marko 6.0.3 → 6.0.4
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/debug/html.js +223 -206
- package/dist/debug/html.mjs +223 -206
- package/dist/html/dynamic-tag.d.ts +1 -1
- package/dist/html/writer.d.ts +8 -8
- package/dist/html.js +125 -120
- package/dist/html.mjs +125 -120
- package/dist/translator/index.js +104 -81
- package/dist/translator/util/references.d.ts +1 -0
- package/dist/translator/visitors/program/html.d.ts +1 -1
- package/package.json +2 -2
package/dist/debug/html.mjs
CHANGED
@@ -125,6 +125,29 @@ function forTo(to, from, step, cb) {
|
|
125
125
|
}
|
126
126
|
}
|
127
127
|
|
128
|
+
// src/html/for.ts
|
129
|
+
function forOfBy(by, item, index) {
|
130
|
+
if (by) {
|
131
|
+
if (typeof by === "string") {
|
132
|
+
return item[by];
|
133
|
+
}
|
134
|
+
return by(item, index);
|
135
|
+
}
|
136
|
+
return index;
|
137
|
+
}
|
138
|
+
function forInBy(by, name, value) {
|
139
|
+
if (by) {
|
140
|
+
return by(name, value);
|
141
|
+
}
|
142
|
+
return name;
|
143
|
+
}
|
144
|
+
function forToBy(by, index) {
|
145
|
+
if (by) {
|
146
|
+
return by(index);
|
147
|
+
}
|
148
|
+
return index;
|
149
|
+
}
|
150
|
+
|
128
151
|
// src/html/inlined-runtimes.ts
|
129
152
|
var WALKER_RUNTIME_CODE = true ? (
|
130
153
|
/* js */
|
@@ -1686,213 +1709,232 @@ var branchIdKey = Symbol();
|
|
1686
1709
|
function withBranchId(branchId, cb) {
|
1687
1710
|
return withContext(branchIdKey, branchId, cb);
|
1688
1711
|
}
|
1689
|
-
function resumeForOf(list, cb, by, scopeId, accessor, serializeBranch) {
|
1690
|
-
|
1691
|
-
|
1712
|
+
function resumeForOf(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker) {
|
1713
|
+
const resumeBranch = serializeBranch !== 0;
|
1714
|
+
const resumeMarker = serializeMarker !== 0;
|
1715
|
+
if (resumeBranch) {
|
1716
|
+
const loopScopes = /* @__PURE__ */ new Map();
|
1717
|
+
forOf(list, (item, index) => {
|
1718
|
+
const branchId = peekNextScopeId();
|
1719
|
+
if (resumeMarker) {
|
1720
|
+
$chunk.writeHTML(
|
1721
|
+
$chunk.boundary.state.mark(
|
1722
|
+
"[" /* BranchStart */,
|
1723
|
+
branchId + (index ? " " : "")
|
1724
|
+
)
|
1725
|
+
);
|
1726
|
+
}
|
1727
|
+
withBranchId(branchId, () => {
|
1728
|
+
cb(item, index);
|
1729
|
+
loopScopes.set(forOfBy(by, item, index), writeScope(branchId, {}));
|
1730
|
+
});
|
1731
|
+
});
|
1732
|
+
if (loopScopes.size) {
|
1733
|
+
writeScope(scopeId, {
|
1734
|
+
["LoopScopeMap:" /* LoopScopeMap */ + accessor]: loopScopes
|
1735
|
+
});
|
1736
|
+
}
|
1737
|
+
} else {
|
1738
|
+
forOf(list, cb);
|
1692
1739
|
}
|
1693
|
-
|
1694
|
-
forOf(list, (item, index) => {
|
1695
|
-
const branchId = peekNextScopeId();
|
1740
|
+
if (resumeMarker) {
|
1696
1741
|
$chunk.writeHTML(
|
1697
1742
|
$chunk.boundary.state.mark(
|
1698
|
-
"
|
1699
|
-
|
1743
|
+
"]" /* BranchEnd */,
|
1744
|
+
scopeId + " " + accessor
|
1700
1745
|
)
|
1701
1746
|
);
|
1702
|
-
withBranchId(branchId, () => {
|
1703
|
-
cb(item, index);
|
1704
|
-
loopScopes.set(forOfBy(by, item, index), writeScope(branchId, {}));
|
1705
|
-
});
|
1706
|
-
});
|
1707
|
-
if (loopScopes.size) {
|
1708
|
-
writeScope(scopeId, {
|
1709
|
-
["LoopScopeMap:" /* LoopScopeMap */ + accessor]: loopScopes
|
1710
|
-
});
|
1711
1747
|
}
|
1712
|
-
$chunk.writeHTML(
|
1713
|
-
$chunk.boundary.state.mark(
|
1714
|
-
"]" /* BranchEnd */,
|
1715
|
-
scopeId + " " + accessor
|
1716
|
-
)
|
1717
|
-
);
|
1718
1748
|
}
|
1719
|
-
function resumeSingleNodeForOf(list, cb, by, scopeId, accessor, serializeBranch, onlyChildInParent) {
|
1720
|
-
|
1721
|
-
|
1722
|
-
}
|
1723
|
-
const loopScopes = /* @__PURE__ */ new Map();
|
1749
|
+
function resumeSingleNodeForOf(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, onlyChildInParent) {
|
1750
|
+
const resumeBranch = serializeBranch !== 0;
|
1751
|
+
const resumeMarker = serializeMarker !== 0;
|
1724
1752
|
let branchIds = "";
|
1725
|
-
|
1726
|
-
const
|
1727
|
-
|
1728
|
-
|
1729
|
-
|
1730
|
-
|
1731
|
-
|
1732
|
-
|
1733
|
-
|
1734
|
-
|
1735
|
-
|
1753
|
+
if (resumeBranch) {
|
1754
|
+
const loopScopes = /* @__PURE__ */ new Map();
|
1755
|
+
forOf(list, (item, index) => {
|
1756
|
+
const branchId = peekNextScopeId();
|
1757
|
+
if (resumeMarker) {
|
1758
|
+
branchIds = " " + branchId + branchIds;
|
1759
|
+
}
|
1760
|
+
withBranchId(branchId, () => {
|
1761
|
+
cb(item, index);
|
1762
|
+
loopScopes.set(forOfBy(by, item, index), writeScope(branchId, {}));
|
1763
|
+
});
|
1736
1764
|
});
|
1737
|
-
|
1738
|
-
|
1739
|
-
|
1740
|
-
|
1741
|
-
scopeId + " " + accessor + branchIds
|
1742
|
-
)
|
1743
|
-
);
|
1744
|
-
}
|
1745
|
-
function forOfBy(by, item, index) {
|
1746
|
-
if (by) {
|
1747
|
-
if (typeof by === "string") {
|
1748
|
-
return item[by];
|
1765
|
+
if (loopScopes.size) {
|
1766
|
+
writeScope(scopeId, {
|
1767
|
+
["LoopScopeMap:" /* LoopScopeMap */ + accessor]: loopScopes
|
1768
|
+
});
|
1749
1769
|
}
|
1750
|
-
|
1770
|
+
} else {
|
1771
|
+
forOf(list, cb);
|
1772
|
+
}
|
1773
|
+
if (resumeMarker) {
|
1774
|
+
$chunk.writeHTML(
|
1775
|
+
$chunk.boundary.state.mark(
|
1776
|
+
onlyChildInParent ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
|
1777
|
+
scopeId + " " + accessor + branchIds
|
1778
|
+
)
|
1779
|
+
);
|
1751
1780
|
}
|
1752
|
-
return index;
|
1753
1781
|
}
|
1754
|
-
function resumeForIn(obj, cb, by, scopeId, accessor, serializeBranch) {
|
1755
|
-
|
1756
|
-
|
1782
|
+
function resumeForIn(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker) {
|
1783
|
+
const resumeBranch = serializeBranch !== 0;
|
1784
|
+
const resumeMarker = serializeMarker !== 0;
|
1785
|
+
if (resumeBranch) {
|
1786
|
+
const loopScopes = /* @__PURE__ */ new Map();
|
1787
|
+
let sep = "";
|
1788
|
+
forIn(obj, (key, value) => {
|
1789
|
+
const branchId = peekNextScopeId();
|
1790
|
+
if (resumeMarker) {
|
1791
|
+
$chunk.writeHTML(
|
1792
|
+
$chunk.boundary.state.mark("[" /* BranchStart */, branchId + sep)
|
1793
|
+
);
|
1794
|
+
sep = " ";
|
1795
|
+
}
|
1796
|
+
withBranchId(branchId, () => {
|
1797
|
+
cb(key, value);
|
1798
|
+
loopScopes.set(forInBy(by, key, value), writeScope(branchId, {}));
|
1799
|
+
});
|
1800
|
+
});
|
1801
|
+
if (loopScopes.size) {
|
1802
|
+
writeScope(scopeId, {
|
1803
|
+
["LoopScopeMap:" /* LoopScopeMap */ + accessor]: loopScopes
|
1804
|
+
});
|
1805
|
+
}
|
1806
|
+
} else {
|
1807
|
+
forIn(obj, cb);
|
1757
1808
|
}
|
1758
|
-
|
1759
|
-
let sep = "";
|
1760
|
-
forIn(obj, (key, value) => {
|
1761
|
-
const branchId = peekNextScopeId();
|
1809
|
+
if (resumeMarker) {
|
1762
1810
|
$chunk.writeHTML(
|
1763
|
-
$chunk.boundary.state.mark(
|
1811
|
+
$chunk.boundary.state.mark(
|
1812
|
+
"]" /* BranchEnd */,
|
1813
|
+
scopeId + " " + accessor
|
1814
|
+
)
|
1764
1815
|
);
|
1765
|
-
sep = " ";
|
1766
|
-
withBranchId(branchId, () => {
|
1767
|
-
cb(key, value);
|
1768
|
-
loopScopes.set(forInBy(by, key, value), writeScope(branchId, {}));
|
1769
|
-
});
|
1770
|
-
});
|
1771
|
-
if (loopScopes.size) {
|
1772
|
-
writeScope(scopeId, {
|
1773
|
-
["LoopScopeMap:" /* LoopScopeMap */ + accessor]: loopScopes
|
1774
|
-
});
|
1775
1816
|
}
|
1776
|
-
$chunk.writeHTML(
|
1777
|
-
$chunk.boundary.state.mark(
|
1778
|
-
"]" /* BranchEnd */,
|
1779
|
-
scopeId + " " + accessor
|
1780
|
-
)
|
1781
|
-
);
|
1782
1817
|
}
|
1783
|
-
function resumeSingleNodeForIn(obj, cb, by, scopeId, accessor, serializeBranch,
|
1784
|
-
|
1785
|
-
|
1786
|
-
}
|
1787
|
-
const loopScopes = /* @__PURE__ */ new Map();
|
1818
|
+
function resumeSingleNodeForIn(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker, onlyChildInParent) {
|
1819
|
+
const resumeBranch = serializeBranch !== 0;
|
1820
|
+
const resumeMarker = serializeMarker !== 0;
|
1788
1821
|
let branchIds = "";
|
1789
|
-
|
1790
|
-
const
|
1791
|
-
|
1792
|
-
|
1793
|
-
|
1794
|
-
|
1795
|
-
|
1796
|
-
|
1797
|
-
|
1798
|
-
|
1799
|
-
|
1822
|
+
if (resumeBranch) {
|
1823
|
+
const loopScopes = /* @__PURE__ */ new Map();
|
1824
|
+
forIn(obj, (key, value) => {
|
1825
|
+
const branchId = peekNextScopeId();
|
1826
|
+
if (resumeMarker) {
|
1827
|
+
branchIds = " " + branchId + branchIds;
|
1828
|
+
}
|
1829
|
+
withBranchId(branchId, () => {
|
1830
|
+
cb(key, value);
|
1831
|
+
loopScopes.set(forInBy(by, key, value), writeScope(branchId, {}));
|
1832
|
+
});
|
1800
1833
|
});
|
1834
|
+
if (loopScopes.size) {
|
1835
|
+
writeScope(scopeId, {
|
1836
|
+
["LoopScopeMap:" /* LoopScopeMap */ + accessor]: loopScopes
|
1837
|
+
});
|
1838
|
+
}
|
1839
|
+
} else {
|
1840
|
+
forIn(obj, cb);
|
1801
1841
|
}
|
1802
|
-
|
1803
|
-
$chunk.
|
1804
|
-
|
1805
|
-
|
1806
|
-
|
1807
|
-
|
1808
|
-
|
1809
|
-
function forInBy(by, name, value) {
|
1810
|
-
if (by) {
|
1811
|
-
return by(name, value);
|
1842
|
+
if (resumeMarker) {
|
1843
|
+
$chunk.writeHTML(
|
1844
|
+
$chunk.boundary.state.mark(
|
1845
|
+
onlyChildInParent ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
|
1846
|
+
scopeId + " " + accessor + branchIds
|
1847
|
+
)
|
1848
|
+
);
|
1812
1849
|
}
|
1813
|
-
return name;
|
1814
1850
|
}
|
1815
|
-
function resumeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch) {
|
1816
|
-
|
1817
|
-
|
1851
|
+
function resumeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker) {
|
1852
|
+
const resumeBranch = serializeBranch !== 0;
|
1853
|
+
const resumeMarker = serializeMarker !== 0;
|
1854
|
+
if (resumeBranch) {
|
1855
|
+
const loopScopes = /* @__PURE__ */ new Map();
|
1856
|
+
let sep = "";
|
1857
|
+
forTo(to, from, step, (i) => {
|
1858
|
+
const branchId = peekNextScopeId();
|
1859
|
+
if (resumeMarker) {
|
1860
|
+
$chunk.writeHTML(
|
1861
|
+
$chunk.boundary.state.mark("[" /* BranchStart */, branchId + sep)
|
1862
|
+
);
|
1863
|
+
sep = " ";
|
1864
|
+
}
|
1865
|
+
withBranchId(branchId, () => {
|
1866
|
+
cb(i);
|
1867
|
+
loopScopes.set(forToBy(by, i), writeScope(branchId, {}));
|
1868
|
+
});
|
1869
|
+
});
|
1870
|
+
if (loopScopes.size) {
|
1871
|
+
writeScope(scopeId, {
|
1872
|
+
["LoopScopeMap:" /* LoopScopeMap */ + accessor]: loopScopes
|
1873
|
+
});
|
1874
|
+
}
|
1875
|
+
} else {
|
1876
|
+
forTo(to, from, step, cb);
|
1818
1877
|
}
|
1819
|
-
|
1820
|
-
let sep = "";
|
1821
|
-
forTo(to, from, step, (index) => {
|
1822
|
-
const branchId = peekNextScopeId();
|
1878
|
+
if (resumeMarker) {
|
1823
1879
|
$chunk.writeHTML(
|
1824
|
-
$chunk.boundary.state.mark(
|
1880
|
+
$chunk.boundary.state.mark(
|
1881
|
+
"]" /* BranchEnd */,
|
1882
|
+
scopeId + " " + accessor
|
1883
|
+
)
|
1825
1884
|
);
|
1826
|
-
sep = " ";
|
1827
|
-
withBranchId(branchId, () => {
|
1828
|
-
cb(index);
|
1829
|
-
loopScopes.set(forToBy(by, index), writeScope(branchId, {}));
|
1830
|
-
});
|
1831
|
-
});
|
1832
|
-
if (loopScopes.size) {
|
1833
|
-
writeScope(scopeId, {
|
1834
|
-
["LoopScopeMap:" /* LoopScopeMap */ + accessor]: loopScopes
|
1835
|
-
});
|
1836
1885
|
}
|
1837
|
-
$chunk.writeHTML(
|
1838
|
-
$chunk.boundary.state.mark(
|
1839
|
-
"]" /* BranchEnd */,
|
1840
|
-
scopeId + " " + accessor
|
1841
|
-
)
|
1842
|
-
);
|
1843
1886
|
}
|
1844
|
-
function resumeSingleNodeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch,
|
1845
|
-
|
1846
|
-
|
1847
|
-
}
|
1848
|
-
const loopScopes = /* @__PURE__ */ new Map();
|
1887
|
+
function resumeSingleNodeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, onlyChildInParent) {
|
1888
|
+
const resumeBranch = serializeBranch !== 0;
|
1889
|
+
const resumeMarker = serializeMarker !== 0;
|
1849
1890
|
let branchIds = "";
|
1850
|
-
|
1851
|
-
const
|
1852
|
-
|
1853
|
-
|
1854
|
-
|
1855
|
-
|
1856
|
-
|
1857
|
-
|
1858
|
-
|
1859
|
-
|
1860
|
-
|
1891
|
+
if (resumeBranch) {
|
1892
|
+
const loopScopes = /* @__PURE__ */ new Map();
|
1893
|
+
forTo(to, from, step, (i) => {
|
1894
|
+
const branchId = peekNextScopeId();
|
1895
|
+
if (resumeMarker) {
|
1896
|
+
branchIds = " " + branchId + branchIds;
|
1897
|
+
}
|
1898
|
+
withBranchId(branchId, () => {
|
1899
|
+
cb(i);
|
1900
|
+
loopScopes.set(forToBy(by, i), writeScope(branchId, {}));
|
1901
|
+
});
|
1861
1902
|
});
|
1903
|
+
if (loopScopes.size) {
|
1904
|
+
writeScope(scopeId, {
|
1905
|
+
["LoopScopeMap:" /* LoopScopeMap */ + accessor]: loopScopes
|
1906
|
+
});
|
1907
|
+
}
|
1908
|
+
} else {
|
1909
|
+
forTo(to, from, step, cb);
|
1862
1910
|
}
|
1863
|
-
|
1864
|
-
$chunk.
|
1865
|
-
|
1866
|
-
|
1867
|
-
|
1868
|
-
|
1869
|
-
|
1870
|
-
function forToBy(by, index) {
|
1871
|
-
if (by) {
|
1872
|
-
return by(index);
|
1911
|
+
if (resumeMarker) {
|
1912
|
+
$chunk.writeHTML(
|
1913
|
+
$chunk.boundary.state.mark(
|
1914
|
+
onlyChildInParent ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
|
1915
|
+
scopeId + " " + accessor + branchIds
|
1916
|
+
)
|
1917
|
+
);
|
1873
1918
|
}
|
1874
|
-
return index;
|
1875
1919
|
}
|
1876
1920
|
function resumeConditional(cb, scopeId, accessor, serializeBranch, serializeMarker) {
|
1877
|
-
|
1878
|
-
|
1879
|
-
}
|
1921
|
+
const resumeBranch = serializeBranch !== 0;
|
1922
|
+
const resumeMarker = serializeMarker !== 0;
|
1880
1923
|
const branchId = peekNextScopeId();
|
1881
|
-
if (
|
1924
|
+
if (resumeMarker && resumeBranch) {
|
1882
1925
|
$chunk.writeHTML(
|
1883
1926
|
$chunk.boundary.state.mark("[" /* BranchStart */, branchId + "")
|
1884
1927
|
);
|
1885
1928
|
}
|
1886
|
-
const branchIndex = withBranchId(branchId, cb);
|
1887
|
-
|
1929
|
+
const branchIndex = resumeBranch ? withBranchId(branchId, cb) : cb();
|
1930
|
+
const rendered = branchIndex !== void 0;
|
1931
|
+
if (resumeBranch && rendered) {
|
1888
1932
|
writeScope(scopeId, {
|
1889
|
-
["ConditionalRenderer:" /* ConditionalRenderer */ + accessor]:
|
1933
|
+
["ConditionalRenderer:" /* ConditionalRenderer */ + accessor]: resumeMarker ? branchIndex : void 0,
|
1890
1934
|
["ConditionalScope:" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
|
1891
1935
|
});
|
1892
|
-
} else {
|
1893
|
-
nextScopeId();
|
1894
1936
|
}
|
1895
|
-
if (
|
1937
|
+
if (resumeMarker) {
|
1896
1938
|
$chunk.writeHTML(
|
1897
1939
|
$chunk.boundary.state.mark(
|
1898
1940
|
"]" /* BranchEnd */,
|
@@ -1901,26 +1943,23 @@ function resumeConditional(cb, scopeId, accessor, serializeBranch, serializeMark
|
|
1901
1943
|
);
|
1902
1944
|
}
|
1903
1945
|
}
|
1904
|
-
function resumeSingleNodeConditional(cb, scopeId, accessor, serializeBranch, serializeMarker,
|
1905
|
-
|
1906
|
-
|
1907
|
-
}
|
1946
|
+
function resumeSingleNodeConditional(cb, scopeId, accessor, serializeBranch, serializeMarker, onlyChildInParent) {
|
1947
|
+
const resumeBranch = serializeBranch !== 0;
|
1948
|
+
const resumeMarker = serializeMarker !== 0;
|
1908
1949
|
const branchId = peekNextScopeId();
|
1909
|
-
const branchIndex = withBranchId(branchId, cb);
|
1910
|
-
const
|
1911
|
-
if (
|
1950
|
+
const branchIndex = resumeBranch ? withBranchId(branchId, cb) : cb();
|
1951
|
+
const shouldWriteBranch = resumeBranch && branchIndex !== void 0;
|
1952
|
+
if (shouldWriteBranch) {
|
1912
1953
|
writeScope(scopeId, {
|
1913
|
-
["ConditionalRenderer:" /* ConditionalRenderer */ + accessor]:
|
1954
|
+
["ConditionalRenderer:" /* ConditionalRenderer */ + accessor]: resumeMarker ? branchIndex : void 0,
|
1914
1955
|
["ConditionalScope:" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
|
1915
1956
|
});
|
1916
|
-
} else {
|
1917
|
-
nextScopeId();
|
1918
1957
|
}
|
1919
|
-
if (
|
1958
|
+
if (resumeMarker) {
|
1920
1959
|
$chunk.writeHTML(
|
1921
1960
|
$chunk.boundary.state.mark(
|
1922
|
-
|
1923
|
-
scopeId + " " + accessor + (
|
1961
|
+
onlyChildInParent ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
|
1962
|
+
scopeId + " " + accessor + (shouldWriteBranch ? " " + branchId : "")
|
1924
1963
|
)
|
1925
1964
|
);
|
1926
1965
|
}
|
@@ -3023,7 +3062,8 @@ function NOOP2() {
|
|
3023
3062
|
|
3024
3063
|
// src/html/dynamic-tag.ts
|
3025
3064
|
var voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|param|source|track|wbr)$/;
|
3026
|
-
var dynamicTag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs,
|
3065
|
+
var dynamicTag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, serializeReason) => {
|
3066
|
+
const shouldResume = serializeReason !== 0;
|
3027
3067
|
const renderer = normalizeDynamicRenderer(tag);
|
3028
3068
|
if (true) {
|
3029
3069
|
if (renderer && typeof renderer !== "function" && typeof renderer !== "string") {
|
@@ -3094,7 +3134,7 @@ var dynamicTag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, sho
|
|
3094
3134
|
const input = inputIsArgs ? inputOrArgs[0] : inputOrArgs;
|
3095
3135
|
return renderer(
|
3096
3136
|
content ? { ...input, content } : input,
|
3097
|
-
shouldResume
|
3137
|
+
shouldResume ? 1 : 0
|
3098
3138
|
);
|
3099
3139
|
}
|
3100
3140
|
return inputIsArgs ? renderer(...inputOrArgs) : renderer(
|
@@ -3238,29 +3278,6 @@ var compat = {
|
|
3238
3278
|
register(RENDER_BODY_ID, fn);
|
3239
3279
|
}
|
3240
3280
|
};
|
3241
|
-
|
3242
|
-
// src/html/for.ts
|
3243
|
-
function forOfBy2(by, item, index) {
|
3244
|
-
if (by) {
|
3245
|
-
if (typeof by === "string") {
|
3246
|
-
return item[by];
|
3247
|
-
}
|
3248
|
-
return by(item, index);
|
3249
|
-
}
|
3250
|
-
return index;
|
3251
|
-
}
|
3252
|
-
function forInBy2(by, name, value) {
|
3253
|
-
if (by) {
|
3254
|
-
return by(name, value);
|
3255
|
-
}
|
3256
|
-
return name;
|
3257
|
-
}
|
3258
|
-
function forToBy2(by, index) {
|
3259
|
-
if (by) {
|
3260
|
-
return by(index);
|
3261
|
-
}
|
3262
|
-
return index;
|
3263
|
-
}
|
3264
3281
|
export {
|
3265
3282
|
$global,
|
3266
3283
|
attr,
|
@@ -3284,11 +3301,11 @@ export {
|
|
3284
3301
|
escapeStyle,
|
3285
3302
|
escapeXML,
|
3286
3303
|
forIn,
|
3287
|
-
|
3304
|
+
forInBy,
|
3288
3305
|
forOf,
|
3289
|
-
|
3306
|
+
forOfBy,
|
3290
3307
|
forTo,
|
3291
|
-
|
3308
|
+
forToBy,
|
3292
3309
|
fork,
|
3293
3310
|
getScopeById,
|
3294
3311
|
hoist,
|
@@ -4,7 +4,7 @@ interface BodyContentObject {
|
|
4
4
|
[x: PropertyKey]: unknown;
|
5
5
|
content: ServerRenderer;
|
6
6
|
}
|
7
|
-
export declare let dynamicTag: (scopeId: number, accessor: Accessor, tag: unknown | string | ServerRenderer | BodyContentObject, inputOrArgs: unknown, content?: (() => void) | 0, inputIsArgs?: 1,
|
7
|
+
export declare let dynamicTag: (scopeId: number, accessor: Accessor, tag: unknown | string | ServerRenderer | BodyContentObject, inputOrArgs: unknown, content?: (() => void) | 0, inputIsArgs?: 1, serializeReason?: 1 | 0) => unknown;
|
8
8
|
export declare function createContent(id: string, fn: ServerRenderer): ServerRenderer;
|
9
9
|
export declare function registerContent(id: string, fn: ServerRenderer, scopeId?: number): ServerRenderer;
|
10
10
|
export declare function patchDynamicTag(patch: (scopeId: number, accessor: Accessor, tag: unknown | string | ServerRenderer | BodyContentObject) => unknown): void;
|
package/dist/html/writer.d.ts
CHANGED
@@ -35,14 +35,14 @@ export declare function hoist(scopeId: number, id?: string): {
|
|
35
35
|
};
|
36
36
|
export declare function resumeClosestBranch(scopeId: number): void;
|
37
37
|
export declare function withBranchId<T>(branchId: number, cb: () => T): T;
|
38
|
-
export declare function resumeForOf(list: Falsy | Iterable<unknown>, cb: (item: unknown, index: number) => void, by: Falsy | ((item: unknown, index: number) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1): void;
|
39
|
-
export declare function resumeSingleNodeForOf(list: Falsy | Iterable<unknown>, cb: (item: unknown, index: number) => void, by: Falsy | ((item: unknown, index: number) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, onlyChildInParent?: 1): void;
|
40
|
-
export declare function resumeForIn(obj: Falsy | {}, cb: (key: string, value: unknown) => void, by: Falsy | ((key: string, v: unknown) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1): void;
|
41
|
-
export declare function resumeSingleNodeForIn(obj: Falsy | {}, cb: (key: string, value: unknown) => void, by: Falsy | ((key: string, v: unknown) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1,
|
42
|
-
export declare function resumeForTo(to: number, from: number | Falsy, step: number | Falsy, cb: (index: number) => void, by: Falsy | ((v: number) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1): void;
|
43
|
-
export declare function resumeSingleNodeForTo(to: number, from: number | Falsy, step: number | Falsy, cb: (index: number) => void, by: Falsy | ((v: number) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1,
|
44
|
-
export declare function resumeConditional(cb: () => void | number, scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 1):
|
45
|
-
export declare function resumeSingleNodeConditional(cb: () => void | number, scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1,
|
38
|
+
export declare function resumeForOf(list: Falsy | Iterable<unknown>, cb: (item: unknown, index: number) => void, by: Falsy | ((item: unknown, index: number) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1): void;
|
39
|
+
export declare function resumeSingleNodeForOf(list: Falsy | Iterable<unknown>, cb: (item: unknown, index: number) => void, by: Falsy | ((item: unknown, index: number) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, onlyChildInParent?: 1): void;
|
40
|
+
export declare function resumeForIn(obj: Falsy | {}, cb: (key: string, value: unknown) => void, by: Falsy | ((key: string, v: unknown) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1): void;
|
41
|
+
export declare function resumeSingleNodeForIn(obj: Falsy | {}, cb: (key: string, value: unknown) => void, by: Falsy | ((key: string, v: unknown) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, onlyChildInParent?: 1): void;
|
42
|
+
export declare function resumeForTo(to: number, from: number | Falsy, step: number | Falsy, cb: (index: number) => void, by: Falsy | ((v: number) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1): void;
|
43
|
+
export declare function resumeSingleNodeForTo(to: number, from: number | Falsy, step: number | Falsy, cb: (index: number) => void, by: Falsy | ((v: number) => unknown), scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, onlyChildInParent?: 1): void;
|
44
|
+
export declare function resumeConditional(cb: () => void | number, scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1): void;
|
45
|
+
export declare function resumeSingleNodeConditional(cb: () => void | number, scopeId: number, accessor: Accessor, serializeBranch?: 0 | 1, serializeMarker?: 0 | 1, onlyChildInParent?: 1): void;
|
46
46
|
declare let writeScope: (scopeId: number, partialScope: PartialScope) => ScopeInternals;
|
47
47
|
export { writeScope };
|
48
48
|
export declare function writeExistingScope(scopeId: number): ScopeInternals;
|