marko 6.3.56 → 6.4.0

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 (81) hide show
  1. package/cheatsheet.md +2 -2
  2. package/dist/common/constants/accessor-prefix.d.ts +1 -0
  3. package/dist/common/constants/accessor-prefix.debug.d.ts +1 -0
  4. package/dist/common/constants/accessor-prop.d.ts +3 -0
  5. package/dist/common/constants/accessor-prop.debug.d.ts +3 -0
  6. package/dist/common/types.d.ts +8 -2
  7. package/dist/debug/dom/catch.feat.js +12 -14
  8. package/dist/debug/dom/catch.feat.mjs +12 -14
  9. package/dist/debug/dom/controllable-input.feat.js +1 -1
  10. package/dist/debug/dom/controllable-input.feat.mjs +1 -1
  11. package/dist/debug/dom/controllable-open.feat.js +1 -1
  12. package/dist/debug/dom/controllable-open.feat.mjs +1 -1
  13. package/dist/debug/dom/controllable-select.feat.js +1 -1
  14. package/dist/debug/dom/controllable-select.feat.mjs +1 -1
  15. package/dist/debug/dom/controllable-textarea.feat.js +1 -1
  16. package/dist/debug/dom/controllable-textarea.feat.mjs +1 -1
  17. package/dist/debug/dom/controllable.feat.js +1 -1
  18. package/dist/debug/dom/controllable.feat.mjs +1 -1
  19. package/dist/debug/dom/dynamic-tag-script.feat.js +1 -1
  20. package/dist/debug/dom/dynamic-tag-script.feat.mjs +1 -1
  21. package/dist/debug/dom/dynamic-tag-var.feat.js +1 -1
  22. package/dist/debug/dom/dynamic-tag-var.feat.mjs +1 -1
  23. package/dist/debug/dom/lazy.feat.js +4 -0
  24. package/dist/debug/dom/lazy.feat.mjs +4 -0
  25. package/dist/debug/dom/placeholder.feat.js +1 -1
  26. package/dist/debug/dom/placeholder.feat.mjs +1 -1
  27. package/dist/debug/{dom-DcwejnYg.js → dom-BRO5aArp.js} +232 -178
  28. package/dist/debug/{dom-BeCNT5R5.mjs → dom-Btj2QJhk.mjs} +215 -167
  29. package/dist/debug/dom.js +14 -12
  30. package/dist/debug/dom.mjs +14 -12
  31. package/dist/debug/html.js +603 -517
  32. package/dist/debug/html.mjs +602 -518
  33. package/dist/dom/abort-signal.d.ts +2 -0
  34. package/dist/dom/catch.feat.js +6 -7
  35. package/dist/dom/catch.feat.mjs +5 -7
  36. package/dist/dom/control-flow.d.ts +3 -5
  37. package/dist/dom/controllable-input.feat.js +3 -2
  38. package/dist/dom/controllable-input.feat.mjs +1 -1
  39. package/dist/dom/controllable-open.feat.js +3 -2
  40. package/dist/dom/controllable-open.feat.mjs +1 -1
  41. package/dist/dom/controllable-select.feat.js +3 -2
  42. package/dist/dom/controllable-select.feat.mjs +1 -1
  43. package/dist/dom/controllable-textarea.feat.js +3 -2
  44. package/dist/dom/controllable-textarea.feat.mjs +1 -1
  45. package/dist/dom/controllable.feat.js +3 -2
  46. package/dist/dom/controllable.feat.mjs +1 -1
  47. package/dist/dom/dynamic-tag-script.feat.js +3 -2
  48. package/dist/dom/dynamic-tag-script.feat.mjs +1 -1
  49. package/dist/dom/dynamic-tag-var.feat.js +2 -1
  50. package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
  51. package/dist/dom/lazy.feat.d.ts +1 -0
  52. package/dist/dom/lazy.feat.js +4 -0
  53. package/dist/dom/lazy.feat.mjs +4 -0
  54. package/dist/dom/load.d.ts +3 -3
  55. package/dist/dom/placeholder.feat.js +4 -3
  56. package/dist/dom/placeholder.feat.mjs +1 -1
  57. package/dist/dom/queue.d.ts +2 -4
  58. package/dist/dom/resume.d.ts +1 -1
  59. package/dist/dom/scope.d.ts +0 -1
  60. package/dist/{dom-BwNsIevR.mjs → dom-B-v8Gw6T.mjs} +114 -87
  61. package/dist/{dom-QEF0csuC.js → dom-BSsI9OPC.js} +210 -182
  62. package/dist/dom.js +59 -56
  63. package/dist/dom.mjs +34 -32
  64. package/dist/html/attrs.d.ts +2 -0
  65. package/dist/html/writer.d.ts +5 -11
  66. package/dist/html.d.ts +1 -1
  67. package/dist/html.js +362 -317
  68. package/dist/html.mjs +361 -317
  69. package/dist/translator/index.js +791 -650
  70. package/dist/translator/util/binding-has-prop.d.ts +2 -0
  71. package/dist/translator/util/entry-builder.d.ts +2 -0
  72. package/dist/translator/util/generate-uid.d.ts +5 -0
  73. package/dist/translator/util/references.d.ts +3 -2
  74. package/dist/translator/util/runtime.d.ts +3 -3
  75. package/dist/translator/util/sections.d.ts +8 -2
  76. package/dist/translator/util/serialize-reasons.d.ts +2 -2
  77. package/dist/translator/util/setup-work.d.ts +5 -0
  78. package/dist/translator/util/signals.d.ts +5 -7
  79. package/dist/translator/visitors/tag/native-tag.d.ts +1 -0
  80. package/package.json +3 -3
  81. package/dist/translator/util/setup-statements.d.ts +0 -5
