Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
69a9ae4
docs: define Phase 2H editor workspace controls
CodePhrex Nov 5, 2026
edb068d
feat: expose project save and open actions in header
CodePhrex Nov 5, 2026
e1050d3
feat: add IconGalleryStudio.tsx
CodePhrex Nov 5, 2026
ed90fdb
feat: add deviceProfile.ts
CodePhrex Nov 5, 2026
395c231
feat: add DeviceDetectionStudio.tsx
CodePhrex Nov 5, 2026
ab9cbde
build: add vector icon and device metadata packages
CodePhrex Nov 5, 2026
40839e8
feat: add DroidUI icon and device workspaces
CodePhrex Nov 5, 2026
0826063
feat: render selected vector icon families on canvas
CodePhrex Nov 5, 2026
9556385
style: organize DroidUI header for compact screens
CodePhrex Nov 5, 2026
3577e25
chore: apply DroidUI product identity to Expo app
CodePhrex Nov 5, 2026
ac61936
fix: insert icons into selected layout without overwriting it
CodePhrex Nov 5, 2026
ba73fda
feat: export vector icon nodes in React Native TSX
CodePhrex Nov 5, 2026
6c944cd
feat: add detected phone to device viewport presets
CodePhrex Nov 5, 2026
ca16653
refactor: avoid runtime viewport dependency in device profile
CodePhrex Nov 5, 2026
0f21f3a
feat: show detected device dimensions in viewport selector
CodePhrex Nov 5, 2026
d8fbf2d
feat: sync detected device profile with preview canvas
CodePhrex Nov 5, 2026
8da0d8f
feat: preview designs on detected device dimensions
CodePhrex Nov 5, 2026
0da22e4
refactor: use typed device profile import for canvas preview
CodePhrex Nov 5, 2026
599d5fc
docs: define DroidUI identity icon gallery and device intelligence
CodePhrex Nov 5, 2026
7ef8543
fix: avoid unnecessary Expo device dependency
CodePhrex Nov 5, 2026
8bdf999
build: synchronize vector icon dependency lockfile
CodePhrex Nov 5, 2026
74300a3
fix: detect Android identity from native platform constants
CodePhrex Nov 5, 2026
3c4be87
docs: align device detection with native platform constants
CodePhrex Nov 5, 2026
b9a2508
fix: correct device profile declaration formatting
CodePhrex Nov 5, 2026
02f26e3
docs: specify interactive canvas color splash audio and event system
CodePhrex Nov 5, 2026
4f64d76
feat: allow starting a project from a complete design preset
CodePhrex Nov 5, 2026
3831a32
feat: add complete editable screens and reusable design kits
CodePhrex Nov 5, 2026
78cae7c
feat: add searchable preset catalog with full-screen apply workflow
CodePhrex Nov 5, 2026
fefeacc
fix: import preset catalog search input
CodePhrex Nov 5, 2026
4bf452e
feat: add reusable rich visual style presets
CodePhrex Nov 5, 2026
681d4b1
feat: add one-tap rich visual styles to component inspector
CodePhrex Nov 5, 2026
bd3b050
docs: define editable design presets and rich styling system
CodePhrex Nov 5, 2026
ec6b729
feat: persist user-created design presets locally
CodePhrex Nov 5, 2026
30d97cc
feat: add live preset previews and personal preset saving
CodePhrex Nov 5, 2026
566d217
feat: add visual design system studio
CodePhrex Nov 5, 2026
1593f45
feat: expose design system studio in editor navigation
CodePhrex Nov 5, 2026
682bd7a
docs: describe design system studio
CodePhrex Nov 5, 2026
098e6ee
feat: add premium component preset collection
CodePhrex Nov 5, 2026
b72a936
docs: plan premium studio feature expansion
CodePhrex Nov 5, 2026
1e22a7e
fix: remove literal newline escape from TypeScript source
CodePhrex Nov 5, 2026
b39bcab
fix: remove literal newline escape from TypeScript source
CodePhrex Nov 5, 2026
52fea7d
fix: remove literal newline escape from TypeScript source
CodePhrex Nov 5, 2026
fa31c69
fix: remove literal newline escape from TypeScript source
CodePhrex Nov 5, 2026
be8398a
ci: run inspection gates on DroidUI editor feature branch
CodePhrex Nov 5, 2026
eee1046
ci: run Android fixture build on DroidUI editor feature branch
CodePhrex Nov 5, 2026
a1857ca
ci: enable DroidUI feature branch APK build and repair verification step
CodePhrex Nov 5, 2026
b4cbde3
ci: execute DroidUI validation on editor feature branch pushes
CodePhrex Nov 5, 2026
482d73a
ci: execute DroidUI validation on editor feature branch pushes
CodePhrex Nov 5, 2026
eda8731
fix: use Expo Android resource helper for splash background
CodePhrex Nov 5, 2026
d3f93d6
ci: use supported Expo prebuild flags
CodePhrex Nov 5, 2026
a02cf11
ci: verify APK label against DroidUI app identity
CodePhrex Nov 5, 2026
6b5969c
ci: increase Gradle heap and limit Android build workers
CodePhrex Nov 5, 2026
8f52f48
ci: increase Gradle heap and limit Android build workers
CodePhrex Nov 5, 2026
a2c5093
fix: correct Gradle memory configuration in Android CI
CodePhrex Nov 5, 2026
e3278c2
fix: correct Gradle memory configuration in Android CI
CodePhrex Nov 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions .github/workflows/android-generated-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: DroidUI Generated Android Build

