@decido/shell 1.0.0 → 4.0.1

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/README.md +31 -0
  2. package/package.json +17 -14
  3. package/.turbo/turbo-build.log +0 -13
  4. package/src/AgentPlayer.tsx +0 -105
  5. package/src/DecidoPlayer.tsx +0 -117
  6. package/src/bridge/BridgeAgent.ts +0 -443
  7. package/src/components/DecidoIcon.tsx +0 -56
  8. package/src/components/JsonTreeEditor.tsx +0 -117
  9. package/src/components/PanelSplitter.tsx +0 -71
  10. package/src/components/PluginErrorBoundary.tsx +0 -69
  11. package/src/components/SafeLiquidUI.tsx +0 -114
  12. package/src/components/TransientLayer.tsx +0 -92
  13. package/src/components/agent/AgentChat.tsx +0 -134
  14. package/src/components/chat-extensions/IntentCatalogPanel.tsx +0 -81
  15. package/src/components/chat-extensions/chatSlashCommands.ts +0 -101
  16. package/src/components/controls/CreatorInputBar.tsx +0 -144
  17. package/src/components/controls/OSToolbar.tsx +0 -90
  18. package/src/components/controls/TimelineTape.tsx +0 -43
  19. package/src/components/debug/ActionTimelineTab.tsx +0 -111
  20. package/src/components/debug/CSSInspectorTab.tsx +0 -436
  21. package/src/components/debug/ExportTab.tsx +0 -192
  22. package/src/components/debug/FlowHealthTab.tsx +0 -86
  23. package/src/components/debug/LogsTab.tsx +0 -110
  24. package/src/components/debug/MorphStackTab.tsx +0 -241
  25. package/src/components/debug/NetworkTab.tsx +0 -173
  26. package/src/components/debug/PerformanceTab.tsx +0 -171
  27. package/src/components/debug/ProfilesTab.tsx +0 -238
  28. package/src/components/debug/ReplayTab.tsx +0 -70
  29. package/src/components/debug/StoresTab.tsx +0 -255
  30. package/src/components/debug/TopologyTab.tsx +0 -59
  31. package/src/components/debug/debugConfig.tsx +0 -66
  32. package/src/components/playground/DebugPanel.tsx +0 -112
  33. package/src/components/playground/HeaderCenterControls.tsx +0 -92
  34. package/src/components/playground/KeyframeListItem.tsx +0 -70
  35. package/src/components/playground/PlaygroundAppSidebar.tsx +0 -171
  36. package/src/components/playground/PlaygroundBottomControls.tsx +0 -132
  37. package/src/components/playground/PlaygroundCanvas.tsx +0 -87
  38. package/src/components/playground/PlaygroundChat.tsx +0 -236
  39. package/src/components/playground/PlaygroundErrorBoundary.tsx +0 -63
  40. package/src/components/playground/PlaygroundFloatingInput.tsx +0 -352
  41. package/src/components/playground/PlaygroundHeader.tsx +0 -222
  42. package/src/components/playground/PlaygroundSidebar.tsx +0 -136
  43. package/src/components/playground/PlaygroundTerminal.tsx +0 -44
  44. package/src/components/playground/SuggestionCards.tsx +0 -29
  45. package/src/components/playground/demos/ClinicaAINode.tsx +0 -221
  46. package/src/components/playground/demos/FinanceAINode.tsx +0 -226
  47. package/src/components/playground/demos/KiaAcademyNode.tsx +0 -250
  48. package/src/components/playground/demos/KiaBotNode.tsx +0 -207
  49. package/src/components/playground/demos/KiaCampaignNode.tsx +0 -191
  50. package/src/components/playground/demos/KiaComplianceNode.tsx +0 -140
  51. package/src/components/playground/demos/KiaCustomerJourneyNode.tsx +0 -220
  52. package/src/components/playground/demos/KiaCyberNode.tsx +0 -203
  53. package/src/components/playground/demos/KiaDashboardNode.tsx +0 -399
  54. package/src/components/playground/demos/KiaEmbudoOverviewNode.tsx +0 -168
  55. package/src/components/playground/demos/KiaExecutiveNode.tsx +0 -169
  56. package/src/components/playground/demos/KiaGamificationNode.tsx +0 -229
  57. package/src/components/playground/demos/KiaIntelligenceHubNode.tsx +0 -165
  58. package/src/components/playground/demos/KiaInventoryNode.tsx +0 -183
  59. package/src/components/playground/demos/KiaLeadScoringNode.tsx +0 -226
  60. package/src/components/playground/demos/KiaLiveSimulationNode.tsx +0 -177
  61. package/src/components/playground/demos/KiaMultiDealerNode.tsx +0 -223
  62. package/src/components/playground/demos/KiaNPSVoiceNode.tsx +0 -214
  63. package/src/components/playground/demos/KiaOmnichannelNode.tsx +0 -162
  64. package/src/components/playground/demos/KiaPBIBudgetNode.tsx +0 -152
  65. package/src/components/playground/demos/KiaPBIConversionNode.tsx +0 -206
  66. package/src/components/playground/demos/KiaPBIFunnelNode.tsx +0 -184
  67. package/src/components/playground/demos/KiaPBIOwnershipNode.tsx +0 -113
  68. package/src/components/playground/demos/KiaPBIPartnerNode.tsx +0 -143
  69. package/src/components/playground/demos/KiaPBIPreciosNode.tsx +0 -120
  70. package/src/components/playground/demos/KiaPBIRuntNode.tsx +0 -205
  71. package/src/components/playground/demos/KiaPartnerScoreNode.tsx +0 -206
  72. package/src/components/playground/demos/KiaPredictiveNode.tsx +0 -226
  73. package/src/components/playground/demos/KiaShowroomNode.tsx +0 -194
  74. package/src/components/playground/demos/KiaStoreNode.tsx +0 -215
  75. package/src/components/playground/demos/KiaSustainabilityNode.tsx +0 -173
  76. package/src/components/playground/demos/KiaUsedVehiclesNode.tsx +0 -163
  77. package/src/components/playground/demos/KiaWorkshopNode.tsx +0 -221
  78. package/src/components/playground/demos/SmartCityNode.tsx +0 -205
  79. package/src/components/playground/demos/kia_campaign_manifest.json +0 -112
  80. package/src/components/playground/input-parts/AIModelSelector.tsx +0 -156
  81. package/src/components/playground/input-parts/InputActions.tsx +0 -80
  82. package/src/components/playground/input-parts/InputToolbar.tsx +0 -245
  83. package/src/components/playground/input-parts/ResourceLibraryPanel.tsx +0 -287
  84. package/src/components/playground/sidebarDsdIO.ts +0 -82
  85. package/src/components/settings/SettingsPanel.tsx +0 -267
  86. package/src/components/shell/AppHeader.tsx +0 -9
  87. package/src/components/shell/AppShell.tsx +0 -139
  88. package/src/components/shell/ArtifactBar.tsx +0 -97
  89. package/src/components/shell/BootScreen.tsx +0 -19
  90. package/src/components/shell/CenterComposite.tsx +0 -87
  91. package/src/components/shell/CodeEditorPanel.tsx +0 -88
  92. package/src/components/shell/GlobalOverlays.tsx +0 -228
  93. package/src/components/shell/LayoutConfigurator.tsx +0 -209
  94. package/src/components/shell/LayoutGrid.tsx +0 -178
  95. package/src/components/shell/MorphShell.tsx +0 -368
  96. package/src/components/shell/PluginViewer.tsx +0 -147
  97. package/src/components/shell/ShellNexusPreview.tsx +0 -458
  98. package/src/components/shell/SlotRenderer.tsx +0 -115
  99. package/src/components/shell/TabBar.tsx +0 -94
  100. package/src/components/shell/TemplateLibrary.tsx +0 -195
  101. package/src/components/shell/layoutConstants.ts +0 -35
  102. package/src/components/shell/morphStageMeta.ts +0 -15
  103. package/src/components/shell/shells/BuiltInShells.tsx +0 -443
  104. package/src/components/shell/shells/DatawayChatShell.tsx +0 -42
  105. package/src/components/shell/shells/TokenPreview.tsx +0 -339
  106. package/src/components/shell/shells/bootShells.ts +0 -31
  107. package/src/components/shells/CreatorShell.tsx +0 -37
  108. package/src/components/shells/DecidoShell.tsx +0 -447
  109. package/src/components/shells/ExperimentalChatShell.tsx +0 -245
  110. package/src/components/shells/UserCanvas.tsx +0 -44
  111. package/src/components/studio/BlueprintManagerPanel.tsx +0 -137
  112. package/src/components/studio/DependencyTreePanel.tsx +0 -192
  113. package/src/components/studio/NodePalette.tsx +0 -92
  114. package/src/components/studio/NodePropertiesPanel.tsx +0 -81
  115. package/src/components/studio/ReactFlowEditor.tsx +0 -242
  116. package/src/components/studio/TimelineEditor.tsx +0 -122
  117. package/src/components/studio/TimelineKeyframeCard.tsx +0 -99
  118. package/src/components/studio/VariablePanel.tsx +0 -181
  119. package/src/components/studio/blueprint/BlueprintCard.tsx +0 -82
  120. package/src/components/studio/editor/CanvasContextMenu.tsx +0 -107
  121. package/src/components/studio/editor/EditorToolbar.tsx +0 -80
  122. package/src/components/studio/editor/StageContentRenderer.tsx +0 -134
  123. package/src/components/studio/editor/TrackPropertyEditors.tsx +0 -133
  124. package/src/components/studio/editor/TreeNodeItem.tsx +0 -91
  125. package/src/components/studio/editor/edgeStyles.ts +0 -43
  126. package/src/components/studio/editor/editorKeyHandler.ts +0 -95
  127. package/src/components/studio/editor/nodeTypeRegistry.ts +0 -137
  128. package/src/components/studio/editor/paletteCatalog.tsx +0 -84
  129. package/src/components/studio/nodes/shell/InteractionNodes.tsx +0 -82
  130. package/src/components/studio/nodes/shell/LayoutControlNodes.tsx +0 -69
  131. package/src/components/studio/nodes/shell/RegisterActionNode.tsx +0 -20
  132. package/src/components/studio/nodes/shell/RegisterButtonNode.tsx +0 -22
  133. package/src/components/studio/nodes/shell/RegisterPanelNode.tsx +0 -19
  134. package/src/components/studio/nodes/shell/RegisterSidebarNode.tsx +0 -19
  135. package/src/components/studio/nodes/shell/RegisterStatusBarNode.tsx +0 -22
  136. package/src/components/studio/nodes/shell/RegisterTabNode.tsx +0 -21
  137. package/src/components/studio/nodes/shell/RegisterTopBarNode.tsx +0 -22
  138. package/src/components/studio/nodes/shell/ShellConfigNode.tsx +0 -51
  139. package/src/components/studio/nodes/shell/ShellNodeBase.tsx +0 -100
  140. package/src/components/studio/nodes/shell/ThemeNodes.tsx +0 -51
  141. package/src/components/studio/nodes/shell/index.ts +0 -12
  142. package/src/components/widgets/BroadcastWidget.tsx +0 -93
  143. package/src/components/widgets/MarketplaceWidget.tsx +0 -298
  144. package/src/components/widgets/McpToolsWidget.tsx +0 -231
  145. package/src/components/widgets/OpsDashboard.tsx +0 -59
  146. package/src/components/widgets/QuickActionsWidget.tsx +0 -60
  147. package/src/components/widgets/UsageWidget.tsx +0 -112
  148. package/src/components/widgets/WidgetRenderer.tsx +0 -892
  149. package/src/components/widgets/WidgetSlotPanel.tsx +0 -213
  150. package/src/config/IconRegistry.ts +0 -126
  151. package/src/contexts/NetworkProvider.tsx +0 -162
  152. package/src/core/AIDirector.ts +0 -71
  153. package/src/core/EventBus.ts +0 -37
  154. package/src/core/PluginContext.tsx +0 -141
  155. package/src/hooks/listeners/useUIStateListener.ts +0 -59
  156. package/src/hooks/listeners/useWhatsAppListener.ts +0 -110
  157. package/src/hooks/morphBridge.ts +0 -82
  158. package/src/hooks/useAIModelSelector.ts +0 -144
  159. package/src/hooks/useAgentStream.ts +0 -220
  160. package/src/hooks/useAutoUpdater.ts +0 -89
  161. package/src/hooks/useBootSequence.ts +0 -20
  162. package/src/hooks/useExportDSD.ts +0 -53
  163. package/src/hooks/useFullscreen.ts +0 -35
  164. package/src/hooks/useGeminiStream.ts +0 -282
  165. package/src/hooks/useIntentLens.ts +0 -224
  166. package/src/hooks/useKeyboardShortcuts.ts +0 -69
  167. package/src/hooks/useLoggerBridge.ts +0 -32
  168. package/src/hooks/useMcpClient.ts +0 -112
  169. package/src/hooks/useNexusaiDeploy.ts +0 -118
  170. package/src/hooks/usePlaybackEngine.ts +0 -21
  171. package/src/hooks/usePlaygroundCommander.ts +0 -475
  172. package/src/hooks/usePluginEngine.ts +0 -165
  173. package/src/hooks/useScreenRecorder.ts +0 -73
  174. package/src/hooks/useShellKeyboard.ts +0 -40
  175. package/src/hooks/useShellShortcuts.ts +0 -118
  176. package/src/hooks/useSoundEffects.ts +0 -35
  177. package/src/hooks/useStudioConfig.ts +0 -72
  178. package/src/hooks/useSystemBoot.ts +0 -84
  179. package/src/hooks/useSystemTelemetry.ts +0 -62
  180. package/src/lib/debugLogger.ts +0 -80
  181. package/src/lib/networkInterceptor.ts +0 -100
  182. package/src/mocks/decido.tsx +0 -41
  183. package/src/plugins/pluginAPI.ts +0 -190
  184. package/src/store/McpStore.ts +0 -69
  185. package/src/store/UpdaterStore.ts +0 -60
  186. package/src/store/engine.ts +0 -392
  187. package/src/store/index.ts +0 -4
  188. package/src/store/layoutPresets.ts +0 -66
  189. package/src/store/playgroundTypes.ts +0 -98
  190. package/src/store/useActionTimelineStore.ts +0 -48
  191. package/src/store/useDebugPanelStore.ts +0 -98
  192. package/src/store/useDebugProfileStore.ts +0 -130
  193. package/src/store/useLayoutStore.ts +0 -205
  194. package/src/store/useMorphInstanceStore.ts +0 -289
  195. package/src/store/useMorphologyStore.ts +0 -103
  196. package/src/store/usePlaygroundStore.ts +0 -236
  197. package/src/store/useShellRegistry.ts +0 -123
  198. package/src/store/useSuggestionsStore.ts +0 -57
  199. package/src/store/useThemeStore.ts +0 -399
  200. package/src/store/useUIComponentStore.ts +0 -179
  201. package/src/types/DecidoStoryDefinition.ts +0 -43
  202. package/src/utils/ai/ai-architect.ts +0 -92
  203. package/src/utils/ai/ai-code.ts +0 -187
  204. package/src/utils/ai/ai-core.ts +0 -50
  205. package/src/utils/ai/ai-media.ts +0 -292
  206. package/src/utils/layoutGraph.ts +0 -67
  207. package/tsconfig.json +0 -17
  208. package/tsconfig.tsbuildinfo +0 -1
