marko 6.4.7 → 6.4.9

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.
Files changed (89) hide show
  1. package/dist/common/constants/closure-signal-prop.d.ts +1 -1
  2. package/dist/common/constants/closure-signal-prop.debug.d.ts +1 -1
  3. package/dist/debug/dom/catch.feat.js +1 -1
  4. package/dist/debug/dom/catch.feat.mjs +1 -1
  5. package/dist/debug/dom/controllable-input.feat.js +1 -1
  6. package/dist/debug/dom/controllable-input.feat.mjs +1 -1
  7. package/dist/debug/dom/controllable-open.feat.js +1 -1
  8. package/dist/debug/dom/controllable-open.feat.mjs +1 -1
  9. package/dist/debug/dom/controllable-select.feat.js +1 -1
  10. package/dist/debug/dom/controllable-select.feat.mjs +1 -1
  11. package/dist/debug/dom/controllable-textarea.feat.js +1 -1
  12. package/dist/debug/dom/controllable-textarea.feat.mjs +1 -1
  13. package/dist/debug/dom/controllable.feat.js +1 -1
  14. package/dist/debug/dom/controllable.feat.mjs +1 -1
  15. package/dist/debug/dom/dynamic-tag-script.feat.js +1 -1
  16. package/dist/debug/dom/dynamic-tag-script.feat.mjs +1 -1
  17. package/dist/debug/dom/dynamic-tag-var.feat.js +1 -1
  18. package/dist/debug/dom/dynamic-tag-var.feat.mjs +1 -1
  19. package/dist/debug/dom/lazy.feat.js +1 -1
  20. package/dist/debug/dom/lazy.feat.mjs +1 -1
  21. package/dist/debug/dom/placeholder.feat.js +1 -1
  22. package/dist/debug/dom/placeholder.feat.mjs +1 -1
  23. package/dist/debug/{dom-D8znnhpf.js → dom-QkYva5Qx.js} +35 -61
  24. package/dist/debug/{dom-CFCBDift.mjs → dom-VKjkbuuo.mjs} +36 -50
  25. package/dist/debug/dom.js +4 -4
  26. package/dist/debug/dom.mjs +4 -4
  27. package/dist/debug/html.js +20 -13
  28. package/dist/debug/html.mjs +18 -11
  29. package/dist/dom/catch.feat.js +3 -3
  30. package/dist/dom/catch.feat.mjs +1 -1
  31. package/dist/dom/compat.d.ts +1 -1
  32. package/dist/dom/control-flow.d.ts +1 -1
  33. package/dist/dom/controllable-input.feat.js +1 -1
  34. package/dist/dom/controllable-input.feat.mjs +1 -1
  35. package/dist/dom/controllable-open.feat.js +1 -1
  36. package/dist/dom/controllable-open.feat.mjs +1 -1
  37. package/dist/dom/controllable-select.feat.js +1 -1
  38. package/dist/dom/controllable-select.feat.mjs +1 -1
  39. package/dist/dom/controllable-textarea.feat.js +1 -1
  40. package/dist/dom/controllable-textarea.feat.mjs +1 -1
  41. package/dist/dom/controllable.feat.js +1 -1
  42. package/dist/dom/controllable.feat.mjs +1 -1
  43. package/dist/dom/dom.d.ts +2 -3
  44. package/dist/dom/dynamic-tag-script.feat.js +2 -2
  45. package/dist/dom/dynamic-tag-script.feat.mjs +1 -1
  46. package/dist/dom/dynamic-tag-var.feat.js +3 -3
  47. package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
  48. package/dist/dom/lazy.feat.js +1 -1
  49. package/dist/dom/lazy.feat.mjs +1 -1
  50. package/dist/dom/placeholder.feat.js +3 -3
  51. package/dist/dom/placeholder.feat.mjs +1 -1
  52. package/dist/dom/resume.d.ts +1 -1
  53. package/dist/dom/scope.d.ts +1 -1
  54. package/dist/dom/signals.d.ts +1 -1
  55. package/dist/{dom-CVAevsbz.mjs → dom-DtKQb840.mjs} +19 -33
  56. package/dist/{dom-Bpkm72vV.js → dom-IujlfJ6b.js} +82 -106
  57. package/dist/dom.js +31 -31
  58. package/dist/dom.mjs +4 -4
  59. package/dist/html/serializer.d.ts +1 -1
  60. package/dist/html/writer.d.ts +3 -3
  61. package/dist/html.d.ts +1 -1
  62. package/dist/html.js +21 -15
  63. package/dist/html.mjs +21 -15
  64. package/dist/translator/core/show.d.ts +3 -4
  65. package/dist/translator/index.js +1253 -1134
  66. package/dist/translator/util/bindings.d.ts +6 -5
  67. package/dist/translator/util/branch-tag.d.ts +1 -1
  68. package/dist/translator/util/constants/slot-kind.d.ts +1 -1
  69. package/dist/translator/util/known-tag.d.ts +6 -2
  70. package/dist/translator/util/module-registrations.d.ts +1 -1
  71. package/dist/translator/util/optional.d.ts +1 -0
  72. package/dist/translator/util/params-tree.d.ts +3 -3
  73. package/dist/translator/util/reasons.d.ts +3 -4
  74. package/dist/translator/util/references.d.ts +13 -8
  75. package/dist/translator/util/replace-with-statements.d.ts +4 -0
  76. package/dist/translator/util/runtime.d.ts +1 -0
  77. package/dist/translator/util/scope-accessor.d.ts +1 -1
  78. package/dist/translator/util/sections.d.ts +42 -17
  79. package/dist/translator/util/signals.d.ts +3 -11
  80. package/dist/translator/util/slots.d.ts +1 -1
  81. package/dist/translator/util/solve-reasons.d.ts +6 -0
  82. package/dist/translator/util/static-text.d.ts +1 -0
  83. package/dist/translator/util/structure.d.ts +3 -2
  84. package/dist/translator/util/tag-import.d.ts +0 -2
  85. package/dist/translator/util/write-guard.d.ts +4 -1
  86. package/dist/translator/visitors/placeholder.d.ts +4 -4
  87. package/package.json +4 -4
  88. package/tags-html.d.ts +3 -0
  89. package/dist/translator/visitors/constants/sibling-text.d.ts +0 -6