on:
pull_request:
branches: [main]
branches: [main, feat/phase-2h-editor-workspace-controls]
push:
branches: [main]
branches: [main, feat/phase-2h-editor-workspace-controls]
workflow_dispatch:

permissions:
Expand Down Expand Up @@ -73,6 +73,33 @@ jobs:
with:
gradle-version: '8.7'

- name: Configure Gradle memory for Android CI
working-directory: ${{ runner.temp }}/droidui-generated-android
shell: bash
run: |
python3 - <<'PY'
from pathlib import Path
import re

path = Path("gradle.properties")
content = path.read_text() if path.exists() else ""
heap = "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"
if re.search(r"(?m)^org\.gradle\.jvmargs=.*$", content):
content = re.sub(r"(?m)^org\.gradle\.jvmargs=.*$", heap, content)
else:
content = content.rstrip() + "\n" + heap + "\n"
settings = {
"org.gradle.parallel": "false",
"org.gradle.workers.max": "2",
}
for key, value in settings.items():
content = re.sub(rf"(?m)^{re.escape(key)}=.*$", f"{key}={value}", content)
if not re.search(rf"(?m)^{re.escape(key)}=", content):
content = content.rstrip() + f"\n{key}={value}\n"
path.write_text(content)
print(path.read_text())
PY

- name: Build generated debug and release APKs
working-directory: ${{ runner.temp }}/droidui-generated-android
run: gradle --no-daemon assembleDebug assembleRelease
Expand Down
42 changes: 32 additions & 10 deletions .github/workflows/droidui-dev-apk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ name: DroidUI Real Android Dev APK
on:
workflow_dispatch:
pull_request:
branches: [main]
branches: [main, feat/phase-2h-editor-workspace-controls]
paths:
- 'app/**'
- '.github/workflows/droidui-dev-apk.yml'
push:
branches:
- 'feat/phase-2g-release-integrity'
- 'feat/phase-2h-editor-workspace-controls'

permissions:
contents: read
Expand Down Expand Up @@ -49,7 +50,7 @@ jobs:

- name: Generate native Android project
working-directory: app
run: npx expo prebuild --platform android --non-interactive --no-install
run: npx expo prebuild --platform android --no-install

- name: Set up JDK 17
uses: actions/setup-java@v4
Expand All @@ -67,6 +68,33 @@ jobs:
with:
gradle-version: '8.6'

- name: Configure Gradle memory for Android CI
working-directory: app/android
shell: bash
run: |
python3 - <<'PY'
from pathlib import Path
import re

path = Path("gradle.properties")
content = path.read_text() if path.exists() else ""
heap = "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"
if re.search(r"(?m)^org\.gradle\.jvmargs=.*$", content):
content = re.sub(r"(?m)^org\.gradle\.jvmargs=.*$", heap, content)
else:
content = content.rstrip() + "\n" + heap + "\n"
settings = {
"org.gradle.parallel": "false",
"org.gradle.workers.max": "2",
}
for key, value in settings.items():
content = re.sub(rf"(?m)^{re.escape(key)}=.*$", f"{key}={value}", content)
if not re.search(rf"(?m)^{re.escape(key)}=", content):
content = content.rstrip() + f"\n{key}={value}\n"
path.write_text(content)
print(path.read_text())
PY

