marko 6.4.11 → 6.4.13
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-DjUZd-9y.mjs → dom-BORByF2b.mjs} +54 -27
- package/dist/debug/{dom-mQ5mPBTF.js → dom-sfzdCRAg.js} +71 -38
- 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-HEWdZCCb.mjs → dom-DKn1bCPC.mjs} +15 -19
- package/dist/{dom-B8j2453O.js → dom-DRiewpRL.js} +127 -136
- 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/core/if.d.ts +0 -85
- package/dist/translator/core/index.d.ts +2 -85
- package/dist/translator/index.d.ts +2 -85
- package/dist/translator/index.js +332 -476
- package/dist/translator/interop/index.d.ts +2 -0
- 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
- package/tags/await.d.marko +9 -1
- package/tags/const.d.marko +7 -1
- package/tags/debug.d.marko +7 -1
- package/tags/define.d.marko +7 -1
- package/tags/effect.d.marko +6 -1
- package/tags/html-comment.d.marko +6 -0
- package/tags/html-script.d.marko +5 -0
- package/tags/html-style.d.marko +5 -0
- package/tags/id.d.marko +11 -1
- package/tags/let.d.marko +8 -1
- package/tags/lifecycle.d.marko +11 -1
- package/tags/log.d.marko +7 -1
- package/tags/script.d.marko +9 -1
- package/tags/show.d.marko +7 -1
- package/tags/try.d.marko +9 -1
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-DRiewpRL.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.yt[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.in((_) => {
|
|
37
|
+
branch = require_control_flow.ht($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.Jt(branch, parentNode, nextSibling), require_control_flow.un(effects), {
|
|
109
40
|
get value() {
|
|
110
41
|
return curValue;
|
|
111
42
|
},
|
|
112
43
|
set value(newValue) {
|
|
113
|
-
require_control_flow.
|
|
44
|
+
require_control_flow.Gt(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.un(require_control_flow.in((_) => args(branch, newInput))));
|
|
117
48
|
},
|
|
118
49
|
destroy() {
|
|
119
|
-
require_control_flow.
|
|
50
|
+
require_control_flow.Yt(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.an(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.sn(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.an(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.Xt(branch), renderer.b(branch, parent().namespaceURI), branch.X = 0, require_control_flow.gt(renderer, branch);
|
|
148
79
|
}, insert = (_) => {
|
|
149
|
-
require_control_flow.
|
|
80
|
+
require_control_flow.Jt(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.an(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.an(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.dn ? (scope.X ||= /* @__PURE__ */ new Map()).set(pending, [value, apply]) : apply._ ? apply._(scope, value) : pending.then((mod) => require_control_flow.an(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.Qt, exports.$signalReset = require_control_flow.$t, exports._assert_class_toggles = require_control_flow.gn, exports._assert_hoist = require_control_flow._n, exports._assert_init = require_control_flow.Kt, 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.yn, exports._closure = require_control_flow.Dt, exports._closure_get = require_control_flow.Ot, exports._const = require_control_flow.kt, 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._t, exports._el = require_control_flow.vt, exports._el_read = require_control_flow.At, exports._for_closure = require_control_flow.jt, 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.Mt, 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.Nt, exports._hoist = require_control_flow.Pt, exports._hoist_read_error = require_control_flow.vn, exports._hoist_resume = require_control_flow.Ft, exports._html = require_control_flow.it, exports._id = require_control_flow.It, exports._if = require_control_flow.f, exports._if_closure = require_control_flow.Lt, exports._let = require_control_flow.Rt, exports._let_change = require_control_flow.zt, 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.Zt, exports._or = require_control_flow.Bt, exports._resumed = require_control_flow.yt, exports._return = require_control_flow.Vt, exports._return_change = require_control_flow.Ht, exports._return_setup = require_control_flow.mt, exports._script = require_control_flow.Ut, 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.Wt, exports._var_change = require_control_flow.Gt, exports._var_resume = require_control_flow.bt, exports.attrTag = attrTag, exports.attrTags = attrTags, exports.forIn = require_control_flow.fn, exports.forOf = require_control_flow.pn, exports.forTo = require_control_flow.mn, exports.forUntil = require_control_flow.hn, exports.init = require_control_flow.St, exports.initEmbedded = require_control_flow.Ct, exports.onAbort = require_control_flow.en, exports.ready = require_control_flow.wt, exports.readyFailed = require_control_flow.Tt, exports.run = require_control_flow.ln;
|
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 $signalReset, A as _attr_input_value_attribute_default, At as _el_read, B as _controllable_textarea, Bt as _or, C as _attr_input_checked, Ct as initEmbedded, D as _attr_input_checked_default, Dt as _closure, E as _attr_input_checkedValue_script, F as _attr_select_value_default, Ft as _hoist_resume, G as _attr_class_item, Gt as _var_change, Ht as _return_change, I as _attr_select_value_script, It as _id, J as _attr_content, Jt as insertBranchBefore, K as _attr_class_items, Kt as _assert_init, L as _controllable_input, Lt as _if_closure, M as _attr_input_value_dynamic_default, Mt as _for_selector, N as _attr_input_value_script, Nt as _global_read, O as _attr_input_checked_script, Ot as _closure_get, P as _attr_select_value, Pt as _hoist, Q as _attr_style_items, Qt as $signal, R as _controllable_open, Rt as _let, S as _attr_details_or_dialog_open_script, St as init, T as _attr_input_checkedValue_default, Tt as readyFailed, U as _attr, Ut as _script, Vt as _return, W as _attr_class, Wt as _var, X as _attr_style, Xt as syncGen, Y as _attr_nonce, Yt as removeAndDestroyBranch, Z as _attr_style_item, Zt as _on, _ as renderCatch, _n as _assert_hoist, _t as _dynamic_tag_var_resume, a as _for_in, an as queueAsyncRender, at as _lifecycle, b as _attr_details_or_dialog_open, bt as _var_resume, c as _for_to, ct as _text, d as _for_until_unkeyed, dn as runId, dt as _content, en as onAbort, et as _attrs_content, f as _if, fn as forIn, ft as _content_closures, gn as _assert_class_toggles, gt as setupBranch, hn as forUntil, ht as createBranch, i as _dynamic_tag_content, in as prepareEffects, it as _html, j as _attr_input_value_default, jt as _for_closure, k as _attr_input_value, kt as _const, l as _for_to_unkeyed, ln as run, lt as _text_content, m as _try, mn as forTo, mt as _return_setup, n as _await_promise, nt as _attrs_partial_content, o as _for_of, ot as _style_rule_item, p as _show, pn as forOf, pt as _content_resume, q as _attr_class_names, r as _dynamic_tag, rt as _attrs_script, s as _for_of_unkeyed, sn as queueRender, st as _style_shell, t as _await_content, tt as _attrs_partial, u as _for_until, un as runEffects, ut as _to_text, vn as _hoist_read_error, vt as _el, w as _attr_input_checkedValue, wt as ready, x as _attr_details_or_dialog_open_default, y as startAwait, yn as _call, yt as _resumed, z as _controllable_select, zt as _let_change } from "./dom-DKn1bCPC.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;
|