@decido/ui 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/.eslintrc.cjs +10 -0
  2. package/.turbo/turbo-build.log +13 -0
  3. package/.turbo/turbo-lint.log +54 -0
  4. package/dist/components/DebugPanel.d.ts +3 -0
  5. package/dist/components/DebugPanel.js +195 -0
  6. package/dist/components/DebugPanelManager.d.ts +3 -0
  7. package/dist/components/DebugPanelManager.js +20 -0
  8. package/dist/components/DecidoButton.d.ts +11 -0
  9. package/dist/components/DecidoButton.js +15 -0
  10. package/dist/components/LoginView.d.ts +6 -0
  11. package/dist/components/LoginView.js +36 -0
  12. package/dist/components/WelcomeView.d.ts +6 -0
  13. package/dist/components/WelcomeView.js +16 -0
  14. package/dist/components/base/BaseComponent.d.ts +12 -0
  15. package/dist/components/base/BaseComponent.js +43 -0
  16. package/dist/components/base/BaseComponentBacjup.d.ts +12 -0
  17. package/dist/components/base/BaseComponentBacjup.js +43 -0
  18. package/dist/components/base/BaseComponentLit.d.ts +9 -0
  19. package/dist/components/base/BaseComponentLit.js +30 -0
  20. package/dist/components/base/shared-styles.d.ts +4 -0
  21. package/dist/components/base/shared-styles.js +18 -0
  22. package/dist/components/index.d.ts +6 -0
  23. package/dist/components/index.js +7 -0
  24. package/dist/components/landing/index.d.ts +11 -0
  25. package/dist/components/landing/index.js +11 -0
  26. package/dist/components/landing/landing-button.d.ts +9 -0
  27. package/dist/components/landing/landing-button.js +5 -0
  28. package/dist/components/landing/landing-card.d.ts +6 -0
  29. package/dist/components/landing/landing-card.js +5 -0
  30. package/dist/components/landing/landing-cta.d.ts +10 -0
  31. package/dist/components/landing/landing-cta.js +5 -0
  32. package/dist/components/landing/landing-feature-card.d.ts +35 -0
  33. package/dist/components/landing/landing-feature-card.js +35 -0
  34. package/dist/components/landing/landing-footer.d.ts +18 -0
  35. package/dist/components/landing/landing-footer.js +7 -0
  36. package/dist/components/landing/landing-header.d.ts +21 -0
  37. package/dist/components/landing/landing-header.js +7 -0
  38. package/dist/components/landing/landing-hero.d.ts +22 -0
  39. package/dist/components/landing/landing-hero.js +10 -0
  40. package/dist/components/landing/landing-page.d.ts +3 -0
  41. package/dist/components/landing/landing-page.js +34 -0
  42. package/dist/components/landing/landing-section.d.ts +14 -0
  43. package/dist/components/landing/landing-section.js +8 -0
  44. package/dist/components/landing/landing-testimonial-card.d.ts +11 -0
  45. package/dist/components/landing/landing-testimonial-card.js +9 -0
  46. package/dist/components/landing/landing-waitlist.d.ts +27 -0
  47. package/dist/components/landing/landing-waitlist.js +18 -0
  48. package/dist/components/theming/ColorPicker.d.ts +8 -0
  49. package/dist/components/theming/ColorPicker.js +19 -0
  50. package/dist/components/theming/ThemePanel.d.ts +5 -0
  51. package/dist/components/theming/ThemePanel.js +12 -0
  52. package/dist/index.d.ts +13 -0
  53. package/dist/index.js +19 -0
  54. package/dist/utils/counter.d.ts +1 -0
  55. package/dist/utils/counter.js +9 -0
  56. package/eslint.config.js +11 -0
  57. package/package.json +47 -0
  58. package/src/components/DebugPanel.tsx +347 -0
  59. package/src/components/DebugPanelManager.tsx +40 -0
  60. package/src/components/DecidoButton.tsx +43 -0
  61. package/src/components/LoginView.tsx +85 -0
  62. package/src/components/WelcomeView.tsx +47 -0
  63. package/src/components/base/landing.css +477 -0
  64. package/src/components/base/shared-styles.ts +21 -0
  65. package/src/components/index.ts +7 -0
  66. package/src/components/landing/index.tsx +11 -0
  67. package/src/components/landing/landing-button.tsx +26 -0
  68. package/src/components/landing/landing-card.tsx +15 -0
  69. package/src/components/landing/landing-cta.tsx +42 -0
  70. package/src/components/landing/landing-feature-card.tsx +149 -0
  71. package/src/components/landing/landing-footer.tsx +66 -0
  72. package/src/components/landing/landing-header.tsx +55 -0
  73. package/src/components/landing/landing-hero.tsx +94 -0
  74. package/src/components/landing/landing-page.tsx +143 -0
  75. package/src/components/landing/landing-section.tsx +42 -0
  76. package/src/components/landing/landing-testimonial-card.tsx +50 -0
  77. package/src/components/landing/landing-waitlist.tsx +115 -0
  78. package/src/components/theming/ColorPicker.tsx +40 -0
  79. package/src/components/theming/ThemePanel.tsx +43 -0
  80. package/src/css/base.css +483 -0
  81. package/src/css/components.css +309 -0
  82. package/src/css/debug-panel.css +1368 -0
  83. package/src/css/layout.css +289 -0
  84. package/src/css/login-view.css +45 -0
  85. package/src/css/style.css +20 -0
  86. package/src/css/welcome-view.css +56 -0
  87. package/src/css/workbench.css +383 -0
  88. package/src/globals.d.ts +8 -0
  89. package/src/index.ts +24 -0
  90. package/src/utils/counter.d.ts.map +1 -0
  91. package/src/utils/counter.js +9 -0
  92. package/src/utils/counter.ts +9 -0
  93. package/src/vite-env.d.ts +1 -0
  94. package/tailwind.config.js +7 -0
  95. package/tsconfig.json +35 -0
