marko 6.0.0-next.3.85 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/accessor.d.ts +1 -0
- package/dist/common/accessor.debug.d.ts +1 -0
- package/dist/debug/dom.js +11 -7
- package/dist/debug/dom.mjs +11 -7
- package/dist/debug/html.js +304 -247
- package/dist/debug/html.mjs +300 -246
- package/dist/dom.js +8 -5
- package/dist/dom.mjs +8 -5
- package/dist/html/compat.d.ts +1 -1
- package/dist/html/dynamic-tag.d.ts +2 -2
- package/dist/html/template.d.ts +1 -0
- package/dist/html/writer.d.ts +14 -12
- package/dist/html.d.ts +1 -1
- package/dist/html.js +214 -168
- package/dist/html.mjs +210 -167
- package/dist/translator/index.js +1464 -980
- package/dist/translator/util/evaluate.d.ts +2 -0
- package/dist/translator/util/generate-uid.d.ts +3 -0
- package/dist/translator/util/optional.d.ts +9 -7
- package/dist/translator/util/references.d.ts +9 -7
- package/dist/translator/util/sections.d.ts +7 -5
- package/dist/translator/util/serialize-reasons.d.ts +28 -17
- package/dist/translator/util/signals.d.ts +1 -2
- package/dist/translator/util/writer.d.ts +2 -1
- package/dist/translator/visitors/placeholder.d.ts +2 -2
- package/dist/translator/visitors/program/html.d.ts +3 -0
- package/dist/translator/visitors/program/index.d.ts +5 -1
- package/dist/translator/visitors/tag/custom-tag.d.ts +2 -0
- package/package.json +2 -2
@@ -16,6 +16,7 @@ export declare enum AccessorPrefix {
|
|
16
16
|
TagVariableChange = "TagVariableChange:"
|
17
17
|
}
|
18
18
|
export declare enum AccessorProp {
|
19
|
+
Owner = "_",// TODO: should be a full name.
|
19
20
|
BranchAccessor = "#BranchAccessor",
|
20
21
|
CatchContent = "#CatchContent",
|
21
22
|
PlaceholderBranch = "#PlaceholderBranch",
|
package/dist/debug/dom.js
CHANGED
@@ -1280,7 +1280,7 @@ function getDebugKey(index, node) {
|
|
1280
1280
|
function createBranch($global, renderer, parentScope, parentNode) {
|
1281
1281
|
const branch = createScope($global);
|
1282
1282
|
const parentBranch = parentScope?.___closestBranch;
|
1283
|
-
branch
|
1283
|
+
branch["_" /* Owner */] = renderer.___owner || parentScope;
|
1284
1284
|
branch.___closestBranch = branch;
|
1285
1285
|
if (parentBranch) {
|
1286
1286
|
branch.___parentBranch = parentBranch;
|
@@ -1556,7 +1556,7 @@ function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
|
|
1556
1556
|
scope[closureSignal.___signalIndexAccessor] = closureSignal.___index;
|
1557
1557
|
childSignal(scope);
|
1558
1558
|
subscribeToScopeSet(
|
1559
|
-
getOwnerScope ? getOwnerScope(scope) : scope
|
1559
|
+
getOwnerScope ? getOwnerScope(scope) : scope["_" /* Owner */],
|
1560
1560
|
closureSignal.___scopeInstancesAccessor,
|
1561
1561
|
scope
|
1562
1562
|
);
|
@@ -1567,7 +1567,10 @@ function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
|
|
1567
1567
|
}
|
1568
1568
|
function closure(valueAccessor, fn, getOwnerScope) {
|
1569
1569
|
return (scope) => {
|
1570
|
-
fn(
|
1570
|
+
fn(
|
1571
|
+
scope,
|
1572
|
+
(getOwnerScope ? getOwnerScope(scope) : scope["_" /* Owner */])[valueAccessor]
|
1573
|
+
);
|
1571
1574
|
};
|
1572
1575
|
}
|
1573
1576
|
function setTagVar(scope, childAccessor, tagVarSignal2) {
|
@@ -1635,7 +1638,7 @@ function awaitTag(nodeAccessor, renderer) {
|
|
1635
1638
|
tryWithPlaceholder["#PlaceholderBranch" /* PlaceholderBranch */] = createAndSetupBranch(
|
1636
1639
|
scope.$global,
|
1637
1640
|
tryWithPlaceholder["#PlaceholderContent" /* PlaceholderContent */],
|
1638
|
-
tryWithPlaceholder
|
1641
|
+
tryWithPlaceholder["_" /* Owner */],
|
1639
1642
|
tryWithPlaceholder.___startNode.parentNode
|
1640
1643
|
),
|
1641
1644
|
tryWithPlaceholder.___startNode.parentNode,
|
@@ -1743,21 +1746,22 @@ function renderCatch(scope, error) {
|
|
1743
1746
|
if (!tryWithCatch) {
|
1744
1747
|
throw error;
|
1745
1748
|
} else {
|
1749
|
+
const owner = tryWithCatch["_" /* Owner */];
|
1746
1750
|
const placeholderBranch = tryWithCatch["#PlaceholderBranch" /* PlaceholderBranch */];
|
1747
1751
|
if (placeholderBranch) {
|
1748
1752
|
tryWithCatch.___pendingAsyncCount = 0;
|
1749
|
-
|
1753
|
+
owner["ConditionalScope:" /* ConditionalScope */ + tryWithCatch["#BranchAccessor" /* BranchAccessor */]] = placeholderBranch;
|
1750
1754
|
destroyBranch(tryWithCatch);
|
1751
1755
|
}
|
1752
1756
|
caughtError.add(pendingEffects);
|
1753
1757
|
setConditionalRenderer(
|
1754
|
-
|
1758
|
+
owner,
|
1755
1759
|
tryWithCatch["#BranchAccessor" /* BranchAccessor */],
|
1756
1760
|
tryWithCatch["#CatchContent" /* CatchContent */],
|
1757
1761
|
createAndSetupBranch
|
1758
1762
|
);
|
1759
1763
|
tryWithCatch["#CatchContent" /* CatchContent */].___params?.(
|
1760
|
-
|
1764
|
+
owner["ConditionalScope:" /* ConditionalScope */ + tryWithCatch["#BranchAccessor" /* BranchAccessor */]],
|
1761
1765
|
[error]
|
1762
1766
|
);
|
1763
1767
|
}
|
package/dist/debug/dom.mjs
CHANGED
@@ -1192,7 +1192,7 @@ function getDebugKey(index, node) {
|
|
1192
1192
|
function createBranch($global, renderer, parentScope, parentNode) {
|
1193
1193
|
const branch = createScope($global);
|
1194
1194
|
const parentBranch = parentScope?.___closestBranch;
|
1195
|
-
branch
|
1195
|
+
branch["_" /* Owner */] = renderer.___owner || parentScope;
|
1196
1196
|
branch.___closestBranch = branch;
|
1197
1197
|
if (parentBranch) {
|
1198
1198
|
branch.___parentBranch = parentBranch;
|
@@ -1468,7 +1468,7 @@ function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
|
|
1468
1468
|
scope[closureSignal.___signalIndexAccessor] = closureSignal.___index;
|
1469
1469
|
childSignal(scope);
|
1470
1470
|
subscribeToScopeSet(
|
1471
|
-
getOwnerScope ? getOwnerScope(scope) : scope
|
1471
|
+
getOwnerScope ? getOwnerScope(scope) : scope["_" /* Owner */],
|
1472
1472
|
closureSignal.___scopeInstancesAccessor,
|
1473
1473
|
scope
|
1474
1474
|
);
|
@@ -1479,7 +1479,10 @@ function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
|
|
1479
1479
|
}
|
1480
1480
|
function closure(valueAccessor, fn, getOwnerScope) {
|
1481
1481
|
return (scope) => {
|
1482
|
-
fn(
|
1482
|
+
fn(
|
1483
|
+
scope,
|
1484
|
+
(getOwnerScope ? getOwnerScope(scope) : scope["_" /* Owner */])[valueAccessor]
|
1485
|
+
);
|
1483
1486
|
};
|
1484
1487
|
}
|
1485
1488
|
function setTagVar(scope, childAccessor, tagVarSignal2) {
|
@@ -1547,7 +1550,7 @@ function awaitTag(nodeAccessor, renderer) {
|
|
1547
1550
|
tryWithPlaceholder["#PlaceholderBranch" /* PlaceholderBranch */] = createAndSetupBranch(
|
1548
1551
|
scope.$global,
|
1549
1552
|
tryWithPlaceholder["#PlaceholderContent" /* PlaceholderContent */],
|
1550
|
-
tryWithPlaceholder
|
1553
|
+
tryWithPlaceholder["_" /* Owner */],
|
1551
1554
|
tryWithPlaceholder.___startNode.parentNode
|
1552
1555
|
),
|
1553
1556
|
tryWithPlaceholder.___startNode.parentNode,
|
@@ -1655,21 +1658,22 @@ function renderCatch(scope, error) {
|
|
1655
1658
|
if (!tryWithCatch) {
|
1656
1659
|
throw error;
|
1657
1660
|
} else {
|
1661
|
+
const owner = tryWithCatch["_" /* Owner */];
|
1658
1662
|
const placeholderBranch = tryWithCatch["#PlaceholderBranch" /* PlaceholderBranch */];
|
1659
1663
|
if (placeholderBranch) {
|
1660
1664
|
tryWithCatch.___pendingAsyncCount = 0;
|
1661
|
-
|
1665
|
+
owner["ConditionalScope:" /* ConditionalScope */ + tryWithCatch["#BranchAccessor" /* BranchAccessor */]] = placeholderBranch;
|
1662
1666
|
destroyBranch(tryWithCatch);
|
1663
1667
|
}
|
1664
1668
|
caughtError.add(pendingEffects);
|
1665
1669
|
setConditionalRenderer(
|
1666
|
-
|
1670
|
+
owner,
|
1667
1671
|
tryWithCatch["#BranchAccessor" /* BranchAccessor */],
|
1668
1672
|
tryWithCatch["#CatchContent" /* CatchContent */],
|
1669
1673
|
createAndSetupBranch
|
1670
1674
|
);
|
1671
1675
|
tryWithCatch["#CatchContent" /* CatchContent */].___params?.(
|
1672
|
-
|
1676
|
+
owner["ConditionalScope:" /* ConditionalScope */ + tryWithCatch["#BranchAccessor" /* BranchAccessor */]],
|
1673
1677
|
[error]
|
1674
1678
|
);
|
1675
1679
|
}
|