wu-framework 1.1.15 → 1.1.17
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/README.md +52 -20
- package/dist/wu-framework.cjs.js +1 -1
- package/dist/wu-framework.cjs.js.map +1 -1
- package/dist/wu-framework.dev.js +15511 -15146
- package/dist/wu-framework.dev.js.map +1 -1
- package/dist/wu-framework.esm.js +1 -1
- package/dist/wu-framework.esm.js.map +1 -1
- package/dist/wu-framework.umd.js +1 -1
- package/dist/wu-framework.umd.js.map +1 -1
- package/package.json +166 -161
- package/src/adapters/angular/ai.js +30 -30
- package/src/adapters/angular/index.d.ts +154 -154
- package/src/adapters/angular/index.js +932 -932
- package/src/adapters/angular.d.ts +3 -3
- package/src/adapters/angular.js +3 -3
- package/src/adapters/index.js +168 -168
- package/src/adapters/lit/ai.js +20 -20
- package/src/adapters/lit/index.d.ts +120 -120
- package/src/adapters/lit/index.js +721 -721
- package/src/adapters/lit.d.ts +3 -3
- package/src/adapters/lit.js +3 -3
- package/src/adapters/preact/ai.js +33 -33
- package/src/adapters/preact/index.d.ts +108 -108
- package/src/adapters/preact/index.js +661 -661
- package/src/adapters/preact.d.ts +3 -3
- package/src/adapters/preact.js +3 -3
- package/src/adapters/react/index.js +48 -54
- package/src/adapters/react.d.ts +3 -3
- package/src/adapters/react.js +3 -3
- package/src/adapters/shared.js +64 -64
- package/src/adapters/solid/ai.js +32 -32
- package/src/adapters/solid/index.d.ts +101 -101
- package/src/adapters/solid/index.js +586 -586
- package/src/adapters/solid.d.ts +3 -3
- package/src/adapters/solid.js +3 -3
- package/src/adapters/svelte/ai.js +31 -31
- package/src/adapters/svelte/index.d.ts +166 -166
- package/src/adapters/svelte/index.js +798 -798
- package/src/adapters/svelte.d.ts +3 -3
- package/src/adapters/svelte.js +3 -3
- package/src/adapters/vanilla/ai.js +30 -30
- package/src/adapters/vanilla/index.d.ts +179 -179
- package/src/adapters/vanilla/index.js +785 -785
- package/src/adapters/vanilla.d.ts +3 -3
- package/src/adapters/vanilla.js +3 -3
- package/src/adapters/vue/ai.js +52 -52
- package/src/adapters/vue/index.d.ts +299 -299
- package/src/adapters/vue/index.js +610 -610
- package/src/adapters/vue.d.ts +3 -3
- package/src/adapters/vue.js +3 -3
- package/src/ai/wu-ai-actions.js +261 -261
- package/src/ai/wu-ai-agent.js +546 -546
- package/src/ai/wu-ai-browser-primitives.js +354 -354
- package/src/ai/wu-ai-browser.js +380 -380
- package/src/ai/wu-ai-context.js +332 -332
- package/src/ai/wu-ai-conversation.js +613 -613
- package/src/ai/wu-ai-orchestrate.js +1021 -1021
- package/src/ai/wu-ai-permissions.js +381 -381
- package/src/ai/wu-ai-provider.js +700 -700
- package/src/ai/wu-ai-schema.js +225 -225
- package/src/ai/wu-ai-triggers.js +396 -396
- package/src/ai/wu-ai.js +804 -804
- package/src/core/wu-app.js +236 -236
- package/src/core/wu-cache.js +498 -477
- package/src/core/wu-core.js +1412 -1398
- package/src/core/wu-error-boundary.js +396 -382
- package/src/core/wu-event-bus.js +390 -348
- package/src/core/wu-hooks.js +350 -350
- package/src/core/wu-html-parser.js +199 -190
- package/src/core/wu-iframe-sandbox.js +328 -328
- package/src/core/wu-loader.js +385 -273
- package/src/core/wu-logger.js +142 -134
- package/src/core/wu-manifest.js +532 -509
- package/src/core/wu-mcp-bridge.js +432 -432
- package/src/core/wu-overrides.js +510 -510
- package/src/core/wu-performance.js +228 -228
- package/src/core/wu-plugin.js +401 -348
- package/src/core/wu-prefetch.js +414 -414
- package/src/core/wu-proxy-sandbox.js +477 -476
- package/src/core/wu-sandbox.js +779 -779
- package/src/core/wu-script-executor.js +161 -113
- package/src/core/wu-snapshot-sandbox.js +227 -227
- package/src/core/wu-store.js +13 -3
- package/src/core/wu-strategies.js +256 -256
- package/src/core/wu-style-bridge.js +477 -477
- package/src/index.d.ts +317 -0
- package/src/index.js +234 -224
- package/src/utils/dependency-resolver.js +327 -327
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
// Re-export from folder structure — backward compatibility
|
|
2
|
-
export * from './angular/index';
|
|
3
|
-
export { default } from './angular/index';
|
|
1
|
+
// Re-export from folder structure — backward compatibility
|
|
2
|
+
export * from './angular/index';
|
|
3
|
+
export { default } from './angular/index';
|
package/src/adapters/angular.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
// Re-export from folder structure — backward compatibility
|
|
2
|
-
export * from './angular/index.js';
|
|
3
|
-
export { default } from './angular/index.js';
|
|
1
|
+
// Re-export from folder structure — backward compatibility
|
|
2
|
+
export * from './angular/index.js';
|
|
3
|
+
export { default } from './angular/index.js';
|
package/src/adapters/index.js
CHANGED
|
@@ -1,168 +1,168 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 🚀 WU-FRAMEWORK ADAPTERS
|
|
3
|
-
*
|
|
4
|
-
* Adapters oficiales para integrar Wu Framework con frameworks populares.
|
|
5
|
-
* Soporta: React, Vue, Angular, Svelte, Preact, Solid.js, Lit, Vanilla JS
|
|
6
|
-
*
|
|
7
|
-
* Cada adapter incluye integración AI (Paradigma C: IA como Director de Orquesta).
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* // Importar adapter específico
|
|
11
|
-
* import { wuReact } from 'wu-framework/adapters/react';
|
|
12
|
-
* import { wuVue } from 'wu-framework/adapters/vue';
|
|
13
|
-
* import { wuAngular } from 'wu-framework/adapters/angular';
|
|
14
|
-
* import { wuSvelte } from 'wu-framework/adapters/svelte';
|
|
15
|
-
* import { wuPreact } from 'wu-framework/adapters/preact';
|
|
16
|
-
* import { wuSolid } from 'wu-framework/adapters/solid';
|
|
17
|
-
* import { wuLit } from 'wu-framework/adapters/lit';
|
|
18
|
-
* import { wuVanilla } from 'wu-framework/adapters/vanilla';
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* // Importar todo
|
|
22
|
-
* import {
|
|
23
|
-
* wuReact, wuVue, wuAngular, wuSvelte,
|
|
24
|
-
* wuPreact, wuSolid, wuLit, wuVanilla
|
|
25
|
-
* } from 'wu-framework/adapters';
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
// ============================================
|
|
29
|
-
// REACT ADAPTER
|
|
30
|
-
// ============================================
|
|
31
|
-
export {
|
|
32
|
-
wuReact,
|
|
33
|
-
register as registerReact,
|
|
34
|
-
createWuSlot,
|
|
35
|
-
createUseWuEvents,
|
|
36
|
-
createUseWuStore,
|
|
37
|
-
createUseWuAI
|
|
38
|
-
} from './react/index.js';
|
|
39
|
-
|
|
40
|
-
// ============================================
|
|
41
|
-
// VUE ADAPTER
|
|
42
|
-
// ============================================
|
|
43
|
-
export {
|
|
44
|
-
wuVue,
|
|
45
|
-
register as registerVue,
|
|
46
|
-
WuSlot,
|
|
47
|
-
useWuEvents,
|
|
48
|
-
useWuStore,
|
|
49
|
-
wuVuePlugin,
|
|
50
|
-
createUseWuAI as createVueUseWuAI,
|
|
51
|
-
useWuAI as useVueWuAI
|
|
52
|
-
} from './vue/index.js';
|
|
53
|
-
|
|
54
|
-
// ============================================
|
|
55
|
-
// ANGULAR ADAPTER
|
|
56
|
-
// ============================================
|
|
57
|
-
export {
|
|
58
|
-
wuAngular,
|
|
59
|
-
register as registerAngular,
|
|
60
|
-
registerStandalone as registerAngularStandalone,
|
|
61
|
-
createWuService,
|
|
62
|
-
createWuSlotComponent,
|
|
63
|
-
getWuSlotModuleConfig,
|
|
64
|
-
createWuAIService
|
|
65
|
-
} from './angular/index.js';
|
|
66
|
-
|
|
67
|
-
// ============================================
|
|
68
|
-
// SVELTE ADAPTER
|
|
69
|
-
// ============================================
|
|
70
|
-
export {
|
|
71
|
-
wuSvelte,
|
|
72
|
-
register as registerSvelte,
|
|
73
|
-
registerSvelte5,
|
|
74
|
-
createWuStore as createSvelteWuStore,
|
|
75
|
-
createWuEventStore,
|
|
76
|
-
useWuEvents as useSvelteWuEvents,
|
|
77
|
-
createWuSlotConfig,
|
|
78
|
-
createWuAIStore
|
|
79
|
-
} from './svelte/index.js';
|
|
80
|
-
|
|
81
|
-
// ============================================
|
|
82
|
-
// PREACT ADAPTER
|
|
83
|
-
// ============================================
|
|
84
|
-
export {
|
|
85
|
-
wuPreact,
|
|
86
|
-
register as registerPreact,
|
|
87
|
-
registerCompat as registerPreactCompat,
|
|
88
|
-
createWuSlot as createPreactWuSlot,
|
|
89
|
-
createUseWuEvents as createPreactUseWuEvents,
|
|
90
|
-
createUseWuStore as createPreactUseWuStore,
|
|
91
|
-
createUseWuAI as createPreactUseWuAI
|
|
92
|
-
} from './preact/index.js';
|
|
93
|
-
|
|
94
|
-
// ============================================
|
|
95
|
-
// SOLID.JS ADAPTER
|
|
96
|
-
// ============================================
|
|
97
|
-
export {
|
|
98
|
-
wuSolid,
|
|
99
|
-
register as registerSolid,
|
|
100
|
-
createWuSlot as createSolidWuSlot,
|
|
101
|
-
createWuStore as createSolidWuStore,
|
|
102
|
-
createWuEvent,
|
|
103
|
-
useWuEvents as useSolidWuEvents,
|
|
104
|
-
createWuContext,
|
|
105
|
-
createUseWuAI as createSolidUseWuAI
|
|
106
|
-
} from './solid/index.js';
|
|
107
|
-
|
|
108
|
-
// ============================================
|
|
109
|
-
// LIT (WEB COMPONENTS) ADAPTER
|
|
110
|
-
// ============================================
|
|
111
|
-
export {
|
|
112
|
-
wuLit,
|
|
113
|
-
register as registerLit,
|
|
114
|
-
registerWebComponent,
|
|
115
|
-
createWuSlotElement,
|
|
116
|
-
WuMixin,
|
|
117
|
-
WuAIMixin,
|
|
118
|
-
wuProperty,
|
|
119
|
-
createSimpleElement
|
|
120
|
-
} from './lit/index.js';
|
|
121
|
-
|
|
122
|
-
// ============================================
|
|
123
|
-
// VANILLA JS ADAPTER
|
|
124
|
-
// ============================================
|
|
125
|
-
export {
|
|
126
|
-
wuVanilla,
|
|
127
|
-
register as registerVanilla,
|
|
128
|
-
registerClass,
|
|
129
|
-
registerTemplate,
|
|
130
|
-
createComponent,
|
|
131
|
-
createWuSlot as createVanillaWuSlot,
|
|
132
|
-
useWuEvents as useVanillaWuEvents,
|
|
133
|
-
useWuStore as useVanillaWuStore,
|
|
134
|
-
useWuAI as useVanillaWuAI
|
|
135
|
-
} from './vanilla/index.js';
|
|
136
|
-
|
|
137
|
-
// ============================================
|
|
138
|
-
// SHARED UTILITIES
|
|
139
|
-
// ============================================
|
|
140
|
-
export { getWuInstance, waitForWu } from './shared.js';
|
|
141
|
-
|
|
142
|
-
// ============================================
|
|
143
|
-
// ALL ADAPTERS OBJECT
|
|
144
|
-
// ============================================
|
|
145
|
-
import { wuReact } from './react/index.js';
|
|
146
|
-
import { wuVue } from './vue/index.js';
|
|
147
|
-
import { wuAngular } from './angular/index.js';
|
|
148
|
-
import { wuSvelte } from './svelte/index.js';
|
|
149
|
-
import { wuPreact } from './preact/index.js';
|
|
150
|
-
import { wuSolid } from './solid/index.js';
|
|
151
|
-
import { wuLit } from './lit/index.js';
|
|
152
|
-
import { wuVanilla } from './vanilla/index.js';
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Objeto con todos los adapters disponibles
|
|
156
|
-
*/
|
|
157
|
-
export const adapters = {
|
|
158
|
-
react: wuReact,
|
|
159
|
-
vue: wuVue,
|
|
160
|
-
angular: wuAngular,
|
|
161
|
-
svelte: wuSvelte,
|
|
162
|
-
preact: wuPreact,
|
|
163
|
-
solid: wuSolid,
|
|
164
|
-
lit: wuLit,
|
|
165
|
-
vanilla: wuVanilla
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
export default adapters;
|
|
1
|
+
/**
|
|
2
|
+
* 🚀 WU-FRAMEWORK ADAPTERS
|
|
3
|
+
*
|
|
4
|
+
* Adapters oficiales para integrar Wu Framework con frameworks populares.
|
|
5
|
+
* Soporta: React, Vue, Angular, Svelte, Preact, Solid.js, Lit, Vanilla JS
|
|
6
|
+
*
|
|
7
|
+
* Cada adapter incluye integración AI (Paradigma C: IA como Director de Orquesta).
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* // Importar adapter específico
|
|
11
|
+
* import { wuReact } from 'wu-framework/adapters/react';
|
|
12
|
+
* import { wuVue } from 'wu-framework/adapters/vue';
|
|
13
|
+
* import { wuAngular } from 'wu-framework/adapters/angular';
|
|
14
|
+
* import { wuSvelte } from 'wu-framework/adapters/svelte';
|
|
15
|
+
* import { wuPreact } from 'wu-framework/adapters/preact';
|
|
16
|
+
* import { wuSolid } from 'wu-framework/adapters/solid';
|
|
17
|
+
* import { wuLit } from 'wu-framework/adapters/lit';
|
|
18
|
+
* import { wuVanilla } from 'wu-framework/adapters/vanilla';
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // Importar todo
|
|
22
|
+
* import {
|
|
23
|
+
* wuReact, wuVue, wuAngular, wuSvelte,
|
|
24
|
+
* wuPreact, wuSolid, wuLit, wuVanilla
|
|
25
|
+
* } from 'wu-framework/adapters';
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
// ============================================
|
|
29
|
+
// REACT ADAPTER
|
|
30
|
+
// ============================================
|
|
31
|
+
export {
|
|
32
|
+
wuReact,
|
|
33
|
+
register as registerReact,
|
|
34
|
+
createWuSlot,
|
|
35
|
+
createUseWuEvents,
|
|
36
|
+
createUseWuStore,
|
|
37
|
+
createUseWuAI
|
|
38
|
+
} from './react/index.js';
|
|
39
|
+
|
|
40
|
+
// ============================================
|
|
41
|
+
// VUE ADAPTER
|
|
42
|
+
// ============================================
|
|
43
|
+
export {
|
|
44
|
+
wuVue,
|
|
45
|
+
register as registerVue,
|
|
46
|
+
WuSlot,
|
|
47
|
+
useWuEvents,
|
|
48
|
+
useWuStore,
|
|
49
|
+
wuVuePlugin,
|
|
50
|
+
createUseWuAI as createVueUseWuAI,
|
|
51
|
+
useWuAI as useVueWuAI
|
|
52
|
+
} from './vue/index.js';
|
|
53
|
+
|
|
54
|
+
// ============================================
|
|
55
|
+
// ANGULAR ADAPTER
|
|
56
|
+
// ============================================
|
|
57
|
+
export {
|
|
58
|
+
wuAngular,
|
|
59
|
+
register as registerAngular,
|
|
60
|
+
registerStandalone as registerAngularStandalone,
|
|
61
|
+
createWuService,
|
|
62
|
+
createWuSlotComponent,
|
|
63
|
+
getWuSlotModuleConfig,
|
|
64
|
+
createWuAIService
|
|
65
|
+
} from './angular/index.js';
|
|
66
|
+
|
|
67
|
+
// ============================================
|
|
68
|
+
// SVELTE ADAPTER
|
|
69
|
+
// ============================================
|
|
70
|
+
export {
|
|
71
|
+
wuSvelte,
|
|
72
|
+
register as registerSvelte,
|
|
73
|
+
registerSvelte5,
|
|
74
|
+
createWuStore as createSvelteWuStore,
|
|
75
|
+
createWuEventStore,
|
|
76
|
+
useWuEvents as useSvelteWuEvents,
|
|
77
|
+
createWuSlotConfig,
|
|
78
|
+
createWuAIStore
|
|
79
|
+
} from './svelte/index.js';
|
|
80
|
+
|
|
81
|
+
// ============================================
|
|
82
|
+
// PREACT ADAPTER
|
|
83
|
+
// ============================================
|
|
84
|
+
export {
|
|
85
|
+
wuPreact,
|
|
86
|
+
register as registerPreact,
|
|
87
|
+
registerCompat as registerPreactCompat,
|
|
88
|
+
createWuSlot as createPreactWuSlot,
|
|
89
|
+
createUseWuEvents as createPreactUseWuEvents,
|
|
90
|
+
createUseWuStore as createPreactUseWuStore,
|
|
91
|
+
createUseWuAI as createPreactUseWuAI
|
|
92
|
+
} from './preact/index.js';
|
|
93
|
+
|
|
94
|
+
// ============================================
|
|
95
|
+
// SOLID.JS ADAPTER
|
|
96
|
+
// ============================================
|
|
97
|
+
export {
|
|
98
|
+
wuSolid,
|
|
99
|
+
register as registerSolid,
|
|
100
|
+
createWuSlot as createSolidWuSlot,
|
|
101
|
+
createWuStore as createSolidWuStore,
|
|
102
|
+
createWuEvent,
|
|
103
|
+
useWuEvents as useSolidWuEvents,
|
|
104
|
+
createWuContext,
|
|
105
|
+
createUseWuAI as createSolidUseWuAI
|
|
106
|
+
} from './solid/index.js';
|
|
107
|
+
|
|
108
|
+
// ============================================
|
|
109
|
+
// LIT (WEB COMPONENTS) ADAPTER
|
|
110
|
+
// ============================================
|
|
111
|
+
export {
|
|
112
|
+
wuLit,
|
|
113
|
+
register as registerLit,
|
|
114
|
+
registerWebComponent,
|
|
115
|
+
createWuSlotElement,
|
|
116
|
+
WuMixin,
|
|
117
|
+
WuAIMixin,
|
|
118
|
+
wuProperty,
|
|
119
|
+
createSimpleElement
|
|
120
|
+
} from './lit/index.js';
|
|
121
|
+
|
|
122
|
+
// ============================================
|
|
123
|
+
// VANILLA JS ADAPTER
|
|
124
|
+
// ============================================
|
|
125
|
+
export {
|
|
126
|
+
wuVanilla,
|
|
127
|
+
register as registerVanilla,
|
|
128
|
+
registerClass,
|
|
129
|
+
registerTemplate,
|
|
130
|
+
createComponent,
|
|
131
|
+
createWuSlot as createVanillaWuSlot,
|
|
132
|
+
useWuEvents as useVanillaWuEvents,
|
|
133
|
+
useWuStore as useVanillaWuStore,
|
|
134
|
+
useWuAI as useVanillaWuAI
|
|
135
|
+
} from './vanilla/index.js';
|
|
136
|
+
|
|
137
|
+
// ============================================
|
|
138
|
+
// SHARED UTILITIES
|
|
139
|
+
// ============================================
|
|
140
|
+
export { getWuInstance, waitForWu } from './shared.js';
|
|
141
|
+
|
|
142
|
+
// ============================================
|
|
143
|
+
// ALL ADAPTERS OBJECT
|
|
144
|
+
// ============================================
|
|
145
|
+
import { wuReact } from './react/index.js';
|
|
146
|
+
import { wuVue } from './vue/index.js';
|
|
147
|
+
import { wuAngular } from './angular/index.js';
|
|
148
|
+
import { wuSvelte } from './svelte/index.js';
|
|
149
|
+
import { wuPreact } from './preact/index.js';
|
|
150
|
+
import { wuSolid } from './solid/index.js';
|
|
151
|
+
import { wuLit } from './lit/index.js';
|
|
152
|
+
import { wuVanilla } from './vanilla/index.js';
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Objeto con todos los adapters disponibles
|
|
156
|
+
*/
|
|
157
|
+
export const adapters = {
|
|
158
|
+
react: wuReact,
|
|
159
|
+
vue: wuVue,
|
|
160
|
+
angular: wuAngular,
|
|
161
|
+
svelte: wuSvelte,
|
|
162
|
+
preact: wuPreact,
|
|
163
|
+
solid: wuSolid,
|
|
164
|
+
lit: wuLit,
|
|
165
|
+
vanilla: wuVanilla
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export default adapters;
|
package/src/adapters/lit/ai.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WU-FRAMEWORK LIT AI INTEGRATION
|
|
3
|
-
*/
|
|
4
|
-
function getWuInstance() {
|
|
5
|
-
if (typeof window === 'undefined') return null;
|
|
6
|
-
return window.wu || window.parent?.wu || window.top?.wu || null;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function WuAIMixin(Base) {
|
|
10
|
-
return class extends Base {
|
|
11
|
-
constructor() { super(); this._wuAINamespace = 'default'; }
|
|
12
|
-
get wuAI() { return getWuInstance()?.ai || null; }
|
|
13
|
-
async wuAISend(text, options = {}) {
|
|
14
|
-
const ai = this.wuAI;
|
|
15
|
-
if (!ai) { console.warn('[WuAIMixin] wu.ai not available'); return null; }
|
|
16
|
-
return ai.send(text, { namespace: this._wuAINamespace, ...options });
|
|
17
|
-
}
|
|
18
|
-
wuAISetNamespace(ns) { this._wuAINamespace = ns; }
|
|
19
|
-
};
|
|
20
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* WU-FRAMEWORK LIT AI INTEGRATION
|
|
3
|
+
*/
|
|
4
|
+
function getWuInstance() {
|
|
5
|
+
if (typeof window === 'undefined') return null;
|
|
6
|
+
return window.wu || window.parent?.wu || window.top?.wu || null;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function WuAIMixin(Base) {
|
|
10
|
+
return class extends Base {
|
|
11
|
+
constructor() { super(); this._wuAINamespace = 'default'; }
|
|
12
|
+
get wuAI() { return getWuInstance()?.ai || null; }
|
|
13
|
+
async wuAISend(text, options = {}) {
|
|
14
|
+
const ai = this.wuAI;
|
|
15
|
+
if (!ai) { console.warn('[WuAIMixin] wu.ai not available'); return null; }
|
|
16
|
+
return ai.send(text, { namespace: this._wuAINamespace, ...options });
|
|
17
|
+
}
|
|
18
|
+
wuAISetNamespace(ns) { this._wuAINamespace = ns; }
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -1,120 +1,120 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 🚀 WU-FRAMEWORK LIT ADAPTER - TypeScript Declarations
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { WuCore } from '../core/wu-core';
|
|
6
|
-
|
|
7
|
-
// Lit types (generics to avoid hard dependency)
|
|
8
|
-
type LitElement = any;
|
|
9
|
-
type TemplateResult = any;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Opciones de registro Lit
|
|
13
|
-
*/
|
|
14
|
-
export interface LitRegisterOptions {
|
|
15
|
-
/** Nombre del custom element (auto-generado si no se provee) */
|
|
16
|
-
tagName?: string;
|
|
17
|
-
/** Propiedades iniciales */
|
|
18
|
-
properties?: Record<string, any>;
|
|
19
|
-
/** Callback después de montar */
|
|
20
|
-
onMount?: (container: HTMLElement, element: HTMLElement) => void;
|
|
21
|
-
/** Callback antes de desmontar */
|
|
22
|
-
onUnmount?: (container: HTMLElement, element: HTMLElement) => void;
|
|
23
|
-
/** Permitir ejecución standalone */
|
|
24
|
-
standalone?: boolean;
|
|
25
|
-
/** Selector para modo standalone */
|
|
26
|
-
standaloneContainer?: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Configuración para crear elemento simple
|
|
31
|
-
*/
|
|
32
|
-
export interface SimpleElementConfig {
|
|
33
|
-
/** Nombre del custom element */
|
|
34
|
-
name: string;
|
|
35
|
-
/** Template HTML */
|
|
36
|
-
template: string | ((element: HTMLElement) => string);
|
|
37
|
-
/** Estilos CSS */
|
|
38
|
-
styles?: string;
|
|
39
|
-
/** Usar Shadow DOM */
|
|
40
|
-
shadow?: boolean;
|
|
41
|
-
/** Atributos observados */
|
|
42
|
-
observedAttributes?: string[];
|
|
43
|
-
/** Callback cuando se conecta */
|
|
44
|
-
connectedCallback?: (this: HTMLElement) => void;
|
|
45
|
-
/** Callback cuando se desconecta */
|
|
46
|
-
disconnectedCallback?: (this: HTMLElement) => void;
|
|
47
|
-
/** Callback cuando cambia un atributo */
|
|
48
|
-
attributeChangedCallback?: (this: HTMLElement, name: string, oldVal: string, newVal: string) => void;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Clase WuSlot Element
|
|
53
|
-
*/
|
|
54
|
-
export interface WuSlotElementClass {
|
|
55
|
-
new(): HTMLElement & {
|
|
56
|
-
name: string;
|
|
57
|
-
url: string;
|
|
58
|
-
appName: string | null;
|
|
59
|
-
fallbackText: string | null;
|
|
60
|
-
loading: boolean;
|
|
61
|
-
error: string | null;
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Tipo para el Mixin de Wu
|
|
67
|
-
*/
|
|
68
|
-
export type WuMixinResult<T extends new (...args: any[]) => any> = T & {
|
|
69
|
-
new (...args: any[]): InstanceType<T> & {
|
|
70
|
-
readonly wu: WuCore | null;
|
|
71
|
-
wuEmit(event: string, data?: any, options?: any): void;
|
|
72
|
-
wuOn(event: string, callback: (data: any) => void): () => void;
|
|
73
|
-
wuOnce(event: string, callback: (data: any) => void): () => void;
|
|
74
|
-
wuGetState(path?: string): any;
|
|
75
|
-
wuSetState(path: string, value: any): void;
|
|
76
|
-
wuOnStateChange(pattern: string, callback: (value: any) => void): () => void;
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export function register(
|
|
81
|
-
appName: string,
|
|
82
|
-
ElementClass: CustomElementConstructor,
|
|
83
|
-
options?: LitRegisterOptions
|
|
84
|
-
): Promise<boolean>;
|
|
85
|
-
|
|
86
|
-
export function registerWebComponent(
|
|
87
|
-
appName: string,
|
|
88
|
-
ElementClass: CustomElementConstructor,
|
|
89
|
-
options?: LitRegisterOptions
|
|
90
|
-
): Promise<boolean>;
|
|
91
|
-
|
|
92
|
-
export function createWuSlotElement(
|
|
93
|
-
LitElement: any,
|
|
94
|
-
html: (strings: TemplateStringsArray, ...values: any[]) => TemplateResult,
|
|
95
|
-
css?: (strings: TemplateStringsArray, ...values: any[]) => any
|
|
96
|
-
): WuSlotElementClass;
|
|
97
|
-
|
|
98
|
-
export function WuMixin<T extends new (...args: any[]) => any>(Base: T): WuMixinResult<T>;
|
|
99
|
-
|
|
100
|
-
export function wuProperty(storePath: string): PropertyDecorator;
|
|
101
|
-
|
|
102
|
-
export function createSimpleElement(config: SimpleElementConfig): CustomElementConstructor;
|
|
103
|
-
|
|
104
|
-
export function getWuInstance(): WuCore | null;
|
|
105
|
-
|
|
106
|
-
export function waitForWu(timeout?: number): Promise<WuCore>;
|
|
107
|
-
|
|
108
|
-
export interface WuLitAdapter {
|
|
109
|
-
register: typeof register;
|
|
110
|
-
registerWebComponent: typeof registerWebComponent;
|
|
111
|
-
createWuSlotElement: typeof createWuSlotElement;
|
|
112
|
-
WuMixin: typeof WuMixin;
|
|
113
|
-
wuProperty: typeof wuProperty;
|
|
114
|
-
createSimpleElement: typeof createSimpleElement;
|
|
115
|
-
getWuInstance: typeof getWuInstance;
|
|
116
|
-
waitForWu: typeof waitForWu;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export const wuLit: WuLitAdapter;
|
|
120
|
-
export default wuLit;
|
|
1
|
+
/**
|
|
2
|
+
* 🚀 WU-FRAMEWORK LIT ADAPTER - TypeScript Declarations
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type { WuCore } from '../core/wu-core';
|
|
6
|
+
|
|
7
|
+
// Lit types (generics to avoid hard dependency)
|
|
8
|
+
type LitElement = any;
|
|
9
|
+
type TemplateResult = any;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Opciones de registro Lit
|
|
13
|
+
*/
|
|
14
|
+
export interface LitRegisterOptions {
|
|
15
|
+
/** Nombre del custom element (auto-generado si no se provee) */
|
|
16
|
+
tagName?: string;
|
|
17
|
+
/** Propiedades iniciales */
|
|
18
|
+
properties?: Record<string, any>;
|
|
19
|
+
/** Callback después de montar */
|
|
20
|
+
onMount?: (container: HTMLElement, element: HTMLElement) => void;
|
|
21
|
+
/** Callback antes de desmontar */
|
|
22
|
+
onUnmount?: (container: HTMLElement, element: HTMLElement) => void;
|
|
23
|
+
/** Permitir ejecución standalone */
|
|
24
|
+
standalone?: boolean;
|
|
25
|
+
/** Selector para modo standalone */
|
|
26
|
+
standaloneContainer?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Configuración para crear elemento simple
|
|
31
|
+
*/
|
|
32
|
+
export interface SimpleElementConfig {
|
|
33
|
+
/** Nombre del custom element */
|
|
34
|
+
name: string;
|
|
35
|
+
/** Template HTML */
|
|
36
|
+
template: string | ((element: HTMLElement) => string);
|
|
37
|
+
/** Estilos CSS */
|
|
38
|
+
styles?: string;
|
|
39
|
+
/** Usar Shadow DOM */
|
|
40
|
+
shadow?: boolean;
|
|
41
|
+
/** Atributos observados */
|
|
42
|
+
observedAttributes?: string[];
|
|
43
|
+
/** Callback cuando se conecta */
|
|
44
|
+
connectedCallback?: (this: HTMLElement) => void;
|
|
45
|
+
/** Callback cuando se desconecta */
|
|
46
|
+
disconnectedCallback?: (this: HTMLElement) => void;
|
|
47
|
+
/** Callback cuando cambia un atributo */
|
|
48
|
+
attributeChangedCallback?: (this: HTMLElement, name: string, oldVal: string, newVal: string) => void;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Clase WuSlot Element
|
|
53
|
+
*/
|
|
54
|
+
export interface WuSlotElementClass {
|
|
55
|
+
new(): HTMLElement & {
|
|
56
|
+
name: string;
|
|
57
|
+
url: string;
|
|
58
|
+
appName: string | null;
|
|
59
|
+
fallbackText: string | null;
|
|
60
|
+
loading: boolean;
|
|
61
|
+
error: string | null;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Tipo para el Mixin de Wu
|
|
67
|
+
*/
|
|
68
|
+
export type WuMixinResult<T extends new (...args: any[]) => any> = T & {
|
|
69
|
+
new (...args: any[]): InstanceType<T> & {
|
|
70
|
+
readonly wu: WuCore | null;
|
|
71
|
+
wuEmit(event: string, data?: any, options?: any): void;
|
|
72
|
+
wuOn(event: string, callback: (data: any) => void): () => void;
|
|
73
|
+
wuOnce(event: string, callback: (data: any) => void): () => void;
|
|
74
|
+
wuGetState(path?: string): any;
|
|
75
|
+
wuSetState(path: string, value: any): void;
|
|
76
|
+
wuOnStateChange(pattern: string, callback: (value: any) => void): () => void;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export function register(
|
|
81
|
+
appName: string,
|
|
82
|
+
ElementClass: CustomElementConstructor,
|
|
83
|
+
options?: LitRegisterOptions
|
|
84
|
+
): Promise<boolean>;
|
|
85
|
+
|
|
86
|
+
export function registerWebComponent(
|
|
87
|
+
appName: string,
|
|
88
|
+
ElementClass: CustomElementConstructor,
|
|
89
|
+
options?: LitRegisterOptions
|
|
90
|
+
): Promise<boolean>;
|
|
91
|
+
|
|
92
|
+
export function createWuSlotElement(
|
|
93
|
+
LitElement: any,
|
|
94
|
+
html: (strings: TemplateStringsArray, ...values: any[]) => TemplateResult,
|
|
95
|
+
css?: (strings: TemplateStringsArray, ...values: any[]) => any
|
|
96
|
+
): WuSlotElementClass;
|
|
97
|
+
|
|
98
|
+
export function WuMixin<T extends new (...args: any[]) => any>(Base: T): WuMixinResult<T>;
|
|
99
|
+
|
|
100
|
+
export function wuProperty(storePath: string): PropertyDecorator;
|
|
101
|
+
|
|
102
|
+
export function createSimpleElement(config: SimpleElementConfig): CustomElementConstructor;
|
|
103
|
+
|
|
104
|
+
export function getWuInstance(): WuCore | null;
|
|
105
|
+
|
|
106
|
+
export function waitForWu(timeout?: number): Promise<WuCore>;
|
|
107
|
+
|
|
108
|
+
export interface WuLitAdapter {
|
|
109
|
+
register: typeof register;
|
|
110
|
+
registerWebComponent: typeof registerWebComponent;
|
|
111
|
+
createWuSlotElement: typeof createWuSlotElement;
|
|
112
|
+
WuMixin: typeof WuMixin;
|
|
113
|
+
wuProperty: typeof wuProperty;
|
|
114
|
+
createSimpleElement: typeof createSimpleElement;
|
|
115
|
+
getWuInstance: typeof getWuInstance;
|
|
116
|
+
waitForWu: typeof waitForWu;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export const wuLit: WuLitAdapter;
|
|
120
|
+
export default wuLit;
|