@fictjs/runtime 0.7.0 → 0.9.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/README.md +46 -0
- package/dist/advanced.cjs +9 -9
- package/dist/advanced.d.cts +4 -4
- package/dist/advanced.d.ts +4 -4
- package/dist/advanced.js +4 -4
- package/dist/{effect-DAzpH7Mm.d.cts → binding-BWchH3Kp.d.cts} +33 -24
- package/dist/{effect-DAzpH7Mm.d.ts → binding-BWchH3Kp.d.ts} +33 -24
- package/dist/{chunk-7YQK3XKY.js → chunk-DXG3TARY.js} +520 -518
- package/dist/chunk-DXG3TARY.js.map +1 -0
- package/dist/{chunk-TLDT76RV.js → chunk-FVX77557.js} +3 -3
- package/dist/{chunk-WRU3IZOA.js → chunk-JVYH76ZX.js} +3 -3
- package/dist/chunk-LBE6DC3V.cjs +768 -0
- package/dist/chunk-LBE6DC3V.cjs.map +1 -0
- package/dist/chunk-N6ODUM2Y.js +768 -0
- package/dist/chunk-N6ODUM2Y.js.map +1 -0
- package/dist/{chunk-PRF4QG73.cjs → chunk-OAM7HABA.cjs} +423 -246
- package/dist/chunk-OAM7HABA.cjs.map +1 -0
- package/dist/{chunk-CEV6TO5U.cjs → chunk-PD6IQY2Y.cjs} +8 -8
- package/dist/{chunk-CEV6TO5U.cjs.map → chunk-PD6IQY2Y.cjs.map} +1 -1
- package/dist/{chunk-HHDHQGJY.cjs → chunk-PG4QX2I2.cjs} +17 -17
- package/dist/{chunk-HHDHQGJY.cjs.map → chunk-PG4QX2I2.cjs.map} +1 -1
- package/dist/{chunk-4LCHQ7U4.js → chunk-T2LNV5Q5.js} +271 -94
- package/dist/chunk-T2LNV5Q5.js.map +1 -0
- package/dist/{chunk-FSCBL7RI.cjs → chunk-UBFDB6OL.cjs} +521 -519
- package/dist/chunk-UBFDB6OL.cjs.map +1 -0
- package/dist/{context-C4vBQbb4.d.ts → devtools-5AipK9CX.d.cts} +35 -35
- package/dist/{context-BFbHf9nC.d.cts → devtools-BDp76luf.d.ts} +35 -35
- package/dist/index.cjs +42 -42
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.dev.js +3 -3
- package/dist/index.dev.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/internal-list.cjs +12 -0
- package/dist/internal-list.cjs.map +1 -0
- package/dist/internal-list.d.cts +2 -0
- package/dist/internal-list.d.ts +2 -0
- package/dist/internal-list.js +12 -0
- package/dist/internal-list.js.map +1 -0
- package/dist/internal.cjs +6 -746
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +6 -74
- package/dist/internal.d.ts +6 -74
- package/dist/internal.js +12 -752
- package/dist/internal.js.map +1 -1
- package/dist/list-DL5DOFcO.d.ts +71 -0
- package/dist/list-hP7hQ9Vk.d.cts +71 -0
- package/dist/loader.cjs +94 -15
- package/dist/loader.cjs.map +1 -1
- package/dist/loader.d.cts +16 -2
- package/dist/loader.d.ts +16 -2
- package/dist/loader.js +87 -8
- package/dist/loader.js.map +1 -1
- package/dist/{props-84UJeWO8.d.cts → props-BpZz0AOq.d.cts} +2 -2
- package/dist/{props-BRhFK50f.d.ts → props-CjLH0JE-.d.ts} +2 -2
- package/dist/{resume-i-A3EFox.d.cts → resume-BJ4oHLi_.d.cts} +3 -1
- package/dist/{resume-CqeQ3v_q.d.ts → resume-CuyJWXP_.d.ts} +3 -1
- package/dist/{scope-DlCBL1Ft.d.cts → scope-BJCtq8hJ.d.cts} +1 -1
- package/dist/{scope-D3DpsfoG.d.ts → scope-jPt5DHRT.d.ts} +1 -1
- package/package.json +8 -1
- package/src/binding.ts +113 -36
- package/src/cycle-guard.ts +3 -3
- package/src/internal/list.ts +7 -0
- package/src/internal.ts +1 -0
- package/src/list-helpers.ts +1 -1
- package/src/loader.ts +119 -9
- package/src/resume.ts +6 -3
- package/src/signal.ts +8 -1
- package/dist/chunk-4LCHQ7U4.js.map +0 -1
- package/dist/chunk-7YQK3XKY.js.map +0 -1
- package/dist/chunk-FSCBL7RI.cjs.map +0 -1
- package/dist/chunk-PRF4QG73.cjs.map +0 -1
- /package/dist/{chunk-TLDT76RV.js.map → chunk-FVX77557.js.map} +0 -0
- /package/dist/{chunk-WRU3IZOA.js.map → chunk-JVYH76ZX.js.map} +0 -0
|
@@ -40,7 +40,86 @@
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
var
|
|
43
|
+
var _chunkUBFDB6OLcjs = require('./chunk-UBFDB6OL.cjs');
|
|
44
|
+
|
|
45
|
+
// src/transition.ts
|
|
46
|
+
function startTransition(fn) {
|
|
47
|
+
const prev = _chunkUBFDB6OLcjs.setTransitionContext.call(void 0, true);
|
|
48
|
+
try {
|
|
49
|
+
fn();
|
|
50
|
+
} finally {
|
|
51
|
+
_chunkUBFDB6OLcjs.setTransitionContext.call(void 0, prev);
|
|
52
|
+
_chunkUBFDB6OLcjs.scheduleFlush.call(void 0, );
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function useTransition() {
|
|
56
|
+
const pending = _chunkUBFDB6OLcjs.signal.call(void 0, false);
|
|
57
|
+
let pendingCount = 0;
|
|
58
|
+
const beginPending = () => {
|
|
59
|
+
pendingCount += 1;
|
|
60
|
+
if (pendingCount === 1) {
|
|
61
|
+
pending(true);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const endPending = () => {
|
|
65
|
+
if (pendingCount === 0) return;
|
|
66
|
+
pendingCount -= 1;
|
|
67
|
+
if (pendingCount === 0) {
|
|
68
|
+
pending(false);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const start = (fn) => {
|
|
72
|
+
beginPending();
|
|
73
|
+
let result;
|
|
74
|
+
let thrown;
|
|
75
|
+
let didThrow = false;
|
|
76
|
+
startTransition(() => {
|
|
77
|
+
try {
|
|
78
|
+
result = fn();
|
|
79
|
+
} catch (err) {
|
|
80
|
+
thrown = err;
|
|
81
|
+
didThrow = true;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
if (didThrow) {
|
|
85
|
+
endPending();
|
|
86
|
+
throw thrown;
|
|
87
|
+
}
|
|
88
|
+
if (result && typeof result.then === "function") {
|
|
89
|
+
Promise.resolve(result).finally(() => {
|
|
90
|
+
endPending();
|
|
91
|
+
});
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (typeof queueMicrotask === "function") {
|
|
95
|
+
queueMicrotask(endPending);
|
|
96
|
+
} else {
|
|
97
|
+
Promise.resolve().then(endPending);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
return [() => pending(), start];
|
|
101
|
+
}
|
|
102
|
+
function useDeferredValue(getValue) {
|
|
103
|
+
const deferredValue = _chunkUBFDB6OLcjs.signal.call(void 0, getValue());
|
|
104
|
+
_chunkUBFDB6OLcjs.createEffect.call(void 0, () => {
|
|
105
|
+
const newValue = getValue();
|
|
106
|
+
const currentDeferred = _chunkUBFDB6OLcjs.untrack.call(void 0, () => deferredValue());
|
|
107
|
+
if (currentDeferred !== newValue) {
|
|
108
|
+
startTransition(() => {
|
|
109
|
+
deferredValue(newValue);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
return () => deferredValue();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// src/scheduler.ts
|
|
117
|
+
function batch2(fn) {
|
|
118
|
+
return _chunkUBFDB6OLcjs.batch.call(void 0, fn);
|
|
119
|
+
}
|
|
120
|
+
function untrack2(fn) {
|
|
121
|
+
return _chunkUBFDB6OLcjs.untrack.call(void 0, fn);
|
|
122
|
+
}
|
|
44
123
|
|
|
45
124
|
// src/jsx.ts
|
|
46
125
|
var Fragment = Symbol("Fragment");
|
|
@@ -247,85 +326,6 @@ function resolvePath(root, path) {
|
|
|
247
326
|
return current;
|
|
248
327
|
}
|
|
249
328
|
|
|
250
|
-
// src/transition.ts
|
|
251
|
-
function startTransition(fn) {
|
|
252
|
-
const prev = _chunkFSCBL7RIcjs.setTransitionContext.call(void 0, true);
|
|
253
|
-
try {
|
|
254
|
-
fn();
|
|
255
|
-
} finally {
|
|
256
|
-
_chunkFSCBL7RIcjs.setTransitionContext.call(void 0, prev);
|
|
257
|
-
_chunkFSCBL7RIcjs.scheduleFlush.call(void 0, );
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
function useTransition() {
|
|
261
|
-
const pending = _chunkFSCBL7RIcjs.signal.call(void 0, false);
|
|
262
|
-
let pendingCount = 0;
|
|
263
|
-
const beginPending = () => {
|
|
264
|
-
pendingCount += 1;
|
|
265
|
-
if (pendingCount === 1) {
|
|
266
|
-
pending(true);
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
const endPending = () => {
|
|
270
|
-
if (pendingCount === 0) return;
|
|
271
|
-
pendingCount -= 1;
|
|
272
|
-
if (pendingCount === 0) {
|
|
273
|
-
pending(false);
|
|
274
|
-
}
|
|
275
|
-
};
|
|
276
|
-
const start = (fn) => {
|
|
277
|
-
beginPending();
|
|
278
|
-
let result;
|
|
279
|
-
let thrown;
|
|
280
|
-
let didThrow = false;
|
|
281
|
-
startTransition(() => {
|
|
282
|
-
try {
|
|
283
|
-
result = fn();
|
|
284
|
-
} catch (err) {
|
|
285
|
-
thrown = err;
|
|
286
|
-
didThrow = true;
|
|
287
|
-
}
|
|
288
|
-
});
|
|
289
|
-
if (didThrow) {
|
|
290
|
-
endPending();
|
|
291
|
-
throw thrown;
|
|
292
|
-
}
|
|
293
|
-
if (result && typeof result.then === "function") {
|
|
294
|
-
Promise.resolve(result).finally(() => {
|
|
295
|
-
endPending();
|
|
296
|
-
});
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
if (typeof queueMicrotask === "function") {
|
|
300
|
-
queueMicrotask(endPending);
|
|
301
|
-
} else {
|
|
302
|
-
Promise.resolve().then(endPending);
|
|
303
|
-
}
|
|
304
|
-
};
|
|
305
|
-
return [() => pending(), start];
|
|
306
|
-
}
|
|
307
|
-
function useDeferredValue(getValue) {
|
|
308
|
-
const deferredValue = _chunkFSCBL7RIcjs.signal.call(void 0, getValue());
|
|
309
|
-
_chunkFSCBL7RIcjs.createEffect.call(void 0, () => {
|
|
310
|
-
const newValue = getValue();
|
|
311
|
-
const currentDeferred = _chunkFSCBL7RIcjs.untrack.call(void 0, () => deferredValue());
|
|
312
|
-
if (currentDeferred !== newValue) {
|
|
313
|
-
startTransition(() => {
|
|
314
|
-
deferredValue(newValue);
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
return () => deferredValue();
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
// src/scheduler.ts
|
|
322
|
-
function batch2(fn) {
|
|
323
|
-
return _chunkFSCBL7RIcjs.batch.call(void 0, fn);
|
|
324
|
-
}
|
|
325
|
-
function untrack2(fn) {
|
|
326
|
-
return _chunkFSCBL7RIcjs.untrack.call(void 0, fn);
|
|
327
|
-
}
|
|
328
|
-
|
|
329
329
|
// src/hydration.ts
|
|
330
330
|
var hydrationStack = [];
|
|
331
331
|
function withHydration(root, fn) {
|
|
@@ -421,14 +421,14 @@ function isExplicitReactiveFn(value) {
|
|
|
421
421
|
function isReactive(value) {
|
|
422
422
|
if (typeof value !== "function") return false;
|
|
423
423
|
if (isNonReactiveFn(value)) return false;
|
|
424
|
-
if (
|
|
424
|
+
if (_chunkUBFDB6OLcjs.isSignal.call(void 0, value) || _chunkUBFDB6OLcjs.isComputed.call(void 0, value)) return true;
|
|
425
425
|
if (isExplicitReactiveFn(value)) return true;
|
|
426
|
-
if (
|
|
426
|
+
if (_chunkUBFDB6OLcjs.isEffect.call(void 0, value) || _chunkUBFDB6OLcjs.isEffectScope.call(void 0, value)) return false;
|
|
427
427
|
return value.length === 0;
|
|
428
428
|
}
|
|
429
429
|
function isStrictlyReactive(value) {
|
|
430
430
|
if (typeof value !== "function") return false;
|
|
431
|
-
return
|
|
431
|
+
return _chunkUBFDB6OLcjs.isSignal.call(void 0, value) || _chunkUBFDB6OLcjs.isComputed.call(void 0, value) || isPropGetterFn(value) || isExplicitReactiveFn(value);
|
|
432
432
|
}
|
|
433
433
|
var PROP_GETTER_MARKER = Symbol.for("fict:prop-getter");
|
|
434
434
|
function isPropGetterFn(value) {
|
|
@@ -491,7 +491,7 @@ function callEventHandler(handler, event, node, data) {
|
|
|
491
491
|
function createTextBinding(value) {
|
|
492
492
|
const text = document.createTextNode("");
|
|
493
493
|
if (isReactive(value)) {
|
|
494
|
-
|
|
494
|
+
_chunkUBFDB6OLcjs.createRenderEffect.call(void 0, () => {
|
|
495
495
|
setText(text, value());
|
|
496
496
|
});
|
|
497
497
|
} else {
|
|
@@ -500,7 +500,7 @@ function createTextBinding(value) {
|
|
|
500
500
|
return text;
|
|
501
501
|
}
|
|
502
502
|
function bindText(textNode, getValue) {
|
|
503
|
-
return
|
|
503
|
+
return _chunkUBFDB6OLcjs.createRenderEffect.call(void 0, () => setText(textNode, getValue()));
|
|
504
504
|
}
|
|
505
505
|
function setText(textNode, value) {
|
|
506
506
|
const next = formatTextValue(value);
|
|
@@ -520,7 +520,7 @@ function formatTextValue(value) {
|
|
|
520
520
|
}
|
|
521
521
|
function createAttributeBinding(el, key, value, setter) {
|
|
522
522
|
if (isReactive(value)) {
|
|
523
|
-
|
|
523
|
+
_chunkUBFDB6OLcjs.createRenderEffect.call(void 0, () => {
|
|
524
524
|
setter(el, key, value());
|
|
525
525
|
});
|
|
526
526
|
} else {
|
|
@@ -528,7 +528,7 @@ function createAttributeBinding(el, key, value, setter) {
|
|
|
528
528
|
}
|
|
529
529
|
}
|
|
530
530
|
function bindAttribute(el, key, getValue) {
|
|
531
|
-
return
|
|
531
|
+
return _chunkUBFDB6OLcjs.createRenderEffect.call(void 0, () => setAttr(el, key, getValue()));
|
|
532
532
|
}
|
|
533
533
|
function setAttr(el, key, value) {
|
|
534
534
|
const cacheTarget = el;
|
|
@@ -544,7 +544,7 @@ function setAttr(el, key, value) {
|
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
546
|
function bindProperty(el, key, getValue) {
|
|
547
|
-
return
|
|
547
|
+
return _chunkUBFDB6OLcjs.createRenderEffect.call(void 0, () => setProp(el, key, getValue()));
|
|
548
548
|
}
|
|
549
549
|
function setProp(el, key, value) {
|
|
550
550
|
const cacheTarget = el;
|
|
@@ -561,7 +561,7 @@ function setProp(el, key, value) {
|
|
|
561
561
|
}
|
|
562
562
|
function createStyleBinding(el, value) {
|
|
563
563
|
if (isReactive(value)) {
|
|
564
|
-
|
|
564
|
+
_chunkUBFDB6OLcjs.createRenderEffect.call(void 0, () => {
|
|
565
565
|
setStyle(el, value());
|
|
566
566
|
});
|
|
567
567
|
} else {
|
|
@@ -569,7 +569,7 @@ function createStyleBinding(el, value) {
|
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
571
|
function bindStyle(el, getValue) {
|
|
572
|
-
return
|
|
572
|
+
return _chunkUBFDB6OLcjs.createRenderEffect.call(void 0, () => setStyle(el, getValue()));
|
|
573
573
|
}
|
|
574
574
|
function setStyle(el, value) {
|
|
575
575
|
const target = el;
|
|
@@ -624,7 +624,7 @@ function applyStyle(el, value, prev) {
|
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
|
-
var isUnitlessStyleProperty = isDev ? (prop2) =>
|
|
627
|
+
var isUnitlessStyleProperty = isDev ? (prop2) => _chunkUBFDB6OLcjs.UnitlessStyles.has(prop2) : (prop2) => prop2 === "opacity" || prop2 === "zIndex";
|
|
628
628
|
function normalizeStyleProperty(prop2) {
|
|
629
629
|
const cached = STYLE_PROP_CACHE.get(prop2);
|
|
630
630
|
if (cached) return cached;
|
|
@@ -634,7 +634,7 @@ function normalizeStyleProperty(prop2) {
|
|
|
634
634
|
}
|
|
635
635
|
function createClassBinding(el, value) {
|
|
636
636
|
if (isReactive(value)) {
|
|
637
|
-
|
|
637
|
+
_chunkUBFDB6OLcjs.createRenderEffect.call(void 0,
|
|
638
638
|
() => setClass(el, value())
|
|
639
639
|
);
|
|
640
640
|
} else {
|
|
@@ -642,7 +642,7 @@ function createClassBinding(el, value) {
|
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
644
|
function bindClass(el, getValue) {
|
|
645
|
-
return
|
|
645
|
+
return _chunkUBFDB6OLcjs.createRenderEffect.call(void 0, () => setClass(el, getValue()));
|
|
646
646
|
}
|
|
647
647
|
function setClass(el, value) {
|
|
648
648
|
const cache = el;
|
|
@@ -703,7 +703,7 @@ function classList(node, value, prev = {}) {
|
|
|
703
703
|
return applyClass(node, value, prev);
|
|
704
704
|
}
|
|
705
705
|
function insert(parent, getValue, markerOrCreateElement, createElementFn) {
|
|
706
|
-
const hostRoot =
|
|
706
|
+
const hostRoot = _chunkUBFDB6OLcjs.getCurrentRoot.call(void 0, );
|
|
707
707
|
let marker;
|
|
708
708
|
let ownsMarker = false;
|
|
709
709
|
let createFn = createElementFn;
|
|
@@ -742,13 +742,13 @@ function insert(parent, getValue, markerOrCreateElement, createElementFn) {
|
|
|
742
742
|
insertNodesBefore(parentNode, [currentText], marker);
|
|
743
743
|
currentNodes = [currentText];
|
|
744
744
|
};
|
|
745
|
-
const dispose =
|
|
745
|
+
const dispose = _chunkUBFDB6OLcjs.createRenderEffect.call(void 0, () => {
|
|
746
746
|
const value = getValue();
|
|
747
747
|
const parentNode = marker.parentNode;
|
|
748
748
|
const isPrimitive = value == null || value === false || typeof value === "string" || typeof value === "number" || typeof value === "boolean";
|
|
749
749
|
if (isPrimitive) {
|
|
750
750
|
if (currentRoot) {
|
|
751
|
-
|
|
751
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, currentRoot);
|
|
752
752
|
currentRoot = null;
|
|
753
753
|
}
|
|
754
754
|
if (!parentNode) {
|
|
@@ -761,12 +761,12 @@ function insert(parent, getValue, markerOrCreateElement, createElementFn) {
|
|
|
761
761
|
return;
|
|
762
762
|
}
|
|
763
763
|
if (currentRoot) {
|
|
764
|
-
|
|
764
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, currentRoot);
|
|
765
765
|
currentRoot = null;
|
|
766
766
|
}
|
|
767
767
|
clearCurrentNodes();
|
|
768
|
-
const root =
|
|
769
|
-
const prev =
|
|
768
|
+
const root = _chunkUBFDB6OLcjs.createRootContext.call(void 0, hostRoot);
|
|
769
|
+
const prev = _chunkUBFDB6OLcjs.pushRoot.call(void 0, root);
|
|
770
770
|
let nodes = [];
|
|
771
771
|
let handledError = false;
|
|
772
772
|
try {
|
|
@@ -793,28 +793,28 @@ function insert(parent, getValue, markerOrCreateElement, createElementFn) {
|
|
|
793
793
|
nodes = toNodeArray(newNode);
|
|
794
794
|
if (root.suspended) {
|
|
795
795
|
handledError = true;
|
|
796
|
-
|
|
796
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, root);
|
|
797
797
|
return;
|
|
798
798
|
}
|
|
799
799
|
if (parentNode) {
|
|
800
800
|
insertNodesBefore(parentNode, nodes, marker);
|
|
801
801
|
}
|
|
802
802
|
} catch (err) {
|
|
803
|
-
if (
|
|
803
|
+
if (_chunkUBFDB6OLcjs.handleSuspend.call(void 0, err, root)) {
|
|
804
804
|
handledError = true;
|
|
805
|
-
|
|
805
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, root);
|
|
806
806
|
return;
|
|
807
807
|
}
|
|
808
|
-
if (
|
|
808
|
+
if (_chunkUBFDB6OLcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
|
|
809
809
|
handledError = true;
|
|
810
|
-
|
|
810
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, root);
|
|
811
811
|
return;
|
|
812
812
|
}
|
|
813
813
|
throw err;
|
|
814
814
|
} finally {
|
|
815
|
-
|
|
815
|
+
_chunkUBFDB6OLcjs.popRoot.call(void 0, prev);
|
|
816
816
|
if (!handledError) {
|
|
817
|
-
|
|
817
|
+
_chunkUBFDB6OLcjs.flushOnMount.call(void 0, root);
|
|
818
818
|
}
|
|
819
819
|
}
|
|
820
820
|
currentRoot = root;
|
|
@@ -823,7 +823,7 @@ function insert(parent, getValue, markerOrCreateElement, createElementFn) {
|
|
|
823
823
|
return () => {
|
|
824
824
|
dispose();
|
|
825
825
|
if (currentRoot) {
|
|
826
|
-
|
|
826
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, currentRoot);
|
|
827
827
|
currentRoot = null;
|
|
828
828
|
}
|
|
829
829
|
clearCurrentNodes();
|
|
@@ -833,11 +833,11 @@ function insert(parent, getValue, markerOrCreateElement, createElementFn) {
|
|
|
833
833
|
};
|
|
834
834
|
}
|
|
835
835
|
function insertBetween(start, end, getValue, createElementFn) {
|
|
836
|
-
const hostRoot =
|
|
836
|
+
const hostRoot = _chunkUBFDB6OLcjs.getCurrentRoot.call(void 0, );
|
|
837
837
|
let currentNodes = [];
|
|
838
838
|
let currentText = null;
|
|
839
839
|
let currentRoot = null;
|
|
840
|
-
let initialHydrating =
|
|
840
|
+
let initialHydrating = _chunkUBFDB6OLcjs.__fictIsHydrating.call(void 0, );
|
|
841
841
|
const collectBetween = () => {
|
|
842
842
|
const nodes = [];
|
|
843
843
|
let cursor = start.nextSibling;
|
|
@@ -873,7 +873,7 @@ function insertBetween(start, end, getValue, createElementFn) {
|
|
|
873
873
|
currentNodes = [currentText];
|
|
874
874
|
}
|
|
875
875
|
};
|
|
876
|
-
const dispose =
|
|
876
|
+
const dispose = _chunkUBFDB6OLcjs.createRenderEffect.call(void 0, () => {
|
|
877
877
|
const value = getValue();
|
|
878
878
|
const parentNode = start.parentNode;
|
|
879
879
|
const isPrimitive = value == null || value === false || typeof value === "string" || typeof value === "number" || typeof value === "boolean";
|
|
@@ -887,7 +887,7 @@ function insertBetween(start, end, getValue, createElementFn) {
|
|
|
887
887
|
}
|
|
888
888
|
}
|
|
889
889
|
if (currentRoot) {
|
|
890
|
-
|
|
890
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, currentRoot);
|
|
891
891
|
currentRoot = null;
|
|
892
892
|
}
|
|
893
893
|
if (!parentNode) {
|
|
@@ -901,12 +901,12 @@ function insertBetween(start, end, getValue, createElementFn) {
|
|
|
901
901
|
return;
|
|
902
902
|
}
|
|
903
903
|
if (currentRoot) {
|
|
904
|
-
|
|
904
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, currentRoot);
|
|
905
905
|
currentRoot = null;
|
|
906
906
|
}
|
|
907
907
|
clearCurrentNodes();
|
|
908
|
-
const root =
|
|
909
|
-
const prev =
|
|
908
|
+
const root = _chunkUBFDB6OLcjs.createRootContext.call(void 0, hostRoot);
|
|
909
|
+
const prev = _chunkUBFDB6OLcjs.pushRoot.call(void 0, root);
|
|
910
910
|
let nodes = [];
|
|
911
911
|
let handledError = false;
|
|
912
912
|
try {
|
|
@@ -940,28 +940,28 @@ function insertBetween(start, end, getValue, createElementFn) {
|
|
|
940
940
|
nodes = toNodeArray(newNode);
|
|
941
941
|
if (root.suspended) {
|
|
942
942
|
handledError = true;
|
|
943
|
-
|
|
943
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, root);
|
|
944
944
|
return;
|
|
945
945
|
}
|
|
946
946
|
if (parentNode && !initialHydrating) {
|
|
947
947
|
insertNodesBefore(parentNode, nodes, end);
|
|
948
948
|
}
|
|
949
949
|
} catch (err) {
|
|
950
|
-
if (
|
|
950
|
+
if (_chunkUBFDB6OLcjs.handleSuspend.call(void 0, err, root)) {
|
|
951
951
|
handledError = true;
|
|
952
|
-
|
|
952
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, root);
|
|
953
953
|
return;
|
|
954
954
|
}
|
|
955
|
-
if (
|
|
955
|
+
if (_chunkUBFDB6OLcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
|
|
956
956
|
handledError = true;
|
|
957
|
-
|
|
957
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, root);
|
|
958
958
|
return;
|
|
959
959
|
}
|
|
960
960
|
throw err;
|
|
961
961
|
} finally {
|
|
962
|
-
|
|
962
|
+
_chunkUBFDB6OLcjs.popRoot.call(void 0, prev);
|
|
963
963
|
if (!handledError) {
|
|
964
|
-
|
|
964
|
+
_chunkUBFDB6OLcjs.flushOnMount.call(void 0, root);
|
|
965
965
|
}
|
|
966
966
|
}
|
|
967
967
|
currentRoot = root;
|
|
@@ -971,7 +971,7 @@ function insertBetween(start, end, getValue, createElementFn) {
|
|
|
971
971
|
return () => {
|
|
972
972
|
dispose();
|
|
973
973
|
if (currentRoot) {
|
|
974
|
-
|
|
974
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, currentRoot);
|
|
975
975
|
currentRoot = null;
|
|
976
976
|
}
|
|
977
977
|
clearCurrentNodes();
|
|
@@ -980,10 +980,10 @@ function insertBetween(start, end, getValue, createElementFn) {
|
|
|
980
980
|
function createChildBinding(parent, getValue, createElementFn) {
|
|
981
981
|
const marker = document.createComment("fict:child");
|
|
982
982
|
parent.appendChild(marker);
|
|
983
|
-
const hostRoot =
|
|
984
|
-
const dispose =
|
|
985
|
-
const root =
|
|
986
|
-
const prev =
|
|
983
|
+
const hostRoot = _chunkUBFDB6OLcjs.getCurrentRoot.call(void 0, );
|
|
984
|
+
const dispose = _chunkUBFDB6OLcjs.createRenderEffect.call(void 0, () => {
|
|
985
|
+
const root = _chunkUBFDB6OLcjs.createRootContext.call(void 0, hostRoot);
|
|
986
|
+
const prev = _chunkUBFDB6OLcjs.pushRoot.call(void 0, root);
|
|
987
987
|
let nodes = [];
|
|
988
988
|
let handledError = false;
|
|
989
989
|
try {
|
|
@@ -998,25 +998,25 @@ function createChildBinding(parent, getValue, createElementFn) {
|
|
|
998
998
|
insertNodesBefore(parentNode, nodes, marker);
|
|
999
999
|
}
|
|
1000
1000
|
return () => {
|
|
1001
|
-
|
|
1001
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, root);
|
|
1002
1002
|
removeNodes(nodes);
|
|
1003
1003
|
};
|
|
1004
1004
|
} catch (err) {
|
|
1005
|
-
if (
|
|
1005
|
+
if (_chunkUBFDB6OLcjs.handleSuspend.call(void 0, err, root)) {
|
|
1006
1006
|
handledError = true;
|
|
1007
|
-
|
|
1007
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, root);
|
|
1008
1008
|
return;
|
|
1009
1009
|
}
|
|
1010
|
-
if (
|
|
1010
|
+
if (_chunkUBFDB6OLcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
|
|
1011
1011
|
handledError = true;
|
|
1012
|
-
|
|
1012
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, root);
|
|
1013
1013
|
return;
|
|
1014
1014
|
}
|
|
1015
1015
|
throw err;
|
|
1016
1016
|
} finally {
|
|
1017
|
-
|
|
1017
|
+
_chunkUBFDB6OLcjs.popRoot.call(void 0, prev);
|
|
1018
1018
|
if (!handledError) {
|
|
1019
|
-
|
|
1019
|
+
_chunkUBFDB6OLcjs.flushOnMount.call(void 0, root);
|
|
1020
1020
|
}
|
|
1021
1021
|
}
|
|
1022
1022
|
});
|
|
@@ -1029,7 +1029,7 @@ function createChildBinding(parent, getValue, createElementFn) {
|
|
|
1029
1029
|
};
|
|
1030
1030
|
}
|
|
1031
1031
|
function delegateEvents(eventNames, doc = window.document) {
|
|
1032
|
-
const e = doc[
|
|
1032
|
+
const e = doc[_chunkUBFDB6OLcjs.$$EVENTS] || (doc[_chunkUBFDB6OLcjs.$$EVENTS] = /* @__PURE__ */ new Set());
|
|
1033
1033
|
for (let i = 0, l = eventNames.length; i < l; i++) {
|
|
1034
1034
|
const name = eventNames[i];
|
|
1035
1035
|
if (!e.has(name)) {
|
|
@@ -1039,12 +1039,12 @@ function delegateEvents(eventNames, doc = window.document) {
|
|
|
1039
1039
|
}
|
|
1040
1040
|
}
|
|
1041
1041
|
function clearDelegatedEvents(doc = window.document) {
|
|
1042
|
-
const e = doc[
|
|
1042
|
+
const e = doc[_chunkUBFDB6OLcjs.$$EVENTS];
|
|
1043
1043
|
if (e) {
|
|
1044
1044
|
for (const name of e.keys()) {
|
|
1045
1045
|
doc.removeEventListener(name, globalEventHandler);
|
|
1046
1046
|
}
|
|
1047
|
-
delete doc[
|
|
1047
|
+
delete doc[_chunkUBFDB6OLcjs.$$EVENTS];
|
|
1048
1048
|
}
|
|
1049
1049
|
}
|
|
1050
1050
|
function globalEventHandler(e) {
|
|
@@ -1157,8 +1157,8 @@ function addEventListener(node, name, handler, delegate) {
|
|
|
1157
1157
|
function bindEvent(el, eventName, handler, options) {
|
|
1158
1158
|
if (handler == null) return () => {
|
|
1159
1159
|
};
|
|
1160
|
-
const rootRef =
|
|
1161
|
-
const shouldDelegate = options == null &&
|
|
1160
|
+
const rootRef = _chunkUBFDB6OLcjs.getCurrentRoot.call(void 0, );
|
|
1161
|
+
const shouldDelegate = options == null && _chunkUBFDB6OLcjs.DelegatedEvents.has(eventName);
|
|
1162
1162
|
if (shouldDelegate) {
|
|
1163
1163
|
const key = `$$${eventName}`;
|
|
1164
1164
|
delegateEvents([eventName]);
|
|
@@ -1168,7 +1168,7 @@ function bindEvent(el, eventName, handler, options) {
|
|
|
1168
1168
|
const fn = resolveHandler();
|
|
1169
1169
|
callEventHandler(fn, args[0], el);
|
|
1170
1170
|
} catch (err) {
|
|
1171
|
-
if (!
|
|
1171
|
+
if (!_chunkUBFDB6OLcjs.handleError.call(void 0, err, { source: "event", eventName }, rootRef)) {
|
|
1172
1172
|
throw err;
|
|
1173
1173
|
}
|
|
1174
1174
|
}
|
|
@@ -1183,7 +1183,7 @@ function bindEvent(el, eventName, handler, options) {
|
|
|
1183
1183
|
const resolved = getHandler();
|
|
1184
1184
|
callEventHandler(resolved, event, el);
|
|
1185
1185
|
} catch (err) {
|
|
1186
|
-
if (
|
|
1186
|
+
if (_chunkUBFDB6OLcjs.handleError.call(void 0, err, { source: "event", eventName }, rootRef)) {
|
|
1187
1187
|
return;
|
|
1188
1188
|
}
|
|
1189
1189
|
throw err;
|
|
@@ -1191,7 +1191,7 @@ function bindEvent(el, eventName, handler, options) {
|
|
|
1191
1191
|
};
|
|
1192
1192
|
el.addEventListener(eventName, wrapped, options);
|
|
1193
1193
|
const cleanup = () => el.removeEventListener(eventName, wrapped, options);
|
|
1194
|
-
|
|
1194
|
+
_chunkUBFDB6OLcjs.registerRootCleanup.call(void 0, cleanup);
|
|
1195
1195
|
return cleanup;
|
|
1196
1196
|
}
|
|
1197
1197
|
function bindRef(el, ref) {
|
|
@@ -1211,11 +1211,11 @@ function bindRef(el, ref) {
|
|
|
1211
1211
|
const initialRef = getRef();
|
|
1212
1212
|
applyRef2(initialRef);
|
|
1213
1213
|
if (isReactive(ref)) {
|
|
1214
|
-
const cleanup2 =
|
|
1214
|
+
const cleanup2 = _chunkUBFDB6OLcjs.createRenderEffect.call(void 0, () => {
|
|
1215
1215
|
const currentRef = getRef();
|
|
1216
1216
|
applyRef2(currentRef);
|
|
1217
1217
|
});
|
|
1218
|
-
|
|
1218
|
+
_chunkUBFDB6OLcjs.registerRootCleanup.call(void 0, cleanup2);
|
|
1219
1219
|
const nullifyCleanup = () => {
|
|
1220
1220
|
const currentRef = getRef();
|
|
1221
1221
|
if (currentRef && typeof currentRef === "object" && "current" in currentRef) {
|
|
@@ -1223,7 +1223,7 @@ function bindRef(el, ref) {
|
|
|
1223
1223
|
currentRef.current = null;
|
|
1224
1224
|
}
|
|
1225
1225
|
};
|
|
1226
|
-
|
|
1226
|
+
_chunkUBFDB6OLcjs.registerRootCleanup.call(void 0, nullifyCleanup);
|
|
1227
1227
|
return () => {
|
|
1228
1228
|
cleanup2();
|
|
1229
1229
|
nullifyCleanup();
|
|
@@ -1236,23 +1236,23 @@ function bindRef(el, ref) {
|
|
|
1236
1236
|
refValue.current = null;
|
|
1237
1237
|
}
|
|
1238
1238
|
};
|
|
1239
|
-
|
|
1239
|
+
_chunkUBFDB6OLcjs.registerRootCleanup.call(void 0, cleanup);
|
|
1240
1240
|
return cleanup;
|
|
1241
1241
|
}
|
|
1242
1242
|
function spread(node, props = {}, isSVG = false, skipChildren = false) {
|
|
1243
1243
|
const prevProps = {};
|
|
1244
1244
|
if (!skipChildren && "children" in props) {
|
|
1245
|
-
|
|
1245
|
+
_chunkUBFDB6OLcjs.createRenderEffect.call(void 0, () => {
|
|
1246
1246
|
prevProps.children = props.children;
|
|
1247
1247
|
});
|
|
1248
1248
|
}
|
|
1249
|
-
|
|
1249
|
+
_chunkUBFDB6OLcjs.createRenderEffect.call(void 0, () => {
|
|
1250
1250
|
if (typeof props.ref === "function") {
|
|
1251
1251
|
;
|
|
1252
1252
|
props.ref(node);
|
|
1253
1253
|
}
|
|
1254
1254
|
});
|
|
1255
|
-
|
|
1255
|
+
_chunkUBFDB6OLcjs.createRenderEffect.call(void 0, () => {
|
|
1256
1256
|
assign(node, props, isSVG, true, prevProps, true);
|
|
1257
1257
|
});
|
|
1258
1258
|
return prevProps;
|
|
@@ -1310,7 +1310,7 @@ function assignProp(node, prop2, value, prev, isSVG, skipRef, props) {
|
|
|
1310
1310
|
}
|
|
1311
1311
|
if (prop2.slice(0, 2) === "on") {
|
|
1312
1312
|
const eventName = prop2.slice(2).toLowerCase();
|
|
1313
|
-
const shouldDelegate =
|
|
1313
|
+
const shouldDelegate = _chunkUBFDB6OLcjs.DelegatedEvents.has(eventName);
|
|
1314
1314
|
if (!shouldDelegate && prev) {
|
|
1315
1315
|
const handler = Array.isArray(prev) ? prev[0] : prev;
|
|
1316
1316
|
node.removeEventListener(eventName, handler);
|
|
@@ -1343,9 +1343,9 @@ function assignProp(node, prop2, value, prev, isSVG, skipRef, props) {
|
|
|
1343
1343
|
}
|
|
1344
1344
|
const isCE = node.nodeName.includes("-") || "is" in props;
|
|
1345
1345
|
if (!isSVG) {
|
|
1346
|
-
const propAlias = isDev ?
|
|
1347
|
-
const isProperty = isDev ?
|
|
1348
|
-
const isChildProp = isDev ?
|
|
1346
|
+
const propAlias = isDev ? _chunkUBFDB6OLcjs.getPropAlias.call(void 0, prop2, node.tagName) : void 0;
|
|
1347
|
+
const isProperty = isDev ? _chunkUBFDB6OLcjs.Properties.has(prop2) : prop2 in node;
|
|
1348
|
+
const isChildProp = isDev ? _chunkUBFDB6OLcjs.ChildProperties.has(prop2) : prop2 === "innerHTML" || prop2 === "textContent" || prop2 === "innerText" || prop2 === "children";
|
|
1349
1349
|
if (propAlias || isProperty || isChildProp || isCE) {
|
|
1350
1350
|
const propName = propAlias || prop2;
|
|
1351
1351
|
if (isCE && !isProperty && !isChildProp && !propAlias) {
|
|
@@ -1360,7 +1360,7 @@ function assignProp(node, prop2, value, prev, isSVG, skipRef, props) {
|
|
|
1360
1360
|
}
|
|
1361
1361
|
if (isSVG && prop2.indexOf(":") > -1) {
|
|
1362
1362
|
const [prefix, name] = prop2.split(":");
|
|
1363
|
-
const ns =
|
|
1363
|
+
const ns = _chunkUBFDB6OLcjs.SVGNamespace[prefix];
|
|
1364
1364
|
if (ns) {
|
|
1365
1365
|
if (value == null) node.removeAttributeNS(ns, name);
|
|
1366
1366
|
else node.setAttributeNS(ns, name, String(value));
|
|
@@ -1375,7 +1375,8 @@ function assignProp(node, prop2, value, prev, isSVG, skipRef, props) {
|
|
|
1375
1375
|
function toPropertyName(name) {
|
|
1376
1376
|
return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());
|
|
1377
1377
|
}
|
|
1378
|
-
function createConditional(condition, renderTrue, createElementFn, renderFalse, startOverride, endOverride) {
|
|
1378
|
+
function createConditional(condition, renderTrue, createElementFn, renderFalse, startOverride, endOverride, options) {
|
|
1379
|
+
const trackBranchReads = _optionalChain([options, 'optionalAccess', _13 => _13.trackBranchReads]) === true;
|
|
1379
1380
|
const useProvided = !!(startOverride && endOverride);
|
|
1380
1381
|
const startMarker = useProvided ? startOverride : document.createComment("fict:cond:start");
|
|
1381
1382
|
const endMarker = useProvided ? endOverride : document.createComment("fict:cond:end");
|
|
@@ -1384,12 +1385,12 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
|
|
|
1384
1385
|
;
|
|
1385
1386
|
fragment.append(startMarker, endMarker);
|
|
1386
1387
|
}
|
|
1387
|
-
const hostRoot =
|
|
1388
|
+
const hostRoot = _chunkUBFDB6OLcjs.getCurrentRoot.call(void 0, );
|
|
1388
1389
|
let currentNodes = [];
|
|
1389
1390
|
let currentRoot = null;
|
|
1390
1391
|
let lastCondition = void 0;
|
|
1391
1392
|
let pendingRender = false;
|
|
1392
|
-
let initialHydrating =
|
|
1393
|
+
let initialHydrating = _chunkUBFDB6OLcjs.__fictIsHydrating.call(void 0, );
|
|
1393
1394
|
const collectBetween = () => {
|
|
1394
1395
|
const nodes = [];
|
|
1395
1396
|
let cursor = startMarker.nextSibling;
|
|
@@ -1399,7 +1400,7 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
|
|
|
1399
1400
|
}
|
|
1400
1401
|
return nodes;
|
|
1401
1402
|
};
|
|
1402
|
-
const conditionMemo =
|
|
1403
|
+
const conditionMemo = _chunkUBFDB6OLcjs.computed.call(void 0, condition);
|
|
1403
1404
|
const runConditional = () => {
|
|
1404
1405
|
const cond = conditionMemo();
|
|
1405
1406
|
const parent = startMarker.parentNode;
|
|
@@ -1416,8 +1417,8 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
|
|
|
1416
1417
|
currentNodes = collectBetween();
|
|
1417
1418
|
return;
|
|
1418
1419
|
}
|
|
1419
|
-
const root2 =
|
|
1420
|
-
const prev2 =
|
|
1420
|
+
const root2 = _chunkUBFDB6OLcjs.createRootContext.call(void 0, hostRoot);
|
|
1421
|
+
const prev2 = _chunkUBFDB6OLcjs.pushRoot.call(void 0, root2);
|
|
1421
1422
|
let handledError2 = false;
|
|
1422
1423
|
try {
|
|
1423
1424
|
withHydrationRange(
|
|
@@ -1425,7 +1426,7 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
|
|
|
1425
1426
|
endMarker,
|
|
1426
1427
|
_nullishCoalesce(parent.ownerDocument, () => ( document)),
|
|
1427
1428
|
() => {
|
|
1428
|
-
const output =
|
|
1429
|
+
const output = trackBranchReads ? render3() : _chunkUBFDB6OLcjs.untrack.call(void 0, render3);
|
|
1429
1430
|
if (output == null || output === false) {
|
|
1430
1431
|
return;
|
|
1431
1432
|
}
|
|
@@ -1434,21 +1435,21 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
|
|
|
1434
1435
|
);
|
|
1435
1436
|
currentNodes = collectBetween();
|
|
1436
1437
|
} catch (err) {
|
|
1437
|
-
if (
|
|
1438
|
+
if (_chunkUBFDB6OLcjs.handleSuspend.call(void 0, err, root2)) {
|
|
1438
1439
|
handledError2 = true;
|
|
1439
|
-
|
|
1440
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, root2);
|
|
1440
1441
|
return;
|
|
1441
1442
|
}
|
|
1442
|
-
if (
|
|
1443
|
+
if (_chunkUBFDB6OLcjs.handleError.call(void 0, err, { source: "renderChild" }, root2)) {
|
|
1443
1444
|
handledError2 = true;
|
|
1444
|
-
|
|
1445
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, root2);
|
|
1445
1446
|
return;
|
|
1446
1447
|
}
|
|
1447
1448
|
throw err;
|
|
1448
1449
|
} finally {
|
|
1449
|
-
|
|
1450
|
+
_chunkUBFDB6OLcjs.popRoot.call(void 0, prev2);
|
|
1450
1451
|
if (!handledError2) {
|
|
1451
|
-
|
|
1452
|
+
_chunkUBFDB6OLcjs.flushOnMount.call(void 0, root2);
|
|
1452
1453
|
currentRoot = root2;
|
|
1453
1454
|
} else {
|
|
1454
1455
|
currentRoot = null;
|
|
@@ -1456,15 +1457,101 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
|
|
|
1456
1457
|
}
|
|
1457
1458
|
return;
|
|
1458
1459
|
}
|
|
1459
|
-
if (
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1460
|
+
if (!trackBranchReads) {
|
|
1461
|
+
if (lastCondition === cond && currentNodes.length > 0) {
|
|
1462
|
+
return;
|
|
1463
|
+
}
|
|
1464
|
+
if (lastCondition === cond && lastCondition === false && renderFalse === void 0) {
|
|
1465
|
+
return;
|
|
1466
|
+
}
|
|
1467
|
+
} else if (lastCondition === cond) {
|
|
1468
|
+
const render3 = cond ? renderTrue : renderFalse;
|
|
1469
|
+
if (!render3) {
|
|
1470
|
+
return;
|
|
1471
|
+
}
|
|
1472
|
+
let patched = false;
|
|
1473
|
+
const scratchRoot = _chunkUBFDB6OLcjs.createRootContext.call(void 0, hostRoot);
|
|
1474
|
+
const prevScratch = _chunkUBFDB6OLcjs.pushRoot.call(void 0, scratchRoot);
|
|
1475
|
+
let handledPatchError = false;
|
|
1476
|
+
let scratchOutput = null;
|
|
1477
|
+
try {
|
|
1478
|
+
const output = render3();
|
|
1479
|
+
scratchOutput = output;
|
|
1480
|
+
if (output != null && output !== false) {
|
|
1481
|
+
if (currentNodes.length === 1) {
|
|
1482
|
+
patched = patchNode(_nullishCoalesce(currentNodes[0], () => ( null)), output);
|
|
1483
|
+
}
|
|
1484
|
+
if (!patched && Array.isArray(output)) {
|
|
1485
|
+
patched = _patchFragmentChildren(currentNodes, output);
|
|
1486
|
+
}
|
|
1487
|
+
if (!patched && _isFragmentVNode(output)) {
|
|
1488
|
+
patched = _patchFragmentChildren(currentNodes, _optionalChain([output, 'access', _14 => _14.props, 'optionalAccess', _15 => _15.children]));
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
} catch (err) {
|
|
1492
|
+
if (_chunkUBFDB6OLcjs.handleSuspend.call(void 0, err, scratchRoot)) {
|
|
1493
|
+
handledPatchError = true;
|
|
1494
|
+
return;
|
|
1495
|
+
}
|
|
1496
|
+
if (_chunkUBFDB6OLcjs.handleError.call(void 0, err, { source: "renderChild" }, scratchRoot)) {
|
|
1497
|
+
handledPatchError = true;
|
|
1498
|
+
return;
|
|
1499
|
+
}
|
|
1500
|
+
throw err;
|
|
1501
|
+
} finally {
|
|
1502
|
+
_chunkUBFDB6OLcjs.popRoot.call(void 0, prevScratch);
|
|
1503
|
+
}
|
|
1504
|
+
if (handledPatchError) {
|
|
1505
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, scratchRoot);
|
|
1506
|
+
return;
|
|
1507
|
+
}
|
|
1508
|
+
if (patched) {
|
|
1509
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, scratchRoot);
|
|
1510
|
+
return;
|
|
1511
|
+
}
|
|
1512
|
+
lastCondition = cond;
|
|
1513
|
+
if (currentRoot) {
|
|
1514
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, currentRoot);
|
|
1515
|
+
currentRoot = null;
|
|
1516
|
+
}
|
|
1517
|
+
removeNodes(currentNodes);
|
|
1518
|
+
currentNodes = [];
|
|
1519
|
+
const prev2 = _chunkUBFDB6OLcjs.pushRoot.call(void 0, scratchRoot);
|
|
1520
|
+
let handledError2 = false;
|
|
1521
|
+
try {
|
|
1522
|
+
if (scratchOutput == null || scratchOutput === false) {
|
|
1523
|
+
return;
|
|
1524
|
+
}
|
|
1525
|
+
const el = createElementFn(scratchOutput);
|
|
1526
|
+
const nodes = toNodeArray(el);
|
|
1527
|
+
insertNodesBefore(parent, nodes, endMarker);
|
|
1528
|
+
currentNodes = nodes;
|
|
1529
|
+
} catch (err) {
|
|
1530
|
+
if (_chunkUBFDB6OLcjs.handleSuspend.call(void 0, err, scratchRoot)) {
|
|
1531
|
+
handledError2 = true;
|
|
1532
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, scratchRoot);
|
|
1533
|
+
return;
|
|
1534
|
+
}
|
|
1535
|
+
if (_chunkUBFDB6OLcjs.handleError.call(void 0, err, { source: "renderChild" }, scratchRoot)) {
|
|
1536
|
+
handledError2 = true;
|
|
1537
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, scratchRoot);
|
|
1538
|
+
return;
|
|
1539
|
+
}
|
|
1540
|
+
throw err;
|
|
1541
|
+
} finally {
|
|
1542
|
+
_chunkUBFDB6OLcjs.popRoot.call(void 0, prev2);
|
|
1543
|
+
if (!handledError2) {
|
|
1544
|
+
_chunkUBFDB6OLcjs.flushOnMount.call(void 0, scratchRoot);
|
|
1545
|
+
currentRoot = scratchRoot;
|
|
1546
|
+
} else {
|
|
1547
|
+
currentRoot = null;
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1463
1550
|
return;
|
|
1464
1551
|
}
|
|
1465
1552
|
lastCondition = cond;
|
|
1466
1553
|
if (currentRoot) {
|
|
1467
|
-
|
|
1554
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, currentRoot);
|
|
1468
1555
|
currentRoot = null;
|
|
1469
1556
|
}
|
|
1470
1557
|
removeNodes(currentNodes);
|
|
@@ -1473,11 +1560,11 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
|
|
|
1473
1560
|
if (!render2) {
|
|
1474
1561
|
return;
|
|
1475
1562
|
}
|
|
1476
|
-
const root =
|
|
1477
|
-
const prev =
|
|
1563
|
+
const root = _chunkUBFDB6OLcjs.createRootContext.call(void 0, hostRoot);
|
|
1564
|
+
const prev = _chunkUBFDB6OLcjs.pushRoot.call(void 0, root);
|
|
1478
1565
|
let handledError = false;
|
|
1479
1566
|
try {
|
|
1480
|
-
const output =
|
|
1567
|
+
const output = trackBranchReads ? render2() : _chunkUBFDB6OLcjs.untrack.call(void 0, render2);
|
|
1481
1568
|
if (output == null || output === false) {
|
|
1482
1569
|
return;
|
|
1483
1570
|
}
|
|
@@ -1486,28 +1573,28 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
|
|
|
1486
1573
|
insertNodesBefore(parent, nodes, endMarker);
|
|
1487
1574
|
currentNodes = nodes;
|
|
1488
1575
|
} catch (err) {
|
|
1489
|
-
if (
|
|
1576
|
+
if (_chunkUBFDB6OLcjs.handleSuspend.call(void 0, err, root)) {
|
|
1490
1577
|
handledError = true;
|
|
1491
|
-
|
|
1578
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, root);
|
|
1492
1579
|
return;
|
|
1493
1580
|
}
|
|
1494
|
-
if (
|
|
1581
|
+
if (_chunkUBFDB6OLcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
|
|
1495
1582
|
handledError = true;
|
|
1496
|
-
|
|
1583
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, root);
|
|
1497
1584
|
return;
|
|
1498
1585
|
}
|
|
1499
1586
|
throw err;
|
|
1500
1587
|
} finally {
|
|
1501
|
-
|
|
1588
|
+
_chunkUBFDB6OLcjs.popRoot.call(void 0, prev);
|
|
1502
1589
|
if (!handledError) {
|
|
1503
|
-
|
|
1590
|
+
_chunkUBFDB6OLcjs.flushOnMount.call(void 0, root);
|
|
1504
1591
|
currentRoot = root;
|
|
1505
1592
|
} else {
|
|
1506
1593
|
currentRoot = null;
|
|
1507
1594
|
}
|
|
1508
1595
|
}
|
|
1509
1596
|
};
|
|
1510
|
-
const dispose =
|
|
1597
|
+
const dispose = _chunkUBFDB6OLcjs.createRenderEffect.call(void 0, runConditional);
|
|
1511
1598
|
return {
|
|
1512
1599
|
marker: fragment,
|
|
1513
1600
|
flush: () => {
|
|
@@ -1518,38 +1605,38 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
|
|
|
1518
1605
|
dispose: () => {
|
|
1519
1606
|
dispose();
|
|
1520
1607
|
if (currentRoot) {
|
|
1521
|
-
|
|
1608
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, currentRoot);
|
|
1522
1609
|
}
|
|
1523
1610
|
removeNodes(currentNodes);
|
|
1524
1611
|
currentNodes = [];
|
|
1525
|
-
_optionalChain([startMarker, 'access',
|
|
1526
|
-
_optionalChain([endMarker, 'access',
|
|
1612
|
+
_optionalChain([startMarker, 'access', _16 => _16.parentNode, 'optionalAccess', _17 => _17.removeChild, 'call', _18 => _18(startMarker)]);
|
|
1613
|
+
_optionalChain([endMarker, 'access', _19 => _19.parentNode, 'optionalAccess', _20 => _20.removeChild, 'call', _21 => _21(endMarker)]);
|
|
1527
1614
|
}
|
|
1528
1615
|
};
|
|
1529
1616
|
}
|
|
1530
1617
|
function createShow(el, condition, displayValue) {
|
|
1531
1618
|
const originalDisplay = _nullishCoalesce(displayValue, () => ( el.style.display));
|
|
1532
|
-
|
|
1619
|
+
_chunkUBFDB6OLcjs.createRenderEffect.call(void 0, () => {
|
|
1533
1620
|
el.style.display = condition() ? originalDisplay : "none";
|
|
1534
1621
|
});
|
|
1535
1622
|
}
|
|
1536
1623
|
function createPortal(container, render2, createElementFn) {
|
|
1537
|
-
const parentRoot =
|
|
1624
|
+
const parentRoot = _chunkUBFDB6OLcjs.getCurrentRoot.call(void 0, );
|
|
1538
1625
|
const marker = document.createComment("fict:portal");
|
|
1539
1626
|
container.appendChild(marker);
|
|
1540
1627
|
let currentNodes = [];
|
|
1541
1628
|
let currentRoot = null;
|
|
1542
|
-
const dispose =
|
|
1629
|
+
const dispose = _chunkUBFDB6OLcjs.createRenderEffect.call(void 0, () => {
|
|
1543
1630
|
if (currentRoot) {
|
|
1544
|
-
|
|
1631
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, currentRoot);
|
|
1545
1632
|
currentRoot = null;
|
|
1546
1633
|
}
|
|
1547
1634
|
if (currentNodes.length > 0) {
|
|
1548
1635
|
removeNodes(currentNodes);
|
|
1549
1636
|
currentNodes = [];
|
|
1550
1637
|
}
|
|
1551
|
-
const root =
|
|
1552
|
-
const prev =
|
|
1638
|
+
const root = _chunkUBFDB6OLcjs.createRootContext.call(void 0, parentRoot);
|
|
1639
|
+
const prev = _chunkUBFDB6OLcjs.pushRoot.call(void 0, root);
|
|
1553
1640
|
let handledError = false;
|
|
1554
1641
|
try {
|
|
1555
1642
|
const output = render2();
|
|
@@ -1562,23 +1649,23 @@ function createPortal(container, render2, createElementFn) {
|
|
|
1562
1649
|
currentNodes = nodes;
|
|
1563
1650
|
}
|
|
1564
1651
|
} catch (err) {
|
|
1565
|
-
if (
|
|
1652
|
+
if (_chunkUBFDB6OLcjs.handleSuspend.call(void 0, err, root)) {
|
|
1566
1653
|
handledError = true;
|
|
1567
|
-
|
|
1654
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, root);
|
|
1568
1655
|
currentNodes = [];
|
|
1569
1656
|
return;
|
|
1570
1657
|
}
|
|
1571
|
-
if (
|
|
1658
|
+
if (_chunkUBFDB6OLcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
|
|
1572
1659
|
handledError = true;
|
|
1573
|
-
|
|
1660
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, root);
|
|
1574
1661
|
currentNodes = [];
|
|
1575
1662
|
return;
|
|
1576
1663
|
}
|
|
1577
1664
|
throw err;
|
|
1578
1665
|
} finally {
|
|
1579
|
-
|
|
1666
|
+
_chunkUBFDB6OLcjs.popRoot.call(void 0, prev);
|
|
1580
1667
|
if (!handledError) {
|
|
1581
|
-
|
|
1668
|
+
_chunkUBFDB6OLcjs.flushOnMount.call(void 0, root);
|
|
1582
1669
|
currentRoot = root;
|
|
1583
1670
|
} else {
|
|
1584
1671
|
currentRoot = null;
|
|
@@ -1588,12 +1675,12 @@ function createPortal(container, render2, createElementFn) {
|
|
|
1588
1675
|
const portalDispose = () => {
|
|
1589
1676
|
dispose();
|
|
1590
1677
|
if (currentRoot) {
|
|
1591
|
-
|
|
1678
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, currentRoot);
|
|
1592
1679
|
}
|
|
1593
1680
|
if (currentNodes.length > 0) {
|
|
1594
1681
|
removeNodes(currentNodes);
|
|
1595
1682
|
}
|
|
1596
|
-
_optionalChain([marker, 'access',
|
|
1683
|
+
_optionalChain([marker, 'access', _22 => _22.parentNode, 'optionalAccess', _23 => _23.removeChild, 'call', _24 => _24(marker)]);
|
|
1597
1684
|
};
|
|
1598
1685
|
if (parentRoot) {
|
|
1599
1686
|
parentRoot.destroyCallbacks.push(portalDispose);
|
|
@@ -1603,6 +1690,96 @@ function createPortal(container, render2, createElementFn) {
|
|
|
1603
1690
|
dispose: portalDispose
|
|
1604
1691
|
};
|
|
1605
1692
|
}
|
|
1693
|
+
function patchElement(el, output) {
|
|
1694
|
+
if (output && typeof output === "object" && !(output instanceof Node)) {
|
|
1695
|
+
const vnode = output;
|
|
1696
|
+
if (typeof vnode.type === "string" && vnode.type.toLowerCase() === el.tagName.toLowerCase()) {
|
|
1697
|
+
const children = _optionalChain([vnode, 'access', _25 => _25.props, 'optionalAccess', _26 => _26.children]);
|
|
1698
|
+
const props = _nullishCoalesce(vnode.props, () => ( {}));
|
|
1699
|
+
for (const [key, value] of Object.entries(props)) {
|
|
1700
|
+
if (key === "children" || key === "key") continue;
|
|
1701
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value === null || value === void 0) {
|
|
1702
|
+
if (key === "class" || key === "className") {
|
|
1703
|
+
el.setAttribute("class", value === false || value === null ? "" : String(value));
|
|
1704
|
+
} else if (key === "style" && typeof value === "string") {
|
|
1705
|
+
;
|
|
1706
|
+
el.style.cssText = value;
|
|
1707
|
+
} else if (value === false || value === null || value === void 0) {
|
|
1708
|
+
el.removeAttribute(key);
|
|
1709
|
+
} else if (value === true) {
|
|
1710
|
+
el.setAttribute(key, "");
|
|
1711
|
+
} else {
|
|
1712
|
+
el.setAttribute(key, String(value));
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
if (typeof children === "string" || typeof children === "number" || children === null || children === void 0 || children === false) {
|
|
1717
|
+
el.textContent = children === null || children === void 0 || children === false ? "" : String(children);
|
|
1718
|
+
return true;
|
|
1719
|
+
}
|
|
1720
|
+
if (children && typeof children === "object" && !Array.isArray(children) && !(children instanceof Node)) {
|
|
1721
|
+
const childVNode = children;
|
|
1722
|
+
if (typeof childVNode.type === "string") {
|
|
1723
|
+
const childEl = el.querySelector(childVNode.type);
|
|
1724
|
+
if (childEl && patchElement(childEl, children)) {
|
|
1725
|
+
return true;
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
return false;
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
return false;
|
|
1733
|
+
}
|
|
1734
|
+
function patchNode(currentNode, nextOutput) {
|
|
1735
|
+
if (!currentNode) return false;
|
|
1736
|
+
if (currentNode instanceof Text && (nextOutput === null || nextOutput === void 0 || nextOutput === false || typeof nextOutput === "string" || typeof nextOutput === "number" || nextOutput instanceof Text)) {
|
|
1737
|
+
const nextText = nextOutput instanceof Text ? nextOutput.data : nextOutput === null || nextOutput === void 0 || nextOutput === false ? "" : String(nextOutput);
|
|
1738
|
+
currentNode.data = nextText;
|
|
1739
|
+
return true;
|
|
1740
|
+
}
|
|
1741
|
+
if (currentNode instanceof Element && patchElement(currentNode, nextOutput)) {
|
|
1742
|
+
return true;
|
|
1743
|
+
}
|
|
1744
|
+
if (nextOutput instanceof Node && currentNode === nextOutput) {
|
|
1745
|
+
return true;
|
|
1746
|
+
}
|
|
1747
|
+
return false;
|
|
1748
|
+
}
|
|
1749
|
+
function _isFragmentVNode(value) {
|
|
1750
|
+
return value != null && typeof value === "object" && !(value instanceof Node) && value.type === Fragment;
|
|
1751
|
+
}
|
|
1752
|
+
function normalizeChildren(children, result = []) {
|
|
1753
|
+
if (children === void 0) {
|
|
1754
|
+
return result;
|
|
1755
|
+
}
|
|
1756
|
+
if (Array.isArray(children)) {
|
|
1757
|
+
for (const child of children) {
|
|
1758
|
+
normalizeChildren(child, result);
|
|
1759
|
+
}
|
|
1760
|
+
return result;
|
|
1761
|
+
}
|
|
1762
|
+
if (children === null || children === false) {
|
|
1763
|
+
return result;
|
|
1764
|
+
}
|
|
1765
|
+
if (_isFragmentVNode(children)) {
|
|
1766
|
+
return normalizeChildren(_optionalChain([children, 'access', _27 => _27.props, 'optionalAccess', _28 => _28.children]), result);
|
|
1767
|
+
}
|
|
1768
|
+
result.push(children);
|
|
1769
|
+
return result;
|
|
1770
|
+
}
|
|
1771
|
+
function _patchFragmentChildren(nodes, children) {
|
|
1772
|
+
const normalized = normalizeChildren(children);
|
|
1773
|
+
if (normalized.length !== nodes.length) {
|
|
1774
|
+
return false;
|
|
1775
|
+
}
|
|
1776
|
+
for (let i = 0; i < normalized.length; i++) {
|
|
1777
|
+
if (!patchNode(nodes[i], normalized[i])) {
|
|
1778
|
+
return false;
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
return true;
|
|
1782
|
+
}
|
|
1606
1783
|
|
|
1607
1784
|
// src/props.ts
|
|
1608
1785
|
var PROP_GETTER_MARKER2 = Symbol.for("fict:prop-getter");
|
|
@@ -1662,10 +1839,10 @@ function isExplicitReactiveFn2(value) {
|
|
|
1662
1839
|
function normalizePropsFunction(value) {
|
|
1663
1840
|
if (typeof value !== "function") return value;
|
|
1664
1841
|
if (value.length !== 0) return value;
|
|
1665
|
-
if (isPropGetter(value) ||
|
|
1842
|
+
if (isPropGetter(value) || _chunkUBFDB6OLcjs.isSignal.call(void 0, value) || _chunkUBFDB6OLcjs.isComputed.call(void 0, value) || isExplicitReactiveFn2(value)) {
|
|
1666
1843
|
return value;
|
|
1667
1844
|
}
|
|
1668
|
-
if (
|
|
1845
|
+
if (_chunkUBFDB6OLcjs.isEffect.call(void 0, value) || _chunkUBFDB6OLcjs.isEffectScope.call(void 0, value) || isNonReactiveFn2(value)) return value;
|
|
1669
1846
|
return markNonReactiveFn(value);
|
|
1670
1847
|
}
|
|
1671
1848
|
function createPropsProxy(props) {
|
|
@@ -1802,9 +1979,9 @@ function prop(getter, options) {
|
|
|
1802
1979
|
return getter;
|
|
1803
1980
|
}
|
|
1804
1981
|
const fn = getter;
|
|
1805
|
-
const unwrap2 = _optionalChain([options, 'optionalAccess',
|
|
1982
|
+
const unwrap2 = _optionalChain([options, 'optionalAccess', _29 => _29.unwrap]) !== false;
|
|
1806
1983
|
return __fictProp(
|
|
1807
|
-
|
|
1984
|
+
_chunkUBFDB6OLcjs.createMemo.call(void 0, () => {
|
|
1808
1985
|
const value = fn();
|
|
1809
1986
|
if (unwrap2 && isPropGetter(value)) {
|
|
1810
1987
|
return value();
|
|
@@ -1817,15 +1994,15 @@ function prop(getter, options) {
|
|
|
1817
1994
|
// src/dom.ts
|
|
1818
1995
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
1819
1996
|
var MATHML_NS = "http://www.w3.org/1998/Math/MathML";
|
|
1820
|
-
var isDev2 = typeof __DEV__ !== "undefined" ? __DEV__ : typeof process !== "undefined" && _optionalChain([process, 'access',
|
|
1997
|
+
var isDev2 = typeof __DEV__ !== "undefined" ? __DEV__ : typeof process !== "undefined" && _optionalChain([process, 'access', _30 => _30.env, 'optionalAccess', _31 => _31.NODE_ENV]) !== "production";
|
|
1821
1998
|
var nextComponentId = 1;
|
|
1822
1999
|
function render(view, container) {
|
|
1823
|
-
const root =
|
|
1824
|
-
const prev =
|
|
2000
|
+
const root = _chunkUBFDB6OLcjs.createRootContext.call(void 0, );
|
|
2001
|
+
const prev = _chunkUBFDB6OLcjs.pushRoot.call(void 0, root);
|
|
1825
2002
|
let dom = void 0;
|
|
1826
2003
|
try {
|
|
1827
2004
|
const output = view();
|
|
1828
|
-
if (
|
|
2005
|
+
if (_chunkUBFDB6OLcjs.__fictIsHydrating.call(void 0, )) {
|
|
1829
2006
|
withHydration(container, () => {
|
|
1830
2007
|
dom = createElement(output);
|
|
1831
2008
|
});
|
|
@@ -1833,35 +2010,35 @@ function render(view, container) {
|
|
|
1833
2010
|
dom = createElement(output);
|
|
1834
2011
|
}
|
|
1835
2012
|
} finally {
|
|
1836
|
-
|
|
2013
|
+
_chunkUBFDB6OLcjs.popRoot.call(void 0, prev);
|
|
1837
2014
|
}
|
|
1838
|
-
if (!
|
|
2015
|
+
if (!_chunkUBFDB6OLcjs.__fictIsHydrating.call(void 0, )) {
|
|
1839
2016
|
container.replaceChildren(dom);
|
|
1840
2017
|
}
|
|
1841
2018
|
container.setAttribute("data-fict-fine-grained", "1");
|
|
1842
|
-
|
|
2019
|
+
_chunkUBFDB6OLcjs.flushOnMount.call(void 0, root);
|
|
1843
2020
|
const teardown = () => {
|
|
1844
|
-
|
|
2021
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, root);
|
|
1845
2022
|
container.innerHTML = "";
|
|
1846
2023
|
};
|
|
1847
2024
|
return teardown;
|
|
1848
2025
|
}
|
|
1849
2026
|
function hydrateComponent(view, container) {
|
|
1850
|
-
const root =
|
|
1851
|
-
const prev =
|
|
1852
|
-
|
|
2027
|
+
const root = _chunkUBFDB6OLcjs.createRootContext.call(void 0, );
|
|
2028
|
+
const prev = _chunkUBFDB6OLcjs.pushRoot.call(void 0, root);
|
|
2029
|
+
_chunkUBFDB6OLcjs.__fictEnterHydration.call(void 0, );
|
|
1853
2030
|
try {
|
|
1854
2031
|
withHydration(container, () => {
|
|
1855
2032
|
view();
|
|
1856
2033
|
});
|
|
1857
2034
|
} finally {
|
|
1858
|
-
|
|
1859
|
-
|
|
2035
|
+
_chunkUBFDB6OLcjs.__fictExitHydration.call(void 0, );
|
|
2036
|
+
_chunkUBFDB6OLcjs.popRoot.call(void 0, prev);
|
|
1860
2037
|
}
|
|
1861
2038
|
container.setAttribute("data-fict-fine-grained", "1");
|
|
1862
|
-
|
|
2039
|
+
_chunkUBFDB6OLcjs.flushOnMount.call(void 0, root);
|
|
1863
2040
|
const teardown = () => {
|
|
1864
|
-
|
|
2041
|
+
_chunkUBFDB6OLcjs.destroyRoot.call(void 0, root);
|
|
1865
2042
|
};
|
|
1866
2043
|
return teardown;
|
|
1867
2044
|
}
|
|
@@ -1873,7 +2050,7 @@ function resolveNamespace(tagName, namespace) {
|
|
|
1873
2050
|
if (tagName === "math") return "mathml";
|
|
1874
2051
|
if (namespace === "mathml") return "mathml";
|
|
1875
2052
|
if (namespace === "svg") return "svg";
|
|
1876
|
-
if (isDev2 &&
|
|
2053
|
+
if (isDev2 && _chunkUBFDB6OLcjs.SVGElements.has(tagName)) return "svg";
|
|
1877
2054
|
return null;
|
|
1878
2055
|
}
|
|
1879
2056
|
function createElementWithContext(node, namespace) {
|
|
@@ -1897,7 +2074,7 @@ function createElementWithContext(node, namespace) {
|
|
|
1897
2074
|
if ("marker" in node) {
|
|
1898
2075
|
const handle = node;
|
|
1899
2076
|
if (typeof handle.dispose === "function") {
|
|
1900
|
-
|
|
2077
|
+
_chunkUBFDB6OLcjs.registerRootCleanup.call(void 0, handle.dispose);
|
|
1901
2078
|
}
|
|
1902
2079
|
if (typeof handle.flush === "function") {
|
|
1903
2080
|
const runFlush = () => handle.flush && handle.flush();
|
|
@@ -1948,13 +2125,13 @@ function createElementWithContext(node, namespace) {
|
|
|
1948
2125
|
}
|
|
1949
2126
|
});
|
|
1950
2127
|
const props = createPropsProxy(baseProps);
|
|
1951
|
-
const hook = isDev2 ?
|
|
1952
|
-
const parentId = hook ?
|
|
2128
|
+
const hook = isDev2 ? _chunkUBFDB6OLcjs.getDevtoolsHook.call(void 0, ) : void 0;
|
|
2129
|
+
const parentId = hook ? _chunkUBFDB6OLcjs.__fictGetCurrentComponentId.call(void 0, ) : void 0;
|
|
1953
2130
|
const componentId = hook ? nextComponentId++ : void 0;
|
|
1954
|
-
if (_optionalChain([hook, 'optionalAccess',
|
|
2131
|
+
if (_optionalChain([hook, 'optionalAccess', _32 => _32.registerComponent]) && componentId !== void 0) {
|
|
1955
2132
|
hook.registerComponent(componentId, vnode.type.name || "Anonymous", parentId);
|
|
1956
2133
|
}
|
|
1957
|
-
const ctx =
|
|
2134
|
+
const ctx = _chunkUBFDB6OLcjs.__fictPushContext.call(void 0, );
|
|
1958
2135
|
if (componentId !== void 0) {
|
|
1959
2136
|
ctx.componentId = componentId;
|
|
1960
2137
|
if (parentId !== void 0) {
|
|
@@ -1964,12 +2141,12 @@ function createElementWithContext(node, namespace) {
|
|
|
1964
2141
|
try {
|
|
1965
2142
|
const rendered = vnode.type(props);
|
|
1966
2143
|
if (hook && componentId !== void 0) {
|
|
1967
|
-
|
|
1968
|
-
_optionalChain([hook, 'access',
|
|
2144
|
+
_chunkUBFDB6OLcjs.onMount.call(void 0, () => {
|
|
2145
|
+
_optionalChain([hook, 'access', _33 => _33.componentMount, 'optionalCall', _34 => _34(componentId)]);
|
|
1969
2146
|
});
|
|
1970
|
-
|
|
2147
|
+
_chunkUBFDB6OLcjs.onCleanup.call(void 0, () => _optionalChain([hook, 'access', _35 => _35.componentUnmount, 'optionalCall', _36 => _36(componentId)]));
|
|
1971
2148
|
}
|
|
1972
|
-
if (
|
|
2149
|
+
if (_chunkUBFDB6OLcjs.__fictIsResumable.call(void 0, ) && !_chunkUBFDB6OLcjs.__fictIsHydrating.call(void 0, )) {
|
|
1973
2150
|
const content = createElementWithContext(rendered, namespace);
|
|
1974
2151
|
const host = namespace === "svg" ? document.createElementNS(SVG_NS, "fict-host") : namespace === "mathml" ? document.createElementNS(MATHML_NS, "fict-host") : document.createElement("fict-host");
|
|
1975
2152
|
host.setAttribute("data-fict-host", "");
|
|
@@ -1978,9 +2155,9 @@ function createElementWithContext(node, namespace) {
|
|
|
1978
2155
|
host.style.display = "contents";
|
|
1979
2156
|
}
|
|
1980
2157
|
const meta = vnode.type.__fictMeta;
|
|
1981
|
-
const typeKey = (_nullishCoalesce(_optionalChain([meta, 'optionalAccess',
|
|
1982
|
-
|
|
1983
|
-
if (_optionalChain([meta, 'optionalAccess',
|
|
2158
|
+
const typeKey = (_nullishCoalesce(_optionalChain([meta, 'optionalAccess', _37 => _37.id]), () => ( vnode.type.name))) || "Anonymous";
|
|
2159
|
+
_chunkUBFDB6OLcjs.__fictRegisterScope.call(void 0, ctx, host, typeKey, rawProps);
|
|
2160
|
+
if (_optionalChain([meta, 'optionalAccess', _38 => _38.resume])) {
|
|
1984
2161
|
host.setAttribute("data-fict-h", meta.resume);
|
|
1985
2162
|
}
|
|
1986
2163
|
if (content instanceof DocumentFragment) {
|
|
@@ -1992,18 +2169,18 @@ function createElementWithContext(node, namespace) {
|
|
|
1992
2169
|
}
|
|
1993
2170
|
return createElementWithContext(rendered, namespace);
|
|
1994
2171
|
} catch (err) {
|
|
1995
|
-
if (
|
|
2172
|
+
if (_chunkUBFDB6OLcjs.handleSuspend.call(void 0, err)) {
|
|
1996
2173
|
return document.createComment("fict:suspend");
|
|
1997
2174
|
}
|
|
1998
|
-
|
|
2175
|
+
_chunkUBFDB6OLcjs.handleError.call(void 0, err, { source: "render", componentName: vnode.type.name });
|
|
1999
2176
|
throw err;
|
|
2000
2177
|
} finally {
|
|
2001
|
-
|
|
2178
|
+
_chunkUBFDB6OLcjs.__fictPopContext.call(void 0, );
|
|
2002
2179
|
}
|
|
2003
2180
|
}
|
|
2004
2181
|
if (vnode.type === Fragment) {
|
|
2005
2182
|
const frag = document.createDocumentFragment();
|
|
2006
|
-
const children = _optionalChain([vnode, 'access',
|
|
2183
|
+
const children = _optionalChain([vnode, 'access', _39 => _39.props, 'optionalAccess', _40 => _40.children]);
|
|
2007
2184
|
appendChildren(frag, children, namespace);
|
|
2008
2185
|
return frag;
|
|
2009
2186
|
}
|
|
@@ -2013,7 +2190,7 @@ function createElementWithContext(node, namespace) {
|
|
|
2013
2190
|
applyProps(el, _nullishCoalesce(vnode.props, () => ( {})), resolvedNamespace === "svg");
|
|
2014
2191
|
appendChildren(
|
|
2015
2192
|
el,
|
|
2016
|
-
_optionalChain([vnode, 'access',
|
|
2193
|
+
_optionalChain([vnode, 'access', _41 => _41.props, 'optionalAccess', _42 => _42.children]),
|
|
2017
2194
|
tagName === "foreignObject" ? null : resolvedNamespace
|
|
2018
2195
|
);
|
|
2019
2196
|
return el;
|
|
@@ -2083,7 +2260,7 @@ function appendChildNode(parent, child, namespace) {
|
|
|
2083
2260
|
}
|
|
2084
2261
|
if (isBindingHandle(child)) {
|
|
2085
2262
|
appendChildNode(parent, child.marker, namespace);
|
|
2086
|
-
_optionalChain([child, 'access',
|
|
2263
|
+
_optionalChain([child, 'access', _43 => _43.flush, 'optionalCall', _44 => _44()]);
|
|
2087
2264
|
return;
|
|
2088
2265
|
}
|
|
2089
2266
|
if (typeof child === "function") {
|
|
@@ -2141,9 +2318,9 @@ function applyRef(el, value) {
|
|
|
2141
2318
|
if (typeof value === "function") {
|
|
2142
2319
|
const refFn = value;
|
|
2143
2320
|
refFn(el);
|
|
2144
|
-
const root =
|
|
2321
|
+
const root = _chunkUBFDB6OLcjs.getCurrentRoot.call(void 0, );
|
|
2145
2322
|
if (root) {
|
|
2146
|
-
|
|
2323
|
+
_chunkUBFDB6OLcjs.registerRootCleanup.call(void 0, () => {
|
|
2147
2324
|
refFn(null);
|
|
2148
2325
|
});
|
|
2149
2326
|
} else if (isDev2) {
|
|
@@ -2154,9 +2331,9 @@ function applyRef(el, value) {
|
|
|
2154
2331
|
} else if (value && typeof value === "object" && "current" in value) {
|
|
2155
2332
|
const refObj = value;
|
|
2156
2333
|
refObj.current = el;
|
|
2157
|
-
const root =
|
|
2334
|
+
const root = _chunkUBFDB6OLcjs.getCurrentRoot.call(void 0, );
|
|
2158
2335
|
if (root) {
|
|
2159
|
-
|
|
2336
|
+
_chunkUBFDB6OLcjs.registerRootCleanup.call(void 0, () => {
|
|
2160
2337
|
refObj.current = null;
|
|
2161
2338
|
});
|
|
2162
2339
|
} else if (isDev2) {
|
|
@@ -2230,7 +2407,7 @@ function applyProps(el, props, isSVG = false) {
|
|
|
2230
2407
|
}
|
|
2231
2408
|
continue;
|
|
2232
2409
|
}
|
|
2233
|
-
if (isDev2 &&
|
|
2410
|
+
if (isDev2 && _chunkUBFDB6OLcjs.ChildProperties.has(key) || key === "innerHTML" || key === "textContent" || key === "innerText" || key === "children") {
|
|
2234
2411
|
createAttributeBinding(el, key, value, setProperty);
|
|
2235
2412
|
continue;
|
|
2236
2413
|
}
|
|
@@ -2246,8 +2423,8 @@ function applyProps(el, props, isSVG = false) {
|
|
|
2246
2423
|
createAttributeBinding(el, key.slice(5), value, setProperty);
|
|
2247
2424
|
continue;
|
|
2248
2425
|
}
|
|
2249
|
-
const propAlias = !isSVG && isDev2 ?
|
|
2250
|
-
const isProperty = !isSVG ? isDev2 ?
|
|
2426
|
+
const propAlias = !isSVG && isDev2 ? _chunkUBFDB6OLcjs.getPropAlias.call(void 0, key, tagName) : void 0;
|
|
2427
|
+
const isProperty = !isSVG ? isDev2 ? _chunkUBFDB6OLcjs.Properties.has(key) : key in el : false;
|
|
2251
2428
|
if (propAlias || isProperty || isCE && !isSVG) {
|
|
2252
2429
|
const propName = propAlias || key;
|
|
2253
2430
|
if (isCE && !isProperty && !propAlias) {
|
|
@@ -2264,7 +2441,7 @@ function applyProps(el, props, isSVG = false) {
|
|
|
2264
2441
|
}
|
|
2265
2442
|
if (isSVG && key.indexOf(":") > -1) {
|
|
2266
2443
|
const [prefix, name] = key.split(":");
|
|
2267
|
-
const ns =
|
|
2444
|
+
const ns = _chunkUBFDB6OLcjs.SVGNamespace[prefix];
|
|
2268
2445
|
if (ns) {
|
|
2269
2446
|
createAttributeBinding(
|
|
2270
2447
|
el,
|
|
@@ -2406,5 +2583,5 @@ function eventNameFromProp(key) {
|
|
|
2406
2583
|
|
|
2407
2584
|
|
|
2408
2585
|
|
|
2409
|
-
exports.
|
|
2410
|
-
//# sourceMappingURL=chunk-
|
|
2586
|
+
exports.startTransition = startTransition; exports.useTransition = useTransition; exports.useDeferredValue = useDeferredValue; exports.batch = batch2; exports.untrack = untrack2; exports.Fragment = Fragment; exports.withHydrationRange = withHydrationRange; exports.isHydratingActive = isHydratingActive; exports.toNodeArray = toNodeArray; exports.insertNodesBefore = insertNodesBefore; exports.removeNodes = removeNodes; exports.getSlotEnd = getSlotEnd; exports.resolvePath = resolvePath; exports.isReactive = isReactive; exports.nonReactive = nonReactive; exports.reactive = reactive; exports.unwrap = unwrap; exports.callEventHandler = callEventHandler; exports.createTextBinding = createTextBinding; exports.bindText = bindText; exports.setText = setText; exports.createAttributeBinding = createAttributeBinding; exports.bindAttribute = bindAttribute; exports.setAttr = setAttr; exports.bindProperty = bindProperty; exports.setProp = setProp; exports.createStyleBinding = createStyleBinding; exports.bindStyle = bindStyle; exports.setStyle = setStyle; exports.createClassBinding = createClassBinding; exports.bindClass = bindClass; exports.setClass = setClass; exports.classList = classList; exports.insert = insert; exports.insertBetween = insertBetween; exports.createChildBinding = createChildBinding; exports.delegateEvents = delegateEvents; exports.clearDelegatedEvents = clearDelegatedEvents; exports.addEventListener = addEventListener; exports.bindEvent = bindEvent; exports.bindRef = bindRef; exports.spread = spread; exports.assign = assign; exports.createConditional = createConditional; exports.createShow = createShow; exports.createPortal = createPortal; exports.__fictProp = __fictProp; exports.createPropsProxy = createPropsProxy; exports.__fictPropsRest = __fictPropsRest; exports.mergeProps = mergeProps; exports.keyed = keyed; exports.prop = prop; exports.render = render; exports.hydrateComponent = hydrateComponent; exports.createElement = createElement; exports.template = template;
|
|
2587
|
+
//# sourceMappingURL=chunk-OAM7HABA.cjs.map
|