marko 6.0.0-next.3.60 → 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 -23
- package/dist/debug/dom.js +83 -83
- package/dist/debug/dom.mjs +83 -83
- package/dist/debug/html.js +11 -11
- package/dist/debug/html.mjs +11 -11
- package/dist/dom.js +68 -68
- package/dist/dom.mjs +68 -68
- package/dist/html.js +7 -7
- package/dist/html.mjs +7 -7
- package/dist/translator/index.js +82 -16
- 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
@@ -240,7 +240,7 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
|
|
240
240
|
}, data2 = dataIndex ? commentText.slice(dataIndex) : "", token = commentText[commentPrefixLen];
|
241
241
|
if (token === "*" /* Node */) {
|
242
242
|
let node = scope[data2] = visit.previousSibling;
|
243
|
-
scope[
|
243
|
+
scope["j" /* Getter */ + data2] = () => node;
|
244
244
|
} else if (token === "$" /* ClosestBranch */)
|
245
245
|
closestBranchMarkers.set(scopeId, visit);
|
246
246
|
else if (token === "[" /* BranchStart */)
|
@@ -285,7 +285,7 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
|
|
285
285
|
let parentBranchId = parentBranchIds.get(scopeId);
|
286
286
|
if (parentBranchId && (scope.c = scopes[parentBranchId]), branchIds.has(scopeId)) {
|
287
287
|
let branch = scope, parentBranch = branch.c;
|
288
|
-
scope.c = branch, parentBranch && (branch.g = parentBranch, (parentBranch.
|
288
|
+
scope.c = branch, parentBranch && (branch.g = parentBranch, (parentBranch.p ||= /* @__PURE__ */ new Set()).add(
|
289
289
|
branch
|
290
290
|
));
|
291
291
|
}
|
@@ -341,7 +341,7 @@ function controllable_input_checked(scope, nodeAccessor, checked, checkedChange)
|
|
341
341
|
function controllable_input_checked_effect(scope, nodeAccessor) {
|
342
342
|
let el = scope[nodeAccessor];
|
343
343
|
syncControllable(el, "input", hasCheckboxChanged, () => {
|
344
|
-
let checkedChange = scope[
|
344
|
+
let checkedChange = scope["e" /* ControlledHandler */ + nodeAccessor];
|
345
345
|
if (checkedChange) {
|
346
346
|
let newValue = el.checked;
|
347
347
|
el.checked = !newValue, checkedChange(newValue), run();
|
@@ -349,7 +349,7 @@ function controllable_input_checked_effect(scope, nodeAccessor) {
|
|
349
349
|
});
|
350
350
|
}
|
351
351
|
function controllable_input_checkedValue(scope, nodeAccessor, checkedValue, checkedValueChange, value2) {
|
352
|
-
scope[
|
352
|
+
scope["g" /* ControlledValue */ + nodeAccessor] = checkedValue, attr(scope[nodeAccessor], "value", value2), setCheckboxValue(
|
353
353
|
scope,
|
354
354
|
nodeAccessor,
|
355
355
|
1 /* InputCheckedValue */,
|
@@ -360,9 +360,9 @@ function controllable_input_checkedValue(scope, nodeAccessor, checkedValue, chec
|
|
360
360
|
function controllable_input_checkedValue_effect(scope, nodeAccessor) {
|
361
361
|
let el = scope[nodeAccessor];
|
362
362
|
syncControllable(el, "input", hasCheckboxChanged, () => {
|
363
|
-
let checkedValueChange = scope[
|
363
|
+
let checkedValueChange = scope["e" /* ControlledHandler */ + nodeAccessor];
|
364
364
|
if (checkedValueChange) {
|
365
|
-
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;
|
366
366
|
if (el.name && el.type[0] === "r")
|
367
367
|
for (let radio of el.getRootNode().querySelectorAll(
|
368
368
|
`[type=radio][name=${CSS.escape(el.name)}]`
|
@@ -376,23 +376,23 @@ function controllable_input_checkedValue_effect(scope, nodeAccessor) {
|
|
376
376
|
}
|
377
377
|
function controllable_input_value(scope, nodeAccessor, value2, valueChange) {
|
378
378
|
let el = scope[nodeAccessor], normalizedValue = normalizeStrProp(value2);
|
379
|
-
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);
|
380
380
|
}
|
381
381
|
function controllable_input_value_effect(scope, nodeAccessor) {
|
382
382
|
let el = scope[nodeAccessor];
|
383
|
-
isResuming && (scope[
|
384
|
-
let valueChange = scope[
|
383
|
+
isResuming && (scope["g" /* ControlledValue */ + nodeAccessor] = el.defaultValue), syncControllable(el, "input", hasValueChanged, (ev) => {
|
384
|
+
let valueChange = scope["e" /* ControlledHandler */ + nodeAccessor];
|
385
385
|
if (valueChange) {
|
386
386
|
let newValue = el.value;
|
387
387
|
inputType = ev?.inputType, setValueAndUpdateSelection(
|
388
388
|
el,
|
389
|
-
scope[
|
389
|
+
scope["g" /* ControlledValue */ + nodeAccessor]
|
390
390
|
), valueChange(newValue), run(), inputType = "";
|
391
391
|
}
|
392
392
|
});
|
393
393
|
}
|
394
394
|
function controllable_select_value(scope, nodeAccessor, value2, valueChange) {
|
395
|
-
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(
|
396
396
|
() => setSelectOptions(
|
397
397
|
scope[nodeAccessor],
|
398
398
|
value2,
|
@@ -403,20 +403,20 @@ function controllable_select_value(scope, nodeAccessor, value2, valueChange) {
|
|
403
403
|
}
|
404
404
|
function controllable_select_value_effect(scope, nodeAccessor) {
|
405
405
|
let el = scope[nodeAccessor], onChange = () => {
|
406
|
-
let valueChange = scope[
|
406
|
+
let valueChange = scope["e" /* ControlledHandler */ + nodeAccessor];
|
407
407
|
if (valueChange) {
|
408
408
|
let newValue = Array.isArray(
|
409
|
-
scope[
|
409
|
+
scope["g" /* ControlledValue */ + nodeAccessor]
|
410
410
|
) ? Array.from(el.selectedOptions, toValueProp) : el.value;
|
411
411
|
setSelectOptions(
|
412
412
|
el,
|
413
|
-
scope[
|
413
|
+
scope["g" /* ControlledValue */ + nodeAccessor],
|
414
414
|
valueChange
|
415
415
|
), valueChange(newValue), run();
|
416
416
|
}
|
417
417
|
};
|
418
418
|
el._ || new MutationObserver(() => {
|
419
|
-
let value2 = scope[
|
419
|
+
let value2 = scope["g" /* ControlledValue */ + nodeAccessor];
|
420
420
|
(Array.isArray(value2) ? value2.length !== el.selectedOptions.length || value2.some((value3, i) => value3 != el.selectedOptions[i].value) : el.value != value2) && onChange();
|
421
421
|
}).observe(el, {
|
422
422
|
childList: !0,
|
@@ -439,16 +439,16 @@ function setSelectOptions(el, value2, valueChange) {
|
|
439
439
|
}
|
440
440
|
}
|
441
441
|
function controllable_detailsOrDialog_open(scope, nodeAccessor, open, openChange) {
|
442
|
-
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);
|
443
443
|
}
|
444
444
|
function controllable_detailsOrDialog_open_effect(scope, nodeAccessor) {
|
445
|
-
let el = scope[nodeAccessor], hasChanged = () => el.open !== scope[
|
445
|
+
let el = scope[nodeAccessor], hasChanged = () => el.open !== scope["g" /* ControlledValue */ + nodeAccessor];
|
446
446
|
syncControllable(
|
447
447
|
el,
|
448
448
|
el.tagName === "DIALOG" ? "close" : "toggle",
|
449
449
|
hasChanged,
|
450
450
|
() => {
|
451
|
-
let openChange = scope[
|
451
|
+
let openChange = scope["e" /* ControlledHandler */ + nodeAccessor];
|
452
452
|
if (openChange && hasChanged()) {
|
453
453
|
let newValue = el.open;
|
454
454
|
el.open = !newValue, openChange(newValue), run();
|
@@ -469,7 +469,7 @@ function setValueAndUpdateSelection(el, value2) {
|
|
469
469
|
}
|
470
470
|
}
|
471
471
|
function setCheckboxValue(scope, nodeAccessor, type, checked, checkedChange) {
|
472
|
-
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);
|
473
473
|
}
|
474
474
|
var controllableDelegate = createDelegator();
|
475
475
|
function syncControllable(el, event, hasChanged, onChange) {
|
@@ -633,13 +633,13 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
|
|
633
633
|
case "content":
|
634
634
|
break;
|
635
635
|
default:
|
636
|
-
isEventHandler(name) ? (events ||= scope[
|
636
|
+
isEventHandler(name) ? (events ||= scope["i" /* EventAttributes */ + nodeAccessor] = {})[getEventHandlerName(name)] = value2 : skip?.test(name) || attr(el, name, value2);
|
637
637
|
}
|
638
638
|
}
|
639
639
|
}
|
640
640
|
function attrsEvents(scope, nodeAccessor) {
|
641
|
-
let el = scope[nodeAccessor], events = scope[
|
642
|
-
switch (scope[
|
641
|
+
let el = scope[nodeAccessor], events = scope["i" /* EventAttributes */ + nodeAccessor];
|
642
|
+
switch (scope["f" /* ControlledType */ + nodeAccessor]) {
|
643
643
|
case 0 /* InputChecked */:
|
644
644
|
controllable_input_checked_effect(scope, nodeAccessor);
|
645
645
|
break;
|
@@ -660,7 +660,7 @@ function attrsEvents(scope, nodeAccessor) {
|
|
660
660
|
on(el, name, events[name]);
|
661
661
|
}
|
662
662
|
function html(scope, value2, accessor) {
|
663
|
-
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(
|
664
664
|
value2 || value2 === 0 ? value2 + "" : "",
|
665
665
|
parentNode.namespaceURI
|
666
666
|
);
|
@@ -668,7 +668,7 @@ function html(scope, value2, accessor) {
|
|
668
668
|
parentNode,
|
669
669
|
firstChild,
|
670
670
|
scope[accessor] = newContent.firstChild || newContent.appendChild(new Text()),
|
671
|
-
scope[
|
671
|
+
scope["h" /* DynamicPlaceholderLastChild */ + accessor] = newContent.lastChild
|
672
672
|
), removeChildNodes(firstChild, lastChild);
|
673
673
|
}
|
674
674
|
function props(scope, nodeIndex, index) {
|
@@ -691,7 +691,7 @@ function lifecycle(scope, index, thisObj) {
|
|
691
691
|
let instance = scope[index];
|
692
692
|
instance ? (Object.assign(instance, thisObj), instance.onUpdate?.()) : (scope[index] = thisObj, thisObj.onMount?.(), getAbortSignal(
|
693
693
|
scope,
|
694
|
-
"
|
694
|
+
"k" /* LifecycleAbortController */ + index
|
695
695
|
).onabort = () => thisObj.onDestroy?.());
|
696
696
|
}
|
697
697
|
function removeChildNodes(startNode, endNode) {
|
@@ -734,10 +734,10 @@ function finishPendingScopes() {
|
|
734
734
|
pendingScopes = [];
|
735
735
|
}
|
736
736
|
function destroyBranch(branch) {
|
737
|
-
branch.g?.
|
737
|
+
branch.g?.p?.delete(branch), destroyNestedBranches(branch);
|
738
738
|
}
|
739
739
|
function destroyNestedBranches(branch) {
|
740
|
-
branch.k = 1, branch.
|
740
|
+
branch.k = 1, branch.p?.forEach(destroyNestedBranches), branch.B?.forEach((scope) => {
|
741
741
|
for (let id in scope.l)
|
742
742
|
scope.l[id]?.abort();
|
743
743
|
});
|
@@ -755,7 +755,7 @@ function insertBranchBefore(branch, parentNode, nextSibling) {
|
|
755
755
|
}
|
756
756
|
function tempDetatchBranch(branch) {
|
757
757
|
insertChildNodes(
|
758
|
-
|
758
|
+
new DocumentFragment(),
|
759
759
|
null,
|
760
760
|
branch.a,
|
761
761
|
branch.b
|
@@ -847,7 +847,7 @@ function walkInternal(currentWalkIndex, walkCodes, scope) {
|
|
847
847
|
for (; currentWalkIndex < walkCodes.length; )
|
848
848
|
if (value2 = walkCodes.charCodeAt(currentWalkIndex++), currentMultiplier = storedMultiplier, storedMultiplier = 0, value2 === 32 /* Get */) {
|
849
849
|
let node = walker.currentNode;
|
850
|
-
scope[currentScopeIndex] = node, scope[
|
850
|
+
scope[currentScopeIndex] = node, scope["j" /* Getter */ + currentScopeIndex++] = () => node;
|
851
851
|
} else if (value2 === 37 /* Replace */ || value2 === 49 /* DynamicTagWithVar */)
|
852
852
|
walker.currentNode.replaceWith(
|
853
853
|
walker.currentNode = scope[currentScopeIndex++] = new Text()
|
@@ -879,7 +879,7 @@ function walkInternal(currentWalkIndex, walkCodes, scope) {
|
|
879
879
|
// src/dom/renderer.ts
|
880
880
|
function createBranch($global, renderer, parentScope, parentNode) {
|
881
881
|
let branch = createScope($global), parentBranch = parentScope?.c;
|
882
|
-
return branch._ = renderer.m || parentScope, branch.c = branch, parentBranch && (branch.g = parentBranch, (parentBranch.
|
882
|
+
return branch._ = renderer.m || parentScope, branch.c = branch, parentBranch && (branch.g = parentBranch, (parentBranch.p ||= /* @__PURE__ */ new Set()).add(branch)), renderer.q?.(
|
883
883
|
branch,
|
884
884
|
parentNode.namespaceURI
|
885
885
|
), branch;
|
@@ -891,10 +891,10 @@ function createAndSetupBranch($global, renderer, parentScope, parentNode) {
|
|
891
891
|
);
|
892
892
|
}
|
893
893
|
function setupBranch(renderer, branch) {
|
894
|
-
return (renderer.
|
894
|
+
return (renderer.t || renderer.x) && queueRender(
|
895
895
|
branch,
|
896
896
|
(branch2) => {
|
897
|
-
renderer.
|
897
|
+
renderer.t?.(branch2), renderer.x?.(branch2);
|
898
898
|
},
|
899
899
|
-1
|
900
900
|
), branch;
|
@@ -915,11 +915,11 @@ function createContent(id, template, walks, setup, params, closures, dynamicScop
|
|
915
915
|
};
|
916
916
|
return (owner) => ({
|
917
917
|
e: id,
|
918
|
-
|
918
|
+
q: clone,
|
919
919
|
m: owner,
|
920
|
-
|
920
|
+
t: setup,
|
921
921
|
d: params,
|
922
|
-
|
922
|
+
x: closures,
|
923
923
|
n: dynamicScopesAccessor
|
924
924
|
});
|
925
925
|
}
|
@@ -976,7 +976,7 @@ function triggerMacroTask() {
|
|
976
976
|
function state(valueAccessor, fn) {
|
977
977
|
if (0)
|
978
978
|
var id;
|
979
|
-
let valueChangeAccessor =
|
979
|
+
let valueChangeAccessor = "@" /* TagVariableChange */ + valueAccessor, update = (scope, value2) => {
|
980
980
|
scope[valueAccessor] !== value2 && (scope[valueAccessor] = value2, fn(scope, value2));
|
981
981
|
};
|
982
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(
|
@@ -998,7 +998,7 @@ function intersection(id, fn, defaultPending = 1, scopeIdAccessor = /* @__KEY__
|
|
998
998
|
};
|
999
999
|
}
|
1000
1000
|
function loopClosure(valueAccessor, ownerLoopNodeAccessor, fn) {
|
1001
|
-
let childSignal = closure(valueAccessor, fn), loopScopeAccessor =
|
1001
|
+
let childSignal = closure(valueAccessor, fn), loopScopeAccessor = "l" /* LoopScopeArray */ + ownerLoopNodeAccessor, loopScopeMapAccessor = "m" /* LoopScopeMap */ + ownerLoopNodeAccessor, ownerSignal = (ownerScope) => {
|
1002
1002
|
let scopes = ownerScope[loopScopeAccessor] || ownerScope[loopScopeMapAccessor]?.values() || [], [firstScope] = scopes;
|
1003
1003
|
firstScope && queueRender(
|
1004
1004
|
ownerScope,
|
@@ -1014,7 +1014,7 @@ function loopClosure(valueAccessor, ownerLoopNodeAccessor, fn) {
|
|
1014
1014
|
return ownerSignal._ = childSignal, ownerSignal;
|
1015
1015
|
}
|
1016
1016
|
function conditionalClosure(valueAccessor, ownerConditionalNodeAccessor, branch, fn) {
|
1017
|
-
let childSignal = closure(valueAccessor, fn), scopeAccessor =
|
1017
|
+
let childSignal = closure(valueAccessor, fn), scopeAccessor = "d" /* ConditionalScope */ + ownerConditionalNodeAccessor, branchAccessor = "c" /* ConditionalRenderer */ + ownerConditionalNodeAccessor, ownerSignal = (scope) => {
|
1018
1018
|
let ifScope = scope[scopeAccessor];
|
1019
1019
|
ifScope && !ifScope.h && scope[branchAccessor] === branch && queueRender(ifScope, childSignal, -1);
|
1020
1020
|
};
|
@@ -1028,9 +1028,9 @@ function subscribeToScopeSet(ownerScope, accessor, scope) {
|
|
1028
1028
|
));
|
1029
1029
|
}
|
1030
1030
|
function dynamicClosure(...closureSignals) {
|
1031
|
-
let [{
|
1031
|
+
let [{ y: ___scopeInstancesAccessor, z: ___signalIndexAccessor }] = closureSignals;
|
1032
1032
|
for (let i = closureSignals.length; i--; )
|
1033
|
-
closureSignals[i].
|
1033
|
+
closureSignals[i].C = i;
|
1034
1034
|
return (scope) => {
|
1035
1035
|
if (scope[___scopeInstancesAccessor])
|
1036
1036
|
for (let childScope of scope[___scopeInstancesAccessor])
|
@@ -1043,13 +1043,13 @@ function dynamicClosure(...closureSignals) {
|
|
1043
1043
|
}
|
1044
1044
|
function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
|
1045
1045
|
let childSignal = closure(valueAccessor, fn, getOwnerScope), closureSignal = (scope) => {
|
1046
|
-
scope[closureSignal.
|
1046
|
+
scope[closureSignal.z] = closureSignal.C, childSignal(scope), subscribeToScopeSet(
|
1047
1047
|
getOwnerScope ? getOwnerScope(scope) : scope._,
|
1048
|
-
closureSignal.
|
1048
|
+
closureSignal.y,
|
1049
1049
|
scope
|
1050
1050
|
);
|
1051
1051
|
};
|
1052
|
-
return closureSignal.
|
1052
|
+
return closureSignal.y = "a" /* ClosureScopes */ + valueAccessor, closureSignal.z = "b" /* ClosureSignalIndex */ + valueAccessor, closureSignal;
|
1053
1053
|
}
|
1054
1054
|
function closure(valueAccessor, fn, getOwnerScope) {
|
1055
1055
|
return (scope) => {
|
@@ -1089,7 +1089,7 @@ function hoist(...path) {
|
|
1089
1089
|
|
1090
1090
|
// src/dom/control-flow.ts
|
1091
1091
|
function awaitTag(nodeAccessor, renderer) {
|
1092
|
-
let promiseAccessor =
|
1092
|
+
let promiseAccessor = "n" /* Promise */ + nodeAccessor, branchAccessor = "d" /* ConditionalScope */ + nodeAccessor;
|
1093
1093
|
return (scope, promise) => {
|
1094
1094
|
let tryBranch = scope.c, awaitBranch = scope[branchAccessor], referenceNode = scope[nodeAccessor], namespaceNode = (awaitBranch?.a ?? referenceNode).parentNode;
|
1095
1095
|
for (; tryBranch && !tryBranch["%" /* PlaceholderContent */]; )
|
@@ -1111,7 +1111,7 @@ function awaitTag(nodeAccessor, renderer) {
|
|
1111
1111
|
), referenceNode.remove()), renderer.d?.(awaitBranch, [data2]);
|
1112
1112
|
});
|
1113
1113
|
if (tryBranch) {
|
1114
|
-
if (!--tryBranch
|
1114
|
+
if (!--tryBranch.o) {
|
1115
1115
|
let placeholderBranch = tryBranch["#" /* PlaceholderBranch */];
|
1116
1116
|
placeholderBranch ? (insertBranchBefore(
|
1117
1117
|
tryBranch,
|
@@ -1135,14 +1135,14 @@ function awaitTag(nodeAccessor, renderer) {
|
|
1135
1135
|
tryBranch2["^" /* CatchContent */],
|
1136
1136
|
createAndSetupBranch
|
1137
1137
|
), tryBranch2["^" /* CatchContent */].d?.(
|
1138
|
-
tryBranch2._[
|
1138
|
+
tryBranch2._["d" /* ConditionalScope */ + tryBranch2["*" /* BranchAccessor */]],
|
1139
1139
|
[error]
|
1140
1140
|
)) : setTimeout(() => {
|
1141
1141
|
throw error;
|
1142
1142
|
});
|
1143
1143
|
});
|
1144
|
-
tryBranch ? (tryBranch
|
1145
|
-
if (tryBranch
|
1144
|
+
tryBranch ? (tryBranch.o || (tryBranch.o = 0, requestAnimationFrame(() => {
|
1145
|
+
if (tryBranch.o && !tryBranch.k) {
|
1146
1146
|
let placeholderBranch = tryBranch["#" /* PlaceholderBranch */] = createAndSetupBranch(
|
1147
1147
|
scope.$global,
|
1148
1148
|
tryBranch["%" /* PlaceholderContent */],
|
@@ -1155,14 +1155,14 @@ function awaitTag(nodeAccessor, renderer) {
|
|
1155
1155
|
tryBranch.a
|
1156
1156
|
), tempDetatchBranch(tryBranch);
|
1157
1157
|
}
|
1158
|
-
})), tryBranch
|
1158
|
+
})), tryBranch.o++) : awaitBranch && (awaitBranch.a.parentNode.insertBefore(
|
1159
1159
|
referenceNode,
|
1160
1160
|
awaitBranch.a
|
1161
1161
|
), tempDetatchBranch(awaitBranch));
|
1162
1162
|
};
|
1163
1163
|
}
|
1164
1164
|
function createTry(nodeAccessor, tryContent) {
|
1165
|
-
let branchAccessor =
|
1165
|
+
let branchAccessor = "d" /* ConditionalScope */ + nodeAccessor;
|
1166
1166
|
return (scope, input) => {
|
1167
1167
|
scope[branchAccessor] || setConditionalRenderer(
|
1168
1168
|
scope,
|
@@ -1177,7 +1177,7 @@ function createTry(nodeAccessor, tryContent) {
|
|
1177
1177
|
};
|
1178
1178
|
}
|
1179
1179
|
function conditional(nodeAccessor, ...branches) {
|
1180
|
-
let branchAccessor =
|
1180
|
+
let branchAccessor = "c" /* ConditionalRenderer */ + nodeAccessor;
|
1181
1181
|
return (scope, newBranch) => {
|
1182
1182
|
newBranch !== scope[branchAccessor] && setConditionalRenderer(
|
1183
1183
|
scope,
|
@@ -1191,7 +1191,7 @@ function patchDynamicTag(fn) {
|
|
1191
1191
|
dynamicTag = fn(dynamicTag);
|
1192
1192
|
}
|
1193
1193
|
var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
1194
|
-
let childScopeAccessor =
|
1194
|
+
let childScopeAccessor = "d" /* ConditionalScope */ + nodeAccessor, rendererAccessor = "c" /* ConditionalRenderer */ + nodeAccessor;
|
1195
1195
|
return (scope, newRenderer, getInput) => {
|
1196
1196
|
let normalizedRenderer = normalizeDynamicRenderer(newRenderer);
|
1197
1197
|
if (scope[rendererAccessor] !== (scope[rendererAccessor] = normalizedRenderer?.e || normalizedRenderer) || getContent && !(normalizedRenderer || scope[childScopeAccessor]))
|
@@ -1211,7 +1211,7 @@ var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
|
1211
1211
|
), content.n && subscribeToScopeSet(
|
1212
1212
|
content.m,
|
1213
1213
|
content.n,
|
1214
|
-
scope[childScopeAccessor][
|
1214
|
+
scope[childScopeAccessor]["d" /* ConditionalScope */ + 0]
|
1215
1215
|
);
|
1216
1216
|
}
|
1217
1217
|
} else normalizedRenderer?.n && subscribeToScopeSet(
|
@@ -1247,7 +1247,7 @@ var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
|
1247
1247
|
};
|
1248
1248
|
};
|
1249
1249
|
function setConditionalRenderer(scope, nodeAccessor, newRenderer, createBranch2) {
|
1250
|
-
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);
|
1251
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());
|
1252
1252
|
}
|
1253
1253
|
function loopOf(nodeAccessor, renderer) {
|
@@ -1279,9 +1279,9 @@ function loopTo(nodeAccessor, renderer) {
|
|
1279
1279
|
function loop(nodeAccessor, renderer, forEach) {
|
1280
1280
|
let params = renderer.d;
|
1281
1281
|
return (scope, value2) => {
|
1282
|
-
let referenceNode = scope[nodeAccessor], oldMap = scope[
|
1282
|
+
let referenceNode = scope[nodeAccessor], oldMap = scope["m" /* LoopScopeMap */ + nodeAccessor], oldArray = oldMap ? scope["l" /* LoopScopeArray */ + nodeAccessor] || [
|
1283
1283
|
...oldMap.values()
|
1284
|
-
] : [], 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] = [];
|
1285
1285
|
forEach(value2, (key, args) => {
|
1286
1286
|
let branch = oldMap?.get(key) || createAndSetupBranch(scope.$global, renderer, scope, parentNode);
|
1287
1287
|
params?.(branch, args), newMap.set(key, branch), newArray.push(branch);
|
@@ -1314,13 +1314,13 @@ var pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map(), pendi
|
|
1314
1314
|
function queueRender(scope, signal, signalKey, value2, scopeKey = scope.e) {
|
1315
1315
|
let key = scopeKey * scopeKeyOffset + signalKey, existingRender = signalKey >= 0 && pendingRendersLookup.get(key);
|
1316
1316
|
if (existingRender)
|
1317
|
-
existingRender.
|
1317
|
+
existingRender.A = value2;
|
1318
1318
|
else {
|
1319
1319
|
let render = {
|
1320
1320
|
j: key,
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1321
|
+
u: scope,
|
1322
|
+
D: signal,
|
1323
|
+
A: value2
|
1324
1324
|
}, i = pendingRenders.push(render) - 1;
|
1325
1325
|
for (; i; ) {
|
1326
1326
|
let parentIndex = i - 1 >> 1, parent = pendingRenders[parentIndex];
|
@@ -1372,17 +1372,17 @@ function runRenders() {
|
|
1372
1372
|
}
|
1373
1373
|
pendingRenders[i] = item;
|
1374
1374
|
}
|
1375
|
-
render.
|
1375
|
+
render.u.c?.k || runRender(render);
|
1376
1376
|
}
|
1377
1377
|
finishPendingScopes();
|
1378
1378
|
}
|
1379
|
-
var runRender = (render) => render.
|
1379
|
+
var runRender = (render) => render.D(render.u, render.A), enableCatch = () => {
|
1380
1380
|
enableCatch = () => {
|
1381
1381
|
}, runRender = /* @__PURE__ */ ((runRender2) => (render) => {
|
1382
1382
|
try {
|
1383
1383
|
runRender2(render);
|
1384
1384
|
} catch (error) {
|
1385
|
-
let branch = render.
|
1385
|
+
let branch = render.u.c;
|
1386
1386
|
for (; branch && !branch["^" /* CatchContent */]; )
|
1387
1387
|
branch = branch.g;
|
1388
1388
|
if (branch)
|
@@ -1392,7 +1392,7 @@ var runRender = (render) => render.C(render.t, render.z), enableCatch = () => {
|
|
1392
1392
|
branch["^" /* CatchContent */],
|
1393
1393
|
createAndSetupBranch
|
1394
1394
|
), branch["^" /* CatchContent */].d?.(
|
1395
|
-
branch._[
|
1395
|
+
branch._["d" /* ConditionalScope */ + branch["*" /* BranchAccessor */]],
|
1396
1396
|
[error]
|
1397
1397
|
);
|
1398
1398
|
else
|
@@ -1407,7 +1407,7 @@ function resetAbortSignal(scope, id) {
|
|
1407
1407
|
ctrl && (queueEffect(ctrl, abort), scope.l[id] = void 0);
|
1408
1408
|
}
|
1409
1409
|
function getAbortSignal(scope, id) {
|
1410
|
-
return scope.c && (scope.c.
|
1410
|
+
return scope.c && (scope.c.B ||= /* @__PURE__ */ new Set()).add(scope), ((scope.l ||= {})[id] ||= new AbortController()).signal;
|
1411
1411
|
}
|
1412
1412
|
function abort(ctrl) {
|
1413
1413
|
ctrl.abort();
|
@@ -1429,7 +1429,7 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
1429
1429
|
register(RENDERER_REGISTER_ID, fn);
|
1430
1430
|
},
|
1431
1431
|
isRenderer(renderer) {
|
1432
|
-
return renderer.
|
1432
|
+
return renderer.q;
|
1433
1433
|
},
|
1434
1434
|
getStartNode(branch) {
|
1435
1435
|
return branch.a;
|
@@ -1454,7 +1454,7 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
1454
1454
|
},
|
1455
1455
|
createRenderer(params, clone) {
|
1456
1456
|
let renderer = createRenderer(0, 0, 0, params);
|
1457
|
-
return renderer.
|
1457
|
+
return renderer.q = (branch) => {
|
1458
1458
|
let cloned = clone();
|
1459
1459
|
branch.a = cloned.startNode, branch.b = cloned.endNode;
|
1460
1460
|
}, renderer;
|
@@ -1519,7 +1519,7 @@ function mount(input = {}, reference, position) {
|
|
1519
1519
|
this,
|
1520
1520
|
void 0,
|
1521
1521
|
parentNode
|
1522
|
-
), this.
|
1522
|
+
), this.t?.(branch), args?.(branch, input);
|
1523
1523
|
});
|
1524
1524
|
return insertChildNodes(
|
1525
1525
|
parentNode,
|