package/dist/debug/dom.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_control_flow = require("./dom-D8znnhpf.js");
3
+ const require_control_flow = require("./dom-QkYva5Qx.js");
4
4
  //#region src/common/attr-tag.ts
5
5
  const empty = [];
6
6
  const rest = Symbol("Attribute Tag");
@@ -83,7 +83,7 @@ const compat = {
83
83
  if (this.scope) require_control_flow.destroyBranch(this.scope);
84
84
  },
85
85
  resolveRegistered(value, $global) {
86
- if (Array.isArray(value) && typeof value[0] === "string") return require_control_flow.getRegisteredWithScope(value[0], getRenderScopes($global)?.[value[1]]);
86
+ if (Array.isArray(value) && typeof value[0] === "string") return require_control_flow.getRegisteredWithScope(getRenderScopes($global)?.[value[1]], value[0]);
87
87
  return value;
88
88
  },
89
89
  createRenderer(params, clone) {
@@ -117,7 +117,7 @@ const compat = {
117
117
  renderer[require_control_flow.Params]?.(branch, renderer._ ? args[0] : args);
118
118
  };
119
119
  component.effects = require_control_flow.rendering ? renderBranch() : require_control_flow.prepareEffects(renderBranch);
120
- if (created) return require_control_flow.toInsertNode(branch[require_control_flow.StartNode], branch[require_control_flow.EndNode]);
120
+ if (created) return branch["#StartNode"].parentNode || branch["#StartNode"];
121
121
  }
122
122
  };
123
123
  //#endregion
@@ -171,7 +171,7 @@ function mount(input = {}, reference, position) {
171
171
  this[require_control_flow.Setup]?.(branch);
172
172
  args?.(branch, input);
173
173
  });
174
- require_control_flow.insertChildNodes(parentNode, nextSibling, branch[require_control_flow.StartNode], branch[require_control_flow.EndNode]);
174
+ require_control_flow.insertBranchBefore(branch, parentNode, nextSibling);
175
175
  require_control_flow.runEffects(effects);
