marko 6.4.10 → 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/accessor.d.ts +0 -3
- package/dist/common/accessor.debug.d.ts +0 -3
- package/dist/common/attr-tag.d.ts +1 -0
- package/dist/common/errors.d.ts +2 -0
- package/dist/common/helpers.d.ts +3 -1
- package/dist/common/types.d.ts +4 -3
- 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-DNB5yq3U.js → dom-CtXOr4Nm.js} +257 -230
- package/dist/debug/{dom-C1V5vpFs.mjs → dom-DaHYZpf2.mjs} +238 -229
- package/dist/debug/dom.js +8 -134
- package/dist/debug/dom.mjs +5 -126
- 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 -4239
- package/dist/debug/html.mjs +1 -4152
- package/dist/dom/abort-signal.d.ts +1 -1
- package/dist/dom/catch.feat.js +3 -3
- 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 +4 -5
- 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 +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/load.d.ts +3 -4
- package/dist/dom/placeholder.feat.js +3 -3
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/dom/queue.d.ts +1 -2
- package/dist/dom/resume.d.ts +3 -1
- package/dist/dom/signals.d.ts +5 -7
- package/dist/{dom-C2-Flitp.js → dom-BB-Te-3z.js} +222 -239
- package/dist/{dom-DsHYWMCR.mjs → dom-BO-0hzLZ.mjs} +124 -146
- package/dist/dom.d.ts +1 -2
- package/dist/dom.js +17 -95
- package/dist/dom.mjs +6 -79
- package/dist/html/assets.d.ts +3 -4
- 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/for.d.ts +0 -1
- package/dist/html/writer.d.ts +4 -3
- package/dist/html-DMDc0zKs.mjs +2404 -0
- package/dist/html-DrHsybFm.js +2880 -0
- package/dist/html.d.ts +1 -2
- package/dist/html.js +2 -2578
- package/dist/html.mjs +3 -2573
- package/dist/translator/index.d.ts +0 -1
- package/dist/translator/index.js +4889 -4733
- package/dist/translator/interop/out-global.d.ts +5 -0
- package/dist/translator/util/assert.d.ts +6 -0
- package/dist/translator/util/branch-tag.d.ts +1 -1
- package/dist/translator/util/entry-builder.d.ts +1 -1
- package/dist/translator/util/finalize-references.d.ts +2 -1
- package/dist/translator/util/for-selector.d.ts +1 -1
- package/dist/translator/util/known-tag.d.ts +10 -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 +12 -5
- package/dist/translator/util/runtime.d.ts +1 -0
- package/dist/translator/util/sections.d.ts +11 -2
- package/dist/translator/util/signals.d.ts +2 -1
- package/dist/translator/util/style-interpolation.d.ts +1 -1
- package/dist/translator/util/tag-facts.d.ts +2 -0
- package/dist/translator/util/tag-name-type.d.ts +1 -0
- package/dist/translator/util/translate-attrs.d.ts +1 -4
- package/dist/translator/util/visitors.d.ts +1 -1
- package/dist/translator/util/write-guard.d.ts +2 -0
- package/dist/translator/visitors/program/index.d.ts +2 -6
- package/dist/translator/visitors/referenced-identifier.d.ts +3 -1
- package/index.d.ts +2 -7
- package/package.json +4 -4
- package/dist/common/constants/keyed-scopes-prop.d.ts +0 -4
- package/dist/common/constants/keyed-scopes-prop.debug.d.ts +0 -4
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.sn,
|
|
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.dn(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.ln ? renderBranch() : require_control_flow.an(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;
|
|
@@ -103,31 +34,27 @@ function mount(input = {}, reference, position) {
|
|
|
103
34
|
case "afterend": parentNode = reference.parentNode, nextSibling = reference.nextSibling;
|
|
104
35
|
}
|
|
105
36
|
let curValue, args = this.d, effects = require_control_flow.an((_) => {
|
|
106
|
-
branch = require_control_flow.
|
|
107
|
-
curValue = newValue;
|
|
108
|
-
}, this.c?.(branch), args?.(branch, input);
|
|
37
|
+
branch = require_control_flow.gt($global, this, void 0, parentNode), branch.T = (newValue) => curValue = newValue, this.c?.(branch), args?.(branch, input);
|
|
109
38
|
});
|
|
110
|
-
return require_control_flow.
|
|
39
|
+
return require_control_flow.Yt(branch, parentNode, nextSibling), require_control_flow.dn(effects), {
|
|
111
40
|
get value() {
|
|
112
41
|
return curValue;
|
|
113
42
|
},
|
|
114
43
|
set value(newValue) {
|
|
115
|
-
require_control_flow.
|
|
44
|
+
require_control_flow.Kt(branch, newValue);
|
|
116
45
|
},
|
|
117
46
|
update(newInput = {}) {
|
|
118
|
-
args && (newInput.$global && ({$global, ...newInput} = newInput), require_control_flow.dn(require_control_flow.an((_) =>
|
|
119
|
-
args(branch, newInput);
|
|
120
|
-
})));
|
|
47
|
+
args && (newInput.$global && ({$global, ...newInput} = newInput), require_control_flow.dn(require_control_flow.an((_) => args(branch, newInput))));
|
|
121
48
|
},
|
|
122
49
|
destroy() {
|
|
123
|
-
require_control_flow.
|
|
50
|
+
require_control_flow.Xt(branch);
|
|
124
51
|
}
|
|
125
52
|
};
|
|
126
53
|
}
|
|
127
54
|
// src/dom/load.ts
|
|
128
55
|
function _load_template(id, load) {
|
|
129
56
|
let pending, lazyTemplate = _template(id, 0, 0, (branch) => {
|
|
130
|
-
let awaitCounter = require_control_flow.
|
|
57
|
+
let awaitCounter = require_control_flow.y(branch);
|
|
131
58
|
branch.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((renderer) => {
|
|
132
59
|
Object.assign(lazyTemplate, renderer), require_control_flow.on(branch, (branch) => insertLoaded(renderer, branch, branch.S, awaitCounter));
|
|
133
60
|
}, loadFailed(branch, awaitCounter));
|
|
@@ -139,21 +66,21 @@ function _load_setup(load) {
|
|
|
139
66
|
return (owner, child, marker) => {
|
|
140
67
|
if (child.X ||= /* @__PURE__ */ new Map(), renderer) require_control_flow.cn(child, insertCached, -1, marker);
|
|
141
68
|
else {
|
|
142
|
-
let awaitCounter = require_control_flow.
|
|
69
|
+
let awaitCounter = require_control_flow.y(owner);
|
|
143
70
|
(pending ||= load()).then((mod) => {
|
|
144
|
-
renderer ||= require_control_flow.
|
|
71
|
+
renderer ||= require_control_flow.dt("", ...mod._)(), require_control_flow.on(child, (child) => insertLoaded(renderer, child, marker, awaitCounter));
|
|
145
72
|
}, loadFailed(child, awaitCounter));
|
|
146
73
|
}
|
|
147
74
|
};
|
|
148
75
|
}
|
|
149
76
|
function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
150
77
|
let parent = (_) => marker.parentNode, values = branch.X, create = (_) => {
|
|
151
|
-
require_control_flow.
|
|
78
|
+
require_control_flow.Zt(branch), renderer.b(branch, parent().namespaceURI), branch.X = 0, require_control_flow._t(renderer, branch);
|
|
152
79
|
}, insert = (_) => {
|
|
153
|
-
require_control_flow.
|
|
80
|
+
require_control_flow.Yt(branch, parent(), marker), marker.remove(), awaitCounter?.c();
|
|
154
81
|
}, remaining;
|
|
155
|
-
if (remaining = values
|
|
156
|
-
awaitCounter ||= require_control_flow.
|
|
82
|
+
if (remaining = values.size) {
|
|
83
|
+
awaitCounter ||= require_control_flow.y(branch);
|
|
157
84
|
let fail = loadFailed(branch, awaitCounter);
|
|
158
85
|
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && require_control_flow.on(branch, (branch) => {
|
|
159
86
|
create(), values.forEach(([value, apply]) => apply(branch, value)), insert();
|
|
@@ -162,7 +89,7 @@ function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
|
162
89
|
}
|
|
163
90
|
function loadFailed(scope, awaitCounter) {
|
|
164
91
|
return (error) => {
|
|
165
|
-
awaitCounter && (awaitCounter.m ? awaitCounter.i = 0 : awaitCounter.i && awaitCounter.c()), require_control_flow.on(scope, require_control_flow.
|
|
92
|
+
awaitCounter && (awaitCounter.m ? awaitCounter.i = 0 : awaitCounter.i && awaitCounter.c()), require_control_flow.on(scope, require_control_flow._, error);
|
|
166
93
|
};
|
|
167
94
|
}
|
|
168
95
|
function _load_signal(load) {
|
|
@@ -194,9 +121,4 @@ function _load_race_trigger(...triggers) {
|
|
|
194
121
|
function getSelectorOrResolve(selector, resolve) {
|
|
195
122
|
return document.querySelector(selector) || resolve();
|
|
196
123
|
}
|
|
197
|
-
exports.$signal = require_control_flow
|
|
198
|
-
enumerable: !0,
|
|
199
|
-
get: function() {
|
|
200
|
-
return require_control_flow.r;
|
|
201
|
-
}
|
|
202
|
-
}), 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.yn, 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.pn, exports.forOf = require_control_flow.mn, exports.forTo = require_control_flow.hn, exports.forUntil = require_control_flow.gn, exports.init = require_control_flow.wt, exports.initEmbedded = require_control_flow.Tt, exports.ready = require_control_flow.Et, exports.readyFailed = require_control_flow.Dt, exports.run = require_control_flow.un;
|
|
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;
|
|
@@ -102,9 +33,7 @@ function mount(input = {}, reference, position) {
|
|
|
102
33
|
case "afterend": parentNode = reference.parentNode, nextSibling = reference.nextSibling;
|
|
103
34
|
}
|
|
104
35
|
let curValue, args = this.d, effects = prepareEffects((_) => {
|
|
105
|
-
branch = createBranch($global, this, void 0, parentNode), branch.T = (newValue) =>
|
|
106
|
-
curValue = newValue;
|
|
107
|
-
}, this.c?.(branch), args?.(branch, input);
|
|
36
|
+
branch = createBranch($global, this, void 0, parentNode), branch.T = (newValue) => curValue = newValue, this.c?.(branch), args?.(branch, input);
|
|
108
37
|
});
|
|
109
38
|
return insertBranchBefore(branch, parentNode, nextSibling), runEffects(effects), {
|
|
110
39
|
get value() {
|
|
@@ -114,9 +43,7 @@ function mount(input = {}, reference, position) {
|
|
|
114
43
|
_var_change(branch, newValue);
|
|
115
44
|
},
|
|
116
45
|
update(newInput = {}) {
|
|
117
|
-
args && (newInput.$global && ({$global, ...newInput} = newInput), runEffects(prepareEffects((_) =>
|
|
118
|
-
args(branch, newInput);
|
|
119
|
-
})));
|
|
46
|
+
args && (newInput.$global && ({$global, ...newInput} = newInput), runEffects(prepareEffects((_) => args(branch, newInput))));
|
|
120
47
|
},
|
|
121
48
|
destroy() {
|
|
122
49
|
removeAndDestroyBranch(branch);
|
|
@@ -151,7 +78,7 @@ function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
|
151
78
|
}, insert = (_) => {
|
|
152
79
|
insertBranchBefore(branch, parent(), marker), marker.remove(), awaitCounter?.c();
|
|
153
80
|
}, remaining;
|
|
154
|
-
if (remaining = values
|
|
81
|
+
if (remaining = values.size) {
|
|
155
82
|
awaitCounter ||= startAwait(branch);
|
|
156
83
|
let fail = loadFailed(branch, awaitCounter);
|
|
157
84
|
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && queueAsyncRender(branch, (branch) => {
|
|
@@ -193,4 +120,4 @@ function _load_race_trigger(...triggers) {
|
|
|
193
120
|
function getSelectorOrResolve(selector, resolve) {
|
|
194
121
|
return document.querySelector(selector) || resolve();
|
|
195
122
|
}
|
|
196
|
-
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 };
|
package/dist/html/assets.d.ts
CHANGED
|
@@ -28,11 +28,10 @@ export interface EventTrigger {
|
|
|
28
28
|
options?: never;
|
|
29
29
|
}
|
|
30
30
|
export type LoadTrigger = VisibleTrigger | IdleTrigger | MediaTrigger | EventTrigger;
|
|
31
|
-
type Trigger = LoadTrigger;
|
|
32
31
|
interface Asset {
|
|
33
32
|
id: string;
|
|
34
33
|
flush: AssetFlush;
|
|
35
|
-
triggers:
|
|
34
|
+
triggers: LoadTrigger[] | undefined;
|
|
36
35
|
block: string | undefined;
|
|
37
36
|
defer: string | undefined;
|
|
38
37
|
script: string | undefined;
|
|
@@ -46,8 +45,8 @@ declare module "../common/types" {
|
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
47
|
type AssetFlush = (g: $Global, type: "block" | "defer", asset: string) => string;
|
|
49
|
-
export declare function withLoadAssets(template: () => ServerRenderer, id: string, flush: AssetFlush, assetId: string, triggers?:
|
|
50
|
-
export declare function writeLoadAsset(assetId: string, flush: AssetFlush, triggers?:
|
|
48
|
+
export declare function withLoadAssets(template: () => ServerRenderer, id: string, flush: AssetFlush, assetId: string, triggers?: LoadTrigger[]): ServerRenderer;
|
|
49
|
+
export declare function writeLoadAsset(assetId: string, flush: AssetFlush, triggers?: LoadTrigger[]): void;
|
|
51
50
|
export declare function withPageAssets(template: ServerRenderer & Template, flush: AssetFlush, assetId: string, runtimeId?: string): Template;
|
|
52
51
|
export declare function _flush_head(): string;
|
|
53
52
|
export {};
|
|
@@ -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;
|