marko 6.0.0-next.3.59 → 6.0.0-next.3.61
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/common/accessor.d.ts +24 -0
- package/dist/common/accessor.debug.d.ts +24 -0
- package/dist/common/types.d.ts +2 -17
- package/dist/debug/dom.js +348 -183
- package/dist/debug/dom.mjs +348 -183
- package/dist/debug/html.js +123 -44
- package/dist/debug/html.mjs +123 -44
- package/dist/dom/control-flow.d.ts +5 -0
- package/dist/dom/queue.d.ts +2 -1
- package/dist/dom/scope.d.ts +1 -0
- package/dist/dom.d.ts +2 -2
- package/dist/dom.js +282 -159
- package/dist/dom.mjs +282 -159
- package/dist/html/dynamic-tag.d.ts +3 -4
- package/dist/html/serializer.d.ts +2 -1
- package/dist/html/writer.d.ts +2 -3
- package/dist/html.js +107 -39
- package/dist/html.mjs +107 -39
- package/dist/translator/core/await.d.ts +7 -0
- package/dist/translator/core/try.d.ts +7 -0
- package/dist/translator/index.js +222 -43
- package/dist/translator/util/get-accessor-char.d.ts +4 -0
- package/dist/translator/util/sections.d.ts +1 -1
- package/package.json +1 -1
package/dist/dom.js
CHANGED
@@ -22,6 +22,7 @@ __export(dom_exports, {
|
|
22
22
|
attrTags: () => attrTags,
|
23
23
|
attrs: () => attrs,
|
24
24
|
attrsEvents: () => attrsEvents,
|
25
|
+
awaitTag: () => awaitTag,
|
25
26
|
classAttr: () => classAttr,
|
26
27
|
compat: () => compat,
|
27
28
|
conditional: () => conditional,
|
@@ -41,11 +42,13 @@ __export(dom_exports, {
|
|
41
42
|
createContent: () => createContent,
|
42
43
|
createRenderer: () => createRenderer,
|
43
44
|
createTemplate: () => createTemplate,
|
45
|
+
createTry: () => createTry,
|
44
46
|
data: () => data,
|
45
47
|
dynamicClosure: () => dynamicClosure,
|
46
48
|
dynamicClosureRead: () => dynamicClosureRead,
|
47
49
|
dynamicTag: () => dynamicTag,
|
48
50
|
effect: () => effect,
|
51
|
+
enableCatch: () => enableCatch,
|
49
52
|
forIn: () => forIn,
|
50
53
|
forOf: () => forOf,
|
51
54
|
forTo: () => forTo,
|
@@ -233,11 +236,11 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
|
|
233
236
|
commentPrefixLen + 1,
|
234
237
|
dataIndex ? dataIndex - 1 : commentText.length
|
235
238
|
), scope = scopeLookup[scopeId] ||= {
|
236
|
-
|
239
|
+
e: +scopeId
|
237
240
|
}, data2 = dataIndex ? commentText.slice(dataIndex) : "", token = commentText[commentPrefixLen];
|
238
241
|
if (token === "*" /* Node */) {
|
239
242
|
let node = scope[data2] = visit.previousSibling;
|
240
|
-
scope[
|
243
|
+
scope["j" /* Getter */ + data2] = () => node;
|
241
244
|
} else if (token === "$" /* ClosestBranch */)
|
242
245
|
closestBranchMarkers.set(scopeId, visit);
|
243
246
|
else if (token === "[" /* BranchStart */)
|
@@ -275,14 +278,14 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
|
|
275
278
|
for (let scopeId in scopes)
|
276
279
|
if (scopeId !== "$") {
|
277
280
|
let scope = scopes[scopeId], prevScope = scopeLookup[scopeId];
|
278
|
-
scope.$global = $global, scope.
|
281
|
+
scope.$global = $global, scope.e = +scopeId, prevScope !== scope && (scopeLookup[scopeId] = Object.assign(
|
279
282
|
scope,
|
280
283
|
prevScope
|
281
284
|
));
|
282
285
|
let parentBranchId = parentBranchIds.get(scopeId);
|
283
286
|
if (parentBranchId && (scope.c = scopes[parentBranchId]), branchIds.has(scopeId)) {
|
284
287
|
let branch = scope, parentBranch = branch.c;
|
285
|
-
scope.c = branch, parentBranch && (branch.
|
288
|
+
scope.c = branch, parentBranch && (branch.g = parentBranch, (parentBranch.p ||= /* @__PURE__ */ new Set()).add(
|
286
289
|
branch
|
287
290
|
));
|
288
291
|
}
|
@@ -338,7 +341,7 @@ function controllable_input_checked(scope, nodeAccessor, checked, checkedChange)
|
|
338
341
|
function controllable_input_checked_effect(scope, nodeAccessor) {
|
339
342
|
let el = scope[nodeAccessor];
|
340
343
|
syncControllable(el, "input", hasCheckboxChanged, () => {
|
341
|
-
let checkedChange = scope[
|
344
|
+
let checkedChange = scope["e" /* ControlledHandler */ + nodeAccessor];
|
342
345
|
if (checkedChange) {
|
343
346
|
let newValue = el.checked;
|
344
347
|
el.checked = !newValue, checkedChange(newValue), run();
|
@@ -346,7 +349,7 @@ function controllable_input_checked_effect(scope, nodeAccessor) {
|
|
346
349
|
});
|
347
350
|
}
|
348
351
|
function controllable_input_checkedValue(scope, nodeAccessor, checkedValue, checkedValueChange, value2) {
|
349
|
-
scope[
|
352
|
+
scope["g" /* ControlledValue */ + nodeAccessor] = checkedValue, attr(scope[nodeAccessor], "value", value2), setCheckboxValue(
|
350
353
|
scope,
|
351
354
|
nodeAccessor,
|
352
355
|
1 /* InputCheckedValue */,
|
@@ -357,9 +360,9 @@ function controllable_input_checkedValue(scope, nodeAccessor, checkedValue, chec
|
|
357
360
|
function controllable_input_checkedValue_effect(scope, nodeAccessor) {
|
358
361
|
let el = scope[nodeAccessor];
|
359
362
|
syncControllable(el, "input", hasCheckboxChanged, () => {
|
360
|
-
let checkedValueChange = scope[
|
363
|
+
let checkedValueChange = scope["e" /* ControlledHandler */ + nodeAccessor];
|
361
364
|
if (checkedValueChange) {
|
362
|
-
let oldValue = scope[
|
365
|
+
let oldValue = scope["g" /* ControlledValue */ + nodeAccessor], newValue = Array.isArray(oldValue) ? updateList(oldValue, el.value, el.checked) : el.checked ? el.value : void 0;
|
363
366
|
if (el.name && el.type[0] === "r")
|
364
367
|
for (let radio of el.getRootNode().querySelectorAll(
|
365
368
|
`[type=radio][name=${CSS.escape(el.name)}]`
|
@@ -373,23 +376,23 @@ function controllable_input_checkedValue_effect(scope, nodeAccessor) {
|
|
373
376
|
}
|
374
377
|
function controllable_input_value(scope, nodeAccessor, value2, valueChange) {
|
375
378
|
let el = scope[nodeAccessor], normalizedValue = normalizeStrProp(value2);
|
376
|
-
scope[
|
379
|
+
scope["e" /* ControlledHandler */ + nodeAccessor] = valueChange, valueChange ? (scope["f" /* ControlledType */ + nodeAccessor] = 0 /* InputChecked */, scope["g" /* ControlledValue */ + nodeAccessor] = value2, el.isConnected ? setValueAndUpdateSelection(el, normalizedValue) : el.defaultValue = normalizedValue) : (scope["f" /* ControlledType */ + nodeAccessor] = 5 /* None */, el.defaultValue = normalizedValue);
|
377
380
|
}
|
378
381
|
function controllable_input_value_effect(scope, nodeAccessor) {
|
379
382
|
let el = scope[nodeAccessor];
|
380
|
-
isResuming && (scope[
|
381
|
-
let valueChange = scope[
|
383
|
+
isResuming && (scope["g" /* ControlledValue */ + nodeAccessor] = el.defaultValue), syncControllable(el, "input", hasValueChanged, (ev) => {
|
384
|
+
let valueChange = scope["e" /* ControlledHandler */ + nodeAccessor];
|
382
385
|
if (valueChange) {
|
383
386
|
let newValue = el.value;
|
384
387
|
inputType = ev?.inputType, setValueAndUpdateSelection(
|
385
388
|
el,
|
386
|
-
scope[
|
389
|
+
scope["g" /* ControlledValue */ + nodeAccessor]
|
387
390
|
), valueChange(newValue), run(), inputType = "";
|
388
391
|
}
|
389
392
|
});
|
390
393
|
}
|
391
394
|
function controllable_select_value(scope, nodeAccessor, value2, valueChange) {
|
392
|
-
scope[
|
395
|
+
scope["e" /* ControlledHandler */ + nodeAccessor] = valueChange, valueChange ? (scope["f" /* ControlledType */ + nodeAccessor] = 3 /* SelectValue */, scope["g" /* ControlledValue */ + nodeAccessor] = value2) : scope["f" /* ControlledType */ + nodeAccessor] = 5 /* None */, pendingEffects.unshift(
|
393
396
|
() => setSelectOptions(
|
394
397
|
scope[nodeAccessor],
|
395
398
|
value2,
|
@@ -400,20 +403,20 @@ function controllable_select_value(scope, nodeAccessor, value2, valueChange) {
|
|
400
403
|
}
|
401
404
|
function controllable_select_value_effect(scope, nodeAccessor) {
|
402
405
|
let el = scope[nodeAccessor], onChange = () => {
|
403
|
-
let valueChange = scope[
|
406
|
+
let valueChange = scope["e" /* ControlledHandler */ + nodeAccessor];
|
404
407
|
if (valueChange) {
|
405
408
|
let newValue = Array.isArray(
|
406
|
-
scope[
|
409
|
+
scope["g" /* ControlledValue */ + nodeAccessor]
|
407
410
|
) ? Array.from(el.selectedOptions, toValueProp) : el.value;
|
408
411
|
setSelectOptions(
|
409
412
|
el,
|
410
|
-
scope[
|
413
|
+
scope["g" /* ControlledValue */ + nodeAccessor],
|
411
414
|
valueChange
|
412
415
|
), valueChange(newValue), run();
|
413
416
|
}
|
414
417
|
};
|
415
418
|
el._ || new MutationObserver(() => {
|
416
|
-
let value2 = scope[
|
419
|
+
let value2 = scope["g" /* ControlledValue */ + nodeAccessor];
|
417
420
|
(Array.isArray(value2) ? value2.length !== el.selectedOptions.length || value2.some((value3, i) => value3 != el.selectedOptions[i].value) : el.value != value2) && onChange();
|
418
421
|
}).observe(el, {
|
419
422
|
childList: !0,
|
@@ -436,16 +439,16 @@ function setSelectOptions(el, value2, valueChange) {
|
|
436
439
|
}
|
437
440
|
}
|
438
441
|
function controllable_detailsOrDialog_open(scope, nodeAccessor, open, openChange) {
|
439
|
-
scope[
|
442
|
+
scope["e" /* ControlledHandler */ + nodeAccessor] = openChange, openChange ? scope["f" /* ControlledType */ + nodeAccessor] = 4 /* DetailsOrDialogOpen */ : scope["f" /* ControlledType */ + nodeAccessor] = 5 /* None */, scope[nodeAccessor].open = scope["g" /* ControlledValue */ + nodeAccessor] = normalizeBoolProp(open);
|
440
443
|
}
|
441
444
|
function controllable_detailsOrDialog_open_effect(scope, nodeAccessor) {
|
442
|
-
let el = scope[nodeAccessor], hasChanged = () => el.open !== scope[
|
445
|
+
let el = scope[nodeAccessor], hasChanged = () => el.open !== scope["g" /* ControlledValue */ + nodeAccessor];
|
443
446
|
syncControllable(
|
444
447
|
el,
|
445
448
|
el.tagName === "DIALOG" ? "close" : "toggle",
|
446
449
|
hasChanged,
|
447
450
|
() => {
|
448
|
-
let openChange = scope[
|
451
|
+
let openChange = scope["e" /* ControlledHandler */ + nodeAccessor];
|
449
452
|
if (openChange && hasChanged()) {
|
450
453
|
let newValue = el.open;
|
451
454
|
el.open = !newValue, openChange(newValue), run();
|
@@ -466,7 +469,7 @@ function setValueAndUpdateSelection(el, value2) {
|
|
466
469
|
}
|
467
470
|
}
|
468
471
|
function setCheckboxValue(scope, nodeAccessor, type, checked, checkedChange) {
|
469
|
-
scope[
|
472
|
+
scope["e" /* ControlledHandler */ + nodeAccessor] = checkedChange, checkedChange ? (scope["f" /* ControlledType */ + nodeAccessor] = type, scope[nodeAccessor].checked = checked) : (scope["f" /* ControlledType */ + nodeAccessor] = 5 /* None */, scope[nodeAccessor].defaultChecked = checked);
|
470
473
|
}
|
471
474
|
var controllableDelegate = createDelegator();
|
472
475
|
function syncControllable(el, event, hasChanged, onChange) {
|
@@ -630,13 +633,13 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
|
|
630
633
|
case "content":
|
631
634
|
break;
|
632
635
|
default:
|
633
|
-
isEventHandler(name) ? (events ||= scope[
|
636
|
+
isEventHandler(name) ? (events ||= scope["i" /* EventAttributes */ + nodeAccessor] = {})[getEventHandlerName(name)] = value2 : skip?.test(name) || attr(el, name, value2);
|
634
637
|
}
|
635
638
|
}
|
636
639
|
}
|
637
640
|
function attrsEvents(scope, nodeAccessor) {
|
638
|
-
let el = scope[nodeAccessor], events = scope[
|
639
|
-
switch (scope[
|
641
|
+
let el = scope[nodeAccessor], events = scope["i" /* EventAttributes */ + nodeAccessor];
|
642
|
+
switch (scope["f" /* ControlledType */ + nodeAccessor]) {
|
640
643
|
case 0 /* InputChecked */:
|
641
644
|
controllable_input_checked_effect(scope, nodeAccessor);
|
642
645
|
break;
|
@@ -657,7 +660,7 @@ function attrsEvents(scope, nodeAccessor) {
|
|
657
660
|
on(el, name, events[name]);
|
658
661
|
}
|
659
662
|
function html(scope, value2, accessor) {
|
660
|
-
let firstChild = scope[accessor], parentNode = firstChild.parentNode, lastChild = scope[
|
663
|
+
let firstChild = scope[accessor], parentNode = firstChild.parentNode, lastChild = scope["h" /* DynamicPlaceholderLastChild */ + accessor] || firstChild, newContent = parseHTML(
|
661
664
|
value2 || value2 === 0 ? value2 + "" : "",
|
662
665
|
parentNode.namespaceURI
|
663
666
|
);
|
@@ -665,7 +668,7 @@ function html(scope, value2, accessor) {
|
|
665
668
|
parentNode,
|
666
669
|
firstChild,
|
667
670
|
scope[accessor] = newContent.firstChild || newContent.appendChild(new Text()),
|
668
|
-
scope[
|
671
|
+
scope["h" /* DynamicPlaceholderLastChild */ + accessor] = newContent.lastChild
|
669
672
|
), removeChildNodes(firstChild, lastChild);
|
670
673
|
}
|
671
674
|
function props(scope, nodeIndex, index) {
|
@@ -688,7 +691,7 @@ function lifecycle(scope, index, thisObj) {
|
|
688
691
|
let instance = scope[index];
|
689
692
|
instance ? (Object.assign(instance, thisObj), instance.onUpdate?.()) : (scope[index] = thisObj, thisObj.onMount?.(), getAbortSignal(
|
690
693
|
scope,
|
691
|
-
"
|
694
|
+
"k" /* LifecycleAbortController */ + index
|
692
695
|
).onabort = () => thisObj.onDestroy?.());
|
693
696
|
}
|
694
697
|
function removeChildNodes(startNode, endNode) {
|
@@ -715,8 +718,8 @@ function toInsertNode(startNode, endNode) {
|
|
715
718
|
var pendingScopes = [];
|
716
719
|
function createScope($global, closestBranch) {
|
717
720
|
let scope = {
|
718
|
-
|
719
|
-
|
721
|
+
e: $global.f++,
|
722
|
+
h: 1,
|
720
723
|
c: closestBranch,
|
721
724
|
$global
|
722
725
|
};
|
@@ -727,16 +730,16 @@ function skipScope(scope) {
|
|
727
730
|
}
|
728
731
|
function finishPendingScopes() {
|
729
732
|
for (let scope of pendingScopes)
|
730
|
-
scope.
|
733
|
+
scope.h = 0;
|
731
734
|
pendingScopes = [];
|
732
735
|
}
|
733
736
|
function destroyBranch(branch) {
|
734
|
-
branch.p?.
|
737
|
+
branch.g?.p?.delete(branch), destroyNestedBranches(branch);
|
735
738
|
}
|
736
739
|
function destroyNestedBranches(branch) {
|
737
|
-
branch.
|
738
|
-
for (let id in scope.
|
739
|
-
scope.
|
740
|
+
branch.k = 1, branch.p?.forEach(destroyNestedBranches), branch.B?.forEach((scope) => {
|
741
|
+
for (let id in scope.l)
|
742
|
+
scope.l[id]?.abort();
|
740
743
|
});
|
741
744
|
}
|
742
745
|
function removeAndDestroyBranch(branch) {
|
@@ -750,90 +753,15 @@ function insertBranchBefore(branch, parentNode, nextSibling) {
|
|
750
753
|
branch.b
|
751
754
|
);
|
752
755
|
}
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
else {
|
761
|
-
let render = {
|
762
|
-
h: key,
|
763
|
-
u: scope,
|
764
|
-
B: signal,
|
765
|
-
t: value2
|
766
|
-
}, i = pendingRenders.push(render) - 1;
|
767
|
-
for (; i; ) {
|
768
|
-
let parentIndex = i - 1 >> 1, parent = pendingRenders[parentIndex];
|
769
|
-
if (key - parent.h >= 0) break;
|
770
|
-
pendingRenders[i] = parent, i = parentIndex;
|
771
|
-
}
|
772
|
-
signalKey >= 0 && pendingRendersLookup.set(key, render), pendingRenders[i] = render;
|
773
|
-
}
|
774
|
-
}
|
775
|
-
function queueEffect(scope, fn) {
|
776
|
-
pendingEffects.push(fn, scope);
|
777
|
-
}
|
778
|
-
function run() {
|
779
|
-
let effects = pendingEffects;
|
780
|
-
try {
|
781
|
-
rendering = !0, runRenders();
|
782
|
-
} finally {
|
783
|
-
pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map(), pendingEffects = [], rendering = !1;
|
784
|
-
}
|
785
|
-
runEffects(effects);
|
786
|
-
}
|
787
|
-
function prepareEffects(fn) {
|
788
|
-
let prevRenders = pendingRenders, prevRendersLookup = pendingRendersLookup, prevEffects = pendingEffects, preparedEffects = pendingEffects = [];
|
789
|
-
pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map();
|
790
|
-
try {
|
791
|
-
rendering = !0, fn(), runRenders();
|
792
|
-
} finally {
|
793
|
-
rendering = !1, pendingRenders = prevRenders, pendingRendersLookup = prevRendersLookup, pendingEffects = prevEffects;
|
794
|
-
}
|
795
|
-
return preparedEffects;
|
796
|
-
}
|
797
|
-
function runEffects(effects) {
|
798
|
-
for (let i = 0, scope; i < effects.length; )
|
799
|
-
effects[i++](
|
800
|
-
scope = effects[i++],
|
801
|
-
scope
|
802
|
-
);
|
803
|
-
}
|
804
|
-
function runRenders() {
|
805
|
-
for (; pendingRenders.length; ) {
|
806
|
-
let render = pendingRenders[0], item = pendingRenders.pop();
|
807
|
-
if (render !== item) {
|
808
|
-
let i = 0, mid = pendingRenders.length >> 1, key = (pendingRenders[0] = item).h;
|
809
|
-
for (; i < mid; ) {
|
810
|
-
let bestChild = (i << 1) + 1, right = bestChild + 1;
|
811
|
-
if (right < pendingRenders.length && pendingRenders[right].h - pendingRenders[bestChild].h < 0 && (bestChild = right), pendingRenders[bestChild].h - key >= 0)
|
812
|
-
break;
|
813
|
-
pendingRenders[i] = pendingRenders[bestChild], i = bestChild;
|
814
|
-
}
|
815
|
-
pendingRenders[i] = item;
|
816
|
-
}
|
817
|
-
render.u.c?.q || render.B(render.u, render.t);
|
818
|
-
}
|
819
|
-
finishPendingScopes();
|
820
|
-
}
|
821
|
-
|
822
|
-
// src/dom/abort-signal.ts
|
823
|
-
function resetAbortSignal(scope, id) {
|
824
|
-
let ctrl = scope.j?.[id];
|
825
|
-
ctrl && (queueEffect(ctrl, abort), scope.j[id] = void 0);
|
826
|
-
}
|
827
|
-
function getAbortSignal(scope, id) {
|
828
|
-
return scope.c && (scope.c.A ||= /* @__PURE__ */ new Set()).add(scope), ((scope.j ||= {})[id] ||= new AbortController()).signal;
|
829
|
-
}
|
830
|
-
function abort(ctrl) {
|
831
|
-
ctrl.abort();
|
756
|
+
function tempDetatchBranch(branch) {
|
757
|
+
insertChildNodes(
|
758
|
+
new DocumentFragment(),
|
759
|
+
null,
|
760
|
+
branch.a,
|
761
|
+
branch.b
|
762
|
+
);
|
832
763
|
}
|
833
764
|
|
834
|
-
// src/common/compat-meta.ts
|
835
|
-
var prefix = "$C_", RENDERER_REGISTER_ID = prefix + "r", SET_SCOPE_REGISTER_ID = prefix + "s", RENDER_BODY_ID = prefix + "b";
|
836
|
-
|
837
765
|
// src/dom/reconcile.ts
|
838
766
|
var WRONG_POS = 2147483647;
|
839
767
|
function reconcile(parent, oldBranches, newBranches, afterReference) {
|
@@ -919,7 +847,7 @@ function walkInternal(currentWalkIndex, walkCodes, scope) {
|
|
919
847
|
for (; currentWalkIndex < walkCodes.length; )
|
920
848
|
if (value2 = walkCodes.charCodeAt(currentWalkIndex++), currentMultiplier = storedMultiplier, storedMultiplier = 0, value2 === 32 /* Get */) {
|
921
849
|
let node = walker.currentNode;
|
922
|
-
scope[currentScopeIndex] = node, scope[
|
850
|
+
scope[currentScopeIndex] = node, scope["j" /* Getter */ + currentScopeIndex++] = () => node;
|
923
851
|
} else if (value2 === 37 /* Replace */ || value2 === 49 /* DynamicTagWithVar */)
|
924
852
|
walker.currentNode.replaceWith(
|
925
853
|
walker.currentNode = scope[currentScopeIndex++] = new Text()
|
@@ -951,7 +879,7 @@ function walkInternal(currentWalkIndex, walkCodes, scope) {
|
|
951
879
|
// src/dom/renderer.ts
|
952
880
|
function createBranch($global, renderer, parentScope, parentNode) {
|
953
881
|
let branch = createScope($global), parentBranch = parentScope?.c;
|
954
|
-
return branch._ = renderer.
|
882
|
+
return branch._ = renderer.m || parentScope, branch.c = branch, parentBranch && (branch.g = parentBranch, (parentBranch.p ||= /* @__PURE__ */ new Set()).add(branch)), renderer.q?.(
|
955
883
|
branch,
|
956
884
|
parentNode.namespaceURI
|
957
885
|
), branch;
|
@@ -963,10 +891,10 @@ function createAndSetupBranch($global, renderer, parentScope, parentNode) {
|
|
963
891
|
);
|
964
892
|
}
|
965
893
|
function setupBranch(renderer, branch) {
|
966
|
-
return (renderer.
|
894
|
+
return (renderer.t || renderer.x) && queueRender(
|
967
895
|
branch,
|
968
896
|
(branch2) => {
|
969
|
-
renderer.
|
897
|
+
renderer.t?.(branch2), renderer.x?.(branch2);
|
970
898
|
},
|
971
899
|
-1
|
972
900
|
), branch;
|
@@ -986,13 +914,13 @@ function createContent(id, template, walks, setup, params, closures, dynamicScop
|
|
986
914
|
);
|
987
915
|
};
|
988
916
|
return (owner) => ({
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
917
|
+
e: id,
|
918
|
+
q: clone,
|
919
|
+
m: owner,
|
920
|
+
t: setup,
|
921
|
+
d: params,
|
994
922
|
x: closures,
|
995
|
-
|
923
|
+
n: dynamicScopesAccessor
|
996
924
|
});
|
997
925
|
}
|
998
926
|
function registerContent(id, template, walks, setup, params, closures, dynamicScopesAccessor) {
|
@@ -1048,7 +976,7 @@ function triggerMacroTask() {
|
|
1048
976
|
function state(valueAccessor, fn) {
|
1049
977
|
if (0)
|
1050
978
|
var id;
|
1051
|
-
let valueChangeAccessor =
|
979
|
+
let valueChangeAccessor = "@" /* TagVariableChange */ + valueAccessor, update = (scope, value2) => {
|
1052
980
|
scope[valueAccessor] !== value2 && (scope[valueAccessor] = value2, fn(scope, value2));
|
1053
981
|
};
|
1054
982
|
return (scope, value2, valueChange) => (rendering ? ((scope[valueChangeAccessor] = valueChange) && scope[valueAccessor] !== value2 || !(valueAccessor in scope)) && (scope[valueAccessor] = value2, fn(scope, value2)) : scope[valueChangeAccessor] ? scope[valueChangeAccessor](value2) : (schedule(), queueRender(
|
@@ -1064,31 +992,31 @@ function value(valueAccessor, fn = () => {
|
|
1064
992
|
(!(valueAccessor in scope) || scope[valueAccessor] !== value2) && (scope[valueAccessor] = value2, fn(scope, value2));
|
1065
993
|
};
|
1066
994
|
}
|
1067
|
-
function intersection(id, fn, defaultPending = 1, scopeIdAccessor = /* @__KEY__ */ "
|
995
|
+
function intersection(id, fn, defaultPending = 1, scopeIdAccessor = /* @__KEY__ */ "e") {
|
1068
996
|
return (scope) => {
|
1069
|
-
scope.
|
997
|
+
scope.h ? scope[id] === void 0 ? scope[id] = defaultPending : --scope[id] || fn(scope) : queueRender(scope, fn, id, 0, scope[scopeIdAccessor]);
|
1070
998
|
};
|
1071
999
|
}
|
1072
1000
|
function loopClosure(valueAccessor, ownerLoopNodeAccessor, fn) {
|
1073
|
-
let childSignal = closure(valueAccessor, fn), loopScopeAccessor =
|
1001
|
+
let childSignal = closure(valueAccessor, fn), loopScopeAccessor = "l" /* LoopScopeArray */ + ownerLoopNodeAccessor, loopScopeMapAccessor = "m" /* LoopScopeMap */ + ownerLoopNodeAccessor, ownerSignal = (ownerScope) => {
|
1074
1002
|
let scopes = ownerScope[loopScopeAccessor] || ownerScope[loopScopeMapAccessor]?.values() || [], [firstScope] = scopes;
|
1075
1003
|
firstScope && queueRender(
|
1076
1004
|
ownerScope,
|
1077
1005
|
() => {
|
1078
1006
|
for (let scope of scopes)
|
1079
|
-
!scope.
|
1007
|
+
!scope.h && !scope.k && childSignal(scope);
|
1080
1008
|
},
|
1081
1009
|
-1,
|
1082
1010
|
0,
|
1083
|
-
firstScope.
|
1011
|
+
firstScope.e
|
1084
1012
|
);
|
1085
1013
|
};
|
1086
1014
|
return ownerSignal._ = childSignal, ownerSignal;
|
1087
1015
|
}
|
1088
1016
|
function conditionalClosure(valueAccessor, ownerConditionalNodeAccessor, branch, fn) {
|
1089
|
-
let childSignal = closure(valueAccessor, fn), scopeAccessor =
|
1017
|
+
let childSignal = closure(valueAccessor, fn), scopeAccessor = "d" /* ConditionalScope */ + ownerConditionalNodeAccessor, branchAccessor = "c" /* ConditionalRenderer */ + ownerConditionalNodeAccessor, ownerSignal = (scope) => {
|
1090
1018
|
let ifScope = scope[scopeAccessor];
|
1091
|
-
ifScope && !ifScope.
|
1019
|
+
ifScope && !ifScope.h && scope[branchAccessor] === branch && queueRender(ifScope, childSignal, -1);
|
1092
1020
|
};
|
1093
1021
|
return ownerSignal._ = childSignal, ownerSignal;
|
1094
1022
|
}
|
@@ -1106,7 +1034,7 @@ function dynamicClosure(...closureSignals) {
|
|
1106
1034
|
return (scope) => {
|
1107
1035
|
if (scope[___scopeInstancesAccessor])
|
1108
1036
|
for (let childScope of scope[___scopeInstancesAccessor])
|
1109
|
-
childScope.
|
1037
|
+
childScope.h || queueRender(
|
1110
1038
|
childScope,
|
1111
1039
|
closureSignals[childScope[___signalIndexAccessor]],
|
1112
1040
|
-1
|
@@ -1121,7 +1049,7 @@ function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
|
|
1121
1049
|
scope
|
1122
1050
|
);
|
1123
1051
|
};
|
1124
|
-
return closureSignal.y =
|
1052
|
+
return closureSignal.y = "a" /* ClosureScopes */ + valueAccessor, closureSignal.z = "b" /* ClosureSignalIndex */ + valueAccessor, closureSignal;
|
1125
1053
|
}
|
1126
1054
|
function closure(valueAccessor, fn, getOwnerScope) {
|
1127
1055
|
return (scope) => {
|
@@ -1160,8 +1088,96 @@ function hoist(...path) {
|
|
1160
1088
|
}
|
1161
1089
|
|
1162
1090
|
// src/dom/control-flow.ts
|
1091
|
+
function awaitTag(nodeAccessor, renderer) {
|
1092
|
+
let promiseAccessor = "n" /* Promise */ + nodeAccessor, branchAccessor = "d" /* ConditionalScope */ + nodeAccessor;
|
1093
|
+
return (scope, promise) => {
|
1094
|
+
let tryBranch = scope.c, awaitBranch = scope[branchAccessor], referenceNode = scope[nodeAccessor], namespaceNode = (awaitBranch?.a ?? referenceNode).parentNode;
|
1095
|
+
for (; tryBranch && !tryBranch["%" /* PlaceholderContent */]; )
|
1096
|
+
tryBranch = tryBranch.g;
|
1097
|
+
let thisPromise = scope[promiseAccessor] = promise.then((data2) => {
|
1098
|
+
if (scope.c?.k || scope[promiseAccessor] !== thisPromise)
|
1099
|
+
return;
|
1100
|
+
scope[promiseAccessor] = void 0;
|
1101
|
+
let effects = prepareEffects(() => {
|
1102
|
+
(!awaitBranch || !tryBranch) && (insertBranchBefore(
|
1103
|
+
awaitBranch ??= scope[branchAccessor] = createAndSetupBranch(
|
1104
|
+
scope.$global,
|
1105
|
+
renderer,
|
1106
|
+
scope,
|
1107
|
+
namespaceNode
|
1108
|
+
),
|
1109
|
+
referenceNode.parentNode,
|
1110
|
+
referenceNode
|
1111
|
+
), referenceNode.remove()), renderer.d?.(awaitBranch, [data2]);
|
1112
|
+
});
|
1113
|
+
if (tryBranch) {
|
1114
|
+
if (!--tryBranch.o) {
|
1115
|
+
let placeholderBranch = tryBranch["#" /* PlaceholderBranch */];
|
1116
|
+
placeholderBranch ? (insertBranchBefore(
|
1117
|
+
tryBranch,
|
1118
|
+
placeholderBranch.a.parentNode,
|
1119
|
+
placeholderBranch.a
|
1120
|
+
), removeAndDestroyBranch(placeholderBranch)) : insertBranchBefore(
|
1121
|
+
tryBranch,
|
1122
|
+
referenceNode.parentNode,
|
1123
|
+
referenceNode
|
1124
|
+
);
|
1125
|
+
}
|
1126
|
+
} else
|
1127
|
+
runEffects(effects);
|
1128
|
+
}).catch((error) => {
|
1129
|
+
let tryBranch2 = scope.c;
|
1130
|
+
for (; tryBranch2 && !tryBranch2["^" /* CatchContent */]; )
|
1131
|
+
tryBranch2 = tryBranch2.g;
|
1132
|
+
tryBranch2 ? (setConditionalRenderer(
|
1133
|
+
tryBranch2._,
|
1134
|
+
tryBranch2["*" /* BranchAccessor */],
|
1135
|
+
tryBranch2["^" /* CatchContent */],
|
1136
|
+
createAndSetupBranch
|
1137
|
+
), tryBranch2["^" /* CatchContent */].d?.(
|
1138
|
+
tryBranch2._["d" /* ConditionalScope */ + tryBranch2["*" /* BranchAccessor */]],
|
1139
|
+
[error]
|
1140
|
+
)) : setTimeout(() => {
|
1141
|
+
throw error;
|
1142
|
+
});
|
1143
|
+
});
|
1144
|
+
tryBranch ? (tryBranch.o || (tryBranch.o = 0, requestAnimationFrame(() => {
|
1145
|
+
if (tryBranch.o && !tryBranch.k) {
|
1146
|
+
let placeholderBranch = tryBranch["#" /* PlaceholderBranch */] = createAndSetupBranch(
|
1147
|
+
scope.$global,
|
1148
|
+
tryBranch["%" /* PlaceholderContent */],
|
1149
|
+
tryBranch._,
|
1150
|
+
tryBranch.a.parentNode
|
1151
|
+
);
|
1152
|
+
insertBranchBefore(
|
1153
|
+
placeholderBranch,
|
1154
|
+
tryBranch.a.parentNode,
|
1155
|
+
tryBranch.a
|
1156
|
+
), tempDetatchBranch(tryBranch);
|
1157
|
+
}
|
1158
|
+
})), tryBranch.o++) : awaitBranch && (awaitBranch.a.parentNode.insertBefore(
|
1159
|
+
referenceNode,
|
1160
|
+
awaitBranch.a
|
1161
|
+
), tempDetatchBranch(awaitBranch));
|
1162
|
+
};
|
1163
|
+
}
|
1164
|
+
function createTry(nodeAccessor, tryContent) {
|
1165
|
+
let branchAccessor = "d" /* ConditionalScope */ + nodeAccessor;
|
1166
|
+
return (scope, input) => {
|
1167
|
+
scope[branchAccessor] || setConditionalRenderer(
|
1168
|
+
scope,
|
1169
|
+
nodeAccessor,
|
1170
|
+
tryContent,
|
1171
|
+
createAndSetupBranch
|
1172
|
+
);
|
1173
|
+
let branch = scope[branchAccessor];
|
1174
|
+
branch && (branch["*" /* BranchAccessor */] = nodeAccessor, branch["^" /* CatchContent */] = normalizeDynamicRenderer(input.catch), branch["%" /* PlaceholderContent */] = normalizeDynamicRenderer(
|
1175
|
+
input.placeholder
|
1176
|
+
));
|
1177
|
+
};
|
1178
|
+
}
|
1163
1179
|
function conditional(nodeAccessor, ...branches) {
|
1164
|
-
let branchAccessor =
|
1180
|
+
let branchAccessor = "c" /* ConditionalRenderer */ + nodeAccessor;
|
1165
1181
|
return (scope, newBranch) => {
|
1166
1182
|
newBranch !== scope[branchAccessor] && setConditionalRenderer(
|
1167
1183
|
scope,
|
@@ -1175,10 +1191,10 @@ function patchDynamicTag(fn) {
|
|
1175
1191
|
dynamicTag = fn(dynamicTag);
|
1176
1192
|
}
|
1177
1193
|
var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
1178
|
-
let childScopeAccessor =
|
1194
|
+
let childScopeAccessor = "d" /* ConditionalScope */ + nodeAccessor, rendererAccessor = "c" /* ConditionalRenderer */ + nodeAccessor;
|
1179
1195
|
return (scope, newRenderer, getInput) => {
|
1180
1196
|
let normalizedRenderer = normalizeDynamicRenderer(newRenderer);
|
1181
|
-
if (scope[rendererAccessor] !== (scope[rendererAccessor] = normalizedRenderer?.
|
1197
|
+
if (scope[rendererAccessor] !== (scope[rendererAccessor] = normalizedRenderer?.e || normalizedRenderer) || getContent && !(normalizedRenderer || scope[childScopeAccessor]))
|
1182
1198
|
if (setConditionalRenderer(
|
1183
1199
|
scope,
|
1184
1200
|
nodeAccessor,
|
@@ -1192,15 +1208,15 @@ var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
|
1192
1208
|
0,
|
1193
1209
|
content,
|
1194
1210
|
createAndSetupBranch
|
1195
|
-
), content.
|
1196
|
-
content.
|
1197
|
-
content.
|
1198
|
-
scope[childScopeAccessor][
|
1211
|
+
), content.n && subscribeToScopeSet(
|
1212
|
+
content.m,
|
1213
|
+
content.n,
|
1214
|
+
scope[childScopeAccessor]["d" /* ConditionalScope */ + 0]
|
1199
1215
|
);
|
1200
1216
|
}
|
1201
|
-
} else normalizedRenderer?.
|
1202
|
-
normalizedRenderer.
|
1203
|
-
normalizedRenderer.
|
1217
|
+
} else normalizedRenderer?.n && subscribeToScopeSet(
|
1218
|
+
normalizedRenderer.m,
|
1219
|
+
normalizedRenderer.n,
|
1204
1220
|
scope[childScopeAccessor]
|
1205
1221
|
);
|
1206
1222
|
if (normalizedRenderer) {
|
@@ -1211,9 +1227,9 @@ var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
|
1211
1227
|
0,
|
1212
1228
|
(inputIsArgs ? args[0] : args) || {}
|
1213
1229
|
);
|
1214
|
-
else if (normalizedRenderer.
|
1230
|
+
else if (normalizedRenderer.d)
|
1215
1231
|
if (inputIsArgs)
|
1216
|
-
normalizedRenderer.
|
1232
|
+
normalizedRenderer.d(
|
1217
1233
|
scope[childScopeAccessor],
|
1218
1234
|
normalizedRenderer._ ? args[0] : args
|
1219
1235
|
);
|
@@ -1222,7 +1238,7 @@ var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
|
1222
1238
|
...args,
|
1223
1239
|
content: getContent(scope)
|
1224
1240
|
} : args || {};
|
1225
|
-
normalizedRenderer.
|
1241
|
+
normalizedRenderer.d(
|
1226
1242
|
scope[childScopeAccessor],
|
1227
1243
|
normalizedRenderer._ ? inputWithContent : [inputWithContent]
|
1228
1244
|
);
|
@@ -1231,7 +1247,7 @@ var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
|
1231
1247
|
};
|
1232
1248
|
};
|
1233
1249
|
function setConditionalRenderer(scope, nodeAccessor, newRenderer, createBranch2) {
|
1234
|
-
let referenceNode = scope[nodeAccessor], prevBranch = scope[
|
1250
|
+
let referenceNode = scope[nodeAccessor], prevBranch = scope["d" /* ConditionalScope */ + nodeAccessor], parentNode = referenceNode.nodeType > 1 /* Element */ ? (prevBranch?.a || referenceNode).parentNode : referenceNode, newBranch = scope["d" /* ConditionalScope */ + nodeAccessor] = newRenderer && createBranch2(scope.$global, newRenderer, scope, parentNode);
|
1235
1251
|
referenceNode === parentNode ? (prevBranch && (destroyBranch(prevBranch), referenceNode.textContent = ""), newBranch && insertBranchBefore(newBranch, parentNode, null)) : prevBranch ? (newBranch ? insertBranchBefore(newBranch, parentNode, prevBranch.a) : parentNode.insertBefore(referenceNode, prevBranch.a), removeAndDestroyBranch(prevBranch)) : newBranch && (insertBranchBefore(newBranch, parentNode, referenceNode), referenceNode.remove());
|
1236
1252
|
}
|
1237
1253
|
function loopOf(nodeAccessor, renderer) {
|
@@ -1261,11 +1277,11 @@ function loopTo(nodeAccessor, renderer) {
|
|
1261
1277
|
);
|
1262
1278
|
}
|
1263
1279
|
function loop(nodeAccessor, renderer, forEach) {
|
1264
|
-
let params = renderer.
|
1280
|
+
let params = renderer.d;
|
1265
1281
|
return (scope, value2) => {
|
1266
|
-
let referenceNode = scope[nodeAccessor], oldMap = scope[
|
1282
|
+
let referenceNode = scope[nodeAccessor], oldMap = scope["m" /* LoopScopeMap */ + nodeAccessor], oldArray = oldMap ? scope["l" /* LoopScopeArray */ + nodeAccessor] || [
|
1267
1283
|
...oldMap.values()
|
1268
|
-
] : [], parentNode = referenceNode.nodeType > 1 /* Element */ ? referenceNode.parentNode || oldArray[0].a.parentNode : referenceNode, newMap = scope[
|
1284
|
+
] : [], parentNode = referenceNode.nodeType > 1 /* Element */ ? referenceNode.parentNode || oldArray[0].a.parentNode : referenceNode, newMap = scope["m" /* LoopScopeMap */ + nodeAccessor] = /* @__PURE__ */ new Map(), newArray = scope["l" /* LoopScopeArray */ + nodeAccessor] = [];
|
1269
1285
|
forEach(value2, (key, args) => {
|
1270
1286
|
let branch = oldMap?.get(key) || createAndSetupBranch(scope.$global, renderer, scope, parentNode);
|
1271
1287
|
params?.(branch, args), newMap.set(key, branch), newArray.push(branch);
|
@@ -1293,6 +1309,113 @@ function byFirstArg(name) {
|
|
1293
1309
|
return name;
|
1294
1310
|
}
|
1295
1311
|
|
1312
|
+
// src/dom/queue.ts
|
1313
|
+
var pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map(), pendingEffects = [], rendering = !1, scopeKeyOffset = 1e3;
|
1314
|
+
function queueRender(scope, signal, signalKey, value2, scopeKey = scope.e) {
|
1315
|
+
let key = scopeKey * scopeKeyOffset + signalKey, existingRender = signalKey >= 0 && pendingRendersLookup.get(key);
|
1316
|
+
if (existingRender)
|
1317
|
+
existingRender.A = value2;
|
1318
|
+
else {
|
1319
|
+
let render = {
|
1320
|
+
j: key,
|
1321
|
+
u: scope,
|
1322
|
+
D: signal,
|
1323
|
+
A: value2
|
1324
|
+
}, i = pendingRenders.push(render) - 1;
|
1325
|
+
for (; i; ) {
|
1326
|
+
let parentIndex = i - 1 >> 1, parent = pendingRenders[parentIndex];
|
1327
|
+
if (key - parent.j >= 0) break;
|
1328
|
+
pendingRenders[i] = parent, i = parentIndex;
|
1329
|
+
}
|
1330
|
+
signalKey >= 0 && pendingRendersLookup.set(key, render), pendingRenders[i] = render;
|
1331
|
+
}
|
1332
|
+
}
|
1333
|
+
function queueEffect(scope, fn) {
|
1334
|
+
pendingEffects.push(fn, scope);
|
1335
|
+
}
|
1336
|
+
function run() {
|
1337
|
+
let effects = pendingEffects;
|
1338
|
+
try {
|
1339
|
+
rendering = !0, runRenders();
|
1340
|
+
} finally {
|
1341
|
+
pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map(), pendingEffects = [], rendering = !1;
|
1342
|
+
}
|
1343
|
+
runEffects(effects);
|
1344
|
+
}
|
1345
|
+
function prepareEffects(fn) {
|
1346
|
+
let prevRenders = pendingRenders, prevRendersLookup = pendingRendersLookup, prevEffects = pendingEffects, preparedEffects = pendingEffects = [];
|
1347
|
+
pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map();
|
1348
|
+
try {
|
1349
|
+
rendering = !0, fn(), runRenders();
|
1350
|
+
} finally {
|
1351
|
+
rendering = !1, pendingRenders = prevRenders, pendingRendersLookup = prevRendersLookup, pendingEffects = prevEffects;
|
1352
|
+
}
|
1353
|
+
return preparedEffects;
|
1354
|
+
}
|
1355
|
+
function runEffects(effects) {
|
1356
|
+
for (let i = 0, scope; i < effects.length; )
|
1357
|
+
effects[i++](
|
1358
|
+
scope = effects[i++],
|
1359
|
+
scope
|
1360
|
+
);
|
1361
|
+
}
|
1362
|
+
function runRenders() {
|
1363
|
+
for (; pendingRenders.length; ) {
|
1364
|
+
let render = pendingRenders[0], item = pendingRenders.pop();
|
1365
|
+
if (render !== item) {
|
1366
|
+
let i = 0, mid = pendingRenders.length >> 1, key = (pendingRenders[0] = item).j;
|
1367
|
+
for (; i < mid; ) {
|
1368
|
+
let bestChild = (i << 1) + 1, right = bestChild + 1;
|
1369
|
+
if (right < pendingRenders.length && pendingRenders[right].j - pendingRenders[bestChild].j < 0 && (bestChild = right), pendingRenders[bestChild].j - key >= 0)
|
1370
|
+
break;
|
1371
|
+
pendingRenders[i] = pendingRenders[bestChild], i = bestChild;
|
1372
|
+
}
|
1373
|
+
pendingRenders[i] = item;
|
1374
|
+
}
|
1375
|
+
render.u.c?.k || runRender(render);
|
1376
|
+
}
|
1377
|
+
finishPendingScopes();
|
1378
|
+
}
|
1379
|
+
var runRender = (render) => render.D(render.u, render.A), enableCatch = () => {
|
1380
|
+
enableCatch = () => {
|
1381
|
+
}, runRender = /* @__PURE__ */ ((runRender2) => (render) => {
|
1382
|
+
try {
|
1383
|
+
runRender2(render);
|
1384
|
+
} catch (error) {
|
1385
|
+
let branch = render.u.c;
|
1386
|
+
for (; branch && !branch["^" /* CatchContent */]; )
|
1387
|
+
branch = branch.g;
|
1388
|
+
if (branch)
|
1389
|
+
setConditionalRenderer(
|
1390
|
+
branch._,
|
1391
|
+
branch["*" /* BranchAccessor */],
|
1392
|
+
branch["^" /* CatchContent */],
|
1393
|
+
createAndSetupBranch
|
1394
|
+
), branch["^" /* CatchContent */].d?.(
|
1395
|
+
branch._["d" /* ConditionalScope */ + branch["*" /* BranchAccessor */]],
|
1396
|
+
[error]
|
1397
|
+
);
|
1398
|
+
else
|
1399
|
+
throw error;
|
1400
|
+
}
|
1401
|
+
})(runRender);
|
1402
|
+
};
|
1403
|
+
|
1404
|
+
// src/dom/abort-signal.ts
|
1405
|
+
function resetAbortSignal(scope, id) {
|
1406
|
+
let ctrl = scope.l?.[id];
|
1407
|
+
ctrl && (queueEffect(ctrl, abort), scope.l[id] = void 0);
|
1408
|
+
}
|
1409
|
+
function getAbortSignal(scope, id) {
|
1410
|
+
return scope.c && (scope.c.B ||= /* @__PURE__ */ new Set()).add(scope), ((scope.l ||= {})[id] ||= new AbortController()).signal;
|
1411
|
+
}
|
1412
|
+
function abort(ctrl) {
|
1413
|
+
ctrl.abort();
|
1414
|
+
}
|
1415
|
+
|
1416
|
+
// src/common/compat-meta.ts
|
1417
|
+
var prefix = "$C_", RENDERER_REGISTER_ID = prefix + "r", SET_SCOPE_REGISTER_ID = prefix + "s", RENDER_BODY_ID = prefix + "b";
|
1418
|
+
|
1296
1419
|
// src/dom/compat.ts
|
1297
1420
|
var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
1298
1421
|
patchDynamicTag,
|
@@ -1306,7 +1429,7 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
1306
1429
|
register(RENDERER_REGISTER_ID, fn);
|
1307
1430
|
},
|
1308
1431
|
isRenderer(renderer) {
|
1309
|
-
return renderer.
|
1432
|
+
return renderer.q;
|
1310
1433
|
},
|
1311
1434
|
getStartNode(branch) {
|
1312
1435
|
return branch.a;
|
@@ -1331,7 +1454,7 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
1331
1454
|
},
|
1332
1455
|
createRenderer(params, clone) {
|
1333
1456
|
let renderer = createRenderer(0, 0, 0, params);
|
1334
|
-
return renderer.
|
1457
|
+
return renderer.q = (branch) => {
|
1335
1458
|
let cloned = clone();
|
1336
1459
|
branch.a = cloned.startNode, branch.b = cloned.endNode;
|
1337
1460
|
}, renderer;
|
@@ -1349,9 +1472,9 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
1349
1472
|
branch ? existing = !0 : (out.global.f ||= 0, branch = component.scope = createAndSetupBranch(
|
1350
1473
|
out.global,
|
1351
1474
|
renderer,
|
1352
|
-
renderer.
|
1475
|
+
renderer.m,
|
1353
1476
|
document.body
|
1354
|
-
)), renderer.
|
1477
|
+
)), renderer.d?.(branch, renderer._ ? args[0] : args);
|
1355
1478
|
}), !existing)
|
1356
1479
|
return toInsertNode(branch.a, branch.b);
|
1357
1480
|
}
|
@@ -1390,13 +1513,13 @@ function mount(input = {}, reference, position) {
|
|
1390
1513
|
parentNode = reference.parentNode, nextSibling = reference.nextSibling;
|
1391
1514
|
break;
|
1392
1515
|
}
|
1393
|
-
let args = this.
|
1516
|
+
let args = this.d, effects = prepareEffects(() => {
|
1394
1517
|
branch = createBranch(
|
1395
1518
|
$global,
|
1396
1519
|
this,
|
1397
1520
|
void 0,
|
1398
1521
|
parentNode
|
1399
|
-
), this.
|
1522
|
+
), this.t?.(branch), args?.(branch, input);
|
1400
1523
|
});
|
1401
1524
|
return insertChildNodes(
|
1402
1525
|
parentNode,
|