marko 6.3.52 → 6.3.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cheatsheet.md +1 -0
- package/dist/common/constants/renderer-prop.d.ts +0 -1
- package/dist/common/constants/renderer-prop.debug.d.ts +0 -1
- package/dist/common/helpers.d.ts +1 -0
- package/dist/debug/dom/catch.feat.js +1 -1
- package/dist/debug/dom/catch.feat.mjs +1 -1
- package/dist/debug/dom/controllable-input.feat.js +1 -1
- package/dist/debug/dom/controllable-input.feat.mjs +1 -1
- package/dist/debug/dom/controllable-open.feat.js +1 -1
- package/dist/debug/dom/controllable-open.feat.mjs +1 -1
- package/dist/debug/dom/controllable-select.feat.js +1 -1
- package/dist/debug/dom/controllable-select.feat.mjs +1 -1
- package/dist/debug/dom/controllable-textarea.feat.js +1 -1
- package/dist/debug/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/debug/dom/controllable.feat.js +1 -1
- package/dist/debug/dom/controllable.feat.mjs +1 -1
- package/dist/debug/dom/dynamic-tag-script.feat.js +5 -0
- package/dist/debug/dom/dynamic-tag-script.feat.mjs +4 -0
- package/dist/debug/dom/dynamic-tag-var.feat.js +2 -3
- package/dist/debug/dom/dynamic-tag-var.feat.mjs +2 -3
- package/dist/debug/dom/placeholder.feat.js +1 -1
- package/dist/debug/dom/placeholder.feat.mjs +1 -1
- package/dist/debug/{dom-BJKb8-wr.js → dom-CI0Vojyk.js} +146 -88
- package/dist/debug/{dom-Dq_Yu7MS.mjs → dom-tl43c2wO.mjs} +113 -85
- package/dist/debug/dom.js +10 -8
- package/dist/debug/dom.mjs +7 -8
- package/dist/debug/html.js +52 -26
- package/dist/debug/html.mjs +52 -26
- package/dist/dom/catch.feat.js +4 -4
- package/dist/dom/catch.feat.mjs +1 -1
- package/dist/dom/control-flow.d.ts +5 -4
- 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/dynamic-tag-script.feat.d.ts +1 -0
- package/dist/dom/dynamic-tag-script.feat.js +4 -0
- package/dist/dom/dynamic-tag-script.feat.mjs +4 -0
- package/dist/dom/dynamic-tag-var.feat.js +1 -2
- package/dist/dom/dynamic-tag-var.feat.mjs +2 -3
- package/dist/dom/load.d.ts +2 -2
- package/dist/dom/placeholder.feat.js +3 -3
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/dom/renderer.d.ts +2 -3
- package/dist/dom/resume.d.ts +1 -0
- package/dist/dom/signals.d.ts +1 -1
- package/dist/{dom-CzfddxCE.mjs → dom-4udEPZaj.mjs} +77 -58
- package/dist/{dom-CzGPOsST.js → dom-C1mr-TA7.js} +213 -174
- package/dist/dom.d.ts +2 -2
- package/dist/dom.js +40 -42
- package/dist/dom.mjs +6 -8
- package/dist/html/dynamic-tag.d.ts +2 -1
- package/dist/html/serializer.d.ts +3 -2
- package/dist/html/writer.d.ts +6 -5
- package/dist/html.js +35 -20
- package/dist/html.mjs +35 -20
- package/dist/translator/index.js +2863 -2666
- package/dist/translator/util/binding-has-prop.d.ts +1 -0
- package/dist/translator/util/branch-tag.d.ts +6 -1
- package/dist/translator/util/optional.d.ts +2 -0
- package/dist/translator/util/references.d.ts +26 -12
- package/dist/translator/util/runtime.d.ts +2 -1
- package/dist/translator/util/sections.d.ts +11 -8
- package/dist/translator/util/serialize-guard.d.ts +1 -7
- package/dist/translator/util/serialize-reasons.d.ts +3 -0
- package/dist/translator/util/set-tag-sections-downstream.d.ts +1 -1
- package/dist/translator/util/signals.d.ts +4 -1
- package/dist/translator/util/structure.d.ts +1 -1
- package/dist/translator/util/tag-name-type.d.ts +1 -1
- package/dist/translator/visitors/function.d.ts +1 -0
- package/dist/translator/visitors/import-declaration.d.ts +1 -0
- package/dist/translator/visitors/tag/custom-tag.d.ts +5 -0
- package/package.json +4 -4
- package/tags/try.d.marko +2 -0
- package/tags-html.d.ts +6 -0
package/dist/dom.d.ts
CHANGED
|
@@ -4,14 +4,14 @@ export { forIn, forOf, forTo, forUntil } from "./common/for";
|
|
|
4
4
|
export { _call } from "./common/helpers";
|
|
5
5
|
export { $signal, $signalReset } from "./dom/abort-signal";
|
|
6
6
|
export { compat } from "./dom/compat";
|
|
7
|
-
export { _await_content, _await_promise, _dynamic_tag, _dynamic_tag_content, _for_in, _for_of, _for_to, _for_until,
|
|
7
|
+
export { _await_content, _await_promise, _dynamic_tag, _dynamic_tag_content, _for_in, _for_of, _for_of_unkeyed, _for_to, _for_to_unkeyed, _for_until, _for_until_unkeyed, _if, _show, _try, } from "./dom/control-flow";
|
|
8
8
|
export { _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checked_default, _attr_input_checked_script, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_input_value as _attr_textarea_value, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_script as _attr_textarea_value_script, _controllable_input, _controllable_open, _controllable_select, _controllable_textarea, } from "./dom/controllable";
|
|
9
9
|
export { _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_content, _attr_nonce, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _html, _lifecycle, _style_rule_item, _style_shell, _text, _text_content, _to_text, } from "./dom/dom";
|
|
10
10
|
export { _on } from "./dom/event";
|
|
11
11
|
export { _load_event_trigger, _load_idle_trigger, _load_media_trigger, _load_race_trigger, _load_setup, _load_signal, _load_template, _load_visible_trigger, } from "./dom/load";
|
|
12
12
|
export { run } from "./dom/queue";
|
|
13
13
|
export { _content, _content_closures, _content_resume } from "./dom/renderer";
|
|
14
|
-
export { _el, _resumed, _var_resume, init, initEmbedded, ready, readyFailed, } from "./dom/resume";
|
|
14
|
+
export { _el, _resume_dynamic_tag_var, _resumed, _var_resume, init, initEmbedded, ready, readyFailed, } from "./dom/resume";
|
|
15
15
|
export { _assert_init } from "./dom/scope";
|
|
16
16
|
export { _child_setup, _closure, _closure_get, _const, _el_read, _global_read, _for_closure, _for_selector, _hoist, _hoist_resume, _id, _if_closure, _let, _let_change, _or, _return, _return_change, _script, _var, _var_change, } from "./dom/signals";
|
|
17
17
|
export { _template } from "./dom/template";
|
package/dist/dom.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
let require_control_flow = require("./dom-
|
|
2
|
-
require_control_flow.
|
|
1
|
+
let require_control_flow = require("./dom-C1mr-TA7.js"), empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), classEventResolver, scopesByRender = /* @__PURE__ */ new WeakMap(), getRenderScopes = ($global) => {
|
|
2
|
+
require_control_flow.Ct($global.runtimeId);
|
|
3
3
|
let render = self[$global.runtimeId]?.[$global.renderId], scopes = render && scopesByRender.get(render);
|
|
4
4
|
return render && !scopes && scopesByRender.set(render, scopes = {}), scopes;
|
|
5
5
|
}, compat = {
|
|
6
|
-
patchDynamicTag: require_control_flow.
|
|
7
|
-
queueEffect: require_control_flow.
|
|
6
|
+
patchDynamicTag: require_control_flow.v,
|
|
7
|
+
queueEffect: require_control_flow.sn,
|
|
8
8
|
init(warp10Noop) {
|
|
9
|
-
require_control_flow.
|
|
9
|
+
require_control_flow.bt.$C_s = (scope) => {
|
|
10
10
|
if (getRenderScopes(scope.$)[scope.L] = scope, scope.m5c && classIdToBranch.set(scope.m5c, scope), classEventResolver) for (let key in scope) {
|
|
11
11
|
let resolved = classEventResolver(scope[key], scope);
|
|
12
12
|
resolved !== scope[key] && (scope[key] = resolved);
|
|
13
13
|
}
|
|
14
|
-
}, require_control_flow.
|
|
14
|
+
}, require_control_flow.bt.$C_b = warp10Noop;
|
|
15
15
|
},
|
|
16
16
|
setClassEventResolver(fn) {
|
|
17
17
|
classEventResolver = fn;
|
|
18
18
|
},
|
|
19
19
|
resumeClassFunction(id, build) {
|
|
20
|
-
require_control_flow.
|
|
20
|
+
require_control_flow.bt[id] = build;
|
|
21
21
|
},
|
|
22
22
|
getScope($global, scopeId) {
|
|
23
23
|
return getRenderScopes($global)?.[scopeId];
|
|
@@ -38,59 +38,57 @@ let require_control_flow = require("./dom-CzGPOsST.js"), empty = [], rest = Symb
|
|
|
38
38
|
branch.S = startNode, branch.K = endNode;
|
|
39
39
|
},
|
|
40
40
|
runComponentEffects() {
|
|
41
|
-
this.effects && require_control_flow.
|
|
41
|
+
this.effects && require_control_flow.un(this.effects);
|
|
42
42
|
},
|
|
43
43
|
runComponentDestroy() {
|
|
44
|
-
this.scope && require_control_flow.
|
|
44
|
+
this.scope && require_control_flow.Yt(this.scope);
|
|
45
45
|
},
|
|
46
46
|
resolveRegistered(value, $global) {
|
|
47
|
-
return Array.isArray(value) && typeof value[0] == "string" ? require_control_flow.
|
|
47
|
+
return Array.isArray(value) && typeof value[0] == "string" ? require_control_flow.St(value[0], getRenderScopes($global)?.[value[1]]) : value;
|
|
48
48
|
},
|
|
49
49
|
createRenderer(params, clone) {
|
|
50
|
-
let renderer = require_control_flow.
|
|
50
|
+
let renderer = require_control_flow.ft("", 0, 0, 0, params)();
|
|
51
51
|
return renderer.b = (branch) => {
|
|
52
52
|
let cloned = clone();
|
|
53
53
|
branch.S = cloned.startNode, branch.K = cloned.endNode;
|
|
54
54
|
}, renderer;
|
|
55
55
|
},
|
|
56
56
|
render(out, component, renderer, args) {
|
|
57
|
-
require_control_flow.
|
|
57
|
+
require_control_flow.Ct(out.global.runtimeId);
|
|
58
58
|
let branch = component.scope, created = 0;
|
|
59
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
60
|
let input = args[0], normalizedInput = args[0] = {};
|
|
61
61
|
for (let key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
|
|
62
62
|
}
|
|
63
|
-
if (component.effects = require_control_flow.
|
|
64
|
-
branch ||= (created = 1, component.scope = require_control_flow.
|
|
65
|
-
}), created) return require_control_flow.
|
|
63
|
+
if (component.effects = require_control_flow.an(() => {
|
|
64
|
+
branch ||= (created = 1, component.scope = require_control_flow.ht(out.global, renderer, renderer.e, document.body)), renderer.d?.(branch, renderer._ ? args[0] : args);
|
|
65
|
+
}), created) return require_control_flow.dt(branch.S, branch.K);
|
|
66
66
|
}
|
|
67
67
|
}, _template = (id, template, walks, setup, inputSignal) => {
|
|
68
|
-
let renderer = require_control_flow.
|
|
69
|
-
return renderer.mount = mount, renderer._ = renderer, require_control_flow.
|
|
70
|
-
}, noop = (_) => 0, _load_template = /*@__PURE__*/ require_control_flow.
|
|
68
|
+
let renderer = require_control_flow.ft(id, template, walks, setup, inputSignal)();
|
|
69
|
+
return renderer.mount = mount, renderer._ = renderer, require_control_flow.bt[id] = renderer;
|
|
70
|
+
}, noop = (_) => 0, _load_template = /*@__PURE__*/ require_control_flow.Dt((id, load) => {
|
|
71
71
|
let pending, lazyTemplate = _template(id, 0, 0, (branch) => {
|
|
72
|
-
let awaitCounter = require_control_flow.
|
|
72
|
+
let awaitCounter = require_control_flow.h(branch);
|
|
73
73
|
branch.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((renderer) => {
|
|
74
|
-
Object.assign(lazyTemplate, renderer), require_control_flow.
|
|
74
|
+
Object.assign(lazyTemplate, renderer), require_control_flow.on(branch, (branch) => insertLoaded(renderer, branch, branch.S, awaitCounter));
|
|
75
75
|
}, loadFailed(branch, awaitCounter));
|
|
76
76
|
}, _load_signal(() => (pending ||= load()).then((r) => ({ _: r.d || noop }))));
|
|
77
77
|
return lazyTemplate;
|
|
78
|
-
}), _load_setup = /*@__PURE__*/ require_control_flow.
|
|
79
|
-
nodeAccessor = require_control_flow.hn(nodeAccessor), childScopeAccessor = require_control_flow.hn(childScopeAccessor);
|
|
78
|
+
}), _load_setup = /*@__PURE__*/ require_control_flow.Dt((load) => {
|
|
80
79
|
let pending, renderer, insertCached = (child, marker) => insertLoaded(renderer, child, marker);
|
|
81
|
-
return (owner) => {
|
|
82
|
-
|
|
83
|
-
if (renderer) require_control_flow.in(child, insertCached, -1, owner[nodeAccessor]);
|
|
80
|
+
return (owner, child, marker) => {
|
|
81
|
+
if (renderer) require_control_flow.cn(child, insertCached, -1, marker);
|
|
84
82
|
else {
|
|
85
|
-
let awaitCounter = require_control_flow.
|
|
83
|
+
let awaitCounter = require_control_flow.h(owner);
|
|
86
84
|
child.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((mod) => {
|
|
87
|
-
renderer
|
|
85
|
+
renderer ||= require_control_flow.ft("", ...mod._)(), require_control_flow.on(child, (child) => insertLoaded(renderer, child, marker, awaitCounter));
|
|
88
86
|
}, loadFailed(child, awaitCounter));
|
|
89
87
|
}
|
|
90
88
|
};
|
|
91
|
-
}), _load_signal = /*@__PURE__*/ require_control_flow.
|
|
89
|
+
}), _load_signal = /*@__PURE__*/ require_control_flow.Dt((load) => {
|
|
92
90
|
let pending, apply = (scope, value) => {
|
|
93
|
-
pending ||= load(), scope.X || !("X" in scope) && scope.H === require_control_flow.
|
|
91
|
+
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.on(scope, apply._ = mod._, value), noop);
|
|
94
92
|
};
|
|
95
93
|
return apply;
|
|
96
94
|
});
|
|
@@ -131,25 +129,25 @@ function mount(input = {}, reference, position) {
|
|
|
131
129
|
parentNode = reference.parentNode, nextSibling = reference.nextSibling;
|
|
132
130
|
break;
|
|
133
131
|
}
|
|
134
|
-
let curValue, args = this.d, effects = require_control_flow.
|
|
135
|
-
branch = require_control_flow.
|
|
132
|
+
let curValue, args = this.d, effects = require_control_flow.an(() => {
|
|
133
|
+
branch = require_control_flow.gt($global, this, void 0, parentNode), branch.T = (newValue) => {
|
|
136
134
|
curValue = newValue;
|
|
137
135
|
}, this.c?.(branch), args?.(branch, input);
|
|
138
136
|
});
|
|
139
|
-
return require_control_flow.
|
|
137
|
+
return require_control_flow.ut(parentNode, nextSibling, branch.S, branch.K), require_control_flow.un(effects), {
|
|
140
138
|
get value() {
|
|
141
139
|
return curValue;
|
|
142
140
|
},
|
|
143
141
|
set value(newValue) {
|
|
144
|
-
require_control_flow.
|
|
142
|
+
require_control_flow.qt(branch, newValue);
|
|
145
143
|
},
|
|
146
144
|
update(newInput = {}) {
|
|
147
|
-
args && (newInput.$global && ({$global, ...newInput} = newInput), require_control_flow.
|
|
145
|
+
args && (newInput.$global && ({$global, ...newInput} = newInput), require_control_flow.un(require_control_flow.an(() => {
|
|
148
146
|
args(branch, newInput);
|
|
149
147
|
})));
|
|
150
148
|
},
|
|
151
149
|
destroy() {
|
|
152
|
-
require_control_flow.
|
|
150
|
+
require_control_flow.Zt(branch);
|
|
153
151
|
}
|
|
154
152
|
};
|
|
155
153
|
}
|
|
@@ -157,20 +155,20 @@ function mount(input = {}, reference, position) {
|
|
|
157
155
|
//#region src/dom/load.ts
|
|
158
156
|
function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
159
157
|
let parent = marker.parentNode, values = branch.X, clone = () => {
|
|
160
|
-
require_control_flow.
|
|
158
|
+
require_control_flow.Qt(branch), renderer.b(branch, parent.namespaceURI), branch.X = 0;
|
|
161
159
|
}, insert = () => {
|
|
162
|
-
require_control_flow.
|
|
160
|
+
require_control_flow.Xt(branch, parent, marker), marker.remove(), awaitCounter?.c();
|
|
163
161
|
}, remaining;
|
|
164
162
|
if (remaining = values?.size) {
|
|
165
163
|
let fail = loadFailed(branch, awaitCounter);
|
|
166
|
-
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && require_control_flow.
|
|
164
|
+
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && require_control_flow.on(branch, (branch) => {
|
|
167
165
|
clone(), renderer.c?.(branch), values.forEach(([value, apply]) => apply(branch, value)), insert();
|
|
168
166
|
}), (error) => remaining > 0 && (remaining = 0, fail(error))));
|
|
169
|
-
} else clone(), require_control_flow.
|
|
167
|
+
} else clone(), require_control_flow._t(renderer, branch), insert();
|
|
170
168
|
}
|
|
171
169
|
function loadFailed(scope, awaitCounter) {
|
|
172
170
|
return (error) => {
|
|
173
|
-
awaitCounter && (awaitCounter.m ? awaitCounter.i = 0 : awaitCounter.c()), require_control_flow.
|
|
171
|
+
awaitCounter && (awaitCounter.m ? awaitCounter.i = 0 : awaitCounter.c()), require_control_flow.on(scope, require_control_flow.y, error);
|
|
174
172
|
};
|
|
175
173
|
}
|
|
176
174
|
function _load_visible_trigger(selector, options) {
|
|
@@ -196,9 +194,9 @@ function _load_race_trigger(...triggers) {
|
|
|
196
194
|
function getSelectorOrResolve(selector, resolve) {
|
|
197
195
|
return document.querySelector(selector) || resolve();
|
|
198
196
|
}
|
|
199
|
-
exports.$signal = require_control_flow.
|
|
197
|
+
exports.$signal = require_control_flow.en, exports.$signalReset = require_control_flow.tn, exports._assert_hoist = require_control_flow.gn, exports._assert_init = require_control_flow.Jt, 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_content = require_control_flow.q, 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.J, 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.Y, exports._attr_style_item = require_control_flow.X, exports._attr_style_items = require_control_flow.Z, exports._attrs = require_control_flow.Q, exports._attrs_content = require_control_flow.$, exports._attrs_partial = require_control_flow.et, exports._attrs_partial_content = require_control_flow.tt, exports._attrs_script = require_control_flow.nt, exports._await_content = require_control_flow.t, exports._await_promise = require_control_flow.n, exports._call = require_control_flow.vn, exports._child_setup = require_control_flow.Ot, exports._closure = require_control_flow.kt, exports._closure_get = require_control_flow.At, exports._const = require_control_flow.jt, exports._content = require_control_flow.ft, exports._content_closures = require_control_flow.pt, exports._content_resume = require_control_flow.mt, 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, Object.defineProperty(exports, "_dynamic_tag", {
|
|
200
198
|
enumerable: !0,
|
|
201
199
|
get: function() {
|
|
202
200
|
return require_control_flow.r;
|
|
203
201
|
}
|
|
204
|
-
}), exports._dynamic_tag_content = require_control_flow.i, exports._el = require_control_flow.
|
|
202
|
+
}), exports._dynamic_tag_content = require_control_flow.i, exports._el = require_control_flow.vt, 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._n, exports._hoist_resume = require_control_flow.Lt, exports._html = require_control_flow.rt, 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.it, 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._resume_dynamic_tag_var = require_control_flow.yt, exports._resumed = require_control_flow.bt, exports._return = require_control_flow.Ut, exports._return_change = require_control_flow.Wt, exports._script = require_control_flow.Gt, exports._show = require_control_flow.p, exports._style_rule_item = require_control_flow.at, exports._style_shell = require_control_flow.ot, exports._template = _template, exports._text = require_control_flow.st, exports._text_content = require_control_flow.ct, exports._to_text = require_control_flow.lt, 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.xt, exports.attrTag = attrTag, exports.attrTags = attrTags, exports.compat = compat, 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.Ct, exports.initEmbedded = require_control_flow.wt, exports.ready = require_control_flow.Tt, exports.readyFailed = require_control_flow.Et, exports.run = require_control_flow.ln;
|
package/dist/dom.mjs
CHANGED
|
@@ -75,16 +75,14 @@ let empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), cl
|
|
|
75
75
|
}, loadFailed(branch, awaitCounter));
|
|
76
76
|
}, _load_signal(() => (pending ||= load()).then((r) => ({ _: r.d || noop }))));
|
|
77
77
|
return lazyTemplate;
|
|
78
|
-
}), _load_setup = /*@__PURE__*/ withLazy((
|
|
79
|
-
nodeAccessor = decodeAccessor(nodeAccessor), childScopeAccessor = decodeAccessor(childScopeAccessor);
|
|
78
|
+
}), _load_setup = /*@__PURE__*/ withLazy((load) => {
|
|
80
79
|
let pending, renderer, insertCached = (child, marker) => insertLoaded(renderer, child, marker);
|
|
81
|
-
return (owner) => {
|
|
82
|
-
|
|
83
|
-
if (renderer) queueRender(child, insertCached, -1, owner[nodeAccessor]);
|
|
80
|
+
return (owner, child, marker) => {
|
|
81
|
+
if (renderer) queueRender(child, insertCached, -1, marker);
|
|
84
82
|
else {
|
|
85
83
|
let awaitCounter = addAwaitCounter(owner);
|
|
86
84
|
child.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((mod) => {
|
|
87
|
-
renderer
|
|
85
|
+
renderer ||= _content("", ...mod._)(), queueAsyncRender(child, (child) => insertLoaded(renderer, child, marker, awaitCounter));
|
|
88
86
|
}, loadFailed(child, awaitCounter));
|
|
89
87
|
}
|
|
90
88
|
};
|
|
@@ -94,7 +92,7 @@ let empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), cl
|
|
|
94
92
|
};
|
|
95
93
|
return apply;
|
|
96
94
|
});
|
|
97
|
-
import { $ as
|
|
95
|
+
import { $ as _attrs_content, $t as _on, A as _attr_input_value_attribute_default, At as _closure_get, B as _controllable_textarea, Bt as _let, C as _attr_input_checked, Ct as init, D as _attr_input_checked_default, Dt as withLazy, E as _attr_input_checkedValue_script, Et as readyFailed, F as _attr_select_value_default, Ft as _global_read, G as _attr_class_item, Gt as _script, Ht as _or, I as _attr_select_value_script, It as _hoist, J as _attr_nonce, Jt as _assert_init, K as _attr_class_items, Kt as _var, L as _controllable_input, Lt as _hoist_resume, M as _attr_input_value_dynamic_default, Mt as _el_read, N as _attr_input_value_script, Nt as _for_closure, O as _attr_input_checked_script, Ot as _child_setup, P as _attr_select_value, Pt as _for_selector, Q as _attrs, Qt as syncGen, R as _controllable_open, Rt as _id, S as _attr_details_or_dialog_open_script, St as getRegisteredWithScope, T as _attr_input_checkedValue_default, Tt as ready, U as _attr, Ut as _return, Vt as _let_change, W as _attr_class, Wt as _return_change, X as _attr_style_item, Xt as insertBranchBefore, Y as _attr_style, Yt as destroyBranch, Z as _attr_style_items, Zt as removeAndDestroyBranch, _n as _hoist_read_error, _t as setupBranch, a as _for_in, an as prepareEffects, at as _style_rule_item, b as _attr_details_or_dialog_open, bt as _resumed, c as _for_to, cn as queueRender, ct as _text_content, d as _for_until_unkeyed, dn as runId, dt as toInsertNode, en as $signal, et as _attrs_partial, f as _if, fn as forIn, ft as _content, gn as _assert_hoist, gt as createBranch, h as addAwaitCounter, hn as forUntil, ht as createAndSetupBranch, i as _dynamic_tag_content, it as _lifecycle, j as _attr_input_value_default, jt as _const, k as _attr_input_value, kt as _closure, l as _for_to_unkeyed, ln as run, lt as _to_text, m as _try, mn as forTo, mt as _content_resume, n as _await_promise, nt as _attrs_script, o as _for_of, on as queueAsyncRender, ot as _style_shell, p as _show, pn as forOf, pt as _content_closures, q as _attr_content, qt as _var_change, r as _dynamic_tag, rt as _html, s as _for_of_unkeyed, sn as queueEffect, st as _text, t as _await_content, tn as $signalReset, tt as _attrs_partial_content, u as _for_until, un as runEffects, ut as insertChildNodes, v as patchDynamicTag, vn as _call, vt as _el, w as _attr_input_checkedValue, wt as initEmbedded, x as _attr_details_or_dialog_open_default, xt as _var_resume, y as renderCatch, yt as _resume_dynamic_tag_var, z as _controllable_select, zt as _if_closure } from "./dom-4udEPZaj.mjs";
|
|
98
96
|
//#region src/common/attr-tag.ts
|
|
99
97
|
function attrTag(attrs) {
|
|
100
98
|
return attrs[Symbol.iterator] = attrTagIterator, attrs[rest] = empty, attrs;
|
|
@@ -197,4 +195,4 @@ function getSelectorOrResolve(selector, resolve) {
|
|
|
197
195
|
return document.querySelector(selector) || resolve();
|
|
198
196
|
}
|
|
199
197
|
//#endregion
|
|
200
|
-
export { $signal, $signalReset, _assert_hoist, _assert_init, _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_checked_default, _attr_input_checked_script, _attr_input_value, _attr_input_value as _attr_textarea_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_input_value_script as _attr_textarea_value_script, _attr_nonce, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _await_content, _await_promise, _call, _child_setup, _closure, _closure_get, _const, _content, _content_closures, _content_resume, _controllable_input, _controllable_open, _controllable_select, _controllable_textarea, _dynamic_tag, _dynamic_tag_content, _el, _el_read, _for_closure, _for_in, _for_of, _for_selector, _for_to, _for_until, _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,
|
|
198
|
+
export { $signal, $signalReset, _assert_hoist, _assert_init, _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_checked_default, _attr_input_checked_script, _attr_input_value, _attr_input_value as _attr_textarea_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_input_value_script as _attr_textarea_value_script, _attr_nonce, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _await_content, _await_promise, _call, _child_setup, _closure, _closure_get, _const, _content, _content_closures, _content_resume, _controllable_input, _controllable_open, _controllable_select, _controllable_textarea, _dynamic_tag, _dynamic_tag_content, _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, _resume_dynamic_tag_var, _resumed, _return, _return_change, _script, _show, _style_rule_item, _style_shell, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, init, initEmbedded, ready, readyFailed, run };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Accessor } from "../common/types";
|
|
2
|
+
import type { Locals } from "./serializer";
|
|
2
3
|
import type { ServerRenderer } from "./template";
|
|
3
4
|
interface BodyContentObject {
|
|
4
5
|
[x: PropertyKey]: unknown;
|
|
@@ -6,6 +7,6 @@ interface BodyContentObject {
|
|
|
6
7
|
}
|
|
7
8
|
export declare let _dynamic_tag: (scopeId: number, accessor: Accessor, tag: unknown | string | ServerRenderer | BodyContentObject, inputOrArgs: unknown, content?: (() => void) | 0, inputIsArgs?: 1, serializeReason?: 1 | 0) => unknown;
|
|
8
9
|
export declare function _content(id: string, fn: ServerRenderer, scopeId?: number): ServerRenderer;
|
|
9
|
-
export declare function _content_resume(id: string, fn: ServerRenderer, scopeId?: number): ServerRenderer;
|
|
10
|
+
export declare function _content_resume(id: string, fn: ServerRenderer, scopeId?: number, locals?: Locals): ServerRenderer;
|
|
10
11
|
export declare const patchDynamicTag: (patch: (tag: unknown, scopeId: number, accessor: Accessor) => unknown) => void;
|
|
11
12
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { Boundary } from "./writer";
|
|
1
|
+
import type { Boundary, PartialScope } from "./writer";
|
|
2
2
|
export declare const K_SCOPE_ID: unique symbol;
|
|
3
|
+
export type Locals = (scope: (scopeId: number) => PartialScope) => (PartialScope | 0)[];
|
|
3
4
|
export type ScopeFlush = [scopeId: number, scope: object, props: object];
|
|
4
5
|
export interface SerializeChannel {
|
|
5
6
|
readyId?: string;
|
|
@@ -22,7 +23,7 @@ export declare class Serializer {
|
|
|
22
23
|
takeChannelDeps(): Set<string> | null;
|
|
23
24
|
writeCall(value: unknown, object: unknown, property: string, channel?: SerializeChannel): void;
|
|
24
25
|
}
|
|
25
|
-
export declare function register<T extends WeakKey>(id: string, val: T, scope?: unknown): T;
|
|
26
|
+
export declare function register<T extends WeakKey>(id: string, val: T, scope?: unknown, locals?: Locals): T;
|
|
26
27
|
export declare function getRegistered(val: WeakKey): {
|
|
27
28
|
id: string;
|
|
28
29
|
scope: unknown;
|
package/dist/html/writer.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type Opt } from "../common/opt";
|
|
|
3
3
|
import { type $Global, type Accessor, type Falsy, ResumeSymbol } from "../common/types";
|
|
4
4
|
import * as FlushStatus from "./constants/flush-status";
|
|
5
5
|
import * as Mark from "./constants/mark";
|
|
6
|
-
import { K_SCOPE_ID, Serializer } from "./serializer";
|
|
6
|
+
import { K_SCOPE_ID, type Locals, Serializer } from "./serializer";
|
|
7
7
|
import type { ServerRenderer } from "./template";
|
|
8
8
|
export type PartialScope = Record<Accessor, unknown>;
|
|
9
9
|
interface SerializeState {
|
|
@@ -40,7 +40,7 @@ export declare function _html(html: string): void;
|
|
|
40
40
|
export declare function writeScript(script: string): void;
|
|
41
41
|
export declare function _script(scopeId: number, registryId: string, serializeMarker?: number): void;
|
|
42
42
|
export declare function _trailers(html: string): void;
|
|
43
|
-
export declare function _resume<T extends WeakKey>(val: T, id: string, scopeId?: number): T;
|
|
43
|
+
export declare function _resume<T extends WeakKey>(val: T, id: string, scopeId?: number, locals?: Locals): T;
|
|
44
44
|
export declare function _resume_locals<T extends WeakKey>(val: T, id: string, locals: Record<string, unknown>, ownerScopeId?: number): T;
|
|
45
45
|
export declare function _el(scopeId: number, id: string): () => void;
|
|
46
46
|
export declare function _hoist(scopeId: number, id: string): {
|
|
@@ -66,9 +66,9 @@ declare let writeScope: (scopeId: number, partialScope: PartialScope) => ScopeIn
|
|
|
66
66
|
export { writeScope as _scope };
|
|
67
67
|
export declare function _existing_scope(scopeId: number): ScopeInternals;
|
|
68
68
|
export declare function _scope_with_id(scopeId: number): ScopeInternals;
|
|
69
|
-
export declare function _subscribe(subscribers: Set<ScopeInternals> | undefined, scope: ScopeInternals): ScopeInternals;
|
|
69
|
+
export declare function _subscribe(subscribers: Set<ScopeInternals> | undefined, scope: ScopeInternals, resumeId?: string, serializeMarker?: number): ScopeInternals;
|
|
70
70
|
export type SerializeReasonValue = undefined | number | Partial<Record<string, number>>;
|
|
71
|
-
export declare const CLIENT_ALL =
|
|
71
|
+
export declare const CLIENT_ALL = 715827883;
|
|
72
72
|
export declare function maskGroup(mask: SerializeReasonValue, group: number): number;
|
|
73
73
|
export declare function _set_serialize_reason(reason: SerializeReasonValue): void;
|
|
74
74
|
export declare function _scope_reason(): SerializeReasonValue;
|
|
@@ -104,6 +104,7 @@ export declare class State implements SerializeState {
|
|
|
104
104
|
serializer: Serializer;
|
|
105
105
|
writeReorders: Chunk[] | null;
|
|
106
106
|
scopes: Map<number, ScopeInternals>;
|
|
107
|
+
scope: (scopeId: number) => ScopeInternals;
|
|
107
108
|
flushScopes: boolean;
|
|
108
109
|
writeScopes: Record<number, PartialScope>;
|
|
109
110
|
readyIds: Set<string> | null;
|
|
@@ -173,7 +174,7 @@ export declare class Chunk {
|
|
|
173
174
|
consume(): Chunk;
|
|
174
175
|
render(content: () => void): Chunk;
|
|
175
176
|
render<T>(content: (val: T) => void, val: T): Chunk;
|
|
176
|
-
flushReadyScripts(reservations?: string[]): string;
|
|
177
|
+
flushReadyScripts(reservations?: string[], holdEffects?: boolean): string;
|
|
177
178
|
flushScript(): this;
|
|
178
179
|
flushHTML(): string;
|
|
179
180
|
}
|
package/dist/html.js
CHANGED
|
@@ -247,7 +247,7 @@ let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeSty
|
|
|
247
247
|
}, unsafeQuoteReg = /["\\<\n\r\u2028\u2029\0\ud800-\udfff]/u, $chunk, kPendingContexts = Symbol("Pending Contexts"), kBranchId = Symbol("Branch Id"), kIsAsync = Symbol("Is Async"), writeScope = (scopeId, partialScope) => {
|
|
248
248
|
let { state } = $chunk.boundary, target = $chunk.serializeState, scope = scopeWithId(state, scopeId), pending = target.writeScopes[scopeId];
|
|
249
249
|
return state.needsMainRuntime = !0, countResumeWrite($chunk.boundary), Object.assign(scope, partialScope), pending && pending !== partialScope ? Object.assign(pending, partialScope) : target.writeScopes[scopeId] = partialScope, target.flushScopes = !0, scope;
|
|
250
|
-
}, CLIENT_ALL =
|
|
250
|
+
}, CLIENT_ALL = 715827883, NOOP$2 = () => {}, tick = globalThis.setImmediate || globalThis.setTimeout || globalThis.queueMicrotask || ((cb) => Promise.resolve().then(cb)), tickQueue, kSelectedValue = Symbol("selectedValue"), checkedValuesRefs = /* @__PURE__ */ new WeakMap(), singleQuoteAttrReplacements = /['\r]|&(?=[#a-zA-Z])/g, doubleQuoteAttrReplacements = /["\r]|&(?=[#a-zA-Z])/g, needsQuotedAttr = /["'>\s]|&[#a-zA-Z]|\/$/g, voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|param|source|track|wbr)$/, _dynamic_tag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, serializeReason) => {
|
|
251
251
|
let shouldResume = serializeReason !== 0, renderer = normalizeDynamicRenderer(tag), state = getState(), branchId = _peek_scope_id(), rendered, result;
|
|
252
252
|
if (typeof renderer == "string") {
|
|
253
253
|
let input = (inputIsArgs ? inputOrArgs[0] : inputOrArgs) || {};
|
|
@@ -263,7 +263,7 @@ let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeSty
|
|
|
263
263
|
}
|
|
264
264
|
let childScope = getScopeById(branchId), needsScript = childScope && (childScope.Ia || childScope.Ea);
|
|
265
265
|
needsScript && _script(branchId, "_d"), (shouldResume || needsScript) && _html(state.mark("(", scopeId + " " + accessor + " " + branchId));
|
|
266
|
-
})(), result = _el(
|
|
266
|
+
})(), result = _el(scopeId, "-" + accessor);
|
|
267
267
|
} else {
|
|
268
268
|
let chunk = getChunk(), beforeBranch = shouldResume ? deferBranchStart(chunk) : void 0, render = () => {
|
|
269
269
|
if (renderer) try {
|
|
@@ -429,6 +429,10 @@ function isEventHandler(name) {
|
|
|
429
429
|
function getEventHandlerName(name) {
|
|
430
430
|
return name[2] === "-" ? name.slice(3) : name.slice(2).toLowerCase();
|
|
431
431
|
}
|
|
432
|
+
function hasKeys(obj) {
|
|
433
|
+
for (let _ in obj) return !0;
|
|
434
|
+
return !1;
|
|
435
|
+
}
|
|
432
436
|
function isVoid(value) {
|
|
433
437
|
return value == null || value === !1;
|
|
434
438
|
}
|
|
@@ -531,10 +535,11 @@ var State$1 = class {
|
|
|
531
535
|
});
|
|
532
536
|
}
|
|
533
537
|
};
|
|
534
|
-
function register(id, val, scope) {
|
|
538
|
+
function register(id, val, scope, locals) {
|
|
535
539
|
return REGISTRY.set(val, {
|
|
536
540
|
id,
|
|
537
541
|
scope,
|
|
542
|
+
locals,
|
|
538
543
|
access: "_._" + toAccess(toObjectKey(id))
|
|
539
544
|
}), val;
|
|
540
545
|
}
|
|
@@ -642,13 +647,22 @@ function newScopeReference(state, val, scopeId) {
|
|
|
642
647
|
let ref = new Reference(null, null, state.flushId);
|
|
643
648
|
return ref.scopeId = scopeId, ref.channel = state.channel, state.refs.set(val, ref), ref;
|
|
644
649
|
}
|
|
650
|
+
function quoteRegisterId(id) {
|
|
651
|
+
return "\"" + id + "\"";
|
|
652
|
+
}
|
|
645
653
|
function writeRegistered(state, val, parent, accessor, registered) {
|
|
646
654
|
let { scope } = registered;
|
|
647
655
|
if (scope) {
|
|
648
656
|
let ref = new Reference(parent, accessor, state.flushId, state.buf.length);
|
|
649
657
|
ref.channel = state.channel, state.refs.set(val, ref);
|
|
650
658
|
let scopeId = scope[K_SCOPE_ID];
|
|
651
|
-
trackScope(state, scope, scopeId)
|
|
659
|
+
trackScope(state, scope, scopeId);
|
|
660
|
+
let locals = registered.locals?.(state.boundary.state.scope);
|
|
661
|
+
if (locals) {
|
|
662
|
+
state.buf.push(registered.access + "(_(" + scopeId + ")");
|
|
663
|
+
for (let local of locals) state.buf.push(","), local ? writePlainObject(state, local, new Reference(ref, null, state.flushId, state.buf.length)) : state.buf.push("0");
|
|
664
|
+
} else state.buf.push("_(" + scopeId + "," + quoteRegisterId(registered.id));
|
|
665
|
+
state.buf.push(")");
|
|
652
666
|
} else state.buf.push(registered.access);
|
|
653
667
|
return !0;
|
|
654
668
|
}
|
|
@@ -1332,8 +1346,8 @@ function _script(scopeId, registryId, serializeMarker) {
|
|
|
1332
1346
|
function _trailers(html) {
|
|
1333
1347
|
$chunk.boundary.state.trailerHTML += html;
|
|
1334
1348
|
}
|
|
1335
|
-
function _resume(val, id, scopeId) {
|
|
1336
|
-
return register(id, val, scopeId === void 0 ? void 0 : _scope_with_id(scopeId));
|
|
1349
|
+
function _resume(val, id, scopeId, locals) {
|
|
1350
|
+
return register(id, val, scopeId === void 0 ? void 0 : _scope_with_id(scopeId), locals);
|
|
1337
1351
|
}
|
|
1338
1352
|
function _resume_locals(val, id, locals, ownerScopeId) {
|
|
1339
1353
|
return ownerScopeId !== void 0 && (locals._ = _scope_with_id(ownerScopeId)), register(id, val, writeScope(_scope_id(), locals));
|
|
@@ -1471,15 +1485,15 @@ function scopeWithId(state, scopeId) {
|
|
|
1471
1485
|
let { scopes } = state, scope = scopes.get(scopeId);
|
|
1472
1486
|
return scope || scopes.set(scopeId, scope = { [K_SCOPE_ID]: scopeId }), scope;
|
|
1473
1487
|
}
|
|
1474
|
-
function _subscribe(subscribers, scope) {
|
|
1488
|
+
function _subscribe(subscribers, scope, resumeId, serializeMarker) {
|
|
1475
1489
|
if (subscribers) {
|
|
1476
1490
|
let { serializer } = $chunk.boundary.state;
|
|
1477
|
-
!$chunk.serializeState.readyId && !serializer.written(subscribers) ? subscribers.add(scope) : serializer.writeCall(scope, subscribers, "add", $chunk.serializeState);
|
|
1491
|
+
!$chunk.serializeState.readyId && !serializer.written(subscribers) ? subscribers.add(scope) : resumeId ? _script(scope[K_SCOPE_ID], resumeId, serializeMarker) : serializer.writeCall(scope, subscribers, "add", $chunk.serializeState);
|
|
1478
1492
|
}
|
|
1479
1493
|
return scope;
|
|
1480
1494
|
}
|
|
1481
1495
|
function maskGroup(mask, group) {
|
|
1482
|
-
return mask ===
|
|
1496
|
+
return mask === 715827883 ? 1 : typeof mask == "number" ? group < 15 ? mask >>> 1 + 2 * group & 3 : 0 : mask[group] ?? 0;
|
|
1483
1497
|
}
|
|
1484
1498
|
function _set_serialize_reason(reason) {
|
|
1485
1499
|
$chunk.boundary.state.serializeReason = reason;
|
|
@@ -1600,6 +1614,7 @@ var State = class {
|
|
|
1600
1614
|
serializer = new Serializer();
|
|
1601
1615
|
writeReorders = null;
|
|
1602
1616
|
scopes = /* @__PURE__ */ new Map();
|
|
1617
|
+
scope = (scopeId) => scopeWithId(this, scopeId);
|
|
1603
1618
|
flushScopes = !1;
|
|
1604
1619
|
writeScopes = {};
|
|
1605
1620
|
readyIds = null;
|
|
@@ -1738,15 +1753,15 @@ var State = class {
|
|
|
1738
1753
|
$chunk = prev;
|
|
1739
1754
|
}
|
|
1740
1755
|
}
|
|
1741
|
-
flushReadyScripts(reservations) {
|
|
1756
|
+
flushReadyScripts(reservations, holdEffects) {
|
|
1742
1757
|
let { boundary, serializeState } = this, { readyId } = serializeState, scripts = "";
|
|
1743
1758
|
if (forEach(this.takeDeferredReady(), (chunk) => {
|
|
1744
|
-
scripts = concatScripts(scripts, chunk.flushReadyScripts(reservations));
|
|
1759
|
+
scripts = concatScripts(scripts, chunk.flushReadyScripts(reservations, holdEffects)), (chunk.effects || chunk.deferredReady) && (this.deferredReady = push(this.deferredReady, chunk));
|
|
1745
1760
|
}), readyId && !this.async) {
|
|
1746
1761
|
let { state } = boundary;
|
|
1747
1762
|
flushSerializer(boundary, serializeState);
|
|
1748
|
-
let deps = state.serializer.takeChannelDeps(),
|
|
1749
|
-
if (serializeState.resumes = "",
|
|
1763
|
+
let deps = state.serializer.takeChannelDeps(), effects = holdEffects ? "" : this.effects, { resumes } = serializeState, chunkScripts = this.scripts;
|
|
1764
|
+
if (serializeState.resumes = this.scripts = "", effects && (this.effects = this.lastEffect = ""), resumes || effects) {
|
|
1750
1765
|
state.needsMainRuntime = !0;
|
|
1751
1766
|
let batch = concatSequence(depsMarker(deps), concatSequence(resumes, effects && `"${effects}"`));
|
|
1752
1767
|
if (reservations) {
|
|
@@ -1761,7 +1776,7 @@ var State = class {
|
|
|
1761
1776
|
flushScript() {
|
|
1762
1777
|
let { boundary } = this, { state } = boundary, { $global, runtimePrefix } = state, needsWalk = state.walkOnNextFlush;
|
|
1763
1778
|
needsWalk && (state.walkOnNextFlush = !1);
|
|
1764
|
-
let readyResumeScripts = this.flushReadyScripts();
|
|
1779
|
+
let readyResumeScripts = this.flushReadyScripts(void 0, this.async);
|
|
1765
1780
|
for (let channel; channel = state.serializer.pendingReadyChannel();) {
|
|
1766
1781
|
let resumes = state.serializer.stringifyScopes([], boundary, channel), deps = state.serializer.takeChannelDeps();
|
|
1767
1782
|
state.needsMainRuntime = !0, readyResumeScripts = concatScripts(readyResumeScripts, state.writeReady(channel.readyId, concatSequence(depsMarker(deps), resumes)));
|
|
@@ -1786,11 +1801,11 @@ var State = class {
|
|
|
1786
1801
|
let { reorderId } = reorderedChunk, readyReservations = [], reorderHTML = "", reorderEffects = "", reorderScripts = "", cur = reorderedChunk;
|
|
1787
1802
|
for (reorderedChunk.reorderId = null;;) {
|
|
1788
1803
|
cur.flushPlaceholder(), cur.deferOwnReady();
|
|
1789
|
-
let { next } = cur, readyResumeScripts = cur.flushReadyScripts(readyReservations);
|
|
1790
|
-
if (cur.consumed = !0, reorderHTML += cur.html, reorderEffects = concatEffects(reorderEffects, cur.effects), reorderScripts = concatScripts(reorderScripts, concatScripts(readyResumeScripts, cur.scripts)), cur.async && (reorderHTML += state.mark("#", cur.reorderId = state.nextReorderId()), state.reorder(cur), cur.html = cur.effects = cur.scripts = cur.lastEffect = "", cur.next = null), next) cur = next;
|
|
1804
|
+
let { next } = cur, readyResumeScripts = cur.flushReadyScripts(readyReservations, this.async);
|
|
1805
|
+
if (this.deferredReady = concat(this.deferredReady, cur.takeDeferredReady()), cur.consumed = !0, reorderHTML += cur.html, reorderEffects = concatEffects(reorderEffects, cur.effects), reorderScripts = concatScripts(reorderScripts, concatScripts(readyResumeScripts, cur.scripts)), cur.async && (reorderHTML += state.mark("#", cur.reorderId = state.nextReorderId()), state.reorder(cur), cur.html = cur.effects = cur.scripts = cur.lastEffect = "", cur.next = null), next) cur = next;
|
|
1791
1806
|
else break;
|
|
1792
1807
|
}
|
|
1793
|
-
reorderEffects && (needsResumeArray = !0, reorderScripts = concatScripts(reorderScripts, "_.push(\"" + reorderEffects + "\")"));
|
|
1808
|
+
reorderEffects && (this.async ? (this.effects = concatEffects(this.effects, reorderEffects), this.lastEffect = "") : (needsResumeArray = !0, reorderScripts = concatScripts(reorderScripts, "_.push(\"" + reorderEffects + "\")")));
|
|
1794
1809
|
for (let reservation of readyReservations) reordered = concatScripts(reordered, reservation);
|
|
1795
1810
|
reordered = concatScripts(reordered, reorderScripts && runtimePrefix + ".j" + toAccess(reorderId) + "=_=>{" + reorderScripts + "}"), html += "<t hidden " + state.commentPrefix + "=" + reorderId + ">" + reorderHTML + "</t>";
|
|
1796
1811
|
}
|
|
@@ -1824,7 +1839,7 @@ function flushSerializer(boundary, serializeState) {
|
|
|
1824
1839
|
}
|
|
1825
1840
|
for (let key in writeScopes) {
|
|
1826
1841
|
let scopeId = +key, props = writeScopes[scopeId];
|
|
1827
|
-
|
|
1842
|
+
hasKeys(props) && flushes.push([
|
|
1828
1843
|
scopeId,
|
|
1829
1844
|
state.scopes.get(scopeId),
|
|
1830
1845
|
props
|
|
@@ -2050,8 +2065,8 @@ function normalizeStrAttrValue(value) {
|
|
|
2050
2065
|
function _content(id, fn, scopeId) {
|
|
2051
2066
|
return fn.a = id, fn.e = scopeId, fn;
|
|
2052
2067
|
}
|
|
2053
|
-
function _content_resume(id, fn, scopeId) {
|
|
2054
|
-
return _resume(_content(id, fn, scopeId), id, scopeId);
|
|
2068
|
+
function _content_resume(id, fn, scopeId, locals) {
|
|
2069
|
+
return _resume(_content(id, fn, scopeId), id, scopeId, locals);
|
|
2055
2070
|
}
|
|
2056
2071
|
//#endregion
|
|
2057
2072
|
//#region src/html/template.ts
|