marko 6.3.45 → 6.3.47

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 (55) hide show
  1. package/dist/common/constants/resume-symbol.d.ts +5 -2
  2. package/dist/common/helpers.d.ts +2 -0
  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-var.feat.js +1 -1
  16. package/dist/debug/dom/dynamic-tag-var.feat.mjs +1 -1
  17. package/dist/debug/dom/placeholder.feat.js +1 -1
  18. package/dist/debug/dom/placeholder.feat.mjs +1 -1
  19. package/dist/debug/{dom-DBuLwSOh.js → dom-BheMBjYT.js} +29 -8
  20. package/dist/debug/{dom-ky42a_qY.mjs → dom-DyBeisho.mjs} +24 -9
  21. package/dist/debug/dom.js +2 -1
  22. package/dist/debug/dom.mjs +2 -2
  23. package/dist/debug/html.js +33 -18
  24. package/dist/debug/html.mjs +32 -18
  25. package/dist/dom/catch.feat.js +3 -3
  26. package/dist/dom/catch.feat.mjs +1 -1
  27. package/dist/dom/controllable-input.feat.js +1 -1
  28. package/dist/dom/controllable-input.feat.mjs +1 -1
  29. package/dist/dom/controllable-open.feat.js +1 -1
  30. package/dist/dom/controllable-open.feat.mjs +1 -1
  31. package/dist/dom/controllable-select.feat.js +1 -1
  32. package/dist/dom/controllable-select.feat.mjs +1 -1
  33. package/dist/dom/controllable-textarea.feat.js +1 -1
  34. package/dist/dom/controllable-textarea.feat.mjs +1 -1
  35. package/dist/dom/controllable.feat.js +1 -1
  36. package/dist/dom/controllable.feat.mjs +1 -1
  37. package/dist/dom/dom.d.ts +1 -1
  38. package/dist/dom/dynamic-tag-var.feat.js +1 -1
  39. package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
  40. package/dist/dom/placeholder.feat.js +3 -3
  41. package/dist/dom/placeholder.feat.mjs +1 -1
  42. package/dist/dom/resume.d.ts +1 -0
  43. package/dist/{dom-BSAs0ur8.mjs → dom-BbknkVDz.mjs} +13 -13
  44. package/dist/{dom-DHJCbngT.js → dom-DprILxYO.js} +64 -59
  45. package/dist/dom.d.ts +1 -1
  46. package/dist/dom.js +24 -24
  47. package/dist/dom.mjs +2 -2
  48. package/dist/html/writer.d.ts +2 -1
  49. package/dist/html.d.ts +1 -1
  50. package/dist/html.js +21 -10
  51. package/dist/html.mjs +21 -10
  52. package/dist/translator/index.js +36 -419
  53. package/dist/translator/util/signals.d.ts +4 -1
  54. package/dist/translator/visitors/constants/sibling-text.d.ts +0 -1
  55. package/package.json +3 -3
