marko 6.4.0 → 6.4.2
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 +2 -2
- package/dist/common/constants/accessor-prefix.d.ts +1 -0
- package/dist/common/constants/accessor-prefix.debug.d.ts +1 -0
- package/dist/common/constants/reserved-id.d.ts +5 -0
- package/dist/common/errors.d.ts +2 -1
- package/dist/common/opt.d.ts +1 -0
- package/dist/common/types.d.ts +3 -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 +1 -1
- package/dist/debug/dom/dynamic-tag-var.feat.mjs +1 -1
- package/dist/debug/dom/lazy.feat.js +1 -1
- package/dist/debug/dom/lazy.feat.mjs +1 -1
- package/dist/debug/dom/placeholder.feat.js +1 -1
- package/dist/debug/dom/placeholder.feat.mjs +1 -1
- package/dist/debug/{dom-BRO5aArp.js → dom-BLbR0hEx.js} +62 -16
- package/dist/debug/{dom-Btj2QJhk.mjs → dom-Cii0IA92.mjs} +51 -17
- package/dist/debug/dom.js +7 -4
- package/dist/debug/dom.mjs +6 -5
- package/dist/debug/html.js +551 -292
- package/dist/debug/html.mjs +548 -290
- package/dist/dom/catch.feat.js +3 -3
- package/dist/dom/catch.feat.mjs +1 -1
- package/dist/dom/controllable-input.feat.js +1 -1
- package/dist/dom/controllable-input.feat.mjs +1 -1
- package/dist/dom/controllable-open.feat.js +1 -1
- package/dist/dom/controllable-open.feat.mjs +1 -1
- package/dist/dom/controllable-select.feat.js +1 -1
- package/dist/dom/controllable-select.feat.mjs +1 -1
- package/dist/dom/controllable-textarea.feat.js +1 -1
- package/dist/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/dom/controllable.feat.js +1 -1
- package/dist/dom/controllable.feat.mjs +1 -1
- package/dist/dom/dom.d.ts +1 -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 +1 -1
- package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
- package/dist/dom/lazy.feat.js +1 -1
- package/dist/dom/lazy.feat.mjs +1 -1
- package/dist/dom/placeholder.feat.js +3 -3
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/dom/signals.d.ts +3 -2
- package/dist/{dom-BSsI9OPC.js → dom-B8UEYzOz.js} +112 -84
- package/dist/{dom-B-v8Gw6T.mjs → dom-BPjLe6YU.mjs} +23 -5
- package/dist/dom.d.ts +2 -2
- package/dist/dom.js +34 -33
- package/dist/dom.mjs +6 -5
- package/dist/html/assets.d.ts +12 -6
- package/dist/html/attrs.d.ts +3 -2
- package/dist/html/compat.d.ts +10 -2
- package/dist/html/dynamic-tag.d.ts +1 -1
- package/dist/html/inlined-runtimes.d.ts +1 -1
- package/dist/html/inlined-runtimes.debug.d.ts +1 -1
- package/dist/html/serializer.d.ts +2 -1
- package/dist/html/writer.d.ts +42 -22
- package/dist/html.d.ts +2 -2
- package/dist/html.js +400 -208
- package/dist/html.mjs +399 -207
- package/dist/translator/core/html-comment.d.ts +0 -7
- package/dist/translator/core/let.d.ts +0 -5
- package/dist/translator/core/show.d.ts +2 -5
- package/dist/translator/core/style.d.ts +6 -8
- package/dist/translator/index.d.ts +9 -0
- package/dist/translator/index.js +8429 -8100
- package/dist/translator/util/binding-has-prop.d.ts +1 -1
- package/dist/translator/util/binding-prop-tree.d.ts +4 -4
- package/dist/translator/util/bindings.d.ts +135 -0
- package/dist/translator/util/body-to-text-literal.d.ts +1 -2
- package/dist/translator/util/branch-tag.d.ts +7 -7
- package/dist/translator/util/constants/binding-type.d.ts +5 -6
- package/dist/translator/util/constants/slot-kind.d.ts +14 -0
- package/dist/translator/util/constants/structure-kind.d.ts +2 -1
- package/dist/translator/util/evaluate.d.ts +11 -10
- package/dist/translator/util/finalize-references.d.ts +4 -0
- package/dist/translator/util/for-selector.d.ts +1 -1
- package/dist/translator/util/generate-uid.d.ts +3 -1
- package/dist/translator/util/get-declared-binding-expression.d.ts +2 -2
- package/dist/translator/util/is-core-tag.d.ts +0 -3
- package/dist/translator/util/is-only-child-in-parent.d.ts +2 -7
- package/dist/translator/util/known-tag.d.ts +10 -8
- package/dist/translator/util/module-read.d.ts +21 -0
- package/dist/translator/util/read-replacement.d.ts +3 -0
- package/dist/translator/util/reasons.d.ts +32 -0
- package/dist/translator/util/references.d.ts +68 -166
- package/dist/translator/util/runtime.d.ts +2 -0
- package/dist/translator/util/scope-accessor.d.ts +14 -0
- package/dist/translator/util/scope-read.d.ts +1 -1
- package/dist/translator/util/sections.d.ts +52 -48
- package/dist/translator/util/set-tag-derived-from.d.ts +7 -0
- package/dist/translator/util/setup-work.d.ts +1 -2
- package/dist/translator/util/signals.d.ts +3 -5
- package/dist/translator/util/slots.d.ts +50 -0
- package/dist/translator/util/solve-reasons.d.ts +10 -0
- package/dist/translator/util/sources.d.ts +21 -0
- package/dist/translator/util/structure.d.ts +6 -2
- package/dist/translator/util/tag-facts.d.ts +21 -0
- package/dist/translator/util/tag-name-type.d.ts +4 -1
- package/dist/translator/util/translate-attrs.d.ts +2 -0
- package/dist/translator/util/translate-var.d.ts +3 -0
- package/dist/translator/util/write-guard.d.ts +12 -0
- package/dist/translator/util/writer.d.ts +3 -3
- package/dist/translator/visitors/export-declaration.d.ts +9 -0
- package/dist/translator/visitors/function.d.ts +5 -4
- package/dist/translator/visitors/import-declaration.d.ts +2 -2
- package/dist/translator/visitors/placeholder.d.ts +0 -3
- package/dist/translator/visitors/program/index.d.ts +13 -3
- package/dist/translator/visitors/referenced-identifier.d.ts +2 -1
- package/dist/translator/visitors/tag/custom-tag.d.ts +1 -1
- package/dist/translator/visitors/tag/dynamic-tag.d.ts +0 -3
- package/dist/translator/visitors/tag/index.d.ts +2 -1
- package/dist/translator/visitors/tag/native-tag.d.ts +26 -12
- package/package.json +3 -3
- package/dist/translator/util/insertion-context.d.ts +0 -1
- package/dist/translator/util/is-non-html-text.d.ts +0 -3
- package/dist/translator/util/serialize-guard.d.ts +0 -11
- package/dist/translator/util/serialize-reasons.d.ts +0 -37
- package/dist/translator/util/set-tag-sections-downstream.d.ts +0 -6
|
@@ -29,8 +29,17 @@ let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "
|
|
|
29
29
|
for (; !currentNode.nextSibling && currentNode.parentNode;) currentNode = currentNode.parentNode;
|
|
30
30
|
walkNextSibling();
|
|
31
31
|
}, walkNextSibling = () => currentNode = currentNode.nextSibling || currentNode, _resumed = {}, curRenders, embedRenders, readyIds, lazyEnabled, isResuming, cloneCache = {}, _html = /*@__PURE__*/ withDynamicHtml(function(scope, value, accessor) {
|
|
32
|
-
let
|
|
33
|
-
|
|
32
|
+
let prevValue = scope["R" + accessor];
|
|
33
|
+
if (prevValue !== (scope["R" + accessor] = _to_text(value))) {
|
|
34
|
+
let firstChild = scope[accessor], parentNode = firstChild.parentNode, lastChild = scope["H" + accessor] || firstChild, newContent = parseHTML(scope["R" + accessor], parentNode.namespaceURI);
|
|
35
|
+
if (prevValue === void 0 && lastChild !== firstChild) {
|
|
36
|
+
let node = firstChild, newNode = newContent.firstChild;
|
|
37
|
+
for (; (node = node.nextSibling) !== lastChild && node.isEqualNode(newNode);) newNode = newNode.nextSibling;
|
|
38
|
+
if (node === lastChild && !newNode) return;
|
|
39
|
+
}
|
|
40
|
+
let newFirstChild = scope[accessor] = newContent.firstChild || newContent.appendChild(new Text()), newLastChild = scope["H" + accessor] = newContent.lastChild, branch = scope.F;
|
|
41
|
+
branch?.S === firstChild && (branch.S = newFirstChild), branch?.K === lastChild && (branch.K = newLastChild), insertChildNodes(parentNode, firstChild, newFirstChild, newLastChild), removeChildNodes(firstChild, lastChild);
|
|
42
|
+
}
|
|
34
43
|
}), R = /[\p{L}\p{N}]/gu, inputType = "", controllableScripts = {}, controllableRenders = {}, _if = /*@__PURE__*/ withBranches((nodeAccessor, ...branchesArgs) => {
|
|
35
44
|
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
36
45
|
let branchAccessor = "D" + nodeAccessor, branches = [], i = 0;
|
|
@@ -165,6 +174,9 @@ function withBranches(runtime) {
|
|
|
165
174
|
function withDynamicHtml(runtime) {
|
|
166
175
|
return dynamicHtmlEnabled = 1, runtime;
|
|
167
176
|
}
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/common/errors.ts
|
|
179
|
+
function _assert_class_toggles(classes, toggles) {}
|
|
168
180
|
function _hoist_read_error() {}
|
|
169
181
|
function _assert_hoist(value) {}
|
|
170
182
|
//#endregion
|
|
@@ -493,13 +505,13 @@ function* traverse(scope, path, args, i = path.length - 1) {
|
|
|
493
505
|
if (scope) {
|
|
494
506
|
if (Symbol.iterator in scope) for (let childScope of scope.values()) childScope.H !== 0 && (yield* traverse(childScope, path, args, i));
|
|
495
507
|
else {
|
|
496
|
-
let item = scope[
|
|
508
|
+
let step = path[i], item = Array.isArray(step) ? (scope[step[1]] || 0) === step[2] && scope[step[0]] : scope[step];
|
|
497
509
|
i ? yield* traverse(item, path, args, i - 1) : yield typeof item == "function" ? item(...args) : item;
|
|
498
510
|
}
|
|
499
511
|
}
|
|
500
512
|
}
|
|
501
513
|
function _hoist(...path) {
|
|
502
|
-
return path = path.map((p) => typeof p == "
|
|
514
|
+
return path = path.map((p) => typeof p == "number" ? decodeAccessor(p) : p), (scope) => {
|
|
503
515
|
let fn = (...args) => traverse(scope, path, args).next().value;
|
|
504
516
|
return fn[Symbol.iterator] = () => traverse(scope, path, []), fn;
|
|
505
517
|
};
|
|
@@ -709,6 +721,12 @@ function _attr_class_items(element, items) {
|
|
|
709
721
|
function _attr_class_item(element, name, value) {
|
|
710
722
|
element.classList.toggle(name, !!value);
|
|
711
723
|
}
|
|
724
|
+
function _attr_class_names(element, names, value) {
|
|
725
|
+
let start = 0, end;
|
|
726
|
+
do
|
|
727
|
+
end = names.indexOf(" ", start), element.classList.toggle(names.slice(start, end >>> 0), !!value);
|
|
728
|
+
while (start = end + 1);
|
|
729
|
+
}
|
|
712
730
|
function _attr_style(element, value) {
|
|
713
731
|
setAttribute(element, "style", toDelimitedString(value, ";", stringifyStyleObject) || void 0);
|
|
714
732
|
}
|
|
@@ -1198,4 +1216,4 @@ function byFirstArg(name) {
|
|
|
1198
1216
|
return name;
|
|
1199
1217
|
}
|
|
1200
1218
|
//#endregion
|
|
1201
|
-
export {
|
|
1219
|
+
export { _attr_style_items as $, removeAndDestroyBranch as $t, _attr_input_value as A, _child_setup as At, _controllable_select as B, _id as Bt, _attr_details_or_dialog_open_script as C, _var_resume as Ct, _attr_input_checkedValue_script as D, ready as Dt, _attr_input_checkedValue_default as E, initEmbedded as Et, _attr_select_value as F, _for_closure as Ft, _attr_class as G, _return as Gt, controllableRenders as H, _let as Ht, _attr_select_value_default as I, _for_selector as It, _attr_class_names as J, _var as Jt, _attr_class_item as K, _return_change as Kt, _attr_select_value_script as L, _global_read as Lt, _attr_input_value_default as M, _closure_get as Mt, _attr_input_value_dynamic_default as N, _const as Nt, _attr_input_checked_default as O, readyFailed as Ot, _attr_input_value_script as P, _el_read as Pt, _attr_style_item as Q, insertBranchBefore as Qt, _controllable_input as R, _hoist as Rt, _attr_details_or_dialog_open_default as S, _resumed as St, _attr_input_checkedValue as T, init as Tt, controllableScripts as U, _let_change as Ut, _controllable_textarea as V, _if_closure as Vt, _attr as W, _or as Wt, _attr_nonce as X, _assert_init as Xt, _attr_content as Y, _var_change as Yt, _attr_style as Z, destroyBranch as Zt, installDynamicTagVar as _, _assert_class_toggles as _n, createAndSetupBranch as _t, _for_in as a, prepareEffects as an, _html as at, runPendingEffects as b, _call as bn, _dynamic_tag_var_resume as bt, _for_to as c, queueRender as cn, _style_shell as ct, _for_until_unkeyed as d, runEffects as dn, _to_text as dt, syncGen as en, _attrs as et, _if as f, runId as fn, insertChildNodes as ft, dynamicTagScript as g, forUntil as gn, _content_resume as gt, addAwaitCounter as h, forTo as hn, _content_closures as ht, _dynamic_tag_content as i, installCatch as in, _attrs_script as it, _attr_input_value_attribute_default as j, _closure as jt, _attr_input_checked_script as k, withLazy as kt, _for_to_unkeyed as l, rendering as ln, _text as lt, _try as m, forOf as mn, _content as mt, _await_promise as n, $signal as nn, _attrs_partial as nt, _for_of as o, queueAsyncRender as on, _lifecycle as ot, _show as p, forIn as pn, toInsertNode as pt, _attr_class_items as q, _script as qt, _dynamic_tag as r, $signalReset as rn, _attrs_partial_content as rt, _for_of_unkeyed as s, queueEffect as sn, _style_rule_item as st, _await_content as t, _on as tn, _attrs_content as tt, _for_until as u, run as un, _text_content as ut, patchDynamicTag as v, _assert_hoist as vn, createBranch as vt, _attr_input_checked as w, getRegisteredWithScope as wt, _attr_details_or_dialog_open as x, withBranches as xn, _el as xt, renderCatch as y, _hoist_read_error as yn, setupBranch as yt, _controllable_open as z, _hoist_resume as zt };
|
package/dist/dom.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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
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";
|
|
12
12
|
export { run } from "./dom/queue";
|
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-B8UEYzOz.js"), empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), classEventResolver, scopesByRender = /* @__PURE__ */ new WeakMap(), getRenderScopes = ($global) => {
|
|
3
|
+
require_control_flow.Tt($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
7
|
patchDynamicTag: require_control_flow.v,
|
|
8
|
-
queueEffect: require_control_flow.
|
|
8
|
+
queueEffect: require_control_flow.sn,
|
|
9
9
|
init(warp10Noop) {
|
|
10
|
-
require_control_flow.
|
|
10
|
+
require_control_flow.St.$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.St.$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.St[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-BSsI9OPC.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.dn(this.effects);
|
|
43
43
|
},
|
|
44
44
|
runComponentDestroy() {
|
|
45
|
-
this.scope && require_control_flow.
|
|
45
|
+
this.scope && require_control_flow.Zt(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.wt(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.mt("", 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.Tt(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._t(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.ln ? renderBranch() : require_control_flow.an(renderBranch), created) return require_control_flow.pt(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.mt(id, template, walks, setup, inputSignal)();
|
|
71
|
+
return renderer.mount = mount, renderer._ = renderer, require_control_flow.St[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.an(() => {
|
|
109
|
+
branch = require_control_flow.vt($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.ft(parentNode, nextSibling, branch.S, branch.K), require_control_flow.dn(effects), {
|
|
114
114
|
get value() {
|
|
115
115
|
return curValue;
|
|
116
116
|
},
|
|
117
117
|
set value(newValue) {
|
|
118
|
-
require_control_flow.
|
|
118
|
+
require_control_flow.Yt(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.dn(require_control_flow.an(() => {
|
|
122
122
|
args(branch, newInput);
|
|
123
123
|
})));
|
|
124
124
|
},
|
|
125
125
|
destroy() {
|
|
126
|
-
require_control_flow
|
|
126
|
+
require_control_flow.$t(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.on(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,37 @@ 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.cn(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.mt("", ...mod._)(), require_control_flow.on(child, (child) => insertLoaded(renderer, child, marker, awaitCounter));
|
|
149
149
|
}, loadFailed(child, awaitCounter));
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
153
|
function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
154
|
-
let parent = marker.parentNode, values = branch.X, clone = () => {
|
|
155
|
-
require_control_flow
|
|
154
|
+
let parent = () => marker.parentNode, values = branch.X, clone = () => {
|
|
155
|
+
require_control_flow.en(branch), renderer.b(branch, parent().namespaceURI), branch.X = 0;
|
|
156
156
|
}, insert = () => {
|
|
157
|
-
require_control_flow.
|
|
157
|
+
require_control_flow.Qt(branch, parent(), marker), marker.remove(), awaitCounter?.c();
|
|
158
158
|
}, remaining;
|
|
159
159
|
if (remaining = values?.size) {
|
|
160
|
+
awaitCounter ||= require_control_flow.h(branch);
|
|
160
161
|
let fail = loadFailed(branch, awaitCounter);
|
|
161
|
-
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && require_control_flow.
|
|
162
|
+
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && require_control_flow.on(branch, (branch) => {
|
|
162
163
|
clone(), renderer.c?.(branch), values.forEach(([value, apply]) => apply(branch, value)), insert();
|
|
163
164
|
}), (error) => remaining > 0 && (remaining = 0, fail(error))));
|
|
164
|
-
} else clone(), require_control_flow.
|
|
165
|
+
} else clone(), require_control_flow.yt(renderer, branch), insert();
|
|
165
166
|
}
|
|
166
167
|
function loadFailed(scope, awaitCounter) {
|
|
167
168
|
return (error) => {
|
|
168
|
-
awaitCounter && (awaitCounter.m ? awaitCounter.i = 0 : awaitCounter.i && awaitCounter.c()), require_control_flow.
|
|
169
|
+
awaitCounter && (awaitCounter.m ? awaitCounter.i = 0 : awaitCounter.i && awaitCounter.c()), require_control_flow.on(scope, require_control_flow.y, error);
|
|
169
170
|
};
|
|
170
171
|
}
|
|
171
172
|
function _load_signal(load) {
|
|
172
173
|
let pending, apply = (scope, value) => {
|
|
173
|
-
pending ||= load(), scope.X || !("X" in scope) && scope.H === require_control_flow.
|
|
174
|
+
pending ||= load(), scope.X || !("X" in scope) && scope.H === require_control_flow.fn ? (scope.X ||= /* @__PURE__ */ new Map()).set(pending, [value, apply]) : apply._ ? apply._(scope, value) : pending.then((mod) => require_control_flow.on(scope, apply._ = mod._, value), noop);
|
|
174
175
|
};
|
|
175
176
|
return apply;
|
|
176
177
|
}
|
|
@@ -197,9 +198,9 @@ function _load_race_trigger(...triggers) {
|
|
|
197
198
|
function getSelectorOrResolve(selector, resolve) {
|
|
198
199
|
return document.querySelector(selector) || resolve();
|
|
199
200
|
}
|
|
200
|
-
exports.$signal = require_control_flow.
|
|
201
|
+
exports.$signal = require_control_flow.nn, exports.$signalReset = require_control_flow.rn, exports._assert_class_toggles = require_control_flow._n, exports._assert_hoist = require_control_flow.vn, exports._assert_init = require_control_flow.Xt, exports._attr = require_control_flow.W, exports._attr_class = require_control_flow.G, exports._attr_class_item = require_control_flow.K, exports._attr_class_items = require_control_flow.q, exports._attr_class_names = require_control_flow.J, exports._attr_content = require_control_flow.Y, exports._attr_details_open = require_control_flow.x, exports._attr_dialog_open = require_control_flow.x, exports._attr_details_open_default = require_control_flow.S, exports._attr_dialog_open_default = require_control_flow.S, exports._attr_details_open_script = require_control_flow.C, exports._attr_dialog_open_script = require_control_flow.C, exports._attr_input_checked = require_control_flow.w, exports._attr_input_checkedValue = require_control_flow.T, exports._attr_input_checkedValue_default = require_control_flow.E, exports._attr_input_checkedValue_script = require_control_flow.D, exports._attr_input_checked_default = require_control_flow.O, exports._attr_input_checked_script = require_control_flow.k, exports._attr_input_value = require_control_flow.A, exports._attr_textarea_value = require_control_flow.A, exports._attr_input_value_attribute_default = require_control_flow.j, exports._attr_input_value_default = require_control_flow.M, exports._attr_textarea_value_default = require_control_flow.M, exports._attr_input_value_dynamic_default = require_control_flow.N, exports._attr_input_value_script = require_control_flow.P, exports._attr_textarea_value_script = require_control_flow.P, exports._attr_nonce = require_control_flow.X, exports._attr_select_value = require_control_flow.F, exports._attr_select_value_default = require_control_flow.I, exports._attr_select_value_script = require_control_flow.L, exports._attr_style = require_control_flow.Z, exports._attr_style_item = require_control_flow.Q, exports._attr_style_items = require_control_flow.$, exports._attrs = require_control_flow.et, exports._attrs_content = require_control_flow.tt, exports._attrs_partial = require_control_flow.nt, exports._attrs_partial_content = require_control_flow.rt, exports._attrs_script = require_control_flow.it, exports._await_content = require_control_flow.t, exports._await_promise = require_control_flow.n, exports._call = require_control_flow.bn, exports._child_setup = require_control_flow.At, exports._closure = require_control_flow.jt, exports._closure_get = require_control_flow.Mt, exports._const = require_control_flow.Nt, exports._content = require_control_flow.mt, exports._content_closures = require_control_flow.ht, exports._content_resume = require_control_flow.gt, exports._controllable_input = require_control_flow.R, exports._controllable_open = require_control_flow.z, exports._controllable_select = require_control_flow.B, exports._controllable_textarea = require_control_flow.V, Object.defineProperty(exports, "_dynamic_tag", {
|
|
201
202
|
enumerable: !0,
|
|
202
203
|
get: function() {
|
|
203
204
|
return require_control_flow.r;
|
|
204
205
|
}
|
|
205
|
-
}), exports._dynamic_tag_content = require_control_flow.i, exports._dynamic_tag_var_resume = require_control_flow.
|
|
206
|
+
}), exports._dynamic_tag_content = require_control_flow.i, exports._dynamic_tag_var_resume = require_control_flow.bt, exports._el = require_control_flow.xt, exports._el_read = require_control_flow.Pt, exports._for_closure = require_control_flow.Ft, 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.It, 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.Lt, exports._hoist = require_control_flow.Rt, exports._hoist_read_error = require_control_flow.yn, exports._hoist_resume = require_control_flow.zt, exports._html = require_control_flow.at, exports._id = require_control_flow.Bt, exports._if = require_control_flow.f, exports._if_closure = require_control_flow.Vt, exports._let = require_control_flow.Ht, exports._let_change = require_control_flow.Ut, exports._lifecycle = require_control_flow.ot, exports._load_event_trigger = _load_event_trigger, exports._load_idle_trigger = _load_idle_trigger, exports._load_media_trigger = _load_media_trigger, exports._load_race_trigger = _load_race_trigger, exports._load_setup = _load_setup, exports._load_signal = _load_signal, exports._load_template = _load_template, exports._load_visible_trigger = _load_visible_trigger, exports._on = require_control_flow.tn, exports._or = require_control_flow.Wt, exports._resumed = require_control_flow.St, exports._return = require_control_flow.Gt, exports._return_change = require_control_flow.Kt, exports._script = require_control_flow.qt, exports._show = require_control_flow.p, exports._style_rule_item = require_control_flow.st, exports._style_shell = require_control_flow.ct, exports._template = _template, exports._text = require_control_flow.lt, exports._text_content = require_control_flow.ut, exports._to_text = require_control_flow.dt, exports._try = require_control_flow.m, exports._var = require_control_flow.Jt, exports._var_change = require_control_flow.Yt, exports._var_resume = require_control_flow.Ct, exports.attrTag = attrTag, exports.attrTags = attrTags, exports.compat = compat, exports.forIn = require_control_flow.pn, exports.forOf = require_control_flow.mn, exports.forTo = require_control_flow.hn, exports.forUntil = require_control_flow.gn, exports.init = require_control_flow.Tt, exports.initEmbedded = require_control_flow.Et, exports.ready = require_control_flow.Dt, exports.readyFailed = require_control_flow.Ot, exports.run = require_control_flow.un;
|
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_items, $t as removeAndDestroyBranch, A as _attr_input_value, At as _child_setup, B as _controllable_select, Bt as _id, C as _attr_details_or_dialog_open_script, Ct as _var_resume, D as _attr_input_checkedValue_script, Dt as ready, E as _attr_input_checkedValue_default, Et as initEmbedded, F as _attr_select_value, Ft as _for_closure, G as _attr_class, Gt as _return, Ht as _let, I as _attr_select_value_default, It as _for_selector, J as _attr_class_names, Jt as _var, K as _attr_class_item, Kt as _return_change, L as _attr_select_value_script, Lt as _global_read, M as _attr_input_value_default, Mt as _closure_get, N as _attr_input_value_dynamic_default, Nt as _const, O as _attr_input_checked_default, Ot as readyFailed, P as _attr_input_value_script, Pt as _el_read, Q as _attr_style_item, Qt as insertBranchBefore, R as _controllable_input, Rt as _hoist, S as _attr_details_or_dialog_open_default, St as _resumed, T as _attr_input_checkedValue, Tt as init, Ut as _let_change, V as _controllable_textarea, Vt as _if_closure, W as _attr, Wt as _or, X as _attr_nonce, Xt as _assert_init, Y as _attr_content, Yt as _var_change, Z as _attr_style, Zt as destroyBranch, _n as _assert_class_toggles, _t as createAndSetupBranch, a as _for_in, an as prepareEffects, at as _html, bn as _call, bt as _dynamic_tag_var_resume, c as _for_to, cn as queueRender, ct as _style_shell, d as _for_until_unkeyed, dn as runEffects, dt as _to_text, en as syncGen, et as _attrs, f as _if, fn as runId, ft as insertChildNodes, gn as forUntil, gt as _content_resume, h as addAwaitCounter, hn as forTo, ht as _content_closures, i as _dynamic_tag_content, it as _attrs_script, j as _attr_input_value_attribute_default, jt as _closure, k as _attr_input_checked_script, l as _for_to_unkeyed, ln as rendering, lt as _text, m as _try, mn as forOf, mt as _content, n as _await_promise, nn as $signal, nt as _attrs_partial, o as _for_of, on as queueAsyncRender, ot as _lifecycle, p as _show, pn as forIn, pt as toInsertNode, q as _attr_class_items, qt as _script, r as _dynamic_tag, rn as $signalReset, rt as _attrs_partial_content, s as _for_of_unkeyed, sn as queueEffect, st as _style_rule_item, t as _await_content, tn as _on, tt as _attrs_content, u as _for_until, un as run, ut as _text_content, v as patchDynamicTag, vn as _assert_hoist, vt as createBranch, w as _attr_input_checked, wt as getRegisteredWithScope, x as _attr_details_or_dialog_open, xt as _el, y as renderCatch, yn as _hoist_read_error, yt as setupBranch, z as _controllable_open, zt as _hoist_resume } from "./dom-BPjLe6YU.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;
|
|
@@ -150,12 +150,13 @@ function _load_setup(load) {
|
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
152
|
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;
|
|
153
|
+
let parent = () => marker.parentNode, values = branch.X, clone = () => {
|
|
154
|
+
syncGen(branch), renderer.b(branch, parent().namespaceURI), branch.X = 0;
|
|
155
155
|
}, insert = () => {
|
|
156
|
-
insertBranchBefore(branch, parent, marker), marker.remove(), awaitCounter?.c();
|
|
156
|
+
insertBranchBefore(branch, parent(), marker), marker.remove(), awaitCounter?.c();
|
|
157
157
|
}, remaining;
|
|
158
158
|
if (remaining = values?.size) {
|
|
159
|
+
awaitCounter ||= addAwaitCounter(branch);
|
|
159
160
|
let fail = loadFailed(branch, awaitCounter);
|
|
160
161
|
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && queueAsyncRender(branch, (branch) => {
|
|
161
162
|
clone(), renderer.c?.(branch), values.forEach(([value, apply]) => apply(branch, value)), insert();
|
|
@@ -197,4 +198,4 @@ function getSelectorOrResolve(selector, resolve) {
|
|
|
197
198
|
return document.querySelector(selector) || resolve();
|
|
198
199
|
}
|
|
199
200
|
//#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 };
|
|
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 };
|
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
|
@@ -18,7 +18,8 @@ export declare function _attr_and(name: string, value: unknown, attr: string): s
|
|
|
18
18
|
export declare function _attr_or(name: string, value: unknown, attr: string): string;
|
|
19
19
|
export declare function _attr_nullish(name: string, value: unknown, attr: string): string;
|
|
20
20
|
export declare function _attrs(data: Record<string, unknown>, nodeAccessor: Accessor, scopeId: number, tagName: string): string;
|
|
21
|
-
export declare function _attrs_content(data: Record<string, unknown>, nodeAccessor: Accessor, scopeId: number, tagName: string,
|
|
21
|
+
export declare function _attrs_content(data: Record<string, unknown>, nodeAccessor: Accessor, scopeId: number, tagName: string, markerGuard?: 1 | 0): void;
|
|
22
22
|
export declare function _attrs_partial(data: Record<string, unknown>, skip: Record<string, 1>, nodeAccessor: Accessor, scopeId: number, tagName: string): string;
|
|
23
|
-
export declare function _attrs_partial_content(data: Record<string, unknown>, skip: Record<string, 1>, nodeAccessor: Accessor, scopeId: number, tagName: string,
|
|
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;
|
|
@@ -5,7 +5,7 @@ interface BodyContentObject {
|
|
|
5
5
|
[x: PropertyKey]: unknown;
|
|
6
6
|
content: ServerRenderer;
|
|
7
7
|
}
|
|
8
|
-
export declare let _dynamic_tag: (scopeId: number, accessor: Accessor, tag: unknown | string | ServerRenderer | BodyContentObject, inputOrArgs: unknown, content?: (() => void) | 0, inputIsArgs?: 1,
|
|
8
|
+
export declare let _dynamic_tag: (scopeId: number, accessor: Accessor, tag: unknown | string | ServerRenderer | BodyContentObject, inputOrArgs: unknown, content?: (() => void) | 0, inputIsArgs?: 1, markerGuard?: 1 | 0) => unknown;
|
|
9
9
|
export declare function _content(id: string, fn: ServerRenderer, scopeId?: number): ServerRenderer;
|
|
10
10
|
export declare function _content_resume(id: string, fn: ServerRenderer, scopeId?: number, locals?: Locals): ServerRenderer;
|
|
11
11
|
export declare const patchDynamicTag: (patch: (tag: unknown, scopeId: number, accessor: Accessor) => unknown) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const WALKER_RUNTIME_CODE = "(e=>(self[e]||=(l,f=e+l,s=f.length,a={},d=[],t=document,n=t.createTreeWalker(t,129))=>t=self[e][l]={i:f,d:t,l:a,v:d,x(){},w(e,l,r){for(;e=n.nextNode();)t.x(l=(l=e.data)&&!l.indexOf(f)&&(r=l.slice(s+1),(l=l[s])>\"#\"||(a[r]=e),l),r,e),l>\"#\"&&d.push(e)}},self[e]))";
|
|
2
|
-
export declare const REORDER_RUNTIME_CODE = "(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++:\"
|
|
2
|
+
export declare const REORDER_RUNTIME_CODE = "(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)))}})";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const WALKER_RUNTIME_CODE = "((runtimeId) => (self[runtimeId] ||= (\n renderId,\n prefix = runtimeId + renderId,\n prefixLen = prefix.length,\n lookup = {},\n visits = [],\n doc = document,\n walker = doc.createTreeWalker(\n doc,\n 129 /* NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_ELEMENT */,\n ),\n) =>\n doc = (self[runtimeId][renderId] = {\n i: prefix,\n d: doc,\n l: lookup,\n v: visits,\n x() {},\n w(node, op, id) {\n while ((node = walker.nextNode())) {\n // Only reorder markers (\"#\", \"!\") are ever looked up, so only they are\n // kept: the lookup lives as long as the page, and every node marker\n // would otherwise stay referenced in it after resume consumed it.\n doc.x(\n (op =\n (op = node.data) &&\n !op.indexOf(prefix) &&\n ((id = op.slice(prefixLen + 1)),\n (op = op[prefixLen]) > \"#\" || (lookup[id] = node),\n op)),\n id,\n node,\n );\n\n if (op > \"#\") {\n visits.push(node);\n }\n }\n },\n })\n, self[runtimeId]))";
|
|
2
|
-
export declare const REORDER_RUNTIME_CODE = "((runtime) => {\n if (runtime.j) return;\n let onNextSibling,\n placeholder,\n nextSibling,\n placeholders = runtime.p = {},\n replace = (id, container) => runtime.l[id].replaceWith(...container.childNodes);\n runtime.j = {};\n runtime.x = (op, id, node, placeholderRoot, placeholderCb) => {\n if (node == nextSibling) {\n onNextSibling();\n }\n\n if (op == \"#\") {\n (placeholders[id] = placeholder).i++;\n } else if (
|
|
2
|
+
export declare const REORDER_RUNTIME_CODE = "((runtime) => {\n if (runtime.j) return;\n let onNextSibling,\n placeholder,\n nextSibling,\n placeholders = runtime.p = {},\n replace = (id, container) => runtime.l[id].replaceWith(...container.childNodes);\n runtime.j = {};\n runtime.x = (op, id, node, placeholderRoot, placeholderCb) => {\n if (node == nextSibling) {\n onNextSibling();\n }\n\n if (op == \"#\") {\n (placeholders[id] = placeholder).i++;\n } else if (node.tagName == \"T\" && (id = node.getAttribute(runtime.i))) {\n nextSibling = node.nextSibling;\n onNextSibling = () => {\n node.remove();\n placeholderRoot || replace(id, node);\n placeholder.c();\n };\n placeholder =\n placeholders[id] ||\n (placeholderRoot = placeholders[id] =\n {\n // The writer streams a reorder only after its markers.\n i: 1,\n r: id,\n // Resume may still walk markers inside the dropped placeholder, so\n // park it in any detached parent (a bare <t> clone is the cheapest).\n c(start = runtime.l[\"^\" + id], removed = node.cloneNode()) {\n if (--placeholderRoot.i) return 1;\n for (\n ;\n removed.prepend(\n (nextSibling = runtime.l[id].previousSibling || start),\n ),\n start != nextSibling;\n\n );\n replace(id, node);\n },\n });\n // Opens the chunk's visits for resume to parent to the root's branch; the\n // walk that this chunk's own script triggers closes it.\n runtime.v.push({ data: runtime.i + \"*\" + placeholder.r });\n // repurpose \"op\" for callbacks ...carefully\n if ((op = runtime.j[id])) {\n placeholderCb = placeholder.c;\n placeholder.c = () => placeholderCb() || op(runtime.r);\n }\n }\n };\n})";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Boundary, PartialScope } from "./writer";
|
|
2
2
|
export declare const K_SCOPE_ID: unique symbol;
|
|
3
|
-
export type Locals = (scope: (scopeId: number) => PartialScope) =>
|
|
3
|
+
export type Locals = (scope: (scopeId: number) => PartialScope) => PartialScope[];
|
|
4
4
|
export type ScopeFlush = [scopeId: number, scope: object, props: object];
|
|
5
5
|
export interface SerializeChannel {
|
|
6
6
|
readyId?: string;
|
|
@@ -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): {
|