@decido/shell 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/.turbo/turbo-build.log +13 -0
  2. package/package.json +65 -0
  3. package/src/AgentPlayer.tsx +105 -0
  4. package/src/DecidoPlayer.tsx +117 -0
  5. package/src/bridge/BridgeAgent.ts +443 -0
  6. package/src/components/DecidoIcon.tsx +56 -0
  7. package/src/components/JsonTreeEditor.tsx +117 -0
  8. package/src/components/PanelSplitter.tsx +71 -0
  9. package/src/components/PluginErrorBoundary.tsx +69 -0
  10. package/src/components/SafeLiquidUI.tsx +114 -0
  11. package/src/components/TransientLayer.tsx +92 -0
  12. package/src/components/agent/AgentChat.tsx +134 -0
  13. package/src/components/chat-extensions/IntentCatalogPanel.tsx +81 -0
  14. package/src/components/chat-extensions/chatSlashCommands.ts +101 -0
  15. package/src/components/controls/CreatorInputBar.tsx +144 -0
  16. package/src/components/controls/OSToolbar.tsx +90 -0
  17. package/src/components/controls/TimelineTape.tsx +43 -0
  18. package/src/components/debug/ActionTimelineTab.tsx +111 -0
  19. package/src/components/debug/CSSInspectorTab.tsx +436 -0
  20. package/src/components/debug/ExportTab.tsx +192 -0
  21. package/src/components/debug/FlowHealthTab.tsx +86 -0
  22. package/src/components/debug/LogsTab.tsx +110 -0
  23. package/src/components/debug/MorphStackTab.tsx +241 -0
  24. package/src/components/debug/NetworkTab.tsx +173 -0
  25. package/src/components/debug/PerformanceTab.tsx +171 -0
  26. package/src/components/debug/ProfilesTab.tsx +238 -0
  27. package/src/components/debug/ReplayTab.tsx +70 -0
  28. package/src/components/debug/StoresTab.tsx +255 -0
  29. package/src/components/debug/TopologyTab.tsx +59 -0
  30. package/src/components/debug/debugConfig.tsx +66 -0
  31. package/src/components/playground/DebugPanel.tsx +112 -0
  32. package/src/components/playground/HeaderCenterControls.tsx +92 -0
  33. package/src/components/playground/KeyframeListItem.tsx +70 -0
  34. package/src/components/playground/PlaygroundAppSidebar.tsx +171 -0
  35. package/src/components/playground/PlaygroundBottomControls.tsx +132 -0
  36. package/src/components/playground/PlaygroundCanvas.tsx +87 -0
  37. package/src/components/playground/PlaygroundChat.tsx +236 -0
  38. package/src/components/playground/PlaygroundErrorBoundary.tsx +63 -0
  39. package/src/components/playground/PlaygroundFloatingInput.tsx +352 -0
  40. package/src/components/playground/PlaygroundHeader.tsx +222 -0
  41. package/src/components/playground/PlaygroundSidebar.tsx +136 -0
  42. package/src/components/playground/PlaygroundTerminal.tsx +44 -0
  43. package/src/components/playground/SuggestionCards.tsx +29 -0
  44. package/src/components/playground/demos/ClinicaAINode.tsx +221 -0
  45. package/src/components/playground/demos/FinanceAINode.tsx +226 -0
  46. package/src/components/playground/demos/KiaAcademyNode.tsx +250 -0
  47. package/src/components/playground/demos/KiaBotNode.tsx +207 -0
  48. package/src/components/playground/demos/KiaCampaignNode.tsx +191 -0
  49. package/src/components/playground/demos/KiaComplianceNode.tsx +140 -0
  50. package/src/components/playground/demos/KiaCustomerJourneyNode.tsx +220 -0
  51. package/src/components/playground/demos/KiaCyberNode.tsx +203 -0
  52. package/src/components/playground/demos/KiaDashboardNode.tsx +399 -0
  53. package/src/components/playground/demos/KiaEmbudoOverviewNode.tsx +168 -0
  54. package/src/components/playground/demos/KiaExecutiveNode.tsx +169 -0
  55. package/src/components/playground/demos/KiaGamificationNode.tsx +229 -0
  56. package/src/components/playground/demos/KiaIntelligenceHubNode.tsx +165 -0
  57. package/src/components/playground/demos/KiaInventoryNode.tsx +183 -0
  58. package/src/components/playground/demos/KiaLeadScoringNode.tsx +226 -0
  59. package/src/components/playground/demos/KiaLiveSimulationNode.tsx +177 -0
  60. package/src/components/playground/demos/KiaMultiDealerNode.tsx +223 -0
  61. package/src/components/playground/demos/KiaNPSVoiceNode.tsx +214 -0
  62. package/src/components/playground/demos/KiaOmnichannelNode.tsx +162 -0
  63. package/src/components/playground/demos/KiaPBIBudgetNode.tsx +152 -0
  64. package/src/components/playground/demos/KiaPBIConversionNode.tsx +206 -0
  65. package/src/components/playground/demos/KiaPBIFunnelNode.tsx +184 -0
  66. package/src/components/playground/demos/KiaPBIOwnershipNode.tsx +113 -0
  67. package/src/components/playground/demos/KiaPBIPartnerNode.tsx +143 -0
  68. package/src/components/playground/demos/KiaPBIPreciosNode.tsx +120 -0
  69. package/src/components/playground/demos/KiaPBIRuntNode.tsx +205 -0
  70. package/src/components/playground/demos/KiaPartnerScoreNode.tsx +206 -0
  71. package/src/components/playground/demos/KiaPredictiveNode.tsx +226 -0
  72. package/src/components/playground/demos/KiaShowroomNode.tsx +194 -0
  73. package/src/components/playground/demos/KiaStoreNode.tsx +215 -0
  74. package/src/components/playground/demos/KiaSustainabilityNode.tsx +173 -0
  75. package/src/components/playground/demos/KiaUsedVehiclesNode.tsx +163 -0
  76. package/src/components/playground/demos/KiaWorkshopNode.tsx +221 -0
  77. package/src/components/playground/demos/SmartCityNode.tsx +205 -0
  78. package/src/components/playground/demos/kia_campaign_manifest.json +112 -0
  79. package/src/components/playground/input-parts/AIModelSelector.tsx +156 -0
  80. package/src/components/playground/input-parts/InputActions.tsx +80 -0
  81. package/src/components/playground/input-parts/InputToolbar.tsx +245 -0
  82. package/src/components/playground/input-parts/ResourceLibraryPanel.tsx +287 -0
  83. package/src/components/playground/sidebarDsdIO.ts +82 -0
  84. package/src/components/settings/SettingsPanel.tsx +267 -0
  85. package/src/components/shell/AppHeader.tsx +9 -0
  86. package/src/components/shell/AppShell.tsx +139 -0
  87. package/src/components/shell/ArtifactBar.tsx +97 -0
  88. package/src/components/shell/BootScreen.tsx +19 -0
  89. package/src/components/shell/CenterComposite.tsx +87 -0
  90. package/src/components/shell/CodeEditorPanel.tsx +88 -0
  91. package/src/components/shell/GlobalOverlays.tsx +228 -0
  92. package/src/components/shell/LayoutConfigurator.tsx +209 -0
  93. package/src/components/shell/LayoutGrid.tsx +178 -0
  94. package/src/components/shell/MorphShell.tsx +368 -0
  95. package/src/components/shell/PluginViewer.tsx +147 -0
  96. package/src/components/shell/ShellNexusPreview.tsx +458 -0
  97. package/src/components/shell/SlotRenderer.tsx +115 -0
  98. package/src/components/shell/TabBar.tsx +94 -0
  99. package/src/components/shell/TemplateLibrary.tsx +195 -0
  100. package/src/components/shell/layoutConstants.ts +35 -0
  101. package/src/components/shell/morphStageMeta.ts +15 -0
  102. package/src/components/shell/shells/BuiltInShells.tsx +443 -0
  103. package/src/components/shell/shells/DatawayChatShell.tsx +42 -0
  104. package/src/components/shell/shells/TokenPreview.tsx +339 -0
  105. package/src/components/shell/shells/bootShells.ts +31 -0
  106. package/src/components/shells/CreatorShell.tsx +37 -0
  107. package/src/components/shells/DecidoShell.tsx +447 -0
  108. package/src/components/shells/ExperimentalChatShell.tsx +245 -0
  109. package/src/components/shells/UserCanvas.tsx +44 -0
  110. package/src/components/studio/BlueprintManagerPanel.tsx +137 -0
  111. package/src/components/studio/DependencyTreePanel.tsx +192 -0
  112. package/src/components/studio/NodePalette.tsx +92 -0
  113. package/src/components/studio/NodePropertiesPanel.tsx +81 -0
  114. package/src/components/studio/ReactFlowEditor.tsx +242 -0
  115. package/src/components/studio/TimelineEditor.tsx +122 -0
  116. package/src/components/studio/TimelineKeyframeCard.tsx +99 -0
  117. package/src/components/studio/VariablePanel.tsx +181 -0
  118. package/src/components/studio/blueprint/BlueprintCard.tsx +82 -0
  119. package/src/components/studio/editor/CanvasContextMenu.tsx +107 -0
  120. package/src/components/studio/editor/EditorToolbar.tsx +80 -0
  121. package/src/components/studio/editor/StageContentRenderer.tsx +134 -0
  122. package/src/components/studio/editor/TrackPropertyEditors.tsx +133 -0
  123. package/src/components/studio/editor/TreeNodeItem.tsx +91 -0
  124. package/src/components/studio/editor/edgeStyles.ts +43 -0
  125. package/src/components/studio/editor/editorKeyHandler.ts +95 -0
  126. package/src/components/studio/editor/nodeTypeRegistry.ts +137 -0
  127. package/src/components/studio/editor/paletteCatalog.tsx +84 -0
  128. package/src/components/studio/nodes/shell/InteractionNodes.tsx +82 -0
  129. package/src/components/studio/nodes/shell/LayoutControlNodes.tsx +69 -0
  130. package/src/components/studio/nodes/shell/RegisterActionNode.tsx +20 -0
  131. package/src/components/studio/nodes/shell/RegisterButtonNode.tsx +22 -0
  132. package/src/components/studio/nodes/shell/RegisterPanelNode.tsx +19 -0
  133. package/src/components/studio/nodes/shell/RegisterSidebarNode.tsx +19 -0
  134. package/src/components/studio/nodes/shell/RegisterStatusBarNode.tsx +22 -0
  135. package/src/components/studio/nodes/shell/RegisterTabNode.tsx +21 -0
  136. package/src/components/studio/nodes/shell/RegisterTopBarNode.tsx +22 -0
  137. package/src/components/studio/nodes/shell/ShellConfigNode.tsx +51 -0
  138. package/src/components/studio/nodes/shell/ShellNodeBase.tsx +100 -0
  139. package/src/components/studio/nodes/shell/ThemeNodes.tsx +51 -0
  140. package/src/components/studio/nodes/shell/index.ts +12 -0
  141. package/src/components/widgets/BroadcastWidget.tsx +93 -0
  142. package/src/components/widgets/MarketplaceWidget.tsx +298 -0
  143. package/src/components/widgets/McpToolsWidget.tsx +231 -0
  144. package/src/components/widgets/OpsDashboard.tsx +59 -0
  145. package/src/components/widgets/QuickActionsWidget.tsx +60 -0
  146. package/src/components/widgets/UsageWidget.tsx +112 -0
  147. package/src/components/widgets/WidgetRenderer.tsx +892 -0
  148. package/src/components/widgets/WidgetSlotPanel.tsx +213 -0
  149. package/src/config/IconRegistry.ts +126 -0
  150. package/src/contexts/NetworkProvider.tsx +162 -0
  151. package/src/core/AIDirector.ts +71 -0
  152. package/src/core/EventBus.ts +37 -0
  153. package/src/core/PluginContext.tsx +141 -0
  154. package/src/hooks/listeners/useUIStateListener.ts +59 -0
  155. package/src/hooks/listeners/useWhatsAppListener.ts +110 -0
  156. package/src/hooks/morphBridge.ts +82 -0
  157. package/src/hooks/useAIModelSelector.ts +144 -0
  158. package/src/hooks/useAgentStream.ts +220 -0
  159. package/src/hooks/useAutoUpdater.ts +89 -0
  160. package/src/hooks/useBootSequence.ts +20 -0
  161. package/src/hooks/useExportDSD.ts +53 -0
  162. package/src/hooks/useFullscreen.ts +35 -0
  163. package/src/hooks/useGeminiStream.ts +282 -0
  164. package/src/hooks/useIntentLens.ts +224 -0
  165. package/src/hooks/useKeyboardShortcuts.ts +69 -0
  166. package/src/hooks/useLoggerBridge.ts +32 -0
  167. package/src/hooks/useMcpClient.ts +112 -0
  168. package/src/hooks/useNexusaiDeploy.ts +118 -0
  169. package/src/hooks/usePlaybackEngine.ts +21 -0
  170. package/src/hooks/usePlaygroundCommander.ts +475 -0
  171. package/src/hooks/usePluginEngine.ts +165 -0
  172. package/src/hooks/useScreenRecorder.ts +73 -0
  173. package/src/hooks/useShellKeyboard.ts +40 -0
  174. package/src/hooks/useShellShortcuts.ts +118 -0
  175. package/src/hooks/useSoundEffects.ts +35 -0
  176. package/src/hooks/useStudioConfig.ts +72 -0
  177. package/src/hooks/useSystemBoot.ts +84 -0
  178. package/src/hooks/useSystemTelemetry.ts +62 -0
  179. package/src/index.ts +97 -0
  180. package/src/lib/debugLogger.ts +80 -0
  181. package/src/lib/networkInterceptor.ts +100 -0
  182. package/src/mocks/decido.tsx +41 -0
  183. package/src/plugins/pluginAPI.ts +190 -0
  184. package/src/store/McpStore.ts +69 -0
  185. package/src/store/UpdaterStore.ts +60 -0
  186. package/src/store/engine.ts +392 -0
  187. package/src/store/index.ts +4 -0
  188. package/src/store/layoutPresets.ts +66 -0
  189. package/src/store/playgroundTypes.ts +98 -0
  190. package/src/store/useActionTimelineStore.ts +48 -0
  191. package/src/store/useDebugPanelStore.ts +98 -0
  192. package/src/store/useDebugProfileStore.ts +130 -0
  193. package/src/store/useLayoutStore.ts +205 -0
  194. package/src/store/useMorphInstanceStore.ts +289 -0
  195. package/src/store/useMorphologyStore.ts +103 -0
  196. package/src/store/usePlaygroundStore.ts +236 -0
  197. package/src/store/useShellRegistry.ts +123 -0
  198. package/src/store/useSuggestionsStore.ts +57 -0
  199. package/src/store/useThemeStore.ts +399 -0
  200. package/src/store/useUIComponentStore.ts +179 -0
  201. package/src/types/DecidoStoryDefinition.ts +43 -0
  202. package/src/utils/ai/ai-architect.ts +92 -0
  203. package/src/utils/ai/ai-code.ts +187 -0
  204. package/src/utils/ai/ai-core.ts +50 -0
  205. package/src/utils/ai/ai-media.ts +292 -0
  206. package/src/utils/layoutGraph.ts +67 -0
  207. package/tsconfig.json +17 -0
  208. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,339 @@
