@marko/runtime-tags 6.3.10 → 6.3.12

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
@@ -45,8 +45,7 @@ const knownWrongAttrs = {
45
45
  "v-text": "${text}"
46
46
  };
47
47
  function getWrongAttrSuggestion(name) {
48
- const exact = knownWrongAttrs[name];
49
- if (exact) return exact;
48
+ if (Object.hasOwn(knownWrongAttrs, name)) return knownWrongAttrs[name];
50
49
  const colon = name.indexOf(":");
51
50
  if (colon > 0) {
52
51
  const rest = name.slice(colon + 1);
@@ -178,12 +177,12 @@ function assertExclusiveAttrs(attrs, onError = throwErr) {
178
177
  if (attrs) {
179
178
  let exclusiveAttrs;
180
179
  if (attrs.checkedChange) (exclusiveAttrs ||= []).push("checkedChange");
181
- if (attrs.checkedValue) {
180
+ if ("checkedValue" in attrs) {
182
181
  (exclusiveAttrs ||= []).push("checkedValue");
183
- if (attrs.checked) exclusiveAttrs.push("checked");
182
+ if ("checked" in attrs) exclusiveAttrs.push("checked");
184
183
  } else if (attrs.checkedValueChange) {
185
184
  (exclusiveAttrs ||= []).push("checkedValueChange");
186
- if (attrs.checked) exclusiveAttrs.push("checked");
185
+ if ("checked" in attrs) exclusiveAttrs.push("checked");
187
186
  }
188
187
  if (attrs.valueChange) (exclusiveAttrs ||= []).push("valueChange");
189
188
  if (exclusiveAttrs && exclusiveAttrs.length > 1) onError(`The attributes ${joinWithAnd(exclusiveAttrs)} are mutually exclusive.`);
@@ -799,7 +798,10 @@ function init(runtimeId = "M") {
799
798
  branch["#StartNode"] = startVisit;
800
799
  branch["#EndNode"] = visit.previousSibling === startVisit ? startVisit : parent.insertBefore(new Text(), visit);
801
800
  }
802
- while (i && orphanBranches[--i]["#Id"] > branchId) setParentBranch(orphanBranches.pop(), branch);
801
+ while (i && orphanBranches[i - 1]["#Id"] > branchId) {
802
+ i--;
803
+ setParentBranch(orphanBranches.pop(), branch);
804
+ }
803
805
  while (j && deferredOwners[--j]["#Id"] > branchId) {
804
806
  const owner = deferredOwners.pop();
805
807
  if (owner["#ClosestBranch"] !== owner) owner["#ClosestBranch"] = branch;
@@ -994,7 +996,12 @@ function _attr_input_value_default(scope, nodeAccessor, value) {
994
996
  setInputValue(el, restoreValue);
995
997
  }
996
998
  }
997
- function _attr_input_value(scope, nodeAccessor, value, valueChange) {
999
+ function _attr_input_value_dynamic_default(scope, nodeAccessor, value) {
1000
+ const el = scope[nodeAccessor];
1001
+ if (/i[ot]|e[cns]|^[bi]/.test(el.type)) _attr(el, "value", value);
1002
+ else _attr_input_value_default(scope, nodeAccessor, value);
1003
+ }
1004
+ function _attr_input_value(scope, nodeAccessor, value, valueChange, setDefault = _attr_input_value_default) {
998
1005
  const el = scope[nodeAccessor];
999
1006
  const normalizedValue = normalizeAttrValue(value) || "";
1000
1007
  assertHandlerIsFunction("valueChange", valueChange);
@@ -1002,7 +1009,10 @@ function _attr_input_value(scope, nodeAccessor, value, valueChange) {
1002
1009
  scope["ControlledValue:" + nodeAccessor] = normalizedValue;
1003
1010
  scope["ControlledType:" + nodeAccessor] = valueChange ? 2 : 5;
1004
1011
  if (valueChange && scope["#Gen"] < runId) setInputValue(el, normalizedValue);
1005
- else _attr_input_value_default(scope, nodeAccessor, normalizedValue);
1012
+ else setDefault(scope, nodeAccessor, normalizedValue);
1013
+ }
1014
+ function _attr_input_value_attribute_default(scope, nodeAccessor, value) {
1015
+ _attr(scope[nodeAccessor], "value", value);
1006
1016
  }
1007
1017
  function _attr_input_value_script(scope, nodeAccessor) {
1008
1018
  const el = scope[nodeAccessor];
@@ -1261,7 +1271,7 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
1261
1271
  for (const name in events) events[name] = 0;
1262
1272
  scope["ControlledType:" + nodeAccessor] = 5;
1263
1273
  scope["ControlledHandler:" + nodeAccessor] = 0;
1264
- switch (el.tagName) {
1274
+ switch (nextAttrs && el.tagName) {
1265
1275
  case "INPUT":
1266
1276
  if ("checked" in nextAttrs || "checkedChange" in nextAttrs) {
1267
1277
  _attr_input_checked(scope, nodeAccessor, nextAttrs.checked, nextAttrs.checkedChange);
@@ -1270,7 +1280,7 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
1270
1280
  _attr_input_checkedValue(scope, nodeAccessor, nextAttrs.checkedValue, nextAttrs.checkedValueChange, nextAttrs.value);
1271
1281
  skip = /^(?:value|checked(?:Value)?)(?:Change)?$/;
1272
1282
  } else if ("value" in nextAttrs || "valueChange" in nextAttrs) {
1273
- _attr_input_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange);
1283
+ _attr_input_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange, _attr_input_value_dynamic_default);
1274
1284
  skip = /^value(?:Change)?$/;
1275
1285
  }
1276
1286
  break;
@@ -2257,7 +2267,9 @@ exports._attr_input_checkedValue_script = _attr_input_checkedValue_script;
2257
2267
  exports._attr_input_checked_default = _attr_input_checked_default;
2258
2268
  exports._attr_input_checked_script = _attr_input_checked_script;
2259
2269
  exports._attr_input_value = _attr_input_value;
2270
+ exports._attr_input_value_attribute_default = _attr_input_value_attribute_default;
2260
2271
  exports._attr_input_value_default = _attr_input_value_default;
2272
+ exports._attr_input_value_dynamic_default = _attr_input_value_dynamic_default;
2261
2273
  exports._attr_input_value_script = _attr_input_value_script;
2262
2274
  exports._attr_nonce = _attr_nonce;
2263
2275
  exports._attr_select_value = _attr_select_value;
@@ -43,8 +43,7 @@ const knownWrongAttrs = {
43
43
  "v-text": "${text}"
44
44
  };
45
45
  function getWrongAttrSuggestion(name) {
46
- const exact = knownWrongAttrs[name];
47
- if (exact) return exact;
46
+ if (Object.hasOwn(knownWrongAttrs, name)) return knownWrongAttrs[name];
48
47
  const colon = name.indexOf(":");
49
48
  if (colon > 0) {
50
49
  const rest = name.slice(colon + 1);
@@ -176,12 +175,12 @@ function assertExclusiveAttrs(attrs, onError = throwErr) {
176
175
  if (attrs) {
177
176
  let exclusiveAttrs;
178
177
  if (attrs.checkedChange) (exclusiveAttrs ||= []).push("checkedChange");
179
- if (attrs.checkedValue) {
178
+ if ("checkedValue" in attrs) {
180
179
  (exclusiveAttrs ||= []).push("checkedValue");
181
- if (attrs.checked) exclusiveAttrs.push("checked");
180
+ if ("checked" in attrs) exclusiveAttrs.push("checked");
182
181
  } else if (attrs.checkedValueChange) {
183
182
  (exclusiveAttrs ||= []).push("checkedValueChange");
184
- if (attrs.checked) exclusiveAttrs.push("checked");
183
+ if ("checked" in attrs) exclusiveAttrs.push("checked");
185
184
  }
186
185
  if (attrs.valueChange) (exclusiveAttrs ||= []).push("valueChange");
187
186
  if (exclusiveAttrs && exclusiveAttrs.length > 1) onError(`The attributes ${joinWithAnd(exclusiveAttrs)} are mutually exclusive.`);
@@ -797,7 +796,10 @@ function init(runtimeId = "M") {
797
796
  branch["#StartNode"] = startVisit;
798
797
  branch["#EndNode"] = visit.previousSibling === startVisit ? startVisit : parent.insertBefore(new Text(), visit);
799
798
  }
800
- while (i && orphanBranches[--i]["#Id"] > branchId) setParentBranch(orphanBranches.pop(), branch);
799
+ while (i && orphanBranches[i - 1]["#Id"] > branchId) {
800
+ i--;
801
+ setParentBranch(orphanBranches.pop(), branch);
802
+ }
801
803
  while (j && deferredOwners[--j]["#Id"] > branchId) {
802
804
  const owner = deferredOwners.pop();
803
805
  if (owner["#ClosestBranch"] !== owner) owner["#ClosestBranch"] = branch;
@@ -992,7 +994,12 @@ function _attr_input_value_default(scope, nodeAccessor, value) {
992
994
  setInputValue(el, restoreValue);
993
995
  }
994
996
  }
995
- function _attr_input_value(scope, nodeAccessor, value, valueChange) {
997
+ function _attr_input_value_dynamic_default(scope, nodeAccessor, value) {
998
+ const el = scope[nodeAccessor];
999
+ if (/i[ot]|e[cns]|^[bi]/.test(el.type)) _attr(el, "value", value);
1000
+ else _attr_input_value_default(scope, nodeAccessor, value);
1001
+ }
1002
+ function _attr_input_value(scope, nodeAccessor, value, valueChange, setDefault = _attr_input_value_default) {
996
1003
  const el = scope[nodeAccessor];
997
1004
  const normalizedValue = normalizeAttrValue(value) || "";
998
1005
  assertHandlerIsFunction("valueChange", valueChange);
@@ -1000,7 +1007,10 @@ function _attr_input_value(scope, nodeAccessor, value, valueChange) {
1000
1007
  scope["ControlledValue:" + nodeAccessor] = normalizedValue;
1001
1008
  scope["ControlledType:" + nodeAccessor] = valueChange ? 2 : 5;
1002
1009
  if (valueChange && scope["#Gen"] < runId) setInputValue(el, normalizedValue);
1003
- else _attr_input_value_default(scope, nodeAccessor, normalizedValue);
1010
+ else setDefault(scope, nodeAccessor, normalizedValue);
1011
+ }
1012
+ function _attr_input_value_attribute_default(scope, nodeAccessor, value) {
1013
+ _attr(scope[nodeAccessor], "value", value);
1004
1014
  }
1005
1015
  function _attr_input_value_script(scope, nodeAccessor) {
1006
1016
  const el = scope[nodeAccessor];
@@ -1259,7 +1269,7 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
1259
1269
  for (const name in events) events[name] = 0;
1260
1270
  scope["ControlledType:" + nodeAccessor] = 5;
1261
1271
  scope["ControlledHandler:" + nodeAccessor] = 0;
1262
- switch (el.tagName) {
1272
+ switch (nextAttrs && el.tagName) {
1263
1273
  case "INPUT":
1264
1274
  if ("checked" in nextAttrs || "checkedChange" in nextAttrs) {
1265
1275
  _attr_input_checked(scope, nodeAccessor, nextAttrs.checked, nextAttrs.checkedChange);
@@ -1268,7 +1278,7 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
1268
1278
  _attr_input_checkedValue(scope, nodeAccessor, nextAttrs.checkedValue, nextAttrs.checkedValueChange, nextAttrs.value);
1269
1279
  skip = /^(?:value|checked(?:Value)?)(?:Change)?$/;
1270
1280
  } else if ("value" in nextAttrs || "valueChange" in nextAttrs) {
1271
- _attr_input_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange);
1281
+ _attr_input_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange, _attr_input_value_dynamic_default);
1272
1282
  skip = /^value(?:Change)?$/;
1273
1283
  }
1274
1284
  break;
@@ -2233,4 +2243,4 @@ function getSelectorOrResolve(selector, resolve) {
2233
2243
  return document.querySelector(selector) || (console.warn(`A lazy load trigger could not find an element matching "${selector}". The module was loaded immediately.`), resolve());
2234
2244
  }
2235
2245
  //#endregion
2236
- export { $signal, $signalReset, _assert_hoist, _assert_init, _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_checked_default, _attr_input_checked_script, _attr_input_value, _attr_input_value as _attr_textarea_value, _attr_input_value_default, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_script, _attr_input_value_script as _attr_textarea_value_script, _attr_nonce, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _await_content, _await_promise, _call, _child_setup, _closure, _closure_get, _const, _content, _content_closures, _content_resume, _dynamic_tag, _dynamic_tag_content, _el, _el_read, _enable_catch, _for_closure, _for_in, _for_of, _for_selector, _for_to, _for_until, _hoist, _hoist_resume, _html, _id, _if, _if_closure, _let, _let_change, _lifecycle, _load_event_trigger, _load_idle_trigger, _load_media_trigger, _load_race_trigger, _load_setup, _load_signal, _load_template, _load_visible_trigger, _on, _or, _resume, _resume_dynamic_tag, _return, _return_change, _script, _show, _style_rule_item, _style_shell, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, init, initEmbedded, ready, run };
2246
+ export { $signal, $signalReset, _assert_hoist, _assert_init, _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_checked_default, _attr_input_checked_script, _attr_input_value, _attr_input_value as _attr_textarea_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_input_value_script as _attr_textarea_value_script, _attr_nonce, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _await_content, _await_promise, _call, _child_setup, _closure, _closure_get, _const, _content, _content_closures, _content_resume, _dynamic_tag, _dynamic_tag_content, _el, _el_read, _enable_catch, _for_closure, _for_in, _for_of, _for_selector, _for_to, _for_until, _hoist, _hoist_resume, _html, _id, _if, _if_closure, _let, _let_change, _lifecycle, _load_event_trigger, _load_idle_trigger, _load_media_trigger, _load_race_trigger, _load_setup, _load_signal, _load_template, _load_visible_trigger, _on, _or, _resume, _resume_dynamic_tag, _return, _return_change, _script, _show, _style_rule_item, _style_shell, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, init, initEmbedded, ready, run };
@@ -45,8 +45,7 @@ const knownWrongAttrs = {
45
45
  "v-text": "${text}"
46
46
  };
47
47
  function getWrongAttrSuggestion(name) {
48
- const exact = knownWrongAttrs[name];
49
- if (exact) return exact;
48
+ if (Object.hasOwn(knownWrongAttrs, name)) return knownWrongAttrs[name];
50
49
  const colon = name.indexOf(":");
51
50
  if (colon > 0) {
52
51
  const rest = name.slice(colon + 1);
@@ -177,12 +176,12 @@ function assertExclusiveAttrs(attrs, onError = throwErr) {
177
176
  if (attrs) {
178
177
  let exclusiveAttrs;
179
178
  if (attrs.checkedChange) (exclusiveAttrs ||= []).push("checkedChange");
180
- if (attrs.checkedValue) {
179
+ if ("checkedValue" in attrs) {
181
180
  (exclusiveAttrs ||= []).push("checkedValue");
182
- if (attrs.checked) exclusiveAttrs.push("checked");
181
+ if ("checked" in attrs) exclusiveAttrs.push("checked");
183
182
  } else if (attrs.checkedValueChange) {
184
183
  (exclusiveAttrs ||= []).push("checkedValueChange");
185
- if (attrs.checked) exclusiveAttrs.push("checked");
184
+ if ("checked" in attrs) exclusiveAttrs.push("checked");
186
185
  }
187
186
  if (attrs.valueChange) (exclusiveAttrs ||= []).push("valueChange");
188
187
  if (exclusiveAttrs && exclusiveAttrs.length > 1) onError(`The attributes ${joinWithAnd(exclusiveAttrs)} are mutually exclusive.`);
@@ -2614,7 +2613,7 @@ function _attrs(data, nodeAccessor, scopeId, tagName) {
2614
2613
  let result = "";
2615
2614
  let skip = /[\s/>"'=]/;
2616
2615
  let events;
2617
- switch (tagName) {
2616
+ switch (data && tagName) {
2618
2617
  case "input":
2619
2618
  assertExclusiveAttrs(data);
2620
2619
  if (data.checkedChange) {
@@ -3005,7 +3004,9 @@ var ServerRendered = class {
3005
3004
  boundary.onNext = NOOP$1;
3006
3005
  onAbort(boundary.signal.reason);
3007
3006
  } else if (write || status === 0) {
3008
- const html = (head = head.consume()).flushHTML();
3007
+ head = head.consume();
3008
+ if (boundary.signal.aborted) return;
3009
+ const html = head.flushHTML();
3009
3010
  if (html) onWrite(html);
3010
3011
  if (status === 0) {
3011
3012
  if (!tick) offTick(onNext);
@@ -43,8 +43,7 @@ const knownWrongAttrs = {
43
43
  "v-text": "${text}"
44
44
  };
45
45
  function getWrongAttrSuggestion(name) {
46
- const exact = knownWrongAttrs[name];
47
- if (exact) return exact;
46
+ if (Object.hasOwn(knownWrongAttrs, name)) return knownWrongAttrs[name];
48
47
  const colon = name.indexOf(":");
49
48
  if (colon > 0) {
50
49
  const rest = name.slice(colon + 1);
@@ -175,12 +174,12 @@ function assertExclusiveAttrs(attrs, onError = throwErr) {
175
174
  if (attrs) {
176
175
  let exclusiveAttrs;
177
176
  if (attrs.checkedChange) (exclusiveAttrs ||= []).push("checkedChange");
178
- if (attrs.checkedValue) {
177
+ if ("checkedValue" in attrs) {
179
178
  (exclusiveAttrs ||= []).push("checkedValue");
180
- if (attrs.checked) exclusiveAttrs.push("checked");
179
+ if ("checked" in attrs) exclusiveAttrs.push("checked");
181
180
  } else if (attrs.checkedValueChange) {
182
181
  (exclusiveAttrs ||= []).push("checkedValueChange");
183
- if (attrs.checked) exclusiveAttrs.push("checked");
182
+ if ("checked" in attrs) exclusiveAttrs.push("checked");
184
183
  }
185
184
  if (attrs.valueChange) (exclusiveAttrs ||= []).push("valueChange");
186
185
  if (exclusiveAttrs && exclusiveAttrs.length > 1) onError(`The attributes ${joinWithAnd(exclusiveAttrs)} are mutually exclusive.`);
@@ -2612,7 +2611,7 @@ function _attrs(data, nodeAccessor, scopeId, tagName) {
2612
2611
  let result = "";
2613
2612
  let skip = /[\s/>"'=]/;
2614
2613
  let events;
2615
- switch (tagName) {
2614
+ switch (data && tagName) {
2616
2615
  case "input":
2617
2616
  assertExclusiveAttrs(data);
2618
2617
  if (data.checkedChange) {
@@ -3003,7 +3002,9 @@ var ServerRendered = class {
3003
3002
  boundary.onNext = NOOP$1;
3004
3003
  onAbort(boundary.signal.reason);
3005
3004
  } else if (write || status === 0) {
3006
- const html = (head = head.consume()).flushHTML();
3005
+ head = head.consume();
3006
+ if (boundary.signal.aborted) return;
3007
+ const html = head.flushHTML();
3007
3008
  if (html) onWrite(html);
3008
3009
  if (status === 0) {
3009
3010
  if (!tick) offTick(onNext);
@@ -6,7 +6,9 @@ export declare function _attr_input_checkedValue_default(scope: Scope, nodeAcces
6
6
  export declare function _attr_input_checkedValue(scope: Scope, nodeAccessor: Accessor, checkedValue: unknown, checkedValueChange: unknown, value: unknown): void;
7
7
  export declare function _attr_input_checkedValue_script(scope: Scope, nodeAccessor: Accessor): void;
8
8
  export declare function _attr_input_value_default(scope: Scope, nodeAccessor: Accessor, value: unknown): void;
9
- export declare function _attr_input_value(scope: Scope, nodeAccessor: Accessor, value: unknown, valueChange: unknown): void;
9
+ export declare function _attr_input_value_dynamic_default(scope: Scope, nodeAccessor: Accessor, value: unknown): void;
10
+ export declare function _attr_input_value(scope: Scope, nodeAccessor: Accessor, value: unknown, valueChange: unknown, setDefault?: typeof _attr_input_value_default): void;
11
+ export declare function _attr_input_value_attribute_default(scope: Scope, nodeAccessor: Accessor, value: unknown): void;
10
12
  export declare function _attr_input_value_script(scope: Scope, nodeAccessor: Accessor): void;
11
13
  export declare function _attr_select_value_default(scope: Scope, nodeAccessor: Accessor, value: unknown): void;
12
14
  export declare function _attr_select_value(scope: Scope, nodeAccessor: Accessor, value: unknown, valueChange: unknown): void;
package/dist/dom.d.ts CHANGED
@@ -5,7 +5,7 @@ export { _call } from "./common/helpers";
5
5
  export { $signal, $signalReset } from "./dom/abort-signal";
6
6
  export { compat } from "./dom/compat";
7
7
  export { _await_content, _await_promise, _dynamic_tag, _dynamic_tag_content, _for_in, _for_of, _for_to, _for_until, _if, _resume_dynamic_tag, _show, _try, } from "./dom/control-flow";
8
- export { _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checked_default, _attr_input_checked_script, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_value, _attr_input_value_default, _attr_input_value_script, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_input_value as _attr_textarea_value, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_script as _attr_textarea_value_script, } from "./dom/controllable";
8
+ export { _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checked_default, _attr_input_checked_script, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_input_value as _attr_textarea_value, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_script as _attr_textarea_value_script, } from "./dom/controllable";
9
9
  export { _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_content, _attr_nonce, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _html, _lifecycle, _style_rule_item, _style_shell, _text, _text_content, _to_text, } from "./dom/dom";
10
10
  export { _on } from "./dom/event";
11
11
  export { _load_event_trigger, _load_idle_trigger, _load_media_trigger, _load_race_trigger, _load_setup, _load_signal, _load_template, _load_visible_trigger, } from "./dom/load";
package/dist/dom.js CHANGED
@@ -508,7 +508,7 @@ function init(runtimeId = "M") {
508
508
  for (; startVisit.previousSibling && ~visits.indexOf(startVisit = startVisit.previousSibling););
509
509
  branch._ ??= visitScope, branch.K = branch.S = startVisit, visitType === "'" && (branch.a = startVisit);
510
510
  } else curBranchScopes = push(curBranchScopes, branch), accessor && (visitScope[accessor] = curBranchScopes, forEach(curBranchScopes, (scope) => scope._ ??= visitScope), curBranchScopes = branchScopesStack.pop()), startVisit = branchStarts.pop(), parent !== startVisit.parentNode && parent.prepend(startVisit), branch.S = startVisit, branch.K = visit.previousSibling === startVisit ? startVisit : parent.insertBefore(new Text(), visit);
511
- for (; i && orphanBranches[--i].L > branchId;) setParentBranch(orphanBranches.pop(), branch);
511
+ for (; i && orphanBranches[i - 1].L > branchId;) i--, setParentBranch(orphanBranches.pop(), branch);
512
512
  for (; j && deferredOwners[--j].L > branchId;) {
513
513
  let owner = deferredOwners.pop();
514
514
  owner.F !== owner && (owner.F = branch);
@@ -632,9 +632,16 @@ function _attr_input_value_default(scope, nodeAccessor, value) {
632
632
  el.defaultValue = normalizedValue, setInputValue(el, restoreValue);
633
633
  }
634
634
  }
635
- function _attr_input_value(scope, nodeAccessor, value, valueChange) {
635
+ function _attr_input_value_dynamic_default(scope, nodeAccessor, value) {
636
+ let el = scope[nodeAccessor];
637
+ /i[ot]|e[cns]|^[bi]/.test(el.type) ? _attr(el, "value", value) : _attr_input_value_default(scope, nodeAccessor, value);
638
+ }
639
+ function _attr_input_value(scope, nodeAccessor, value, valueChange, setDefault = _attr_input_value_default) {
636
640
  let el = scope[nodeAccessor], normalizedValue = normalizeAttrValue(value) || "";
637
- scope["E" + nodeAccessor] = valueChange, scope["G" + nodeAccessor] = normalizedValue, scope["F" + nodeAccessor] = valueChange ? 2 : 5, valueChange && scope.H < runId ? setInputValue(el, normalizedValue) : _attr_input_value_default(scope, nodeAccessor, normalizedValue);
641
+ scope["E" + nodeAccessor] = valueChange, scope["G" + nodeAccessor] = normalizedValue, scope["F" + nodeAccessor] = valueChange ? 2 : 5, valueChange && scope.H < runId ? setInputValue(el, normalizedValue) : setDefault(scope, nodeAccessor, normalizedValue);
642
+ }
643
+ function _attr_input_value_attribute_default(scope, nodeAccessor, value) {
644
+ _attr(scope[nodeAccessor], "value", value);
638
645
  }
639
646
  function _attr_input_value_script(scope, nodeAccessor) {
640
647
  let el = scope[nodeAccessor];
@@ -828,9 +835,9 @@ function _attrs_partial_content(scope, nodeAccessor, nextAttrs, skip) {
828
835
  function attrsInternal(scope, nodeAccessor, nextAttrs) {
829
836
  let el = scope[nodeAccessor], events = scope["I" + nodeAccessor], skip;
830
837
  for (let name in events) events[name] = 0;
831
- switch (scope["F" + nodeAccessor] = 5, scope["E" + nodeAccessor] = 0, el.tagName) {
838
+ switch (scope["F" + nodeAccessor] = 5, scope["E" + nodeAccessor] = 0, nextAttrs && el.tagName) {
832
839
  case "INPUT":
833
- "checked" in nextAttrs || "checkedChange" in nextAttrs ? (_attr_input_checked(scope, nodeAccessor, nextAttrs.checked, nextAttrs.checkedChange), skip = /^checked(?:Value)?(?:Change)?$/) : "checkedValue" in nextAttrs || "checkedValueChange" in nextAttrs ? (_attr_input_checkedValue(scope, nodeAccessor, nextAttrs.checkedValue, nextAttrs.checkedValueChange, nextAttrs.value), skip = /^(?:value|checked(?:Value)?)(?:Change)?$/) : ("value" in nextAttrs || "valueChange" in nextAttrs) && (_attr_input_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange), skip = /^value(?:Change)?$/);
840
+ "checked" in nextAttrs || "checkedChange" in nextAttrs ? (_attr_input_checked(scope, nodeAccessor, nextAttrs.checked, nextAttrs.checkedChange), skip = /^checked(?:Value)?(?:Change)?$/) : "checkedValue" in nextAttrs || "checkedValueChange" in nextAttrs ? (_attr_input_checkedValue(scope, nodeAccessor, nextAttrs.checkedValue, nextAttrs.checkedValueChange, nextAttrs.value), skip = /^(?:value|checked(?:Value)?)(?:Change)?$/) : ("value" in nextAttrs || "valueChange" in nextAttrs) && (_attr_input_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange, _attr_input_value_dynamic_default), skip = /^value(?:Change)?$/);
834
841
  break;
835
842
  case "SELECT":
836
843
  ("value" in nextAttrs || "valueChange" in nextAttrs) && (_attr_select_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange), skip = /^value(?:Change)?$/);
@@ -1345,7 +1352,7 @@ function _load_race_trigger(...triggers) {
1345
1352
  function getSelectorOrResolve(selector, resolve) {
1346
1353
  return document.querySelector(selector) || resolve();
1347
1354
  }
1348
- exports.$signal = $signal, exports.$signalReset = $signalReset, exports._assert_hoist = _assert_hoist, exports._assert_init = _assert_init, exports._attr = _attr, exports._attr_class = _attr_class, exports._attr_class_item = _attr_class_item, exports._attr_class_items = _attr_class_items, exports._attr_content = _attr_content, exports._attr_details_open = _attr_details_or_dialog_open, exports._attr_dialog_open = _attr_details_or_dialog_open, exports._attr_details_open_default = _attr_details_or_dialog_open_default, exports._attr_dialog_open_default = _attr_details_or_dialog_open_default, exports._attr_details_open_script = _attr_details_or_dialog_open_script, exports._attr_dialog_open_script = _attr_details_or_dialog_open_script, exports._attr_input_checked = _attr_input_checked, exports._attr_input_checkedValue = _attr_input_checkedValue, exports._attr_input_checkedValue_default = _attr_input_checkedValue_default, exports._attr_input_checkedValue_script = _attr_input_checkedValue_script, exports._attr_input_checked_default = _attr_input_checked_default, exports._attr_input_checked_script = _attr_input_checked_script, exports._attr_input_value = _attr_input_value, exports._attr_textarea_value = _attr_input_value, exports._attr_input_value_default = _attr_input_value_default, exports._attr_textarea_value_default = _attr_input_value_default, exports._attr_input_value_script = _attr_input_value_script, exports._attr_textarea_value_script = _attr_input_value_script, exports._attr_nonce = _attr_nonce, exports._attr_select_value = _attr_select_value, exports._attr_select_value_default = _attr_select_value_default, exports._attr_select_value_script = _attr_select_value_script, exports._attr_style = _attr_style, exports._attr_style_item = _attr_style_item, exports._attr_style_items = _attr_style_items, exports._attrs = _attrs, exports._attrs_content = _attrs_content, exports._attrs_partial = _attrs_partial, exports._attrs_partial_content = _attrs_partial_content, exports._attrs_script = _attrs_script, exports._await_content = _await_content, exports._await_promise = _await_promise, exports._call = _call, exports._child_setup = _child_setup, exports._closure = _closure, exports._closure_get = _closure_get, exports._const = _const, exports._content = _content, exports._content_closures = _content_closures, exports._content_resume = _content_resume, Object.defineProperty(exports, "_dynamic_tag", {
1355
+ exports.$signal = $signal, exports.$signalReset = $signalReset, exports._assert_hoist = _assert_hoist, exports._assert_init = _assert_init, exports._attr = _attr, exports._attr_class = _attr_class, exports._attr_class_item = _attr_class_item, exports._attr_class_items = _attr_class_items, exports._attr_content = _attr_content, exports._attr_details_open = _attr_details_or_dialog_open, exports._attr_dialog_open = _attr_details_or_dialog_open, exports._attr_details_open_default = _attr_details_or_dialog_open_default, exports._attr_dialog_open_default = _attr_details_or_dialog_open_default, exports._attr_details_open_script = _attr_details_or_dialog_open_script, exports._attr_dialog_open_script = _attr_details_or_dialog_open_script, exports._attr_input_checked = _attr_input_checked, exports._attr_input_checkedValue = _attr_input_checkedValue, exports._attr_input_checkedValue_default = _attr_input_checkedValue_default, exports._attr_input_checkedValue_script = _attr_input_checkedValue_script, exports._attr_input_checked_default = _attr_input_checked_default, exports._attr_input_checked_script = _attr_input_checked_script, exports._attr_input_value = _attr_input_value, exports._attr_textarea_value = _attr_input_value, exports._attr_input_value_attribute_default = _attr_input_value_attribute_default, exports._attr_input_value_default = _attr_input_value_default, exports._attr_textarea_value_default = _attr_input_value_default, exports._attr_input_value_dynamic_default = _attr_input_value_dynamic_default, exports._attr_input_value_script = _attr_input_value_script, exports._attr_textarea_value_script = _attr_input_value_script, exports._attr_nonce = _attr_nonce, exports._attr_select_value = _attr_select_value, exports._attr_select_value_default = _attr_select_value_default, exports._attr_select_value_script = _attr_select_value_script, exports._attr_style = _attr_style, exports._attr_style_item = _attr_style_item, exports._attr_style_items = _attr_style_items, exports._attrs = _attrs, exports._attrs_content = _attrs_content, exports._attrs_partial = _attrs_partial, exports._attrs_partial_content = _attrs_partial_content, exports._attrs_script = _attrs_script, exports._await_content = _await_content, exports._await_promise = _await_promise, exports._call = _call, exports._child_setup = _child_setup, exports._closure = _closure, exports._closure_get = _closure_get, exports._const = _const, exports._content = _content, exports._content_closures = _content_closures, exports._content_resume = _content_resume, Object.defineProperty(exports, "_dynamic_tag", {
1349
1356
  enumerable: !0,
1350
1357
  get: function() {
1351
1358
  return _dynamic_tag;
package/dist/dom.mjs CHANGED
@@ -507,7 +507,7 @@ function init(runtimeId = "M") {
507
507
  for (; startVisit.previousSibling && ~visits.indexOf(startVisit = startVisit.previousSibling););
508
508
  branch._ ??= visitScope, branch.K = branch.S = startVisit, visitType === "'" && (branch.a = startVisit);
509
509
  } else curBranchScopes = push(curBranchScopes, branch), accessor && (visitScope[accessor] = curBranchScopes, forEach(curBranchScopes, (scope) => scope._ ??= visitScope), curBranchScopes = branchScopesStack.pop()), startVisit = branchStarts.pop(), parent !== startVisit.parentNode && parent.prepend(startVisit), branch.S = startVisit, branch.K = visit.previousSibling === startVisit ? startVisit : parent.insertBefore(new Text(), visit);
510
- for (; i && orphanBranches[--i].L > branchId;) setParentBranch(orphanBranches.pop(), branch);
510
+ for (; i && orphanBranches[i - 1].L > branchId;) i--, setParentBranch(orphanBranches.pop(), branch);
511
511
  for (; j && deferredOwners[--j].L > branchId;) {
512
512
  let owner = deferredOwners.pop();
513
513
  owner.F !== owner && (owner.F = branch);
@@ -631,9 +631,16 @@ function _attr_input_value_default(scope, nodeAccessor, value) {
631
631
  el.defaultValue = normalizedValue, setInputValue(el, restoreValue);
632
632
  }
633
633
  }
634
- function _attr_input_value(scope, nodeAccessor, value, valueChange) {
634
+ function _attr_input_value_dynamic_default(scope, nodeAccessor, value) {
635
+ let el = scope[nodeAccessor];
636
+ /i[ot]|e[cns]|^[bi]/.test(el.type) ? _attr(el, "value", value) : _attr_input_value_default(scope, nodeAccessor, value);
637
+ }
638
+ function _attr_input_value(scope, nodeAccessor, value, valueChange, setDefault = _attr_input_value_default) {
635
639
  let el = scope[nodeAccessor], normalizedValue = normalizeAttrValue(value) || "";
636
- scope["E" + nodeAccessor] = valueChange, scope["G" + nodeAccessor] = normalizedValue, scope["F" + nodeAccessor] = valueChange ? 2 : 5, valueChange && scope.H < runId ? setInputValue(el, normalizedValue) : _attr_input_value_default(scope, nodeAccessor, normalizedValue);
640
+ scope["E" + nodeAccessor] = valueChange, scope["G" + nodeAccessor] = normalizedValue, scope["F" + nodeAccessor] = valueChange ? 2 : 5, valueChange && scope.H < runId ? setInputValue(el, normalizedValue) : setDefault(scope, nodeAccessor, normalizedValue);
641
+ }
642
+ function _attr_input_value_attribute_default(scope, nodeAccessor, value) {
643
+ _attr(scope[nodeAccessor], "value", value);
637
644
  }
638
645
  function _attr_input_value_script(scope, nodeAccessor) {
639
646
  let el = scope[nodeAccessor];
@@ -827,9 +834,9 @@ function _attrs_partial_content(scope, nodeAccessor, nextAttrs, skip) {
827
834
  function attrsInternal(scope, nodeAccessor, nextAttrs) {
828
835
  let el = scope[nodeAccessor], events = scope["I" + nodeAccessor], skip;
829
836
  for (let name in events) events[name] = 0;
830
- switch (scope["F" + nodeAccessor] = 5, scope["E" + nodeAccessor] = 0, el.tagName) {
837
+ switch (scope["F" + nodeAccessor] = 5, scope["E" + nodeAccessor] = 0, nextAttrs && el.tagName) {
831
838
  case "INPUT":
832
- "checked" in nextAttrs || "checkedChange" in nextAttrs ? (_attr_input_checked(scope, nodeAccessor, nextAttrs.checked, nextAttrs.checkedChange), skip = /^checked(?:Value)?(?:Change)?$/) : "checkedValue" in nextAttrs || "checkedValueChange" in nextAttrs ? (_attr_input_checkedValue(scope, nodeAccessor, nextAttrs.checkedValue, nextAttrs.checkedValueChange, nextAttrs.value), skip = /^(?:value|checked(?:Value)?)(?:Change)?$/) : ("value" in nextAttrs || "valueChange" in nextAttrs) && (_attr_input_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange), skip = /^value(?:Change)?$/);
839
+ "checked" in nextAttrs || "checkedChange" in nextAttrs ? (_attr_input_checked(scope, nodeAccessor, nextAttrs.checked, nextAttrs.checkedChange), skip = /^checked(?:Value)?(?:Change)?$/) : "checkedValue" in nextAttrs || "checkedValueChange" in nextAttrs ? (_attr_input_checkedValue(scope, nodeAccessor, nextAttrs.checkedValue, nextAttrs.checkedValueChange, nextAttrs.value), skip = /^(?:value|checked(?:Value)?)(?:Change)?$/) : ("value" in nextAttrs || "valueChange" in nextAttrs) && (_attr_input_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange, _attr_input_value_dynamic_default), skip = /^value(?:Change)?$/);
833
840
  break;
834
841
  case "SELECT":
835
842
  ("value" in nextAttrs || "valueChange" in nextAttrs) && (_attr_select_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange), skip = /^value(?:Change)?$/);
@@ -1345,4 +1352,4 @@ function getSelectorOrResolve(selector, resolve) {
1345
1352
  return document.querySelector(selector) || resolve();
1346
1353
  }
1347
1354
  //#endregion
1348
- export { $signal, $signalReset, _assert_hoist, _assert_init, _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_checked_default, _attr_input_checked_script, _attr_input_value, _attr_input_value as _attr_textarea_value, _attr_input_value_default, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_script, _attr_input_value_script as _attr_textarea_value_script, _attr_nonce, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _await_content, _await_promise, _call, _child_setup, _closure, _closure_get, _const, _content, _content_closures, _content_resume, _dynamic_tag, _dynamic_tag_content, _el, _el_read, _enable_catch, _for_closure, _for_in, _for_of, _for_selector, _for_to, _for_until, _hoist, _hoist_resume, _html, _id, _if, _if_closure, _let, _let_change, _lifecycle, _load_event_trigger, _load_idle_trigger, _load_media_trigger, _load_race_trigger, _load_setup, _load_signal, _load_template, _load_visible_trigger, _on, _or, _resume, _resume_dynamic_tag, _return, _return_change, _script, _show, _style_rule_item, _style_shell, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, init, initEmbedded, ready, run };
1355
+ export { $signal, $signalReset, _assert_hoist, _assert_init, _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_checked_default, _attr_input_checked_script, _attr_input_value, _attr_input_value as _attr_textarea_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_input_value_script as _attr_textarea_value_script, _attr_nonce, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _await_content, _await_promise, _call, _child_setup, _closure, _closure_get, _const, _content, _content_closures, _content_resume, _dynamic_tag, _dynamic_tag_content, _el, _el_read, _enable_catch, _for_closure, _for_in, _for_of, _for_selector, _for_to, _for_until, _hoist, _hoist_resume, _html, _id, _if, _if_closure, _let, _let_change, _lifecycle, _load_event_trigger, _load_idle_trigger, _load_media_trigger, _load_race_trigger, _load_setup, _load_signal, _load_template, _load_visible_trigger, _on, _or, _resume, _resume_dynamic_tag, _return, _return_change, _script, _show, _style_rule_item, _style_shell, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, init, initEmbedded, ready, run };
package/dist/html.js CHANGED
@@ -1722,7 +1722,7 @@ function _attr_nullish(name, value, attr) {
1722
1722
  }
1723
1723
  function _attrs(data, nodeAccessor, scopeId, tagName) {
1724
1724
  let result = "", skip = /[\s/>"'=]/, events;
1725
- switch (tagName) {
1725
+ switch (data && tagName) {
1726
1726
  case "input":
1727
1727
  data.checkedChange ? (result += _attr_input_checked(scopeId, nodeAccessor, data.checked, data.checkedChange, 1), skip = /^checked(?:Value)?(?:Change)?$|[\s/>"'=]/) : "checkedValue" in data || data.checkedValueChange ? (result += _attr_input_checkedValue(scopeId, nodeAccessor, data.checkedValue, data.checkedValueChange, data.value, 1), skip = /^(?:value|checked(?:Value)?)(?:Change)?$|[\s/>"'=]/) : data.valueChange && (result += _attr_input_value(scopeId, nodeAccessor, data.value, data.valueChange, 1), skip = /^value(?:Change)?$|[\s/>"'=]/);
1728
1728
  break;
@@ -1960,7 +1960,8 @@ var ServerRendered = class {
1960
1960
  let status = boundary.flush();
1961
1961
  if (status === 2) tick || offTick(onNext), boundary.onNext = NOOP$1, onAbort(boundary.signal.reason);
1962
1962
  else if (write || status === 0) {
1963
- let html = (head = head.consume()).flushHTML();
1963
+ if (head = head.consume(), boundary.signal.aborted) return;
1964
+ let html = head.flushHTML();
1964
1965
  html && onWrite(html), status === 0 ? (tick || offTick(onNext), onClose()) : tick = !0;
1965
1966
  } else tick && (tick = !1, queueTick(onNext));
1966
1967
  };
package/dist/html.mjs CHANGED
@@ -1721,7 +1721,7 @@ function _attr_nullish(name, value, attr) {
1721
1721
  }
1722
1722
  function _attrs(data, nodeAccessor, scopeId, tagName) {
1723
1723
  let result = "", skip = /[\s/>"'=]/, events;
1724
- switch (tagName) {
1724
+ switch (data && tagName) {
1725
1725
  case "input":
1726
1726
  data.checkedChange ? (result += _attr_input_checked(scopeId, nodeAccessor, data.checked, data.checkedChange, 1), skip = /^checked(?:Value)?(?:Change)?$|[\s/>"'=]/) : "checkedValue" in data || data.checkedValueChange ? (result += _attr_input_checkedValue(scopeId, nodeAccessor, data.checkedValue, data.checkedValueChange, data.value, 1), skip = /^(?:value|checked(?:Value)?)(?:Change)?$|[\s/>"'=]/) : data.valueChange && (result += _attr_input_value(scopeId, nodeAccessor, data.value, data.valueChange, 1), skip = /^value(?:Change)?$|[\s/>"'=]/);
1727
1727
  break;
@@ -1959,7 +1959,8 @@ var ServerRendered = class {
1959
1959
  let status = boundary.flush();
1960
1960
  if (status === 2) tick || offTick(onNext), boundary.onNext = NOOP$1, onAbort(boundary.signal.reason);
1961
1961
  else if (write || status === 0) {
1962
- let html = (head = head.consume()).flushHTML();
1962
+ if (head = head.consume(), boundary.signal.aborted) return;
1963
+ let html = head.flushHTML();
1963
1964
  html && onWrite(html), status === 0 ? (tick || offTick(onNext), onClose()) : tick = !0;
1964
1965
  } else tick && (tick = !1, queueTick(onNext));
1965
1966
  };
@@ -233,8 +233,7 @@ const knownWrongAttrs = {
233
233
  "v-text": "${text}"
234
234
  };
235
235
  function getWrongAttrSuggestion(name) {
236
- const exact = knownWrongAttrs[name];
237
- if (exact) return exact;
236
+ if (Object.hasOwn(knownWrongAttrs, name)) return knownWrongAttrs[name];
238
237
  const colon = name.indexOf(":");
239
238
  if (colon > 0) {
240
239
  const rest = name.slice(colon + 1);
@@ -1156,8 +1155,8 @@ function analyzeExpressionTagName(name, extra) {
1156
1155
  pending.push(path.get("consequent"));
1157
1156
  if (path.node.alternate) pending.push(path.get("alternate"));
1158
1157
  } else if (path.isLogicalExpression()) {
1159
- if (path.node.operator === "||") pending.push(path.get("left"));
1160
- else nullable = true;
1158
+ if (path.node.operator === "&&") nullable = true;
1159
+ else pending.push(path.get("left"));
1161
1160
  pending.push(path.get("right"));
1162
1161
  } else if (path.isAssignmentExpression()) pending.push(path.get("right"));
1163
1162
  else if (path.isBinaryExpression()) type = path.node.operator !== "+" || type === void 0 || type === 0 ? 0 : 2;
@@ -1403,8 +1402,11 @@ function getCommonSection(section, other) {
1403
1402
  throw new Error("No common section");
1404
1403
  }
1405
1404
  function finalizeParamSerializeReasonGroups(section) {
1406
- if (isReasonDynamic(section.serializeReason)) for (const [paramSection, params] of groupParamsBySection(section.serializeReason.param)) ensureParamReasonGroup(paramSection, params);
1407
- for (const reason of section.serializeReasons.values()) if (isReasonDynamic(reason)) for (const [paramSection, params] of groupParamsBySection(reason.param)) ensureParamReasonGroup(paramSection, params);
1405
+ ensureReasonGroups(section.serializeReason);
1406
+ for (const reason of section.serializeReasons.values()) ensureReasonGroups(reason);
1407
+ }
1408
+ function ensureReasonGroups(reason) {
1409
+ if (isReasonDynamic(reason)) for (const [paramSection, params] of groupParamsBySection(reason.param)) ensureParamReasonGroup(paramSection, params);
1408
1410
  }
1409
1411
  function ensureParamReasonGroup(section, reason) {
1410
1412
  const { paramReasonGroups } = section;
@@ -1695,12 +1697,12 @@ function assertExclusiveAttrs(attrs, onError = throwErr) {
1695
1697
  if (attrs) {
1696
1698
  let exclusiveAttrs;
1697
1699
  if (attrs.checkedChange) (exclusiveAttrs ||= []).push("checkedChange");
1698
- if (attrs.checkedValue) {
1700
+ if ("checkedValue" in attrs) {
1699
1701
  (exclusiveAttrs ||= []).push("checkedValue");
1700
- if (attrs.checked) exclusiveAttrs.push("checked");
1702
+ if ("checked" in attrs) exclusiveAttrs.push("checked");
1701
1703
  } else if (attrs.checkedValueChange) {
1702
1704
  (exclusiveAttrs ||= []).push("checkedValueChange");
1703
- if (attrs.checked) exclusiveAttrs.push("checked");
1705
+ if ("checked" in attrs) exclusiveAttrs.push("checked");
1704
1706
  }
1705
1707
  if (attrs.valueChange) (exclusiveAttrs ||= []).push("valueChange");
1706
1708
  if (exclusiveAttrs && exclusiveAttrs.length > 1) onError(`The attributes ${joinWithAnd(exclusiveAttrs)} are mutually exclusive.`);
@@ -1872,7 +1874,7 @@ function _attrs(data, nodeAccessor, scopeId, tagName) {
1872
1874
  let result = "";
1873
1875
  let skip = /[\s/>"'=]/;
1874
1876
  let events;
1875
- switch (tagName) {
1877
+ switch (data && tagName) {
1876
1878
  case "input":
1877
1879
  if (data.checkedChange) {
1878
1880
  result += _attr_input_checked(scopeId, nodeAccessor, data.checked, data.checkedChange, 1);
@@ -4329,7 +4331,7 @@ var native_tag_default = {
4329
4331
  }
4330
4332
  if (tagName === "option") assertOptionInSelectWithValue(tag);
4331
4333
  const isTextOnly = isTextOnlyNativeTag(tag);
4332
- const seen = {};
4334
+ const seen = Object.create(null);
4333
4335
  const { attributes } = tag.node;
4334
4336
  let injectNonce = isInjectNonceTag(tagName);
4335
4337
  let hasDynamicAttributes = false;
@@ -4570,9 +4572,11 @@ var native_tag_default = {
4570
4572
  if (injectNonce) addStatement("render", tagSection, void 0, _marko_compiler.types.expressionStatement(callRuntime("_attr_nonce", scopeIdentifier, getScopeAccessorLiteral(nodeBinding))), void 0, true);
4571
4573
  if (staticControllable) {
4572
4574
  const hasChangeHandler = !!staticControllable.attrs[1];
4575
+ const defaultHelper = getDOMControllableDefaultHelper(staticControllable);
4573
4576
  const referencedBindings = staticControllable.attrs.find(Boolean).value.extra?.referencedBindings;
4574
4577
  const values = (hasChangeHandler ? staticControllable.attrs : staticControllable.attrs.toSpliced(1, 1)).map((attr) => attr?.value);
4575
- addStatement("render", tagSection, referencedBindings, _marko_compiler.types.expressionStatement(callRuntime(hasChangeHandler ? staticControllable.helper : `${staticControllable.helper}_default`, scopeIdentifier, visitAccessor, ...values)));
4578
+ if (hasChangeHandler && defaultHelper !== `${staticControllable.helper}_default`) values.push(importRuntime(defaultHelper));
4579
+ addStatement("render", tagSection, referencedBindings, _marko_compiler.types.expressionStatement(callRuntime(hasChangeHandler ? staticControllable.helper : defaultHelper, scopeIdentifier, visitAccessor, ...values)));
4576
4580
  if (hasChangeHandler) addStatement("effect", tagSection, void 0, _marko_compiler.types.expressionStatement(callRuntime(`${staticControllable.helper}_script`, scopeIdentifier, visitAccessor)));
4577
4581
  }
4578
4582
  for (const attr of staticAttrs) {
@@ -4682,11 +4686,16 @@ function getRelatedControllable(tagName, attrs) {
4682
4686
  attrs.value
4683
4687
  ]
4684
4688
  };
4685
- if (attrs.value || attrs.valueChange) return {
4686
- special: false,
4687
- helper: "_attr_input_value",
4688
- attrs: [attrs.value, attrs.valueChange]
4689
- };
4689
+ if (attrs.value || attrs.valueChange) {
4690
+ const valueMode = getInputValueMode(attrs.type);
4691
+ if (valueMode === "attribute" && !attrs.valueChange) break;
4692
+ return {
4693
+ special: false,
4694
+ helper: "_attr_input_value",
4695
+ attrs: [attrs.value, attrs.valueChange],
4696
+ valueMode
4697
+ };
4698
+ }
4690
4699
  break;
4691
4700
  case "select":
4692
4701
  if (attrs.value || attrs.valueChange) return {
@@ -4712,8 +4721,25 @@ function getRelatedControllable(tagName, attrs) {
4712
4721
  break;
4713
4722
  }
4714
4723
  }
4724
+ function getInputValueMode(typeAttr) {
4725
+ if (!typeAttr) return;
4726
+ const type = evaluate(typeAttr.value);
4727
+ if (!type.confident) return "dynamic";
4728
+ if (typeof type.computed === "string") switch (type.computed.toLowerCase()) {
4729
+ case "button":
4730
+ case "checkbox":
4731
+ case "hidden":
4732
+ case "image":
4733
+ case "radio":
4734
+ case "reset":
4735
+ case "submit": return "attribute";
4736
+ }
4737
+ }
4738
+ function getDOMControllableDefaultHelper(controllable) {
4739
+ return controllable.helper === "_attr_input_value" && controllable.valueMode ? `_attr_input_value_${controllable.valueMode}_default` : `${controllable.helper}_default`;
4740
+ }
4715
4741
  function getUsedAttrs(tagName, tag) {
4716
- const seen = {};
4742
+ const seen = Object.create(null);
4717
4743
  const { attributes } = tag;
4718
4744
  const maybeStaticAttrs = /* @__PURE__ */ new Set();
4719
4745
  const skipProps = /* @__PURE__ */ new Set();
@@ -7887,7 +7913,10 @@ var html_comment_default = {
7887
7913
  const nodeBinding = tagExtra[kNodeBinding$1];
7888
7914
  const write = writeTo(tag);
7889
7915
  if (isOutputHTML()) {
7890
- for (const child of tag.node.body.body) if (_marko_compiler.types.isMarkoText(child)) write`${escapeCommentText(child.value)}`;
7916
+ const { body } = tag.node.body;
7917
+ if (nodeBinding && isEmptiableCommentBody(body)) if (body.length) write`${_marko_compiler.types.logicalExpression("||", buildCommentValue(body), _marko_compiler.types.stringLiteral(" "))}`;
7918
+ else write` `;
7919
+ else for (const child of body) if (_marko_compiler.types.isMarkoText(child)) write`${escapeCommentText(child.value)}`;
7891
7920
  else if (_marko_compiler.types.isMarkoPlaceholder(child)) write`${callRuntime(child.escape ? "_escape_comment" : "_unescaped", child.value)}`;
7892
7921
  } else {
7893
7922
  const textLiteral = bodyToTextLiteral(tag.node.body);
@@ -7907,6 +7936,21 @@ var html_comment_default = {
7907
7936
  descriptionMoreURL: "https://markojs.com/docs/reference/core-tag#html-comment"
7908
7937
  }]
7909
7938
  };
7939
+ function isEmptiableCommentBody(body) {
7940
+ for (const child of body) if (!_marko_compiler.types.isMarkoPlaceholder(child) || isNonEmptyLiteral(child.value)) return false;
7941
+ return true;
7942
+ }
7943
+ function isNonEmptyLiteral(value) {
7944
+ return _marko_compiler.types.isStringLiteral(value) ? !!value.value : _marko_compiler.types.isNumericLiteral(value);
7945
+ }
7946
+ function buildCommentValue(body) {
7947
+ let value;
7948
+ for (const child of body) {
7949
+ const part = callRuntime(child.escape ? "_escape_comment" : "_unescaped", child.value);
7950
+ value = value ? _marko_compiler.types.binaryExpression("+", value, part) : part;
7951
+ }
7952
+ return value;
7953
+ }
7910
7954
  //#endregion
7911
7955
  //#region src/translator/core/html-script.ts
7912
7956
  var html_script_default = {
@@ -8193,12 +8237,14 @@ var script_default = {
8193
8237
  let referencesScope = false;
8194
8238
  if (isFunction) if (value.async || value.generator) referencesScope = traverseContains(value, isScopeIdentifier);
8195
8239
  else if (_marko_compiler.types.isBlockStatement(value.body)) {
8196
- let hasDeclaration = false;
8197
- for (const child of value.body.body) if (_marko_compiler.types.isDeclaration(child)) {
8198
- hasDeclaration = true;
8199
- break;
8240
+ if (!traverseContains(value.body, isReturnStatement)) {
8241
+ let hasDeclaration = false;
8242
+ for (const child of value.body.body) if (_marko_compiler.types.isDeclaration(child)) {
8243
+ hasDeclaration = true;
8244
+ break;
8245
+ }
8246
+ inlineBody = hasDeclaration ? value.body : value.body.body;
8200
8247
  }
8201
- inlineBody = hasDeclaration ? value.body : value.body.body;
8202
8248
  } else inlineBody = _marko_compiler.types.expressionStatement(value.body);
8203
8249
  addStatement("effect", section, referencedBindings, inlineBody || _marko_compiler.types.expressionStatement(_marko_compiler.types.callExpression(value, referencesScope ? [scopeIdentifier] : [])));
8204
8250
  } else addHTMLEffectCall(section, referencedBindings);
@@ -8227,6 +8273,18 @@ function isAwaitExpression(node) {
8227
8273
  default: return false;
8228
8274
  }
8229
8275
  }
8276
+ function isReturnStatement(node) {
8277
+ switch (node.type) {
8278
+ case "FunctionDeclaration":
8279
+ case "FunctionExpression":
8280
+ case "ArrowFunctionExpression":
8281
+ case "ClassMethod":
8282
+ case "ObjectMethod":
8283
+ case "ClassPrivateMethod": return skip;
8284
+ case "ReturnStatement": return true;
8285
+ default: return false;
8286
+ }
8287
+ }
8230
8288
  //#endregion
8231
8289
  //#region src/translator/core/server.ts
8232
8290
  var server_default = {
@@ -8865,6 +8923,7 @@ var import_declaration_default = {
8865
8923
  if (!(tagImport && (0, _marko_compiler_babel_utils.loadFileForImport)(file, value))) throw importDecl.buildCodeFrameError("Unable to resolve marko file for load import.");
8866
8924
  if ((node.importKind || "value") !== "value") throw importDecl.buildCodeFrameError("Invalid load import.");
8867
8925
  for (const specifier of importDecl.get("specifiers")) if (!_marko_compiler.types.isImportDefaultSpecifier(specifier.node)) throw specifier.buildCodeFrameError("Invalid load import, only a default specifier is allowed.");
8926
+ if (!node.specifiers.some(_marko_compiler.types.isImportDefaultSpecifier)) throw importDecl.buildCodeFrameError("Invalid load import, a default specifier is required.");
8868
8927
  }
8869
8928
  },
8870
8929
  translate: { exit(importDecl) {
@@ -9817,6 +9876,7 @@ function getFeatureTypeFromCoreTagName(tagName) {
9817
9876
  case "lifecycle":
9818
9877
  case "log":
9819
9878
  case "return":
9879
+ case "show":
9820
9880
  case "try": return "tags";
9821
9881
  default: return;
9822
9882
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marko/runtime-tags",
3
- "version": "6.3.10",
3
+ "version": "6.3.12",
4
4
  "description": "Optimized runtime for Marko templates.",
5
5
  "keywords": [
6
6
  "api",