- name: Build real DroidUI debug APK
working-directory: app/android
run: gradle --no-daemon assembleDebug
Expand All @@ -89,14 +117,8 @@ jobs:
AAPT="$ANDROID_HOME/build-tools/34.0.0/aapt"
BADGING="$("$AAPT" dump badging "$APK")"
grep -F "package: name='com.codephrex.droidstudio'" <<< "$BADGING"
grep -F "application-label:'Droid Studio UI/UX'" <<< "$BADGING"
unzip -l "$APK" | grep -E 'assets/index.android.bundle uses: actions/upload-artifact@v4
with:
name: droidui-real-dev-apk-${{ github.sha }}
path: app/android/app/build/outputs/apk/debug/app-debug.apk
if-no-files-found: error
retention-days: 14

grep -F "application-label:'DroidUI'" <<< "$BADGING"
unzip -l "$APK" | grep -q 'assets/index.android.bundle'
echo "Verified: this artifact is the DroidUI application, not the generated test fixture."

- name: Upload real DroidUI development APK
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/inspection-gates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: DroidUI Inspection Gates

on:
pull_request:
branches: [main]
branches: [main, feat/phase-2h-editor-workspace-controls]
push:
branches: [main]
branches: [main, feat/phase-2h-editor-workspace-controls]
workflow_dispatch:

permissions:
Expand Down
45 changes: 37 additions & 8 deletions app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ import { generateGitHubActionsYAML } from './src/compiler/cicdPipelineGenerator'
import { UnitTestGeneratorStudio } from './src/components/UnitTestGeneratorStudio';
import { generateJestTestSpec } from './src/compiler/jestTestGenerator';
import React, { useState } from 'react';
import { StyleSheet, Text, View, TouchableOpacity, Modal, ScrollView, SafeAreaView } from 'react-native';
import { IconGalleryStudio } from './src/components/IconGalleryStudio';
import { DeviceDetectionStudio } from './src/components/DeviceDetectionStudio';
import { detectCurrentDeviceProfile } from './src/device/deviceProfile';
import { StyleSheet, Text, View, TouchableOpacity, Modal, ScrollView, SafeAreaView, Alert } from 'react-native';
import { useEditorStore } from './src/store/useEditorStore';
import { CanvasRenderer } from './src/components/CanvasRenderer';
import { PropertyInspector } from './src/components/PropertyInspector';
import { LayerReorderManager } from './src/components/LayerReorderManager';
import { TemplateLibrary } from './src/templates/TemplateLibrary';
import { ThemeManager } from './src/components/ThemeManager';
import { DesignSystemStudio } from './src/components/DesignSystemStudio';
import { ProjectManager } from './src/components/ProjectManager';
import { AssetPickerStudio } from './src/components/AssetPickerStudio';
import { ViewportSelector, VIEWPORTS, ViewportMode } from './src/components/ViewportSelector';
Expand Down Expand Up @@ -49,19 +53,30 @@ export default function App() {
i18nDict,
currentProjectId,
currentProjectName,
saveCurrentProject,
undo,
redo
} = useEditorStore();

const theme = THEMES[currentTheme] || THEMES.dark;
const isLightMode = currentTheme === 'light';

const [activeTab, setActiveTab] = useState<'inspector' | 'deeplink' | 'release' | 'droid_file' | 'svg_importer' | 'store' | 'export_android' | 'splash' | 'sounds' | 'transitions' | 'assets' | 'templates' | 'cicd' | 'tests' | 'profiler' | 'i18n' | 'accessibility' | 'states' | 'spacing' | 'presets' | 'code' | 'font' | 'search' | 'assets' | 'projects' | 'layers' | 'theme' | 'theme_io'>('inspector');
const [activeTab, setActiveTab] = useState<'inspector' | 'deeplink' | 'release' | 'droid_file' | 'svg_importer' | 'store' | 'export_android' | 'splash' | 'sounds' | 'transitions' | 'assets' | 'templates' | 'cicd' | 'tests' | 'profiler' | 'i18n' | 'accessibility' | 'states' | 'spacing' | 'presets' | 'code' | 'font' | 'search' | 'assets' | 'projects' | 'layers' | 'theme' | 'theme_io' | 'design_system' | 'icons' | 'device'>('inspector');
const [activeViewport, setActiveViewport] = useState<ViewportMode>('galaxy_s24_ultra');
const [modalVisible, setModalVisible] = useState(false);
const [codeOutput, setCodeOutput] = useState('');