@@ -1,6 +1,8 @@
1
1
  import { type Scope } from "../common/types";
2
2
  export declare function $signalReset(scope: Scope, id: string | number): void;
3
3
  export declare function $signal(scope: Scope, id: string | number): AbortSignal;
4
+ /** Runs `abort` as a destroyed scope's `$signal` would fire, without creating one. */
5
+ export declare function trackAbort(scope: Scope, id: string | number, abort: () => void): void;
4
6
  /** Enrols `scope` with its branch so destroying the branch cleans it up. */
5
7
  export declare function trackCleanup(scope: Scope, subscribers?: Set<Scope>): void;
6
8
  export declare let abortsEnabled: undefined | 1;
@@ -1,15 +1,14 @@
1
- let require_control_flow = require("../dom-QEF0csuC.js"), handlePendingTry = (fn, scope, branch) => {
1
+ "use strict";
2
+ let require_control_flow = require("../dom-BSsI9OPC.js"), handlePendingTry = (fn, scope, branch) => {
2
3
  for (; branch;) {
3
- if (branch.O?.i) return (branch.J ||= []).push(fn, scope);
4
+ if (branch.O?.i) return (scope.J ||= ((branch.JS ||= (branch.O.m && ((complete) => branch.O.c = () => complete() || require_control_flow.an(branch, require_control_flow.on, require_control_flow.b))(branch.O.c), [])).push(scope), /* @__PURE__ */ new Set())).add(fn);
4
5
  branch = branch.N;
5
6
  }
6
7
  };
7
8
  //#region src/dom/catch.feat.ts
8
- require_control_flow.rn((runEffects) => (effects, checkPending = require_control_flow.in.has(effects)) => {
9
- if (checkPending || require_control_flow.nn.has(effects)) {
10
- let i = 0, fn, scope, branch;
11
- for (; i < effects.length;) fn = effects[i++], scope = effects[i++], (branch = scope.F)?.H !== 0 && !(checkPending && handlePendingTry(fn, scope, branch)) && fn(scope);
12
- } else runEffects(effects);
9
+ require_control_flow.rn((effects) => {
10
+ let i = 0, fn, scope, branch;
11
+ for (; i < effects.length;) fn = effects[i++], scope = effects[i++], (branch = scope.F)?.H !== 0 && !handlePendingTry(fn, scope, branch) && fn(scope);
13
12
  }, (runRender) => (render) => {
14
13
  try {
15
14
  let branch = render.b.F;
@@ -1,16 +1,14 @@
1
1
  let handlePendingTry = (fn, scope, branch) => {
2
2
  for (; branch;) {
3
- if (branch.O?.i) return (branch.J ||= []).push(fn, scope);
3
+ if (branch.O?.i) return (scope.J ||= ((branch.JS ||= (branch.O.m && ((complete) => branch.O.c = () => complete() || queueAsyncRender(branch, queueEffect, runPendingEffects))(branch.O.c), [])).push(scope), /* @__PURE__ */ new Set())).add(fn);
4
4
  branch = branch.N;
5
5
  }
6
6
  };
7
- import { in as placeholderShown, nn as caughtError, rn as installCatch, y as renderCatch } from "../dom-BwNsIevR.mjs";
7
+ import { an as queueAsyncRender, b as runPendingEffects, on as queueEffect, rn as installCatch, y as renderCatch } from "../dom-B-v8Gw6T.mjs";
8
8
  //#region src/dom/catch.feat.ts
9
- installCatch((runEffects) => (effects, checkPending = placeholderShown.has(effects)) => {
10
- if (checkPending || caughtError.has(effects)) {
11
- let i = 0, fn, scope, branch;
12
- for (; i < effects.length;) fn = effects[i++], scope = effects[i++], (branch = scope.F)?.H !== 0 && !(checkPending && handlePendingTry(fn, scope, branch)) && fn(scope);
13
- } else runEffects(effects);
9
+ installCatch((effects) => {
10
+ let i = 0, fn, scope, branch;
11
+ for (; i < effects.length;) fn = effects[i++], scope = effects[i++], (branch = scope.F)?.H !== 0 && !handlePendingTry(fn, scope, branch) && fn(scope);
14
12
  }, (runRender) => (render) => {
15
13
  try {
16
14
  let branch = render.b.F;
@@ -1,13 +1,11 @@
1
1
  import { type Accessor, AccessorProp, type AwaitCounter, type BranchScope, type EncodedAccessor, type Scope } from "../common/types";
2
- import { type Renderer, type SetupFn } from "./renderer";
2
+ import { _content, type Renderer, type SetupFn } from "./renderer";
3
3
  import { type Signal } from "./signals";
4
4
  export declare function _await_promise(nodeAccessor: EncodedAccessor, params?: Signal<unknown>): (scope: Scope, promise: unknown) => unknown;
5
5
  export declare function _await_content(nodeAccessor: EncodedAccessor, template?: string | 0, walks?: string | 0, setup?: SetupFn | 0): (scope: Scope) => void;
6
6
  export declare function addAwaitCounter(scope: Scope, tryBranch?: BranchScope | undefined): AwaitCounter | undefined;
7
- export declare function _try(nodeAccessor: EncodedAccessor, template?: string | 0, walks?: string | 0, setup?: SetupFn | 0): (scope: Scope, input: {
8
- catch: unknown;
9
- placeholder: unknown;
10
- }) => void;
7
+ export declare function runPendingEffects(tryBranch: BranchScope): void;
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;
11
9
  export declare function renderCatch(scope: Scope, error: unknown): void;
12
10
  export declare const _if: (nodeAccessor: EncodedAccessor, ...branchesArgs: (string | SetupFn | 0)[]) => (scope: Scope, newBranch: number) => void;
13
11
  export declare const _show: (nodeAccessor: EncodedAccessor, startNodeAccessor?: EncodedAccessor, endNodeAccessor?: EncodedAccessor) => (scope: Scope, display: unknown) => void;
@@ -1,3 +1,4 @@
1
- let require_control_flow = require("../dom-QEF0csuC.js");
2
- require_control_flow.H[0] = require_control_flow.O, require_control_flow.H[1] = require_control_flow.E, require_control_flow.H[2] = require_control_flow.N;
1
+ "use strict";
2
+ let require_control_flow = require("../dom-BSsI9OPC.js");
3
+ require_control_flow.U[0] = require_control_flow.k, require_control_flow.U[1] = require_control_flow.D, require_control_flow.U[2] = require_control_flow.P;
3
4
  //#endregion
@@ -1,3 +1,3 @@
1
- import { E as _attr_input_checkedValue_script, H as controllableScripts, N as _attr_input_value_script, O as _attr_input_checked_script } from "../dom-BwNsIevR.mjs";
1
+ import { D as _attr_input_checkedValue_script, P as _attr_input_value_script, U as controllableScripts, k as _attr_input_checked_script } from "../dom-B-v8Gw6T.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,5 @@
1
- let require_control_flow = require("../dom-QEF0csuC.js");
1
+ "use strict";
2
+ let require_control_flow = require("../dom-BSsI9OPC.js");
2
3
  //#region src/dom/controllable-open.feat.ts
3
- require_control_flow.H[4] = require_control_flow.S;
4
+ require_control_flow.U[4] = require_control_flow.C;
4
5
  //#endregion
@@ -1,4 +1,4 @@
1
- import { H as controllableScripts, S as _attr_details_or_dialog_open_script } from "../dom-BwNsIevR.mjs";
1
+ import { C as _attr_details_or_dialog_open_script, U as controllableScripts } from "../dom-B-v8Gw6T.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,5 @@
1
- let require_control_flow = require("../dom-QEF0csuC.js");
1
+ "use strict";
2
+ let require_control_flow = require("../dom-BSsI9OPC.js");
2
3
  //#region src/dom/controllable-select.feat.ts
3
- require_control_flow.H[3] = require_control_flow.I;
4
+ require_control_flow.U[3] = require_control_flow.L;
4
5
  //#endregion
@@ -1,4 +1,4 @@
1
- import { H as controllableScripts, I as _attr_select_value_script } from "../dom-BwNsIevR.mjs";
1
+ import { L as _attr_select_value_script, U as controllableScripts } from "../dom-B-v8Gw6T.mjs";
2
2
  //#region src/dom/controllable-select.feat.ts
3
3
  controllableScripts[3] = _attr_select_value_script;
4
4
  //#endregion
@@ -1,4 +1,5 @@
1
- let require_control_flow = require("../dom-QEF0csuC.js");
1
+ "use strict";
2
+ let require_control_flow = require("../dom-BSsI9OPC.js");
2
3
  //#region src/dom/controllable-textarea.feat.ts
3
- require_control_flow.H[2] = require_control_flow.N;
4
+ require_control_flow.U[2] = require_control_flow.P;
4
5
  //#endregion
@@ -1,4 +1,4 @@
1
- import { H as controllableScripts, N as _attr_input_value_script } from "../dom-BwNsIevR.mjs";
1
+ import { P as _attr_input_value_script, U as controllableScripts } from "../dom-B-v8Gw6T.mjs";
2
2
  //#region src/dom/controllable-textarea.feat.ts
3
3
  controllableScripts[2] = _attr_input_value_script;
4
4
  //#endregion
@@ -1,3 +1,4 @@
1
- let require_control_flow = require("../dom-QEF0csuC.js");
2
- require("./controllable-input.feat.js"), require("./controllable-open.feat.js"), require("./controllable-select.feat.js"), require_control_flow.V.INPUT = require_control_flow.L, require_control_flow.V.TEXTAREA = require_control_flow.B, require_control_flow.V.SELECT = require_control_flow.z, require_control_flow.V.DETAILS = require_control_flow.V.DIALOG = require_control_flow.R;
1
+ "use strict";
2
+ let require_control_flow = require("../dom-BSsI9OPC.js");
3
+ require("./controllable-input.feat.js"), require("./controllable-open.feat.js"), require("./controllable-select.feat.js"), require_control_flow.H.INPUT = require_control_flow.R, require_control_flow.H.TEXTAREA = require_control_flow.V, require_control_flow.H.SELECT = require_control_flow.B, require_control_flow.H.DETAILS = require_control_flow.H.DIALOG = require_control_flow.z;
3
4
  //#endregion
@@ -1,4 +1,4 @@
1
- import { B as _controllable_textarea, L as _controllable_input, R as _controllable_open, V as controllableRenders, z as _controllable_select } from "../dom-BwNsIevR.mjs";
1
+ import { B as _controllable_select, H as controllableRenders, R as _controllable_input, V as _controllable_textarea, z as _controllable_open } from "../dom-B-v8Gw6T.mjs";
2
2
  import "./controllable-input.feat.mjs";
3
3
  import "./controllable-open.feat.mjs";
4
4
  import "./controllable-select.feat.mjs";
@@ -1,4 +1,5 @@
1
- let require_control_flow = require("../dom-QEF0csuC.js");
1
+ "use strict";
2
+ let require_control_flow = require("../dom-BSsI9OPC.js");
2
3
  //#region src/dom/dynamic-tag-script.feat.ts
3
- require_control_flow.bt._d = require_control_flow.yn(require_control_flow.g);
4
+ require_control_flow.xt._d = require_control_flow.yn(require_control_flow.g);
4
5
  //#endregion
@@ -1,4 +1,4 @@
1
- import { bt as _resumed, g as dynamicTagScript, yn as withBranches } from "../dom-BwNsIevR.mjs";
1
+ import { g as dynamicTagScript, xt as _resumed, yn as withBranches } from "../dom-B-v8Gw6T.mjs";
2
2
  //#region src/dom/dynamic-tag-script.feat.ts
3
3
  _resumed._d = withBranches(dynamicTagScript);
4
4
  //#endregion
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  //#region src/dom/dynamic-tag-var.feat.ts
2
- require("../dom-QEF0csuC.js")._((branch) => branch.T(() => branch.S));
3
+ require("../dom-BSsI9OPC.js")._((branch) => branch.T(() => branch.S));
3
4
  //#endregion
@@ -1,4 +1,4 @@
1
- import { _ as installDynamicTagVar } from "../dom-BwNsIevR.mjs";
1
+ import { _ as installDynamicTagVar } from "../dom-B-v8Gw6T.mjs";
2
2
  //#region src/dom/dynamic-tag-var.feat.ts
3
3
  installDynamicTagVar((branch) => branch.T(() => branch.S));
4
4
  //#endregion
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ //#region src/dom/lazy.feat.ts
3
+ require("../dom-BSsI9OPC.js").Ot();
4
+ //#endregion
@@ -0,0 +1,4 @@
1
+ import { Ot as withLazy } from "../dom-B-v8Gw6T.mjs";
2
+ //#region src/dom/lazy.feat.ts
3
+ withLazy();
4
+ //#endregion
@@ -10,9 +10,9 @@ interface LoadSignal {
10
10
  export interface LoadTrigger {
11
11
  <T>(load: () => Promise<T>): () => Promise<T>;
12
12
  }
13
- export declare const _load_template: (id: string, load: () => Promise<Renderer>) => Template & Renderer;
14
- export declare const _load_setup: (load: () => Promise<LoadModule>) => (owner: Scope, child: BranchScope, marker: ChildNode) => void;
15
- export declare const _load_signal: (load: () => Promise<LoadSignal>) => Signal;
13
+ export declare function _load_template(id: string, load: () => Promise<Renderer>): Template & Renderer;
14
+ export declare function _load_setup(load: () => Promise<LoadModule>): (owner: Scope, child: BranchScope, marker: ChildNode) => void;
15
+ export declare function _load_signal(load: () => Promise<LoadSignal>): Signal;
16
16
  export declare function _load_visible_trigger(selector: string, options?: IntersectionObserverInit): LoadTrigger;
17
17
  export declare function _load_idle_trigger(options?: {
18
18
  timeout?: number;
@@ -1,6 +1,7 @@
1
- let require_control_flow = require("../dom-QEF0csuC.js");
1
+ "use strict";
2
+ let require_control_flow = require("../dom-BSsI9OPC.js");
2
3
  //#region src/dom/placeholder.feat.ts
3
- require_control_flow.bt._f = (tryBranch) => {
4
- tryBranch.P &&= (require_control_flow.Yt(tryBranch.P), 0);
4
+ require_control_flow.xt._f = (tryBranch) => {
5
+ tryBranch.P &&= (require_control_flow.Xt(tryBranch.P), 0);
5
6
  };
6
7
  //#endregion
@@ -1,4 +1,4 @@
1
- import { Yt as destroyBranch, bt as _resumed } from "../dom-BwNsIevR.mjs";
1
+ import { Xt as destroyBranch, xt as _resumed } from "../dom-B-v8Gw6T.mjs";
2
2
  //#region src/dom/placeholder.feat.ts
3
3
  _resumed._f = (tryBranch) => {
4
4
  tryBranch.P &&= (destroyBranch(tryBranch.P), 0);
@@ -11,8 +11,6 @@ export type PendingRender = {
11
11
  };
12
12
  export declare let rendering: undefined | 0 | 1;
13
13
  export declare let runId: number;
14
- export declare const caughtError: WeakSet<unknown[]>;
15
- export declare const placeholderShown: WeakSet<unknown[]>;
16
14
  export declare let pendingEffects: unknown[];
17
15
  export declare function queueRender<T, U extends Scope = Scope>(scope: U, signal: Signal<T, U>, signalKey: number, value?: T, scopeKey?: number): void;
18
16
  export declare function queuePendingRender(render: PendingRender): void;
@@ -20,7 +18,7 @@ export declare function queueEffect<S extends Scope, T extends ExecFn<S>>(scope:
20
18
  export declare function run(): void;
21
19
  export declare function queueAsyncRender<T, U extends Scope = Scope>(scope: U, signal: Signal<T, U>, value?: T): void;
22
20
  export declare function prepareEffects(fn: () => void): unknown[];
23
- export declare let runEffects: (effects: unknown[], checkPending?: boolean | 1) => void;
21
+ export declare let runEffects: (effects: unknown[]) => void;
24
22
  declare let runRender: (render: PendingRender) => void;
25
- export declare function installCatch(wrapEffects: (base: typeof runEffects) => typeof runEffects, wrapRender: (base: typeof runRender) => typeof runRender): void;
23
+ export declare function installCatch(catchEffects: typeof runEffects, wrapRender: (base: typeof runRender) => typeof runRender): void;
26
24
  export {};
@@ -26,7 +26,7 @@ export interface RenderData {
26
26
  export declare const _resumed: Record<string, unknown>;
27
27
  export declare function ready(readyId: string): void;
28
28
  export declare function readyFailed(readyId: string): void;
29
- export declare function withLazy<T>(runtime: T): T;
29
+ export declare function withLazy(): void;
30
30
  export declare function initEmbedded(readyId: string, runtimeId?: string): void;
31
31
  export declare function init(runtimeId?: string): void;
32
32
  export declare let isResuming: undefined | 0 | 1;
@@ -4,7 +4,6 @@ export declare function syncGen(scope: Scope): void;
4
4
  export declare function _assert_init(scope: Scope, accessor: string): any;
5
5
  export declare function collectScopes(fn: () => void): Scope[];
6
6
  export declare function skipScope(): number;
7
- export declare function findBranchWithKey(scope: Scope, key: string): BranchScope | undefined;
8
7
  export declare function destroyBranch(branch: BranchScope): void;
9
8
  export declare function destroyScope(scope: Scope): void;
10
9
  export declare function removeAndDestroyBranch(branch: BranchScope): void;