marko 6.4.2 → 6.4.3
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/dist/common/constants/accessor-prop.d.ts +1 -0
- package/dist/common/constants/accessor-prop.debug.d.ts +1 -0
- package/dist/common/types.d.ts +1 -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-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 +6 -2
- package/dist/debug/dom/dynamic-tag-var.feat.mjs +6 -2
- 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-BLbR0hEx.js → dom-C7F3yZTh.js} +89 -24
- package/dist/debug/{dom-Cii0IA92.mjs → dom-uEY0J_H9.mjs} +60 -25
- package/dist/debug/dom.js +10 -1
- package/dist/debug/dom.mjs +10 -2
- package/dist/debug/html.js +13 -7
- package/dist/debug/html.mjs +13 -7
- package/dist/dom/catch.feat.js +4 -4
- package/dist/dom/catch.feat.mjs +1 -1
- package/dist/dom/control-flow.d.ts +2 -2
- package/dist/dom/controllable-input.feat.js +2 -2
- package/dist/dom/controllable-input.feat.mjs +1 -1
- package/dist/dom/controllable-open.feat.js +2 -2
- package/dist/dom/controllable-open.feat.mjs +1 -1
- package/dist/dom/controllable-select.feat.js +2 -2
- package/dist/dom/controllable-select.feat.mjs +1 -1
- package/dist/dom/controllable-textarea.feat.js +2 -2
- package/dist/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/dom/controllable.feat.js +2 -2
- package/dist/dom/controllable.feat.mjs +1 -1
- package/dist/dom/dynamic-tag-script.feat.js +2 -2
- package/dist/dom/dynamic-tag-script.feat.mjs +1 -1
- package/dist/dom/dynamic-tag-var.feat.js +4 -2
- package/dist/dom/dynamic-tag-var.feat.mjs +4 -3
- package/dist/dom/lazy.feat.js +1 -1
- package/dist/dom/lazy.feat.mjs +1 -1
- package/dist/dom/load.d.ts +1 -0
- package/dist/dom/placeholder.feat.js +3 -3
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/dom/queue.d.ts +4 -1
- package/dist/{dom-B8UEYzOz.js → dom-CtIT8Mpr.js} +184 -140
- package/dist/{dom-BPjLe6YU.mjs → dom-DHg9YChM.mjs} +51 -27
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +39 -33
- package/dist/dom.mjs +8 -2
- package/dist/html/writer.d.ts +1 -1
- package/dist/html.js +18 -8
- package/dist/html.mjs +18 -8
- package/dist/translator/index.js +28 -23
- package/package.json +2 -2
- package/tags-html.d.ts +6 -5
|
@@ -6,7 +6,15 @@ let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "
|
|
|
6
6
|
else for (let name in val) part = stringify(name, val[name]), part && (str += sep + part, sep = delimiter);
|
|
7
7
|
}
|
|
8
8
|
return str;
|
|
9
|
-
}, decodeAccessor = (num) => (num + (num < 26 ? 10 : num < 962 ? 334 : 11998)).toString(36), branchesEnabled, dynamicHtmlEnabled, rendering, runId = 2, pendingEffects = [], pendingRenders = [],
|
|
9
|
+
}, decodeAccessor = (num) => (num + (num < 26 ? 10 : num < 962 ? 334 : 11998)).toString(36), branchesEnabled, dynamicHtmlEnabled, rendering, runId = 2, pendingEffects = [], pendingRenders = [], queuePendingRender = (render) => {
|
|
10
|
+
let i = pendingRenders.push(render) - 1;
|
|
11
|
+
for (; i;) {
|
|
12
|
+
let parentIndex = i - 1 >> 1, parent = pendingRenders[parentIndex];
|
|
13
|
+
if (render.a - parent.a >= 0) break;
|
|
14
|
+
pendingRenders[i] = parent, i = parentIndex;
|
|
15
|
+
}
|
|
16
|
+
pendingRenders[i] = render;
|
|
17
|
+
}, runEffects = ((effects) => {
|
|
10
18
|
for (let i = 0; i < effects.length;) effects[i++](effects[i++]);
|
|
11
19
|
}), runRender = (render) => {
|
|
12
20
|
(!branchesEnabled || render.b.F?.H !== 0) && render.c(render.b, render.d);
|
|
@@ -62,18 +70,19 @@ let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "
|
|
|
62
70
|
display ? inDom || insertBranchBefore(range, parentNode, onlyChild ? null : referenceNode) : inDom && (onlyChild && (range.S = parentNode.firstChild, range.K = parentNode.lastChild), tempDetachBranch(range));
|
|
63
71
|
};
|
|
64
72
|
}), _dynamic_tag = /*@__PURE__*/ withBranches((nodeAccessor, getContent, getTagVar, inputIsArgs) => {
|
|
73
|
+
let scopeOffsetAccessor = getTagVar && decodeAccessor(nodeAccessor + 1);
|
|
65
74
|
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
66
75
|
let childScopeAccessor = "A" + nodeAccessor, rendererAccessor = "D" + nodeAccessor;
|
|
67
76
|
return (scope, newRenderer, getInput) => {
|
|
68
77
|
let normalizedRenderer = normalizeDynamicRenderer(newRenderer);
|
|
69
78
|
if (scope[rendererAccessor] !== (scope[rendererAccessor] = rendererKey(normalizedRenderer)) || getContent && !(normalizedRenderer || scope[childScopeAccessor])) {
|
|
70
79
|
let renderer = normalizedRenderer || (getContent ? getContent(scope) : void 0);
|
|
71
|
-
if (setConditionalRenderer(scope, nodeAccessor, renderer, createBranchWithTagNameOrRenderer), getTagVar && (scope[childScopeAccessor] ? (scope[childScopeAccessor].T = (value) => getTagVar()(scope, value),
|
|
80
|
+
if (setConditionalRenderer(scope, nodeAccessor, renderer, createBranchWithTagNameOrRenderer), getTagVar && (scope[childScopeAccessor] ? (scope[childScopeAccessor].T = (value) => getTagVar()(scope, value), bindTagVar(scope, scope[childScopeAccessor], scope[scopeOffsetAccessor], normalizedRenderer)) : getTagVar()(scope, void 0)), typeof renderer == "string") {
|
|
72
81
|
if (getContent) {
|
|
73
82
|
let content = getContent(scope);
|
|
74
83
|
setConditionalRenderer(scope[childScopeAccessor], "a", content, createAndSetupBranch), content.f && subscribeToScopeSet(content.e, content.f, scope[childScopeAccessor].Aa);
|
|
75
84
|
}
|
|
76
|
-
} else renderer
|
|
85
|
+
} else renderer && (setupBranch(renderer, scope[childScopeAccessor]), renderer.f && subscribeToScopeSet(renderer.e, renderer.f, scope[childScopeAccessor]));
|
|
77
86
|
}
|
|
78
87
|
if (normalizedRenderer) {
|
|
79
88
|
let childScope = scope[childScopeAccessor], args = getInput?.();
|
|
@@ -96,7 +105,7 @@ let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "
|
|
|
96
105
|
return (scope, renderer) => {
|
|
97
106
|
scope[rendererAccessor] !== (scope[rendererAccessor] = rendererKey(renderer)) && (setConditionalRenderer(scope, nodeAccessor, renderer, createAndSetupBranch), renderer?.f && subscribeToScopeSet(renderer.e, renderer.f, scope[childScopeAccessor])), renderer?.g?.(scope[childScopeAccessor]);
|
|
98
107
|
};
|
|
99
|
-
}),
|
|
108
|
+
}), bindTagVar, loop = /*@__PURE__*/ withBranches((forEach, reorder) => (nodeAccessor, template, walks, setup, params) => {
|
|
100
109
|
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
101
110
|
let scopesAccessor = "A" + nodeAccessor, keyedScopesAccessor = "O" + nodeAccessor, renderer = _content("", template, walks, setup)();
|
|
102
111
|
return (scope, value) => {
|
|
@@ -214,14 +223,30 @@ function queueRender(scope, signal, signalKey, value, scopeKey = scope.L) {
|
|
|
214
223
|
}, signalKey >= 0 && (scope[signalKey] = render);
|
|
215
224
|
queuePendingRender(render);
|
|
216
225
|
}
|
|
217
|
-
function
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
226
|
+
function createBranchRenders(scope, scopeKey) {
|
|
227
|
+
return {
|
|
228
|
+
a: scopeKey * 1e6 - 1,
|
|
229
|
+
b: scope,
|
|
230
|
+
c: runBranchRenders,
|
|
231
|
+
d: [],
|
|
232
|
+
e: 0
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
function installBranchRenders() {
|
|
236
|
+
let queue = queuePendingRender;
|
|
237
|
+
queuePendingRender = (render) => {
|
|
238
|
+
let branchRenders = render.b.F?.BR;
|
|
239
|
+
if (branchRenders) {
|
|
240
|
+
branchRenders.e !== runId && !branchRenders.f && (branchRenders.d = []), branchRenders.e = runId;
|
|
241
|
+
let renders = branchRenders.d;
|
|
242
|
+
renders.length || queuePendingRender(branchRenders);
|
|
243
|
+
let prev = pendingRenders;
|
|
244
|
+
pendingRenders = renders, queue(render), pendingRenders = prev;
|
|
245
|
+
} else queue(render);
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
function runBranchRenders(_scope, renders) {
|
|
249
|
+
runRenders(renders);
|
|
225
250
|
}
|
|
226
251
|
function queueEffect(scope, fn) {
|
|
227
252
|
pendingEffects.push(fn, scope);
|
|
@@ -251,17 +276,17 @@ function prepareEffects(fn) {
|
|
|
251
276
|
function installCatch(catchEffects, wrapRender) {
|
|
252
277
|
catchEnabled = 1, withBranches(), runEffects = catchEffects, runRender = wrapRender(runRender);
|
|
253
278
|
}
|
|
254
|
-
function runRenders() {
|
|
255
|
-
for (;
|
|
256
|
-
let render =
|
|
279
|
+
function runRenders(renders = pendingRenders) {
|
|
280
|
+
for (; renders.length;) {
|
|
281
|
+
let render = renders[0], item = renders.pop();
|
|
257
282
|
if (render !== item) {
|
|
258
|
-
let i = 0, mid =
|
|
283
|
+
let i = 0, mid = renders.length >> 1, key = (renders[0] = item).a;
|
|
259
284
|
for (; i < mid;) {
|
|
260
285
|
let bestChild = (i << 1) + 1, right = bestChild + 1;
|
|
261
|
-
if (right <
|
|
262
|
-
|
|
286
|
+
if (right < renders.length && renders[right].a - renders[bestChild].a < 0 && (bestChild = right), renders[bestChild].a - key >= 0) break;
|
|
287
|
+
renders[i] = renders[bestChild], i = bestChild;
|
|
263
288
|
}
|
|
264
|
-
|
|
289
|
+
renders[i] = item;
|
|
265
290
|
}
|
|
266
291
|
runRender(render);
|
|
267
292
|
}
|
|
@@ -404,17 +429,16 @@ function _for_closure(ownerLoopNodeAccessor, fn) {
|
|
|
404
429
|
ownerLoopNodeAccessor = decodeAccessor(ownerLoopNodeAccessor);
|
|
405
430
|
let scopeAccessor = "A" + ownerLoopNodeAccessor, ownerSignal = (ownerScope) => {
|
|
406
431
|
let scopes = toArray(ownerScope[scopeAccessor]);
|
|
407
|
-
|
|
432
|
+
queueRender(ownerScope, () => {
|
|
408
433
|
for (let scope of scopes) scope.H > 0 && scope.H < runId && fn(scope);
|
|
409
|
-
}, -1
|
|
434
|
+
}, -1);
|
|
410
435
|
};
|
|
411
436
|
return ownerSignal._ = fn, ownerSignal;
|
|
412
437
|
}
|
|
413
438
|
function _for_selector(ownerLoopNodeAccessor, ownerValueAccessor, keyValueAccessor, fn) {
|
|
414
439
|
ownerLoopNodeAccessor = decodeAccessor(ownerLoopNodeAccessor), ownerValueAccessor = decodeAccessor(ownerValueAccessor), keyValueAccessor !== "M" && (keyValueAccessor = decodeAccessor(keyValueAccessor));
|
|
415
440
|
let scopeAccessor = "A" + ownerLoopNodeAccessor, mapAccessor = "O" + ownerLoopNodeAccessor, prevKeyProp = `_${ownerValueAccessor}`, ownerSignal = (ownerScope) => {
|
|
416
|
-
|
|
417
|
-
if (ownerScope.H < runId && scopes.length) {
|
|
441
|
+
if (ownerScope.H < runId) {
|
|
418
442
|
let nextKey = ownerScope[ownerValueAccessor];
|
|
419
443
|
queueRender(ownerScope, () => {
|
|
420
444
|
let map = keyedScopes(ownerScope, scopeAccessor, mapAccessor, keyValueAccessor);
|
|
@@ -423,7 +447,7 @@ function _for_selector(ownerLoopNodeAccessor, ownerValueAccessor, keyValueAccess
|
|
|
423
447
|
prevScope !== nextScope && (runLiveBranch(prevScope, fn), runLiveBranch(nextScope, fn));
|
|
424
448
|
} else for (let scope of toArray(ownerScope[scopeAccessor])) runLiveBranch(scope, fn);
|
|
425
449
|
map && (map[prevKeyProp] = nextKey);
|
|
426
|
-
}, -1
|
|
450
|
+
}, -1);
|
|
427
451
|
}
|
|
428
452
|
};
|
|
429
453
|
return ownerSignal._ = fn, ownerSignal;
|
|
@@ -1183,7 +1207,7 @@ function patchDynamicTag(fn) {
|
|
|
1183
1207
|
_dynamic_tag = fn(_dynamic_tag);
|
|
1184
1208
|
}
|
|
1185
1209
|
function installDynamicTagVar(bind) {
|
|
1186
|
-
|
|
1210
|
+
bindTagVar = bind;
|
|
1187
1211
|
}
|
|
1188
1212
|
function dynamicTagScript(branch) {
|
|
1189
1213
|
_attrs_script(branch, "a");
|
|
@@ -1207,7 +1231,7 @@ function reorderKeyed(newScopes, start, newEnd, parentNode, afterReference) {
|
|
|
1207
1231
|
}
|
|
1208
1232
|
function createBranchWithTagNameOrRenderer($global, tagNameOrRenderer, parentScope, parentNode) {
|
|
1209
1233
|
let branch = createBranch($global, tagNameOrRenderer, parentScope, parentNode);
|
|
1210
|
-
return typeof tagNameOrRenderer == "string"
|
|
1234
|
+
return typeof tagNameOrRenderer == "string" && (branch.a = branch.S = branch.K = document.createElementNS(tagNameOrRenderer === "svg" ? "http://www.w3.org/2000/svg" : tagNameOrRenderer === "math" ? "http://www.w3.org/1998/Math/MathML" : parentNode.namespaceURI, tagNameOrRenderer)), branch;
|
|
1211
1235
|
}
|
|
1212
1236
|
function bySecondArg(_item, index) {
|
|
1213
1237
|
return index;
|
|
@@ -1216,4 +1240,4 @@ function byFirstArg(name) {
|
|
|
1216
1240
|
return name;
|
|
1217
1241
|
}
|
|
1218
1242
|
//#endregion
|
|
1219
|
-
export {
|
|
1243
|
+
export { _attr_style_item as $, destroyBranch as $t, _attr_input_checked_script as A, readyFailed as At, _controllable_open as B, _hoist as Bt, _attr_details_or_dialog_open_default as C, _hoist_read_error as Cn, _el as Ct, _attr_input_checkedValue_default as D, init as Dt, _attr_input_checkedValue as E, getRegisteredWithScope as Et, _attr_input_value_script as F, _const as Ft, _attr as G, _let_change as Gt, _controllable_textarea as H, _id as Ht, _attr_select_value as I, _el_read as It, _attr_class_items as J, _return_change as Jt, _attr_class as K, _or as Kt, _attr_select_value_default as L, _for_closure as Lt, _attr_input_value_attribute_default as M, _child_setup as Mt, _attr_input_value_default as N, _closure as Nt, _attr_input_checkedValue_script as O, initEmbedded as Ot, _attr_input_value_dynamic_default as P, _closure_get as Pt, _attr_style as Q, _assert_init as Qt, _attr_select_value_script as R, _for_selector as Rt, _attr_details_or_dialog_open as S, _assert_hoist as Sn, _dynamic_tag_var_resume as St, _attr_input_checked as T, withBranches as Tn, _var_resume as Tt, controllableRenders as U, _if_closure as Ut, _controllable_select as V, _hoist_resume as Vt, controllableScripts as W, _let as Wt, _attr_content as X, _var as Xt, _attr_class_names as Y, _script as Yt, _attr_nonce as Z, _var_change as Zt, dynamicTagScript as _, forIn as _n, _content_resume as _t, _for_in as a, $signalReset as an, _attrs_script as at, renderCatch as b, forUntil as bn, setParentBranch as bt, _for_to as c, installCatch as cn, _style_rule_item as ct, _for_until_unkeyed as d, queueEffect as dn, _text_content as dt, insertBranchBefore as en, _attr_style_items as et, _if as f, queueRender as fn, _to_text as ft, bindTagVar as g, runId as gn, _content_closures as gt, addAwaitCounter as h, runEffects as hn, _content as ht, _dynamic_tag_content as i, $signal as in, _attrs_partial_content as it, _attr_input_value as j, withLazy as jt, _attr_input_checked_default as k, ready as kt, _for_to_unkeyed as l, prepareEffects as ln, _style_shell as lt, _try as m, run as mn, toInsertNode as mt, _await_promise as n, syncGen as nn, _attrs_content as nt, _for_of as o, createBranchRenders as on, _html as ot, _show as p, rendering as pn, insertChildNodes as pt, _attr_class_item as q, _return as qt, _dynamic_tag as r, _on as rn, _attrs_partial as rt, _for_of_unkeyed as s, installBranchRenders as sn, _lifecycle as st, _await_content as t, removeAndDestroyBranch as tn, _attrs as tt, _for_until as u, queueAsyncRender as un, _text as ut, installDynamicTagVar as v, forOf as vn, createAndSetupBranch as vt, _attr_details_or_dialog_open_script as w, _call as wn, _resumed as wt, runPendingEffects as x, _assert_class_toggles as xn, setupBranch as xt, patchDynamicTag as y, forTo as yn, createBranch as yt, _controllable_input as z, _global_read as zt };
|
package/dist/dom.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { _await_content, _await_promise, _dynamic_tag, _dynamic_tag_content, _fo
|
|
|
8
8
|
export { _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checked_default, _attr_input_checked_script, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_input_value as _attr_textarea_value, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_script as _attr_textarea_value_script, _controllable_input, _controllable_open, _controllable_select, _controllable_textarea, } from "./dom/controllable";
|
|
9
9
|
export { _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_class_names, _attr_content, _attr_nonce, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _html, _lifecycle, _style_rule_item, _style_shell, _text, _text_content, _to_text, } from "./dom/dom";
|
|
10
10
|
export { _on } from "./dom/event";
|
|
11
|
-
export { _load_event_trigger, _load_idle_trigger, _load_media_trigger, _load_race_trigger, _load_setup, _load_signal, _load_template, _load_visible_trigger, } from "./dom/load";
|
|
11
|
+
export { _load_event_trigger, _load_idle_trigger, _load_media_trigger, _load_race_trigger, _load_setup, _load_setup_var, _load_signal, _load_template, _load_visible_trigger, } from "./dom/load";
|
|
12
12
|
export { run } from "./dom/queue";
|
|
13
13
|
export { _content, _content_closures, _content_resume } from "./dom/renderer";
|
|
14
14
|
export { _dynamic_tag_var_resume, _el, _resumed, _var_resume, init, initEmbedded, ready, readyFailed, } from "./dom/resume";
|
package/dist/dom.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
let require_control_flow = require("./dom-
|
|
3
|
-
require_control_flow.
|
|
2
|
+
let require_control_flow = require("./dom-CtIT8Mpr.js"), empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), classEventResolver, scopesByRender = /* @__PURE__ */ new WeakMap(), getRenderScopes = ($global) => {
|
|
3
|
+
require_control_flow.Dt($global.runtimeId);
|
|
4
4
|
let render = self[$global.runtimeId]?.[$global.renderId], scopes = render && scopesByRender.get(render);
|
|
5
5
|
return render && !scopes && scopesByRender.set(render, scopes = {}), scopes;
|
|
6
6
|
}, compat = {
|
|
7
|
-
patchDynamicTag: require_control_flow.
|
|
8
|
-
queueEffect: require_control_flow.
|
|
7
|
+
patchDynamicTag: require_control_flow.y,
|
|
8
|
+
queueEffect: require_control_flow.dn,
|
|
9
9
|
init(warp10Noop) {
|
|
10
|
-
require_control_flow.
|
|
10
|
+
require_control_flow.wt.$C_s = (scope) => {
|
|
11
11
|
if (getRenderScopes(scope.$)[scope.L] = scope, scope.m5c && classIdToBranch.set(scope.m5c, scope), classEventResolver) for (let key in scope) {
|
|
12
12
|
let resolved = classEventResolver(scope[key], scope);
|
|
13
13
|
resolved !== scope[key] && (scope[key] = resolved);
|
|
14
14
|
}
|
|
15
|
-
}, require_control_flow.
|
|
15
|
+
}, require_control_flow.wt.$C_b = warp10Noop;
|
|
16
16
|
},
|
|
17
17
|
setClassEventResolver(fn) {
|
|
18
18
|
classEventResolver = fn;
|
|
19
19
|
},
|
|
20
20
|
resumeClassFunction(id, build) {
|
|
21
|
-
require_control_flow.
|
|
21
|
+
require_control_flow.wt[id] = build;
|
|
22
22
|
},
|
|
23
23
|
getScope($global, scopeId) {
|
|
24
24
|
return getRenderScopes($global)?.[scopeId];
|
|
@@ -39,36 +39,36 @@ let require_control_flow = require("./dom-B8UEYzOz.js"), empty = [], rest = Symb
|
|
|
39
39
|
branch.S = startNode, branch.K = endNode;
|
|
40
40
|
},
|
|
41
41
|
runComponentEffects() {
|
|
42
|
-
this.effects && require_control_flow.
|
|
42
|
+
this.effects && require_control_flow.hn(this.effects);
|
|
43
43
|
},
|
|
44
44
|
runComponentDestroy() {
|
|
45
|
-
this.scope && require_control_flow
|
|
45
|
+
this.scope && require_control_flow.$t(this.scope);
|
|
46
46
|
},
|
|
47
47
|
resolveRegistered(value, $global) {
|
|
48
|
-
return Array.isArray(value) && typeof value[0] == "string" ? require_control_flow.
|
|
48
|
+
return Array.isArray(value) && typeof value[0] == "string" ? require_control_flow.Et(value[0], getRenderScopes($global)?.[value[1]]) : value;
|
|
49
49
|
},
|
|
50
50
|
createRenderer(params, clone) {
|
|
51
|
-
let renderer = require_control_flow.
|
|
51
|
+
let renderer = require_control_flow.ht("", 0, 0, 0, params)();
|
|
52
52
|
return renderer.b = (branch) => {
|
|
53
53
|
let cloned = clone();
|
|
54
54
|
branch.S = cloned.startNode, branch.K = cloned.endNode;
|
|
55
55
|
}, renderer;
|
|
56
56
|
},
|
|
57
57
|
render(out, component, renderer, args) {
|
|
58
|
-
require_control_flow.
|
|
58
|
+
require_control_flow.Dt(out.global.runtimeId);
|
|
59
59
|
let branch = component.scope, created = 0;
|
|
60
60
|
if (!branch && (branch = classIdToBranch.get(component.id)) && (component.scope = branch, classIdToBranch.delete(component.id)), args[0] && typeof args[0] == "object" && "renderBody" in args[0]) {
|
|
61
61
|
let input = args[0], normalizedInput = args[0] = {};
|
|
62
62
|
for (let key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
|
|
63
63
|
}
|
|
64
64
|
let renderBranch = () => {
|
|
65
|
-
branch ||= (created = 1, component.scope = require_control_flow.
|
|
65
|
+
branch ||= (created = 1, component.scope = require_control_flow.vt(out.global, renderer, renderer.e, document.body)), renderer.d?.(branch, renderer._ ? args[0] : args);
|
|
66
66
|
};
|
|
67
|
-
if (component.effects = require_control_flow.
|
|
67
|
+
if (component.effects = require_control_flow.pn ? renderBranch() : require_control_flow.ln(renderBranch), created) return require_control_flow.mt(branch.S, branch.K);
|
|
68
68
|
}
|
|
69
69
|
}, _template = (id, template, walks, setup, inputSignal) => {
|
|
70
|
-
let renderer = require_control_flow.
|
|
71
|
-
return renderer.mount = mount, renderer._ = renderer, require_control_flow.
|
|
70
|
+
let renderer = require_control_flow.ht(id, template, walks, setup, inputSignal)();
|
|
71
|
+
return renderer.mount = mount, renderer._ = renderer, require_control_flow.wt[id] = renderer;
|
|
72
72
|
}, noop = (_) => 0;
|
|
73
73
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
74
74
|
//#region src/common/attr-tag.ts
|
|
@@ -105,25 +105,25 @@ function mount(input = {}, reference, position) {
|
|
|
105
105
|
break;
|
|
106
106
|
case "afterend": parentNode = reference.parentNode, nextSibling = reference.nextSibling;
|
|
107
107
|
}
|
|
108
|
-
let curValue, args = this.d, effects = require_control_flow.
|
|
109
|
-
branch = require_control_flow.
|
|
108
|
+
let curValue, args = this.d, effects = require_control_flow.ln(() => {
|
|
109
|
+
branch = require_control_flow.yt($global, this, void 0, parentNode), branch.T = (newValue) => {
|
|
110
110
|
curValue = newValue;
|
|
111
111
|
}, this.c?.(branch), args?.(branch, input);
|
|
112
112
|
});
|
|
113
|
-
return require_control_flow.
|
|
113
|
+
return require_control_flow.pt(parentNode, nextSibling, branch.S, branch.K), require_control_flow.hn(effects), {
|
|
114
114
|
get value() {
|
|
115
115
|
return curValue;
|
|
116
116
|
},
|
|
117
117
|
set value(newValue) {
|
|
118
|
-
require_control_flow.
|
|
118
|
+
require_control_flow.Zt(branch, newValue);
|
|
119
119
|
},
|
|
120
120
|
update(newInput = {}) {
|
|
121
|
-
args && (newInput.$global && ({$global, ...newInput} = newInput), require_control_flow.
|
|
121
|
+
args && (newInput.$global && ({$global, ...newInput} = newInput), require_control_flow.hn(require_control_flow.ln(() => {
|
|
122
122
|
args(branch, newInput);
|
|
123
123
|
})));
|
|
124
124
|
},
|
|
125
125
|
destroy() {
|
|
126
|
-
require_control_flow
|
|
126
|
+
require_control_flow.tn(branch);
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
129
|
}
|
|
@@ -133,7 +133,7 @@ function _load_template(id, load) {
|
|
|
133
133
|
let pending, lazyTemplate = _template(id, 0, 0, (branch) => {
|
|
134
134
|
let awaitCounter = require_control_flow.h(branch);
|
|
135
135
|
branch.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((renderer) => {
|
|
136
|
-
Object.assign(lazyTemplate, renderer), require_control_flow.
|
|
136
|
+
Object.assign(lazyTemplate, renderer), require_control_flow.un(branch, (branch) => insertLoaded(renderer, branch, branch.S, awaitCounter));
|
|
137
137
|
}, loadFailed(branch, awaitCounter));
|
|
138
138
|
}, _load_signal(() => (pending ||= load()).then((r) => ({ _: r.d || noop }))));
|
|
139
139
|
return lazyTemplate;
|
|
@@ -141,37 +141,43 @@ function _load_template(id, load) {
|
|
|
141
141
|
function _load_setup(load) {
|
|
142
142
|
let pending, renderer, insertCached = (child, marker) => insertLoaded(renderer, child, marker);
|
|
143
143
|
return (owner, child, marker) => {
|
|
144
|
-
if (renderer) require_control_flow.
|
|
144
|
+
if (renderer) require_control_flow.fn(child, insertCached, -1, marker);
|
|
145
145
|
else {
|
|
146
146
|
let awaitCounter = require_control_flow.h(owner);
|
|
147
147
|
child.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((mod) => {
|
|
148
|
-
renderer ||= require_control_flow.
|
|
148
|
+
renderer ||= require_control_flow.ht("", ...mod._)(), require_control_flow.un(child, (child) => insertLoaded(renderer, child, marker, awaitCounter));
|
|
149
149
|
}, loadFailed(child, awaitCounter));
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
|
+
function _load_setup_var(load) {
|
|
154
|
+
let setup = _load_setup(load);
|
|
155
|
+
return (owner, child, marker) => {
|
|
156
|
+
require_control_flow.bt(child, child.F), require_control_flow.g(owner, child, child.L), setup(owner, child, marker);
|
|
157
|
+
};
|
|
158
|
+
}
|
|
153
159
|
function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
154
160
|
let parent = () => marker.parentNode, values = branch.X, clone = () => {
|
|
155
|
-
require_control_flow.
|
|
161
|
+
require_control_flow.nn(branch), renderer.b(branch, parent().namespaceURI), branch.X = 0;
|
|
156
162
|
}, insert = () => {
|
|
157
|
-
require_control_flow.
|
|
163
|
+
require_control_flow.en(branch, parent(), marker), marker.remove(), awaitCounter?.c();
|
|
158
164
|
}, remaining;
|
|
159
165
|
if (remaining = values?.size) {
|
|
160
166
|
awaitCounter ||= require_control_flow.h(branch);
|
|
161
167
|
let fail = loadFailed(branch, awaitCounter);
|
|
162
|
-
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && require_control_flow.
|
|
168
|
+
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && require_control_flow.un(branch, (branch) => {
|
|
163
169
|
clone(), renderer.c?.(branch), values.forEach(([value, apply]) => apply(branch, value)), insert();
|
|
164
170
|
}), (error) => remaining > 0 && (remaining = 0, fail(error))));
|
|
165
|
-
} else clone(), require_control_flow.
|
|
171
|
+
} else clone(), require_control_flow.xt(renderer, branch), insert();
|
|
166
172
|
}
|
|
167
173
|
function loadFailed(scope, awaitCounter) {
|
|
168
174
|
return (error) => {
|
|
169
|
-
awaitCounter && (awaitCounter.m ? awaitCounter.i = 0 : awaitCounter.i && awaitCounter.c()), require_control_flow.
|
|
175
|
+
awaitCounter && (awaitCounter.m ? awaitCounter.i = 0 : awaitCounter.i && awaitCounter.c()), require_control_flow.un(scope, require_control_flow.b, error);
|
|
170
176
|
};
|
|
171
177
|
}
|
|
172
178
|
function _load_signal(load) {
|
|
173
179
|
let pending, apply = (scope, value) => {
|
|
174
|
-
pending ||= load(), scope.X || !("X" in scope) && scope.H === require_control_flow.
|
|
180
|
+
pending ||= load(), scope.X || !("X" in scope) && scope.H === require_control_flow.gn ? (scope.X ||= /* @__PURE__ */ new Map()).set(pending, [value, apply]) : apply._ ? apply._(scope, value) : pending.then((mod) => require_control_flow.un(scope, apply._ = mod._, value), noop);
|
|
175
181
|
};
|
|
176
182
|
return apply;
|
|
177
183
|
}
|
|
@@ -198,9 +204,9 @@ function _load_race_trigger(...triggers) {
|
|
|
198
204
|
function getSelectorOrResolve(selector, resolve) {
|
|
199
205
|
return document.querySelector(selector) || resolve();
|
|
200
206
|
}
|
|
201
|
-
exports.$signal = require_control_flow.
|
|
207
|
+
exports.$signal = require_control_flow.in, exports.$signalReset = require_control_flow.an, exports._assert_class_toggles = require_control_flow.xn, exports._assert_hoist = require_control_flow.Sn, exports._assert_init = require_control_flow.Qt, exports._attr = require_control_flow.G, exports._attr_class = require_control_flow.K, exports._attr_class_item = require_control_flow.q, exports._attr_class_items = require_control_flow.J, exports._attr_class_names = require_control_flow.Y, exports._attr_content = require_control_flow.X, exports._attr_details_open = require_control_flow.S, exports._attr_dialog_open = require_control_flow.S, exports._attr_details_open_default = require_control_flow.C, exports._attr_dialog_open_default = require_control_flow.C, exports._attr_details_open_script = require_control_flow.w, exports._attr_dialog_open_script = require_control_flow.w, exports._attr_input_checked = require_control_flow.T, exports._attr_input_checkedValue = require_control_flow.E, exports._attr_input_checkedValue_default = require_control_flow.D, exports._attr_input_checkedValue_script = require_control_flow.O, exports._attr_input_checked_default = require_control_flow.k, exports._attr_input_checked_script = require_control_flow.A, exports._attr_input_value = require_control_flow.j, exports._attr_textarea_value = require_control_flow.j, exports._attr_input_value_attribute_default = require_control_flow.M, exports._attr_input_value_default = require_control_flow.N, exports._attr_textarea_value_default = require_control_flow.N, exports._attr_input_value_dynamic_default = require_control_flow.P, exports._attr_input_value_script = require_control_flow.F, exports._attr_textarea_value_script = require_control_flow.F, exports._attr_nonce = require_control_flow.Z, exports._attr_select_value = require_control_flow.I, exports._attr_select_value_default = require_control_flow.L, exports._attr_select_value_script = require_control_flow.R, exports._attr_style = require_control_flow.Q, exports._attr_style_item = require_control_flow.$, exports._attr_style_items = require_control_flow.et, exports._attrs = require_control_flow.tt, exports._attrs_content = require_control_flow.nt, exports._attrs_partial = require_control_flow.rt, exports._attrs_partial_content = require_control_flow.it, exports._attrs_script = require_control_flow.at, exports._await_content = require_control_flow.t, exports._await_promise = require_control_flow.n, exports._call = require_control_flow.wn, exports._child_setup = require_control_flow.Mt, exports._closure = require_control_flow.Nt, exports._closure_get = require_control_flow.Pt, exports._const = require_control_flow.Ft, exports._content = require_control_flow.ht, exports._content_closures = require_control_flow.gt, exports._content_resume = require_control_flow._t, exports._controllable_input = require_control_flow.z, exports._controllable_open = require_control_flow.B, exports._controllable_select = require_control_flow.V, exports._controllable_textarea = require_control_flow.H, Object.defineProperty(exports, "_dynamic_tag", {
|
|
202
208
|
enumerable: !0,
|
|
203
209
|
get: function() {
|
|
204
210
|
return require_control_flow.r;
|
|
205
211
|
}
|
|
206
|
-
}), exports._dynamic_tag_content = require_control_flow.i, exports._dynamic_tag_var_resume = require_control_flow.
|
|
212
|
+
}), exports._dynamic_tag_content = require_control_flow.i, exports._dynamic_tag_var_resume = require_control_flow.St, exports._el = require_control_flow.Ct, exports._el_read = require_control_flow.It, exports._for_closure = require_control_flow.Lt, exports._for_in = require_control_flow.a, exports._for_of = require_control_flow.o, exports._for_of_unkeyed = require_control_flow.s, exports._for_selector = require_control_flow.Rt, exports._for_to = require_control_flow.c, exports._for_to_unkeyed = require_control_flow.l, exports._for_until = require_control_flow.u, exports._for_until_unkeyed = require_control_flow.d, exports._global_read = require_control_flow.zt, exports._hoist = require_control_flow.Bt, exports._hoist_read_error = require_control_flow.Cn, exports._hoist_resume = require_control_flow.Vt, exports._html = require_control_flow.ot, exports._id = require_control_flow.Ht, exports._if = require_control_flow.f, exports._if_closure = require_control_flow.Ut, exports._let = require_control_flow.Wt, exports._let_change = require_control_flow.Gt, exports._lifecycle = require_control_flow.st, 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_setup_var = _load_setup_var, exports._load_signal = _load_signal, exports._load_template = _load_template, exports._load_visible_trigger = _load_visible_trigger, exports._on = require_control_flow.rn, exports._or = require_control_flow.Kt, exports._resumed = require_control_flow.wt, exports._return = require_control_flow.qt, exports._return_change = require_control_flow.Jt, exports._script = require_control_flow.Yt, exports._show = require_control_flow.p, exports._style_rule_item = require_control_flow.ct, exports._style_shell = require_control_flow.lt, exports._template = _template, exports._text = require_control_flow.ut, exports._text_content = require_control_flow.dt, exports._to_text = require_control_flow.ft, exports._try = require_control_flow.m, exports._var = require_control_flow.Xt, exports._var_change = require_control_flow.Zt, exports._var_resume = require_control_flow.Tt, exports.attrTag = attrTag, exports.attrTags = attrTags, exports.compat = compat, exports.forIn = require_control_flow._n, exports.forOf = require_control_flow.vn, exports.forTo = require_control_flow.yn, exports.forUntil = require_control_flow.bn, exports.init = require_control_flow.Dt, exports.initEmbedded = require_control_flow.Ot, exports.ready = require_control_flow.kt, exports.readyFailed = require_control_flow.At, exports.run = require_control_flow.mn;
|
package/dist/dom.mjs
CHANGED
|
@@ -69,7 +69,7 @@ let empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), cl
|
|
|
69
69
|
let renderer = _content(id, template, walks, setup, inputSignal)();
|
|
70
70
|
return renderer.mount = mount, renderer._ = renderer, _resumed[id] = renderer;
|
|
71
71
|
}, noop = (_) => 0;
|
|
72
|
-
import { $ as
|
|
72
|
+
import { $ as _attr_style_item, $t as destroyBranch, A as _attr_input_checked_script, At as readyFailed, B as _controllable_open, Bt as _hoist, C as _attr_details_or_dialog_open_default, Cn as _hoist_read_error, Ct as _el, D as _attr_input_checkedValue_default, Dt as init, E as _attr_input_checkedValue, Et as getRegisteredWithScope, F as _attr_input_value_script, Ft as _const, G as _attr, Gt as _let_change, H as _controllable_textarea, Ht as _id, I as _attr_select_value, It as _el_read, J as _attr_class_items, Jt as _return_change, K as _attr_class, Kt as _or, L as _attr_select_value_default, Lt as _for_closure, M as _attr_input_value_attribute_default, Mt as _child_setup, N as _attr_input_value_default, Nt as _closure, O as _attr_input_checkedValue_script, Ot as initEmbedded, P as _attr_input_value_dynamic_default, Pt as _closure_get, Q as _attr_style, Qt as _assert_init, R as _attr_select_value_script, Rt as _for_selector, S as _attr_details_or_dialog_open, Sn as _assert_hoist, St as _dynamic_tag_var_resume, T as _attr_input_checked, Tt as _var_resume, Ut as _if_closure, V as _controllable_select, Vt as _hoist_resume, Wt as _let, X as _attr_content, Xt as _var, Y as _attr_class_names, Yt as _script, Z as _attr_nonce, Zt as _var_change, _n as forIn, _t as _content_resume, a as _for_in, an as $signalReset, at as _attrs_script, b as renderCatch, bn as forUntil, bt as setParentBranch, c as _for_to, ct as _style_rule_item, d as _for_until_unkeyed, dn as queueEffect, dt as _text_content, en as insertBranchBefore, et as _attr_style_items, f as _if, fn as queueRender, ft as _to_text, g as bindTagVar, gn as runId, gt as _content_closures, h as addAwaitCounter, hn as runEffects, ht as _content, i as _dynamic_tag_content, in as $signal, it as _attrs_partial_content, j as _attr_input_value, k as _attr_input_checked_default, kt as ready, l as _for_to_unkeyed, ln as prepareEffects, lt as _style_shell, m as _try, mn as run, mt as toInsertNode, n as _await_promise, nn as syncGen, nt as _attrs_content, o as _for_of, ot as _html, p as _show, pn as rendering, pt as insertChildNodes, q as _attr_class_item, qt as _return, r as _dynamic_tag, rn as _on, rt as _attrs_partial, s as _for_of_unkeyed, st as _lifecycle, t as _await_content, tn as removeAndDestroyBranch, tt as _attrs, u as _for_until, un as queueAsyncRender, ut as _text, vn as forOf, vt as createAndSetupBranch, w as _attr_details_or_dialog_open_script, wn as _call, wt as _resumed, xn as _assert_class_toggles, xt as setupBranch, y as patchDynamicTag, yn as forTo, yt as createBranch, z as _controllable_input, zt as _global_read } from "./dom-DHg9YChM.mjs";
|
|
73
73
|
//#region src/common/attr-tag.ts
|
|
74
74
|
function attrTag(attrs) {
|
|
75
75
|
return attrs[Symbol.iterator] = attrTagIterator, attrs[rest] = empty, attrs;
|
|
@@ -149,6 +149,12 @@ function _load_setup(load) {
|
|
|
149
149
|
}
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
|
+
function _load_setup_var(load) {
|
|
153
|
+
let setup = _load_setup(load);
|
|
154
|
+
return (owner, child, marker) => {
|
|
155
|
+
setParentBranch(child, child.F), bindTagVar(owner, child, child.L), setup(owner, child, marker);
|
|
156
|
+
};
|
|
157
|
+
}
|
|
152
158
|
function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
153
159
|
let parent = () => marker.parentNode, values = branch.X, clone = () => {
|
|
154
160
|
syncGen(branch), renderer.b(branch, parent().namespaceURI), branch.X = 0;
|
|
@@ -198,4 +204,4 @@ function getSelectorOrResolve(selector, resolve) {
|
|
|
198
204
|
return document.querySelector(selector) || resolve();
|
|
199
205
|
}
|
|
200
206
|
//#endregion
|
|
201
|
-
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, _child_setup, _closure, _closure_get, _const, _content, _content_closures, _content_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, _script, _show, _style_rule_item, _style_shell, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, init, initEmbedded, ready, readyFailed, run };
|
|
207
|
+
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, _child_setup, _closure, _closure_get, _const, _content, _content_closures, _content_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_setup_var, _load_signal, _load_template, _load_visible_trigger, _on, _or, _resumed, _return, _return_change, _script, _show, _style_rule_item, _style_shell, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, init, initEmbedded, ready, readyFailed, run };
|
package/dist/html/writer.d.ts
CHANGED
package/dist/html.js
CHANGED
|
@@ -268,7 +268,7 @@ let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeSty
|
|
|
268
268
|
} else {
|
|
269
269
|
let chunk = getChunk(), beforeBranch = shouldResume ? deferBranchStart(chunk) : void 0, render = () => {
|
|
270
270
|
if (renderer) try {
|
|
271
|
-
return _set_scope_reason(shouldResume
|
|
271
|
+
return _set_scope_reason(shouldResume ? CLIENT_ALL : 0), inputIsArgs ? renderer(...inputOrArgs) : renderer(content ? {
|
|
272
272
|
...inputOrArgs,
|
|
273
273
|
content
|
|
274
274
|
} : inputOrArgs);
|
|
@@ -277,7 +277,7 @@ let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeSty
|
|
|
277
277
|
}
|
|
278
278
|
else if (content) return content();
|
|
279
279
|
};
|
|
280
|
-
result = shouldResume ? withBranchId(branchId, render) : render(), rendered = _peek_scope_id() !== branchId, beforeBranch !== void 0 && (applyBranchStart(chunk, beforeBranch, rendered), _html(state.mark("]", scopeId + " " + accessor + (rendered ? " " + branchId : ""))));
|
|
280
|
+
result = shouldResume ? withBranchId(branchId, render) : render(), rendered = _peek_scope_id() !== branchId, beforeBranch !== void 0 && (applyBranchStart(chunk, beforeBranch, rendered), _html(state.mark("]", scopeId + " " + accessor + (rendered ? " " + branchId : ""))), renderer && _existing_scope(branchId));
|
|
281
281
|
}
|
|
282
282
|
return rendered ? shouldResume && writeScope(scopeId, { ["D" + accessor]: rendererKey(renderer) }) : _scope_id(), result;
|
|
283
283
|
}, patchDynamicTag = /* @__PURE__ */ ((originalDynamicTag) => (patch) => {
|
|
@@ -1588,7 +1588,12 @@ function _resume_branch(scopeId) {
|
|
|
1588
1588
|
}
|
|
1589
1589
|
function _attr_content(nodeAccessor, scopeId, content, markerGuard) {
|
|
1590
1590
|
let shouldResume = markerGuard !== 0, render = normalizeServerRender(content), branchId = _peek_scope_id();
|
|
1591
|
-
|
|
1591
|
+
if (render) try {
|
|
1592
|
+
_set_scope_reason(shouldResume ? CLIENT_ALL : 0), shouldResume ? withBranchId(branchId, render) : render();
|
|
1593
|
+
} finally {
|
|
1594
|
+
_set_scope_reason(void 0);
|
|
1595
|
+
}
|
|
1596
|
+
_peek_scope_id() === branchId ? _scope_id() : shouldResume && writeScope(scopeId, {
|
|
1592
1597
|
["A" + nodeAccessor]: writeScope(branchId, {}),
|
|
1593
1598
|
["D" + nodeAccessor]: rendererKey(render)
|
|
1594
1599
|
});
|
|
@@ -1796,7 +1801,7 @@ function tryBoundary(content, catchContent, branchId, renderers) {
|
|
|
1796
1801
|
chunk.catchRange = null, renderersAtSettle || catchChunk.render(clearTryRenderers, branchId);
|
|
1797
1802
|
let inOrder = catchChunk === catchChunk.render(catchContent, catchBoundary.reason);
|
|
1798
1803
|
if (boundary.aborted) return;
|
|
1799
|
-
if ((bodyEnd.consumed || !inOrder) && (catchChunk.
|
|
1804
|
+
if ((bodyEnd.consumed || !inOrder) && (catchChunk.reorderBranch = branchId), bodyEnd.consumed) catchChunk.reorderId = reorderId, state.reorder(catchChunk);
|
|
1800
1805
|
else {
|
|
1801
1806
|
let reorder = null;
|
|
1802
1807
|
inOrder ? streamed && (reorder = chunk.fork(boundary, null)) : reorder = catchChunk, reorder && (reorder.reorderId = reorderId);
|
|
@@ -1942,7 +1947,7 @@ var State = class {
|
|
|
1942
1947
|
async = !1;
|
|
1943
1948
|
consumed = !1;
|
|
1944
1949
|
reorderId = null;
|
|
1945
|
-
|
|
1950
|
+
reorderBranch = 0;
|
|
1946
1951
|
deferredReady = null;
|
|
1947
1952
|
heldEffects = null;
|
|
1948
1953
|
deferredReorder = null;
|
|
@@ -2083,15 +2088,20 @@ var State = class {
|
|
|
2083
2088
|
if (state.writeReorders) {
|
|
2084
2089
|
for (let reorderedChunk of state.writeReorders) {
|
|
2085
2090
|
needsWalk = !0, state.hasReorderRuntime || (state.hasReorderRuntime = !0, scripts = concatScripts(scripts, "(e=>{if(e.j)return;let i,l,r,t=e.p={},c=(i,l)=>e.l[i].replaceWith(...l.childNodes);e.j={},e.x=(n,a,d,o,g)=>{d==r&&i(),\"#\"==n?(t[a]=l).i++:\"T\"==d.tagName&&(a=d.getAttribute(e.i))&&(r=d.nextSibling,i=()=>{d.remove(),o||c(a,d),l.c()},l=t[a]||(o=t[a]={i:1,r:a,c(i=e.l[\"^\"+a],f=d.cloneNode()){if(--o.i)return 1;for(;f.prepend(r=e.l[a].previousSibling||i),i!=r;);c(a,d)}}),e.v.push({data:e.i+\"*\"+l.r}),(n=e.j[a])&&(g=l.c,l.c=()=>g()||n(e.r)))}})(" + runtimePrefix + ")"));
|
|
2086
|
-
let { reorderId,
|
|
2091
|
+
let { reorderId, reorderBranch } = reorderedChunk, rootBranch = reorderBranch || +reorderId, readyReservations = [], reorderHTML = "", reorderEffects = "", effectsBoundary = reorderedChunk.boundary, reorderScripts = "", cur = reorderedChunk.boundary.aborted ? null : reorderedChunk;
|
|
2087
2092
|
for (reorderedChunk.reorderId = null; cur;) {
|
|
2088
2093
|
cur.markCatchRange(), cur.queueDeferredReorder(), cur.deferOwnReady();
|
|
2089
2094
|
let { next } = cur, readyResumeScripts = cur.flushReadyScripts(boundary, readyReservations, this.async);
|
|
2090
|
-
this.deferredReady = concat(this.deferredReady, cur.takeDeferredReady()), cur.consumed = !0, reorderHTML += cur.html, this.async && cur.effects && cur.boundary !== effectsBoundary && (reorderEffects &&= (holdReorderEffects(this, effectsBoundary, reorderEffects), ""), effectsBoundary = cur.boundary), reorderEffects = concatEffects(reorderEffects, cur.effects), reorderScripts = concatScripts(reorderScripts, concatScripts(readyResumeScripts, cur.scripts)), cur.async
|
|
2095
|
+
if (this.deferredReady = concat(this.deferredReady, cur.takeDeferredReady()), cur.consumed = !0, reorderHTML += cur.html, this.async && cur.effects && cur.boundary !== effectsBoundary && (reorderEffects &&= (holdReorderEffects(this, effectsBoundary, reorderEffects), ""), effectsBoundary = cur.boundary), reorderEffects = concatEffects(reorderEffects, cur.effects), reorderScripts = concatScripts(reorderScripts, concatScripts(readyResumeScripts, cur.scripts)), cur.async) {
|
|
2096
|
+
reorderHTML += state.mark("#", cur.reorderId = state.nextReorderId());
|
|
2097
|
+
let holeBranch = cur.context?.[kBranchId];
|
|
2098
|
+
cur.reorderBranch = holeBranch > rootBranch ? holeBranch : reorderBranch, (cur.boundary.pendingReorders ||= /* @__PURE__ */ new Set()).add(cur), cur.html = cur.effects = cur.scripts = cur.lastEffect = "", cur.next = null;
|
|
2099
|
+
}
|
|
2100
|
+
cur = next;
|
|
2091
2101
|
}
|
|
2092
2102
|
reorderEffects && (this.async ? holdReorderEffects(this, effectsBoundary, reorderEffects) : (needsResumeArray = !0, reorderScripts = concatScripts(reorderScripts, "_.push(\"" + reorderEffects + "\")")));
|
|
2093
2103
|
for (let reservation of readyReservations) reordered = concatScripts(reordered, reservation);
|
|
2094
|
-
reordered = concatScripts(reordered, reorderScripts && runtimePrefix + ".j" + toAccess(reorderId) + "=_=>{" + reorderScripts + "}"), html += "<t hidden " + state.commentPrefix + "=" + reorderId + ">" +
|
|
2104
|
+
reordered = concatScripts(reordered, reorderScripts && runtimePrefix + ".j" + toAccess(reorderId) + "=_=>{" + reorderScripts + "}"), html += "<t hidden " + state.commentPrefix + "=" + reorderId + ">" + (reorderBranch ? state.mark("*", reorderBranch + "") : "") + reorderHTML + "</t>";
|
|
2095
2105
|
}
|
|
2096
2106
|
state.writeReorders = null;
|
|
2097
2107
|
}
|