@@ -1,222 +0,0 @@
1
- import React from 'react';
2
- import { PanelLeftClose, PanelLeftOpen, Plus, Share2, Bug, Sun, Moon, MessageSquare, MessageSquareOff } from 'lucide-react';
3
- import { useTheme } from '../../store/useThemeStore';
4
- import { HeaderCenterControls } from './HeaderCenterControls';
5
- import { LayoutConfigurator } from '../shell/LayoutConfigurator';
6
- import { usePlaygroundStore } from '../../store/usePlaygroundStore';
7
- import { useEngineStore } from '@decido/engine';
8
- import { useDebugPanelStore } from '../../store/useDebugPanelStore';
9
- import { useLayoutStore } from '../../store/useLayoutStore';
10
-
11
- // --------------------------------------------------
12
- // Types
13
- // --------------------------------------------------
14
- export interface HeaderAction {
15
- id: string;
16
- icon?: React.ReactNode;
17
- label?: string;
18
- onClick: () => void;
19
- variant?: 'ghost' | 'outline' | 'accent';
20
- /** Show a pulsing dot indicator */
21
- showIndicator?: boolean;
22
- indicatorColor?: string;
23
- /** Only show in creator / player / both */
24
- visibleIn?: 'creator' | 'player' | 'both';
25
- className?: string;
26
- }
27
-
28
- export interface PlaygroundHeaderProps {
29
- /** Additional dynamic action buttons */
30
- extraActions?: HeaderAction[];
31
- /** Active model / persona label */
32
- modelLabel?: string;
33
- onModelClick?: () => void;
34
- }
35
-
36
- // ─── Theme Toggle Button ───
37
- function ThemeToggleBtn() {
38
- const currentThemeId = useTheme((s) => s.currentThemeId);
39
- const setTheme = useTheme((s) => s.setTheme);
40
- const isDark = currentThemeId !== 'decido-light';
41
-
42
- return (
43
- <button
44
- onClick={() => setTheme(isDark ? 'decido-light' : 'decido-dark')}
45
- className="w-8 h-8 rounded-lg flex items-center justify-center transition-all duration-200 border text-text-secondary hover:text-text-primary hover:bg-surface-glass border-transparent"
46
- title={isDark ? 'Cambiar a Decido Light' : 'Cambiar a Decido Dark'}
47
- aria-label={isDark ? 'Cambiar a tema claro' : 'Cambiar a tema oscuro'}
48
- >
49
- <div className="relative w-4 h-4">
50
- <Sun
51
- size={16}
52
- className="absolute inset-0 transition-all duration-300"
53
- style={{
54
- opacity: isDark ? 0 : 1,
55
- transform: isDark ? 'rotate(-90deg) scale(0.5)' : 'rotate(0deg) scale(1)',
56
- color: isDark ? undefined : '#f59e0b',
57
- }}
58
- />
59
- <Moon
60
- size={16}
61
- className="absolute inset-0 transition-all duration-300"
62
- style={{
63
- opacity: isDark ? 1 : 0,
64
- transform: isDark ? 'rotate(0deg) scale(1)' : 'rotate(90deg) scale(0.5)',
65
- color: isDark ? '#a78bfa' : undefined,
66
- }}
67
- />
68
- </div>
69
- </button>
70
- );
71
- }
72
-
73
- export const PlaygroundHeader = React.memo(function PlaygroundHeader({
74
- extraActions = [],
75
- modelLabel,
76
- onModelClick,
77
- }: PlaygroundHeaderProps) {
78
- // ── Read from stores ──
79
- const isSidebarOpen = usePlaygroundStore((s) => s.isSidebarOpen);
80
- const setIsSidebarOpen = usePlaygroundStore((s) => s.setIsSidebarOpen);
81
- const prototypeBrand = usePlaygroundStore((s) => s.prototypeBrand);
82
- const isCreatorMode = usePlaygroundStore((s) => s.isCreatorMode);
83
- const setIsCreatorMode = usePlaygroundStore((s) => s.setIsCreatorMode);
84
- const creatorViewMode = usePlaygroundStore((s) => s.creatorViewMode);
85
- const setCreatorViewMode = usePlaygroundStore((s) => s.setCreatorViewMode);
86
- const isVoiceActive = usePlaygroundStore((s) => s.isVoiceActive);
87
- const { isSpeaking } = useEngineStore();
88
- const debugIsOpen = useDebugPanelStore((s) => s.isOpen);
89
- const debugErrorCount = useDebugPanelStore((s) => s.errorCount);
90
- const toggleDebugPanel = useDebugPanelStore((s) => s.togglePanel);
91
- const showChat = useLayoutStore((s) => s.showChat);
92
- const setShowChat = useLayoutStore((s) => s.setShowChat);
93
- const pgSetShowChat = usePlaygroundStore((s) => s.setShowChat);
94
-
95
- const toggleChat = () => {
96
- const newVal = !showChat;
97
- setShowChat(newVal);
98
- pgSetShowChat(newVal);
99
- };
100
-
101
- // Sync layout store on mode toggle
102
- const syncCreatorMode = (newVal: boolean) => {
103
- setIsCreatorMode(newVal);
104
- useLayoutStore.getState().setIsCreatorMode(newVal);
105
- };
106
-
107
- // Built-in actions
108
- const builtInActions: HeaderAction[] = [
109
- {
110
- id: 'toggle-chat',
111
- icon: showChat ? <MessageSquareOff size={16} /> : <MessageSquare size={16} />,
112
- label: showChat ? 'Ocultar chat' : 'Mostrar chat',
113
- onClick: toggleChat,
114
- variant: showChat ? 'ghost' : 'outline',
115
- visibleIn: 'both',
116
- className: showChat ? 'text-text-secondary' : 'text-accent-cyan bg-surface-glass border-accent-cyan/30',
117
- },
118
- {
119
- id: 'debug-panel',
120
- icon: <Bug size={16} />,
121
- onClick: toggleDebugPanel,
122
- variant: debugIsOpen ? 'accent' : 'ghost',
123
- showIndicator: debugErrorCount > 0,
124
- indicatorColor: 'bg-status-error',
125
- visibleIn: 'both',
126
- },
127
- ];
128
-
129
- const allActions = [...builtInActions, ...extraActions];
130
- const visibleActions = allActions.filter(a =>
131
- !a.visibleIn || a.visibleIn === 'both' ||
132
- (a.visibleIn === 'creator' && isCreatorMode) ||
133
- (a.visibleIn === 'player' && !isCreatorMode)
134
- );
135
-
136
- const getVariantClasses = (variant: HeaderAction['variant'] = 'ghost') => {
137
- switch (variant) {
138
- case 'accent':
139
- return 'bg-surface-glass text-accent-cyan hover:bg-surface-elevated border border-accent-cyan';
140
- case 'outline':
141
- return 'bg-transparent text-text-primary hover:bg-surface-glass border-border-default';
142
- default:
143
- return 'bg-transparent text-text-secondary hover:text-text-primary hover:bg-surface-glass border-transparent';
144
- }
145
- };
146
-
147
- return (
148
- <header
149
- data-tauri-drag-region
150
- className="flex-none h-12 px-3 flex items-center justify-between bg-surface-secondary backdrop-blur-md border-b border-border-default shadow-[0_1px_3px_0_rgba(0,0,0,0.08)] z-30 select-none"
151
- >
152
- {/* ─── LEFT ─── */}
153
- <div className="flex items-center gap-1.5 min-w-0">
154
- {/* Sidebar Toggle */}
155
- <button
156
- onClick={() => setIsSidebarOpen(!isSidebarOpen)}
157
- className="w-8 h-8 rounded-lg text-text-secondary hover:text-text-primary hover:bg-surface-glass flex items-center justify-center transition-all duration-150 shrink-0"
158
- title={isSidebarOpen ? 'Cerrar panel' : 'Abrir panel'}
159
- >
160
- {isSidebarOpen ? <PanelLeftClose size={18} /> : <PanelLeftOpen size={18} />}
161
- </button>
162
-
163
- {/* New Chat / Action */}
164
- <button
165
- className="w-8 h-8 rounded-lg text-text-secondary hover:text-text-primary hover:bg-surface-glass flex items-center justify-center transition-all duration-150 shrink-0"
166
- title="Nueva Conversación"
167
- >
168
- <Plus size={18} />
169
- </button>
170
-
171
- <div className="h-4 w-px bg-border-subtle mx-1 hidden sm:block" />
172
-
173
- {/* Brand / Title */}
174
- <div
175
- data-tauri-drag-region
176
- className="flex items-center gap-2 min-w-0 cursor-default"
177
- >
178
- <span className="text-sm font-semibold text-text-primary/80 tracking-tight truncate hidden sm:inline">
179
- <span className="text-accent-cyan capitalize">{prototypeBrand || 'Decido'} OS</span>
180
- </span>
181
- </div>
182
- </div>
183
-
184
- {/* ─── CENTER: Controls ─── */}
185
- <HeaderCenterControls isSpeaking={!!isSpeaking} isCreatorMode={isCreatorMode} creatorViewMode={creatorViewMode}
186
- modelLabel={modelLabel} onModelClick={onModelClick} onSyncCreatorMode={syncCreatorMode} onSetCreatorViewMode={setCreatorViewMode} />
187
-
188
- {/* ─── RIGHT: Dynamic Action Buttons ─── */}
189
- <div className="flex items-center gap-1">
190
- {visibleActions.map(action => (
191
- <button
192
- key={action.id}
193
- onClick={action.onClick}
194
- className={`relative h-8 rounded-lg flex items-center justify-center transition-all duration-150 border text-xs font-medium ${action.className || ''} ${getVariantClasses(action.variant)} ${action.label ? 'px-3 gap-1.5' : 'w-8'}`}
195
- title={action.label}
196
- >
197
- {action.icon}
198
- {action.label && <span className="hidden sm:inline">{action.label}</span>}
199
- {action.showIndicator && (
200
- <span className={`absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full ${action.indicatorColor || 'bg-accent-cyan'} shadow-[0_0_6px] animate-pulse`} />
201
- )}
202
- </button>
203
- ))}
204
-
205
- {/* Theme Toggle (Dark ↔ Light) */}
206
- <ThemeToggleBtn />
207
-
208
- {/* Layout Configurator */}
209
- <LayoutConfigurator />
210
-
211
- {/* Share / Export (static) */}
212
- <button
213
- className="w-8 h-8 rounded-lg text-text-secondary hover:text-text-primary hover:bg-surface-glass flex items-center justify-center transition-all duration-150"
214
- title="Compartir"
215
- >
216
- <Share2 size={16} />
217
- </button>
218
- </div>
219
- </header>
220
- );
221
- });
222
-
@@ -1,136 +0,0 @@
1
- import React from 'react';
2
- import { Menu, Play, Trash2, Save, Download, Upload, Database } from 'lucide-react';
3
- import { usePlaygroundStore } from '../../store/usePlaygroundStore';
4
- import { useEngineStore } from '@decido/engine';
5
- import { KeyframeListItem } from './KeyframeListItem';
6
- import { downloadSequenceAsDSD, handleSequenceUpload } from './sidebarDsdIO';
7
-
8
- export interface PlaygroundSidebarProps {
9
- isSidebarOpen: boolean;
10
- setIsSidebarOpen: (open: boolean) => void;
11
- prototypeBrand: string;
12
- dynamicTimelines: any;
13
- setDynamicTimelines: any;
14
- currentTime: number;
15
- setCurrentTime: (time: number) => void;
16
- }
17
-
18
- export const PlaygroundSidebar = React.memo(function PlaygroundSidebar({
19
- isSidebarOpen, setIsSidebarOpen, prototypeBrand, dynamicTimelines, setDynamicTimelines, currentTime, setCurrentTime
20
- }: PlaygroundSidebarProps) {
21
- const [editingKeyframe, setEditingKeyframe] = React.useState<number | null>(null);
22
- const savedSequences = usePlaygroundStore(state => state.savedSequences);
23
- const removeSavedSequence = usePlaygroundStore(state => state.removeSavedSequence);
24
- const variables = useEngineStore(state => state.variables);
25
-
26
- const brandSequences = savedSequences.filter(seq => seq.brand === prototypeBrand);
27
-
28
- const loadSequence = (seq: any) => {
29
- setDynamicTimelines((prev: any) => ({
30
- ...prev,
31
- [prototypeBrand]: { duration: seq.duration, keyframes: seq.keyframes }
32
- }));
33
- setCurrentTime(0);
34
- };
35
-
36
- const handleUpdateKeyframe = (index: number, newTime: string, newSpeech: string) => {
37
- const t = parseFloat(newTime);
38
- if (isNaN(t)) return;
39
- setDynamicTimelines((prev: any) => {
40
- const currentTimelines = { ...prev };
41
- const updatedKeyframes = [...currentTimelines[prototypeBrand].keyframes];
42
- updatedKeyframes[index] = { ...updatedKeyframes[index], t, speech: newSpeech };
43
- updatedKeyframes.sort((a, b) => a.t - b.t);
44
- return { ...currentTimelines, [prototypeBrand]: { ...currentTimelines[prototypeBrand], keyframes: updatedKeyframes } };
45
- });
46
- setEditingKeyframe(null);
47
- };
48
-
49
- if (!dynamicTimelines[prototypeBrand]) return null;
50
-
51
- const keyframes = dynamicTimelines[prototypeBrand].keyframes;
52
-
53
- return (
54
- <div className="flex flex-col h-full w-full bg-surface-secondary/90 backdrop-blur-xl border-r border-border-subtle z-30 overflow-hidden">
55
- <div className="w-full min-w-0 p-4 flex flex-col h-full opacity-100">
56
- <div className="flex items-center gap-3 mb-6 mt-2">
57
- <button onClick={() => setIsSidebarOpen(false)} className="p-2 -ml-2 rounded-full hover:bg-surface-glass text-text-secondary hover:text-text-primary transition-colors">
58
- <Menu size={22} />
59
- </button>
60
- <span className="font-bold text-text-primary tracking-wide">Inspector de Capas</span>
61
- </div>
62
-
63
- <div className="flex-1 overflow-y-auto space-y-4 pr-2 custom-scrollbar">
64
- {/* Saved Sequences */}
65
- {brandSequences.length > 0 && (
66
- <div className="space-y-2 mb-6">
67
- <div className="flex items-center justify-between px-2 mb-2">
68
- <div className="text-xs font-mono text-text-muted tracking-wider flex items-center gap-2 uppercase">
69
- <Save size={12} /> Secuencias Guardadas
70
- </div>
71
- <label className="cursor-pointer text-text-muted hover:text-cyan-400 transition-colors p-1" title="Importar Secuencia JSON">
72
- <Upload size={14} />
73
- <input type="file" accept=".json" className="hidden" onChange={(e) => handleSequenceUpload(e, prototypeBrand)} />
74
- </label>
75
- </div>
76
- <div className="space-y-1">
77
- {brandSequences.map((seq) => (
78
- <div key={seq.id} className="flex items-center justify-between p-2 rounded-lg bg-surface-glass hover:bg-surface-glass border border-border-subtle transition-colors group">
79
- <button onClick={() => loadSequence(seq)} className="flex-1 text-left min-w-0 pr-2">
80
- <div className="text-xs font-medium text-text-primary truncate" title={seq.prompt}>{seq.prompt}</div>
81
- <div className="text-[10px] text-text-muted font-mono mt-0.5">{seq.duration.toFixed(1)}s • {seq.keyframes.length} frames</div>
82
- </button>
83
- <div className="flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity">
84
- <button onClick={() => downloadSequenceAsDSD(seq)} className="p-1.5 rounded hover:bg-purple-500/20 text-purple-400 transition-colors" title="Exportar JSON"><Download size={14} /></button>
85
- <button onClick={() => loadSequence(seq)} className="p-1.5 rounded hover:bg-cyan-500/20 text-cyan-400 transition-colors" title="Cargar y reproducir"><Play size={14} /></button>
86
- <button onClick={() => removeSavedSequence(seq.id)} className="p-1.5 rounded hover:bg-red-500/20 text-red-400 transition-colors" title="Eliminar secuencia"><Trash2 size={14} /></button>
87
- </div>
88
- </div>
89
- ))}
90
- </div>
91
- </div>
92
- )}
93
-
94
- {/* Watch Panel */}
95
- <div className="space-y-2 mb-6 select-text">
96
- <div className="flex items-center justify-between px-2 mb-2">
97
- <div className="text-xs font-mono text-cyan-500 tracking-wider flex items-center gap-2 uppercase">
98
- <Database size={12} /> Watch: Variables Globales
99
- </div>
100
- </div>
101
- <div className="bg-surface-overlay border border-border-subtle rounded-lg p-2 font-mono text-[10px] overflow-hidden">
102
- {Object.keys(variables).length === 0 ? (
103
- <div className="text-text-muted italic px-1">Memoria vacía. El runtime iniciará las variables al ejecutar Nodos.</div>
104
- ) : (
105
- <div className="space-y-1">
106
- {Object.entries(variables).map(([key, value]) => (
107
- <div key={key} className="flex flex-col group hover:bg-surface-glass rounded px-1 transition-colors">
108
- <span className="text-purple-400 font-bold">{key}:</span>
109
- <span className="text-text-primary pl-2 break-all">
110
- {typeof value === 'object' ? JSON.stringify(value) : String(value)}
111
- </span>
112
- </div>
113
- ))}
114
- </div>
115
- )}
116
- </div>
117
- </div>
118
-
119
- {/* Keyframe Timeline */}
120
- <div className="space-y-2">
121
- <div className="text-xs font-mono text-text-muted px-2 tracking-wider uppercase">Línea de Tiempo ({prototypeBrand})</div>
122
- {keyframes.map((kf: any, i: number) => {
123
- const isPast = currentTime >= kf.t;
124
- const isActive = isPast && (i === keyframes.length - 1 || currentTime < keyframes[i + 1].t);
125
- return (
126
- <KeyframeListItem key={i} kf={kf} index={i} isActive={isActive} isPast={isPast}
127
- isEditing={editingKeyframe === i} isLast={i === keyframes.length - 1}
128
- onSeek={setCurrentTime} onStartEdit={setEditingKeyframe} onSaveEdit={handleUpdateKeyframe} />
129
- );
130
- })}
131
- </div>
132
- </div>
133
- </div>
134
- </div>
135
- );
136
- });
@@ -1,44 +0,0 @@
1
- import React from 'react';
2
- import { motion, AnimatePresence } from 'motion/react';
3
- import { Terminal, Trash2, X } from 'lucide-react';
4
-
5
- export interface PlaygroundTerminalProps {
6
- isOpen: boolean;
7
- setIsOpen: (open: boolean) => void;
8
- logs: { time: string, msg: string, type: string }[];
9
- setLogs: (logs: { time: string, msg: string, type: string }[]) => void;
10
- logsEndRef: React.RefObject<HTMLDivElement | null>;
11
- }
12
-
13
- export const PlaygroundTerminal = React.memo(function PlaygroundTerminal({ isOpen, setIsOpen, logs, setLogs, logsEndRef }: PlaygroundTerminalProps) {
14
- return (
15
- <AnimatePresence>
16
- {isOpen && (
17
- <motion.div
18
- initial={{ opacity: 0, y: 50 }} animate={{ opacity: 1, y: 0 }} exit={{ opacity: 0, y: 50 }}
19
- className="absolute right-6 bottom-40 w-80 h-64 bg-surface-overlay backdrop-blur-md border border-border-default rounded-xl flex flex-col overflow-hidden z-30 shadow-2xl"
20
- >
21
- <div className="flex items-center justify-between px-3 py-2 border-b border-border-default bg-surface-glass">
22
- <div className="flex items-center gap-2">
23
- <Terminal size={14} className="text-text-secondary" />
24
- <span className="text-xs font-mono text-text-secondary">System Log</span>
25
- </div>
26
- <div className="flex items-center gap-2">
27
- <button onClick={() => setLogs([])} className="text-text-muted hover:text-red-400 transition-colors" title="Limpiar logs"><Trash2 size={14} /></button>
28
- <button onClick={() => setIsOpen(false)} className="text-text-muted hover:text-text-primary transition-colors"><X size={14} /></button>
29
- </div>
30
- </div>
31
- <div className="flex-1 overflow-y-auto p-3 font-mono text-[10px] space-y-1 custom-scrollbar">
32
- {logs.map((log, i) => (
33
- <div key={i} className={`flex gap-2 ${log.type === 'error' ? 'text-red-400' : log.type === 'success' ? 'text-emerald-400' : log.type === 'system' ? 'text-purple-400' : 'text-text-secondary'}`}>
34
- <span className="opacity-50 shrink-0">[{log.time}]</span>
35
- <span className="wrap-break-word">{log.msg}</span>
36
- </div>
37
- ))}
38
- <div ref={logsEndRef} />
39
- </div>
40
- </motion.div>
41
- )}
42
- </AnimatePresence>
43
- );
44
- });
@@ -1,29 +0,0 @@
1
- import React from 'react';
2
- import { resolveIcon, resolveColor } from '../../config/IconRegistry';
3
-
4
- interface SuggestionCardsProps {
5
- suggestions: any[];
6
- onSelect: (command: string) => void;
7
- }
8
-
9
- export const SuggestionCards = React.memo(function SuggestionCards({ suggestions, onSelect }: SuggestionCardsProps) {
10
- return (
11
- <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2.5 sm:gap-3 w-full min-w-0 max-w-full mt-3 sm:mt-4">
12
- {suggestions.map((sug, i) => {
13
- const IconComponent = resolveIcon(sug.icon);
14
- const colorClass = resolveColor(sug.color);
15
- return (
16
- <div key={i} className="group relative flex flex-col p-3 sm:p-4 bg-surface-tertiary hover:bg-surface-elevated border border-border-subtle hover:border-border-default rounded-xl sm:rounded-2xl text-left transition-all overflow-hidden h-auto min-h-[6rem] sm:h-32 min-w-0">
17
- <div className="flex-1 cursor-pointer flex flex-col min-w-0" onClick={() => onSelect(sug.command)}>
18
- <div className="flex items-center gap-2 mb-1.5 sm:mb-2">
19
- <div className={`p-1 sm:p-1.5 rounded-full bg-surface-glass shrink-0 ${colorClass}`}><IconComponent size={12} className="sm:w-3.5 sm:h-3.5" /></div>
20
- <span className={`text-[11px] sm:text-xs font-bold truncate ${colorClass}`}>{sug.title}</span>
21
- </div>
22
- <p className="text-xs sm:text-sm text-text-secondary flex-1 leading-snug line-clamp-2 sm:line-clamp-3 overflow-hidden break-words">"{sug.command}"</p>
23
- </div>
24
- </div>
25
- );
26
- })}
27
- </div>
28
- );
29
- });