const currentVP = VIEWPORTS[activeViewport] || VIEWPORTS.galaxy_s24_ultra;
const currentVP = activeViewport === 'detected_device' ? detectCurrentDeviceProfile().viewport : (VIEWPORTS[activeViewport as Exclude<ViewportMode, 'detected_device'>] || VIEWPORTS.galaxy_s24_ultra);

const handleSaveProject = async () => {
try {
await saveCurrentProject(currentProjectName);
Alert.alert('Project Saved', `\"${currentProjectName}\" was saved on this device.`);
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
Alert.alert('Save Failed', message);
}
};

const toggleThemeMode = () => {
setTheme(isLightMode ? 'dark' : 'light');
Expand All @@ -85,13 +100,19 @@ export default function App() {
{/* Studio Top Navigation Header Bar */}
<View style={[styles.navbar, { backgroundColor: theme.bgSurface, borderColor: theme.border }]}>
<View style={styles.brandGroup}>
<Text style={[styles.logoTitle, { color: theme.textPrimary }]}>📱 Droid Mobile Studio</Text>
<Text style={[styles.logoTitle, { color: theme.textPrimary }]}>◈ DroidUI Studio</Text>
<View style={[styles.projectBadge, { backgroundColor: isLightMode ? '#e2e8f0' : '#334155' }]}>
<Text style={[styles.projectBadgeText, { color: theme.textSecondary }]}>{currentProjectName}</Text>
</View>
</View>

<View style={styles.navActions}>
<TouchableOpacity style={[styles.navBtn, { backgroundColor: isLightMode ? '#e2e8f0' : '#334155' }]} onPress={() => setActiveTab('projects')}>
<Text style={[styles.navBtnText, { color: theme.textPrimary }]}>📂 Open</Text>
</TouchableOpacity>
<TouchableOpacity style={[styles.navBtn, { backgroundColor: isLightMode ? '#e2e8f0' : '#334155' }]} onPress={handleSaveProject}>
<Text style={[styles.navBtnText, { color: theme.textPrimary }]}>💾 Save</Text>
</TouchableOpacity>
{/* Light / Dark UI Toggle Switch */}
<TouchableOpacity
style={[styles.themeToggleBtn, { backgroundColor: isLightMode ? '#3b82f6' : '#334155', borderColor: theme.border }]}
Expand Down Expand Up @@ -136,6 +157,8 @@ export default function App() {
<TouchableOpacity style={[styles.tab, activeTab === 'deeplink' && styles.activeTab]} onPress={() => setActiveTab('deeplink')}>
<Text style={[styles.tabText, { color: activeTab === 'deeplink' ? theme.primary : theme.textSecondary }]}>🔗 Deep Links & Icons</Text>
</TouchableOpacity>
<TouchableOpacity style={[styles.tab, activeTab === 'icons' && styles.activeTab]} onPress={() => setActiveTab('icons')}><Text style={[styles.tabText, { color: activeTab === 'icons' ? theme.primary : theme.textSecondary }]}>✣ Icon Gallery</Text></TouchableOpacity>
<TouchableOpacity style={[styles.tab, activeTab === 'device' && styles.activeTab]} onPress={() => setActiveTab('device')}><Text style={[styles.tabText, { color: activeTab === 'device' ? theme.primary : theme.textSecondary }]}>▣ Detect Device</Text></TouchableOpacity>
<TouchableOpacity style={[styles.tab, activeTab === 'inspector' && styles.activeTab]} onPress={() => setActiveTab('inspector')}>
<Text style={[styles.tabText, { color: activeTab === 'inspector' ? theme.primary : theme.textSecondary }]}>🎨 Inspector</Text>
</TouchableOpacity>
Expand Down Expand Up @@ -214,8 +237,13 @@ export default function App() {
<TouchableOpacity style={[styles.tab, activeTab === 'theme' && styles.activeTab]} onPress={() => setActiveTab('theme')}>
<Text style={[styles.tabText, { color: activeTab === 'theme' ? theme.primary : theme.textSecondary }]}>⚙️ Theme</Text>
</TouchableOpacity>
<TouchableOpacity style={[styles.tab, activeTab === 'design_system' && styles.activeTab]} onPress={() => setActiveTab('design_system')}>
<Text style={[styles.tabText, { color: activeTab === 'design_system' ? theme.primary : theme.textSecondary }]}>🎨 Design System</Text>
</TouchableOpacity>
</ScrollView>

{activeTab === 'icons' && <IconGalleryStudio />}
{activeTab === 'device' && <DeviceDetectionStudio onDetected={() => setActiveViewport('detected_device')} />}
{activeTab === 'inspector' && <PropertyInspector />}
{activeTab === 'deeplink' && <DeepLinkAndIconStudio />}
{activeTab === 'release' && <ReleaseVersionStudio />}
Expand Down Expand Up @@ -243,6 +271,7 @@ export default function App() {
{activeTab === 'projects' && <ProjectManager />}
{activeTab === 'layers' && <LayerReorderManager />}
{activeTab === 'theme' && <ThemeManager />}
{activeTab === 'design_system' && <DesignSystemStudio />}
</View>
</View>

Expand Down Expand Up @@ -277,12 +306,12 @@ export default function App() {

const styles = StyleSheet.create({
container: { flex: 1 },
navbar: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', padding: 10, borderBottomWidth: 1 },
brandGroup: { flexDirection: 'row', alignItems: 'center', gap: 8 },
logoTitle: { fontSize: 15, fontWeight: 'bold' },
navbar: { flexDirection: 'column', justifyContent: 'center', alignItems: 'stretch', paddingHorizontal: 12, paddingVertical: 10, borderBottomWidth: 1, gap: 8 },
brandGroup: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', gap: 8, width: '100%' },
logoTitle: { fontSize: 17, fontWeight: '900', letterSpacing: 0.3 },
projectBadge: { paddingHorizontal: 8, paddingVertical: 3, borderRadius: 12 },
projectBadgeText: { fontSize: 10, fontWeight: 'bold' },
navActions: { flexDirection: 'row', alignItems: 'center', gap: 6 },
navActions: { flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-end', flexWrap: 'wrap', gap: 6, width: '100%' },
themeToggleBtn: { borderWidth: 1, paddingHorizontal: 10, paddingVertical: 5, borderRadius: 20 },
themeToggleText: { color: '#ffffff', fontSize: 11, fontWeight: 'bold' },
navBtn: { paddingHorizontal: 10, paddingVertical: 6, borderRadius: 6 },
Expand Down
4 changes: 2 additions & 2 deletions app/app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"expo": {
"name": "Droid Studio UI/UX",
"slug": "droid-studio-ui-ux",
"name": "DroidUI",
"slug": "droidui",
"version": "7.0.0",
"orientation": "portrait",
"userInterfaceStyle": "dark",
Expand Down
3 changes: 2 additions & 1 deletion app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"react-native-reanimated": "~3.6.2",
"react-native-svg": "14.1.0",
"zustand": "^4.5.0",
"expo-clipboard": "~5.0.1"
"expo-clipboard": "~5.0.1",
"@expo/vector-icons": "^14.0.0"
},
"devDependencies": {
"@babel/core": "^7.20.0",
Expand Down
24 changes: 10 additions & 14 deletions app/plugins/withAndroidSplashBackground.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
'use strict';

const { withAndroidColors } = require('@expo/config-plugins');
const { AndroidConfig, withAndroidColors } = require('@expo/config-plugins');

const SPLASH_BACKGROUND_COLOR = '#080D1F';
const SPLASH_BACKGROUND_RESOURCE = 'splashscreen_background';

module.exports = function withAndroidSplashBackground(config) {
return withAndroidColors(config, (modConfig) => {
const resources = modConfig.modResults.resources || [];
const existing = resources.find(
(resource) => resource.$ && resource.$.name === 'splashscreen_background'
modConfig.modResults = AndroidConfig.Colors.assignColorValue(
modConfig.modResults,
{
name: SPLASH_BACKGROUND_RESOURCE,
value: SPLASH_BACKGROUND_COLOR
}
);

if (existing) {
existing._ = '#0B1020';
} else {
resources.push({
$: { name: 'splashscreen_background' },
_: '#0B1020'
});
}

modConfig.modResults.resources = resources;
return modConfig;
});
};
8 changes: 8 additions & 0 deletions app/src/compiler/codeExporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ export const generateReactNativeTSX = (rootNode: ComponentNode): string => {
return `${indent}<View style={${styleStr}}${accStr}>\n${childrenCode}\n${indent}</View>`;
}

if (node.type === 'Icon') {
const family = ['MaterialCommunityIcons', 'MaterialIcons', 'Ionicons', 'Feather', 'FontAwesome5', 'AntDesign'].includes(node.props?.iconLibrary) ? node.props.iconLibrary : 'MaterialCommunityIcons';
const name = String(node.props?.iconName || 'help-circle').replace(/"/g, '&quot;');
const color = String(node.style?.color || '#3b82f6').replace(/"/g, '&quot;');
return indent + '<' + family + ' name="' + name + '" size={' + (node.style?.fontSize || 28) + '} color="' + color + '" style={' + styleStr + '}' + accStr + ' />';
}

if (node.type === 'Text') {
return `${indent}<Text style={${styleStr}}${accStr}>${node.props?.text || 'Text'}</Text>`;
}
Expand Down Expand Up @@ -89,6 +96,7 @@ export const generateReactNativeTSX = (rootNode: ComponentNode): string => {
return `import React from 'react';
import { View, Text, TouchableOpacity, TextInput, Switch, StyleSheet } from 'react-native';
import { SvgXml } from 'react-native-svg';
import { MaterialCommunityIcons, MaterialIcons, Ionicons, Feather, FontAwesome5, AntDesign } from '@expo/vector-icons';
import Animated, { FadeIn, SpringIn } from 'react-native-reanimated';

export default function ExportedUI() {
Expand Down
12 changes: 11 additions & 1 deletion app/src/components/CanvasRenderer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import { View, Text, TouchableOpacity, Image, StyleSheet } from 'react-native';
import { SvgXml } from 'react-native-svg';
import { MaterialCommunityIcons, MaterialIcons, Ionicons, Feather, FontAwesome5, AntDesign } from '@expo/vector-icons';
import { ComponentNode } from '../types/schema';
import { useEditorStore } from '../store/useEditorStore';
import { playSoundEffect } from '../audio/soundSynthesizer';
Expand Down Expand Up @@ -67,7 +68,16 @@ export const CanvasRenderer: React.FC<Props> = ({ node }) => {

if (node.type === 'Image') return wrap(node.props?.imageUri ? <Image source={{ uri: node.props.imageUri }} style={[{ width: '100%', height: node.style.height || 140 }, node.style]} resizeMode="cover" /> : <View style={[styles.imagePlaceholder, node.style]}><Text style={styles.muted}>📷 Image Placeholder</Text></View>, { borderRadius: node.style.borderRadius || 8, overflow: 'hidden', marginVertical: 4 });

if (node.type === 'Icon') return wrap(<Text style={{ fontSize: node.style.fontSize || 28, color: node.style.color || '#3b82f6' }}>{node.props?.iconSymbol || '❖'}</Text>, { padding: 4, borderRadius: 6, marginVertical: 2 });
if (node.type === 'Icon') {
const iconLibraries: Record<string, any> = { MaterialCommunityIcons, MaterialIcons, Ionicons, Feather, FontAwesome5, AntDesign };
const IconSet = iconLibraries[node.props?.iconLibrary || 'MaterialCommunityIcons'] || MaterialCommunityIcons;
return wrap(
node.props?.iconName
? <IconSet name={node.props.iconName} size={node.style.fontSize || 28} color={node.style.color || '#3b82f6'} />
: <Text style={{ fontSize: node.style.fontSize || 28, color: node.style.color || '#3b82f6' }}>{node.props?.iconSymbol || '❖'}</Text>,
{ padding: 4, borderRadius: 6, marginVertical: 2 }
);
}

if (node.type === 'Button') return wrap(<Text style={{ color: (activeSimMode === 'pressed' && node.pressState?.pressedTextColor) || node.style.color || '#fff', fontWeight: node.style.fontWeight || 'bold', fontSize: node.style.fontSize || 14, fontFamily: node.style.fontFamily }}>{text(node.props?.label || 'Button', node.props?.i18nKey)}</Text>, styles.button);

Expand Down
Loading
Loading