marko 6.0.101 → 6.0.103
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 +37 -22
- package/dist/common/accessor.debug.d.ts +18 -3
- package/dist/common/errors.d.ts +4 -0
- package/dist/common/helpers.d.ts +1 -0
- package/dist/common/meta.d.ts +1 -0
- package/dist/common/types.d.ts +20 -17
- package/dist/debug/dom.js +253 -141
- package/dist/debug/dom.mjs +253 -141
- package/dist/debug/html.js +65 -4
- package/dist/debug/html.mjs +65 -4
- package/dist/dom/abort-signal.d.ts +1 -1
- package/dist/dom/control-flow.d.ts +7 -6
- package/dist/dom/queue.d.ts +1 -1
- package/dist/dom/reconcile.d.ts +1 -1
- package/dist/dom/renderer.d.ts +3 -3
- package/dist/dom/resume.d.ts +3 -3
- package/dist/dom/scope.d.ts +2 -2
- package/dist/dom/signals.d.ts +8 -8
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +250 -204
- package/dist/dom.mjs +250 -204
- package/dist/html/writer.d.ts +1 -1
- package/dist/html.js +32 -31
- package/dist/html.mjs +32 -31
- package/dist/translator/index.js +281 -209
- package/dist/translator/util/references.d.ts +2 -2
- package/dist/translator/util/scope-read.d.ts +1 -1
- package/dist/translator/util/signals.d.ts +0 -1
- package/dist/translator/util/tag-name-type.d.ts +1 -1
- package/package.json +1 -1
package/dist/html/writer.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare function getScopeById(scopeId: number | undefined): PartialScope
|
|
|
31
31
|
export declare function _set_serialize_reason(reason: undefined | 0 | 1): void;
|
|
32
32
|
export declare function _scope_reason(): 0 | 1 | undefined;
|
|
33
33
|
export declare function _serialize_if(condition: undefined | 1 | Record<string, 1>, key: string): 1 | undefined;
|
|
34
|
-
export declare function _serialize_guard(condition: undefined | 1 | Record<string, 1>, key: string):
|
|
34
|
+
export declare function _serialize_guard(condition: undefined | 1 | Record<string, 1>, key: string): 1 | 0;
|
|
35
35
|
export declare function _el_resume(scopeId: number, accessor: Accessor, shouldResume?: 0 | 1): string;
|
|
36
36
|
export declare function _sep(shouldResume: 0 | 1): "" | "<!>";
|
|
37
37
|
export declare function _el(scopeId: number, id: string): () => void;
|
package/dist/html.js
CHANGED
|
@@ -146,7 +146,7 @@ function normalizeDynamicRenderer(value) {
|
|
|
146
146
|
if (value) {
|
|
147
147
|
if (typeof value == "string") return value;
|
|
148
148
|
let normalized = value.content || value.default || value;
|
|
149
|
-
if (/* @__KEY__ */ "
|
|
149
|
+
if (/* @__KEY__ */ "a" in normalized)
|
|
150
150
|
return normalized;
|
|
151
151
|
}
|
|
152
152
|
}
|
|
@@ -1150,11 +1150,11 @@ function _script(scopeId, registryId) {
|
|
|
1150
1150
|
function _attr_content(nodeAccessor, scopeId, content, serializeReason) {
|
|
1151
1151
|
let shouldResume = serializeReason !== 0, render2 = normalizeServerRender(content), branchId = _peek_scope_id();
|
|
1152
1152
|
render2 && (shouldResume ? withBranchId(branchId, render2) : render2()), _peek_scope_id() !== branchId ? shouldResume && writeScope(scopeId, {
|
|
1153
|
-
["
|
|
1153
|
+
["D" /* ConditionalScope */ + nodeAccessor]: writeScope(
|
|
1154
1154
|
branchId,
|
|
1155
1155
|
{}
|
|
1156
1156
|
),
|
|
1157
|
-
["
|
|
1157
|
+
["C" /* ConditionalRenderer */ + nodeAccessor]: render2?.a
|
|
1158
1158
|
}) : _scope_id();
|
|
1159
1159
|
}
|
|
1160
1160
|
function normalizeServerRender(value) {
|
|
@@ -1173,7 +1173,7 @@ function withContext(key, value, cb) {
|
|
|
1173
1173
|
}
|
|
1174
1174
|
}
|
|
1175
1175
|
function _var(parentScopeId, scopeOffsetAccessor, childScopeId, registryId) {
|
|
1176
|
-
_scope_with_id(parentScopeId)[scopeOffsetAccessor] = _scope_id(), _scope_with_id(childScopeId).
|
|
1176
|
+
_scope_with_id(parentScopeId)[scopeOffsetAccessor] = _scope_id(), _scope_with_id(childScopeId).T = _resume(
|
|
1177
1177
|
{},
|
|
1178
1178
|
registryId,
|
|
1179
1179
|
parentScopeId
|
|
@@ -1230,7 +1230,7 @@ function _hoist(scopeId, id) {
|
|
|
1230
1230
|
}
|
|
1231
1231
|
function _resume_branch(scopeId) {
|
|
1232
1232
|
let branchId = $chunk.context?.[branchIdKey];
|
|
1233
|
-
branchId !== void 0 && branchId !== scopeId && writeScope(scopeId, {
|
|
1233
|
+
branchId !== void 0 && branchId !== scopeId && writeScope(scopeId, { H: branchId });
|
|
1234
1234
|
}
|
|
1235
1235
|
var branchIdKey = Symbol();
|
|
1236
1236
|
function isInResumedBranch() {
|
|
@@ -1251,7 +1251,7 @@ function _for_of(list, cb, by, scopeId, accessor, serializeBranch, serializeMark
|
|
|
1251
1251
|
cb(item, index), loopScopes.set(itemKey, writeScope(branchId, {}));
|
|
1252
1252
|
});
|
|
1253
1253
|
}), loopScopes.size && writeScope(scopeId, {
|
|
1254
|
-
["
|
|
1254
|
+
["M" /* LoopScopeMap */ + accessor]: loopScopes
|
|
1255
1255
|
});
|
|
1256
1256
|
} else
|
|
1257
1257
|
forOf(list, cb);
|
|
@@ -1277,7 +1277,7 @@ function _for_in(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarke
|
|
|
1277
1277
|
cb(key, value), loopScopes.set(itemKey, writeScope(branchId, {}));
|
|
1278
1278
|
});
|
|
1279
1279
|
}), loopScopes.size && writeScope(scopeId, {
|
|
1280
|
-
["
|
|
1280
|
+
["M" /* LoopScopeMap */ + accessor]: loopScopes
|
|
1281
1281
|
});
|
|
1282
1282
|
} else
|
|
1283
1283
|
forIn(obj, cb);
|
|
@@ -1303,7 +1303,7 @@ function _for_to(to, from, step, cb, by, scopeId, accessor, serializeBranch, ser
|
|
|
1303
1303
|
cb(i), loopScopes.set(itemKey, writeScope(branchId, {}));
|
|
1304
1304
|
});
|
|
1305
1305
|
}), loopScopes.size && writeScope(scopeId, {
|
|
1306
|
-
["
|
|
1306
|
+
["M" /* LoopScopeMap */ + accessor]: loopScopes
|
|
1307
1307
|
});
|
|
1308
1308
|
} else
|
|
1309
1309
|
forTo(to, from, step, cb);
|
|
@@ -1329,7 +1329,7 @@ function _for_until(to, from, step, cb, by, scopeId, accessor, serializeBranch,
|
|
|
1329
1329
|
cb(i), loopScopes.set(itemKey, writeScope(branchId, {}));
|
|
1330
1330
|
});
|
|
1331
1331
|
}), loopScopes.size && writeScope(scopeId, {
|
|
1332
|
-
["
|
|
1332
|
+
["M" /* LoopScopeMap */ + accessor]: loopScopes
|
|
1333
1333
|
});
|
|
1334
1334
|
} else
|
|
1335
1335
|
forUntil(to, from, step, cb);
|
|
@@ -1351,9 +1351,9 @@ function _if(cb, scopeId, accessor, serializeBranch, serializeMarker, serializeS
|
|
|
1351
1351
|
// TODO: technically conditional renderer should only be written when either the
|
|
1352
1352
|
// condition is stateful, or if there are direct closures.
|
|
1353
1353
|
// It may make sense to pass in another arg for this.
|
|
1354
|
-
["
|
|
1354
|
+
["C" /* ConditionalRenderer */ + accessor]: branchIndex || void 0,
|
|
1355
1355
|
// we convert 0 to undefined since the runtime defaults branch to 0.
|
|
1356
|
-
["
|
|
1356
|
+
["D" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
|
|
1357
1357
|
}), writeBranchEnd(
|
|
1358
1358
|
scopeId,
|
|
1359
1359
|
accessor,
|
|
@@ -1404,7 +1404,7 @@ function _await(scopeId, accessor, promise, content, serializeMarker) {
|
|
|
1404
1404
|
$chunk.writeHTML(
|
|
1405
1405
|
$chunk.boundary.state.mark("[" /* BranchStart */, "")
|
|
1406
1406
|
), content(promise), writeScope(scopeId, {
|
|
1407
|
-
["
|
|
1407
|
+
["D" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
|
|
1408
1408
|
}), $chunk.writeHTML(
|
|
1409
1409
|
$chunk.boundary.state.mark(
|
|
1410
1410
|
"]" /* BranchEnd */,
|
|
@@ -1426,7 +1426,7 @@ function _await(scopeId, accessor, promise, content, serializeMarker) {
|
|
|
1426
1426
|
), content(value), boundary.state.serializer.writeAssign(
|
|
1427
1427
|
writeScope(branchId, {}),
|
|
1428
1428
|
_scope_with_id(scopeId),
|
|
1429
|
-
"
|
|
1429
|
+
"D" /* ConditionalScope */ + accessor
|
|
1430
1430
|
), $chunk.writeHTML(
|
|
1431
1431
|
$chunk.boundary.state.mark(
|
|
1432
1432
|
"]" /* BranchEnd */,
|
|
@@ -1450,11 +1450,11 @@ function _try(scopeId, accessor, content, input) {
|
|
|
1450
1450
|
placeholderContent ? () => tryPlaceholder(content, placeholderContent) : content,
|
|
1451
1451
|
catchContent
|
|
1452
1452
|
) : placeholderContent ? tryPlaceholder(content, placeholderContent) : content(), writeScope(branchId, {
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1453
|
+
D: accessor,
|
|
1454
|
+
F: catchContent,
|
|
1455
|
+
Q: placeholderContent
|
|
1456
1456
|
}), writeScope(scopeId, {
|
|
1457
|
-
["
|
|
1457
|
+
["D" /* ConditionalScope */ + accessor]: getScopeById(branchId)
|
|
1458
1458
|
}), $chunk.writeHTML(
|
|
1459
1459
|
$chunk.boundary.state.mark(
|
|
1460
1460
|
"]" /* BranchEnd */,
|
|
@@ -1870,7 +1870,7 @@ function _attrs(data, nodeAccessor, scopeId, tagName) {
|
|
|
1870
1870
|
break;
|
|
1871
1871
|
default:
|
|
1872
1872
|
name && !(isVoid(value) || skip.test(name) || name === "content" && tagName !== "meta") && (isEventHandler(name) ? (events || (events = {}, writeScope(scopeId, {
|
|
1873
|
-
["
|
|
1873
|
+
["I" /* EventAttributes */ + nodeAccessor]: events
|
|
1874
1874
|
})), events[getEventHandlerName(name)] = value) : result += nonVoidAttr(name, value));
|
|
1875
1875
|
break;
|
|
1876
1876
|
}
|
|
@@ -1891,9 +1891,9 @@ function _attrs_partial_content(data, skip, nodeAccessor, scopeId, tagName, seri
|
|
|
1891
1891
|
}
|
|
1892
1892
|
function writeControlledScope(type, scopeId, nodeAccessor, value, valueChange) {
|
|
1893
1893
|
writeScope(scopeId, {
|
|
1894
|
-
["
|
|
1895
|
-
["
|
|
1896
|
-
["
|
|
1894
|
+
["F" /* ControlledType */ + nodeAccessor]: type,
|
|
1895
|
+
["G" /* ControlledValue */ + nodeAccessor]: value,
|
|
1896
|
+
["E" /* ControlledHandler */ + nodeAccessor]: valueChange
|
|
1897
1897
|
});
|
|
1898
1898
|
}
|
|
1899
1899
|
function stringAttr(name, value) {
|
|
@@ -1946,14 +1946,14 @@ var voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|p
|
|
|
1946
1946
|
if (typeof renderer == "string") {
|
|
1947
1947
|
let input = (inputIsArgs ? inputOrArgs[0] : inputOrArgs) || {};
|
|
1948
1948
|
if (rendered = !0, _scope_id(), _html(
|
|
1949
|
-
`<${renderer}${_attrs(input,
|
|
1949
|
+
`<${renderer}${_attrs(input, "a", branchId, renderer)}>`
|
|
1950
1950
|
), !voidElementsReg.test(renderer)) {
|
|
1951
1951
|
let renderContent = content || normalizeDynamicRenderer(input.content);
|
|
1952
1952
|
if (renderer === "textarea")
|
|
1953
1953
|
_html(
|
|
1954
1954
|
_attr_textarea_value(
|
|
1955
1955
|
branchId,
|
|
1956
|
-
|
|
1956
|
+
"a",
|
|
1957
1957
|
input.value,
|
|
1958
1958
|
input.valueChange
|
|
1959
1959
|
)
|
|
@@ -1965,13 +1965,13 @@ var voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|p
|
|
|
1965
1965
|
);
|
|
1966
1966
|
renderer === "select" && ("value" in input || "valueChange" in input) ? _attr_select_value(
|
|
1967
1967
|
branchId,
|
|
1968
|
-
|
|
1968
|
+
"a",
|
|
1969
1969
|
input.value,
|
|
1970
1970
|
input.valueChange,
|
|
1971
1971
|
renderContent
|
|
1972
1972
|
) : _dynamic_tag(
|
|
1973
1973
|
branchId,
|
|
1974
|
-
|
|
1974
|
+
"a",
|
|
1975
1975
|
renderContent,
|
|
1976
1976
|
[],
|
|
1977
1977
|
0,
|
|
@@ -1981,7 +1981,8 @@ var voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|p
|
|
|
1981
1981
|
}
|
|
1982
1982
|
_html(`</${renderer}>`);
|
|
1983
1983
|
}
|
|
1984
|
-
|
|
1984
|
+
let childScope = getScopeById(branchId);
|
|
1985
|
+
childScope && (childScope["Ia"] || childScope["Ea"]) && (childScope.R = renderer, _script(branchId, "d")), shouldResume && _html(
|
|
1985
1986
|
state.mark(
|
|
1986
1987
|
"'" /* BranchEndNativeTag */,
|
|
1987
1988
|
scopeId + " " + accessor + " " + branchId
|
|
@@ -2009,12 +2010,12 @@ var voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|p
|
|
|
2009
2010
|
);
|
|
2010
2011
|
}
|
|
2011
2012
|
return rendered ? shouldResume && writeScope(scopeId, {
|
|
2012
|
-
["
|
|
2013
|
-
["
|
|
2013
|
+
["D" /* ConditionalScope */ + accessor]: writeScope(branchId, {}),
|
|
2014
|
+
["C" /* ConditionalRenderer */ + accessor]: renderer?.a || renderer
|
|
2014
2015
|
}) : _scope_id(), result;
|
|
2015
2016
|
};
|
|
2016
2017
|
function _content(id, fn) {
|
|
2017
|
-
return fn.
|
|
2018
|
+
return fn.a = id, fn;
|
|
2018
2019
|
}
|
|
2019
2020
|
function _content_resume(id, fn, scopeId) {
|
|
2020
2021
|
return _resume(_content(id, fn), id, scopeId);
|
|
@@ -2022,7 +2023,7 @@ function _content_resume(id, fn, scopeId) {
|
|
|
2022
2023
|
function patchDynamicTag(patch) {
|
|
2023
2024
|
_dynamic_tag = /* @__PURE__ */ ((originalDynamicTag) => (scopeId, accessor, tag, input, content, inputIsArgs, resume) => {
|
|
2024
2025
|
let patched = patch(scopeId, accessor, tag);
|
|
2025
|
-
return patched !== tag && (patched.
|
|
2026
|
+
return patched !== tag && (patched.a = tag), originalDynamicTag(
|
|
2026
2027
|
scopeId,
|
|
2027
2028
|
accessor,
|
|
2028
2029
|
patched,
|
|
@@ -2048,7 +2049,7 @@ var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap()
|
|
|
2048
2049
|
return state || ($global2.runtimeId ||= "M", $global2.renderId ||= $global2.componentIdPrefix || $global2.widgetIdPrefix || "_", $global2[K_TAGS_API_STATE] = state = new State2($global2)), state;
|
|
2049
2050
|
},
|
|
2050
2051
|
isTagsAPI(fn) {
|
|
2051
|
-
return !!fn.
|
|
2052
|
+
return !!fn.a;
|
|
2052
2053
|
},
|
|
2053
2054
|
onFlush(fn) {
|
|
2054
2055
|
let { flushHTML } = Chunk.prototype;
|
package/dist/html.mjs
CHANGED
|
@@ -57,7 +57,7 @@ function normalizeDynamicRenderer(value) {
|
|
|
57
57
|
if (value) {
|
|
58
58
|
if (typeof value == "string") return value;
|
|
59
59
|
let normalized = value.content || value.default || value;
|
|
60
|
-
if (/* @__KEY__ */ "
|
|
60
|
+
if (/* @__KEY__ */ "a" in normalized)
|
|
61
61
|
return normalized;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -1061,11 +1061,11 @@ function _script(scopeId, registryId) {
|
|
|
1061
1061
|
function _attr_content(nodeAccessor, scopeId, content, serializeReason) {
|
|
1062
1062
|
let shouldResume = serializeReason !== 0, render2 = normalizeServerRender(content), branchId = _peek_scope_id();
|
|
1063
1063
|
render2 && (shouldResume ? withBranchId(branchId, render2) : render2()), _peek_scope_id() !== branchId ? shouldResume && writeScope(scopeId, {
|
|
1064
|
-
["
|
|
1064
|
+
["D" /* ConditionalScope */ + nodeAccessor]: writeScope(
|
|
1065
1065
|
branchId,
|
|
1066
1066
|
{}
|
|
1067
1067
|
),
|
|
1068
|
-
["
|
|
1068
|
+
["C" /* ConditionalRenderer */ + nodeAccessor]: render2?.a
|
|
1069
1069
|
}) : _scope_id();
|
|
1070
1070
|
}
|
|
1071
1071
|
function normalizeServerRender(value) {
|
|
@@ -1084,7 +1084,7 @@ function withContext(key, value, cb) {
|
|
|
1084
1084
|
}
|
|
1085
1085
|
}
|
|
1086
1086
|
function _var(parentScopeId, scopeOffsetAccessor, childScopeId, registryId) {
|
|
1087
|
-
_scope_with_id(parentScopeId)[scopeOffsetAccessor] = _scope_id(), _scope_with_id(childScopeId).
|
|
1087
|
+
_scope_with_id(parentScopeId)[scopeOffsetAccessor] = _scope_id(), _scope_with_id(childScopeId).T = _resume(
|
|
1088
1088
|
{},
|
|
1089
1089
|
registryId,
|
|
1090
1090
|
parentScopeId
|
|
@@ -1141,7 +1141,7 @@ function _hoist(scopeId, id) {
|
|
|
1141
1141
|
}
|
|
1142
1142
|
function _resume_branch(scopeId) {
|
|
1143
1143
|
let branchId = $chunk.context?.[branchIdKey];
|
|
1144
|
-
branchId !== void 0 && branchId !== scopeId && writeScope(scopeId, {
|
|
1144
|
+
branchId !== void 0 && branchId !== scopeId && writeScope(scopeId, { H: branchId });
|
|
1145
1145
|
}
|
|
1146
1146
|
var branchIdKey = Symbol();
|
|
1147
1147
|
function isInResumedBranch() {
|
|
@@ -1162,7 +1162,7 @@ function _for_of(list, cb, by, scopeId, accessor, serializeBranch, serializeMark
|
|
|
1162
1162
|
cb(item, index), loopScopes.set(itemKey, writeScope(branchId, {}));
|
|
1163
1163
|
});
|
|
1164
1164
|
}), loopScopes.size && writeScope(scopeId, {
|
|
1165
|
-
["
|
|
1165
|
+
["M" /* LoopScopeMap */ + accessor]: loopScopes
|
|
1166
1166
|
});
|
|
1167
1167
|
} else
|
|
1168
1168
|
forOf(list, cb);
|
|
@@ -1188,7 +1188,7 @@ function _for_in(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarke
|
|
|
1188
1188
|
cb(key, value), loopScopes.set(itemKey, writeScope(branchId, {}));
|
|
1189
1189
|
});
|
|
1190
1190
|
}), loopScopes.size && writeScope(scopeId, {
|
|
1191
|
-
["
|
|
1191
|
+
["M" /* LoopScopeMap */ + accessor]: loopScopes
|
|
1192
1192
|
});
|
|
1193
1193
|
} else
|
|
1194
1194
|
forIn(obj, cb);
|
|
@@ -1214,7 +1214,7 @@ function _for_to(to, from, step, cb, by, scopeId, accessor, serializeBranch, ser
|
|
|
1214
1214
|
cb(i), loopScopes.set(itemKey, writeScope(branchId, {}));
|
|
1215
1215
|
});
|
|
1216
1216
|
}), loopScopes.size && writeScope(scopeId, {
|
|
1217
|
-
["
|
|
1217
|
+
["M" /* LoopScopeMap */ + accessor]: loopScopes
|
|
1218
1218
|
});
|
|
1219
1219
|
} else
|
|
1220
1220
|
forTo(to, from, step, cb);
|
|
@@ -1240,7 +1240,7 @@ function _for_until(to, from, step, cb, by, scopeId, accessor, serializeBranch,
|
|
|
1240
1240
|
cb(i), loopScopes.set(itemKey, writeScope(branchId, {}));
|
|
1241
1241
|
});
|
|
1242
1242
|
}), loopScopes.size && writeScope(scopeId, {
|
|
1243
|
-
["
|
|
1243
|
+
["M" /* LoopScopeMap */ + accessor]: loopScopes
|
|
1244
1244
|
});
|
|
1245
1245
|
} else
|
|
1246
1246
|
forUntil(to, from, step, cb);
|
|
@@ -1262,9 +1262,9 @@ function _if(cb, scopeId, accessor, serializeBranch, serializeMarker, serializeS
|
|
|
1262
1262
|
// TODO: technically conditional renderer should only be written when either the
|
|
1263
1263
|
// condition is stateful, or if there are direct closures.
|
|
1264
1264
|
// It may make sense to pass in another arg for this.
|
|
1265
|
-
["
|
|
1265
|
+
["C" /* ConditionalRenderer */ + accessor]: branchIndex || void 0,
|
|
1266
1266
|
// we convert 0 to undefined since the runtime defaults branch to 0.
|
|
1267
|
-
["
|
|
1267
|
+
["D" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
|
|
1268
1268
|
}), writeBranchEnd(
|
|
1269
1269
|
scopeId,
|
|
1270
1270
|
accessor,
|
|
@@ -1315,7 +1315,7 @@ function _await(scopeId, accessor, promise, content, serializeMarker) {
|
|
|
1315
1315
|
$chunk.writeHTML(
|
|
1316
1316
|
$chunk.boundary.state.mark("[" /* BranchStart */, "")
|
|
1317
1317
|
), content(promise), writeScope(scopeId, {
|
|
1318
|
-
["
|
|
1318
|
+
["D" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
|
|
1319
1319
|
}), $chunk.writeHTML(
|
|
1320
1320
|
$chunk.boundary.state.mark(
|
|
1321
1321
|
"]" /* BranchEnd */,
|
|
@@ -1337,7 +1337,7 @@ function _await(scopeId, accessor, promise, content, serializeMarker) {
|
|
|
1337
1337
|
), content(value), boundary.state.serializer.writeAssign(
|
|
1338
1338
|
writeScope(branchId, {}),
|
|
1339
1339
|
_scope_with_id(scopeId),
|
|
1340
|
-
"
|
|
1340
|
+
"D" /* ConditionalScope */ + accessor
|
|
1341
1341
|
), $chunk.writeHTML(
|
|
1342
1342
|
$chunk.boundary.state.mark(
|
|
1343
1343
|
"]" /* BranchEnd */,
|
|
@@ -1361,11 +1361,11 @@ function _try(scopeId, accessor, content, input) {
|
|
|
1361
1361
|
placeholderContent ? () => tryPlaceholder(content, placeholderContent) : content,
|
|
1362
1362
|
catchContent
|
|
1363
1363
|
) : placeholderContent ? tryPlaceholder(content, placeholderContent) : content(), writeScope(branchId, {
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1364
|
+
D: accessor,
|
|
1365
|
+
F: catchContent,
|
|
1366
|
+
Q: placeholderContent
|
|
1367
1367
|
}), writeScope(scopeId, {
|
|
1368
|
-
["
|
|
1368
|
+
["D" /* ConditionalScope */ + accessor]: getScopeById(branchId)
|
|
1369
1369
|
}), $chunk.writeHTML(
|
|
1370
1370
|
$chunk.boundary.state.mark(
|
|
1371
1371
|
"]" /* BranchEnd */,
|
|
@@ -1781,7 +1781,7 @@ function _attrs(data, nodeAccessor, scopeId, tagName) {
|
|
|
1781
1781
|
break;
|
|
1782
1782
|
default:
|
|
1783
1783
|
name && !(isVoid(value) || skip.test(name) || name === "content" && tagName !== "meta") && (isEventHandler(name) ? (events || (events = {}, writeScope(scopeId, {
|
|
1784
|
-
["
|
|
1784
|
+
["I" /* EventAttributes */ + nodeAccessor]: events
|
|
1785
1785
|
})), events[getEventHandlerName(name)] = value) : result += nonVoidAttr(name, value));
|
|
1786
1786
|
break;
|
|
1787
1787
|
}
|
|
@@ -1802,9 +1802,9 @@ function _attrs_partial_content(data, skip, nodeAccessor, scopeId, tagName, seri
|
|
|
1802
1802
|
}
|
|
1803
1803
|
function writeControlledScope(type, scopeId, nodeAccessor, value, valueChange) {
|
|
1804
1804
|
writeScope(scopeId, {
|
|
1805
|
-
["
|
|
1806
|
-
["
|
|
1807
|
-
["
|
|
1805
|
+
["F" /* ControlledType */ + nodeAccessor]: type,
|
|
1806
|
+
["G" /* ControlledValue */ + nodeAccessor]: value,
|
|
1807
|
+
["E" /* ControlledHandler */ + nodeAccessor]: valueChange
|
|
1808
1808
|
});
|
|
1809
1809
|
}
|
|
1810
1810
|
function stringAttr(name, value) {
|
|
@@ -1857,14 +1857,14 @@ var voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|p
|
|
|
1857
1857
|
if (typeof renderer == "string") {
|
|
1858
1858
|
let input = (inputIsArgs ? inputOrArgs[0] : inputOrArgs) || {};
|
|
1859
1859
|
if (rendered = !0, _scope_id(), _html(
|
|
1860
|
-
`<${renderer}${_attrs(input,
|
|
1860
|
+
`<${renderer}${_attrs(input, "a", branchId, renderer)}>`
|
|
1861
1861
|
), !voidElementsReg.test(renderer)) {
|
|
1862
1862
|
let renderContent = content || normalizeDynamicRenderer(input.content);
|
|
1863
1863
|
if (renderer === "textarea")
|
|
1864
1864
|
_html(
|
|
1865
1865
|
_attr_textarea_value(
|
|
1866
1866
|
branchId,
|
|
1867
|
-
|
|
1867
|
+
"a",
|
|
1868
1868
|
input.value,
|
|
1869
1869
|
input.valueChange
|
|
1870
1870
|
)
|
|
@@ -1876,13 +1876,13 @@ var voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|p
|
|
|
1876
1876
|
);
|
|
1877
1877
|
renderer === "select" && ("value" in input || "valueChange" in input) ? _attr_select_value(
|
|
1878
1878
|
branchId,
|
|
1879
|
-
|
|
1879
|
+
"a",
|
|
1880
1880
|
input.value,
|
|
1881
1881
|
input.valueChange,
|
|
1882
1882
|
renderContent
|
|
1883
1883
|
) : _dynamic_tag(
|
|
1884
1884
|
branchId,
|
|
1885
|
-
|
|
1885
|
+
"a",
|
|
1886
1886
|
renderContent,
|
|
1887
1887
|
[],
|
|
1888
1888
|
0,
|
|
@@ -1892,7 +1892,8 @@ var voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|p
|
|
|
1892
1892
|
}
|
|
1893
1893
|
_html(`</${renderer}>`);
|
|
1894
1894
|
}
|
|
1895
|
-
|
|
1895
|
+
let childScope = getScopeById(branchId);
|
|
1896
|
+
childScope && (childScope["Ia"] || childScope["Ea"]) && (childScope.R = renderer, _script(branchId, "d")), shouldResume && _html(
|
|
1896
1897
|
state.mark(
|
|
1897
1898
|
"'" /* BranchEndNativeTag */,
|
|
1898
1899
|
scopeId + " " + accessor + " " + branchId
|
|
@@ -1920,12 +1921,12 @@ var voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|p
|
|
|
1920
1921
|
);
|
|
1921
1922
|
}
|
|
1922
1923
|
return rendered ? shouldResume && writeScope(scopeId, {
|
|
1923
|
-
["
|
|
1924
|
-
["
|
|
1924
|
+
["D" /* ConditionalScope */ + accessor]: writeScope(branchId, {}),
|
|
1925
|
+
["C" /* ConditionalRenderer */ + accessor]: renderer?.a || renderer
|
|
1925
1926
|
}) : _scope_id(), result;
|
|
1926
1927
|
};
|
|
1927
1928
|
function _content(id, fn) {
|
|
1928
|
-
return fn.
|
|
1929
|
+
return fn.a = id, fn;
|
|
1929
1930
|
}
|
|
1930
1931
|
function _content_resume(id, fn, scopeId) {
|
|
1931
1932
|
return _resume(_content(id, fn), id, scopeId);
|
|
@@ -1933,7 +1934,7 @@ function _content_resume(id, fn, scopeId) {
|
|
|
1933
1934
|
function patchDynamicTag(patch) {
|
|
1934
1935
|
_dynamic_tag = /* @__PURE__ */ ((originalDynamicTag) => (scopeId, accessor, tag, input, content, inputIsArgs, resume) => {
|
|
1935
1936
|
let patched = patch(scopeId, accessor, tag);
|
|
1936
|
-
return patched !== tag && (patched.
|
|
1937
|
+
return patched !== tag && (patched.a = tag), originalDynamicTag(
|
|
1937
1938
|
scopeId,
|
|
1938
1939
|
accessor,
|
|
1939
1940
|
patched,
|
|
@@ -1959,7 +1960,7 @@ var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap()
|
|
|
1959
1960
|
return state || ($global2.runtimeId ||= "M", $global2.renderId ||= $global2.componentIdPrefix || $global2.widgetIdPrefix || "_", $global2[K_TAGS_API_STATE] = state = new State2($global2)), state;
|
|
1960
1961
|
},
|
|
1961
1962
|
isTagsAPI(fn) {
|
|
1962
|
-
return !!fn.
|
|
1963
|
+
return !!fn.a;
|
|
1963
1964
|
},
|
|
1964
1965
|
onFlush(fn) {
|
|
1965
1966
|
let { flushHTML } = Chunk.prototype;
|