@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,70 +0,0 @@
1
- import React from 'react';
2
- import { Edit2, Check } from 'lucide-react';
3
-
4
- export interface KeyframeItemProps {
5
- kf: any;
6
- index: number;
7
- isActive: boolean;
8
- isPast: boolean;
9
- isEditing: boolean;
10
- isLast: boolean;
11
- onSeek: (time: number) => void;
12
- onStartEdit: (index: number) => void;
13
- onSaveEdit: (index: number, time: string, speech: string) => void;
14
- }
15
-
16
- export const KeyframeListItem = React.memo(function KeyframeListItem({
17
- kf, index, isActive, isPast, isEditing, isLast, onSeek, onStartEdit, onSaveEdit
18
- }: KeyframeItemProps) {
19
- return (
20
- <div className={`flex items-start w-full gap-3 p-3 rounded-xl border transition-all text-left relative group overflow-hidden ${isActive ? 'bg-cyan-500/10 border-cyan-500/30 shadow-[0_0_15px_rgba(34,211,238,0.1)]' : isPast ? 'bg-surface-glass border-border-default opacity-70 hover:opacity-100' : 'bg-transparent border-transparent text-text-muted hover:bg-surface-glass'}`}>
21
- <button onClick={() => onSeek(kf.t)} className="absolute inset-0 z-0"></button>
22
-
23
- <div className="flex flex-col items-center gap-1 mt-1 relative z-10 pointer-events-none">
24
- <div className={`w-2 h-2 rounded-full shrink-0 ${isActive ? 'bg-cyan-400 shadow-[0_0_8px_rgba(34,211,238,0.8)]' : isPast ? 'bg-surface-glass0' : 'bg-surface-tertiary'}`}></div>
25
- {!isLast && (
26
- <div className={`w-0.5 h-full min-h-[24px] ${isPast && !isActive ? 'bg-surface-glass' : 'bg-surface-tertiary'}`}></div>
27
- )}
28
- </div>
29
- <div className="flex-1 min-w-0 relative z-10">
30
- <div className="flex items-center justify-between mb-1">
31
- {isEditing ? (
32
- <input autoFocus type="number" step="0.5" defaultValue={kf.t} id={`kf-time-${index}`}
33
- className="w-16 bg-surface-glass border border-border-strong rounded px-1 text-xs text-text-primary focus:outline-hidden focus:border-cyan-400" />
34
- ) : (
35
- <span className={`font-mono text-xs ${isActive ? 'text-cyan-400 font-bold' : isPast ? 'text-text-primary' : 'text-text-muted'}`}>{kf.t.toFixed(1)}s</span>
36
- )}
37
-
38
- <div className="flex items-center gap-2">
39
- {kf.canvas && <span className="px-1.5 py-0.5 rounded text-[10px] bg-purple-500/20 text-purple-400 font-mono shrink-0 pointer-events-none">CANVAS</span>}
40
- {isEditing ? (
41
- <button onClick={(e) => {
42
- const timeVal = (document.getElementById(`kf-time-${index}`) as HTMLInputElement)?.value;
43
- const speechVal = (document.getElementById(`kf-speech-${index}`) as HTMLInputElement)?.value;
44
- onSaveEdit(index, timeVal || kf.t.toString(), speechVal !== undefined ? speechVal : (kf.speech || ''));
45
- }} className="p-1 rounded bg-emerald-500/20 text-emerald-400 hover:bg-emerald-500/40 transition-colors pointer-events-auto">
46
- <Check size={12} />
47
- </button>
48
- ) : (
49
- <button onClick={() => onStartEdit(index)} className="p-1 rounded bg-surface-glass text-text-secondary hover:text-text-primary opacity-0 group-hover:opacity-100 transition-all pointer-events-auto">
50
- <Edit2 size={12} />
51
- </button>
52
- )}
53
- </div>
54
- </div>
55
- <div className={`text-sm font-medium truncate pointer-events-none ${isActive ? 'text-text-primary' : isPast ? 'text-text-secondary' : 'text-text-muted'}`}>{kf.state}</div>
56
-
57
- {(kf.speech || isEditing) && (
58
- <div className="mt-1">
59
- {isEditing ? (
60
- <input type="text" defaultValue={kf.speech || ''} id={`kf-speech-${index}`} placeholder="Voz TTS..."
61
- className="w-full bg-surface-glass border border-border-strong rounded px-2 py-1 text-xs text-text-primary focus:outline-hidden focus:border-cyan-400 pointer-events-auto" />
62
- ) : (
63
- <div className="text-xs text-text-muted italic truncate pointer-events-none">"{kf.speech}"</div>
64
- )}
65
- </div>
66
- )}
67
- </div>
68
- </div>
69
- );
70
- });
@@ -1,171 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { motion, AnimatePresence } from 'motion/react';
3
- import { Search, Plus, X, Settings, ChevronDown, Plug, Wrench, Network, PackageOpen, Paintbrush } from 'lucide-react';
4
- import { usePlaygroundStore } from '../../store/usePlaygroundStore';
5
- import { ChatHistoryList } from '@decido/chat';
6
- import { SettingsPanel } from '../settings/SettingsPanel';
7
-
8
- // --------------------------------------------------
9
- // Types
10
- // --------------------------------------------------
11
- export interface SidebarMenuItem { id: string; label: string; icon?: React.ReactNode; onClick: () => void; badge?: string | number; active?: boolean; }
12
- export interface SidebarMenuSection { id: string; title: string; icon?: React.ReactNode; items: SidebarMenuItem[]; collapsible?: boolean; }
13
-
14
- export interface PlaygroundAppSidebarProps {
15
- isOpen: boolean;
16
- onClose: () => void;
17
- menuSections?: SidebarMenuSection[];
18
- onSettings?: () => void;
19
- onProfile?: () => void;
20
- profileName?: string;
21
- profileAvatar?: string;
22
- }
23
-
24
- // --------------------------------------------------
25
- // Sub-components
26
- // --------------------------------------------------
27
- const DevToolsFAB = () => {
28
- const [expanded, setExpanded] = useState(false);
29
- return (
30
- <div className="relative" onMouseLeave={() => setExpanded(false)}>
31
- <button
32
- onClick={() => setExpanded(!expanded)}
33
- className={`w-8 h-8 rounded-lg flex items-center justify-center transition-colors shrink-0 ${expanded ? 'bg-surface-elevated text-text-primary' : 'text-text-muted hover:text-text-primary hover:bg-surface-glass'}`}
34
- title="Herramientas de Desarrollador"
35
- >
36
- <Wrench size={16} />
37
- </button>
38
- <AnimatePresence>
39
- {expanded && (
40
- <motion.div
41
- initial={{ opacity: 0, scale: 0.9, y: 10 }}
42
- animate={{ opacity: 1, scale: 1, y: 0 }}
43
- exit={{ opacity: 0, scale: 0.9, y: 10 }}
44
- transition={{ type: 'spring', stiffness: 400, damping: 25 }}
45
- className="absolute bottom-full right-0 mb-2 flex flex-col gap-2 p-2 rounded-2xl bg-surface-elevated border border-border-default shadow-2xl origin-bottom z-50"
46
- >
47
- <button onClick={() => window.dispatchEvent(new CustomEvent('DECIDO_OPEN_SWARM_WIZARD'))} className="w-10 h-10 rounded-full bg-surface-secondary border border-border-default hover:border-cyan-400/50 flex items-center justify-center text-text-secondary hover:text-cyan-400 transition-all hover:shadow-[0_0_15px_rgba(6,182,212,0.3)]" title="Configuración del Enjambre"><i className="fas fa-cog text-sm" /></button>
48
- <button onClick={() => window.dispatchEvent(new CustomEvent('DECIDO_TOGGLE_TOPOLOGY'))} className="w-10 h-10 rounded-full bg-surface-secondary border border-border-default hover:border-emerald-400/50 flex items-center justify-center text-text-secondary hover:text-emerald-400 transition-all hover:shadow-[0_0_15px_rgba(16,185,129,0.3)]" title="Live Topology"><Network size={16} /></button>
49
- <button onClick={() => window.dispatchEvent(new CustomEvent('DECIDO_OPEN_MARKETPLACE'))} className="w-10 h-10 rounded-full bg-surface-secondary border border-border-default hover:border-indigo-400/50 flex items-center justify-center text-text-secondary hover:text-indigo-400 transition-all hover:shadow-[0_0_15px_rgba(99,102,241,0.3)]" title="Plugin Marketplace"><PackageOpen size={16} /></button>
50
- <button onClick={() => window.dispatchEvent(new CustomEvent('DECIDO_TOGGLE_TW_EDITOR'))} className="w-10 h-10 rounded-full bg-surface-secondary border border-border-default hover:border-purple-400/50 flex items-center justify-center text-text-secondary hover:text-purple-400 transition-all hover:shadow-[0_0_15px_rgba(139,92,246,0.3)]" title="Tailwind Editor"><Paintbrush size={16} /></button>
51
- </motion.div>
52
- )}
53
- </AnimatePresence>
54
- </div>
55
- );
56
- };
57
-
58
- // --------------------------------------------------
59
- // Main Sidebar Component
60
- // --------------------------------------------------
61
- export const PlaygroundAppSidebar = React.memo(function PlaygroundAppSidebar({
62
- isOpen, onClose, menuSections = [], onSettings, onProfile, profileName = 'Usuario', profileAvatar
63
- }: PlaygroundAppSidebarProps) {
64
- const [searchQuery, setSearchQuery] = useState('');
65
- const [collapsedSections, setCollapsedSections] = useState<Set<string>>(new Set());
66
- const [showSettings, setShowSettings] = useState(false);
67
-
68
- const chatInstances = usePlaygroundStore(s => s.chatInstances);
69
- const activeChatId = usePlaygroundStore(s => s.activeChatId);
70
- const addChatInstance = usePlaygroundStore(s => s.addChatInstance);
71
- const removeChatInstance = usePlaygroundStore(s => s.removeChatInstance);
72
- const renameChatInstance = usePlaygroundStore(s => s.renameChatInstance);
73
- const setActiveChatId = usePlaygroundStore(s => s.setActiveChatId);
74
-
75
- const toggleSection = (id: string) => {
76
- setCollapsedSections(prev => { const next = new Set(prev); if (next.has(id)) next.delete(id); else next.add(id); return next; });
77
- };
78
-
79
- const sidebarContent = (showClose = false) => (
80
- <div className="flex flex-col h-full bg-surface-secondary text-text-primary">
81
- {/* Top: Search + New Chat */}
82
- <div className="flex-none p-3 pt-4 space-y-2">
83
- {showClose && (
84
- <div className="flex justify-end mb-1">
85
- <button onClick={onClose} className="w-7 h-7 rounded-full bg-surface-glass hover:bg-surface-elevated flex items-center justify-center text-text-secondary hover:text-text-primary transition-colors">
86
- <X size={14} />
87
- </button>
88
- </div>
89
- )}
90
- <div className="relative">
91
- <Search size={14} className="absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted" />
92
- <input value={searchQuery} onChange={e => setSearchQuery(e.target.value)} placeholder="Buscar conversaciones..."
93
- className="w-full bg-surface-glass border border-border-subtle rounded-lg pl-8 pr-3 py-2 text-sm text-text-primary placeholder-text-muted outline-hidden focus:border-border-strong focus:bg-surface-glass transition-colors" />
94
- {searchQuery && <button onClick={() => setSearchQuery('')} className="absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-primary"><X size={12} /></button>}
95
- </div>
96
- <button onClick={() => addChatInstance()} className="w-full flex items-center gap-2 px-3 py-2 rounded-lg bg-surface-glass border border-border-subtle hover:bg-surface-glass hover:border-border-default transition-colors text-sm text-text-primary hover:text-text-primary">
97
- <Plus size={16} /><span>Nueva conversación</span>
98
- </button>
99
- </div>
100
-
101
- {/* Middle: Scrollable content */}
102
- <div className="flex-1 overflow-y-auto px-3 pb-2 space-y-1" style={{ scrollbarWidth: 'thin', scrollbarColor: 'rgba(255,255,255,0.15) transparent' }}>
103
- {/* Chat History */}
104
- <ChatHistoryList chatInstances={chatInstances} activeChatId={activeChatId || ""} searchQuery={searchQuery}
105
- setActiveChatId={setActiveChatId} renameChatInstance={renameChatInstance} removeChatInstance={removeChatInstance} />
106
-
107
- {/* Dynamic Plugin Sections (below chat history) */}
108
- {menuSections.length > 0 && (
109
- <div className="mt-4 pt-3 border-t border-border-subtle">
110
- {menuSections.map(section => (
111
- <div key={section.id} className="mb-3">
112
- <button onClick={() => section.collapsible && toggleSection(section.id)} className="flex items-center gap-1.5 px-2 py-1.5 text-[11px] font-semibold text-text-muted uppercase tracking-wider w-full hover:text-text-primary transition-colors">
113
- {section.icon}<span className="flex-1 text-left">{section.title}</span>
114
- {section.collapsible && <ChevronDown size={12} className={`transition-transform ${collapsedSections.has(section.id) ? '-rotate-90' : ''}`} />}
115
- </button>
116
- <AnimatePresence>
117
- {!collapsedSections.has(section.id) && (
118
- <motion.div initial={{ height: 0, opacity: 0 }} animate={{ height: 'auto', opacity: 1 }} exit={{ height: 0, opacity: 0 }} className="overflow-hidden">
119
- {section.items.map(item => (
120
- <button key={item.id} onClick={item.onClick} className={`w-full flex items-center gap-2 px-2 py-2 rounded-lg text-sm transition-colors ${item.active ? 'bg-surface-glass text-text-primary' : 'text-text-secondary hover:bg-surface-glass hover:text-text-primary'}`}>
121
- {item.icon}<span className="flex-1 text-left truncate">{item.label}</span>
122
- {item.badge !== undefined && <span className="px-1.5 py-0.5 rounded-full bg-cyan-500/15 text-cyan-400 text-[10px] font-bold">{item.badge}</span>}
123
- </button>
124
- ))}
125
- </motion.div>
126
- )}
127
- </AnimatePresence>
128
- </div>
129
- ))}
130
- </div>
131
- )}
132
- </div>
133
-
134
- {/* Bottom: Footer */}
135
- <div className="flex-none border-t border-border-subtle px-3 py-2">
136
- <div className="flex items-center gap-2">
137
- <button onClick={onProfile} className="flex-1 flex items-center gap-2 px-2 py-2 rounded-lg hover:bg-surface-glass transition-colors group">
138
- <div className="w-7 h-7 rounded-full bg-linear-to-br from-cyan-500 to-purple-600 flex items-center justify-center text-text-primary text-xs font-bold shrink-0">{profileAvatar || profileName.charAt(0).toUpperCase()}</div>
139
- <span className="text-sm text-text-primary group-hover:text-text-primary truncate">{profileName}</span>
140
- </button>
141
- <DevToolsFAB />
142
- <button onClick={() => window.dispatchEvent(new CustomEvent('DECIDO_OPEN_MCP_MODAL'))} className="w-8 h-8 rounded-lg text-text-muted hover:text-text-primary hover:bg-surface-glass flex items-center justify-center transition-colors shrink-0" title="Configuración MCP"><Plug size={16} /></button>
143
- <button onClick={() => setShowSettings(true)} className="w-8 h-8 rounded-lg text-text-muted hover:text-text-primary hover:bg-surface-glass flex items-center justify-center transition-colors shrink-0" title="Configuración"><Settings size={16} /></button>
144
- </div>
145
- </div>
146
-
147
- {/* Settings Panel */}
148
- <SettingsPanel isOpen={showSettings} onClose={() => setShowSettings(false)} />
149
- </div>
150
- );
151
-
152
- const mobileDrawer = (
153
- <AnimatePresence>
154
- {isOpen && (
155
- <>
156
- <motion.div initial={{ opacity: 0 }} animate={{ opacity: 1 }} exit={{ opacity: 0 }} onClick={onClose} className="md:hidden fixed inset-0 bg-surface-overlay backdrop-blur-xs z-40" />
157
- <motion.div initial={{ x: '-100%' }} animate={{ x: 0 }} exit={{ x: '-100%' }} transition={{ type: 'spring', damping: 30, stiffness: 300 }} className="md:hidden fixed inset-y-0 left-0 w-[380px] z-50 shadow-2xl">
158
- {sidebarContent(true)}
159
- </motion.div>
160
- </>
161
- )}
162
- </AnimatePresence>
163
- );
164
-
165
- return (
166
- <>
167
- {mobileDrawer}
168
- {isOpen && <div className="hidden md:flex h-full w-full min-h-0">{sidebarContent(false)}</div>}
169
- </>
170
- );
171
- });
@@ -1,132 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { motion } from 'motion/react';
3
- import { X } from 'lucide-react';
4
- import { BlueprintManagerPanel } from '../studio/BlueprintManagerPanel';
5
- import { DependencyTreePanel } from '../studio/DependencyTreePanel';
6
- import { TimelineTape } from '../controls/TimelineTape';
7
- import { CreatorInputBar } from '../controls/CreatorInputBar';
8
- import { OSToolbar } from '../controls/OSToolbar';
9
-
10
- export interface PlaygroundBottomControlsProps {
11
- step: string;
12
- isVoiceActive: boolean;
13
- setIsVoiceActive: (active: boolean) => void;
14
- currentTime: number;
15
- seekTime: (time: number) => void;
16
- playbackSpeed: number;
17
- setPlaybackSpeed: (speed: number) => void;
18
- isPlaying: boolean;
19
- setIsPlaying: (playing: boolean) => void;
20
- handleResetPlayground: () => void;
21
- dynamicTimelines: any;
22
- prototypeBrand: string;
23
- setPrototypeBrand: (brand: string) => void;
24
- inputValue: string;
25
- setInputValue: (val: string) => void;
26
- isGenerating: boolean;
27
- handleGeneratePlayground: () => void;
28
- showCanvas: boolean;
29
- setShowCanvas: (show: boolean) => void;
30
- isTerminalOpen: boolean;
31
- setIsTerminalOpen: (open: boolean) => void;
32
- isMuted: boolean;
33
- setIsMuted: (muted: boolean) => void;
34
- selectedVoice: string;
35
- setSelectedVoice: (voice: string) => void;
36
- isFullscreen: boolean;
37
- toggleFullscreen: () => void;
38
- demoState: string;
39
- isRecording: boolean;
40
- handleExport: () => void;
41
- dynamicPersona: any;
42
- setSuggestions: (sugs: any) => void;
43
- isCreatorMode: boolean;
44
- setIsCreatorMode: (mode: boolean) => void;
45
- VoiceWidget?: React.ComponentType<any>;
46
- config: any;
47
- }
48
-
49
- export const PlaygroundBottomControls = React.memo(function PlaygroundBottomControls({
50
- step, isVoiceActive, setIsVoiceActive,
51
- currentTime, seekTime, playbackSpeed, setPlaybackSpeed, isPlaying, setIsPlaying, handleResetPlayground,
52
- dynamicTimelines, prototypeBrand, setPrototypeBrand, inputValue, setInputValue,
53
- isGenerating, handleGeneratePlayground,
54
- showCanvas, setShowCanvas, isTerminalOpen, setIsTerminalOpen,
55
- isMuted, setIsMuted, selectedVoice, setSelectedVoice,
56
- isFullscreen, toggleFullscreen, handleExport,
57
- dynamicPersona, setSuggestions, isCreatorMode,
58
- VoiceWidget, config
59
- }: PlaygroundBottomControlsProps) {
60
- if (step === 'action' || step === 'profile') return null;
61
- if (!isCreatorMode && !isVoiceActive) return null;
62
-
63
- const [isBlueprintManagerOpen, setIsBlueprintManagerOpen] = useState(false);
64
- const [isTreeOpen, setIsTreeOpen] = useState(false);
65
- const currentTimeline = dynamicTimelines[prototypeBrand] || { duration: 10, keyframes: [] };
66
-
67
- return (
68
- <>
69
- <div className="absolute bottom-0 left-0 w-full p-3 sm:p-4 md:p-6 bg-linear-to-t from-surface-primary via-surface-primary to-transparent z-40 flex flex-col items-center">
70
- <motion.div layout className={`w-full max-w-4xl relative ${isVoiceActive ? 'h-64' : ''}`}>
71
- {!isVoiceActive ? (
72
- <div className={`bg-surface-tertiary/90 border border-border-default rounded-xl sm:rounded-2xl shadow-xl backdrop-blur-md p-3 sm:p-4 md:p-5 flex flex-col gap-3 sm:gap-4 transition-all ${isCreatorMode ? 'border-purple-500/30' : ''}`}>
73
- {/* Timeline */}
74
- {isCreatorMode && (
75
- <TimelineTape
76
- currentTime={currentTime} seekTime={seekTime}
77
- playbackSpeed={playbackSpeed} setPlaybackSpeed={setPlaybackSpeed}
78
- isPlaying={isPlaying} setIsPlaying={setIsPlaying}
79
- handleResetPlayground={handleResetPlayground}
80
- currentTimeline={currentTimeline}
81
- />
82
- )}
83
-
84
- {/* Creator Input + OS Toolbar */}
85
- {isCreatorMode && (
86
- <>
87
- <CreatorInputBar
88
- inputValue={inputValue} setInputValue={setInputValue}
89
- isGenerating={isGenerating} handleGeneratePlayground={handleGeneratePlayground}
90
- setIsVoiceActive={setIsVoiceActive}
91
- prototypeBrand={prototypeBrand} handleExport={handleExport}
92
- />
93
- <OSToolbar
94
- dynamicTimelines={dynamicTimelines} prototypeBrand={prototypeBrand}
95
- showCanvas={showCanvas} setShowCanvas={setShowCanvas}
96
- isTerminalOpen={isTerminalOpen} setIsTerminalOpen={setIsTerminalOpen}
97
- isMuted={isMuted} setIsMuted={setIsMuted}
98
- selectedVoice={selectedVoice} setSelectedVoice={setSelectedVoice}
99
- isFullscreen={isFullscreen} toggleFullscreen={toggleFullscreen}
100
- handleExport={handleExport} config={config}
101
- isBlueprintManagerOpen={isBlueprintManagerOpen} setIsBlueprintManagerOpen={setIsBlueprintManagerOpen}
102
- isTreeOpen={isTreeOpen} setIsTreeOpen={setIsTreeOpen}
103
- />
104
- </>
105
- )}
106
- </div>
107
- ) : (
108
- <div className="flex flex-col w-full h-full relative p-2 bg-surface-tertiary border border-cyan-500/30 rounded-4xl shadow-lg">
109
- <div className="flex w-full items-center justify-between mb-2">
110
- <span className="text-cyan-400 font-medium px-4 bg-linear-to-r from-cyan-400 via-purple-400 to-indigo-400 text-transparent bg-clip-text animate-pulse">Capturando Audio de IA...</span>
111
- <button onClick={() => setIsVoiceActive(false)} className="w-8 h-8 rounded-full bg-surface-glass hover:bg-surface-glass flex items-center justify-center text-text-secondary hover:text-text-primary transition-colors"><X size={16} /></button>
112
- </div>
113
- <div className="flex-1 w-full rounded-2xl overflow-hidden relative">
114
- {VoiceWidget ? (
115
- <VoiceWidget
116
- isCompact={true} persona={dynamicPersona}
117
- onSuggestionsUpdate={setSuggestions} selectedVoice={selectedVoice}
118
- controls={{ setPrototypeBrand, setShowCanvas, setIsPlaying, handleExport, setInputValue, handleGeneratePlayground }}
119
- />
120
- ) : (
121
- <div className="p-4 flex flex-col items-center justify-center h-full text-text-muted font-mono text-sm border border-border-subtle rounded-xl bg-surface-glass">Módulo de Voz no proporcionado.</div>
122
- )}
123
- </div>
124
- </div>
125
- )}
126
- </motion.div>
127
- </div>
128
- <BlueprintManagerPanel isOpen={isBlueprintManagerOpen} onClose={() => setIsBlueprintManagerOpen(false)} />
129
- <DependencyTreePanel isOpen={isTreeOpen} onClose={() => setIsTreeOpen(false)} />
130
- </>
131
- );
132
- });
@@ -1,87 +0,0 @@
1
- import React from 'react';
2
- import { motion, AnimatePresence } from 'motion/react';
3
- import { X, ArrowLeft, Layers, Code2, Droplets, Monitor, MonitorPlay } from 'lucide-react';
4
- import { usePlaygroundStore } from '../../store/usePlaygroundStore';
5
- import { useMorphologyStore, MorphStageType } from '../../store/useMorphologyStore';
6
- import { StageContentRenderer } from '../studio/editor/StageContentRenderer';
7
-
8
- const STAGE_META: Record<MorphStageType, { icon: React.ComponentType<any>; label: string; color: string }> = {
9
- 'workbench': { icon: Code2, label: 'Workbench', color: 'text-purple-400' },
10
- 'liquid': { icon: Droplets, label: 'UI Dinámica', color: 'text-amber-400' },
11
- 'artifact': { icon: MonitorPlay, label: 'Artefacto', color: 'text-emerald-400' },
12
- 'custom': { icon: Layers, label: 'Custom', color: 'text-violet-400' },
13
- };
14
-
15
- export interface PlaygroundCanvasProps {
16
- showCanvas: boolean; setShowCanvas: (show: boolean) => void;
17
- activeConfig: any; prototypeBrand: string; activeState?: string;
18
- chartData: { val: number }[]; dragConstraintsRef: React.RefObject<HTMLDivElement | null>;
19
- }
20
-
21
- export const PlaygroundCanvas = React.memo(function PlaygroundCanvas({
22
- showCanvas, setShowCanvas, activeConfig, prototypeBrand, activeState, chartData, dragConstraintsRef
23
- }: PlaygroundCanvasProps) {
24
- if (!showCanvas) return null;
25
-
26
- const activeStage = useMorphologyStore(s => s.activeStage);
27
- const stageHistory = useMorphologyStore(s => s.stageHistory);
28
- const popStage = useMorphologyStore(s => s.popStage);
29
- const clearStages = useMorphologyStore(s => s.clearStages);
30
- const activeArtifactData = usePlaygroundStore(s => s.activeArtifactData);
31
- const [defaultViewMode, setDefaultViewMode] = React.useState<'2d' | '3d'>('3d');
32
-
33
- const effectiveStage = activeStage || (activeArtifactData ? { type: 'artifact' as const, data: activeArtifactData } : null);
34
- const renderingType: MorphStageType = effectiveStage?.type || defaultViewMode;
35
- const stageMeta = STAGE_META[renderingType] || STAGE_META['custom'];
36
- const StageIcon = stageMeta.icon;
37
-
38
- const handleClose = () => { clearStages(); usePlaygroundStore.getState().setActiveArtifactData(null); setShowCanvas(false); };
39
- const handleBack = () => { stageHistory.length > 0 ? popStage() : clearStages(); };
40
-
41
- return (
42
- <AnimatePresence>
43
- <motion.div initial={{ opacity: 0, scale: 0.95 }} animate={{ opacity: 1, scale: 1 }} exit={{ opacity: 0, scale: 0.95 }}
44
- className="w-full h-full bg-surface-secondary flex flex-col overflow-hidden relative border-l border-border-subtle">
45
- {/* Header */}
46
- <div className="flex justify-between items-center pl-2 z-10 p-4 pb-0 shrink-0">
47
- <div className="flex items-center gap-2">
48
- {(activeStage || activeArtifactData) && <button onClick={handleBack} className="p-1.5 rounded-lg hover:bg-surface-glass text-text-muted hover:text-text-primary transition-colors" title="Volver"><ArrowLeft size={16} /></button>}
49
- <h2 className="text-lg font-bold flex items-center gap-2 text-text-primary">
50
- <div className="w-7 h-7 rounded-lg flex items-center justify-center bg-surface-glass"><StageIcon size={14} className={stageMeta.color} /></div>
51
- <span className="truncate max-w-[200px]">{activeStage?.label || (activeArtifactData ? 'Artefacto' : 'Lienzo de Trabajo')}</span>
52
- <span className="text-text-muted font-mono text-[10px] ml-1">{renderingType.toUpperCase()}</span>
53
- </h2>
54
- </div>
55
- <div className="flex items-center gap-3">
56
- {stageHistory.length > 0 && (
57
- <div className="hidden md:flex items-center gap-1 text-[10px] text-text-muted font-mono">
58
- {stageHistory.map((s, i) => (
59
- <React.Fragment key={i}>
60
- <span className="hover:text-text-secondary cursor-pointer" onClick={() => { const st = useMorphologyStore.getState(); for (let j = 0; j < stageHistory.length - i; j++) st.popStage(); }}>{s.label || s.type}</span><span>›</span>
61
- </React.Fragment>
62
- ))}
63
- <span className="text-text-secondary">{activeStage?.label || renderingType}</span>
64
- </div>
65
- )}
66
- {!effectiveStage && (
67
- <div className="flex bg-surface-glass border border-border-default rounded-full p-1">
68
- <button onClick={() => setDefaultViewMode('2d')} className={`px-3 py-1 text-[10px] font-bold tracking-wider rounded-full transition-all ${defaultViewMode === '2d' ? 'bg-surface-glass text-text-primary shadow-xs' : 'text-text-muted hover:text-text-primary'}`}>2D DATA</button>
69
- <button onClick={() => setDefaultViewMode('3d')} className={`px-3 py-1 text-[10px] font-bold tracking-wider rounded-full transition-all ${defaultViewMode === '3d' ? 'bg-cyan-500/20 text-cyan-400 shadow-[0_0_10px_rgba(6,182,212,0.3)]' : 'text-text-muted hover:text-text-primary'}`}>3D SCENE</button>
70
- </div>
71
- )}
72
- <button onClick={handleClose} className="p-2 bg-surface-glass hover:bg-red-500/20 text-text-secondary hover:text-red-400 rounded-full transition-colors"><X size={16} /></button>
73
- </div>
74
- </div>
75
- {/* Stage Content */}
76
- <div className="flex-1 relative overflow-hidden">
77
- <AnimatePresence mode="wait">
78
- <motion.div key={renderingType + (activeStage?.componentId || '')} initial={{ opacity: 0, y: 10 }} animate={{ opacity: 1, y: 0 }} exit={{ opacity: 0, y: -10 }} transition={{ duration: 0.2 }} className="w-full h-full">
79
- <StageContentRenderer renderingType={renderingType} activeStage={activeStage} activeArtifactData={activeArtifactData} activeConfig={activeConfig}
80
- activeState={activeState} prototypeBrand={prototypeBrand} chartData={chartData} dragConstraintsRef={dragConstraintsRef} defaultViewMode={defaultViewMode} />
81
- </motion.div>
82
- </AnimatePresence>
83
- </div>
84
- </motion.div>
85
- </AnimatePresence>
86
- );
87
- });