package/.eslintrc.cjs ADDED
@@ -0,0 +1,10 @@
1
+ /** @type {import("eslint").Linter.Config} */
2
+ module.exports = {
3
+ root: true,
4
+ ignorePatterns: [".eslintrc.cjs", "**/*.d.ts"],
5
+ extends: ["@decido/eslint-config/index.js"],
6
+ parser: "@typescript-eslint/parser",
7
+ parserOptions: {
8
+ project: true,
9
+ },
10
+ };
@@ -0,0 +1,13 @@
1
+
2
+ Debugger listening on ws://127.0.0.1:58999/f7610a75-abe1-4d65-a3aa-cf0571ab02c0
3
+ For help, see: https://nodejs.org/en/docs/inspector
4
+ Debugger attached.
5
+
6
+ > @decido/ui@0.0.0 build /Users/julioramirez/dev/active/OnBoardingDecido/packages/shell-vscode/ui
7
+ > tsc
8
+
9
+ Debugger listening on ws://127.0.0.1:59001/eba3193e-0563-41ab-bc42-0987bcf98f41
10
+ For help, see: https://nodejs.org/en/docs/inspector
11
+ Debugger attached.
12
+ Waiting for the debugger to disconnect...
13
+ Waiting for the debugger to disconnect...
@@ -0,0 +1,54 @@
1
+
2
+ Debugger listening on ws://127.0.0.1:51604/85064dbf-5de0-40bd-b33a-5bc9f2e928d4
3
+ For help, see: https://nodejs.org/en/docs/inspector
4
+ Debugger attached.
5
+
6
+ > @decido/ui@0.0.0 lint /Users/julioramirez/dev/apps/yo-decido/packages/ui
7
+ > eslint "src/**/*.ts"
8
+
9
+ Debugger listening on ws://127.0.0.1:51615/5ffc4c45-6f4d-4a40-a73b-ad032e0dcc96
10
+ For help, see: https://nodejs.org/en/docs/inspector
11
+ Debugger attached.
12
+ Warning: React version was set to "detect" in eslint-plugin-react settings, but the "react" package is not installed. Assuming latest React version for linting.
13
+ 
14
+ /Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/DecidoButton.ts
15
+  31:6 error Parsing error: '>' expected
16
+ 
17
+ /Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/landing/landing-button.ts
18
+  17:7 error Parsing error: '>' expected
19
+ 
20
+ /Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/landing/landing-card.ts
21
+  9:9 error Parsing error: '>' expected
22
+ 
23
+ /Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/landing/landing-cta.ts
24
+  19:13 error Parsing error: '>' expected
25
+ 
26
+ /Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/landing/landing-feature-card.ts
27
+  60:13 error Parsing error: '>' expected
28
+ 
29
+ /Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/landing/landing-footer.ts
30
+  25:12 error Parsing error: '>' expected
31
+ 
32
+ /Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/landing/landing-header.ts
33
+  27:9 error Parsing error: '>' expected
34
+ 
35
+ /Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/landing/landing-hero.ts
36
+  33:13 error Parsing error: '>' expected
37
+ 
38
+ /Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/landing/landing-page.ts
39
+  51:5 error Parsing error: Type expected
40
+ 
41
+ /Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/landing/landing-section.ts
42
+  17:12 error Parsing error: Type expected
43
+ 
44
+ /Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/landing/landing-testimonial-card.ts
45
+  20:11 error Parsing error: '>' expected
46
+ 
47
+ /Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/landing/landing-waitlist.ts
48
+  47:9 error Parsing error: '>' expected
49
+ 
50
+ ✖ 12 problems (12 errors, 0 warnings)
51
+ 
52
+ Waiting for the debugger to disconnect...
53
+  ELIFECYCLE  Command failed with exit code 1.
54
+ Waiting for the debugger to disconnect...
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const DebugPanel: React.FC;
3
+ export default DebugPanel;
@@ -0,0 +1,195 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState, useEffect, useRef, useCallback } from 'react';
3
+ /**
4
+ * Un serializador JSON seguro que maneja referencias circulares, funciones y elementos del DOM.
5
+ * @param value El objeto a serializar.
6
+ * @returns Una cadena de texto JSON segura.
7
+ */
8
+ function safeJsonStringify(value) {
9
+ const cache = new Set();
10
+ const replacer = (_key, value) => {
11
+ if (typeof value === 'object' && value !== null) {
12
+ if (cache.has(value)) {
13
+ // Referencia circular detectada
14
+ return '[Circular Reference]';
15
+ }
16
+ cache.add(value);
17
+ }
18
+ if (typeof value === 'function') {
19
+ return `[Function: ${value.name || 'anonymous'}]`;
20
+ }
21
+ if (value instanceof HTMLElement) {
22
+ return `[HTMLElement: ${value.tagName}${value.id ? '#' + value.id : ''}]`;
23
+ }
24
+ return value;
25
+ };
26
+ // Usamos el 'replacer' y una indentación de 2 espacios para que sea legible.
27
+ return JSON.stringify(value, replacer, 2);
28
+ }
29
+ const DebugPanel = () => {
30
+ const debugService = window.decidoAPI?.debug; // Asumo que el debugService está en window.decidoAPI.debug
31
+ const [nodes, setNodes] = useState([]);
32
+ const [links, setLinks] = useState([]);
33
+ const [hoveredNode, setHoveredNode] = useState(null);
34
+ const [activeTab, setActiveTab] = useState('graph');
35
+ const panelRef = useRef(null);
36
+ const [panelPosition, setPanelPosition] = useState({ bottom: 20, right: 20, left: 'auto', top: 'auto' });
37
+ const width = 800;
38
+ const height = 500;
39
+ // --- Lógica de Arrastre del Panel ---
40
+ const isPanelDragging = useRef(false);
41
+ const panelOffset = useRef({ x: 0, y: 0 });
42
+ const onPanelDragStart = useCallback((e) => {
43
+ if (e.button !== 0)
44
+ return; // Solo arrastrar con el botón izquierdo del ratón
45
+ isPanelDragging.current = true;
46
+ const panelRect = panelRef.current.getBoundingClientRect();
47
+ panelOffset.current = {
48
+ x: e.clientX - panelRect.left,
49
+ y: e.clientY - panelRect.top,
50
+ };
51
+ document.addEventListener('mousemove', onPanelDrag);
52
+ document.addEventListener('mouseup', onPanelDragEnd);
53
+ document.body.style.userSelect = 'none'; // Evitar selección de texto durante el arrastre
54
+ }, []);
55
+ const onPanelDrag = useCallback((e) => {
56
+ if (!isPanelDragging.current)
57
+ return;
58
+ const x = e.clientX - panelOffset.current.x;
59
+ const y = e.clientY - panelOffset.current.y;
60
+ setPanelPosition({ bottom: 'auto', right: 'auto', left: x, top: y });
61
+ }, []);
62
+ const onPanelDragEnd = useCallback(() => {
63
+ isPanelDragging.current = false;
64
+ document.removeEventListener('mousemove', onPanelDrag);
65
+ document.removeEventListener('mouseup', onPanelDragEnd);
66
+ document.body.style.userSelect = ''; // Restaurar la selección de texto
67
+ }, []);
68
+ useEffect(() => {
69
+ if (!debugService)
70
+ return;
71
+ // Mock subscription for effect - Assuming debugService triggers reloads
72
+ const graph = debugService.graphState[0]();
73
+ setNodes(prevNodes => {
74
+ if (graph.nodes.length > 0 && prevNodes.length === 0) {
75
+ return initializeNodePositions(graph.nodes);
76
+ }
77
+ return graph.nodes;
78
+ });
79
+ setLinks(graph.links);
80
+ return () => {
81
+ // Unsubscribe mock
82
+ };
83
+ }, [debugService]);
84
+ const initializeNodePositions = useCallback((newNodes) => {
85
+ const savedPositions = loadNodePositions();
86
+ return newNodes.map(node => {
87
+ if (savedPositions[node.id]) {
88
+ return { ...node, x: savedPositions[node.id].x, y: savedPositions[node.id].y };
89
+ }
90
+ return {
91
+ ...node,
92
+ x: node.x === undefined ? Math.random() * (width - 100) + 50 : node.x,
93
+ y: node.y === undefined ? Math.random() * (height - 100) + 50 : node.y,
94
+ };
95
+ });
96
+ }, [width, height]);
97
+ const saveNodePositions = useCallback((currentNodes) => {
98
+ const positions = currentNodes.reduce((acc, node) => {
99
+ acc[node.id] = { x: node.x, y: node.y };
100
+ return acc;
101
+ }, {});
102
+ localStorage.setItem('decido_debug_panel_node_positions', JSON.stringify(positions));
103
+ }, []);
104
+ const loadNodePositions = () => {
105
+ try {
106
+ const saved = localStorage.getItem('decido_debug_panel_node_positions');
107
+ return saved ? JSON.parse(saved) : {};
108
+ }
109
+ catch (e) {
110
+ console.error("Error cargando posiciones de nodos:", e);
111
+ return {};
112
+ }
113
+ };
114
+ // --- Lógica de Arrastre de Nodos ---
115
+ const draggedNode = useRef(null);
116
+ const nodeOffset = useRef({ x: 0, y: 0 });
117
+ const onNodeDragStart = useCallback((e, node) => {
118
+ e.stopPropagation();
119
+ draggedNode.current = node;
120
+ nodeOffset.current = {
121
+ x: e.clientX - node.x,
122
+ y: e.clientY - node.y,
123
+ };
124
+ setNodes(prevNodes => prevNodes.map(n => n.id === node.id ? { ...n, fx: node.x, fy: node.y } : n));
125
+ document.addEventListener('mousemove', onNodeDrag);
126
+ document.addEventListener('mouseup', onNodeDragEnd);
127
+ document.body.style.userSelect = 'none';
128
+ }, [nodes]);
129
+ const onNodeDrag = useCallback((e) => {
130
+ if (!draggedNode.current)
131
+ return;
132
+ const newFx = e.clientX - nodeOffset.current.x;
133
+ const newFy = e.clientY - nodeOffset.current.y;
134
+ setNodes(prevNodes => prevNodes.map(n => n.id === draggedNode.current?.id ? { ...n, fx: newFx, fy: newFy } : n));
135
+ }, []);
136
+ const onNodeDragEnd = useCallback(() => {
137
+ if (draggedNode.current) {
138
+ setNodes(prevNodes => {
139
+ const updatedNodes = prevNodes.map(n => {
140
+ if (n.id === draggedNode.current?.id) {
141
+ return { ...n, x: n.fx, y: n.fy, fx: null, fy: null };
142
+ }
143
+ return n;
144
+ });
145
+ saveNodePositions(updatedNodes);
146
+ return updatedNodes;
147
+ });
148
+ }
149
+ draggedNode.current = null;
150
+ document.removeEventListener('mousemove', onNodeDrag);
151
+ document.removeEventListener('mouseup', onNodeDragEnd);
152
+ document.body.style.userSelect = '';
153
+ }, [saveNodePositions]);
154
+ const onMouseOverNode = useCallback((node) => { setHoveredNode(node); }, []);
155
+ const onMouseOutNode = useCallback(() => { setHoveredNode(null); }, []);
156
+ // --- Renderizado de Logs de Consola ---
157
+ const renderConsoleLog = (log) => {
158
+ const formattedMessage = log.message.map(m => {
159
+ if (typeof m === 'object' && m !== null) {
160
+ return safeJsonStringify(m);
161
+ }
162
+ return String(m);
163
+ }).join(' ');
164
+ return (_jsxs("div", { className: `log-entry log-level-${log.type}`, children: [_jsx("span", { className: "log-timestamp", children: new Date(log.timestamp).toLocaleTimeString() }), _jsx("pre", { className: "log-message", children: formattedMessage })] }, log.id));
165
+ };
166
+ const handleMapChange = (e) => {
167
+ const path = e.target.value;
168
+ debugService?.loadArchitectureGraph(path);
169
+ };
170
+ const log = debugService?.probeLog[0]();
171
+ const playback = debugService?.playbackState[0]();
172
+ const consoleLogs = debugService?.consoleLogs[0]();
173
+ const renderGraphContent = (currentNodes, currentLinks) => {
174
+ const populatedLinks = currentLinks
175
+ .map(link => ({
176
+ ...link,
177
+ source: currentNodes.find(n => n.id === link.source),
178
+ target: currentNodes.find(n => n.id === link.target)
179
+ }))
180
+ .filter(l => l.source && l.target);
181
+ return (_jsxs("svg", { id: "architecture-svg", width: width, height: height - 40, children: [_jsx("g", { className: "links", children: populatedLinks.map((link, index) => (_jsx("line", { x1: link.source.x, y1: link.source.y, x2: link.target.x, y2: link.target.y, stroke: "#475569", strokeWidth: "1.5" }, index))) }), _jsx("g", { className: "nodes", children: currentNodes.map(node => (_jsxs("g", { className: "node-group", transform: `translate(${node.fx ?? node.x}, ${node.fy ?? node.y})`, onMouseDown: (e) => onNodeDragStart(e, node), onMouseOver: () => onMouseOverNode(node), onMouseOut: onMouseOutNode, children: [_jsx("circle", { r: "12", className: `node-circle type-${node.type} status-${node.status}` }), _jsx("text", { x: "16", y: "4", className: "node-label", children: node.label })] }, node.id))) }), hoveredNode && renderTooltip(hoveredNode)] }));
182
+ };
183
+ const renderTooltip = (node) => {
184
+ return (_jsx("foreignObject", { x: (node.x || 0) + 20, y: (node.y || 0) + 20, width: "250", height: "150", children: _jsxs("div", { className: "tooltip-container", children: [_jsx("div", { className: `tooltip-header type-${node.type}`, children: node.label }), _jsxs("div", { className: "tooltip-body", children: [_jsxs("p", { children: [_jsx("strong", { children: "ID:" }), " ", node.id] }), _jsxs("p", { children: [_jsx("strong", { children: "Tipo:" }), " ", node.type] }), _jsxs("p", { children: [_jsx("strong", { children: "Estado:" }), " ", _jsx("span", { className: `status-${node.status}`, children: node.status })] }), _jsx("p", { className: "tooltip-desc", children: node.description || 'Sin descripción.' })] })] }) }));
185
+ };
186
+ return (_jsxs("div", { ref: panelRef, className: "debug-panel", style: {
187
+ bottom: panelPosition.bottom,
188
+ right: panelPosition.right,
189
+ left: panelPosition.left,
190
+ top: panelPosition.top,
191
+ width: width,
192
+ height: height,
193
+ }, children: [_jsxs("div", { className: "debug-header", onMouseDown: onPanelDragStart, children: [_jsxs("span", { children: [_jsx("i", { className: "fas fa-microchip mr-2" }), "Esc\u00E1ner de Arquitectura"] }), _jsxs("select", { onChange: handleMapChange, style: { background: '#334155', border: 'none', color: 'white', borderRadius: '4px', fontSize: '11px' }, children: [_jsx("option", { value: "/architecture-map.json", children: "Vista General" }), _jsx("option", { value: "/maps/auth-flow.json", children: "Flujo de Autenticaci\u00F3n" }), _jsx("option", { value: "/maps/kanban-flow.json", children: "Flujo de Kanban" })] })] }), _jsxs("div", { className: "debug-tabs", children: [_jsxs("button", { className: `debug-tab ${activeTab === 'graph' ? 'active' : ''}`, onClick: () => setActiveTab('graph'), children: [_jsx("i", { className: "fas fa-sitemap mr-2" }), "Arquitectura"] }), _jsxs("button", { className: `debug-tab ${activeTab === 'console' ? 'active' : ''}`, onClick: () => setActiveTab('console'), children: [_jsx("i", { className: "fas fa-terminal mr-2" }), "Consola"] })] }), _jsxs("div", { className: "debug-content", children: [activeTab === 'graph' && (_jsx("div", { className: "tab-content active", children: renderGraphContent(nodes, links) })), activeTab === 'console' && (_jsx("div", { className: "tab-content active", children: _jsx("div", { className: "console-log-list", children: consoleLogs?.map((log) => renderConsoleLog(log)) }) }))] }), _jsxs("div", { className: "debug-footer", children: [_jsxs("div", { className: "playback-controls flex gap-2", children: [_jsx("button", { onClick: () => debugService?.goToLogIndex(0), title: "Ir al Inicio", children: _jsx("i", { className: "fas fa-fast-backward" }) }), _jsx("button", { onClick: () => debugService?.goToLogIndex(playback?.currentIndex - 1), title: "Paso Anterior", children: _jsx("i", { className: "fas fa-step-backward" }) }), _jsx("button", { onClick: () => { }, title: "Reproducir", children: _jsx("i", { className: "fas fa-play" }) }), _jsx("button", { onClick: () => debugService?.goToLogIndex(playback?.currentIndex + 1), title: "Paso Siguiente", children: _jsx("i", { className: "fas fa-step-forward" }) })] }), _jsx("input", { type: "range", className: "timeline-slider", min: "0", max: log?.length > 0 ? log.length - 1 : 0, value: playback?.currentIndex || 0, onChange: (e) => debugService?.goToLogIndex(parseInt(e.target.value)) }), _jsxs("span", { className: "text-xs text-muted-foreground w-20 text-center", children: [playback?.currentIndex + 1, " / ", log?.length] })] })] }));
194
+ };
195
+ export default DebugPanel;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const DebugPanelManager: React.FC;
3
+ export default DebugPanelManager;
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
3
+ import DebugPanel from './DebugPanel'; // Import the React component
4
+ const DebugPanelManager = () => {
5
+ const [panels, setPanels] = useState([]);
6
+ const panelService = window.decidoAPI?.debug?.panels; // Access the service from window.decidoAPI
7
+ useEffect(() => {
8
+ if (!panelService)
9
+ return;
10
+ // Assuming panelService.panels is a signal, we'd subscribe to it
11
+ const unsubscribe = () => { }; // MOCK: createEffect was from missing import
12
+ const currentPanels = Object.values(panelService.panels[0]());
13
+ setPanels(currentPanels);
14
+ return () => {
15
+ unsubscribe();
16
+ };
17
+ }, [panelService]);
18
+ return (_jsx(_Fragment, { children: panels.filter(p => p.isVisible).map(p => (_jsx(DebugPanel, {}, p.id))) }));
19
+ };
20
+ export default DebugPanelManager;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ interface DecidoButtonProps {
3
+ onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
4
+ type?: 'button' | 'submit' | 'reset';
5
+ variant?: 'primary' | 'secondary';
6
+ disabled?: boolean;
7
+ className?: string;
8
+ children: React.ReactNode;
9
+ }
10
+ declare const DecidoButton: React.FC<DecidoButtonProps>;
11
+ export default DecidoButton;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ const DecidoButton = ({ onClick, type = 'button', variant = 'primary', disabled = false, className = '', children, }) => {
3
+ const baseClasses = `btn btn-${variant} ${className}`.trim();
4
+ const handleClick = (event) => {
5
+ if (type === 'submit') {
6
+ const form = event.currentTarget.closest('form');
7
+ if (form) {
8
+ form.dispatchEvent(new Event('submit', { cancelable: true, bubbles: true }));
9
+ }
10
+ }
11
+ onClick?.(event);
12
+ };
13
+ return (_jsx("button", { type: type, className: baseClasses, disabled: disabled, onClick: handleClick, children: children }));
14
+ };
15
+ export default DecidoButton;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import '../css/login-view.css';
3
+ interface LoginViewProps {
4
+ }
5
+ declare const LoginView: React.FC<LoginViewProps>;
6
+ export default LoginView;
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import '../css/login-view.css';
4
+ const LoginView = () => {
5
+ const [email, setEmail] = useState('ing_julioramirez@hotmail.com');
6
+ const [password, setPassword] = useState('y0s0ft..');
7
+ const [isLoading, setIsLoading] = useState(false);
8
+ const api = window.decidoAPI;
9
+ const handleLogin = async (e) => {
10
+ e.preventDefault();
11
+ setIsLoading(true);
12
+ api.debug?.probe('ui:LoginView', 'active');
13
+ try {
14
+ await api.auth.login(email, password);
15
+ // On success, the router and auth service should handle the redirect.
16
+ // No need to manually navigate here.
17
+ }
18
+ catch (error) {
19
+ const errorMessage = error instanceof Error ? error.message : "Error desconocido";
20
+ api.notifications.show('error', 'Error de Login', errorMessage);
21
+ }
22
+ finally {
23
+ setIsLoading(false);
24
+ }
25
+ };
26
+ const handleRegisterClick = () => {
27
+ if (api && api.commands) {
28
+ api.commands.executeCommand("auth.showRegisterModal");
29
+ }
30
+ else {
31
+ console.warn('Decido API o Command Service no disponible.');
32
+ }
33
+ };
34
+ return (_jsx("div", { className: "login-container animate-fade-in", children: _jsxs("div", { className: "login-box", children: [_jsx("h1", { className: "login-title", children: "Iniciar Sesi\u00F3n" }), _jsxs("form", { className: "login-form", onSubmit: handleLogin, children: [_jsxs("div", { className: "form-group", children: [_jsx("label", { htmlFor: "email", className: "journal-label", children: "Email" }), _jsx("input", { type: "email", id: "email", name: "email", className: "form-input-premium", required: true, value: email, onChange: (e) => setEmail(e.target.value), disabled: isLoading })] }), _jsxs("div", { className: "form-group", children: [_jsx("label", { htmlFor: "password", className: "journal-label", children: "Contrase\u00F1a" }), _jsx("input", { type: "password", id: "password", name: "password", className: "form-input-premium", required: true, value: password, onChange: (e) => setPassword(e.target.value), disabled: isLoading })] }), _jsx("div", { className: "form-actions", children: _jsxs("button", { type: "submit", className: "btn-premium w-full", disabled: isLoading, children: [isLoading ? _jsx("i", { className: "fas fa-spinner fa-spin" }) : '', " Entrar"] }) })] }), _jsx("div", { className: "register-link", children: _jsx("a", { href: "#", onClick: handleRegisterClick, children: "\u00BFNo tienes cuenta? Reg\u00EDstrate" }) })] }) }));
35
+ };
36
+ export default LoginView;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import '../css/welcome-view.css';
3
+ interface WelcomeViewProps {
4
+ }
5
+ declare const WelcomeView: React.FC<WelcomeViewProps>;
6
+ export default WelcomeView;
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import '../css/welcome-view.css';
3
+ const WelcomeView = () => {
4
+ // Access the API from the window object
5
+ const api = window.decidoAPI;
6
+ const handleQuickLinkClick = (commandId, commandArgs) => {
7
+ if (api && api.commands) {
8
+ api.commands.executeCommand(commandId, commandArgs);
9
+ }
10
+ else {
11
+ console.warn('Decido API o Command Service no disponible.');
12
+ }
13
+ };
14
+ return (_jsxs("div", { className: "welcome-container animate-fade-in", children: [_jsx("div", { className: "logo", children: _jsx("i", { className: "fas fa-brain" }) }), _jsx("h1", { className: "welcome-title", children: "Bienvenido a Decido" }), _jsx("p", { className: "welcome-subtitle", children: "Tu sistema operativo para la vida. \u00BFQu\u00E9 quieres lograr hoy?" }), _jsxs("div", { className: "quick-links-grid", children: [_jsxs("a", { href: "#", className: "quick-link", onClick: () => handleQuickLinkClick("workbench.openTab", { id: "dashboard", title: "Dashboard", componentTag: "dashboard-view", icon: "fas fa-home" }), children: [_jsx("i", { className: "fas fa-home" }), _jsx("span", { children: "Ver mi Dashboard" })] }), _jsxs("a", { href: "#", className: "quick-link", onClick: () => handleQuickLinkClick("workbench.openTab", { id: "goal-architect", title: "Arquitecto de Metas", componentTag: "goal-architect-view", icon: "fas fa-compass" }), children: [_jsx("i", { className: "fas fa-compass" }), _jsx("span", { children: "Definir una Meta" })] }), _jsxs("a", { href: "#", className: "quick-link", onClick: () => handleQuickLinkClick("palette.toggle"), children: [_jsx("i", { className: "fas fa-terminal" }), _jsx("span", { children: "Abrir Paleta de Comandos" })] })] })] }));
15
+ };
16
+ export default WelcomeView;
@@ -0,0 +1,12 @@
1
+ import { IPlatformAPI } from '@decido/core';
2
+ import { TemplateResult } from 'lit-html';
3
+ export declare abstract class BaseComponent extends HTMLElement {
4
+ protected readonly api: IPlatformAPI;
5
+ protected readonly shadow: ShadowRoot;
6
+ constructor();
7
+ connectedCallback(): void;
8
+ onMount(): void;
9
+ abstract renderContent(): TemplateResult;
10
+ render(): void;
11
+ protected emitEvent<T>(name: string, detail?: T): void;
12
+ }
@@ -0,0 +1,43 @@
1
+ // src/core/BaseComponent.ts
2
+ import { createEffect } from '@decido/core';
3
+ import { render as litRender } from 'lit-html';
4
+ import { faSheet, globalSheet } from './shared-styles.js';
5
+ export class BaseComponent extends HTMLElement {
6
+ api;
7
+ shadow;
8
+ constructor() {
9
+ super();
10
+ // @ts-expect-error "Falta la definicion"
11
+ this.api = window.decidoAPI;
12
+ this.shadow = this.attachShadow({ mode: 'open' });
13
+ // ¡Aquí está la magia!
14
+ // Le decimos al Shadow DOM que adopte y use nuestra hoja de estilos.
15
+ console.log(globalSheet, faSheet);
16
+ this.shadow.adoptedStyleSheets = [globalSheet, faSheet];
17
+ }
18
+ connectedCallback() {
19
+ // // Enlazamos los estilos globales.
20
+ // const globalStyles = document.createElement('link');
21
+ // globalStyles.setAttribute('rel', 'stylesheet');
22
+ // globalStyles.setAttribute('href', '/css/style.css');
23
+ // this.shadow.appendChild(globalStyles);
24
+ // --- LA CORRECCIÓN CLAVE ---
25
+ // El efecto ahora llama al método render() de ESTA clase base,
26
+ // que es el que sabe cómo usar lit-html.
27
+ createEffect(() => this.render());
28
+ // onMount se llama una vez después del primer render para listeners, etc.
29
+ this.onMount();
30
+ }
31
+ onMount() { }
32
+ // Este es el método de renderizado final y privado de la clase base.
33
+ // No debe ser sobreescrito por los hijos.
34
+ render() {
35
+ // Llama a renderContent() del hijo para obtener la plantilla...
36
+ const template = this.renderContent();
37
+ // ...y usa litRender para aplicarla eficientemente al Shadow DOM.
38
+ litRender(template, this.shadow);
39
+ }
40
+ emitEvent(name, detail) {
41
+ this.dispatchEvent(new CustomEvent(name, { detail, bubbles: true, composed: true }));
42
+ }
43
+ }
@@ -0,0 +1,12 @@
1
+ import { IPlatformAPI } from '@decido/core';
2
+ import { TemplateResult } from 'lit-html';
3
+ export declare abstract class BaseComponent extends HTMLElement {
4
+ protected readonly api: IPlatformAPI;
5
+ protected readonly shadow: ShadowRoot;
6
+ constructor();
7
+ connectedCallback(): void;
8
+ onMount(): void;
9
+ abstract renderContent(): TemplateResult;
10
+ render(): void;
11
+ protected emitEvent<T>(name: string, detail?: T): void;
12
+ }
@@ -0,0 +1,43 @@
1
+ // src/core/BaseComponent.ts
2
+ import { createEffect } from '@decido/core';
3
+ import { render as litRender } from 'lit-html';
4
+ import { faSheet, globalSheet } from './shared-styles.js';
5
+ export class BaseComponent extends HTMLElement {
6
+ api;
7
+ shadow;
8
+ constructor() {
9
+ super();
10
+ // @ts-expect-error "Falta la definicion"
11
+ this.api = window.decidoAPI;
12
+ this.shadow = this.attachShadow({ mode: 'open' });
13
+ // ¡Aquí está la magia!
14
+ // Le decimos al Shadow DOM que adopte y use nuestra hoja de estilos.
15
+ console.log(globalSheet, faSheet);
16
+ this.shadow.adoptedStyleSheets = [globalSheet, faSheet];
17
+ }
18
+ connectedCallback() {
19
+ // // Enlazamos los estilos globales.
20
+ // const globalStyles = document.createElement('link');
21
+ // globalStyles.setAttribute('rel', 'stylesheet');
22
+ // globalStyles.setAttribute('href', '/css/style.css');
23
+ // this.shadow.appendChild(globalStyles);
24
+ // --- LA CORRECCIÓN CLAVE ---
25
+ // El efecto ahora llama al método render() de ESTA clase base,
26
+ // que es el que sabe cómo usar lit-html.
27
+ createEffect(() => this.render());
28
+ // onMount se llama una vez después del primer render para listeners, etc.
29
+ this.onMount();
30
+ }
31
+ onMount() { }
32
+ // Este es el método de renderizado final y privado de la clase base.
33
+ // No debe ser sobreescrito por los hijos.
34
+ render() {
35
+ // Llama a renderContent() del hijo para obtener la plantilla...
36
+ const template = this.renderContent();
37
+ // ...y usa litRender para aplicarla eficientemente al Shadow DOM.
38
+ litRender(template, this.shadow);
39
+ }
40
+ emitEvent(name, detail) {
41
+ this.dispatchEvent(new CustomEvent(name, { detail, bubbles: true, composed: true }));
42
+ }
43
+ }
@@ -0,0 +1,9 @@
1
+ import { LitElement, TemplateResult } from 'lit';
2
+ export declare abstract class BaseComponent extends LitElement {
3
+ static styles: import("lit").CSSResult;
4
+ connectedCallback(): void;
5
+ protected onMount(): void;
6
+ protected render(): TemplateResult;
7
+ protected abstract renderContent(): TemplateResult;
8
+ protected emitEvent<T>(name: string, detail?: T): void;
9
+ }
@@ -0,0 +1,30 @@
1
+ import { LitElement, css } from 'lit';
2
+ // Si tienes estilos globales en un archivo .ts, puedes importarlos así:
3
+ // import { globalStyles } from './global-styles.js';
4
+ export class BaseComponent extends LitElement {
5
+ // Con LitElement, los estilos se encapsulan automáticamente.
6
+ // No necesitas 'adoptedStyleSheets' a menos que estés haciendo algo muy avanzado.
7
+ // Los estilos base se pueden definir aquí.
8
+ static styles = css `
9
+ :host {
10
+ display: block;
11
+ }
12
+ `;
13
+ // El ciclo de vida de LitElement reemplaza a onMount y connectedCallback manuales.
14
+ // `connectedCallback` todavía existe, pero `firstUpdated` es a menudo más útil.
15
+ connectedCallback() {
16
+ super.connectedCallback();
17
+ this.onMount();
18
+ }
19
+ // `onMount` puede ser usado por los hijos para lógica de inicialización.
20
+ onMount() { }
21
+ // `render` es el método principal en LitElement.
22
+ // Los hijos deben implementar `renderContent`.
23
+ render() {
24
+ return this.renderContent();
25
+ }
26
+ // El helper para emitir eventos sigue siendo útil.
27
+ emitEvent(name, detail) {
28
+ this.dispatchEvent(new CustomEvent(name, { detail, bubbles: true, composed: true }));
29
+ }
30
+ }
@@ -0,0 +1,4 @@
1
+ declare const faSheet: CSSStyleSheet;
2
+ declare const landingSheet: CSSStyleSheet;
3
+ declare const globalSheet: CSSStyleSheet;
4
+ export { faSheet, globalSheet, landingSheet };
@@ -0,0 +1,18 @@
1
+ // /src/styles/shared-styles.js
2
+ // Importamos el CSS de Font Awesome como un string de texto.
3
+ import fontAwesomeCss from '@fortawesome/fontawesome-free/css/all.min.css';
4
+ // import globalCss from '../../css/style.css';
5
+ import globalCss from '../../css/style.css';
6
+ import landingCss from './landing.css';
7
+ // Creamos una hoja de estilos "adoptable"
8
+ const faSheet = new CSSStyleSheet();
9
+ faSheet.replaceSync(fontAwesomeCss); // Cargamos el CSS en el objeto
10
+ // Creamos una hoja de estilos "adoptable"
11
+ const landingSheet = new CSSStyleSheet();
12
+ landingSheet.replaceSync(landingCss); // Cargamos el CSS en el objeto
13
+ // Creamos la hoja de estilos para los estilos globales
14
+ const globalSheet = new CSSStyleSheet();
15
+ globalSheet.replaceSync(globalCss);
16
+ console.log(faSheet, globalSheet);
17
+ // Exportamos AMBAS hojas para que puedan ser usadas
18
+ export { faSheet, globalSheet, landingSheet };
@@ -0,0 +1,6 @@
1
+ export * from './theming/ColorPicker';
2
+ export * from './theming/ThemePanel';
3
+ export * from './DecidoButton';
4
+ export * from './LoginView';
5
+ export * from './WelcomeView';
6
+ export * from './landing/index';
@@ -0,0 +1,7 @@
1
+ // export * from './base/BaseComponent';
2
+ export * from './theming/ColorPicker';
3
+ export * from './theming/ThemePanel';
4
+ export * from './DecidoButton';
5
+ export * from './LoginView';
6
+ export * from './WelcomeView';
7
+ export * from './landing/index';
@@ -0,0 +1,11 @@
1
+ export * from './landing-page.js';
2
+ export * from './landing-button.js';
3
+ export * from './landing-card.js';
4
+ export * from './landing-feature-card.js';
5
+ export * from './landing-testimonial-card.js';
6
+ export * from './landing-section.js';
7
+ export * from './landing-header.js';
8
+ export * from './landing-footer.js';
9
+ export * from './landing-hero.js';
10
+ export * from './landing-waitlist.js';
11
+ export * from './landing-cta.js';
@@ -0,0 +1,11 @@
1
+ export * from './landing-page.js';
2
+ export * from './landing-button.js';
3
+ export * from './landing-card.js';
4
+ export * from './landing-feature-card.js';
5
+ export * from './landing-testimonial-card.js';
6
+ export * from './landing-section.js';
7
+ export * from './landing-header.js';
8
+ export * from './landing-footer.js';
9
+ export * from './landing-hero.js';
10
+ export * from './landing-waitlist.js';
11
+ export * from './landing-cta.js';