marko 6.4.10 → 6.4.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/accessor.d.ts +0 -3
- package/dist/common/accessor.debug.d.ts +0 -3
- package/dist/common/attr-tag.d.ts +1 -0
- package/dist/common/errors.d.ts +2 -0
- package/dist/common/helpers.d.ts +3 -1
- package/dist/common/types.d.ts +4 -3
- package/dist/debug/dom/catch.feat.js +1 -1
- package/dist/debug/dom/catch.feat.mjs +1 -1
- package/dist/debug/dom/compat.feat.js +143 -0
- package/dist/debug/dom/compat.feat.mjs +141 -0
- package/dist/debug/dom/controllable-input.feat.js +1 -1
- package/dist/debug/dom/controllable-input.feat.mjs +1 -1
- package/dist/debug/dom/controllable-open.feat.js +1 -1
- package/dist/debug/dom/controllable-open.feat.mjs +1 -1
- package/dist/debug/dom/controllable-select.feat.js +1 -1
- package/dist/debug/dom/controllable-select.feat.mjs +1 -1
- package/dist/debug/dom/controllable-textarea.feat.js +1 -1
- package/dist/debug/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/debug/dom/controllable.feat.js +1 -1
- package/dist/debug/dom/controllable.feat.mjs +1 -1
- package/dist/debug/dom/dynamic-tag-script.feat.js +1 -1
- package/dist/debug/dom/dynamic-tag-script.feat.mjs +1 -1
- package/dist/debug/dom/dynamic-tag-var.feat.js +1 -1
- package/dist/debug/dom/dynamic-tag-var.feat.mjs +1 -1
- package/dist/debug/dom/lazy.feat.js +1 -1
- package/dist/debug/dom/lazy.feat.mjs +1 -1
- package/dist/debug/dom/placeholder.feat.js +1 -1
- package/dist/debug/dom/placeholder.feat.mjs +1 -1
- package/dist/debug/{dom-DNB5yq3U.js → dom-CtXOr4Nm.js} +257 -230
- package/dist/debug/{dom-C1V5vpFs.mjs → dom-DaHYZpf2.mjs} +238 -229
- package/dist/debug/dom.js +8 -134
- package/dist/debug/dom.mjs +5 -126
- package/dist/debug/html/compat.feat.js +222 -0
- package/dist/debug/html/compat.feat.mjs +220 -0
- package/dist/debug/html-DMo6pc_h.mjs +3931 -0
- package/dist/debug/html-DfZjMkhx.js +4513 -0
- package/dist/debug/html.js +83 -4239
- package/dist/debug/html.mjs +1 -4152
- package/dist/dom/abort-signal.d.ts +1 -1
- package/dist/dom/catch.feat.js +3 -3
- package/dist/dom/catch.feat.mjs +1 -1
- package/dist/dom/{compat.d.ts → compat.feat.d.ts} +18 -9
- package/dist/dom/compat.feat.js +101 -0
- package/dist/dom/compat.feat.mjs +100 -0
- package/dist/dom/control-flow.d.ts +4 -5
- package/dist/dom/controllable-input.feat.js +2 -2
- package/dist/dom/controllable-input.feat.mjs +1 -1
- package/dist/dom/controllable-open.feat.js +2 -2
- package/dist/dom/controllable-open.feat.mjs +1 -1
- package/dist/dom/controllable-select.feat.js +2 -2
- package/dist/dom/controllable-select.feat.mjs +1 -1
- package/dist/dom/controllable-textarea.feat.js +2 -2
- package/dist/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/dom/controllable.feat.js +2 -2
- package/dist/dom/controllable.feat.mjs +1 -1
- package/dist/dom/dom.d.ts +2 -1
- package/dist/dom/dynamic-tag-script.feat.js +2 -2
- package/dist/dom/dynamic-tag-script.feat.mjs +1 -1
- package/dist/dom/dynamic-tag-var.feat.js +1 -1
- package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
- package/dist/dom/lazy.feat.js +1 -1
- package/dist/dom/lazy.feat.mjs +1 -1
- package/dist/dom/load.d.ts +3 -4
- package/dist/dom/placeholder.feat.js +3 -3
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/dom/queue.d.ts +1 -2
- package/dist/dom/resume.d.ts +3 -1
- package/dist/dom/signals.d.ts +5 -7
- package/dist/{dom-C2-Flitp.js → dom-BB-Te-3z.js} +222 -239
- package/dist/{dom-DsHYWMCR.mjs → dom-BO-0hzLZ.mjs} +124 -146
- package/dist/dom.d.ts +1 -2
- package/dist/dom.js +17 -95
- package/dist/dom.mjs +6 -79
- package/dist/html/assets.d.ts +3 -4
- package/dist/html/{compat.d.ts → compat.feat.d.ts} +5 -4
- package/dist/html/compat.feat.js +165 -0
- package/dist/html/compat.feat.mjs +164 -0
- package/dist/html/dynamic-tag.d.ts +1 -2
- package/dist/html/for.d.ts +0 -1
- package/dist/html/writer.d.ts +4 -3
- package/dist/html-DMDc0zKs.mjs +2404 -0
- package/dist/html-DrHsybFm.js +2880 -0
- package/dist/html.d.ts +1 -2
- package/dist/html.js +2 -2578
- package/dist/html.mjs +3 -2573
- package/dist/translator/index.d.ts +0 -1
- package/dist/translator/index.js +4889 -4733
- package/dist/translator/interop/out-global.d.ts +5 -0
- package/dist/translator/util/assert.d.ts +6 -0
- package/dist/translator/util/branch-tag.d.ts +1 -1
- package/dist/translator/util/entry-builder.d.ts +1 -1
- package/dist/translator/util/finalize-references.d.ts +2 -1
- package/dist/translator/util/for-selector.d.ts +1 -1
- package/dist/translator/util/known-tag.d.ts +10 -1
- package/dist/translator/util/optional.d.ts +0 -1
- package/dist/translator/util/reasons.d.ts +0 -1
- package/dist/translator/util/references.d.ts +12 -5
- package/dist/translator/util/runtime.d.ts +1 -0
- package/dist/translator/util/sections.d.ts +11 -2
- package/dist/translator/util/signals.d.ts +2 -1
- package/dist/translator/util/style-interpolation.d.ts +1 -1
- package/dist/translator/util/tag-facts.d.ts +2 -0
- package/dist/translator/util/tag-name-type.d.ts +1 -0
- package/dist/translator/util/translate-attrs.d.ts +1 -4
- package/dist/translator/util/visitors.d.ts +1 -1
- package/dist/translator/util/write-guard.d.ts +2 -0
- package/dist/translator/visitors/program/index.d.ts +2 -6
- package/dist/translator/visitors/referenced-identifier.d.ts +3 -1
- package/index.d.ts +2 -7
- package/package.json +4 -4
- package/dist/common/constants/keyed-scopes-prop.d.ts +0 -4
- package/dist/common/constants/keyed-scopes-prop.debug.d.ts +0 -4
package/dist/debug/dom.js
CHANGED
|
@@ -1,123 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_control_flow = require("./dom-
|
|
4
|
-
// src/common/attr-tag.ts
|
|
5
|
-
const empty = [];
|
|
6
|
-
const rest = Symbol("Attribute Tag");
|
|
7
|
-
function attrTag(attrs) {
|
|
8
|
-
attrs[Symbol.iterator] = attrTagIterator;
|
|
9
|
-
attrs[rest] = empty;
|
|
10
|
-
return attrs;
|
|
11
|
-
}
|
|
12
|
-
function attrTags(first, attrs) {
|
|
13
|
-
if (first) {
|
|
14
|
-
if (first[rest] === empty) first[rest] = [attrs];
|
|
15
|
-
else first[rest].push(attrs);
|
|
16
|
-
return first;
|
|
17
|
-
}
|
|
18
|
-
return attrTag(attrs);
|
|
19
|
-
}
|
|
20
|
-
function* attrTagIterator() {
|
|
21
|
-
yield this;
|
|
22
|
-
yield* this[rest];
|
|
23
|
-
}
|
|
24
|
-
// src/common/compat-meta.ts
|
|
25
|
-
const SET_SCOPE_REGISTER_ID = "$compat_setScope";
|
|
26
|
-
const RENDER_BODY_ID = "$compat_renderBody";
|
|
27
|
-
// src/dom/compat.ts
|
|
28
|
-
const classIdToBranch = /* @__PURE__ */ new Map();
|
|
29
|
-
let classEventResolver;
|
|
30
|
-
const scopesByRender = /* @__PURE__ */ new WeakMap();
|
|
31
|
-
const getRenderScopes = ($global) => {
|
|
32
|
-
require_control_flow.init($global.runtimeId);
|
|
33
|
-
const render = self[$global.runtimeId]?.[$global.renderId];
|
|
34
|
-
let scopes = render && scopesByRender.get(render);
|
|
35
|
-
if (render && !scopes) scopesByRender.set(render, scopes = {});
|
|
36
|
-
return scopes;
|
|
37
|
-
};
|
|
38
|
-
const compat = {
|
|
39
|
-
patchDynamicTag: require_control_flow.patchDynamicTag,
|
|
40
|
-
queueEffect: require_control_flow.queueEffect,
|
|
41
|
-
init(warp10Noop) {
|
|
42
|
-
require_control_flow._resumed[SET_SCOPE_REGISTER_ID] = (scope) => {
|
|
43
|
-
getRenderScopes(scope[require_control_flow.Global])[scope["#Id"]] = scope;
|
|
44
|
-
if (scope.m5c) classIdToBranch.set(scope.m5c, scope);
|
|
45
|
-
if (classEventResolver) for (const key in scope) {
|
|
46
|
-
const resolved = classEventResolver(scope[key], scope);
|
|
47
|
-
if (resolved !== scope[key]) scope[key] = resolved;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
require_control_flow._resumed[RENDER_BODY_ID] = warp10Noop;
|
|
51
|
-
},
|
|
52
|
-
setClassEventResolver(fn) {
|
|
53
|
-
classEventResolver = fn;
|
|
54
|
-
},
|
|
55
|
-
resumeClassFunction(id, build) {
|
|
56
|
-
require_control_flow._resumed[id] = build;
|
|
57
|
-
},
|
|
58
|
-
getScope($global, scopeId) {
|
|
59
|
-
return getRenderScopes($global)?.[scopeId];
|
|
60
|
-
},
|
|
61
|
-
setRendererId(renderer, id) {
|
|
62
|
-
renderer["id"] = id;
|
|
63
|
-
},
|
|
64
|
-
isRenderer(renderer) {
|
|
65
|
-
return renderer[require_control_flow.Clone];
|
|
66
|
-
},
|
|
67
|
-
getStartNode(branch) {
|
|
68
|
-
return branch[require_control_flow.StartNode];
|
|
69
|
-
},
|
|
70
|
-
getEndNode(branch) {
|
|
71
|
-
return branch[require_control_flow.EndNode];
|
|
72
|
-
},
|
|
73
|
-
setScopeNodes(branch, startNode, endNode) {
|
|
74
|
-
branch[require_control_flow.StartNode] = startNode;
|
|
75
|
-
branch[require_control_flow.EndNode] = endNode;
|
|
76
|
-
},
|
|
77
|
-
runComponentEffects() {
|
|
78
|
-
if (this.effects) require_control_flow.runEffects(this.effects);
|
|
79
|
-
},
|
|
80
|
-
runComponentDestroy() {
|
|
81
|
-
if (this.scope) require_control_flow.destroyBranch(this.scope);
|
|
82
|
-
},
|
|
83
|
-
resolveRegistered(value, $global) {
|
|
84
|
-
if (Array.isArray(value) && typeof value[0] === "string") return require_control_flow.getRegisteredWithScope(getRenderScopes($global)?.[value[1]], value[0]);
|
|
85
|
-
return value;
|
|
86
|
-
},
|
|
87
|
-
createRenderer(params, clone) {
|
|
88
|
-
const renderer = require_control_flow._content("", 0, 0, 0, params)();
|
|
89
|
-
renderer[require_control_flow.Clone] = (branch) => {
|
|
90
|
-
const cloned = clone();
|
|
91
|
-
branch[require_control_flow.StartNode] = cloned.startNode;
|
|
92
|
-
branch[require_control_flow.EndNode] = cloned.endNode;
|
|
93
|
-
};
|
|
94
|
-
return renderer;
|
|
95
|
-
},
|
|
96
|
-
render(out, component, renderer, args) {
|
|
97
|
-
require_control_flow.init(out.global.runtimeId);
|
|
98
|
-
let branch = component.scope;
|
|
99
|
-
let created = 0;
|
|
100
|
-
if (!branch && (branch = classIdToBranch.get(component.id))) {
|
|
101
|
-
component.scope = branch;
|
|
102
|
-
classIdToBranch.delete(component.id);
|
|
103
|
-
}
|
|
104
|
-
if (args[0] && typeof args[0] === "object" && "renderBody" in args[0]) {
|
|
105
|
-
const input = args[0];
|
|
106
|
-
const normalizedInput = args[0] = {};
|
|
107
|
-
for (const key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
|
|
108
|
-
}
|
|
109
|
-
const renderBranch = (_) => {
|
|
110
|
-
if (!branch) {
|
|
111
|
-
created = 1;
|
|
112
|
-
branch = component.scope = require_control_flow.createAndSetupBranch(out.global, renderer, renderer[require_control_flow.Owner], document.body);
|
|
113
|
-
}
|
|
114
|
-
renderer[require_control_flow.LocalClosures]?.(branch);
|
|
115
|
-
renderer[require_control_flow.Params]?.(branch, renderer._ ? args[0] : args);
|
|
116
|
-
};
|
|
117
|
-
component.effects = require_control_flow.rendering ? renderBranch() : require_control_flow.prepareEffects(renderBranch);
|
|
118
|
-
if (created) return branch["#StartNode"].parentNode || branch["#StartNode"];
|
|
119
|
-
}
|
|
120
|
-
};
|
|
3
|
+
const require_control_flow = require("./dom-CtXOr4Nm.js");
|
|
121
4
|
// src/dom/template.ts
|
|
122
5
|
const _template = (id, template, walks, setup, inputSignal) => {
|
|
123
6
|
const renderer = require_control_flow._content(id, template, walks, setup, inputSignal)();
|
|
@@ -162,9 +45,7 @@ function mount(input = {}, reference, position) {
|
|
|
162
45
|
const args = this[require_control_flow.Params];
|
|
163
46
|
const effects = require_control_flow.prepareEffects((_) => {
|
|
164
47
|
branch = require_control_flow.createBranch($global, this, void 0, parentNode);
|
|
165
|
-
branch[require_control_flow.TagVariable] = (newValue) =>
|
|
166
|
-
curValue = newValue;
|
|
167
|
-
};
|
|
48
|
+
branch[require_control_flow.TagVariable] = (newValue) => curValue = newValue;
|
|
168
49
|
this[require_control_flow.Setup]?.(branch);
|
|
169
50
|
args?.(branch, input);
|
|
170
51
|
});
|
|
@@ -180,9 +61,7 @@ function mount(input = {}, reference, position) {
|
|
|
180
61
|
update(newInput = {}) {
|
|
181
62
|
if (args) {
|
|
182
63
|
if (newInput.$global) ({$global, ...newInput} = newInput);
|
|
183
|
-
require_control_flow.runEffects(require_control_flow.prepareEffects((_) =>
|
|
184
|
-
args(branch, newInput);
|
|
185
|
-
}));
|
|
64
|
+
require_control_flow.runEffects(require_control_flow.prepareEffects((_) => args(branch, newInput)));
|
|
186
65
|
}
|
|
187
66
|
},
|
|
188
67
|
destroy() {
|
|
@@ -233,7 +112,7 @@ function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
|
233
112
|
awaitCounter?.c();
|
|
234
113
|
};
|
|
235
114
|
let remaining;
|
|
236
|
-
if (remaining = values
|
|
115
|
+
if (remaining = values.size) {
|
|
237
116
|
awaitCounter ||= require_control_flow.startAwait(branch);
|
|
238
117
|
const fail = loadFailed(branch, awaitCounter);
|
|
239
118
|
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && require_control_flow.queueAsyncRender(branch, (branch) => {
|
|
@@ -346,12 +225,7 @@ exports._controllable_input = require_control_flow._controllable_input;
|
|
|
346
225
|
exports._controllable_open = require_control_flow._controllable_open;
|
|
347
226
|
exports._controllable_select = require_control_flow._controllable_select;
|
|
348
227
|
exports._controllable_textarea = require_control_flow._controllable_textarea;
|
|
349
|
-
|
|
350
|
-
enumerable: true,
|
|
351
|
-
get: function() {
|
|
352
|
-
return require_control_flow._dynamic_tag;
|
|
353
|
-
}
|
|
354
|
-
});
|
|
228
|
+
exports._dynamic_tag = require_control_flow._dynamic_tag;
|
|
355
229
|
exports._dynamic_tag_content = require_control_flow._dynamic_tag_content;
|
|
356
230
|
exports._dynamic_tag_var_resume = require_control_flow._dynamic_tag_var_resume;
|
|
357
231
|
exports._el = require_control_flow._el;
|
|
@@ -402,15 +276,15 @@ exports._try = require_control_flow._try;
|
|
|
402
276
|
exports._var = require_control_flow._var;
|
|
403
277
|
exports._var_change = require_control_flow._var_change;
|
|
404
278
|
exports._var_resume = require_control_flow._var_resume;
|
|
405
|
-
exports.attrTag = attrTag;
|
|
406
|
-
exports.attrTags = attrTags;
|
|
407
|
-
exports.compat = compat;
|
|
279
|
+
exports.attrTag = require_control_flow.attrTag;
|
|
280
|
+
exports.attrTags = require_control_flow.attrTags;
|
|
408
281
|
exports.forIn = require_control_flow.forIn;
|
|
409
282
|
exports.forOf = require_control_flow.forOf;
|
|
410
283
|
exports.forTo = require_control_flow.forTo;
|
|
411
284
|
exports.forUntil = require_control_flow.forUntil;
|
|
412
285
|
exports.init = require_control_flow.init;
|
|
413
286
|
exports.initEmbedded = require_control_flow.initEmbedded;
|
|
287
|
+
exports.onAbort = require_control_flow.onAbort;
|
|
414
288
|
exports.ready = require_control_flow.ready;
|
|
415
289
|
exports.readyFailed = require_control_flow.readyFailed;
|
|
416
290
|
exports.run = require_control_flow.run;
|
package/dist/debug/dom.mjs
CHANGED
|
@@ -1,121 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
// src/common/attr-tag.ts
|
|
3
|
-
const empty = [];
|
|
4
|
-
const rest = Symbol("Attribute Tag");
|
|
5
|
-
function attrTag(attrs) {
|
|
6
|
-
attrs[Symbol.iterator] = attrTagIterator;
|
|
7
|
-
attrs[rest] = empty;
|
|
8
|
-
return attrs;
|
|
9
|
-
}
|
|
10
|
-
function attrTags(first, attrs) {
|
|
11
|
-
if (first) {
|
|
12
|
-
if (first[rest] === empty) first[rest] = [attrs];
|
|
13
|
-
else first[rest].push(attrs);
|
|
14
|
-
return first;
|
|
15
|
-
}
|
|
16
|
-
return attrTag(attrs);
|
|
17
|
-
}
|
|
18
|
-
function* attrTagIterator() {
|
|
19
|
-
yield this;
|
|
20
|
-
yield* this[rest];
|
|
21
|
-
}
|
|
22
|
-
// src/common/compat-meta.ts
|
|
23
|
-
const SET_SCOPE_REGISTER_ID = "$compat_setScope";
|
|
24
|
-
const RENDER_BODY_ID = "$compat_renderBody";
|
|
25
|
-
// src/dom/compat.ts
|
|
26
|
-
const classIdToBranch = /* @__PURE__ */ new Map();
|
|
27
|
-
let classEventResolver;
|
|
28
|
-
const scopesByRender = /* @__PURE__ */ new WeakMap();
|
|
29
|
-
const getRenderScopes = ($global) => {
|
|
30
|
-
init($global.runtimeId);
|
|
31
|
-
const render = self[$global.runtimeId]?.[$global.renderId];
|
|
32
|
-
let scopes = render && scopesByRender.get(render);
|
|
33
|
-
if (render && !scopes) scopesByRender.set(render, scopes = {});
|
|
34
|
-
return scopes;
|
|
35
|
-
};
|
|
36
|
-
const compat = {
|
|
37
|
-
patchDynamicTag,
|
|
38
|
-
queueEffect,
|
|
39
|
-
init(warp10Noop) {
|
|
40
|
-
_resumed[SET_SCOPE_REGISTER_ID] = (scope) => {
|
|
41
|
-
getRenderScopes(scope[Global])[scope["#Id"]] = scope;
|
|
42
|
-
if (scope.m5c) classIdToBranch.set(scope.m5c, scope);
|
|
43
|
-
if (classEventResolver) for (const key in scope) {
|
|
44
|
-
const resolved = classEventResolver(scope[key], scope);
|
|
45
|
-
if (resolved !== scope[key]) scope[key] = resolved;
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
_resumed[RENDER_BODY_ID] = warp10Noop;
|
|
49
|
-
},
|
|
50
|
-
setClassEventResolver(fn) {
|
|
51
|
-
classEventResolver = fn;
|
|
52
|
-
},
|
|
53
|
-
resumeClassFunction(id, build) {
|
|
54
|
-
_resumed[id] = build;
|
|
55
|
-
},
|
|
56
|
-
getScope($global, scopeId) {
|
|
57
|
-
return getRenderScopes($global)?.[scopeId];
|
|
58
|
-
},
|
|
59
|
-
setRendererId(renderer, id) {
|
|
60
|
-
renderer["id"] = id;
|
|
61
|
-
},
|
|
62
|
-
isRenderer(renderer) {
|
|
63
|
-
return renderer[Clone];
|
|
64
|
-
},
|
|
65
|
-
getStartNode(branch) {
|
|
66
|
-
return branch[StartNode];
|
|
67
|
-
},
|
|
68
|
-
getEndNode(branch) {
|
|
69
|
-
return branch[EndNode];
|
|
70
|
-
},
|
|
71
|
-
setScopeNodes(branch, startNode, endNode) {
|
|
72
|
-
branch[StartNode] = startNode;
|
|
73
|
-
branch[EndNode] = endNode;
|
|
74
|
-
},
|
|
75
|
-
runComponentEffects() {
|
|
76
|
-
if (this.effects) runEffects(this.effects);
|
|
77
|
-
},
|
|
78
|
-
runComponentDestroy() {
|
|
79
|
-
if (this.scope) destroyBranch(this.scope);
|
|
80
|
-
},
|
|
81
|
-
resolveRegistered(value, $global) {
|
|
82
|
-
if (Array.isArray(value) && typeof value[0] === "string") return getRegisteredWithScope(getRenderScopes($global)?.[value[1]], value[0]);
|
|
83
|
-
return value;
|
|
84
|
-
},
|
|
85
|
-
createRenderer(params, clone) {
|
|
86
|
-
const renderer = _content("", 0, 0, 0, params)();
|
|
87
|
-
renderer[Clone] = (branch) => {
|
|
88
|
-
const cloned = clone();
|
|
89
|
-
branch[StartNode] = cloned.startNode;
|
|
90
|
-
branch[EndNode] = cloned.endNode;
|
|
91
|
-
};
|
|
92
|
-
return renderer;
|
|
93
|
-
},
|
|
94
|
-
render(out, component, renderer, args) {
|
|
95
|
-
init(out.global.runtimeId);
|
|
96
|
-
let branch = component.scope;
|
|
97
|
-
let created = 0;
|
|
98
|
-
if (!branch && (branch = classIdToBranch.get(component.id))) {
|
|
99
|
-
component.scope = branch;
|
|
100
|
-
classIdToBranch.delete(component.id);
|
|
101
|
-
}
|
|
102
|
-
if (args[0] && typeof args[0] === "object" && "renderBody" in args[0]) {
|
|
103
|
-
const input = args[0];
|
|
104
|
-
const normalizedInput = args[0] = {};
|
|
105
|
-
for (const key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
|
|
106
|
-
}
|
|
107
|
-
const renderBranch = (_) => {
|
|
108
|
-
if (!branch) {
|
|
109
|
-
created = 1;
|
|
110
|
-
branch = component.scope = createAndSetupBranch(out.global, renderer, renderer[Owner], document.body);
|
|
111
|
-
}
|
|
112
|
-
renderer[LocalClosures]?.(branch);
|
|
113
|
-
renderer[Params]?.(branch, renderer._ ? args[0] : args);
|
|
114
|
-
};
|
|
115
|
-
component.effects = rendering ? renderBranch() : prepareEffects(renderBranch);
|
|
116
|
-
if (created) return branch["#StartNode"].parentNode || branch["#StartNode"];
|
|
117
|
-
}
|
|
118
|
-
};
|
|
1
|
+
import { $ as _attrs, A as _attr_input_value_attribute_default, At as _const, B as _controllable_textarea, Bn as Load, Bt as _let_change, C as _attr_input_checked, Ct as init, D as _attr_input_checked_default, E as _attr_input_checkedValue_script, En as Lazy, Et as readyFailed, F as _attr_select_value_default, Ft as _hoist, G as _attr_class_item, Gt as _var, Ht as _return, I as _attr_select_value_script, It as _hoist_resume, J as _attr_content, Jn as attrTag, K as _attr_class_items, Kn as StartNode, Kt as _var_change, L as _controllable_input, Lt as _id, M as _attr_input_value_dynamic_default, Mt as _for_closure, N as _attr_input_value_script, Nt as _for_selector, O as _attr_input_checked_script, Ot as _closure, P as _attr_select_value, Pt as _global_read, Q as _attr_style_items, R as _controllable_open, Rt as _if_closure, S as _attr_details_or_dialog_open_script, Sn as _call, T as _attr_input_checkedValue_default, Tn as Clone, Tt as ready, U as _attr, Ut as _return_change, Vt as _or, W as _attr_class, Wt as _script, X as _attr_style, Xt as removeAndDestroyBranch, Y as _attr_nonce, Yn as attrTags, Yt as insertBranchBefore, Z as _attr_style_item, Zt as syncGen, _ as renderCatch, _n as forTo, _t as setupBranch, a as _for_in, at as _lifecycle, b as _attr_details_or_dialog_open, bn as _assert_hoist, bt as _resumed, c as _for_to, cn as queueAsyncRender, ct as _text, d as _for_until_unkeyed, dt as _content, en as _on, et as _attrs_content, f as _if, fn as run, ft as _content_closures, gn as forOf, gt as createBranch, hn as forIn, i as _dynamic_tag_content, it as _html, j as _attr_input_value_default, jn as Setup, jt as _el_read, k as _attr_input_value, kn as Params, kt as _closure_get, l as _for_to_unkeyed, lt as _text_content, m as _try, mn as runId, mt as _return_setup, n as _await_promise, nn as $signalReset, nt as _attrs_partial_content, o as _for_of, ot as _style_rule_item, p as _show, pn as runEffects, pt as _content_resume, q as _attr_class_names, qn as TagVariable, qt as _assert_init, r as _dynamic_tag, rn as onAbort, rt as _attrs_script, s as _for_of_unkeyed, sn as prepareEffects, st as _style_shell, t as _await_content, tn as $signal, tt as _attrs_partial, u as _for_until, un as queueRender, ut as _to_text, vn as forUntil, vt as _dynamic_tag_var_resume, w as _attr_input_checkedValue, wt as initEmbedded, x as _attr_details_or_dialog_open_default, xn as _hoist_read_error, xt as _var_resume, y as startAwait, yn as _assert_class_toggles, yt as _el, z as _controllable_select, zt as _let } from "./dom-DaHYZpf2.mjs";
|
|
119
2
|
// src/dom/template.ts
|
|
120
3
|
const _template = (id, template, walks, setup, inputSignal) => {
|
|
121
4
|
const renderer = _content(id, template, walks, setup, inputSignal)();
|
|
@@ -160,9 +43,7 @@ function mount(input = {}, reference, position) {
|
|
|
160
43
|
const args = this[Params];
|
|
161
44
|
const effects = prepareEffects((_) => {
|
|
162
45
|
branch = createBranch($global, this, void 0, parentNode);
|
|
163
|
-
branch[TagVariable] = (newValue) =>
|
|
164
|
-
curValue = newValue;
|
|
165
|
-
};
|
|
46
|
+
branch[TagVariable] = (newValue) => curValue = newValue;
|
|
166
47
|
this[Setup]?.(branch);
|
|
167
48
|
args?.(branch, input);
|
|
168
49
|
});
|
|
@@ -178,9 +59,7 @@ function mount(input = {}, reference, position) {
|
|
|
178
59
|
update(newInput = {}) {
|
|
179
60
|
if (args) {
|
|
180
61
|
if (newInput.$global) ({$global, ...newInput} = newInput);
|
|
181
|
-
runEffects(prepareEffects((_) =>
|
|
182
|
-
args(branch, newInput);
|
|
183
|
-
}));
|
|
62
|
+
runEffects(prepareEffects((_) => args(branch, newInput)));
|
|
184
63
|
}
|
|
185
64
|
},
|
|
186
65
|
destroy() {
|
|
@@ -231,7 +110,7 @@ function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
|
231
110
|
awaitCounter?.c();
|
|
232
111
|
};
|
|
233
112
|
let remaining;
|
|
234
|
-
if (remaining = values
|
|
113
|
+
if (remaining = values.size) {
|
|
235
114
|
awaitCounter ||= startAwait(branch);
|
|
236
115
|
const fail = loadFailed(branch, awaitCounter);
|
|
237
116
|
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && queueAsyncRender(branch, (branch) => {
|
|
@@ -288,4 +167,4 @@ function _load_race_trigger(...triggers) {
|
|
|
288
167
|
function getSelectorOrResolve(selector, resolve) {
|
|
289
168
|
return document.querySelector(selector) || (console.warn(`A lazy load trigger could not find an element matching "${selector}". The module was loaded immediately.`), resolve());
|
|
290
169
|
}
|
|
291
|
-
export { $signal, $signalReset, _assert_class_toggles, _assert_hoist, _assert_init, _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_class_names, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_checked_default, _attr_input_checked_script, _attr_input_value, _attr_input_value as _attr_textarea_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_input_value_script as _attr_textarea_value_script, _attr_nonce, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _await_content, _await_promise, _call, _closure, _closure_get, _const, _content, _content_closures, _content_resume, _controllable_input, _controllable_open, _controllable_select, _controllable_textarea, _dynamic_tag, _dynamic_tag_content, _dynamic_tag_var_resume, _el, _el_read, _for_closure, _for_in, _for_of, _for_of_unkeyed, _for_selector, _for_to, _for_to_unkeyed, _for_until, _for_until_unkeyed, _global_read, _hoist, _hoist_read_error, _hoist_resume, _html, _id, _if, _if_closure, _let, _let_change, _lifecycle, _load_event_trigger, _load_idle_trigger, _load_media_trigger, _load_race_trigger, _load_setup, _load_signal, _load_template, _load_visible_trigger, _on, _or, _resumed, _return, _return_change, _return_setup, _script, _show, _style_rule_item, _style_shell, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags,
|
|
170
|
+
export { $signal, $signalReset, _assert_class_toggles, _assert_hoist, _assert_init, _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_class_names, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_checked_default, _attr_input_checked_script, _attr_input_value, _attr_input_value as _attr_textarea_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_input_value_script as _attr_textarea_value_script, _attr_nonce, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _await_content, _await_promise, _call, _closure, _closure_get, _const, _content, _content_closures, _content_resume, _controllable_input, _controllable_open, _controllable_select, _controllable_textarea, _dynamic_tag, _dynamic_tag_content, _dynamic_tag_var_resume, _el, _el_read, _for_closure, _for_in, _for_of, _for_of_unkeyed, _for_selector, _for_to, _for_to_unkeyed, _for_until, _for_until_unkeyed, _global_read, _hoist, _hoist_read_error, _hoist_resume, _html, _id, _if, _if_closure, _let, _let_change, _lifecycle, _load_event_trigger, _load_idle_trigger, _load_media_trigger, _load_race_trigger, _load_setup, _load_signal, _load_template, _load_visible_trigger, _on, _or, _resumed, _return, _return_change, _return_setup, _script, _show, _style_rule_item, _style_shell, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags, forIn, forOf, forTo, forUntil, init, initEmbedded, onAbort, ready, readyFailed, run };
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const require_control_flow = require("../html-DfZjMkhx.js");
|
|
4
|
+
// src/common/compat-meta.ts
|
|
5
|
+
const SET_SCOPE_REGISTER_ID = "$compat_setScope";
|
|
6
|
+
const RENDER_BODY_ID = "$compat_renderBody";
|
|
7
|
+
// src/html/compat.feat.ts
|
|
8
|
+
const K_TAGS_API_STATE = Symbol();
|
|
9
|
+
const COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap();
|
|
10
|
+
const compat = {
|
|
11
|
+
$global: require_control_flow.$global,
|
|
12
|
+
writeLoadAsset: require_control_flow.writeLoadAsset,
|
|
13
|
+
fork(scopeId, promise, content) {
|
|
14
|
+
require_control_flow._await(scopeId, "#text/0", promise, (value) => {
|
|
15
|
+
const branchId = require_control_flow._peek_scope_id();
|
|
16
|
+
content(value);
|
|
17
|
+
if (require_control_flow._peek_scope_id() === branchId) require_control_flow._scope_id();
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
write: require_control_flow._html,
|
|
21
|
+
writeScript: require_control_flow.writeScript,
|
|
22
|
+
nextScopeId: require_control_flow._scope_id,
|
|
23
|
+
peekNextScopeId: require_control_flow._peek_scope_id,
|
|
24
|
+
isInResumedBranch: require_control_flow.isInResumedBranch,
|
|
25
|
+
withChunk: require_control_flow.withChunk,
|
|
26
|
+
getChunk: require_control_flow.getChunk,
|
|
27
|
+
ensureState($global) {
|
|
28
|
+
let state = $global[K_TAGS_API_STATE] ||= require_control_flow.getChunk()?.boundary.state;
|
|
29
|
+
if (!state) {
|
|
30
|
+
$global.runtimeId ||= "M";
|
|
31
|
+
$global.renderId ||= $global.componentIdPrefix || $global.widgetIdPrefix || "_";
|
|
32
|
+
$global[K_TAGS_API_STATE] = state = new require_control_flow.State($global);
|
|
33
|
+
}
|
|
34
|
+
return state;
|
|
35
|
+
},
|
|
36
|
+
isRenderer(value) {
|
|
37
|
+
return typeof value === "function" && "id" in value;
|
|
38
|
+
},
|
|
39
|
+
setRendererId(renderer, id) {
|
|
40
|
+
renderer["id"] = id;
|
|
41
|
+
},
|
|
42
|
+
onFlush(fn) {
|
|
43
|
+
const { flushHTML } = require_control_flow.Chunk.prototype;
|
|
44
|
+
require_control_flow.Chunk.prototype.flushHTML = function(boundary) {
|
|
45
|
+
const { state } = boundary;
|
|
46
|
+
const reorders = swapReorders(state, null);
|
|
47
|
+
fn(this);
|
|
48
|
+
swapReorders(state, reorders);
|
|
49
|
+
return flushHTML.call(this, boundary);
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
setClassAPIRenderer: require_control_flow.setClassAPIRenderer,
|
|
53
|
+
writeSetScopeForComponent(branchId, m5c, m5i) {
|
|
54
|
+
require_control_flow.writeScope(branchId, {
|
|
55
|
+
m5c,
|
|
56
|
+
m5i
|
|
57
|
+
});
|
|
58
|
+
require_control_flow._script(branchId, SET_SCOPE_REGISTER_ID);
|
|
59
|
+
},
|
|
60
|
+
toJSON() {
|
|
61
|
+
return function toJSON() {
|
|
62
|
+
let compatRegistered = COMPAT_REGISTRY.get(this);
|
|
63
|
+
if (!compatRegistered) {
|
|
64
|
+
const registered = require_control_flow.REGISTRY.get(this);
|
|
65
|
+
if (registered) {
|
|
66
|
+
const scopeId = registered.scope ? require_control_flow.getScopeId(registered.scope) : void 0;
|
|
67
|
+
if (scopeId !== void 0) require_control_flow._script(scopeId, SET_SCOPE_REGISTER_ID);
|
|
68
|
+
COMPAT_REGISTRY.set(this, compatRegistered = [registered.id, scopeId]);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return compatRegistered;
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
joinChunks(chunks) {
|
|
75
|
+
let joined;
|
|
76
|
+
for (const chunk of chunks) {
|
|
77
|
+
if (chunk.boundary.aborted) continue;
|
|
78
|
+
if (joined) joined.append(chunk);
|
|
79
|
+
else joined = chunk;
|
|
80
|
+
}
|
|
81
|
+
return joined;
|
|
82
|
+
},
|
|
83
|
+
appendChunks(chunks) {
|
|
84
|
+
const chunk = require_control_flow.$chunk;
|
|
85
|
+
for (const part of chunks) {
|
|
86
|
+
chunk.append(part);
|
|
87
|
+
if (part.effects) chunk.lastEffect = part.lastEffect;
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
deferReorders(reorders) {
|
|
91
|
+
const chunk = require_control_flow.$chunk;
|
|
92
|
+
for (let i = reorders.length; i--;) {
|
|
93
|
+
const carrier = chunk.fork(chunk.boundary, chunk.next);
|
|
94
|
+
carrier.deferredReorder = reorders[i];
|
|
95
|
+
chunk.next = carrier;
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
createChunk($global) {
|
|
99
|
+
const state = this.ensureState($global);
|
|
100
|
+
return new require_control_flow.Chunk(new require_control_flow.Boundary(state), null, null, state);
|
|
101
|
+
},
|
|
102
|
+
flushScript(chunk, reorders) {
|
|
103
|
+
const { boundary } = chunk;
|
|
104
|
+
const { state } = boundary;
|
|
105
|
+
let html = "";
|
|
106
|
+
let scripts = "";
|
|
107
|
+
if (reorders) for (const reorder of reorders) state.reorder(reorder);
|
|
108
|
+
if (boundary.flush() === 0) ({html, scripts} = chunk.flush(boundary));
|
|
109
|
+
if (boundary.aborted) throw boundary.reason;
|
|
110
|
+
if (boundary.count) throw /* @__PURE__ */ new Error("Cannot serialize promise across tags/class compat layer.");
|
|
111
|
+
return {
|
|
112
|
+
html,
|
|
113
|
+
scripts
|
|
114
|
+
};
|
|
115
|
+
},
|
|
116
|
+
render(renderer, willRerender, classAPIOut, component, input, componentScopes, registerChildScope, parentChunk) {
|
|
117
|
+
if (parentChunk?.boundary.aborted) return;
|
|
118
|
+
const state = this.ensureState(classAPIOut.global);
|
|
119
|
+
const boundary = new require_control_flow.Boundary(state, void 0, parentChunk?.boundary);
|
|
120
|
+
const context = require_control_flow.getChunk()?.context ?? null;
|
|
121
|
+
let head = new require_control_flow.Chunk(boundary, new require_control_flow.Chunk(boundary, null, context, state), context, state);
|
|
122
|
+
let normalizedInput = input;
|
|
123
|
+
if ("renderBody" in input) {
|
|
124
|
+
normalizedInput = {};
|
|
125
|
+
for (const key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
|
|
126
|
+
}
|
|
127
|
+
const componentScope = new require_control_flow.Chunk(boundary, null, context, state);
|
|
128
|
+
componentScope.render(() => {
|
|
129
|
+
if (this.hasPendingClassFunctions(classAPIOut.global)) drainClassFunctions(classAPIOut.global, (hostId) => {
|
|
130
|
+
const fnScopeId = require_control_flow._scope_id();
|
|
131
|
+
const scope = require_control_flow.writeScope(fnScopeId, {
|
|
132
|
+
m5c: component.id,
|
|
133
|
+
m5h: hostId
|
|
134
|
+
});
|
|
135
|
+
require_control_flow._script(fnScopeId, SET_SCOPE_REGISTER_ID);
|
|
136
|
+
return scope;
|
|
137
|
+
});
|
|
138
|
+
if (willRerender || registerChildScope) {
|
|
139
|
+
const scopeId = require_control_flow._peek_scope_id();
|
|
140
|
+
require_control_flow.writeScope(scopeId, { m5c: component.id });
|
|
141
|
+
require_control_flow._script(scopeId, SET_SCOPE_REGISTER_ID);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
head.render(() => {
|
|
145
|
+
require_control_flow._set_scope_reason(willRerender ? require_control_flow.ALL_GROUPS : 0);
|
|
146
|
+
try {
|
|
147
|
+
renderer(normalizedInput);
|
|
148
|
+
} finally {
|
|
149
|
+
require_control_flow._set_scope_reason(void 0);
|
|
150
|
+
}
|
|
151
|
+
const asyncOut = classAPIOut.beginAsync({
|
|
152
|
+
last: true,
|
|
153
|
+
timeout: -1
|
|
154
|
+
});
|
|
155
|
+
classAPIOut.onLast((next) => {
|
|
156
|
+
(boundary.onNext = () => {
|
|
157
|
+
if (boundary.aborted) {
|
|
158
|
+
boundary.onNext = require_control_flow.NOOP;
|
|
159
|
+
if (parentChunk?.boundary.aborted) {
|
|
160
|
+
asyncOut.end();
|
|
161
|
+
next();
|
|
162
|
+
} else asyncOut.error(boundary.reason);
|
|
163
|
+
} else if (!boundary.count) {
|
|
164
|
+
boundary.onNext = require_control_flow.NOOP;
|
|
165
|
+
const queued = swapReorders(state, null);
|
|
166
|
+
head = head.consume(boundary);
|
|
167
|
+
const reorders = swapReorders(state, queued);
|
|
168
|
+
if (reorders) asyncOut.writer.get("reorders").push(...reorders);
|
|
169
|
+
const heldEffects = head.takeHeldEffects();
|
|
170
|
+
if (heldEffects) {
|
|
171
|
+
head.effects = require_control_flow.joinHeldEffects(heldEffects, head.effects);
|
|
172
|
+
head.lastEffect = "";
|
|
173
|
+
}
|
|
174
|
+
asyncOut.write(head.html);
|
|
175
|
+
asyncOut.script(head.scripts);
|
|
176
|
+
head.html = head.scripts = "";
|
|
177
|
+
asyncOut.writer.get("chunks").push(head);
|
|
178
|
+
asyncOut.end();
|
|
179
|
+
componentScopes.push(componentScope);
|
|
180
|
+
next();
|
|
181
|
+
}
|
|
182
|
+
})();
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
},
|
|
186
|
+
register: require_control_flow.register,
|
|
187
|
+
registerRenderBody(fn) {
|
|
188
|
+
require_control_flow.register(RENDER_BODY_ID, fn);
|
|
189
|
+
},
|
|
190
|
+
registerClassFunctions(input) {
|
|
191
|
+
for (const key in input) {
|
|
192
|
+
const value = input[key];
|
|
193
|
+
if (typeof value === "function" && !require_control_flow.REGISTRY.has(value)) require_control_flow.register(RENDER_BODY_ID, value);
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
registerClassFunction($global, id, fn, hostId) {
|
|
197
|
+
let pending = pendingClassFunctions.get($global);
|
|
198
|
+
if (!pending) pendingClassFunctions.set($global, pending = []);
|
|
199
|
+
pending.push([
|
|
200
|
+
id,
|
|
201
|
+
fn,
|
|
202
|
+
hostId
|
|
203
|
+
]);
|
|
204
|
+
return fn;
|
|
205
|
+
},
|
|
206
|
+
hasPendingClassFunctions($global) {
|
|
207
|
+
return !!pendingClassFunctions.get($global)?.length;
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
const pendingClassFunctions = /* @__PURE__ */ new WeakMap();
|
|
211
|
+
function drainClassFunctions($global, writeScope) {
|
|
212
|
+
const pending = pendingClassFunctions.get($global);
|
|
213
|
+
const scopeByHost = {};
|
|
214
|
+
for (const [id, fn, hostId] of pending) require_control_flow.register(id, fn, scopeByHost[hostId] ||= writeScope(hostId));
|
|
215
|
+
pending.length = 0;
|
|
216
|
+
}
|
|
217
|
+
function swapReorders(state, reorders) {
|
|
218
|
+
const { writeReorders } = state;
|
|
219
|
+
state.writeReorders = reorders;
|
|
220
|
+
return writeReorders;
|
|
221
|
+
}
|
|
222
|
+
exports.compat = compat;
|