marko 6.4.1 → 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/cheatsheet.md +1 -1
- package/dist/common/constants/accessor-prop.d.ts +1 -0
- package/dist/common/constants/accessor-prop.debug.d.ts +1 -0
- package/dist/common/errors.d.ts +1 -0
- package/dist/common/opt.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-ClV4kVOO.js → dom-C7F3yZTh.js} +119 -24
- package/dist/debug/{dom-LFrKxOk5.mjs → dom-uEY0J_H9.mjs} +78 -25
- package/dist/debug/dom.js +16 -4
- package/dist/debug/dom.mjs +14 -5
- package/dist/debug/html.js +288 -78
- package/dist/debug/html.mjs +288 -79
- 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/dom.d.ts +1 -0
- 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-CNglVi8P.js → dom-CtIT8Mpr.js} +201 -138
- package/dist/{dom-DfP3MCo0.mjs → dom-DHg9YChM.mjs} +60 -27
- package/dist/dom.d.ts +3 -3
- package/dist/dom.js +41 -34
- package/dist/dom.mjs +12 -5
- package/dist/html/assets.d.ts +12 -6
- package/dist/html/attrs.d.ts +1 -0
- package/dist/html/compat.d.ts +10 -2
- package/dist/html/serializer.d.ts +1 -0
- package/dist/html/writer.d.ts +8 -0
- package/dist/html.d.ts +1 -1
- package/dist/html.js +207 -62
- package/dist/html.mjs +207 -62
- package/dist/translator/index.js +432 -213
- package/dist/translator/util/bindings.d.ts +9 -1
- package/dist/translator/util/constants/structure-kind.d.ts +1 -0
- package/dist/translator/util/known-tag.d.ts +2 -1
- package/dist/translator/util/module-read.d.ts +21 -0
- package/dist/translator/util/references.d.ts +1 -0
- package/dist/translator/util/runtime.d.ts +2 -0
- package/dist/translator/util/sections.d.ts +5 -1
- package/dist/translator/util/structure.d.ts +1 -0
- package/package.json +3 -3
- 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) => {
|
|
@@ -174,6 +183,9 @@ function withBranches(runtime) {
|
|
|
174
183
|
function withDynamicHtml(runtime) {
|
|
175
184
|
return dynamicHtmlEnabled = 1, runtime;
|
|
176
185
|
}
|
|
186
|
+
//#endregion
|
|
187
|
+
//#region src/common/errors.ts
|
|
188
|
+
function _assert_class_toggles(classes, toggles) {}
|
|
177
189
|
function _hoist_read_error() {}
|
|
178
190
|
function _assert_hoist(value) {}
|
|
179
191
|
//#endregion
|
|
@@ -211,14 +223,30 @@ function queueRender(scope, signal, signalKey, value, scopeKey = scope.L) {
|
|
|
211
223
|
}, signalKey >= 0 && (scope[signalKey] = render);
|
|
212
224
|
queuePendingRender(render);
|
|
213
225
|
}
|
|
214
|
-
function
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
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);
|
|
222
250
|
}
|
|
223
251
|
function queueEffect(scope, fn) {
|
|
224
252
|
pendingEffects.push(fn, scope);
|
|
@@ -248,17 +276,17 @@ function prepareEffects(fn) {
|
|
|
248
276
|
function installCatch(catchEffects, wrapRender) {
|
|
249
277
|
catchEnabled = 1, withBranches(), runEffects = catchEffects, runRender = wrapRender(runRender);
|
|
250
278
|
}
|
|
251
|
-
function runRenders() {
|
|
252
|
-
for (;
|
|
253
|
-
let render =
|
|
279
|
+
function runRenders(renders = pendingRenders) {
|
|
280
|
+
for (; renders.length;) {
|
|
281
|
+
let render = renders[0], item = renders.pop();
|
|
254
282
|
if (render !== item) {
|
|
255
|
-
let i = 0, mid =
|
|
283
|
+
let i = 0, mid = renders.length >> 1, key = (renders[0] = item).a;
|
|
256
284
|
for (; i < mid;) {
|
|
257
285
|
let bestChild = (i << 1) + 1, right = bestChild + 1;
|
|
258
|
-
if (right <
|
|
259
|
-
|
|
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;
|
|
260
288
|
}
|
|
261
|
-
|
|
289
|
+
renders[i] = item;
|
|
262
290
|
}
|
|
263
291
|
runRender(render);
|
|
264
292
|
}
|
|
@@ -401,17 +429,16 @@ function _for_closure(ownerLoopNodeAccessor, fn) {
|
|
|
401
429
|
ownerLoopNodeAccessor = decodeAccessor(ownerLoopNodeAccessor);
|
|
402
430
|
let scopeAccessor = "A" + ownerLoopNodeAccessor, ownerSignal = (ownerScope) => {
|
|
403
431
|
let scopes = toArray(ownerScope[scopeAccessor]);
|
|
404
|
-
|
|
432
|
+
queueRender(ownerScope, () => {
|
|
405
433
|
for (let scope of scopes) scope.H > 0 && scope.H < runId && fn(scope);
|
|
406
|
-
}, -1
|
|
434
|
+
}, -1);
|
|
407
435
|
};
|
|
408
436
|
return ownerSignal._ = fn, ownerSignal;
|
|
409
437
|
}
|
|
410
438
|
function _for_selector(ownerLoopNodeAccessor, ownerValueAccessor, keyValueAccessor, fn) {
|
|
411
439
|
ownerLoopNodeAccessor = decodeAccessor(ownerLoopNodeAccessor), ownerValueAccessor = decodeAccessor(ownerValueAccessor), keyValueAccessor !== "M" && (keyValueAccessor = decodeAccessor(keyValueAccessor));
|
|
412
440
|
let scopeAccessor = "A" + ownerLoopNodeAccessor, mapAccessor = "O" + ownerLoopNodeAccessor, prevKeyProp = `_${ownerValueAccessor}`, ownerSignal = (ownerScope) => {
|
|
413
|
-
|
|
414
|
-
if (ownerScope.H < runId && scopes.length) {
|
|
441
|
+
if (ownerScope.H < runId) {
|
|
415
442
|
let nextKey = ownerScope[ownerValueAccessor];
|
|
416
443
|
queueRender(ownerScope, () => {
|
|
417
444
|
let map = keyedScopes(ownerScope, scopeAccessor, mapAccessor, keyValueAccessor);
|
|
@@ -420,7 +447,7 @@ function _for_selector(ownerLoopNodeAccessor, ownerValueAccessor, keyValueAccess
|
|
|
420
447
|
prevScope !== nextScope && (runLiveBranch(prevScope, fn), runLiveBranch(nextScope, fn));
|
|
421
448
|
} else for (let scope of toArray(ownerScope[scopeAccessor])) runLiveBranch(scope, fn);
|
|
422
449
|
map && (map[prevKeyProp] = nextKey);
|
|
423
|
-
}, -1
|
|
450
|
+
}, -1);
|
|
424
451
|
}
|
|
425
452
|
};
|
|
426
453
|
return ownerSignal._ = fn, ownerSignal;
|
|
@@ -718,6 +745,12 @@ function _attr_class_items(element, items) {
|
|
|
718
745
|
function _attr_class_item(element, name, value) {
|
|
719
746
|
element.classList.toggle(name, !!value);
|
|
720
747
|
}
|
|
748
|
+
function _attr_class_names(element, names, value) {
|
|
749
|
+
let start = 0, end;
|
|
750
|
+
do
|
|
751
|
+
end = names.indexOf(" ", start), element.classList.toggle(names.slice(start, end >>> 0), !!value);
|
|
752
|
+
while (start = end + 1);
|
|
753
|
+
}
|
|
721
754
|
function _attr_style(element, value) {
|
|
722
755
|
setAttribute(element, "style", toDelimitedString(value, ";", stringifyStyleObject) || void 0);
|
|
723
756
|
}
|
|
@@ -1174,7 +1207,7 @@ function patchDynamicTag(fn) {
|
|
|
1174
1207
|
_dynamic_tag = fn(_dynamic_tag);
|
|
1175
1208
|
}
|
|
1176
1209
|
function installDynamicTagVar(bind) {
|
|
1177
|
-
|
|
1210
|
+
bindTagVar = bind;
|
|
1178
1211
|
}
|
|
1179
1212
|
function dynamicTagScript(branch) {
|
|
1180
1213
|
_attrs_script(branch, "a");
|
|
@@ -1198,7 +1231,7 @@ function reorderKeyed(newScopes, start, newEnd, parentNode, afterReference) {
|
|
|
1198
1231
|
}
|
|
1199
1232
|
function createBranchWithTagNameOrRenderer($global, tagNameOrRenderer, parentScope, parentNode) {
|
|
1200
1233
|
let branch = createBranch($global, tagNameOrRenderer, parentScope, parentNode);
|
|
1201
|
-
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;
|
|
1202
1235
|
}
|
|
1203
1236
|
function bySecondArg(_item, index) {
|
|
1204
1237
|
return index;
|
|
@@ -1207,4 +1240,4 @@ function byFirstArg(name) {
|
|
|
1207
1240
|
return name;
|
|
1208
1241
|
}
|
|
1209
1242
|
//#endregion
|
|
1210
|
-
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
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export { attrTag, attrTags } from "./common/attr-tag";
|
|
2
|
-
export { _assert_hoist, _hoist_read_error } from "./common/errors";
|
|
2
|
+
export { _assert_class_toggles, _assert_hoist, _hoist_read_error, } from "./common/errors";
|
|
3
3
|
export { forIn, forOf, forTo, forUntil } from "./common/for";
|
|
4
4
|
export { _call } from "./common/helpers";
|
|
5
5
|
export { $signal, $signalReset } from "./dom/abort-signal";
|
|
6
6
|
export { compat } from "./dom/compat";
|
|
7
7
|
export { _await_content, _await_promise, _dynamic_tag, _dynamic_tag_content, _for_in, _for_of, _for_of_unkeyed, _for_to, _for_to_unkeyed, _for_until, _for_until_unkeyed, _if, _show, _try, } from "./dom/control-flow";
|
|
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
|
-
export { _attr, _attr_class, _attr_class_item, _attr_class_items, _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";
|
|
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-CNglVi8P.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,36 +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
|
-
let parent = marker.parentNode, values = branch.X, clone = () => {
|
|
155
|
-
require_control_flow
|
|
160
|
+
let parent = () => marker.parentNode, values = branch.X, clone = () => {
|
|
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) {
|
|
166
|
+
awaitCounter ||= require_control_flow.h(branch);
|
|
160
167
|
let fail = loadFailed(branch, awaitCounter);
|
|
161
|
-
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) => {
|
|
162
169
|
clone(), renderer.c?.(branch), values.forEach(([value, apply]) => apply(branch, value)), insert();
|
|
163
170
|
}), (error) => remaining > 0 && (remaining = 0, fail(error))));
|
|
164
|
-
} else clone(), require_control_flow.
|
|
171
|
+
} else clone(), require_control_flow.xt(renderer, branch), insert();
|
|
165
172
|
}
|
|
166
173
|
function loadFailed(scope, awaitCounter) {
|
|
167
174
|
return (error) => {
|
|
168
|
-
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);
|
|
169
176
|
};
|
|
170
177
|
}
|
|
171
178
|
function _load_signal(load) {
|
|
172
179
|
let pending, apply = (scope, value) => {
|
|
173
|
-
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);
|
|
174
181
|
};
|
|
175
182
|
return apply;
|
|
176
183
|
}
|
|
@@ -197,9 +204,9 @@ function _load_race_trigger(...triggers) {
|
|
|
197
204
|
function getSelectorOrResolve(selector, resolve) {
|
|
198
205
|
return document.querySelector(selector) || resolve();
|
|
199
206
|
}
|
|
200
|
-
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", {
|
|
201
208
|
enumerable: !0,
|
|
202
209
|
get: function() {
|
|
203
210
|
return require_control_flow.r;
|
|
204
211
|
}
|
|
205
|
-
}), 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,13 +149,20 @@ 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
|
-
let parent = marker.parentNode, values = branch.X, clone = () => {
|
|
154
|
-
syncGen(branch), renderer.b(branch, parent.namespaceURI), branch.X = 0;
|
|
159
|
+
let parent = () => marker.parentNode, values = branch.X, clone = () => {
|
|
160
|
+
syncGen(branch), renderer.b(branch, parent().namespaceURI), branch.X = 0;
|
|
155
161
|
}, insert = () => {
|
|
156
|
-
insertBranchBefore(branch, parent, marker), marker.remove(), awaitCounter?.c();
|
|
162
|
+
insertBranchBefore(branch, parent(), marker), marker.remove(), awaitCounter?.c();
|
|
157
163
|
}, remaining;
|
|
158
164
|
if (remaining = values?.size) {
|
|
165
|
+
awaitCounter ||= addAwaitCounter(branch);
|
|
159
166
|
let fail = loadFailed(branch, awaitCounter);
|
|
160
167
|
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && queueAsyncRender(branch, (branch) => {
|
|
161
168
|
clone(), renderer.c?.(branch), values.forEach(([value, apply]) => apply(branch, value)), insert();
|
|
@@ -197,4 +204,4 @@ function getSelectorOrResolve(selector, resolve) {
|
|
|
197
204
|
return document.querySelector(selector) || resolve();
|
|
198
205
|
}
|
|
199
206
|
//#endregion
|
|
200
|
-
export { $signal, $signalReset, _assert_hoist, _assert_init, _attr, _attr_class, _attr_class_item, _attr_class_items, _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/assets.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { $Global, Template } from "../common/types";
|
|
2
2
|
import { type ServerRenderer } from "./template";
|
|
3
|
+
import { type Boundary } from "./writer";
|
|
3
4
|
declare const kAssets: unique symbol;
|
|
4
|
-
declare const
|
|
5
|
-
declare const kDeferIndex: unique symbol;
|
|
5
|
+
declare const kHead: unique symbol;
|
|
6
6
|
export interface VisibleTrigger {
|
|
7
7
|
type: "visible";
|
|
8
8
|
selector: string;
|
|
@@ -31,17 +31,23 @@ export type LoadTrigger = VisibleTrigger | IdleTrigger | MediaTrigger | EventTri
|
|
|
31
31
|
type Trigger = LoadTrigger;
|
|
32
32
|
interface Asset {
|
|
33
33
|
id: string;
|
|
34
|
-
|
|
34
|
+
flush: AssetFlush;
|
|
35
|
+
triggers: Trigger[] | undefined;
|
|
36
|
+
block: string | undefined;
|
|
37
|
+
defer: string | undefined;
|
|
38
|
+
script: string | undefined;
|
|
39
|
+
htmlAt: Boundary | null | undefined;
|
|
40
|
+
scriptAt: Boundary | null | undefined;
|
|
35
41
|
}
|
|
36
42
|
declare module "../common/types" {
|
|
37
43
|
interface $Global {
|
|
38
44
|
[kAssets]?: Asset[];
|
|
39
|
-
[
|
|
40
|
-
[kDeferIndex]?: number;
|
|
45
|
+
[kHead]?: true;
|
|
41
46
|
}
|
|
42
47
|
}
|
|
43
48
|
type AssetFlush = (g: $Global, type: "block" | "defer", asset: string) => string;
|
|
44
|
-
export declare function withLoadAssets(renderer: ServerRenderer, assetId: string, triggers?: Trigger[]): ServerRenderer;
|
|
49
|
+
export declare function withLoadAssets(renderer: ServerRenderer, flush: AssetFlush, assetId: string, triggers?: Trigger[]): ServerRenderer;
|
|
50
|
+
export declare function writeLoadAsset(assetId: string, flush: AssetFlush, triggers?: Trigger[]): void;
|
|
45
51
|
export declare function withPageAssets(template: ServerRenderer & Template, runtime: AssetFlush, assetId: string, runtimeId?: string): Template;
|
|
46
52
|
export declare function _flush_head(): string;
|
|
47
53
|
export {};
|
package/dist/html/attrs.d.ts
CHANGED
|
@@ -22,3 +22,4 @@ export declare function _attrs_content(data: Record<string, unknown>, nodeAccess
|
|
|
22
22
|
export declare function _attrs_partial(data: Record<string, unknown>, skip: Record<string, 1>, nodeAccessor: Accessor, scopeId: number, tagName: string): string;
|
|
23
23
|
export declare function _attrs_partial_content(data: Record<string, unknown>, skip: Record<string, 1>, nodeAccessor: Accessor, scopeId: number, tagName: string, markerGuard?: 1 | 0): void;
|
|
24
24
|
export declare function attrAssignment(value: string): string;
|
|
25
|
+
export declare function escapeDoubleQuotedAttrValue(value: string): string;
|
package/dist/html/compat.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { writeLoadAsset } from "./assets";
|
|
1
2
|
import { register } from "./serializer";
|
|
2
3
|
import type { ServerRenderer } from "./template";
|
|
3
4
|
import { _await, _html, _peek_scope_id, _scope_id, $global, Chunk, getChunk, isInResumedBranch, State, withChunk, writeScript } from "./writer";
|
|
4
5
|
export declare const compat: {
|
|
5
6
|
$global: typeof $global;
|
|
7
|
+
writeLoadAsset: typeof writeLoadAsset;
|
|
6
8
|
fork: typeof _await;
|
|
7
9
|
write: typeof _html;
|
|
8
10
|
writeScript: typeof writeScript;
|
|
@@ -17,9 +19,15 @@ export declare const compat: {
|
|
|
17
19
|
patchDynamicTag: (patch: (tag: unknown, scopeId: number, accessor: import("../common/types").Accessor) => unknown) => void;
|
|
18
20
|
writeSetScopeForComponent(branchId: number, m5c: string, m5i: unknown): void;
|
|
19
21
|
toJSON(): (this: WeakKey) => [registryId: string, scopeId: unknown] | undefined;
|
|
22
|
+
joinChunks(chunks: Chunk[]): Chunk | undefined;
|
|
23
|
+
appendChunks(chunks: Chunk[]): void;
|
|
24
|
+
deferReorders(reorders: Chunk[]): void;
|
|
20
25
|
createChunk($global: any): Chunk;
|
|
21
|
-
flushScript(
|
|
22
|
-
|
|
26
|
+
flushScript(chunk: Chunk, reorders?: Chunk[]): {
|
|
27
|
+
html: string;
|
|
28
|
+
scripts: string;
|
|
29
|
+
};
|
|
30
|
+
render(renderer: ServerRenderer, willRerender: boolean, classAPIOut: any, component: any, input: any, componentScopes: Chunk[], registerChildScope?: boolean, parentChunk?: Chunk): void;
|
|
23
31
|
register: typeof register;
|
|
24
32
|
registerRenderBody(fn: any): void;
|
|
25
33
|
registerClassFunctions(input: any): void;
|
|
@@ -22,6 +22,7 @@ export declare class Serializer {
|
|
|
22
22
|
written(val: WeakKey): boolean;
|
|
23
23
|
takeChannelDeps(): Set<string> | null;
|
|
24
24
|
writeCall(value: unknown, object: unknown, property: string, channel?: SerializeChannel): void;
|
|
25
|
+
dropCall(value: unknown, object: unknown, property: string): boolean;
|
|
25
26
|
}
|
|
26
27
|
export declare function register<T extends WeakKey>(id: string, val: T, scope?: unknown, locals?: Locals): T;
|
|
27
28
|
export declare function getRegistered(val: WeakKey): {
|
package/dist/html/writer.d.ts
CHANGED
|
@@ -38,6 +38,8 @@ export declare function withBranchId<T>(branchId: number, cb: () => T): T;
|
|
|
38
38
|
export declare function withBranchId<T, U>(branchId: number, cb: (value: U) => T, cbValue: U): T;
|
|
39
39
|
export declare function _html(html: string): void;
|
|
40
40
|
export declare function writeScript(script: string): void;
|
|
41
|
+
export declare function catchableBoundary(): Boundary | null;
|
|
42
|
+
export declare function mayDrop(written: Boundary): boolean;
|
|
41
43
|
export declare function _script(scopeId: number, registryId: string, markerGuard?: number): void;
|
|
42
44
|
export declare function _trailers(html: string): void;
|
|
43
45
|
export declare function _resume<T extends WeakKey>(val: T, id: string, scopeId?: number, locals?: Locals): T;
|
|
@@ -131,8 +133,10 @@ export declare class Boundary {
|
|
|
131
133
|
parent?: Boundary;
|
|
132
134
|
aborted: boolean;
|
|
133
135
|
reason: unknown;
|
|
136
|
+
subscribed?: unknown[];
|
|
134
137
|
pendingReorders?: Set<Chunk>;
|
|
135
138
|
children?: Boundary[];
|
|
139
|
+
withinCatch: boolean;
|
|
136
140
|
constructor(state: State, signal?: AbortSignal, parent?: Boundary);
|
|
137
141
|
abort(reason: unknown): void;
|
|
138
142
|
handleEvent(event: Event): void;
|
|
@@ -148,7 +152,9 @@ export declare class Chunk {
|
|
|
148
152
|
async: boolean;
|
|
149
153
|
consumed: boolean;
|
|
150
154
|
reorderId: string | null;
|
|
155
|
+
reorderBranch: number;
|
|
151
156
|
deferredReady: Opt<Chunk>;
|
|
157
|
+
heldEffects: Opt<Chunk>;
|
|
152
158
|
deferredReorder: Chunk | null;
|
|
153
159
|
catchRange: {
|
|
154
160
|
id: string;
|
|
@@ -171,6 +177,7 @@ export declare class Chunk {
|
|
|
171
177
|
writeEffect(scopeId: number, registryId: string): void;
|
|
172
178
|
writeScript(script: string): void;
|
|
173
179
|
append(chunk: Chunk): void;
|
|
180
|
+
takeHeldEffects(): Opt<Chunk>;
|
|
174
181
|
takeDeferredReady(): Opt<Chunk>;
|
|
175
182
|
deferOwnReady(): void;
|
|
176
183
|
renderPlaceholders(boundary: Boundary): void;
|
|
@@ -184,6 +191,7 @@ export declare class Chunk {
|
|
|
184
191
|
flushScript(boundary: Boundary): this;
|
|
185
192
|
flushHTML(boundary: Boundary): string;
|
|
186
193
|
}
|
|
194
|
+
export declare function joinHeldEffects(heldEffects: Opt<Chunk>, effects: string): string;
|
|
187
195
|
type QueueCallback = (ticked: true) => void;
|
|
188
196
|
export declare function queueTick(cb: QueueCallback): void;
|
|
189
197
|
export declare function offTick(cb: QueueCallback): void;
|