@@ -298,16 +298,16 @@ function _escape_comment(val) {
298
298
  //#endregion
299
299
  //#region src/html/serializer.ts
300
300
  const K_SCOPE_ID = Symbol("Scope ID");
301
- const kTouchedIterator = Symbol.for("marko.touchedIterator");
301
+ const kTouchedIterator = /* @__PURE__ */ Symbol.for("marko.touchedIterator");
302
302
  const { hasOwnProperty } = {};
303
303
  const objectProto = Object.prototype;
304
304
  const arrayProto = Array.prototype;
305
- const Generator = (function* () {})().constructor;
306
- const AsyncGenerator = (async function* () {})().constructor;
305
+ const Generator = (/* @__PURE__ */ (function* () {})()).constructor;
306
+ const AsyncGenerator = (/* @__PURE__ */ (async function* () {})()).constructor;
307
307
  patchIteratorNext(Generator.prototype);
308
308
  patchIteratorNext(AsyncGenerator.prototype);
309
309
  const REGISTRY = /* @__PURE__ */ new WeakMap();
310
- const KNOWN_SYMBOLS = (() => {
310
+ const KNOWN_SYMBOLS = /* @__PURE__ */ (() => {
311
311
  const KNOWN_SYMBOLS = /* @__PURE__ */ new Map();
312
312
  for (const name of Object.getOwnPropertyNames(Symbol)) {
313
313
  const symbol = Symbol[name];
@@ -315,7 +315,7 @@ const KNOWN_SYMBOLS = (() => {
315
315
  }
316
316
  return KNOWN_SYMBOLS;
317
317
  })();
318
- const KNOWN_FUNCTIONS = /* @__PURE__ */ new Map([
318
+ const KNOWN_FUNCTIONS = /* @__PURE__ */ (() => /* @__PURE__ */ new Map([
319
319
  [AggregateError, "AggregateError"],
320
320
  [Array, "Array"],
321
321
  [Array.from, "Array.from"],
@@ -533,8 +533,8 @@ const KNOWN_FUNCTIONS = /* @__PURE__ */ new Map([
533
533
  [URIError, "URIError"],
534
534
  [WeakMap, "WeakMap"],
535
535
  [WeakSet, "WeakSet"]
536
- ]);
537
- const KNOWN_OBJECTS = /* @__PURE__ */ new Map([
536
+ ]))();
537
+ const KNOWN_OBJECTS = /* @__PURE__ */ (() => /* @__PURE__ */ new Map([
538
538
  [Atomics, "Atomics"],
539
539
  [console, "console"],
540
540
  [globalThis, "globalThis"],
@@ -543,7 +543,7 @@ const KNOWN_OBJECTS = /* @__PURE__ */ new Map([
543
543
  [JSON, "JSON"],
544
544
  [Math, "Math"],
545
545
  [Reflect, "Reflect"]
546
- ]);
546
+ ]))();
547
547
  var State$1 = class {
548
548
  ids = 0;
549
549
  flushId = 0;
@@ -2020,10 +2020,23 @@ function _el_resume(scopeId, accessor, shouldResume) {
2020
2020
  if (shouldResume === 0) return "";
2021
2021
  const { state } = $chunk.boundary;
2022
2022
  state.needsMainRuntime = true;
2023
- return state.mark("*", scopeId + " " + accessor);
2023
+ return state.mark("$", scopeId + " " + accessor);
2024
2024
  }
2025
- function _sep(shouldResume) {
2026
- return shouldResume === 0 ? "" : "<!>";
2025
+ function _text_resume(scopeId, accessor, val, shouldResume) {
2026
+ return markText(scopeId, accessor, _escape(val), shouldResume);
2027
+ }
2028
+ function _html_resume(scopeId, accessor, val, shouldResume) {
2029
+ const html = _unescaped(val);
2030
+ if (shouldResume === 0 || !~html.indexOf("<")) return markText(scopeId, accessor, html, shouldResume);
2031
+ const { state } = $chunk.boundary;
2032
+ state.needsMainRuntime = true;
2033
+ return state.mark("&", "") + html + state.mark("'", scopeId + " " + accessor);
2034
+ }
2035
+ function markText(scopeId, accessor, text, shouldResume) {
2036
+ if (shouldResume === 0) return text;
2037
+ const { state } = $chunk.boundary;
2038
+ state.needsMainRuntime = true;
2039
+ return text ? (shouldResume === 2 ? "<!>" : "") + text + state.mark("$", scopeId + " " + accessor) : state.mark("%", scopeId + " " + accessor);
2027
2040
  }
2028
2041
  function _resume_branch(scopeId) {
2029
2042
  const branchId = $chunk.context?.[kBranchId];
@@ -2313,7 +2326,7 @@ function tryCatch(content, catchContent) {
2313
2326
  const chunk = $chunk;
2314
2327
  const { boundary } = chunk;
2315
2328
  const { state } = boundary;
2316
- const catchBoundary = new Boundary(state, void 0, boundary);
2329
+ const catchBoundary = new Boundary(state, boundary.signal, boundary);
2317
2330
  const body = chunk.fork(catchBoundary, null);
2318
2331
  const bodyEnd = body.render(content);
2319
2332
  if (catchBoundary.signal.aborted) {
@@ -3109,7 +3122,7 @@ let _dynamic_tag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, s
3109
3122
  writeScope(branchId, { [Renderer]: renderer });
3110
3123
  _script(branchId, DYNAMIC_TAG_SCRIPT_REGISTER_ID);
3111
3124
  }
3112
- if (shouldResume || needsScript) _html(state.mark("'", scopeId + " " + accessor + " " + branchId));
3125
+ if (shouldResume || needsScript) _html(state.mark("(", scopeId + " " + accessor + " " + branchId));
3113
3126
  };
3114
3127
  renderNative();
3115
3128
  result = _el(branchId, DYNAMIC_TAG_VAR_REGISTER_ID);
@@ -3148,7 +3161,7 @@ function _content(id, fn, scopeId) {
3148
3161
  function _content_resume(id, fn, scopeId) {
3149
3162
  return _resume(_content(id, fn, scopeId), id, scopeId);
3150
3163
  }
3151
- const patchDynamicTag = ((originalDynamicTag) => (patch) => {
3164
+ const patchDynamicTag = /* @__PURE__ */ ((originalDynamicTag) => (patch) => {
3152
3165
  _dynamic_tag = (scopeId, accessor, tag, input, content, inputIsArgs, resume) => {
3153
3166
  const patched = patch(tag, scopeId, accessor);
3154
3167
  if (patched !== tag) patched["id"] = tag;
@@ -3438,7 +3451,7 @@ function flush(g, html) {
3438
3451
  const { id, triggers } = assets[di];
3439
3452
  const deferHTML = assetFlush(g, "defer", id);
3440
3453
  if (triggers) {
3441
- if (deferHTML) writeTriggerScript(deferHTML, triggers);
3454
+ if (deferHTML) writeTriggerScript(id, deferHTML, triggers);
3442
3455
  } else result += deferHTML;
3443
3456
  }
3444
3457
  g[kBlockIndex] = bi;
@@ -3462,8 +3475,9 @@ function addAsset(g, id, triggers) {
3462
3475
  if (JSON.stringify(existing.triggers) !== JSON.stringify(triggers)) console.error(`The lazy asset "${id}" is imported with different \`load\` triggers; an asset must use one consistent trigger.`);
3463
3476
  }
3464
3477
  }
3465
- function writeTriggerScript(html, triggers) {
3478
+ function writeTriggerScript(id, html, triggers) {
3466
3479
  const htmlStr = _escape_script(JSON.stringify(html));
3480
+ const insert = `(d=new Range().createContextualFragment(h),d.querySelectorAll("script").forEach(s=>s.onerror=()=>console.error(${_escape_script(JSON.stringify(`The lazy module for "${id}" failed to load; its server-rendered content cannot become interactive.`))})),p.after(d))`;
3467
3481
  const exprs = triggers.map((trigger) => {
3468
3482
  const options = trigger.options && toObjectExpression(trigger.options);
3469
3483
  switch (trigger.type) {
@@ -3473,7 +3487,7 @@ function writeTriggerScript(html, triggers) {
3473
3487
  default: return `(e=>e?.addEventListener("${trigger.type.slice(3)}",l,{once:1}))(${querySelectorOrLoad(trigger.selector)})`;
3474
3488
  }
3475
3489
  });
3476
- writeScript(`((p,h,d,l=$=>{d||p.after(new Range().createContextualFragment(d=h))})=>${exprs.length > 1 ? `{${exprs.join(";")}}` : exprs[0]})(document.currentScript,${htmlStr})`);
3490
+ writeScript(`((p,h,d,l=$=>{d||${insert}})=>${exprs.length > 1 ? `{${exprs.join(";")}}` : exprs[0]})(document.currentScript,${htmlStr})`);
3477
3491
  }
3478
3492
  function querySelectorOrLoad(selector) {
3479
3493
  return `document.querySelector(${JSON.stringify(selector)})||${`(console.warn(${JSON.stringify(`A lazy load trigger could not find an element matching "${selector}". The module was loaded immediately.`)}),l())`}`;
@@ -3645,4 +3659,4 @@ function drainClassFunctions($global, writeScope) {
3645
3659
  }
3646
3660
  function NOOP() {}
3647
3661
  //#endregion
3648
- export { $global, _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, _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, _id, _if, _peek_scope_id, _resume, _resume_branch, _resume_locals, writeScope as _scope, _scope_id, _scope_reason, _scope_with_id, _script, _sep, _serialize_guard, _serialize_if, _set_serialize_reason, _show_end, _show_start, _style_html, _subscribe, _template, _textarea_value, _to_text, _trailers, _try, _unescaped, _var, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, withLoadAssets, withPageAssets };
3662
+ export { $global, _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, _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, _serialize_guard, _serialize_if, _set_serialize_reason, _show_end, _show_start, _style_html, _subscribe, _template, _text_resume, _textarea_value, _to_text, _trailers, _try, _unescaped, _var, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, withLoadAssets, withPageAssets };
@@ -1,12 +1,12 @@
1
- let require_control_flow = require("../dom-DHJCbngT.js"), handlePendingTry = (fn, scope, branch) => {
1
+ let require_control_flow = require("../dom-DprILxYO.js"), handlePendingTry = (fn, scope, branch) => {
2
2
  for (; branch;) {
3
3
  if (branch.O?.i) return (branch.J ||= []).push(fn, scope);
4
4
  branch = branch.N;
5
5
  }
6
6
  };
7
7
  //#region src/dom/catch.feat.ts
8
- require_control_flow.$t((runEffects) => (effects, checkPending = require_control_flow.en.has(effects)) => {
9
- if (checkPending || require_control_flow.Qt.has(effects)) {
8
+ require_control_flow.en((runEffects) => (effects, checkPending = require_control_flow.tn.has(effects)) => {
9
+ if (checkPending || require_control_flow.$t.has(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 && !(checkPending && handlePendingTry(fn, scope, branch)) && fn(scope);
12
12
  } else runEffects(effects);
@@ -4,7 +4,7 @@ let handlePendingTry = (fn, scope, branch) => {
4
4
  branch = branch.N;
5
5
  }
6
6
  };
7
- import { $t as installCatch, Qt as caughtError, en as placeholderShown, g as renderCatch } from "../dom-BSAs0ur8.mjs";
7
+ import { $t as caughtError, en as installCatch, g as renderCatch, tn as placeholderShown } from "../dom-BbknkVDz.mjs";
8
8
  //#region src/dom/catch.feat.ts
9
9
  installCatch((runEffects) => (effects, checkPending = placeholderShown.has(effects)) => {
10
10
  if (checkPending || caughtError.has(effects)) {
@@ -1,3 +1,3 @@
1
- let require_control_flow = require("../dom-DHJCbngT.js");
1
+ let require_control_flow = require("../dom-DprILxYO.js");
2
2
  require_control_flow.z[0] = require_control_flow.T, require_control_flow.z[1] = require_control_flow.C, require_control_flow.z[2] = require_control_flow.A;
3
3
  //#endregion
@@ -1,3 +1,3 @@
1
- import { A as _attr_input_value_script, C as _attr_input_checkedValue_script, T as _attr_input_checked_script, z as controllableScripts } from "../dom-BSAs0ur8.mjs";
1
+ import { A as _attr_input_value_script, C as _attr_input_checkedValue_script, T as _attr_input_checked_script, z as controllableScripts } from "../dom-BbknkVDz.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,4 +1,4 @@
1
- let require_control_flow = require("../dom-DHJCbngT.js");
1
+ let require_control_flow = require("../dom-DprILxYO.js");
2
2
  //#region src/dom/controllable-open.feat.ts
3
3
  require_control_flow.z[4] = require_control_flow.y;
4
4
  //#endregion
@@ -1,4 +1,4 @@
1
- import { y as _attr_details_or_dialog_open_script, z as controllableScripts } from "../dom-BSAs0ur8.mjs";
1
+ import { y as _attr_details_or_dialog_open_script, z as controllableScripts } from "../dom-BbknkVDz.mjs";
2
2
  //#region src/dom/controllable-open.feat.ts
3
3
  controllableScripts[4] = _attr_details_or_dialog_open_script;
4
4
  //#endregion
@@ -1,4 +1,4 @@
1
- let require_control_flow = require("../dom-DHJCbngT.js");
1
+ let require_control_flow = require("../dom-DprILxYO.js");
2
2
  //#region src/dom/controllable-select.feat.ts
3
3
  require_control_flow.z[3] = require_control_flow.N;
4
4
  //#endregion
@@ -1,4 +1,4 @@
1
- import { N as _attr_select_value_script, z as controllableScripts } from "../dom-BSAs0ur8.mjs";
1
+ import { N as _attr_select_value_script, z as controllableScripts } from "../dom-BbknkVDz.mjs";
2
2
  //#region src/dom/controllable-select.feat.ts
3
3
  controllableScripts[3] = _attr_select_value_script;
4
4
  //#endregion
@@ -1,4 +1,4 @@
1
- let require_control_flow = require("../dom-DHJCbngT.js");
1
+ let require_control_flow = require("../dom-DprILxYO.js");
2
2
  //#region src/dom/controllable-textarea.feat.ts
3
3
  require_control_flow.z[2] = require_control_flow.A;
4
4
  //#endregion
@@ -1,4 +1,4 @@
1
- import { A as _attr_input_value_script, z as controllableScripts } from "../dom-BSAs0ur8.mjs";
1
+ import { A as _attr_input_value_script, z as controllableScripts } from "../dom-BbknkVDz.mjs";
2
2
  //#region src/dom/controllable-textarea.feat.ts
3
3
  controllableScripts[2] = _attr_input_value_script;
4
4
  //#endregion
@@ -1,3 +1,3 @@
1
- let require_control_flow = require("../dom-DHJCbngT.js");
1
+ let require_control_flow = require("../dom-DprILxYO.js");
2
2
  require("./controllable-input.feat.js"), require("./controllable-open.feat.js"), require("./controllable-select.feat.js"), require_control_flow.R.INPUT = require_control_flow.P, require_control_flow.R.TEXTAREA = require_control_flow.L, require_control_flow.R.SELECT = require_control_flow.I, require_control_flow.R.DETAILS = require_control_flow.R.DIALOG = require_control_flow.F;
3
3
  //#endregion
@@ -1,4 +1,4 @@
1
- import { F as _controllable_open, I as _controllable_select, L as _controllable_textarea, P as _controllable_input, R as controllableRenders } from "../dom-BSAs0ur8.mjs";
1
+ import { F as _controllable_open, I as _controllable_select, L as _controllable_textarea, P as _controllable_input, R as controllableRenders } from "../dom-BbknkVDz.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
@@ -19,7 +19,7 @@ export declare function _attrs_partial(scope: Scope, nodeAccessor: Accessor, nex
19
19
  export declare function _attrs_partial_content(scope: Scope, nodeAccessor: Accessor, nextAttrs: Record<string, unknown>, skip: Record<string, 1>, controllable?: ControllableAttrs): void;
20
20
  export declare function _attr_content(scope: Scope, nodeAccessor: Accessor, value: unknown): void;
21
21
  export declare function _attrs_script(scope: Scope, nodeAccessor: Accessor): void;
22
- export declare function _html(scope: Scope, value: unknown, accessor: Accessor): void;
22
+ export declare const _html: (scope: Scope, value: unknown, accessor: Accessor) => void;
23
23
  export declare function normalizeAttrValue(value: unknown): string | undefined;
24
24
  export declare function _lifecycle(scope: Scope, thisObj: Record<string, unknown> & {
25
25
  onMount?: (this: unknown) => Record<string, unknown> | void;
@@ -1,3 +1,3 @@
1
- let require_control_flow = require("../dom-DHJCbngT.js"), elementGetter = (branch) => () => branch.S;
1
+ let require_control_flow = require("../dom-DprILxYO.js"), elementGetter = (branch) => () => branch.S;
2
2
  require_control_flow.m((branch) => branch.T(elementGetter(branch))), require_control_flow.gt("_e", elementGetter);
3
3
  //#endregion
@@ -1,4 +1,4 @@
1
1
  let elementGetter = (branch) => () => branch.S;
2
- import { gt as _resume, m as installDynamicTagVar } from "../dom-BSAs0ur8.mjs";
2
+ import { gt as _resume, m as installDynamicTagVar } from "../dom-BbknkVDz.mjs";
3
3
  installDynamicTagVar((branch) => branch.T(elementGetter(branch))), _resume("_e", elementGetter);
4
4
  //#endregion
@@ -1,6 +1,6 @@
1
- let require_control_flow = require("../dom-DHJCbngT.js");
1
+ let require_control_flow = require("../dom-DprILxYO.js");
2
2
  //#region src/dom/placeholder.feat.ts
3
- require_control_flow.St._f = (tryBranch) => {
4
- tryBranch.P &&= (require_control_flow.Gt(tryBranch.P), 0);
3
+ require_control_flow.Ct._f = (tryBranch) => {
4
+ tryBranch.P &&= (require_control_flow.Kt(tryBranch.P), 0);
5
5
  };
6
6
  //#endregion
@@ -1,4 +1,4 @@
1
- import { Gt as destroyBranch, St as registeredValues } from "../dom-BSAs0ur8.mjs";
1
+ import { Ct as registeredValues, Kt as destroyBranch } from "../dom-BbknkVDz.mjs";
2
2
  //#region src/dom/placeholder.feat.ts
3
3
  registeredValues._f = (tryBranch) => {
4
4
  tryBranch.P &&= (destroyBranch(tryBranch.P), 0);
@@ -25,6 +25,7 @@ export interface RenderData {
25
25
  }
26
26
  export declare const registeredValues: Record<string, unknown>;
27
27
  export declare function ready(readyId: string): void;
28
+ export declare function readyFailed(readyId: string): void;
28
29
  export declare function withLazy<T>(runtime: T): T;
29
30
  export declare function initEmbedded(readyId: string, runtimeId?: string): void;
30
31
  export declare function init(runtimeId?: string): void;
@@ -4,7 +4,7 @@ let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "
4
4
  else if (Array.isArray(val)) for (let v of val) part = toDelimitedString(v, delimiter, stringify), part && (str += sep + part, sep = delimiter);
5
5
  else for (let name in val) part = stringify(name, val[name]), part && (str += sep + part, sep = delimiter);
6
6
  return str;
7
- }, decodeAccessor = (num) => (num + (num < 26 ? 10 : num < 962 ? 334 : 11998)).toString(36), branchesEnabled, rendering, runId = 2, caughtError = /* @__PURE__ */ new WeakSet(), placeholderShown = /* @__PURE__ */ new WeakSet(), pendingEffects = [], pendingRenders = [], runEffects = ((effects) => {
7
+ }, decodeAccessor = (num) => (num + (num < 26 ? 10 : num < 962 ? 334 : 11998)).toString(36), branchesEnabled, dynamicHtmlEnabled, rendering, runId = 2, caughtError = /* @__PURE__ */ new WeakSet(), placeholderShown = /* @__PURE__ */ new WeakSet(), pendingEffects = [], pendingRenders = [], runEffects = ((effects) => {
8
8
  for (let i = 0; i < effects.length;) effects[i++](effects[i++]);
9
9
  }), runRender = (render) => {
10
10
  (!branchesEnabled || render.b.F?.H !== 0) && render.c(render.b, render.d);
@@ -26,7 +26,10 @@ let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "
26
26
  if (currentNode.firstChild) return currentNode = currentNode.firstChild;
27
27
  for (; !currentNode.nextSibling && currentNode.parentNode;) currentNode = currentNode.parentNode;
28
28
  walkNextSibling();
29
- }, walkNextSibling = () => currentNode = currentNode.nextSibling || currentNode, registeredValues = {}, curRenders, embedRenders, readyIds, lazyEnabled, isResuming, cloneCache = {}, R = /[\p{L}\p{N}]/gu, inputType = "", controllableScripts = {}, controllableRenders = {}, _if = /*@__PURE__*/ withBranches((nodeAccessor, ...branchesArgs) => {
29
+ }, walkNextSibling = () => currentNode = currentNode.nextSibling || currentNode, registeredValues = {}, curRenders, embedRenders, readyIds, lazyEnabled, isResuming, cloneCache = {}, _html = /*@__PURE__*/ withDynamicHtml(function(scope, value, accessor) {
30
+ let firstChild = scope[accessor], parentNode = firstChild.parentNode, lastChild = scope["H" + accessor] || firstChild, newContent = parseHTML(_to_text(value), parentNode.namespaceURI);
31
+ insertChildNodes(parentNode, firstChild, scope[accessor] = newContent.firstChild || newContent.appendChild(new Text()), scope["H" + accessor] = newContent.lastChild), removeChildNodes(firstChild, lastChild);
32
+ }), R = /[\p{L}\p{N}]/gu, inputType = "", controllableScripts = {}, controllableRenders = {}, _if = /*@__PURE__*/ withBranches((nodeAccessor, ...branchesArgs) => {
30
33
  nodeAccessor = decodeAccessor(nodeAccessor);
31
34
  let branchAccessor = "D" + nodeAccessor, branches = [], i = 0;
32
35
  for (; i < branchesArgs.length;) branches.push(_content("", branchesArgs[i++], branchesArgs[i++], branchesArgs[i++])());
@@ -163,6 +166,9 @@ function normalizeDynamicRenderer(value) {
163
166
  function withBranches(runtime) {
164
167
  return branchesEnabled = 1, runtime;
165
168
  }
169
+ function withDynamicHtml(runtime) {
170
+ return dynamicHtmlEnabled = 1, runtime;
171
+ }
166
172
  function _hoist_read_error() {}
167
173
  function _assert_hoist(value) {}
168
174
  //#endregion
@@ -509,6 +515,7 @@ function ready(readyId) {
509
515
  (readyIds ||= /* @__PURE__ */ new Set()).add(readyId);
510
516
  for (let renderId in curRenders) runResumeEffects(curRenders[renderId]);
511
517
  }
518
+ function readyFailed(readyId) {}
512
519
  function withLazy(runtime) {
513
520
  return lazyEnabled = 1, runtime;
514
521
  }
@@ -540,7 +547,7 @@ function init(runtimeId = "M") {
540
547
  for (visitType !== "[" && (visitScope[nextToken()] = visitType === ")" || visitType === "}" ? parent : visit, accessor = "A" + lastToken, singleNode = visitType !== "]" && visitType !== ")", nextToken()); branchId = +lastToken;) {
541
548
  if ((endedBranches ||= []).push(branch = getScope(branchId)), setParentBranch(branch, branch.F), (branch.O = render.p?.[branchId]) && (branch.O.m = render.m), singleNode) {
542
549
  for (; startVisit.previousSibling && ~visits.indexOf(startVisit = startVisit.previousSibling););
543
- branch._ ??= visitScope, branch.K = branch.S = startVisit, visitType === "'" && (branch.a = startVisit);
550
+ branch._ ??= visitScope, branch.K = branch.S = startVisit, visitType === "(" && (branch.a = startVisit);
544
551
  } 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);
545
552
  for (; i && orphanBranches[i - 1].L > branchId;) i--, setParentBranch(orphanBranches.pop(), branch);
546
553
  for (; j && deferredOwners[j - 1].L > branchId;) {
@@ -569,7 +576,7 @@ function init(runtimeId = "M") {
569
576
  }
570
577
  }
571
578
  return resumes.splice(0, i), i;
572
- }, lastEffect, visits, visit, visitText, visitType, visitScope, lastToken, lastTokenIndex, visitBranches, embedAnchor;
579
+ }, lastEffect, visits, visit, visitText, visitType, visitScope, lastToken, lastTokenIndex, visitBranches, htmlStart, embedAnchor;
573
580
  return serializeContext._ = registeredValues, render.m = (effects) => {
574
581
  if (processResumes(render.r, effects), readyIds && render.b) for (let progress = 1; progress;) {
575
582
  progress = 0;
@@ -579,10 +586,7 @@ function init(runtimeId = "M") {
579
586
  }
580
587
  }
581
588
  let retained = 0;
582
- for (visit of visits = render.v) if (lastTokenIndex = render.i.length, visitText = visit.data, visitType = visitText[lastTokenIndex++], visitScope = getScope(nextToken()), visitType === "*") {
583
- let prev = visit.previousSibling;
584
- visitScope[nextToken()] = prev && (prev.nodeType < 8 || prev.data) ? prev : visit.parentNode.insertBefore(new Text(), visit);
585
- } else branchesEnabled ? (visitBranches ||= createVisitBranches())() : lazyEnabled && render.b && (visits[retained++] = visit);
589
+ for (visit of visits = render.v) lastTokenIndex = render.i.length, visitText = visit.data, visitType = visitText[lastTokenIndex++], visitScope = getScope(nextToken()), dynamicHtmlEnabled && visitType > "%" && visitType <= "'" ? visitType === "&" ? htmlStart = visit : (visitScope[nextToken()] = htmlStart, visitScope["H" + lastToken] = visit) : branchesEnabled && visitType > "'" ? (visitBranches ||= createVisitBranches())() : lazyEnabled && render.b && visitType > "%" ? visits[retained++] = visit : visitScope[nextToken()] = visitType === "$" ? visit.previousSibling : visit.parentNode.insertBefore(new Text(), visit);
586
590
  return embedRenders && !embedAnchor && visit && embedRenders.set(embedAnchor = visit.parentNode.insertBefore(new Text(), visit.nextSibling), [renderId, scopeLookup]), visits.length = retained, effects;
587
591
  }, render.w = () => {
588
592
  walk(), runResumeEffects(render);
@@ -774,10 +778,6 @@ function _attrs_script(scope, nodeAccessor) {
774
778
  controllableScripts[scope["F" + nodeAccessor]]?.(scope, nodeAccessor);
775
779
  for (let name in events) _on(el, name, events[name]);
776
780
  }
777
- function _html(scope, value, accessor) {
778
- let firstChild = scope[accessor], parentNode = firstChild.parentNode, lastChild = scope["H" + accessor] || firstChild, newContent = parseHTML(_to_text(value), parentNode.namespaceURI);
779
- insertChildNodes(parentNode, firstChild, scope[accessor] = newContent.firstChild || newContent.appendChild(new Text()), scope["H" + accessor] = newContent.lastChild), removeChildNodes(firstChild, lastChild);
780
- }
781
781
  function normalizeClientRender(value) {
782
782
  let renderer = normalizeDynamicRenderer(value);
783
783
  if (renderer && renderer.a) return renderer;
@@ -1153,4 +1153,4 @@ function byFirstArg(name) {
1153
1153
  return name;
1154
1154
  }
1155
1155
  //#endregion
1156
- export { _attrs_script as $, installCatch as $t, _attr_input_value_script as A, _for_selector as At, _attr as B, _return_change as Bt, _attr_input_checkedValue_script as C, withLazy as Ct, _attr_input_value_attribute_default as D, _const as Dt, _attr_input_value as E, _closure_get as Et, _controllable_open as F, _if_closure as Ft, _attr_nonce as G, destroyBranch as Gt, _attr_class_item as H, _var as Ht, _controllable_select as I, _let as It, _attr_style_items as J, syncGen as Jt, _attr_style as K, insertBranchBefore as Kt, _controllable_textarea as L, _let_change as Lt, _attr_select_value_default as M, _hoist as Mt, _attr_select_value_script as N, _hoist_resume as Nt, _attr_input_value_default as O, _el_read as Ot, _controllable_input as P, _id as Pt, _attrs_partial_content as Q, caughtError as Qt, controllableRenders as R, _or as Rt, _attr_input_checkedValue_default as S, registeredValues as St, _attr_input_checked_script as T, _closure as Tt, _attr_class_items as U, _var_change as Ut, _attr_class as V, _script as Vt, _attr_content as W, _assert_init as Wt, _attrs_content as X, $signal as Xt, _attrs as Y, _on as Yt, _attrs_partial as Z, $signalReset as Zt, _attr_details_or_dialog_open as _, _var_resume as _t, _for_in as a, runEffects as an, _text_content as at, _attr_input_checked as b, initEmbedded as bt, _for_until as c, forOf as cn, toInsertNode as ct, _show as d, _assert_hoist as dn, _content_resume as dt, placeholderShown as en, _html as et, _try as f, _hoist_read_error as fn, createAndSetupBranch as ft, renderCatch as g, _resume as gt, patchDynamicTag as h, _el as ht, _dynamic_tag_content as i, run as in, _text as it, _attr_select_value as j, _global_read as jt, _attr_input_value_dynamic_default as k, _for_closure as kt, _if as l, forTo as ln, _content as lt, installDynamicTagVar as m, decodeAccessor as mn, setupBranch as mt, _await_promise as n, queueAsyncRender as nn, _style_rule_item as nt, _for_of as o, runId as on, _to_text as ot, addAwaitCounter as p, _call as pn, createBranch as pt, _attr_style_item as q, removeAndDestroyBranch as qt, _dynamic_tag as r, queueEffect as rn, _style_shell as rt, _for_to as s, forIn as sn, insertChildNodes as st, _await_content as t, prepareEffects as tn, _lifecycle as tt, _resume_dynamic_tag as u, forUntil as un, _content_closures as ut, _attr_details_or_dialog_open_default as v, getRegisteredWithScope as vt, _attr_input_checked_default as w, _child_setup as wt, _attr_input_checkedValue as x, ready as xt, _attr_details_or_dialog_open_script as y, init as yt, controllableScripts as z, _return as zt };
1156
+ export { _attrs_script as $, caughtError as $t, _attr_input_value_script as A, _for_closure as At, _attr as B, _return as Bt, _attr_input_checkedValue_script as C, registeredValues as Ct, _attr_input_value_attribute_default as D, _closure_get as Dt, _attr_input_value as E, _closure as Et, _controllable_open as F, _id as Ft, _attr_nonce as G, _assert_init as Gt, _attr_class_item as H, _script as Ht, _controllable_select as I, _if_closure as It, _attr_style_items as J, removeAndDestroyBranch as Jt, _attr_style as K, destroyBranch as Kt, _controllable_textarea as L, _let as Lt, _attr_select_value_default as M, _global_read as Mt, _attr_select_value_script as N, _hoist as Nt, _attr_input_value_default as O, _const as Ot, _controllable_input as P, _hoist_resume as Pt, _attrs_partial_content as Q, $signalReset as Qt, controllableRenders as R, _let_change as Rt, _attr_input_checkedValue_default as S, readyFailed as St, _attr_input_checked_script as T, _child_setup as Tt, _attr_class_items as U, _var as Ut, _attr_class as V, _return_change as Vt, _attr_content as W, _var_change as Wt, _attrs_content as X, _on as Xt, _attrs as Y, syncGen as Yt, _attrs_partial as Z, $signal as Zt, _attr_details_or_dialog_open as _, _var_resume as _t, _for_in as a, run as an, _text_content as at, _attr_input_checked as b, initEmbedded as bt, _for_until as c, forIn as cn, toInsertNode as ct, _show as d, forUntil as dn, _content_resume as dt, installCatch as en, _html as et, _try as f, _assert_hoist as fn, createAndSetupBranch as ft, renderCatch as g, _resume as gt, patchDynamicTag as h, decodeAccessor as hn, _el as ht, _dynamic_tag_content as i, queueEffect as in, _text as it, _attr_select_value as j, _for_selector as jt, _attr_input_value_dynamic_default as k, _el_read as kt, _if as l, forOf as ln, _content as lt, installDynamicTagVar as m, _call as mn, setupBranch as mt, _await_promise as n, prepareEffects as nn, _style_rule_item as nt, _for_of as o, runEffects as on, _to_text as ot, addAwaitCounter as p, _hoist_read_error as pn, createBranch as pt, _attr_style_item as q, insertBranchBefore as qt, _dynamic_tag as r, queueAsyncRender as rn, _style_shell as rt, _for_to as s, runId as sn, insertChildNodes as st, _await_content as t, placeholderShown as tn, _lifecycle as tt, _resume_dynamic_tag as u, forTo as un, _content_closures as ut, _attr_details_or_dialog_open_default as v, getRegisteredWithScope as vt, _attr_input_checked_default as w, withLazy as wt, _attr_input_checkedValue as x, ready as xt, _attr_details_or_dialog_open_script as y, init as yt, controllableScripts as z, _or as zt };