@decido/shell-vscode-core 4.0.1 → 4.0.2

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 (52) hide show
  1. package/package.json +14 -13
  2. package/.turbo/turbo-build.log +0 -13
  3. package/CHANGELOG.md +0 -31
  4. package/src/appState.ts +0 -167
  5. package/src/core/AIService.ts +0 -109
  6. package/src/core/ApiService.ts +0 -40
  7. package/src/core/AuthService.ts +0 -85
  8. package/src/core/BaseService.ts +0 -47
  9. package/src/core/CalendarService.ts +0 -44
  10. package/src/core/CommandService.ts +0 -69
  11. package/src/core/DebugPanelService.ts +0 -38
  12. package/src/core/DebugService.ts +0 -181
  13. package/src/core/EventBus.ts +0 -60
  14. package/src/core/EventHandler.ts +0 -97
  15. package/src/core/GamificationService.ts +0 -120
  16. package/src/core/HookService.ts +0 -86
  17. package/src/core/ModalService.ts +0 -97
  18. package/src/core/NotificationService.ts +0 -53
  19. package/src/core/RouterService.ts +0 -68
  20. package/src/core/ServiceContainer.ts +0 -31
  21. package/src/core/ShortcutService.ts +0 -49
  22. package/src/core/StorageService.ts +0 -123
  23. package/src/core/ThemeService.ts +0 -71
  24. package/src/core/WebSocketService.ts +0 -32
  25. package/src/core/api.ts +0 -78
  26. package/src/core/app/ModuleManager.ts +0 -273
  27. package/src/core/app/apiFactory.ts +0 -130
  28. package/src/core/app/commandManager.ts +0 -218
  29. package/src/core/app/moduleLoader.ts +0 -39
  30. package/src/core/app/routeManager.ts +0 -8
  31. package/src/core/index.ts +0 -15
  32. package/src/core/signals.ts +0 -84
  33. package/src/core/uiState.ts +0 -13
  34. package/src/index.ts +0 -18
  35. package/src/lib/local-db.ts +0 -65
  36. package/src/lib/sync-service.ts +0 -44
  37. package/src/platform/ILayoutService.ts +0 -77
  38. package/src/platform/IRenderer.ts +0 -16
  39. package/src/platform/ServiceRegistry.ts +0 -53
  40. package/src/platform/extensionPoints.ts +0 -202
  41. package/src/platform/index.ts +0 -4
  42. package/src/stores/editorStore.ts +0 -6
  43. package/src/stores/gamificationStore.ts +0 -4
  44. package/src/stores/historyStore.ts +0 -14
  45. package/src/stores/workspaceStore.ts +0 -8
  46. package/src/types/app.ts +0 -36
  47. package/src/types/debug.ts +0 -69
  48. package/src/types/index.ts +0 -3
  49. package/src/types/platform.ts +0 -112
  50. package/src/ui/Palette.ts +0 -161
  51. package/src/utils.ts +0 -63
  52. package/tsconfig.json +0 -23