176
176
  return {
177
177
  get value() {
@@ -1,4 +1,4 @@
1
- import { $ as _attr_style_items, $t as removeAndDestroyBranch, A as _attr_input_value, An as Params, B as _controllable_select, Bn as Global, Bt as _id, C as _attr_details_or_dialog_open_script, Cn as _hoist_read_error, Ct as _resumed, D as _attr_input_checkedValue_script, Dn as Lazy, Dt as initEmbedded, E as _attr_input_checkedValue_default, En as Clone, Et as init, F as _attr_select_value, Ft as _for_closure, G as _attr_class, Gt as _return, Ht as _let, I as _attr_select_value_default, It as _for_selector, J as _attr_class_names, Jn as TagVariable, Jt as _var, K as _attr_class_item, Kt as _return_change, L as _attr_select_value_script, Lt as _global_read, M as _attr_input_value_default, Mn as Setup, Mt as _closure_get, N as _attr_input_value_dynamic_default, Nt as _const, O as _attr_input_checked_default, On as LocalClosures, Ot as ready, P as _attr_input_value_script, Pt as _el_read, Q as _attr_style_item, Qt as insertBranchBefore, R as _controllable_input, Rn as EndNode, Rt as _hoist, S as _attr_details_or_dialog_open_default, Sn as _assert_hoist, St as _el, T as _attr_input_checkedValue, Tt as getRegisteredWithScope, Ut as _let_change, V as _controllable_textarea, Vn as Load, Vt as _if_closure, W as _attr, Wt as _or, X as _attr_nonce, Xt as _assert_init, Y as _attr_content, Yt as _var_change, Z as _attr_style, Zt as destroyBranch, _ as patchDynamicTag, _n as forIn, _t as _return_setup, a as _for_in, an as $signalReset, at as _html, b as startAwait, bn as forUntil, bt as setupBranch, c as _for_to, ct as _style_shell, d as _for_until_unkeyed, dn as queueEffect, dt as _to_text, en as syncGen, et as _attrs, f as _if, fn as queueRender, ft as insertChildNodes, gn as runId, gt as _content_resume, hn as runEffects, ht as _content_closures, i as _dynamic_tag_content, in as $signal, it as _attrs_script, j as _attr_input_value_attribute_default, jt as _closure, k as _attr_input_checked_script, kn as Owner, kt as readyFailed, l as _for_to_unkeyed, ln as prepareEffects, lt as _text, m as _try, mn as run, mt as _content, n as _await_promise, nt as _attrs_partial, o as _for_of, ot as _lifecycle, p as _show, pn as rendering, pt as toInsertNode, q as _attr_class_items, qn as StartNode, qt as _script, r as _dynamic_tag, rn as _on, rt as _attrs_partial_content, s as _for_of_unkeyed, st as _style_rule_item, t as _await_content, tt as _attrs_content, u as _for_until, un as queueAsyncRender, ut as _text_content, v as renderCatch, vn as forOf, vt as createAndSetupBranch, w as _attr_input_checked, wn as _call, wt as _var_resume, x as _attr_details_or_dialog_open, xn as _assert_class_toggles, xt as _dynamic_tag_var_resume, yn as forTo, yt as createBranch, z as _controllable_open, zt as _hoist_resume } from "./dom-CFCBDift.mjs";
1
+ import { $ as _attr_style_items, A as _attr_input_value, An as Setup, At as _closure_get, B as _controllable_select, Bt as _let, C as _attr_details_or_dialog_open_script, Ct as getRegisteredWithScope, D as _attr_input_checkedValue_script, Dn as Owner, Dt as readyFailed, E as _attr_input_checkedValue_default, En as LocalClosures, Et as ready, F as _attr_select_value, Ft as _global_read, G as _attr_class, Gn as StartNode, Gt as _script, Ht as _or, I as _attr_select_value_default, In as EndNode, It as _hoist, J as _attr_class_names, Jt as _assert_init, K as _attr_class_item, Kn as TagVariable, Kt as _var, L as _attr_select_value_script, Lt as _hoist_resume, M as _attr_input_value_default, Mt as _el_read, N as _attr_input_value_dynamic_default, Nt as _for_closure, O as _attr_input_checked_default, On as Params, P as _attr_input_value_script, Pt as _for_selector, Q as _attr_style_item, Qt as syncGen, R as _controllable_input, Rn as Global, Rt as _id, S as _attr_details_or_dialog_open_default, Sn as _call, St as _var_resume, T as _attr_input_checkedValue, Tn as Lazy, Tt as initEmbedded, Ut as _return, V as _controllable_textarea, Vt as _let_change, W as _attr, Wt as _return_change, X as _attr_nonce, Xt as insertBranchBefore, Y as _attr_content, Yt as destroyBranch, Z as _attr_style, Zt as removeAndDestroyBranch, _ as patchDynamicTag, _n as forTo, _t as createBranch, a as _for_in, at as _html, b as startAwait, bn as _assert_hoist, bt as _el, c as _for_to, cn as queueAsyncRender, ct as _style_shell, d as _for_until_unkeyed, dn as rendering, dt as _to_text, et as _attrs, f as _if, fn as run, ft as _content, gn as forOf, gt as createAndSetupBranch, hn as forIn, ht as _return_setup, i as _dynamic_tag_content, it as _attrs_script, j as _attr_input_value_attribute_default, jt as _const, k as _attr_input_checked_script, kt as _closure, l as _for_to_unkeyed, ln as queueEffect, lt as _text, m as _try, mn as runId, mt as _content_resume, n as _await_promise, nn as $signal, nt as _attrs_partial, o as _for_of, ot as _lifecycle, p as _show, pn as runEffects, pt as _content_closures, q as _attr_class_items, qt as _var_change, r as _dynamic_tag, rn as $signalReset, rt as _attrs_partial_content, s as _for_of_unkeyed, sn as prepareEffects, st as _style_rule_item, t as _await_content, tn as _on, tt as _attrs_content, u as _for_until, un as queueRender, ut as _text_content, v as renderCatch, vn as forUntil, vt as setupBranch, w as _attr_input_checked, wn as Clone, wt as init, x as _attr_details_or_dialog_open, xn as _hoist_read_error, xt as _resumed, yn as _assert_class_toggles, yt as _dynamic_tag_var_resume, z as _controllable_open, zn as Load, zt as _if_closure } from "./dom-VKjkbuuo.mjs";
2
2
  //#region src/common/attr-tag.ts
3
3
  const empty = [];
4
4
  const rest = Symbol("Attribute Tag");
@@ -81,7 +81,7 @@ const compat = {
81
81
  if (this.scope) destroyBranch(this.scope);
82
82
  },
83
83
  resolveRegistered(value, $global) {
84
- if (Array.isArray(value) && typeof value[0] === "string") return getRegisteredWithScope(value[0], getRenderScopes($global)?.[value[1]]);
84
+ if (Array.isArray(value) && typeof value[0] === "string") return getRegisteredWithScope(getRenderScopes($global)?.[value[1]], value[0]);
85
85
  return value;
86
86
  },
87
87
  createRenderer(params, clone) {
@@ -115,7 +115,7 @@ const compat = {
115
115
  renderer[Params]?.(branch, renderer._ ? args[0] : args);
116
116
  };
117
117
  component.effects = rendering ? renderBranch() : prepareEffects(renderBranch);
118
- if (created) return toInsertNode(branch[StartNode], branch[EndNode]);
118
+ if (created) return branch["#StartNode"].parentNode || branch["#StartNode"];
119
119
  }
120
120
  };
121
121
  //#endregion
@@ -169,7 +169,7 @@ function mount(input = {}, reference, position) {
169
169
  this[Setup]?.(branch);
170
170
  args?.(branch, input);
171
171
  });
172
- insertChildNodes(parentNode, nextSibling, branch[StartNode], branch[EndNode]);
172
+ insertBranchBefore(branch, parentNode, nextSibling);
173
173
  runEffects(effects);
174
174
  return {
175
175
  get value() {
@@ -600,7 +600,7 @@ var State$1 = class {
600
600
  this.buf.push(",");
601
601
  writePlainObject(this, local, newArgReference(this, ref, local));
602
602
  }
603
- } else this.buf.push("_(" + scopeId + "," + quoteRegisterId(registered.id));
603
+ } else this.buf.push("_(" + scopeId + "," + quoteRegistryId(registered.id));
604
604
  this.buf.push(")");
605
605
  }
606
606
  };
@@ -864,7 +864,7 @@ function newScopeReference(state, val, scopeId) {
864
864
  ref.debug = DEBUG.get(val);
865
865
  return ref;
866
866
  }
