@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.
- package/.eslintrc.cjs +10 -0
- package/.turbo/turbo-build.log +13 -0
- package/.turbo/turbo-lint.log +54 -0
- package/dist/components/DebugPanel.d.ts +3 -0
- package/dist/components/DebugPanel.js +195 -0
- package/dist/components/DebugPanelManager.d.ts +3 -0
- package/dist/components/DebugPanelManager.js +20 -0
- package/dist/components/DecidoButton.d.ts +11 -0
- package/dist/components/DecidoButton.js +15 -0
- package/dist/components/LoginView.d.ts +6 -0
- package/dist/components/LoginView.js +36 -0
- package/dist/components/WelcomeView.d.ts +6 -0
- package/dist/components/WelcomeView.js +16 -0
- package/dist/components/base/BaseComponent.d.ts +12 -0
- package/dist/components/base/BaseComponent.js +43 -0
- package/dist/components/base/BaseComponentBacjup.d.ts +12 -0
- package/dist/components/base/BaseComponentBacjup.js +43 -0
- package/dist/components/base/BaseComponentLit.d.ts +9 -0
- package/dist/components/base/BaseComponentLit.js +30 -0
- package/dist/components/base/shared-styles.d.ts +4 -0
- package/dist/components/base/shared-styles.js +18 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +7 -0
- package/dist/components/landing/index.d.ts +11 -0
- package/dist/components/landing/index.js +11 -0
- package/dist/components/landing/landing-button.d.ts +9 -0
- package/dist/components/landing/landing-button.js +5 -0
- package/dist/components/landing/landing-card.d.ts +6 -0
- package/dist/components/landing/landing-card.js +5 -0
- package/dist/components/landing/landing-cta.d.ts +10 -0
- package/dist/components/landing/landing-cta.js +5 -0
- package/dist/components/landing/landing-feature-card.d.ts +35 -0
- package/dist/components/landing/landing-feature-card.js +35 -0
- package/dist/components/landing/landing-footer.d.ts +18 -0
- package/dist/components/landing/landing-footer.js +7 -0
- package/dist/components/landing/landing-header.d.ts +21 -0
- package/dist/components/landing/landing-header.js +7 -0
- package/dist/components/landing/landing-hero.d.ts +22 -0
- package/dist/components/landing/landing-hero.js +10 -0
- package/dist/components/landing/landing-page.d.ts +3 -0
- package/dist/components/landing/landing-page.js +34 -0
- package/dist/components/landing/landing-section.d.ts +14 -0
- package/dist/components/landing/landing-section.js +8 -0
- package/dist/components/landing/landing-testimonial-card.d.ts +11 -0
- package/dist/components/landing/landing-testimonial-card.js +9 -0
- package/dist/components/landing/landing-waitlist.d.ts +27 -0
- package/dist/components/landing/landing-waitlist.js +18 -0
- package/dist/components/theming/ColorPicker.d.ts +8 -0
- package/dist/components/theming/ColorPicker.js +19 -0
- package/dist/components/theming/ThemePanel.d.ts +5 -0
- package/dist/components/theming/ThemePanel.js +12 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +19 -0
- package/dist/utils/counter.d.ts +1 -0
- package/dist/utils/counter.js +9 -0
- package/eslint.config.js +11 -0
- package/package.json +47 -0
- package/src/components/DebugPanel.tsx +347 -0
- package/src/components/DebugPanelManager.tsx +40 -0
- package/src/components/DecidoButton.tsx +43 -0
- package/src/components/LoginView.tsx +85 -0
- package/src/components/WelcomeView.tsx +47 -0
- package/src/components/base/landing.css +477 -0
- package/src/components/base/shared-styles.ts +21 -0
- package/src/components/index.ts +7 -0
- package/src/components/landing/index.tsx +11 -0
- package/src/components/landing/landing-button.tsx +26 -0
- package/src/components/landing/landing-card.tsx +15 -0
- package/src/components/landing/landing-cta.tsx +42 -0
- package/src/components/landing/landing-feature-card.tsx +149 -0
- package/src/components/landing/landing-footer.tsx +66 -0
- package/src/components/landing/landing-header.tsx +55 -0
- package/src/components/landing/landing-hero.tsx +94 -0
- package/src/components/landing/landing-page.tsx +143 -0
- package/src/components/landing/landing-section.tsx +42 -0
- package/src/components/landing/landing-testimonial-card.tsx +50 -0
- package/src/components/landing/landing-waitlist.tsx +115 -0
- package/src/components/theming/ColorPicker.tsx +40 -0
- package/src/components/theming/ThemePanel.tsx +43 -0
- package/src/css/base.css +483 -0
- package/src/css/components.css +309 -0
- package/src/css/debug-panel.css +1368 -0
- package/src/css/layout.css +289 -0
- package/src/css/login-view.css +45 -0
- package/src/css/style.css +20 -0
- package/src/css/welcome-view.css +56 -0
- package/src/css/workbench.css +383 -0
- package/src/globals.d.ts +8 -0
- package/src/index.ts +24 -0
- package/src/utils/counter.d.ts.map +1 -0
- package/src/utils/counter.js +9 -0
- package/src/utils/counter.ts +9 -0
- package/src/vite-env.d.ts +1 -0
- package/tailwind.config.js +7 -0
- 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
|
+
[0m[0m
|
|
14
|
+
[0m[4m/Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/DecidoButton.ts[24m[0m
|
|
15
|
+
[0m [2m31:6[22m [31merror[39m Parsing error: '>' expected[0m
|
|
16
|
+
[0m[0m
|
|
17
|
+
[0m[4m/Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/landing/landing-button.ts[24m[0m
|
|
18
|
+
[0m [2m17:7[22m [31merror[39m Parsing error: '>' expected[0m
|
|
19
|
+
[0m[0m
|
|
20
|
+
[0m[4m/Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/landing/landing-card.ts[24m[0m
|
|
21
|
+
[0m [2m9:9[22m [31merror[39m Parsing error: '>' expected[0m
|
|
22
|
+
[0m[0m
|
|
23
|
+
[0m[4m/Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/landing/landing-cta.ts[24m[0m
|
|
24
|
+
[0m [2m19:13[22m [31merror[39m Parsing error: '>' expected[0m
|
|
25
|
+
[0m[0m
|
|
26
|
+
[0m[4m/Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/landing/landing-feature-card.ts[24m[0m
|
|
27
|
+
[0m [2m60:13[22m [31merror[39m Parsing error: '>' expected[0m
|
|
28
|
+
[0m[0m
|
|
29
|
+
[0m[4m/Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/landing/landing-footer.ts[24m[0m
|
|
30
|
+
[0m [2m25:12[22m [31merror[39m Parsing error: '>' expected[0m
|
|
31
|
+
[0m[0m
|
|
32
|
+
[0m[4m/Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/landing/landing-header.ts[24m[0m
|
|
33
|
+
[0m [2m27:9[22m [31merror[39m Parsing error: '>' expected[0m
|
|
34
|
+
[0m[0m
|
|
35
|
+
[0m[4m/Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/landing/landing-hero.ts[24m[0m
|
|
36
|
+
[0m [2m33:13[22m [31merror[39m Parsing error: '>' expected[0m
|
|
37
|
+
[0m[0m
|
|
38
|
+
[0m[4m/Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/landing/landing-page.ts[24m[0m
|
|
39
|
+
[0m [2m51:5[22m [31merror[39m Parsing error: Type expected[0m
|
|
40
|
+
[0m[0m
|
|
41
|
+
[0m[4m/Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/landing/landing-section.ts[24m[0m
|
|
42
|
+
[0m [2m17:12[22m [31merror[39m Parsing error: Type expected[0m
|
|
43
|
+
[0m[0m
|
|
44
|
+
[0m[4m/Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/landing/landing-testimonial-card.ts[24m[0m
|
|
45
|
+
[0m [2m20:11[22m [31merror[39m Parsing error: '>' expected[0m
|
|
46
|
+
[0m[0m
|
|
47
|
+
[0m[4m/Users/julioramirez/dev/apps/yo-decido/packages/ui/src/components/landing/landing-waitlist.ts[24m[0m
|
|
48
|
+
[0m [2m47:9[22m [31merror[39m Parsing error: '>' expected[0m
|
|
49
|
+
[0m[0m
|
|
50
|
+
[0m[31m[1m✖ 12 problems (12 errors, 0 warnings)[22m[39m[0m
|
|
51
|
+
[0m[31m[1m[22m[39m[0m
|
|
52
|
+
Waiting for the debugger to disconnect...
|
|
53
|
+
[41m[30m ELIFECYCLE [39m[49m [31mCommand failed with exit code 1.[39m
|
|
54
|
+
Waiting for the debugger to disconnect...
|
|
@@ -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,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,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,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,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,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';
|