@sigx/runtime-core 0.1.8 → 0.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/dist/component.d.ts +6 -1
- package/dist/component.d.ts.map +1 -1
- package/dist/index.d.ts +19 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1239
- package/dist/index.js.map +1 -1
- package/dist/internals.d.ts +29 -0
- package/dist/internals.d.ts.map +1 -0
- package/dist/internals.js +2 -0
- package/dist/messaging/index.d.ts +1 -1
- package/dist/messaging/index.d.ts.map +1 -1
- package/dist/models/index.d.ts +0 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/renderer-KQIgreMb.js +1230 -0
- package/dist/renderer-KQIgreMb.js.map +1 -0
- package/dist/renderer.d.ts +13 -3
- package/dist/renderer.d.ts.map +1 -1
- package/package.json +7 -3
package/dist/index.js
CHANGED
|
@@ -1,613 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
var platformModelProcessor = null;
|
|
4
|
-
function setPlatformModelProcessor(fn) {
|
|
5
|
-
platformModelProcessor = fn;
|
|
6
|
-
}
|
|
7
|
-
function getPlatformModelProcessor() {
|
|
8
|
-
return platformModelProcessor;
|
|
9
|
-
}
|
|
10
|
-
var plugins = [];
|
|
11
|
-
function registerComponentPlugin(plugin) {
|
|
12
|
-
plugins.push(plugin);
|
|
13
|
-
}
|
|
14
|
-
function getComponentPlugins() {
|
|
15
|
-
return plugins;
|
|
16
|
-
}
|
|
17
|
-
var contextExtensions = [];
|
|
18
|
-
function registerContextExtension(extension) {
|
|
19
|
-
contextExtensions.push(extension);
|
|
20
|
-
}
|
|
21
|
-
function applyContextExtensions(ctx) {
|
|
22
|
-
for (const extension of contextExtensions) extension(ctx);
|
|
23
|
-
}
|
|
24
|
-
var require___vite_browser_external = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
25
|
-
module.exports = {};
|
|
26
|
-
}));
|
|
27
|
-
var asyncLocalStorage = null;
|
|
28
|
-
try {
|
|
29
|
-
if (typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined") {
|
|
30
|
-
const nodeAsync = globalThis.process?.versions?.node ? require___vite_browser_external() : null;
|
|
31
|
-
if (nodeAsync?.AsyncLocalStorage) asyncLocalStorage = new nodeAsync.AsyncLocalStorage();
|
|
32
|
-
}
|
|
33
|
-
} catch {}
|
|
34
|
-
var _fallbackContext = {
|
|
35
|
-
currentComponentContext: null,
|
|
36
|
-
currentSuspenseBoundary: null
|
|
37
|
-
};
|
|
38
|
-
function getRequestContext() {
|
|
39
|
-
if (asyncLocalStorage) {
|
|
40
|
-
const store = asyncLocalStorage.getStore();
|
|
41
|
-
if (store) return store;
|
|
42
|
-
}
|
|
43
|
-
return _fallbackContext;
|
|
44
|
-
}
|
|
45
|
-
function getCurrentInstanceSafe() {
|
|
46
|
-
return getRequestContext().currentComponentContext;
|
|
47
|
-
}
|
|
48
|
-
function setCurrentInstanceSafe(ctx) {
|
|
49
|
-
const reqCtx = getRequestContext();
|
|
50
|
-
const prev = reqCtx.currentComponentContext;
|
|
51
|
-
reqCtx.currentComponentContext = ctx;
|
|
52
|
-
return prev;
|
|
53
|
-
}
|
|
54
|
-
function getCurrentSuspenseBoundarySafe() {
|
|
55
|
-
return getRequestContext().currentSuspenseBoundary;
|
|
56
|
-
}
|
|
57
|
-
function setCurrentSuspenseBoundarySafe(boundary) {
|
|
58
|
-
const reqCtx = getRequestContext();
|
|
59
|
-
const prev = reqCtx.currentSuspenseBoundary;
|
|
60
|
-
reqCtx.currentSuspenseBoundary = boundary;
|
|
61
|
-
return prev;
|
|
62
|
-
}
|
|
63
|
-
function runInRequestScope(fn) {
|
|
64
|
-
if (asyncLocalStorage) return asyncLocalStorage.run({
|
|
65
|
-
currentComponentContext: null,
|
|
66
|
-
currentSuspenseBoundary: null
|
|
67
|
-
}, fn);
|
|
68
|
-
return fn();
|
|
69
|
-
}
|
|
70
|
-
function hasRequestIsolation() {
|
|
71
|
-
return asyncLocalStorage !== null;
|
|
72
|
-
}
|
|
73
|
-
var currentComponentContext = null;
|
|
74
|
-
function getCurrentInstance() {
|
|
75
|
-
return getCurrentInstanceSafe() ?? currentComponentContext;
|
|
76
|
-
}
|
|
77
|
-
function setCurrentInstance(ctx) {
|
|
78
|
-
const prevSafe = setCurrentInstanceSafe(ctx);
|
|
79
|
-
const prevModule = currentComponentContext;
|
|
80
|
-
currentComponentContext = ctx;
|
|
81
|
-
return prevSafe ?? prevModule;
|
|
82
|
-
}
|
|
83
|
-
function onMounted(fn) {
|
|
84
|
-
if (currentComponentContext) currentComponentContext.onMounted(fn);
|
|
85
|
-
else console.warn("onMounted called outside of component setup");
|
|
86
|
-
}
|
|
87
|
-
function onUnmounted(fn) {
|
|
88
|
-
if (currentComponentContext) currentComponentContext.onUnmounted(fn);
|
|
89
|
-
else console.warn("onUnmounted called outside of component setup");
|
|
90
|
-
}
|
|
91
|
-
function onCreated(fn) {
|
|
92
|
-
if (currentComponentContext) currentComponentContext.onCreated(fn);
|
|
93
|
-
else console.warn("onCreated called outside of component setup");
|
|
94
|
-
}
|
|
95
|
-
function onUpdated(fn) {
|
|
96
|
-
if (currentComponentContext) currentComponentContext.onUpdated(fn);
|
|
97
|
-
else console.warn("onUpdated called outside of component setup");
|
|
98
|
-
}
|
|
99
|
-
var componentRegistry = /* @__PURE__ */ new Map();
|
|
100
|
-
function getComponentMeta(factory) {
|
|
101
|
-
return componentRegistry.get(factory);
|
|
102
|
-
}
|
|
103
|
-
function createPropsProxy(target, onAccess) {
|
|
104
|
-
return new Proxy(target, { get(obj, prop) {
|
|
105
|
-
if (typeof prop === "string" && onAccess) onAccess(prop);
|
|
106
|
-
return obj[prop];
|
|
107
|
-
} });
|
|
108
|
-
}
|
|
109
|
-
function component(setup, options) {
|
|
110
|
-
const factory = function(props) {
|
|
111
|
-
return {
|
|
112
|
-
type: factory,
|
|
113
|
-
props: props || {},
|
|
114
|
-
key: props?.key || null,
|
|
115
|
-
children: [],
|
|
116
|
-
dom: null
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
factory.__setup = setup;
|
|
120
|
-
factory.__name = options?.name;
|
|
121
|
-
factory.__props = null;
|
|
122
|
-
factory.__events = null;
|
|
123
|
-
factory.__ref = null;
|
|
124
|
-
factory.__slots = null;
|
|
125
|
-
componentRegistry.set(factory, {
|
|
126
|
-
name: options?.name,
|
|
127
|
-
setup
|
|
128
|
-
});
|
|
129
|
-
getComponentPlugins().forEach((p) => p.onDefine?.(options?.name, factory, setup));
|
|
130
|
-
return factory;
|
|
131
|
-
}
|
|
132
|
-
var globalInstances = /* @__PURE__ */ new Map();
|
|
133
|
-
var appContextToken = Symbol("sigx:appContext");
|
|
134
|
-
function lookupProvided(token) {
|
|
135
|
-
const ctx = getCurrentInstance();
|
|
136
|
-
if (!ctx) return;
|
|
137
|
-
let current = ctx;
|
|
138
|
-
while (current) {
|
|
139
|
-
if (current.provides && current.provides.has(token)) return current.provides.get(token);
|
|
140
|
-
current = current.parent;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
function provideAtComponent(token, value) {
|
|
144
|
-
const ctx = getCurrentInstance();
|
|
145
|
-
if (!ctx) throw new Error("defineProvide must be called inside a component setup function");
|
|
146
|
-
if (!ctx.provides) ctx.provides = /* @__PURE__ */ new Map();
|
|
147
|
-
ctx.provides.set(token, value);
|
|
148
|
-
}
|
|
149
|
-
function defineInjectable(factory) {
|
|
150
|
-
const token = Symbol();
|
|
151
|
-
const useFn = (() => {
|
|
152
|
-
const provided = lookupProvided(token);
|
|
153
|
-
if (provided !== void 0) return provided;
|
|
154
|
-
if (!globalInstances.has(token)) globalInstances.set(token, factory());
|
|
155
|
-
return globalInstances.get(token);
|
|
156
|
-
});
|
|
157
|
-
useFn._factory = factory;
|
|
158
|
-
useFn._token = token;
|
|
159
|
-
return useFn;
|
|
160
|
-
}
|
|
161
|
-
function defineProvide(useFn, factory) {
|
|
162
|
-
const actualFactory = factory ?? useFn._factory;
|
|
163
|
-
const token = useFn._token;
|
|
164
|
-
if (!actualFactory || !token) throw new Error("defineProvide must be called with a function created by defineInjectable");
|
|
165
|
-
const instance = actualFactory();
|
|
166
|
-
provideAtComponent(token, instance);
|
|
167
|
-
return instance;
|
|
168
|
-
}
|
|
169
|
-
function useAppContext() {
|
|
170
|
-
return lookupProvided(appContextToken) ?? null;
|
|
171
|
-
}
|
|
172
|
-
function getAppContextToken() {
|
|
173
|
-
return appContextToken;
|
|
174
|
-
}
|
|
175
|
-
function provideAppContext(ctx, appContext) {
|
|
176
|
-
if (!ctx.provides) ctx.provides = /* @__PURE__ */ new Map();
|
|
177
|
-
ctx.provides.set(appContextToken, appContext);
|
|
178
|
-
if (appContext.provides) for (const [token, value] of appContext.provides) ctx.provides.set(token, value);
|
|
179
|
-
}
|
|
180
|
-
const __DIRECTIVE__ = Symbol.for("sigx.directive");
|
|
181
|
-
function defineDirective(definition) {
|
|
182
|
-
definition[__DIRECTIVE__] = true;
|
|
183
|
-
return definition;
|
|
184
|
-
}
|
|
185
|
-
function isDirective(value) {
|
|
186
|
-
return value != null && typeof value === "object" && value[__DIRECTIVE__] === true;
|
|
187
|
-
}
|
|
188
|
-
var isDev = typeof process !== "undefined" && process.env.NODE_ENV !== "production" || true;
|
|
189
|
-
var defaultMountFn = null;
|
|
190
|
-
function setDefaultMount(mountFn) {
|
|
191
|
-
defaultMountFn = mountFn;
|
|
192
|
-
}
|
|
193
|
-
function getDefaultMount() {
|
|
194
|
-
return defaultMountFn;
|
|
195
|
-
}
|
|
196
|
-
function defineApp(rootComponent) {
|
|
197
|
-
const installedPlugins = /* @__PURE__ */ new Set();
|
|
198
|
-
const context = {
|
|
199
|
-
app: null,
|
|
200
|
-
provides: /* @__PURE__ */ new Map(),
|
|
201
|
-
config: {},
|
|
202
|
-
hooks: [],
|
|
203
|
-
directives: /* @__PURE__ */ new Map()
|
|
204
|
-
};
|
|
205
|
-
let isMounted = false;
|
|
206
|
-
let container = null;
|
|
207
|
-
let unmountFn = null;
|
|
208
|
-
const app = {
|
|
209
|
-
config: context.config,
|
|
210
|
-
use(plugin, options) {
|
|
211
|
-
if (installedPlugins.has(plugin)) {
|
|
212
|
-
if (isDev) console.warn(`Plugin ${plugin.name || "anonymous"} is already installed.`);
|
|
213
|
-
return app;
|
|
214
|
-
}
|
|
215
|
-
installedPlugins.add(plugin);
|
|
216
|
-
if (typeof plugin === "function") plugin(app, options);
|
|
217
|
-
else if (plugin && typeof plugin.install === "function") plugin.install(app, options);
|
|
218
|
-
else if (isDev) console.warn("Invalid plugin: must be a function or have an install() method.");
|
|
219
|
-
return app;
|
|
220
|
-
},
|
|
221
|
-
defineProvide(useFn, factory) {
|
|
222
|
-
const actualFactory = factory ?? useFn._factory;
|
|
223
|
-
const token = useFn._token;
|
|
224
|
-
if (!actualFactory || !token) throw new Error("defineProvide must be called with a function created by defineInjectable");
|
|
225
|
-
const instance = actualFactory();
|
|
226
|
-
context.provides.set(token, instance);
|
|
227
|
-
return instance;
|
|
228
|
-
},
|
|
229
|
-
hook(hooks) {
|
|
230
|
-
context.hooks.push(hooks);
|
|
231
|
-
return app;
|
|
232
|
-
},
|
|
233
|
-
directive(name, definition) {
|
|
234
|
-
if (definition !== void 0) {
|
|
235
|
-
if (isDev && !isDirective(definition)) console.warn(`[sigx] app.directive('${name}', ...) received a value that is not a valid directive definition. Use defineDirective() to create directive definitions.`);
|
|
236
|
-
context.directives.set(name, definition);
|
|
237
|
-
return app;
|
|
238
|
-
}
|
|
239
|
-
return context.directives.get(name);
|
|
240
|
-
},
|
|
241
|
-
mount(target, renderFn) {
|
|
242
|
-
if (isMounted) {
|
|
243
|
-
if (isDev) console.warn("App is already mounted. Call app.unmount() first.");
|
|
244
|
-
return app;
|
|
245
|
-
}
|
|
246
|
-
const mountFn = renderFn ?? defaultMountFn;
|
|
247
|
-
if (!mountFn) throw new Error("No mount function provided and no default mount function set. Either pass a mount function to app.mount(), or import a platform package (e.g., @sigx/runtime-dom or @sigx/runtime-terminal) that sets the default.");
|
|
248
|
-
container = target;
|
|
249
|
-
isMounted = true;
|
|
250
|
-
const result = mountFn(rootComponent, target, context);
|
|
251
|
-
if (typeof result === "function") unmountFn = result;
|
|
252
|
-
return app;
|
|
253
|
-
},
|
|
254
|
-
unmount() {
|
|
255
|
-
if (!isMounted) {
|
|
256
|
-
if (isDev) console.warn("App is not mounted.");
|
|
257
|
-
return;
|
|
258
|
-
}
|
|
259
|
-
if (unmountFn) unmountFn();
|
|
260
|
-
context.provides.clear();
|
|
261
|
-
isMounted = false;
|
|
262
|
-
container = null;
|
|
263
|
-
},
|
|
264
|
-
get _context() {
|
|
265
|
-
return context;
|
|
266
|
-
},
|
|
267
|
-
get _isMounted() {
|
|
268
|
-
return isMounted;
|
|
269
|
-
},
|
|
270
|
-
get _container() {
|
|
271
|
-
return container;
|
|
272
|
-
},
|
|
273
|
-
get _rootComponent() {
|
|
274
|
-
return rootComponent;
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
context.app = app;
|
|
278
|
-
const appContextToken = getAppContextToken();
|
|
279
|
-
context.provides.set(appContextToken, context);
|
|
280
|
-
return app;
|
|
281
|
-
}
|
|
282
|
-
function notifyComponentCreated(context, instance) {
|
|
283
|
-
if (!context) return;
|
|
284
|
-
for (const hooks of context.hooks) try {
|
|
285
|
-
hooks.onComponentCreated?.(instance);
|
|
286
|
-
} catch (err) {
|
|
287
|
-
handleHookError(context, err, instance, "onComponentCreated");
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
function notifyComponentMounted(context, instance) {
|
|
291
|
-
if (!context) return;
|
|
292
|
-
for (const hooks of context.hooks) try {
|
|
293
|
-
hooks.onComponentMounted?.(instance);
|
|
294
|
-
} catch (err) {
|
|
295
|
-
handleHookError(context, err, instance, "onComponentMounted");
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
function notifyComponentUnmounted(context, instance) {
|
|
299
|
-
if (!context) return;
|
|
300
|
-
for (const hooks of context.hooks) try {
|
|
301
|
-
hooks.onComponentUnmounted?.(instance);
|
|
302
|
-
} catch (err) {
|
|
303
|
-
handleHookError(context, err, instance, "onComponentUnmounted");
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
function notifyComponentUpdated(context, instance) {
|
|
307
|
-
if (!context) return;
|
|
308
|
-
for (const hooks of context.hooks) try {
|
|
309
|
-
hooks.onComponentUpdated?.(instance);
|
|
310
|
-
} catch (err) {
|
|
311
|
-
handleHookError(context, err, instance, "onComponentUpdated");
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
function handleComponentError(context, err, instance, info) {
|
|
315
|
-
if (!context) return false;
|
|
316
|
-
for (const hooks of context.hooks) try {
|
|
317
|
-
if (hooks.onComponentError?.(err, instance, info) === true) return true;
|
|
318
|
-
} catch (hookErr) {
|
|
319
|
-
console.error("Error in onComponentError hook:", hookErr);
|
|
320
|
-
}
|
|
321
|
-
if (context.config.errorHandler) try {
|
|
322
|
-
if (context.config.errorHandler(err, instance, info) === true) return true;
|
|
323
|
-
} catch (handlerErr) {
|
|
324
|
-
console.error("Error in app.config.errorHandler:", handlerErr);
|
|
325
|
-
}
|
|
326
|
-
return false;
|
|
327
|
-
}
|
|
328
|
-
function handleHookError(context, err, instance, hookName) {
|
|
329
|
-
console.error(`Error in ${hookName} hook:`, err);
|
|
330
|
-
if (context.config.errorHandler) try {
|
|
331
|
-
context.config.errorHandler(err, instance, `plugin hook: ${hookName}`);
|
|
332
|
-
} catch {}
|
|
333
|
-
}
|
|
1
|
+
import { B as defineProvide, D as isModel, G as getComponentMeta, J as onMounted, K as getCurrentInstance, L as defineDirective, O as defineApp, R as isDirective, T as createModelFromBinding, U as useAppContext, W as component, X as onUpdated, Y as onUnmounted, _ as Text, b as jsxs, f as Suspense, g as Fragment, m as lazy, n as CLIENT_DIRECTIVES, p as isLazyComponent, q as onCreated, r as CLIENT_DIRECTIVE_PREFIX, v as jsx, w as createModel, x as isComponent, y as jsxDEV, z as defineInjectable } from "./renderer-KQIgreMb.js";
|
|
2
|
+
import { signal } from "@sigx/reactivity";
|
|
334
3
|
function compound(main, sub) {
|
|
335
4
|
return Object.assign(main, sub);
|
|
336
5
|
}
|
|
337
|
-
var MODEL_SYMBOL = Symbol.for("sigx.model");
|
|
338
|
-
function createModel(tuple, updateHandler) {
|
|
339
|
-
const [obj, key] = tuple;
|
|
340
|
-
return {
|
|
341
|
-
get value() {
|
|
342
|
-
return obj[key];
|
|
343
|
-
},
|
|
344
|
-
set value(v) {
|
|
345
|
-
updateHandler(v);
|
|
346
|
-
},
|
|
347
|
-
get binding() {
|
|
348
|
-
return [
|
|
349
|
-
obj,
|
|
350
|
-
key,
|
|
351
|
-
updateHandler
|
|
352
|
-
];
|
|
353
|
-
},
|
|
354
|
-
[MODEL_SYMBOL]: true
|
|
355
|
-
};
|
|
356
|
-
}
|
|
357
|
-
function createModelFromBinding(binding) {
|
|
358
|
-
const [obj, key, handler] = binding;
|
|
359
|
-
return createModel([obj, key], handler);
|
|
360
|
-
}
|
|
361
|
-
function isModel(value) {
|
|
362
|
-
return value !== null && typeof value === "object" && MODEL_SYMBOL in value && value[MODEL_SYMBOL] === true;
|
|
363
|
-
}
|
|
364
|
-
function getModelSymbol() {
|
|
365
|
-
return MODEL_SYMBOL;
|
|
366
|
-
}
|
|
367
|
-
function isComponent(type) {
|
|
368
|
-
return typeof type === "function" && "__setup" in type;
|
|
369
|
-
}
|
|
370
|
-
const Fragment = Symbol.for("sigx.Fragment");
|
|
371
|
-
const Text = Symbol.for("sigx.Text");
|
|
372
|
-
function normalizeChildren(children) {
|
|
373
|
-
if (children == null || children === false || children === true) return [];
|
|
374
|
-
if (isComputed(children)) return normalizeChildren(children.value);
|
|
375
|
-
if (Array.isArray(children)) return children.flatMap((c) => normalizeChildren(c));
|
|
376
|
-
if (typeof children === "string" || typeof children === "number") return [{
|
|
377
|
-
type: Text,
|
|
378
|
-
props: {},
|
|
379
|
-
key: null,
|
|
380
|
-
children: [],
|
|
381
|
-
dom: null,
|
|
382
|
-
text: children
|
|
383
|
-
}];
|
|
384
|
-
if (children.type) return [children];
|
|
385
|
-
return [];
|
|
386
|
-
}
|
|
387
|
-
function jsx(type, props, key) {
|
|
388
|
-
const processedProps = { ...props || {} };
|
|
389
|
-
const models = {};
|
|
390
|
-
const isComponentType = isComponent(type);
|
|
391
|
-
if (props) {
|
|
392
|
-
for (const propKey in props) if (propKey === "model") {
|
|
393
|
-
let modelBinding = props[propKey];
|
|
394
|
-
let tuple = null;
|
|
395
|
-
let updateHandler = null;
|
|
396
|
-
if (isModel(modelBinding)) {
|
|
397
|
-
const [obj, key, handler] = modelBinding.binding;
|
|
398
|
-
tuple = [obj, key];
|
|
399
|
-
updateHandler = handler;
|
|
400
|
-
} else if (typeof modelBinding === "function") {
|
|
401
|
-
const detected = detectAccess(modelBinding);
|
|
402
|
-
if (detected && typeof detected[1] === "string") tuple = detected;
|
|
403
|
-
} else if (Array.isArray(modelBinding) && modelBinding.length === 2 && typeof modelBinding[1] === "string") tuple = modelBinding;
|
|
404
|
-
if (tuple) {
|
|
405
|
-
const [stateObj, stateKey] = tuple;
|
|
406
|
-
let handled = false;
|
|
407
|
-
if (!updateHandler) {
|
|
408
|
-
const existingHandler = processedProps["onUpdate:modelValue"];
|
|
409
|
-
updateHandler = (v) => {
|
|
410
|
-
const customHandler = stateObj[`onUpdate:${stateKey}`];
|
|
411
|
-
if (typeof customHandler === "function") customHandler(v);
|
|
412
|
-
else stateObj[stateKey] = v;
|
|
413
|
-
if (existingHandler) existingHandler(v);
|
|
414
|
-
};
|
|
415
|
-
}
|
|
416
|
-
const platformProcessor = getPlatformModelProcessor();
|
|
417
|
-
if (typeof type === "string" && platformProcessor) handled = platformProcessor(type, processedProps, tuple, props);
|
|
418
|
-
if (isComponentType) {
|
|
419
|
-
models.model = createModel(tuple, updateHandler);
|
|
420
|
-
processedProps["onUpdate:modelValue"] = updateHandler;
|
|
421
|
-
} else if (!handled) {
|
|
422
|
-
processedProps.modelValue = stateObj[stateKey];
|
|
423
|
-
processedProps["onUpdate:modelValue"] = updateHandler;
|
|
424
|
-
}
|
|
425
|
-
delete processedProps.model;
|
|
426
|
-
}
|
|
427
|
-
} else if (propKey.startsWith("model:")) {
|
|
428
|
-
let modelBinding = props[propKey];
|
|
429
|
-
const name = propKey.slice(6);
|
|
430
|
-
let tuple = null;
|
|
431
|
-
let updateHandler = null;
|
|
432
|
-
if (isModel(modelBinding)) {
|
|
433
|
-
const [obj, key, handler] = modelBinding.binding;
|
|
434
|
-
tuple = [obj, key];
|
|
435
|
-
updateHandler = handler;
|
|
436
|
-
} else if (typeof modelBinding === "function") {
|
|
437
|
-
const detected = detectAccess(modelBinding);
|
|
438
|
-
if (detected && typeof detected[1] === "string") tuple = detected;
|
|
439
|
-
} else if (Array.isArray(modelBinding) && modelBinding.length === 2 && typeof modelBinding[1] === "string") tuple = modelBinding;
|
|
440
|
-
if (tuple) {
|
|
441
|
-
const [stateObj, stateKey] = tuple;
|
|
442
|
-
const eventName = `onUpdate:${name}`;
|
|
443
|
-
if (!updateHandler) {
|
|
444
|
-
const existingHandler = processedProps[eventName];
|
|
445
|
-
updateHandler = (v) => {
|
|
446
|
-
const customHandler = stateObj[`onUpdate:${stateKey}`];
|
|
447
|
-
if (typeof customHandler === "function") customHandler(v);
|
|
448
|
-
else stateObj[stateKey] = v;
|
|
449
|
-
if (existingHandler) existingHandler(v);
|
|
450
|
-
};
|
|
451
|
-
}
|
|
452
|
-
if (isComponentType) {
|
|
453
|
-
models[name] = createModel(tuple, updateHandler);
|
|
454
|
-
processedProps[eventName] = updateHandler;
|
|
455
|
-
} else {
|
|
456
|
-
processedProps[name] = stateObj[stateKey];
|
|
457
|
-
processedProps[eventName] = updateHandler;
|
|
458
|
-
}
|
|
459
|
-
delete processedProps[propKey];
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
if (Object.keys(models).length > 0) processedProps.$models = models;
|
|
464
|
-
if (isComponent(type)) {
|
|
465
|
-
const { children, ...rest } = processedProps;
|
|
466
|
-
return {
|
|
467
|
-
type,
|
|
468
|
-
props: {
|
|
469
|
-
...rest,
|
|
470
|
-
children
|
|
471
|
-
},
|
|
472
|
-
key: key || rest.key || null,
|
|
473
|
-
children: [],
|
|
474
|
-
dom: null
|
|
475
|
-
};
|
|
476
|
-
}
|
|
477
|
-
if (typeof type === "function" && type !== Fragment) return type(processedProps);
|
|
478
|
-
const { children, ...rest } = processedProps;
|
|
479
|
-
return {
|
|
480
|
-
type,
|
|
481
|
-
props: rest,
|
|
482
|
-
key: key || rest.key || null,
|
|
483
|
-
children: normalizeChildren(children),
|
|
484
|
-
dom: null
|
|
485
|
-
};
|
|
486
|
-
}
|
|
487
|
-
function jsxs(type, props, key) {
|
|
488
|
-
return jsx(type, props, key);
|
|
489
|
-
}
|
|
490
|
-
const jsxDEV = jsx;
|
|
491
|
-
var currentSuspenseBoundary = null;
|
|
492
|
-
function registerPendingPromise(promise) {
|
|
493
|
-
const boundary = getCurrentSuspenseBoundarySafe() ?? currentSuspenseBoundary;
|
|
494
|
-
if (boundary) {
|
|
495
|
-
boundary.pending.add(promise);
|
|
496
|
-
promise.finally(() => {
|
|
497
|
-
boundary.pending.delete(promise);
|
|
498
|
-
if (boundary.pending.size === 0) boundary.onResolve();
|
|
499
|
-
});
|
|
500
|
-
return true;
|
|
501
|
-
}
|
|
502
|
-
return false;
|
|
503
|
-
}
|
|
504
|
-
function lazy(loader) {
|
|
505
|
-
let Component = null;
|
|
506
|
-
let promise = null;
|
|
507
|
-
let error = null;
|
|
508
|
-
let state = "pending";
|
|
509
|
-
const LazyWrapper = component((ctx) => {
|
|
510
|
-
const loadState = ctx.signal({
|
|
511
|
-
state,
|
|
512
|
-
tick: 0
|
|
513
|
-
});
|
|
514
|
-
if (!promise) promise = loader().then((mod) => {
|
|
515
|
-
Component = "default" in mod ? mod.default : mod;
|
|
516
|
-
state = "resolved";
|
|
517
|
-
loadState.state = "resolved";
|
|
518
|
-
loadState.tick++;
|
|
519
|
-
return Component;
|
|
520
|
-
}).catch((err) => {
|
|
521
|
-
error = err instanceof Error ? err : new Error(String(err));
|
|
522
|
-
state = "rejected";
|
|
523
|
-
loadState.state = "rejected";
|
|
524
|
-
loadState.tick++;
|
|
525
|
-
throw error;
|
|
526
|
-
});
|
|
527
|
-
if (state === "resolved" && Component) return () => {
|
|
528
|
-
return jsx(Component, {});
|
|
529
|
-
};
|
|
530
|
-
if (state === "rejected" && error) throw error;
|
|
531
|
-
if (!registerPendingPromise(promise)) promise.catch(() => {});
|
|
532
|
-
return () => {
|
|
533
|
-
const currentState = loadState.state;
|
|
534
|
-
loadState.tick;
|
|
535
|
-
if (currentState === "resolved" && Component) return jsx(Component, {});
|
|
536
|
-
if (currentState === "rejected" && error) throw error;
|
|
537
|
-
return null;
|
|
538
|
-
};
|
|
539
|
-
}, { name: "LazyComponent" });
|
|
540
|
-
LazyWrapper.__lazy = true;
|
|
541
|
-
LazyWrapper.preload = () => {
|
|
542
|
-
if (!promise) promise = loader().then((mod) => {
|
|
543
|
-
Component = "default" in mod ? mod.default : mod;
|
|
544
|
-
state = "resolved";
|
|
545
|
-
return Component;
|
|
546
|
-
}).catch((err) => {
|
|
547
|
-
error = err instanceof Error ? err : new Error(String(err));
|
|
548
|
-
state = "rejected";
|
|
549
|
-
throw error;
|
|
550
|
-
});
|
|
551
|
-
return promise;
|
|
552
|
-
};
|
|
553
|
-
LazyWrapper.isLoaded = () => {
|
|
554
|
-
return state === "resolved";
|
|
555
|
-
};
|
|
556
|
-
return LazyWrapper;
|
|
557
|
-
}
|
|
558
|
-
const Suspense = component((ctx) => {
|
|
559
|
-
const { props, slots } = ctx;
|
|
560
|
-
const state = ctx.signal({
|
|
561
|
-
isReady: false,
|
|
562
|
-
pendingCount: 0
|
|
563
|
-
});
|
|
564
|
-
const boundary = {
|
|
565
|
-
pending: /* @__PURE__ */ new Set(),
|
|
566
|
-
onResolve: () => {
|
|
567
|
-
state.pendingCount = boundary.pending.size;
|
|
568
|
-
if (boundary.pending.size === 0) state.isReady = true;
|
|
569
|
-
}
|
|
570
|
-
};
|
|
571
|
-
ctx.onMounted(() => {
|
|
572
|
-
if (boundary.pending.size === 0) state.isReady = true;
|
|
573
|
-
});
|
|
574
|
-
return () => {
|
|
575
|
-
state.isReady;
|
|
576
|
-
state.pendingCount;
|
|
577
|
-
const prevBoundary = getCurrentSuspenseBoundarySafe() ?? currentSuspenseBoundary;
|
|
578
|
-
currentSuspenseBoundary = boundary;
|
|
579
|
-
setCurrentSuspenseBoundarySafe(boundary);
|
|
580
|
-
try {
|
|
581
|
-
const children = slots.default();
|
|
582
|
-
if (boundary.pending.size > 0) {
|
|
583
|
-
const fallback = props.fallback;
|
|
584
|
-
if (typeof fallback === "function") return fallback();
|
|
585
|
-
return fallback ?? null;
|
|
586
|
-
}
|
|
587
|
-
if (Array.isArray(children)) {
|
|
588
|
-
const filtered = children.filter((c) => c != null && c !== false && c !== true);
|
|
589
|
-
if (filtered.length === 0) return null;
|
|
590
|
-
if (filtered.length === 1) return filtered[0];
|
|
591
|
-
return filtered;
|
|
592
|
-
}
|
|
593
|
-
return children;
|
|
594
|
-
} catch (err) {
|
|
595
|
-
if (err instanceof Promise) {
|
|
596
|
-
registerPendingPromise(err);
|
|
597
|
-
const fallback = props.fallback;
|
|
598
|
-
if (typeof fallback === "function") return fallback();
|
|
599
|
-
return fallback ?? null;
|
|
600
|
-
}
|
|
601
|
-
throw err;
|
|
602
|
-
} finally {
|
|
603
|
-
currentSuspenseBoundary = prevBoundary;
|
|
604
|
-
setCurrentSuspenseBoundarySafe(prevBoundary);
|
|
605
|
-
}
|
|
606
|
-
};
|
|
607
|
-
}, { name: "Suspense" });
|
|
608
|
-
function isLazyComponent(component) {
|
|
609
|
-
return component && component.__lazy === true;
|
|
610
|
-
}
|
|
611
6
|
const ErrorBoundary = component((ctx) => {
|
|
612
7
|
const { fallback } = ctx.props;
|
|
613
8
|
const { slots } = ctx;
|
|
@@ -647,102 +42,6 @@ function guid$1() {
|
|
|
647
42
|
return (c == "x" ? r : r & 3 | 8).toString(16);
|
|
648
43
|
});
|
|
649
44
|
}
|
|
650
|
-
function createPropsAccessor(reactiveProps) {
|
|
651
|
-
return new Proxy(reactiveProps, {
|
|
652
|
-
get(target, key) {
|
|
653
|
-
if (typeof key === "symbol") return void 0;
|
|
654
|
-
return target[key];
|
|
655
|
-
},
|
|
656
|
-
has(target, key) {
|
|
657
|
-
if (typeof key === "symbol") return false;
|
|
658
|
-
return key in target;
|
|
659
|
-
},
|
|
660
|
-
ownKeys(target) {
|
|
661
|
-
return Object.keys(target);
|
|
662
|
-
},
|
|
663
|
-
getOwnPropertyDescriptor(target, key) {
|
|
664
|
-
if (typeof key === "symbol") return void 0;
|
|
665
|
-
if (key in target) return {
|
|
666
|
-
enumerable: true,
|
|
667
|
-
configurable: true,
|
|
668
|
-
writable: false
|
|
669
|
-
};
|
|
670
|
-
}
|
|
671
|
-
});
|
|
672
|
-
}
|
|
673
|
-
function createSlots(children, slotsFromProps) {
|
|
674
|
-
const versionSignal = signal$1({ v: 0 });
|
|
675
|
-
function extractNamedSlotsFromChildren(c) {
|
|
676
|
-
const defaultChildren = [];
|
|
677
|
-
const namedSlots = {};
|
|
678
|
-
if (c == null) return {
|
|
679
|
-
defaultChildren,
|
|
680
|
-
namedSlots
|
|
681
|
-
};
|
|
682
|
-
const items = Array.isArray(c) ? c : [c];
|
|
683
|
-
for (const child of items) if (child && typeof child === "object" && child.props && child.props.slot) {
|
|
684
|
-
const slotName = child.props.slot;
|
|
685
|
-
if (!namedSlots[slotName]) namedSlots[slotName] = [];
|
|
686
|
-
namedSlots[slotName].push(child);
|
|
687
|
-
} else defaultChildren.push(child);
|
|
688
|
-
return {
|
|
689
|
-
defaultChildren,
|
|
690
|
-
namedSlots
|
|
691
|
-
};
|
|
692
|
-
}
|
|
693
|
-
const slotsObj = {
|
|
694
|
-
_children: children,
|
|
695
|
-
_slotsFromProps: slotsFromProps || {},
|
|
696
|
-
_version: versionSignal,
|
|
697
|
-
_isPatching: false,
|
|
698
|
-
default: function() {
|
|
699
|
-
this._version.v;
|
|
700
|
-
const c = this._children;
|
|
701
|
-
const { defaultChildren } = extractNamedSlotsFromChildren(c);
|
|
702
|
-
return defaultChildren.filter((child) => child != null && child !== false && child !== true);
|
|
703
|
-
}
|
|
704
|
-
};
|
|
705
|
-
return new Proxy(slotsObj, { get(target, prop) {
|
|
706
|
-
if (prop in target) return target[prop];
|
|
707
|
-
if (typeof prop === "string") return function(scopedProps) {
|
|
708
|
-
target._version.v;
|
|
709
|
-
if (target._slotsFromProps && typeof target._slotsFromProps[prop] === "function") {
|
|
710
|
-
const result = target._slotsFromProps[prop](scopedProps);
|
|
711
|
-
if (result == null) return [];
|
|
712
|
-
return Array.isArray(result) ? result : [result];
|
|
713
|
-
}
|
|
714
|
-
const { namedSlots } = extractNamedSlotsFromChildren(target._children);
|
|
715
|
-
return namedSlots[prop] || [];
|
|
716
|
-
};
|
|
717
|
-
} });
|
|
718
|
-
}
|
|
719
|
-
function normalizeSubTree(result) {
|
|
720
|
-
if (result == null || result === false || result === true) return {
|
|
721
|
-
type: Text,
|
|
722
|
-
props: {},
|
|
723
|
-
key: null,
|
|
724
|
-
children: [],
|
|
725
|
-
dom: null,
|
|
726
|
-
text: ""
|
|
727
|
-
};
|
|
728
|
-
if (isComputed(result)) return normalizeSubTree(result.value);
|
|
729
|
-
if (Array.isArray(result)) return {
|
|
730
|
-
type: Fragment,
|
|
731
|
-
props: {},
|
|
732
|
-
key: null,
|
|
733
|
-
children: result,
|
|
734
|
-
dom: null
|
|
735
|
-
};
|
|
736
|
-
if (typeof result === "string" || typeof result === "number") return {
|
|
737
|
-
type: Text,
|
|
738
|
-
props: {},
|
|
739
|
-
key: null,
|
|
740
|
-
children: [],
|
|
741
|
-
dom: null,
|
|
742
|
-
text: result
|
|
743
|
-
};
|
|
744
|
-
return result;
|
|
745
|
-
}
|
|
746
45
|
const guid = guid$1;
|
|
747
46
|
let InstanceLifetimes = /* @__PURE__ */ function(InstanceLifetimes) {
|
|
748
47
|
InstanceLifetimes[InstanceLifetimes["Transient"] = 0] = "Transient";
|
|
@@ -750,10 +49,7 @@ let InstanceLifetimes = /* @__PURE__ */ function(InstanceLifetimes) {
|
|
|
750
49
|
InstanceLifetimes[InstanceLifetimes["Singleton"] = 2] = "Singleton";
|
|
751
50
|
return InstanceLifetimes;
|
|
752
51
|
}({});
|
|
753
|
-
function
|
|
754
|
-
return obj;
|
|
755
|
-
}
|
|
756
|
-
function createTopic(options) {
|
|
52
|
+
function createTopic(_options) {
|
|
757
53
|
let subscribers = [];
|
|
758
54
|
const publish = (data) => {
|
|
759
55
|
subscribers.forEach((s) => s(data));
|
|
@@ -766,7 +62,7 @@ function createTopic(options) {
|
|
|
766
62
|
};
|
|
767
63
|
try {
|
|
768
64
|
onUnmounted(unsubscribe);
|
|
769
|
-
} catch
|
|
65
|
+
} catch {}
|
|
770
66
|
return { unsubscribe };
|
|
771
67
|
};
|
|
772
68
|
const destroy = () => {
|
|
@@ -793,7 +89,7 @@ var SubscriptionHandler = class {
|
|
|
793
89
|
this.unsubs = [];
|
|
794
90
|
}
|
|
795
91
|
};
|
|
796
|
-
function defineFactory(setup,
|
|
92
|
+
function defineFactory(setup, _lifetime, _typeIdentifier) {
|
|
797
93
|
const factoryCreator = (...args) => {
|
|
798
94
|
const subscriptions = new SubscriptionHandler();
|
|
799
95
|
const deactivations = /* @__PURE__ */ new Set();
|
|
@@ -811,7 +107,7 @@ function defineFactory(setup, lifetime, typeIdentifier) {
|
|
|
811
107
|
if (customDispose) customDispose(dispose);
|
|
812
108
|
else try {
|
|
813
109
|
onUnmounted(() => dispose());
|
|
814
|
-
} catch
|
|
110
|
+
} catch {}
|
|
815
111
|
return {
|
|
816
112
|
...result,
|
|
817
113
|
dispose
|
|
@@ -820,534 +116,6 @@ function defineFactory(setup, lifetime, typeIdentifier) {
|
|
|
820
116
|
if (setup.length <= 1) return defineInjectable(() => factoryCreator());
|
|
821
117
|
return factoryCreator;
|
|
822
118
|
}
|
|
823
|
-
|
|
824
|
-
const CLIENT_DIRECTIVES = [
|
|
825
|
-
"client:load",
|
|
826
|
-
"client:idle",
|
|
827
|
-
"client:visible",
|
|
828
|
-
"client:media",
|
|
829
|
-
"client:only"
|
|
830
|
-
];
|
|
831
|
-
function filterClientDirectives(props) {
|
|
832
|
-
const filtered = {};
|
|
833
|
-
for (const key in props) if (!key.startsWith("client:")) filtered[key] = props[key];
|
|
834
|
-
return filtered;
|
|
835
|
-
}
|
|
836
|
-
function getHydrationDirective(props) {
|
|
837
|
-
if (props["client:load"] !== void 0) return { strategy: "load" };
|
|
838
|
-
if (props["client:idle"] !== void 0) return { strategy: "idle" };
|
|
839
|
-
if (props["client:visible"] !== void 0) return { strategy: "visible" };
|
|
840
|
-
if (props["client:only"] !== void 0) return { strategy: "only" };
|
|
841
|
-
if (props["client:media"] !== void 0) return {
|
|
842
|
-
strategy: "media",
|
|
843
|
-
media: props["client:media"]
|
|
844
|
-
};
|
|
845
|
-
return null;
|
|
846
|
-
}
|
|
847
|
-
function hasClientDirective(props) {
|
|
848
|
-
for (const key in props) if (key.startsWith("client:")) return true;
|
|
849
|
-
return false;
|
|
850
|
-
}
|
|
851
|
-
function serializeProps(props) {
|
|
852
|
-
const filtered = filterClientDirectives(props);
|
|
853
|
-
const result = {};
|
|
854
|
-
let hasProps = false;
|
|
855
|
-
for (const key in filtered) {
|
|
856
|
-
const value = filtered[key];
|
|
857
|
-
if (key === "children" || key === "key" || key === "ref" || key === "slots") continue;
|
|
858
|
-
if (typeof value === "function") continue;
|
|
859
|
-
if (typeof value === "symbol") continue;
|
|
860
|
-
if (value === void 0) continue;
|
|
861
|
-
if (key.startsWith("on") && key.length > 2 && key[2] === key[2].toUpperCase()) continue;
|
|
862
|
-
try {
|
|
863
|
-
JSON.stringify(value);
|
|
864
|
-
result[key] = value;
|
|
865
|
-
hasProps = true;
|
|
866
|
-
} catch {}
|
|
867
|
-
}
|
|
868
|
-
return hasProps ? result : void 0;
|
|
869
|
-
}
|
|
870
|
-
function createEmit(reactiveProps) {
|
|
871
|
-
return (event, ...args) => {
|
|
872
|
-
const eventName = `on${event[0].toUpperCase() + event.slice(1)}`;
|
|
873
|
-
const handler = ("value" in reactiveProps ? reactiveProps.value : reactiveProps)?.[eventName];
|
|
874
|
-
if (handler && typeof handler === "function") handler(...args);
|
|
875
|
-
};
|
|
876
|
-
}
|
|
877
|
-
function createRenderer(options) {
|
|
878
|
-
const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, cloneNode: hostCloneNode, insertStaticContent: hostInsertStaticContent, patchDirective: hostPatchDirective, onElementMounted: hostOnElementMounted, onElementUnmounted: hostOnElementUnmounted } = options;
|
|
879
|
-
let currentAppContext = null;
|
|
880
|
-
function render(element, container, appContext) {
|
|
881
|
-
if (appContext) currentAppContext = appContext;
|
|
882
|
-
const oldVNode = container._vnode;
|
|
883
|
-
let vnode = null;
|
|
884
|
-
if (element != null && element !== false && element !== true) if (typeof element === "string" || typeof element === "number") vnode = {
|
|
885
|
-
type: Text,
|
|
886
|
-
props: {},
|
|
887
|
-
key: null,
|
|
888
|
-
children: [],
|
|
889
|
-
dom: null,
|
|
890
|
-
text: element
|
|
891
|
-
};
|
|
892
|
-
else if (isComponent(element)) vnode = {
|
|
893
|
-
type: element,
|
|
894
|
-
props: {},
|
|
895
|
-
key: null,
|
|
896
|
-
children: [],
|
|
897
|
-
dom: null
|
|
898
|
-
};
|
|
899
|
-
else vnode = element;
|
|
900
|
-
if (vnode) {
|
|
901
|
-
if (oldVNode) patch(oldVNode, vnode, container);
|
|
902
|
-
else mount(vnode, container);
|
|
903
|
-
container._vnode = vnode;
|
|
904
|
-
} else if (oldVNode) {
|
|
905
|
-
unmount(oldVNode, container);
|
|
906
|
-
container._vnode = null;
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
const svgTags = new Set([
|
|
910
|
-
"svg",
|
|
911
|
-
"animate",
|
|
912
|
-
"animateMotion",
|
|
913
|
-
"animateTransform",
|
|
914
|
-
"circle",
|
|
915
|
-
"clipPath",
|
|
916
|
-
"defs",
|
|
917
|
-
"desc",
|
|
918
|
-
"ellipse",
|
|
919
|
-
"feBlend",
|
|
920
|
-
"feColorMatrix",
|
|
921
|
-
"feComponentTransfer",
|
|
922
|
-
"feComposite",
|
|
923
|
-
"feConvolveMatrix",
|
|
924
|
-
"feDiffuseLighting",
|
|
925
|
-
"feDisplacementMap",
|
|
926
|
-
"feDistantLight",
|
|
927
|
-
"feDropShadow",
|
|
928
|
-
"feFlood",
|
|
929
|
-
"feFuncA",
|
|
930
|
-
"feFuncB",
|
|
931
|
-
"feFuncG",
|
|
932
|
-
"feFuncR",
|
|
933
|
-
"feGaussianBlur",
|
|
934
|
-
"feImage",
|
|
935
|
-
"feMerge",
|
|
936
|
-
"feMergeNode",
|
|
937
|
-
"feMorphology",
|
|
938
|
-
"feOffset",
|
|
939
|
-
"fePointLight",
|
|
940
|
-
"feSpecularLighting",
|
|
941
|
-
"feSpotLight",
|
|
942
|
-
"feTile",
|
|
943
|
-
"feTurbulence",
|
|
944
|
-
"filter",
|
|
945
|
-
"foreignObject",
|
|
946
|
-
"g",
|
|
947
|
-
"image",
|
|
948
|
-
"line",
|
|
949
|
-
"linearGradient",
|
|
950
|
-
"marker",
|
|
951
|
-
"mask",
|
|
952
|
-
"metadata",
|
|
953
|
-
"mpath",
|
|
954
|
-
"path",
|
|
955
|
-
"pattern",
|
|
956
|
-
"polygon",
|
|
957
|
-
"polyline",
|
|
958
|
-
"radialGradient",
|
|
959
|
-
"rect",
|
|
960
|
-
"set",
|
|
961
|
-
"stop",
|
|
962
|
-
"switch",
|
|
963
|
-
"symbol",
|
|
964
|
-
"text",
|
|
965
|
-
"textPath",
|
|
966
|
-
"title",
|
|
967
|
-
"tspan",
|
|
968
|
-
"use",
|
|
969
|
-
"view"
|
|
970
|
-
]);
|
|
971
|
-
function isSvgTag(tag) {
|
|
972
|
-
return svgTags.has(tag);
|
|
973
|
-
}
|
|
974
|
-
function mount(vnode, container, before = null, parentIsSVG = false) {
|
|
975
|
-
if (vnode == null || vnode === false || vnode === true) return;
|
|
976
|
-
if (vnode.type === Text) {
|
|
977
|
-
const node = hostCreateText(String(vnode.text));
|
|
978
|
-
vnode.dom = node;
|
|
979
|
-
node.__vnode = vnode;
|
|
980
|
-
hostInsert(node, container, before);
|
|
981
|
-
return;
|
|
982
|
-
}
|
|
983
|
-
if (vnode.type === Fragment) {
|
|
984
|
-
const anchor = hostCreateComment("");
|
|
985
|
-
vnode.dom = anchor;
|
|
986
|
-
hostInsert(anchor, container, before);
|
|
987
|
-
if (vnode.children) vnode.children.forEach((child) => mount(child, container, anchor, parentIsSVG));
|
|
988
|
-
return;
|
|
989
|
-
}
|
|
990
|
-
if (isComponent(vnode.type)) {
|
|
991
|
-
mountComponent(vnode, container, before, vnode.type.__setup);
|
|
992
|
-
return;
|
|
993
|
-
}
|
|
994
|
-
const tag = vnode.type;
|
|
995
|
-
const isSVG = tag === "svg" || parentIsSVG && tag !== "foreignObject";
|
|
996
|
-
const element = hostCreateElement(tag, isSVG);
|
|
997
|
-
vnode.dom = element;
|
|
998
|
-
element.__vnode = vnode;
|
|
999
|
-
if (vnode.props) {
|
|
1000
|
-
for (const key in vnode.props) if (key !== "children" && key !== "key" && key !== "ref") if (key.charCodeAt(0) === 117 && key.startsWith("use:")) {
|
|
1001
|
-
if (hostPatchDirective) hostPatchDirective(element, key.slice(4), null, vnode.props[key], currentAppContext);
|
|
1002
|
-
} else hostPatchProp(element, key, null, vnode.props[key], isSVG);
|
|
1003
|
-
if (vnode.props.ref) untrack(() => {
|
|
1004
|
-
if (typeof vnode.props.ref === "function") vnode.props.ref(element);
|
|
1005
|
-
else if (typeof vnode.props.ref === "object") vnode.props.ref.current = element;
|
|
1006
|
-
});
|
|
1007
|
-
}
|
|
1008
|
-
const childIsSVG = isSVG && tag !== "foreignObject";
|
|
1009
|
-
if (vnode.children) vnode.children.forEach((child) => {
|
|
1010
|
-
child.parent = vnode;
|
|
1011
|
-
mount(child, element, null, childIsSVG);
|
|
1012
|
-
});
|
|
1013
|
-
hostInsert(element, container, before);
|
|
1014
|
-
if (hostOnElementMounted) hostOnElementMounted(element);
|
|
1015
|
-
}
|
|
1016
|
-
function unmount(vnode, container) {
|
|
1017
|
-
const internalVNode = vnode;
|
|
1018
|
-
if (internalVNode._effect) internalVNode._effect.stop();
|
|
1019
|
-
if (vnode.cleanup) vnode.cleanup();
|
|
1020
|
-
if (isComponent(vnode.type)) {
|
|
1021
|
-
const subTree = internalVNode._subTree;
|
|
1022
|
-
if (subTree) unmount(subTree, container);
|
|
1023
|
-
if (vnode.dom) hostRemove(vnode.dom);
|
|
1024
|
-
if (vnode.props?.ref) untrack(() => {
|
|
1025
|
-
if (typeof vnode.props.ref === "function") vnode.props.ref(null);
|
|
1026
|
-
else if (typeof vnode.props.ref === "object") vnode.props.ref.current = null;
|
|
1027
|
-
});
|
|
1028
|
-
return;
|
|
1029
|
-
}
|
|
1030
|
-
if (vnode.type === Fragment) {
|
|
1031
|
-
if (vnode.children) vnode.children.forEach((child) => unmount(child, container));
|
|
1032
|
-
if (vnode.dom) hostRemove(vnode.dom);
|
|
1033
|
-
return;
|
|
1034
|
-
}
|
|
1035
|
-
if (vnode.props?.ref) untrack(() => {
|
|
1036
|
-
if (typeof vnode.props.ref === "function") vnode.props.ref(null);
|
|
1037
|
-
else if (vnode.props.ref && typeof vnode.props.ref === "object") vnode.props.ref.current = null;
|
|
1038
|
-
});
|
|
1039
|
-
if (hostOnElementUnmounted && vnode.dom) hostOnElementUnmounted(vnode.dom);
|
|
1040
|
-
if (vnode.children && vnode.children.length > 0) vnode.children.forEach((child) => unmount(child, vnode.dom));
|
|
1041
|
-
if (vnode.dom) hostRemove(vnode.dom);
|
|
1042
|
-
}
|
|
1043
|
-
function patch(oldVNode, newVNode, container) {
|
|
1044
|
-
if (oldVNode === newVNode) return;
|
|
1045
|
-
if (!isSameVNode(oldVNode, newVNode)) {
|
|
1046
|
-
const parent = hostParentNode(oldVNode.dom) || container;
|
|
1047
|
-
const nextSibling = oldVNode.dom ? hostNextSibling(oldVNode.dom) : null;
|
|
1048
|
-
unmount(oldVNode, parent);
|
|
1049
|
-
mount(newVNode, parent, nextSibling);
|
|
1050
|
-
return;
|
|
1051
|
-
}
|
|
1052
|
-
const oldInternal = oldVNode;
|
|
1053
|
-
const newInternal = newVNode;
|
|
1054
|
-
if (oldInternal._effect) {
|
|
1055
|
-
newVNode.dom = oldVNode.dom;
|
|
1056
|
-
newInternal._effect = oldInternal._effect;
|
|
1057
|
-
newInternal._subTree = oldInternal._subTree;
|
|
1058
|
-
newInternal._slots = oldInternal._slots;
|
|
1059
|
-
const props = oldInternal._componentProps;
|
|
1060
|
-
newInternal._componentProps = props;
|
|
1061
|
-
if (props) {
|
|
1062
|
-
const newProps = newVNode.props || {};
|
|
1063
|
-
const newModels = newVNode.props?.$models || {};
|
|
1064
|
-
untrack(() => {
|
|
1065
|
-
for (const key in newProps) if (key !== "children" && key !== "key" && key !== "ref" && key !== "$models") {
|
|
1066
|
-
if (props[key] !== newProps[key]) props[key] = newProps[key];
|
|
1067
|
-
}
|
|
1068
|
-
for (const modelKey in newModels) {
|
|
1069
|
-
const newModel = newModels[modelKey];
|
|
1070
|
-
const oldModel = props[modelKey];
|
|
1071
|
-
if (isModel(newModel)) {
|
|
1072
|
-
if (isModel(oldModel)) {
|
|
1073
|
-
const [newObj, newKey] = newModel.binding;
|
|
1074
|
-
const [oldObj, oldKey] = oldModel.binding;
|
|
1075
|
-
if (newObj === oldObj && newKey === oldKey) continue;
|
|
1076
|
-
}
|
|
1077
|
-
props[modelKey] = newModel;
|
|
1078
|
-
}
|
|
1079
|
-
}
|
|
1080
|
-
for (const key in props) if (!(key in newProps) && !(key in newModels) && key !== "children" && key !== "key" && key !== "ref" && key !== "$models") delete props[key];
|
|
1081
|
-
});
|
|
1082
|
-
}
|
|
1083
|
-
const slotsRef = oldInternal._slots;
|
|
1084
|
-
const newChildren = newVNode.props?.children;
|
|
1085
|
-
const newSlotsFromProps = newVNode.props?.slots;
|
|
1086
|
-
if (slotsRef) {
|
|
1087
|
-
if (newChildren !== void 0) slotsRef._children = newChildren;
|
|
1088
|
-
if (newSlotsFromProps !== void 0) slotsRef._slotsFromProps = newSlotsFromProps;
|
|
1089
|
-
if (!slotsRef._isPatching) {
|
|
1090
|
-
slotsRef._isPatching = true;
|
|
1091
|
-
try {
|
|
1092
|
-
untrack(() => {
|
|
1093
|
-
slotsRef._version.v++;
|
|
1094
|
-
});
|
|
1095
|
-
} finally {
|
|
1096
|
-
slotsRef._isPatching = false;
|
|
1097
|
-
}
|
|
1098
|
-
}
|
|
1099
|
-
}
|
|
1100
|
-
return;
|
|
1101
|
-
}
|
|
1102
|
-
if (newVNode.type === Text) {
|
|
1103
|
-
newVNode.dom = oldVNode.dom;
|
|
1104
|
-
if (!newVNode.dom) {
|
|
1105
|
-
const textNode = hostCreateText(String(newVNode.text));
|
|
1106
|
-
newVNode.dom = textNode;
|
|
1107
|
-
if (container) hostInsert(textNode, container, oldVNode.dom || null);
|
|
1108
|
-
return;
|
|
1109
|
-
}
|
|
1110
|
-
if (oldVNode.text !== newVNode.text) hostSetText(newVNode.dom, String(newVNode.text));
|
|
1111
|
-
return;
|
|
1112
|
-
}
|
|
1113
|
-
if (newVNode.type === Fragment) {
|
|
1114
|
-
patchChildren(oldVNode, newVNode, container, false);
|
|
1115
|
-
return;
|
|
1116
|
-
}
|
|
1117
|
-
const element = newVNode.dom = oldVNode.dom;
|
|
1118
|
-
if (!element) {
|
|
1119
|
-
mount(newVNode, container);
|
|
1120
|
-
return;
|
|
1121
|
-
}
|
|
1122
|
-
const tag = newVNode.type;
|
|
1123
|
-
const isSVG = tag === "svg" || isSvgTag(tag);
|
|
1124
|
-
const oldProps = oldVNode.props || {};
|
|
1125
|
-
const newProps = newVNode.props || {};
|
|
1126
|
-
for (const key in oldProps) if (!(key in newProps) && key !== "children" && key !== "key" && key !== "ref") if (key.charCodeAt(0) === 117 && key.startsWith("use:")) {
|
|
1127
|
-
if (hostPatchDirective) hostPatchDirective(element, key.slice(4), oldProps[key], null, currentAppContext);
|
|
1128
|
-
} else hostPatchProp(element, key, oldProps[key], null, isSVG);
|
|
1129
|
-
for (const key in newProps) {
|
|
1130
|
-
const oldValue = oldProps[key];
|
|
1131
|
-
const newValue = newProps[key];
|
|
1132
|
-
if (key !== "children" && key !== "key" && key !== "ref" && oldValue !== newValue) if (key.charCodeAt(0) === 117 && key.startsWith("use:")) {
|
|
1133
|
-
if (hostPatchDirective) hostPatchDirective(element, key.slice(4), oldValue, newValue, currentAppContext);
|
|
1134
|
-
} else hostPatchProp(element, key, oldValue, newValue, isSVG);
|
|
1135
|
-
}
|
|
1136
|
-
patchChildren(oldVNode, newVNode, element, isSVG && tag !== "foreignObject");
|
|
1137
|
-
}
|
|
1138
|
-
function patchChildren(oldVNode, newVNode, container, parentIsSVG = false) {
|
|
1139
|
-
const oldChildren = oldVNode.children;
|
|
1140
|
-
const newChildren = newVNode.children;
|
|
1141
|
-
newChildren.forEach((c) => c.parent = newVNode);
|
|
1142
|
-
reconcileChildrenArray(container, oldChildren, newChildren, parentIsSVG);
|
|
1143
|
-
}
|
|
1144
|
-
function checkDuplicateKeys(children) {
|
|
1145
|
-
if (process.env.NODE_ENV === "production") return;
|
|
1146
|
-
const seenKeys = /* @__PURE__ */ new Set();
|
|
1147
|
-
for (const child of children) if (child?.key != null) {
|
|
1148
|
-
const keyStr = String(child.key);
|
|
1149
|
-
if (seenKeys.has(keyStr)) console.warn(`[SignalX] Duplicate key "${child.key}" detected in list. Keys should be unique among siblings to ensure correct reconciliation. This may cause unexpected behavior when items are reordered, added, or removed.`);
|
|
1150
|
-
seenKeys.add(keyStr);
|
|
1151
|
-
}
|
|
1152
|
-
}
|
|
1153
|
-
function reconcileChildrenArray(parent, oldChildren, newChildren, parentIsSVG = false) {
|
|
1154
|
-
if (process.env.NODE_ENV !== "production") checkDuplicateKeys(newChildren);
|
|
1155
|
-
let oldStartIdx = 0;
|
|
1156
|
-
let oldEndIdx = oldChildren.length - 1;
|
|
1157
|
-
let oldStartVNode = oldChildren[0];
|
|
1158
|
-
let oldEndVNode = oldChildren[oldEndIdx];
|
|
1159
|
-
let newStartIdx = 0;
|
|
1160
|
-
let newEndIdx = newChildren.length - 1;
|
|
1161
|
-
let newStartVNode = newChildren[0];
|
|
1162
|
-
let newEndVNode = newChildren[newEndIdx];
|
|
1163
|
-
let oldKeyToIdx;
|
|
1164
|
-
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) if (oldStartVNode == null) oldStartVNode = oldChildren[++oldStartIdx];
|
|
1165
|
-
else if (oldEndVNode == null) oldEndVNode = oldChildren[--oldEndIdx];
|
|
1166
|
-
else if (isSameVNode(oldStartVNode, newStartVNode)) {
|
|
1167
|
-
patch(oldStartVNode, newStartVNode, parent);
|
|
1168
|
-
oldStartVNode = oldChildren[++oldStartIdx];
|
|
1169
|
-
newStartVNode = newChildren[++newStartIdx];
|
|
1170
|
-
} else if (isSameVNode(oldEndVNode, newEndVNode)) {
|
|
1171
|
-
patch(oldEndVNode, newEndVNode, parent);
|
|
1172
|
-
oldEndVNode = oldChildren[--oldEndIdx];
|
|
1173
|
-
newEndVNode = newChildren[--newEndIdx];
|
|
1174
|
-
} else if (isSameVNode(oldStartVNode, newEndVNode)) {
|
|
1175
|
-
patch(oldStartVNode, newEndVNode, parent);
|
|
1176
|
-
const nodeToMove = oldStartVNode.dom;
|
|
1177
|
-
const anchor = hostNextSibling(oldEndVNode.dom);
|
|
1178
|
-
if (nodeToMove) hostInsert(nodeToMove, parent, anchor);
|
|
1179
|
-
oldStartVNode = oldChildren[++oldStartIdx];
|
|
1180
|
-
newEndVNode = newChildren[--newEndIdx];
|
|
1181
|
-
} else if (isSameVNode(oldEndVNode, newStartVNode)) {
|
|
1182
|
-
patch(oldEndVNode, newStartVNode, parent);
|
|
1183
|
-
const nodeToMove = oldEndVNode.dom;
|
|
1184
|
-
const anchor = oldStartVNode.dom;
|
|
1185
|
-
if (nodeToMove) hostInsert(nodeToMove, parent, anchor);
|
|
1186
|
-
oldEndVNode = oldChildren[--oldEndIdx];
|
|
1187
|
-
newStartVNode = newChildren[++newStartIdx];
|
|
1188
|
-
} else {
|
|
1189
|
-
if (!oldKeyToIdx) oldKeyToIdx = createKeyToKeyIndexMap(oldChildren, oldStartIdx, oldEndIdx);
|
|
1190
|
-
const idxInOld = newStartVNode.key != null ? oldKeyToIdx.get(String(newStartVNode.key)) : findIndexInOld(oldChildren, newStartVNode, oldStartIdx, oldEndIdx);
|
|
1191
|
-
if (idxInOld != null) {
|
|
1192
|
-
const vnodeToMove = oldChildren[idxInOld];
|
|
1193
|
-
patch(vnodeToMove, newStartVNode, parent);
|
|
1194
|
-
oldChildren[idxInOld] = void 0;
|
|
1195
|
-
if (vnodeToMove.dom && oldStartVNode.dom) hostInsert(vnodeToMove.dom, parent, oldStartVNode.dom);
|
|
1196
|
-
} else mount(newStartVNode, parent, oldStartVNode.dom, parentIsSVG);
|
|
1197
|
-
newStartVNode = newChildren[++newStartIdx];
|
|
1198
|
-
}
|
|
1199
|
-
if (oldStartIdx > oldEndIdx) {
|
|
1200
|
-
if (newStartIdx <= newEndIdx) {
|
|
1201
|
-
const anchor = newChildren[newEndIdx + 1] == null ? null : newChildren[newEndIdx + 1].dom;
|
|
1202
|
-
for (let i = newStartIdx; i <= newEndIdx; i++) mount(newChildren[i], parent, anchor, parentIsSVG);
|
|
1203
|
-
}
|
|
1204
|
-
} else if (newStartIdx > newEndIdx) {
|
|
1205
|
-
for (let i = oldStartIdx; i <= oldEndIdx; i++) if (oldChildren[i]) unmount(oldChildren[i], parent);
|
|
1206
|
-
}
|
|
1207
|
-
}
|
|
1208
|
-
function isSameVNode(n1, n2) {
|
|
1209
|
-
const k1 = n1.key == null ? null : n1.key;
|
|
1210
|
-
const k2 = n2.key == null ? null : n2.key;
|
|
1211
|
-
if (n1.type !== n2.type) return false;
|
|
1212
|
-
if (k1 === k2) return true;
|
|
1213
|
-
return String(k1) === String(k2);
|
|
1214
|
-
}
|
|
1215
|
-
function createKeyToKeyIndexMap(children, beginIdx, endIdx) {
|
|
1216
|
-
const map = /* @__PURE__ */ new Map();
|
|
1217
|
-
for (let i = beginIdx; i <= endIdx; i++) {
|
|
1218
|
-
const key = children[i]?.key;
|
|
1219
|
-
if (key != null) {
|
|
1220
|
-
const keyStr = String(key);
|
|
1221
|
-
if (process.env.NODE_ENV !== "production" && map.has(keyStr)) console.warn(`[SignalX] Duplicate key "${key}" detected in list. Keys should be unique among siblings to ensure correct reconciliation. This may cause unexpected behavior when items are reordered, added, or removed.`);
|
|
1222
|
-
map.set(keyStr, i);
|
|
1223
|
-
}
|
|
1224
|
-
}
|
|
1225
|
-
return map;
|
|
1226
|
-
}
|
|
1227
|
-
function findIndexInOld(children, newChild, beginIdx, endIdx) {
|
|
1228
|
-
for (let i = beginIdx; i <= endIdx; i++) if (children[i] && isSameVNode(children[i], newChild)) return i;
|
|
1229
|
-
return null;
|
|
1230
|
-
}
|
|
1231
|
-
function mountComponent(vnode, container, before, setup) {
|
|
1232
|
-
const anchor = hostCreateComment("");
|
|
1233
|
-
vnode.dom = anchor;
|
|
1234
|
-
anchor.__vnode = vnode;
|
|
1235
|
-
hostInsert(anchor, container, before);
|
|
1236
|
-
let exposed = null;
|
|
1237
|
-
let exposeCalled = false;
|
|
1238
|
-
const { children, slots: slotsFromProps, $models: modelsData, ...propsData } = vnode.props || {};
|
|
1239
|
-
const propsWithModels = { ...propsData };
|
|
1240
|
-
if (modelsData) for (const modelKey in modelsData) {
|
|
1241
|
-
const modelValue = modelsData[modelKey];
|
|
1242
|
-
if (isModel(modelValue)) propsWithModels[modelKey] = modelValue;
|
|
1243
|
-
}
|
|
1244
|
-
const reactiveProps = signal$1(propsWithModels);
|
|
1245
|
-
const internalVNode = vnode;
|
|
1246
|
-
internalVNode._componentProps = reactiveProps;
|
|
1247
|
-
const slots = createSlots(children, slotsFromProps);
|
|
1248
|
-
internalVNode._slots = slots;
|
|
1249
|
-
const createdHooks = [];
|
|
1250
|
-
const mountHooks = [];
|
|
1251
|
-
const updatedHooks = [];
|
|
1252
|
-
const unmountHooks = [];
|
|
1253
|
-
const parentInstance = getCurrentInstance();
|
|
1254
|
-
const componentName = vnode.type.__name;
|
|
1255
|
-
const ctx = {
|
|
1256
|
-
el: container,
|
|
1257
|
-
signal: signal$1,
|
|
1258
|
-
props: createPropsAccessor(reactiveProps),
|
|
1259
|
-
slots,
|
|
1260
|
-
emit: createEmit(reactiveProps),
|
|
1261
|
-
parent: parentInstance,
|
|
1262
|
-
onMounted: (fn) => {
|
|
1263
|
-
mountHooks.push(fn);
|
|
1264
|
-
},
|
|
1265
|
-
onUnmounted: (fn) => {
|
|
1266
|
-
unmountHooks.push(fn);
|
|
1267
|
-
},
|
|
1268
|
-
onCreated: (fn) => {
|
|
1269
|
-
createdHooks.push(fn);
|
|
1270
|
-
},
|
|
1271
|
-
onUpdated: (fn) => {
|
|
1272
|
-
updatedHooks.push(fn);
|
|
1273
|
-
},
|
|
1274
|
-
expose: (exposedValue) => {
|
|
1275
|
-
exposed = exposedValue;
|
|
1276
|
-
exposeCalled = true;
|
|
1277
|
-
},
|
|
1278
|
-
renderFn: null,
|
|
1279
|
-
update: () => {}
|
|
1280
|
-
};
|
|
1281
|
-
applyContextExtensions(ctx);
|
|
1282
|
-
ctx.__name = componentName;
|
|
1283
|
-
if (!parentInstance && currentAppContext) provideAppContext(ctx, currentAppContext);
|
|
1284
|
-
const componentInstance = {
|
|
1285
|
-
name: componentName,
|
|
1286
|
-
ctx,
|
|
1287
|
-
vnode
|
|
1288
|
-
};
|
|
1289
|
-
const prev = setCurrentInstance(ctx);
|
|
1290
|
-
let renderFn;
|
|
1291
|
-
try {
|
|
1292
|
-
const setupResult = setup(ctx);
|
|
1293
|
-
if (setupResult && typeof setupResult.then === "function") throw new Error(`Async setup in component "${componentName}" is only supported during SSR. On the client, use pre-loaded data from hydration or fetch in onMounted.`);
|
|
1294
|
-
renderFn = setupResult;
|
|
1295
|
-
notifyComponentCreated(currentAppContext, componentInstance);
|
|
1296
|
-
createdHooks.forEach((hook) => hook());
|
|
1297
|
-
} catch (err) {
|
|
1298
|
-
if (!handleComponentError(currentAppContext, err, componentInstance, "setup")) throw err;
|
|
1299
|
-
} finally {
|
|
1300
|
-
setCurrentInstance(prev);
|
|
1301
|
-
}
|
|
1302
|
-
if (vnode.props?.ref) {
|
|
1303
|
-
const refValue = exposeCalled ? exposed : null;
|
|
1304
|
-
untrack(() => {
|
|
1305
|
-
if (typeof vnode.props.ref === "function") vnode.props.ref(refValue);
|
|
1306
|
-
else if (vnode.props.ref && typeof vnode.props.ref === "object") vnode.props.ref.current = refValue;
|
|
1307
|
-
});
|
|
1308
|
-
}
|
|
1309
|
-
if (renderFn) {
|
|
1310
|
-
ctx.renderFn = renderFn;
|
|
1311
|
-
const componentEffect = effect(() => {
|
|
1312
|
-
const prevInstance = setCurrentInstance(ctx);
|
|
1313
|
-
try {
|
|
1314
|
-
const subTreeResult = ctx.renderFn();
|
|
1315
|
-
if (subTreeResult == null) return;
|
|
1316
|
-
const subTree = normalizeSubTree(subTreeResult);
|
|
1317
|
-
const prevSubTree = internalVNode._subTree;
|
|
1318
|
-
if (prevSubTree) {
|
|
1319
|
-
patch(prevSubTree, subTree, container);
|
|
1320
|
-
notifyComponentUpdated(currentAppContext, componentInstance);
|
|
1321
|
-
updatedHooks.forEach((hook) => hook());
|
|
1322
|
-
} else mount(subTree, container, anchor);
|
|
1323
|
-
internalVNode._subTree = subTree;
|
|
1324
|
-
} catch (err) {
|
|
1325
|
-
if (!handleComponentError(currentAppContext, err, componentInstance, "render")) throw err;
|
|
1326
|
-
} finally {
|
|
1327
|
-
setCurrentInstance(prevInstance);
|
|
1328
|
-
}
|
|
1329
|
-
});
|
|
1330
|
-
internalVNode._effect = componentEffect;
|
|
1331
|
-
ctx.update = () => {
|
|
1332
|
-
componentEffect();
|
|
1333
|
-
};
|
|
1334
|
-
}
|
|
1335
|
-
const mountCtx = { el: container };
|
|
1336
|
-
mountHooks.forEach((hook) => hook(mountCtx));
|
|
1337
|
-
notifyComponentMounted(currentAppContext, componentInstance);
|
|
1338
|
-
vnode.cleanup = () => {
|
|
1339
|
-
notifyComponentUnmounted(currentAppContext, componentInstance);
|
|
1340
|
-
unmountHooks.forEach((hook) => hook(mountCtx));
|
|
1341
|
-
};
|
|
1342
|
-
}
|
|
1343
|
-
return {
|
|
1344
|
-
render,
|
|
1345
|
-
patch,
|
|
1346
|
-
mount,
|
|
1347
|
-
unmount,
|
|
1348
|
-
mountComponent
|
|
1349
|
-
};
|
|
1350
|
-
}
|
|
1351
|
-
export { CLIENT_DIRECTIVES, CLIENT_DIRECTIVE_PREFIX, ErrorBoundary, Fragment, InstanceLifetimes, SubscriptionHandler, Suspense, Text, Utils, __DIRECTIVE__, applyContextExtensions, component, compound, createEmit, createModel, createModelFromBinding, createPropsAccessor, createPropsProxy, createRenderer, createSlots, createTopic, defineApp, defineDirective, defineFactory, defineInjectable, defineProvide, filterClientDirectives, getAppContextToken, getComponentMeta, getComponentPlugins, getCurrentInstance, getDefaultMount, getHydrationDirective, getModelSymbol, getPlatformModelProcessor, guid, handleComponentError, hasClientDirective, hasRequestIsolation, isComponent, isDirective, isLazyComponent, isModel, jsx, jsxDEV, jsxs, lazy, normalizeSubTree, notifyComponentCreated, notifyComponentMounted, notifyComponentUnmounted, notifyComponentUpdated, onCreated, onMounted, onUnmounted, onUpdated, provideAppContext, registerComponentPlugin, registerContextExtension, registerPendingPromise, runInRequestScope, serializeProps, setCurrentInstance, setDefaultMount, setPlatformModelProcessor, signal, toSubscriber, useAppContext, valueOf };
|
|
119
|
+
export { CLIENT_DIRECTIVES, CLIENT_DIRECTIVE_PREFIX, ErrorBoundary, Fragment, InstanceLifetimes, SubscriptionHandler, Suspense, Text, Utils, component, compound, createModel, createModelFromBinding, createTopic, defineApp, defineDirective, defineFactory, defineInjectable, defineProvide, getComponentMeta, getCurrentInstance, guid, isComponent, isDirective, isLazyComponent, isModel, jsx, jsxDEV, jsxs, lazy, onCreated, onMounted, onUnmounted, onUpdated, signal, toSubscriber, useAppContext };
|
|
1352
120
|
|
|
1353
121
|
//# sourceMappingURL=index.js.map
|