bobe 0.0.60 → 0.0.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/bobe.cjs.js +160 -35
- package/dist/bobe.cjs.js.map +1 -1
- package/dist/bobe.compiler.cjs.js +160 -35
- package/dist/bobe.compiler.cjs.js.map +1 -1
- package/dist/bobe.compiler.esm.js +162 -37
- package/dist/bobe.compiler.esm.js.map +1 -1
- package/dist/bobe.esm.js +162 -37
- package/dist/bobe.esm.js.map +1 -1
- package/dist/index.d.ts +18 -5
- package/dist/index.umd.js +160 -35
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -3
package/dist/bobe.cjs.js
CHANGED
|
@@ -34,15 +34,15 @@ let FakeType = function (FakeType) {
|
|
|
34
34
|
FakeType[FakeType["ForItem"] = 64] = "ForItem";
|
|
35
35
|
FakeType[FakeType["Context"] = 128] = "Context";
|
|
36
36
|
FakeType[FakeType["DynamicText"] = 256] = "DynamicText";
|
|
37
|
+
FakeType[FakeType["Tp"] = 512] = "Tp";
|
|
37
38
|
return FakeType;
|
|
38
39
|
}({});
|
|
39
40
|
const CondBit = FakeType.If | FakeType.Fail | FakeType.Else;
|
|
40
|
-
const LogicalBit = FakeType.If | FakeType.Fail | FakeType.Else | FakeType.For | FakeType.ForItem;
|
|
41
41
|
const CtxProviderBit = FakeType.If | FakeType.Fail | FakeType.Else | FakeType.For | FakeType.ForItem | FakeType.Component | FakeType.Fragment | FakeType.DynamicText;
|
|
42
|
-
const ContextBit = FakeType.If | FakeType.Fail | FakeType.Else | FakeType.ForItem | FakeType.Context;
|
|
42
|
+
const ContextBit = FakeType.If | FakeType.Fail | FakeType.Else | FakeType.ForItem | FakeType.Context | FakeType.Tp;
|
|
43
43
|
const TokenizerSwitcherBit = FakeType.Component | FakeType.Fragment;
|
|
44
44
|
let NodeSort = function (NodeSort) {
|
|
45
|
-
NodeSort[NodeSort["
|
|
45
|
+
NodeSort[NodeSort["EffectNode"] = 1] = "EffectNode";
|
|
46
46
|
NodeSort[NodeSort["Real"] = 2] = "Real";
|
|
47
47
|
NodeSort[NodeSort["Component"] = 4] = "Component";
|
|
48
48
|
NodeSort[NodeSort["CtxProvider"] = 8] = "CtxProvider";
|
|
@@ -55,6 +55,7 @@ let NodeSort = function (NodeSort) {
|
|
|
55
55
|
TerpEvt["HandledComponentNode"] = "handled-component-node";
|
|
56
56
|
return TerpEvt;
|
|
57
57
|
})({});
|
|
58
|
+
const FakeNode = Symbol('fake-node');
|
|
58
59
|
let ParseErrorCode = function (ParseErrorCode) {
|
|
59
60
|
ParseErrorCode[ParseErrorCode["UNCLOSED_BRACE"] = 9001] = "UNCLOSED_BRACE";
|
|
60
61
|
ParseErrorCode[ParseErrorCode["UNCLOSED_STRING"] = 9002] = "UNCLOSED_STRING";
|
|
@@ -1434,7 +1435,7 @@ const SAFE_HANDLER = {
|
|
|
1434
1435
|
has: () => true,
|
|
1435
1436
|
get: (t, k) => {
|
|
1436
1437
|
if (typeof k === 'symbol') return t[k];
|
|
1437
|
-
return
|
|
1438
|
+
return t[k];
|
|
1438
1439
|
}
|
|
1439
1440
|
};
|
|
1440
1441
|
const safe = data => new Proxy(data, SAFE_HANDLER);
|
|
@@ -1449,9 +1450,6 @@ class Interpreter {
|
|
|
1449
1450
|
constructor(tokenizer) {
|
|
1450
1451
|
this.tokenizer = tokenizer;
|
|
1451
1452
|
}
|
|
1452
|
-
isLogicNode(node) {
|
|
1453
|
-
return node && node.__logicType & LogicalBit;
|
|
1454
|
-
}
|
|
1455
1453
|
rootComponent = null;
|
|
1456
1454
|
program(root, componentNode, before, ctxProvider) {
|
|
1457
1455
|
this.rootComponent = componentNode;
|
|
@@ -1470,7 +1468,7 @@ class Interpreter {
|
|
|
1470
1468
|
stack.push({
|
|
1471
1469
|
node: ctxProvider,
|
|
1472
1470
|
prev: null
|
|
1473
|
-
}, (ctxProvider.__logicType
|
|
1471
|
+
}, (ctxProvider.__logicType && ctxProvider.effect ? NodeSort.EffectNode : 0) | NodeSort.CtxProvider);
|
|
1474
1472
|
}
|
|
1475
1473
|
const rootLen = stack.length;
|
|
1476
1474
|
const ctx = this.ctx = {
|
|
@@ -1493,18 +1491,24 @@ class Interpreter {
|
|
|
1493
1491
|
const token = this.tokenizer.token;
|
|
1494
1492
|
if (token.type & TokenType.Indent) {
|
|
1495
1493
|
this.tokenizer.nextToken();
|
|
1496
|
-
const
|
|
1494
|
+
const isEffectNode = ctx.current && ctx.current.__logicType && ctx.current.effect;
|
|
1497
1495
|
stack.push({
|
|
1498
1496
|
node: ctx.current,
|
|
1499
1497
|
prev: ctx.prevSibling
|
|
1500
|
-
}, !ctx.current.__logicType ? NodeSort.Real : (ctx.current.__logicType &
|
|
1498
|
+
}, !ctx.current.__logicType ? NodeSort.Real : (isEffectNode ? NodeSort.EffectNode : 0) | (ctx.current.__logicType & TokenizerSwitcherBit ? NodeSort.TokenizerSwitcher : 0) | (ctx.current.__logicType & ContextBit ? NodeSort.Context : 0) | (ctx.current.__logicType === FakeType.Component ? NodeSort.Component : 0) | (ctx.current.__logicType === FakeType.Tp ? NodeSort.Real : 0) | (ctx.current.__logicType & CtxProviderBit ? NodeSort.CtxProvider : 0));
|
|
1501
1499
|
if (ctx.current.__logicType) {
|
|
1502
1500
|
this.beforeLogicIndent?.(ctx.current);
|
|
1503
|
-
if (
|
|
1501
|
+
if (isEffectNode) {
|
|
1504
1502
|
aoye.setPulling(ctx.current.effect);
|
|
1505
1503
|
if (ctx.current.__logicType & FakeType.ForItem) {
|
|
1506
1504
|
ctx.prevSibling = ctx.current.realBefore;
|
|
1507
1505
|
}
|
|
1506
|
+
if (ctx.current.__logicType & FakeType.Tp) {
|
|
1507
|
+
aoye.runWithPulling(() => {
|
|
1508
|
+
ctx.realParent = ctx.current.tpData.node;
|
|
1509
|
+
}, null);
|
|
1510
|
+
ctx.prevSibling = ctx.current.contentBefore;
|
|
1511
|
+
}
|
|
1508
1512
|
}
|
|
1509
1513
|
} else {
|
|
1510
1514
|
if (ctx.current) {
|
|
@@ -1538,16 +1542,24 @@ class Interpreter {
|
|
|
1538
1542
|
sort = _stack$pop2[1];
|
|
1539
1543
|
if (!parent.__logicType) {
|
|
1540
1544
|
const prevSameType = stack.peekByType(NodeSort.Real);
|
|
1541
|
-
|
|
1545
|
+
const sameNode = prevSameType?.node;
|
|
1546
|
+
if (sameNode) {
|
|
1547
|
+
ctx.realParent = sameNode.__logicType === FakeType.Tp ? aoye.runWithPulling(() => sameNode.tpData.node, null) : sameNode;
|
|
1548
|
+
} else {
|
|
1549
|
+
ctx.realParent = root;
|
|
1550
|
+
}
|
|
1542
1551
|
} else {
|
|
1543
|
-
if (sort & NodeSort.
|
|
1544
|
-
const parentLogic = stack.peekByType(NodeSort.
|
|
1552
|
+
if (sort & NodeSort.EffectNode) {
|
|
1553
|
+
const parentLogic = stack.peekByType(NodeSort.EffectNode)?.node;
|
|
1545
1554
|
if (parentLogic) {
|
|
1546
1555
|
aoye.setPulling(parentLogic.effect);
|
|
1547
1556
|
} else {
|
|
1548
1557
|
aoye.setPulling(rootPulling);
|
|
1549
1558
|
}
|
|
1550
1559
|
}
|
|
1560
|
+
if (parent.__logicType === FakeType.Tp) {
|
|
1561
|
+
ctx.realParent = parent.realParent;
|
|
1562
|
+
}
|
|
1551
1563
|
if (sort & NodeSort.TokenizerSwitcher) {
|
|
1552
1564
|
const switcher = stack.peekByType(NodeSort.TokenizerSwitcher)?.node;
|
|
1553
1565
|
if (parent.resumeSnapshot) {
|
|
@@ -1584,13 +1596,17 @@ class Interpreter {
|
|
|
1584
1596
|
}
|
|
1585
1597
|
return componentNode;
|
|
1586
1598
|
}
|
|
1587
|
-
insertAnchor(name = 'anchor', isBefore = false) {
|
|
1599
|
+
insertAnchor(node, name = 'anchor', isBefore = false) {
|
|
1588
1600
|
const _this$ctx = this.ctx,
|
|
1589
1601
|
realParent = _this$ctx.realParent,
|
|
1590
1602
|
prevSibling = _this$ctx.prevSibling,
|
|
1591
1603
|
stack = _this$ctx.stack,
|
|
1592
1604
|
before = _this$ctx.before;
|
|
1605
|
+
_this$ctx.current;
|
|
1593
1606
|
const afterAnchor = this.createAnchor(name, isBefore);
|
|
1607
|
+
if (!isBefore) {
|
|
1608
|
+
this.anchorRefBack(afterAnchor, node);
|
|
1609
|
+
}
|
|
1594
1610
|
this.ctx.prevSibling = stack.length === 2 && !prevSibling ? before : prevSibling;
|
|
1595
1611
|
this.handleInsert(realParent, afterAnchor, prevSibling);
|
|
1596
1612
|
return afterAnchor;
|
|
@@ -1635,6 +1651,8 @@ class Interpreter {
|
|
|
1635
1651
|
return this.condDeclaration(ctx);
|
|
1636
1652
|
} else if (value === 'context') {
|
|
1637
1653
|
_node = this.createContextNode();
|
|
1654
|
+
} else if (value === 'tp') {
|
|
1655
|
+
return this.createTpNode();
|
|
1638
1656
|
} else if (value === 'for') {
|
|
1639
1657
|
return this.forDeclaration();
|
|
1640
1658
|
} else if (hookType) {
|
|
@@ -1666,7 +1684,7 @@ class Interpreter {
|
|
|
1666
1684
|
return _node;
|
|
1667
1685
|
}
|
|
1668
1686
|
dynamicDeclaration(pData, value, ctx) {
|
|
1669
|
-
const valueIsMapKey =
|
|
1687
|
+
const valueIsMapKey = Boolean(aoye.getProxyHasKey(pData, value));
|
|
1670
1688
|
let node = {
|
|
1671
1689
|
__logicType: null,
|
|
1672
1690
|
realParent: null,
|
|
@@ -1678,7 +1696,7 @@ class Interpreter {
|
|
|
1678
1696
|
parentDataProvider: ctx.stack.peekByType(NodeSort.CtxProvider)?.node
|
|
1679
1697
|
};
|
|
1680
1698
|
let isUpdate = false;
|
|
1681
|
-
node.realAfter = this.insertAnchor(`dynamic-after`);
|
|
1699
|
+
node.realAfter = this.insertAnchor(node, `dynamic-after`);
|
|
1682
1700
|
node.effect = this.effect(({
|
|
1683
1701
|
old,
|
|
1684
1702
|
val
|
|
@@ -1750,10 +1768,110 @@ class Interpreter {
|
|
|
1750
1768
|
this.removeLogicNode(node);
|
|
1751
1769
|
}
|
|
1752
1770
|
};
|
|
1753
|
-
}, [() => {
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1771
|
+
}, [valueIsMapKey ? () => pData[value] : this.getFn(pData, value)], {
|
|
1772
|
+
type: 'render'
|
|
1773
|
+
});
|
|
1774
|
+
return node;
|
|
1775
|
+
}
|
|
1776
|
+
createTpNode() {
|
|
1777
|
+
const child = aoye.deepSignal({}, aoye.getPulling());
|
|
1778
|
+
const node = {
|
|
1779
|
+
__logicType: FakeType.Tp,
|
|
1780
|
+
data: this.getData(),
|
|
1781
|
+
realParent: null,
|
|
1782
|
+
realBefore: null,
|
|
1783
|
+
realAfter: null,
|
|
1784
|
+
contentBefore: null,
|
|
1785
|
+
contentAfter: null,
|
|
1786
|
+
effect: null,
|
|
1787
|
+
snapshot: null,
|
|
1788
|
+
tpData: child,
|
|
1789
|
+
owner: this.ctx.stack.peekByType(NodeSort.TokenizerSwitcher)?.node
|
|
1790
|
+
};
|
|
1791
|
+
this.onePropParsed = createStoreOnePropParsed(child);
|
|
1792
|
+
this.tokenizer.nextToken();
|
|
1793
|
+
this.headerLineAndExtensions(node);
|
|
1794
|
+
this.onePropParsed = this.oneRealPropParsed;
|
|
1795
|
+
node.realAfter = this.insertAnchor(node, 'tp-after');
|
|
1796
|
+
const before = node.contentBefore = this.createAnchor('tp-content-before', true);
|
|
1797
|
+
const after = node.contentAfter = this.createAnchor('tp-content-after', true);
|
|
1798
|
+
let firstRender = true;
|
|
1799
|
+
let scope = new aoye.Scope(() => {});
|
|
1800
|
+
scope.scope = null;
|
|
1801
|
+
aoye.runWithPulling(() => {
|
|
1802
|
+
scope.get();
|
|
1803
|
+
}, null);
|
|
1804
|
+
node.effect = scope;
|
|
1805
|
+
this.effect(({
|
|
1806
|
+
old: oldDom,
|
|
1807
|
+
val: dom
|
|
1808
|
+
}) => {
|
|
1809
|
+
const removeTpChild = () => {
|
|
1810
|
+
if (oldDom) {
|
|
1811
|
+
let point = before;
|
|
1812
|
+
do {
|
|
1813
|
+
const next = this.nextSib(point);
|
|
1814
|
+
this.remove(point, oldDom, null);
|
|
1815
|
+
if (point === after) break;
|
|
1816
|
+
point = next;
|
|
1817
|
+
} while (true);
|
|
1818
|
+
}
|
|
1819
|
+
};
|
|
1820
|
+
if (firstRender) {
|
|
1821
|
+
if (dom) {
|
|
1822
|
+
this.handleInsert(dom, after, null);
|
|
1823
|
+
this.handleInsert(dom, before, null);
|
|
1824
|
+
} else {
|
|
1825
|
+
if (this.tokenizer.token.type === TokenType.Indent) {
|
|
1826
|
+
const dentLen = this.tokenizer.dentStack[this.tokenizer.dentStack.length - 2] ?? 0;
|
|
1827
|
+
this.tokenizer.skip(dentLen);
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
} else {
|
|
1831
|
+
if (dom) {
|
|
1832
|
+
if (oldDom) {
|
|
1833
|
+
let point = before,
|
|
1834
|
+
lastInsert = null;
|
|
1835
|
+
do {
|
|
1836
|
+
const next = this.nextSib(point);
|
|
1837
|
+
const fakeNode = point[FakeNode];
|
|
1838
|
+
if (fakeNode) {
|
|
1839
|
+
fakeNode.realParent = dom;
|
|
1840
|
+
}
|
|
1841
|
+
this.handleInsert(dom, point, lastInsert);
|
|
1842
|
+
if (point === after) break;
|
|
1843
|
+
lastInsert = point;
|
|
1844
|
+
point = next;
|
|
1845
|
+
} while (true);
|
|
1846
|
+
} else {
|
|
1847
|
+
this.handleInsert(dom, after, null);
|
|
1848
|
+
this.handleInsert(dom, before, null);
|
|
1849
|
+
aoye.runWithPulling(() => {
|
|
1850
|
+
this.tokenizer = node.owner.tokenizer;
|
|
1851
|
+
this.tokenizer.resume(node.snapshot);
|
|
1852
|
+
this.tokenizer.useDedentAsEof = false;
|
|
1853
|
+
this.program(dom, node.owner, before, node);
|
|
1854
|
+
}, scope);
|
|
1855
|
+
}
|
|
1856
|
+
} else {
|
|
1857
|
+
removeTpChild();
|
|
1858
|
+
scope.dispose();
|
|
1859
|
+
scope = new aoye.Scope(() => {});
|
|
1860
|
+
scope.scope = null;
|
|
1861
|
+
aoye.runWithPulling(() => {
|
|
1862
|
+
scope.get();
|
|
1863
|
+
}, null);
|
|
1864
|
+
node.effect = scope;
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
firstRender = false;
|
|
1868
|
+
return isDestroy => {
|
|
1869
|
+
if (isDestroy) {
|
|
1870
|
+
removeTpChild();
|
|
1871
|
+
scope.dispose();
|
|
1872
|
+
}
|
|
1873
|
+
};
|
|
1874
|
+
}, [() => child.node], {
|
|
1757
1875
|
type: 'render'
|
|
1758
1876
|
});
|
|
1759
1877
|
return node;
|
|
@@ -1762,7 +1880,7 @@ class Interpreter {
|
|
|
1762
1880
|
const child = aoye.deepSignal({}, aoye.getPulling());
|
|
1763
1881
|
const parentContext = this.ctx.stack.peekByType(NodeSort.Context)?.node?.context;
|
|
1764
1882
|
if (parentContext) {
|
|
1765
|
-
|
|
1883
|
+
aoye.backupSignal(child, parentContext);
|
|
1766
1884
|
}
|
|
1767
1885
|
this.onePropParsed = createStoreOnePropParsed(child);
|
|
1768
1886
|
const node = {
|
|
@@ -1772,7 +1890,7 @@ class Interpreter {
|
|
|
1772
1890
|
realBefore: null,
|
|
1773
1891
|
realAfter: null
|
|
1774
1892
|
};
|
|
1775
|
-
node.realAfter = this.insertAnchor('context-after');
|
|
1893
|
+
node.realAfter = this.insertAnchor(node, 'context-after');
|
|
1776
1894
|
return node;
|
|
1777
1895
|
}
|
|
1778
1896
|
formatForCollection(collection) {
|
|
@@ -1865,13 +1983,12 @@ class Interpreter {
|
|
|
1865
1983
|
const rawGetKey = new Function('data', `with(data){return (${keyExp})}`);
|
|
1866
1984
|
forNode.getKey = data => rawGetKey(safe(data));
|
|
1867
1985
|
}
|
|
1868
|
-
window['for1'] = forNode;
|
|
1869
1986
|
const data = this.getData();
|
|
1870
1987
|
const cells = data[aoye.Keys.Meta].cells;
|
|
1871
1988
|
const hasArrExpKey = Reflect.has(data[aoye.Keys.Raw], arrExp);
|
|
1872
1989
|
const arrSignal = hasArrExpKey ? (data[arrExp], cells.get(arrExp)) : new aoye.Computed(this.getFn(data, arrExp));
|
|
1873
1990
|
forNode.arrSignal = arrSignal;
|
|
1874
|
-
forNode.realAfter = this.insertAnchor('for-after');
|
|
1991
|
+
forNode.realAfter = this.insertAnchor(forNode, 'for-after');
|
|
1875
1992
|
const _forNode$snapshot = forNode.snapshot;
|
|
1876
1993
|
_forNode$snapshot.dentStack;
|
|
1877
1994
|
_forNode$snapshot.isFirstToken;
|
|
@@ -1894,8 +2011,8 @@ class Interpreter {
|
|
|
1894
2011
|
const len = arr.length;
|
|
1895
2012
|
for (let i = len; i--;) {
|
|
1896
2013
|
const item = this.createForItem(forNode, i, data);
|
|
1897
|
-
item.realAfter = this.insertAnchor('for-item-after');
|
|
1898
|
-
item.realBefore = this.insertAnchor('for-item-before', true);
|
|
2014
|
+
item.realAfter = this.insertAnchor(item, 'for-item-after');
|
|
2015
|
+
item.realBefore = this.insertAnchor(item, 'for-item-before', true);
|
|
1899
2016
|
item.realParent = forNode.realParent;
|
|
1900
2017
|
children[i] = item;
|
|
1901
2018
|
}
|
|
@@ -2057,10 +2174,14 @@ class Interpreter {
|
|
|
2057
2174
|
}, aoye.ScheduleType.Render);
|
|
2058
2175
|
return forNode.children[0] || forNode;
|
|
2059
2176
|
}
|
|
2177
|
+
anchorRefBack(anchor, node) {
|
|
2178
|
+
anchor[FakeNode] = node;
|
|
2179
|
+
}
|
|
2060
2180
|
insertForItem(forNode, i, parentData, newChildren, before, snapshotForUpdate) {
|
|
2061
2181
|
const item = this.createForItem(forNode, i, parentData);
|
|
2062
2182
|
newChildren[i] = item;
|
|
2063
2183
|
let realAfter = this.createAnchor('for-item-after');
|
|
2184
|
+
this.anchorRefBack(realAfter, item);
|
|
2064
2185
|
this.handleInsert(forNode.realParent, realAfter, before);
|
|
2065
2186
|
let realBefore = this.createAnchor('for-item-before', true);
|
|
2066
2187
|
this.handleInsert(forNode.realParent, realBefore, before);
|
|
@@ -2147,7 +2268,7 @@ class Interpreter {
|
|
|
2147
2268
|
cells.set(name, new aoye.Computed(() => computedData.get()[name]));
|
|
2148
2269
|
}
|
|
2149
2270
|
}
|
|
2150
|
-
|
|
2271
|
+
aoye.backupSignal(data, parentData);
|
|
2151
2272
|
return data;
|
|
2152
2273
|
}
|
|
2153
2274
|
getData() {
|
|
@@ -2188,7 +2309,7 @@ class Interpreter {
|
|
|
2188
2309
|
} else if (ComponentOrRender instanceof InlineFragment) {
|
|
2189
2310
|
const conf = ComponentOrRender;
|
|
2190
2311
|
child = aoye.deepSignal({}, aoye.getPulling(), true);
|
|
2191
|
-
|
|
2312
|
+
aoye.backupSignal(child, conf.data);
|
|
2192
2313
|
tokenizer = conf.tokenizer;
|
|
2193
2314
|
fragmentSnapshot = conf.snapshot;
|
|
2194
2315
|
__logicType = FakeType.Fragment;
|
|
@@ -2198,7 +2319,7 @@ class Interpreter {
|
|
|
2198
2319
|
const boundStore = render.boundStore;
|
|
2199
2320
|
child = aoye.deepSignal({}, aoye.getPulling(), true);
|
|
2200
2321
|
if (boundStore) {
|
|
2201
|
-
|
|
2322
|
+
aoye.backupSignal(child, boundStore);
|
|
2202
2323
|
}
|
|
2203
2324
|
tokenizer = render(true);
|
|
2204
2325
|
__logicType = FakeType.Fragment;
|
|
@@ -2231,7 +2352,7 @@ class Interpreter {
|
|
|
2231
2352
|
resumeSnapshot
|
|
2232
2353
|
};
|
|
2233
2354
|
this.onePropParsed = onePropParsed;
|
|
2234
|
-
node.realAfter = this.insertAnchor('component-after');
|
|
2355
|
+
node.realAfter = this.insertAnchor(node, 'component-after');
|
|
2235
2356
|
return node;
|
|
2236
2357
|
}
|
|
2237
2358
|
getFn(data, expression) {
|
|
@@ -2326,7 +2447,7 @@ class Interpreter {
|
|
|
2326
2447
|
break;
|
|
2327
2448
|
}
|
|
2328
2449
|
ifNode.condition = signal;
|
|
2329
|
-
ifNode.realAfter = this.insertAnchor(`${keyWord.value}-after`);
|
|
2450
|
+
ifNode.realAfter = this.insertAnchor(ifNode, `${keyWord.value}-after`);
|
|
2330
2451
|
const ef = this.effect(({
|
|
2331
2452
|
val
|
|
2332
2453
|
}) => {
|
|
@@ -2369,10 +2490,11 @@ class Interpreter {
|
|
|
2369
2490
|
const tokenizer = this.tokenizer;
|
|
2370
2491
|
do {
|
|
2371
2492
|
const isComponent = _node.__logicType & TokenizerSwitcherBit;
|
|
2493
|
+
const isTp = _node.__logicType === FakeType.Tp;
|
|
2372
2494
|
let snapshot, dentLen;
|
|
2373
2495
|
const data = this.getData();
|
|
2374
2496
|
const unHandledKey = this.attributeList(_node, data);
|
|
2375
|
-
if (isComponent) {
|
|
2497
|
+
if (isComponent || isTp) {
|
|
2376
2498
|
snapshot = tokenizer.snapshot(undefined, -1);
|
|
2377
2499
|
dentLen = tokenizer.dentStack[tokenizer.dentStack.length - 1];
|
|
2378
2500
|
}
|
|
@@ -2384,6 +2506,9 @@ class Interpreter {
|
|
|
2384
2506
|
if ((tokenizer.token.type & TokenType.Pipe) === 0) {
|
|
2385
2507
|
break;
|
|
2386
2508
|
}
|
|
2509
|
+
} else if (isTp) {
|
|
2510
|
+
_node.snapshot = snapshot;
|
|
2511
|
+
break;
|
|
2387
2512
|
} else {
|
|
2388
2513
|
break;
|
|
2389
2514
|
}
|
|
@@ -2442,7 +2567,7 @@ class Interpreter {
|
|
|
2442
2567
|
prevKeys.delete(k);
|
|
2443
2568
|
if (isComponent) {
|
|
2444
2569
|
const savedK = savedDefaults.has(k);
|
|
2445
|
-
if (!savedK &&
|
|
2570
|
+
if (!savedK && bobeShared.hasOwn(rawTarget, k)) {
|
|
2446
2571
|
savedDefaults.set(k, rawTarget[k]);
|
|
2447
2572
|
}
|
|
2448
2573
|
const val = props[k];
|
|
@@ -2475,7 +2600,7 @@ class Interpreter {
|
|
|
2475
2600
|
}).get();
|
|
2476
2601
|
}
|
|
2477
2602
|
} else if (hookType === 'dynamic') {
|
|
2478
|
-
const valueIsMapKey =
|
|
2603
|
+
const valueIsMapKey = Boolean(aoye.getProxyHasKey(data, value));
|
|
2479
2604
|
const fn = isFn ? rawVal : valueIsMapKey ? value : this.getFn(data, value);
|
|
2480
2605
|
this.onePropParsed(data, _node, key, fn, valueIsMapKey, isFn, hookI);
|
|
2481
2606
|
} else if (hookType === 'static') {
|