marko 6.4.15 → 6.5.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.
- package/cheatsheet.md +12 -1
- package/dist/debug/dom/catch.feat.js +2 -2
- package/dist/debug/dom/catch.feat.mjs +2 -2
- package/dist/debug/dom/compat.feat.js +1 -1
- package/dist/debug/dom/compat.feat.mjs +1 -1
- package/dist/debug/dom/controllable-input.feat.js +1 -1
- package/dist/debug/dom/controllable-input.feat.mjs +1 -1
- package/dist/debug/dom/controllable-open.feat.js +1 -1
- package/dist/debug/dom/controllable-open.feat.mjs +1 -1
- package/dist/debug/dom/controllable-select.feat.js +1 -1
- package/dist/debug/dom/controllable-select.feat.mjs +1 -1
- package/dist/debug/dom/controllable-textarea.feat.js +1 -1
- package/dist/debug/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/debug/dom/controllable.feat.js +1 -1
- package/dist/debug/dom/controllable.feat.mjs +1 -1
- package/dist/debug/dom/dynamic-tag-script.feat.js +1 -1
- package/dist/debug/dom/dynamic-tag-script.feat.mjs +1 -1
- package/dist/debug/dom/dynamic-tag-var.feat.js +1 -1
- package/dist/debug/dom/dynamic-tag-var.feat.mjs +1 -1
- package/dist/debug/dom/lazy.feat.js +1 -1
- package/dist/debug/dom/lazy.feat.mjs +1 -1
- package/dist/debug/dom/placeholder.feat.js +1 -1
- package/dist/debug/dom/placeholder.feat.mjs +1 -1
- package/dist/debug/{dom-sfzdCRAg.js → dom-BiJ_UKJV.js} +12 -12
- package/dist/debug/{dom-BORByF2b.mjs → dom-D3A8gh_D.mjs} +5 -5
- package/dist/debug/dom.js +3 -2
- package/dist/debug/dom.mjs +2 -2
- package/dist/debug/html/compat.feat.js +1 -1
- package/dist/debug/html/compat.feat.mjs +1 -1
- package/dist/debug/{html-C17tAtch.mjs → html-Bfl3MJP9.mjs} +29 -22
- package/dist/debug/{html-7qRi22mK.js → html-shBfuhlc.js} +29 -22
- package/dist/debug/html.js +1 -1
- package/dist/debug/html.mjs +1 -1
- package/dist/dom/catch.feat.js +3 -3
- package/dist/dom/catch.feat.mjs +2 -2
- package/dist/dom/compat.feat.js +1 -1
- package/dist/dom/compat.feat.mjs +1 -1
- package/dist/dom/control-flow.d.ts +1 -1
- package/dist/dom/controllable-input.feat.js +1 -1
- package/dist/dom/controllable-input.feat.mjs +1 -1
- package/dist/dom/controllable-open.feat.js +1 -1
- package/dist/dom/controllable-open.feat.mjs +1 -1
- package/dist/dom/controllable-select.feat.js +1 -1
- package/dist/dom/controllable-select.feat.mjs +1 -1
- package/dist/dom/controllable-textarea.feat.js +1 -1
- package/dist/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/dom/controllable.feat.js +1 -1
- package/dist/dom/controllable.feat.mjs +1 -1
- package/dist/dom/dynamic-tag-script.feat.js +1 -1
- package/dist/dom/dynamic-tag-script.feat.mjs +1 -1
- package/dist/dom/dynamic-tag-var.feat.js +1 -1
- package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
- package/dist/dom/lazy.feat.js +1 -1
- package/dist/dom/lazy.feat.mjs +1 -1
- package/dist/dom/placeholder.feat.js +1 -1
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/dom/renderer.d.ts +1 -1
- package/dist/{dom-DRiewpRL.js → dom-B3piR0q1.js} +7 -7
- package/dist/{dom-DKn1bCPC.mjs → dom-CPk_8CMB.mjs} +5 -5
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +3 -3
- package/dist/dom.mjs +2 -2
- package/dist/html/assets.d.ts +1 -1
- package/dist/html/compat.feat.js +1 -1
- package/dist/html/compat.feat.mjs +1 -1
- package/dist/html/control-flow.d.ts +9 -9
- package/dist/html/for.d.ts +3 -3
- package/dist/html/serializer.d.ts +2 -0
- package/dist/html/writer.d.ts +2 -2
- package/dist/{html-6w1jd6wm.mjs → html-BD-y50wS.mjs} +27 -24
- package/dist/{html-BaAyg2TB.js → html-aFBpTKdf.js} +27 -24
- package/dist/html.js +1 -1
- package/dist/html.mjs +1 -1
- package/dist/translator/core/define.d.ts +6 -0
- package/dist/translator/core/show.d.ts +1 -1
- package/dist/translator/index.js +808 -751
- package/dist/translator/interop/build-aggregate-error.d.ts +1 -1
- package/dist/translator/util/assert.d.ts +2 -0
- package/dist/translator/util/bindings.d.ts +15 -8
- package/dist/translator/util/cyclic-memo.d.ts +2 -1
- package/dist/translator/util/entry-builder.d.ts +2 -3
- package/dist/translator/util/finalize-references.d.ts +0 -1
- package/dist/translator/util/for-selector.d.ts +0 -1
- package/dist/translator/util/module-registrations.d.ts +1 -0
- package/dist/translator/util/optional.d.ts +7 -5
- package/dist/translator/util/reasons.d.ts +1 -2
- package/dist/translator/util/references.d.ts +6 -5
- package/dist/translator/util/sections.d.ts +5 -1
- package/dist/translator/util/signals.d.ts +1 -1
- package/dist/translator/util/slots.d.ts +1 -2
- package/dist/translator/util/solve-reasons.d.ts +8 -6
- package/dist/translator/util/structure.d.ts +1 -0
- package/dist/translator/util/write-guard.d.ts +2 -0
- package/dist/translator/util/writer.d.ts +1 -2
- package/dist/translator/visitors/tag/native-tag.d.ts +2 -0
- package/index.d.ts +11 -0
- package/package.json +4 -4
package/cheatsheet.md
CHANGED
|
@@ -94,12 +94,18 @@ Don't fetch while rendering: start data loads early, pass the promise through th
|
|
|
94
94
|
|
|
95
95
|
## Components
|
|
96
96
|
|
|
97
|
-
- File `src/tags/product-card.marko` is auto-discovered as `<product-card>` from any template (no import needed). Attributes arrive as `input
|
|
97
|
+
- File `src/tags/product-card.marko` is auto-discovered as `<product-card>` from any template (no import needed). Attributes arrive as `input` (`${input.title}`), typed by the template's `export interface Input` (see TypeScript).
|
|
98
98
|
- Body content renders where the child places `<${input.content}/>`, and the child can hand it values: `<${input.content}(x, y)/>` in the child, `<my-tag|count, total|>${count}</my-tag>` in the parent. Placement is the child's: put it inside a `<for>` and the body appears once per item, each with its own values (`<for|...args| to=input.to><${input.content}(...args)/></>`). Those values exist only inside that body.
|
|
99
99
|
- `<return=value>` publishes one value into the parent's scope, named by a tag variable; from there it is an ordinary value in that template. A native tag variable's value is itself a function returning the element, so `<div/el>` is read as `el()`. So: body parameters when the value belongs to the nested markup, including one set per item where the child loops; a tag variable when the parent needs one value outside the body. A tag var on a child that never returns is `undefined`.
|
|
100
100
|
|
|
101
101
|
```marko
|
|
102
102
|
/* src/tags/toggle-section.marko */
|
|
103
|
+
export interface Input {
|
|
104
|
+
title: string;
|
|
105
|
+
startExpanded?: boolean;
|
|
106
|
+
content: Marko.Body;
|
|
107
|
+
}
|
|
108
|
+
|
|
103
109
|
<let/open=input.startExpanded ?? false>
|
|
104
110
|
<button onClick() { open = !open }>${input.title}</button>
|
|
105
111
|
<if=open><div><${input.content}/></div></if>
|
|
@@ -121,6 +127,11 @@ Don't fetch while rendering: start data loads early, pass the promise through th
|
|
|
121
127
|
</my-card>
|
|
122
128
|
|
|
123
129
|
/* src/tags/my-card.marko */
|
|
130
|
+
export interface Input {
|
|
131
|
+
header: Marko.AttrTag<{ content: Marko.Body }>;
|
|
132
|
+
content: Marko.Body;
|
|
133
|
+
}
|
|
134
|
+
|
|
124
135
|
<div class="card">
|
|
125
136
|
<header><${input.header.content}/></header>
|
|
126
137
|
<${input.content}/>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_control_flow = require("../dom-
|
|
2
|
+
const require_control_flow = require("../dom-BiJ_UKJV.js");
|
|
3
3
|
// src/dom/catch.feat.ts
|
|
4
4
|
const deferToPendingTry = (fn, scope, branch) => {
|
|
5
5
|
while (branch) {
|
|
6
|
-
if (branch["#AwaitCounter"]?.i) return (scope[require_control_flow.PendingEffects] ||= ((branch[require_control_flow.PendingEffectScopes] ||= (branch["#AwaitCounter"].m && ((complete) => branch["#AwaitCounter"].c = (_) => complete() || require_control_flow.queueAsyncRender(branch, require_control_flow.
|
|
6
|
+
if (branch["#AwaitCounter"]?.i) return (scope[require_control_flow.PendingEffects] ||= ((branch[require_control_flow.PendingEffectScopes] ||= (branch["#AwaitCounter"].m && ((complete) => branch["#AwaitCounter"].c = (_) => complete() || require_control_flow.queueAsyncRender(branch, require_control_flow.queuePendingEffects))(branch["#AwaitCounter"].c), [])).push(scope), /* @__PURE__ */ new Set())).add(fn);
|
|
7
7
|
branch = branch[require_control_flow.ParentBranch];
|
|
8
8
|
}
|
|
9
9
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Bn as ParentBranch, Fn as ClosestBranch, Hn as PendingEffects, Mn as Scope, Un as PendingRenders, Vn as PendingEffectScopes, _ as
|
|
1
|
+
import { Bn as ParentBranch, Fn as ClosestBranch, Hn as PendingEffects, Mn as Scope, Un as PendingRenders, Vn as PendingEffectScopes, _ as queuePendingEffects, an as installCatch, jn as Pending, sn as queueAsyncRender, v as renderCatch } from "../dom-D3A8gh_D.mjs";
|
|
2
2
|
// src/dom/catch.feat.ts
|
|
3
3
|
const deferToPendingTry = (fn, scope, branch) => {
|
|
4
4
|
while (branch) {
|
|
5
|
-
if (branch["#AwaitCounter"]?.i) return (scope[PendingEffects] ||= ((branch[PendingEffectScopes] ||= (branch["#AwaitCounter"].m && ((complete) => branch["#AwaitCounter"].c = (_) => complete() || queueAsyncRender(branch,
|
|
5
|
+
if (branch["#AwaitCounter"]?.i) return (scope[PendingEffects] ||= ((branch[PendingEffectScopes] ||= (branch["#AwaitCounter"].m && ((complete) => branch["#AwaitCounter"].c = (_) => complete() || queueAsyncRender(branch, queuePendingEffects))(branch["#AwaitCounter"].c), [])).push(scope), /* @__PURE__ */ new Set())).add(fn);
|
|
6
6
|
branch = branch[ParentBranch];
|
|
7
7
|
}
|
|
8
8
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_control_flow = require("../dom-
|
|
3
|
+
const require_control_flow = require("../dom-BiJ_UKJV.js");
|
|
4
4
|
// src/common/compat-meta.ts
|
|
5
5
|
const SET_SCOPE_REGISTER_ID = "$compat_setScope";
|
|
6
6
|
const RENDER_BODY_ID = "$compat_renderBody";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { An as Setup, Dn as Owner, En as LocalClosures, Gn as StartNode, In as EndNode, On as Params, Rn as Global, Sn as setClassAPIRenderer, St as init, cn as queueEffect, dt as _content, fn as runEffects, gt as setupBranch, ht as createBranch, ln as queueRender, on as prepareEffects, qt as destroyBranch, un as rendering, wn as Clone, xt as getRegisteredWithScope, yt as _resumed } from "../dom-
|
|
1
|
+
import { An as Setup, Dn as Owner, En as LocalClosures, Gn as StartNode, In as EndNode, On as Params, Rn as Global, Sn as setClassAPIRenderer, St as init, cn as queueEffect, dt as _content, fn as runEffects, gt as setupBranch, ht as createBranch, ln as queueRender, on as prepareEffects, qt as destroyBranch, un as rendering, wn as Clone, xt as getRegisteredWithScope, yt as _resumed } from "../dom-D3A8gh_D.mjs";
|
|
2
2
|
// src/common/compat-meta.ts
|
|
3
3
|
const SET_SCOPE_REGISTER_ID = "$compat_setScope";
|
|
4
4
|
const RENDER_BODY_ID = "$compat_renderBody";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_control_flow = require("../dom-
|
|
2
|
+
const require_control_flow = require("../dom-BiJ_UKJV.js");
|
|
3
3
|
// src/dom/controllable-input.feat.ts
|
|
4
4
|
require_control_flow.controllableScripts[0] = require_control_flow._attr_input_checked_script;
|
|
5
5
|
require_control_flow.controllableScripts[1] = require_control_flow._attr_input_checkedValue_script;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as _attr_input_checkedValue_script, N as _attr_input_value_script, O as _attr_input_checked_script, V as controllableScripts } from "../dom-
|
|
1
|
+
import { E as _attr_input_checkedValue_script, N as _attr_input_value_script, O as _attr_input_checked_script, V as controllableScripts } from "../dom-D3A8gh_D.mjs";
|
|
2
2
|
// src/dom/controllable-input.feat.ts
|
|
3
3
|
controllableScripts[0] = _attr_input_checked_script;
|
|
4
4
|
controllableScripts[1] = _attr_input_checkedValue_script;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_control_flow = require("../dom-
|
|
2
|
+
const require_control_flow = require("../dom-BiJ_UKJV.js");
|
|
3
3
|
// src/dom/controllable-open.feat.ts
|
|
4
4
|
require_control_flow.controllableScripts[4] = require_control_flow._attr_details_or_dialog_open_script;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { S as _attr_details_or_dialog_open_script, V as controllableScripts } from "../dom-
|
|
1
|
+
import { S as _attr_details_or_dialog_open_script, V as controllableScripts } from "../dom-D3A8gh_D.mjs";
|
|
2
2
|
// src/dom/controllable-open.feat.ts
|
|
3
3
|
controllableScripts[4] = _attr_details_or_dialog_open_script;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_control_flow = require("../dom-
|
|
2
|
+
const require_control_flow = require("../dom-BiJ_UKJV.js");
|
|
3
3
|
// src/dom/controllable-select.feat.ts
|
|
4
4
|
require_control_flow.controllableScripts[3] = require_control_flow._attr_select_value_script;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { I as _attr_select_value_script, V as controllableScripts } from "../dom-
|
|
1
|
+
import { I as _attr_select_value_script, V as controllableScripts } from "../dom-D3A8gh_D.mjs";
|
|
2
2
|
// src/dom/controllable-select.feat.ts
|
|
3
3
|
controllableScripts[3] = _attr_select_value_script;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_control_flow = require("../dom-
|
|
2
|
+
const require_control_flow = require("../dom-BiJ_UKJV.js");
|
|
3
3
|
// src/dom/controllable-textarea.feat.ts
|
|
4
4
|
require_control_flow.controllableScripts[2] = require_control_flow._attr_input_value_script;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { N as _attr_input_value_script, V as controllableScripts } from "../dom-
|
|
1
|
+
import { N as _attr_input_value_script, V as controllableScripts } from "../dom-D3A8gh_D.mjs";
|
|
2
2
|
// src/dom/controllable-textarea.feat.ts
|
|
3
3
|
controllableScripts[2] = _attr_input_value_script;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as _controllable_textarea, H as controllableSpreadHelpers, L as _controllable_input, R as _controllable_open, z as _controllable_select } from "../dom-
|
|
1
|
+
import { B as _controllable_textarea, H as controllableSpreadHelpers, L as _controllable_input, R as _controllable_open, z as _controllable_select } from "../dom-D3A8gh_D.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,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_control_flow = require("../dom-
|
|
2
|
+
const require_control_flow = require("../dom-BiJ_UKJV.js");
|
|
3
3
|
// src/dom/dynamic-tag-script.feat.ts
|
|
4
4
|
require_control_flow._resumed[require_control_flow.DYNAMIC_TAG_SCRIPT_REGISTER_ID] = require_control_flow.withBranches(require_control_flow.dynamicTagScript);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Cn as withBranches, Zt as DYNAMIC_TAG_SCRIPT_REGISTER_ID, h as dynamicTagScript, yt as _resumed } from "../dom-
|
|
1
|
+
import { Cn as withBranches, Zt as DYNAMIC_TAG_SCRIPT_REGISTER_ID, h as dynamicTagScript, yt as _resumed } from "../dom-D3A8gh_D.mjs";
|
|
2
2
|
// src/dom/dynamic-tag-script.feat.ts
|
|
3
3
|
_resumed[DYNAMIC_TAG_SCRIPT_REGISTER_ID] = withBranches(dynamicTagScript);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_control_flow = require("../dom-
|
|
2
|
+
const require_control_flow = require("../dom-BiJ_UKJV.js");
|
|
3
3
|
// src/dom/dynamic-tag-var.feat.ts
|
|
4
4
|
require_control_flow.installBranchRenders();
|
|
5
5
|
require_control_flow.installDynamicTagVar((scope, branch, scopeKey, renderer) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { At as _el_read, Gn as StartNode, Kn as TagVariable, Pn as BranchRenders, g as installDynamicTagVar, in as installBranchRenders, rn as createBranchRenders } from "../dom-
|
|
1
|
+
import { At as _el_read, Gn as StartNode, Kn as TagVariable, Pn as BranchRenders, g as installDynamicTagVar, in as installBranchRenders, rn as createBranchRenders } from "../dom-D3A8gh_D.mjs";
|
|
2
2
|
// src/dom/dynamic-tag-var.feat.ts
|
|
3
3
|
installBranchRenders();
|
|
4
4
|
installDynamicTagVar((scope, branch, scopeKey, renderer) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_control_flow = require("../dom-
|
|
2
|
+
const require_control_flow = require("../dom-BiJ_UKJV.js");
|
|
3
3
|
// src/dom/placeholder.feat.ts
|
|
4
4
|
require_control_flow._resumed[require_control_flow.PLACEHOLDER_DISMISS_REGISTER_ID] = (tryBranch) => {
|
|
5
5
|
if (tryBranch["#PlaceholderBranch"]) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Qt as PLACEHOLDER_DISMISS_REGISTER_ID, Wn as PlaceholderBranch, qt as destroyBranch, yt as _resumed } from "../dom-
|
|
1
|
+
import { Qt as PLACEHOLDER_DISMISS_REGISTER_ID, Wn as PlaceholderBranch, qt as destroyBranch, yt as _resumed } from "../dom-D3A8gh_D.mjs";
|
|
2
2
|
// src/dom/placeholder.feat.ts
|
|
3
3
|
_resumed[PLACEHOLDER_DISMISS_REGISTER_ID] = (tryBranch) => {
|
|
4
4
|
if (tryBranch["#PlaceholderBranch"]) {
|
|
@@ -1211,7 +1211,7 @@ function _content(id, template, walks, setup, params, dynamicScopesAccessor) {
|
|
|
1211
1211
|
};
|
|
1212
1212
|
};
|
|
1213
1213
|
}
|
|
1214
|
-
function
|
|
1214
|
+
function _content_closures_resume(renderer, hasLocalValues = 0) {
|
|
1215
1215
|
return _resumed[renderer()["id"]] = (owner, ...values) => {
|
|
1216
1216
|
for (let i = values.length, scope = owner; i > hasLocalValues;) {
|
|
1217
1217
|
if (!scope) throw new Error("Unable to resume registered content: its payload does not link the owner of every closure level.");
|
|
@@ -1905,13 +1905,13 @@ function createAwaitCounter(tryBranch, done) {
|
|
|
1905
1905
|
if (awaitCounter.i < 1) throw new Error("An await counter completed more counts than it took.");
|
|
1906
1906
|
if (--awaitCounter.i) return 1;
|
|
1907
1907
|
done();
|
|
1908
|
-
|
|
1908
|
+
queuePendingEffects(tryBranch);
|
|
1909
1909
|
}
|
|
1910
1910
|
};
|
|
1911
1911
|
return awaitCounter;
|
|
1912
1912
|
}
|
|
1913
|
-
function
|
|
1914
|
-
tryBranch[PendingEffectScopes]?.forEach((scope) => scope[PendingEffects].forEach((fn) =>
|
|
1913
|
+
function queuePendingEffects(tryBranch) {
|
|
1914
|
+
tryBranch[PendingEffectScopes]?.forEach((scope) => scope[PendingEffects].forEach((fn) => queueEffect(scope, fn), scope[PendingEffects] = null), tryBranch[PendingEffectScopes] = null);
|
|
1915
1915
|
}
|
|
1916
1916
|
function dismissPlaceholder(tryBranch) {
|
|
1917
1917
|
const placeholderBranch = tryBranch[PlaceholderBranch];
|
|
@@ -2642,10 +2642,10 @@ Object.defineProperty(exports, "_content_closures", {
|
|
|
2642
2642
|
return _content_closures;
|
|
2643
2643
|
}
|
|
2644
2644
|
});
|
|
2645
|
-
Object.defineProperty(exports, "
|
|
2645
|
+
Object.defineProperty(exports, "_content_closures_resume", {
|
|
2646
2646
|
enumerable: true,
|
|
2647
2647
|
get: function() {
|
|
2648
|
-
return
|
|
2648
|
+
return _content_closures_resume;
|
|
2649
2649
|
}
|
|
2650
2650
|
});
|
|
2651
2651
|
Object.defineProperty(exports, "_controllable_input", {
|
|
@@ -3062,6 +3062,12 @@ Object.defineProperty(exports, "queueEffect", {
|
|
|
3062
3062
|
return queueEffect;
|
|
3063
3063
|
}
|
|
3064
3064
|
});
|
|
3065
|
+
Object.defineProperty(exports, "queuePendingEffects", {
|
|
3066
|
+
enumerable: true,
|
|
3067
|
+
get: function() {
|
|
3068
|
+
return queuePendingEffects;
|
|
3069
|
+
}
|
|
3070
|
+
});
|
|
3065
3071
|
Object.defineProperty(exports, "queueRender", {
|
|
3066
3072
|
enumerable: true,
|
|
3067
3073
|
get: function() {
|
|
@@ -3116,12 +3122,6 @@ Object.defineProperty(exports, "runId", {
|
|
|
3116
3122
|
return runId;
|
|
3117
3123
|
}
|
|
3118
3124
|
});
|
|
3119
|
-
Object.defineProperty(exports, "runPendingEffects", {
|
|
3120
|
-
enumerable: true,
|
|
3121
|
-
get: function() {
|
|
3122
|
-
return runPendingEffects;
|
|
3123
|
-
}
|
|
3124
|
-
});
|
|
3125
3125
|
Object.defineProperty(exports, "setClassAPIRenderer", {
|
|
3126
3126
|
enumerable: true,
|
|
3127
3127
|
get: function() {
|
|
@@ -1210,7 +1210,7 @@ function _content(id, template, walks, setup, params, dynamicScopesAccessor) {
|
|
|
1210
1210
|
};
|
|
1211
1211
|
};
|
|
1212
1212
|
}
|
|
1213
|
-
function
|
|
1213
|
+
function _content_closures_resume(renderer, hasLocalValues = 0) {
|
|
1214
1214
|
return _resumed[renderer()["id"]] = (owner, ...values) => {
|
|
1215
1215
|
for (let i = values.length, scope = owner; i > hasLocalValues;) {
|
|
1216
1216
|
if (!scope) throw new Error("Unable to resume registered content: its payload does not link the owner of every closure level.");
|
|
@@ -1904,13 +1904,13 @@ function createAwaitCounter(tryBranch, done) {
|
|
|
1904
1904
|
if (awaitCounter.i < 1) throw new Error("An await counter completed more counts than it took.");
|
|
1905
1905
|
if (--awaitCounter.i) return 1;
|
|
1906
1906
|
done();
|
|
1907
|
-
|
|
1907
|
+
queuePendingEffects(tryBranch);
|
|
1908
1908
|
}
|
|
1909
1909
|
};
|
|
1910
1910
|
return awaitCounter;
|
|
1911
1911
|
}
|
|
1912
|
-
function
|
|
1913
|
-
tryBranch[PendingEffectScopes]?.forEach((scope) => scope[PendingEffects].forEach((fn) =>
|
|
1912
|
+
function queuePendingEffects(tryBranch) {
|
|
1913
|
+
tryBranch[PendingEffectScopes]?.forEach((scope) => scope[PendingEffects].forEach((fn) => queueEffect(scope, fn), scope[PendingEffects] = null), tryBranch[PendingEffectScopes] = null);
|
|
1914
1914
|
}
|
|
1915
1915
|
function dismissPlaceholder(tryBranch) {
|
|
1916
1916
|
const placeholderBranch = tryBranch[PlaceholderBranch];
|
|
@@ -2221,4 +2221,4 @@ function bySecondArg(_item, index) {
|
|
|
2221
2221
|
function byFirstArg(name) {
|
|
2222
2222
|
return name;
|
|
2223
2223
|
}
|
|
2224
|
-
export { _attrs as $, _on as $t, _attr_input_value_attribute_default as A, Setup as An, _el_read as At, _controllable_textarea as B, ParentBranch as Bn, _or as Bt, _attr_input_checked as C, withBranches as Cn, initEmbedded as Ct, _attr_input_checked_default as D, Owner as Dn, _closure as Dt, _attr_input_checkedValue_script as E, LocalClosures as En, withLazy as Et, _attr_select_value_default as F, ClosestBranch as Fn, _hoist_resume as Ft, _attr_class_item as G, StartNode as Gn, _var_change as Gt, controllableSpreadHelpers as H, PendingEffects as Hn, _return_change as Ht, _attr_select_value_script as I, EndNode as In, _id as It, _attr_content as J, attrTags as Jn, insertBranchBefore as Jt, _attr_class_items as K, TagVariable as Kn, _assert_init as Kt, _controllable_input as L, Gen$1 as Ln, _if_closure as Lt, _attr_input_value_dynamic_default as M, Scope as Mn, _for_selector as Mt, _attr_input_value_script as N, AwaitCounter as Nn, _global_read as Nt, _attr_input_checked_script as O, Params as On, _closure_get as Ot, _attr_select_value as P, BranchRenders as Pn, _hoist as Pt, _attr_style_items as Q, PLACEHOLDER_DISMISS_REGISTER_ID as Qt, _controllable_open as R, Global as Rn, _let as Rt, _attr_details_or_dialog_open_script as S, setClassAPIRenderer as Sn, init as St, _attr_input_checkedValue_default as T, Lazy as Tn, readyFailed as Tt, _attr as U, PendingRenders as Un, _script as Ut, controllableScripts as V, PendingEffectScopes as Vn, _return as Vt, _attr_class as W, PlaceholderBranch as Wn, _var as Wt, _attr_style as X, syncGen as Xt, _attr_nonce as Y, removeAndDestroyBranch as Yt, _attr_style_item as Z, DYNAMIC_TAG_SCRIPT_REGISTER_ID as Zt,
|
|
2224
|
+
export { _attrs as $, _on as $t, _attr_input_value_attribute_default as A, Setup as An, _el_read as At, _controllable_textarea as B, ParentBranch as Bn, _or as Bt, _attr_input_checked as C, withBranches as Cn, initEmbedded as Ct, _attr_input_checked_default as D, Owner as Dn, _closure as Dt, _attr_input_checkedValue_script as E, LocalClosures as En, withLazy as Et, _attr_select_value_default as F, ClosestBranch as Fn, _hoist_resume as Ft, _attr_class_item as G, StartNode as Gn, _var_change as Gt, controllableSpreadHelpers as H, PendingEffects as Hn, _return_change as Ht, _attr_select_value_script as I, EndNode as In, _id as It, _attr_content as J, attrTags as Jn, insertBranchBefore as Jt, _attr_class_items as K, TagVariable as Kn, _assert_init as Kt, _controllable_input as L, Gen$1 as Ln, _if_closure as Lt, _attr_input_value_dynamic_default as M, Scope as Mn, _for_selector as Mt, _attr_input_value_script as N, AwaitCounter as Nn, _global_read as Nt, _attr_input_checked_script as O, Params as On, _closure_get as Ot, _attr_select_value as P, BranchRenders as Pn, _hoist as Pt, _attr_style_items as Q, PLACEHOLDER_DISMISS_REGISTER_ID as Qt, _controllable_open as R, Global as Rn, _let as Rt, _attr_details_or_dialog_open_script as S, setClassAPIRenderer as Sn, init as St, _attr_input_checkedValue_default as T, Lazy as Tn, readyFailed as Tt, _attr as U, PendingRenders as Un, _script as Ut, controllableScripts as V, PendingEffectScopes as Vn, _return as Vt, _attr_class as W, PlaceholderBranch as Wn, _var as Wt, _attr_style as X, syncGen as Xt, _attr_nonce as Y, removeAndDestroyBranch as Yt, _attr_style_item as Z, DYNAMIC_TAG_SCRIPT_REGISTER_ID as Zt, queuePendingEffects as _, forUntil as _n, _dynamic_tag_var_resume as _t, _for_in as a, installCatch as an, _lifecycle as at, _attr_details_or_dialog_open as b, _hoist_read_error as bn, _var_resume as bt, _for_to as c, queueEffect as cn, _text as ct, _for_until_unkeyed as d, run as dn, _content as dt, $signal as en, _attrs_content as et, _if as f, runEffects as fn, _content_closures as ft, installDynamicTagVar as g, forTo as gn, setupBranch as gt, dynamicTagScript as h, forOf as hn, createBranch as ht, _dynamic_tag_content as i, installBranchRenders as in, _html as it, _attr_input_value_default as j, Pending as jn, _for_closure as jt, _attr_input_value as k, Returns as kn, _const as kt, _for_to_unkeyed as l, queueRender as ln, _text_content as lt, _try as m, forIn as mn, _return_setup as mt, _await_promise as n, onAbort as nn, _attrs_partial_content as nt, _for_of as o, prepareEffects as on, _style_rule_item as ot, _show as p, runId as pn, _content_closures_resume as pt, _attr_class_names as q, attrTag as qn, destroyBranch as qt, _dynamic_tag as r, createBranchRenders as rn, _attrs_script as rt, _for_of_unkeyed as s, queueAsyncRender as sn, _style_shell as st, _await_content as t, $signalReset as tn, _attrs_partial as tt, _for_until as u, rendering as un, _to_text as ut, renderCatch as v, _assert_class_toggles as vn, _el as vt, _attr_input_checkedValue as w, Clone as wn, ready as wt, _attr_details_or_dialog_open_default as x, _call as xn, getRegisteredWithScope as xt, startAwait as y, _assert_hoist as yn, _resumed as yt, _controllable_select as z, Load as zn, _let_change as zt };
|
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-
|
|
3
|
+
const require_control_flow = require("./dom-BiJ_UKJV.js");
|
|
4
4
|
// src/dom/template.ts
|
|
5
5
|
const _template = (id, template, walks, setup, inputSignal) => {
|
|
6
6
|
const renderer = require_control_flow._content(id, template, walks, setup, inputSignal)();
|
|
@@ -220,7 +220,8 @@ exports._closure_get = require_control_flow._closure_get;
|
|
|
220
220
|
exports._const = require_control_flow._const;
|
|
221
221
|
exports._content = require_control_flow._content;
|
|
222
222
|
exports._content_closures = require_control_flow._content_closures;
|
|
223
|
-
exports.
|
|
223
|
+
exports._content_closures_resume = require_control_flow._content_closures_resume;
|
|
224
|
+
exports._content_resume = require_control_flow._content;
|
|
224
225
|
exports._controllable_input = require_control_flow._controllable_input;
|
|
225
226
|
exports._controllable_open = require_control_flow._controllable_open;
|
|
226
227
|
exports._controllable_select = require_control_flow._controllable_select;
|
package/dist/debug/dom.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as _attrs, $t as _on, A as _attr_input_value_attribute_default, An as Setup, At as _el_read, B as _controllable_textarea, Bt as _or, C as _attr_input_checked, Ct as initEmbedded, D as _attr_input_checked_default, Dt as _closure, E as _attr_input_checkedValue_script, F as _attr_select_value_default, Ft as _hoist_resume, G as _attr_class_item, Gn as StartNode, Gt as _var_change, Ht as _return_change, I as _attr_select_value_script, It as _id, J as _attr_content, Jn as attrTags, Jt as insertBranchBefore, K as _attr_class_items, Kn as TagVariable, Kt as _assert_init, L as _controllable_input, Lt as _if_closure, M as _attr_input_value_dynamic_default, Mt as _for_selector, N as _attr_input_value_script, Nt as _global_read, O as _attr_input_checked_script, On as Params, Ot as _closure_get, P as _attr_select_value, Pt as _hoist, Q as _attr_style_items, R as _controllable_open, Rt as _let, S as _attr_details_or_dialog_open_script, St as init, T as _attr_input_checkedValue_default, Tn as Lazy, Tt as readyFailed, U as _attr, Ut as _script, Vt as _return, W as _attr_class, Wt as _var, X as _attr_style, Xt as syncGen, Y as _attr_nonce, Yt as removeAndDestroyBranch, Z as _attr_style_item,
|
|
1
|
+
import { $ as _attrs, $t as _on, A as _attr_input_value_attribute_default, An as Setup, At as _el_read, B as _controllable_textarea, Bt as _or, C as _attr_input_checked, Ct as initEmbedded, D as _attr_input_checked_default, Dt as _closure, E as _attr_input_checkedValue_script, F as _attr_select_value_default, Ft as _hoist_resume, G as _attr_class_item, Gn as StartNode, Gt as _var_change, Ht as _return_change, I as _attr_select_value_script, It as _id, J as _attr_content, Jn as attrTags, Jt as insertBranchBefore, K as _attr_class_items, Kn as TagVariable, Kt as _assert_init, L as _controllable_input, Lt as _if_closure, M as _attr_input_value_dynamic_default, Mt as _for_selector, N as _attr_input_value_script, Nt as _global_read, O as _attr_input_checked_script, On as Params, Ot as _closure_get, P as _attr_select_value, Pt as _hoist, Q as _attr_style_items, R as _controllable_open, Rt as _let, S as _attr_details_or_dialog_open_script, St as init, T as _attr_input_checkedValue_default, Tn as Lazy, Tt as readyFailed, U as _attr, Ut as _script, Vt as _return, W as _attr_class, Wt as _var, X as _attr_style, Xt as syncGen, Y as _attr_nonce, Yt as removeAndDestroyBranch, Z as _attr_style_item, _n as forUntil, _t as _dynamic_tag_var_resume, a as _for_in, at as _lifecycle, b as _attr_details_or_dialog_open, bn as _hoist_read_error, bt as _var_resume, c as _for_to, ct as _text, d as _for_until_unkeyed, dn as run, dt as _content, en as $signal, et as _attrs_content, f as _if, fn as runEffects, ft as _content_closures, gn as forTo, gt as setupBranch, hn as forOf, ht as createBranch, i as _dynamic_tag_content, it as _html, j as _attr_input_value_default, jt as _for_closure, k as _attr_input_value, kt as _const, l as _for_to_unkeyed, ln as queueRender, lt as _text_content, m as _try, mn as forIn, mt as _return_setup, n as _await_promise, nn as onAbort, nt as _attrs_partial_content, o as _for_of, on as prepareEffects, ot as _style_rule_item, p as _show, pn as runId, pt as _content_closures_resume, q as _attr_class_names, qn as attrTag, r as _dynamic_tag, rt as _attrs_script, s as _for_of_unkeyed, sn as queueAsyncRender, st as _style_shell, t as _await_content, tn as $signalReset, tt as _attrs_partial, u as _for_until, ut as _to_text, v as renderCatch, vn as _assert_class_toggles, vt as _el, w as _attr_input_checkedValue, wn as Clone, wt as ready, x as _attr_details_or_dialog_open_default, xn as _call, y as startAwait, yn as _assert_hoist, yt as _resumed, z as _controllable_select, zn as Load, zt as _let_change } from "./dom-D3A8gh_D.mjs";
|
|
2
2
|
// src/dom/template.ts
|
|
3
3
|
const _template = (id, template, walks, setup, inputSignal) => {
|
|
4
4
|
const renderer = _content(id, template, walks, setup, inputSignal)();
|
|
@@ -167,4 +167,4 @@ function _load_race_trigger(...triggers) {
|
|
|
167
167
|
function getSelectorOrResolve(selector, resolve) {
|
|
168
168
|
return document.querySelector(selector) || (console.warn(`A lazy load trigger could not find an element matching "${selector}". The module was loaded immediately.`), resolve());
|
|
169
169
|
}
|
|
170
|
-
export { $signal, $signalReset, _assert_class_toggles, _assert_hoist, _assert_init, _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_class_names, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_checked_default, _attr_input_checked_script, _attr_input_value, _attr_input_value as _attr_textarea_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_input_value_script as _attr_textarea_value_script, _attr_nonce, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _await_content, _await_promise, _call, _closure, _closure_get, _const, _content, _content_closures,
|
|
170
|
+
export { $signal, $signalReset, _assert_class_toggles, _assert_hoist, _assert_init, _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_class_names, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_checked_default, _attr_input_checked_script, _attr_input_value, _attr_input_value as _attr_textarea_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_input_value_script as _attr_textarea_value_script, _attr_nonce, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _await_content, _await_promise, _call, _closure, _closure_get, _const, _content, _content as _content_resume, _content_closures, _content_closures_resume, _controllable_input, _controllable_open, _controllable_select, _controllable_textarea, _dynamic_tag, _dynamic_tag_content, _dynamic_tag_var_resume, _el, _el_read, _for_closure, _for_in, _for_of, _for_of_unkeyed, _for_selector, _for_to, _for_to_unkeyed, _for_until, _for_until_unkeyed, _global_read, _hoist, _hoist_read_error, _hoist_resume, _html, _id, _if, _if_closure, _let, _let_change, _lifecycle, _load_event_trigger, _load_idle_trigger, _load_media_trigger, _load_race_trigger, _load_setup, _load_signal, _load_template, _load_visible_trigger, _on, _or, _resumed, _return, _return_change, _return_setup, _script, _show, _style_rule_item, _style_shell, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags, forIn, forOf, forTo, forUntil, init, initEmbedded, onAbort, ready, readyFailed, run };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_control_flow = require("../html-
|
|
3
|
+
const require_control_flow = require("../html-shBfuhlc.js");
|
|
4
4
|
// src/common/compat-meta.ts
|
|
5
5
|
const SET_SCOPE_REGISTER_ID = "$compat_setScope";
|
|
6
6
|
const RENDER_BODY_ID = "$compat_renderBody";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as $global, F as State, Ft as register, J as _scope_id, M as Boundary, N as Chunk, P as NOOP, Pt as REGISTRY, Q as _set_scope_reason, V as _html, Vt as setClassAPIRenderer, W as _peek_scope_id, Z as _script, _ as writeLoadAsset, at as getChunk, ct as joinHeldEffects, dt as writeScript, j as ALL_GROUPS, k as $chunk, lt as withChunk, ot as getScopeId, st as isInResumedBranch, t as _await, ut as writeScope } from "../html-
|
|
1
|
+
import { A as $global, F as State, Ft as register, J as _scope_id, M as Boundary, N as Chunk, P as NOOP, Pt as REGISTRY, Q as _set_scope_reason, V as _html, Vt as setClassAPIRenderer, W as _peek_scope_id, Z as _script, _ as writeLoadAsset, at as getChunk, ct as joinHeldEffects, dt as writeScript, j as ALL_GROUPS, k as $chunk, lt as withChunk, ot as getScopeId, st as isInResumedBranch, t as _await, ut as writeScope } from "../html-Bfl3MJP9.mjs";
|
|
2
2
|
// src/common/compat-meta.ts
|
|
3
3
|
const SET_SCOPE_REGISTER_ID = "$compat_setScope";
|
|
4
4
|
const RENDER_BODY_ID = "$compat_renderBody";
|
|
@@ -314,14 +314,12 @@ function concat(opt, other) {
|
|
|
314
314
|
}
|
|
315
315
|
// src/html/serializer.ts
|
|
316
316
|
const K_SCOPE_ID = Symbol("Scope ID");
|
|
317
|
-
const kTouchedIterator = /* @__PURE__ */ Symbol.for("marko.touchedIterator");
|
|
318
317
|
const { hasOwnProperty } = {};
|
|
319
318
|
const objectProto = Object.prototype;
|
|
320
319
|
const arrayProto = Array.prototype;
|
|
321
320
|
const Generator = (/* @__PURE__ */ (function* () {})()).constructor;
|
|
322
321
|
const AsyncGenerator = (/* @__PURE__ */ (async function* () {})()).constructor;
|
|
323
|
-
|
|
324
|
-
patchIteratorNext(AsyncGenerator.prototype);
|
|
322
|
+
const kTouchedIterator = /* @__PURE__ */ patchIteratorsNext();
|
|
325
323
|
const REGISTRY = /* @__PURE__ */ new WeakMap();
|
|
326
324
|
const KNOWN_SYMBOLS = /* @__PURE__ */ (() => {
|
|
327
325
|
const KNOWN_SYMBOLS = /* @__PURE__ */ new Map();
|
|
@@ -605,14 +603,17 @@ var State$1 = class {
|
|
|
605
603
|
const locals = registered.locals?.(this.boundary.state.scope);
|
|
606
604
|
if (locals) {
|
|
607
605
|
this.buf.push(registered.access + "(_(" + scopeId + ")");
|
|
608
|
-
|
|
609
|
-
this.buf.push(",");
|
|
610
|
-
writePlainObject(this, local, newArgReference(this, ref, local));
|
|
611
|
-
}
|
|
606
|
+
writeLocalArgs(this, ref, locals);
|
|
612
607
|
} else this.buf.push("_(" + scopeId + "," + quoteRegistryId(registered.id));
|
|
613
608
|
this.buf.push(")");
|
|
614
609
|
}
|
|
615
610
|
};
|
|
611
|
+
function writeLocalArgs(state, ref, locals) {
|
|
612
|
+
for (const local of locals) {
|
|
613
|
+
state.buf.push(",");
|
|
614
|
+
writePlainObject(state, local, newArgReference(state, ref, local));
|
|
615
|
+
}
|
|
616
|
+
}
|
|
616
617
|
var Reference = class {
|
|
617
618
|
assignments = null;
|
|
618
619
|
deferredMembers = null;
|
|
@@ -1833,14 +1834,20 @@ function hasOnlyZeros(typedArray) {
|
|
|
1833
1834
|
for (let i = 0; i < typedArray.length; i++) if (typedArray[i] !== zero) return false;
|
|
1834
1835
|
return true;
|
|
1835
1836
|
}
|
|
1836
|
-
function
|
|
1837
|
-
|
|
1837
|
+
function patchIteratorsNext() {
|
|
1838
|
+
const key = Symbol.for("marko.touchedIterator");
|
|
1839
|
+
patchIteratorNext(Generator.prototype, key);
|
|
1840
|
+
patchIteratorNext(AsyncGenerator.prototype, key);
|
|
1841
|
+
return key;
|
|
1842
|
+
}
|
|
1843
|
+
function patchIteratorNext(proto, key) {
|
|
1844
|
+
if (proto.next[key]) return;
|
|
1838
1845
|
const { next } = proto;
|
|
1839
1846
|
proto.next = function(value) {
|
|
1840
|
-
this[
|
|
1847
|
+
this[key] = 1;
|
|
1841
1848
|
return next.call(this, value);
|
|
1842
1849
|
};
|
|
1843
|
-
proto.next[
|
|
1850
|
+
proto.next[key] = true;
|
|
1844
1851
|
}
|
|
1845
1852
|
// src/html/attrs.ts
|
|
1846
1853
|
function _attr_class(value) {
|
|
@@ -2230,12 +2237,6 @@ function withContext(key, value, cb, cbValue, cbValue2) {
|
|
|
2230
2237
|
ctx[key] = prev;
|
|
2231
2238
|
}
|
|
2232
2239
|
}
|
|
2233
|
-
function captureContext(chunk) {
|
|
2234
|
-
if (chunk.context?.[kPendingContexts]) chunk.context = {
|
|
2235
|
-
...chunk.context,
|
|
2236
|
-
[kPendingContexts]: 0
|
|
2237
|
-
};
|
|
2238
|
-
}
|
|
2239
2240
|
const kBranchId = Symbol("Branch Id");
|
|
2240
2241
|
const kAsyncContent = Symbol("Async Content");
|
|
2241
2242
|
function isInResumedBranch() {
|
|
@@ -2517,6 +2518,12 @@ var State = class {
|
|
|
2517
2518
|
runtimeScript() {
|
|
2518
2519
|
return WALKER_RUNTIME_CODE + "(\"" + this.$global.runtimeId + "\")(\"" + this.$global.renderId + "\")";
|
|
2519
2520
|
}
|
|
2521
|
+
captureContext(chunk) {
|
|
2522
|
+
if (chunk.context?.[kPendingContexts]) chunk.context = {
|
|
2523
|
+
...chunk.context,
|
|
2524
|
+
[kPendingContexts]: 0
|
|
2525
|
+
};
|
|
2526
|
+
}
|
|
2520
2527
|
keepsTryMarks(chunk, resumeWrites) {
|
|
2521
2528
|
return chunk !== $chunk || chunk.boundary.resumeWrites !== resumeWrites;
|
|
2522
2529
|
}
|
|
@@ -3074,8 +3081,8 @@ function readyBatch(state, channel, deps, resumes) {
|
|
|
3074
3081
|
}
|
|
3075
3082
|
function getFilteredGlobals($global) {
|
|
3076
3083
|
const serializedGlobals = $global.serializedGlobals;
|
|
3077
|
-
|
|
3078
|
-
|
|
3084
|
+
let filtered = $global.cspNonce ? { cspNonce: $global.cspNonce } : 0;
|
|
3085
|
+
if (!serializedGlobals) return filtered;
|
|
3079
3086
|
if (Array.isArray(serializedGlobals)) for (const key of serializedGlobals) {
|
|
3080
3087
|
const value = $global[key];
|
|
3081
3088
|
if (value !== void 0) (filtered ||= {})[key] = value;
|
|
@@ -3784,7 +3791,7 @@ function _await(scopeId, accessor, promise, content, markerGuard) {
|
|
|
3784
3791
|
const startId = _peek_scope_id();
|
|
3785
3792
|
const after = chunk.next = chunk.forkRest(boundary);
|
|
3786
3793
|
chunk.async = true;
|
|
3787
|
-
captureContext(chunk);
|
|
3794
|
+
boundary.state.captureContext(chunk);
|
|
3788
3795
|
boundary.startAsync();
|
|
3789
3796
|
promise.then((value) => {
|
|
3790
3797
|
if (chunk.async) {
|
|
@@ -3840,7 +3847,7 @@ function tryPlaceholder(content, placeholder, branchId, scopeId, placeholderBran
|
|
|
3840
3847
|
return;
|
|
3841
3848
|
}
|
|
3842
3849
|
chunk.next = chunk.forkRest(boundary);
|
|
3843
|
-
captureContext(chunk);
|
|
3850
|
+
boundary.state.captureContext(chunk);
|
|
3844
3851
|
chunk.placeholder = {
|
|
3845
3852
|
body,
|
|
3846
3853
|
render: placeholder,
|
|
@@ -3876,7 +3883,7 @@ function tryBoundary(content, catchContent, branchId, renderers) {
|
|
|
3876
3883
|
id: reorderId,
|
|
3877
3884
|
end: bodyEnd
|
|
3878
3885
|
};
|
|
3879
|
-
captureContext(chunk);
|
|
3886
|
+
state.captureContext(chunk);
|
|
3880
3887
|
}
|
|
3881
3888
|
bodyBoundary.onNext = () => {
|
|
3882
3889
|
if (boundary.aborted) return;
|
|
@@ -315,14 +315,12 @@ function concat(opt, other) {
|
|
|
315
315
|
}
|
|
316
316
|
// src/html/serializer.ts
|
|
317
317
|
const K_SCOPE_ID = Symbol("Scope ID");
|
|
318
|
-
const kTouchedIterator = /* @__PURE__ */ Symbol.for("marko.touchedIterator");
|
|
319
318
|
const { hasOwnProperty } = {};
|
|
320
319
|
const objectProto = Object.prototype;
|
|
321
320
|
const arrayProto = Array.prototype;
|
|
322
321
|
const Generator = (/* @__PURE__ */ (function* () {})()).constructor;
|
|
323
322
|
const AsyncGenerator = (/* @__PURE__ */ (async function* () {})()).constructor;
|
|
324
|
-
|
|
325
|
-
patchIteratorNext(AsyncGenerator.prototype);
|
|
323
|
+
const kTouchedIterator = /* @__PURE__ */ patchIteratorsNext();
|
|
326
324
|
const REGISTRY = /* @__PURE__ */ new WeakMap();
|
|
327
325
|
const KNOWN_SYMBOLS = /* @__PURE__ */ (() => {
|
|
328
326
|
const KNOWN_SYMBOLS = /* @__PURE__ */ new Map();
|
|
@@ -606,14 +604,17 @@ var State$1 = class {
|
|
|
606
604
|
const locals = registered.locals?.(this.boundary.state.scope);
|
|
607
605
|
if (locals) {
|
|
608
606
|
this.buf.push(registered.access + "(_(" + scopeId + ")");
|
|
609
|
-
|
|
610
|
-
this.buf.push(",");
|
|
611
|
-
writePlainObject(this, local, newArgReference(this, ref, local));
|
|
612
|
-
}
|
|
607
|
+
writeLocalArgs(this, ref, locals);
|
|
613
608
|
} else this.buf.push("_(" + scopeId + "," + quoteRegistryId(registered.id));
|
|
614
609
|
this.buf.push(")");
|
|
615
610
|
}
|
|
616
611
|
};
|
|
612
|
+
function writeLocalArgs(state, ref, locals) {
|
|
613
|
+
for (const local of locals) {
|
|
614
|
+
state.buf.push(",");
|
|
615
|
+
writePlainObject(state, local, newArgReference(state, ref, local));
|
|
616
|
+
}
|
|
617
|
+
}
|
|
617
618
|
var Reference = class {
|
|
618
619
|
assignments = null;
|
|
619
620
|
deferredMembers = null;
|
|
@@ -1834,14 +1835,20 @@ function hasOnlyZeros(typedArray) {
|
|
|
1834
1835
|
for (let i = 0; i < typedArray.length; i++) if (typedArray[i] !== zero) return false;
|
|
1835
1836
|
return true;
|
|
1836
1837
|
}
|
|
1837
|
-
function
|
|
1838
|
-
|
|
1838
|
+
function patchIteratorsNext() {
|
|
1839
|
+
const key = Symbol.for("marko.touchedIterator");
|
|
1840
|
+
patchIteratorNext(Generator.prototype, key);
|
|
1841
|
+
patchIteratorNext(AsyncGenerator.prototype, key);
|
|
1842
|
+
return key;
|
|
1843
|
+
}
|
|
1844
|
+
function patchIteratorNext(proto, key) {
|
|
1845
|
+
if (proto.next[key]) return;
|
|
1839
1846
|
const { next } = proto;
|
|
1840
1847
|
proto.next = function(value) {
|
|
1841
|
-
this[
|
|
1848
|
+
this[key] = 1;
|
|
1842
1849
|
return next.call(this, value);
|
|
1843
1850
|
};
|
|
1844
|
-
proto.next[
|
|
1851
|
+
proto.next[key] = true;
|
|
1845
1852
|
}
|
|
1846
1853
|
// src/html/attrs.ts
|
|
1847
1854
|
function _attr_class(value) {
|
|
@@ -2231,12 +2238,6 @@ function withContext(key, value, cb, cbValue, cbValue2) {
|
|
|
2231
2238
|
ctx[key] = prev;
|
|
2232
2239
|
}
|
|
2233
2240
|
}
|
|
2234
|
-
function captureContext(chunk) {
|
|
2235
|
-
if (chunk.context?.[kPendingContexts]) chunk.context = {
|
|
2236
|
-
...chunk.context,
|
|
2237
|
-
[kPendingContexts]: 0
|
|
2238
|
-
};
|
|
2239
|
-
}
|
|
2240
2241
|
const kBranchId = Symbol("Branch Id");
|
|
2241
2242
|
const kAsyncContent = Symbol("Async Content");
|
|
2242
2243
|
function isInResumedBranch() {
|
|
@@ -2518,6 +2519,12 @@ var State = class {
|
|
|
2518
2519
|
runtimeScript() {
|
|
2519
2520
|
return WALKER_RUNTIME_CODE + "(\"" + this.$global.runtimeId + "\")(\"" + this.$global.renderId + "\")";
|
|
2520
2521
|
}
|
|
2522
|
+
captureContext(chunk) {
|
|
2523
|
+
if (chunk.context?.[kPendingContexts]) chunk.context = {
|
|
2524
|
+
...chunk.context,
|
|
2525
|
+
[kPendingContexts]: 0
|
|
2526
|
+
};
|
|
2527
|
+
}
|
|
2521
2528
|
keepsTryMarks(chunk, resumeWrites) {
|
|
2522
2529
|
return chunk !== $chunk || chunk.boundary.resumeWrites !== resumeWrites;
|
|
2523
2530
|
}
|
|
@@ -3075,8 +3082,8 @@ function readyBatch(state, channel, deps, resumes) {
|
|
|
3075
3082
|
}
|
|
3076
3083
|
function getFilteredGlobals($global) {
|
|
3077
3084
|
const serializedGlobals = $global.serializedGlobals;
|
|
3078
|
-
|
|
3079
|
-
|
|
3085
|
+
let filtered = $global.cspNonce ? { cspNonce: $global.cspNonce } : 0;
|
|
3086
|
+
if (!serializedGlobals) return filtered;
|
|
3080
3087
|
if (Array.isArray(serializedGlobals)) for (const key of serializedGlobals) {
|
|
3081
3088
|
const value = $global[key];
|
|
3082
3089
|
if (value !== void 0) (filtered ||= {})[key] = value;
|
|
@@ -3785,7 +3792,7 @@ function _await(scopeId, accessor, promise, content, markerGuard) {
|
|
|
3785
3792
|
const startId = _peek_scope_id();
|
|
3786
3793
|
const after = chunk.next = chunk.forkRest(boundary);
|
|
3787
3794
|
chunk.async = true;
|
|
3788
|
-
captureContext(chunk);
|
|
3795
|
+
boundary.state.captureContext(chunk);
|
|
3789
3796
|
boundary.startAsync();
|
|
3790
3797
|
promise.then((value) => {
|
|
3791
3798
|
if (chunk.async) {
|
|
@@ -3841,7 +3848,7 @@ function tryPlaceholder(content, placeholder, branchId, scopeId, placeholderBran
|
|
|
3841
3848
|
return;
|
|
3842
3849
|
}
|
|
3843
3850
|
chunk.next = chunk.forkRest(boundary);
|
|
3844
|
-
captureContext(chunk);
|
|
3851
|
+
boundary.state.captureContext(chunk);
|
|
3845
3852
|
chunk.placeholder = {
|
|
3846
3853
|
body,
|
|
3847
3854
|
render: placeholder,
|
|
@@ -3877,7 +3884,7 @@ function tryBoundary(content, catchContent, branchId, renderers) {
|
|
|
3877
3884
|
id: reorderId,
|
|
3878
3885
|
end: bodyEnd
|
|
3879
3886
|
};
|
|
3880
|
-
captureContext(chunk);
|
|
3887
|
+
state.captureContext(chunk);
|
|
3881
3888
|
}
|
|
3882
3889
|
bodyBoundary.onNext = () => {
|
|
3883
3890
|
if (boundary.aborted) return;
|