@marko/runtime-tags 6.3.6 → 6.3.8
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 +3 -2
- package/dist/debug/dom.mjs +3 -2
- package/dist/debug/html.js +32 -15
- package/dist/debug/html.mjs +32 -15
- package/dist/dom.js +2 -2
- package/dist/dom.mjs +2 -2
- package/dist/html.js +23 -8
- package/dist/html.mjs +23 -8
- package/dist/translator/index.js +2 -2
- package/package.json +2 -2
package/dist/debug/dom.js
CHANGED
|
@@ -974,10 +974,11 @@ function _attr_input_checkedValue_script(scope, nodeAccessor) {
|
|
|
974
974
|
syncControllableFormInput(el, hasCheckboxChanged, () => {
|
|
975
975
|
const checkedValueChange = scope["ControlledHandler:" + nodeAccessor];
|
|
976
976
|
if (checkedValueChange) {
|
|
977
|
-
const
|
|
977
|
+
const controlledValueKey = "ControlledValue:" + nodeAccessor;
|
|
978
|
+
const oldValue = scope[controlledValueKey];
|
|
978
979
|
const newValue = Array.isArray(oldValue) ? updateList(oldValue, el.value, el.checked) : el.checked ? el.value : void 0;
|
|
979
980
|
if (el.name && el.type[0] === "r") {
|
|
980
|
-
for (const radio of document.querySelectorAll(`[type=radio][name=${CSS.escape(el.name)}]`)) if (radio.form === el.form) radio.checked = Array.isArray(oldValue) ? oldValue.includes(radio.value) : oldValue === radio.value;
|
|
981
|
+
for (const radio of document.querySelectorAll(`[type=radio][name=${CSS.escape(el.name)}]`)) if (radio.form === el.form) radio.checked = Array.isArray(oldValue) ? oldValue.includes(radio.value) : controlledValueKey in scope ? oldValue === radio.value : radio.defaultChecked;
|
|
981
982
|
} else el.checked = !el.checked;
|
|
982
983
|
checkedValueChange(newValue);
|
|
983
984
|
run();
|
package/dist/debug/dom.mjs
CHANGED
|
@@ -972,10 +972,11 @@ function _attr_input_checkedValue_script(scope, nodeAccessor) {
|
|
|
972
972
|
syncControllableFormInput(el, hasCheckboxChanged, () => {
|
|
973
973
|
const checkedValueChange = scope["ControlledHandler:" + nodeAccessor];
|
|
974
974
|
if (checkedValueChange) {
|
|
975
|
-
const
|
|
975
|
+
const controlledValueKey = "ControlledValue:" + nodeAccessor;
|
|
976
|
+
const oldValue = scope[controlledValueKey];
|
|
976
977
|
const newValue = Array.isArray(oldValue) ? updateList(oldValue, el.value, el.checked) : el.checked ? el.value : void 0;
|
|
977
978
|
if (el.name && el.type[0] === "r") {
|
|
978
|
-
for (const radio of document.querySelectorAll(`[type=radio][name=${CSS.escape(el.name)}]`)) if (radio.form === el.form) radio.checked = Array.isArray(oldValue) ? oldValue.includes(radio.value) : oldValue === radio.value;
|
|
979
|
+
for (const radio of document.querySelectorAll(`[type=radio][name=${CSS.escape(el.name)}]`)) if (radio.form === el.form) radio.checked = Array.isArray(oldValue) ? oldValue.includes(radio.value) : controlledValueKey in scope ? oldValue === radio.value : radio.defaultChecked;
|
|
979
980
|
} else el.checked = !el.checked;
|
|
980
981
|
checkedValueChange(newValue);
|
|
981
982
|
run();
|
package/dist/debug/html.js
CHANGED
|
@@ -1174,25 +1174,39 @@ function writeGenerator(state, iter, ref) {
|
|
|
1174
1174
|
state.buf.push("(function*(){}())");
|
|
1175
1175
|
return true;
|
|
1176
1176
|
}
|
|
1177
|
-
|
|
1178
|
-
|
|
1177
|
+
const yields = [];
|
|
1178
|
+
let returnValue;
|
|
1179
|
+
let needsId;
|
|
1179
1180
|
while (true) {
|
|
1180
1181
|
const { value, done } = iter.next();
|
|
1181
1182
|
if (done) {
|
|
1182
|
-
|
|
1183
|
-
state.buf.push(sep + "return ");
|
|
1184
|
-
writeProp(state, value, ref, "");
|
|
1185
|
-
}
|
|
1183
|
+
returnValue = value;
|
|
1186
1184
|
break;
|
|
1187
1185
|
}
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1186
|
+
needsId ||= isDedupedMember(value);
|
|
1187
|
+
yields.push(value);
|
|
1188
|
+
}
|
|
1189
|
+
if (returnValue === void 0 && !yields.length) {
|
|
1190
|
+
state.buf.push("(function*(){})()");
|
|
1191
|
+
return true;
|
|
1192
|
+
}
|
|
1193
|
+
state.buf.push(returnValue === void 0 ? "(function*(a){yield*a})(" : "(function*(a,r){yield*a;return r})(");
|
|
1194
|
+
if (needsId) {
|
|
1195
|
+
const arrayRef = new Reference(ref, null, state.flush, null, nextRefAccess(state));
|
|
1196
|
+
state.buf.push(arrayRef.id + "=");
|
|
1197
|
+
writeArray(state, yields, arrayRef);
|
|
1198
|
+
} else writeArray(state, yields, new Reference(ref, null, state.flush, state.buf.length));
|
|
1199
|
+
if (returnValue !== void 0) {
|
|
1200
|
+
const sepIndex = state.buf.push(",") - 1;
|
|
1201
|
+
if (writeProp(state, returnValue, ref, "") && isDedupedMember(returnValue)) {
|
|
1202
|
+
const retRef = typeof returnValue === "string" ? state.strs.get(returnValue) : state.refs.get(returnValue);
|
|
1203
|
+
if (retRef && !retRef.id && retRef.scopeId === void 0) {
|
|
1204
|
+
retRef.id = nextRefAccess(state);
|
|
1205
|
+
state.buf[sepIndex] = "," + retRef.id + "=";
|
|
1206
|
+
}
|
|
1192
1207
|
}
|
|
1193
|
-
sep = ";";
|
|
1194
1208
|
}
|
|
1195
|
-
state.buf.push("
|
|
1209
|
+
state.buf.push(")");
|
|
1196
1210
|
return true;
|
|
1197
1211
|
}
|
|
1198
1212
|
function writeAsyncGenerator(state, iter, ref) {
|
|
@@ -1327,9 +1341,12 @@ function toObjectKey(name) {
|
|
|
1327
1341
|
const c0 = name.charCodeAt(0);
|
|
1328
1342
|
if (c0 >= 48 && c0 <= 57) if (c0 === 48) {
|
|
1329
1343
|
if (len !== 1) return quote(name, 1);
|
|
1330
|
-
} else
|
|
1331
|
-
|
|
1332
|
-
|
|
1344
|
+
} else {
|
|
1345
|
+
for (let i = 1; i < len; i++) {
|
|
1346
|
+
const c = name.charCodeAt(i);
|
|
1347
|
+
if (c < 48 || c > 57) return quote(name, i);
|
|
1348
|
+
}
|
|
1349
|
+
if (len > 15 && "" + +name !== name) return quote(name, 0);
|
|
1333
1350
|
}
|
|
1334
1351
|
else if (c0 >= 97 && c0 <= 122 || c0 >= 65 && c0 <= 90 || c0 === 95 || c0 === 36) for (let i = 1; i < len; i++) {
|
|
1335
1352
|
const c = name.charCodeAt(i);
|
package/dist/debug/html.mjs
CHANGED
|
@@ -1172,25 +1172,39 @@ function writeGenerator(state, iter, ref) {
|
|
|
1172
1172
|
state.buf.push("(function*(){}())");
|
|
1173
1173
|
return true;
|
|
1174
1174
|
}
|
|
1175
|
-
|
|
1176
|
-
|
|
1175
|
+
const yields = [];
|
|
1176
|
+
let returnValue;
|
|
1177
|
+
let needsId;
|
|
1177
1178
|
while (true) {
|
|
1178
1179
|
const { value, done } = iter.next();
|
|
1179
1180
|
if (done) {
|
|
1180
|
-
|
|
1181
|
-
state.buf.push(sep + "return ");
|
|
1182
|
-
writeProp(state, value, ref, "");
|
|
1183
|
-
}
|
|
1181
|
+
returnValue = value;
|
|
1184
1182
|
break;
|
|
1185
1183
|
}
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1184
|
+
needsId ||= isDedupedMember(value);
|
|
1185
|
+
yields.push(value);
|
|
1186
|
+
}
|
|
1187
|
+
if (returnValue === void 0 && !yields.length) {
|
|
1188
|
+
state.buf.push("(function*(){})()");
|
|
1189
|
+
return true;
|
|
1190
|
+
}
|
|
1191
|
+
state.buf.push(returnValue === void 0 ? "(function*(a){yield*a})(" : "(function*(a,r){yield*a;return r})(");
|
|
1192
|
+
if (needsId) {
|
|
1193
|
+
const arrayRef = new Reference(ref, null, state.flush, null, nextRefAccess(state));
|
|
1194
|
+
state.buf.push(arrayRef.id + "=");
|
|
1195
|
+
writeArray(state, yields, arrayRef);
|
|
1196
|
+
} else writeArray(state, yields, new Reference(ref, null, state.flush, state.buf.length));
|
|
1197
|
+
if (returnValue !== void 0) {
|
|
1198
|
+
const sepIndex = state.buf.push(",") - 1;
|
|
1199
|
+
if (writeProp(state, returnValue, ref, "") && isDedupedMember(returnValue)) {
|
|
1200
|
+
const retRef = typeof returnValue === "string" ? state.strs.get(returnValue) : state.refs.get(returnValue);
|
|
1201
|
+
if (retRef && !retRef.id && retRef.scopeId === void 0) {
|
|
1202
|
+
retRef.id = nextRefAccess(state);
|
|
1203
|
+
state.buf[sepIndex] = "," + retRef.id + "=";
|
|
1204
|
+
}
|
|
1190
1205
|
}
|
|
1191
|
-
sep = ";";
|
|
1192
1206
|
}
|
|
1193
|
-
state.buf.push("
|
|
1207
|
+
state.buf.push(")");
|
|
1194
1208
|
return true;
|
|
1195
1209
|
}
|
|
1196
1210
|
function writeAsyncGenerator(state, iter, ref) {
|
|
@@ -1325,9 +1339,12 @@ function toObjectKey(name) {
|
|
|
1325
1339
|
const c0 = name.charCodeAt(0);
|
|
1326
1340
|
if (c0 >= 48 && c0 <= 57) if (c0 === 48) {
|
|
1327
1341
|
if (len !== 1) return quote(name, 1);
|
|
1328
|
-
} else
|
|
1329
|
-
|
|
1330
|
-
|
|
1342
|
+
} else {
|
|
1343
|
+
for (let i = 1; i < len; i++) {
|
|
1344
|
+
const c = name.charCodeAt(i);
|
|
1345
|
+
if (c < 48 || c > 57) return quote(name, i);
|
|
1346
|
+
}
|
|
1347
|
+
if (len > 15 && "" + +name !== name) return quote(name, 0);
|
|
1331
1348
|
}
|
|
1332
1349
|
else if (c0 >= 97 && c0 <= 122 || c0 >= 65 && c0 <= 90 || c0 === 95 || c0 === 36) for (let i = 1; i < len; i++) {
|
|
1333
1350
|
const c = name.charCodeAt(i);
|
package/dist/dom.js
CHANGED
|
@@ -618,8 +618,8 @@ function _attr_input_checkedValue_script(scope, nodeAccessor) {
|
|
|
618
618
|
isResuming && el.defaultChecked && (scope["G" + nodeAccessor] ? scope["G" + nodeAccessor].push(el.value) : scope["G" + nodeAccessor] = el.value), syncControllableFormInput(el, hasCheckboxChanged, () => {
|
|
619
619
|
let checkedValueChange = scope["E" + nodeAccessor];
|
|
620
620
|
if (checkedValueChange) {
|
|
621
|
-
let
|
|
622
|
-
if (el.name && el.type[0] === "r") for (let radio of document.querySelectorAll(`[type=radio][name=${CSS.escape(el.name)}]`)) radio.form === el.form && (radio.checked = Array.isArray(oldValue) ? oldValue.includes(radio.value) : oldValue === radio.value);
|
|
621
|
+
let controlledValueKey = "G" + nodeAccessor, oldValue = scope[controlledValueKey], newValue = Array.isArray(oldValue) ? updateList(oldValue, el.value, el.checked) : el.checked ? el.value : void 0;
|
|
622
|
+
if (el.name && el.type[0] === "r") for (let radio of document.querySelectorAll(`[type=radio][name=${CSS.escape(el.name)}]`)) radio.form === el.form && (radio.checked = Array.isArray(oldValue) ? oldValue.includes(radio.value) : controlledValueKey in scope ? oldValue === radio.value : radio.defaultChecked);
|
|
623
623
|
else el.checked = !el.checked;
|
|
624
624
|
checkedValueChange(newValue), run();
|
|
625
625
|
}
|
package/dist/dom.mjs
CHANGED
|
@@ -617,8 +617,8 @@ function _attr_input_checkedValue_script(scope, nodeAccessor) {
|
|
|
617
617
|
isResuming && el.defaultChecked && (scope["G" + nodeAccessor] ? scope["G" + nodeAccessor].push(el.value) : scope["G" + nodeAccessor] = el.value), syncControllableFormInput(el, hasCheckboxChanged, () => {
|
|
618
618
|
let checkedValueChange = scope["E" + nodeAccessor];
|
|
619
619
|
if (checkedValueChange) {
|
|
620
|
-
let
|
|
621
|
-
if (el.name && el.type[0] === "r") for (let radio of document.querySelectorAll(`[type=radio][name=${CSS.escape(el.name)}]`)) radio.form === el.form && (radio.checked = Array.isArray(oldValue) ? oldValue.includes(radio.value) : oldValue === radio.value);
|
|
620
|
+
let controlledValueKey = "G" + nodeAccessor, oldValue = scope[controlledValueKey], newValue = Array.isArray(oldValue) ? updateList(oldValue, el.value, el.checked) : el.checked ? el.value : void 0;
|
|
621
|
+
if (el.name && el.type[0] === "r") for (let radio of document.querySelectorAll(`[type=radio][name=${CSS.escape(el.name)}]`)) radio.form === el.form && (radio.checked = Array.isArray(oldValue) ? oldValue.includes(radio.value) : controlledValueKey in scope ? oldValue === radio.value : radio.defaultChecked);
|
|
622
622
|
else el.checked = !el.checked;
|
|
623
623
|
checkedValueChange(newValue), run();
|
|
624
624
|
}
|
package/dist/html.js
CHANGED
|
@@ -823,16 +823,28 @@ function writeReadableStream(state, val, ref) {
|
|
|
823
823
|
}
|
|
824
824
|
function writeGenerator(state, iter, ref) {
|
|
825
825
|
if (iter[kTouchedIterator]) return state.buf.push("(function*(){}())"), !0;
|
|
826
|
-
let
|
|
827
|
-
for (
|
|
826
|
+
let yields = [], returnValue, needsId;
|
|
827
|
+
for (;;) {
|
|
828
828
|
let { value, done } = iter.next();
|
|
829
829
|
if (done) {
|
|
830
|
-
|
|
830
|
+
returnValue = value;
|
|
831
831
|
break;
|
|
832
832
|
}
|
|
833
|
-
|
|
833
|
+
needsId ||= isDedupedMember(value), yields.push(value);
|
|
834
|
+
}
|
|
835
|
+
if (returnValue === void 0 && !yields.length) return state.buf.push("(function*(){})()"), !0;
|
|
836
|
+
if (state.buf.push(returnValue === void 0 ? "(function*(a){yield*a})(" : "(function*(a,r){yield*a;return r})("), needsId) {
|
|
837
|
+
let arrayRef = new Reference(ref, null, state.flush, null, nextRefAccess(state));
|
|
838
|
+
state.buf.push(arrayRef.id + "="), writeArray(state, yields, arrayRef);
|
|
839
|
+
} else writeArray(state, yields, new Reference(ref, null, state.flush, state.buf.length));
|
|
840
|
+
if (returnValue !== void 0) {
|
|
841
|
+
let sepIndex = state.buf.push(",") - 1;
|
|
842
|
+
if (writeProp(state, returnValue, ref, "") && isDedupedMember(returnValue)) {
|
|
843
|
+
let retRef = typeof returnValue == "string" ? state.strs.get(returnValue) : state.refs.get(returnValue);
|
|
844
|
+
retRef && !retRef.id && retRef.scopeId === void 0 && (retRef.id = nextRefAccess(state), state.buf[sepIndex] = "," + retRef.id + "=");
|
|
845
|
+
}
|
|
834
846
|
}
|
|
835
|
-
return state.buf.push("
|
|
847
|
+
return state.buf.push(")"), !0;
|
|
836
848
|
}
|
|
837
849
|
function writeAsyncGenerator(state, iter, ref) {
|
|
838
850
|
if (iter[kTouchedIterator]) return state.buf.push("(async function*(){}())"), !0;
|
|
@@ -902,9 +914,12 @@ function toObjectKey(name) {
|
|
|
902
914
|
let len = name.length, c0 = name.charCodeAt(0);
|
|
903
915
|
if (c0 >= 48 && c0 <= 57) if (c0 === 48) {
|
|
904
916
|
if (len !== 1) return quote(name, 1);
|
|
905
|
-
} else
|
|
906
|
-
let
|
|
907
|
-
|
|
917
|
+
} else {
|
|
918
|
+
for (let i = 1; i < len; i++) {
|
|
919
|
+
let c = name.charCodeAt(i);
|
|
920
|
+
if (c < 48 || c > 57) return quote(name, i);
|
|
921
|
+
}
|
|
922
|
+
if (len > 15 && "" + +name !== name) return quote(name, 0);
|
|
908
923
|
}
|
|
909
924
|
else if (c0 >= 97 && c0 <= 122 || c0 >= 65 && c0 <= 90 || c0 === 95 || c0 === 36) for (let i = 1; i < len; i++) {
|
|
910
925
|
let c = name.charCodeAt(i);
|
package/dist/html.mjs
CHANGED
|
@@ -822,16 +822,28 @@ function writeReadableStream(state, val, ref) {
|
|
|
822
822
|
}
|
|
823
823
|
function writeGenerator(state, iter, ref) {
|
|
824
824
|
if (iter[kTouchedIterator]) return state.buf.push("(function*(){}())"), !0;
|
|
825
|
-
let
|
|
826
|
-
for (
|
|
825
|
+
let yields = [], returnValue, needsId;
|
|
826
|
+
for (;;) {
|
|
827
827
|
let { value, done } = iter.next();
|
|
828
828
|
if (done) {
|
|
829
|
-
|
|
829
|
+
returnValue = value;
|
|
830
830
|
break;
|
|
831
831
|
}
|
|
832
|
-
|
|
832
|
+
needsId ||= isDedupedMember(value), yields.push(value);
|
|
833
|
+
}
|
|
834
|
+
if (returnValue === void 0 && !yields.length) return state.buf.push("(function*(){})()"), !0;
|
|
835
|
+
if (state.buf.push(returnValue === void 0 ? "(function*(a){yield*a})(" : "(function*(a,r){yield*a;return r})("), needsId) {
|
|
836
|
+
let arrayRef = new Reference(ref, null, state.flush, null, nextRefAccess(state));
|
|
837
|
+
state.buf.push(arrayRef.id + "="), writeArray(state, yields, arrayRef);
|
|
838
|
+
} else writeArray(state, yields, new Reference(ref, null, state.flush, state.buf.length));
|
|
839
|
+
if (returnValue !== void 0) {
|
|
840
|
+
let sepIndex = state.buf.push(",") - 1;
|
|
841
|
+
if (writeProp(state, returnValue, ref, "") && isDedupedMember(returnValue)) {
|
|
842
|
+
let retRef = typeof returnValue == "string" ? state.strs.get(returnValue) : state.refs.get(returnValue);
|
|
843
|
+
retRef && !retRef.id && retRef.scopeId === void 0 && (retRef.id = nextRefAccess(state), state.buf[sepIndex] = "," + retRef.id + "=");
|
|
844
|
+
}
|
|
833
845
|
}
|
|
834
|
-
return state.buf.push("
|
|
846
|
+
return state.buf.push(")"), !0;
|
|
835
847
|
}
|
|
836
848
|
function writeAsyncGenerator(state, iter, ref) {
|
|
837
849
|
if (iter[kTouchedIterator]) return state.buf.push("(async function*(){}())"), !0;
|
|
@@ -901,9 +913,12 @@ function toObjectKey(name) {
|
|
|
901
913
|
let len = name.length, c0 = name.charCodeAt(0);
|
|
902
914
|
if (c0 >= 48 && c0 <= 57) if (c0 === 48) {
|
|
903
915
|
if (len !== 1) return quote(name, 1);
|
|
904
|
-
} else
|
|
905
|
-
let
|
|
906
|
-
|
|
916
|
+
} else {
|
|
917
|
+
for (let i = 1; i < len; i++) {
|
|
918
|
+
let c = name.charCodeAt(i);
|
|
919
|
+
if (c < 48 || c > 57) return quote(name, i);
|
|
920
|
+
}
|
|
921
|
+
if (len > 15 && "" + +name !== name) return quote(name, 0);
|
|
907
922
|
}
|
|
908
923
|
else if (c0 >= 97 && c0 <= 122 || c0 >= 65 && c0 <= 90 || c0 === 95 || c0 === 36) for (let i = 1; i < len; i++) {
|
|
909
924
|
let c = name.charCodeAt(i);
|
package/dist/translator/index.js
CHANGED
|
@@ -8676,9 +8676,9 @@ function buildStyleDecls(node) {
|
|
|
8676
8676
|
* `resolveVirtualDependency` hook.
|
|
8677
8677
|
*/
|
|
8678
8678
|
function getStyleImportPath(file, node, names) {
|
|
8679
|
-
const { resolveVirtualDependency } = file.markoOpts;
|
|
8679
|
+
const { resolveVirtualDependency, sourceMaps } = file.markoOpts;
|
|
8680
8680
|
if (!resolveVirtualDependency) return;
|
|
8681
|
-
const { filename
|
|
8681
|
+
const { filename } = file.opts;
|
|
8682
8682
|
let ext = STYLE_EXT_REG.exec(node.rawValue || "")?.[1] || ".css";
|
|
8683
8683
|
if (node.var && !/\.module\./.test(ext)) ext = ".module" + ext;
|
|
8684
8684
|
const program = (0, _marko_compiler_babel_utils.getProgram)().node;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marko/runtime-tags",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.8",
|
|
4
4
|
"description": "Optimized runtime for Marko templates.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"build": "node -r ~ts ./scripts/bundle.mts"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@marko/compiler": "^5.41.
|
|
54
|
+
"@marko/compiler": "^5.41.2",
|
|
55
55
|
"csstype": "^3.2.3",
|
|
56
56
|
"fastest-levenshtein": "^1.0.16",
|
|
57
57
|
"magic-string": "^0.30.21"
|