@marko/runtime-tags 6.1.19 → 6.1.20

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 CHANGED
@@ -1190,11 +1190,16 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
1190
1190
  scope["ControlledHandler:" + nodeAccessor] = 0;
1191
1191
  switch (el.tagName) {
1192
1192
  case "INPUT":
1193
- if ("checked" in nextAttrs || "checkedChange" in nextAttrs) _attr_input_checked(scope, nodeAccessor, nextAttrs.checked, nextAttrs.checkedChange);
1194
- else if ("checkedValue" in nextAttrs || "checkedValueChange" in nextAttrs) _attr_input_checkedValue(scope, nodeAccessor, nextAttrs.checkedValue, nextAttrs.checkedValueChange, nextAttrs.value);
1195
- else if ("value" in nextAttrs || "valueChange" in nextAttrs) _attr_input_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange);
1196
- else break;
1197
- skip = /^(?:value|checked(?:Value)?)(?:Change)?$/;
1193
+ if ("checked" in nextAttrs || "checkedChange" in nextAttrs) {
1194
+ _attr_input_checked(scope, nodeAccessor, nextAttrs.checked, nextAttrs.checkedChange);
1195
+ skip = /^checked(?:Value)?(?:Change)?$/;
1196
+ } else if ("checkedValue" in nextAttrs || "checkedValueChange" in nextAttrs) {
1197
+ _attr_input_checkedValue(scope, nodeAccessor, nextAttrs.checkedValue, nextAttrs.checkedValueChange, nextAttrs.value);
1198
+ skip = /^(?:value|checked(?:Value)?)(?:Change)?$/;
1199
+ } else if ("value" in nextAttrs || "valueChange" in nextAttrs) {
1200
+ _attr_input_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange);
1201
+ skip = /^value(?:Change)?$/;
1202
+ } else break;
1198
1203
  break;
1199
1204
  case "SELECT":