1
+ /**
2
+ * TokenPreview — Design System Showroom v2.
3
+ * Registered as 'shell-theme-editor'.
4
+ *
5
+ * Premium theme editor with live component preview,
6
+ * powered by @decido/ui-kit useTheme store.
7
+ */
8
+ import React, { useState, useCallback } from 'react';
9
+ import { useTheme, THEME_PRESETS, type ThemePreset, type ThemeTokens } from '../../../store/useThemeStore';
10
+
11
+ // ── Token Groups for Editor ──
12
+
13
+ interface TokenDef { key: keyof ThemeTokens; label: string; }
14
+ interface TokenGroup { title: string; icon: string; tokens: TokenDef[]; }
15
+
16
+ const TOKEN_GROUPS: TokenGroup[] = [
17
+ {
18
+ title: 'Surfaces', icon: '◻️', tokens: [
19
+ { key: 'surface-primary', label: 'Primary' },
20
+ { key: 'surface-secondary', label: 'Secondary' },
21
+ { key: 'surface-tertiary', label: 'Tertiary' },
22
+ { key: 'surface-elevated', label: 'Elevated' },
23
+ ]
24
+ },
25
+ {
26
+ title: 'Text', icon: '✏️', tokens: [
27
+ { key: 'text-primary', label: 'Primary' },
28
+ { key: 'text-secondary', label: 'Secondary' },
29
+ { key: 'text-muted', label: 'Muted' },
30
+ ]
31
+ },
32
+ {
33
+ title: 'Accents', icon: '💎', tokens: [
34
+ { key: 'accent-blue', label: 'Blue' },
35
+ { key: 'accent-purple', label: 'Purple' },
36
+ { key: 'accent-green', label: 'Green' },
37
+ { key: 'accent-red', label: 'Red' },
38
+ { key: 'accent-amber', label: 'Amber' },
39
+ { key: 'accent-cyan', label: 'Cyan' },
40
+ ]
41
+ },
42
+ {
43
+ title: 'Borders', icon: '▬', tokens: [
44
+ { key: 'border-subtle', label: 'Subtle' },
45
+ { key: 'border-default', label: 'Default' },
46
+ { key: 'border-strong', label: 'Strong' },
47
+ { key: 'border-glow', label: 'Glow' },
48
+ ]
49
+ },
50
+ {
51
+ title: 'Status', icon: '●', tokens: [
52
+ { key: 'status-ok', label: 'Success' },
53
+ { key: 'status-warn', label: 'Warning' },
54
+ { key: 'status-error', label: 'Error' },
55
+ { key: 'status-info', label: 'Info' },
56
+ ]
57
+ },
58
+ ];
59
+
60
+ type TabId = 'themes' | 'tokens' | 'showroom';
61
+
62
+ // ── Token Swatch ──
63
+
64
+ function TokenSwatch({ tokenKey, label }: { tokenKey: keyof ThemeTokens; label: string }) {
65
+ const { getCurrentPreset, setToken } = useTheme();
66
+ const preset = getCurrentPreset();
67
+ const value = preset.tokens[tokenKey];
68
+
69
+ return (
70
+ <div className="flex items-center gap-2 py-1.5 px-2 rounded-lg bg-surface-glass hover:bg-surface-elevated/50 transition-colors group">
71
+ <div className="relative w-6 h-6 shrink-0">
72
+ <div className="w-6 h-6 rounded-md border border-border-default" style={{ background: value }} />
73
+ <input type="color"
74
+ value={value.startsWith('#') ? value : '#888888'}
75
+ onChange={e => setToken(tokenKey, e.target.value)}
76
+ className="absolute inset-0 opacity-0 w-full h-full cursor-pointer" />
77
+ </div>
78
+ <div className="flex-1 min-w-0">
79
+ <div className="text-[11px] font-semibold text-text-primary truncate">{label}</div>
80
+ <div className="text-[9px] text-text-muted font-mono">--ds-{tokenKey}</div>
81
+ </div>
82
+ <span className="text-[10px] text-text-muted font-mono opacity-0 group-hover:opacity-100 transition-opacity">
83
+ {value.slice(0, 9)}
84
+ </span>
85
+ </div>
86
+ );
87
+ }
88
+
89
+ // ── Theme Preset Card ──
90
+
91
+ function PresetCard({ preset, isActive, onSelect }: { preset: ThemePreset; isActive: boolean; onSelect: () => void }) {
92
+ return (
93
+ <button onClick={onSelect}
94
+ className={`flex flex-col items-center gap-2 p-3 rounded-xl border transition-all duration-200 cursor-pointer ${isActive
95
+ ? 'border-accent-purple bg-accent-purple/10 shadow-glow-sm'
96
+ : 'border-border-subtle bg-surface-glass hover:border-border-default hover:bg-surface-elevated/30'
97
+ }`}>
98
+ {/* Color dots preview */}
99
+ <div className="flex gap-1">
100
+ {[preset.preview.bg, preset.preview.accent, preset.preview.text].map((c, i) => (
101
+ <div key={i} className="w-3 h-3 rounded-full border border-border-subtle" style={{ background: c }} />
102
+ ))}
103
+ </div>
104
+ <span className="text-[10px] font-medium text-text-secondary">{preset.name}</span>
105
+ </button>
106
+ );
107
+ }
108
+
109
+ // ── Component Showroom ──
110
+
111
+ function ComponentShowroom() {
112
+ return (
113
+ <div className="flex flex-col gap-4 p-3">
114
+ {/* Buttons */}
115
+ <ShowSection title="Buttons">
116
+ <div className="flex flex-wrap gap-2">
117
+ <button className="px-4 py-2 bg-accent-purple text-text-inverse rounded-lg text-xs font-semibold hover:opacity-90 transition-opacity">
118
+ Primary
119
+ </button>
120
+ <button className="px-4 py-2 bg-surface-glass border border-border-default text-text-primary rounded-lg text-xs font-semibold hover:bg-surface-elevated transition-colors">
121
+ Secondary
122
+ </button>
123
+ <button className="px-4 py-2 bg-accent-red/10 text-accent-red border border-accent-red/20 rounded-lg text-xs font-semibold hover:bg-accent-red/20 transition-colors">
124
+ Destructive
125
+ </button>
126
+ <button className="px-3 py-1.5 text-text-secondary text-xs hover:text-text-primary transition-colors">
127
+ Ghost
128
+ </button>
129
+ </div>
130
+ </ShowSection>
131
+
132
+ {/* Cards */}
133
+ <ShowSection title="Cards">
134
+ <div className="surface-card p-4">
135
+ <div className="text-sm font-semibold text-text-primary mb-1">Glass Card</div>
136
+ <div className="text-xs text-text-secondary">Surface secondary con border subtle y hover.</div>
137
+ </div>
138
+ <div className="glass-panel rounded-xl p-4 mt-2">
139
+ <div className="text-sm font-semibold text-text-primary mb-1">Glass Panel</div>
140
+ <div className="text-xs text-text-secondary">Overlay + backdrop blur + border default.</div>
141
+ </div>
142
+ </ShowSection>
143
+
144
+ {/* Inputs */}
145
+ <ShowSection title="Inputs">
146
+ <input type="text" placeholder="Escribe algo..."
147
+ className="w-full px-3 py-2 bg-surface-primary border border-border-default rounded-lg text-sm text-text-primary placeholder:text-text-muted focus:border-accent-purple focus:ring-1 focus:ring-accent-purple/30 outline-hidden transition-all" />
148
+ <div className="flex gap-2 mt-2">
149
+ <input type="text" value="Readonly" readOnly
150
+ className="flex-1 px-3 py-2 bg-surface-glass border border-border-subtle rounded-lg text-sm text-text-secondary" />
151
+ <select className="px-3 py-2 bg-surface-primary border border-border-default rounded-lg text-sm text-text-primary outline-hidden">
152
+ <option>Opción A</option>
153
+ <option>Opción B</option>
154
+ </select>
155
+ </div>
156
+ </ShowSection>
157
+
158
+ {/* Badges */}
159
+ <ShowSection title="Badges & Status">
160
+ <div className="flex flex-wrap gap-2">
161
+ <span className="px-2 py-0.5 bg-status-ok/10 text-status-ok border border-status-ok/20 rounded-full text-[10px] font-semibold">Active</span>
162
+ <span className="px-2 py-0.5 bg-status-warn/10 text-status-warn border border-status-warn/20 rounded-full text-[10px] font-semibold">Pending</span>
163
+ <span className="px-2 py-0.5 bg-status-error/10 text-status-error border border-status-error/20 rounded-full text-[10px] font-semibold">Error</span>
164
+ <span className="px-2 py-0.5 bg-status-info/10 text-status-info border border-status-info/20 rounded-full text-[10px] font-semibold">Info</span>
165
+ <span className="px-2 py-0.5 bg-accent-purple/10 text-accent-purple border border-accent-purple/20 rounded-full text-[10px] font-semibold">Plugin</span>
166
+ </div>
167
+ </ShowSection>
168
+
169
+ {/* Chat Bubbles */}
170
+ <ShowSection title="Chat Bubbles">
171
+ <div className="flex flex-col gap-2">
172
+ <div className="self-end max-w-[80%] px-3 py-2 bg-accent-purple/10 border border-accent-purple/20 rounded-2xl rounded-br-sm">
173
+ <div className="text-xs text-text-primary">Hola, ¿cómo puedo ayudarte hoy?</div>
174
+ </div>
175
+ <div className="self-start max-w-[80%] px-3 py-2 bg-surface-glass border border-border-subtle rounded-2xl rounded-bl-sm">
176
+ <div className="text-xs text-text-primary">Muestra el dashboard de ventas</div>
177
+ </div>
178
+ <div className="self-end max-w-[80%] px-3 py-2 bg-accent-blue/10 border border-accent-blue/20 rounded-2xl rounded-br-sm">
179
+ <span className="inline-flex items-center gap-1 text-xs text-accent-blue font-medium">
180
+ ● Generando diseño web...
181
+ </span>
182
+ </div>
183
+ </div>
184
+ </ShowSection>
185
+
186
+ {/* Typography */}
187
+ <ShowSection title="Typography">
188
+ <h1 className="text-xl font-bold text-text-primary">Heading Primary</h1>
189
+ <h2 className="text-base font-semibold text-text-secondary">Heading Secondary</h2>
190
+ <p className="text-sm text-text-secondary mt-1">Body text con color secundario para contenido descriptivo.</p>
191
+ <p className="text-xs text-text-muted mt-1">Caption text en muted para metadata y timestamps.</p>
192
+ <p className="text-sm text-gradient font-bold mt-2">✦ Gradient text premium</p>
193
+ </ShowSection>
194
+
195
+ {/* Color Palette */}
196
+ <ShowSection title="Accent Palette">
197
+ <div className="grid grid-cols-6 gap-1">
198
+ {['accent-blue', 'accent-purple', 'accent-green', 'accent-red', 'accent-amber', 'accent-cyan'].map(c => (
199
+ <div key={c} className="flex flex-col items-center gap-1">
200
+ <div className={`w-8 h-8 rounded-lg bg-${c}`} />
201
+ <span className="text-[8px] text-text-muted">{c.split('-')[1]}</span>
202
+ </div>
203
+ ))}
204
+ </div>
205
+ </ShowSection>
206
+
207
+ {/* Node Preview */}
208
+ <ShowSection title="Graph Nodes">
209
+ <div className="flex gap-2">
210
+ {[
211
+ { name: 'Dialogue', border: 'border-accent-purple/30', header: 'bg-accent-purple/10' },
212
+ { name: 'Logic', border: 'border-accent-amber/30', header: 'bg-accent-amber/10' },
213
+ { name: 'State', border: 'border-accent-cyan/30', header: 'bg-accent-cyan/10' },
214
+ ].map(n => (
215
+ <div key={n.name} className={`flex-1 bg-surface-tertiary ${n.border} border rounded-lg overflow-hidden`}>
216
+ <div className={`${n.header} px-2 py-1 text-[10px] font-semibold text-text-primary`}>{n.name}</div>
217
+ <div className="px-2 py-2 text-[9px] text-text-muted">Node content</div>
218
+ </div>
219
+ ))}
220
+ </div>
221
+ </ShowSection>
222
+ </div>
223
+ );
224
+ }
225
+
226
+ function ShowSection({ title, children }: { title: string; children: React.ReactNode }) {
227
+ return (
228
+ <div>
229
+ <div className="text-[10px] font-bold uppercase tracking-wider text-text-muted mb-2">{title}</div>
230
+ {children}
231
+ </div>
232
+ );
233
+ }
234
+
235
+ // ── Main Component ──
236
+
237
+ export function TokenPreview() {
238
+ const [tab, setTab] = useState<TabId>('themes');
239
+ const { currentThemeId, setTheme, exportCSS, getAllPresets, getCurrentPreset } = useTheme();
240
+
241
+ const handleExport = useCallback(() => {
242
+ const css = exportCSS();
243
+ navigator.clipboard.writeText(css);
244
+ }, [exportCSS]);
245
+
246
+ const tabs: { id: TabId; icon: string; label: string }[] = [
247
+ { id: 'themes', icon: '🎨', label: 'Temas' },
248
+ { id: 'tokens', icon: '🔧', label: 'Tokens' },
249
+ { id: 'showroom', icon: '🏛️', label: 'Showroom' },
250
+ ];
251
+
252
+ return (
253
+ <div className="flex flex-col h-full bg-surface-primary text-text-primary font-sans overflow-hidden">
254
+ {/* Header */}
255
+ <div className="flex items-center gap-2 px-3 py-2.5 border-b border-border-subtle bg-surface-glass">
256
+ <span className="text-sm">🎨</span>
257
+ <span className="text-xs font-bold flex-1">Design System</span>
258
+ <span className="text-[9px] px-1.5 py-0.5 bg-accent-purple/10 text-accent-purple rounded font-mono">
259
+ {getCurrentPreset().name}
260
+ </span>
261
+ <button onClick={handleExport}
262
+ className="px-2.5 py-1 border border-border-default rounded-md bg-accent-purple hover:bg-accent-purple/80 text-[10px] text-text-primary font-medium cursor-pointer transition-colors">
263
+ Export CSS
264
+ </button>
265
+ </div>
266
+
267
+ {/* Tab Bar */}
268
+ <div className="flex border-b border-border-subtle">
269
+ {tabs.map(t => (
270
+ <button key={t.id}
271
+ onClick={() => setTab(t.id)}
272
+ className={`flex-1 flex items-center justify-center gap-1.5 py-2 text-[10px] font-semibold transition-all cursor-pointer ${tab === t.id
273
+ ? 'text-accent-purple border-b-2 border-accent-purple bg-accent-purple/5'
274
+ : 'text-text-muted hover:text-text-secondary hover:bg-surface-glass'
275
+ }`}>
276
+ <span>{t.icon}</span>
277
+ <span>{t.label}</span>
278
+ </button>
279
+ ))}
280
+ </div>
281
+
282
+ {/* Content */}
283
+ <div className="flex-1 overflow-auto custom-scrollbar">
284
+ {tab === 'themes' && (
285
+ <div className="p-3 flex flex-col gap-3">
286
+ <div className="text-[10px] font-bold uppercase tracking-wider text-text-muted">Presets</div>
287
+ <div className="grid grid-cols-2 gap-2">
288
+ {getAllPresets().map(p => (
289
+ <PresetCard key={p.id} preset={p}
290
+ isActive={currentThemeId === p.id}
291
+ onSelect={() => setTheme(p.id)} />
292
+ ))}
293
+ </div>
294
+
295
+ {/* Quick Preview */}
296
+ <div className="mt-2">
297
+ <div className="text-[10px] font-bold uppercase tracking-wider text-text-muted mb-2">Vista Rápida</div>
298
+ <div className="surface-card p-3 flex flex-col gap-2">
299
+ <div className="flex items-center gap-2">
300
+ <div className="w-8 h-8 rounded-full bg-accent-purple flex items-center justify-center text-text-inverse text-[10px] font-bold">Z</div>
301
+ <div>
302
+ <div className="text-xs font-semibold text-text-primary">Zephyr AI</div>
303
+ <div className="text-[10px] text-text-muted">Agente activo • ahora</div>
304
+ </div>
305
+ </div>
306
+ <div className="px-3 py-2 bg-surface-glass rounded-xl text-xs text-text-secondary">
307
+ ¿En qué puedo ayudarte hoy?
308
+ </div>
309
+ <div className="flex gap-1.5">
310
+ <span className="px-2 py-0.5 bg-status-ok/10 text-status-ok rounded-full text-[9px] font-medium">Online</span>
311
+ <span className="px-2 py-0.5 bg-accent-blue/10 text-accent-blue rounded-full text-[9px] font-medium">GPT-4</span>
312
+ </div>
313
+ </div>
314
+ </div>
315
+ </div>
316
+ )}
317
+
318
+ {tab === 'tokens' && (
319
+ <div className="p-3 flex flex-col gap-3">
320
+ {TOKEN_GROUPS.map(g => (
321
+ <div key={g.title}>
322
+ <div className="text-[10px] font-bold uppercase tracking-wider text-text-muted mb-1.5 flex items-center gap-1">
323
+ <span>{g.icon}</span> {g.title}
324
+ </div>
325
+ <div className="flex flex-col gap-1">
326
+ {g.tokens.map(t => (
327
+ <TokenSwatch key={t.key} tokenKey={t.key} label={t.label} />
328
+ ))}
329
+ </div>
330
+ </div>
331
+ ))}
332
+ </div>
333
+ )}
334
+
335
+ {tab === 'showroom' && <ComponentShowroom />}
336
+ </div>
337
+ </div>
338
+ );
339
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Shell Boot Registration — Called once at app startup.
3
+ *
4
+ * Registers built-in shell types (markdown, iframe) into the ShellRegistry.
5
+ *
6
+ * NOTE: shell-vscode and shell-canvas are NOT registered here because they
7
+ * depend on workspace packages (@decido/react-shell, @decido/node-engine).
8
+ * The HOST APP must register them:
9
+ *
10
+ * import { registerShell } from '@decido/studio';
11
+ * registerShell('shell-vscode', MyVscodeWrapper);
12
+ * registerShell('shell-canvas', MyCanvasWrapper);
13
+ */
14
+ import { registerShell } from '../../../store/useShellRegistry';
15
+ import { MarkdownShell, IframeShell } from './BuiltInShells';
16
+ import { TokenPreview } from './TokenPreview';
17
+ import { DatawayChatShell } from './DatawayChatShell';
18
+ import { ShellNexusPreview } from '../ShellNexusPreview';
19
+
20
+ let booted = false;
21
+
22
+ export function bootShells() {
23
+ if (booted) return;
24
+ booted = true;
25
+
26
+ registerShell('markdown', MarkdownShell);
27
+ registerShell('iframe', IframeShell);
28
+ registerShell('shell-theme-editor', TokenPreview);
29
+ registerShell('nexusai-preview', ShellNexusPreview, { icon: '🌐', color: '#3b82f6', label: 'Web Preview' });
30
+ registerShell('dataway-studio', DatawayChatShell, { icon: 'ƒ', color: '#14b8a6', label: 'Dataway M-Script Studio' });
31
+ }
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+ import { Omnibar } from '../Omnibar';
3
+ import { TransientLayer } from '../TransientLayer';
4
+ import { PanelSplitter } from '../PanelSplitter';
5
+ import { ActivityBar } from '../ActivityBar';
6
+ import { GodModePanel } from '../GodModePanel';
7
+ import { OmniAgent } from '../OmniAgent';
8
+ import { useShellStore } from '../../store/engine';
9
+
10
+ export const CreatorShell: React.FC = () => {
11
+ const isGodModePanelOpen = useShellStore(state => state.isGodModePanelOpen);
12
+ const setGodModePanelOpen = useShellStore(state => state.setGodModePanelOpen);
13
+
14
+ return (
15
+ <div className="relative w-screen h-screen overflow-hidden bg-surface-primary text-text-primary flex flex-col font-sans selection:bg-purple-500/30">
16
+ {/* Dynamic Background Noise & Gradients - Creator specific (Purple theme) */}
17
+ <div className="absolute inset-x-0 top-0 h-[500px] w-full bg-linear-to-b from-purple-900/20 via-fuchsia-900/10 to-transparent pointer-events-none -translate-y-1/2 opacity-50 blur-[100px]" />
18
+ <div className="w-full shrink-0 flex-none bg-surface-overlay backdrop-blur-md border-b border-border-subtle" style={{ height: 'max(env(safe-area-inset-top, 0px), 1.5rem)' }} />
19
+
20
+ <Omnibar />
21
+
22
+ {/* Creator layout relies heavily on the Splitter for IDE-like config */}
23
+ <div className="flex-1 relative overflow-hidden z-10 w-full flex flex-row border-t border-purple-500/10">
24
+ <ActivityBar />
25
+ <div className="flex-1 relative p-4 pt-0">
26
+ <PanelSplitter isRoot={true} />
27
+ </div>
28
+ </div>
29
+
30
+ <div className="w-full shrink-0 flex-none" style={{ height: 'max(env(safe-area-inset-bottom, 0px), 1rem)' }} />
31
+
32
+ <TransientLayer />
33
+ {isGodModePanelOpen && <GodModePanel onClose={() => setGodModePanelOpen(false)} />}
34
+ <OmniAgent />
35
+ </div>
36
+ );
37
+ };