marko 6.0.59 → 6.0.61
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/dom.js +278 -296
- package/dist/debug/dom.mjs +278 -296
- package/dist/debug/html.js +219 -219
- package/dist/debug/html.mjs +169 -169
- package/dist/dom/abort-signal.d.ts +2 -2
- package/dist/dom/control-flow.d.ts +8 -8
- package/dist/dom/controllable.d.ts +11 -11
- package/dist/dom/dom.d.ts +17 -18
- package/dist/dom/event.d.ts +1 -1
- package/dist/dom/queue.d.ts +1 -1
- package/dist/dom/renderer.d.ts +4 -4
- package/dist/dom/resume.d.ts +3 -3
- package/dist/dom/signals.d.ts +14 -14
- package/dist/dom/template.d.ts +1 -1
- package/dist/dom.d.ts +10 -10
- package/dist/dom.js +254 -265
- package/dist/dom.mjs +254 -265
- package/dist/html/attrs.d.ts +14 -14
- package/dist/html/compat.d.ts +5 -5
- package/dist/html/content.d.ts +4 -4
- package/dist/html/dynamic-tag.d.ts +3 -3
- package/dist/html/template.d.ts +1 -1
- package/dist/html/writer.d.ts +26 -26
- package/dist/html.d.ts +5 -5
- package/dist/html.js +210 -210
- package/dist/html.mjs +160 -160
- package/dist/translator/index.js +501 -483
- package/dist/translator/util/runtime.d.ts +8 -8
- package/dist/translator/util/signals.d.ts +1 -1
- package/package.json +1 -1
package/dist/html.mjs
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
// src/common/attr-tag.ts
|
2
2
|
var empty = [], rest = Symbol();
|
3
|
-
function attrTag(
|
4
|
-
return
|
3
|
+
function attrTag(attrs) {
|
4
|
+
return attrs[Symbol.iterator] = attrTagIterator, attrs[rest] = empty, attrs;
|
5
5
|
}
|
6
|
-
function attrTags(first,
|
7
|
-
return first ? (first[rest] === empty ? first[rest] = [
|
6
|
+
function attrTags(first, attrs) {
|
7
|
+
return first ? (first[rest] === empty ? first[rest] = [attrs] : first[rest].push(attrs), first) : attrTag(attrs);
|
8
8
|
}
|
9
9
|
function* attrTagIterator() {
|
10
10
|
yield this, yield* this[rest];
|
@@ -50,22 +50,22 @@ function normalizeDynamicRenderer(value) {
|
|
50
50
|
}
|
51
51
|
|
52
52
|
// src/html/content.ts
|
53
|
-
function
|
53
|
+
function _unescaped(val) {
|
54
54
|
return val ? val + "" : val === 0 ? "0" : "";
|
55
55
|
}
|
56
56
|
var unsafeXMLReg = /[<&]/g, replaceUnsafeXML = (c) => c === "&" ? "&" : "<", escapeXMLStr = (str) => unsafeXMLReg.test(str) ? str.replace(unsafeXMLReg, replaceUnsafeXML) : str;
|
57
|
-
function
|
57
|
+
function _escape(val) {
|
58
58
|
return val ? escapeXMLStr(val + "") : val === 0 ? "0" : "‍";
|
59
59
|
}
|
60
60
|
function escapeTextAreaValue(val) {
|
61
61
|
return val ? escapeXMLStr(val + "") : val === 0 ? "0" : "";
|
62
62
|
}
|
63
63
|
var unsafeScriptReg = /<\/script/g, escapeScriptStr = (str) => unsafeScriptReg.test(str) ? str.replace(unsafeScriptReg, "\\x3C/script") : str;
|
64
|
-
function
|
64
|
+
function _escape_script(val) {
|
65
65
|
return val ? escapeScriptStr(val + "") : val === 0 ? "0" : "";
|
66
66
|
}
|
67
67
|
var unsafeStyleReg = /<\/style/g, escapeStyleStr = (str) => unsafeStyleReg.test(str) ? str.replace(unsafeStyleReg, "\\3C/style") : str;
|
68
|
-
function
|
68
|
+
function _escape_style(val) {
|
69
69
|
return val ? escapeStyleStr(val + "") : val === 0 ? "0" : "";
|
70
70
|
}
|
71
71
|
|
@@ -484,7 +484,7 @@ function writeProp(state, val, parent, accessor) {
|
|
484
484
|
return !1;
|
485
485
|
}
|
486
486
|
}
|
487
|
-
function writeReferenceOr(state,
|
487
|
+
function writeReferenceOr(state, write, val, parent, accessor) {
|
488
488
|
let ref = state.refs.get(val);
|
489
489
|
if (ref)
|
490
490
|
return ref.init ? (addAssignment(ref, ensureId(state, parent) + toAccess(accessor)), !1) : isCircular(parent, ref) ? (ref.assigns || (ensureId(state, ref), state.assigned.add(ref)), addAssignment(ref, ensureId(state, parent) + toAccess(accessor)), !1) : (state.buf.push(ensureId(state, ref)), !0);
|
@@ -492,7 +492,7 @@ function writeReferenceOr(state, write2, val, parent, accessor) {
|
|
492
492
|
return registered ? writeRegistered(state, val, parent, accessor, registered) : (state.refs.set(
|
493
493
|
val,
|
494
494
|
ref = new Reference(parent, accessor, state.flush, state.buf.length)
|
495
|
-
),
|
495
|
+
), write(state, val, ref) ? !0 : (state.refs.delete(ref), !1));
|
496
496
|
}
|
497
497
|
function writeRegistered(state, val, parent, accessor, { access, scope, getter }) {
|
498
498
|
if (scope) {
|
@@ -1014,24 +1014,24 @@ function getState() {
|
|
1014
1014
|
function getScopeId(scope) {
|
1015
1015
|
return scope[K_SCOPE_ID];
|
1016
1016
|
}
|
1017
|
-
function
|
1017
|
+
function _html(html) {
|
1018
1018
|
$chunk.writeHTML(html);
|
1019
1019
|
}
|
1020
1020
|
function writeScript(script) {
|
1021
1021
|
$chunk.writeScript(script);
|
1022
1022
|
}
|
1023
|
-
function
|
1023
|
+
function _script(scopeId, registryId) {
|
1024
1024
|
$chunk.boundary.state.needsMainRuntime = !0, $chunk.writeEffect(scopeId, registryId);
|
1025
1025
|
}
|
1026
|
-
function
|
1027
|
-
let shouldResume = serializeReason !== 0, render2 = normalizeServerRender(content), branchId =
|
1028
|
-
render2 && (shouldResume ? withBranchId(branchId, render2) : render2()),
|
1026
|
+
function _attr_content(nodeAccessor, scopeId, content, serializeReason) {
|
1027
|
+
let shouldResume = serializeReason !== 0, render2 = normalizeServerRender(content), branchId = _peek_scope_id();
|
1028
|
+
render2 && (shouldResume ? withBranchId(branchId, render2) : render2()), _peek_scope_id() !== branchId ? shouldResume && writeScope(scopeId, {
|
1029
1029
|
["d" /* ConditionalScope */ + nodeAccessor]: writeScope(
|
1030
1030
|
branchId,
|
1031
1031
|
{}
|
1032
1032
|
),
|
1033
1033
|
["c" /* ConditionalRenderer */ + nodeAccessor]: render2?.h
|
1034
|
-
}) :
|
1034
|
+
}) : _scope_id();
|
1035
1035
|
}
|
1036
1036
|
function normalizeServerRender(value) {
|
1037
1037
|
let renderer = normalizeDynamicRenderer(value);
|
@@ -1048,55 +1048,55 @@ function withContext(key, value, cb) {
|
|
1048
1048
|
ctx[kPendingContexts]--, ctx[key] = prev;
|
1049
1049
|
}
|
1050
1050
|
}
|
1051
|
-
function
|
1052
|
-
|
1051
|
+
function _var(parentScopeId, scopeOffsetAccessor, childScopeId, registryId) {
|
1052
|
+
_scope_with_id(parentScopeId)[scopeOffsetAccessor] = _scope_id(), _scope_with_id(childScopeId).e = _resume(
|
1053
1053
|
{},
|
1054
1054
|
registryId,
|
1055
1055
|
parentScopeId
|
1056
1056
|
);
|
1057
1057
|
}
|
1058
|
-
function
|
1059
|
-
return scopeId === void 0 ? register(id, val) : register(id, val,
|
1058
|
+
function _resume(val, id, scopeId) {
|
1059
|
+
return scopeId === void 0 ? register(id, val) : register(id, val, _scope_with_id(scopeId));
|
1060
1060
|
}
|
1061
|
-
function
|
1061
|
+
function _id() {
|
1062
1062
|
let state = $chunk.boundary.state, { $global: $global2 } = state;
|
1063
1063
|
return "s" + $global2.runtimeId + $global2.renderId + (state.tagId++).toString(36);
|
1064
1064
|
}
|
1065
|
-
function
|
1065
|
+
function _scope_id() {
|
1066
1066
|
return $chunk.boundary.state.scopeId++;
|
1067
1067
|
}
|
1068
|
-
function
|
1068
|
+
function _peek_scope_id() {
|
1069
1069
|
return $chunk.boundary.state.scopeId;
|
1070
1070
|
}
|
1071
1071
|
function getScopeById(scopeId) {
|
1072
1072
|
if (scopeId !== void 0)
|
1073
1073
|
return $chunk.boundary.state.scopes.get(scopeId);
|
1074
1074
|
}
|
1075
|
-
function
|
1075
|
+
function _serialize_if(condition, key) {
|
1076
1076
|
return condition && (condition === 1 || condition[key]) ? 1 : void 0;
|
1077
1077
|
}
|
1078
|
-
function
|
1078
|
+
function _serialize_guard(condition, key) {
|
1079
1079
|
return condition && (condition === 1 || condition[key]) ? 1 : 0;
|
1080
1080
|
}
|
1081
|
-
function
|
1081
|
+
function _el_resume(scopeId, accessor, shouldResume) {
|
1082
1082
|
if (shouldResume === 0) return "";
|
1083
1083
|
let { state } = $chunk.boundary;
|
1084
1084
|
return state.needsMainRuntime = !0, state.mark("*" /* Node */, scopeId + " " + accessor);
|
1085
1085
|
}
|
1086
|
-
function
|
1086
|
+
function _sep(shouldResume) {
|
1087
1087
|
return shouldResume === 0 ? "" : "<!>";
|
1088
1088
|
}
|
1089
|
-
function
|
1089
|
+
function _el(scopeId, id) {
|
1090
1090
|
let getter = () => {
|
1091
1091
|
};
|
1092
|
-
return id ?
|
1092
|
+
return id ? _resume(getter, id, scopeId) : getter;
|
1093
1093
|
}
|
1094
|
-
function
|
1094
|
+
function _hoist(scopeId, id) {
|
1095
1095
|
let getter = () => {
|
1096
1096
|
};
|
1097
|
-
return getter[Symbol.iterator] = getter, id ?
|
1097
|
+
return getter[Symbol.iterator] = getter, id ? _resume(getter, id, scopeId) : getter;
|
1098
1098
|
}
|
1099
|
-
function
|
1099
|
+
function _resume_branch(scopeId) {
|
1100
1100
|
let branchId = $chunk.context?.[branchIdKey];
|
1101
1101
|
branchId !== void 0 && branchId !== scopeId && writeScope(scopeId, { g: branchId });
|
1102
1102
|
}
|
@@ -1107,12 +1107,12 @@ function isInResumedBranch() {
|
|
1107
1107
|
function withBranchId(branchId, cb) {
|
1108
1108
|
return withContext(branchIdKey, branchId, cb);
|
1109
1109
|
}
|
1110
|
-
function
|
1110
|
+
function _for_of(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
|
1111
1111
|
let { state } = $chunk.boundary, resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, singleNodeBranchIds = "";
|
1112
1112
|
if (resumeBranch) {
|
1113
1113
|
let loopScopes = /* @__PURE__ */ new Map();
|
1114
1114
|
forOf(list, (item, index) => {
|
1115
|
-
let branchId =
|
1115
|
+
let branchId = _peek_scope_id();
|
1116
1116
|
resumeMarker && (singleNode ? singleNodeBranchIds = " " + branchId + singleNodeBranchIds : $chunk.writeHTML(
|
1117
1117
|
state.mark("[" /* BranchStart */, branchId + (index ? " " : ""))
|
1118
1118
|
)), withBranchId(branchId, () => {
|
@@ -1134,12 +1134,12 @@ function resumeForOf(list, cb, by, scopeId, accessor, serializeBranch, serialize
|
|
1134
1134
|
) : state.mark("]" /* BranchEnd */, scopeId + " " + accessor))
|
1135
1135
|
);
|
1136
1136
|
}
|
1137
|
-
function
|
1137
|
+
function _for_in(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
|
1138
1138
|
let { state } = $chunk.boundary, resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, singleNodeBranchIds = "";
|
1139
1139
|
if (resumeBranch) {
|
1140
1140
|
let loopScopes = /* @__PURE__ */ new Map(), sep = "";
|
1141
1141
|
forIn(obj, (key, value) => {
|
1142
|
-
let branchId =
|
1142
|
+
let branchId = _peek_scope_id();
|
1143
1143
|
resumeMarker && (singleNode ? singleNodeBranchIds = " " + branchId + singleNodeBranchIds : ($chunk.writeHTML(
|
1144
1144
|
state.mark("[" /* BranchStart */, branchId + sep)
|
1145
1145
|
), sep = " ")), withBranchId(branchId, () => {
|
@@ -1161,12 +1161,12 @@ function resumeForIn(obj, cb, by, scopeId, accessor, serializeBranch, serializeM
|
|
1161
1161
|
) : state.mark("]" /* BranchEnd */, scopeId + " " + accessor))
|
1162
1162
|
);
|
1163
1163
|
}
|
1164
|
-
function
|
1164
|
+
function _for_to(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
|
1165
1165
|
let { state } = $chunk.boundary, resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, singleNodeBranchIds = "";
|
1166
1166
|
if (resumeBranch) {
|
1167
1167
|
let loopScopes = /* @__PURE__ */ new Map(), sep = "";
|
1168
1168
|
forTo(to, from, step, (i) => {
|
1169
|
-
let branchId =
|
1169
|
+
let branchId = _peek_scope_id();
|
1170
1170
|
resumeMarker && (singleNode ? singleNodeBranchIds = " " + branchId + singleNodeBranchIds : ($chunk.writeHTML(
|
1171
1171
|
state.mark("[" /* BranchStart */, branchId + sep)
|
1172
1172
|
), sep = " ")), withBranchId(branchId, () => {
|
@@ -1188,8 +1188,8 @@ function resumeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch,
|
|
1188
1188
|
) : state.mark("]" /* BranchEnd */, scopeId + " " + accessor))
|
1189
1189
|
);
|
1190
1190
|
}
|
1191
|
-
function
|
1192
|
-
let { state } = $chunk.boundary, resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, branchId =
|
1191
|
+
function _if(cb, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag, singleNode) {
|
1192
|
+
let { state } = $chunk.boundary, resumeBranch = serializeBranch !== 0, resumeMarker = serializeMarker !== 0, branchId = _peek_scope_id();
|
1193
1193
|
resumeMarker && resumeBranch && !singleNode && $chunk.writeHTML(state.mark("[" /* BranchStart */, branchId + ""));
|
1194
1194
|
let branchIndex = resumeBranch ? withBranchId(branchId, cb) : cb(), shouldWriteBranch = resumeBranch && branchIndex !== void 0;
|
1195
1195
|
shouldWriteBranch && writeScope(scopeId, {
|
@@ -1208,28 +1208,28 @@ function resumeConditional(cb, scopeId, accessor, serializeBranch, serializeMark
|
|
1208
1208
|
}
|
1209
1209
|
function writeBranchEnd(scopeId, accessor, resumeMarker, parentEndTag, mark) {
|
1210
1210
|
let endTag = parentEndTag || "";
|
1211
|
-
resumeMarker ? mark ? $chunk.writeHTML(mark + endTag) : $chunk.writeHTML(endTag +
|
1211
|
+
resumeMarker ? mark ? $chunk.writeHTML(mark + endTag) : $chunk.writeHTML(endTag + _el_resume(scopeId, accessor)) : $chunk.writeHTML(endTag);
|
1212
1212
|
}
|
1213
1213
|
var writeScope = (scopeId, partialScope) => writeScopeToState($chunk.boundary.state, scopeId, partialScope);
|
1214
1214
|
function writeScopeToState(state, scopeId, partialScope) {
|
1215
1215
|
let { scopes } = state, scope = scopes.get(scopeId);
|
1216
1216
|
return state.needsMainRuntime = !0, scope ? Object.assign(scope, partialScope) : (scope = partialScope, scope[K_SCOPE_ID] = scopeId, state.scopes.set(scopeId, scope)), state.writeScopes ? state.writeScopes[scopeId] = scope : state.writeScopes = { [scopeId]: scope }, scope;
|
1217
1217
|
}
|
1218
|
-
function
|
1219
|
-
return writeScope(scopeId,
|
1218
|
+
function _existing_scope(scopeId) {
|
1219
|
+
return writeScope(scopeId, _scope_with_id(scopeId));
|
1220
1220
|
}
|
1221
|
-
function
|
1221
|
+
function _scope_with_id(scopeId) {
|
1222
1222
|
let { state } = $chunk.boundary, scope = state.scopes.get(scopeId);
|
1223
1223
|
return scope || (scope = { [K_SCOPE_ID]: scopeId }, state.scopes.set(scopeId, scope)), scope;
|
1224
1224
|
}
|
1225
1225
|
function $global() {
|
1226
1226
|
return $chunk.boundary.state.$global;
|
1227
1227
|
}
|
1228
|
-
function
|
1228
|
+
function _await(scopeId, accessor, promise, content, serializeMarker) {
|
1229
1229
|
let resumeMarker = serializeMarker !== 0;
|
1230
1230
|
if (!isPromise(promise)) {
|
1231
1231
|
if (resumeMarker) {
|
1232
|
-
let branchId =
|
1232
|
+
let branchId = _peek_scope_id();
|
1233
1233
|
$chunk.writeHTML(
|
1234
1234
|
$chunk.boundary.state.mark("[" /* BranchStart */, branchId + "")
|
1235
1235
|
), content(promise), writeScope(scopeId, {
|
@@ -1249,7 +1249,7 @@ function fork(scopeId, accessor, promise, content, serializeMarker) {
|
|
1249
1249
|
(value) => {
|
1250
1250
|
chunk.async && (chunk.async = !1, boundary.signal.aborted || (chunk.render(() => {
|
1251
1251
|
if (resumeMarker) {
|
1252
|
-
let branchId =
|
1252
|
+
let branchId = _peek_scope_id();
|
1253
1253
|
$chunk.writeHTML(
|
1254
1254
|
$chunk.boundary.state.mark(
|
1255
1255
|
"[" /* BranchStart */,
|
@@ -1257,7 +1257,7 @@ function fork(scopeId, accessor, promise, content, serializeMarker) {
|
|
1257
1257
|
)
|
1258
1258
|
), content(value), boundary.state.serializer.writeAssign(
|
1259
1259
|
writeScope(branchId, {}),
|
1260
|
-
|
1260
|
+
_scope_with_id(scopeId),
|
1261
1261
|
"d" /* ConditionalScope */ + accessor
|
1262
1262
|
), $chunk.writeHTML(
|
1263
1263
|
$chunk.boundary.state.mark(
|
@@ -1274,8 +1274,8 @@ function fork(scopeId, accessor, promise, content, serializeMarker) {
|
|
1274
1274
|
}
|
1275
1275
|
);
|
1276
1276
|
}
|
1277
|
-
function
|
1278
|
-
let branchId =
|
1277
|
+
function _try(scopeId, accessor, content, input) {
|
1278
|
+
let branchId = _peek_scope_id();
|
1279
1279
|
$chunk.writeHTML(
|
1280
1280
|
$chunk.boundary.state.mark("[" /* BranchStart */, branchId + "")
|
1281
1281
|
);
|
@@ -1526,7 +1526,7 @@ function flushSerializer(boundary) {
|
|
1526
1526
|
), state.lastSerializedScopeId = lastSerializedScopeId, state.writeScopes = null, flushed && (state.walkOnNextFlush = !0);
|
1527
1527
|
}
|
1528
1528
|
}
|
1529
|
-
function
|
1529
|
+
function _trailers(html) {
|
1530
1530
|
$chunk.boundary.state.trailerHTML += html;
|
1531
1531
|
}
|
1532
1532
|
function concatEffects(a, b) {
|
@@ -1569,23 +1569,23 @@ function getFilteredGlobals($global2) {
|
|
1569
1569
|
}
|
1570
1570
|
return filtered;
|
1571
1571
|
}
|
1572
|
-
function
|
1572
|
+
function _subscribe(subscribers, scope) {
|
1573
1573
|
return $chunk.boundary.state.serializer.writeCall(scope, subscribers, "add"), scope;
|
1574
1574
|
}
|
1575
1575
|
|
1576
1576
|
// src/html/attrs.ts
|
1577
|
-
function
|
1577
|
+
function _attr_class(value) {
|
1578
1578
|
return stringAttr("class", classValue(value));
|
1579
1579
|
}
|
1580
|
-
function
|
1580
|
+
function _attr_style(value) {
|
1581
1581
|
return stringAttr("style", styleValue(value));
|
1582
1582
|
}
|
1583
|
-
function
|
1583
|
+
function _attr_option_value(value) {
|
1584
1584
|
let selectedValue = getContext(kSelectedValue);
|
1585
|
-
return
|
1585
|
+
return _attr("value", value) + (!isVoid(value) && (Array.isArray(selectedValue) ? selectedValue.includes(value) : selectedValue === value) ? " selected" : "");
|
1586
1586
|
}
|
1587
1587
|
var kSelectedValue = Symbol("selectedValue");
|
1588
|
-
function
|
1588
|
+
function _attr_select_value(scopeId, nodeAccessor, value, valueChange, content) {
|
1589
1589
|
valueChange && writeControlledScope(
|
1590
1590
|
3 /* SelectValue */,
|
1591
1591
|
scopeId,
|
@@ -1594,7 +1594,7 @@ function controllable_select_value(scopeId, nodeAccessor, value, valueChange, co
|
|
1594
1594
|
valueChange
|
1595
1595
|
), content && withContext(kSelectedValue, value, content);
|
1596
1596
|
}
|
1597
|
-
function
|
1597
|
+
function _attr_textarea_value(scopeId, nodeAccessor, value, valueChange) {
|
1598
1598
|
return valueChange && writeControlledScope(
|
1599
1599
|
2 /* InputValue */,
|
1600
1600
|
scopeId,
|
@@ -1603,26 +1603,26 @@ function controllable_textarea_value(scopeId, nodeAccessor, value, valueChange)
|
|
1603
1603
|
valueChange
|
1604
1604
|
), escapeTextAreaValue(value);
|
1605
1605
|
}
|
1606
|
-
function
|
1606
|
+
function _attr_input_value(scopeId, nodeAccessor, value, valueChange) {
|
1607
1607
|
return valueChange && writeControlledScope(
|
1608
1608
|
2 /* InputValue */,
|
1609
1609
|
scopeId,
|
1610
1610
|
nodeAccessor,
|
1611
1611
|
void 0,
|
1612
1612
|
valueChange
|
1613
|
-
),
|
1613
|
+
), _attr("value", value);
|
1614
1614
|
}
|
1615
|
-
function
|
1615
|
+
function _attr_input_checked(scopeId, nodeAccessor, checked, checkedChange) {
|
1616
1616
|
return checkedChange && writeControlledScope(
|
1617
1617
|
0 /* InputChecked */,
|
1618
1618
|
scopeId,
|
1619
1619
|
nodeAccessor,
|
1620
1620
|
void 0,
|
1621
1621
|
checkedChange
|
1622
|
-
),
|
1622
|
+
), _attr("checked", checked);
|
1623
1623
|
}
|
1624
|
-
function
|
1625
|
-
let multiple = Array.isArray(checkedValue), valueAttr =
|
1624
|
+
function _attr_input_checkedValue(scopeId, nodeAccessor, checkedValue, checkedValueChange, value) {
|
1625
|
+
let multiple = Array.isArray(checkedValue), valueAttr = _attr("value", value);
|
1626
1626
|
return checkedValueChange && writeControlledScope(
|
1627
1627
|
1 /* InputCheckedValue */,
|
1628
1628
|
scopeId,
|
@@ -1631,31 +1631,31 @@ function controllable_input_checkedValue(scopeId, nodeAccessor, checkedValue, ch
|
|
1631
1631
|
checkedValueChange
|
1632
1632
|
), (multiple ? checkedValue.includes(value) : checkedValue === value) ? valueAttr + " checked" : valueAttr;
|
1633
1633
|
}
|
1634
|
-
function
|
1634
|
+
function _attr_details_or_dialog_open(scopeId, nodeAccessor, open, openChange) {
|
1635
1635
|
return openChange && writeControlledScope(
|
1636
1636
|
4 /* DetailsOrDialogOpen */,
|
1637
1637
|
scopeId,
|
1638
1638
|
nodeAccessor,
|
1639
1639
|
open,
|
1640
1640
|
openChange
|
1641
|
-
),
|
1641
|
+
), _attr("open", open);
|
1642
1642
|
}
|
1643
|
-
function
|
1643
|
+
function _attr(name, value) {
|
1644
1644
|
return isVoid(value) ? "" : nonVoidAttr(name, value);
|
1645
1645
|
}
|
1646
|
-
function
|
1646
|
+
function _attrs(data, nodeAccessor, scopeId, tagName) {
|
1647
1647
|
let result = "", skip = /[\s/>"'=]/, events;
|
1648
1648
|
switch (tagName) {
|
1649
1649
|
case "input":
|
1650
1650
|
if (data.checkedChange)
|
1651
|
-
result +=
|
1651
|
+
result += _attr_input_checked(
|
1652
1652
|
scopeId,
|
1653
1653
|
nodeAccessor,
|
1654
1654
|
data.checked,
|
1655
1655
|
data.checkedChange
|
1656
1656
|
);
|
1657
1657
|
else if (data.checkedValue || data.checkedValueChange)
|
1658
|
-
result +=
|
1658
|
+
result += _attr_input_checkedValue(
|
1659
1659
|
scopeId,
|
1660
1660
|
nodeAccessor,
|
1661
1661
|
data.checkedValue,
|
@@ -1663,7 +1663,7 @@ function attrs(data, nodeAccessor, scopeId, tagName) {
|
|
1663
1663
|
data.value
|
1664
1664
|
);
|
1665
1665
|
else if (data.valueChange)
|
1666
|
-
result +=
|
1666
|
+
result += _attr_input_value(
|
1667
1667
|
scopeId,
|
1668
1668
|
nodeAccessor,
|
1669
1669
|
data.value,
|
@@ -1678,11 +1678,11 @@ function attrs(data, nodeAccessor, scopeId, tagName) {
|
|
1678
1678
|
(data.value || data.valueChange) && (skip = /^value(?:Change)?$|[\s/>"'=]/);
|
1679
1679
|
break;
|
1680
1680
|
case "option":
|
1681
|
-
data.value && (result +=
|
1681
|
+
data.value && (result += _attr_option_value(data.value), skip = /^value$|[\s/>"'=]/);
|
1682
1682
|
break;
|
1683
1683
|
case "details":
|
1684
1684
|
case "dialog":
|
1685
|
-
data.openChange && (result +=
|
1685
|
+
data.openChange && (result += _attr_details_or_dialog_open(
|
1686
1686
|
scopeId,
|
1687
1687
|
nodeAccessor,
|
1688
1688
|
data.open,
|
@@ -1694,10 +1694,10 @@ function attrs(data, nodeAccessor, scopeId, tagName) {
|
|
1694
1694
|
let value = data[name];
|
1695
1695
|
switch (name) {
|
1696
1696
|
case "class":
|
1697
|
-
result +=
|
1697
|
+
result += _attr_class(value);
|
1698
1698
|
break;
|
1699
1699
|
case "style":
|
1700
|
-
result +=
|
1700
|
+
result += _attr_style(value);
|
1701
1701
|
break;
|
1702
1702
|
default:
|
1703
1703
|
name && !(isVoid(value) || skip.test(name) || name === "content" && tagName !== "meta") && (isEventHandler(name) ? (events || (events = {}, writeScope(scopeId, {
|
@@ -1708,17 +1708,17 @@ function attrs(data, nodeAccessor, scopeId, tagName) {
|
|
1708
1708
|
}
|
1709
1709
|
return result;
|
1710
1710
|
}
|
1711
|
-
function
|
1712
|
-
|
1711
|
+
function _attrs_content(data, nodeAccessor, scopeId, tagName, serializeReason) {
|
1712
|
+
_html(`${_attrs(data, nodeAccessor, scopeId, tagName)}>`), _attr_content(nodeAccessor, scopeId, data?.content, serializeReason);
|
1713
1713
|
}
|
1714
|
-
function
|
1714
|
+
function _attrs_partial(data, skip, nodeAccessor, scopeId, tagName) {
|
1715
1715
|
let partial = {};
|
1716
1716
|
for (let key in data)
|
1717
1717
|
skip[key] || (partial[key] = data[key]);
|
1718
|
-
return
|
1718
|
+
return _attrs(partial, nodeAccessor, scopeId, tagName);
|
1719
1719
|
}
|
1720
|
-
function
|
1721
|
-
|
1720
|
+
function _attrs_partial_content(data, skip, nodeAccessor, scopeId, tagName, serializeReason) {
|
1721
|
+
_html(`${_attrs_partial(data, skip, nodeAccessor, scopeId, tagName)}>`), _attr_content(nodeAccessor, scopeId, data?.content, serializeReason);
|
1722
1722
|
}
|
1723
1723
|
function writeControlledScope(type, scopeId, nodeAccessor, value, valueChange) {
|
1724
1724
|
writeScope(scopeId, {
|
@@ -1772,7 +1772,7 @@ function replaceUnsafeDoubleQuoteAttrChar(match) {
|
|
1772
1772
|
var RENDERER_REGISTER_ID = "$C_r", SET_SCOPE_REGISTER_ID = "$C_s", RENDER_BODY_ID = "$C_b";
|
1773
1773
|
|
1774
1774
|
// src/html/template.ts
|
1775
|
-
var
|
1775
|
+
var _template = (templateId, renderer) => (renderer.render = render, renderer._ = renderer, _content_resume(templateId, renderer));
|
1776
1776
|
function isTemplate(renderer) {
|
1777
1777
|
return !!renderer._;
|
1778
1778
|
}
|
@@ -1890,12 +1890,12 @@ var ServerRendered = class {
|
|
1890
1890
|
onAbort(new Error("Cannot read from a consumed render result"));
|
1891
1891
|
return;
|
1892
1892
|
}
|
1893
|
-
let { boundary } = head, onNext = boundary.onNext = (
|
1893
|
+
let { boundary } = head, onNext = boundary.onNext = (write) => {
|
1894
1894
|
if (boundary.signal.aborted)
|
1895
1895
|
tick2 || offTick(onNext), boundary.onNext = NOOP2, onAbort(boundary.signal.reason);
|
1896
1896
|
else {
|
1897
1897
|
let { done } = boundary;
|
1898
|
-
if (done ||
|
1898
|
+
if (done || write) {
|
1899
1899
|
let html = (head = head.consume()).flushHTML();
|
1900
1900
|
html && onWrite(html), done ? (tick2 || offTick(onNext), onClose()) : tick2 = !0;
|
1901
1901
|
} else tick2 && (tick2 = !1, queueTick(onNext));
|
@@ -1917,17 +1917,17 @@ function NOOP2() {
|
|
1917
1917
|
}
|
1918
1918
|
|
1919
1919
|
// src/html/dynamic-tag.ts
|
1920
|
-
var voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|param|source|track|wbr)$/,
|
1921
|
-
let shouldResume = serializeReason !== 0, renderer = normalizeDynamicRenderer(tag), state = getState(), branchId =
|
1920
|
+
var voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|param|source|track|wbr)$/, _dynamic_tag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, serializeReason) => {
|
1921
|
+
let shouldResume = serializeReason !== 0, renderer = normalizeDynamicRenderer(tag), state = getState(), branchId = _peek_scope_id(), result;
|
1922
1922
|
if (typeof renderer == "string") {
|
1923
1923
|
let input = (inputIsArgs ? inputOrArgs[0] : inputOrArgs) || {};
|
1924
|
-
if (
|
1925
|
-
`<${renderer}${
|
1924
|
+
if (_scope_id(), _html(
|
1925
|
+
`<${renderer}${_attrs(input, 0, branchId, renderer)}>`
|
1926
1926
|
), !voidElementsReg.test(renderer)) {
|
1927
1927
|
let renderContent = content || normalizeDynamicRenderer(input.content);
|
1928
1928
|
if (renderer === "textarea")
|
1929
|
-
|
1930
|
-
|
1929
|
+
_html(
|
1930
|
+
_attr_textarea_value(
|
1931
1931
|
branchId,
|
1932
1932
|
0,
|
1933
1933
|
input.value,
|
@@ -1939,13 +1939,13 @@ var voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|p
|
|
1939
1939
|
throw new Error(
|
1940
1940
|
`Body content is not supported for the \`<${renderer}>\` tag.`
|
1941
1941
|
);
|
1942
|
-
renderer === "select" && ("value" in input || "valueChange" in input) ?
|
1942
|
+
renderer === "select" && ("value" in input || "valueChange" in input) ? _attr_select_value(
|
1943
1943
|
branchId,
|
1944
1944
|
0,
|
1945
1945
|
input.value,
|
1946
1946
|
input.valueChange,
|
1947
1947
|
renderContent
|
1948
|
-
) :
|
1948
|
+
) : _dynamic_tag(
|
1949
1949
|
branchId,
|
1950
1950
|
0,
|
1951
1951
|
renderContent,
|
@@ -1955,16 +1955,16 @@ var voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|p
|
|
1955
1955
|
serializeReason
|
1956
1956
|
);
|
1957
1957
|
}
|
1958
|
-
|
1958
|
+
_html(`</${renderer}>`);
|
1959
1959
|
}
|
1960
|
-
shouldResume &&
|
1960
|
+
shouldResume && _html(
|
1961
1961
|
state.mark(
|
1962
1962
|
"'" /* BranchNativeTag */,
|
1963
1963
|
scopeId + " " + accessor + " " + branchId
|
1964
1964
|
)
|
1965
1965
|
);
|
1966
1966
|
} else {
|
1967
|
-
shouldResume &&
|
1967
|
+
shouldResume && _html(state.mark("[" /* BranchStart */, branchId + ""));
|
1968
1968
|
let render2 = () => {
|
1969
1969
|
if (renderer) {
|
1970
1970
|
if (isTemplate(renderer)) {
|
@@ -1980,21 +1980,21 @@ var voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|p
|
|
1980
1980
|
} else if (content)
|
1981
1981
|
return content();
|
1982
1982
|
};
|
1983
|
-
result = shouldResume ? withBranchId(branchId, render2) : render2(), shouldResume &&
|
1983
|
+
result = shouldResume ? withBranchId(branchId, render2) : render2(), shouldResume && _html(state.mark("]" /* BranchEnd */, scopeId + " " + accessor));
|
1984
1984
|
}
|
1985
|
-
return
|
1985
|
+
return _peek_scope_id() !== branchId ? shouldResume && writeScope(scopeId, {
|
1986
1986
|
["d" /* ConditionalScope */ + accessor]: writeScope(branchId, {}),
|
1987
1987
|
["c" /* ConditionalRenderer */ + accessor]: renderer?.h || renderer
|
1988
|
-
}) :
|
1988
|
+
}) : _scope_id(), result;
|
1989
1989
|
};
|
1990
|
-
function
|
1990
|
+
function _content(id, fn) {
|
1991
1991
|
return fn.h = id, fn;
|
1992
1992
|
}
|
1993
|
-
function
|
1994
|
-
return
|
1993
|
+
function _content_resume(id, fn, scopeId) {
|
1994
|
+
return _resume(_content(id, fn), id, scopeId);
|
1995
1995
|
}
|
1996
1996
|
function patchDynamicTag(patch) {
|
1997
|
-
|
1997
|
+
_dynamic_tag = /* @__PURE__ */ ((originalDynamicTag) => (scopeId, accessor, tag, input, content, inputIsArgs, resume) => {
|
1998
1998
|
let patched = patch(scopeId, accessor, tag);
|
1999
1999
|
return patched !== tag && (patched.h = tag), originalDynamicTag(
|
2000
2000
|
scopeId,
|
@@ -2005,17 +2005,17 @@ function patchDynamicTag(patch) {
|
|
2005
2005
|
inputIsArgs,
|
2006
2006
|
resume
|
2007
2007
|
);
|
2008
|
-
})(
|
2008
|
+
})(_dynamic_tag);
|
2009
2009
|
}
|
2010
2010
|
|
2011
2011
|
// src/html/compat.ts
|
2012
2012
|
var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap(), compat = {
|
2013
2013
|
$global,
|
2014
|
-
fork,
|
2015
|
-
write,
|
2014
|
+
fork: _await,
|
2015
|
+
write: _html,
|
2016
2016
|
writeScript,
|
2017
|
-
nextScopeId,
|
2018
|
-
peekNextScopeId,
|
2017
|
+
nextScopeId: _scope_id,
|
2018
|
+
peekNextScopeId: _peek_scope_id,
|
2019
2019
|
isInResumedBranch,
|
2020
2020
|
ensureState($global2) {
|
2021
2021
|
let state = $global2[K_TAGS_API_STATE] ||= getChunk()?.boundary.state;
|
@@ -2032,7 +2032,7 @@ var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap()
|
|
2032
2032
|
},
|
2033
2033
|
patchDynamicTag,
|
2034
2034
|
writeSetScopeForComponent(branchId, m5c) {
|
2035
|
-
writeScope(branchId, { m5c }),
|
2035
|
+
writeScope(branchId, { m5c }), _script(branchId, SET_SCOPE_REGISTER_ID);
|
2036
2036
|
},
|
2037
2037
|
toJSON(state) {
|
2038
2038
|
return function() {
|
@@ -2071,8 +2071,8 @@ var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap()
|
|
2071
2071
|
}
|
2072
2072
|
head.render(() => {
|
2073
2073
|
if (willRerender) {
|
2074
|
-
let scopeId =
|
2075
|
-
writeScope(scopeId, { m5c: component.id }),
|
2074
|
+
let scopeId = _peek_scope_id();
|
2075
|
+
writeScope(scopeId, { m5c: component.id }), _script(scopeId, SET_SCOPE_REGISTER_ID);
|
2076
2076
|
}
|
2077
2077
|
isTemplate(renderer) && willRerender ? renderer(normalizedInput, 1) : renderer(normalizedInput);
|
2078
2078
|
let asyncOut = classAPIOut.beginAsync();
|
@@ -2097,62 +2097,62 @@ function NOOP3() {
|
|
2097
2097
|
}
|
2098
2098
|
export {
|
2099
2099
|
$global,
|
2100
|
-
|
2100
|
+
_attr,
|
2101
|
+
_attr_class,
|
2102
|
+
_attr_content,
|
2103
|
+
_attr_details_or_dialog_open as _attr_details_open,
|
2104
|
+
_attr_details_or_dialog_open as _attr_dialog_open,
|
2105
|
+
_attr_input_checked,
|
2106
|
+
_attr_input_checkedValue,
|
2107
|
+
_attr_input_value,
|
2108
|
+
_attr_option_value,
|
2109
|
+
_attr_select_value,
|
2110
|
+
_attr_style,
|
2111
|
+
_attr_textarea_value,
|
2112
|
+
_attrs,
|
2113
|
+
_attrs_content,
|
2114
|
+
_attrs_partial,
|
2115
|
+
_attrs_partial_content,
|
2116
|
+
_await,
|
2117
|
+
_content,
|
2118
|
+
_content_resume,
|
2119
|
+
_dynamic_tag,
|
2120
|
+
_el,
|
2121
|
+
_el_resume,
|
2122
|
+
_escape,
|
2123
|
+
_escape_script,
|
2124
|
+
_escape_style,
|
2125
|
+
_existing_scope,
|
2126
|
+
_for_in,
|
2127
|
+
_for_of,
|
2128
|
+
_for_to,
|
2129
|
+
_hoist,
|
2130
|
+
_html,
|
2131
|
+
_id,
|
2132
|
+
_if,
|
2133
|
+
_peek_scope_id,
|
2134
|
+
_resume,
|
2135
|
+
_resume_branch,
|
2136
|
+
writeScope as _scope,
|
2137
|
+
_scope_id,
|
2138
|
+
_scope_with_id,
|
2139
|
+
_script,
|
2140
|
+
_sep,
|
2141
|
+
_serialize_guard,
|
2142
|
+
_serialize_if,
|
2143
|
+
_subscribe,
|
2144
|
+
_template,
|
2145
|
+
_trailers,
|
2146
|
+
_try,
|
2147
|
+
_unescaped,
|
2148
|
+
_var,
|
2101
2149
|
attrTag,
|
2102
2150
|
attrTags,
|
2103
|
-
attrs,
|
2104
|
-
classAttr,
|
2105
|
-
commentSeparator,
|
2106
2151
|
compat,
|
2107
|
-
controllable_detailsOrDialog_open,
|
2108
|
-
controllable_input_checked,
|
2109
|
-
controllable_input_checkedValue,
|
2110
|
-
controllable_input_value,
|
2111
|
-
controllable_select_value,
|
2112
|
-
controllable_textarea_value,
|
2113
|
-
createContent,
|
2114
|
-
createTemplate,
|
2115
|
-
dynamicTag,
|
2116
|
-
ensureScopeWithId,
|
2117
|
-
escapeScript,
|
2118
|
-
escapeStyle,
|
2119
|
-
escapeXML,
|
2120
2152
|
forIn,
|
2121
2153
|
forInBy,
|
2122
2154
|
forOf,
|
2123
2155
|
forOfBy,
|
2124
2156
|
forTo,
|
2125
|
-
forToBy
|
2126
|
-
fork,
|
2127
|
-
getScopeById,
|
2128
|
-
hoist,
|
2129
|
-
markResumeNode,
|
2130
|
-
nextScopeId,
|
2131
|
-
nextTagId,
|
2132
|
-
nodeRef,
|
2133
|
-
optionValueAttr,
|
2134
|
-
partialAttrs,
|
2135
|
-
peekNextScopeId,
|
2136
|
-
register2 as register,
|
2137
|
-
registerContent,
|
2138
|
-
resumeClosestBranch,
|
2139
|
-
resumeConditional,
|
2140
|
-
resumeForIn,
|
2141
|
-
resumeForOf,
|
2142
|
-
resumeForTo,
|
2143
|
-
serializeGuard,
|
2144
|
-
serializeIf,
|
2145
|
-
setTagVar,
|
2146
|
-
styleAttr,
|
2147
|
-
toString,
|
2148
|
-
tryContent,
|
2149
|
-
write,
|
2150
|
-
writeAttrsAndContent,
|
2151
|
-
writeContent,
|
2152
|
-
writeEffect,
|
2153
|
-
writeExistingScope,
|
2154
|
-
writePartialAttrsAndContent,
|
2155
|
-
writeScope,
|
2156
|
-
writeSubscribe,
|
2157
|
-
writeTrailers
|
2157
|
+
forToBy
|
2158
2158
|
};
|