marko 6.0.3 → 6.0.5
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/helpers.d.ts +2 -2
- package/dist/debug/dom.js +138 -136
- package/dist/debug/dom.mjs +138 -136
- package/dist/debug/html.js +250 -237
- package/dist/debug/html.mjs +250 -237
- package/dist/dom/dom.d.ts +5 -0
- package/dist/dom/queue.d.ts +1 -0
- package/dist/dom/scope.d.ts +0 -1
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +85 -90
- package/dist/dom.mjs +85 -90
- package/dist/html/dynamic-tag.d.ts +1 -1
- package/dist/html/writer.d.ts +8 -8
- package/dist/html.js +141 -145
- package/dist/html.mjs +141 -145
- package/dist/translator/index.js +677 -420
- package/dist/translator/util/css-px-props.d.ts +2 -0
- package/dist/translator/util/references.d.ts +1 -0
- package/dist/translator/visitors/program/html.d.ts +1 -1
- package/dist/translator/visitors/tag/native-tag.d.ts +2 -2
- package/package.json +2 -2
package/dist/debug/html.js
CHANGED
@@ -42,11 +42,11 @@ __export(html_exports, {
|
|
42
42
|
escapeStyle: () => escapeStyle,
|
43
43
|
escapeXML: () => escapeXML,
|
44
44
|
forIn: () => forIn,
|
45
|
-
forInBy: () =>
|
45
|
+
forInBy: () => forInBy,
|
46
46
|
forOf: () => forOf,
|
47
|
-
forOfBy: () =>
|
47
|
+
forOfBy: () => forOfBy,
|
48
48
|
forTo: () => forTo,
|
49
|
-
forToBy: () =>
|
49
|
+
forToBy: () => forToBy,
|
50
50
|
fork: () => fork,
|
51
51
|
getScopeById: () => getScopeById,
|
52
52
|
hoist: () => hoist,
|
@@ -108,48 +108,44 @@ function* attrTagIterator() {
|
|
108
108
|
}
|
109
109
|
|
110
110
|
// src/common/helpers.ts
|
111
|
-
function classValue(
|
112
|
-
return toDelimitedString(
|
111
|
+
function classValue(classValue2) {
|
112
|
+
return toDelimitedString(classValue2, " ", stringifyClassObject);
|
113
113
|
}
|
114
114
|
function stringifyClassObject(name, value) {
|
115
115
|
return value ? name : "";
|
116
116
|
}
|
117
|
-
function styleValue(
|
118
|
-
return toDelimitedString(
|
117
|
+
function styleValue(styleValue2) {
|
118
|
+
return toDelimitedString(styleValue2, ";", stringifyStyleObject);
|
119
119
|
}
|
120
120
|
function stringifyStyleObject(name, value) {
|
121
|
-
return value || value === 0 ? `${name}:${typeof value === "number" &&
|
121
|
+
return value || value === 0 ? `${name}:${value && typeof value === "number" && !/^(--|ta|or|li|z)|cou|nk|it|ag|we|do|w$/.test(name) ? value + "px" : value}` : "";
|
122
122
|
}
|
123
123
|
function toDelimitedString(val, delimiter, stringify) {
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
curDelimiter = delimiter;
|
137
|
-
}
|
138
|
-
}
|
139
|
-
} else {
|
140
|
-
for (const name in val) {
|
141
|
-
const v = val[name];
|
142
|
-
const part = stringify(name, v);
|
143
|
-
if (part !== "") {
|
144
|
-
result += curDelimiter + part;
|
145
|
-
curDelimiter = delimiter;
|
146
|
-
}
|
147
|
-
}
|
124
|
+
let str = "";
|
125
|
+
let sep = "";
|
126
|
+
let part;
|
127
|
+
if (val) {
|
128
|
+
if (typeof val !== "object") {
|
129
|
+
str += val;
|
130
|
+
} else if (Array.isArray(val)) {
|
131
|
+
for (const v of val) {
|
132
|
+
part = toDelimitedString(v, delimiter, stringify);
|
133
|
+
if (part) {
|
134
|
+
str += sep + part;
|
135
|
+
sep = delimiter;
|
148
136
|
}
|
149
|
-
return result;
|
150
137
|
}
|
138
|
+
} else {
|
139
|
+
for (const name in val) {
|
140
|
+
part = stringify(name, val[name]);
|
141
|
+
if (part) {
|
142
|
+
str += sep + part;
|
143
|
+
sep = delimiter;
|
144
|
+
}
|
145
|
+
}
|
146
|
+
}
|
151
147
|
}
|
152
|
-
return
|
148
|
+
return str;
|
153
149
|
}
|
154
150
|
function isEventHandler(name) {
|
155
151
|
return /^on[A-Z-]/.test(name);
|
@@ -210,6 +206,29 @@ function forTo(to, from, step, cb) {
|
|
210
206
|
}
|
211
207
|
}
|
212
208
|
|
209
|
+
// src/html/for.ts
|
210
|
+
function forOfBy(by, item, index) {
|
211
|
+
if (by) {
|
212
|
+
if (typeof by === "string") {
|
213
|
+
return item[by];
|
214
|
+
}
|
215
|
+
return by(item, index);
|
216
|
+
}
|
217
|
+
return index;
|
218
|
+
}
|
219
|
+
function forInBy(by, name, value) {
|
220
|
+
if (by) {
|
221
|
+
return by(name, value);
|
222
|
+
}
|
223
|
+
return name;
|
224
|
+
}
|
225
|
+
function forToBy(by, index) {
|
226
|
+
if (by) {
|
227
|
+
return by(index);
|
228
|
+
}
|
229
|
+
return index;
|
230
|
+
}
|
231
|
+
|
213
232
|
// src/html/inlined-runtimes.ts
|
214
233
|
var WALKER_RUNTIME_CODE = true ? (
|
215
234
|
/* js */
|
@@ -1771,213 +1790,232 @@ var branchIdKey = Symbol();
|
|
1771
1790
|
function withBranchId(branchId, cb) {
|
1772
1791
|
return withContext(branchIdKey, branchId, cb);
|
1773
1792
|
}
|
1774
|
-
function resumeForOf(list, cb, by, scopeId, accessor, serializeBranch) {
|
1775
|
-
|
1776
|
-
|
1793
|
+
function resumeForOf(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker) {
|
1794
|
+
const resumeBranch = serializeBranch !== 0;
|
1795
|
+
const resumeMarker = serializeMarker !== 0;
|
1796
|
+
if (resumeBranch) {
|
1797
|
+
const loopScopes = /* @__PURE__ */ new Map();
|
1798
|
+
forOf(list, (item, index) => {
|
1799
|
+
const branchId = peekNextScopeId();
|
1800
|
+
if (resumeMarker) {
|
1801
|
+
$chunk.writeHTML(
|
1802
|
+
$chunk.boundary.state.mark(
|
1803
|
+
"[" /* BranchStart */,
|
1804
|
+
branchId + (index ? " " : "")
|
1805
|
+
)
|
1806
|
+
);
|
1807
|
+
}
|
1808
|
+
withBranchId(branchId, () => {
|
1809
|
+
cb(item, index);
|
1810
|
+
loopScopes.set(forOfBy(by, item, index), writeScope(branchId, {}));
|
1811
|
+
});
|
1812
|
+
});
|
1813
|
+
if (loopScopes.size) {
|
1814
|
+
writeScope(scopeId, {
|
1815
|
+
["LoopScopeMap:" /* LoopScopeMap */ + accessor]: loopScopes
|
1816
|
+
});
|
1817
|
+
}
|
1818
|
+
} else {
|
1819
|
+
forOf(list, cb);
|
1777
1820
|
}
|
1778
|
-
|
1779
|
-
forOf(list, (item, index) => {
|
1780
|
-
const branchId = peekNextScopeId();
|
1821
|
+
if (resumeMarker) {
|
1781
1822
|
$chunk.writeHTML(
|
1782
1823
|
$chunk.boundary.state.mark(
|
1783
|
-
"
|
1784
|
-
|
1824
|
+
"]" /* BranchEnd */,
|
1825
|
+
scopeId + " " + accessor
|
1785
1826
|
)
|
1786
1827
|
);
|
1787
|
-
withBranchId(branchId, () => {
|
1788
|
-
cb(item, index);
|
1789
|
-
loopScopes.set(forOfBy(by, item, index), writeScope(branchId, {}));
|
1790
|
-
});
|
1791
|
-
});
|
1792
|
-
if (loopScopes.size) {
|
1793
|
-
writeScope(scopeId, {
|
1794
|
-
["LoopScopeMap:" /* LoopScopeMap */ + accessor]: loopScopes
|
1795
|
-
});
|
1796
1828
|
}
|
1797
|
-
$chunk.writeHTML(
|
1798
|
-
$chunk.boundary.state.mark(
|
1799
|
-
"]" /* BranchEnd */,
|
1800
|
-
scopeId + " " + accessor
|
1801
|
-
)
|
1802
|
-
);
|
1803
1829
|
}
|
1804
|
-
function resumeSingleNodeForOf(list, cb, by, scopeId, accessor, serializeBranch, onlyChildInParent) {
|
1805
|
-
|
1806
|
-
|
1807
|
-
}
|
1808
|
-
const loopScopes = /* @__PURE__ */ new Map();
|
1830
|
+
function resumeSingleNodeForOf(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, onlyChildInParent) {
|
1831
|
+
const resumeBranch = serializeBranch !== 0;
|
1832
|
+
const resumeMarker = serializeMarker !== 0;
|
1809
1833
|
let branchIds = "";
|
1810
|
-
|
1811
|
-
const
|
1812
|
-
|
1813
|
-
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1817
|
-
|
1818
|
-
|
1819
|
-
|
1820
|
-
|
1834
|
+
if (resumeBranch) {
|
1835
|
+
const loopScopes = /* @__PURE__ */ new Map();
|
1836
|
+
forOf(list, (item, index) => {
|
1837
|
+
const branchId = peekNextScopeId();
|
1838
|
+
if (resumeMarker) {
|
1839
|
+
branchIds = " " + branchId + branchIds;
|
1840
|
+
}
|
1841
|
+
withBranchId(branchId, () => {
|
1842
|
+
cb(item, index);
|
1843
|
+
loopScopes.set(forOfBy(by, item, index), writeScope(branchId, {}));
|
1844
|
+
});
|
1821
1845
|
});
|
1822
|
-
|
1823
|
-
|
1824
|
-
|
1825
|
-
|
1826
|
-
scopeId + " " + accessor + branchIds
|
1827
|
-
)
|
1828
|
-
);
|
1829
|
-
}
|
1830
|
-
function forOfBy(by, item, index) {
|
1831
|
-
if (by) {
|
1832
|
-
if (typeof by === "string") {
|
1833
|
-
return item[by];
|
1846
|
+
if (loopScopes.size) {
|
1847
|
+
writeScope(scopeId, {
|
1848
|
+
["LoopScopeMap:" /* LoopScopeMap */ + accessor]: loopScopes
|
1849
|
+
});
|
1834
1850
|
}
|
1835
|
-
|
1851
|
+
} else {
|
1852
|
+
forOf(list, cb);
|
1853
|
+
}
|
1854
|
+
if (resumeMarker) {
|
1855
|
+
$chunk.writeHTML(
|
1856
|
+
$chunk.boundary.state.mark(
|
1857
|
+
onlyChildInParent ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
|
1858
|
+
scopeId + " " + accessor + branchIds
|
1859
|
+
)
|
1860
|
+
);
|
1836
1861
|
}
|
1837
|
-
return index;
|
1838
1862
|
}
|
1839
|
-
function resumeForIn(obj, cb, by, scopeId, accessor, serializeBranch) {
|
1840
|
-
|
1841
|
-
|
1863
|
+
function resumeForIn(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker) {
|
1864
|
+
const resumeBranch = serializeBranch !== 0;
|
1865
|
+
const resumeMarker = serializeMarker !== 0;
|
1866
|
+
if (resumeBranch) {
|
1867
|
+
const loopScopes = /* @__PURE__ */ new Map();
|
1868
|
+
let sep = "";
|
1869
|
+
forIn(obj, (key, value) => {
|
1870
|
+
const branchId = peekNextScopeId();
|
1871
|
+
if (resumeMarker) {
|
1872
|
+
$chunk.writeHTML(
|
1873
|
+
$chunk.boundary.state.mark("[" /* BranchStart */, branchId + sep)
|
1874
|
+
);
|
1875
|
+
sep = " ";
|
1876
|
+
}
|
1877
|
+
withBranchId(branchId, () => {
|
1878
|
+
cb(key, value);
|
1879
|
+
loopScopes.set(forInBy(by, key, value), writeScope(branchId, {}));
|
1880
|
+
});
|
1881
|
+
});
|
1882
|
+
if (loopScopes.size) {
|
1883
|
+
writeScope(scopeId, {
|
1884
|
+
["LoopScopeMap:" /* LoopScopeMap */ + accessor]: loopScopes
|
1885
|
+
});
|
1886
|
+
}
|
1887
|
+
} else {
|
1888
|
+
forIn(obj, cb);
|
1842
1889
|
}
|
1843
|
-
|
1844
|
-
let sep = "";
|
1845
|
-
forIn(obj, (key, value) => {
|
1846
|
-
const branchId = peekNextScopeId();
|
1890
|
+
if (resumeMarker) {
|
1847
1891
|
$chunk.writeHTML(
|
1848
|
-
$chunk.boundary.state.mark(
|
1892
|
+
$chunk.boundary.state.mark(
|
1893
|
+
"]" /* BranchEnd */,
|
1894
|
+
scopeId + " " + accessor
|
1895
|
+
)
|
1849
1896
|
);
|
1850
|
-
sep = " ";
|
1851
|
-
withBranchId(branchId, () => {
|
1852
|
-
cb(key, value);
|
1853
|
-
loopScopes.set(forInBy(by, key, value), writeScope(branchId, {}));
|
1854
|
-
});
|
1855
|
-
});
|
1856
|
-
if (loopScopes.size) {
|
1857
|
-
writeScope(scopeId, {
|
1858
|
-
["LoopScopeMap:" /* LoopScopeMap */ + accessor]: loopScopes
|
1859
|
-
});
|
1860
1897
|
}
|
1861
|
-
$chunk.writeHTML(
|
1862
|
-
$chunk.boundary.state.mark(
|
1863
|
-
"]" /* BranchEnd */,
|
1864
|
-
scopeId + " " + accessor
|
1865
|
-
)
|
1866
|
-
);
|
1867
1898
|
}
|
1868
|
-
function resumeSingleNodeForIn(obj, cb, by, scopeId, accessor, serializeBranch,
|
1869
|
-
|
1870
|
-
|
1871
|
-
}
|
1872
|
-
const loopScopes = /* @__PURE__ */ new Map();
|
1899
|
+
function resumeSingleNodeForIn(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker, onlyChildInParent) {
|
1900
|
+
const resumeBranch = serializeBranch !== 0;
|
1901
|
+
const resumeMarker = serializeMarker !== 0;
|
1873
1902
|
let branchIds = "";
|
1874
|
-
|
1875
|
-
const
|
1876
|
-
|
1877
|
-
|
1878
|
-
|
1879
|
-
|
1880
|
-
|
1881
|
-
|
1882
|
-
|
1883
|
-
|
1884
|
-
|
1903
|
+
if (resumeBranch) {
|
1904
|
+
const loopScopes = /* @__PURE__ */ new Map();
|
1905
|
+
forIn(obj, (key, value) => {
|
1906
|
+
const branchId = peekNextScopeId();
|
1907
|
+
if (resumeMarker) {
|
1908
|
+
branchIds = " " + branchId + branchIds;
|
1909
|
+
}
|
1910
|
+
withBranchId(branchId, () => {
|
1911
|
+
cb(key, value);
|
1912
|
+
loopScopes.set(forInBy(by, key, value), writeScope(branchId, {}));
|
1913
|
+
});
|
1885
1914
|
});
|
1915
|
+
if (loopScopes.size) {
|
1916
|
+
writeScope(scopeId, {
|
1917
|
+
["LoopScopeMap:" /* LoopScopeMap */ + accessor]: loopScopes
|
1918
|
+
});
|
1919
|
+
}
|
1920
|
+
} else {
|
1921
|
+
forIn(obj, cb);
|
1886
1922
|
}
|
1887
|
-
|
1888
|
-
$chunk.
|
1889
|
-
|
1890
|
-
|
1891
|
-
|
1892
|
-
|
1893
|
-
|
1894
|
-
function forInBy(by, name, value) {
|
1895
|
-
if (by) {
|
1896
|
-
return by(name, value);
|
1923
|
+
if (resumeMarker) {
|
1924
|
+
$chunk.writeHTML(
|
1925
|
+
$chunk.boundary.state.mark(
|
1926
|
+
onlyChildInParent ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
|
1927
|
+
scopeId + " " + accessor + branchIds
|
1928
|
+
)
|
1929
|
+
);
|
1897
1930
|
}
|
1898
|
-
return name;
|
1899
1931
|
}
|
1900
|
-
function resumeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch) {
|
1901
|
-
|
1902
|
-
|
1932
|
+
function resumeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker) {
|
1933
|
+
const resumeBranch = serializeBranch !== 0;
|
1934
|
+
const resumeMarker = serializeMarker !== 0;
|
1935
|
+
if (resumeBranch) {
|
1936
|
+
const loopScopes = /* @__PURE__ */ new Map();
|
1937
|
+
let sep = "";
|
1938
|
+
forTo(to, from, step, (i) => {
|
1939
|
+
const branchId = peekNextScopeId();
|
1940
|
+
if (resumeMarker) {
|
1941
|
+
$chunk.writeHTML(
|
1942
|
+
$chunk.boundary.state.mark("[" /* BranchStart */, branchId + sep)
|
1943
|
+
);
|
1944
|
+
sep = " ";
|
1945
|
+
}
|
1946
|
+
withBranchId(branchId, () => {
|
1947
|
+
cb(i);
|
1948
|
+
loopScopes.set(forToBy(by, i), writeScope(branchId, {}));
|
1949
|
+
});
|
1950
|
+
});
|
1951
|
+
if (loopScopes.size) {
|
1952
|
+
writeScope(scopeId, {
|
1953
|
+
["LoopScopeMap:" /* LoopScopeMap */ + accessor]: loopScopes
|
1954
|
+
});
|
1955
|
+
}
|
1956
|
+
} else {
|
1957
|
+
forTo(to, from, step, cb);
|
1903
1958
|
}
|
1904
|
-
|
1905
|
-
let sep = "";
|
1906
|
-
forTo(to, from, step, (index) => {
|
1907
|
-
const branchId = peekNextScopeId();
|
1959
|
+
if (resumeMarker) {
|
1908
1960
|
$chunk.writeHTML(
|
1909
|
-
$chunk.boundary.state.mark(
|
1961
|
+
$chunk.boundary.state.mark(
|
1962
|
+
"]" /* BranchEnd */,
|
1963
|
+
scopeId + " " + accessor
|
1964
|
+
)
|
1910
1965
|
);
|
1911
|
-
sep = " ";
|
1912
|
-
withBranchId(branchId, () => {
|
1913
|
-
cb(index);
|
1914
|
-
loopScopes.set(forToBy(by, index), writeScope(branchId, {}));
|
1915
|
-
});
|
1916
|
-
});
|
1917
|
-
if (loopScopes.size) {
|
1918
|
-
writeScope(scopeId, {
|
1919
|
-
["LoopScopeMap:" /* LoopScopeMap */ + accessor]: loopScopes
|
1920
|
-
});
|
1921
1966
|
}
|
1922
|
-
$chunk.writeHTML(
|
1923
|
-
$chunk.boundary.state.mark(
|
1924
|
-
"]" /* BranchEnd */,
|
1925
|
-
scopeId + " " + accessor
|
1926
|
-
)
|
1927
|
-
);
|
1928
1967
|
}
|
1929
|
-
function resumeSingleNodeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch,
|
1930
|
-
|
1931
|
-
|
1932
|
-
}
|
1933
|
-
const loopScopes = /* @__PURE__ */ new Map();
|
1968
|
+
function resumeSingleNodeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, onlyChildInParent) {
|
1969
|
+
const resumeBranch = serializeBranch !== 0;
|
1970
|
+
const resumeMarker = serializeMarker !== 0;
|
1934
1971
|
let branchIds = "";
|
1935
|
-
|
1936
|
-
const
|
1937
|
-
|
1938
|
-
|
1939
|
-
|
1940
|
-
|
1941
|
-
|
1942
|
-
|
1943
|
-
|
1944
|
-
|
1945
|
-
|
1972
|
+
if (resumeBranch) {
|
1973
|
+
const loopScopes = /* @__PURE__ */ new Map();
|
1974
|
+
forTo(to, from, step, (i) => {
|
1975
|
+
const branchId = peekNextScopeId();
|
1976
|
+
if (resumeMarker) {
|
1977
|
+
branchIds = " " + branchId + branchIds;
|
1978
|
+
}
|
1979
|
+
withBranchId(branchId, () => {
|
1980
|
+
cb(i);
|
1981
|
+
loopScopes.set(forToBy(by, i), writeScope(branchId, {}));
|
1982
|
+
});
|
1946
1983
|
});
|
1984
|
+
if (loopScopes.size) {
|
1985
|
+
writeScope(scopeId, {
|
1986
|
+
["LoopScopeMap:" /* LoopScopeMap */ + accessor]: loopScopes
|
1987
|
+
});
|
1988
|
+
}
|
1989
|
+
} else {
|
1990
|
+
forTo(to, from, step, cb);
|
1947
1991
|
}
|
1948
|
-
|
1949
|
-
$chunk.
|
1950
|
-
|
1951
|
-
|
1952
|
-
|
1953
|
-
|
1954
|
-
|
1955
|
-
function forToBy(by, index) {
|
1956
|
-
if (by) {
|
1957
|
-
return by(index);
|
1992
|
+
if (resumeMarker) {
|
1993
|
+
$chunk.writeHTML(
|
1994
|
+
$chunk.boundary.state.mark(
|
1995
|
+
onlyChildInParent ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
|
1996
|
+
scopeId + " " + accessor + branchIds
|
1997
|
+
)
|
1998
|
+
);
|
1958
1999
|
}
|
1959
|
-
return index;
|
1960
2000
|
}
|
1961
2001
|
function resumeConditional(cb, scopeId, accessor, serializeBranch, serializeMarker) {
|
1962
|
-
|
1963
|
-
|
1964
|
-
}
|
2002
|
+
const resumeBranch = serializeBranch !== 0;
|
2003
|
+
const resumeMarker = serializeMarker !== 0;
|
1965
2004
|
const branchId = peekNextScopeId();
|
1966
|
-
if (
|
2005
|
+
if (resumeMarker && resumeBranch) {
|
1967
2006
|
$chunk.writeHTML(
|
1968
2007
|
$chunk.boundary.state.mark("[" /* BranchStart */, branchId + "")
|
1969
2008
|
);
|
1970
2009
|
}
|
1971
|
-
const branchIndex = withBranchId(branchId, cb);
|
1972
|
-
|
2010
|
+
const branchIndex = resumeBranch ? withBranchId(branchId, cb) : cb();
|
2011
|
+
const rendered = branchIndex !== void 0;
|
2012
|
+
if (resumeBranch && rendered) {
|
1973
2013
|
writeScope(scopeId, {
|
1974
|
-
["ConditionalRenderer:" /* ConditionalRenderer */ + accessor]:
|
2014
|
+
["ConditionalRenderer:" /* ConditionalRenderer */ + accessor]: resumeMarker ? branchIndex : void 0,
|
1975
2015
|
["ConditionalScope:" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
|
1976
2016
|
});
|
1977
|
-
} else {
|
1978
|
-
nextScopeId();
|
1979
2017
|
}
|
1980
|
-
if (
|
2018
|
+
if (resumeMarker) {
|
1981
2019
|
$chunk.writeHTML(
|
1982
2020
|
$chunk.boundary.state.mark(
|
1983
2021
|
"]" /* BranchEnd */,
|
@@ -1986,26 +2024,23 @@ function resumeConditional(cb, scopeId, accessor, serializeBranch, serializeMark
|
|
1986
2024
|
);
|
1987
2025
|
}
|
1988
2026
|
}
|
1989
|
-
function resumeSingleNodeConditional(cb, scopeId, accessor, serializeBranch, serializeMarker,
|
1990
|
-
|
1991
|
-
|
1992
|
-
}
|
2027
|
+
function resumeSingleNodeConditional(cb, scopeId, accessor, serializeBranch, serializeMarker, onlyChildInParent) {
|
2028
|
+
const resumeBranch = serializeBranch !== 0;
|
2029
|
+
const resumeMarker = serializeMarker !== 0;
|
1993
2030
|
const branchId = peekNextScopeId();
|
1994
|
-
const branchIndex = withBranchId(branchId, cb);
|
1995
|
-
const
|
1996
|
-
if (
|
2031
|
+
const branchIndex = resumeBranch ? withBranchId(branchId, cb) : cb();
|
2032
|
+
const shouldWriteBranch = resumeBranch && branchIndex !== void 0;
|
2033
|
+
if (shouldWriteBranch) {
|
1997
2034
|
writeScope(scopeId, {
|
1998
|
-
["ConditionalRenderer:" /* ConditionalRenderer */ + accessor]:
|
2035
|
+
["ConditionalRenderer:" /* ConditionalRenderer */ + accessor]: resumeMarker ? branchIndex : void 0,
|
1999
2036
|
["ConditionalScope:" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
|
2000
2037
|
});
|
2001
|
-
} else {
|
2002
|
-
nextScopeId();
|
2003
2038
|
}
|
2004
|
-
if (
|
2039
|
+
if (resumeMarker) {
|
2005
2040
|
$chunk.writeHTML(
|
2006
2041
|
$chunk.boundary.state.mark(
|
2007
|
-
|
2008
|
-
scopeId + " " + accessor + (
|
2042
|
+
onlyChildInParent ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
|
2043
|
+
scopeId + " " + accessor + (shouldWriteBranch ? " " + branchId : "")
|
2009
2044
|
)
|
2010
2045
|
);
|
2011
2046
|
}
|
@@ -3108,7 +3143,8 @@ function NOOP2() {
|
|
3108
3143
|
|
3109
3144
|
// src/html/dynamic-tag.ts
|
3110
3145
|
var voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|param|source|track|wbr)$/;
|
3111
|
-
var dynamicTag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs,
|
3146
|
+
var dynamicTag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, serializeReason) => {
|
3147
|
+
const shouldResume = serializeReason !== 0;
|
3112
3148
|
const renderer = normalizeDynamicRenderer(tag);
|
3113
3149
|
if (true) {
|
3114
3150
|
if (renderer && typeof renderer !== "function" && typeof renderer !== "string") {
|
@@ -3179,7 +3215,7 @@ var dynamicTag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, sho
|
|
3179
3215
|
const input = inputIsArgs ? inputOrArgs[0] : inputOrArgs;
|
3180
3216
|
return renderer(
|
3181
3217
|
content ? { ...input, content } : input,
|
3182
|
-
shouldResume
|
3218
|
+
shouldResume ? 1 : 0
|
3183
3219
|
);
|
3184
3220
|
}
|
3185
3221
|
return inputIsArgs ? renderer(...inputOrArgs) : renderer(
|
@@ -3323,29 +3359,6 @@ var compat = {
|
|
3323
3359
|
register(RENDER_BODY_ID, fn);
|
3324
3360
|
}
|
3325
3361
|
};
|
3326
|
-
|
3327
|
-
// src/html/for.ts
|
3328
|
-
function forOfBy2(by, item, index) {
|
3329
|
-
if (by) {
|
3330
|
-
if (typeof by === "string") {
|
3331
|
-
return item[by];
|
3332
|
-
}
|
3333
|
-
return by(item, index);
|
3334
|
-
}
|
3335
|
-
return index;
|
3336
|
-
}
|
3337
|
-
function forInBy2(by, name, value) {
|
3338
|
-
if (by) {
|
3339
|
-
return by(name, value);
|
3340
|
-
}
|
3341
|
-
return name;
|
3342
|
-
}
|
3343
|
-
function forToBy2(by, index) {
|
3344
|
-
if (by) {
|
3345
|
-
return by(index);
|
3346
|
-
}
|
3347
|
-
return index;
|
3348
|
-
}
|
3349
3362
|
// Annotate the CommonJS export names for ESM import in node:
|
3350
3363
|
0 && (module.exports = {
|
3351
3364
|
$global,
|