@clusterenvision/ui-framework 1.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/LICENSE +21 -0
- package/README.md +295 -0
- package/dist/ai-assistant-Db002XYC.d.ts +92 -0
- package/dist/ai-assistant-EobSUV70.d.cts +92 -0
- package/dist/browser-DnHpnWwE.d.cts +354 -0
- package/dist/browser-Dx4oKf5e.d.ts +354 -0
- package/dist/browser-signals-07qodpYT.d.cts +66 -0
- package/dist/browser-signals-07qodpYT.d.ts +66 -0
- package/dist/browser-signals.cjs +32 -0
- package/dist/browser-signals.cjs.map +1 -0
- package/dist/browser-signals.d.cts +1 -0
- package/dist/browser-signals.d.ts +1 -0
- package/dist/browser-signals.js +3 -0
- package/dist/browser-signals.js.map +1 -0
- package/dist/browser.cjs +197 -0
- package/dist/browser.cjs.map +1 -0
- package/dist/browser.d.cts +13 -0
- package/dist/browser.d.ts +13 -0
- package/dist/browser.js +12 -0
- package/dist/browser.js.map +1 -0
- package/dist/chunk-22HQL2Y4.js +568 -0
- package/dist/chunk-22HQL2Y4.js.map +1 -0
- package/dist/chunk-3ZBRNFEE.js +1525 -0
- package/dist/chunk-3ZBRNFEE.js.map +1 -0
- package/dist/chunk-4HRORR2Q.js +1953 -0
- package/dist/chunk-4HRORR2Q.js.map +1 -0
- package/dist/chunk-4L3UXVL5.cjs +68 -0
- package/dist/chunk-4L3UXVL5.cjs.map +1 -0
- package/dist/chunk-6BYWFGQY.cjs +226 -0
- package/dist/chunk-6BYWFGQY.cjs.map +1 -0
- package/dist/chunk-7SCIB5HP.js +57 -0
- package/dist/chunk-7SCIB5HP.js.map +1 -0
- package/dist/chunk-BBAUALNU.js +888 -0
- package/dist/chunk-BBAUALNU.js.map +1 -0
- package/dist/chunk-CHLDE4JQ.js +715 -0
- package/dist/chunk-CHLDE4JQ.js.map +1 -0
- package/dist/chunk-CXTAUXLG.cjs +71 -0
- package/dist/chunk-CXTAUXLG.cjs.map +1 -0
- package/dist/chunk-D2USIT6V.js +121 -0
- package/dist/chunk-D2USIT6V.js.map +1 -0
- package/dist/chunk-D3H5CGVD.js +36 -0
- package/dist/chunk-D3H5CGVD.js.map +1 -0
- package/dist/chunk-DQBX75NJ.js +92 -0
- package/dist/chunk-DQBX75NJ.js.map +1 -0
- package/dist/chunk-DRPG2DFX.js +208 -0
- package/dist/chunk-DRPG2DFX.js.map +1 -0
- package/dist/chunk-EFOOXCY7.cjs +41 -0
- package/dist/chunk-EFOOXCY7.cjs.map +1 -0
- package/dist/chunk-FFCZSYC7.cjs +906 -0
- package/dist/chunk-FFCZSYC7.cjs.map +1 -0
- package/dist/chunk-FNXIYAET.cjs +1593 -0
- package/dist/chunk-FNXIYAET.cjs.map +1 -0
- package/dist/chunk-I6GNUM3P.cjs +63 -0
- package/dist/chunk-I6GNUM3P.cjs.map +1 -0
- package/dist/chunk-IHAMVLRY.js +129 -0
- package/dist/chunk-IHAMVLRY.js.map +1 -0
- package/dist/chunk-IRBUKIRF.cjs +133 -0
- package/dist/chunk-IRBUKIRF.cjs.map +1 -0
- package/dist/chunk-KPG5HAHK.cjs +97 -0
- package/dist/chunk-KPG5HAHK.cjs.map +1 -0
- package/dist/chunk-N7Q2ESLG.cjs +130 -0
- package/dist/chunk-N7Q2ESLG.cjs.map +1 -0
- package/dist/chunk-PFBEIFVS.js +180 -0
- package/dist/chunk-PFBEIFVS.js.map +1 -0
- package/dist/chunk-PVZVFICK.cjs +318 -0
- package/dist/chunk-PVZVFICK.cjs.map +1 -0
- package/dist/chunk-Q3KH6HMU.js +305 -0
- package/dist/chunk-Q3KH6HMU.js.map +1 -0
- package/dist/chunk-QPAAV32J.cjs +1985 -0
- package/dist/chunk-QPAAV32J.cjs.map +1 -0
- package/dist/chunk-R6XQUMWT.cjs +61 -0
- package/dist/chunk-R6XQUMWT.cjs.map +1 -0
- package/dist/chunk-SA5UD5B6.js +92 -0
- package/dist/chunk-SA5UD5B6.js.map +1 -0
- package/dist/chunk-SM35JOYD.cjs +211 -0
- package/dist/chunk-SM35JOYD.cjs.map +1 -0
- package/dist/chunk-SZQNIMYI.cjs +592 -0
- package/dist/chunk-SZQNIMYI.cjs.map +1 -0
- package/dist/chunk-T6T7QE4J.js +224 -0
- package/dist/chunk-T6T7QE4J.js.map +1 -0
- package/dist/chunk-TIF372DZ.js +65 -0
- package/dist/chunk-TIF372DZ.js.map +1 -0
- package/dist/chunk-V6JCOBGY.js +69 -0
- package/dist/chunk-V6JCOBGY.js.map +1 -0
- package/dist/chunk-VHUXNDW2.cjs +189 -0
- package/dist/chunk-VHUXNDW2.cjs.map +1 -0
- package/dist/chunk-W3LNNY3U.cjs +729 -0
- package/dist/chunk-W3LNNY3U.cjs.map +1 -0
- package/dist/chunk-ZUWSU4OA.js +61 -0
- package/dist/chunk-ZUWSU4OA.js.map +1 -0
- package/dist/chunk-ZWUA2LPB.cjs +103 -0
- package/dist/chunk-ZWUA2LPB.cjs.map +1 -0
- package/dist/cli/index.cjs +566 -0
- package/dist/cli/index.cjs.map +1 -0
- package/dist/cli/index.d.cts +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +558 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/compiler/index.cjs +80 -0
- package/dist/compiler/index.cjs.map +1 -0
- package/dist/compiler/index.d.cts +130 -0
- package/dist/compiler/index.d.ts +130 -0
- package/dist/compiler/index.js +3 -0
- package/dist/compiler/index.js.map +1 -0
- package/dist/component-BVzvepw9.d.cts +90 -0
- package/dist/component-wTxZ2BPD.d.ts +90 -0
- package/dist/index-CpxDa60m.d.cts +644 -0
- package/dist/index-CpxDa60m.d.ts +644 -0
- package/dist/index.cjs +1356 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +165 -0
- package/dist/index.d.ts +165 -0
- package/dist/index.js +772 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/dom.cjs +102 -0
- package/dist/lib/dom.cjs.map +1 -0
- package/dist/lib/dom.d.cts +373 -0
- package/dist/lib/dom.d.ts +373 -0
- package/dist/lib/dom.js +3 -0
- package/dist/lib/dom.js.map +1 -0
- package/dist/lib/icons.cjs +20 -0
- package/dist/lib/icons.cjs.map +1 -0
- package/dist/lib/icons.d.cts +64 -0
- package/dist/lib/icons.d.ts +64 -0
- package/dist/lib/icons.js +3 -0
- package/dist/lib/icons.js.map +1 -0
- package/dist/lib/index.cjs +247 -0
- package/dist/lib/index.cjs.map +1 -0
- package/dist/lib/index.d.cts +30 -0
- package/dist/lib/index.d.ts +30 -0
- package/dist/lib/index.js +92 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/theme.cjs +56 -0
- package/dist/lib/theme.cjs.map +1 -0
- package/dist/lib/theme.d.cts +27 -0
- package/dist/lib/theme.d.ts +27 -0
- package/dist/lib/theme.js +3 -0
- package/dist/lib/theme.js.map +1 -0
- package/dist/router-B9kms5XQ.d.ts +124 -0
- package/dist/router-YnpW_sIK.d.cts +124 -0
- package/dist/runtime/adapters/angular.cjs +48 -0
- package/dist/runtime/adapters/angular.cjs.map +1 -0
- package/dist/runtime/adapters/angular.d.cts +38 -0
- package/dist/runtime/adapters/angular.d.ts +38 -0
- package/dist/runtime/adapters/angular.js +46 -0
- package/dist/runtime/adapters/angular.js.map +1 -0
- package/dist/runtime/adapters/react.cjs +41 -0
- package/dist/runtime/adapters/react.cjs.map +1 -0
- package/dist/runtime/adapters/react.d.cts +26 -0
- package/dist/runtime/adapters/react.d.ts +26 -0
- package/dist/runtime/adapters/react.js +39 -0
- package/dist/runtime/adapters/react.js.map +1 -0
- package/dist/runtime/adapters/vue.cjs +44 -0
- package/dist/runtime/adapters/vue.cjs.map +1 -0
- package/dist/runtime/adapters/vue.d.cts +37 -0
- package/dist/runtime/adapters/vue.d.ts +37 -0
- package/dist/runtime/adapters/vue.js +42 -0
- package/dist/runtime/adapters/vue.js.map +1 -0
- package/dist/runtime/components/ai-assistant.cjs +18 -0
- package/dist/runtime/components/ai-assistant.cjs.map +1 -0
- package/dist/runtime/components/ai-assistant.d.cts +8 -0
- package/dist/runtime/components/ai-assistant.d.ts +8 -0
- package/dist/runtime/components/ai-assistant.js +9 -0
- package/dist/runtime/components/ai-assistant.js.map +1 -0
- package/dist/runtime/components/ai-summary-card.cjs +18 -0
- package/dist/runtime/components/ai-summary-card.cjs.map +1 -0
- package/dist/runtime/components/ai-summary-card.d.cts +19 -0
- package/dist/runtime/components/ai-summary-card.d.ts +19 -0
- package/dist/runtime/components/ai-summary-card.js +9 -0
- package/dist/runtime/components/ai-summary-card.js.map +1 -0
- package/dist/runtime/router.cjs +429 -0
- package/dist/runtime/router.cjs.map +1 -0
- package/dist/runtime/router.d.cts +2 -0
- package/dist/runtime/router.d.ts +2 -0
- package/dist/runtime/router.js +421 -0
- package/dist/runtime/router.js.map +1 -0
- package/dist/runtime/server.cjs +125 -0
- package/dist/runtime/server.cjs.map +1 -0
- package/dist/runtime/server.d.cts +27 -0
- package/dist/runtime/server.d.ts +27 -0
- package/dist/runtime/server.js +117 -0
- package/dist/runtime/server.js.map +1 -0
- package/dist/runtime/workflow/index.cjs +282 -0
- package/dist/runtime/workflow/index.cjs.map +1 -0
- package/dist/runtime/workflow/index.d.cts +1 -0
- package/dist/runtime/workflow/index.d.ts +1 -0
- package/dist/runtime/workflow/index.js +5 -0
- package/dist/runtime/workflow/index.js.map +1 -0
- package/dist/tracing-DGdvMCEl.d.cts +109 -0
- package/dist/tracing-DGdvMCEl.d.ts +109 -0
- package/dist/types-C4RXXKfk.d.cts +76 -0
- package/dist/types-C4RXXKfk.d.ts +76 -0
- package/package.json +166 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { S as SignalAccessor } from './browser-signals-07qodpYT.js';
|
|
2
|
+
|
|
3
|
+
type RuntimeErrorPhase = 'render' | 'effect' | 'loader' | 'action' | 'hydration' | 'navigation';
|
|
4
|
+
interface RuntimeErrorInfo {
|
|
5
|
+
phase: RuntimeErrorPhase;
|
|
6
|
+
componentName?: string;
|
|
7
|
+
componentInstanceId?: string;
|
|
8
|
+
templateId?: string;
|
|
9
|
+
effectName?: string;
|
|
10
|
+
attributes?: Record<string, unknown>;
|
|
11
|
+
}
|
|
12
|
+
interface RuntimeErrorBoundary {
|
|
13
|
+
id: string;
|
|
14
|
+
handle(error: Error, info: RuntimeErrorInfo): boolean | undefined;
|
|
15
|
+
}
|
|
16
|
+
interface RuntimeErrorContext {
|
|
17
|
+
componentName?: string;
|
|
18
|
+
componentInstanceId?: string;
|
|
19
|
+
templateId?: string;
|
|
20
|
+
attributes?: Record<string, unknown>;
|
|
21
|
+
}
|
|
22
|
+
declare function withRuntimeErrorBoundary<T>(boundary: RuntimeErrorBoundary, run: () => T): T;
|
|
23
|
+
declare function pushRuntimeErrorBoundary(boundary: RuntimeErrorBoundary): void;
|
|
24
|
+
declare function popRuntimeErrorBoundary(boundary: RuntimeErrorBoundary): void;
|
|
25
|
+
declare function captureRuntimeError(error: unknown, info: RuntimeErrorInfo): boolean;
|
|
26
|
+
|
|
27
|
+
type RouteComponentFactory = () => Promise<Record<string, unknown>> | Record<string, unknown>;
|
|
28
|
+
interface RouteBoundaryConfig {
|
|
29
|
+
id?: string;
|
|
30
|
+
name?: string;
|
|
31
|
+
componentName?: string;
|
|
32
|
+
templateId?: string;
|
|
33
|
+
attributes?: Record<string, unknown>;
|
|
34
|
+
onError?: (error: Error, info: RuntimeErrorInfo) => boolean | void;
|
|
35
|
+
}
|
|
36
|
+
type RouteLayoutDefinition = RouteBoundaryConfig;
|
|
37
|
+
interface RouteDefinition {
|
|
38
|
+
id?: string;
|
|
39
|
+
path: string;
|
|
40
|
+
component: RouteComponentFactory;
|
|
41
|
+
boundary?: RouteBoundaryConfig;
|
|
42
|
+
layouts?: RouteLayoutDefinition[];
|
|
43
|
+
loader?: RouteDataHandler;
|
|
44
|
+
action?: RouteDataHandler;
|
|
45
|
+
guards?: RouteGuard[];
|
|
46
|
+
children?: RouteDefinition[];
|
|
47
|
+
}
|
|
48
|
+
interface RouteHandlerArgs {
|
|
49
|
+
params: Record<string, string>;
|
|
50
|
+
request?: Request;
|
|
51
|
+
signal?: AbortSignal;
|
|
52
|
+
context?: Record<string, unknown>;
|
|
53
|
+
}
|
|
54
|
+
type RouteDataHandler<T = unknown> = (args: RouteHandlerArgs) => T | Promise<T>;
|
|
55
|
+
interface RouteHandlerResult<T = unknown> {
|
|
56
|
+
data?: T;
|
|
57
|
+
error?: Error;
|
|
58
|
+
info?: RuntimeErrorInfo | null;
|
|
59
|
+
handled: boolean;
|
|
60
|
+
startedAt?: number;
|
|
61
|
+
endedAt?: number;
|
|
62
|
+
durationMs?: number;
|
|
63
|
+
}
|
|
64
|
+
interface RouteGuardContext {
|
|
65
|
+
match: RouteMatch;
|
|
66
|
+
params: Record<string, string>;
|
|
67
|
+
}
|
|
68
|
+
type RouteGuardResult = {
|
|
69
|
+
type: 'continue';
|
|
70
|
+
} | {
|
|
71
|
+
type: 'redirect';
|
|
72
|
+
to: string;
|
|
73
|
+
options?: NavigateOptions;
|
|
74
|
+
} | {
|
|
75
|
+
type: 'error';
|
|
76
|
+
error: Error;
|
|
77
|
+
info?: RuntimeErrorInfo | null;
|
|
78
|
+
};
|
|
79
|
+
type RouteGuard = (context: RouteGuardContext) => RouteGuardResult | undefined;
|
|
80
|
+
type RouterBoundaryKind = 'layout' | 'route';
|
|
81
|
+
interface RouteBoundaryConfigResolved extends RouteBoundaryConfig {
|
|
82
|
+
id: string;
|
|
83
|
+
componentName: string;
|
|
84
|
+
attributes: Record<string, unknown>;
|
|
85
|
+
}
|
|
86
|
+
interface RouterBoundaryState {
|
|
87
|
+
id: string;
|
|
88
|
+
kind: RouterBoundaryKind;
|
|
89
|
+
definition: RouteBoundaryConfigResolved;
|
|
90
|
+
boundary: RuntimeErrorBoundary;
|
|
91
|
+
error: Error | null;
|
|
92
|
+
info: RuntimeErrorInfo | null;
|
|
93
|
+
reset(): void;
|
|
94
|
+
}
|
|
95
|
+
interface RouteMatch {
|
|
96
|
+
route: RouteDefinition;
|
|
97
|
+
params: Record<string, string>;
|
|
98
|
+
fullPath: string;
|
|
99
|
+
layouts: RouterBoundaryState[];
|
|
100
|
+
boundary: RouterBoundaryState;
|
|
101
|
+
}
|
|
102
|
+
interface NavigateOptions {
|
|
103
|
+
replace?: boolean;
|
|
104
|
+
state?: unknown;
|
|
105
|
+
}
|
|
106
|
+
interface Router {
|
|
107
|
+
currentPath: SignalAccessor<string>;
|
|
108
|
+
currentMatch: SignalAccessor<RouteMatch | null>;
|
|
109
|
+
navigate(path: string, options?: NavigateOptions): RouteMatch | null;
|
|
110
|
+
match(path?: string): RouteMatch | null;
|
|
111
|
+
start(): void;
|
|
112
|
+
dispose(): void;
|
|
113
|
+
}
|
|
114
|
+
interface RouterOptions {
|
|
115
|
+
routes: RouteDefinition[];
|
|
116
|
+
notFoundRoute?: RouteDefinition;
|
|
117
|
+
errorRoute?: RouteDefinition;
|
|
118
|
+
}
|
|
119
|
+
declare function createRouter(routes: RouteDefinition[]): Router;
|
|
120
|
+
declare function createRouter(options: RouterOptions): Router;
|
|
121
|
+
declare function runRouteLoader<T = unknown>(match: RouteMatch, args?: Partial<RouteHandlerArgs>): Promise<RouteHandlerResult<T>>;
|
|
122
|
+
declare function runRouteAction<T = unknown>(match: RouteMatch, args?: Partial<RouteHandlerArgs>): Promise<RouteHandlerResult<T>>;
|
|
123
|
+
|
|
124
|
+
export { type NavigateOptions as N, type Router as R, type RouteMatch as a, type RuntimeErrorInfo as b, type RouteBoundaryConfig as c, type RouteBoundaryConfigResolved as d, type RouteComponentFactory as e, type RouteDataHandler as f, type RouteDefinition as g, type RouteGuard as h, type RouteGuardContext as i, type RouteGuardResult as j, type RouteHandlerArgs as k, type RouteHandlerResult as l, type RouteLayoutDefinition as m, type RouterBoundaryKind as n, type RouterBoundaryState as o, type RouterOptions as p, type RuntimeErrorBoundary as q, type RuntimeErrorContext as r, type RuntimeErrorPhase as s, captureRuntimeError as t, createRouter as u, popRuntimeErrorBoundary as v, pushRuntimeErrorBoundary as w, runRouteAction as x, runRouteLoader as y, withRuntimeErrorBoundary as z };
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { S as SignalAccessor } from './browser-signals-07qodpYT.cjs';
|
|
2
|
+
|
|
3
|
+
type RuntimeErrorPhase = 'render' | 'effect' | 'loader' | 'action' | 'hydration' | 'navigation';
|
|
4
|
+
interface RuntimeErrorInfo {
|
|
5
|
+
phase: RuntimeErrorPhase;
|
|
6
|
+
componentName?: string;
|
|
7
|
+
componentInstanceId?: string;
|
|
8
|
+
templateId?: string;
|
|
9
|
+
effectName?: string;
|
|
10
|
+
attributes?: Record<string, unknown>;
|
|
11
|
+
}
|
|
12
|
+
interface RuntimeErrorBoundary {
|
|
13
|
+
id: string;
|
|
14
|
+
handle(error: Error, info: RuntimeErrorInfo): boolean | undefined;
|
|
15
|
+
}
|
|
16
|
+
interface RuntimeErrorContext {
|
|
17
|
+
componentName?: string;
|
|
18
|
+
componentInstanceId?: string;
|
|
19
|
+
templateId?: string;
|
|
20
|
+
attributes?: Record<string, unknown>;
|
|
21
|
+
}
|
|
22
|
+
declare function withRuntimeErrorBoundary<T>(boundary: RuntimeErrorBoundary, run: () => T): T;
|
|
23
|
+
declare function pushRuntimeErrorBoundary(boundary: RuntimeErrorBoundary): void;
|
|
24
|
+
declare function popRuntimeErrorBoundary(boundary: RuntimeErrorBoundary): void;
|
|
25
|
+
declare function captureRuntimeError(error: unknown, info: RuntimeErrorInfo): boolean;
|
|
26
|
+
|
|
27
|
+
type RouteComponentFactory = () => Promise<Record<string, unknown>> | Record<string, unknown>;
|
|
28
|
+
interface RouteBoundaryConfig {
|
|
29
|
+
id?: string;
|
|
30
|
+
name?: string;
|
|
31
|
+
componentName?: string;
|
|
32
|
+
templateId?: string;
|
|
33
|
+
attributes?: Record<string, unknown>;
|
|
34
|
+
onError?: (error: Error, info: RuntimeErrorInfo) => boolean | void;
|
|
35
|
+
}
|
|
36
|
+
type RouteLayoutDefinition = RouteBoundaryConfig;
|
|
37
|
+
interface RouteDefinition {
|
|
38
|
+
id?: string;
|
|
39
|
+
path: string;
|
|
40
|
+
component: RouteComponentFactory;
|
|
41
|
+
boundary?: RouteBoundaryConfig;
|
|
42
|
+
layouts?: RouteLayoutDefinition[];
|
|
43
|
+
loader?: RouteDataHandler;
|
|
44
|
+
action?: RouteDataHandler;
|
|
45
|
+
guards?: RouteGuard[];
|
|
46
|
+
children?: RouteDefinition[];
|
|
47
|
+
}
|
|
48
|
+
interface RouteHandlerArgs {
|
|
49
|
+
params: Record<string, string>;
|
|
50
|
+
request?: Request;
|
|
51
|
+
signal?: AbortSignal;
|
|
52
|
+
context?: Record<string, unknown>;
|
|
53
|
+
}
|
|
54
|
+
type RouteDataHandler<T = unknown> = (args: RouteHandlerArgs) => T | Promise<T>;
|
|
55
|
+
interface RouteHandlerResult<T = unknown> {
|
|
56
|
+
data?: T;
|
|
57
|
+
error?: Error;
|
|
58
|
+
info?: RuntimeErrorInfo | null;
|
|
59
|
+
handled: boolean;
|
|
60
|
+
startedAt?: number;
|
|
61
|
+
endedAt?: number;
|
|
62
|
+
durationMs?: number;
|
|
63
|
+
}
|
|
64
|
+
interface RouteGuardContext {
|
|
65
|
+
match: RouteMatch;
|
|
66
|
+
params: Record<string, string>;
|
|
67
|
+
}
|
|
68
|
+
type RouteGuardResult = {
|
|
69
|
+
type: 'continue';
|
|
70
|
+
} | {
|
|
71
|
+
type: 'redirect';
|
|
72
|
+
to: string;
|
|
73
|
+
options?: NavigateOptions;
|
|
74
|
+
} | {
|
|
75
|
+
type: 'error';
|
|
76
|
+
error: Error;
|
|
77
|
+
info?: RuntimeErrorInfo | null;
|
|
78
|
+
};
|
|
79
|
+
type RouteGuard = (context: RouteGuardContext) => RouteGuardResult | undefined;
|
|
80
|
+
type RouterBoundaryKind = 'layout' | 'route';
|
|
81
|
+
interface RouteBoundaryConfigResolved extends RouteBoundaryConfig {
|
|
82
|
+
id: string;
|
|
83
|
+
componentName: string;
|
|
84
|
+
attributes: Record<string, unknown>;
|
|
85
|
+
}
|
|
86
|
+
interface RouterBoundaryState {
|
|
87
|
+
id: string;
|
|
88
|
+
kind: RouterBoundaryKind;
|
|
89
|
+
definition: RouteBoundaryConfigResolved;
|
|
90
|
+
boundary: RuntimeErrorBoundary;
|
|
91
|
+
error: Error | null;
|
|
92
|
+
info: RuntimeErrorInfo | null;
|
|
93
|
+
reset(): void;
|
|
94
|
+
}
|
|
95
|
+
interface RouteMatch {
|
|
96
|
+
route: RouteDefinition;
|
|
97
|
+
params: Record<string, string>;
|
|
98
|
+
fullPath: string;
|
|
99
|
+
layouts: RouterBoundaryState[];
|
|
100
|
+
boundary: RouterBoundaryState;
|
|
101
|
+
}
|
|
102
|
+
interface NavigateOptions {
|
|
103
|
+
replace?: boolean;
|
|
104
|
+
state?: unknown;
|
|
105
|
+
}
|
|
106
|
+
interface Router {
|
|
107
|
+
currentPath: SignalAccessor<string>;
|
|
108
|
+
currentMatch: SignalAccessor<RouteMatch | null>;
|
|
109
|
+
navigate(path: string, options?: NavigateOptions): RouteMatch | null;
|
|
110
|
+
match(path?: string): RouteMatch | null;
|
|
111
|
+
start(): void;
|
|
112
|
+
dispose(): void;
|
|
113
|
+
}
|
|
114
|
+
interface RouterOptions {
|
|
115
|
+
routes: RouteDefinition[];
|
|
116
|
+
notFoundRoute?: RouteDefinition;
|
|
117
|
+
errorRoute?: RouteDefinition;
|
|
118
|
+
}
|
|
119
|
+
declare function createRouter(routes: RouteDefinition[]): Router;
|
|
120
|
+
declare function createRouter(options: RouterOptions): Router;
|
|
121
|
+
declare function runRouteLoader<T = unknown>(match: RouteMatch, args?: Partial<RouteHandlerArgs>): Promise<RouteHandlerResult<T>>;
|
|
122
|
+
declare function runRouteAction<T = unknown>(match: RouteMatch, args?: Partial<RouteHandlerArgs>): Promise<RouteHandlerResult<T>>;
|
|
123
|
+
|
|
124
|
+
export { type NavigateOptions as N, type Router as R, type RouteMatch as a, type RuntimeErrorInfo as b, type RouteBoundaryConfig as c, type RouteBoundaryConfigResolved as d, type RouteComponentFactory as e, type RouteDataHandler as f, type RouteDefinition as g, type RouteGuard as h, type RouteGuardContext as i, type RouteGuardResult as j, type RouteHandlerArgs as k, type RouteHandlerResult as l, type RouteLayoutDefinition as m, type RouterBoundaryKind as n, type RouterBoundaryState as o, type RouterOptions as p, type RuntimeErrorBoundary as q, type RuntimeErrorContext as r, type RuntimeErrorPhase as s, captureRuntimeError as t, createRouter as u, popRuntimeErrorBoundary as v, pushRuntimeErrorBoundary as w, runRouteAction as x, runRouteLoader as y, withRuntimeErrorBoundary as z };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/runtime/adapters/angular.ts
|
|
4
|
+
function createAngularAdapter(factory, options = {}) {
|
|
5
|
+
return class CeAngularBridge {
|
|
6
|
+
constructor(host) {
|
|
7
|
+
this.host = host;
|
|
8
|
+
}
|
|
9
|
+
host;
|
|
10
|
+
static selector = options.selector;
|
|
11
|
+
static inputs = options.inputs ?? [];
|
|
12
|
+
instance;
|
|
13
|
+
props = {};
|
|
14
|
+
setInput(key, value) {
|
|
15
|
+
this.props = { ...this.props, [key]: value };
|
|
16
|
+
const patch = { [key]: value };
|
|
17
|
+
this.instance?.updateProps(patch);
|
|
18
|
+
}
|
|
19
|
+
ngOnInit() {
|
|
20
|
+
this.instance = factory.mount({
|
|
21
|
+
target: this.host.nativeElement,
|
|
22
|
+
props: this.props
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
ngOnChanges(changes) {
|
|
26
|
+
if (!this.instance) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const next = {};
|
|
30
|
+
Object.keys(changes).forEach((key) => {
|
|
31
|
+
const change = changes[key];
|
|
32
|
+
if (change) {
|
|
33
|
+
next[key] = change.currentValue;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
if (Object.keys(next).length) {
|
|
37
|
+
this.instance.updateProps(next);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
ngOnDestroy() {
|
|
41
|
+
this.instance?.destroy();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
exports.createAngularAdapter = createAngularAdapter;
|
|
47
|
+
//# sourceMappingURL=angular.cjs.map
|
|
48
|
+
//# sourceMappingURL=angular.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/runtime/adapters/angular.ts"],"names":[],"mappings":";;;AAqBO,SAAS,oBAAA,CACd,OAAA,EACA,OAAA,GAAwC,EAAC,EACzC;AACA,EAAA,OAAO,MAAM,eAAA,CAAgB;AAAA,IAO3B,YAAqB,IAAA,EAAyB;AAAzB,MAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AAAA,IAA0B;AAAA,IAA1B,IAAA;AAAA,IANrB,OAAgB,WAAW,OAAA,CAAQ,QAAA;AAAA,IACnC,OAAgB,MAAA,GAAS,OAAA,CAAQ,MAAA,IAAU,EAAC;AAAA,IAE5C,QAAA;AAAA,IACA,QAAe,EAAC;AAAA,IAIhB,QAAA,CAAgC,KAAQ,KAAA,EAAiB;AACvD,MAAA,IAAA,CAAK,KAAA,GAAQ,EAAE,GAAG,IAAA,CAAK,OAAO,CAAC,GAAG,GAAG,KAAA,EAAM;AAC3C,MAAA,MAAM,KAAA,GAAQ,EAAE,CAAC,GAAG,GAAG,KAAA,EAAM;AAC7B,MAAA,IAAA,CAAK,QAAA,EAAU,YAAY,KAAK,CAAA;AAAA,IAClC;AAAA,IAEA,QAAA,GAAW;AACT,MAAA,IAAA,CAAK,QAAA,GAAW,QAAQ,KAAA,CAAM;AAAA,QAC5B,MAAA,EAAQ,KAAK,IAAA,CAAK,aAAA;AAAA,QAClB,OAAO,IAAA,CAAK;AAAA,OACb,CAAA;AAAA,IACH;AAAA,IAEA,YAAY,OAAA,EAAsC;AAChD,MAAA,IAAI,CAAC,KAAK,QAAA,EAAU;AAClB,QAAA;AAAA,MACF;AACA,MAAA,MAAM,OAAuB,EAAC;AAC9B,MAAC,MAAA,CAAO,IAAA,CAAK,OAAO,CAAA,CAAsB,QAAQ,CAAA,GAAA,KAAO;AACvD,QAAA,MAAM,MAAA,GAAS,QAAQ,GAAG,CAAA;AAC1B,QAAA,IAAI,MAAA,EAAQ;AACV,UAAA,IAAA,CAAK,GAAG,IAAI,MAAA,CAAO,YAAA;AAAA,QACrB;AAAA,MACF,CAAC,CAAA;AACD,MAAA,IAAI,MAAA,CAAO,IAAA,CAAK,IAAI,CAAA,CAAE,MAAA,EAAQ;AAC5B,QAAA,IAAA,CAAK,QAAA,CAAS,YAAY,IAAI,CAAA;AAAA,MAChC;AAAA,IACF;AAAA,IAEA,WAAA,GAAc;AACZ,MAAA,IAAA,CAAK,UAAU,OAAA,EAAQ;AAAA,IACzB;AAAA,GACF;AACF","file":"angular.cjs","sourcesContent":["import type { ComponentFactory, ComponentInstance } from '../component.js';\n\nexport interface AngularElementRef {\n nativeElement: Element;\n}\n\nexport interface AngularSimpleChange<T> {\n previousValue?: T;\n currentValue: T;\n firstChange: boolean;\n}\n\nexport type AngularSimpleChanges<Props extends Record<string, unknown>> = {\n [K in keyof Props]?: AngularSimpleChange<Props[K]>;\n};\n\nexport interface AngularAdapterOptions<Props extends Record<string, unknown>> {\n selector?: string;\n inputs?: (keyof Props)[];\n}\n\nexport function createAngularAdapter<Props extends Record<string, unknown>>(\n factory: ComponentFactory<Props>,\n options: AngularAdapterOptions<Props> = {},\n) {\n return class CeAngularBridge {\n static readonly selector = options.selector;\n static readonly inputs = options.inputs ?? [];\n\n instance?: ComponentInstance<Props>;\n props: Props = {} as Props;\n\n constructor(readonly host: AngularElementRef) {}\n\n setInput<K extends keyof Props>(key: K, value: Props[K]) {\n this.props = { ...this.props, [key]: value };\n const patch = { [key]: value } as unknown as Partial<Props>;\n this.instance?.updateProps(patch);\n }\n\n ngOnInit() {\n this.instance = factory.mount({\n target: this.host.nativeElement,\n props: this.props,\n });\n }\n\n ngOnChanges(changes: AngularSimpleChanges<Props>) {\n if (!this.instance) {\n return;\n }\n const next: Partial<Props> = {};\n (Object.keys(changes) as (keyof Props)[]).forEach(key => {\n const change = changes[key];\n if (change) {\n next[key] = change.currentValue;\n }\n });\n if (Object.keys(next).length) {\n this.instance.updateProps(next);\n }\n }\n\n ngOnDestroy() {\n this.instance?.destroy();\n }\n };\n}\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { C as ComponentFactory, a as ComponentInstance } from '../../component-BVzvepw9.cjs';
|
|
2
|
+
import '../../types-C4RXXKfk.cjs';
|
|
3
|
+
import '../../tracing-DGdvMCEl.cjs';
|
|
4
|
+
import 'node:fs';
|
|
5
|
+
import '../../router-YnpW_sIK.cjs';
|
|
6
|
+
import '../../browser-signals-07qodpYT.cjs';
|
|
7
|
+
import '../../lib/theme.cjs';
|
|
8
|
+
|
|
9
|
+
interface AngularElementRef {
|
|
10
|
+
nativeElement: Element;
|
|
11
|
+
}
|
|
12
|
+
interface AngularSimpleChange<T> {
|
|
13
|
+
previousValue?: T;
|
|
14
|
+
currentValue: T;
|
|
15
|
+
firstChange: boolean;
|
|
16
|
+
}
|
|
17
|
+
type AngularSimpleChanges<Props extends Record<string, unknown>> = {
|
|
18
|
+
[K in keyof Props]?: AngularSimpleChange<Props[K]>;
|
|
19
|
+
};
|
|
20
|
+
interface AngularAdapterOptions<Props extends Record<string, unknown>> {
|
|
21
|
+
selector?: string;
|
|
22
|
+
inputs?: (keyof Props)[];
|
|
23
|
+
}
|
|
24
|
+
declare function createAngularAdapter<Props extends Record<string, unknown>>(factory: ComponentFactory<Props>, options?: AngularAdapterOptions<Props>): {
|
|
25
|
+
new (host: AngularElementRef): {
|
|
26
|
+
instance?: ComponentInstance<Props>;
|
|
27
|
+
props: Props;
|
|
28
|
+
readonly host: AngularElementRef;
|
|
29
|
+
setInput<K extends keyof Props>(key: K, value: Props[K]): void;
|
|
30
|
+
ngOnInit(): void;
|
|
31
|
+
ngOnChanges(changes: AngularSimpleChanges<Props>): void;
|
|
32
|
+
ngOnDestroy(): void;
|
|
33
|
+
};
|
|
34
|
+
readonly selector: string | undefined;
|
|
35
|
+
readonly inputs: (keyof Props)[];
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export { type AngularAdapterOptions, type AngularElementRef, type AngularSimpleChange, type AngularSimpleChanges, createAngularAdapter };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { C as ComponentFactory, a as ComponentInstance } from '../../component-wTxZ2BPD.js';
|
|
2
|
+
import '../../types-C4RXXKfk.js';
|
|
3
|
+
import '../../tracing-DGdvMCEl.js';
|
|
4
|
+
import 'node:fs';
|
|
5
|
+
import '../../router-B9kms5XQ.js';
|
|
6
|
+
import '../../browser-signals-07qodpYT.js';
|
|
7
|
+
import '../../lib/theme.js';
|
|
8
|
+
|
|
9
|
+
interface AngularElementRef {
|
|
10
|
+
nativeElement: Element;
|
|
11
|
+
}
|
|
12
|
+
interface AngularSimpleChange<T> {
|
|
13
|
+
previousValue?: T;
|
|
14
|
+
currentValue: T;
|
|
15
|
+
firstChange: boolean;
|
|
16
|
+
}
|
|
17
|
+
type AngularSimpleChanges<Props extends Record<string, unknown>> = {
|
|
18
|
+
[K in keyof Props]?: AngularSimpleChange<Props[K]>;
|
|
19
|
+
};
|
|
20
|
+
interface AngularAdapterOptions<Props extends Record<string, unknown>> {
|
|
21
|
+
selector?: string;
|
|
22
|
+
inputs?: (keyof Props)[];
|
|
23
|
+
}
|
|
24
|
+
declare function createAngularAdapter<Props extends Record<string, unknown>>(factory: ComponentFactory<Props>, options?: AngularAdapterOptions<Props>): {
|
|
25
|
+
new (host: AngularElementRef): {
|
|
26
|
+
instance?: ComponentInstance<Props>;
|
|
27
|
+
props: Props;
|
|
28
|
+
readonly host: AngularElementRef;
|
|
29
|
+
setInput<K extends keyof Props>(key: K, value: Props[K]): void;
|
|
30
|
+
ngOnInit(): void;
|
|
31
|
+
ngOnChanges(changes: AngularSimpleChanges<Props>): void;
|
|
32
|
+
ngOnDestroy(): void;
|
|
33
|
+
};
|
|
34
|
+
readonly selector: string | undefined;
|
|
35
|
+
readonly inputs: (keyof Props)[];
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export { type AngularAdapterOptions, type AngularElementRef, type AngularSimpleChange, type AngularSimpleChanges, createAngularAdapter };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// src/runtime/adapters/angular.ts
|
|
2
|
+
function createAngularAdapter(factory, options = {}) {
|
|
3
|
+
return class CeAngularBridge {
|
|
4
|
+
constructor(host) {
|
|
5
|
+
this.host = host;
|
|
6
|
+
}
|
|
7
|
+
host;
|
|
8
|
+
static selector = options.selector;
|
|
9
|
+
static inputs = options.inputs ?? [];
|
|
10
|
+
instance;
|
|
11
|
+
props = {};
|
|
12
|
+
setInput(key, value) {
|
|
13
|
+
this.props = { ...this.props, [key]: value };
|
|
14
|
+
const patch = { [key]: value };
|
|
15
|
+
this.instance?.updateProps(patch);
|
|
16
|
+
}
|
|
17
|
+
ngOnInit() {
|
|
18
|
+
this.instance = factory.mount({
|
|
19
|
+
target: this.host.nativeElement,
|
|
20
|
+
props: this.props
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
ngOnChanges(changes) {
|
|
24
|
+
if (!this.instance) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const next = {};
|
|
28
|
+
Object.keys(changes).forEach((key) => {
|
|
29
|
+
const change = changes[key];
|
|
30
|
+
if (change) {
|
|
31
|
+
next[key] = change.currentValue;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
if (Object.keys(next).length) {
|
|
35
|
+
this.instance.updateProps(next);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
ngOnDestroy() {
|
|
39
|
+
this.instance?.destroy();
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { createAngularAdapter };
|
|
45
|
+
//# sourceMappingURL=angular.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AAQ;AACV,UAAA,IAAA,CAAK,GAAG,IAAI,MAAA,CAAO,YAAA;AAAA,QACrB;AAAA,MACF,CAAC,CAAA;AACD,MAAA,IAAI,MAAA,CAAO,IAAA,CAAK,IAAI,CAAA,CAAE,MAAA,EAAQ;AAC5B,QAAA,IAAA,CAAK,QAAA,CAAS,YAAY,IAAI,CAAA;AAAA,MAChC;AAAA,IACF;AAAA,IAEA,WAAA,GAAc;AACZ,MAAA,IAAA,CAAK,UAAU,OAAA,EAAQ;AAAA,IACzB;AAAA,GACF;AACF","file":"angular.js","sourcesContent":["import type { ComponentFactory, ComponentInstance } from '../component.js';\n\nexport interface AngularElementRef {\n nativeElement: Element;\n}\n\nexport interface AngularSimpleChange<T> {\n previousValue?: T;\n currentValue: T;\n firstChange: boolean;\n}\n\nexport type AngularSimpleChanges<Props extends Record<string, unknown>> = {\n [K in keyof Props]?: AngularSimpleChange<Props[K]>;\n};\n\nexport interface AngularAdapterOptions<Props extends Record<string, unknown>> {\n selector?: string;\n inputs?: (keyof Props)[];\n}\n\nexport function createAngularAdapter<Props extends Record<string, unknown>>(\n factory: ComponentFactory<Props>,\n options: AngularAdapterOptions<Props> = {},\n) {\n return class CeAngularBridge {\n static readonly selector = options.selector;\n static readonly inputs = options.inputs ?? [];\n\n instance?: ComponentInstance<Props>;\n props: Props = {} as Props;\n\n constructor(readonly host: AngularElementRef) {}\n\n setInput<K extends keyof Props>(key: K, value: Props[K]) {\n this.props = { ...this.props, [key]: value };\n const patch = { [key]: value } as unknown as Partial<Props>;\n this.instance?.updateProps(patch);\n }\n\n ngOnInit() {\n this.instance = factory.mount({\n target: this.host.nativeElement,\n props: this.props,\n });\n }\n\n ngOnChanges(changes: AngularSimpleChanges<Props>) {\n if (!this.instance) {\n return;\n }\n const next: Partial<Props> = {};\n (Object.keys(changes) as (keyof Props)[]).forEach(key => {\n const change = changes[key];\n if (change) {\n next[key] = change.currentValue;\n }\n });\n if (Object.keys(next).length) {\n this.instance.updateProps(next);\n }\n }\n\n ngOnDestroy() {\n this.instance?.destroy();\n }\n };\n}\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/runtime/adapters/react.ts
|
|
4
|
+
function createReactAdapter(factory, react, options = {}) {
|
|
5
|
+
const hostTag = options.hostElement ?? "div";
|
|
6
|
+
const Adapter = (props) => {
|
|
7
|
+
const hostRef = react.useRef(null);
|
|
8
|
+
const instanceRef = react.useRef(null);
|
|
9
|
+
react.useEffect(() => {
|
|
10
|
+
if (!hostRef.current) {
|
|
11
|
+
return void 0;
|
|
12
|
+
}
|
|
13
|
+
instanceRef.current = factory.mount({
|
|
14
|
+
target: hostRef.current,
|
|
15
|
+
props
|
|
16
|
+
});
|
|
17
|
+
return () => {
|
|
18
|
+
instanceRef.current?.destroy();
|
|
19
|
+
instanceRef.current = null;
|
|
20
|
+
};
|
|
21
|
+
}, []);
|
|
22
|
+
react.useEffect(() => {
|
|
23
|
+
if (instanceRef.current) {
|
|
24
|
+
instanceRef.current.updateProps(props);
|
|
25
|
+
}
|
|
26
|
+
return void 0;
|
|
27
|
+
}, [props]);
|
|
28
|
+
const refCallback = (node) => {
|
|
29
|
+
hostRef.current = node;
|
|
30
|
+
};
|
|
31
|
+
return react.createElement(hostTag, { ref: refCallback }, props.children ?? null);
|
|
32
|
+
};
|
|
33
|
+
if (options.displayName) {
|
|
34
|
+
Adapter.displayName = options.displayName;
|
|
35
|
+
}
|
|
36
|
+
return Adapter;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
exports.createReactAdapter = createReactAdapter;
|
|
40
|
+
//# sourceMappingURL=react.cjs.map
|
|
41
|
+
//# sourceMappingURL=react.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/runtime/adapters/react.ts"],"names":[],"mappings":";;;AAmBO,SAAS,kBAAA,CACd,OAAA,EACA,KAAA,EACA,OAAA,GAA+B,EAAC,EACF;AAC9B,EAA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ComponentFactory, ComponentInstance } from '../component.js';\n\ntype ReactCleanupFn = () => void;\n\nexport interface ReactInterop {\n createElement: (...args: unknown[]) => unknown;\n useEffect: (effect: () => ReactCleanupFn | undefined, deps?: unknown[]) => void;\n useRef: <T>(initial: T | null) => { current: T | null };\n}\n\nexport interface ReactAdapterOptions {\n hostElement?: string;\n displayName?: string;\n}\n\nexport type ReactAdapterComponent<Props extends Record<string, unknown>> = (\n props: Props & { children?: unknown },\n) => unknown;\n\nexport function createReactAdapter<Props extends Record<string, unknown>>(\n factory: ComponentFactory<Props>,\n react: ReactInterop,\n options: ReactAdapterOptions = {},\n): ReactAdapterComponent<Props> {\n const hostTag = options.hostElement ?? 'div';\n\n const Adapter: ReactAdapterComponent<Props> = props => {\n const hostRef = react.useRef<Element | null>(null);\n const instanceRef = react.useRef<ComponentInstance<Props> | null>(null);\n\n react.useEffect(() => {\n if (!hostRef.current) {\n return undefined;\n }\n instanceRef.current = factory.mount({\n target: hostRef.current,\n props: props as Props,\n });\n return () => {\n instanceRef.current?.destroy();\n instanceRef.current = null;\n };\n }, []);\n\n react.useEffect(() => {\n if (instanceRef.current) {\n instanceRef.current.updateProps(props as Props);\n }\n return undefined;\n }, [props]);\n\n const refCallback = (node: Element | null) => {\n hostRef.current = node;\n };\n\n return react.createElement(hostTag, { ref: refCallback }, props.children ?? null);\n };\n\n if (options.displayName) {\n (Adapter as { displayName?: string }).displayName = options.displayName;\n }\n\n return Adapter;\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { C as ComponentFactory } from '../../component-BVzvepw9.cjs';
|
|
2
|
+
import '../../types-C4RXXKfk.cjs';
|
|
3
|
+
import '../../tracing-DGdvMCEl.cjs';
|
|
4
|
+
import 'node:fs';
|
|
5
|
+
import '../../router-YnpW_sIK.cjs';
|
|
6
|
+
import '../../browser-signals-07qodpYT.cjs';
|
|
7
|
+
import '../../lib/theme.cjs';
|
|
8
|
+
|
|
9
|
+
type ReactCleanupFn = () => void;
|
|
10
|
+
interface ReactInterop {
|
|
11
|
+
createElement: (...args: unknown[]) => unknown;
|
|
12
|
+
useEffect: (effect: () => ReactCleanupFn | undefined, deps?: unknown[]) => void;
|
|
13
|
+
useRef: <T>(initial: T | null) => {
|
|
14
|
+
current: T | null;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
interface ReactAdapterOptions {
|
|
18
|
+
hostElement?: string;
|
|
19
|
+
displayName?: string;
|
|
20
|
+
}
|
|
21
|
+
type ReactAdapterComponent<Props extends Record<string, unknown>> = (props: Props & {
|
|
22
|
+
children?: unknown;
|
|
23
|
+
}) => unknown;
|
|
24
|
+
declare function createReactAdapter<Props extends Record<string, unknown>>(factory: ComponentFactory<Props>, react: ReactInterop, options?: ReactAdapterOptions): ReactAdapterComponent<Props>;
|
|
25
|
+
|
|
26
|
+
export { type ReactAdapterComponent, type ReactAdapterOptions, type ReactInterop, createReactAdapter };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { C as ComponentFactory } from '../../component-wTxZ2BPD.js';
|
|
2
|
+
import '../../types-C4RXXKfk.js';
|
|
3
|
+
import '../../tracing-DGdvMCEl.js';
|
|
4
|
+
import 'node:fs';
|
|
5
|
+
import '../../router-B9kms5XQ.js';
|
|
6
|
+
import '../../browser-signals-07qodpYT.js';
|
|
7
|
+
import '../../lib/theme.js';
|
|
8
|
+
|
|
9
|
+
type ReactCleanupFn = () => void;
|
|
10
|
+
interface ReactInterop {
|
|
11
|
+
createElement: (...args: unknown[]) => unknown;
|
|
12
|
+
useEffect: (effect: () => ReactCleanupFn | undefined, deps?: unknown[]) => void;
|
|
13
|
+
useRef: <T>(initial: T | null) => {
|
|
14
|
+
current: T | null;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
interface ReactAdapterOptions {
|
|
18
|
+
hostElement?: string;
|
|
19
|
+
displayName?: string;
|
|
20
|
+
}
|
|
21
|
+
type ReactAdapterComponent<Props extends Record<string, unknown>> = (props: Props & {
|
|
22
|
+
children?: unknown;
|
|
23
|
+
}) => unknown;
|
|
24
|
+
declare function createReactAdapter<Props extends Record<string, unknown>>(factory: ComponentFactory<Props>, react: ReactInterop, options?: ReactAdapterOptions): ReactAdapterComponent<Props>;
|
|
25
|
+
|
|
26
|
+
export { type ReactAdapterComponent, type ReactAdapterOptions, type ReactInterop, createReactAdapter };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// src/runtime/adapters/react.ts
|
|
2
|
+
function createReactAdapter(factory, react, options = {}) {
|
|
3
|
+
const hostTag = options.hostElement ?? "div";
|
|
4
|
+
const Adapter = (props) => {
|
|
5
|
+
const hostRef = react.useRef(null);
|
|
6
|
+
const instanceRef = react.useRef(null);
|
|
7
|
+
react.useEffect(() => {
|
|
8
|
+
if (!hostRef.current) {
|
|
9
|
+
return void 0;
|
|
10
|
+
}
|
|
11
|
+
instanceRef.current = factory.mount({
|
|
12
|
+
target: hostRef.current,
|
|
13
|
+
props
|
|
14
|
+
});
|
|
15
|
+
return () => {
|
|
16
|
+
instanceRef.current?.destroy();
|
|
17
|
+
instanceRef.current = null;
|
|
18
|
+
};
|
|
19
|
+
}, []);
|
|
20
|
+
react.useEffect(() => {
|
|
21
|
+
if (instanceRef.current) {
|
|
22
|
+
instanceRef.current.updateProps(props);
|
|
23
|
+
}
|
|
24
|
+
return void 0;
|
|
25
|
+
}, [props]);
|
|
26
|
+
const refCallback = (node) => {
|
|
27
|
+
hostRef.current = node;
|
|
28
|
+
};
|
|
29
|
+
return react.createElement(hostTag, { ref: refCallback }, props.children ?? null);
|
|
30
|
+
};
|
|
31
|
+
if (options.displayName) {
|
|
32
|
+
Adapter.displayName = options.displayName;
|
|
33
|
+
}
|
|
34
|
+
return Adapter;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { createReactAdapter };
|
|
38
|
+
//# sourceMappingURL=react.js.map
|
|
39
|
+
//# sourceMappingURL=react.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["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AACvB,IAAC,OAAA,CAAqC,cAAc,OAAA,CAAQ,WAAA;AAAA,EAC9D;AAEA,EAAA,OAAO,OAAA;AACT","file":"react.js","sourcesContent":["import type { ComponentFactory, ComponentInstance } from '../component.js';\n\ntype ReactCleanupFn = () => void;\n\nexport interface ReactInterop {\n createElement: (...args: unknown[]) => unknown;\n useEffect: (effect: () => ReactCleanupFn | undefined, deps?: unknown[]) => void;\n useRef: <T>(initial: T | null) => { current: T | null };\n}\n\nexport interface ReactAdapterOptions {\n hostElement?: string;\n displayName?: string;\n}\n\nexport type ReactAdapterComponent<Props extends Record<string, unknown>> = (\n props: Props & { children?: unknown },\n) => unknown;\n\nexport function createReactAdapter<Props extends Record<string, unknown>>(\n factory: ComponentFactory<Props>,\n react: ReactInterop,\n options: ReactAdapterOptions = {},\n): ReactAdapterComponent<Props> {\n const hostTag = options.hostElement ?? 'div';\n\n const Adapter: ReactAdapterComponent<Props> = props => {\n const hostRef = react.useRef<Element | null>(null);\n const instanceRef = react.useRef<ComponentInstance<Props> | null>(null);\n\n react.useEffect(() => {\n if (!hostRef.current) {\n return undefined;\n }\n instanceRef.current = factory.mount({\n target: hostRef.current,\n props: props as Props,\n });\n return () => {\n instanceRef.current?.destroy();\n instanceRef.current = null;\n };\n }, []);\n\n react.useEffect(() => {\n if (instanceRef.current) {\n instanceRef.current.updateProps(props as Props);\n }\n return undefined;\n }, [props]);\n\n const refCallback = (node: Element | null) => {\n hostRef.current = node;\n };\n\n return react.createElement(hostTag, { ref: refCallback }, props.children ?? null);\n };\n\n if (options.displayName) {\n (Adapter as { displayName?: string }).displayName = options.displayName;\n }\n\n return Adapter;\n}\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/runtime/adapters/vue.ts
|
|
4
|
+
function createVueAdapter(factory, vue, options = {}) {
|
|
5
|
+
const hostTag = options.hostElement ?? "div";
|
|
6
|
+
const component = {
|
|
7
|
+
name: options.displayName,
|
|
8
|
+
setup(props, ctx) {
|
|
9
|
+
const hostRef = vue.ref(null);
|
|
10
|
+
let instance = null;
|
|
11
|
+
vue.onMounted(() => {
|
|
12
|
+
if (!hostRef.value) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
instance = factory.mount({
|
|
16
|
+
target: hostRef.value,
|
|
17
|
+
props
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
vue.watch(
|
|
21
|
+
() => props,
|
|
22
|
+
(next) => {
|
|
23
|
+
if (instance) {
|
|
24
|
+
instance.updateProps(next);
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{ deep: true }
|
|
28
|
+
);
|
|
29
|
+
vue.onBeforeUnmount(() => {
|
|
30
|
+
instance?.destroy();
|
|
31
|
+
instance = null;
|
|
32
|
+
});
|
|
33
|
+
return () => {
|
|
34
|
+
const slot = ctx.slots?.default;
|
|
35
|
+
return vue.h(hostTag, { ref: hostRef }, slot ? slot() : null);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
return component;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
exports.createVueAdapter = createVueAdapter;
|
|
43
|
+
//# sourceMappingURL=vue.cjs.map
|
|
44
|
+
//# sourceMappingURL=vue.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/runtime/adapters/vue.ts"],"names":[],"mappings":";;;AAwBO,SAAS,gBAAA,CACd,OAAA,EACA,GAAA,EACA,OAAA,GAA6B,EAAC,EACF;AAC5B,EAAA,MAAM,OAAA,GAAU,QAAQ,WAAA,IAAe,KAAA;AAEvC,EAAA,MAAM,SAAA,GAAwC;AAAA,IAC5C,MAAM,OAAA,CAAQ,WAAA;AAAA,IACd,KAAA,CAAM,OAAO,GAAA,EAAK;AAChB,MAAA,MAAM,OAAA,GAAU,GAAA,CAAI,GAAA,CAAoB,IAAI,CAAA;AAC5C,MAAA,IAAI,QAAA,GAA4C,IAAA;AAEhD,MAAA,GAAA,CAAI,UAAU,MAAM;AAClB,QAAA,IAAI,CAAC,QAAQ,KAAA,EAAO;AAClB,UAAA;AAAA,QACF;AACA,QAAA,QAAA,GAAW,QAAQ,KAAA,CAAM;AAAA,UACvB,QAAQ,OAAA,CAAQ,KAAA;AAAA,UAChB;AAAA,SACD,CAAA;AAAA,MACH,CAAC,CAAA;AAED,MAAA,GAAA,CAAI,KAAA;AAAA,QACF,MAAM,KAAA;AAAA,QACN,CAAA,IAAA,KAAQ;AACN,UAAA,IAAI,QAAA,EAAU;AACZ,YAAA,QAAA,CAAS,YAAY,IAAa,CAAA;AAAA,UACpC;AAAA,QACF,CAAA;AAAA,QACA,EAAE,MAAM,IAAA;AAAK,OACf;AAEA,MAAA,GAAA,CAAI,gBAAgB,MAAM;AACxB,QAAA,QAAA,EAAU,OAAA,EAAQ;AAClB,QAAA,QAAA,GAAW,IAAA;AAAA,MACb,CAAC,CAAA;AAED,MAAA,OAAO,MAAM;AACX,QAAA,MAAM,IAAA,GAAO,IAAI,KAAA,EAAO,OAAA;AACxB,QAAA,OAAO,GAAA,CAAI,CAAA,CAAE,OAAA,EAAS,EAAE,GAAA,EAAK,SAAQ,EAAG,IAAA,GAAO,IAAA,EAAK,GAAI,IAAI,CAAA;AAAA,MAC9D,CAAA;AAAA,IACF;AAAA,GACF;AAEA,EAAA,OAAO,SAAA;AACT","file":"vue.cjs","sourcesContent":["import type { ComponentFactory, ComponentInstance } from '../component.js';\n\nexport interface VueInterop {\n h: (...args: unknown[]) => unknown;\n ref: <T>(value: T | null) => { value: T | null };\n onMounted: (callback: () => void) => void;\n onBeforeUnmount: (callback: () => void) => void;\n watch: (\n source: () => unknown,\n callback: (value: unknown) => void,\n options?: { deep?: boolean },\n ) => void;\n}\n\nexport interface VueAdapterOptions {\n hostElement?: string;\n displayName?: string;\n}\n\nexport interface VueAdapterComponent<Props extends Record<string, unknown>> {\n name?: string;\n setup: (props: Props, ctx: { slots?: { default?: () => unknown } }) => () => unknown;\n}\n\nexport function createVueAdapter<Props extends Record<string, unknown>>(\n factory: ComponentFactory<Props>,\n vue: VueInterop,\n options: VueAdapterOptions = {},\n): VueAdapterComponent<Props> {\n const hostTag = options.hostElement ?? 'div';\n\n const component: VueAdapterComponent<Props> = {\n name: options.displayName,\n setup(props, ctx) {\n const hostRef = vue.ref<Element | null>(null);\n let instance: ComponentInstance<Props> | null = null;\n\n vue.onMounted(() => {\n if (!hostRef.value) {\n return;\n }\n instance = factory.mount({\n target: hostRef.value,\n props,\n });\n });\n\n vue.watch(\n () => props,\n next => {\n if (instance) {\n instance.updateProps(next as Props);\n }\n },\n { deep: true },\n );\n\n vue.onBeforeUnmount(() => {\n instance?.destroy();\n instance = null;\n });\n\n return () => {\n const slot = ctx.slots?.default;\n return vue.h(hostTag, { ref: hostRef }, slot ? slot() : null);\n };\n },\n };\n\n return component;\n}\n"]}
|