867
- function quoteRegisterId(id) {
867
+ function quoteRegistryId(id) {
868
868
  return quote(id, 0);
869
869
  }
870
870
  function writeRegistered(state, val, parent, accessor, registered) {
@@ -2283,16 +2283,16 @@ function _hoist(scopeId, id) {
2283
2283
  getter[Symbol.iterator] = _hoist_read_error;
2284
2284
  return _resume(getter, id, scopeId);
2285
2285
  }
2286
- function _el_resume(scopeId, accessor, markerGuard) {
2286
+ function _el_mark(scopeId, accessor, markerGuard) {
2287
2287
  if (markerGuard === 0) return "";
2288
2288
  const { state } = $chunk.boundary;
2289
2289
  state.needsWalkerRuntime = true;
2290
2290
  return state.mark("$", scopeId + " " + accessor);
2291
2291
  }
2292
- function _text_resume(scopeId, accessor, val, markerGuard) {
2292
+ function _text_mark(scopeId, accessor, val, markerGuard) {
2293
2293
  return markText(scopeId, accessor, _escape(val), markerGuard);
2294
2294
  }
2295
- function _html_resume(scopeId, accessor, val, markerGuard) {
2295
+ function _html_mark(scopeId, accessor, val, markerGuard) {
2296
2296
  const html = _unescaped(val);
2297
2297
  if (markerGuard === 0 || !~html.indexOf("<")) return markText(scopeId, accessor, html, markerGuard);
2298
2298
  const { state } = $chunk.boundary;
@@ -2837,9 +2837,10 @@ var Chunk = class Chunk {
2837
2837
  }
2838
2838
  if (readyId && !this.async) {
2839
2839
  const { state } = boundary;
2840
+ const effects = holdEffects ? "" : this.effects;
2841
+ if (effects) flushSerializerGlobals(boundary);
2840
2842
  flushSerializer(boundary, channel);
2841
2843
  const deps = takeChannelDeps(state.serializer);
2842
- const effects = holdEffects ? "" : this.effects;
2843
2844
  const { resumes } = channel;
2844
2845
  const chunkScripts = this.scripts;
2845
2846
  channel.resumes = this.scripts = "";
@@ -2881,6 +2882,7 @@ var Chunk = class Chunk {
2881
2882
  scripts = concatScripts(scripts, readyResumeScripts);
2882
2883
  if (effects) {
2883
2884
  needsWalk = true;
2885
+ flushSerializerGlobals(boundary);
2884
2886
  state.resumes = state.resumes ? state.resumes + ",\"" + effects + "\"" : "\"" + effects + "\"";
2885
2887
  }
2886
2888
  let reordered = "";
@@ -3034,7 +3036,7 @@ function flushSerializer(boundary, channel) {
3034
3036
  ]);
3035
3037
  }
3036
3038
  if (flushes.length || pending) {
3037
- if (channel.readyId && !state.hasWrittenGlobals) flushSerializerGlobals(boundary);
3039
+ if (channel.readyId) flushSerializerGlobals(boundary);
3038
3040
  state.addResumes(channel, stringifyScopes(serializer, flushes, boundary, channel));
3039
3041
  }
3040
3042
  channel.writeScopes = {};
@@ -3044,9 +3046,10 @@ function flushSerializer(boundary, channel) {
3044
3046
  }
3045
3047
  function flushSerializerGlobals(boundary) {
3046
3048
  const { state } = boundary;
3049
+ if (state.hasWrittenGlobals) return;
3050
+ state.hasWrittenGlobals = true;
3047
3051
  const globals = getFilteredGlobals(state.$global);
3048
3052
  if (globals) {
3049
- state.hasWrittenGlobals = true;
3050
3053
  state.needsWalkerRuntime = true;
3051
3054
  state.resumes = concatSequence(state.resumes, stringifyScopes(state.serializer, [[
3052
3055
  0,
@@ -3787,7 +3790,7 @@ function writeBranchEnd(scopeId, accessor, branchExprGuard, markerGuard, parentE
3787
3790
  const { state } = $chunk.boundary;
3788
3791
  const mark = singleNode ? state.mark(parentEndTag ? "}" : "|", scopeId + " " + accessor + (branchIds || "")) : state.mark(parentEndTag ? ")" : "]", scopeId + " " + accessor + (branchIds || ""));
3789
3792
  $chunk.writeHTML(mark + endTag);
3790
- } else if (markerGuard !== 0) $chunk.writeHTML(endTag + _el_resume(scopeId, accessor));
3793
+ } else if (markerGuard !== 0) $chunk.writeHTML(endTag + _el_mark(scopeId, accessor));
3791
3794
  else $chunk.writeHTML(endTag);
3792
3795
  }
3793
3796
  function _await(scopeId, accessor, promise, content, markerGuard) {
@@ -3961,7 +3964,11 @@ const COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap();
3961
3964
  const compat = {
3962
3965
  $global,
3963
3966
  writeLoadAsset,
3964
- fork: _await,
3967
+ fork: ((scopeId, accessor, promise, content) => _await(scopeId, accessor, promise, (value) => {
3968
+ const branchId = _peek_scope_id();
3969
+ content(value);
3970
+ if (_peek_scope_id() === branchId) _scope_id();
3971
+ })),
3965
3972
  write: _html,
3966
3973
  writeScript,
3967
3974
  nextScopeId: _scope_id,
@@ -4198,8 +4205,8 @@ Object.defineProperty(exports, "_dynamic_tag", {
4198
4205
  }
4199
4206
  });
4200
4207
  exports._el = _el;
4208
+ exports._el_mark = _el_mark;
4201
4209
  exports._el_read_error = _el_read_error;
4202
- exports._el_resume = _el_resume;
4203
4210
  exports._escape = _escape;
4204
4211
  exports._escape_comment = _escape_comment;
4205
4212
  exports._escape_script = _escape_script;
@@ -4214,7 +4221,7 @@ exports._for_until = _for_until;
4214
4221
  exports._hoist = _hoist;
4215
4222
  exports._hoist_read_error = _hoist_read_error;
4216
4223
  exports._html = _html;
4217
- exports._html_resume = _html_resume;
4224
+ exports._html_mark = _html_mark;
4218
4225
  exports._id = _id;
4219
4226
  exports._if = _if;
4220
4227
  exports._peek_scope_id = _peek_scope_id;
@@ -4238,7 +4245,7 @@ exports._signal_read_error = _signal_read_error;
4238
4245
  exports._style_html = _style_html;
4239
4246
  exports._subscribe = _subscribe;
4240
4247
  exports._template = _template;
4241
- exports._text_resume = _text_resume;
4248
+ exports._text_mark = _text_mark;
4242
4249
  exports._textarea_value = _textarea_value;
4243
4250
  exports._to_text = _to_text;
4244
4251
  exports._trailers = _trailers;
@@ -598,7 +598,7 @@ var State$1 = class {
598
598
  this.buf.push(",");
599
599
  writePlainObject(this, local, newArgReference(this, ref, local));
600
600
  }
601
- } else this.buf.push("_(" + scopeId + "," + quoteRegisterId(registered.id));
601
+ } else this.buf.push("_(" + scopeId + "," + quoteRegistryId(registered.id));
602
602
  this.buf.push(")");
603
603
  }
604
604
  };
@@ -862,7 +862,7 @@ function newScopeReference(state, val, scopeId) {
862
862
  ref.debug = DEBUG.get(val);
863
863
  return ref;
864
864
  }
865
- function quoteRegisterId(id) {
865
+ function quoteRegistryId(id) {
866
866
  return quote(id, 0);
867
867
  }
868
868
  function writeRegistered(state, val, parent, accessor, registered) {
@@ -2281,16 +2281,16 @@ function _hoist(scopeId, id) {
2281
2281
  getter[Symbol.iterator] = _hoist_read_error;
2282
2282
  return _resume(getter, id, scopeId);
2283
2283
  }
2284
- function _el_resume(scopeId, accessor, markerGuard) {
2284
+ function _el_mark(scopeId, accessor, markerGuard) {
2285
2285
  if (markerGuard === 0) return "";
2286
2286
  const { state } = $chunk.boundary;
2287
2287
  state.needsWalkerRuntime = true;
2288
2288
  return state.mark("$", scopeId + " " + accessor);
2289
2289
  }
2290
- function _text_resume(scopeId, accessor, val, markerGuard) {
2290
+ function _text_mark(scopeId, accessor, val, markerGuard) {
2291
2291
  return markText(scopeId, accessor, _escape(val), markerGuard);
2292
2292
  }
2293
- function _html_resume(scopeId, accessor, val, markerGuard) {
2293
+ function _html_mark(scopeId, accessor, val, markerGuard) {
2294
2294
  const html = _unescaped(val);
2295
2295
  if (markerGuard === 0 || !~html.indexOf("<")) return markText(scopeId, accessor, html, markerGuard);
2296
2296
  const { state } = $chunk.boundary;
@@ -2835,9 +2835,10 @@ var Chunk = class Chunk {
2835
2835
  }
2836
2836
  if (readyId && !this.async) {
2837
2837
  const { state } = boundary;
2838
+ const effects = holdEffects ? "" : this.effects;
2839
+ if (effects) flushSerializerGlobals(boundary);
2838
2840
  flushSerializer(boundary, channel);
2839
2841
  const deps = takeChannelDeps(state.serializer);
2840
- const effects = holdEffects ? "" : this.effects;
2841
2842
  const { resumes } = channel;
2842
2843
  const chunkScripts = this.scripts;
2843
2844
  channel.resumes = this.scripts = "";
@@ -2879,6 +2880,7 @@ var Chunk = class Chunk {
2879
2880
  scripts = concatScripts(scripts, readyResumeScripts);
2880
2881
  if (effects) {
2881
2882
  needsWalk = true;
2883
+ flushSerializerGlobals(boundary);
2882
2884
  state.resumes = state.resumes ? state.resumes + ",\"" + effects + "\"" : "\"" + effects + "\"";
2883
2885
  }
2884
2886
  let reordered = "";
@@ -3032,7 +3034,7 @@ function flushSerializer(boundary, channel) {
3032
3034
  ]);
3033
3035
  }
3034
3036
  if (flushes.length || pending) {
3035
- if (channel.readyId && !state.hasWrittenGlobals) flushSerializerGlobals(boundary);
3037
+ if (channel.readyId) flushSerializerGlobals(boundary);
3036
3038
  state.addResumes(channel, stringifyScopes(serializer, flushes, boundary, channel));
3037
3039
  }
3038
3040
  channel.writeScopes = {};
@@ -3042,9 +3044,10 @@ function flushSerializer(boundary, channel) {
3042
3044
  }
3043
3045
  function flushSerializerGlobals(boundary) {
3044
3046
  const { state } = boundary;
3047
+ if (state.hasWrittenGlobals) return;
3048
+ state.hasWrittenGlobals = true;
3045
3049
  const globals = getFilteredGlobals(state.$global);
3046
3050
  if (globals) {
3047
- state.hasWrittenGlobals = true;
3048
3051
  state.needsWalkerRuntime = true;
3049
3052
  state.resumes = concatSequence(state.resumes, stringifyScopes(state.serializer, [[
3050
3053
  0,
@@ -3785,7 +3788,7 @@ function writeBranchEnd(scopeId, accessor, branchExprGuard, markerGuard, parentE
3785
3788
  const { state } = $chunk.boundary;
3786
3789
  const mark = singleNode ? state.mark(parentEndTag ? "}" : "|", scopeId + " " + accessor + (branchIds || "")) : state.mark(parentEndTag ? ")" : "]", scopeId + " " + accessor + (branchIds || ""));
3787
3790
  $chunk.writeHTML(mark + endTag);
3788
- } else if (markerGuard !== 0) $chunk.writeHTML(endTag + _el_resume(scopeId, accessor));
3791
+ } else if (markerGuard !== 0) $chunk.writeHTML(endTag + _el_mark(scopeId, accessor));
3789
3792
  else $chunk.writeHTML(endTag);
3790
3793
  }
3791
3794
  function _await(scopeId, accessor, promise, content, markerGuard) {
@@ -3959,7 +3962,11 @@ const COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap();
3959
3962
  const compat = {
3960
3963
  $global,
3961
3964
  writeLoadAsset,
3962
- fork: _await,
3965
+ fork: ((scopeId, accessor, promise, content) => _await(scopeId, accessor, promise, (value) => {
3966
+ const branchId = _peek_scope_id();
3967
+ content(value);
3968
+ if (_peek_scope_id() === branchId) _scope_id();
3969
+ })),
3963
3970
  write: _html,
3964
3971
  writeScript,
3965
3972
  nextScopeId: _scope_id,
@@ -4161,4 +4168,4 @@ function swapReorders(state, reorders) {
4161
4168
  }
4162
4169
  function NOOP() {}
4163
4170
  //#endregion
4164
- export { $global, _assert_class_toggles, _assert_hoist, _attr, _attr_and, _attr_class, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_input_checked, _attr_input_checkedValue, _attr_input_value, _attr_nonce, _attr_nullish, _attr_option_value, _attr_or, _attr_select_value, _attr_style, _attr_textarea_value, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_select_value, _attrs_textarea_value, _await, _content, _content_resume, _dynamic_tag, _el, _el_read_error, _el_resume, _escape, _escape_comment, _escape_script, _escape_style, _escape_style_value, _existing_scope, _flush_head, _for_in, _for_of, _for_to, _for_until, _hoist, _hoist_read_error, _html, _html_resume, _id, _if, _peek_scope_id, _resume, _resume_branch, _resume_locals, writeScope as _scope, _scope_id, _scope_reason, _scope_with_id, _script, _set_scope_reason, _show_end, _show_start, _signal_read_error, _style_html, _subscribe, _template, _text_resume, _textarea_value, _to_text, _trailers, _try, _unescaped, _var, _write_guard, _write_if, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, withLoadAssets, withPageAssets };
4171
+ export { $global, _assert_class_toggles, _assert_hoist, _attr, _attr_and, _attr_class, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_input_checked, _attr_input_checkedValue, _attr_input_value, _attr_nonce, _attr_nullish, _attr_option_value, _attr_or, _attr_select_value, _attr_style, _attr_textarea_value, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_select_value, _attrs_textarea_value, _await, _content, _content_resume, _dynamic_tag, _el, _el_mark, _el_read_error, _escape, _escape_comment, _escape_script, _escape_style, _escape_style_value, _existing_scope, _flush_head, _for_in, _for_of, _for_to, _for_until, _hoist, _hoist_read_error, _html, _html_mark, _id, _if, _peek_scope_id, _resume, _resume_branch, _resume_locals, writeScope as _scope, _scope_id, _scope_reason, _scope_with_id, _script, _set_scope_reason, _show_end, _show_start, _signal_read_error, _style_html, _subscribe, _template, _text_mark, _textarea_value, _to_text, _trailers, _try, _unescaped, _var, _write_guard, _write_if, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, withLoadAssets, withPageAssets };
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
- let require_control_flow = require("../dom-Bpkm72vV.js"), deferToPendingTry = (fn, scope, branch) => {
2
+ let require_control_flow = require("../dom-IujlfJ6b.js"), deferToPendingTry = (fn, scope, branch) => {
3
3
  for (; branch;) {
4
- if (branch.O?.i) return (scope.J ||= ((branch.JS ||= (branch.O.m && ((complete) => branch.O.c = (_) => complete() || require_control_flow.cn(branch, require_control_flow.ln, require_control_flow.y))(branch.O.c), [])).push(scope), /* @__PURE__ */ new Set())).add(fn);
4
+ if (branch.O?.i) return (scope.J ||= ((branch.JS ||= (branch.O.m && ((complete) => branch.O.c = (_) => complete() || require_control_flow.on(branch, require_control_flow.sn, require_control_flow.y))(branch.O.c), [])).push(scope), /* @__PURE__ */ new Set())).add(fn);
5
5
  branch = branch.N;
6
6
  }
7
7
  };
8
8
  //#region src/dom/catch.feat.ts
9
- require_control_flow.on((effects) => {
9
+ require_control_flow.in((effects) => {
10
10
  let i = 0, fn, scope, branch;
11
11
  for (; i < effects.length;) fn = effects[i++], scope = effects[i++], (branch = scope.F)?.H !== 0 && !deferToPendingTry(fn, scope, branch) && fn(scope);
12
12
  }, (runRender) => (render) => {
@@ -4,7 +4,7 @@ let deferToPendingTry = (fn, scope, branch) => {
4
4
  branch = branch.N;
5
5
  }
6
6
  };
7
- import { cn as queueAsyncRender, ln as queueEffect, on as installCatch, v as renderCatch, y as runPendingEffects } from "../dom-CVAevsbz.mjs";
7
+ import { in as installCatch, on as queueAsyncRender, sn as queueEffect, v as renderCatch, y as runPendingEffects } from "../dom-DtKQb840.mjs";
8
8
  //#region src/dom/catch.feat.ts
9
9
  installCatch((effects) => {
10
10
  let i = 0, fn, scope, branch;
@@ -24,5 +24,5 @@ export declare const compat: {
24
24
  startNode: ChildNode;
25
25
  endNode: ChildNode;
26
26
  }): Renderer;
27
- render(out: any, component: any, renderer: Renderer, args: any): Node | undefined;
27
+ render(out: any, component: any, renderer: Renderer, args: any): ChildNode | ParentNode | undefined;
28
28
  };
@@ -8,7 +8,7 @@ export declare function runPendingEffects(tryBranch: BranchScope): void;
8
8
  export declare function _try(nodeAccessor: EncodedAccessor, template?: string | 0, walks?: string | 0, setup?: SetupFn | 0, placeholderContent?: ReturnType<typeof _content> | 0, catchContent?: ReturnType<typeof _content>): (scope: Scope) => void;
9
9
  export declare function renderCatch(scope: Scope, error?: unknown): void;
10
10
  export declare const _if: (nodeAccessor: EncodedAccessor, ...branchesArgs: (string | SetupFn | 0)[]) => (scope: Scope, newBranch: number) => void;
11
- export declare const _show: (nodeAccessor: EncodedAccessor, startNodeAccessor?: EncodedAccessor, endNodeAccessor?: EncodedAccessor) => (scope: Scope, display: unknown) => void;
11
+ export declare const _show: (nodeAccessor: EncodedAccessor, startNodeAccessor?: EncodedAccessor) => (scope: Scope, display: unknown) => void;
12
12
  export declare function rendererKey(renderer: Renderer | string | undefined): string | Renderer | undefined;
13
13
  export declare function patchDynamicTag(fn: <T extends typeof _dynamic_tag>(cond: T) => T): void;
14
14
  export declare let _dynamic_tag: (nodeAccessor: EncodedAccessor, getContent?: ((scope: Scope) => Renderer) | 0, getTagVar?: (() => (scope: Scope, value?: unknown) => void) | 0, inputIsArgs?: 1) => Signal<Renderer | string | undefined>;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
- let require_control_flow = require("../dom-Bpkm72vV.js");
2
+ let require_control_flow = require("../dom-IujlfJ6b.js");
3
3
  require_control_flow.H[0] = require_control_flow.k, require_control_flow.H[1] = require_control_flow.D, require_control_flow.H[2] = require_control_flow.P;
4
4
  //#endregion
@@ -1,3 +1,3 @@
1
- import { D as _attr_input_checkedValue_script, H as controllableScripts, P as _attr_input_value_script, k as _attr_input_checked_script } from "../dom-CVAevsbz.mjs";
1
+ import { D as _attr_input_checkedValue_script, H as controllableScripts, P as _attr_input_value_script, k as _attr_input_checked_script } from "../dom-DtKQb840.mjs";
2
2
  controllableScripts[0] = _attr_input_checked_script, controllableScripts[1] = _attr_input_checkedValue_script, controllableScripts[2] = _attr_input_value_script;
3
3
  //#endregion
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- let require_control_flow = require("../dom-Bpkm72vV.js");
2
+ let require_control_flow = require("../dom-IujlfJ6b.js");
3
3
  //#region src/dom/controllable-open.feat.ts
4
4
  require_control_flow.H[4] = require_control_flow.C;
5
5
  //#endregion
@@ -1,4 +1,4 @@
1
- import { C as _attr_details_or_dialog_open_script, H as controllableScripts } from "../dom-CVAevsbz.mjs";
1
+ import { C as _attr_details_or_dialog_open_script, H as controllableScripts } from "../dom-DtKQb840.mjs";
2
2
  //#region src/dom/controllable-open.feat.ts
3
3
  controllableScripts[4] = _attr_details_or_dialog_open_script;
4
4
  //#endregion
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- let require_control_flow = require("../dom-Bpkm72vV.js");
2
+ let require_control_flow = require("../dom-IujlfJ6b.js");
3
3
  //#region src/dom/controllable-select.feat.ts
4
4
  require_control_flow.H[3] = require_control_flow.L;
5
5
  //#endregion
@@ -1,4 +1,4 @@
1
- import { H as controllableScripts, L as _attr_select_value_script } from "../dom-CVAevsbz.mjs";
1
+ import { H as controllableScripts, L as _attr_select_value_script } from "../dom-DtKQb840.mjs";
2
2
  //#region src/dom/controllable-select.feat.ts
3
3
  controllableScripts[3] = _attr_select_value_script;
4
4
  //#endregion
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- let require_control_flow = require("../dom-Bpkm72vV.js");
2
+ let require_control_flow = require("../dom-IujlfJ6b.js");
3
3
  //#region src/dom/controllable-textarea.feat.ts
4
4
  require_control_flow.H[2] = require_control_flow.P;
5
5
  //#endregion
@@ -1,4 +1,4 @@
1
- import { H as controllableScripts, P as _attr_input_value_script } from "../dom-CVAevsbz.mjs";
1
+ import { H as controllableScripts, P as _attr_input_value_script } from "../dom-DtKQb840.mjs";
2
2
  //#region src/dom/controllable-textarea.feat.ts
3
3
  controllableScripts[2] = _attr_input_value_script;
4
4
  //#endregion
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
- let require_control_flow = require("../dom-Bpkm72vV.js");
2
+ let require_control_flow = require("../dom-IujlfJ6b.js");
3
3
  require("./controllable-input.feat.js"), require("./controllable-open.feat.js"), require("./controllable-select.feat.js"), require_control_flow.U.INPUT = require_control_flow.R, require_control_flow.U.TEXTAREA = require_control_flow.V, require_control_flow.U.SELECT = require_control_flow.B, require_control_flow.U.DETAILS = require_control_flow.U.DIALOG = require_control_flow.z;
4
4
  //#endregion
@@ -1,4 +1,4 @@
1
- import { B as _controllable_select, R as _controllable_input, U as controllableSpreadHelpers, V as _controllable_textarea, z as _controllable_open } from "../dom-CVAevsbz.mjs";
1
+ import { B as _controllable_select, R as _controllable_input, U as controllableSpreadHelpers, V as _controllable_textarea, z as _controllable_open } from "../dom-DtKQb840.mjs";
2
2
  import "./controllable-input.feat.mjs";
3
3
  import "./controllable-open.feat.mjs";
4
4
  import "./controllable-select.feat.mjs";
package/dist/dom/dom.d.ts CHANGED
@@ -27,6 +27,5 @@ export declare function _lifecycle(scope: Scope, thisObj: Record<string, unknown
27
27
  onUpdate?: (this: unknown) => void;
28
28
  onDestroy?: (this: unknown) => void;
29
29
  }, index?: number): void;
30
- export declare function removeChildNodes(startNode: ChildNode, endNode: ChildNode): void;
31
- export declare function insertChildNodes(parentNode: ParentNode, referenceNode: Node | null, startNode: Node, endNode: Node): ParentNode;
32
- export declare function toInsertNode(startNode: Node, endNode: Node): Node;
30
+ export declare function removeChildNodes(startNode: ChildNode, endNode: ChildNode | null): void;
31
+ export declare function insertChildNodes(parentNode: ParentNode, referenceNode: Node | null, startNode: Node, endNode: Node | null): void;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- let require_control_flow = require("../dom-Bpkm72vV.js");
2
+ let require_control_flow = require("../dom-IujlfJ6b.js");
3
3
  //#region src/dom/dynamic-tag-script.feat.ts
4
- require_control_flow.Ct._d = require_control_flow.Cn(require_control_flow.h);
4
+ require_control_flow.xt._d = require_control_flow.xn(require_control_flow.h);
5
5
  //#endregion
@@ -1,4 +1,4 @@
1
- import { Cn as withBranches, Ct as _resumed, h as dynamicTagScript } from "../dom-CVAevsbz.mjs";
1
+ import { h as dynamicTagScript, xn as withBranches, xt as _resumed } from "../dom-DtKQb840.mjs";
2
2
  //#region src/dom/dynamic-tag-script.feat.ts
3
3
  _resumed._d = withBranches(dynamicTagScript);
4
4
  //#endregion
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- let require_control_flow = require("../dom-Bpkm72vV.js");
3
- require_control_flow.an(), require_control_flow.g((scope, branch, scopeKey, renderer) => {
4
- branch.BR = require_control_flow.in(scope, scopeKey), typeof renderer == "string" && branch.T((_) => branch.S);
2
+ let require_control_flow = require("../dom-IujlfJ6b.js");
3
+ require_control_flow.rn(), require_control_flow.g((scope, branch, scopeKey, renderer) => {
4
+ branch.BR = require_control_flow.nn(scope, scopeKey), typeof renderer == "string" && branch.T((_) => branch.S);
5
5
  });
6
6
  //#endregion
@@ -1,4 +1,4 @@
1
- import { an as installBranchRenders, g as installDynamicTagVar, in as createBranchRenders } from "../dom-CVAevsbz.mjs";
1
+ import { g as installDynamicTagVar, nn as createBranchRenders, rn as installBranchRenders } from "../dom-DtKQb840.mjs";
2
2
  installBranchRenders(), installDynamicTagVar((scope, branch, scopeKey, renderer) => {
3
3
  branch.BR = createBranchRenders(scope, scopeKey), typeof renderer == "string" && branch.T((_) => branch.S);
4
4
  });
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  //#region src/dom/lazy.feat.ts
3
- require("../dom-Bpkm72vV.js").At();
3
+ require("../dom-IujlfJ6b.js").Ot();
4
4
  //#endregion
@@ -1,4 +1,4 @@
1
- import { At as withLazy } from "../dom-CVAevsbz.mjs";
1
+ import { Ot as withLazy } from "../dom-DtKQb840.mjs";
2
2
  //#region src/dom/lazy.feat.ts
3
3
  withLazy();
4
4
  //#endregion
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
- let require_control_flow = require("../dom-Bpkm72vV.js");
2
+ let require_control_flow = require("../dom-IujlfJ6b.js");
3
3
  //#region src/dom/placeholder.feat.ts
4
- require_control_flow.Ct._f = (tryBranch) => {
5
- tryBranch.P &&= (require_control_flow.Zt(tryBranch.P), 0);
4
+ require_control_flow.xt._f = (tryBranch) => {
5
+ tryBranch.P &&= (require_control_flow.Yt(tryBranch.P), 0);
6
6
  };
7
7
  //#endregion
@@ -1,4 +1,4 @@
1
- import { Ct as _resumed, Zt as destroyBranch } from "../dom-CVAevsbz.mjs";
1
+ import { Yt as destroyBranch, xt as _resumed } from "../dom-DtKQb840.mjs";
2
2
  //#region src/dom/placeholder.feat.ts
3
3
  _resumed._f = (tryBranch) => {
4
4
  tryBranch.P &&= (destroyBranch(tryBranch.P), 0);
@@ -29,7 +29,7 @@ export declare function withLazy(): void;
29
29
  export declare function initEmbedded(readyId: string, runtimeId?: string): void;
30
30
  export declare function init(runtimeId?: string): void;
31
31
  export declare let isResuming: undefined | 0 | 1;
32
- export declare function getRegisteredWithScope<T = unknown>(id: string, scope?: Scope): T;
32
+ export declare function getRegisteredWithScope<T = unknown>(scope: Scope | undefined, id: string): T;
33
33
  export declare function _var_resume<T extends Signal<unknown>>(id: string, signal: T): T;
34
34
  export declare function _el(id: string, accessor: EncodedAccessor): (scope: Scope) => (_?: never) => any;
35
35
  export declare function _dynamic_tag_var_resume(accessor: EncodedAccessor): void;
@@ -8,4 +8,4 @@ export declare function destroyBranch(branch: BranchScope): void;
8
8
  export declare function destroyScope(scope: Scope): void;
9
9
  export declare function removeAndDestroyBranch(branch: BranchScope): void;
10
10
  export declare function insertBranchBefore(branch: BranchScope, parentNode: ParentNode, nextSibling: Node | null): void;
11
- export declare function tempDetachBranch(branch: BranchScope): void;
11
+ export declare function detachBranch(branch: BranchScope): void;
@@ -14,7 +14,7 @@ export declare function _if_closure(ownerConditionalNodeAccessor: EncodedAccesso
14
14
  export declare function subscribeToScopeSet(owner: Record<Accessor, unknown>, accessor: Accessor, scope: Scope): void;
15
15
  export declare function _closure(...closureSignals: ReturnType<typeof _closure_get>[]): (scope: Scope) => void;
16
16
  export declare function _closure_get(valueAccessor: EncodedAccessor, fn: SignalFn, getOwnerScope?: (scope: Scope) => Scope, resumeId?: string): ((scope: Scope, resumed?: 1) => void) & {
17
- scopeInstancesAccessor: string;
17
+ scopesAccessor: string;
18
18
  signalIndexAccessor: string;
19
19
  index: number;
20
20
  };