wu-framework 1.1.6 → 1.1.8
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 +511 -977
- package/dist/wu-framework.cjs.js +3 -1
- package/dist/wu-framework.cjs.js.map +1 -0
- package/dist/wu-framework.dev.js +7533 -2761
- 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 +94 -74
- 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 +689 -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-browser.js +663 -0
- package/src/ai/wu-ai-context.js +332 -0
- package/src/ai/wu-ai-conversation.js +554 -0
- package/src/ai/wu-ai-permissions.js +381 -0
- package/src/ai/wu-ai-provider.js +605 -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 +474 -0
- package/src/core/wu-app.js +50 -8
- package/src/core/wu-cache.js +1 -1
- package/src/core/wu-core.js +645 -677
- 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 +647 -0
- package/src/core/wu-overrides.js +510 -0
- 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 +0 -2
- package/src/index.js +139 -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/preact.d.ts
CHANGED
|
@@ -1,108 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import type { WuCore } from '../core/wu-core';
|
|
6
|
-
|
|
7
|
-
// Preact types (generics to avoid hard dependency)
|
|
8
|
-
type ComponentType<P = {}> = (props: P) => any;
|
|
9
|
-
type VNode = any;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Opciones de registro Preact
|
|
13
|
-
*/
|
|
14
|
-
export interface PreactRegisterOptions {
|
|
15
|
-
/** Props iniciales */
|
|
16
|
-
props?: Record<string, any>;
|
|
17
|
-
/** Callback después de montar */
|
|
18
|
-
onMount?: (container: HTMLElement) => void;
|
|
19
|
-
/** Callback antes de desmontar */
|
|
20
|
-
onUnmount?: (container: HTMLElement) => void;
|
|
21
|
-
/** Permitir ejecución standalone */
|
|
22
|
-
standalone?: boolean;
|
|
23
|
-
/** Selector para modo standalone */
|
|
24
|
-
standaloneContainer?: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Props del componente WuSlot
|
|
29
|
-
*/
|
|
30
|
-
export interface WuSlotProps {
|
|
31
|
-
name: string;
|
|
32
|
-
url: string;
|
|
33
|
-
appName?: string;
|
|
34
|
-
fallback?: VNode;
|
|
35
|
-
onLoad?: (data: { name: string; url: string }) => void;
|
|
36
|
-
onError?: (error: Error) => void;
|
|
37
|
-
className?: string;
|
|
38
|
-
style?: Record<string, string | number>;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Hooks de Preact necesarios para createUseWuEvents
|
|
43
|
-
*/
|
|
44
|
-
export interface PreactHooks {
|
|
45
|
-
useCallback: <T extends (...args: any[]) => any>(callback: T, deps: any[]) => T;
|
|
46
|
-
useEffect: (effect: () => void | (() => void), deps?: any[]) => void;
|
|
47
|
-
useRef: <T>(initialValue: T) => { current: T };
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Hooks para createUseWuStore
|
|
52
|
-
*/
|
|
53
|
-
export interface PreactStoreHooks extends PreactHooks {
|
|
54
|
-
useState: <T>(initialValue: T | (() => T)) => [T, (value: T) => void];
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Helper de eventos Wu para Preact
|
|
59
|
-
*/
|
|
60
|
-
export interface UseWuEventsResult {
|
|
61
|
-
emit: (event: string, data?: any, options?: any) => void;
|
|
62
|
-
on: (event: string, callback: (data: any) => void) => () => void;
|
|
63
|
-
once: (event: string, callback: (data: any) => void) => () => void;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Helper de store Wu para Preact
|
|
68
|
-
*/
|
|
69
|
-
export interface UseWuStoreResult {
|
|
70
|
-
state: any;
|
|
71
|
-
setState: (path: string, value: any) => void;
|
|
72
|
-
getState: (path?: string) => any;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export function register(
|
|
76
|
-
appName: string,
|
|
77
|
-
Component: ComponentType,
|
|
78
|
-
options?: PreactRegisterOptions
|
|
79
|
-
): Promise<boolean>;
|
|
80
|
-
|
|
81
|
-
export function registerCompat(
|
|
82
|
-
appName: string,
|
|
83
|
-
Component: ComponentType,
|
|
84
|
-
options?: PreactRegisterOptions
|
|
85
|
-
): Promise<boolean>;
|
|
86
|
-
|
|
87
|
-
export function createWuSlot(h: (type: any, props: any, ...children: any[]) => VNode): ComponentType<WuSlotProps>;
|
|
88
|
-
|
|
89
|
-
export function createUseWuEvents(hooks: PreactHooks): () => UseWuEventsResult;
|
|
90
|
-
|
|
91
|
-
export function createUseWuStore(hooks: PreactStoreHooks): (namespace?: string) => UseWuStoreResult;
|
|
92
|
-
|
|
93
|
-
export function getWuInstance(): WuCore | null;
|
|
94
|
-
|
|
95
|
-
export function waitForWu(timeout?: number): Promise<WuCore>;
|
|
96
|
-
|
|
97
|
-
export interface WuPreactAdapter {
|
|
98
|
-
register: typeof register;
|
|
99
|
-
registerCompat: typeof registerCompat;
|
|
100
|
-
createWuSlot: typeof createWuSlot;
|
|
101
|
-
createUseWuEvents: typeof createUseWuEvents;
|
|
102
|
-
createUseWuStore: typeof createUseWuStore;
|
|
103
|
-
getWuInstance: typeof getWuInstance;
|
|
104
|
-
waitForWu: typeof waitForWu;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export const wuPreact: WuPreactAdapter;
|
|
108
|
-
export default wuPreact;
|
|
1
|
+
// Re-export from folder structure — backward compatibility
|
|
2
|
+
export * from './preact/index';
|
|
3
|
+
export { default } from './preact/index';
|