wu-framework 1.1.7 → 1.1.9
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/LICENSE +19 -1
- package/README.md +257 -1122
- package/dist/wu-framework.cjs.js +3 -1
- package/dist/wu-framework.cjs.js.map +1 -0
- package/dist/wu-framework.dev.js +9867 -3183
- package/dist/wu-framework.dev.js.map +1 -1
- package/dist/wu-framework.esm.js +3 -0
- package/dist/wu-framework.esm.js.map +1 -0
- package/dist/wu-framework.umd.js +3 -1
- package/dist/wu-framework.umd.js.map +1 -0
- package/integrations/astro/README.md +127 -0
- package/integrations/astro/WuApp.astro +63 -0
- package/integrations/astro/WuShell.astro +39 -0
- package/integrations/astro/index.js +68 -0
- package/integrations/astro/package.json +38 -0
- package/integrations/astro/types.d.ts +53 -0
- package/package.json +96 -72
- package/src/adapters/angular/ai.js +30 -0
- package/src/adapters/angular/index.d.ts +154 -0
- package/src/adapters/angular/index.js +932 -0
- package/src/adapters/angular.d.ts +3 -154
- package/src/adapters/angular.js +3 -813
- package/src/adapters/index.js +35 -24
- package/src/adapters/lit/ai.js +20 -0
- package/src/adapters/lit/index.d.ts +120 -0
- package/src/adapters/lit/index.js +721 -0
- package/src/adapters/lit.d.ts +3 -120
- package/src/adapters/lit.js +3 -726
- package/src/adapters/preact/ai.js +33 -0
- package/src/adapters/preact/index.d.ts +108 -0
- package/src/adapters/preact/index.js +661 -0
- package/src/adapters/preact.d.ts +3 -108
- package/src/adapters/preact.js +3 -665
- package/src/adapters/react/ai.js +135 -0
- package/src/adapters/react/index.d.ts +246 -0
- package/src/adapters/react/index.js +694 -0
- package/src/adapters/react.d.ts +3 -212
- package/src/adapters/react.js +3 -513
- package/src/adapters/shared.js +64 -0
- package/src/adapters/solid/ai.js +32 -0
- package/src/adapters/solid/index.d.ts +101 -0
- package/src/adapters/solid/index.js +586 -0
- package/src/adapters/solid.d.ts +3 -101
- package/src/adapters/solid.js +3 -591
- package/src/adapters/svelte/ai.js +31 -0
- package/src/adapters/svelte/index.d.ts +166 -0
- package/src/adapters/svelte/index.js +798 -0
- package/src/adapters/svelte.d.ts +3 -166
- package/src/adapters/svelte.js +3 -803
- package/src/adapters/vanilla/ai.js +30 -0
- package/src/adapters/vanilla/index.d.ts +179 -0
- package/src/adapters/vanilla/index.js +785 -0
- package/src/adapters/vanilla.d.ts +3 -179
- package/src/adapters/vanilla.js +3 -791
- package/src/adapters/vue/ai.js +52 -0
- package/src/adapters/vue/index.d.ts +299 -0
- package/src/adapters/vue/index.js +608 -0
- package/src/adapters/vue.d.ts +3 -299
- package/src/adapters/vue.js +3 -611
- package/src/ai/wu-ai-actions.js +261 -0
- package/src/ai/wu-ai-agent.js +546 -0
- package/src/ai/wu-ai-browser-primitives.js +354 -0
- package/src/ai/wu-ai-browser.js +380 -0
- package/src/ai/wu-ai-context.js +332 -0
- package/src/ai/wu-ai-conversation.js +613 -0
- package/src/ai/wu-ai-orchestrate.js +1021 -0
- package/src/ai/wu-ai-permissions.js +381 -0
- package/src/ai/wu-ai-provider.js +700 -0
- package/src/ai/wu-ai-schema.js +225 -0
- package/src/ai/wu-ai-triggers.js +396 -0
- package/src/ai/wu-ai.js +804 -0
- package/src/core/wu-app.js +50 -8
- package/src/core/wu-cache.js +2 -3
- package/src/core/wu-core.js +648 -681
- package/src/core/wu-html-parser.js +121 -211
- package/src/core/wu-iframe-sandbox.js +328 -0
- package/src/core/wu-mcp-bridge.js +431 -0
- package/src/core/wu-overrides.js +510 -0
- package/src/core/wu-plugin.js +4 -1
- package/src/core/wu-prefetch.js +414 -0
- package/src/core/wu-proxy-sandbox.js +398 -75
- package/src/core/wu-sandbox.js +86 -268
- package/src/core/wu-script-executor.js +79 -182
- package/src/core/wu-snapshot-sandbox.js +149 -106
- package/src/core/wu-strategies.js +13 -0
- package/src/core/wu-style-bridge.js +23 -23
- package/src/index.js +162 -665
- package/dist/wu-framework.hex.js +0 -23
- package/dist/wu-framework.min.js +0 -1
- package/dist/wu-framework.obf.js +0 -1
- package/scripts/build-protected.js +0 -366
- package/scripts/build.js +0 -212
- package/scripts/rollup-plugin-hex.js +0 -143
- package/src/core/wu-registry.js +0 -60
- package/src/core/wu-sandbox-pool.js +0 -390
package/src/adapters/svelte.d.ts
CHANGED
|
@@ -1,166 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import type { WuCore } from '../core/wu-core';
|
|
6
|
-
|
|
7
|
-
// Svelte types (generics to avoid hard dependency)
|
|
8
|
-
type SvelteComponent = any;
|
|
9
|
-
type ComponentConstructor<T = any> = new (options: any) => T;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Opciones para registrar un componente Svelte
|
|
13
|
-
*/
|
|
14
|
-
export interface SvelteRegisterOptions {
|
|
15
|
-
/** Props iniciales para el componente */
|
|
16
|
-
props?: Record<string, any>;
|
|
17
|
-
/** Contexto a pasar al componente */
|
|
18
|
-
context?: Map<any, any>;
|
|
19
|
-
/** Ejecutar transiciones de intro (default: false) */
|
|
20
|
-
intro?: boolean;
|
|
21
|
-
/** Callback después de montar */
|
|
22
|
-
onMount?: (container: HTMLElement, instance: SvelteComponent) => void;
|
|
23
|
-
/** Callback antes de desmontar */
|
|
24
|
-
onUnmount?: (container: HTMLElement, instance: SvelteComponent) => void;
|
|
25
|
-
/** Permitir ejecución standalone (default: true) */
|
|
26
|
-
standalone?: boolean;
|
|
27
|
-
/** Selector para modo standalone (default: '#app') */
|
|
28
|
-
standaloneContainer?: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Opciones para registrar un componente Svelte 5
|
|
33
|
-
*/
|
|
34
|
-
export interface Svelte5RegisterOptions {
|
|
35
|
-
/** Props iniciales para el componente */
|
|
36
|
-
props?: Record<string, any>;
|
|
37
|
-
/** Callback después de montar */
|
|
38
|
-
onMount?: (container: HTMLElement, instance: any) => void;
|
|
39
|
-
/** Callback antes de desmontar */
|
|
40
|
-
onUnmount?: (container: HTMLElement, instance: any) => void;
|
|
41
|
-
/** Permitir ejecución standalone (default: true) */
|
|
42
|
-
standalone?: boolean;
|
|
43
|
-
/** Selector para modo standalone (default: '#app') */
|
|
44
|
-
standaloneContainer?: string;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Store de Wu compatible con Svelte
|
|
49
|
-
*/
|
|
50
|
-
export interface WuSvelteStore<T = any> {
|
|
51
|
-
/** Suscribirse al store (Svelte store contract) */
|
|
52
|
-
subscribe: (fn: (value: T) => void) => () => void;
|
|
53
|
-
/** Establecer valor en path específico */
|
|
54
|
-
set: (path: string, value: any) => void;
|
|
55
|
-
/** Obtener valor de path específico */
|
|
56
|
-
get: (path?: string) => any;
|
|
57
|
-
/** Actualizar valor con función */
|
|
58
|
-
update: (fn: (value: T) => T) => void;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Store de eventos de Wu para Svelte
|
|
63
|
-
*/
|
|
64
|
-
export interface WuEventStore<T = any> {
|
|
65
|
-
/** Suscribirse al store (Svelte store contract) */
|
|
66
|
-
subscribe: (fn: (value: T | null) => void) => () => void;
|
|
67
|
-
/** Emitir evento */
|
|
68
|
-
emit: (data: any, options?: any) => void;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Helper de eventos para Svelte
|
|
73
|
-
*/
|
|
74
|
-
export interface WuEventsHelper {
|
|
75
|
-
/** Emitir evento */
|
|
76
|
-
emit: (event: string, data?: any, options?: any) => void;
|
|
77
|
-
/** Suscribirse a evento */
|
|
78
|
-
on: (event: string, callback: (data: any) => void) => () => void;
|
|
79
|
-
/** Suscribirse a evento una vez */
|
|
80
|
-
once: (event: string, callback: (data: any) => void) => () => void;
|
|
81
|
-
/** Desuscribirse de evento */
|
|
82
|
-
off: (event: string, callback: (data: any) => void) => void;
|
|
83
|
-
/** Limpiar todas las suscripciones */
|
|
84
|
-
cleanup: () => void;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Configuración del componente WuSlot para Svelte
|
|
89
|
-
*/
|
|
90
|
-
export interface WuSlotConfig {
|
|
91
|
-
props: string[];
|
|
92
|
-
template: string;
|
|
93
|
-
createInstance: (target: HTMLElement, props: {
|
|
94
|
-
name: string;
|
|
95
|
-
url: string;
|
|
96
|
-
appName?: string;
|
|
97
|
-
fallbackText?: string;
|
|
98
|
-
onLoad?: (data: { name: string; url: string }) => void;
|
|
99
|
-
onError?: (error: Error) => void;
|
|
100
|
-
}) => { destroy: () => Promise<void> };
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Registra un componente Svelte como microfrontend
|
|
105
|
-
*/
|
|
106
|
-
export function register(
|
|
107
|
-
appName: string,
|
|
108
|
-
Component: ComponentConstructor,
|
|
109
|
-
options?: SvelteRegisterOptions
|
|
110
|
-
): Promise<boolean>;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Registra un componente Svelte 5 como microfrontend
|
|
114
|
-
*/
|
|
115
|
-
export function registerSvelte5(
|
|
116
|
-
appName: string,
|
|
117
|
-
Component: ComponentConstructor,
|
|
118
|
-
options?: Svelte5RegisterOptions
|
|
119
|
-
): Promise<boolean>;
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Crea un store de Wu compatible con Svelte
|
|
123
|
-
*/
|
|
124
|
-
export function createWuStore<T = any>(namespace?: string): WuSvelteStore<T>;
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Crea un store de eventos de Wu para Svelte
|
|
128
|
-
*/
|
|
129
|
-
export function createWuEventStore<T = any>(eventPattern: string): WuEventStore<T>;
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Helper para usar eventos de Wu en Svelte
|
|
133
|
-
*/
|
|
134
|
-
export function useWuEvents(): WuEventsHelper;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Crea la configuración para un componente WuSlot
|
|
138
|
-
*/
|
|
139
|
-
export function createWuSlotConfig(): WuSlotConfig;
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Obtiene la instancia de Wu Framework
|
|
143
|
-
*/
|
|
144
|
-
export function getWuInstance(): WuCore | null;
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Espera a que Wu Framework esté disponible
|
|
148
|
-
*/
|
|
149
|
-
export function waitForWu(timeout?: number): Promise<WuCore>;
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* API del adapter Svelte
|
|
153
|
-
*/
|
|
154
|
-
export interface WuSvelteAdapter {
|
|
155
|
-
register: typeof register;
|
|
156
|
-
registerSvelte5: typeof registerSvelte5;
|
|
157
|
-
createWuStore: typeof createWuStore;
|
|
158
|
-
createWuEventStore: typeof createWuEventStore;
|
|
159
|
-
useWuEvents: typeof useWuEvents;
|
|
160
|
-
createWuSlotConfig: typeof createWuSlotConfig;
|
|
161
|
-
getWuInstance: typeof getWuInstance;
|
|
162
|
-
waitForWu: typeof waitForWu;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export const wuSvelte: WuSvelteAdapter;
|
|
166
|
-
export default wuSvelte;
|
|
1
|
+
// Re-export from folder structure — backward compatibility
|
|
2
|
+
export * from './svelte/index';
|
|
3
|
+
export { default } from './svelte/index';
|