package/src/types/app.ts DELETED
@@ -1,36 +0,0 @@
1
- // src/types/app.ts
2
- import { IPlatformAPI } from "../core/api";
3
-
4
- export type RouteAccess = 'public' | 'guestOnly' | 'protected';
5
-
6
- export interface RouteDefinition {
7
- path: string;
8
- componentTag: string;
9
- auth: RouteAccess;
10
- roles?: string[];
11
- title?: string;
12
- isFullscreen?: boolean;
13
- }
14
-
15
- export interface RegisteredComponent {
16
- name: string;
17
- icon: string;
18
- slot: 'sidebar-nav';
19
- order?: number;
20
- render: (container: HTMLElement, appContext: AppContext) => void;
21
- }
22
-
23
- export type AppContext = IPlatformAPI;
24
- export type ViewId = 'dashboard' | 'kanban' | 'goal-architect' | 'projects' | 'calendar' | 'journal' | 'resilience' | 'settings' | 'progress' | 'blueprint' | 'marketplace' | 'upload-module' | 'user-profile' | 'help' | 'about' | 'notifications';
25
-
26
- declare const HTML_RESULT = 1;
27
- declare const SVG_RESULT = 2;
28
- declare const MATHML_RESULT = 3;
29
- type ResultType = typeof HTML_RESULT | typeof SVG_RESULT | typeof MATHML_RESULT;
30
-
31
- export type UncompiledTemplateResult<T extends ResultType = ResultType> = {
32
- ['_$litType$']: T;
33
- strings: TemplateStringsArray;
34
- values: unknown[];
35
- };
36
- export type TemplateResult<T extends ResultType = ResultType> = UncompiledTemplateResult<T>;
@@ -1,69 +0,0 @@
1
- // Types
2
- export type LogLevel = 'log' | 'info' | 'warn' | 'error';
3
- export type DockPosition = 'left' | 'bottom' | 'right' | 'floating';
4
- export type TabId = 'state' | 'history' | 'events' | 'console' | 'network' | 'performance';
5
- export type PanelLayout = 'single' | 'split-horizontal' | 'split-vertical' | 'grid';
6
-
7
- export interface ConsoleLog {
8
- id: string;
9
- type: LogLevel;
10
- timestamp: Date;
11
- message: any[];
12
- stack?: string;
13
- }
14
-
15
- export interface NetworkLog {
16
- id: string;
17
- url: string;
18
- method: string;
19
- status: number;
20
- timestamp: Date;
21
- duration: number;
22
- size?: number;
23
- error?: string;
24
- }
25
-
26
- export interface PerformanceLog {
27
- id: string;
28
- name: string;
29
- duration: number;
30
- timestamp: Date;
31
- type: 'navigation' | 'resource' | 'measure' | 'mark';
32
- }
33
-
34
- export interface EventLog {
35
- id: string;
36
- name: string;
37
- data: any;
38
- timestamp: Date;
39
- direction: 'emitted' | 'received';
40
- }
41
-
42
- export interface PanelInstance {
43
- id: string;
44
- activeTab: TabId;
45
- position: { x: number; y: number };
46
- size: { width: number; height: number };
47
- isMinimized: boolean;
48
- zIndex: number;
49
- }
50
-
51
- export interface DebugSettings {
52
- maxLogs: number;
53
- autoScroll: boolean;
54
- showTimestamps: boolean;
55
- position: DockPosition;
56
- isMinimized: boolean;
57
- layout: PanelLayout;
58
- panels: PanelInstance[];
59
- enableStateEditing: boolean;
60
- autoSaveState: boolean;
61
- theme: 'dark' | 'light';
62
- }
63
-
64
- export interface StateEditContext {
65
- path: string[];
66
- originalValue: any;
67
- isEditing: boolean;
68
- element?: HTMLElement;
69
- }
@@ -1,3 +0,0 @@
1
- // src/types/index.ts
2
- export * from './app';
3
- export * from './platform';
@@ -1,112 +0,0 @@
1
- // --- Tipos de la UI del Workbench ---
2
-
3
- import { IPlatformAPI } from "../core/api";
4
- import { TemplateResult } from "./app";
5
- import React from 'react';
6
-
7
- export interface Pane {
8
- id: string;
9
- tabs: Tab[];
10
- activeTabId: string | null;
11
- }
12
-
13
- export interface Tab {
14
- id: string;
15
- title: string;
16
- componentTag: string;
17
- icon?: string;
18
- }
19
-
20
- // --- Tipos de Puntos de Contribución de la UI ---
21
-
22
- export interface ActivityBarItem {
23
- id: string;
24
- icon: string;
25
- title: string;
26
- viewId: string; // ID de la vista que se mostrará en el sidebar
27
- order?: number;
28
- command?: string; // Comando opcional a ejecutar en lugar del default
29
- commandArg?: any;
30
- }
31
-
32
- export interface SidebarView {
33
- id: string;
34
- title: string;
35
- render?: (container: HTMLElement, api: IPlatformAPI) => void;
36
- component?: React.ComponentType<any>;
37
- }
38
-
39
- export interface SidebarRightView {
40
- id: string;
41
- title: string;
42
- render?: (container: HTMLElement, api: IPlatformAPI) => void;
43
- component?: React.ComponentType<any>;
44
- }
45
-
46
- export interface MainView { // Opcional, si quieres registrar vistas principales
47
- id: string;
48
- render?: (container: HTMLElement, api: IPlatformAPI) => void;
49
- componentTag: string;
50
- component?: React.ComponentType<any>;
51
- }
52
-
53
- export interface PanelView {
54
- id: string;
55
- title: string;
56
- render?: (container: HTMLElement, api: IPlatformAPI) => void;
57
- component?: React.ComponentType<any>;
58
- }
59
-
60
- export interface StatusBarItem {
61
- id: string;
62
- render: (container: HTMLElement, api: IPlatformAPI) => void;
63
- alignment: 'left' | 'right';
64
- order?: number;
65
- }
66
-
67
- export interface TopBarItem {
68
- id: string;
69
- order?: number;
70
- // Para botones simples
71
- icon?: string;
72
- title?: string;
73
- commandId?: string;
74
- commandArg?: any;
75
- // Para componentes complejos
76
- render?: (api: IPlatformAPI) => TemplateResult;
77
- }
78
-
79
- export interface CalendarEvent {
80
- id: number;
81
- title: string;
82
- start: string; // Formato ISO: "2025-07-25T10:00:00"
83
- end: string; // Formato ISO: "2025-07-25T11:30:00"
84
- allDay: boolean;
85
- color: string; // Color del evento, puede heredar de un proyecto
86
- source?: {
87
- type: 'project' | 'task' | 'manual';
88
- id?: number;
89
- };
90
- }
91
-
92
- export interface GamificationAchievement {
93
- id: string;
94
- title: string;
95
- description: string;
96
- icon: string;
97
- conditionType: 'tasks_completed' | 'goals_created' | 'journal_streak' | 'level';
98
- conditionValue: number;
99
- reward_xp: number;
100
- isCustom?: boolean;
101
- isSuggested?: boolean;
102
- unlocked?: boolean;
103
- }
104
-
105
- export interface GamificationState {
106
- xp: number;
107
- level: number;
108
- streak: number;
109
- lastJournalDate: string | null;
110
- unlockedAchievements: string[];
111
- achievements: GamificationAchievement[];
112
- }
package/src/ui/Palette.ts DELETED
@@ -1,161 +0,0 @@
1
- // /src/ui/Palette.ts (VERSIÓN COMPLETA Y FUNCIONAL)
2
-
3
- import { IPlatformAPI } from '../core/api.js';
4
- import { Command } from '../core/CommandService.js';
5
- import { html } from '../utils.js';
6
-
7
- export class Palette {
8
- private api: IPlatformAPI;
9
- private dom: { [key: string]: HTMLElement | null } = {};
10
- private allCommands: Command[] = [];
11
- private filteredCommands: Command[] = [];
12
- private selectedIndex = 0;
13
-
14
- constructor(api: IPlatformAPI) {
15
- this.api = api;
16
- this.init();
17
- }
18
-
19
- /**
20
- * Alterna la visibilidad de la paleta.
21
- */
22
- public toggle() {
23
- const isHidden = this.dom.modal?.classList.contains('hidden');
24
- if (isHidden) this.show();
25
- else this.hide();
26
- }
27
-
28
- /**
29
- * Muestra la paleta, carga los comandos y enfoca el input.
30
- */
31
- private show() {
32
- this.allCommands = this.api.commands.getAll();
33
- this.filteredCommands = this.allCommands;
34
- this.selectedIndex = 0;
35
- this.renderResults();
36
- this.dom.modal?.classList.remove('hidden');
37
- (this.dom.input as HTMLInputElement)?.focus();
38
- }
39
-
40
- /**
41
- * Oculta la paleta y resetea el input.
42
- */
43
- private hide() {
44
- const input = this.dom.input as HTMLInputElement;
45
- if (input) input.value = '';
46
- this.dom.modal?.classList.add('hidden');
47
- }
48
-
49
- /**
50
- * Crea el HTML de la paleta y lo añade al DOM.
51
- */
52
- private init() {
53
- const paletteEl = document.createElement('div');
54
- paletteEl.id = 'command-palette-modal';
55
- paletteEl.className = 'fixed inset-0 bg-darker/80 backdrop-blur-sm flex items-start justify-center hidden pt-24';
56
- paletteEl.style.zIndex = '10000';
57
- paletteEl.style.position = 'fixed';
58
- paletteEl.innerHTML = html`
59
- <div class="glass-premium p-4 rounded-2xl w-full max-w-2xl animate-scale-in flex flex-col max-h-[70vh]">
60
- <input id="palette-search-input" type="text" class="form-input-premium text-lg mb-2" placeholder="Escribe un comando...">
61
- <div id="palette-results-list" class="overflow-y-auto"></div>
62
- </div>
63
- `;
64
- document.body.appendChild(paletteEl);
65
-
66
- this.dom.modal = paletteEl;
67
- this.dom.input = paletteEl.querySelector('#palette-search-input');
68
- this.dom.results = paletteEl.querySelector('#palette-results-list');
69
-
70
- this.attachEventListeners();
71
- }
72
-
73
- /**
74
- * Adjunta todos los listeners necesarios para la interactividad de la paleta.
75
- */
76
- private attachEventListeners() {
77
- // Cerrar al hacer clic fuera del modal
78
- this.dom.modal?.addEventListener('click', (e) => {
79
- if (e.target === this.dom.modal) this.hide();
80
- });
81
-
82
- // Filtrar resultados mientras el usuario escribe
83
- this.dom.input?.addEventListener('input', () => {
84
- const searchTerm = (this.dom.input as HTMLInputElement).value.toLowerCase();
85
- this.filteredCommands = this.allCommands.filter(cmd =>
86
- cmd.title.toLowerCase().includes(searchTerm) ||
87
- cmd.category?.toLowerCase().includes(searchTerm)
88
- );
89
- this.selectedIndex = 0;
90
- this.renderResults();
91
- });
92
-
93
- // Navegación por teclado y ejecución
94
- this.dom.input?.addEventListener('keydown', (e: KeyboardEvent) => {
95
- switch (e.key) {
96
- case 'ArrowDown':
97
- e.preventDefault();
98
- this.selectedIndex = Math.min(this.selectedIndex + 1, this.filteredCommands.length - 1);
99
- this.renderResults();
100
- break;
101
- case 'ArrowUp':
102
- e.preventDefault();
103
- this.selectedIndex = Math.max(this.selectedIndex - 1, 0);
104
- this.renderResults();
105
- break;
106
- case 'Enter':
107
- e.preventDefault();
108
- this.executeSelected();
109
- break;
110
- case 'Escape':
111
- this.hide();
112
- break;
113
- }
114
- });
115
-
116
- // Ejecución por clic
117
- this.dom.results?.addEventListener('click', (e: MouseEvent) => {
118
- const item = (e.target as HTMLElement).closest('.command-palette-item') as HTMLElement;
119
- if (item?.dataset.commandId) {
120
- this.api.commands.execute(item.dataset.commandId);
121
- this.hide();
122
- }
123
- });
124
- }
125
-
126
- /**
127
- * Dibuja la lista de comandos filtrados en el DOM.
128
- */
129
- private renderResults() {
130
- if (!this.dom.results) return;
131
-
132
- if (this.filteredCommands.length === 0) {
133
- this.dom.results.innerHTML = `<div class="p-4 text-center text-muted-foreground">No se encontraron comandos.</div>`;
134
- return;
135
- }
136
-
137
- this.dom.results.innerHTML = this.filteredCommands.map((cmd, index) => html`
138
- <div class="command-palette-item ${index === this.selectedIndex ? 'selected' : ''}" data-command-id="${cmd.id}">
139
- <div class="flex items-center gap-3">
140
- <i class="${cmd.icon || 'fas fa-cogs'}"></i>
141
- <span>${cmd.title}</span>
142
- </div>
143
- ${cmd.category ? `<span class="category">${cmd.category}</span>` : ''}
144
- </div>
145
- `).join('');
146
-
147
- // Asegurarse de que el elemento seleccionado esté visible
148
- this.dom.results.querySelector('.selected')?.scrollIntoView({ block: 'nearest' });
149
- }
150
-
151
- /**
152
- * Ejecuta el comando actualmente seleccionado en la lista.
153
- */
154
- private executeSelected() {
155
- const command = this.filteredCommands[this.selectedIndex];
156
- if (command) {
157
- this.api.commands.execute(command.id);
158
- this.hide();
159
- }
160
- }
161
- }
package/src/utils.ts DELETED
@@ -1,63 +0,0 @@
1
- // js/utils.js
2
-
3
- /**
4
- * Formatea una cadena de fecha (ej: "2025-06-20") a un formato legible.
5
- * @param {string} dateString - La fecha en formato YYYY-MM-DD.
6
- * @returns {string} La fecha formateada (ej: "20 jun. 2025").
7
- */
8
- export function formatDate(dateString?: string): string {
9
- if (!dateString) return 'Sin fecha';
10
- const date = new Date(dateString);
11
- const userTimezoneOffset = date.getTimezoneOffset() * 60000;
12
- return new Date(date.getTime() + userTimezoneOffset).toLocaleDateString('es-ES', {
13
- year: 'numeric',
14
- month: 'short',
15
- day: 'numeric'
16
- });
17
- }
18
-
19
- /**
20
- * Función ficticia (dummy) para activar el resaltado de sintaxis de HTML
21
- * en las plantillas de texto de VS Code. Simplemente reconstruye y devuelve
22
- * la cadena de texto original.
23
- * @param {TemplateStringsArray} strings
24
- * @param {...any} values
25
- * @returns {string}
26
- */
27
- export function html(strings: any, ...values: any[]) {
28
- // String.raw es una forma segura y nativa de reconstruir la plantilla
29
- return String.raw({ raw: strings }, ...values);
30
- }
31
-
32
- /**
33
- * Hace que un elemento del DOM sea arrastrable usando un manejador.
34
- * @param {HTMLElement} _element - El elemento a mover.
35
- * @param {HTMLElement} _handle - El elemento que activa el arrastre.
36
- */
37
- export function makeDraggable(_element: any, _handle: any) {
38
- // let pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
39
- // handle.onmousedown = dragMouseDown;
40
-
41
- // function dragMouseDown(e) {
42
- // e.preventDefault();
43
- // pos3 = e.clientX;
44
- // pos4 = e.clientY;
45
- // document.onmouseup = closeDragElement;
46
- // document.onmousemove = elementDrag;
47
- // }
48
-
49
- // function elementDrag(e) {
50
- // e.preventDefault();
51
- // pos1 = pos3 - e.clientX;
52
- // pos2 = pos4 - e.clientY;
53
- // pos3 = e.clientX;
54
- // pos4 = e.clientY;
55
- // element.style.top = (element.offsetTop - pos2) + "px";
56
- // element.style.left = (element.offsetLeft - pos1) + "px";
57
- // }
58
-
59
- // function closeDragElement() {
60
- // document.onmouseup = null;
61
- // document.onmousemove = null;
62
- // }
63
- }
package/tsconfig.json DELETED
@@ -1,23 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ESNext",
4
- "module": "ESNext",
5
- "outDir": "dist",
6
- "rootDir": "src",
7
- "strict": true,
8
- "esModuleInterop": true,
9
- "skipLibCheck": true,
10
- "forceConsistentCasingInFileNames": true,
11
- "declaration": true,
12
- "declarationMap": true,
13
- "moduleResolution": "node",
14
- "jsx": "react-jsx"
15
- },
16
- "include": [
17
- "src/**/*.ts"
18
- ],
19
- "exclude": [
20
- "node_modules",
21
- "dist"
22
- ]
23
- }