marko 6.3.56 → 6.4.1
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 +3 -3
- package/dist/common/constants/accessor-prefix.d.ts +2 -0
- package/dist/common/constants/accessor-prefix.debug.d.ts +2 -0
- package/dist/common/constants/accessor-prop.d.ts +3 -0
- package/dist/common/constants/accessor-prop.debug.d.ts +3 -0
- package/dist/common/constants/reserved-id.d.ts +5 -0
- package/dist/common/errors.d.ts +1 -1
- package/dist/common/types.d.ts +11 -2
- package/dist/debug/dom/catch.feat.js +12 -14
- package/dist/debug/dom/catch.feat.mjs +12 -14
- 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 +4 -0
- package/dist/debug/dom/lazy.feat.mjs +4 -0
- package/dist/debug/dom/placeholder.feat.js +1 -1
- package/dist/debug/dom/placeholder.feat.mjs +1 -1
- package/dist/debug/{dom-DcwejnYg.js → dom-ClV4kVOO.js} +263 -193
- package/dist/debug/{dom-BeCNT5R5.mjs → dom-LFrKxOk5.mjs} +246 -182
- package/dist/debug/dom.js +14 -12
- package/dist/debug/dom.mjs +14 -12
- package/dist/debug/html.js +826 -685
- package/dist/debug/html.mjs +822 -683
- package/dist/dom/abort-signal.d.ts +2 -0
- package/dist/dom/catch.feat.js +6 -7
- package/dist/dom/catch.feat.mjs +5 -7
- package/dist/dom/control-flow.d.ts +3 -5
- package/dist/dom/controllable-input.feat.js +3 -2
- package/dist/dom/controllable-input.feat.mjs +1 -1
- package/dist/dom/controllable-open.feat.js +3 -2
- package/dist/dom/controllable-open.feat.mjs +1 -1
- package/dist/dom/controllable-select.feat.js +3 -2
- package/dist/dom/controllable-select.feat.mjs +1 -1
- package/dist/dom/controllable-textarea.feat.js +3 -2
- package/dist/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/dom/controllable.feat.js +3 -2
- package/dist/dom/controllable.feat.mjs +1 -1
- package/dist/dom/dynamic-tag-script.feat.js +3 -2
- package/dist/dom/dynamic-tag-script.feat.mjs +1 -1
- package/dist/dom/dynamic-tag-var.feat.js +2 -1
- package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
- package/dist/dom/lazy.feat.d.ts +1 -0
- package/dist/dom/lazy.feat.js +4 -0
- package/dist/dom/lazy.feat.mjs +4 -0
- package/dist/dom/load.d.ts +3 -3
- package/dist/dom/placeholder.feat.js +4 -3
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/dom/queue.d.ts +2 -4
- package/dist/dom/resume.d.ts +1 -1
- package/dist/dom/scope.d.ts +0 -1
- package/dist/dom/signals.d.ts +3 -2
- package/dist/{dom-QEF0csuC.js → dom-CNglVi8P.js} +222 -185
- package/dist/{dom-BwNsIevR.mjs → dom-DfP3MCo0.mjs} +126 -90
- package/dist/dom.js +59 -56
- package/dist/dom.mjs +34 -32
- package/dist/html/attrs.d.ts +4 -2
- package/dist/html/dynamic-tag.d.ts +1 -1
- package/dist/html/inlined-runtimes.d.ts +1 -1
- package/dist/html/inlined-runtimes.debug.d.ts +1 -1
- package/dist/html/serializer.d.ts +1 -1
- package/dist/html/writer.d.ts +39 -33
- package/dist/html.d.ts +2 -2
- package/dist/html.js +526 -424
- package/dist/html.mjs +524 -423
- package/dist/translator/core/html-comment.d.ts +0 -7
- package/dist/translator/core/let.d.ts +0 -5
- package/dist/translator/core/show.d.ts +2 -5
- package/dist/translator/core/style.d.ts +6 -8
- package/dist/translator/index.d.ts +9 -0
- package/dist/translator/index.js +8195 -7939
- package/dist/translator/util/binding-has-prop.d.ts +3 -1
- package/dist/translator/util/binding-prop-tree.d.ts +4 -4
- package/dist/translator/util/bindings.d.ts +127 -0
- package/dist/translator/util/body-to-text-literal.d.ts +1 -2
- package/dist/translator/util/branch-tag.d.ts +7 -7
- package/dist/translator/util/constants/binding-type.d.ts +5 -6
- package/dist/translator/util/constants/slot-kind.d.ts +14 -0
- package/dist/translator/util/constants/structure-kind.d.ts +1 -1
- package/dist/translator/util/entry-builder.d.ts +2 -0
- package/dist/translator/util/evaluate.d.ts +11 -10
- package/dist/translator/util/finalize-references.d.ts +4 -0
- package/dist/translator/util/for-selector.d.ts +1 -1
- package/dist/translator/util/generate-uid.d.ts +7 -0
- package/dist/translator/util/get-declared-binding-expression.d.ts +2 -2
- package/dist/translator/util/is-core-tag.d.ts +0 -3
- package/dist/translator/util/is-only-child-in-parent.d.ts +2 -7
- package/dist/translator/util/known-tag.d.ts +8 -7
- package/dist/translator/util/read-replacement.d.ts +3 -0
- package/dist/translator/util/reasons.d.ts +32 -0
- package/dist/translator/util/references.d.ts +69 -167
- package/dist/translator/util/runtime.d.ts +3 -3
- package/dist/translator/util/scope-accessor.d.ts +14 -0
- package/dist/translator/util/scope-read.d.ts +1 -1
- package/dist/translator/util/sections.d.ts +56 -50
- package/dist/translator/util/set-tag-derived-from.d.ts +7 -0
- package/dist/translator/util/setup-work.d.ts +4 -0
- package/dist/translator/util/signals.d.ts +8 -12
- package/dist/translator/util/slots.d.ts +50 -0
- package/dist/translator/util/solve-reasons.d.ts +10 -0
- package/dist/translator/util/sources.d.ts +21 -0
- package/dist/translator/util/structure.d.ts +5 -2
- package/dist/translator/util/tag-facts.d.ts +21 -0
- package/dist/translator/util/tag-name-type.d.ts +4 -1
- package/dist/translator/util/translate-attrs.d.ts +2 -0
- package/dist/translator/util/translate-var.d.ts +3 -0
- package/dist/translator/util/write-guard.d.ts +12 -0
- package/dist/translator/util/writer.d.ts +3 -3
- package/dist/translator/visitors/export-declaration.d.ts +9 -0
- package/dist/translator/visitors/function.d.ts +5 -4
- package/dist/translator/visitors/import-declaration.d.ts +2 -2
- package/dist/translator/visitors/placeholder.d.ts +0 -3
- package/dist/translator/visitors/program/index.d.ts +13 -3
- package/dist/translator/visitors/referenced-identifier.d.ts +2 -1
- package/dist/translator/visitors/tag/custom-tag.d.ts +1 -1
- package/dist/translator/visitors/tag/dynamic-tag.d.ts +0 -3
- package/dist/translator/visitors/tag/index.d.ts +2 -1
- package/dist/translator/visitors/tag/native-tag.d.ts +26 -11
- package/package.json +3 -3
- package/dist/translator/util/insertion-context.d.ts +0 -1
- package/dist/translator/util/is-non-html-text.d.ts +0 -3
- package/dist/translator/util/serialize-guard.d.ts +0 -11
- package/dist/translator/util/serialize-reasons.d.ts +0 -37
- package/dist/translator/util/set-tag-sections-downstream.d.ts +0 -6
- package/dist/translator/util/setup-statements.d.ts +0 -5
package/dist/dom.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
let require_control_flow = require("./dom-CNglVi8P.js"), empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), classEventResolver, scopesByRender = /* @__PURE__ */ new WeakMap(), getRenderScopes = ($global) => {
|
|
3
|
+
require_control_flow.wt($global.runtimeId);
|
|
3
4
|
let render = self[$global.runtimeId]?.[$global.renderId], scopes = render && scopesByRender.get(render);
|
|
4
5
|
return render && !scopes && scopesByRender.set(render, scopes = {}), scopes;
|
|
5
6
|
}, compat = {
|
|
6
7
|
patchDynamicTag: require_control_flow.v,
|
|
7
|
-
queueEffect: require_control_flow.
|
|
8
|
+
queueEffect: require_control_flow.on,
|
|
8
9
|
init(warp10Noop) {
|
|
9
|
-
require_control_flow.
|
|
10
|
+
require_control_flow.xt.$C_s = (scope) => {
|
|
10
11
|
if (getRenderScopes(scope.$)[scope.L] = scope, scope.m5c && classIdToBranch.set(scope.m5c, scope), classEventResolver) for (let key in scope) {
|
|
11
12
|
let resolved = classEventResolver(scope[key], scope);
|
|
12
13
|
resolved !== scope[key] && (scope[key] = resolved);
|
|
13
14
|
}
|
|
14
|
-
}, require_control_flow.
|
|
15
|
+
}, require_control_flow.xt.$C_b = warp10Noop;
|
|
15
16
|
},
|
|
16
17
|
setClassEventResolver(fn) {
|
|
17
18
|
classEventResolver = fn;
|
|
18
19
|
},
|
|
19
20
|
resumeClassFunction(id, build) {
|
|
20
|
-
require_control_flow.
|
|
21
|
+
require_control_flow.xt[id] = build;
|
|
21
22
|
},
|
|
22
23
|
getScope($global, scopeId) {
|
|
23
24
|
return getRenderScopes($global)?.[scopeId];
|
|
@@ -41,57 +42,34 @@ let require_control_flow = require("./dom-QEF0csuC.js"), empty = [], rest = Symb
|
|
|
41
42
|
this.effects && require_control_flow.un(this.effects);
|
|
42
43
|
},
|
|
43
44
|
runComponentDestroy() {
|
|
44
|
-
this.scope && require_control_flow.
|
|
45
|
+
this.scope && require_control_flow.Xt(this.scope);
|
|
45
46
|
},
|
|
46
47
|
resolveRegistered(value, $global) {
|
|
47
|
-
return Array.isArray(value) && typeof value[0] == "string" ? require_control_flow.
|
|
48
|
+
return Array.isArray(value) && typeof value[0] == "string" ? require_control_flow.Ct(value[0], getRenderScopes($global)?.[value[1]]) : value;
|
|
48
49
|
},
|
|
49
50
|
createRenderer(params, clone) {
|
|
50
|
-
let renderer = require_control_flow.
|
|
51
|
+
let renderer = require_control_flow.pt("", 0, 0, 0, params)();
|
|
51
52
|
return renderer.b = (branch) => {
|
|
52
53
|
let cloned = clone();
|
|
53
54
|
branch.S = cloned.startNode, branch.K = cloned.endNode;
|
|
54
55
|
}, renderer;
|
|
55
56
|
},
|
|
56
57
|
render(out, component, renderer, args) {
|
|
57
|
-
require_control_flow.
|
|
58
|
+
require_control_flow.wt(out.global.runtimeId);
|
|
58
59
|
let branch = component.scope, created = 0;
|
|
59
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]) {
|
|
60
61
|
let input = args[0], normalizedInput = args[0] = {};
|
|
61
62
|
for (let key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
|
|
62
63
|
}
|
|
63
|
-
|
|
64
|
-
branch ||= (created = 1, component.scope = require_control_flow.
|
|
65
|
-
}
|
|
64
|
+
let renderBranch = () => {
|
|
65
|
+
branch ||= (created = 1, component.scope = require_control_flow.gt(out.global, renderer, renderer.e, document.body)), renderer.d?.(branch, renderer._ ? args[0] : args);
|
|
66
|
+
};
|
|
67
|
+
if (component.effects = require_control_flow.cn ? renderBranch() : require_control_flow.in(renderBranch), created) return require_control_flow.ft(branch.S, branch.K);
|
|
66
68
|
}
|
|
67
69
|
}, _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
|
|
71
|
-
let pending, lazyTemplate = _template(id, 0, 0, (branch) => {
|
|
72
|
-
let awaitCounter = require_control_flow.h(branch);
|
|
73
|
-
branch.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((renderer) => {
|
|
74
|
-
Object.assign(lazyTemplate, renderer), require_control_flow.on(branch, (branch) => insertLoaded(renderer, branch, branch.S, awaitCounter));
|
|
75
|
-
}, loadFailed(branch, awaitCounter));
|
|
76
|
-
}, _load_signal(() => (pending ||= load()).then((r) => ({ _: r.d || noop }))));
|
|
77
|
-
return lazyTemplate;
|
|
78
|
-
}), _load_setup = /*@__PURE__*/ require_control_flow.Dt((load) => {
|
|
79
|
-
let pending, renderer, insertCached = (child, marker) => insertLoaded(renderer, child, marker);
|
|
80
|
-
return (owner, child, marker) => {
|
|
81
|
-
if (renderer) require_control_flow.cn(child, insertCached, -1, marker);
|
|
82
|
-
else {
|
|
83
|
-
let awaitCounter = require_control_flow.h(owner);
|
|
84
|
-
child.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((mod) => {
|
|
85
|
-
renderer ||= require_control_flow.ft("", ...mod._)(), require_control_flow.on(child, (child) => insertLoaded(renderer, child, marker, awaitCounter));
|
|
86
|
-
}, loadFailed(child, awaitCounter));
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
}), _load_signal = /*@__PURE__*/ require_control_flow.Dt((load) => {
|
|
90
|
-
let pending, apply = (scope, value) => {
|
|
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);
|
|
92
|
-
};
|
|
93
|
-
return apply;
|
|
94
|
-
});
|
|
70
|
+
let renderer = require_control_flow.pt(id, template, walks, setup, inputSignal)();
|
|
71
|
+
return renderer.mount = mount, renderer._ = renderer, require_control_flow.xt[id] = renderer;
|
|
72
|
+
}, noop = (_) => 0;
|
|
95
73
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
96
74
|
//#region src/common/attr-tag.ts
|
|
97
75
|
function attrTag(attrs) {
|
|
@@ -125,52 +103,77 @@ function mount(input = {}, reference, position) {
|
|
|
125
103
|
case "afterbegin":
|
|
126
104
|
nextSibling = reference.firstChild;
|
|
127
105
|
break;
|
|
128
|
-
case "afterend":
|
|
129
|
-
parentNode = reference.parentNode, nextSibling = reference.nextSibling;
|
|
130
|
-
break;
|
|
106
|
+
case "afterend": parentNode = reference.parentNode, nextSibling = reference.nextSibling;
|
|
131
107
|
}
|
|
132
|
-
let curValue, args = this.d, effects = require_control_flow.
|
|
133
|
-
branch = require_control_flow.
|
|
108
|
+
let curValue, args = this.d, effects = require_control_flow.in(() => {
|
|
109
|
+
branch = require_control_flow._t($global, this, void 0, parentNode), branch.T = (newValue) => {
|
|
134
110
|
curValue = newValue;
|
|
135
111
|
}, this.c?.(branch), args?.(branch, input);
|
|
136
112
|
});
|
|
137
|
-
return require_control_flow.
|
|
113
|
+
return require_control_flow.dt(parentNode, nextSibling, branch.S, branch.K), require_control_flow.un(effects), {
|
|
138
114
|
get value() {
|
|
139
115
|
return curValue;
|
|
140
116
|
},
|
|
141
117
|
set value(newValue) {
|
|
142
|
-
require_control_flow.
|
|
118
|
+
require_control_flow.Jt(branch, newValue);
|
|
143
119
|
},
|
|
144
120
|
update(newInput = {}) {
|
|
145
|
-
args && (newInput.$global && ({$global, ...newInput} = newInput), require_control_flow.un(require_control_flow.
|
|
121
|
+
args && (newInput.$global && ({$global, ...newInput} = newInput), require_control_flow.un(require_control_flow.in(() => {
|
|
146
122
|
args(branch, newInput);
|
|
147
123
|
})));
|
|
148
124
|
},
|
|
149
125
|
destroy() {
|
|
150
|
-
require_control_flow.
|
|
126
|
+
require_control_flow.Qt(branch);
|
|
151
127
|
}
|
|
152
128
|
};
|
|
153
129
|
}
|
|
154
130
|
//#endregion
|
|
155
131
|
//#region src/dom/load.ts
|
|
132
|
+
function _load_template(id, load) {
|
|
133
|
+
let pending, lazyTemplate = _template(id, 0, 0, (branch) => {
|
|
134
|
+
let awaitCounter = require_control_flow.h(branch);
|
|
135
|
+
branch.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((renderer) => {
|
|
136
|
+
Object.assign(lazyTemplate, renderer), require_control_flow.an(branch, (branch) => insertLoaded(renderer, branch, branch.S, awaitCounter));
|
|
137
|
+
}, loadFailed(branch, awaitCounter));
|
|
138
|
+
}, _load_signal(() => (pending ||= load()).then((r) => ({ _: r.d || noop }))));
|
|
139
|
+
return lazyTemplate;
|
|
140
|
+
}
|
|
141
|
+
function _load_setup(load) {
|
|
142
|
+
let pending, renderer, insertCached = (child, marker) => insertLoaded(renderer, child, marker);
|
|
143
|
+
return (owner, child, marker) => {
|
|
144
|
+
if (renderer) require_control_flow.sn(child, insertCached, -1, marker);
|
|
145
|
+
else {
|
|
146
|
+
let awaitCounter = require_control_flow.h(owner);
|
|
147
|
+
child.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((mod) => {
|
|
148
|
+
renderer ||= require_control_flow.pt("", ...mod._)(), require_control_flow.an(child, (child) => insertLoaded(renderer, child, marker, awaitCounter));
|
|
149
|
+
}, loadFailed(child, awaitCounter));
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
}
|
|
156
153
|
function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
157
154
|
let parent = marker.parentNode, values = branch.X, clone = () => {
|
|
158
|
-
require_control_flow
|
|
155
|
+
require_control_flow.$t(branch), renderer.b(branch, parent.namespaceURI), branch.X = 0;
|
|
159
156
|
}, insert = () => {
|
|
160
|
-
require_control_flow.
|
|
157
|
+
require_control_flow.Zt(branch, parent, marker), marker.remove(), awaitCounter?.c();
|
|
161
158
|
}, remaining;
|
|
162
159
|
if (remaining = values?.size) {
|
|
163
160
|
let fail = loadFailed(branch, awaitCounter);
|
|
164
|
-
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && require_control_flow.
|
|
161
|
+
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && require_control_flow.an(branch, (branch) => {
|
|
165
162
|
clone(), renderer.c?.(branch), values.forEach(([value, apply]) => apply(branch, value)), insert();
|
|
166
163
|
}), (error) => remaining > 0 && (remaining = 0, fail(error))));
|
|
167
|
-
} else clone(), require_control_flow.
|
|
164
|
+
} else clone(), require_control_flow.vt(renderer, branch), insert();
|
|
168
165
|
}
|
|
169
166
|
function loadFailed(scope, awaitCounter) {
|
|
170
167
|
return (error) => {
|
|
171
|
-
awaitCounter && (awaitCounter.m ? awaitCounter.i = 0 : awaitCounter.c()), require_control_flow.
|
|
168
|
+
awaitCounter && (awaitCounter.m ? awaitCounter.i = 0 : awaitCounter.i && awaitCounter.c()), require_control_flow.an(scope, require_control_flow.y, error);
|
|
172
169
|
};
|
|
173
170
|
}
|
|
171
|
+
function _load_signal(load) {
|
|
172
|
+
let pending, apply = (scope, value) => {
|
|
173
|
+
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);
|
|
174
|
+
};
|
|
175
|
+
return apply;
|
|
176
|
+
}
|
|
174
177
|
function _load_visible_trigger(selector, options) {
|
|
175
178
|
let pending, el;
|
|
176
179
|
return (load) => () => (pending ||= new Promise((resolve) => (el = getSelectorOrResolve(selector, resolve)) && new IntersectionObserver((entries, io) => entries.some((entry) => entry.isIntersecting) && resolve(io.disconnect()), options).observe(el))).then(load);
|
|
@@ -194,9 +197,9 @@ function _load_race_trigger(...triggers) {
|
|
|
194
197
|
function getSelectorOrResolve(selector, resolve) {
|
|
195
198
|
return document.querySelector(selector) || resolve();
|
|
196
199
|
}
|
|
197
|
-
exports.$signal = require_control_flow.
|
|
200
|
+
exports.$signal = require_control_flow.tn, exports.$signalReset = require_control_flow.nn, exports._assert_hoist = require_control_flow.gn, exports._assert_init = require_control_flow.Yt, 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_content = require_control_flow.J, 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.Y, 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.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.vn, exports._child_setup = require_control_flow.kt, exports._closure = require_control_flow.At, exports._closure_get = require_control_flow.jt, exports._const = require_control_flow.Mt, exports._content = require_control_flow.pt, exports._content_closures = require_control_flow.mt, exports._content_resume = require_control_flow.ht, 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", {
|
|
198
201
|
enumerable: !0,
|
|
199
202
|
get: function() {
|
|
200
203
|
return require_control_flow.r;
|
|
201
204
|
}
|
|
202
|
-
}), exports._dynamic_tag_content = require_control_flow.i, exports._dynamic_tag_var_resume = require_control_flow.
|
|
205
|
+
}), 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.Nt, exports._for_closure = require_control_flow.Pt, 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.Ft, 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.It, exports._hoist = require_control_flow.Lt, exports._hoist_read_error = require_control_flow._n, exports._hoist_resume = require_control_flow.Rt, exports._html = require_control_flow.it, exports._id = require_control_flow.zt, exports._if = require_control_flow.f, exports._if_closure = require_control_flow.Bt, exports._let = require_control_flow.Vt, exports._let_change = require_control_flow.Ht, 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.en, exports._or = require_control_flow.Ut, exports._resumed = require_control_flow.xt, exports._return = require_control_flow.Wt, exports._return_change = require_control_flow.Gt, exports._script = require_control_flow.Kt, 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.qt, exports._var_change = require_control_flow.Jt, exports._var_resume = require_control_flow.St, 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.wt, exports.initEmbedded = require_control_flow.Tt, exports.ready = require_control_flow.Et, exports.readyFailed = require_control_flow.Dt, exports.run = require_control_flow.ln;
|
package/dist/dom.mjs
CHANGED
|
@@ -60,39 +60,16 @@ let empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), cl
|
|
|
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
|
-
|
|
63
|
+
let renderBranch = () => {
|
|
64
64
|
branch ||= (created = 1, component.scope = createAndSetupBranch(out.global, renderer, renderer.e, document.body)), renderer.d?.(branch, renderer._ ? args[0] : args);
|
|
65
|
-
}
|
|
65
|
+
};
|
|
66
|
+
if (component.effects = rendering ? renderBranch() : prepareEffects(renderBranch), created) return toInsertNode(branch.S, branch.K);
|
|
66
67
|
}
|
|
67
68
|
}, _template = (id, template, walks, setup, inputSignal) => {
|
|
68
69
|
let renderer = _content(id, template, walks, setup, inputSignal)();
|
|
69
70
|
return renderer.mount = mount, renderer._ = renderer, _resumed[id] = renderer;
|
|
70
|
-
}, noop = (_) => 0
|
|
71
|
-
|
|
72
|
-
let awaitCounter = addAwaitCounter(branch);
|
|
73
|
-
branch.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((renderer) => {
|
|
74
|
-
Object.assign(lazyTemplate, renderer), queueAsyncRender(branch, (branch) => insertLoaded(renderer, branch, branch.S, awaitCounter));
|
|
75
|
-
}, loadFailed(branch, awaitCounter));
|
|
76
|
-
}, _load_signal(() => (pending ||= load()).then((r) => ({ _: r.d || noop }))));
|
|
77
|
-
return lazyTemplate;
|
|
78
|
-
}), _load_setup = /*@__PURE__*/ withLazy((load) => {
|
|
79
|
-
let pending, renderer, insertCached = (child, marker) => insertLoaded(renderer, child, marker);
|
|
80
|
-
return (owner, child, marker) => {
|
|
81
|
-
if (renderer) queueRender(child, insertCached, -1, marker);
|
|
82
|
-
else {
|
|
83
|
-
let awaitCounter = addAwaitCounter(owner);
|
|
84
|
-
child.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((mod) => {
|
|
85
|
-
renderer ||= _content("", ...mod._)(), queueAsyncRender(child, (child) => insertLoaded(renderer, child, marker, awaitCounter));
|
|
86
|
-
}, loadFailed(child, awaitCounter));
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
}), _load_signal = /*@__PURE__*/ withLazy((load) => {
|
|
90
|
-
let pending, apply = (scope, value) => {
|
|
91
|
-
pending ||= load(), scope.X || !("X" in scope) && scope.H === runId ? (scope.X ||= /* @__PURE__ */ new Map()).set(pending, [value, apply]) : apply._ ? apply._(scope, value) : pending.then((mod) => queueAsyncRender(scope, apply._ = mod._, value), noop);
|
|
92
|
-
};
|
|
93
|
-
return apply;
|
|
94
|
-
});
|
|
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 _dynamic_tag_var_resume, w as _attr_input_checkedValue, wt as initEmbedded, x as _attr_details_or_dialog_open_default, xt as _var_resume, y as renderCatch, yt as _el, z as _controllable_select, zt as _if_closure } from "./dom-BwNsIevR.mjs";
|
|
71
|
+
}, noop = (_) => 0;
|
|
72
|
+
import { $ as _attrs, $t as syncGen, A as _attr_input_value, At as _closure, B as _controllable_select, Bt as _if_closure, C as _attr_details_or_dialog_open_script, Ct as getRegisteredWithScope, D as _attr_input_checkedValue_script, Dt as readyFailed, E as _attr_input_checkedValue_default, Et as ready, F as _attr_select_value, Ft as _for_selector, G as _attr_class, Gt as _return_change, Ht as _let_change, I as _attr_select_value_default, It as _global_read, J as _attr_content, Jt as _var_change, K as _attr_class_item, Kt as _script, L as _attr_select_value_script, Lt as _hoist, M as _attr_input_value_default, Mt as _const, N as _attr_input_value_dynamic_default, Nt as _el_read, O as _attr_input_checked_default, P as _attr_input_value_script, Pt as _for_closure, Q as _attr_style_items, Qt as removeAndDestroyBranch, R as _controllable_input, Rt as _hoist_resume, S as _attr_details_or_dialog_open_default, St as _var_resume, T as _attr_input_checkedValue, Tt as initEmbedded, Ut as _or, V as _controllable_textarea, Vt as _let, W as _attr, Wt as _return, X as _attr_style, Xt as destroyBranch, Y as _attr_nonce, Yt as _assert_init, Z as _attr_style_item, Zt as insertBranchBefore, _n as _hoist_read_error, _t as createBranch, a as _for_in, an as queueAsyncRender, at as _lifecycle, bt as _el, c as _for_to, cn as rendering, ct as _text, d as _for_until_unkeyed, dn as runId, dt as insertChildNodes, en as _on, et as _attrs_content, f as _if, fn as forIn, ft as toInsertNode, gn as _assert_hoist, gt as createAndSetupBranch, h as addAwaitCounter, hn as forUntil, ht as _content_resume, i as _dynamic_tag_content, in as prepareEffects, it as _html, j as _attr_input_value_attribute_default, jt as _closure_get, k as _attr_input_checked_script, kt as _child_setup, l as _for_to_unkeyed, ln as run, lt as _text_content, m as _try, mn as forTo, mt as _content_closures, n as _await_promise, nn as $signalReset, nt as _attrs_partial_content, o as _for_of, on as queueEffect, ot as _style_rule_item, p as _show, pn as forOf, pt as _content, q as _attr_class_items, qt as _var, r as _dynamic_tag, rt as _attrs_script, s as _for_of_unkeyed, sn as queueRender, st as _style_shell, t as _await_content, tn as $signal, tt as _attrs_partial, u as _for_until, un as runEffects, ut as _to_text, v as patchDynamicTag, vn as _call, vt as setupBranch, w as _attr_input_checked, wt as init, x as _attr_details_or_dialog_open, xt as _resumed, y as renderCatch, yt as _dynamic_tag_var_resume, z as _controllable_open, zt as _id } from "./dom-DfP3MCo0.mjs";
|
|
96
73
|
//#region src/common/attr-tag.ts
|
|
97
74
|
function attrTag(attrs) {
|
|
98
75
|
return attrs[Symbol.iterator] = attrTagIterator, attrs[rest] = empty, attrs;
|
|
@@ -125,9 +102,7 @@ function mount(input = {}, reference, position) {
|
|
|
125
102
|
case "afterbegin":
|
|
126
103
|
nextSibling = reference.firstChild;
|
|
127
104
|
break;
|
|
128
|
-
case "afterend":
|
|
129
|
-
parentNode = reference.parentNode, nextSibling = reference.nextSibling;
|
|
130
|
-
break;
|
|
105
|
+
case "afterend": parentNode = reference.parentNode, nextSibling = reference.nextSibling;
|
|
131
106
|
}
|
|
132
107
|
let curValue, args = this.d, effects = prepareEffects(() => {
|
|
133
108
|
branch = createBranch($global, this, void 0, parentNode), branch.T = (newValue) => {
|
|
@@ -153,6 +128,27 @@ function mount(input = {}, reference, position) {
|
|
|
153
128
|
}
|
|
154
129
|
//#endregion
|
|
155
130
|
//#region src/dom/load.ts
|
|
131
|
+
function _load_template(id, load) {
|
|
132
|
+
let pending, lazyTemplate = _template(id, 0, 0, (branch) => {
|
|
133
|
+
let awaitCounter = addAwaitCounter(branch);
|
|
134
|
+
branch.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((renderer) => {
|
|
135
|
+
Object.assign(lazyTemplate, renderer), queueAsyncRender(branch, (branch) => insertLoaded(renderer, branch, branch.S, awaitCounter));
|
|
136
|
+
}, loadFailed(branch, awaitCounter));
|
|
137
|
+
}, _load_signal(() => (pending ||= load()).then((r) => ({ _: r.d || noop }))));
|
|
138
|
+
return lazyTemplate;
|
|
139
|
+
}
|
|
140
|
+
function _load_setup(load) {
|
|
141
|
+
let pending, renderer, insertCached = (child, marker) => insertLoaded(renderer, child, marker);
|
|
142
|
+
return (owner, child, marker) => {
|
|
143
|
+
if (renderer) queueRender(child, insertCached, -1, marker);
|
|
144
|
+
else {
|
|
145
|
+
let awaitCounter = addAwaitCounter(owner);
|
|
146
|
+
child.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((mod) => {
|
|
147
|
+
renderer ||= _content("", ...mod._)(), queueAsyncRender(child, (child) => insertLoaded(renderer, child, marker, awaitCounter));
|
|
148
|
+
}, loadFailed(child, awaitCounter));
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
}
|
|
156
152
|
function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
157
153
|
let parent = marker.parentNode, values = branch.X, clone = () => {
|
|
158
154
|
syncGen(branch), renderer.b(branch, parent.namespaceURI), branch.X = 0;
|
|
@@ -168,9 +164,15 @@ function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
|
168
164
|
}
|
|
169
165
|
function loadFailed(scope, awaitCounter) {
|
|
170
166
|
return (error) => {
|
|
171
|
-
awaitCounter && (awaitCounter.m ? awaitCounter.i = 0 : awaitCounter.c()), queueAsyncRender(scope, renderCatch, error);
|
|
167
|
+
awaitCounter && (awaitCounter.m ? awaitCounter.i = 0 : awaitCounter.i && awaitCounter.c()), queueAsyncRender(scope, renderCatch, error);
|
|
172
168
|
};
|
|
173
169
|
}
|
|
170
|
+
function _load_signal(load) {
|
|
171
|
+
let pending, apply = (scope, value) => {
|
|
172
|
+
pending ||= load(), scope.X || !("X" in scope) && scope.H === runId ? (scope.X ||= /* @__PURE__ */ new Map()).set(pending, [value, apply]) : apply._ ? apply._(scope, value) : pending.then((mod) => queueAsyncRender(scope, apply._ = mod._, value), noop);
|
|
173
|
+
};
|
|
174
|
+
return apply;
|
|
175
|
+
}
|
|
174
176
|
function _load_visible_trigger(selector, options) {
|
|
175
177
|
let pending, el;
|
|
176
178
|
return (load) => () => (pending ||= new Promise((resolve) => (el = getSelectorOrResolve(selector, resolve)) && new IntersectionObserver((entries, io) => entries.some((entry) => entry.isIntersecting) && resolve(io.disconnect()), options).observe(el))).then(load);
|
package/dist/html/attrs.d.ts
CHANGED
|
@@ -3,7 +3,9 @@ export declare function _attr_class(value: unknown): string;
|
|
|
3
3
|
export declare function _attr_style(value: unknown): string;
|
|
4
4
|
export declare function _attr_option_value(value: unknown): string;
|
|
5
5
|
export declare function _attr_select_value(scopeId: number, nodeAccessor: Accessor, value: unknown, valueChange: unknown, content?: () => void, serializeType?: 1): void;
|
|
6
|
+
export declare function _attrs_select_value(scopeId: number, nodeAccessor: Accessor, data: Record<string, unknown>, content: () => void): void;
|
|
6
7
|
export declare function _attr_textarea_value(scopeId: number, nodeAccessor: Accessor, value: unknown, valueChange: unknown, serializeType?: 1): string;
|
|
8
|
+
export declare function _attrs_textarea_value(scopeId: number, nodeAccessor: Accessor, data: Record<string, unknown>): string;
|
|
7
9
|
export declare function _textarea_value(value: unknown): string;
|
|
8
10
|
export declare function _attr_input_value(scopeId: number, nodeAccessor: Accessor, value: unknown, valueChange: unknown, serializeType?: 1): string;
|
|
9
11
|
export declare function _attr_input_checked(scopeId: number, nodeAccessor: Accessor, checked: unknown, checkedChange: unknown, serializeType?: 1): "" | " checked";
|
|
@@ -16,7 +18,7 @@ export declare function _attr_and(name: string, value: unknown, attr: string): s
|
|
|
16
18
|
export declare function _attr_or(name: string, value: unknown, attr: string): string;
|
|
17
19
|
export declare function _attr_nullish(name: string, value: unknown, attr: string): string;
|
|
18
20
|
export declare function _attrs(data: Record<string, unknown>, nodeAccessor: Accessor, scopeId: number, tagName: string): string;
|
|
19
|
-
export declare function _attrs_content(data: Record<string, unknown>, nodeAccessor: Accessor, scopeId: number, tagName: string,
|
|
21
|
+
export declare function _attrs_content(data: Record<string, unknown>, nodeAccessor: Accessor, scopeId: number, tagName: string, markerGuard?: 1 | 0): void;
|
|
20
22
|
export declare function _attrs_partial(data: Record<string, unknown>, skip: Record<string, 1>, nodeAccessor: Accessor, scopeId: number, tagName: string): string;
|
|
21
|
-
export declare function _attrs_partial_content(data: Record<string, unknown>, skip: Record<string, 1>, nodeAccessor: Accessor, scopeId: number, tagName: string,
|
|
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;
|
|
22
24
|
export declare function attrAssignment(value: string): string;
|
|
@@ -5,7 +5,7 @@ interface BodyContentObject {
|
|
|
5
5
|
[x: PropertyKey]: unknown;
|
|
6
6
|
content: ServerRenderer;
|
|
7
7
|
}
|
|
8
|
-
export declare let _dynamic_tag: (scopeId: number, accessor: Accessor, tag: unknown | string | ServerRenderer | BodyContentObject, inputOrArgs: unknown, content?: (() => void) | 0, inputIsArgs?: 1,
|
|
8
|
+
export declare let _dynamic_tag: (scopeId: number, accessor: Accessor, tag: unknown | string | ServerRenderer | BodyContentObject, inputOrArgs: unknown, content?: (() => void) | 0, inputIsArgs?: 1, markerGuard?: 1 | 0) => unknown;
|
|
9
9
|
export declare function _content(id: string, fn: ServerRenderer, scopeId?: number): ServerRenderer;
|
|
10
10
|
export declare function _content_resume(id: string, fn: ServerRenderer, scopeId?: number, locals?: Locals): ServerRenderer;
|
|
11
11
|
export declare const patchDynamicTag: (patch: (tag: unknown, scopeId: number, accessor: Accessor) => unknown) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const WALKER_RUNTIME_CODE = "(e=>(self[e]||=(l,f=e+l,s=f.length,a={},d=[],t=document,n=t.createTreeWalker(t,129))=>t=self[e][l]={i:f,d:t,l:a,v:d,x(){},w(e,l,r){for(;e=n.nextNode();)t.x(l=(l=e.data)&&!l.indexOf(f)&&(r=l.slice(s+1),(l=l[s])>\"#\"||(a[r]=e),l),r,e),l>\"#\"&&d.push(e)}},self[e]))";
|
|
2
|
-
export declare const REORDER_RUNTIME_CODE = "(e=>{if(e.j)return;let i,l,r,t=e.p={},c=(i,l)=>e.l[i].replaceWith(...l.childNodes);e.j={},e.x=(n,a,d,o,g)=>{d==r&&i(),\"#\"==n?(t[a]=l).i++:\"
|
|
2
|
+
export declare const REORDER_RUNTIME_CODE = "(e=>{if(e.j)return;let i,l,r,t=e.p={},c=(i,l)=>e.l[i].replaceWith(...l.childNodes);e.j={},e.x=(n,a,d,o,g)=>{d==r&&i(),\"#\"==n?(t[a]=l).i++:\"T\"==d.tagName&&(a=d.getAttribute(e.i))&&(r=d.nextSibling,i=()=>{d.remove(),o||c(a,d),l.c()},l=t[a]||(o=t[a]={i:1,r:a,c(i=e.l[\"^\"+a],f=d.cloneNode()){if(--o.i)return 1;for(;f.prepend(r=e.l[a].previousSibling||i),i!=r;);c(a,d)}}),e.v.push({data:e.i+\"*\"+l.r}),(n=e.j[a])&&(g=l.c,l.c=()=>g()||n(e.r)))}})";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const WALKER_RUNTIME_CODE = "((runtimeId) => (self[runtimeId] ||= (\n renderId,\n prefix = runtimeId + renderId,\n prefixLen = prefix.length,\n lookup = {},\n visits = [],\n doc = document,\n walker = doc.createTreeWalker(\n doc,\n 129 /* NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_ELEMENT */,\n ),\n) =>\n doc = (self[runtimeId][renderId] = {\n i: prefix,\n d: doc,\n l: lookup,\n v: visits,\n x() {},\n w(node, op, id) {\n while ((node = walker.nextNode())) {\n // Only reorder markers (\"#\", \"!\") are ever looked up, so only they are\n // kept: the lookup lives as long as the page, and every node marker\n // would otherwise stay referenced in it after resume consumed it.\n doc.x(\n (op =\n (op = node.data) &&\n !op.indexOf(prefix) &&\n ((id = op.slice(prefixLen + 1)),\n (op = op[prefixLen]) > \"#\" || (lookup[id] = node),\n op)),\n id,\n node,\n );\n\n if (op > \"#\") {\n visits.push(node);\n }\n }\n },\n })\n, self[runtimeId]))";
|
|
2
|
-
export declare const REORDER_RUNTIME_CODE = "((runtime) => {\n if (runtime.j) return;\n let onNextSibling,\n placeholder,\n nextSibling,\n placeholders = runtime.p = {},\n replace = (id, container) => runtime.l[id].replaceWith(...container.childNodes);\n runtime.j = {};\n runtime.x = (op, id, node, placeholderRoot, placeholderCb) => {\n if (node == nextSibling) {\n onNextSibling();\n }\n\n if (op == \"#\") {\n (placeholders[id] = placeholder).i++;\n } else if (
|
|
2
|
+
export declare const REORDER_RUNTIME_CODE = "((runtime) => {\n if (runtime.j) return;\n let onNextSibling,\n placeholder,\n nextSibling,\n placeholders = runtime.p = {},\n replace = (id, container) => runtime.l[id].replaceWith(...container.childNodes);\n runtime.j = {};\n runtime.x = (op, id, node, placeholderRoot, placeholderCb) => {\n if (node == nextSibling) {\n onNextSibling();\n }\n\n if (op == \"#\") {\n (placeholders[id] = placeholder).i++;\n } else if (node.tagName == \"T\" && (id = node.getAttribute(runtime.i))) {\n nextSibling = node.nextSibling;\n onNextSibling = () => {\n node.remove();\n placeholderRoot || replace(id, node);\n placeholder.c();\n };\n placeholder =\n placeholders[id] ||\n (placeholderRoot = placeholders[id] =\n {\n // The writer streams a reorder only after its markers.\n i: 1,\n r: id,\n // Resume may still walk markers inside the dropped placeholder, so\n // park it in any detached parent (a bare <t> clone is the cheapest).\n c(start = runtime.l[\"^\" + id], removed = node.cloneNode()) {\n if (--placeholderRoot.i) return 1;\n for (\n ;\n removed.prepend(\n (nextSibling = runtime.l[id].previousSibling || start),\n ),\n start != nextSibling;\n\n );\n replace(id, node);\n },\n });\n // Opens the chunk's visits for resume to parent to the root's branch; the\n // walk that this chunk's own script triggers closes it.\n runtime.v.push({ data: runtime.i + \"*\" + placeholder.r });\n // repurpose \"op\" for callbacks ...carefully\n if ((op = runtime.j[id])) {\n placeholderCb = placeholder.c;\n placeholder.c = () => placeholderCb() || op(runtime.r);\n }\n }\n };\n})";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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) =>
|
|
3
|
+
export type Locals = (scope: (scopeId: number) => PartialScope) => PartialScope[];
|
|
4
4
|
export type ScopeFlush = [scopeId: number, scope: object, props: object];
|
|
5
5
|
export interface SerializeChannel {
|
|
6
6
|
readyId?: string;
|
package/dist/html/writer.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ 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 _script(scopeId: number, registryId: string,
|
|
41
|
+
export declare function _script(scopeId: number, registryId: string, markerGuard?: number): void;
|
|
42
42
|
export declare function _trailers(html: string): void;
|
|
43
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;
|
|
@@ -51,39 +51,32 @@ export declare function _el_resume(scopeId: number, accessor: Accessor, shouldRe
|
|
|
51
51
|
export declare function _text_resume(scopeId: number, accessor: Accessor, val: unknown, shouldResume?: number): string;
|
|
52
52
|
export declare function _html_resume(scopeId: number, accessor: Accessor, val: unknown, shouldResume?: number): string;
|
|
53
53
|
export declare function _resume_branch(scopeId: number): void;
|
|
54
|
-
export declare function _attr_content(nodeAccessor: Accessor, scopeId: number, content: unknown,
|
|
54
|
+
export declare function _attr_content(nodeAccessor: Accessor, scopeId: number, content: unknown, markerGuard?: number): void;
|
|
55
55
|
export declare function _var(parentScopeId: number, scopeOffsetAccessor: Accessor, childScopeId: number, registryId: string, nodeAccessor?: Accessor): void;
|
|
56
|
-
export declare function _show_start(display: unknown,
|
|
57
|
-
export declare function _show_end(scopeId: number, accessor: Accessor, display: unknown,
|
|
58
|
-
export declare function _for_of(list: Falsy | Iterable<unknown>, cb: (item: unknown, index: number) => void, by: Falsy | ((item: unknown, index: number) => unknown), scopeId: number, accessor: Accessor,
|
|
59
|
-
export declare function _for_in(obj: Falsy | {}, cb: (key: string, value: unknown) => void, by: Falsy | ((key: string, v: unknown) => unknown), scopeId: number, accessor: Accessor,
|
|
60
|
-
export declare function _for_to(to: number, from: number | Falsy, step: number | Falsy, cb: (index: number) => void, by: Falsy | ((v: number) => unknown), scopeId: number, accessor: Accessor,
|
|
61
|
-
export declare function _for_until(to: number, from: number | Falsy, step: number | Falsy, cb: (index: number) => void, by: Falsy | ((v: number) => unknown), scopeId: number, accessor: Accessor,
|
|
62
|
-
export declare function _if(cb: () => void | number, scopeId: number, accessor: Accessor,
|
|
56
|
+
export declare function _show_start(display: unknown, markerGuard?: number, branchExprGuard?: number, parentEndTag?: string | 0): void;
|
|
57
|
+
export declare function _show_end(scopeId: number, accessor: Accessor, display: unknown, markerGuard?: number, branchExprGuard?: number, parentEndTag?: string | 0, singleNode?: 1 | 0): void;
|
|
58
|
+
export declare function _for_of(list: Falsy | Iterable<unknown>, cb: (item: unknown, index: number) => void, by: Falsy | ((item: unknown, index: number) => unknown), scopeId: number, accessor: Accessor, branchGuard?: number, markerGuard?: number, branchExprGuard?: number, parentEndTag?: string | 0, singleNode?: 1): void;
|
|
59
|
+
export declare function _for_in(obj: Falsy | {}, cb: (key: string, value: unknown) => void, by: Falsy | ((key: string, v: unknown) => unknown), scopeId: number, accessor: Accessor, branchGuard?: number, markerGuard?: number, branchExprGuard?: number, parentEndTag?: string | 0, singleNode?: 1): void;
|
|
60
|
+
export declare function _for_to(to: number, from: number | Falsy, step: number | Falsy, cb: (index: number) => void, by: Falsy | ((v: number) => unknown), scopeId: number, accessor: Accessor, branchGuard?: number, markerGuard?: number, branchExprGuard?: number, parentEndTag?: string | 0, singleNode?: 1): void;
|
|
61
|
+
export declare function _for_until(to: number, from: number | Falsy, step: number | Falsy, cb: (index: number) => void, by: Falsy | ((v: number) => unknown), scopeId: number, accessor: Accessor, branchGuard?: number, markerGuard?: number, branchExprGuard?: number, parentEndTag?: string | 0, singleNode?: 1): void;
|
|
62
|
+
export declare function _if(cb: () => void | number, scopeId: number, accessor: Accessor, branchGuard?: number, markerGuard?: number, branchExprGuard?: number, parentEndTag?: string | 0, singleNode?: 1): void;
|
|
63
63
|
export declare function deferBranchStart(chunk: Chunk): string;
|
|
64
64
|
export declare function applyBranchStart(chunk: Chunk, beforeBranch: string, rendered: boolean): void;
|
|
65
65
|
declare let writeScope: (scopeId: number, partialScope: PartialScope) => ScopeInternals;
|
|
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, resumeId?: string,
|
|
70
|
-
export type
|
|
69
|
+
export declare function _subscribe(subscribers: Set<ScopeInternals> | undefined, scope: ScopeInternals, resumeId?: string, markerGuard?: number): ScopeInternals;
|
|
70
|
+
export type GroupMask = undefined | number | Partial<Record<string, number>>;
|
|
71
71
|
export declare const CLIENT_ALL = 715827883;
|
|
72
|
-
export declare function maskGroup(mask:
|
|
73
|
-
export declare function
|
|
74
|
-
export declare function _scope_reason():
|
|
75
|
-
export declare function
|
|
76
|
-
export declare function
|
|
72
|
+
export declare function maskGroup(mask: GroupMask, group: number): number;
|
|
73
|
+
export declare function _set_scope_reason(reason: GroupMask): void;
|
|
74
|
+
export declare function _scope_reason(): GroupMask;
|
|
75
|
+
export declare function _write_if(condition: GroupMask, key: number): 1 | undefined;
|
|
76
|
+
export declare function _write_guard(condition: GroupMask, key: number): 0 | 1;
|
|
77
77
|
export declare function writeWaitReady(readyId: string, renderer: ServerRenderer, input: unknown): void;
|
|
78
|
-
export declare function _await<T>(scopeId: number, accessor: Accessor, promise: Promise<T> | T, content: (value: T) => void,
|
|
79
|
-
export declare function _try(scopeId: number, accessor: Accessor, content: () => void,
|
|
80
|
-
placeholder?: {
|
|
81
|
-
content?(): void;
|
|
82
|
-
};
|
|
83
|
-
catch?: {
|
|
84
|
-
content?(err: unknown): void;
|
|
85
|
-
};
|
|
86
|
-
}): void;
|
|
78
|
+
export declare function _await<T>(scopeId: number, accessor: Accessor, promise: Promise<T> | T, content: (value: T) => void, markerGuard?: number): void;
|
|
79
|
+
export declare function _try(scopeId: number, accessor: Accessor, content: () => void, placeholderContent?: ServerRenderer, catchContent?: ServerRenderer, placeholderId?: string, catchId?: string): void;
|
|
87
80
|
declare const NOOP: () => void;
|
|
88
81
|
type Mark = Mark.Value;
|
|
89
82
|
export declare class State implements SerializeState {
|
|
@@ -108,7 +101,7 @@ export declare class State implements SerializeState {
|
|
|
108
101
|
flushScopes: boolean;
|
|
109
102
|
writeScopes: Record<number, PartialScope>;
|
|
110
103
|
readyIds: Set<string> | null;
|
|
111
|
-
|
|
104
|
+
scopeReason: GroupMask;
|
|
112
105
|
$global: $Global & {
|
|
113
106
|
renderId: string;
|
|
114
107
|
runtimeId: string;
|
|
@@ -130,13 +123,19 @@ export declare class State implements SerializeState {
|
|
|
130
123
|
}
|
|
131
124
|
type FlushStatus = FlushStatus.Value;
|
|
132
125
|
export { FlushStatus };
|
|
133
|
-
export declare class Boundary
|
|
126
|
+
export declare class Boundary {
|
|
134
127
|
onNext: typeof NOOP;
|
|
135
128
|
count: number;
|
|
136
129
|
resumeWrites: number;
|
|
137
130
|
state: State;
|
|
138
131
|
parent?: Boundary;
|
|
132
|
+
aborted: boolean;
|
|
133
|
+
reason: unknown;
|
|
134
|
+
pendingReorders?: Set<Chunk>;
|
|
135
|
+
children?: Boundary[];
|
|
139
136
|
constructor(state: State, signal?: AbortSignal, parent?: Boundary);
|
|
137
|
+
abort(reason: unknown): void;
|
|
138
|
+
handleEvent(event: Event): void;
|
|
140
139
|
flush(): 0 | 1 | 2;
|
|
141
140
|
startAsync(): void;
|
|
142
141
|
endAsync(): void;
|
|
@@ -148,9 +147,13 @@ export declare class Chunk {
|
|
|
148
147
|
lastEffect: string;
|
|
149
148
|
async: boolean;
|
|
150
149
|
consumed: boolean;
|
|
151
|
-
needsWalk: boolean;
|
|
152
150
|
reorderId: string | null;
|
|
153
151
|
deferredReady: Opt<Chunk>;
|
|
152
|
+
deferredReorder: Chunk | null;
|
|
153
|
+
catchRange: {
|
|
154
|
+
id: string;
|
|
155
|
+
end: Chunk;
|
|
156
|
+
} | null;
|
|
154
157
|
placeholder: {
|
|
155
158
|
body: Chunk;
|
|
156
159
|
render: () => void;
|
|
@@ -170,13 +173,16 @@ export declare class Chunk {
|
|
|
170
173
|
append(chunk: Chunk): void;
|
|
171
174
|
takeDeferredReady(): Opt<Chunk>;
|
|
172
175
|
deferOwnReady(): void;
|
|
173
|
-
|
|
174
|
-
|
|
176
|
+
renderPlaceholders(boundary: Boundary): void;
|
|
177
|
+
renderPlaceholder(state: State): boolean;
|
|
178
|
+
markCatchRange(): void;
|
|
179
|
+
queueDeferredReorder(): void;
|
|
180
|
+
consume(boundary: Boundary): Chunk;
|
|
175
181
|
render(content: () => void): Chunk;
|
|
176
182
|
render<T>(content: (val: T) => void, val: T): Chunk;
|
|
177
|
-
flushReadyScripts(reservations?: string[], holdEffects?: boolean): string;
|
|
178
|
-
flushScript(): this;
|
|
179
|
-
flushHTML(): string;
|
|
183
|
+
flushReadyScripts(boundary: Boundary, reservations?: string[], holdEffects?: boolean): string;
|
|
184
|
+
flushScript(boundary: Boundary): this;
|
|
185
|
+
flushHTML(boundary: Boundary): string;
|
|
180
186
|
}
|
|
181
187
|
type QueueCallback = (ticked: true) => void;
|
|
182
188
|
export declare function queueTick(cb: QueueCallback): void;
|
package/dist/html.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { attrTag, attrTags } from "./common/attr-tag";
|
|
2
2
|
export { _assert_hoist, _el_read_error, _hoist_read_error, } from "./common/errors";
|
|
3
3
|
export { _flush_head, withLoadAssets, withPageAssets } from "./html/assets";
|
|
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, _style_html, _textarea_value, } from "./html/attrs";
|
|
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";
|
|
6
6
|
export { _escape, _escape_comment, _escape_script, _escape_style, _escape_style_value, _to_text, _unescaped, } from "./html/content";
|
|
7
7
|
export { _content, _content_resume, _dynamic_tag } from "./html/dynamic-tag";
|
|
8
8
|
export { forIn, forOf, forTo, forUntil } from "./html/for";
|
|
9
9
|
export { _template } from "./html/template";
|
|
10
|
-
export { _attr_content, _await, _el, _el_resume, _existing_scope, _for_in, _for_of, _for_to, _for_until, _hoist, _html, _id, _if, _peek_scope_id, _resume, _resume_branch, _resume_locals, _scope, _scope_id, _scope_reason, _html_resume, _scope_with_id, _script,
|
|
10
|
+
export { _attr_content, _await, _el, _el_resume, _existing_scope, _for_in, _for_of, _for_to, _for_until, _hoist, _html, _id, _if, _peek_scope_id, _resume, _resume_branch, _resume_locals, _scope, _scope_id, _scope_reason, _html_resume, _scope_with_id, _script, _write_guard, _write_if, _set_scope_reason, _show_end, _show_start, _text_resume, _subscribe, _trailers, _try, _var, $global, } from "./html/writer";
|