@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,162 +0,0 @@
1
- import React, { useState, useEffect } from 'react';
2
- import { BaseNode } from '@decido/macia-core';
3
- import {
4
- MessageCircle, Mail, Phone, Bell, Send,
5
- Clock, TrendingUp, Eye, CheckCheck, AlertCircle
6
- } from 'lucide-react';
7
-
8
- /* ═══════════════════════════════════════════════════════════════
9
- KIA OMNICHANNEL NODE — Communication Hub · Grecco Motors
10
- WhatsApp + Email + SMS + Push — Unified inbox, templates, metrics
11
- ═══════════════════════════════════════════════════════════════ */
12
-
13
- interface Channel {
14
- name: string;
15
- icon: string;
16
- sent: number;
17
- opened: number;
18
- replied: number;
19
- converted: number;
20
- avgResponse: string;
21
- color: string;
22
- }
23
-
24
- const CHANNELS: Channel[] = [
25
- { name: 'WhatsApp', icon: '💬', sent: 1245, opened: 1180, replied: 892, converted: 67, avgResponse: '2.3 min', color: '#22c55e' },
26
- { name: 'Email', icon: '📧', sent: 3420, opened: 1368, replied: 342, converted: 28, avgResponse: '4.2 hrs', color: '#3b82f6' },
27
- { name: 'SMS', icon: '📱', sent: 890, opened: 712, replied: 178, converted: 15, avgResponse: '18 min', color: '#f59e0b' },
28
- { name: 'Push', icon: '🔔', sent: 2100, opened: 840, replied: 0, converted: 42, avgResponse: 'N/A', color: '#a855f7' },
29
- ];
30
-
31
- const TEMPLATES = [
32
- { name: 'Bienvenida Lead', channels: ['WhatsApp', 'Email'], stage: 'Lead', uses: 234, openRate: 94 },
33
- { name: 'Seguimiento 48h', channels: ['WhatsApp', 'SMS'], stage: 'Contacto', uses: 178, openRate: 88 },
34
- { name: 'Confirmación Test Drive', channels: ['WhatsApp', 'Email', 'SMS'], stage: 'Test Drive', uses: 89, openRate: 97 },
35
- { name: 'Cotización Enviada', channels: ['Email', 'WhatsApp'], stage: 'Cotización', uses: 156, openRate: 91 },
36
- { name: 'NPS Post-Servicio', channels: ['WhatsApp', 'SMS'], stage: 'Servicio', uses: 312, openRate: 82 },
37
- { name: 'Recall Vehículo', channels: ['Email', 'SMS', 'Push'], stage: 'Urgente', uses: 45, openRate: 96 },
38
- ];
39
-
40
- const CONVERSATIONS = [
41
- { name: 'María Gómez', channel: 'WhatsApp', time: '17:28', msg: '¿El EV6 tiene carga rápida V2L?', status: 'pending', avatar: '🟢' },
42
- { name: 'Carlos Ruiz', channel: 'Email', time: '17:15', msg: 'Re: Cotización Sportage Premium', status: 'replied', avatar: '🔵' },
43
- { name: 'Laura Mejía', channel: 'WhatsApp', time: '16:58', msg: '¡Gracias por el servicio! ⭐⭐⭐⭐⭐', status: 'resolved', avatar: '🟢' },
44
- { name: 'Diego Arias', channel: 'SMS', time: '16:42', msg: 'OK confirmo test drive sábado 10am', status: 'replied', avatar: '🟡' },
45
- { name: 'Pedro Martínez', channel: 'WhatsApp', time: '16:30', msg: '¿Ya resolvieron mi reclamación?', status: 'escalated', avatar: '🔴' },
46
- ];
47
-
48
- export const KiaOmnichannelNode = (props: any) => {
49
- const [tab, setTab] = useState<'inbox' | 'templates' | 'metrics'>('inbox');
50
- const [channels, setChannels] = useState(CHANNELS.map(c => ({ ...c })));
51
-
52
- const totalSent = channels.reduce((s, c) => s + c.sent, 0);
53
- const totalConverted = channels.reduce((s, c) => s + c.converted, 0);
54
-
55
- useEffect(() => {
56
- const interval = setInterval(() => {
57
- setChannels(prev => prev.map(c => ({
58
- ...c,
59
- sent: c.sent + Math.floor(Math.random() * 3),
60
- opened: c.opened + Math.floor(Math.random() * 2),
61
- })));
62
- }, 5000);
63
- return () => clearInterval(interval);
64
- }, []);
65
-
66
- const statusColor = (s: string) =>
67
- s === 'pending' ? 'text-yellow-400' : s === 'replied' ? 'text-blue-400' : s === 'resolved' ? 'text-green-400' : 'text-red-400';
68
- const statusLabel = (s: string) =>
69
- s === 'pending' ? 'Pendiente' : s === 'replied' ? 'Respondido' : s === 'resolved' ? 'Resuelto' : 'Escalado';
70
-
71
- return (
72
- <BaseNode {...props} title="Kia Omnichannel" width={500} height={620}>
73
- <div className="flex flex-col h-full bg-slate-950 text-white overflow-hidden">
74
-
75
- {/* Header */}
76
- <div className="flex items-center gap-3 p-3 bg-slate-900 border-b border-slate-800">
77
- <div className="w-9 h-9 rounded-full bg-green-600/20 flex items-center justify-center border border-green-500/30">
78
- <Send size={16} className="text-green-400" />
79
- </div>
80
- <div className="flex-1">
81
- <div className="text-xs font-bold tracking-wide flex items-center gap-2">
82
- OMNICHANNEL HUB
83
- <span className="text-[8px] px-1.5 py-0.5 bg-green-500/20 text-green-400 rounded">{CHANNELS.length} CANALES</span>
84
- </div>
85
- <div className="text-[10px] text-slate-400">Grecco Motors · {totalSent.toLocaleString()} mensajes · {totalConverted} conversiones</div>
86
- </div>
87
- </div>
88
-
89
- {/* Tabs */}
90
- <div className="flex gap-1 p-2 bg-slate-900/50 border-b border-slate-800">
91
- {([
92
- { key: 'inbox' as const, label: '📥 Inbox' },
93
- { key: 'templates' as const, label: '📋 Templates' },
94
- { key: 'metrics' as const, label: '📊 Métricas' },
95
- ]).map(t => (
96
- <button key={t.key} onClick={() => setTab(t.key)}
97
- className={`flex-1 py-1.5 rounded text-[9px] font-bold transition-all ${tab === t.key ? 'bg-green-600/20 text-green-400 border border-green-500/30' : 'text-slate-500'
98
- }`}>
99
- {t.label}
100
- </button>
101
- ))}
102
- </div>
103
-
104
- <div className="flex-1 overflow-y-auto p-3 space-y-1.5">
105
-
106
- {tab === 'inbox' && CONVERSATIONS.map((c, i) => (
107
- <div key={i} className="bg-slate-900/50 rounded-lg p-2.5 border border-slate-800 flex items-start gap-2">
108
- <span className="text-sm">{c.avatar}</span>
109
- <div className="flex-1 min-w-0">
110
- <div className="flex items-center justify-between">
111
- <span className="text-[10px] font-bold">{c.name}</span>
112
- <span className="text-[8px] text-slate-500">{c.time}</span>
113
- </div>
114
- <div className="text-[9px] text-slate-400 truncate">{c.msg}</div>
115
- <div className="flex items-center gap-2 mt-0.5">
116
- <span className="text-[8px] text-slate-600">{c.channel}</span>
117
- <span className={`text-[8px] font-bold ${statusColor(c.status)}`}>{statusLabel(c.status)}</span>
118
- </div>
119
- </div>
120
- </div>
121
- ))}
122
-
123
- {tab === 'templates' && TEMPLATES.map(t => (
124
- <div key={t.name} className="bg-slate-900/50 rounded-lg p-2.5 border border-slate-800">
125
- <div className="flex items-center justify-between mb-1">
126
- <span className="text-[10px] font-bold">{t.name}</span>
127
- <span className="text-[9px] text-green-400 font-bold">{t.openRate}% open</span>
128
- </div>
129
- <div className="flex items-center gap-2 text-[8px]">
130
- <span className="text-slate-500">Stage: {t.stage}</span>
131
- <span className="text-slate-500">Usado: {t.uses}×</span>
132
- <span className="text-slate-600">{t.channels.join(' · ')}</span>
133
- </div>
134
- </div>
135
- ))}
136
-
137
- {tab === 'metrics' && channels.map(c => (
138
- <div key={c.name} className="bg-slate-900/50 rounded-lg p-3 border border-slate-800"
139
- style={{ borderLeftWidth: '2px', borderLeftColor: c.color }}>
140
- <div className="flex items-center justify-between mb-1.5">
141
- <span className="text-[11px] font-bold">{c.icon} {c.name}</span>
142
- <span className="text-[9px] text-slate-500">⏱ {c.avgResponse}</span>
143
- </div>
144
- <div className="grid grid-cols-4 gap-1 text-center text-[8px]">
145
- <div><div className="font-bold text-[10px]" style={{ color: c.color }}>{c.sent}</div>Enviados</div>
146
- <div><div className="font-bold text-[10px] text-blue-400">{c.opened}</div>Abiertos</div>
147
- <div><div className="font-bold text-[10px] text-purple-400">{c.replied}</div>Replies</div>
148
- <div><div className="font-bold text-[10px] text-green-400">{c.converted}</div>Conv</div>
149
- </div>
150
- <div className="flex items-center gap-1 mt-1.5">
151
- <div className="flex-1 h-1 bg-slate-800 rounded-full">
152
- <div className="h-full rounded-full" style={{ width: `${(c.opened / c.sent) * 100}%`, background: c.color }} />
153
- </div>
154
- <span className="text-[8px] text-slate-500">{((c.opened / c.sent) * 100).toFixed(0)}% open</span>
155
- </div>
156
- </div>
157
- ))}
158
- </div>
159
- </div>
160
- </BaseNode>
161
- );
162
- };
@@ -1,152 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { BaseNode } from '@decido/macia-core';
3
- import {
4
- Wallet, TrendingUp, Calendar, BarChart3, Award,
5
- CheckCircle, Clock, AlertTriangle
6
- } from 'lucide-react';
7
-
8
- /* ═══════════════════════════════════════════════════════════════
9
- KIA PBI BUDGET NODE — Mirror de PowerBI "Budget Comarketing"
10
- Datos REALES Grecco Motors · 2026
11
- ═══════════════════════════════════════════════════════════════ */
12
-
13
- const fmtM = (n: number) => `$${(n / 1000000).toFixed(1)}M`;
14
-
15
- const MONTHS = [
16
- { month: 'Ene 2026', class: 'S', partner: 99.4, retail: 181, retailTarget: 165, compliance: 109.7, budget: 23100000, booster: 7700000, total: 30951000 },
17
- { month: 'Feb 2026', class: '—', partner: 0, retail: 0, retailTarget: 0, compliance: 0, budget: 0, booster: 0, total: 0 },
18
- ];
19
-
20
- const BUDGET_STATUS = [
21
- { label: 'Solicitado', value: 38006159, color: '#3b82f6' },
22
- { label: 'Disponible', value: 38006159, color: '#22c55e' },
23
- { label: 'Por Vencer (Sol)', value: 0, color: '#f59e0b' },
24
- { label: 'Vencido (Sol)', value: 0, color: '#ef4444' },
25
- ];
26
-
27
- const HISTORY = [
28
- { month: 'Oct 2025', budget: 22500000, booster: 7500000, runt: 165 },
29
- { month: 'Nov 2025', budget: 21800000, booster: 7270000, runt: 158 },
30
- { month: 'Dic 2025', budget: 22200000, booster: 7400000, runt: 182 },
31
- { month: 'Ene 2026', budget: 23100000, booster: 7700000, runt: 181 },
32
- ];
33
-
34
- export const KiaPBIBudgetNode = (props: any) => {
35
- const [tab, setTab] = useState<'resumen' | 'matriz' | 'variacion'>('resumen');
36
- const acumulado = 38006159;
37
-
38
- return (
39
- <BaseNode {...props} title="Budget Comarketing — PBI" width={500} height={620}>
40
- <div className="flex flex-col h-full bg-[#1a1a2e] text-white overflow-hidden">
41
-
42
- {/* Header */}
43
- <div className="flex items-center gap-3 p-3 bg-[#16213e] border-b border-orange-900/40">
44
- <div className="w-9 h-9 rounded bg-orange-600/20 flex items-center justify-center">
45
- <Wallet size={16} className="text-orange-400" />
46
- </div>
47
- <div className="flex-1">
48
- <div className="text-xs font-bold tracking-wide flex items-center gap-2">
49
- BUDGET COMARKETING
50
- <span className="text-[8px] px-1.5 py-0.5 bg-yellow-500/20 text-yellow-400 rounded">2026</span>
51
- <span className="text-[8px] px-1.5 py-0.5 bg-orange-500/20 text-orange-400 rounded">POWER BI</span>
52
- </div>
53
- <div className="text-[10px] text-slate-400">Grupo Grecco · Acumulado: {fmtM(acumulado)}</div>
54
- </div>
55
- </div>
56
-
57
- {/* KPIs */}
58
- <div className="flex gap-1 px-3 py-2 border-b border-orange-900/20">
59
- {[
60
- { label: 'Acumulado', val: fmtM(acumulado), color: 'text-orange-400' },
61
- { label: 'Class. Ene', val: 'S', color: 'text-yellow-400' },
62
- { label: 'Partner', val: '99.4%', color: 'text-green-400' },
63
- { label: 'Retail', val: '109.7%', color: 'text-blue-400' },
64
- ].map(k => (
65
- <div key={k.label} className="flex-1 text-center bg-[#16213e]/50 rounded p-1.5 border border-orange-900/10">
66
- <div className={`text-[10px] font-bold ${k.color}`}>{k.val}</div>
67
- <div className="text-[7px] text-slate-500">{k.label}</div>
68
- </div>
69
- ))}
70
- </div>
71
-
72
- {/* Tabs */}
73
- <div className="flex gap-1 p-2 bg-[#16213e]/30 border-b border-orange-900/20">
74
- {([
75
- { key: 'resumen' as const, label: '📊 Resumen' },
76
- { key: 'matriz' as const, label: '📋 Matriz' },
77
- { key: 'variacion' as const, label: '📈 Variación' },
78
- ]).map(t => (
79
- <button key={t.key} onClick={() => setTab(t.key)}
80
- className={`flex-1 py-1.5 rounded text-[9px] font-bold transition-all ${tab === t.key ? 'bg-orange-600/20 text-orange-300 border border-orange-500/30' : 'text-slate-500'
81
- }`}>
82
- {t.label}
83
- </button>
84
- ))}
85
- </div>
86
-
87
- <div className="flex-1 overflow-y-auto p-3 space-y-2">
88
-
89
- {tab === 'resumen' && (
90
- <>
91
- <div className="text-[9px] text-slate-500 font-bold uppercase mb-1">Estado del Presupuesto</div>
92
- {BUDGET_STATUS.map(b => (
93
- <div key={b.label} className="bg-[#16213e]/40 rounded p-2.5 border border-orange-900/10"
94
- style={{ borderLeftWidth: '3px', borderLeftColor: b.color }}>
95
- <div className="flex items-center justify-between">
96
- <span className="text-[10px] font-bold">{b.label}</span>
97
- <span className="text-[10px] font-bold" style={{ color: b.color }}>{fmtM(b.value)}</span>
98
- </div>
99
- </div>
100
- ))}
101
- <div className="bg-green-500/10 rounded p-2.5 border border-green-500/20 text-[9px] text-green-400 mt-2">
102
- ✅ Enero 2026: Retail 181 uds (meta 165) = 109.7% cumplimiento · Class S · Budget $30.9M
103
- </div>
104
- </>
105
- )}
106
-
107
- {tab === 'matriz' && (
108
- <>
109
- <div className="text-[9px] text-slate-500 font-bold uppercase mb-1">Matriz 2026</div>
110
- <div className="bg-[#16213e]/40 rounded-lg border border-orange-900/20">
111
- <div className="grid grid-cols-5 gap-0 text-[7px] font-bold text-slate-500 p-2 border-b border-orange-900/10">
112
- <div>Mes</div><div className="text-center">Class</div><div className="text-right">Budget</div><div className="text-right">Booster</div><div className="text-right">Total</div>
113
- </div>
114
- {MONTHS.map(m => (
115
- <div key={m.month} className="grid grid-cols-5 gap-0 text-[9px] p-2 border-b border-orange-900/5">
116
- <div className="font-bold">{m.month}</div>
117
- <div className="text-center font-bold text-yellow-400">{m.class}</div>
118
- <div className="text-right text-slate-400">{m.budget ? fmtM(m.budget) : '—'}</div>
119
- <div className="text-right text-blue-400">{m.booster ? fmtM(m.booster) : '—'}</div>
120
- <div className="text-right font-bold text-orange-400">{m.total ? fmtM(m.total) : '—'}</div>
121
- </div>
122
- ))}
123
- </div>
124
- <div className="bg-orange-500/10 rounded p-2 border border-orange-500/20 text-[9px] text-orange-400 mt-1">
125
- 📌 Feb 2026: Pendiente consolidación. Acumulado: {fmtM(acumulado)}
126
- </div>
127
- </>
128
- )}
129
-
130
- {tab === 'variacion' && (
131
- <>
132
- <div className="text-[9px] text-slate-500 font-bold uppercase mb-1">Histórico Budget & RUNT</div>
133
- {HISTORY.map(h => (
134
- <div key={h.month} className="bg-[#16213e]/40 rounded-lg p-2.5 border border-orange-900/10">
135
- <div className="flex items-center justify-between mb-1">
136
- <span className="text-[10px] font-bold">{h.month}</span>
137
- <span className="text-[10px] font-bold text-cyan-400">{h.runt} RUNT</span>
138
- </div>
139
- <div className="flex gap-2 text-[9px]">
140
- <span className="text-slate-400">Budget: <span className="font-bold text-orange-400">{fmtM(h.budget)}</span></span>
141
- <span className="text-slate-400">Booster: <span className="font-bold text-blue-400">{fmtM(h.booster)}</span></span>
142
- <span className="text-slate-400">Total: <span className="font-bold text-yellow-400">{fmtM(h.budget + h.booster)}</span></span>
143
- </div>
144
- </div>
145
- ))}
146
- </>
147
- )}
148
- </div>
149
- </div>
150
- </BaseNode>
151
- );
152
- };
@@ -1,206 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { BaseNode } from '@decido/macia-core';
3
- import {
4
- TrendingUp, Users, Clock, BarChart3, Target,
5
- Globe, MapPin, UserCheck, Megaphone
6
- } from 'lucide-react';
7
-
8
- /* ═══════════════════════════════════════════════════════════════
9
- KIA PBI CONVERSION NODE — Mirror de PowerBI "Conversión - CRM"
10
- Datos REALES Grecco Motors · Febrero 2026
11
- ═══════════════════════════════════════════════════════════════ */
12
-
13
- const KPIS = [
14
- { label: 'Conversión', value: '10.6%', delta: '+1.2%', positive: true },
15
- { label: 'Lead Time', value: '5 días', delta: '-67%', positive: true },
16
- { label: 'Opps Totales', value: '908', delta: '-43%', positive: false },
17
- { label: 'Opps Únicas', value: '868', delta: '-42%', positive: false },
18
- { label: 'Ventas Únicas', value: '92', delta: '-35%', positive: false },
19
- ];
20
-
21
- const CHANNELS = [
22
- { canal: 'Walk-in', conv: 34.6, color: '#22c55e' },
23
- { canal: 'Concesionario', conv: 14.7, color: '#3b82f6' },
24
- { canal: 'Marca', conv: 2.0, color: '#f59e0b' },
25
- { canal: 'Digital', conv: 1.2, color: '#ef4444' },
26
- ];
27
-
28
- const GEO = [
29
- { ciudad: 'Bucaramanga', conv: 11.7, color: '#22c55e' },
30
- { ciudad: 'Cúcuta', conv: 9.4, color: '#3b82f6' },
31
- ];
32
-
33
- const SEGMENTS = [
34
- { seg: 'SUV', conv: 12.8, color: '#8b5cf6' },
35
- { seg: 'Automóvil', conv: 9.9, color: '#06b6d4' },
36
- ];
37
-
38
- const MATRIX = [
39
- { fuente: 'Showroom', opsUnicas: 226, ventas: 82, conv: 36.3 },
40
- { fuente: 'BTL', opsUnicas: 19, ventas: 2, conv: 10.5 },
41
- { fuente: 'Redes Sociales', opsUnicas: 489, ventas: 3, conv: 0.6 },
42
- ];
43
-
44
- const CAMPAIGNS = [
45
- { campaign: 'Walk-in', conv: 34.6, ventas: 84, platform: '—' },
46
- { campaign: 'General', conv: 3.4, ventas: 6, platform: 'META' },
47
- { campaign: 'Leads', conv: 0.6, ventas: 2, platform: 'META' },
48
- ];
49
-
50
- const SELLERS = [
51
- { name: 'Johan S. Blanco', leads: 142, pct: 91 },
52
- { name: 'Paola E. Ortega', leads: 5, pct: 3.2 },
53
- { name: 'Aura Y. Joya', leads: 2, pct: 1.3 },
54
- ];
55
-
56
- export const KiaPBIConversionNode = (props: any) => {
57
- const [tab, setTab] = useState<'overview' | 'matrix' | 'campaigns'>('overview');
58
-
59
- return (
60
- <BaseNode {...props} title="Conversión CRM — PBI" width={520} height={640}>
61
- <div className="flex flex-col h-full bg-[#1a1a2e] text-white overflow-hidden">
62
-
63
- {/* Header */}
64
- <div className="flex items-center gap-3 p-3 bg-[#16213e] border-b border-indigo-900/40">
65
- <div className="w-9 h-9 rounded bg-indigo-600/20 flex items-center justify-center">
66
- <TrendingUp size={16} className="text-indigo-400" />
67
- </div>
68
- <div className="flex-1">
69
- <div className="text-xs font-bold tracking-wide flex items-center gap-2">
70
- CONVERSIÓN — CRM
71
- <span className="text-[8px] px-1.5 py-0.5 bg-yellow-500/20 text-yellow-400 rounded">FEB 2026</span>
72
- <span className="text-[8px] px-1.5 py-0.5 bg-indigo-500/20 text-indigo-400 rounded">POWER BI</span>
73
- </div>
74
- <div className="text-[10px] text-slate-400">Grecco Motors · 5 hojas · Conversión 10.6%</div>
75
- </div>
76
- </div>
77
-
78
- {/* KPI Row */}
79
- <div className="flex gap-1 px-2 py-2 border-b border-indigo-900/20">
80
- {KPIS.map(k => (
81
- <div key={k.label} className="flex-1 text-center bg-[#16213e]/50 rounded p-1 border border-indigo-900/10">
82
- <div className="text-[10px] font-bold text-white">{k.value}</div>
83
- <div className={`text-[7px] font-bold ${k.positive ? 'text-green-400' : 'text-red-400'}`}>{k.delta}</div>
84
- <div className="text-[7px] text-slate-500">{k.label}</div>
85
- </div>
86
- ))}
87
- </div>
88
-
89
- {/* Tabs */}
90
- <div className="flex gap-1 p-2 bg-[#16213e]/30 border-b border-indigo-900/20">
91
- {([
92
- { key: 'overview' as const, label: '📊 Overview' },
93
- { key: 'matrix' as const, label: '📋 Matriz' },
94
- { key: 'campaigns' as const, label: '🎯 Campañas' },
95
- ]).map(t => (
96
- <button key={t.key} onClick={() => setTab(t.key)}
97
- className={`flex-1 py-1.5 rounded text-[9px] font-bold transition-all ${tab === t.key ? 'bg-indigo-600/30 text-indigo-300 border border-indigo-500/30' : 'text-slate-500'
98
- }`}>
99
- {t.label}
100
- </button>
101
- ))}
102
- </div>
103
-
104
- <div className="flex-1 overflow-y-auto p-3 space-y-2">
105
-
106
- {tab === 'overview' && (
107
- <>
108
- <div className="text-[9px] text-slate-500 font-bold uppercase mb-1">Conversión por Canal</div>
109
- {CHANNELS.map(c => (
110
- <div key={c.canal} className="bg-[#16213e]/40 rounded p-2 border border-indigo-900/10"
111
- style={{ borderLeftWidth: '3px', borderLeftColor: c.color }}>
112
- <div className="flex items-center justify-between">
113
- <span className="text-[10px] font-bold">{c.canal}</span>
114
- <span className="text-[11px] font-black" style={{ color: c.color }}>{c.conv}%</span>
115
- </div>
116
- <div className="h-1.5 bg-[#0a0f1a] rounded-full mt-1">
117
- <div className="h-full rounded-full" style={{ width: `${c.conv}%`, background: c.color }} />
118
- </div>
119
- </div>
120
- ))}
121
-
122
- <div className="flex gap-2 mt-2">
123
- <div className="flex-1">
124
- <div className="text-[8px] text-slate-500 font-bold uppercase mb-1">Geografía</div>
125
- {GEO.map(g => (
126
- <div key={g.ciudad} className="bg-[#16213e]/40 rounded p-1.5 mb-1 flex items-center justify-between border border-indigo-900/10">
127
- <span className="text-[9px]">{g.ciudad}</span>
128
- <span className="text-[10px] font-bold" style={{ color: g.color }}>{g.conv}%</span>
129
- </div>
130
- ))}
131
- </div>
132
- <div className="flex-1">
133
- <div className="text-[8px] text-slate-500 font-bold uppercase mb-1">Segmento</div>
134
- {SEGMENTS.map(s => (
135
- <div key={s.seg} className="bg-[#16213e]/40 rounded p-1.5 mb-1 flex items-center justify-between border border-indigo-900/10">
136
- <span className="text-[9px]">{s.seg}</span>
137
- <span className="text-[10px] font-bold" style={{ color: s.color }}>{s.conv}%</span>
138
- </div>
139
- ))}
140
- </div>
141
- </div>
142
- </>
143
- )}
144
-
145
- {tab === 'matrix' && (
146
- <>
147
- <div className="text-[9px] text-slate-500 font-bold uppercase mb-1">Matriz Fuente → Conversión</div>
148
- <div className="bg-[#16213e]/40 rounded-lg border border-indigo-900/20">
149
- <div className="grid grid-cols-4 gap-0 text-[8px] font-bold text-slate-500 p-2 border-b border-indigo-900/10">
150
- <div>Fuente</div><div className="text-right">Únicos</div><div className="text-right">Ventas</div><div className="text-right">Conv %</div>
151
- </div>
152
- {MATRIX.map(m => (
153
- <div key={m.fuente} className="grid grid-cols-4 gap-0 text-[9px] p-2 border-b border-indigo-900/5 hover:bg-indigo-500/5">
154
- <div className="font-bold">{m.fuente}</div>
155
- <div className="text-right text-slate-400">{m.opsUnicas}</div>
156
- <div className="text-right font-bold text-green-400">{m.ventas}</div>
157
- <div className={`text-right font-bold ${m.conv > 10 ? 'text-green-400' : m.conv > 3 ? 'text-yellow-400' : 'text-red-400'}`}>{m.conv}%</div>
158
- </div>
159
- ))}
160
- </div>
161
-
162
- <div className="text-[9px] text-slate-500 font-bold uppercase mt-2 mb-1">Top Vendedores (Digital)</div>
163
- {SELLERS.map(s => (
164
- <div key={s.name} className="bg-[#16213e]/40 rounded p-2 flex items-center justify-between border border-indigo-900/10">
165
- <span className="text-[9px] font-bold">{s.name}</span>
166
- <div className="flex items-center gap-2">
167
- <span className="text-[9px] text-slate-400">{s.leads} leads</span>
168
- <span className="text-[9px] font-bold text-indigo-400">{s.pct}%</span>
169
- </div>
170
- </div>
171
- ))}
172
- </>
173
- )}
174
-
175
- {tab === 'campaigns' && (
176
- <>
177
- <div className="text-[9px] text-slate-500 font-bold uppercase mb-1">Campañas — Conversión</div>
178
- {CAMPAIGNS.map(c => (
179
- <div key={c.campaign} className="bg-[#16213e]/40 rounded-lg p-3 border border-indigo-900/20">
180
- <div className="flex items-center justify-between mb-1">
181
- <span className="text-[11px] font-bold">{c.campaign}</span>
182
- <span className={`text-sm font-black ${c.conv > 10 ? 'text-green-400' : c.conv > 2 ? 'text-yellow-400' : 'text-red-400'}`}>{c.conv}%</span>
183
- </div>
184
- <div className="flex gap-3 text-[9px]">
185
- <span className="text-slate-400">Ventas: <span className="font-bold text-white">{c.ventas}</span></span>
186
- {c.platform !== '—' && <span className="text-slate-400">Plataforma: <span className="font-bold text-blue-400">{c.platform}</span></span>}
187
- </div>
188
- <div className="h-1.5 bg-[#0a0f1a] rounded-full mt-1.5">
189
- <div className="h-full rounded-full bg-indigo-500" style={{ width: `${c.conv}%` }} />
190
- </div>
191
- </div>
192
- ))}
193
- {/* Models by campaign */}
194
- <div className="text-[9px] text-slate-500 font-bold uppercase mt-2 mb-1">Modelos en Campaña</div>
195
- <div className="flex flex-wrap gap-1">
196
- {['EV3', 'EV5', 'K3 Cross', 'K4', 'Sonet', 'Stonic', 'Sportage'].map(m => (
197
- <span key={m} className="text-[8px] px-2 py-1 bg-[#16213e]/50 rounded border border-indigo-900/20 text-slate-400">{m}</span>
198
- ))}
199
- </div>
200
- </>
201
- )}
202
- </div>
203
- </div>
204
- </BaseNode>
205
- );
206
- };