marko 6.3.46 → 6.3.48
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 +19 -16
- package/dist/common/accessor.d.ts +0 -3
- package/dist/common/accessor.debug.d.ts +0 -3
- package/dist/common/constants/resume-symbol.d.ts +5 -2
- package/dist/common/helpers.d.ts +2 -0
- package/dist/debug/dom/catch.feat.js +1 -1
- package/dist/debug/dom/catch.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-var.feat.js +1 -1
- package/dist/debug/dom/dynamic-tag-var.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-WyMgkHne.js → dom-CA_HiiES.js} +23 -8
- package/dist/debug/{dom-CIt3_Sdm.mjs → dom-DBMLPLeE.mjs} +18 -9
- package/dist/debug/dom.js +20 -24
- package/dist/debug/dom.mjs +20 -24
- package/dist/debug/html.js +19 -5
- package/dist/debug/html.mjs +18 -5
- package/dist/dom/catch.feat.js +1 -1
- package/dist/dom/catch.feat.mjs +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/dom.d.ts +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/placeholder.feat.js +1 -1
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/{dom-R3sALHJt.js → dom-BfydlrCq.js} +27 -23
- package/dist/{dom-DN6BTUmH.mjs → dom-UwNQ-AXt.mjs} +12 -13
- package/dist/dom.js +20 -20
- package/dist/dom.mjs +14 -14
- package/dist/html/writer.d.ts +2 -1
- package/dist/html.d.ts +1 -1
- package/dist/html.js +16 -5
- package/dist/html.mjs +16 -5
- package/dist/translator/index.js +11 -19
- package/dist/translator/visitors/constants/sibling-text.d.ts +0 -1
- package/package.json +3 -3
- package/dist/common/constants/load-signal-value.d.ts +0 -5
- package/dist/common/constants/load-signal-value.debug.d.ts +0 -5
package/dist/dom.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
let require_control_flow = require("./dom-
|
|
1
|
+
let require_control_flow = require("./dom-BfydlrCq.js"), empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), classEventResolver, scopesByRender = /* @__PURE__ */ new WeakMap(), getRenderScopes = ($global) => {
|
|
2
2
|
require_control_flow.yt($global.runtimeId);
|
|
3
3
|
let render = self[$global.runtimeId]?.[$global.renderId], scopes = render && scopesByRender.get(render);
|
|
4
4
|
return render && !scopes && scopesByRender.set(render, scopes = {}), scopes;
|
|
@@ -38,7 +38,7 @@ let require_control_flow = require("./dom-R3sALHJt.js"), empty = [], rest = Symb
|
|
|
38
38
|
branch.S = startNode, branch.K = endNode;
|
|
39
39
|
},
|
|
40
40
|
runComponentEffects() {
|
|
41
|
-
this.effects && require_control_flow.
|
|
41
|
+
this.effects && require_control_flow.sn(this.effects);
|
|
42
42
|
},
|
|
43
43
|
runComponentDestroy() {
|
|
44
44
|
this.scope && require_control_flow.Kt(this.scope);
|
|
@@ -76,11 +76,11 @@ let require_control_flow = require("./dom-R3sALHJt.js"), empty = [], rest = Symb
|
|
|
76
76
|
}, _load_signal(() => (pending ||= load()).then((r) => ({ _: r.d }))));
|
|
77
77
|
return lazyTemplate;
|
|
78
78
|
}), _load_setup = /*@__PURE__*/ require_control_flow.wt((nodeAccessor, childScopeAccessor, load) => {
|
|
79
|
-
nodeAccessor = require_control_flow.
|
|
80
|
-
let pending, renderer;
|
|
79
|
+
nodeAccessor = require_control_flow.gn(nodeAccessor), childScopeAccessor = require_control_flow.gn(childScopeAccessor);
|
|
80
|
+
let pending, renderer, insertCached = (child, marker) => insertLoaded(renderer, child, marker);
|
|
81
81
|
return (owner) => {
|
|
82
82
|
let child = owner[childScopeAccessor];
|
|
83
|
-
if (renderer)
|
|
83
|
+
if (renderer) require_control_flow.an(child, insertCached, -1, owner[nodeAccessor]);
|
|
84
84
|
else {
|
|
85
85
|
let awaitCounter = require_control_flow.p(owner);
|
|
86
86
|
child.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((mod) => {
|
|
@@ -89,10 +89,10 @@ let require_control_flow = require("./dom-R3sALHJt.js"), empty = [], rest = Symb
|
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
91
|
}), _load_signal = /*@__PURE__*/ require_control_flow.wt((load) => {
|
|
92
|
-
let pending,
|
|
93
|
-
|
|
94
|
-
pending ||= load(), scope.X || !("X" in scope) && scope.H === require_control_flow.sn ? (scope.X ||= /* @__PURE__ */ new Map()).set(pending, { a: value }) : signal ? signal(scope, value) : pending.then((mod) => require_control_flow.rn(scope, signal = mod._, value), () => 0);
|
|
92
|
+
let pending, apply = (scope, value) => {
|
|
93
|
+
pending ||= load(), scope.X || !("X" in scope) && scope.H === require_control_flow.cn ? (scope.X ||= /* @__PURE__ */ new Map()).set(pending, [value, apply]) : apply._ ? apply._(scope, value) : pending.then((mod) => require_control_flow.rn(scope, apply._ = mod._, value), () => 0);
|
|
95
94
|
};
|
|
95
|
+
return apply;
|
|
96
96
|
});
|
|
97
97
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
98
98
|
//#region src/common/attr-tag.ts
|
|
@@ -136,7 +136,7 @@ function mount(input = {}, reference, position) {
|
|
|
136
136
|
curValue = newValue;
|
|
137
137
|
}, this.c?.(branch), args?.(branch, input);
|
|
138
138
|
});
|
|
139
|
-
return require_control_flow.st(parentNode, nextSibling, branch.S, branch.K), require_control_flow.
|
|
139
|
+
return require_control_flow.st(parentNode, nextSibling, branch.S, branch.K), require_control_flow.sn(effects), {
|
|
140
140
|
get value() {
|
|
141
141
|
return curValue;
|
|
142
142
|
},
|
|
@@ -144,7 +144,7 @@ function mount(input = {}, reference, position) {
|
|
|
144
144
|
require_control_flow.Wt(branch, newValue);
|
|
145
145
|
},
|
|
146
146
|
update(newInput = {}) {
|
|
147
|
-
args && (newInput.$global && ({$global, ...newInput} = newInput), require_control_flow.
|
|
147
|
+
args && (newInput.$global && ({$global, ...newInput} = newInput), require_control_flow.sn(require_control_flow.nn(() => {
|
|
148
148
|
args(branch, newInput);
|
|
149
149
|
})));
|
|
150
150
|
},
|
|
@@ -156,17 +156,17 @@ function mount(input = {}, reference, position) {
|
|
|
156
156
|
//#endregion
|
|
157
157
|
//#region src/dom/load.ts
|
|
158
158
|
function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
159
|
-
let parent = marker.parentNode, values = branch.X,
|
|
159
|
+
let parent = marker.parentNode, values = branch.X, clone = () => {
|
|
160
|
+
require_control_flow.Yt(branch), renderer.b(branch, parent.namespaceURI), branch.X = 0;
|
|
161
|
+
}, insert = () => {
|
|
160
162
|
require_control_flow.qt(branch, parent, marker), marker.remove(), awaitCounter?.c();
|
|
161
163
|
}, remaining;
|
|
162
|
-
if (
|
|
164
|
+
if (remaining = values?.size) {
|
|
163
165
|
let fail = loadFailed(branch, awaitCounter);
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}, (error) => remaining > 0 && (remaining = 0, fail(error)));
|
|
169
|
-
} else require_control_flow.mt(renderer, branch), insert();
|
|
166
|
+
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && require_control_flow.rn(branch, (branch) => {
|
|
167
|
+
clone(), renderer.c?.(branch), values.forEach(([value, apply]) => apply(branch, value)), insert();
|
|
168
|
+
}), (error) => remaining > 0 && (remaining = 0, fail(error))));
|
|
169
|
+
} else clone(), require_control_flow.mt(renderer, branch), insert();
|
|
170
170
|
}
|
|
171
171
|
function loadFailed(scope, awaitCounter) {
|
|
172
172
|
return (error) => {
|
|
@@ -196,9 +196,9 @@ function _load_race_trigger(...triggers) {
|
|
|
196
196
|
function getSelectorOrResolve(selector, resolve) {
|
|
197
197
|
return document.querySelector(selector) || resolve();
|
|
198
198
|
}
|
|
199
|
-
exports.$signal = require_control_flow.Zt, exports.$signalReset = require_control_flow.Qt, exports._assert_hoist = require_control_flow.
|
|
199
|
+
exports.$signal = require_control_flow.Zt, exports.$signalReset = require_control_flow.Qt, exports._assert_hoist = require_control_flow.pn, exports._assert_init = require_control_flow.Gt, exports._attr = require_control_flow.B, exports._attr_class = require_control_flow.V, exports._attr_class_item = require_control_flow.H, exports._attr_class_items = require_control_flow.U, exports._attr_content = require_control_flow.W, exports._attr_details_open = require_control_flow._, exports._attr_dialog_open = require_control_flow._, exports._attr_details_open_default = require_control_flow.v, exports._attr_dialog_open_default = require_control_flow.v, exports._attr_details_open_script = require_control_flow.y, exports._attr_dialog_open_script = require_control_flow.y, exports._attr_input_checked = require_control_flow.b, exports._attr_input_checkedValue = require_control_flow.x, exports._attr_input_checkedValue_default = require_control_flow.S, exports._attr_input_checkedValue_script = require_control_flow.C, exports._attr_input_checked_default = require_control_flow.w, exports._attr_input_checked_script = require_control_flow.T, exports._attr_input_value = require_control_flow.E, exports._attr_textarea_value = require_control_flow.E, exports._attr_input_value_attribute_default = require_control_flow.D, exports._attr_input_value_default = require_control_flow.O, exports._attr_textarea_value_default = require_control_flow.O, exports._attr_input_value_dynamic_default = require_control_flow.k, exports._attr_input_value_script = require_control_flow.A, exports._attr_textarea_value_script = require_control_flow.A, exports._attr_nonce = require_control_flow.G, exports._attr_select_value = require_control_flow.j, exports._attr_select_value_default = require_control_flow.M, exports._attr_select_value_script = require_control_flow.N, exports._attr_style = require_control_flow.K, exports._attr_style_item = require_control_flow.q, exports._attr_style_items = require_control_flow.J, exports._attrs = require_control_flow.Y, exports._attrs_content = require_control_flow.X, exports._attrs_partial = require_control_flow.Z, exports._attrs_partial_content = require_control_flow.Q, exports._attrs_script = require_control_flow.$, exports._await_content = require_control_flow.t, exports._await_promise = require_control_flow.n, exports._call = require_control_flow.hn, exports._child_setup = require_control_flow.Tt, exports._closure = require_control_flow.Et, exports._closure_get = require_control_flow.Dt, exports._const = require_control_flow.Ot, exports._content = require_control_flow.lt, exports._content_closures = require_control_flow.ut, exports._content_resume = require_control_flow.dt, exports._controllable_input = require_control_flow.P, exports._controllable_open = require_control_flow.F, exports._controllable_select = require_control_flow.I, exports._controllable_textarea = require_control_flow.L, Object.defineProperty(exports, "_dynamic_tag", {
|
|
200
200
|
enumerable: !0,
|
|
201
201
|
get: function() {
|
|
202
202
|
return require_control_flow.r;
|
|
203
203
|
}
|
|
204
|
-
}), exports._dynamic_tag_content = require_control_flow.i, exports._el = require_control_flow.ht, exports._el_read = require_control_flow.kt, exports._for_closure = require_control_flow.At, exports._for_in = require_control_flow.a, exports._for_of = require_control_flow.o, exports._for_selector = require_control_flow.jt, exports._for_to = require_control_flow.s, exports._for_until = require_control_flow.c, exports._global_read = require_control_flow.Mt, exports._hoist = require_control_flow.Nt, exports._hoist_read_error = require_control_flow.
|
|
204
|
+
}), exports._dynamic_tag_content = require_control_flow.i, exports._el = require_control_flow.ht, exports._el_read = require_control_flow.kt, exports._for_closure = require_control_flow.At, exports._for_in = require_control_flow.a, exports._for_of = require_control_flow.o, exports._for_selector = require_control_flow.jt, exports._for_to = require_control_flow.s, exports._for_until = require_control_flow.c, exports._global_read = require_control_flow.Mt, exports._hoist = require_control_flow.Nt, exports._hoist_read_error = require_control_flow.mn, exports._hoist_resume = require_control_flow.Pt, exports._html = require_control_flow.et, exports._id = require_control_flow.Ft, exports._if = require_control_flow.l, exports._if_closure = require_control_flow.It, exports._let = require_control_flow.Lt, exports._let_change = require_control_flow.Rt, exports._lifecycle = require_control_flow.tt, exports._load_event_trigger = _load_event_trigger, exports._load_idle_trigger = _load_idle_trigger, exports._load_media_trigger = _load_media_trigger, exports._load_race_trigger = _load_race_trigger, exports._load_setup = _load_setup, exports._load_signal = _load_signal, exports._load_template = _load_template, exports._load_visible_trigger = _load_visible_trigger, exports._on = require_control_flow.Xt, exports._or = require_control_flow.zt, exports._resume = require_control_flow.gt, exports._resume_dynamic_tag = require_control_flow.u, exports._return = require_control_flow.Bt, exports._return_change = require_control_flow.Vt, exports._script = require_control_flow.Ht, exports._show = require_control_flow.d, exports._style_rule_item = require_control_flow.nt, exports._style_shell = require_control_flow.rt, exports._template = _template, exports._text = require_control_flow.it, exports._text_content = require_control_flow.at, exports._to_text = require_control_flow.ot, exports._try = require_control_flow.f, exports._var = require_control_flow.Ut, exports._var_change = require_control_flow.Wt, exports._var_resume = require_control_flow._t, exports.attrTag = attrTag, exports.attrTags = attrTags, exports.compat = compat, exports.forIn = require_control_flow.ln, exports.forOf = require_control_flow.un, exports.forTo = require_control_flow.dn, exports.forUntil = require_control_flow.fn, exports.init = require_control_flow.yt, exports.initEmbedded = require_control_flow.bt, exports.ready = require_control_flow.xt, exports.readyFailed = require_control_flow.St, exports.run = require_control_flow.on;
|
package/dist/dom.mjs
CHANGED
|
@@ -77,10 +77,10 @@ let empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), cl
|
|
|
77
77
|
return lazyTemplate;
|
|
78
78
|
}), _load_setup = /*@__PURE__*/ withLazy((nodeAccessor, childScopeAccessor, load) => {
|
|
79
79
|
nodeAccessor = decodeAccessor(nodeAccessor), childScopeAccessor = decodeAccessor(childScopeAccessor);
|
|
80
|
-
let pending, renderer;
|
|
80
|
+
let pending, renderer, insertCached = (child, marker) => insertLoaded(renderer, child, marker);
|
|
81
81
|
return (owner) => {
|
|
82
82
|
let child = owner[childScopeAccessor];
|
|
83
|
-
if (renderer)
|
|
83
|
+
if (renderer) queueRender(child, insertCached, -1, owner[nodeAccessor]);
|
|
84
84
|
else {
|
|
85
85
|
let awaitCounter = addAwaitCounter(owner);
|
|
86
86
|
child.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((mod) => {
|
|
@@ -89,12 +89,12 @@ let empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), cl
|
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
91
|
}), _load_signal = /*@__PURE__*/ withLazy((load) => {
|
|
92
|
-
let pending,
|
|
93
|
-
|
|
94
|
-
pending ||= load(), scope.X || !("X" in scope) && scope.H === runId ? (scope.X ||= /* @__PURE__ */ new Map()).set(pending, { a: value }) : signal ? signal(scope, value) : pending.then((mod) => queueAsyncRender(scope, signal = mod._, value), () => 0);
|
|
92
|
+
let pending, apply = (scope, value) => {
|
|
93
|
+
pending ||= load(), scope.X || !("X" in scope) && scope.H === runId ? (scope.X ||= /* @__PURE__ */ new Map()).set(pending, [value, apply]) : apply._ ? apply._(scope, value) : pending.then((mod) => queueAsyncRender(scope, apply._ = mod._, value), () => 0);
|
|
95
94
|
};
|
|
95
|
+
return apply;
|
|
96
96
|
});
|
|
97
|
-
import { $ as _attrs_script, A as _attr_input_value_script, At as _for_closure, B as _attr, Bt as _return, C as _attr_input_checkedValue_script, D as _attr_input_value_attribute_default, Dt as _closure_get, E as _attr_input_value, Et as _closure, F as _controllable_open, Ft as _id, G as _attr_nonce, Gt as _assert_init, H as _attr_class_item, Ht as _script, I as _controllable_select, It as _if_closure, J as _attr_style_items, Jt as removeAndDestroyBranch, K as _attr_style, Kt as destroyBranch, L as _controllable_textarea, Lt as _let, M as _attr_select_value_default, Mt as _global_read, N as _attr_select_value_script, Nt as _hoist, O as _attr_input_value_default, Ot as _const, P as _controllable_input, Pt as _hoist_resume, Q as _attrs_partial_content, Qt as $signalReset, Rt as _let_change, S as _attr_input_checkedValue_default, St as readyFailed, T as _attr_input_checked_script, Tt as _child_setup, U as _attr_class_items, Ut as _var, V as _attr_class, Vt as _return_change, W as _attr_content, Wt as _var_change, X as _attrs_content, Xt as _on, Y as _attrs, Yt as syncGen, Z as _attrs_partial, Zt as $signal, _ as _attr_details_or_dialog_open, _t as _var_resume, a as _for_in, an as
|
|
97
|
+
import { $ as _attrs_script, A as _attr_input_value_script, At as _for_closure, B as _attr, Bt as _return, C as _attr_input_checkedValue_script, D as _attr_input_value_attribute_default, Dt as _closure_get, E as _attr_input_value, Et as _closure, F as _controllable_open, Ft as _id, G as _attr_nonce, Gt as _assert_init, H as _attr_class_item, Ht as _script, I as _controllable_select, It as _if_closure, J as _attr_style_items, Jt as removeAndDestroyBranch, K as _attr_style, Kt as destroyBranch, L as _controllable_textarea, Lt as _let, M as _attr_select_value_default, Mt as _global_read, N as _attr_select_value_script, Nt as _hoist, O as _attr_input_value_default, Ot as _const, P as _controllable_input, Pt as _hoist_resume, Q as _attrs_partial_content, Qt as $signalReset, Rt as _let_change, S as _attr_input_checkedValue_default, St as readyFailed, T as _attr_input_checked_script, Tt as _child_setup, U as _attr_class_items, Ut as _var, V as _attr_class, Vt as _return_change, W as _attr_content, Wt as _var_change, X as _attrs_content, Xt as _on, Y as _attrs, Yt as syncGen, Z as _attrs_partial, Zt as $signal, _ as _attr_details_or_dialog_open, _t as _var_resume, a as _for_in, an as queueRender, at as _text_content, b as _attr_input_checked, bt as initEmbedded, c as _for_until, cn as runId, ct as toInsertNode, d as _show, dn as forTo, dt as _content_resume, et as _html, f as _try, fn as forUntil, ft as createAndSetupBranch, g as renderCatch, gn as decodeAccessor, gt as _resume, h as patchDynamicTag, hn as _call, ht as _el, i as _dynamic_tag_content, in as queueEffect, it as _text, j as _attr_select_value, jt as _for_selector, k as _attr_input_value_dynamic_default, kt as _el_read, l as _if, ln as forIn, lt as _content, mn as _hoist_read_error, mt as setupBranch, n as _await_promise, nn as prepareEffects, nt as _style_rule_item, o as _for_of, on as run, ot as _to_text, p as addAwaitCounter, pn as _assert_hoist, pt as createBranch, q as _attr_style_item, qt as insertBranchBefore, r as _dynamic_tag, rn as queueAsyncRender, rt as _style_shell, s as _for_to, sn as runEffects, st as insertChildNodes, t as _await_content, tt as _lifecycle, u as _resume_dynamic_tag, un as forOf, ut as _content_closures, v as _attr_details_or_dialog_open_default, vt as getRegisteredWithScope, w as _attr_input_checked_default, wt as withLazy, x as _attr_input_checkedValue, xt as ready, y as _attr_details_or_dialog_open_script, yt as init, zt as _or } from "./dom-UwNQ-AXt.mjs";
|
|
98
98
|
//#region src/common/attr-tag.ts
|
|
99
99
|
function attrTag(attrs) {
|
|
100
100
|
return attrs[Symbol.iterator] = attrTagIterator, attrs[rest] = empty, attrs;
|
|
@@ -156,17 +156,17 @@ function mount(input = {}, reference, position) {
|
|
|
156
156
|
//#endregion
|
|
157
157
|
//#region src/dom/load.ts
|
|
158
158
|
function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
159
|
-
let parent = marker.parentNode, values = branch.X,
|
|
159
|
+
let parent = marker.parentNode, values = branch.X, clone = () => {
|
|
160
|
+
syncGen(branch), renderer.b(branch, parent.namespaceURI), branch.X = 0;
|
|
161
|
+
}, insert = () => {
|
|
160
162
|
insertBranchBefore(branch, parent, marker), marker.remove(), awaitCounter?.c();
|
|
161
163
|
}, remaining;
|
|
162
|
-
if (
|
|
164
|
+
if (remaining = values?.size) {
|
|
163
165
|
let fail = loadFailed(branch, awaitCounter);
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}, (error) => remaining > 0 && (remaining = 0, fail(error)));
|
|
169
|
-
} else setupBranch(renderer, branch), insert();
|
|
166
|
+
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && queueAsyncRender(branch, (branch) => {
|
|
167
|
+
clone(), renderer.c?.(branch), values.forEach(([value, apply]) => apply(branch, value)), insert();
|
|
168
|
+
}), (error) => remaining > 0 && (remaining = 0, fail(error))));
|
|
169
|
+
} else clone(), setupBranch(renderer, branch), insert();
|
|
170
170
|
}
|
|
171
171
|
function loadFailed(scope, awaitCounter) {
|
|
172
172
|
return (error) => {
|
package/dist/html/writer.d.ts
CHANGED
|
@@ -47,7 +47,8 @@ export declare function _hoist(scopeId: number, id: string): {
|
|
|
47
47
|
[Symbol.iterator]: typeof _hoist_read_error;
|
|
48
48
|
};
|
|
49
49
|
export declare function _el_resume(scopeId: number, accessor: Accessor, shouldResume?: number): string;
|
|
50
|
-
export declare function
|
|
50
|
+
export declare function _text_resume(scopeId: number, accessor: Accessor, val: unknown, shouldResume?: number): string;
|
|
51
|
+
export declare function _html_resume(scopeId: number, accessor: Accessor, val: unknown, shouldResume?: number): string;
|
|
51
52
|
export declare function _resume_branch(scopeId: number): void;
|
|
52
53
|
export declare function _attr_content(nodeAccessor: Accessor, scopeId: number, content: unknown, serializeReason?: number): void;
|
|
53
54
|
export declare function _var(parentScopeId: number, scopeOffsetAccessor: Accessor, childScopeId: number, registryId: string, nodeAccessor?: Accessor): void;
|
package/dist/html.d.ts
CHANGED
|
@@ -7,4 +7,4 @@ export { _escape, _escape_comment, _escape_script, _escape_style, _escape_style_
|
|
|
7
7
|
export { _content, _content_resume, _dynamic_tag } from "./html/dynamic-tag";
|
|
8
8
|
export { forIn, forOf, forTo, forUntil } from "./html/for";
|
|
9
9
|
export { _template } from "./html/template";
|
|
10
|
-
export { _attr_content, _await, _el, _el_resume, _existing_scope, _for_in, _for_of, _for_to, _for_until, _hoist, _html, _id, _if, _peek_scope_id, _resume, _resume_branch, _resume_locals, _scope, _scope_id, _scope_reason, _scope_with_id, _script,
|
|
10
|
+
export { _attr_content, _await, _el, _el_resume, _existing_scope, _for_in, _for_of, _for_to, _for_until, _hoist, _html, _id, _if, _peek_scope_id, _resume, _resume_branch, _resume_locals, _scope, _scope_id, _scope_reason, _html_resume, _scope_with_id, _script, _serialize_guard, _serialize_if, _set_serialize_reason, _show_end, _show_start, _text_resume, _subscribe, _trailers, _try, _var, $global, } from "./html/writer";
|
package/dist/html.js
CHANGED
|
@@ -262,7 +262,7 @@ let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeSty
|
|
|
262
262
|
_html(`</${renderer}>`);
|
|
263
263
|
}
|
|
264
264
|
let childScope = getScopeById(branchId), needsScript = childScope && (childScope.Ia || childScope.Ea);
|
|
265
|
-
needsScript && _script(branchId, "_d"), (shouldResume || needsScript) && _html(state.mark("
|
|
265
|
+
needsScript && _script(branchId, "_d"), (shouldResume || needsScript) && _html(state.mark("(", scopeId + " " + accessor + " " + branchId));
|
|
266
266
|
})(), result = _el(branchId, "_e");
|
|
267
267
|
} else {
|
|
268
268
|
let chunk = getChunk(), beforeBranch = shouldResume ? deferBranchStart(chunk) : void 0, render = () => {
|
|
@@ -1349,10 +1349,21 @@ function _hoist(scopeId, id) {
|
|
|
1349
1349
|
function _el_resume(scopeId, accessor, shouldResume) {
|
|
1350
1350
|
if (shouldResume === 0) return "";
|
|
1351
1351
|
let { state } = $chunk.boundary;
|
|
1352
|
-
return state.needsMainRuntime = !0, state.mark("
|
|
1352
|
+
return state.needsMainRuntime = !0, state.mark("$", scopeId + " " + accessor);
|
|
1353
1353
|
}
|
|
1354
|
-
function
|
|
1355
|
-
return
|
|
1354
|
+
function _text_resume(scopeId, accessor, val, shouldResume) {
|
|
1355
|
+
return markText(scopeId, accessor, _escape(val), shouldResume);
|
|
1356
|
+
}
|
|
1357
|
+
function _html_resume(scopeId, accessor, val, shouldResume) {
|
|
1358
|
+
let html = _unescaped(val);
|
|
1359
|
+
if (shouldResume === 0 || !~html.indexOf("<")) return markText(scopeId, accessor, html, shouldResume);
|
|
1360
|
+
let { state } = $chunk.boundary;
|
|
1361
|
+
return state.needsMainRuntime = !0, state.mark("&", "") + html + state.mark("'", scopeId + " " + accessor);
|
|
1362
|
+
}
|
|
1363
|
+
function markText(scopeId, accessor, text, shouldResume) {
|
|
1364
|
+
if (shouldResume === 0) return text;
|
|
1365
|
+
let { state } = $chunk.boundary;
|
|
1366
|
+
return state.needsMainRuntime = !0, text ? (shouldResume === 2 ? "<!>" : "") + text + state.mark("$", scopeId + " " + accessor) : state.mark("%", scopeId + " " + accessor);
|
|
1356
1367
|
}
|
|
1357
1368
|
function _resume_branch(scopeId) {
|
|
1358
1369
|
let branchId = $chunk.context?.[kBranchId];
|
|
@@ -2260,4 +2271,4 @@ exports.$global = $global, exports._assert_hoist = _assert_hoist, exports._attr
|
|
|
2260
2271
|
get: function() {
|
|
2261
2272
|
return _dynamic_tag;
|
|
2262
2273
|
}
|
|
2263
|
-
}), exports._el = _el, exports._el_read_error = _el_read_error, exports._el_resume = _el_resume, exports._escape = _escape, exports._escape_comment = _escape_comment, exports._escape_script = _escape_script, exports._escape_style = _escape_style, exports._escape_style_value = _escape_style_value, exports._existing_scope = _existing_scope, exports._flush_head = _flush_head, exports._for_in = _for_in, exports._for_of = _for_of, exports._for_to = _for_to, exports._for_until = _for_until, exports._hoist = _hoist, exports._hoist_read_error = _hoist_read_error, exports._html = _html, exports._id = _id, exports._if = _if, exports._peek_scope_id = _peek_scope_id, exports._resume = _resume, exports._resume_branch = _resume_branch, exports._resume_locals = _resume_locals, exports._scope = writeScope, exports._scope_id = _scope_id, exports._scope_reason = _scope_reason, exports._scope_with_id = _scope_with_id, exports._script = _script, exports.
|
|
2274
|
+
}), exports._el = _el, exports._el_read_error = _el_read_error, exports._el_resume = _el_resume, exports._escape = _escape, exports._escape_comment = _escape_comment, exports._escape_script = _escape_script, exports._escape_style = _escape_style, exports._escape_style_value = _escape_style_value, exports._existing_scope = _existing_scope, exports._flush_head = _flush_head, exports._for_in = _for_in, exports._for_of = _for_of, exports._for_to = _for_to, exports._for_until = _for_until, exports._hoist = _hoist, exports._hoist_read_error = _hoist_read_error, exports._html = _html, exports._html_resume = _html_resume, exports._id = _id, exports._if = _if, exports._peek_scope_id = _peek_scope_id, exports._resume = _resume, exports._resume_branch = _resume_branch, exports._resume_locals = _resume_locals, exports._scope = writeScope, exports._scope_id = _scope_id, exports._scope_reason = _scope_reason, exports._scope_with_id = _scope_with_id, exports._script = _script, exports._serialize_guard = _serialize_guard, exports._serialize_if = _serialize_if, exports._set_serialize_reason = _set_serialize_reason, exports._show_end = _show_end, exports._show_start = _show_start, exports._style_html = _style_html, exports._subscribe = _subscribe, exports._template = _template, exports._text_resume = _text_resume, exports._textarea_value = _textarea_value, exports._to_text = _to_text, exports._trailers = _trailers, exports._try = _try, exports._unescaped = _unescaped, exports._var = _var, exports.attrTag = attrTag, exports.attrTags = attrTags, exports.compat = compat, exports.forIn = forIn, exports.forOf = forOf, exports.forTo = forTo, exports.forUntil = forUntil, exports.withLoadAssets = withLoadAssets, exports.withPageAssets = withPageAssets;
|
package/dist/html.mjs
CHANGED
|
@@ -262,7 +262,7 @@ let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeSty
|
|
|
262
262
|
_html(`</${renderer}>`);
|
|
263
263
|
}
|
|
264
264
|
let childScope = getScopeById(branchId), needsScript = childScope && (childScope.Ia || childScope.Ea);
|
|
265
|
-
needsScript && _script(branchId, "_d"), (shouldResume || needsScript) && _html(state.mark("
|
|
265
|
+
needsScript && _script(branchId, "_d"), (shouldResume || needsScript) && _html(state.mark("(", scopeId + " " + accessor + " " + branchId));
|
|
266
266
|
})(), result = _el(branchId, "_e");
|
|
267
267
|
} else {
|
|
268
268
|
let chunk = getChunk(), beforeBranch = shouldResume ? deferBranchStart(chunk) : void 0, render = () => {
|
|
@@ -1348,10 +1348,21 @@ function _hoist(scopeId, id) {
|
|
|
1348
1348
|
function _el_resume(scopeId, accessor, shouldResume) {
|
|
1349
1349
|
if (shouldResume === 0) return "";
|
|
1350
1350
|
let { state } = $chunk.boundary;
|
|
1351
|
-
return state.needsMainRuntime = !0, state.mark("
|
|
1351
|
+
return state.needsMainRuntime = !0, state.mark("$", scopeId + " " + accessor);
|
|
1352
1352
|
}
|
|
1353
|
-
function
|
|
1354
|
-
return
|
|
1353
|
+
function _text_resume(scopeId, accessor, val, shouldResume) {
|
|
1354
|
+
return markText(scopeId, accessor, _escape(val), shouldResume);
|
|
1355
|
+
}
|
|
1356
|
+
function _html_resume(scopeId, accessor, val, shouldResume) {
|
|
1357
|
+
let html = _unescaped(val);
|
|
1358
|
+
if (shouldResume === 0 || !~html.indexOf("<")) return markText(scopeId, accessor, html, shouldResume);
|
|
1359
|
+
let { state } = $chunk.boundary;
|
|
1360
|
+
return state.needsMainRuntime = !0, state.mark("&", "") + html + state.mark("'", scopeId + " " + accessor);
|
|
1361
|
+
}
|
|
1362
|
+
function markText(scopeId, accessor, text, shouldResume) {
|
|
1363
|
+
if (shouldResume === 0) return text;
|
|
1364
|
+
let { state } = $chunk.boundary;
|
|
1365
|
+
return state.needsMainRuntime = !0, text ? (shouldResume === 2 ? "<!>" : "") + text + state.mark("$", scopeId + " " + accessor) : state.mark("%", scopeId + " " + accessor);
|
|
1355
1366
|
}
|
|
1356
1367
|
function _resume_branch(scopeId) {
|
|
1357
1368
|
let branchId = $chunk.context?.[kBranchId];
|
|
@@ -2255,4 +2266,4 @@ function drainClassFunctions($global, writeScope) {
|
|
|
2255
2266
|
}
|
|
2256
2267
|
function NOOP() {}
|
|
2257
2268
|
//#endregion
|
|
2258
|
-
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,
|
|
2269
|
+
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 };
|
package/dist/translator/index.js
CHANGED
|
@@ -9015,7 +9015,10 @@ function assertHasBody(tag) {
|
|
|
9015
9015
|
function assertHasValueAttribute(tag) {
|
|
9016
9016
|
const { node } = tag;
|
|
9017
9017
|
const [valueAttr] = node.attributes;
|
|
9018
|
-
if (!_marko_compiler.types.isMarkoAttribute(valueAttr) || !(valueAttr.default || valueAttr.name === "value"))
|
|
9018
|
+
if (!_marko_compiler.types.isMarkoAttribute(valueAttr) || !(valueAttr.default || valueAttr.name === "value")) {
|
|
9019
|
+
const wrongName = _marko_compiler.types.isMarkoAttribute(valueAttr) && valueAttr.name;
|
|
9020
|
+
throw (wrongName ? tag.get("attributes")[0] : tag.get("name")).buildCodeFrameError(`The [\`<${getTagName(tag)}>\` tag](https://markojs.com/docs/reference/core-tag#show) requires the [\`value=\` attribute](https://markojs.com/docs/reference/language#shorthand-value).${wrongName ? ` Use \`<${getTagName(tag)}=condition>\` instead of \`<${getTagName(tag)} ${wrongName}=condition>\`.` : ""}`);
|
|
9021
|
+
}
|
|
9019
9022
|
if (node.attributes.length > 1) throw tag.get("name").buildCodeFrameError(`The [\`<${getTagName(tag)}>\` tag](https://markojs.com/docs/reference/core-tag#show) only supports the [\`value=\` attribute](https://markojs.com/docs/reference/language#shorthand-value).`);
|
|
9020
9023
|
}
|
|
9021
9024
|
//#endregion
|
|
@@ -9714,14 +9717,11 @@ function translateExit(placeholder) {
|
|
|
9714
9717
|
const section = getSection(placeholder);
|
|
9715
9718
|
const siblingText = extra[kSiblingText];
|
|
9716
9719
|
const markerSerializeReason = nodeBinding && getSerializeReason(section, nodeBinding);
|
|
9717
|
-
if (isHTML
|
|
9718
|
-
|
|
9719
|
-
|
|
9720
|
-
}
|
|
9721
|
-
|
|
9722
|
-
write`${method === "_escape" ? buildEscapedTextExpression(value) : callRuntime(method, value)}`;
|
|
9723
|
-
if (nodeBinding) markNode(placeholder, nodeBinding, markerSerializeReason);
|
|
9724
|
-
} else addStatement("render", section, valueExtra.referencedBindings, _marko_compiler.types.expressionStatement(method === "_text" ? callRuntime("_text", createScopeReadExpression(nodeBinding), value) : callRuntime("_html", scopeIdentifier, value, getScopeAccessorLiteral(nodeBinding))), true);
|
|
9720
|
+
if (isHTML) if (markerSerializeReason) {
|
|
9721
|
+
const guard = getSerializeGuard(section, markerSerializeReason, true);
|
|
9722
|
+
write`${callRuntime(node.escape ? "_text_resume" : "_html_resume", getScopeIdIdentifier(section), getScopeAccessorLiteral(nodeBinding), value, siblingText === 1 ? guard ? _marko_compiler.types.binaryExpression("*", guard, _marko_compiler.types.numericLiteral(2)) : _marko_compiler.types.numericLiteral(2) : guard)}`;
|
|
9723
|
+
} else write`${method === "_escape" ? buildEscapedTextExpression(value) : callRuntime(method, value)}`;
|
|
9724
|
+
else addStatement("render", section, valueExtra.referencedBindings, _marko_compiler.types.expressionStatement(method === "_text" ? callRuntime("_text", createScopeReadExpression(nodeBinding), value) : callRuntime("_html", scopeIdentifier, value, getScopeAccessorLiteral(nodeBinding))), true);
|
|
9725
9725
|
}
|
|
9726
9726
|
placeholder.remove();
|
|
9727
9727
|
}
|
|
@@ -9745,13 +9745,8 @@ function buildEscapedTextExpression(value) {
|
|
|
9745
9745
|
default: return callRuntime("_escape", value);
|
|
9746
9746
|
}
|
|
9747
9747
|
}
|
|
9748
|
-
function writeSeparator(write, section, reason) {
|
|
9749
|
-
if (reason === true || reason.state) write`<!>`;
|
|
9750
|
-
else write`${callRuntime("_sep", getSerializeGuard(section, reason, true))}`;
|
|
9751
|
-
}
|
|
9752
9748
|
function analyzeSiblingText(placeholder) {
|
|
9753
9749
|
const placeholderExtra = placeholder.node.extra;
|
|
9754
|
-
let hasNodeBefore = false;
|
|
9755
9750
|
let prev = placeholder.getPrevSibling();
|
|
9756
9751
|
let prevParent = placeholder.parentPath;
|
|
9757
9752
|
for (;;) {
|
|
@@ -9767,10 +9762,7 @@ function analyzeSiblingText(placeholder) {
|
|
|
9767
9762
|
const contentType = getNodeContentType(prev, "endType");
|
|
9768
9763
|
if (contentType === null) prev = prev.getPrevSibling();
|
|
9769
9764
|
else if (contentType === 4 || contentType === 1 || contentType === 2) return placeholderExtra[kSiblingText] = 1;
|
|
9770
|
-
else
|
|
9771
|
-
hasNodeBefore = true;
|
|
9772
|
-
break;
|
|
9773
|
-
}
|
|
9765
|
+
else break;
|
|
9774
9766
|
}
|
|
9775
9767
|
if (!prev.node && prevParent.isProgram()) return placeholderExtra[kSiblingText] = 1;
|
|
9776
9768
|
let next = placeholder.getNextSibling();
|
|
@@ -9791,7 +9783,7 @@ function analyzeSiblingText(placeholder) {
|
|
|
9791
9783
|
else break;
|
|
9792
9784
|
}
|
|
9793
9785
|
if (!next.node && nextParent.isProgram()) return placeholderExtra[kSiblingText] = 2;
|
|
9794
|
-
return placeholderExtra[kSiblingText] =
|
|
9786
|
+
return placeholderExtra[kSiblingText] = 0;
|
|
9795
9787
|
}
|
|
9796
9788
|
function getInlinedBodyTag(parent) {
|
|
9797
9789
|
if (parent.isMarkoTagBody()) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "marko",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.48",
|
|
4
4
|
"description": "Optimized runtime for Marko templates.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"magic-string": "^0.30.21"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"marko": "
|
|
61
|
-
"
|
|
60
|
+
"@marko/runtime-tags": "npm:marko@6.3.48",
|
|
61
|
+
"marko": "5.39.38"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
64
64
|
"node": ">=22"
|