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
|
@@ -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";
|
|
@@ -1461,7 +1462,7 @@ const SAFE_HANDLER = {
|
|
|
1461
1462
|
has: () => true,
|
|
1462
1463
|
get: (t, k) => {
|
|
1463
1464
|
if (typeof k === 'symbol') return t[k];
|
|
1464
|
-
return
|
|
1465
|
+
return t[k];
|
|
1465
1466
|
}
|
|
1466
1467
|
};
|
|
1467
1468
|
const safe = data => new Proxy(data, SAFE_HANDLER);
|
|
@@ -1476,9 +1477,6 @@ class Interpreter {
|
|
|
1476
1477
|
constructor(tokenizer) {
|
|
1477
1478
|
this.tokenizer = tokenizer;
|
|
1478
1479
|
}
|
|
1479
|
-
isLogicNode(node) {
|
|
1480
|
-
return node && node.__logicType & LogicalBit;
|
|
1481
|
-
}
|
|
1482
1480
|
rootComponent = null;
|
|
1483
1481
|
program(root, componentNode, before, ctxProvider) {
|
|
1484
1482
|
this.rootComponent = componentNode;
|
|
@@ -1497,7 +1495,7 @@ class Interpreter {
|
|
|
1497
1495
|
stack.push({
|
|
1498
1496
|
node: ctxProvider,
|
|
1499
1497
|
prev: null
|
|
1500
|
-
}, (ctxProvider.__logicType
|
|
1498
|
+
}, (ctxProvider.__logicType && ctxProvider.effect ? NodeSort.EffectNode : 0) | NodeSort.CtxProvider);
|
|
1501
1499
|
}
|
|
1502
1500
|
const rootLen = stack.length;
|
|
1503
1501
|
const ctx = this.ctx = {
|
|
@@ -1520,18 +1518,24 @@ class Interpreter {
|
|
|
1520
1518
|
const token = this.tokenizer.token;
|
|
1521
1519
|
if (token.type & TokenType.Indent) {
|
|
1522
1520
|
this.tokenizer.nextToken();
|
|
1523
|
-
const
|
|
1521
|
+
const isEffectNode = ctx.current && ctx.current.__logicType && ctx.current.effect;
|
|
1524
1522
|
stack.push({
|
|
1525
1523
|
node: ctx.current,
|
|
1526
1524
|
prev: ctx.prevSibling
|
|
1527
|
-
}, !ctx.current.__logicType ? NodeSort.Real : (ctx.current.__logicType &
|
|
1525
|
+
}, !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));
|
|
1528
1526
|
if (ctx.current.__logicType) {
|
|
1529
1527
|
this.beforeLogicIndent?.(ctx.current);
|
|
1530
|
-
if (
|
|
1528
|
+
if (isEffectNode) {
|
|
1531
1529
|
aoye.setPulling(ctx.current.effect);
|
|
1532
1530
|
if (ctx.current.__logicType & FakeType.ForItem) {
|
|
1533
1531
|
ctx.prevSibling = ctx.current.realBefore;
|
|
1534
1532
|
}
|
|
1533
|
+
if (ctx.current.__logicType & FakeType.Tp) {
|
|
1534
|
+
aoye.runWithPulling(() => {
|
|
1535
|
+
ctx.realParent = ctx.current.tpData.node;
|
|
1536
|
+
}, null);
|
|
1537
|
+
ctx.prevSibling = ctx.current.contentBefore;
|
|
1538
|
+
}
|
|
1535
1539
|
}
|
|
1536
1540
|
} else {
|
|
1537
1541
|
if (ctx.current) {
|
|
@@ -1565,16 +1569,24 @@ class Interpreter {
|
|
|
1565
1569
|
sort = _stack$pop2[1];
|
|
1566
1570
|
if (!parent.__logicType) {
|
|
1567
1571
|
const prevSameType = stack.peekByType(NodeSort.Real);
|
|
1568
|
-
|
|
1572
|
+
const sameNode = prevSameType?.node;
|
|
1573
|
+
if (sameNode) {
|
|
1574
|
+
ctx.realParent = sameNode.__logicType === FakeType.Tp ? aoye.runWithPulling(() => sameNode.tpData.node, null) : sameNode;
|
|
1575
|
+
} else {
|
|
1576
|
+
ctx.realParent = root;
|
|
1577
|
+
}
|
|
1569
1578
|
} else {
|
|
1570
|
-
if (sort & NodeSort.
|
|
1571
|
-
const parentLogic = stack.peekByType(NodeSort.
|
|
1579
|
+
if (sort & NodeSort.EffectNode) {
|
|
1580
|
+
const parentLogic = stack.peekByType(NodeSort.EffectNode)?.node;
|
|
1572
1581
|
if (parentLogic) {
|
|
1573
1582
|
aoye.setPulling(parentLogic.effect);
|
|
1574
1583
|
} else {
|
|
1575
1584
|
aoye.setPulling(rootPulling);
|
|
1576
1585
|
}
|
|
1577
1586
|
}
|
|
1587
|
+
if (parent.__logicType === FakeType.Tp) {
|
|
1588
|
+
ctx.realParent = parent.realParent;
|
|
1589
|
+
}
|
|
1578
1590
|
if (sort & NodeSort.TokenizerSwitcher) {
|
|
1579
1591
|
const switcher = stack.peekByType(NodeSort.TokenizerSwitcher)?.node;
|
|
1580
1592
|
if (parent.resumeSnapshot) {
|
|
@@ -1611,13 +1623,17 @@ class Interpreter {
|
|
|
1611
1623
|
}
|
|
1612
1624
|
return componentNode;
|
|
1613
1625
|
}
|
|
1614
|
-
insertAnchor(name = 'anchor', isBefore = false) {
|
|
1626
|
+
insertAnchor(node, name = 'anchor', isBefore = false) {
|
|
1615
1627
|
const _this$ctx = this.ctx,
|
|
1616
1628
|
realParent = _this$ctx.realParent,
|
|
1617
1629
|
prevSibling = _this$ctx.prevSibling,
|
|
1618
1630
|
stack = _this$ctx.stack,
|
|
1619
1631
|
before = _this$ctx.before;
|
|
1632
|
+
_this$ctx.current;
|
|
1620
1633
|
const afterAnchor = this.createAnchor(name, isBefore);
|
|
1634
|
+
if (!isBefore) {
|
|
1635
|
+
this.anchorRefBack(afterAnchor, node);
|
|
1636
|
+
}
|
|
1621
1637
|
this.ctx.prevSibling = stack.length === 2 && !prevSibling ? before : prevSibling;
|
|
1622
1638
|
this.handleInsert(realParent, afterAnchor, prevSibling);
|
|
1623
1639
|
return afterAnchor;
|
|
@@ -1662,6 +1678,8 @@ class Interpreter {
|
|
|
1662
1678
|
return this.condDeclaration(ctx);
|
|
1663
1679
|
} else if (value === 'context') {
|
|
1664
1680
|
_node = this.createContextNode();
|
|
1681
|
+
} else if (value === 'tp') {
|
|
1682
|
+
return this.createTpNode();
|
|
1665
1683
|
} else if (value === 'for') {
|
|
1666
1684
|
return this.forDeclaration();
|
|
1667
1685
|
} else if (hookType) {
|
|
@@ -1693,7 +1711,7 @@ class Interpreter {
|
|
|
1693
1711
|
return _node;
|
|
1694
1712
|
}
|
|
1695
1713
|
dynamicDeclaration(pData, value, ctx) {
|
|
1696
|
-
const valueIsMapKey =
|
|
1714
|
+
const valueIsMapKey = Boolean(aoye.getProxyHasKey(pData, value));
|
|
1697
1715
|
let node = {
|
|
1698
1716
|
__logicType: null,
|
|
1699
1717
|
realParent: null,
|
|
@@ -1705,7 +1723,7 @@ class Interpreter {
|
|
|
1705
1723
|
parentDataProvider: ctx.stack.peekByType(NodeSort.CtxProvider)?.node
|
|
1706
1724
|
};
|
|
1707
1725
|
let isUpdate = false;
|
|
1708
|
-
node.realAfter = this.insertAnchor(`dynamic-after`);
|
|
1726
|
+
node.realAfter = this.insertAnchor(node, `dynamic-after`);
|
|
1709
1727
|
node.effect = this.effect(({
|
|
1710
1728
|
old,
|
|
1711
1729
|
val
|
|
@@ -1777,10 +1795,110 @@ class Interpreter {
|
|
|
1777
1795
|
this.removeLogicNode(node);
|
|
1778
1796
|
}
|
|
1779
1797
|
};
|
|
1780
|
-
}, [() => {
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1798
|
+
}, [valueIsMapKey ? () => pData[value] : this.getFn(pData, value)], {
|
|
1799
|
+
type: 'render'
|
|
1800
|
+
});
|
|
1801
|
+
return node;
|
|
1802
|
+
}
|
|
1803
|
+
createTpNode() {
|
|
1804
|
+
const child = aoye.deepSignal({}, aoye.getPulling());
|
|
1805
|
+
const node = {
|
|
1806
|
+
__logicType: FakeType.Tp,
|
|
1807
|
+
data: this.getData(),
|
|
1808
|
+
realParent: null,
|
|
1809
|
+
realBefore: null,
|
|
1810
|
+
realAfter: null,
|
|
1811
|
+
contentBefore: null,
|
|
1812
|
+
contentAfter: null,
|
|
1813
|
+
effect: null,
|
|
1814
|
+
snapshot: null,
|
|
1815
|
+
tpData: child,
|
|
1816
|
+
owner: this.ctx.stack.peekByType(NodeSort.TokenizerSwitcher)?.node
|
|
1817
|
+
};
|
|
1818
|
+
this.onePropParsed = createStoreOnePropParsed(child);
|
|
1819
|
+
this.tokenizer.nextToken();
|
|
1820
|
+
this.headerLineAndExtensions(node);
|
|
1821
|
+
this.onePropParsed = this.oneRealPropParsed;
|
|
1822
|
+
node.realAfter = this.insertAnchor(node, 'tp-after');
|
|
1823
|
+
const before = node.contentBefore = this.createAnchor('tp-content-before', true);
|
|
1824
|
+
const after = node.contentAfter = this.createAnchor('tp-content-after', true);
|
|
1825
|
+
let firstRender = true;
|
|
1826
|
+
let scope = new aoye.Scope(() => {});
|
|
1827
|
+
scope.scope = null;
|
|
1828
|
+
aoye.runWithPulling(() => {
|
|
1829
|
+
scope.get();
|
|
1830
|
+
}, null);
|
|
1831
|
+
node.effect = scope;
|
|
1832
|
+
this.effect(({
|
|
1833
|
+
old: oldDom,
|
|
1834
|
+
val: dom
|
|
1835
|
+
}) => {
|
|
1836
|
+
const removeTpChild = () => {
|
|
1837
|
+
if (oldDom) {
|
|
1838
|
+
let point = before;
|
|
1839
|
+
do {
|
|
1840
|
+
const next = this.nextSib(point);
|
|
1841
|
+
this.remove(point, oldDom, null);
|
|
1842
|
+
if (point === after) break;
|
|
1843
|
+
point = next;
|
|
1844
|
+
} while (true);
|
|
1845
|
+
}
|
|
1846
|
+
};
|
|
1847
|
+
if (firstRender) {
|
|
1848
|
+
if (dom) {
|
|
1849
|
+
this.handleInsert(dom, after, null);
|
|
1850
|
+
this.handleInsert(dom, before, null);
|
|
1851
|
+
} else {
|
|
1852
|
+
if (this.tokenizer.token.type === TokenType.Indent) {
|
|
1853
|
+
const dentLen = this.tokenizer.dentStack[this.tokenizer.dentStack.length - 2] ?? 0;
|
|
1854
|
+
this.tokenizer.skip(dentLen);
|
|
1855
|
+
}
|
|
1856
|
+
}
|
|
1857
|
+
} else {
|
|
1858
|
+
if (dom) {
|
|
1859
|
+
if (oldDom) {
|
|
1860
|
+
let point = before,
|
|
1861
|
+
lastInsert = null;
|
|
1862
|
+
do {
|
|
1863
|
+
const next = this.nextSib(point);
|
|
1864
|
+
const fakeNode = point[FakeNode];
|
|
1865
|
+
if (fakeNode) {
|
|
1866
|
+
fakeNode.realParent = dom;
|
|
1867
|
+
}
|
|
1868
|
+
this.handleInsert(dom, point, lastInsert);
|
|
1869
|
+
if (point === after) break;
|
|
1870
|
+
lastInsert = point;
|
|
1871
|
+
point = next;
|
|
1872
|
+
} while (true);
|
|
1873
|
+
} else {
|
|
1874
|
+
this.handleInsert(dom, after, null);
|
|
1875
|
+
this.handleInsert(dom, before, null);
|
|
1876
|
+
aoye.runWithPulling(() => {
|
|
1877
|
+
this.tokenizer = node.owner.tokenizer;
|
|
1878
|
+
this.tokenizer.resume(node.snapshot);
|
|
1879
|
+
this.tokenizer.useDedentAsEof = false;
|
|
1880
|
+
this.program(dom, node.owner, before, node);
|
|
1881
|
+
}, scope);
|
|
1882
|
+
}
|
|
1883
|
+
} else {
|
|
1884
|
+
removeTpChild();
|
|
1885
|
+
scope.dispose();
|
|
1886
|
+
scope = new aoye.Scope(() => {});
|
|
1887
|
+
scope.scope = null;
|
|
1888
|
+
aoye.runWithPulling(() => {
|
|
1889
|
+
scope.get();
|
|
1890
|
+
}, null);
|
|
1891
|
+
node.effect = scope;
|
|
1892
|
+
}
|
|
1893
|
+
}
|
|
1894
|
+
firstRender = false;
|
|
1895
|
+
return isDestroy => {
|
|
1896
|
+
if (isDestroy) {
|
|
1897
|
+
removeTpChild();
|
|
1898
|
+
scope.dispose();
|
|
1899
|
+
}
|
|
1900
|
+
};
|
|
1901
|
+
}, [() => child.node], {
|
|
1784
1902
|
type: 'render'
|
|
1785
1903
|
});
|
|
1786
1904
|
return node;
|
|
@@ -1789,7 +1907,7 @@ class Interpreter {
|
|
|
1789
1907
|
const child = aoye.deepSignal({}, aoye.getPulling());
|
|
1790
1908
|
const parentContext = this.ctx.stack.peekByType(NodeSort.Context)?.node?.context;
|
|
1791
1909
|
if (parentContext) {
|
|
1792
|
-
|
|
1910
|
+
aoye.backupSignal(child, parentContext);
|
|
1793
1911
|
}
|
|
1794
1912
|
this.onePropParsed = createStoreOnePropParsed(child);
|
|
1795
1913
|
const node = {
|
|
@@ -1799,7 +1917,7 @@ class Interpreter {
|
|
|
1799
1917
|
realBefore: null,
|
|
1800
1918
|
realAfter: null
|
|
1801
1919
|
};
|
|
1802
|
-
node.realAfter = this.insertAnchor('context-after');
|
|
1920
|
+
node.realAfter = this.insertAnchor(node, 'context-after');
|
|
1803
1921
|
return node;
|
|
1804
1922
|
}
|
|
1805
1923
|
formatForCollection(collection) {
|
|
@@ -1892,13 +2010,12 @@ class Interpreter {
|
|
|
1892
2010
|
const rawGetKey = new Function('data', `with(data){return (${keyExp})}`);
|
|
1893
2011
|
forNode.getKey = data => rawGetKey(safe(data));
|
|
1894
2012
|
}
|
|
1895
|
-
window['for1'] = forNode;
|
|
1896
2013
|
const data = this.getData();
|
|
1897
2014
|
const cells = data[aoye.Keys.Meta].cells;
|
|
1898
2015
|
const hasArrExpKey = Reflect.has(data[aoye.Keys.Raw], arrExp);
|
|
1899
2016
|
const arrSignal = hasArrExpKey ? (data[arrExp], cells.get(arrExp)) : new aoye.Computed(this.getFn(data, arrExp));
|
|
1900
2017
|
forNode.arrSignal = arrSignal;
|
|
1901
|
-
forNode.realAfter = this.insertAnchor('for-after');
|
|
2018
|
+
forNode.realAfter = this.insertAnchor(forNode, 'for-after');
|
|
1902
2019
|
const _forNode$snapshot = forNode.snapshot;
|
|
1903
2020
|
_forNode$snapshot.dentStack;
|
|
1904
2021
|
_forNode$snapshot.isFirstToken;
|
|
@@ -1921,8 +2038,8 @@ class Interpreter {
|
|
|
1921
2038
|
const len = arr.length;
|
|
1922
2039
|
for (let i = len; i--;) {
|
|
1923
2040
|
const item = this.createForItem(forNode, i, data);
|
|
1924
|
-
item.realAfter = this.insertAnchor('for-item-after');
|
|
1925
|
-
item.realBefore = this.insertAnchor('for-item-before', true);
|
|
2041
|
+
item.realAfter = this.insertAnchor(item, 'for-item-after');
|
|
2042
|
+
item.realBefore = this.insertAnchor(item, 'for-item-before', true);
|
|
1926
2043
|
item.realParent = forNode.realParent;
|
|
1927
2044
|
children[i] = item;
|
|
1928
2045
|
}
|
|
@@ -2084,10 +2201,14 @@ class Interpreter {
|
|
|
2084
2201
|
}, aoye.ScheduleType.Render);
|
|
2085
2202
|
return forNode.children[0] || forNode;
|
|
2086
2203
|
}
|
|
2204
|
+
anchorRefBack(anchor, node) {
|
|
2205
|
+
anchor[FakeNode] = node;
|
|
2206
|
+
}
|
|
2087
2207
|
insertForItem(forNode, i, parentData, newChildren, before, snapshotForUpdate) {
|
|
2088
2208
|
const item = this.createForItem(forNode, i, parentData);
|
|
2089
2209
|
newChildren[i] = item;
|
|
2090
2210
|
let realAfter = this.createAnchor('for-item-after');
|
|
2211
|
+
this.anchorRefBack(realAfter, item);
|
|
2091
2212
|
this.handleInsert(forNode.realParent, realAfter, before);
|
|
2092
2213
|
let realBefore = this.createAnchor('for-item-before', true);
|
|
2093
2214
|
this.handleInsert(forNode.realParent, realBefore, before);
|
|
@@ -2174,7 +2295,7 @@ class Interpreter {
|
|
|
2174
2295
|
cells.set(name, new aoye.Computed(() => computedData.get()[name]));
|
|
2175
2296
|
}
|
|
2176
2297
|
}
|
|
2177
|
-
|
|
2298
|
+
aoye.backupSignal(data, parentData);
|
|
2178
2299
|
return data;
|
|
2179
2300
|
}
|
|
2180
2301
|
getData() {
|
|
@@ -2215,7 +2336,7 @@ class Interpreter {
|
|
|
2215
2336
|
} else if (ComponentOrRender instanceof InlineFragment) {
|
|
2216
2337
|
const conf = ComponentOrRender;
|
|
2217
2338
|
child = aoye.deepSignal({}, aoye.getPulling(), true);
|
|
2218
|
-
|
|
2339
|
+
aoye.backupSignal(child, conf.data);
|
|
2219
2340
|
tokenizer = conf.tokenizer;
|
|
2220
2341
|
fragmentSnapshot = conf.snapshot;
|
|
2221
2342
|
__logicType = FakeType.Fragment;
|
|
@@ -2225,7 +2346,7 @@ class Interpreter {
|
|
|
2225
2346
|
const boundStore = render.boundStore;
|
|
2226
2347
|
child = aoye.deepSignal({}, aoye.getPulling(), true);
|
|
2227
2348
|
if (boundStore) {
|
|
2228
|
-
|
|
2349
|
+
aoye.backupSignal(child, boundStore);
|
|
2229
2350
|
}
|
|
2230
2351
|
tokenizer = render(true);
|
|
2231
2352
|
__logicType = FakeType.Fragment;
|
|
@@ -2258,7 +2379,7 @@ class Interpreter {
|
|
|
2258
2379
|
resumeSnapshot
|
|
2259
2380
|
};
|
|
2260
2381
|
this.onePropParsed = onePropParsed;
|
|
2261
|
-
node.realAfter = this.insertAnchor('component-after');
|
|
2382
|
+
node.realAfter = this.insertAnchor(node, 'component-after');
|
|
2262
2383
|
return node;
|
|
2263
2384
|
}
|
|
2264
2385
|
getFn(data, expression) {
|
|
@@ -2353,7 +2474,7 @@ class Interpreter {
|
|
|
2353
2474
|
break;
|
|
2354
2475
|
}
|
|
2355
2476
|
ifNode.condition = signal;
|
|
2356
|
-
ifNode.realAfter = this.insertAnchor(`${keyWord.value}-after`);
|
|
2477
|
+
ifNode.realAfter = this.insertAnchor(ifNode, `${keyWord.value}-after`);
|
|
2357
2478
|
const ef = this.effect(({
|
|
2358
2479
|
val
|
|
2359
2480
|
}) => {
|
|
@@ -2396,10 +2517,11 @@ class Interpreter {
|
|
|
2396
2517
|
const tokenizer = this.tokenizer;
|
|
2397
2518
|
do {
|
|
2398
2519
|
const isComponent = _node.__logicType & TokenizerSwitcherBit;
|
|
2520
|
+
const isTp = _node.__logicType === FakeType.Tp;
|
|
2399
2521
|
let snapshot, dentLen;
|
|
2400
2522
|
const data = this.getData();
|
|
2401
2523
|
const unHandledKey = this.attributeList(_node, data);
|
|
2402
|
-
if (isComponent) {
|
|
2524
|
+
if (isComponent || isTp) {
|
|
2403
2525
|
snapshot = tokenizer.snapshot(undefined, -1);
|
|
2404
2526
|
dentLen = tokenizer.dentStack[tokenizer.dentStack.length - 1];
|
|
2405
2527
|
}
|
|
@@ -2411,6 +2533,9 @@ class Interpreter {
|
|
|
2411
2533
|
if ((tokenizer.token.type & TokenType.Pipe) === 0) {
|
|
2412
2534
|
break;
|
|
2413
2535
|
}
|
|
2536
|
+
} else if (isTp) {
|
|
2537
|
+
_node.snapshot = snapshot;
|
|
2538
|
+
break;
|
|
2414
2539
|
} else {
|
|
2415
2540
|
break;
|
|
2416
2541
|
}
|
|
@@ -2469,7 +2594,7 @@ class Interpreter {
|
|
|
2469
2594
|
prevKeys.delete(k);
|
|
2470
2595
|
if (isComponent) {
|
|
2471
2596
|
const savedK = savedDefaults.has(k);
|
|
2472
|
-
if (!savedK &&
|
|
2597
|
+
if (!savedK && bobeShared.hasOwn(rawTarget, k)) {
|
|
2473
2598
|
savedDefaults.set(k, rawTarget[k]);
|
|
2474
2599
|
}
|
|
2475
2600
|
const val = props[k];
|
|
@@ -2502,7 +2627,7 @@ class Interpreter {
|
|
|
2502
2627
|
}).get();
|
|
2503
2628
|
}
|
|
2504
2629
|
} else if (hookType === 'dynamic') {
|
|
2505
|
-
const valueIsMapKey =
|
|
2630
|
+
const valueIsMapKey = Boolean(aoye.getProxyHasKey(data, value));
|
|
2506
2631
|
const fn = isFn ? rawVal : valueIsMapKey ? value : this.getFn(data, value);
|
|
2507
2632
|
this.onePropParsed(data, _node, key, fn, valueIsMapKey, isFn, hookI);
|
|
2508
2633
|
} else if (hookType === 'static') {
|