marko 6.0.0-next.3.60 → 6.0.0-next.3.62
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 +25 -0
- package/dist/common/accessor.debug.d.ts +25 -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 +171 -171
- package/dist/dom.mjs +171 -171
- package/dist/html.js +14 -14
- package/dist/html.mjs +14 -14
- package/dist/translator/index.js +84 -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/debug/dom.mjs
CHANGED
@@ -234,7 +234,7 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
|
|
234
234
|
const token = commentText[commentPrefixLen];
|
235
235
|
if (token === "*" /* Node */) {
|
236
236
|
const node = scope[data2] = visit.previousSibling;
|
237
|
-
scope[
|
237
|
+
scope["Getter:" /* Getter */ + data2] = () => node;
|
238
238
|
} else if (token === "$" /* ClosestBranch */) {
|
239
239
|
closestBranchMarkers.set(scopeId, visit);
|
240
240
|
} else if (token === "[" /* BranchStart */) {
|
@@ -379,7 +379,7 @@ function controllable_input_checked(scope, nodeAccessor, checked, checkedChange)
|
|
379
379
|
function controllable_input_checked_effect(scope, nodeAccessor) {
|
380
380
|
const el = scope[nodeAccessor];
|
381
381
|
syncControllable(el, "input", hasCheckboxChanged, () => {
|
382
|
-
const checkedChange = scope[
|
382
|
+
const checkedChange = scope["ControlledHandler:" /* ControlledHandler */ + nodeAccessor];
|
383
383
|
if (checkedChange) {
|
384
384
|
const newValue = el.checked;
|
385
385
|
el.checked = !newValue;
|
@@ -389,7 +389,7 @@ function controllable_input_checked_effect(scope, nodeAccessor) {
|
|
389
389
|
});
|
390
390
|
}
|
391
391
|
function controllable_input_checkedValue(scope, nodeAccessor, checkedValue, checkedValueChange, value2) {
|
392
|
-
scope[
|
392
|
+
scope["ControlledValue:" /* ControlledValue */ + nodeAccessor] = checkedValue;
|
393
393
|
attr(scope[nodeAccessor], "value", value2);
|
394
394
|
setCheckboxValue(
|
395
395
|
scope,
|
@@ -402,9 +402,9 @@ function controllable_input_checkedValue(scope, nodeAccessor, checkedValue, chec
|
|
402
402
|
function controllable_input_checkedValue_effect(scope, nodeAccessor) {
|
403
403
|
const el = scope[nodeAccessor];
|
404
404
|
syncControllable(el, "input", hasCheckboxChanged, () => {
|
405
|
-
const checkedValueChange = scope[
|
405
|
+
const checkedValueChange = scope["ControlledHandler:" /* ControlledHandler */ + nodeAccessor];
|
406
406
|
if (checkedValueChange) {
|
407
|
-
const oldValue = scope[
|
407
|
+
const oldValue = scope["ControlledValue:" /* ControlledValue */ + nodeAccessor];
|
408
408
|
const newValue = Array.isArray(oldValue) ? updateList(oldValue, el.value, el.checked) : el.checked ? el.value : void 0;
|
409
409
|
if (el.name && el.type[0] === "r") {
|
410
410
|
for (const radio of el.getRootNode().querySelectorAll(
|
@@ -425,33 +425,33 @@ function controllable_input_checkedValue_effect(scope, nodeAccessor) {
|
|
425
425
|
function controllable_input_value(scope, nodeAccessor, value2, valueChange) {
|
426
426
|
const el = scope[nodeAccessor];
|
427
427
|
const normalizedValue = normalizeStrProp(value2);
|
428
|
-
scope[
|
428
|
+
scope["ControlledHandler:" /* ControlledHandler */ + nodeAccessor] = valueChange;
|
429
429
|
if (valueChange) {
|
430
|
-
scope[
|
431
|
-
scope[
|
430
|
+
scope["ControlledType:" /* ControlledType */ + nodeAccessor] = 0 /* InputChecked */;
|
431
|
+
scope["ControlledValue:" /* ControlledValue */ + nodeAccessor] = value2;
|
432
432
|
if (el.isConnected) {
|
433
433
|
setValueAndUpdateSelection(el, normalizedValue);
|
434
434
|
} else {
|
435
435
|
el.defaultValue = normalizedValue;
|
436
436
|
}
|
437
437
|
} else {
|
438
|
-
scope[
|
438
|
+
scope["ControlledType:" /* ControlledType */ + nodeAccessor] = 5 /* None */;
|
439
439
|
el.defaultValue = normalizedValue;
|
440
440
|
}
|
441
441
|
}
|
442
442
|
function controllable_input_value_effect(scope, nodeAccessor) {
|
443
443
|
const el = scope[nodeAccessor];
|
444
444
|
if (isResuming) {
|
445
|
-
scope[
|
445
|
+
scope["ControlledValue:" /* ControlledValue */ + nodeAccessor] = el.defaultValue;
|
446
446
|
}
|
447
447
|
syncControllable(el, "input", hasValueChanged, (ev) => {
|
448
|
-
const valueChange = scope[
|
448
|
+
const valueChange = scope["ControlledHandler:" /* ControlledHandler */ + nodeAccessor];
|
449
449
|
if (valueChange) {
|
450
450
|
const newValue = el.value;
|
451
451
|
inputType = ev?.inputType;
|
452
452
|
setValueAndUpdateSelection(
|
453
453
|
el,
|
454
|
-
scope[
|
454
|
+
scope["ControlledValue:" /* ControlledValue */ + nodeAccessor]
|
455
455
|
);
|
456
456
|
valueChange(newValue);
|
457
457
|
run();
|
@@ -460,12 +460,12 @@ function controllable_input_value_effect(scope, nodeAccessor) {
|
|
460
460
|
});
|
461
461
|
}
|
462
462
|
function controllable_select_value(scope, nodeAccessor, value2, valueChange) {
|
463
|
-
scope[
|
463
|
+
scope["ControlledHandler:" /* ControlledHandler */ + nodeAccessor] = valueChange;
|
464
464
|
if (valueChange) {
|
465
|
-
scope[
|
466
|
-
scope[
|
465
|
+
scope["ControlledType:" /* ControlledType */ + nodeAccessor] = 3 /* SelectValue */;
|
466
|
+
scope["ControlledValue:" /* ControlledValue */ + nodeAccessor] = value2;
|
467
467
|
} else {
|
468
|
-
scope[
|
468
|
+
scope["ControlledType:" /* ControlledType */ + nodeAccessor] = 5 /* None */;
|
469
469
|
}
|
470
470
|
pendingEffects.unshift(
|
471
471
|
() => setSelectOptions(
|
@@ -479,14 +479,14 @@ function controllable_select_value(scope, nodeAccessor, value2, valueChange) {
|
|
479
479
|
function controllable_select_value_effect(scope, nodeAccessor) {
|
480
480
|
const el = scope[nodeAccessor];
|
481
481
|
const onChange = () => {
|
482
|
-
const valueChange = scope[
|
482
|
+
const valueChange = scope["ControlledHandler:" /* ControlledHandler */ + nodeAccessor];
|
483
483
|
if (valueChange) {
|
484
484
|
const newValue = Array.isArray(
|
485
|
-
scope[
|
485
|
+
scope["ControlledValue:" /* ControlledValue */ + nodeAccessor]
|
486
486
|
) ? Array.from(el.selectedOptions, toValueProp) : el.value;
|
487
487
|
setSelectOptions(
|
488
488
|
el,
|
489
|
-
scope[
|
489
|
+
scope["ControlledValue:" /* ControlledValue */ + nodeAccessor],
|
490
490
|
valueChange
|
491
491
|
);
|
492
492
|
valueChange(newValue);
|
@@ -495,7 +495,7 @@ function controllable_select_value_effect(scope, nodeAccessor) {
|
|
495
495
|
};
|
496
496
|
if (!el._) {
|
497
497
|
new MutationObserver(() => {
|
498
|
-
const value2 = scope[
|
498
|
+
const value2 = scope["ControlledValue:" /* ControlledValue */ + nodeAccessor];
|
499
499
|
if (Array.isArray(value2) ? value2.length !== el.selectedOptions.length || value2.some((value3, i) => value3 != el.selectedOptions[i].value) : el.value != value2) {
|
500
500
|
onChange();
|
501
501
|
}
|
@@ -528,23 +528,23 @@ function setSelectOptions(el, value2, valueChange) {
|
|
528
528
|
}
|
529
529
|
}
|
530
530
|
function controllable_detailsOrDialog_open(scope, nodeAccessor, open, openChange) {
|
531
|
-
scope[
|
531
|
+
scope["ControlledHandler:" /* ControlledHandler */ + nodeAccessor] = openChange;
|
532
532
|
if (openChange) {
|
533
|
-
scope[
|
533
|
+
scope["ControlledType:" /* ControlledType */ + nodeAccessor] = 4 /* DetailsOrDialogOpen */;
|
534
534
|
} else {
|
535
|
-
scope[
|
535
|
+
scope["ControlledType:" /* ControlledType */ + nodeAccessor] = 5 /* None */;
|
536
536
|
}
|
537
|
-
scope[nodeAccessor].open = scope[
|
537
|
+
scope[nodeAccessor].open = scope["ControlledValue:" /* ControlledValue */ + nodeAccessor] = normalizeBoolProp(open);
|
538
538
|
}
|
539
539
|
function controllable_detailsOrDialog_open_effect(scope, nodeAccessor) {
|
540
540
|
const el = scope[nodeAccessor];
|
541
|
-
const hasChanged = () => el.open !== scope[
|
541
|
+
const hasChanged = () => el.open !== scope["ControlledValue:" /* ControlledValue */ + nodeAccessor];
|
542
542
|
syncControllable(
|
543
543
|
el,
|
544
544
|
el.tagName === "DIALOG" ? "close" : "toggle",
|
545
545
|
hasChanged,
|
546
546
|
() => {
|
547
|
-
const openChange = scope[
|
547
|
+
const openChange = scope["ControlledHandler:" /* ControlledHandler */ + nodeAccessor];
|
548
548
|
if (openChange && hasChanged()) {
|
549
549
|
const newValue = el.open;
|
550
550
|
el.open = !newValue;
|
@@ -569,12 +569,12 @@ function setValueAndUpdateSelection(el, value2) {
|
|
569
569
|
}
|
570
570
|
}
|
571
571
|
function setCheckboxValue(scope, nodeAccessor, type, checked, checkedChange) {
|
572
|
-
scope[
|
572
|
+
scope["ControlledHandler:" /* ControlledHandler */ + nodeAccessor] = checkedChange;
|
573
573
|
if (checkedChange) {
|
574
|
-
scope[
|
574
|
+
scope["ControlledType:" /* ControlledType */ + nodeAccessor] = type;
|
575
575
|
scope[nodeAccessor].checked = checked;
|
576
576
|
} else {
|
577
|
-
scope[
|
577
|
+
scope["ControlledType:" /* ControlledType */ + nodeAccessor] = 5 /* None */;
|
578
578
|
scope[nodeAccessor].defaultChecked = checked;
|
579
579
|
}
|
580
580
|
}
|
@@ -786,7 +786,7 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
|
|
786
786
|
break;
|
787
787
|
default: {
|
788
788
|
if (isEventHandler(name)) {
|
789
|
-
(events ||= scope[
|
789
|
+
(events ||= scope["EventAttributes:" /* EventAttributes */ + nodeAccessor] = {})[getEventHandlerName(name)] = value2;
|
790
790
|
} else if (!skip?.test(name)) {
|
791
791
|
attr(el, name, value2);
|
792
792
|
}
|
@@ -796,8 +796,8 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
|
|
796
796
|
}
|
797
797
|
function attrsEvents(scope, nodeAccessor) {
|
798
798
|
const el = scope[nodeAccessor];
|
799
|
-
const events = scope[
|
800
|
-
switch (scope[
|
799
|
+
const events = scope["EventAttributes:" /* EventAttributes */ + nodeAccessor];
|
800
|
+
switch (scope["ControlledType:" /* ControlledType */ + nodeAccessor]) {
|
801
801
|
case 0 /* InputChecked */:
|
802
802
|
controllable_input_checked_effect(scope, nodeAccessor);
|
803
803
|
break;
|
@@ -821,7 +821,7 @@ function attrsEvents(scope, nodeAccessor) {
|
|
821
821
|
function html(scope, value2, accessor) {
|
822
822
|
const firstChild = scope[accessor];
|
823
823
|
const parentNode = firstChild.parentNode;
|
824
|
-
const lastChild = scope[
|
824
|
+
const lastChild = scope["DynamicPlaceholderLastChild:" /* DynamicPlaceholderLastChild */ + accessor] || firstChild;
|
825
825
|
const newContent = parseHTML(
|
826
826
|
value2 || value2 === 0 ? value2 + "" : "",
|
827
827
|
parentNode.namespaceURI
|
@@ -830,7 +830,7 @@ function html(scope, value2, accessor) {
|
|
830
830
|
parentNode,
|
831
831
|
firstChild,
|
832
832
|
scope[accessor] = newContent.firstChild || newContent.appendChild(new Text()),
|
833
|
-
scope[
|
833
|
+
scope["DynamicPlaceholderLastChild:" /* DynamicPlaceholderLastChild */ + accessor] = newContent.lastChild
|
834
834
|
);
|
835
835
|
removeChildNodes(firstChild, lastChild);
|
836
836
|
}
|
@@ -868,7 +868,7 @@ function lifecycle(scope, index, thisObj) {
|
|
868
868
|
thisObj.onMount?.();
|
869
869
|
getAbortSignal(
|
870
870
|
scope,
|
871
|
-
"
|
871
|
+
"LifecycleAbortController:" /* LifecycleAbortController */ + index
|
872
872
|
).onabort = () => thisObj.onDestroy?.();
|
873
873
|
}
|
874
874
|
}
|
@@ -945,7 +945,7 @@ function insertBranchBefore(branch, parentNode, nextSibling) {
|
|
945
945
|
}
|
946
946
|
function tempDetatchBranch(branch) {
|
947
947
|
insertChildNodes(
|
948
|
-
|
948
|
+
new DocumentFragment(),
|
949
949
|
null,
|
950
950
|
branch.___startNode,
|
951
951
|
branch.___endNode
|
@@ -1136,7 +1136,7 @@ function walkInternal(currentWalkIndex, walkCodes, scope) {
|
|
1136
1136
|
if (value2 === 32 /* Get */) {
|
1137
1137
|
const node = walker.currentNode;
|
1138
1138
|
scope[true ? getDebugKey(currentScopeIndex, walker.currentNode) : currentScopeIndex] = node;
|
1139
|
-
scope[(true ? getDebugKey(currentScopeIndex++, walker.currentNode) : currentScopeIndex++)
|
1139
|
+
scope["Getter:" /* Getter */ + (true ? getDebugKey(currentScopeIndex++, walker.currentNode) : currentScopeIndex++)] = () => node;
|
1140
1140
|
} else if (value2 === 37 /* Replace */ || value2 === 49 /* DynamicTagWithVar */) {
|
1141
1141
|
walker.currentNode.replaceWith(
|
1142
1142
|
walker.currentNode = scope[true ? getDebugKey(currentScopeIndex++, "#text") : currentScopeIndex++] = new Text()
|
@@ -1349,7 +1349,7 @@ function state(valueAccessor, fn) {
|
|
1349
1349
|
valueAccessor.lastIndexOf("/")
|
1350
1350
|
);
|
1351
1351
|
}
|
1352
|
-
const valueChangeAccessor =
|
1352
|
+
const valueChangeAccessor = "TagVariableChange:" /* TagVariableChange */ + valueAccessor;
|
1353
1353
|
const update = (scope, value2) => {
|
1354
1354
|
if (scope[valueAccessor] !== value2) {
|
1355
1355
|
scope[valueAccessor] = value2;
|
@@ -1400,8 +1400,8 @@ function intersection(id, fn, defaultPending = 1, scopeIdAccessor = /* @__KEY__
|
|
1400
1400
|
}
|
1401
1401
|
function loopClosure(valueAccessor, ownerLoopNodeAccessor, fn) {
|
1402
1402
|
const childSignal = closure(valueAccessor, fn);
|
1403
|
-
const loopScopeAccessor =
|
1404
|
-
const loopScopeMapAccessor =
|
1403
|
+
const loopScopeAccessor = "LoopScopeArray:" /* LoopScopeArray */ + ownerLoopNodeAccessor;
|
1404
|
+
const loopScopeMapAccessor = "LoopScopeMap:" /* LoopScopeMap */ + ownerLoopNodeAccessor;
|
1405
1405
|
const ownerSignal = (ownerScope) => {
|
1406
1406
|
const scopes = ownerScope[loopScopeAccessor] || ownerScope[loopScopeMapAccessor]?.values() || [];
|
1407
1407
|
const [firstScope] = scopes;
|
@@ -1426,8 +1426,8 @@ function loopClosure(valueAccessor, ownerLoopNodeAccessor, fn) {
|
|
1426
1426
|
}
|
1427
1427
|
function conditionalClosure(valueAccessor, ownerConditionalNodeAccessor, branch, fn) {
|
1428
1428
|
const childSignal = closure(valueAccessor, fn);
|
1429
|
-
const scopeAccessor =
|
1430
|
-
const branchAccessor =
|
1429
|
+
const scopeAccessor = "ConditionalScope:" /* ConditionalScope */ + ownerConditionalNodeAccessor;
|
1430
|
+
const branchAccessor = "ConditionalRenderer:" /* ConditionalRenderer */ + ownerConditionalNodeAccessor;
|
1431
1431
|
const ownerSignal = (scope) => {
|
1432
1432
|
const ifScope = scope[scopeAccessor];
|
1433
1433
|
if (ifScope && !ifScope.___pending && scope[branchAccessor] === branch) {
|
@@ -1477,8 +1477,8 @@ function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
|
|
1477
1477
|
scope
|
1478
1478
|
);
|
1479
1479
|
};
|
1480
|
-
closureSignal.___scopeInstancesAccessor =
|
1481
|
-
closureSignal.___signalIndexAccessor =
|
1480
|
+
closureSignal.___scopeInstancesAccessor = "ClosureScopes:" /* ClosureScopes */ + valueAccessor;
|
1481
|
+
closureSignal.___signalIndexAccessor = "ClosureSignalIndex:" /* ClosureSignalIndex */ + valueAccessor;
|
1482
1482
|
return closureSignal;
|
1483
1483
|
}
|
1484
1484
|
function closure(valueAccessor, fn, getOwnerScope) {
|
@@ -1487,13 +1487,13 @@ function closure(valueAccessor, fn, getOwnerScope) {
|
|
1487
1487
|
};
|
1488
1488
|
}
|
1489
1489
|
function setTagVar(scope, childAccessor, tagVarSignal2) {
|
1490
|
-
scope[childAccessor]["
|
1490
|
+
scope[childAccessor]["#TagVariable" /* TagVariable */] = (value2) => tagVarSignal2(scope, value2);
|
1491
1491
|
}
|
1492
|
-
var tagVarSignal = (scope, value2) => scope["
|
1492
|
+
var tagVarSignal = (scope, value2) => scope["#TagVariable" /* TagVariable */]?.(value2);
|
1493
1493
|
function setTagVarChange(scope, changeHandler) {
|
1494
|
-
scope["
|
1494
|
+
scope["#TagVariableChange" /* TagVariableChange */] = changeHandler;
|
1495
1495
|
}
|
1496
|
-
var tagVarSignalChange = (scope, value2) => scope["
|
1496
|
+
var tagVarSignalChange = (scope, value2) => scope["#TagVariableChange" /* TagVariableChange */]?.(value2);
|
1497
1497
|
var tagIdsByGlobal = /* @__PURE__ */ new WeakMap();
|
1498
1498
|
function nextTagId({ $global }) {
|
1499
1499
|
const id = tagIdsByGlobal.get($global) || 0;
|
@@ -1529,14 +1529,14 @@ function hoist(...path) {
|
|
1529
1529
|
|
1530
1530
|
// src/dom/control-flow.ts
|
1531
1531
|
function awaitTag(nodeAccessor, renderer) {
|
1532
|
-
const promiseAccessor =
|
1533
|
-
const branchAccessor =
|
1532
|
+
const promiseAccessor = "Promise:" /* Promise */ + nodeAccessor;
|
1533
|
+
const branchAccessor = "ConditionalScope:" /* ConditionalScope */ + nodeAccessor;
|
1534
1534
|
return (scope, promise) => {
|
1535
1535
|
let tryBranch = scope.___closestBranch;
|
1536
1536
|
let awaitBranch = scope[branchAccessor];
|
1537
1537
|
const referenceNode = scope[nodeAccessor];
|
1538
1538
|
const namespaceNode = (awaitBranch?.___startNode ?? referenceNode).parentNode;
|
1539
|
-
while (tryBranch && !tryBranch["
|
1539
|
+
while (tryBranch && !tryBranch["#PlaceholderContent" /* PlaceholderContent */]) {
|
1540
1540
|
tryBranch = tryBranch.___parentBranch;
|
1541
1541
|
}
|
1542
1542
|
const thisPromise = scope[promiseAccessor] = promise.then((data2) => {
|
@@ -1561,8 +1561,8 @@ function awaitTag(nodeAccessor, renderer) {
|
|
1561
1561
|
renderer.___params?.(awaitBranch, [data2]);
|
1562
1562
|
});
|
1563
1563
|
if (tryBranch) {
|
1564
|
-
if (!--tryBranch
|
1565
|
-
const placeholderBranch = tryBranch["#" /* PlaceholderBranch */];
|
1564
|
+
if (!--tryBranch.___pendingAsyncCount) {
|
1565
|
+
const placeholderBranch = tryBranch["#PlaceholderBranch" /* PlaceholderBranch */];
|
1566
1566
|
if (placeholderBranch) {
|
1567
1567
|
insertBranchBefore(
|
1568
1568
|
tryBranch,
|
@@ -1583,7 +1583,7 @@ function awaitTag(nodeAccessor, renderer) {
|
|
1583
1583
|
}
|
1584
1584
|
}).catch((error) => {
|
1585
1585
|
let tryBranch2 = scope.___closestBranch;
|
1586
|
-
while (tryBranch2 && !tryBranch2["
|
1586
|
+
while (tryBranch2 && !tryBranch2["#CatchContent" /* CatchContent */]) {
|
1587
1587
|
tryBranch2 = tryBranch2.___parentBranch;
|
1588
1588
|
}
|
1589
1589
|
if (!tryBranch2) {
|
@@ -1593,24 +1593,24 @@ function awaitTag(nodeAccessor, renderer) {
|
|
1593
1593
|
} else {
|
1594
1594
|
setConditionalRenderer(
|
1595
1595
|
tryBranch2._,
|
1596
|
-
tryBranch2["
|
1597
|
-
tryBranch2["
|
1596
|
+
tryBranch2["#BranchAccessor" /* BranchAccessor */],
|
1597
|
+
tryBranch2["#CatchContent" /* CatchContent */],
|
1598
1598
|
createAndSetupBranch
|
1599
1599
|
);
|
1600
|
-
tryBranch2["
|
1601
|
-
tryBranch2._[
|
1600
|
+
tryBranch2["#CatchContent" /* CatchContent */].___params?.(
|
1601
|
+
tryBranch2._["ConditionalScope:" /* ConditionalScope */ + tryBranch2["#BranchAccessor" /* BranchAccessor */]],
|
1602
1602
|
[error]
|
1603
1603
|
);
|
1604
1604
|
}
|
1605
1605
|
});
|
1606
1606
|
if (tryBranch) {
|
1607
|
-
if (!tryBranch
|
1608
|
-
tryBranch
|
1607
|
+
if (!tryBranch.___pendingAsyncCount) {
|
1608
|
+
tryBranch.___pendingAsyncCount = 0;
|
1609
1609
|
requestAnimationFrame(() => {
|
1610
|
-
if (tryBranch
|
1611
|
-
const placeholderBranch = tryBranch["#" /* PlaceholderBranch */] = createAndSetupBranch(
|
1610
|
+
if (tryBranch.___pendingAsyncCount && !tryBranch.___destroyed) {
|
1611
|
+
const placeholderBranch = tryBranch["#PlaceholderBranch" /* PlaceholderBranch */] = createAndSetupBranch(
|
1612
1612
|
scope.$global,
|
1613
|
-
tryBranch["
|
1613
|
+
tryBranch["#PlaceholderContent" /* PlaceholderContent */],
|
1614
1614
|
tryBranch._,
|
1615
1615
|
tryBranch.___startNode.parentNode
|
1616
1616
|
);
|
@@ -1623,7 +1623,7 @@ function awaitTag(nodeAccessor, renderer) {
|
|
1623
1623
|
}
|
1624
1624
|
});
|
1625
1625
|
}
|
1626
|
-
tryBranch
|
1626
|
+
tryBranch.___pendingAsyncCount++;
|
1627
1627
|
} else if (awaitBranch) {
|
1628
1628
|
awaitBranch.___startNode.parentNode.insertBefore(
|
1629
1629
|
referenceNode,
|
@@ -1634,7 +1634,7 @@ function awaitTag(nodeAccessor, renderer) {
|
|
1634
1634
|
};
|
1635
1635
|
}
|
1636
1636
|
function createTry(nodeAccessor, tryContent) {
|
1637
|
-
const branchAccessor =
|
1637
|
+
const branchAccessor = "ConditionalScope:" /* ConditionalScope */ + nodeAccessor;
|
1638
1638
|
return (scope, input) => {
|
1639
1639
|
if (!scope[branchAccessor]) {
|
1640
1640
|
setConditionalRenderer(
|
@@ -1646,16 +1646,16 @@ function createTry(nodeAccessor, tryContent) {
|
|
1646
1646
|
}
|
1647
1647
|
const branch = scope[branchAccessor];
|
1648
1648
|
if (branch) {
|
1649
|
-
branch["
|
1650
|
-
branch["
|
1651
|
-
branch["
|
1649
|
+
branch["#BranchAccessor" /* BranchAccessor */] = nodeAccessor;
|
1650
|
+
branch["#CatchContent" /* CatchContent */] = normalizeDynamicRenderer(input.catch);
|
1651
|
+
branch["#PlaceholderContent" /* PlaceholderContent */] = normalizeDynamicRenderer(
|
1652
1652
|
input.placeholder
|
1653
1653
|
);
|
1654
1654
|
}
|
1655
1655
|
};
|
1656
1656
|
}
|
1657
1657
|
function conditional(nodeAccessor, ...branches) {
|
1658
|
-
const branchAccessor =
|
1658
|
+
const branchAccessor = "ConditionalRenderer:" /* ConditionalRenderer */ + nodeAccessor;
|
1659
1659
|
return (scope, newBranch) => {
|
1660
1660
|
if (newBranch !== scope[branchAccessor]) {
|
1661
1661
|
setConditionalRenderer(
|
@@ -1671,8 +1671,8 @@ function patchDynamicTag(fn) {
|
|
1671
1671
|
dynamicTag = fn(dynamicTag);
|
1672
1672
|
}
|
1673
1673
|
var dynamicTag = function dynamicTag2(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
1674
|
-
const childScopeAccessor =
|
1675
|
-
const rendererAccessor =
|
1674
|
+
const childScopeAccessor = "ConditionalScope:" /* ConditionalScope */ + nodeAccessor;
|
1675
|
+
const rendererAccessor = "ConditionalRenderer:" /* ConditionalRenderer */ + nodeAccessor;
|
1676
1676
|
return (scope, newRenderer, getInput) => {
|
1677
1677
|
const normalizedRenderer = normalizeDynamicRenderer(newRenderer);
|
1678
1678
|
if (scope[rendererAccessor] !== (scope[rendererAccessor] = normalizedRenderer?.___id || normalizedRenderer) || getContent && !(normalizedRenderer || scope[childScopeAccessor])) {
|
@@ -1698,7 +1698,7 @@ var dynamicTag = function dynamicTag2(nodeAccessor, getContent, getTagVar, input
|
|
1698
1698
|
subscribeToScopeSet(
|
1699
1699
|
content.___owner,
|
1700
1700
|
content.___accessor,
|
1701
|
-
scope[childScopeAccessor][(true ? `#${normalizedRenderer}/0` : 0)
|
1701
|
+
scope[childScopeAccessor]["ConditionalScope:" /* ConditionalScope */ + (true ? `#${normalizedRenderer}/0` : 0)]
|
1702
1702
|
);
|
1703
1703
|
}
|
1704
1704
|
}
|
@@ -1740,9 +1740,9 @@ var dynamicTag = function dynamicTag2(nodeAccessor, getContent, getTagVar, input
|
|
1740
1740
|
};
|
1741
1741
|
function setConditionalRenderer(scope, nodeAccessor, newRenderer, createBranch2) {
|
1742
1742
|
const referenceNode = scope[nodeAccessor];
|
1743
|
-
const prevBranch = scope[
|
1743
|
+
const prevBranch = scope["ConditionalScope:" /* ConditionalScope */ + nodeAccessor];
|
1744
1744
|
const parentNode = referenceNode.nodeType > 1 /* Element */ ? (prevBranch?.___startNode || referenceNode).parentNode : referenceNode;
|
1745
|
-
const newBranch = scope[
|
1745
|
+
const newBranch = scope["ConditionalScope:" /* ConditionalScope */ + nodeAccessor] = newRenderer && createBranch2(scope.$global, newRenderer, scope, parentNode);
|
1746
1746
|
if (referenceNode === parentNode) {
|
1747
1747
|
if (prevBranch) {
|
1748
1748
|
destroyBranch(prevBranch);
|
@@ -1797,13 +1797,13 @@ function loop(nodeAccessor, renderer, forEach) {
|
|
1797
1797
|
const params = renderer.___params;
|
1798
1798
|
return (scope, value2) => {
|
1799
1799
|
const referenceNode = scope[nodeAccessor];
|
1800
|
-
const oldMap = scope[
|
1801
|
-
const oldArray = oldMap ? scope[
|
1800
|
+
const oldMap = scope["LoopScopeMap:" /* LoopScopeMap */ + nodeAccessor];
|
1801
|
+
const oldArray = oldMap ? scope["LoopScopeArray:" /* LoopScopeArray */ + nodeAccessor] || [
|
1802
1802
|
...oldMap.values()
|
1803
1803
|
] : [];
|
1804
1804
|
const parentNode = referenceNode.nodeType > 1 /* Element */ ? referenceNode.parentNode || oldArray[0].___startNode.parentNode : referenceNode;
|
1805
|
-
const newMap = scope[
|
1806
|
-
const newArray = scope[
|
1805
|
+
const newMap = scope["LoopScopeMap:" /* LoopScopeMap */ + nodeAccessor] = /* @__PURE__ */ new Map();
|
1806
|
+
const newArray = scope["LoopScopeArray:" /* LoopScopeArray */ + nodeAccessor] = [];
|
1807
1807
|
forEach(value2, (key, args) => {
|
1808
1808
|
const branch = oldMap?.get(key) || createAndSetupBranch(scope.$global, renderer, scope, parentNode);
|
1809
1809
|
params?.(branch, args);
|
@@ -1960,19 +1960,19 @@ var enableCatch = () => {
|
|
1960
1960
|
runRender2(render);
|
1961
1961
|
} catch (error) {
|
1962
1962
|
let branch = render.___scope.___closestBranch;
|
1963
|
-
while (branch && !branch["
|
1963
|
+
while (branch && !branch["#CatchContent" /* CatchContent */])
|
1964
1964
|
branch = branch.___parentBranch;
|
1965
1965
|
if (!branch) {
|
1966
1966
|
throw error;
|
1967
1967
|
} else {
|
1968
1968
|
setConditionalRenderer(
|
1969
1969
|
branch._,
|
1970
|
-
branch["
|
1971
|
-
branch["
|
1970
|
+
branch["#BranchAccessor" /* BranchAccessor */],
|
1971
|
+
branch["#CatchContent" /* CatchContent */],
|
1972
1972
|
createAndSetupBranch
|
1973
1973
|
);
|
1974
|
-
branch["
|
1975
|
-
branch._[
|
1974
|
+
branch["#CatchContent" /* CatchContent */].___params?.(
|
1975
|
+
branch._["ConditionalScope:" /* ConditionalScope */ + branch["#BranchAccessor" /* BranchAccessor */]],
|
1976
1976
|
[error]
|
1977
1977
|
);
|
1978
1978
|
}
|
package/dist/debug/html.js
CHANGED
@@ -1644,7 +1644,7 @@ function withContext(key, value, cb) {
|
|
1644
1644
|
}
|
1645
1645
|
function setTagVar(parentScopeId, scopeOffsetAccessor, childScope, registryId) {
|
1646
1646
|
ensureScopeWithId(parentScopeId)[scopeOffsetAccessor] = nextScopeId();
|
1647
|
-
childScope["
|
1647
|
+
childScope["#TagVariable" /* TagVariable */] = register2(
|
1648
1648
|
{},
|
1649
1649
|
registryId,
|
1650
1650
|
parentScopeId
|
@@ -1889,7 +1889,7 @@ function fork(scopeId, accessor, promise, content) {
|
|
1889
1889
|
);
|
1890
1890
|
content(promise);
|
1891
1891
|
writeScope(scopeId, {
|
1892
|
-
[
|
1892
|
+
["ConditionalScope:" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
|
1893
1893
|
});
|
1894
1894
|
$chunk.writeHTML(
|
1895
1895
|
$chunk.boundary.state.mark(
|
@@ -1924,7 +1924,7 @@ function fork(scopeId, accessor, promise, content) {
|
|
1924
1924
|
boundary.state.serializer.writeAssign(
|
1925
1925
|
writeScope(branchId, {}),
|
1926
1926
|
ensureScopeWithId(scopeId),
|
1927
|
-
|
1927
|
+
"ConditionalScope:" /* ConditionalScope */ + accessor
|
1928
1928
|
);
|
1929
1929
|
$chunk.writeHTML(
|
1930
1930
|
$chunk.boundary.state.mark(
|
@@ -1961,12 +1961,12 @@ function tryContent(scopeId, accessor, content, input) {
|
|
1961
1961
|
content();
|
1962
1962
|
}
|
1963
1963
|
writeScope(branchId, {
|
1964
|
-
["
|
1965
|
-
["
|
1966
|
-
["
|
1964
|
+
["#BranchAccessor" /* BranchAccessor */]: accessor,
|
1965
|
+
["#CatchContent" /* CatchContent */]: catchContent,
|
1966
|
+
["#PlaceholderContent" /* PlaceholderContent */]: placeholderContent
|
1967
1967
|
});
|
1968
1968
|
writeScope(scopeId, {
|
1969
|
-
[
|
1969
|
+
["ConditionalScope:" /* ConditionalScope */ + accessor]: getScopeById(branchId)
|
1970
1970
|
});
|
1971
1971
|
$chunk.writeHTML(
|
1972
1972
|
$chunk.boundary.state.mark(
|
@@ -2590,7 +2590,7 @@ function attrs(data, nodeAccessor, scopeId, tagName) {
|
|
2590
2590
|
if (!events) {
|
2591
2591
|
events = {};
|
2592
2592
|
writeScope(scopeId, {
|
2593
|
-
[
|
2593
|
+
["EventAttributes:" /* EventAttributes */ + nodeAccessor]: events
|
2594
2594
|
});
|
2595
2595
|
}
|
2596
2596
|
events[getEventHandlerName(name)] = value;
|
@@ -2612,9 +2612,9 @@ function partialAttrs(data, skip, nodeAccessor, scopeId, tagName) {
|
|
2612
2612
|
}
|
2613
2613
|
function writeControlledScope(type, scopeId, nodeAccessor, value, valueChange) {
|
2614
2614
|
writeScope(scopeId, {
|
2615
|
-
[
|
2616
|
-
[
|
2617
|
-
[
|
2615
|
+
["ControlledType:" /* ControlledType */ + nodeAccessor]: type,
|
2616
|
+
["ControlledValue:" /* ControlledValue */ + nodeAccessor]: value,
|
2617
|
+
["ControlledHandler:" /* ControlledHandler */ + nodeAccessor]: valueChange
|
2618
2618
|
});
|
2619
2619
|
}
|
2620
2620
|
function stringAttr(name, value) {
|
package/dist/debug/html.mjs
CHANGED
@@ -1560,7 +1560,7 @@ function withContext(key, value, cb) {
|
|
1560
1560
|
}
|
1561
1561
|
function setTagVar(parentScopeId, scopeOffsetAccessor, childScope, registryId) {
|
1562
1562
|
ensureScopeWithId(parentScopeId)[scopeOffsetAccessor] = nextScopeId();
|
1563
|
-
childScope["
|
1563
|
+
childScope["#TagVariable" /* TagVariable */] = register2(
|
1564
1564
|
{},
|
1565
1565
|
registryId,
|
1566
1566
|
parentScopeId
|
@@ -1805,7 +1805,7 @@ function fork(scopeId, accessor, promise, content) {
|
|
1805
1805
|
);
|
1806
1806
|
content(promise);
|
1807
1807
|
writeScope(scopeId, {
|
1808
|
-
[
|
1808
|
+
["ConditionalScope:" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
|
1809
1809
|
});
|
1810
1810
|
$chunk.writeHTML(
|
1811
1811
|
$chunk.boundary.state.mark(
|
@@ -1840,7 +1840,7 @@ function fork(scopeId, accessor, promise, content) {
|
|
1840
1840
|
boundary.state.serializer.writeAssign(
|
1841
1841
|
writeScope(branchId, {}),
|
1842
1842
|
ensureScopeWithId(scopeId),
|
1843
|
-
|
1843
|
+
"ConditionalScope:" /* ConditionalScope */ + accessor
|
1844
1844
|
);
|
1845
1845
|
$chunk.writeHTML(
|
1846
1846
|
$chunk.boundary.state.mark(
|
@@ -1877,12 +1877,12 @@ function tryContent(scopeId, accessor, content, input) {
|
|
1877
1877
|
content();
|
1878
1878
|
}
|
1879
1879
|
writeScope(branchId, {
|
1880
|
-
["
|
1881
|
-
["
|
1882
|
-
["
|
1880
|
+
["#BranchAccessor" /* BranchAccessor */]: accessor,
|
1881
|
+
["#CatchContent" /* CatchContent */]: catchContent,
|
1882
|
+
["#PlaceholderContent" /* PlaceholderContent */]: placeholderContent
|
1883
1883
|
});
|
1884
1884
|
writeScope(scopeId, {
|
1885
|
-
[
|
1885
|
+
["ConditionalScope:" /* ConditionalScope */ + accessor]: getScopeById(branchId)
|
1886
1886
|
});
|
1887
1887
|
$chunk.writeHTML(
|
1888
1888
|
$chunk.boundary.state.mark(
|
@@ -2506,7 +2506,7 @@ function attrs(data, nodeAccessor, scopeId, tagName) {
|
|
2506
2506
|
if (!events) {
|
2507
2507
|
events = {};
|
2508
2508
|
writeScope(scopeId, {
|
2509
|
-
[
|
2509
|
+
["EventAttributes:" /* EventAttributes */ + nodeAccessor]: events
|
2510
2510
|
});
|
2511
2511
|
}
|
2512
2512
|
events[getEventHandlerName(name)] = value;
|
@@ -2528,9 +2528,9 @@ function partialAttrs(data, skip, nodeAccessor, scopeId, tagName) {
|
|
2528
2528
|
}
|
2529
2529
|
function writeControlledScope(type, scopeId, nodeAccessor, value, valueChange) {
|
2530
2530
|
writeScope(scopeId, {
|
2531
|
-
[
|
2532
|
-
[
|
2533
|
-
[
|
2531
|
+
["ControlledType:" /* ControlledType */ + nodeAccessor]: type,
|
2532
|
+
["ControlledValue:" /* ControlledValue */ + nodeAccessor]: value,
|
2533
|
+
["ControlledHandler:" /* ControlledHandler */ + nodeAccessor]: valueChange
|
2534
2534
|
});
|
2535
2535
|
}
|
2536
2536
|
function stringAttr(name, value) {
|