1200
1205
  if ("value" in nextAttrs || "valueChange" in nextAttrs) {
@@ -1925,7 +1930,7 @@ const compat = {
1925
1930
  component.scope = branch;
1926
1931
  classIdToBranch.delete(component.id);
1927
1932
  }
1928
- if (typeof args[0] === "object" && "renderBody" in args[0]) {
1933
+ if (args[0] && typeof args[0] === "object" && "renderBody" in args[0]) {
1929
1934
  const input = args[0];
1930
1935
  const normalizedInput = args[0] = {};
1931
1936
  for (const key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
@@ -2044,35 +2049,34 @@ function _load_setup(nodeAccessor, childScopeAccessor, load) {
2044
2049
  };
2045
2050
  }
2046
2051
  function insertLoaded(renderer, branch, marker, awaitCounter) {
2047
- const parent = marker.parentNode;
2048
- syncGen(branch);
2049
- renderer["clone"](branch, parent.namespaceURI);
2050
- setupBranch(renderer, branch);
2051
- applyLoad(branch, () => {
2052
+ const parent = marker.parentNode, values = branch["#Load"], insert = () => {
2052
2053
  insertBranchBefore(branch, parent, marker);
2053
2054
  marker.remove();
2054
2055
  awaitCounter?.c();
2055
- });
2056
- }
2057
- function loadFailed(scope, awaitCounter) {
2058
- return (error) => {
2059
- if (awaitCounter) awaitCounter.i = 0;
2060
- queueAsyncRender(scope, renderCatch, error);
2061
2056
  };
2062
- }
2063
- function applyLoad(scope, insert) {
2064
- const values = scope["#Load"];
2065
2057
  let remaining;
2066
- scope["#Load"] = 0;
2058
+ syncGen(branch);
2059
+ renderer["clone"](branch, parent.namespaceURI);
2060
+ branch["#Load"] = 0;
2067
2061
  if (remaining = values?.size) for (const [promise, entry] of values) promise.then((signal) => {
2068
2062
  entry["signal"] = signal;
2069
- if (!--remaining) queueAsyncRender(scope, (scope) => {
2070
- syncGen(scope);
2071
- values.forEach((e) => e["signal"]._(scope, e["value"]));
2063
+ if (!--remaining) queueAsyncRender(branch, (branch) => {
2064
+ syncGen(branch);
2065
+ renderer["setup"]?.(branch);
2066
+ values.forEach((e) => e["signal"]._(branch, e["value"]));
2072
2067
  insert();
2073
2068
  });
2074
2069
  }, () => 0);
2075
- else insert();
2070
+ else {
2071
+ setupBranch(renderer, branch);
2072
+ insert();
2073
+ }
2074
+ }
2075
+ function loadFailed(scope, awaitCounter) {
2076
+ return (error) => {
2077
+ if (awaitCounter) awaitCounter.i = 0;
2078
+ queueAsyncRender(scope, renderCatch, error);
2079
+ };
2076
2080
  }
2077
2081
  function _load_signal(load) {
2078
2082
  let pending;
@@ -1188,11 +1188,16 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
1188
1188
  scope["ControlledHandler:" + nodeAccessor] = 0;
1189
1189
  switch (el.tagName) {
1190
1190
  case "INPUT":
1191
- if ("checked" in nextAttrs || "checkedChange" in nextAttrs) _attr_input_checked(scope, nodeAccessor, nextAttrs.checked, nextAttrs.checkedChange);
1192
- else if ("checkedValue" in nextAttrs || "checkedValueChange" in nextAttrs) _attr_input_checkedValue(scope, nodeAccessor, nextAttrs.checkedValue, nextAttrs.checkedValueChange, nextAttrs.value);
1193
- else if ("value" in nextAttrs || "valueChange" in nextAttrs) _attr_input_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange);
1194
- else break;
1195
- skip = /^(?:value|checked(?:Value)?)(?:Change)?$/;
1191
+ if ("checked" in nextAttrs || "checkedChange" in nextAttrs) {
1192
+ _attr_input_checked(scope, nodeAccessor, nextAttrs.checked, nextAttrs.checkedChange);
1193
+ skip = /^checked(?:Value)?(?:Change)?$/;
1194
+ } else if ("checkedValue" in nextAttrs || "checkedValueChange" in nextAttrs) {
1195
+ _attr_input_checkedValue(scope, nodeAccessor, nextAttrs.checkedValue, nextAttrs.checkedValueChange, nextAttrs.value);
1196
+ skip = /^(?:value|checked(?:Value)?)(?:Change)?$/;
1197
+ } else if ("value" in nextAttrs || "valueChange" in nextAttrs) {
1198
+ _attr_input_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange);
1199
+ skip = /^value(?:Change)?$/;
1200
+ } else break;
1196
1201
  break;
1197
1202
  case "SELECT":
1198
1203
  if ("value" in nextAttrs || "valueChange" in nextAttrs) {
@@ -1923,7 +1928,7 @@ const compat = {
1923
1928
  component.scope = branch;
1924
1929
  classIdToBranch.delete(component.id);
1925
1930
  }
1926
- if (typeof args[0] === "object" && "renderBody" in args[0]) {
1931
+ if (args[0] && typeof args[0] === "object" && "renderBody" in args[0]) {
1927
1932
  const input = args[0];
1928
1933
  const normalizedInput = args[0] = {};
1929
1934
  for (const key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
@@ -2042,35 +2047,34 @@ function _load_setup(nodeAccessor, childScopeAccessor, load) {
2042
2047
  };
2043
2048
  }
2044
2049
  function insertLoaded(renderer, branch, marker, awaitCounter) {
2045
- const parent = marker.parentNode;
2046
- syncGen(branch);
2047
- renderer["clone"](branch, parent.namespaceURI);
2048
- setupBranch(renderer, branch);
2049
- applyLoad(branch, () => {
2050
+ const parent = marker.parentNode, values = branch["#Load"], insert = () => {
2050
2051
  insertBranchBefore(branch, parent, marker);
2051
2052
  marker.remove();
2052
2053
  awaitCounter?.c();
2053
- });
2054
- }
2055
- function loadFailed(scope, awaitCounter) {
2056
- return (error) => {
2057
- if (awaitCounter) awaitCounter.i = 0;
2058
- queueAsyncRender(scope, renderCatch, error);
2059
2054
  };
2060
- }
2061
- function applyLoad(scope, insert) {
2062
- const values = scope["#Load"];
2063
2055
  let remaining;
2064
- scope["#Load"] = 0;
2056
+ syncGen(branch);
2057
+ renderer["clone"](branch, parent.namespaceURI);
2058
+ branch["#Load"] = 0;
2065
2059
  if (remaining = values?.size) for (const [promise, entry] of values) promise.then((signal) => {
2066
2060
  entry["signal"] = signal;
2067
- if (!--remaining) queueAsyncRender(scope, (scope) => {
2068
- syncGen(scope);
2069
- values.forEach((e) => e["signal"]._(scope, e["value"]));
2061
+ if (!--remaining) queueAsyncRender(branch, (branch) => {
2062
+ syncGen(branch);
2063
+ renderer["setup"]?.(branch);
2064
+ values.forEach((e) => e["signal"]._(branch, e["value"]));
2070
2065
  insert();
2071
2066
  });
2072
2067
  }, () => 0);
2073
- else insert();
2068
+ else {
2069
+ setupBranch(renderer, branch);
2070
+ insert();
2071
+ }
2072
+ }
2073
+ function loadFailed(scope, awaitCounter) {
2074
+ return (error) => {
2075
+ if (awaitCounter) awaitCounter.i = 0;
2076
+ queueAsyncRender(scope, renderCatch, error);
2077
+ };
2074
2078
  }
2075
2079
  function _load_signal(load) {
2076
2080
  let pending;
@@ -877,8 +877,11 @@ function writeDate(state, val) {
877
877
  state.buf.push("new Date(" + +val + ")");
878
878
  return true;
879
879
  }
880
+ const unsafeRegExpSourceReg = /\\[\s\S]|</g;
881
+ const replaceUnsafeRegExpSourceChar = (match) => match === "<" || match === "\\<" ? "\\x3C" : match;
880
882
  function writeRegExp(state, val) {
881
- state.buf.push(val + "");
883
+ const { source } = val;
884
+ state.buf.push("/" + (source.includes("<") ? source.replace(unsafeRegExpSourceReg, replaceUnsafeRegExpSourceChar) : source) + "/" + val.flags);
882
885
  return true;
883
886
  }
884
887
  function writePromise(state, val, ref) {
@@ -1008,7 +1011,7 @@ function writeWeakMap(state) {
1008
1011
  }
1009
1012
  function writeError(state, val, ref) {
1010
1013
  const result = "new " + val.constructor.name + "(" + quote(val.message + "", 0);
1011
- if (val.cause) {
1014
+ if (val.cause !== void 0) {
1012
1015
  state.buf.push(result + ",{cause:");
1013
1016
  writeProp(state, val.cause, ref, "cause");
1014
1017
  state.buf.push("})");
@@ -2464,7 +2467,8 @@ function _attr_style(value) {
2464
2467
  }
2465
2468
  function _attr_option_value(value) {
2466
2469
  const valueAttr = _attr("value", value);
2467
- if (normalizedValueMatches(getContext(kSelectedValue), value)) {
2470
+ const selectedValue = getContext(kSelectedValue);
2471
+ if (selectedValue !== void 0 && normalizedValueMatches(selectedValue, value)) {
2468
2472
  {
2469
2473
  const matched = getContext(kSelectedValueMatched);
2470
2474
  if (matched) matched.value = true;
@@ -2529,11 +2533,16 @@ function _attrs(data, nodeAccessor, scopeId, tagName) {
2529
2533
  switch (tagName) {
2530
2534
  case "input":
2531
2535
  assertExclusiveAttrs(data);
2532
- if (data.checkedChange) result += _attr_input_checked(scopeId, nodeAccessor, data.checked, data.checkedChange, 1);
2533
- else if ("checkedValue" in data || data.checkedValueChange) result += _attr_input_checkedValue(scopeId, nodeAccessor, data.checkedValue, data.checkedValueChange, data.value, 1);
2534
- else if (data.valueChange) result += _attr_input_value(scopeId, nodeAccessor, data.value, data.valueChange, 1);
2535
- else break;
2536
- skip = /^(?:value|checked(?:Value)?)(?:Change)?$|[\s/>"'=]/;
2536
+ if (data.checkedChange) {
2537
+ result += _attr_input_checked(scopeId, nodeAccessor, data.checked, data.checkedChange, 1);
2538
+ skip = /^checked(?:Value)?(?:Change)?$|[\s/>"'=]/;
2539
+ } else if ("checkedValue" in data || data.checkedValueChange) {
2540
+ result += _attr_input_checkedValue(scopeId, nodeAccessor, data.checkedValue, data.checkedValueChange, data.value, 1);
2541
+ skip = /^(?:value|checked(?:Value)?)(?:Change)?$|[\s/>"'=]/;
2542
+ } else if (data.valueChange) {
2543
+ result += _attr_input_value(scopeId, nodeAccessor, data.value, data.valueChange, 1);
2544
+ skip = /^value(?:Change)?$|[\s/>"'=]/;
2545
+ } else break;
2537
2546
  break;
2538
2547
  case "select":
2539
2548
  case "textarea":
@@ -875,8 +875,11 @@ function writeDate(state, val) {
875
875
  state.buf.push("new Date(" + +val + ")");
876
876
  return true;
877
877
  }
878
+ const unsafeRegExpSourceReg = /\\[\s\S]|</g;
879
+ const replaceUnsafeRegExpSourceChar = (match) => match === "<" || match === "\\<" ? "\\x3C" : match;
878
880
  function writeRegExp(state, val) {
879
- state.buf.push(val + "");
881
+ const { source } = val;
882
+ state.buf.push("/" + (source.includes("<") ? source.replace(unsafeRegExpSourceReg, replaceUnsafeRegExpSourceChar) : source) + "/" + val.flags);
880
883
  return true;
881
884
  }
882
885
  function writePromise(state, val, ref) {
@@ -1006,7 +1009,7 @@ function writeWeakMap(state) {
1006
1009
  }
1007
1010
  function writeError(state, val, ref) {
1008
1011
  const result = "new " + val.constructor.name + "(" + quote(val.message + "", 0);
1009
- if (val.cause) {
1012
+ if (val.cause !== void 0) {
1010
1013
  state.buf.push(result + ",{cause:");
1011
1014
  writeProp(state, val.cause, ref, "cause");
1012
1015
  state.buf.push("})");
@@ -2462,7 +2465,8 @@ function _attr_style(value) {
2462
2465
  }
2463
2466
  function _attr_option_value(value) {
2464
2467
  const valueAttr = _attr("value", value);
2465
- if (normalizedValueMatches(getContext(kSelectedValue), value)) {
2468
+ const selectedValue = getContext(kSelectedValue);
2469
+ if (selectedValue !== void 0 && normalizedValueMatches(selectedValue, value)) {
2466
2470
  {
2467
2471
  const matched = getContext(kSelectedValueMatched);
2468
2472
  if (matched) matched.value = true;
@@ -2527,11 +2531,16 @@ function _attrs(data, nodeAccessor, scopeId, tagName) {
2527
2531
  switch (tagName) {
2528
2532
  case "input":
2529
2533
  assertExclusiveAttrs(data);
2530
- if (data.checkedChange) result += _attr_input_checked(scopeId, nodeAccessor, data.checked, data.checkedChange, 1);
2531
- else if ("checkedValue" in data || data.checkedValueChange) result += _attr_input_checkedValue(scopeId, nodeAccessor, data.checkedValue, data.checkedValueChange, data.value, 1);
2532
- else if (data.valueChange) result += _attr_input_value(scopeId, nodeAccessor, data.value, data.valueChange, 1);
2533
- else break;
2534
- skip = /^(?:value|checked(?:Value)?)(?:Change)?$|[\s/>"'=]/;
2534
+ if (data.checkedChange) {
2535
+ result += _attr_input_checked(scopeId, nodeAccessor, data.checked, data.checkedChange, 1);
2536
+ skip = /^checked(?:Value)?(?:Change)?$|[\s/>"'=]/;
2537
+ } else if ("checkedValue" in data || data.checkedValueChange) {
2538
+ result += _attr_input_checkedValue(scopeId, nodeAccessor, data.checkedValue, data.checkedValueChange, data.value, 1);
2539
+ skip = /^(?:value|checked(?:Value)?)(?:Change)?$|[\s/>"'=]/;
2540
+ } else if (data.valueChange) {
2541
+ result += _attr_input_value(scopeId, nodeAccessor, data.value, data.valueChange, 1);
2542
+ skip = /^value(?:Change)?$|[\s/>"'=]/;
2543
+ } else break;
2535
2544
  break;
2536
2545
  case "select":
2537
2546
  case "textarea":
package/dist/dom.js CHANGED
@@ -98,7 +98,7 @@ let empty = [], rest = Symbol(), toDelimitedString = function toDelimitedString(
98
98
  },
99
99
  render(out, component, renderer, args) {
100
100
  let branch = component.scope, created = 0;
101
- if (!branch && (branch = classIdToBranch.get(component.id)) && (component.scope = branch, classIdToBranch.delete(component.id)), typeof args[0] == "object" && "renderBody" in args[0]) {
101
+ if (!branch && (branch = classIdToBranch.get(component.id)) && (component.scope = branch, classIdToBranch.delete(component.id)), args[0] && typeof args[0] == "object" && "renderBody" in args[0]) {
102
102
  let input = args[0], normalizedInput = args[0] = {};
103
103
  for (let key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
104
104
  }
@@ -773,11 +773,10 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
773
773
  for (let name in events) events[name] = 0;
774
774
  switch (scope["F" + nodeAccessor] = 5, scope["E" + nodeAccessor] = 0, el.tagName) {
775
775
  case "INPUT":
776
- if ("checked" in nextAttrs || "checkedChange" in nextAttrs) _attr_input_checked(scope, nodeAccessor, nextAttrs.checked, nextAttrs.checkedChange);
777
- else if ("checkedValue" in nextAttrs || "checkedValueChange" in nextAttrs) _attr_input_checkedValue(scope, nodeAccessor, nextAttrs.checkedValue, nextAttrs.checkedValueChange, nextAttrs.value);
778
- else if ("value" in nextAttrs || "valueChange" in nextAttrs) _attr_input_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange);
776
+ if ("checked" in nextAttrs || "checkedChange" in nextAttrs) _attr_input_checked(scope, nodeAccessor, nextAttrs.checked, nextAttrs.checkedChange), skip = /^checked(?:Value)?(?:Change)?$/;
777
+ else if ("checkedValue" in nextAttrs || "checkedValueChange" in nextAttrs) _attr_input_checkedValue(scope, nodeAccessor, nextAttrs.checkedValue, nextAttrs.checkedValueChange, nextAttrs.value), skip = /^(?:value|checked(?:Value)?)(?:Change)?$/;
778
+ else if ("value" in nextAttrs || "valueChange" in nextAttrs) _attr_input_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange), skip = /^value(?:Change)?$/;
779
779
  else break;
780
- skip = /^(?:value|checked(?:Value)?)(?:Change)?$/;
781
780
  break;
782
781
  case "SELECT":
783
782
  ("value" in nextAttrs || "valueChange" in nextAttrs) && (_attr_select_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange), skip = /^value(?:Change)?$/);
@@ -1224,25 +1223,21 @@ function _load_setup(nodeAccessor, childScopeAccessor, load) {
1224
1223
  };
1225
1224
  }
1226
1225
  function insertLoaded(renderer, branch, marker, awaitCounter) {
1227
- let parent = marker.parentNode;
1228
- syncGen(branch), renderer.b(branch, parent.namespaceURI), setupBranch(renderer, branch), applyLoad(branch, () => {
1226
+ let parent = marker.parentNode, values = branch.X, insert = () => {
1229
1227
  insertBranchBefore(branch, parent, marker), marker.remove(), awaitCounter?.c();
1230
- });
1228
+ }, remaining;
1229
+ if (syncGen(branch), renderer.b(branch, parent.namespaceURI), branch.X = 0, remaining = values?.size) for (let [promise, entry] of values) promise.then((signal) => {
1230
+ entry.b = signal, --remaining || queueAsyncRender(branch, (branch) => {
1231
+ syncGen(branch), renderer.c?.(branch), values.forEach((e) => e.b._(branch, e.a)), insert();
1232
+ });
1233
+ }, () => 0);
1234
+ else setupBranch(renderer, branch), insert();
1231
1235
  }
1232
1236
  function loadFailed(scope, awaitCounter) {
1233
1237
  return (error) => {
1234
1238
  awaitCounter && (awaitCounter.i = 0), queueAsyncRender(scope, renderCatch, error);
1235
1239
  };
1236
1240
  }
1237
- function applyLoad(scope, insert) {
1238
- let values = scope.X, remaining;
1239
- if (scope.X = 0, remaining = values?.size) for (let [promise, entry] of values) promise.then((signal) => {
1240
- entry.b = signal, --remaining || queueAsyncRender(scope, (scope) => {
1241
- syncGen(scope), values.forEach((e) => e.b._(scope, e.a)), insert();
1242
- });
1243
- }, () => 0);
1244
- else insert();
1245
- }
1246
1241
  function _load_signal(load) {
1247
1242
  let pending, signal;
1248
1243
  return (scope, value) => {
package/dist/dom.mjs CHANGED
@@ -98,7 +98,7 @@ let empty = [], rest = Symbol(), toDelimitedString = function toDelimitedString(
98
98
  },
99
99
  render(out, component, renderer, args) {
100
100
  let branch = component.scope, created = 0;
101
- if (!branch && (branch = classIdToBranch.get(component.id)) && (component.scope = branch, classIdToBranch.delete(component.id)), typeof args[0] == "object" && "renderBody" in args[0]) {
101
+ if (!branch && (branch = classIdToBranch.get(component.id)) && (component.scope = branch, classIdToBranch.delete(component.id)), args[0] && typeof args[0] == "object" && "renderBody" in args[0]) {
102
102
  let input = args[0], normalizedInput = args[0] = {};
103
103
  for (let key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
104
104
  }
@@ -772,11 +772,10 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
772
772
  for (let name in events) events[name] = 0;
773
773
  switch (scope["F" + nodeAccessor] = 5, scope["E" + nodeAccessor] = 0, el.tagName) {
774
774
  case "INPUT":
775
- if ("checked" in nextAttrs || "checkedChange" in nextAttrs) _attr_input_checked(scope, nodeAccessor, nextAttrs.checked, nextAttrs.checkedChange);
776
- else if ("checkedValue" in nextAttrs || "checkedValueChange" in nextAttrs) _attr_input_checkedValue(scope, nodeAccessor, nextAttrs.checkedValue, nextAttrs.checkedValueChange, nextAttrs.value);
777
- else if ("value" in nextAttrs || "valueChange" in nextAttrs) _attr_input_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange);
775
+ if ("checked" in nextAttrs || "checkedChange" in nextAttrs) _attr_input_checked(scope, nodeAccessor, nextAttrs.checked, nextAttrs.checkedChange), skip = /^checked(?:Value)?(?:Change)?$/;
776
+ else if ("checkedValue" in nextAttrs || "checkedValueChange" in nextAttrs) _attr_input_checkedValue(scope, nodeAccessor, nextAttrs.checkedValue, nextAttrs.checkedValueChange, nextAttrs.value), skip = /^(?:value|checked(?:Value)?)(?:Change)?$/;
777
+ else if ("value" in nextAttrs || "valueChange" in nextAttrs) _attr_input_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange), skip = /^value(?:Change)?$/;
778
778
  else break;
779
- skip = /^(?:value|checked(?:Value)?)(?:Change)?$/;
780
779
  break;
781
780
  case "SELECT":
782
781
  ("value" in nextAttrs || "valueChange" in nextAttrs) && (_attr_select_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange), skip = /^value(?:Change)?$/);
@@ -1223,25 +1222,21 @@ function _load_setup(nodeAccessor, childScopeAccessor, load) {
1223
1222
  };
1224
1223
  }
1225
1224
  function insertLoaded(renderer, branch, marker, awaitCounter) {
1226
- let parent = marker.parentNode;
1227
- syncGen(branch), renderer.b(branch, parent.namespaceURI), setupBranch(renderer, branch), applyLoad(branch, () => {
1225
+ let parent = marker.parentNode, values = branch.X, insert = () => {
1228
1226
  insertBranchBefore(branch, parent, marker), marker.remove(), awaitCounter?.c();
1229
- });
1227
+ }, remaining;
1228
+ if (syncGen(branch), renderer.b(branch, parent.namespaceURI), branch.X = 0, remaining = values?.size) for (let [promise, entry] of values) promise.then((signal) => {
1229
+ entry.b = signal, --remaining || queueAsyncRender(branch, (branch) => {
1230
+ syncGen(branch), renderer.c?.(branch), values.forEach((e) => e.b._(branch, e.a)), insert();
1231
+ });
1232
+ }, () => 0);
1233
+ else setupBranch(renderer, branch), insert();
1230
1234
  }
1231
1235
  function loadFailed(scope, awaitCounter) {
1232
1236
  return (error) => {
1233
1237
  awaitCounter && (awaitCounter.i = 0), queueAsyncRender(scope, renderCatch, error);
1234
1238
  };
1235
1239
  }
1236
- function applyLoad(scope, insert) {
1237
- let values = scope.X, remaining;
1238
- if (scope.X = 0, remaining = values?.size) for (let [promise, entry] of values) promise.then((signal) => {
1239
- entry.b = signal, --remaining || queueAsyncRender(scope, (scope) => {
1240
- syncGen(scope), values.forEach((e) => e.b._(scope, e.a)), insert();
1241
- });
1242
- }, () => 0);
1243
- else insert();
1244
- }
1245
1240
  function _load_signal(load) {
1246
1241
  let pending, signal;
1247
1242
  return (scope, value) => {
package/dist/html.js CHANGED
@@ -238,7 +238,7 @@ let empty = [], rest = Symbol(), toDelimitedString = function toDelimitedString(
238
238
  [JSON, "JSON"],
239
239
  [Math, "Math"],
240
240
  [Reflect, "Reflect"]
241
- ]), $chunk, NOOP$2 = () => {}, kPendingContexts = Symbol("Pending Contexts"), kBranchId = Symbol("Branch Id"), kIsAsync = Symbol("Is Async"), writeScope = (scopeId, partialScope) => {
241
+ ]), unsafeRegExpSourceReg = /\\[\s\S]|</g, replaceUnsafeRegExpSourceChar = (match) => match === "<" || match === "\\<" ? "\\x3C" : match, $chunk, NOOP$2 = () => {}, kPendingContexts = Symbol("Pending Contexts"), kBranchId = Symbol("Branch Id"), kIsAsync = Symbol("Is Async"), writeScope = (scopeId, partialScope) => {
242
242
  let { state } = $chunk.boundary, target = $chunk.serializeState, scope = scopeWithId(state, scopeId), pending = target.writeScopes[scopeId];
243
243
  return state.needsMainRuntime = !0, Object.assign(scope, partialScope), pending && pending !== partialScope ? Object.assign(pending, partialScope) : target.writeScopes[scopeId] = partialScope, target.flushScopes = !0, scope;
244
244
  }, tick = globalThis.setImmediate || globalThis.setTimeout || globalThis.queueMicrotask || ((cb) => Promise.resolve().then(cb)), tickQueue, kSelectedValue = Symbol("selectedValue"), checkedValuesRefs = /* @__PURE__ */ new WeakMap(), singleQuoteAttrReplacements = /'|&(?=#?\w+;)/g, doubleQuoteAttrReplacements = /"|&(?=#?\w+;)/g, needsQuotedAttr = /["'>\s]|&#?\w+;|\/$/g, 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) => {
@@ -691,7 +691,8 @@ function writeDate(state, val) {
691
691
  return state.buf.push("new Date(" + +val + ")"), !0;
692
692
  }
693
693
  function writeRegExp(state, val) {
694
- return state.buf.push(val + ""), !0;
694
+ let { source } = val;
695
+ return state.buf.push("/" + (source.includes("<") ? source.replace(unsafeRegExpSourceReg, replaceUnsafeRegExpSourceChar) : source) + "/" + val.flags), !0;
695
696
  }
696
697
  function writePromise(state, val, ref) {
697
698
  let { boundary, channel } = state;
@@ -760,7 +761,7 @@ function writeWeakMap(state) {
760
761
  }
761
762
  function writeError(state, val, ref) {
762
763
  let result = "new " + val.constructor.name + "(" + quote(val.message + "", 0);
763
- return val.cause ? (state.buf.push(result + ",{cause:"), writeProp(state, val.cause, ref, "cause"), state.buf.push("})")) : state.buf.push(result + ")"), !0;
764
+ return val.cause === void 0 ? state.buf.push(result + ")") : (state.buf.push(result + ",{cause:"), writeProp(state, val.cause, ref, "cause"), state.buf.push("})")), !0;
764
765
  }
765
766
  function writeAggregateError(state, val, ref) {
766
767
  return state.buf.push("new AggregateError("), writeProp(state, val.errors, ref, "errors"), val.message ? state.buf.push("," + quote(val.message + "", 0) + ")") : state.buf.push(")"), !0;
@@ -1611,8 +1612,8 @@ function _attr_style(value) {
1611
1612
  return stringAttr("style", toDelimitedString(value, ";", stringifyStyleObject));
1612
1613
  }
1613
1614
  function _attr_option_value(value) {
1614
- let valueAttr = _attr("value", value);
1615
- return normalizedValueMatches(getContext(kSelectedValue), value) ? valueAttr + " selected" : valueAttr;
1615
+ let valueAttr = _attr("value", value), selectedValue = getContext(kSelectedValue);
1616
+ return selectedValue !== void 0 && normalizedValueMatches(selectedValue, value) ? valueAttr + " selected" : valueAttr;
1616
1617
  }
1617
1618
  function _attr_select_value(scopeId, nodeAccessor, value, valueChange, content, serializeType) {
1618
1619
  valueChange && writeControlledScope(3, scopeId, nodeAccessor, void 0, valueChange, serializeType), content && withContext(kSelectedValue, value, content);
@@ -1650,11 +1651,10 @@ function _attrs(data, nodeAccessor, scopeId, tagName) {
1650
1651
  let result = "", skip = /[\s/>"'=]/, events;
1651
1652
  switch (tagName) {
1652
1653
  case "input":
1653
- if (data.checkedChange) result += _attr_input_checked(scopeId, nodeAccessor, data.checked, data.checkedChange, 1);
1654
- else if ("checkedValue" in data || data.checkedValueChange) result += _attr_input_checkedValue(scopeId, nodeAccessor, data.checkedValue, data.checkedValueChange, data.value, 1);
1655
- else if (data.valueChange) result += _attr_input_value(scopeId, nodeAccessor, data.value, data.valueChange, 1);
1654
+ if (data.checkedChange) result += _attr_input_checked(scopeId, nodeAccessor, data.checked, data.checkedChange, 1), skip = /^checked(?:Value)?(?:Change)?$|[\s/>"'=]/;
1655
+ else if ("checkedValue" in data || data.checkedValueChange) result += _attr_input_checkedValue(scopeId, nodeAccessor, data.checkedValue, data.checkedValueChange, data.value, 1), skip = /^(?:value|checked(?:Value)?)(?:Change)?$|[\s/>"'=]/;
1656
+ else if (data.valueChange) result += _attr_input_value(scopeId, nodeAccessor, data.value, data.valueChange, 1), skip = /^value(?:Change)?$|[\s/>"'=]/;
1656
1657
  else break;
1657
- skip = /^(?:value|checked(?:Value)?)(?:Change)?$|[\s/>"'=]/;
1658
1658
  break;
1659
1659
  case "select":
1660
1660
  case "textarea":
package/dist/html.mjs CHANGED
@@ -238,7 +238,7 @@ let empty = [], rest = Symbol(), toDelimitedString = function toDelimitedString(
238
238
  [JSON, "JSON"],
239
239
  [Math, "Math"],
240
240
  [Reflect, "Reflect"]
241
- ]), $chunk, NOOP$2 = () => {}, kPendingContexts = Symbol("Pending Contexts"), kBranchId = Symbol("Branch Id"), kIsAsync = Symbol("Is Async"), writeScope = (scopeId, partialScope) => {
241
+ ]), unsafeRegExpSourceReg = /\\[\s\S]|</g, replaceUnsafeRegExpSourceChar = (match) => match === "<" || match === "\\<" ? "\\x3C" : match, $chunk, NOOP$2 = () => {}, kPendingContexts = Symbol("Pending Contexts"), kBranchId = Symbol("Branch Id"), kIsAsync = Symbol("Is Async"), writeScope = (scopeId, partialScope) => {
242
242
  let { state } = $chunk.boundary, target = $chunk.serializeState, scope = scopeWithId(state, scopeId), pending = target.writeScopes[scopeId];
243
243
  return state.needsMainRuntime = !0, Object.assign(scope, partialScope), pending && pending !== partialScope ? Object.assign(pending, partialScope) : target.writeScopes[scopeId] = partialScope, target.flushScopes = !0, scope;
244
244
  }, tick = globalThis.setImmediate || globalThis.setTimeout || globalThis.queueMicrotask || ((cb) => Promise.resolve().then(cb)), tickQueue, kSelectedValue = Symbol("selectedValue"), checkedValuesRefs = /* @__PURE__ */ new WeakMap(), singleQuoteAttrReplacements = /'|&(?=#?\w+;)/g, doubleQuoteAttrReplacements = /"|&(?=#?\w+;)/g, needsQuotedAttr = /["'>\s]|&#?\w+;|\/$/g, 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) => {
@@ -690,7 +690,8 @@ function writeDate(state, val) {
690
690
  return state.buf.push("new Date(" + +val + ")"), !0;
691
691
  }
692
692
  function writeRegExp(state, val) {
693
- return state.buf.push(val + ""), !0;
693
+ let { source } = val;
694
+ return state.buf.push("/" + (source.includes("<") ? source.replace(unsafeRegExpSourceReg, replaceUnsafeRegExpSourceChar) : source) + "/" + val.flags), !0;
694
695
  }
695
696
  function writePromise(state, val, ref) {
696
697
  let { boundary, channel } = state;
@@ -759,7 +760,7 @@ function writeWeakMap(state) {
759
760
  }
760
761
  function writeError(state, val, ref) {
761
762
  let result = "new " + val.constructor.name + "(" + quote(val.message + "", 0);
762
- return val.cause ? (state.buf.push(result + ",{cause:"), writeProp(state, val.cause, ref, "cause"), state.buf.push("})")) : state.buf.push(result + ")"), !0;
763
+ return val.cause === void 0 ? state.buf.push(result + ")") : (state.buf.push(result + ",{cause:"), writeProp(state, val.cause, ref, "cause"), state.buf.push("})")), !0;
763
764
  }
764
765
  function writeAggregateError(state, val, ref) {
765
766
  return state.buf.push("new AggregateError("), writeProp(state, val.errors, ref, "errors"), val.message ? state.buf.push("," + quote(val.message + "", 0) + ")") : state.buf.push(")"), !0;
@@ -1610,8 +1611,8 @@ function _attr_style(value) {
1610
1611
  return stringAttr("style", toDelimitedString(value, ";", stringifyStyleObject));
1611
1612
  }
1612
1613
  function _attr_option_value(value) {
1613
- let valueAttr = _attr("value", value);
1614
- return normalizedValueMatches(getContext(kSelectedValue), value) ? valueAttr + " selected" : valueAttr;
1614
+ let valueAttr = _attr("value", value), selectedValue = getContext(kSelectedValue);
1615
+ return selectedValue !== void 0 && normalizedValueMatches(selectedValue, value) ? valueAttr + " selected" : valueAttr;
1615
1616
  }
1616
1617
  function _attr_select_value(scopeId, nodeAccessor, value, valueChange, content, serializeType) {
1617
1618
  valueChange && writeControlledScope(3, scopeId, nodeAccessor, void 0, valueChange, serializeType), content && withContext(kSelectedValue, value, content);
@@ -1649,11 +1650,10 @@ function _attrs(data, nodeAccessor, scopeId, tagName) {
1649
1650
  let result = "", skip = /[\s/>"'=]/, events;
1650
1651
  switch (tagName) {
1651
1652
  case "input":
1652
- if (data.checkedChange) result += _attr_input_checked(scopeId, nodeAccessor, data.checked, data.checkedChange, 1);
1653
- else if ("checkedValue" in data || data.checkedValueChange) result += _attr_input_checkedValue(scopeId, nodeAccessor, data.checkedValue, data.checkedValueChange, data.value, 1);
1654
- else if (data.valueChange) result += _attr_input_value(scopeId, nodeAccessor, data.value, data.valueChange, 1);
1653
+ if (data.checkedChange) result += _attr_input_checked(scopeId, nodeAccessor, data.checked, data.checkedChange, 1), skip = /^checked(?:Value)?(?:Change)?$|[\s/>"'=]/;
1654
+ else if ("checkedValue" in data || data.checkedValueChange) result += _attr_input_checkedValue(scopeId, nodeAccessor, data.checkedValue, data.checkedValueChange, data.value, 1), skip = /^(?:value|checked(?:Value)?)(?:Change)?$|[\s/>"'=]/;
1655
+ else if (data.valueChange) result += _attr_input_value(scopeId, nodeAccessor, data.value, data.valueChange, 1), skip = /^value(?:Change)?$|[\s/>"'=]/;
1655
1656
  else break;
1656
- skip = /^(?:value|checked(?:Value)?)(?:Change)?$|[\s/>"'=]/;
1657
1657
  break;
1658
1658
  case "select":
1659
1659
  case "textarea":
@@ -25,7 +25,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
25
  let package_json = require("../../package.json");
26
26
  let _marko_compiler = require("@marko/compiler");
27
27
  let _marko_compiler_babel_utils = require("@marko/compiler/babel-utils");
28
- let _marko_compiler_config = require("@marko/compiler/config");
29
28
  let node_path = require("node:path");
30
29
  node_path = __toESM(node_path);
31
30
  let path = require("path");
@@ -1765,13 +1764,13 @@ function getBindingPropTree(binding) {
1765
1764
  };
1766
1765
  if (!binding.reads.size) {
1767
1766
  if (!binding.aliases.size) {
1768
- props.props = {};
1767
+ props.props = Object.create(null);
1769
1768
  for (const [property, alias] of binding.propertyAliases) props.props[property] = getBindingPropTree(alias);
1770
1769
  } else if (binding.aliases.size === 1) {
1771
1770
  const [restAlias] = binding.aliases;
1772
1771
  if (hasSupersetExcludeProperties(binding, restAlias.excludeProperties)) {
1773
1772
  props.rest = getBindingPropTree(restAlias);
1774
- props.props = {};
1773
+ props.props = Object.create(null);
1775
1774
  if (restAlias.type === 2) restAlias.export ??= generateUid(restAlias.name);
1776
1775
  forEach(restAlias.excludeProperties, (property) => {
1777
1776
  const propAlias = binding.propertyAliases.get(property);
@@ -2013,7 +2012,8 @@ function _attr_style(value) {
2013
2012
  }
2014
2013
  function _attr_option_value(value) {
2015
2014
  const valueAttr = _attr("value", value);
2016
- if (normalizedValueMatches(getContext(kSelectedValue), value)) return valueAttr + " selected";
2015
+ const selectedValue = getContext(kSelectedValue);
2016
+ if (selectedValue !== void 0 && normalizedValueMatches(selectedValue, value)) return valueAttr + " selected";
2017
2017
  return valueAttr;
2018
2018
  }
2019
2019
  const kSelectedValue = Symbol("selectedValue");
@@ -2063,11 +2063,16 @@ function _attrs(data, nodeAccessor, scopeId, tagName) {
2063
2063
  let events;
2064
2064
  switch (tagName) {
2065
2065
  case "input":
2066
- if (data.checkedChange) result += _attr_input_checked(scopeId, nodeAccessor, data.checked, data.checkedChange, 1);
2067
- else if ("checkedValue" in data || data.checkedValueChange) result += _attr_input_checkedValue(scopeId, nodeAccessor, data.checkedValue, data.checkedValueChange, data.value, 1);
2068
- else if (data.valueChange) result += _attr_input_value(scopeId, nodeAccessor, data.value, data.valueChange, 1);
2069
- else break;
2070
- skip = /^(?:value|checked(?:Value)?)(?:Change)?$|[\s/>"'=]/;
2066
+ if (data.checkedChange) {
2067
+ result += _attr_input_checked(scopeId, nodeAccessor, data.checked, data.checkedChange, 1);
2068
+ skip = /^checked(?:Value)?(?:Change)?$|[\s/>"'=]/;
2069
+ } else if ("checkedValue" in data || data.checkedValueChange) {
2070
+ result += _attr_input_checkedValue(scopeId, nodeAccessor, data.checkedValue, data.checkedValueChange, data.value, 1);
2071
+ skip = /^(?:value|checked(?:Value)?)(?:Change)?$|[\s/>"'=]/;
2072
+ } else if (data.valueChange) {
2073
+ result += _attr_input_value(scopeId, nodeAccessor, data.value, data.valueChange, 1);
2074
+ skip = /^value(?:Change)?$|[\s/>"'=]/;
2075
+ } else break;
2071
2076
  break;
2072
2077
  case "select":
2073
2078
  case "textarea":
@@ -4073,8 +4078,7 @@ function analyzeAttributeTags(tag) {
4073
4078
  }
4074
4079
  let attrTagMeta = lookup[name];
4075
4080
  if (!attrTagMeta) {
4076
- attrTagMeta = lookup[name] = createAttrTagMeta(name, []);
4077
- curGroup = attrTagMeta.group;
4081
+ attrTagMeta = lookup[name] = createAttrTagMeta(name, curGroup ||= []);
4078
4082
  curGroup.push(name);
4079
4083
  }
4080
4084
  attrTagMeta.dynamic = true;
@@ -6923,7 +6927,7 @@ function getReadReplacement(node, signal) {
6923
6927
  else if (read.getter?.hoisted) replacement = _marko_compiler.types.callExpression(getBindingGetterIdentifier(readBinding, read.getter.hoisted), [getScopeExpression(extra.section, read.getter.hoisted)]);
6924
6928
  else if (readBinding.type === 0) {
6925
6929
  if (read.getter) replacement = _marko_compiler.types.callExpression(getBindingGetterIdentifier(readBinding, readBinding.section), [getScopeExpression(extra.section, readBinding.section)]);
6926
- } else if (!_marko_compiler_config.optimize && read.ownVar) replacement = callRuntime("_assert_init", extra.section ? getScopeExpression(extra.section, readBinding.section) : scopeIdentifier, getScopeAccessorLiteral(readBinding));
6930
+ } else if (!isOptimize() && read.ownVar) replacement = callRuntime("_assert_init", extra.section ? getScopeExpression(extra.section, readBinding.section) : scopeIdentifier, getScopeAccessorLiteral(readBinding));
6927
6931
  else replacement = createScopeReadExpression(readBinding, extra.section);
6928
6932
  else if (node.type !== "Identifier") replacement = _marko_compiler.types.identifier(readBinding.name);
6929
6933
  else if (read.getter?.hoisted) replacement = getBindingGetterIdentifier(readBinding, read.getter.hoisted);
@@ -7986,9 +7990,9 @@ var style_default = {
7986
7990
  (0, _marko_compiler_babel_utils.assertNoParams)(tag);
7987
7991
  (0, _marko_compiler_babel_utils.assertNoAttributeTags)(tag);
7988
7992
  const { node, hub: { file } } = tag;
7989
- const ext = STYLE_EXT_REG.exec(node.rawValue || "")?.[1]?.slice(1);
7993
+ const extClass = (STYLE_EXT_REG.exec(node.rawValue || "")?.[1]?.slice(1))?.replace(/\./g, " ");
7990
7994
  for (const attr of node.attributes) {
7991
- if (attr.start == null && attr.type === "MarkoAttribute" && attr.name === "class" && attr.value.type === "StringLiteral" && attr.value.value === ext) continue;
7995
+ if (attr.start == null && attr.type === "MarkoAttribute" && attr.name === "class" && attr.value.type === "StringLiteral" && attr.value.value === extClass) continue;
7992
7996
  throw tag.hub.buildError(attr.value, "The `style` does not support html attributes." + htmlStyleTagAlternateMsg);
7993
7997
  }
7994
7998
  for (const child of node.body.body) if (child.type !== "MarkoText") throw tag.hub.buildError(child, "The [`<style>` tag](https://markojs.com/docs/reference/core-tag#style) currently only supports static content." + htmlStyleTagAlternateMsg);
@@ -8485,7 +8489,7 @@ var referenced_identifier_default = {
8485
8489
  abortIdsByExpression = /* @__PURE__ */ new Map();
8486
8490
  abortIdsByExpressionForSection.set(section, abortIdsByExpression);
8487
8491
  }
8488
- if (!exprId) {
8492
+ if (exprId === void 0) {
8489
8493
  exprId = abortIdsByExpression.size;
8490
8494
  abortIdsByExpression.set(exprRoot, exprId);
8491
8495
  addStatement("render", section, exprRoot.node.extra?.referencedBindings, _marko_compiler.types.expressionStatement(_marko_compiler.types.callExpression(importRuntime("$signalReset"), [scopeIdentifier, _marko_compiler.types.numericLiteral(exprId)])), false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marko/runtime-tags",
3
- "version": "6.1.19",
3
+ "version": "6.1.20",
4
4
  "description": "Optimized runtime for Marko templates.",
5
5
  "keywords": [
6
6
  "api",