marko 6.4.11 → 6.4.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/attr-tag.d.ts +1 -0
- package/dist/common/errors.d.ts +2 -0
- package/dist/common/helpers.d.ts +2 -0
- package/dist/debug/dom/catch.feat.js +1 -1
- package/dist/debug/dom/catch.feat.mjs +1 -1
- package/dist/debug/dom/compat.feat.js +143 -0
- package/dist/debug/dom/compat.feat.mjs +141 -0
- 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-mQ5mPBTF.js → dom-CtXOr4Nm.js} +68 -31
- package/dist/debug/{dom-DjUZd-9y.mjs → dom-DaHYZpf2.mjs} +51 -26
- package/dist/debug/dom.js +4 -127
- package/dist/debug/dom.mjs +2 -119
- package/dist/debug/html/compat.feat.js +222 -0
- package/dist/debug/html/compat.feat.mjs +220 -0
- package/dist/debug/html-DMo6pc_h.mjs +3931 -0
- package/dist/debug/html-DfZjMkhx.js +4513 -0
- package/dist/debug/html.js +83 -4220
- package/dist/debug/html.mjs +1 -4133
- package/dist/dom/catch.feat.js +4 -4
- package/dist/dom/catch.feat.mjs +1 -1
- package/dist/dom/{compat.d.ts → compat.feat.d.ts} +18 -9
- package/dist/dom/compat.feat.js +101 -0
- package/dist/dom/compat.feat.mjs +100 -0
- package/dist/dom/control-flow.d.ts +0 -1
- 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 +2 -1
- package/dist/dom/dynamic-tag-script.feat.js +2 -2
- package/dist/dom/dynamic-tag-script.feat.mjs +1 -1
- package/dist/dom/dynamic-tag-var.feat.js +3 -3
- 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/resume.d.ts +3 -1
- package/dist/{dom-B8j2453O.js → dom-BB-Te-3z.js} +125 -130
- package/dist/{dom-HEWdZCCb.mjs → dom-BO-0hzLZ.mjs} +13 -18
- package/dist/dom.d.ts +0 -1
- package/dist/dom.js +21 -95
- package/dist/dom.mjs +3 -72
- package/dist/html/{compat.d.ts → compat.feat.d.ts} +5 -4
- package/dist/html/compat.feat.js +165 -0
- package/dist/html/compat.feat.mjs +164 -0
- package/dist/html/dynamic-tag.d.ts +1 -2
- package/dist/html/writer.d.ts +2 -1
- package/dist/html-DMDc0zKs.mjs +2404 -0
- package/dist/html-DrHsybFm.js +2880 -0
- package/dist/html.d.ts +0 -1
- package/dist/html.js +2 -2566
- package/dist/html.mjs +3 -2561
- package/dist/translator/index.js +297 -285
- package/dist/translator/util/assert.d.ts +2 -0
- package/dist/translator/util/branch-tag.d.ts +1 -1
- package/dist/translator/util/known-tag.d.ts +4 -1
- package/dist/translator/util/optional.d.ts +0 -1
- package/dist/translator/util/reasons.d.ts +0 -1
- package/dist/translator/util/references.d.ts +1 -0
- package/dist/translator/util/sections.d.ts +5 -1
- package/dist/translator/util/tag-facts.d.ts +2 -0
- package/dist/translator/util/translate-attrs.d.ts +1 -4
- package/dist/translator/visitors/program/index.d.ts +2 -2
- package/index.d.ts +2 -7
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "\\3B " : "\\\\", decodeAccessor = (num) => (num + (num < 26 ? 10 : num < 962 ? 334 : 11998)).toString(36), branchesEnabled, dynamicHtmlEnabled, rendering, runId = 2, pendingEffects = [], pendingRenders = [], queuePendingRender = (render) => {
|
|
1
|
+
let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "\\3B " : "\\\\", classAPIRenderer, decodeAccessor = (num) => (num + (num < 26 ? 10 : num < 962 ? 334 : 11998)).toString(36), branchesEnabled, dynamicHtmlEnabled, rendering, runId = 2, pendingEffects = [], pendingRenders = [], queuePendingRender = (render) => {
|
|
2
2
|
let i = pendingRenders.push(render) - 1;
|
|
3
3
|
for (; i;) {
|
|
4
4
|
let parentIndex = i - 1 >> 1, parent = pendingRenders[parentIndex];
|
|
@@ -43,12 +43,7 @@ let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "
|
|
|
43
43
|
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
44
44
|
let childScopeAccessor = "A" + nodeAccessor, rendererAccessor = "D" + nodeAccessor, createTagBranch = ($global, tagNameOrRenderer, scope, parentNode) => {
|
|
45
45
|
let branch = createBranch($global, tagNameOrRenderer, scope, parentNode);
|
|
46
|
-
|
|
47
|
-
else if (getContent) {
|
|
48
|
-
let content = getContent(scope);
|
|
49
|
-
setBranch(branch, "a", content, createAndSetupBranch), content.f && subscribeToScopeSet(content.e, content.f, branch.Aa);
|
|
50
|
-
}
|
|
51
|
-
return branch;
|
|
46
|
+
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)), getTagVar && (branch.T = (value) => getTagVar()(scope, value), bindTagVar(scope, branch, scope[scopeOffsetAccessor], tagNameOrRenderer)), typeof tagNameOrRenderer == "string" ? getContent && _attr_content(branch, "a", getContent(scope)) : setupBranch(tagNameOrRenderer, branch), branch;
|
|
52
47
|
};
|
|
53
48
|
return (scope, newRenderer, getInput) => {
|
|
54
49
|
let normalizedRenderer = normalizeDynamicRenderer(newRenderer);
|
|
@@ -148,10 +143,14 @@ function isNotNullishOrFalse(value) {
|
|
|
148
143
|
function isPromise(value) {
|
|
149
144
|
return value != null && typeof value.then == "function";
|
|
150
145
|
}
|
|
146
|
+
function setClassAPIRenderer(render) {
|
|
147
|
+
classAPIRenderer = render;
|
|
148
|
+
}
|
|
151
149
|
function normalizeDynamicRenderer(value) {
|
|
152
150
|
if (value) {
|
|
153
151
|
if (typeof value == "string") return value;
|
|
154
152
|
let normalized = value.content || value.default || value;
|
|
153
|
+
if (classAPIRenderer) return classAPIRenderer(normalized);
|
|
155
154
|
if ("a" in normalized) return normalized;
|
|
156
155
|
}
|
|
157
156
|
}
|
|
@@ -579,10 +578,10 @@ function init(runtimeId = "M") {
|
|
|
579
578
|
for (; i < resumes.length; i++) {
|
|
580
579
|
let serialized = resumes[i];
|
|
581
580
|
if (typeof serialized == "string") for (lastTokenIndex = 0, visitText = serialized; nextToken();) /\D/.test(lastToken) ? lastEffect = _resumed[lastToken] : effects.push(lastEffect, getScope(lastToken));
|
|
582
|
-
else if (
|
|
583
|
-
if (!(
|
|
584
|
-
} else
|
|
585
|
-
|
|
581
|
+
else if (readyIds && typeof serialized != "function") {
|
|
582
|
+
if (typeof serialized == "number" || !Object.keys(serialized).every((dep) => readyIds.has(dep) && (render.b[dep]?.n || 0) >= serialized[dep])) break;
|
|
583
|
+
} else {
|
|
584
|
+
readyIds && (resumes.n = (resumes.n || 0) + 1);
|
|
586
585
|
let scopes = serialized(serializeContext);
|
|
587
586
|
Array.isArray(scopes) && applyScopes(scopes);
|
|
588
587
|
}
|
|
@@ -791,9 +790,8 @@ function attrsInternal(scope, nodeAccessor, nextAttrs, controllable) {
|
|
|
791
790
|
}
|
|
792
791
|
}
|
|
793
792
|
}
|
|
794
|
-
function _attr_content(scope, nodeAccessor,
|
|
795
|
-
|
|
796
|
-
renderer && renderer.a && (content = renderer), scope["D" + nodeAccessor] !== (scope["D" + nodeAccessor] = rendererKey(content)) && (setBranch(scope, nodeAccessor, content, createAndSetupBranch), content?.f && subscribeToScopeSet(content.e, content.f, scope["A" + nodeAccessor])), content?.g?.(scope["A" + nodeAccessor]);
|
|
793
|
+
function _attr_content(scope, nodeAccessor, content) {
|
|
794
|
+
content = content?.content || content, classAPIRenderer && content && (content = classAPIRenderer(content)), scope["D" + nodeAccessor] !== (scope["D" + nodeAccessor] = rendererKey(content)) && (setBranch(scope, nodeAccessor, content, createAndSetupBranch), content?.f && subscribeToScopeSet(content.e, content.f, scope["A" + nodeAccessor])), content?.g?.(scope["A" + nodeAccessor]);
|
|
797
795
|
}
|
|
798
796
|
function _attrs_script(scope, nodeAccessor) {
|
|
799
797
|
let el = scope[nodeAccessor], events = scope["I" + nodeAccessor];
|
|
@@ -1155,9 +1153,6 @@ function findTryWithCatch(scope) {
|
|
|
1155
1153
|
function rendererKey(renderer) {
|
|
1156
1154
|
return renderer?.e ? renderer.a + " " + renderer.e.L : renderer?.a || renderer;
|
|
1157
1155
|
}
|
|
1158
|
-
function patchDynamicTag(fn) {
|
|
1159
|
-
_dynamic_tag = fn(_dynamic_tag);
|
|
1160
|
-
}
|
|
1161
1156
|
function installDynamicTagVar(bind) {
|
|
1162
1157
|
bindTagVar = bind;
|
|
1163
1158
|
}
|
|
@@ -1187,4 +1182,4 @@ function bySecondArg(_item, index) {
|
|
|
1187
1182
|
function byFirstArg(name) {
|
|
1188
1183
|
return name;
|
|
1189
1184
|
}
|
|
1190
|
-
export {
|
|
1185
|
+
export { _attrs as $, $signal as $t, _attr_input_value_attribute_default as A, _const as At, _controllable_textarea as B, _let_change as Bt, _attr_input_checked as C, init as Ct, _attr_input_checked_default as D, withLazy as Dt, _attr_input_checkedValue_script as E, readyFailed as Et, _attr_select_value_default as F, _hoist as Ft, _attr_class_item as G, _var as Gt, controllableSpreadHelpers as H, _return as Ht, _attr_select_value_script as I, _hoist_resume as It, _attr_content as J, destroyBranch as Jt, _attr_class_items as K, _var_change as Kt, _controllable_input as L, _id as Lt, _attr_input_value_dynamic_default as M, _for_closure as Mt, _attr_input_value_script as N, _for_selector as Nt, _attr_input_checked_script as O, _closure as Ot, _attr_select_value as P, _global_read as Pt, _attr_style_items as Q, _on as Qt, _controllable_open as R, _if_closure as Rt, _attr_details_or_dialog_open_script as S, withBranches as Sn, getRegisteredWithScope as St, _attr_input_checkedValue_default as T, ready as Tt, _attr as U, _return_change as Ut, controllableScripts as V, _or as Vt, _attr_class as W, _script as Wt, _attr_style as X, removeAndDestroyBranch as Xt, _attr_nonce as Y, insertBranchBefore as Yt, _attr_style_item as Z, syncGen as Zt, renderCatch as _, _assert_class_toggles as _n, setupBranch as _t, _for_in as a, prepareEffects as an, _lifecycle as at, _attr_details_or_dialog_open as b, _call as bn, _resumed as bt, _for_to as c, queueRender as cn, _text as ct, _for_until_unkeyed as d, runEffects as dn, _content as dt, $signalReset as en, _attrs_content as et, _if as f, runId as fn, _content_closures as ft, installDynamicTagVar as g, forUntil as gn, createBranch as gt, dynamicTagScript as h, forTo as hn, createAndSetupBranch as ht, _dynamic_tag_content as i, installCatch as in, _html as it, _attr_input_value_default as j, _el_read as jt, _attr_input_value as k, _closure_get as kt, _for_to_unkeyed as l, rendering as ln, _text_content as lt, _try as m, forOf as mn, _return_setup as mt, _await_promise as n, createBranchRenders as nn, _attrs_partial_content as nt, _for_of as o, queueAsyncRender as on, _style_rule_item as ot, _show as p, forIn as pn, _content_resume as pt, _attr_class_names as q, _assert_init as qt, _dynamic_tag as r, installBranchRenders as rn, _attrs_script as rt, _for_of_unkeyed as s, queueEffect as sn, _style_shell as st, _await_content as t, onAbort as tn, _attrs_partial as tt, _for_until as u, run as un, _to_text as ut, runPendingEffects as v, _assert_hoist as vn, _dynamic_tag_var_resume as vt, _attr_input_checkedValue as w, initEmbedded as wt, _attr_details_or_dialog_open_default as x, setClassAPIRenderer as xn, _var_resume as xt, startAwait as y, _hoist_read_error as yn, _el as yt, _controllable_select as z, _let as zt };
|
package/dist/dom.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ export { _assert_class_toggles, _assert_hoist, _hoist_read_error, } from "./comm
|
|
|
3
3
|
export { forIn, forOf, forTo, forUntil } from "./common/for";
|
|
4
4
|
export { _call } from "./common/helpers";
|
|
5
5
|
export { $signal, $signalReset, onAbort } from "./dom/abort-signal";
|
|
6
|
-
export { compat } from "./dom/compat";
|
|
7
6
|
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
7
|
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
8
|
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";
|
package/dist/dom.js
CHANGED
|
@@ -1,74 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
let require_control_flow = require("./dom-
|
|
3
|
-
require_control_flow.
|
|
4
|
-
|
|
5
|
-
return render && !scopes && scopesByRender.set(render, scopes = {}), scopes;
|
|
6
|
-
}, compat = {
|
|
7
|
-
patchDynamicTag: require_control_flow._,
|
|
8
|
-
queueEffect: require_control_flow.cn,
|
|
9
|
-
init(warp10Noop) {
|
|
10
|
-
require_control_flow.xt.$C_s = (scope) => {
|
|
11
|
-
if (getRenderScopes(scope.$)[scope.L] = scope, scope.m5c && classIdToBranch.set(scope.m5c, scope), classEventResolver) for (let key in scope) {
|
|
12
|
-
let resolved = classEventResolver(scope[key], scope);
|
|
13
|
-
resolved !== scope[key] && (scope[key] = resolved);
|
|
14
|
-
}
|
|
15
|
-
}, require_control_flow.xt.$C_b = warp10Noop;
|
|
16
|
-
},
|
|
17
|
-
setClassEventResolver(fn) {
|
|
18
|
-
classEventResolver = fn;
|
|
19
|
-
},
|
|
20
|
-
resumeClassFunction(id, build) {
|
|
21
|
-
require_control_flow.xt[id] = build;
|
|
22
|
-
},
|
|
23
|
-
getScope($global, scopeId) {
|
|
24
|
-
return getRenderScopes($global)?.[scopeId];
|
|
25
|
-
},
|
|
26
|
-
setRendererId(renderer, id) {
|
|
27
|
-
renderer.a = id;
|
|
28
|
-
},
|
|
29
|
-
isRenderer(renderer) {
|
|
30
|
-
return renderer.b;
|
|
31
|
-
},
|
|
32
|
-
getStartNode(branch) {
|
|
33
|
-
return branch.S;
|
|
34
|
-
},
|
|
35
|
-
getEndNode(branch) {
|
|
36
|
-
return branch.K;
|
|
37
|
-
},
|
|
38
|
-
setScopeNodes(branch, startNode, endNode) {
|
|
39
|
-
branch.S = startNode, branch.K = endNode;
|
|
40
|
-
},
|
|
41
|
-
runComponentEffects() {
|
|
42
|
-
this.effects && require_control_flow.fn(this.effects);
|
|
43
|
-
},
|
|
44
|
-
runComponentDestroy() {
|
|
45
|
-
this.scope && require_control_flow.Yt(this.scope);
|
|
46
|
-
},
|
|
47
|
-
resolveRegistered(value, $global) {
|
|
48
|
-
return Array.isArray(value) && typeof value[0] == "string" ? require_control_flow.Ct(getRenderScopes($global)?.[value[1]], value[0]) : value;
|
|
49
|
-
},
|
|
50
|
-
createRenderer(params, clone) {
|
|
51
|
-
let renderer = require_control_flow.ft("", 0, 0, 0, params)();
|
|
52
|
-
return renderer.b = (branch) => {
|
|
53
|
-
let cloned = clone();
|
|
54
|
-
branch.S = cloned.startNode, branch.K = cloned.endNode;
|
|
55
|
-
}, renderer;
|
|
56
|
-
},
|
|
57
|
-
render(out, component, renderer, args) {
|
|
58
|
-
require_control_flow.wt(out.global.runtimeId);
|
|
59
|
-
let branch = component.scope, created = 0;
|
|
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
|
-
let input = args[0], normalizedInput = args[0] = {};
|
|
62
|
-
for (let key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
|
|
63
|
-
}
|
|
64
|
-
let renderBranch = (_) => {
|
|
65
|
-
branch ||= (created = 1, component.scope = require_control_flow.gt(out.global, renderer, renderer.e, document.body)), renderer.g?.(branch), renderer.d?.(branch, renderer._ ? args[0] : args);
|
|
66
|
-
};
|
|
67
|
-
if (component.effects = require_control_flow.un ? renderBranch() : require_control_flow.on(renderBranch), created) return branch.S.parentNode || branch.S;
|
|
68
|
-
}
|
|
69
|
-
}, _template = (id, template, walks, setup, inputSignal) => {
|
|
70
|
-
let renderer = require_control_flow.ft(id, template, walks, setup, inputSignal)();
|
|
71
|
-
return renderer.mount = mount, renderer._ = renderer, require_control_flow.xt[id] = renderer;
|
|
2
|
+
let require_control_flow = require("./dom-BB-Te-3z.js"), empty = [], rest = Symbol(), _template = (id, template, walks, setup, inputSignal) => {
|
|
3
|
+
let renderer = require_control_flow.dt(id, template, walks, setup, inputSignal)();
|
|
4
|
+
return renderer.mount = mount, renderer._ = renderer, require_control_flow.bt[id] = renderer;
|
|
72
5
|
}, noop = (_) => 0;
|
|
73
6
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
74
7
|
// src/common/attr-tag.ts
|
|
@@ -81,8 +14,6 @@ function attrTags(first, attrs) {
|
|
|
81
14
|
function* attrTagIterator() {
|
|
82
15
|
yield this, yield* this[rest];
|
|
83
16
|
}
|
|
84
|
-
// src/common/compat-meta.ts
|
|
85
|
-
// src/dom/compat.ts
|
|
86
17
|
// src/dom/template.ts
|
|
87
18
|
function mount(input = {}, reference, position) {
|
|
88
19
|
let branch, parentNode = reference, nextSibling = null, { $global } = input;
|
|
@@ -102,30 +33,30 @@ function mount(input = {}, reference, position) {
|
|
|
102
33
|
break;
|
|
103
34
|
case "afterend": parentNode = reference.parentNode, nextSibling = reference.nextSibling;
|
|
104
35
|
}
|
|
105
|
-
let curValue, args = this.d, effects = require_control_flow.
|
|
106
|
-
branch = require_control_flow.
|
|
36
|
+
let curValue, args = this.d, effects = require_control_flow.an((_) => {
|
|
37
|
+
branch = require_control_flow.gt($global, this, void 0, parentNode), branch.T = (newValue) => curValue = newValue, this.c?.(branch), args?.(branch, input);
|
|
107
38
|
});
|
|
108
|
-
return require_control_flow.
|
|
39
|
+
return require_control_flow.Yt(branch, parentNode, nextSibling), require_control_flow.dn(effects), {
|
|
109
40
|
get value() {
|
|
110
41
|
return curValue;
|
|
111
42
|
},
|
|
112
43
|
set value(newValue) {
|
|
113
|
-
require_control_flow.
|
|
44
|
+
require_control_flow.Kt(branch, newValue);
|
|
114
45
|
},
|
|
115
46
|
update(newInput = {}) {
|
|
116
|
-
args && (newInput.$global && ({$global, ...newInput} = newInput), require_control_flow.
|
|
47
|
+
args && (newInput.$global && ({$global, ...newInput} = newInput), require_control_flow.dn(require_control_flow.an((_) => args(branch, newInput))));
|
|
117
48
|
},
|
|
118
49
|
destroy() {
|
|
119
|
-
require_control_flow.
|
|
50
|
+
require_control_flow.Xt(branch);
|
|
120
51
|
}
|
|
121
52
|
};
|
|
122
53
|
}
|
|
123
54
|
// src/dom/load.ts
|
|
124
55
|
function _load_template(id, load) {
|
|
125
56
|
let pending, lazyTemplate = _template(id, 0, 0, (branch) => {
|
|
126
|
-
let awaitCounter = require_control_flow.
|
|
57
|
+
let awaitCounter = require_control_flow.y(branch);
|
|
127
58
|
branch.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((renderer) => {
|
|
128
|
-
Object.assign(lazyTemplate, renderer), require_control_flow.
|
|
59
|
+
Object.assign(lazyTemplate, renderer), require_control_flow.on(branch, (branch) => insertLoaded(renderer, branch, branch.S, awaitCounter));
|
|
129
60
|
}, loadFailed(branch, awaitCounter));
|
|
130
61
|
}, _load_signal((_) => (pending ||= load()).then((r) => ({ _: r.d || noop }))));
|
|
131
62
|
return lazyTemplate;
|
|
@@ -133,37 +64,37 @@ function _load_template(id, load) {
|
|
|
133
64
|
function _load_setup(load) {
|
|
134
65
|
let pending, renderer, insertCached = (child, marker) => insertLoaded(renderer, child, marker);
|
|
135
66
|
return (owner, child, marker) => {
|
|
136
|
-
if (child.X ||= /* @__PURE__ */ new Map(), renderer) require_control_flow.
|
|
67
|
+
if (child.X ||= /* @__PURE__ */ new Map(), renderer) require_control_flow.cn(child, insertCached, -1, marker);
|
|
137
68
|
else {
|
|
138
|
-
let awaitCounter = require_control_flow.
|
|
69
|
+
let awaitCounter = require_control_flow.y(owner);
|
|
139
70
|
(pending ||= load()).then((mod) => {
|
|
140
|
-
renderer ||= require_control_flow.
|
|
71
|
+
renderer ||= require_control_flow.dt("", ...mod._)(), require_control_flow.on(child, (child) => insertLoaded(renderer, child, marker, awaitCounter));
|
|
141
72
|
}, loadFailed(child, awaitCounter));
|
|
142
73
|
}
|
|
143
74
|
};
|
|
144
75
|
}
|
|
145
76
|
function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
146
77
|
let parent = (_) => marker.parentNode, values = branch.X, create = (_) => {
|
|
147
|
-
require_control_flow.
|
|
78
|
+
require_control_flow.Zt(branch), renderer.b(branch, parent().namespaceURI), branch.X = 0, require_control_flow._t(renderer, branch);
|
|
148
79
|
}, insert = (_) => {
|
|
149
|
-
require_control_flow.
|
|
80
|
+
require_control_flow.Yt(branch, parent(), marker), marker.remove(), awaitCounter?.c();
|
|
150
81
|
}, remaining;
|
|
151
82
|
if (remaining = values.size) {
|
|
152
|
-
awaitCounter ||= require_control_flow.
|
|
83
|
+
awaitCounter ||= require_control_flow.y(branch);
|
|
153
84
|
let fail = loadFailed(branch, awaitCounter);
|
|
154
|
-
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && require_control_flow.
|
|
85
|
+
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && require_control_flow.on(branch, (branch) => {
|
|
155
86
|
create(), values.forEach(([value, apply]) => apply(branch, value)), insert();
|
|
156
87
|
}), (error) => remaining > 0 && (remaining = 0, fail(error))));
|
|
157
88
|
} else create(), insert();
|
|
158
89
|
}
|
|
159
90
|
function loadFailed(scope, awaitCounter) {
|
|
160
91
|
return (error) => {
|
|
161
|
-
awaitCounter && (awaitCounter.m ? awaitCounter.i = 0 : awaitCounter.i && awaitCounter.c()), require_control_flow.
|
|
92
|
+
awaitCounter && (awaitCounter.m ? awaitCounter.i = 0 : awaitCounter.i && awaitCounter.c()), require_control_flow.on(scope, require_control_flow._, error);
|
|
162
93
|
};
|
|
163
94
|
}
|
|
164
95
|
function _load_signal(load) {
|
|
165
96
|
let pending, apply = (scope, value) => {
|
|
166
|
-
pending ||= load(), scope.X || !("X" in scope) && scope.H === require_control_flow.
|
|
97
|
+
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);
|
|
167
98
|
};
|
|
168
99
|
return apply;
|
|
169
100
|
}
|
|
@@ -190,9 +121,4 @@ function _load_race_trigger(...triggers) {
|
|
|
190
121
|
function getSelectorOrResolve(selector, resolve) {
|
|
191
122
|
return document.querySelector(selector) || resolve();
|
|
192
123
|
}
|
|
193
|
-
exports.$signal = require_control_flow
|
|
194
|
-
enumerable: !0,
|
|
195
|
-
get: function() {
|
|
196
|
-
return require_control_flow.r;
|
|
197
|
-
}
|
|
198
|
-
}), exports._dynamic_tag_content = require_control_flow.i, exports._dynamic_tag_var_resume = require_control_flow.yt, exports._el = require_control_flow.bt, exports._el_read = require_control_flow.Mt, exports._for_closure = require_control_flow.Nt, 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.Pt, 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.Ft, exports._hoist = require_control_flow.It, exports._hoist_read_error = require_control_flow.bn, exports._hoist_resume = require_control_flow.Lt, exports._html = require_control_flow.at, exports._id = require_control_flow.Rt, exports._if = require_control_flow.f, exports._if_closure = require_control_flow.zt, exports._let = require_control_flow.Bt, exports._let_change = require_control_flow.Vt, 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.$t, exports._or = require_control_flow.Ht, exports._resumed = require_control_flow.xt, exports._return = require_control_flow.Ut, exports._return_change = require_control_flow.Wt, exports._return_setup = require_control_flow.ht, exports._script = require_control_flow.Gt, 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.Kt, exports._var_change = require_control_flow.qt, exports._var_resume = require_control_flow.St, exports.attrTag = attrTag, exports.attrTags = attrTags, exports.compat = compat, exports.forIn = require_control_flow.mn, exports.forOf = require_control_flow.hn, exports.forTo = require_control_flow.gn, exports.forUntil = require_control_flow._n, exports.init = require_control_flow.wt, exports.initEmbedded = require_control_flow.Tt, exports.onAbort = require_control_flow.nn, exports.ready = require_control_flow.Et, exports.readyFailed = require_control_flow.Dt, exports.run = require_control_flow.dn;
|
|
124
|
+
exports.$signal = require_control_flow.$t, exports.$signalReset = require_control_flow.en, exports._assert_class_toggles = require_control_flow._n, exports._assert_hoist = require_control_flow.vn, exports._assert_init = require_control_flow.qt, exports._attr = require_control_flow.U, exports._attr_class = require_control_flow.W, exports._attr_class_item = require_control_flow.G, exports._attr_class_items = require_control_flow.K, exports._attr_class_names = require_control_flow.q, exports._attr_content = require_control_flow.J, exports._attr_details_open = require_control_flow.b, exports._attr_dialog_open = require_control_flow.b, exports._attr_details_open_default = require_control_flow.x, exports._attr_dialog_open_default = require_control_flow.x, exports._attr_details_open_script = require_control_flow.S, exports._attr_dialog_open_script = require_control_flow.S, exports._attr_input_checked = require_control_flow.C, exports._attr_input_checkedValue = require_control_flow.w, exports._attr_input_checkedValue_default = require_control_flow.T, exports._attr_input_checkedValue_script = require_control_flow.E, exports._attr_input_checked_default = require_control_flow.D, exports._attr_input_checked_script = require_control_flow.O, exports._attr_input_value = require_control_flow.k, exports._attr_textarea_value = require_control_flow.k, exports._attr_input_value_attribute_default = require_control_flow.A, exports._attr_input_value_default = require_control_flow.j, exports._attr_textarea_value_default = require_control_flow.j, exports._attr_input_value_dynamic_default = require_control_flow.M, exports._attr_input_value_script = require_control_flow.N, exports._attr_textarea_value_script = require_control_flow.N, exports._attr_nonce = require_control_flow.Y, exports._attr_select_value = require_control_flow.P, exports._attr_select_value_default = require_control_flow.F, exports._attr_select_value_script = require_control_flow.I, exports._attr_style = require_control_flow.X, exports._attr_style_item = require_control_flow.Z, exports._attr_style_items = require_control_flow.Q, exports._attrs = require_control_flow.$, exports._attrs_content = require_control_flow.et, exports._attrs_partial = require_control_flow.tt, exports._attrs_partial_content = require_control_flow.nt, exports._attrs_script = require_control_flow.rt, exports._await_content = require_control_flow.t, exports._await_promise = require_control_flow.n, exports._call = require_control_flow.bn, exports._closure = require_control_flow.Ot, exports._closure_get = require_control_flow.kt, exports._const = require_control_flow.At, exports._content = require_control_flow.dt, exports._content_closures = require_control_flow.ft, exports._content_resume = require_control_flow.pt, exports._controllable_input = require_control_flow.L, exports._controllable_open = require_control_flow.R, exports._controllable_select = require_control_flow.z, exports._controllable_textarea = require_control_flow.B, exports._dynamic_tag = require_control_flow.r, exports._dynamic_tag_content = require_control_flow.i, exports._dynamic_tag_var_resume = require_control_flow.vt, exports._el = require_control_flow.yt, exports._el_read = require_control_flow.jt, exports._for_closure = require_control_flow.Mt, 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.Nt, 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.Pt, exports._hoist = require_control_flow.Ft, exports._hoist_read_error = require_control_flow.yn, exports._hoist_resume = require_control_flow.It, exports._html = require_control_flow.it, exports._id = require_control_flow.Lt, exports._if = require_control_flow.f, exports._if_closure = require_control_flow.Rt, exports._let = require_control_flow.zt, exports._let_change = require_control_flow.Bt, exports._lifecycle = require_control_flow.at, 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.Qt, exports._or = require_control_flow.Vt, exports._resumed = require_control_flow.bt, exports._return = require_control_flow.Ht, exports._return_change = require_control_flow.Ut, exports._return_setup = require_control_flow.mt, exports._script = require_control_flow.Wt, exports._show = require_control_flow.p, exports._style_rule_item = require_control_flow.ot, exports._style_shell = require_control_flow.st, exports._template = _template, exports._text = require_control_flow.ct, exports._text_content = require_control_flow.lt, exports._to_text = require_control_flow.ut, exports._try = require_control_flow.m, exports._var = require_control_flow.Gt, exports._var_change = require_control_flow.Kt, exports._var_resume = require_control_flow.xt, exports.attrTag = attrTag, exports.attrTags = attrTags, 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.Ct, exports.initEmbedded = require_control_flow.wt, exports.onAbort = require_control_flow.tn, exports.ready = require_control_flow.Tt, exports.readyFailed = require_control_flow.Et, exports.run = require_control_flow.un;
|
package/dist/dom.mjs
CHANGED
|
@@ -1,75 +1,8 @@
|
|
|
1
|
-
let empty = [], rest = Symbol(),
|
|
2
|
-
init($global.runtimeId);
|
|
3
|
-
let render = self[$global.runtimeId]?.[$global.renderId], scopes = render && scopesByRender.get(render);
|
|
4
|
-
return render && !scopes && scopesByRender.set(render, scopes = {}), scopes;
|
|
5
|
-
}, compat = {
|
|
6
|
-
patchDynamicTag,
|
|
7
|
-
queueEffect,
|
|
8
|
-
init(warp10Noop) {
|
|
9
|
-
_resumed.$C_s = (scope) => {
|
|
10
|
-
if (getRenderScopes(scope.$)[scope.L] = scope, scope.m5c && classIdToBranch.set(scope.m5c, scope), classEventResolver) for (let key in scope) {
|
|
11
|
-
let resolved = classEventResolver(scope[key], scope);
|
|
12
|
-
resolved !== scope[key] && (scope[key] = resolved);
|
|
13
|
-
}
|
|
14
|
-
}, _resumed.$C_b = warp10Noop;
|
|
15
|
-
},
|
|
16
|
-
setClassEventResolver(fn) {
|
|
17
|
-
classEventResolver = fn;
|
|
18
|
-
},
|
|
19
|
-
resumeClassFunction(id, build) {
|
|
20
|
-
_resumed[id] = build;
|
|
21
|
-
},
|
|
22
|
-
getScope($global, scopeId) {
|
|
23
|
-
return getRenderScopes($global)?.[scopeId];
|
|
24
|
-
},
|
|
25
|
-
setRendererId(renderer, id) {
|
|
26
|
-
renderer.a = id;
|
|
27
|
-
},
|
|
28
|
-
isRenderer(renderer) {
|
|
29
|
-
return renderer.b;
|
|
30
|
-
},
|
|
31
|
-
getStartNode(branch) {
|
|
32
|
-
return branch.S;
|
|
33
|
-
},
|
|
34
|
-
getEndNode(branch) {
|
|
35
|
-
return branch.K;
|
|
36
|
-
},
|
|
37
|
-
setScopeNodes(branch, startNode, endNode) {
|
|
38
|
-
branch.S = startNode, branch.K = endNode;
|
|
39
|
-
},
|
|
40
|
-
runComponentEffects() {
|
|
41
|
-
this.effects && runEffects(this.effects);
|
|
42
|
-
},
|
|
43
|
-
runComponentDestroy() {
|
|
44
|
-
this.scope && destroyBranch(this.scope);
|
|
45
|
-
},
|
|
46
|
-
resolveRegistered(value, $global) {
|
|
47
|
-
return Array.isArray(value) && typeof value[0] == "string" ? getRegisteredWithScope(getRenderScopes($global)?.[value[1]], value[0]) : value;
|
|
48
|
-
},
|
|
49
|
-
createRenderer(params, clone) {
|
|
50
|
-
let renderer = _content("", 0, 0, 0, params)();
|
|
51
|
-
return renderer.b = (branch) => {
|
|
52
|
-
let cloned = clone();
|
|
53
|
-
branch.S = cloned.startNode, branch.K = cloned.endNode;
|
|
54
|
-
}, renderer;
|
|
55
|
-
},
|
|
56
|
-
render(out, component, renderer, args) {
|
|
57
|
-
init(out.global.runtimeId);
|
|
58
|
-
let branch = component.scope, created = 0;
|
|
59
|
-
if (!branch && (branch = classIdToBranch.get(component.id)) && (component.scope = branch, classIdToBranch.delete(component.id)), args[0] && typeof args[0] == "object" && "renderBody" in args[0]) {
|
|
60
|
-
let input = args[0], normalizedInput = args[0] = {};
|
|
61
|
-
for (let key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
|
|
62
|
-
}
|
|
63
|
-
let renderBranch = (_) => {
|
|
64
|
-
branch ||= (created = 1, component.scope = createAndSetupBranch(out.global, renderer, renderer.e, document.body)), renderer.g?.(branch), renderer.d?.(branch, renderer._ ? args[0] : args);
|
|
65
|
-
};
|
|
66
|
-
if (component.effects = rendering ? renderBranch() : prepareEffects(renderBranch), created) return branch.S.parentNode || branch.S;
|
|
67
|
-
}
|
|
68
|
-
}, _template = (id, template, walks, setup, inputSignal) => {
|
|
1
|
+
let empty = [], rest = Symbol(), _template = (id, template, walks, setup, inputSignal) => {
|
|
69
2
|
let renderer = _content(id, template, walks, setup, inputSignal)();
|
|
70
3
|
return renderer.mount = mount, renderer._ = renderer, _resumed[id] = renderer;
|
|
71
4
|
}, noop = (_) => 0;
|
|
72
|
-
import { $ as
|
|
5
|
+
import { $ as _attrs, $t as $signal, A as _attr_input_value_attribute_default, At as _const, B as _controllable_textarea, Bt as _let_change, C as _attr_input_checked, Ct as init, D as _attr_input_checked_default, E as _attr_input_checkedValue_script, Et as readyFailed, F as _attr_select_value_default, Ft as _hoist, G as _attr_class_item, Gt as _var, Ht as _return, I as _attr_select_value_script, It as _hoist_resume, J as _attr_content, K as _attr_class_items, Kt as _var_change, L as _controllable_input, Lt as _id, M as _attr_input_value_dynamic_default, Mt as _for_closure, N as _attr_input_value_script, Nt as _for_selector, O as _attr_input_checked_script, Ot as _closure, P as _attr_select_value, Pt as _global_read, Q as _attr_style_items, Qt as _on, R as _controllable_open, Rt as _if_closure, S as _attr_details_or_dialog_open_script, T as _attr_input_checkedValue_default, Tt as ready, U as _attr, Ut as _return_change, Vt as _or, W as _attr_class, Wt as _script, X as _attr_style, Xt as removeAndDestroyBranch, Y as _attr_nonce, Yt as insertBranchBefore, Z as _attr_style_item, Zt as syncGen, _ as renderCatch, _n as _assert_class_toggles, _t as setupBranch, a as _for_in, an as prepareEffects, at as _lifecycle, b as _attr_details_or_dialog_open, bn as _call, bt as _resumed, c as _for_to, cn as queueRender, ct as _text, d as _for_until_unkeyed, dn as runEffects, dt as _content, en as $signalReset, et as _attrs_content, f as _if, fn as runId, ft as _content_closures, gn as forUntil, gt as createBranch, hn as forTo, i as _dynamic_tag_content, it as _html, j as _attr_input_value_default, jt as _el_read, k as _attr_input_value, kt as _closure_get, l as _for_to_unkeyed, lt as _text_content, m as _try, mn as forOf, mt as _return_setup, n as _await_promise, nt as _attrs_partial_content, o as _for_of, on as queueAsyncRender, ot as _style_rule_item, p as _show, pn as forIn, pt as _content_resume, q as _attr_class_names, qt as _assert_init, r as _dynamic_tag, rt as _attrs_script, s as _for_of_unkeyed, st as _style_shell, t as _await_content, tn as onAbort, tt as _attrs_partial, u as _for_until, un as run, ut as _to_text, vn as _assert_hoist, vt as _dynamic_tag_var_resume, w as _attr_input_checkedValue, wt as initEmbedded, x as _attr_details_or_dialog_open_default, xt as _var_resume, y as startAwait, yn as _hoist_read_error, yt as _el, z as _controllable_select, zt as _let } from "./dom-BO-0hzLZ.mjs";
|
|
73
6
|
// src/common/attr-tag.ts
|
|
74
7
|
function attrTag(attrs) {
|
|
75
8
|
return attrs[Symbol.iterator] = attrTagIterator, attrs[rest] = empty, attrs;
|
|
@@ -80,8 +13,6 @@ function attrTags(first, attrs) {
|
|
|
80
13
|
function* attrTagIterator() {
|
|
81
14
|
yield this, yield* this[rest];
|
|
82
15
|
}
|
|
83
|
-
// src/common/compat-meta.ts
|
|
84
|
-
// src/dom/compat.ts
|
|
85
16
|
// src/dom/template.ts
|
|
86
17
|
function mount(input = {}, reference, position) {
|
|
87
18
|
let branch, parentNode = reference, nextSibling = null, { $global } = input;
|
|
@@ -189,4 +120,4 @@ function _load_race_trigger(...triggers) {
|
|
|
189
120
|
function getSelectorOrResolve(selector, resolve) {
|
|
190
121
|
return document.querySelector(selector) || resolve();
|
|
191
122
|
}
|
|
192
|
-
export { $signal, $signalReset, _assert_class_toggles, _assert_hoist, _assert_init, _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_class_names, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_checked_default, _attr_input_checked_script, _attr_input_value, _attr_input_value as _attr_textarea_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_input_value_script as _attr_textarea_value_script, _attr_nonce, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _await_content, _await_promise, _call, _closure, _closure_get, _const, _content, _content_closures, _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, _return_setup, _script, _show, _style_rule_item, _style_shell, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags,
|
|
123
|
+
export { $signal, $signalReset, _assert_class_toggles, _assert_hoist, _assert_init, _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_class_names, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_checked_default, _attr_input_checked_script, _attr_input_value, _attr_input_value as _attr_textarea_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_input_value_script as _attr_textarea_value_script, _attr_nonce, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _await_content, _await_promise, _call, _closure, _closure_get, _const, _content, _content_closures, _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, _return_setup, _script, _show, _style_rule_item, _style_shell, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags, forIn, forOf, forTo, forUntil, init, initEmbedded, onAbort, ready, readyFailed, run };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { setClassAPIRenderer } from "../common/helpers";
|
|
1
2
|
import { writeLoadAsset } from "./assets";
|
|
2
|
-
import { _await } from "./control-flow";
|
|
3
3
|
import { register } from "./serializer";
|
|
4
4
|
import type { ServerRenderer } from "./template";
|
|
5
5
|
import { _html, _peek_scope_id, _scope_id, $global, Chunk, getChunk, isInResumedBranch, State, withChunk, writeScript } from "./writer";
|
|
6
6
|
export declare const compat: {
|
|
7
7
|
$global: typeof $global;
|
|
8
8
|
writeLoadAsset: typeof writeLoadAsset;
|
|
9
|
-
fork:
|
|
9
|
+
fork(scopeId: number, promise: unknown, content: (value: unknown) => void): void;
|
|
10
10
|
write: typeof _html;
|
|
11
11
|
writeScript: typeof writeScript;
|
|
12
12
|
nextScopeId: typeof _scope_id;
|
|
@@ -15,9 +15,10 @@ export declare const compat: {
|
|
|
15
15
|
withChunk: typeof withChunk;
|
|
16
16
|
getChunk: typeof getChunk;
|
|
17
17
|
ensureState($global: any): State;
|
|
18
|
-
|
|
18
|
+
isRenderer(value: any): boolean;
|
|
19
|
+
setRendererId(renderer: any, id: unknown): void;
|
|
19
20
|
onFlush(fn: (chunk: Chunk) => void): void;
|
|
20
|
-
|
|
21
|
+
setClassAPIRenderer: typeof setClassAPIRenderer;
|
|
21
22
|
writeSetScopeForComponent(branchId: number, m5c: string, m5i: unknown): void;
|
|
22
23
|
toJSON(): (this: WeakKey) => [registryId: string, scopeId: unknown] | undefined;
|
|
23
24
|
joinChunks(chunks: Chunk[]): Chunk | undefined;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
let require_control_flow = require("../html-DrHsybFm.js"), SET_SCOPE_REGISTER_ID = "$C_s", RENDER_BODY_ID = "$C_b", K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap(), compat = {
|
|
3
|
+
$global: require_control_flow.A,
|
|
4
|
+
writeLoadAsset: require_control_flow._,
|
|
5
|
+
fork(scopeId, promise, content) {
|
|
6
|
+
require_control_flow.t(scopeId, "a", promise, (value) => {
|
|
7
|
+
let branchId = require_control_flow.W();
|
|
8
|
+
content(value), require_control_flow.W() === branchId && require_control_flow.J();
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
write: require_control_flow.V,
|
|
12
|
+
writeScript: require_control_flow.dt,
|
|
13
|
+
nextScopeId: require_control_flow.J,
|
|
14
|
+
peekNextScopeId: require_control_flow.W,
|
|
15
|
+
isInResumedBranch: require_control_flow.st,
|
|
16
|
+
withChunk: require_control_flow.lt,
|
|
17
|
+
getChunk: require_control_flow.at,
|
|
18
|
+
ensureState($global) {
|
|
19
|
+
let state = $global[K_TAGS_API_STATE] ||= require_control_flow.at()?.boundary.state;
|
|
20
|
+
return state || ($global.runtimeId ||= "M", $global.renderId ||= $global.componentIdPrefix || $global.widgetIdPrefix || "_", $global[K_TAGS_API_STATE] = state = new require_control_flow.F($global)), state;
|
|
21
|
+
},
|
|
22
|
+
isRenderer(value) {
|
|
23
|
+
return typeof value == "function" && "a" in value;
|
|
24
|
+
},
|
|
25
|
+
setRendererId(renderer, id) {
|
|
26
|
+
renderer.a = id;
|
|
27
|
+
},
|
|
28
|
+
onFlush(fn) {
|
|
29
|
+
let { flushHTML } = require_control_flow.N.prototype;
|
|
30
|
+
require_control_flow.N.prototype.flushHTML = function(boundary) {
|
|
31
|
+
let { state } = boundary, reorders = swapReorders(state, null);
|
|
32
|
+
return fn(this), swapReorders(state, reorders), flushHTML.call(this, boundary);
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
setClassAPIRenderer: require_control_flow.Vt,
|
|
36
|
+
writeSetScopeForComponent(branchId, m5c, m5i) {
|
|
37
|
+
require_control_flow.ut(branchId, {
|
|
38
|
+
m5c,
|
|
39
|
+
m5i
|
|
40
|
+
}), require_control_flow.Z(branchId, SET_SCOPE_REGISTER_ID);
|
|
41
|
+
},
|
|
42
|
+
toJSON() {
|
|
43
|
+
return function() {
|
|
44
|
+
let compatRegistered = COMPAT_REGISTRY.get(this);
|
|
45
|
+
if (!compatRegistered) {
|
|
46
|
+
let registered = require_control_flow.Pt.get(this);
|
|
47
|
+
if (registered) {
|
|
48
|
+
let scopeId = registered.scope ? require_control_flow.ot(registered.scope) : void 0;
|
|
49
|
+
scopeId !== void 0 && require_control_flow.Z(scopeId, SET_SCOPE_REGISTER_ID), COMPAT_REGISTRY.set(this, compatRegistered = [registered.id, scopeId]);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return compatRegistered;
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
joinChunks(chunks) {
|
|
56
|
+
let joined;
|
|
57
|
+
for (let chunk of chunks) chunk.boundary.aborted || (joined ? joined.append(chunk) : joined = chunk);
|
|
58
|
+
return joined;
|
|
59
|
+
},
|
|
60
|
+
appendChunks(chunks) {
|
|
61
|
+
let chunk = require_control_flow.k;
|
|
62
|
+
for (let part of chunks) chunk.append(part), part.effects && (chunk.lastEffect = part.lastEffect);
|
|
63
|
+
},
|
|
64
|
+
deferReorders(reorders) {
|
|
65
|
+
let chunk = require_control_flow.k;
|
|
66
|
+
for (let i = reorders.length; i--;) {
|
|
67
|
+
let carrier = chunk.fork(chunk.boundary, chunk.next);
|
|
68
|
+
carrier.deferredReorder = reorders[i], chunk.next = carrier;
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
createChunk($global) {
|
|
72
|
+
let state = this.ensureState($global);
|
|
73
|
+
return new require_control_flow.N(new require_control_flow.M(state), null, null, state);
|
|
74
|
+
},
|
|
75
|
+
flushScript(chunk, reorders) {
|
|
76
|
+
let { boundary } = chunk, { state } = boundary, html = "", scripts = "";
|
|
77
|
+
if (reorders) for (let reorder of reorders) state.reorder(reorder);
|
|
78
|
+
if (boundary.flush() === 0 && ({html, scripts} = chunk.flush(boundary)), boundary.aborted) throw boundary.reason;
|
|
79
|
+
if (boundary.count) throw /* @__PURE__ */ Error();
|
|
80
|
+
return {
|
|
81
|
+
html,
|
|
82
|
+
scripts
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
render(renderer, willRerender, classAPIOut, component, input, componentScopes, registerChildScope, parentChunk) {
|
|
86
|
+
if (parentChunk?.boundary.aborted) return;
|
|
87
|
+
let state = this.ensureState(classAPIOut.global), boundary = new require_control_flow.M(state, void 0, parentChunk?.boundary), context = require_control_flow.at()?.context ?? null, head = new require_control_flow.N(boundary, new require_control_flow.N(boundary, null, context, state), context, state), normalizedInput = input;
|
|
88
|
+
if ("renderBody" in input) {
|
|
89
|
+
normalizedInput = {};
|
|
90
|
+
for (let key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
|
|
91
|
+
}
|
|
92
|
+
let componentScope = new require_control_flow.N(boundary, null, context, state);
|
|
93
|
+
componentScope.render(() => {
|
|
94
|
+
if (this.hasPendingClassFunctions(classAPIOut.global) && drainClassFunctions(classAPIOut.global, (hostId) => {
|
|
95
|
+
let fnScopeId = require_control_flow.J(), scope = require_control_flow.ut(fnScopeId, {
|
|
96
|
+
m5c: component.id,
|
|
97
|
+
m5h: hostId
|
|
98
|
+
});
|
|
99
|
+
return require_control_flow.Z(fnScopeId, SET_SCOPE_REGISTER_ID), scope;
|
|
100
|
+
}), willRerender || registerChildScope) {
|
|
101
|
+
let scopeId = require_control_flow.W();
|
|
102
|
+
require_control_flow.ut(scopeId, { m5c: component.id }), require_control_flow.Z(scopeId, SET_SCOPE_REGISTER_ID);
|
|
103
|
+
}
|
|
104
|
+
}), head.render(() => {
|
|
105
|
+
require_control_flow.Q(willRerender ? require_control_flow.j : 0);
|
|
106
|
+
try {
|
|
107
|
+
renderer(normalizedInput);
|
|
108
|
+
} finally {
|
|
109
|
+
require_control_flow.Q(void 0);
|
|
110
|
+
}
|
|
111
|
+
let asyncOut = classAPIOut.beginAsync({
|
|
112
|
+
last: !0,
|
|
113
|
+
timeout: -1
|
|
114
|
+
});
|
|
115
|
+
classAPIOut.onLast((next) => {
|
|
116
|
+
(boundary.onNext = () => {
|
|
117
|
+
if (boundary.aborted) boundary.onNext = require_control_flow.P, parentChunk?.boundary.aborted ? (asyncOut.end(), next()) : asyncOut.error(boundary.reason);
|
|
118
|
+
else if (!boundary.count) {
|
|
119
|
+
boundary.onNext = require_control_flow.P;
|
|
120
|
+
let queued = swapReorders(state, null);
|
|
121
|
+
head = head.consume(boundary);
|
|
122
|
+
let reorders = swapReorders(state, queued);
|
|
123
|
+
reorders && asyncOut.writer.get("reorders").push(...reorders);
|
|
124
|
+
let heldEffects = head.takeHeldEffects();
|
|
125
|
+
heldEffects && (head.effects = require_control_flow.ct(heldEffects, head.effects), head.lastEffect = ""), asyncOut.write(head.html), asyncOut.script(head.scripts), head.html = head.scripts = "", asyncOut.writer.get("chunks").push(head), asyncOut.end(), componentScopes.push(componentScope), next();
|
|
126
|
+
}
|
|
127
|
+
})();
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
},
|
|
131
|
+
register: require_control_flow.Ft,
|
|
132
|
+
registerRenderBody(fn) {
|
|
133
|
+
require_control_flow.Ft(RENDER_BODY_ID, fn);
|
|
134
|
+
},
|
|
135
|
+
registerClassFunctions(input) {
|
|
136
|
+
for (let key in input) {
|
|
137
|
+
let value = input[key];
|
|
138
|
+
typeof value == "function" && !require_control_flow.Pt.has(value) && require_control_flow.Ft(RENDER_BODY_ID, value);
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
registerClassFunction($global, id, fn, hostId) {
|
|
142
|
+
let pending = pendingClassFunctions.get($global);
|
|
143
|
+
return pending || pendingClassFunctions.set($global, pending = []), pending.push([
|
|
144
|
+
id,
|
|
145
|
+
fn,
|
|
146
|
+
hostId
|
|
147
|
+
]), fn;
|
|
148
|
+
},
|
|
149
|
+
hasPendingClassFunctions($global) {
|
|
150
|
+
return !!pendingClassFunctions.get($global)?.length;
|
|
151
|
+
}
|
|
152
|
+
}, pendingClassFunctions = /* @__PURE__ */ new WeakMap();
|
|
153
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
154
|
+
// src/common/compat-meta.ts
|
|
155
|
+
// src/html/compat.feat.ts
|
|
156
|
+
function drainClassFunctions($global, writeScope) {
|
|
157
|
+
let pending = pendingClassFunctions.get($global), scopeByHost = {};
|
|
158
|
+
for (let [id, fn, hostId] of pending) require_control_flow.Ft(id, fn, scopeByHost[hostId] ||= writeScope(hostId));
|
|
159
|
+
pending.length = 0;
|
|
160
|
+
}
|
|
161
|
+
function swapReorders(state, reorders) {
|
|
162
|
+
let { writeReorders } = state;
|
|
163
|
+
return state.writeReorders = reorders, writeReorders;
|
|
164
|
+
}
|
|
165
|
+
exports.compat = compat;
|