marko 6.4.1 → 6.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cheatsheet.md +1 -1
- package/dist/common/errors.d.ts +1 -0
- package/dist/common/opt.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 +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-ClV4kVOO.js → dom-BLbR0hEx.js} +30 -0
- package/dist/debug/{dom-LFrKxOk5.mjs → dom-Cii0IA92.mjs} +19 -1
- package/dist/debug/dom.js +7 -4
- package/dist/debug/dom.mjs +6 -5
- package/dist/debug/html.js +280 -76
- package/dist/debug/html.mjs +280 -77
- package/dist/dom/catch.feat.js +3 -3
- package/dist/dom/catch.feat.mjs +1 -1
- package/dist/dom/controllable-input.feat.js +1 -1
- package/dist/dom/controllable-input.feat.mjs +1 -1
- package/dist/dom/controllable-open.feat.js +1 -1
- package/dist/dom/controllable-open.feat.mjs +1 -1
- package/dist/dom/controllable-select.feat.js +1 -1
- package/dist/dom/controllable-select.feat.mjs +1 -1
- package/dist/dom/controllable-textarea.feat.js +1 -1
- package/dist/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/dom/controllable.feat.js +1 -1
- package/dist/dom/controllable.feat.mjs +1 -1
- package/dist/dom/dom.d.ts +1 -0
- package/dist/dom/dynamic-tag-script.feat.js +2 -2
- package/dist/dom/dynamic-tag-script.feat.mjs +1 -1
- package/dist/dom/dynamic-tag-var.feat.js +1 -1
- package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
- package/dist/dom/lazy.feat.js +1 -1
- package/dist/dom/lazy.feat.mjs +1 -1
- package/dist/dom/placeholder.feat.js +3 -3
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/{dom-CNglVi8P.js → dom-B8UEYzOz.js} +99 -80
- package/dist/{dom-DfP3MCo0.mjs → dom-BPjLe6YU.mjs} +10 -1
- package/dist/dom.d.ts +2 -2
- package/dist/dom.js +34 -33
- package/dist/dom.mjs +6 -5
- package/dist/html/assets.d.ts +12 -6
- package/dist/html/attrs.d.ts +1 -0
- package/dist/html/compat.d.ts +10 -2
- package/dist/html/serializer.d.ts +1 -0
- package/dist/html/writer.d.ts +8 -0
- package/dist/html.d.ts +1 -1
- package/dist/html.js +194 -59
- package/dist/html.mjs +194 -59
- package/dist/translator/index.js +404 -190
- package/dist/translator/util/bindings.d.ts +9 -1
- package/dist/translator/util/constants/structure-kind.d.ts +1 -0
- package/dist/translator/util/known-tag.d.ts +2 -1
- package/dist/translator/util/module-read.d.ts +21 -0
- package/dist/translator/util/references.d.ts +1 -0
- package/dist/translator/util/runtime.d.ts +2 -0
- package/dist/translator/util/sections.d.ts +5 -1
- package/dist/translator/util/structure.d.ts +1 -0
- package/package.json +3 -3
package/dist/dom.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export { attrTag, attrTags } from "./common/attr-tag";
|
|
2
|
-
export { _assert_hoist, _hoist_read_error } from "./common/errors";
|
|
2
|
+
export { _assert_class_toggles, _assert_hoist, _hoist_read_error, } from "./common/errors";
|
|
3
3
|
export { forIn, forOf, forTo, forUntil } from "./common/for";
|
|
4
4
|
export { _call } from "./common/helpers";
|
|
5
5
|
export { $signal, $signalReset } from "./dom/abort-signal";
|
|
6
6
|
export { compat } from "./dom/compat";
|
|
7
7
|
export { _await_content, _await_promise, _dynamic_tag, _dynamic_tag_content, _for_in, _for_of, _for_of_unkeyed, _for_to, _for_to_unkeyed, _for_until, _for_until_unkeyed, _if, _show, _try, } from "./dom/control-flow";
|
|
8
8
|
export { _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checked_default, _attr_input_checked_script, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_input_value as _attr_textarea_value, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_script as _attr_textarea_value_script, _controllable_input, _controllable_open, _controllable_select, _controllable_textarea, } from "./dom/controllable";
|
|
9
|
-
export { _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_content, _attr_nonce, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _html, _lifecycle, _style_rule_item, _style_shell, _text, _text_content, _to_text, } from "./dom/dom";
|
|
9
|
+
export { _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_class_names, _attr_content, _attr_nonce, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _html, _lifecycle, _style_rule_item, _style_shell, _text, _text_content, _to_text, } from "./dom/dom";
|
|
10
10
|
export { _on } from "./dom/event";
|
|
11
11
|
export { _load_event_trigger, _load_idle_trigger, _load_media_trigger, _load_race_trigger, _load_setup, _load_signal, _load_template, _load_visible_trigger, } from "./dom/load";
|
|
12
12
|
export { run } from "./dom/queue";
|
package/dist/dom.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
let require_control_flow = require("./dom-
|
|
3
|
-
require_control_flow.
|
|
2
|
+
let require_control_flow = require("./dom-B8UEYzOz.js"), empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), classEventResolver, scopesByRender = /* @__PURE__ */ new WeakMap(), getRenderScopes = ($global) => {
|
|
3
|
+
require_control_flow.Tt($global.runtimeId);
|
|
4
4
|
let render = self[$global.runtimeId]?.[$global.renderId], scopes = render && scopesByRender.get(render);
|
|
5
5
|
return render && !scopes && scopesByRender.set(render, scopes = {}), scopes;
|
|
6
6
|
}, compat = {
|
|
7
7
|
patchDynamicTag: require_control_flow.v,
|
|
8
|
-
queueEffect: require_control_flow.
|
|
8
|
+
queueEffect: require_control_flow.sn,
|
|
9
9
|
init(warp10Noop) {
|
|
10
|
-
require_control_flow.
|
|
10
|
+
require_control_flow.St.$C_s = (scope) => {
|
|
11
11
|
if (getRenderScopes(scope.$)[scope.L] = scope, scope.m5c && classIdToBranch.set(scope.m5c, scope), classEventResolver) for (let key in scope) {
|
|
12
12
|
let resolved = classEventResolver(scope[key], scope);
|
|
13
13
|
resolved !== scope[key] && (scope[key] = resolved);
|
|
14
14
|
}
|
|
15
|
-
}, require_control_flow.
|
|
15
|
+
}, require_control_flow.St.$C_b = warp10Noop;
|
|
16
16
|
},
|
|
17
17
|
setClassEventResolver(fn) {
|
|
18
18
|
classEventResolver = fn;
|
|
19
19
|
},
|
|
20
20
|
resumeClassFunction(id, build) {
|
|
21
|
-
require_control_flow.
|
|
21
|
+
require_control_flow.St[id] = build;
|
|
22
22
|
},
|
|
23
23
|
getScope($global, scopeId) {
|
|
24
24
|
return getRenderScopes($global)?.[scopeId];
|
|
@@ -39,36 +39,36 @@ let require_control_flow = require("./dom-CNglVi8P.js"), empty = [], rest = Symb
|
|
|
39
39
|
branch.S = startNode, branch.K = endNode;
|
|
40
40
|
},
|
|
41
41
|
runComponentEffects() {
|
|
42
|
-
this.effects && require_control_flow.
|
|
42
|
+
this.effects && require_control_flow.dn(this.effects);
|
|
43
43
|
},
|
|
44
44
|
runComponentDestroy() {
|
|
45
|
-
this.scope && require_control_flow.
|
|
45
|
+
this.scope && require_control_flow.Zt(this.scope);
|
|
46
46
|
},
|
|
47
47
|
resolveRegistered(value, $global) {
|
|
48
|
-
return Array.isArray(value) && typeof value[0] == "string" ? require_control_flow.
|
|
48
|
+
return Array.isArray(value) && typeof value[0] == "string" ? require_control_flow.wt(value[0], getRenderScopes($global)?.[value[1]]) : value;
|
|
49
49
|
},
|
|
50
50
|
createRenderer(params, clone) {
|
|
51
|
-
let renderer = require_control_flow.
|
|
51
|
+
let renderer = require_control_flow.mt("", 0, 0, 0, params)();
|
|
52
52
|
return renderer.b = (branch) => {
|
|
53
53
|
let cloned = clone();
|
|
54
54
|
branch.S = cloned.startNode, branch.K = cloned.endNode;
|
|
55
55
|
}, renderer;
|
|
56
56
|
},
|
|
57
57
|
render(out, component, renderer, args) {
|
|
58
|
-
require_control_flow.
|
|
58
|
+
require_control_flow.Tt(out.global.runtimeId);
|
|
59
59
|
let branch = component.scope, created = 0;
|
|
60
60
|
if (!branch && (branch = classIdToBranch.get(component.id)) && (component.scope = branch, classIdToBranch.delete(component.id)), args[0] && typeof args[0] == "object" && "renderBody" in args[0]) {
|
|
61
61
|
let input = args[0], normalizedInput = args[0] = {};
|
|
62
62
|
for (let key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
|
|
63
63
|
}
|
|
64
64
|
let renderBranch = () => {
|
|
65
|
-
branch ||= (created = 1, component.scope = require_control_flow.
|
|
65
|
+
branch ||= (created = 1, component.scope = require_control_flow._t(out.global, renderer, renderer.e, document.body)), renderer.d?.(branch, renderer._ ? args[0] : args);
|
|
66
66
|
};
|
|
67
|
-
if (component.effects = require_control_flow.
|
|
67
|
+
if (component.effects = require_control_flow.ln ? renderBranch() : require_control_flow.an(renderBranch), created) return require_control_flow.pt(branch.S, branch.K);
|
|
68
68
|
}
|
|
69
69
|
}, _template = (id, template, walks, setup, inputSignal) => {
|
|
70
|
-
let renderer = require_control_flow.
|
|
71
|
-
return renderer.mount = mount, renderer._ = renderer, require_control_flow.
|
|
70
|
+
let renderer = require_control_flow.mt(id, template, walks, setup, inputSignal)();
|
|
71
|
+
return renderer.mount = mount, renderer._ = renderer, require_control_flow.St[id] = renderer;
|
|
72
72
|
}, noop = (_) => 0;
|
|
73
73
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
74
74
|
//#region src/common/attr-tag.ts
|
|
@@ -105,25 +105,25 @@ function mount(input = {}, reference, position) {
|
|
|
105
105
|
break;
|
|
106
106
|
case "afterend": parentNode = reference.parentNode, nextSibling = reference.nextSibling;
|
|
107
107
|
}
|
|
108
|
-
let curValue, args = this.d, effects = require_control_flow.
|
|
109
|
-
branch = require_control_flow.
|
|
108
|
+
let curValue, args = this.d, effects = require_control_flow.an(() => {
|
|
109
|
+
branch = require_control_flow.vt($global, this, void 0, parentNode), branch.T = (newValue) => {
|
|
110
110
|
curValue = newValue;
|
|
111
111
|
}, this.c?.(branch), args?.(branch, input);
|
|
112
112
|
});
|
|
113
|
-
return require_control_flow.
|
|
113
|
+
return require_control_flow.ft(parentNode, nextSibling, branch.S, branch.K), require_control_flow.dn(effects), {
|
|
114
114
|
get value() {
|
|
115
115
|
return curValue;
|
|
116
116
|
},
|
|
117
117
|
set value(newValue) {
|
|
118
|
-
require_control_flow.
|
|
118
|
+
require_control_flow.Yt(branch, newValue);
|
|
119
119
|
},
|
|
120
120
|
update(newInput = {}) {
|
|
121
|
-
args && (newInput.$global && ({$global, ...newInput} = newInput), require_control_flow.
|
|
121
|
+
args && (newInput.$global && ({$global, ...newInput} = newInput), require_control_flow.dn(require_control_flow.an(() => {
|
|
122
122
|
args(branch, newInput);
|
|
123
123
|
})));
|
|
124
124
|
},
|
|
125
125
|
destroy() {
|
|
126
|
-
require_control_flow
|
|
126
|
+
require_control_flow.$t(branch);
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
129
|
}
|
|
@@ -133,7 +133,7 @@ function _load_template(id, load) {
|
|
|
133
133
|
let pending, lazyTemplate = _template(id, 0, 0, (branch) => {
|
|
134
134
|
let awaitCounter = require_control_flow.h(branch);
|
|
135
135
|
branch.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((renderer) => {
|
|
136
|
-
Object.assign(lazyTemplate, renderer), require_control_flow.
|
|
136
|
+
Object.assign(lazyTemplate, renderer), require_control_flow.on(branch, (branch) => insertLoaded(renderer, branch, branch.S, awaitCounter));
|
|
137
137
|
}, loadFailed(branch, awaitCounter));
|
|
138
138
|
}, _load_signal(() => (pending ||= load()).then((r) => ({ _: r.d || noop }))));
|
|
139
139
|
return lazyTemplate;
|
|
@@ -141,36 +141,37 @@ function _load_template(id, load) {
|
|
|
141
141
|
function _load_setup(load) {
|
|
142
142
|
let pending, renderer, insertCached = (child, marker) => insertLoaded(renderer, child, marker);
|
|
143
143
|
return (owner, child, marker) => {
|
|
144
|
-
if (renderer) require_control_flow.
|
|
144
|
+
if (renderer) require_control_flow.cn(child, insertCached, -1, marker);
|
|
145
145
|
else {
|
|
146
146
|
let awaitCounter = require_control_flow.h(owner);
|
|
147
147
|
child.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((mod) => {
|
|
148
|
-
renderer ||= require_control_flow.
|
|
148
|
+
renderer ||= require_control_flow.mt("", ...mod._)(), require_control_flow.on(child, (child) => insertLoaded(renderer, child, marker, awaitCounter));
|
|
149
149
|
}, loadFailed(child, awaitCounter));
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
153
|
function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
154
|
-
let parent = marker.parentNode, values = branch.X, clone = () => {
|
|
155
|
-
require_control_flow
|
|
154
|
+
let parent = () => marker.parentNode, values = branch.X, clone = () => {
|
|
155
|
+
require_control_flow.en(branch), renderer.b(branch, parent().namespaceURI), branch.X = 0;
|
|
156
156
|
}, insert = () => {
|
|
157
|
-
require_control_flow.
|
|
157
|
+
require_control_flow.Qt(branch, parent(), marker), marker.remove(), awaitCounter?.c();
|
|
158
158
|
}, remaining;
|
|
159
159
|
if (remaining = values?.size) {
|
|
160
|
+
awaitCounter ||= require_control_flow.h(branch);
|
|
160
161
|
let fail = loadFailed(branch, awaitCounter);
|
|
161
|
-
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && require_control_flow.
|
|
162
|
+
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && require_control_flow.on(branch, (branch) => {
|
|
162
163
|
clone(), renderer.c?.(branch), values.forEach(([value, apply]) => apply(branch, value)), insert();
|
|
163
164
|
}), (error) => remaining > 0 && (remaining = 0, fail(error))));
|
|
164
|
-
} else clone(), require_control_flow.
|
|
165
|
+
} else clone(), require_control_flow.yt(renderer, branch), insert();
|
|
165
166
|
}
|
|
166
167
|
function loadFailed(scope, awaitCounter) {
|
|
167
168
|
return (error) => {
|
|
168
|
-
awaitCounter && (awaitCounter.m ? awaitCounter.i = 0 : awaitCounter.i && awaitCounter.c()), require_control_flow.
|
|
169
|
+
awaitCounter && (awaitCounter.m ? awaitCounter.i = 0 : awaitCounter.i && awaitCounter.c()), require_control_flow.on(scope, require_control_flow.y, error);
|
|
169
170
|
};
|
|
170
171
|
}
|
|
171
172
|
function _load_signal(load) {
|
|
172
173
|
let pending, apply = (scope, value) => {
|
|
173
|
-
pending ||= load(), scope.X || !("X" in scope) && scope.H === require_control_flow.
|
|
174
|
+
pending ||= load(), scope.X || !("X" in scope) && scope.H === require_control_flow.fn ? (scope.X ||= /* @__PURE__ */ new Map()).set(pending, [value, apply]) : apply._ ? apply._(scope, value) : pending.then((mod) => require_control_flow.on(scope, apply._ = mod._, value), noop);
|
|
174
175
|
};
|
|
175
176
|
return apply;
|
|
176
177
|
}
|
|
@@ -197,9 +198,9 @@ function _load_race_trigger(...triggers) {
|
|
|
197
198
|
function getSelectorOrResolve(selector, resolve) {
|
|
198
199
|
return document.querySelector(selector) || resolve();
|
|
199
200
|
}
|
|
200
|
-
exports.$signal = require_control_flow.
|
|
201
|
+
exports.$signal = require_control_flow.nn, exports.$signalReset = require_control_flow.rn, exports._assert_class_toggles = require_control_flow._n, exports._assert_hoist = require_control_flow.vn, exports._assert_init = require_control_flow.Xt, exports._attr = require_control_flow.W, exports._attr_class = require_control_flow.G, exports._attr_class_item = require_control_flow.K, exports._attr_class_items = require_control_flow.q, exports._attr_class_names = require_control_flow.J, exports._attr_content = require_control_flow.Y, exports._attr_details_open = require_control_flow.x, exports._attr_dialog_open = require_control_flow.x, exports._attr_details_open_default = require_control_flow.S, exports._attr_dialog_open_default = require_control_flow.S, exports._attr_details_open_script = require_control_flow.C, exports._attr_dialog_open_script = require_control_flow.C, exports._attr_input_checked = require_control_flow.w, exports._attr_input_checkedValue = require_control_flow.T, exports._attr_input_checkedValue_default = require_control_flow.E, exports._attr_input_checkedValue_script = require_control_flow.D, exports._attr_input_checked_default = require_control_flow.O, exports._attr_input_checked_script = require_control_flow.k, exports._attr_input_value = require_control_flow.A, exports._attr_textarea_value = require_control_flow.A, exports._attr_input_value_attribute_default = require_control_flow.j, exports._attr_input_value_default = require_control_flow.M, exports._attr_textarea_value_default = require_control_flow.M, exports._attr_input_value_dynamic_default = require_control_flow.N, exports._attr_input_value_script = require_control_flow.P, exports._attr_textarea_value_script = require_control_flow.P, exports._attr_nonce = require_control_flow.X, exports._attr_select_value = require_control_flow.F, exports._attr_select_value_default = require_control_flow.I, exports._attr_select_value_script = require_control_flow.L, exports._attr_style = require_control_flow.Z, exports._attr_style_item = require_control_flow.Q, exports._attr_style_items = require_control_flow.$, exports._attrs = require_control_flow.et, exports._attrs_content = require_control_flow.tt, exports._attrs_partial = require_control_flow.nt, exports._attrs_partial_content = require_control_flow.rt, exports._attrs_script = require_control_flow.it, exports._await_content = require_control_flow.t, exports._await_promise = require_control_flow.n, exports._call = require_control_flow.bn, exports._child_setup = require_control_flow.At, exports._closure = require_control_flow.jt, exports._closure_get = require_control_flow.Mt, exports._const = require_control_flow.Nt, exports._content = require_control_flow.mt, exports._content_closures = require_control_flow.ht, exports._content_resume = require_control_flow.gt, exports._controllable_input = require_control_flow.R, exports._controllable_open = require_control_flow.z, exports._controllable_select = require_control_flow.B, exports._controllable_textarea = require_control_flow.V, Object.defineProperty(exports, "_dynamic_tag", {
|
|
201
202
|
enumerable: !0,
|
|
202
203
|
get: function() {
|
|
203
204
|
return require_control_flow.r;
|
|
204
205
|
}
|
|
205
|
-
}), exports._dynamic_tag_content = require_control_flow.i, exports._dynamic_tag_var_resume = require_control_flow.
|
|
206
|
+
}), exports._dynamic_tag_content = require_control_flow.i, exports._dynamic_tag_var_resume = require_control_flow.bt, exports._el = require_control_flow.xt, exports._el_read = require_control_flow.Pt, exports._for_closure = require_control_flow.Ft, exports._for_in = require_control_flow.a, exports._for_of = require_control_flow.o, exports._for_of_unkeyed = require_control_flow.s, exports._for_selector = require_control_flow.It, exports._for_to = require_control_flow.c, exports._for_to_unkeyed = require_control_flow.l, exports._for_until = require_control_flow.u, exports._for_until_unkeyed = require_control_flow.d, exports._global_read = require_control_flow.Lt, exports._hoist = require_control_flow.Rt, exports._hoist_read_error = require_control_flow.yn, exports._hoist_resume = require_control_flow.zt, exports._html = require_control_flow.at, exports._id = require_control_flow.Bt, exports._if = require_control_flow.f, exports._if_closure = require_control_flow.Vt, exports._let = require_control_flow.Ht, exports._let_change = require_control_flow.Ut, exports._lifecycle = require_control_flow.ot, exports._load_event_trigger = _load_event_trigger, exports._load_idle_trigger = _load_idle_trigger, exports._load_media_trigger = _load_media_trigger, exports._load_race_trigger = _load_race_trigger, exports._load_setup = _load_setup, exports._load_signal = _load_signal, exports._load_template = _load_template, exports._load_visible_trigger = _load_visible_trigger, exports._on = require_control_flow.tn, exports._or = require_control_flow.Wt, exports._resumed = require_control_flow.St, exports._return = require_control_flow.Gt, exports._return_change = require_control_flow.Kt, exports._script = require_control_flow.qt, exports._show = require_control_flow.p, exports._style_rule_item = require_control_flow.st, exports._style_shell = require_control_flow.ct, exports._template = _template, exports._text = require_control_flow.lt, exports._text_content = require_control_flow.ut, exports._to_text = require_control_flow.dt, exports._try = require_control_flow.m, exports._var = require_control_flow.Jt, exports._var_change = require_control_flow.Yt, exports._var_resume = require_control_flow.Ct, exports.attrTag = attrTag, exports.attrTags = attrTags, exports.compat = compat, exports.forIn = require_control_flow.pn, exports.forOf = require_control_flow.mn, exports.forTo = require_control_flow.hn, exports.forUntil = require_control_flow.gn, exports.init = require_control_flow.Tt, exports.initEmbedded = require_control_flow.Et, exports.ready = require_control_flow.Dt, exports.readyFailed = require_control_flow.Ot, exports.run = require_control_flow.un;
|
package/dist/dom.mjs
CHANGED
|
@@ -69,7 +69,7 @@ let empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), cl
|
|
|
69
69
|
let renderer = _content(id, template, walks, setup, inputSignal)();
|
|
70
70
|
return renderer.mount = mount, renderer._ = renderer, _resumed[id] = renderer;
|
|
71
71
|
}, noop = (_) => 0;
|
|
72
|
-
import { $ as
|
|
72
|
+
import { $ as _attr_style_items, $t as removeAndDestroyBranch, A as _attr_input_value, At as _child_setup, B as _controllable_select, Bt as _id, C as _attr_details_or_dialog_open_script, Ct as _var_resume, D as _attr_input_checkedValue_script, Dt as ready, E as _attr_input_checkedValue_default, Et as initEmbedded, F as _attr_select_value, Ft as _for_closure, G as _attr_class, Gt as _return, Ht as _let, I as _attr_select_value_default, It as _for_selector, J as _attr_class_names, Jt as _var, K as _attr_class_item, Kt as _return_change, L as _attr_select_value_script, Lt as _global_read, M as _attr_input_value_default, Mt as _closure_get, N as _attr_input_value_dynamic_default, Nt as _const, O as _attr_input_checked_default, Ot as readyFailed, P as _attr_input_value_script, Pt as _el_read, Q as _attr_style_item, Qt as insertBranchBefore, R as _controllable_input, Rt as _hoist, S as _attr_details_or_dialog_open_default, St as _resumed, T as _attr_input_checkedValue, Tt as init, Ut as _let_change, V as _controllable_textarea, Vt as _if_closure, W as _attr, Wt as _or, X as _attr_nonce, Xt as _assert_init, Y as _attr_content, Yt as _var_change, Z as _attr_style, Zt as destroyBranch, _n as _assert_class_toggles, _t as createAndSetupBranch, a as _for_in, an as prepareEffects, at as _html, bn as _call, bt as _dynamic_tag_var_resume, c as _for_to, cn as queueRender, ct as _style_shell, d as _for_until_unkeyed, dn as runEffects, dt as _to_text, en as syncGen, et as _attrs, f as _if, fn as runId, ft as insertChildNodes, gn as forUntil, gt as _content_resume, h as addAwaitCounter, hn as forTo, ht as _content_closures, i as _dynamic_tag_content, it as _attrs_script, j as _attr_input_value_attribute_default, jt as _closure, k as _attr_input_checked_script, l as _for_to_unkeyed, ln as rendering, lt as _text, m as _try, mn as forOf, mt as _content, n as _await_promise, nn as $signal, nt as _attrs_partial, o as _for_of, on as queueAsyncRender, ot as _lifecycle, p as _show, pn as forIn, pt as toInsertNode, q as _attr_class_items, qt as _script, r as _dynamic_tag, rn as $signalReset, rt as _attrs_partial_content, s as _for_of_unkeyed, sn as queueEffect, st as _style_rule_item, t as _await_content, tn as _on, tt as _attrs_content, u as _for_until, un as run, ut as _text_content, v as patchDynamicTag, vn as _assert_hoist, vt as createBranch, w as _attr_input_checked, wt as getRegisteredWithScope, x as _attr_details_or_dialog_open, xt as _el, y as renderCatch, yn as _hoist_read_error, yt as setupBranch, z as _controllable_open, zt as _hoist_resume } from "./dom-BPjLe6YU.mjs";
|
|
73
73
|
//#region src/common/attr-tag.ts
|
|
74
74
|
function attrTag(attrs) {
|
|
75
75
|
return attrs[Symbol.iterator] = attrTagIterator, attrs[rest] = empty, attrs;
|
|
@@ -150,12 +150,13 @@ function _load_setup(load) {
|
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
152
|
function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
153
|
-
let parent = marker.parentNode, values = branch.X, clone = () => {
|
|
154
|
-
syncGen(branch), renderer.b(branch, parent.namespaceURI), branch.X = 0;
|
|
153
|
+
let parent = () => marker.parentNode, values = branch.X, clone = () => {
|
|
154
|
+
syncGen(branch), renderer.b(branch, parent().namespaceURI), branch.X = 0;
|
|
155
155
|
}, insert = () => {
|
|
156
|
-
insertBranchBefore(branch, parent, marker), marker.remove(), awaitCounter?.c();
|
|
156
|
+
insertBranchBefore(branch, parent(), marker), marker.remove(), awaitCounter?.c();
|
|
157
157
|
}, remaining;
|
|
158
158
|
if (remaining = values?.size) {
|
|
159
|
+
awaitCounter ||= addAwaitCounter(branch);
|
|
159
160
|
let fail = loadFailed(branch, awaitCounter);
|
|
160
161
|
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && queueAsyncRender(branch, (branch) => {
|
|
161
162
|
clone(), renderer.c?.(branch), values.forEach(([value, apply]) => apply(branch, value)), insert();
|
|
@@ -197,4 +198,4 @@ function getSelectorOrResolve(selector, resolve) {
|
|
|
197
198
|
return document.querySelector(selector) || resolve();
|
|
198
199
|
}
|
|
199
200
|
//#endregion
|
|
200
|
-
export { $signal, $signalReset, _assert_hoist, _assert_init, _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_checked_default, _attr_input_checked_script, _attr_input_value, _attr_input_value as _attr_textarea_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_input_value_script as _attr_textarea_value_script, _attr_nonce, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _await_content, _await_promise, _call, _child_setup, _closure, _closure_get, _const, _content, _content_closures, _content_resume, _controllable_input, _controllable_open, _controllable_select, _controllable_textarea, _dynamic_tag, _dynamic_tag_content, _dynamic_tag_var_resume, _el, _el_read, _for_closure, _for_in, _for_of, _for_of_unkeyed, _for_selector, _for_to, _for_to_unkeyed, _for_until, _for_until_unkeyed, _global_read, _hoist, _hoist_read_error, _hoist_resume, _html, _id, _if, _if_closure, _let, _let_change, _lifecycle, _load_event_trigger, _load_idle_trigger, _load_media_trigger, _load_race_trigger, _load_setup, _load_signal, _load_template, _load_visible_trigger, _on, _or, _resumed, _return, _return_change, _script, _show, _style_rule_item, _style_shell, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, init, initEmbedded, ready, readyFailed, run };
|
|
201
|
+
export { $signal, $signalReset, _assert_class_toggles, _assert_hoist, _assert_init, _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_class_names, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_checked_default, _attr_input_checked_script, _attr_input_value, _attr_input_value as _attr_textarea_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_input_value_script as _attr_textarea_value_script, _attr_nonce, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _await_content, _await_promise, _call, _child_setup, _closure, _closure_get, _const, _content, _content_closures, _content_resume, _controllable_input, _controllable_open, _controllable_select, _controllable_textarea, _dynamic_tag, _dynamic_tag_content, _dynamic_tag_var_resume, _el, _el_read, _for_closure, _for_in, _for_of, _for_of_unkeyed, _for_selector, _for_to, _for_to_unkeyed, _for_until, _for_until_unkeyed, _global_read, _hoist, _hoist_read_error, _hoist_resume, _html, _id, _if, _if_closure, _let, _let_change, _lifecycle, _load_event_trigger, _load_idle_trigger, _load_media_trigger, _load_race_trigger, _load_setup, _load_signal, _load_template, _load_visible_trigger, _on, _or, _resumed, _return, _return_change, _script, _show, _style_rule_item, _style_shell, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, init, initEmbedded, ready, readyFailed, run };
|
package/dist/html/assets.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { $Global, Template } from "../common/types";
|
|
2
2
|
import { type ServerRenderer } from "./template";
|
|
3
|
+
import { type Boundary } from "./writer";
|
|
3
4
|
declare const kAssets: unique symbol;
|
|
4
|
-
declare const
|
|
5
|
-
declare const kDeferIndex: unique symbol;
|
|
5
|
+
declare const kHead: unique symbol;
|
|
6
6
|
export interface VisibleTrigger {
|
|
7
7
|
type: "visible";
|
|
8
8
|
selector: string;
|
|
@@ -31,17 +31,23 @@ export type LoadTrigger = VisibleTrigger | IdleTrigger | MediaTrigger | EventTri
|
|
|
31
31
|
type Trigger = LoadTrigger;
|
|
32
32
|
interface Asset {
|
|
33
33
|
id: string;
|
|
34
|
-
|
|
34
|
+
flush: AssetFlush;
|
|
35
|
+
triggers: Trigger[] | undefined;
|
|
36
|
+
block: string | undefined;
|
|
37
|
+
defer: string | undefined;
|
|
38
|
+
script: string | undefined;
|
|
39
|
+
htmlAt: Boundary | null | undefined;
|
|
40
|
+
scriptAt: Boundary | null | undefined;
|
|
35
41
|
}
|
|
36
42
|
declare module "../common/types" {
|
|
37
43
|
interface $Global {
|
|
38
44
|
[kAssets]?: Asset[];
|
|
39
|
-
[
|
|
40
|
-
[kDeferIndex]?: number;
|
|
45
|
+
[kHead]?: true;
|
|
41
46
|
}
|
|
42
47
|
}
|
|
43
48
|
type AssetFlush = (g: $Global, type: "block" | "defer", asset: string) => string;
|
|
44
|
-
export declare function withLoadAssets(renderer: ServerRenderer, assetId: string, triggers?: Trigger[]): ServerRenderer;
|
|
49
|
+
export declare function withLoadAssets(renderer: ServerRenderer, flush: AssetFlush, assetId: string, triggers?: Trigger[]): ServerRenderer;
|
|
50
|
+
export declare function writeLoadAsset(assetId: string, flush: AssetFlush, triggers?: Trigger[]): void;
|
|
45
51
|
export declare function withPageAssets(template: ServerRenderer & Template, runtime: AssetFlush, assetId: string, runtimeId?: string): Template;
|
|
46
52
|
export declare function _flush_head(): string;
|
|
47
53
|
export {};
|
package/dist/html/attrs.d.ts
CHANGED
|
@@ -22,3 +22,4 @@ export declare function _attrs_content(data: Record<string, unknown>, nodeAccess
|
|
|
22
22
|
export declare function _attrs_partial(data: Record<string, unknown>, skip: Record<string, 1>, nodeAccessor: Accessor, scopeId: number, tagName: string): string;
|
|
23
23
|
export declare function _attrs_partial_content(data: Record<string, unknown>, skip: Record<string, 1>, nodeAccessor: Accessor, scopeId: number, tagName: string, markerGuard?: 1 | 0): void;
|
|
24
24
|
export declare function attrAssignment(value: string): string;
|
|
25
|
+
export declare function escapeDoubleQuotedAttrValue(value: string): string;
|
package/dist/html/compat.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { writeLoadAsset } from "./assets";
|
|
1
2
|
import { register } from "./serializer";
|
|
2
3
|
import type { ServerRenderer } from "./template";
|
|
3
4
|
import { _await, _html, _peek_scope_id, _scope_id, $global, Chunk, getChunk, isInResumedBranch, State, withChunk, writeScript } from "./writer";
|
|
4
5
|
export declare const compat: {
|
|
5
6
|
$global: typeof $global;
|
|
7
|
+
writeLoadAsset: typeof writeLoadAsset;
|
|
6
8
|
fork: typeof _await;
|
|
7
9
|
write: typeof _html;
|
|
8
10
|
writeScript: typeof writeScript;
|
|
@@ -17,9 +19,15 @@ export declare const compat: {
|
|
|
17
19
|
patchDynamicTag: (patch: (tag: unknown, scopeId: number, accessor: import("../common/types").Accessor) => unknown) => void;
|
|
18
20
|
writeSetScopeForComponent(branchId: number, m5c: string, m5i: unknown): void;
|
|
19
21
|
toJSON(): (this: WeakKey) => [registryId: string, scopeId: unknown] | undefined;
|
|
22
|
+
joinChunks(chunks: Chunk[]): Chunk | undefined;
|
|
23
|
+
appendChunks(chunks: Chunk[]): void;
|
|
24
|
+
deferReorders(reorders: Chunk[]): void;
|
|
20
25
|
createChunk($global: any): Chunk;
|
|
21
|
-
flushScript(
|
|
22
|
-
|
|
26
|
+
flushScript(chunk: Chunk, reorders?: Chunk[]): {
|
|
27
|
+
html: string;
|
|
28
|
+
scripts: string;
|
|
29
|
+
};
|
|
30
|
+
render(renderer: ServerRenderer, willRerender: boolean, classAPIOut: any, component: any, input: any, componentScopes: Chunk[], registerChildScope?: boolean, parentChunk?: Chunk): void;
|
|
23
31
|
register: typeof register;
|
|
24
32
|
registerRenderBody(fn: any): void;
|
|
25
33
|
registerClassFunctions(input: any): void;
|
|
@@ -22,6 +22,7 @@ export declare class Serializer {
|
|
|
22
22
|
written(val: WeakKey): boolean;
|
|
23
23
|
takeChannelDeps(): Set<string> | null;
|
|
24
24
|
writeCall(value: unknown, object: unknown, property: string, channel?: SerializeChannel): void;
|
|
25
|
+
dropCall(value: unknown, object: unknown, property: string): boolean;
|
|
25
26
|
}
|
|
26
27
|
export declare function register<T extends WeakKey>(id: string, val: T, scope?: unknown, locals?: Locals): T;
|
|
27
28
|
export declare function getRegistered(val: WeakKey): {
|
package/dist/html/writer.d.ts
CHANGED
|
@@ -38,6 +38,8 @@ export declare function withBranchId<T>(branchId: number, cb: () => T): T;
|
|
|
38
38
|
export declare function withBranchId<T, U>(branchId: number, cb: (value: U) => T, cbValue: U): T;
|
|
39
39
|
export declare function _html(html: string): void;
|
|
40
40
|
export declare function writeScript(script: string): void;
|
|
41
|
+
export declare function catchableBoundary(): Boundary | null;
|
|
42
|
+
export declare function mayDrop(written: Boundary): boolean;
|
|
41
43
|
export declare function _script(scopeId: number, registryId: string, markerGuard?: number): void;
|
|
42
44
|
export declare function _trailers(html: string): void;
|
|
43
45
|
export declare function _resume<T extends WeakKey>(val: T, id: string, scopeId?: number, locals?: Locals): T;
|
|
@@ -131,8 +133,10 @@ export declare class Boundary {
|
|
|
131
133
|
parent?: Boundary;
|
|
132
134
|
aborted: boolean;
|
|
133
135
|
reason: unknown;
|
|
136
|
+
subscribed?: unknown[];
|
|
134
137
|
pendingReorders?: Set<Chunk>;
|
|
135
138
|
children?: Boundary[];
|
|
139
|
+
withinCatch: boolean;
|
|
136
140
|
constructor(state: State, signal?: AbortSignal, parent?: Boundary);
|
|
137
141
|
abort(reason: unknown): void;
|
|
138
142
|
handleEvent(event: Event): void;
|
|
@@ -148,7 +152,9 @@ export declare class Chunk {
|
|
|
148
152
|
async: boolean;
|
|
149
153
|
consumed: boolean;
|
|
150
154
|
reorderId: string | null;
|
|
155
|
+
reorderStart: string;
|
|
151
156
|
deferredReady: Opt<Chunk>;
|
|
157
|
+
heldEffects: Opt<Chunk>;
|
|
152
158
|
deferredReorder: Chunk | null;
|
|
153
159
|
catchRange: {
|
|
154
160
|
id: string;
|
|
@@ -171,6 +177,7 @@ export declare class Chunk {
|
|
|
171
177
|
writeEffect(scopeId: number, registryId: string): void;
|
|
172
178
|
writeScript(script: string): void;
|
|
173
179
|
append(chunk: Chunk): void;
|
|
180
|
+
takeHeldEffects(): Opt<Chunk>;
|
|
174
181
|
takeDeferredReady(): Opt<Chunk>;
|
|
175
182
|
deferOwnReady(): void;
|
|
176
183
|
renderPlaceholders(boundary: Boundary): void;
|
|
@@ -184,6 +191,7 @@ export declare class Chunk {
|
|
|
184
191
|
flushScript(boundary: Boundary): this;
|
|
185
192
|
flushHTML(boundary: Boundary): string;
|
|
186
193
|
}
|
|
194
|
+
export declare function joinHeldEffects(heldEffects: Opt<Chunk>, effects: string): string;
|
|
187
195
|
type QueueCallback = (ticked: true) => void;
|
|
188
196
|
export declare function queueTick(cb: QueueCallback): void;
|
|
189
197
|
export declare function offTick(cb: QueueCallback): void;
|
package/dist/html.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { attrTag, attrTags } from "./common/attr-tag";
|
|
2
|
-
export { _assert_hoist, _el_read_error, _hoist_read_error, } from "./common/errors";
|
|
2
|
+
export { _assert_class_toggles, _assert_hoist, _el_read_error, _hoist_read_error, } from "./common/errors";
|
|
3
3
|
export { _flush_head, withLoadAssets, withPageAssets } from "./html/assets";
|
|
4
4
|
export { _attr, _attr_and, _attr_class, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_input_checked, _attr_input_checkedValue, _attr_input_value, _attr_nonce, _attr_nullish, _attr_option_value, _attr_or, _attr_select_value, _attr_style, _attr_textarea_value, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_select_value, _attrs_textarea_value, _style_html, _textarea_value, } from "./html/attrs";
|
|
5
5
|
export { compat } from "./html/compat";
|