marko 6.4.9 → 6.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cheatsheet.md +1 -1
- package/dist/common/accessor.d.ts +0 -3
- package/dist/common/accessor.debug.d.ts +0 -3
- package/dist/common/helpers.d.ts +1 -1
- package/dist/common/types.d.ts +4 -3
- package/dist/debug/dom/catch.feat.js +2 -3
- package/dist/debug/dom/catch.feat.mjs +2 -3
- package/dist/debug/dom/controllable-input.feat.js +2 -3
- package/dist/debug/dom/controllable-input.feat.mjs +2 -3
- package/dist/debug/dom/controllable-open.feat.js +2 -3
- package/dist/debug/dom/controllable-open.feat.mjs +2 -3
- package/dist/debug/dom/controllable-select.feat.js +2 -3
- package/dist/debug/dom/controllable-select.feat.mjs +2 -3
- package/dist/debug/dom/controllable-textarea.feat.js +2 -3
- package/dist/debug/dom/controllable-textarea.feat.mjs +2 -3
- package/dist/debug/dom/controllable.feat.js +2 -3
- package/dist/debug/dom/controllable.feat.mjs +2 -3
- package/dist/debug/dom/dynamic-tag-script.feat.js +2 -3
- package/dist/debug/dom/dynamic-tag-script.feat.mjs +2 -3
- package/dist/debug/dom/dynamic-tag-var.feat.js +2 -3
- package/dist/debug/dom/dynamic-tag-var.feat.mjs +2 -3
- package/dist/debug/dom/lazy.feat.js +2 -3
- package/dist/debug/dom/lazy.feat.mjs +2 -3
- package/dist/debug/dom/placeholder.feat.js +2 -3
- package/dist/debug/dom/placeholder.feat.mjs +2 -3
- package/dist/debug/{dom-VKjkbuuo.mjs → dom-DjUZd-9y.mjs} +221 -261
- package/dist/debug/{dom-QkYva5Qx.js → dom-mQ5mPBTF.js} +226 -260
- package/dist/debug/dom.js +10 -18
- package/dist/debug/dom.mjs +10 -19
- package/dist/debug/html.js +87 -125
- package/dist/debug/html.mjs +87 -125
- package/dist/dom/abort-signal.d.ts +1 -1
- package/dist/dom/catch.feat.js +4 -5
- package/dist/dom/catch.feat.mjs +2 -3
- package/dist/dom/control-flow.d.ts +4 -4
- package/dist/dom/controllable-input.feat.js +1 -2
- package/dist/dom/controllable-input.feat.mjs +1 -2
- package/dist/dom/controllable-open.feat.js +2 -3
- package/dist/dom/controllable-open.feat.mjs +2 -3
- package/dist/dom/controllable-select.feat.js +2 -3
- package/dist/dom/controllable-select.feat.mjs +2 -3
- package/dist/dom/controllable-textarea.feat.js +2 -3
- package/dist/dom/controllable-textarea.feat.mjs +2 -3
- package/dist/dom/controllable.feat.js +1 -2
- package/dist/dom/controllable.feat.mjs +1 -2
- package/dist/dom/dynamic-tag-script.feat.js +3 -4
- package/dist/dom/dynamic-tag-script.feat.mjs +2 -3
- package/dist/dom/dynamic-tag-var.feat.js +3 -4
- package/dist/dom/dynamic-tag-var.feat.mjs +1 -2
- package/dist/dom/lazy.feat.js +2 -3
- package/dist/dom/lazy.feat.mjs +2 -3
- package/dist/dom/load.d.ts +3 -4
- package/dist/dom/placeholder.feat.js +2 -3
- package/dist/dom/placeholder.feat.mjs +2 -3
- package/dist/dom/queue.d.ts +1 -2
- package/dist/dom/signals.d.ts +5 -7
- package/dist/{dom-IujlfJ6b.js → dom-B8j2453O.js} +158 -190
- package/dist/{dom-DtKQb840.mjs → dom-HEWdZCCb.mjs} +134 -172
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +22 -30
- package/dist/dom.mjs +10 -19
- package/dist/html/assets.d.ts +3 -4
- package/dist/html/for.d.ts +0 -1
- package/dist/html/writer.d.ts +2 -2
- package/dist/html.d.ts +1 -1
- package/dist/html.js +99 -131
- package/dist/html.mjs +99 -132
- package/dist/translator/index.d.ts +0 -1
- package/dist/translator/index.js +4771 -4760
- package/dist/translator/interop/out-global.d.ts +5 -0
- package/dist/translator/util/assert.d.ts +13 -2
- 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/references.d.ts +11 -5
- package/dist/translator/util/runtime.d.ts +1 -0
- package/dist/translator/util/sections.d.ts +6 -1
- package/dist/translator/util/signals.d.ts +2 -1
- package/dist/translator/util/sources.d.ts +1 -1
- package/dist/translator/util/style-interpolation.d.ts +1 -1
- package/dist/translator/util/tag-name-type.d.ts +4 -0
- 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 +0 -4
- package/dist/translator/visitors/referenced-identifier.d.ts +3 -1
- package/package.json +6 -6
- package/tags/lifecycle.d.marko +2 -0
- package/dist/common/constants/keyed-scopes-prop.d.ts +0 -4
- package/dist/common/constants/keyed-scopes-prop.debug.d.ts +0 -4
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "\\3B " : "\\\\",
|
|
3
|
-
let str = "", sep = "", part;
|
|
4
|
-
if (val) {
|
|
5
|
-
if (typeof val != "object") str += val;
|
|
6
|
-
else if (Array.isArray(val)) for (let v of val) part = toDelimitedString(v, delimiter, stringify), part && (str += sep + part, sep = delimiter);
|
|
7
|
-
else for (let name in val) part = stringify(name, val[name]), part && (str += sep + part, sep = delimiter);
|
|
8
|
-
}
|
|
9
|
-
return str;
|
|
10
|
-
}, decodeAccessor = (num) => (num + (num < 26 ? 10 : num < 962 ? 334 : 11998)).toString(36), branchesEnabled, dynamicHtmlEnabled, rendering, runId = 2, pendingEffects = [], pendingRenders = [], queuePendingRender = (render) => {
|
|
2
|
+
let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "\\3B " : "\\\\", decodeAccessor = (num) => (num + (num < 26 ? 10 : num < 962 ? 334 : 11998)).toString(36), branchesEnabled, dynamicHtmlEnabled, rendering, runId = 2, pendingEffects = [], pendingRenders = [], queuePendingRender = (render) => {
|
|
11
3
|
let i = pendingRenders.push(render) - 1;
|
|
12
4
|
for (; i;) {
|
|
13
5
|
let parentIndex = i - 1 >> 1, parent = pendingRenders[parentIndex];
|
|
@@ -15,29 +7,11 @@ let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "
|
|
|
15
7
|
pendingRenders[i] = parent, i = parentIndex;
|
|
16
8
|
}
|
|
17
9
|
pendingRenders[i] = render;
|
|
18
|
-
}, runEffects = (
|
|
10
|
+
}, runEffects = (effects) => {
|
|
19
11
|
for (let i = 0; i < effects.length;) effects[i++](effects[i++]);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
}, catchEnabled, abortsEnabled, subscriptionsEnabled, delegate = (type, handler) => handler[1 + type] ||= (document.addEventListener(type, handler, !0), 1), parsers = {}, nextScopeId = 1e6, collectingScopes,
|
|
23
|
-
scope.H = 0, scope.D?.forEach(destroyNestedScopes), scope.B?.forEach(cleanupScope);
|
|
24
|
-
}, isScheduled, channel, _return = (scope, value) => scope.T ? scope.T(value) : scope.RV = value, _var_change = (scope, value) => scope.U?.(value), tagIdsByGlobal = /* @__PURE__ */ new WeakMap(), currentNode, walkInternal = function walkInternal(currentWalkIndex, walkCodes, scope) {
|
|
25
|
-
let value, currentMultiplier, storedMultiplier = 0, currentScopeIndex = 0;
|
|
26
|
-
for (; currentWalkIndex < walkCodes.length;) if (value = walkCodes.charCodeAt(currentWalkIndex++), currentMultiplier = storedMultiplier, storedMultiplier = 0, value === 32) scope[decodeAccessor(currentScopeIndex++)] = currentNode;
|
|
27
|
-
else if (value === 37 || value === 49) currentNode.replaceWith(currentNode = scope[decodeAccessor(currentScopeIndex++)] = new Text()), value === 49 && (scope[decodeAccessor(currentScopeIndex++)] = skipScope());
|
|
28
|
-
else if (value === 38) return currentWalkIndex;
|
|
29
|
-
else if (value === 47 || value === 48) currentWalkIndex = walkInternal(currentWalkIndex, walkCodes, scope[decodeAccessor(currentScopeIndex++)] = createScope(scope.$, scope.F)), value === 48 && (scope[decodeAccessor(currentScopeIndex++)] = skipScope());
|
|
30
|
-
else if (value < 92) for (value = 25 * currentMultiplier + value - 67; value--;) if (currentNode.firstChild) currentNode = currentNode.firstChild;
|
|
31
|
-
else {
|
|
32
|
-
for (; !currentNode.nextSibling && currentNode.parentNode;) currentNode = currentNode.parentNode;
|
|
33
|
-
walkNextSibling();
|
|
34
|
-
}
|
|
35
|
-
else if (value < 107) for (value = 10 * currentMultiplier + value - 97; value--;) walkNextSibling();
|
|
36
|
-
else if (value < 117) {
|
|
37
|
-
for (value = 10 * currentMultiplier + value - 107; value--;) currentNode = currentNode.parentNode || currentNode;
|
|
38
|
-
walkNextSibling();
|
|
39
|
-
} else storedMultiplier = currentMultiplier * 10 + value - 117;
|
|
40
|
-
}, walkNextSibling = (_) => currentNode = currentNode.nextSibling || currentNode, _resumed = {}, curRenders, embedRenders, readyIds, lazyEnabled, isResuming, cloneCache = {}, _html = /*@__PURE__*/ withDynamicHtml(function(scope, value, accessor) {
|
|
12
|
+
}, runRender = (render) => {
|
|
13
|
+
branchesEnabled && render.b.F?.H === 0 || render.c(render.b, render.d);
|
|
14
|
+
}, catchEnabled, abortsEnabled, subscriptionsEnabled, delegate = (type, handler) => handler[1 + type] ||= (document.addEventListener(type, handler, !0), 1), parsers = {}, nextScopeId = 1e6, collectingScopes, isScheduled, channel, _return = (scope, value) => scope.T ? scope.T(value) : scope.RV = value, _var_change = (scope, value) => scope.U?.(value), tagIdsByGlobal = /* @__PURE__ */ new WeakMap(), currentNode, walkNextSibling = (_) => currentNode = currentNode.nextSibling || currentNode, _resumed = {}, curRenders, embedRenders, readyIds, lazyEnabled, isResuming, _html = /*@__PURE__*/ withDynamicHtml(function(scope, value, accessor) {
|
|
41
15
|
let prevValue = scope["R" + accessor];
|
|
42
16
|
if (prevValue !== (scope["R" + accessor] = _to_text(value))) {
|
|
43
17
|
let firstChild = scope[accessor], parentNode = firstChild.parentNode, lastChild = scope["H" + accessor] || firstChild, newContent = parseHTML(scope["R" + accessor], parentNode.namespaceURI);
|
|
@@ -60,7 +34,7 @@ let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "
|
|
|
60
34
|
nodeAccessor = decodeAccessor(nodeAccessor), startNodeAccessor !== void 0 && (startNodeAccessor = decodeAccessor(startNodeAccessor));
|
|
61
35
|
let rangeAccessor = "A" + nodeAccessor;
|
|
62
36
|
return (scope, display) => {
|
|
63
|
-
let referenceNode = scope[nodeAccessor], onlyChild = referenceNode.nodeType
|
|
37
|
+
let referenceNode = scope[nodeAccessor], onlyChild = referenceNode.nodeType < 3, parentNode = onlyChild ? referenceNode : referenceNode.parentNode, range = scope[rangeAccessor];
|
|
64
38
|
range || (range = scope[rangeAccessor] = {}, range.S = onlyChild ? parentNode.insertBefore(new Text(), parentNode.firstChild) : startNodeAccessor ? scope[startNodeAccessor] : referenceNode.previousSibling);
|
|
65
39
|
let startNode = range.S;
|
|
66
40
|
range.L && startNode.tagName === "T" ? display && startNode.replaceWith(range.S = new Text(), ...startNode.childNodes) : display ? startNode.parentNode !== parentNode && parentNode.insertBefore(startNode.parentNode, onlyChild ? null : referenceNode) : startNode.parentNode === parentNode && (range.K = onlyChild ? parentNode.lastChild : referenceNode.previousSibling, detachBranch(range));
|
|
@@ -113,22 +87,19 @@ let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "
|
|
|
113
87
|
let oldLen = oldScopes.length, parentNode = referenceNode.nodeType > 1 ? referenceNode.parentNode || oldScopes[0]?.S.parentNode : referenceNode, oldScopesByKey, hasPotentialMoves, start = 0;
|
|
114
88
|
forEach(value, (key, args) => {
|
|
115
89
|
let i = newScopes.length, oldScope = oldScopes[i], branch = oldLen && (oldScopesByKey || key !== (oldScope?.M ?? i) ? (oldScopesByKey ||= oldScopes.reduce((map, scope, j) => j < i ? map : (scope.I = j, map.set(scope.M ?? j, scope)), /* @__PURE__ */ new Map())).get(key) : oldScope && (start++, oldScope));
|
|
116
|
-
branch ? (hasPotentialMoves =
|
|
90
|
+
branch ? (hasPotentialMoves = 1, oldScopesByKey?.delete(key), branch.M = key) : ((branch = createBranch(scope.$, renderer, scope, parentNode)).M = key, setupBranch(renderer, branch)), newScopes.push(branch), params?.(branch, args);
|
|
117
91
|
}), scope[scopesAccessor] = newScopes;
|
|
118
92
|
let newLen = newScopes.length, hasSiblings = referenceNode !== parentNode, afterReference = null, oldEnd = oldLen - 1, newEnd = newLen - 1;
|
|
119
93
|
if (hasSiblings && (oldLen ? (afterReference = oldScopes[oldEnd].K.nextSibling, newLen || parentNode.insertBefore(referenceNode, afterReference)) : newLen && (afterReference = referenceNode.nextSibling, referenceNode.remove())), !hasPotentialMoves) {
|
|
120
94
|
oldLen && (oldScopes.forEach(hasSiblings ? removeAndDestroyBranch : destroyBranch), hasSiblings || (parentNode.textContent = ""));
|
|
121
95
|
for (let newScope of newScopes) insertBranchBefore(newScope, parentNode, afterReference);
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
for (let i = start; i <= newEnd; i++) insertBranchBefore(newScopes[i], parentNode, afterReference);
|
|
129
|
-
return;
|
|
96
|
+
} else {
|
|
97
|
+
if (oldScopesByKey) oldScopesByKey.forEach(removeAndDestroyBranch);
|
|
98
|
+
else for (let i = newLen; i < oldLen; i++) removeAndDestroyBranch(oldScopes[i]);
|
|
99
|
+
for (; oldEnd >= start && newEnd >= start && oldScopes[oldEnd] === newScopes[newEnd];) oldEnd--, newEnd--;
|
|
100
|
+
if (oldEnd + 1 < oldLen && (afterReference = oldScopes[oldEnd + 1].S), start > oldEnd || start > newEnd) for (let i = start; i <= newEnd; i++) insertBranchBefore(newScopes[i], parentNode, afterReference);
|
|
101
|
+
else reorder(newScopes, start, newEnd, parentNode, afterReference);
|
|
130
102
|
}
|
|
131
|
-
reorder(newScopes, start, newEnd, parentNode, afterReference);
|
|
132
103
|
};
|
|
133
104
|
}), _for_of = /*@__PURE__*/ loop(([all, by], cb) => {
|
|
134
105
|
by ||= bySecondArg, typeof by == "string" ? forOf(all, (item, i) => cb(item[by], [item, i])) : forOf(all, (item, i) => cb(by(item, i), [item, i]));
|
|
@@ -139,7 +110,7 @@ let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "
|
|
|
139
110
|
}, reorderKeyed), _for_until = /*@__PURE__*/ loop(([until, from, step, by], cb) => {
|
|
140
111
|
by ||= byFirstArg, forUntil(until, from, step, (v) => cb(by(v), [v]));
|
|
141
112
|
}, reorderKeyed), _for_of_unkeyed = /*@__PURE__*/ loop(([all], cb) => forOf(all, (item, i) => cb(i, [item, i]))), _for_to_unkeyed = /*@__PURE__*/ loop(([to, from, step], cb) => forTo(to, from, step, (v) => cb(v, [v]))), _for_until_unkeyed = /*@__PURE__*/ loop(([until, from, step], cb) => forUntil(until, from, step, (v) => cb(v, [v])));
|
|
142
|
-
|
|
113
|
+
// src/common/helpers.ts
|
|
143
114
|
function _call(fn, v) {
|
|
144
115
|
return fn(v), v;
|
|
145
116
|
}
|
|
@@ -157,6 +128,15 @@ function escapeStyleValue(str) {
|
|
|
157
128
|
for (let c of result) c === "(" ? closers = ")" + closers : c === "[" ? closers = "]" + closers : c === closers[0] && (closers = closers.slice(1));
|
|
158
129
|
return result + closers;
|
|
159
130
|
}
|
|
131
|
+
function toDelimitedString(val, delimiter, stringify) {
|
|
132
|
+
let str = "", sep = "", part;
|
|
133
|
+
if (val) {
|
|
134
|
+
if (typeof val != "object") str += val;
|
|
135
|
+
else if (Array.isArray(val)) for (let v of val) part = toDelimitedString(v, delimiter, stringify), part && (str += sep + part, sep = delimiter);
|
|
136
|
+
else for (let name in val) part = stringify(name, val[name]), part && (str += sep + part, sep = delimiter);
|
|
137
|
+
}
|
|
138
|
+
return str;
|
|
139
|
+
}
|
|
160
140
|
function isEventHandler(name) {
|
|
161
141
|
return /^on[A-Z-]/.test(name);
|
|
162
142
|
}
|
|
@@ -182,13 +162,11 @@ function withBranches(runtime) {
|
|
|
182
162
|
function withDynamicHtml(runtime) {
|
|
183
163
|
return dynamicHtmlEnabled = 1, runtime;
|
|
184
164
|
}
|
|
185
|
-
|
|
186
|
-
//#region src/common/errors.ts
|
|
165
|
+
// src/common/errors.ts
|
|
187
166
|
function _assert_class_toggles(classes, toggles) {}
|
|
188
167
|
function _hoist_read_error() {}
|
|
189
168
|
function _assert_hoist(value) {}
|
|
190
|
-
|
|
191
|
-
//#region src/common/for.ts
|
|
169
|
+
// src/common/for.ts
|
|
192
170
|
function forIn(obj, cb) {
|
|
193
171
|
for (let key in obj) cb(key, obj[key]);
|
|
194
172
|
}
|
|
@@ -206,8 +184,7 @@ function forUntil(until, from, step, cb) {
|
|
|
206
184
|
let start = from || 0, delta = step || 1;
|
|
207
185
|
for (let steps = (until - start) / delta, i = 0; i < steps; i++) cb(start + i * delta);
|
|
208
186
|
}
|
|
209
|
-
|
|
210
|
-
//#region src/dom/queue.ts
|
|
187
|
+
// src/dom/queue.ts
|
|
211
188
|
function queueRender(scope, signal, signalKey, value, scopeKey = scope.L) {
|
|
212
189
|
let render;
|
|
213
190
|
if (signalKey >= 0 && (render = scope[signalKey])) {
|
|
@@ -290,8 +267,7 @@ function runRenders(renders = pendingRenders) {
|
|
|
290
267
|
runRender(render);
|
|
291
268
|
}
|
|
292
269
|
}
|
|
293
|
-
|
|
294
|
-
//#region src/dom/abort-signal.ts
|
|
270
|
+
// src/dom/abort-signal.ts
|
|
295
271
|
function $signalReset(scope, id) {
|
|
296
272
|
let ctrl = scope.A?.[id];
|
|
297
273
|
ctrl && (scope.A[id] = void 0, rendering ? queueEffect(ctrl, abort) : abort(ctrl));
|
|
@@ -300,7 +276,7 @@ function $signal(scope, id) {
|
|
|
300
276
|
return abortsEnabled = 1, trackCleanup(scope), ((scope.A ||= {})[id] ||= new AbortController()).signal;
|
|
301
277
|
}
|
|
302
278
|
/** Runs `abort` as a destroyed scope's `$signal` would fire, without creating one. */
|
|
303
|
-
function
|
|
279
|
+
function onAbort(scope, id, abort) {
|
|
304
280
|
abortsEnabled = 1, trackCleanup(scope), (scope.A ||= {})[id] = { abort };
|
|
305
281
|
}
|
|
306
282
|
/** Enrols `scope` with its branch so destroying the branch cleans it up. */
|
|
@@ -311,8 +287,7 @@ function trackCleanup(scope, subscribers) {
|
|
|
311
287
|
function abort(ctrl) {
|
|
312
288
|
ctrl.abort();
|
|
313
289
|
}
|
|
314
|
-
|
|
315
|
-
//#region src/common/opt.ts
|
|
290
|
+
// src/common/opt.ts
|
|
316
291
|
function toArray(opt) {
|
|
317
292
|
return opt ? Array.isArray(opt) ? opt : [opt] : [];
|
|
318
293
|
}
|
|
@@ -325,8 +300,7 @@ function forEach(opt, cb) {
|
|
|
325
300
|
function push(opt, item) {
|
|
326
301
|
return opt ? Array.isArray(opt) ? (opt.push(item), opt) : [opt, item] : item;
|
|
327
302
|
}
|
|
328
|
-
|
|
329
|
-
//#region src/dom/event.ts
|
|
303
|
+
// src/dom/event.ts
|
|
330
304
|
function _on(element, type, handler) {
|
|
331
305
|
delegate(type, handleDelegated), element[1 + type] = handler || null;
|
|
332
306
|
}
|
|
@@ -334,14 +308,12 @@ function handleDelegated(ev) {
|
|
|
334
308
|
let target = !rendering && ev.target;
|
|
335
309
|
for (; target;) target[1 + ev.type]?.(ev, target), target = ev.bubbles && !ev.cancelBubble && target.parentNode;
|
|
336
310
|
}
|
|
337
|
-
|
|
338
|
-
//#region src/dom/parse-html.ts
|
|
311
|
+
// src/dom/parse-html.ts
|
|
339
312
|
function parseHTML(html, ns) {
|
|
340
313
|
let parser = parsers[ns] ||= document.createElementNS(ns, "template");
|
|
341
314
|
return parser.innerHTML = html, parser.content || parser;
|
|
342
315
|
}
|
|
343
|
-
|
|
344
|
-
//#region src/dom/scope.ts
|
|
316
|
+
// src/dom/scope.ts
|
|
345
317
|
function createScope($global, closestBranch) {
|
|
346
318
|
let scope = {
|
|
347
319
|
L: nextScopeId++,
|
|
@@ -370,11 +342,14 @@ function skipScope() {
|
|
|
370
342
|
return nextScopeId++;
|
|
371
343
|
}
|
|
372
344
|
function destroyBranch(branch) {
|
|
373
|
-
branch.N?.D
|
|
345
|
+
branch.N?.D.delete(branch), destroyNestedScopes(branch);
|
|
374
346
|
}
|
|
375
347
|
function destroyScope(scope) {
|
|
376
348
|
scope.H && (destroyNestedScopes(scope), cleanupScope(scope));
|
|
377
349
|
}
|
|
350
|
+
function destroyNestedScopes(scope) {
|
|
351
|
+
scope.H = 0, scope.D?.forEach(destroyNestedScopes), scope.B?.forEach(cleanupScope);
|
|
352
|
+
}
|
|
378
353
|
function cleanupScope(scope) {
|
|
379
354
|
if (subscriptionsEnabled && scope.Z?.forEach(unsubscribe, scope), abortsEnabled) for (let id in scope.A) $signalReset(scope, id);
|
|
380
355
|
}
|
|
@@ -391,8 +366,7 @@ function detachBranch(branch) {
|
|
|
391
366
|
let fragment = new DocumentFragment();
|
|
392
367
|
fragment.namespaceURI = branch.S.parentNode.namespaceURI, insertChildNodes(fragment, null, branch.S, branch.K);
|
|
393
368
|
}
|
|
394
|
-
|
|
395
|
-
//#region src/dom/schedule.ts
|
|
369
|
+
// src/dom/schedule.ts
|
|
396
370
|
function schedule() {
|
|
397
371
|
isScheduled || (isScheduled = 1, queueMicrotask(flushAndWaitFrame));
|
|
398
372
|
}
|
|
@@ -404,8 +378,7 @@ function triggerMacroTask() {
|
|
|
404
378
|
isScheduled = 0, run();
|
|
405
379
|
}), channel.port2.postMessage(0);
|
|
406
380
|
}
|
|
407
|
-
|
|
408
|
-
//#region src/dom/signals.ts
|
|
381
|
+
// src/dom/signals.ts
|
|
409
382
|
function _let(id, fn) {
|
|
410
383
|
let valueAccessor = decodeAccessor(id);
|
|
411
384
|
return (scope, value) => (rendering ? scope.H === runId && (scope[valueAccessor] = value, fn?.(scope)) : (scope[valueAccessor] !== value || !(valueAccessor in scope)) && (scope[valueAccessor] = value, fn) && (schedule(), queueRender(scope, fn, id)), value);
|
|
@@ -416,37 +389,31 @@ function _let_change(id, fn) {
|
|
|
416
389
|
}
|
|
417
390
|
function _const(valueAccessor, fn) {
|
|
418
391
|
return valueAccessor = decodeAccessor(valueAccessor), ((scope, value) => {
|
|
419
|
-
|
|
392
|
+
scope[valueAccessor] === value && valueAccessor in scope || (scope[valueAccessor] = value, fn?.(scope));
|
|
420
393
|
});
|
|
421
394
|
}
|
|
422
|
-
function _or(id, fn, defaultPending = 1, scopeIdAccessor
|
|
423
|
-
return scopeIdAccessor
|
|
395
|
+
function _or(id, fn, defaultPending = 1, scopeIdAccessor) {
|
|
396
|
+
return scopeIdAccessor = scopeIdAccessor ? decodeAccessor(scopeIdAccessor) : "L", (scope) => {
|
|
424
397
|
scope.H === runId ? ~id in scope ? --scope[~id] || fn(scope) : scope[~id] = defaultPending : queueRender(scope, fn, id, 0, scope[scopeIdAccessor]);
|
|
425
398
|
};
|
|
426
399
|
}
|
|
427
|
-
function _for_closure(ownerLoopNodeAccessor, fn) {
|
|
428
|
-
ownerLoopNodeAccessor = decodeAccessor(ownerLoopNodeAccessor);
|
|
429
|
-
let scopeAccessor = "A" + ownerLoopNodeAccessor,
|
|
430
|
-
let
|
|
431
|
-
|
|
432
|
-
for (let scope of scopes) scope.H > 0 && scope.H < runId && fn(scope);
|
|
433
|
-
}, -1);
|
|
434
|
-
};
|
|
400
|
+
function _for_closure(ownerLoopNodeAccessor, fn, id, scopeIdAccessor) {
|
|
401
|
+
ownerLoopNodeAccessor = decodeAccessor(ownerLoopNodeAccessor), scopeIdAccessor = scopeIdAccessor ? decodeAccessor(scopeIdAccessor) : "L";
|
|
402
|
+
let scopeAccessor = "A" + ownerLoopNodeAccessor, render = (ownerScope) => {
|
|
403
|
+
for (let scope of toArray(ownerScope[scopeAccessor])) scope.H < runId && fn(scope);
|
|
404
|
+
}, ownerSignal = (ownerScope) => queueRender(ownerScope, render, id, 0, ownerScope[scopeIdAccessor]);
|
|
435
405
|
return ownerSignal._ = (scope) => queueRender(scope, fn, -1), ownerSignal;
|
|
436
406
|
}
|
|
437
|
-
function _for_selector(ownerLoopNodeAccessor, ownerValueAccessor, fn) {
|
|
407
|
+
function _for_selector(ownerLoopNodeAccessor, ownerValueAccessor, fn, getValueScope) {
|
|
438
408
|
ownerLoopNodeAccessor = decodeAccessor(ownerLoopNodeAccessor), ownerValueAccessor = decodeAccessor(ownerValueAccessor);
|
|
439
|
-
let scopeAccessor = "A" + ownerLoopNodeAccessor, mapAccessor = "O" + ownerLoopNodeAccessor,
|
|
409
|
+
let scopeAccessor = "A" + ownerLoopNodeAccessor, mapAccessor = "O" + ownerLoopNodeAccessor, prevKey = Symbol(), ownerSignal = (ownerScope) => {
|
|
440
410
|
if (ownerScope.H < runId) {
|
|
441
|
-
let nextKey = ownerScope[ownerValueAccessor];
|
|
442
|
-
|
|
443
|
-
let
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
} else for (let scope of toArray(ownerScope[scopeAccessor])) runLiveBranch(scope, fn);
|
|
448
|
-
map && (map[prevKeyProp] = nextKey);
|
|
449
|
-
}, -1);
|
|
411
|
+
let nextKey = (getValueScope ? getValueScope(ownerScope) : ownerScope)[ownerValueAccessor], map = keyedScopes(ownerScope, scopeAccessor, mapAccessor);
|
|
412
|
+
if (map && prevKey in ownerScope) {
|
|
413
|
+
let prevScope = map.get(ownerScope[prevKey]), nextScope = map.get(nextKey);
|
|
414
|
+
prevScope !== nextScope && (queueLiveBranch(prevScope, fn), queueLiveBranch(nextScope, fn));
|
|
415
|
+
} else for (let scope of toArray(ownerScope[scopeAccessor])) queueLiveBranch(scope, fn);
|
|
416
|
+
ownerScope[prevKey] = nextKey;
|
|
450
417
|
}
|
|
451
418
|
};
|
|
452
419
|
return ownerSignal._ = (scope) => queueRender(scope, fn, -1), ownerSignal;
|
|
@@ -460,8 +427,8 @@ function keyedScopes(ownerScope, scopeAccessor, mapAccessor) {
|
|
|
460
427
|
}
|
|
461
428
|
return map;
|
|
462
429
|
}
|
|
463
|
-
function
|
|
464
|
-
scope
|
|
430
|
+
function queueLiveBranch(scope, fn) {
|
|
431
|
+
scope?.H < runId && queueRender(scope, fn, -1);
|
|
465
432
|
}
|
|
466
433
|
function _if_closure(ownerConditionalNodeAccessor, branch, fn) {
|
|
467
434
|
ownerConditionalNodeAccessor = decodeAccessor(ownerConditionalNodeAccessor);
|
|
@@ -509,9 +476,7 @@ function _id(scope, accessor) {
|
|
|
509
476
|
return id;
|
|
510
477
|
}
|
|
511
478
|
function _script(id, fn) {
|
|
512
|
-
return _resumed[id] = fn, (scope) =>
|
|
513
|
-
queueEffect(scope, fn);
|
|
514
|
-
};
|
|
479
|
+
return _resumed[id] = fn, (scope) => queueEffect(scope, fn);
|
|
515
480
|
}
|
|
516
481
|
function _global_read($global, key) {
|
|
517
482
|
return $global[key];
|
|
@@ -537,14 +502,29 @@ function _hoist(...path) {
|
|
|
537
502
|
function _hoist_resume(id, ...path) {
|
|
538
503
|
return _resumed[id] = _hoist(...path);
|
|
539
504
|
}
|
|
540
|
-
|
|
541
|
-
//#region src/dom/walker.ts
|
|
505
|
+
// src/dom/walker.ts
|
|
542
506
|
/** Cloned templates are small, where a TreeWalker's per-step cost dominates. */
|
|
543
507
|
function walk(startNode, walkCodes, branch) {
|
|
544
508
|
currentNode = startNode, walkInternal(0, walkCodes, branch);
|
|
545
509
|
}
|
|
546
|
-
|
|
547
|
-
|
|
510
|
+
function walkInternal(currentWalkIndex, walkCodes, scope) {
|
|
511
|
+
let value, currentMultiplier, storedMultiplier = 0, currentScopeIndex = 0;
|
|
512
|
+
for (; currentWalkIndex < walkCodes.length;) if (value = walkCodes.charCodeAt(currentWalkIndex++), currentMultiplier = storedMultiplier, storedMultiplier = 0, value === 32) scope[decodeAccessor(currentScopeIndex++)] = currentNode;
|
|
513
|
+
else if (value === 37 || value === 49) currentNode.replaceWith(currentNode = scope[decodeAccessor(currentScopeIndex++)] = new Text()), value === 49 && (scope[decodeAccessor(currentScopeIndex++)] = skipScope());
|
|
514
|
+
else if (value === 38) return currentWalkIndex;
|
|
515
|
+
else if (value === 47 || value === 48) currentWalkIndex = walkInternal(currentWalkIndex, walkCodes, scope[decodeAccessor(currentScopeIndex++)] = createScope(scope.$, scope.F)), value === 48 && (scope[decodeAccessor(currentScopeIndex++)] = skipScope());
|
|
516
|
+
else if (value < 92) for (value = 25 * currentMultiplier + value - 67; value--;) if (currentNode.firstChild) currentNode = currentNode.firstChild;
|
|
517
|
+
else {
|
|
518
|
+
for (; !currentNode.nextSibling && currentNode.parentNode;) currentNode = currentNode.parentNode;
|
|
519
|
+
walkNextSibling();
|
|
520
|
+
}
|
|
521
|
+
else if (value < 107) for (value = 10 * currentMultiplier + value - 97; value--;) walkNextSibling();
|
|
522
|
+
else if (value < 117) {
|
|
523
|
+
for (value = 10 * currentMultiplier + value - 107; value--;) currentNode = currentNode.parentNode || currentNode;
|
|
524
|
+
walkNextSibling();
|
|
525
|
+
} else storedMultiplier = currentMultiplier * 10 + value - 117;
|
|
526
|
+
}
|
|
527
|
+
// src/dom/resume.ts
|
|
548
528
|
function ready(readyId) {
|
|
549
529
|
(readyIds ||= /* @__PURE__ */ new Set()).add(readyId);
|
|
550
530
|
for (let renderId in curRenders) runResumeEffects(curRenders[renderId]);
|
|
@@ -566,23 +546,21 @@ function initEmbedded(readyId, runtimeId) {
|
|
|
566
546
|
}
|
|
567
547
|
function init(runtimeId = "M") {
|
|
568
548
|
if (curRenders) return;
|
|
569
|
-
let renders = self[runtimeId], defineRuntime = (desc) => Object.defineProperty(self, runtimeId, desc), initRuntime = (renders) => {
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
return;
|
|
585
|
-
}
|
|
549
|
+
let renders = self[runtimeId], defineRuntime = (desc) => Object.defineProperty(self, runtimeId, desc), initRuntime = (renders) => defineRuntime({ value: curRenders = ((renderId) => {
|
|
550
|
+
let render = curRenders[renderId] = renders[renderId] || renders(renderId), walk = render.w, scopeLookup = {}, pending = [], getScope = (id) => scopeLookup[id] || (+id ? initScope(scopeLookup[id] = { L: +id }) : initGlobal()), initGlobal = (_) => scopeLookup[0] ||= {
|
|
551
|
+
runtimeId,
|
|
552
|
+
renderId
|
|
553
|
+
}, initScope = (scope) => (scope.H ??= 1, scope.$ = initGlobal(), branchesEnabled && scope.G && (scope.F = getScope(scope.G)), scope), applyScopes = (partials) => {
|
|
554
|
+
let scopeId = partials[0];
|
|
555
|
+
for (let i = 1; i < partials.length; i++) {
|
|
556
|
+
let partial = partials[i];
|
|
557
|
+
typeof partial == "number" ? scopeId += partial : (scopeId ? initScope(Object.assign(scopeLookup[scopeId] ||= (partial.L = scopeId, partial), partial)) : Object.assign(initGlobal(), partial), scopeId++);
|
|
558
|
+
}
|
|
559
|
+
}, serializeContext = ((data, registryId) => typeof data == "number" ? registryId ? _resumed[registryId](getScope(data)) : getScope(data) : applyScopes(data)), createVisitBranches = (branchScopesStack = [], branchStarts = [], curBranchScopes, reorderBranch, reorderDepth = 0, adopt = (scope, branch) => scope.F === scope ? scope !== branch && setParentBranch(scope, branch) : scope.F = branch) => (branchId, branch, endedBranches, accessor, nodeAccessor, singleNode, parent = visit.parentNode, startVisit = visit) => {
|
|
560
|
+
if (visitType === "*") {
|
|
561
|
+
for (; reorderBranch && pending.length >= reorderDepth;) adopt(pending.pop(), reorderBranch);
|
|
562
|
+
(reorderBranch = +lastToken && visitScope) && (reorderDepth = pending.push(reorderBranch));
|
|
563
|
+
} else {
|
|
586
564
|
for (visitType !== "[" && (visitScope[nextToken()] = visitType === ")" || visitType === "}" ? parent : visit, accessor = "A" + (nodeAccessor = lastToken), singleNode = visitType !== "]" && visitType !== ")", nextToken()); branchId = +lastToken;) {
|
|
587
565
|
if ((endedBranches ||= []).push(branch = getScope(branchId)), setParentBranch(branch, branch.F), (branch.O = render.p?.[branchId]) && (branch.O.m = render.m), singleNode) {
|
|
588
566
|
for (; startVisit.previousSibling && (startVisit = startVisit.previousSibling).nodeType > 1;);
|
|
@@ -596,37 +574,37 @@ function init(runtimeId = "M") {
|
|
|
596
574
|
singleNode && (visitScope[accessor] = endedBranches.length > 1 ? endedBranches.reverse() : endedBranches[0]);
|
|
597
575
|
}
|
|
598
576
|
visitType === "[" ? (endedBranches || (branchScopesStack.push(curBranchScopes), curBranchScopes = void 0), branchStarts.push(visit)) : pending.push(visitScope);
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
577
|
+
}
|
|
578
|
+
}, nextToken = (_) => lastToken = visitText.slice(lastTokenIndex, (lastTokenIndex = visitText.indexOf(" ", lastTokenIndex) + 1 || visitText.length + 1) - 1), processResumes = (resumes = [], effects) => {
|
|
579
|
+
let i = 0;
|
|
580
|
+
for (; i < resumes.length; i++) {
|
|
581
|
+
let serialized = resumes[i];
|
|
582
|
+
if (typeof serialized == "string") for (lastTokenIndex = 0, visitText = serialized; nextToken();) /\D/.test(lastToken) ? lastEffect = _resumed[lastToken] : effects.push(lastEffect, getScope(lastToken));
|
|
583
|
+
else if (Array.isArray(serialized)) {
|
|
584
|
+
if (!(readyIds && serialized.every((dep) => readyIds.has(dep) && !render.b[dep].length))) break;
|
|
585
|
+
} else if (readyIds && typeof serialized == "number") break;
|
|
586
|
+
else {
|
|
587
|
+
let scopes = serialized(serializeContext);
|
|
588
|
+
Array.isArray(scopes) && applyScopes(scopes);
|
|
611
589
|
}
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
590
|
+
}
|
|
591
|
+
return resumes.splice(0, i), i;
|
|
592
|
+
}, lastEffect, visits, visit, visitText, visitType, visitScope, lastToken, lastTokenIndex, visitBranches, htmlStart, embedAnchor;
|
|
593
|
+
return serializeContext._ = _resumed, render.m = (effects) => {
|
|
594
|
+
if (processResumes(render.r, effects), readyIds && render.b) for (let progress = 1; progress;) {
|
|
595
|
+
progress = 0;
|
|
596
|
+
for (let readyId of readyIds) {
|
|
597
|
+
let resumes = render.b[readyId];
|
|
598
|
+
resumes && processResumes(resumes, effects) && (progress = 1);
|
|
621
599
|
}
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
}
|
|
629
|
-
};
|
|
600
|
+
}
|
|
601
|
+
let retained = 0;
|
|
602
|
+
for (visit of visits = render.v) lastTokenIndex = render.i.length, visitText = visit.data, visitType = visitText[lastTokenIndex++], visitScope = getScope(nextToken()), dynamicHtmlEnabled && visitType > "%" && visitType <= "'" ? visitType === "&" ? htmlStart = visit : (visitScope[nextToken()] = htmlStart, visitScope["H" + lastToken] = visit, (branchesEnabled || lazyEnabled) && pending[pending.length - 1] !== visitScope && pending.push(visitScope)) : branchesEnabled && visitType > "'" ? (visitBranches ||= createVisitBranches())() : lazyEnabled && render.b && visitType > "%" ? visits[retained++] = visit : (visitScope[nextToken()] = visitType === "%" ? visit.parentNode.insertBefore(new Text(), visit) : visit.previousSibling, (branchesEnabled || lazyEnabled) && pending[pending.length - 1] !== visitScope && pending.push(visitScope)), embedRenders && !embedAnchor && visit.parentNode && embedRenders.set(embedAnchor = visit.parentNode.insertBefore(new Text(), visit), [renderId, scopeLookup]);
|
|
603
|
+
return branchesEnabled && visitBranches && (visitType = "*", lastToken = "", visitBranches()), visits.length = retained, effects;
|
|
604
|
+
}, render.w = (_) => {
|
|
605
|
+
walk(), runResumeEffects(render);
|
|
606
|
+
}, render;
|
|
607
|
+
}) });
|
|
630
608
|
if (renders) {
|
|
631
609
|
initRuntime(renders);
|
|
632
610
|
for (let renderId in renders) runResumeEffects(curRenders(renderId));
|
|
@@ -654,11 +632,10 @@ function _el(id, accessor) {
|
|
|
654
632
|
function _dynamic_tag_var_resume(accessor) {
|
|
655
633
|
accessor = decodeAccessor(accessor), _resumed["-" + accessor] = (scope) => (_) => {
|
|
656
634
|
let node = scope[accessor];
|
|
657
|
-
return node.nodeType
|
|
635
|
+
return node.nodeType > 1 ? node.previousSibling : node;
|
|
658
636
|
};
|
|
659
637
|
}
|
|
660
|
-
|
|
661
|
-
//#region src/dom/renderer.ts
|
|
638
|
+
// src/dom/renderer.ts
|
|
662
639
|
function createBranch($global, renderer, parentScope, parentNode) {
|
|
663
640
|
let branch = createScope($global);
|
|
664
641
|
return branch._ = renderer.e || parentScope, setParentBranch(branch, parentScope?.F), renderer.b?.(branch, parentNode.namespaceURI), branch;
|
|
@@ -677,11 +654,7 @@ function _return_setup(setup) {
|
|
|
677
654
|
}
|
|
678
655
|
function _content(id, template, walks, setup, params, dynamicScopesAccessor) {
|
|
679
656
|
walks = walks ? walks.replace(/[^\0-1]+$/, "") : "", setup = setup ? setup._ || setup : void 0, params ||= void 0;
|
|
680
|
-
let clone = template ? (branch, ns) =>
|
|
681
|
-
((cloneCache[ns] ||= {})[1 + template] ||= createCloneableHTML(template, ns))(branch, walks);
|
|
682
|
-
} : (branch) => {
|
|
683
|
-
walk(branch.S = branch.K = new Text(), walks, branch);
|
|
684
|
-
};
|
|
657
|
+
let cloneables = {}, clone = template ? (branch, ns) => (cloneables[ns] ||= createCloneableHTML(template, walks, ns))(branch) : (branch) => walk(branch.S = branch.K = new Text(), walks, branch);
|
|
685
658
|
return _resumed[id] = (owner) => ({
|
|
686
659
|
a: id,
|
|
687
660
|
b: clone,
|
|
@@ -713,17 +686,14 @@ function _content_closures(renderer, closureFns) {
|
|
|
713
686
|
}, instance;
|
|
714
687
|
};
|
|
715
688
|
}
|
|
716
|
-
function createCloneableHTML(html, ns) {
|
|
689
|
+
function createCloneableHTML(html, walks, ns) {
|
|
717
690
|
let { firstChild, lastChild } = parseHTML(html, ns), parent = new DocumentFragment();
|
|
718
|
-
return insertChildNodes(parent, null, firstChild, lastChild), firstChild === lastChild && firstChild.nodeType < 8 ? (branch, walks) => {
|
|
719
|
-
walk(branch.S = branch.K = firstChild.cloneNode(!0), walks, branch);
|
|
720
|
-
} : (branch, walks) => {
|
|
691
|
+
return insertChildNodes(parent, null, firstChild, lastChild), firstChild === lastChild && firstChild.nodeType < 8 ? (branch) => walk(branch.S = branch.K = firstChild.cloneNode(!0), walks, branch) : (branch) => {
|
|
721
692
|
let clone = parent.cloneNode(!0);
|
|
722
693
|
clone.namespaceURI = ns, walk(clone.firstChild, walks, branch), branch.S = clone.firstChild, branch.K = clone.lastChild;
|
|
723
694
|
};
|
|
724
695
|
}
|
|
725
|
-
|
|
726
|
-
//#region src/dom/dom.ts
|
|
696
|
+
// src/dom/dom.ts
|
|
727
697
|
function _to_text(value) {
|
|
728
698
|
return value || value === 0 ? value + "" : "";
|
|
729
699
|
}
|
|
@@ -823,24 +793,20 @@ function attrsInternal(scope, nodeAccessor, nextAttrs, controllable) {
|
|
|
823
793
|
}
|
|
824
794
|
}
|
|
825
795
|
function _attr_content(scope, nodeAccessor, value) {
|
|
826
|
-
let
|
|
827
|
-
scope["D" + nodeAccessor] !== (scope["D" + nodeAccessor] = rendererKey(content)) && (setBranch(scope, nodeAccessor, content, createAndSetupBranch), content?.f && subscribeToScopeSet(content.e, content.f, scope["A" + nodeAccessor])), content?.g?.(scope["A" + nodeAccessor]);
|
|
796
|
+
let renderer = normalizeDynamicRenderer(value), content;
|
|
797
|
+
renderer && renderer.a && (content = renderer), scope["D" + nodeAccessor] !== (scope["D" + nodeAccessor] = rendererKey(content)) && (setBranch(scope, nodeAccessor, content, createAndSetupBranch), content?.f && subscribeToScopeSet(content.e, content.f, scope["A" + nodeAccessor])), content?.g?.(scope["A" + nodeAccessor]);
|
|
828
798
|
}
|
|
829
799
|
function _attrs_script(scope, nodeAccessor) {
|
|
830
800
|
let el = scope[nodeAccessor], events = scope["I" + nodeAccessor];
|
|
831
801
|
controllableScripts[scope["F" + nodeAccessor]]?.(scope, nodeAccessor);
|
|
832
802
|
for (let name in events) _on(el, name, events[name]);
|
|
833
803
|
}
|
|
834
|
-
function normalizeClientRender(value) {
|
|
835
|
-
let renderer = normalizeDynamicRenderer(value);
|
|
836
|
-
if (renderer && renderer.a) return renderer;
|
|
837
|
-
}
|
|
838
804
|
function normalizeAttrValue(value) {
|
|
839
805
|
if (isNotNullishOrFalse(value)) return value === !0 ? "" : value + "";
|
|
840
806
|
}
|
|
841
807
|
function _lifecycle(scope, thisObj, index = 0) {
|
|
842
808
|
let accessor = "K" + index, instance = scope[accessor];
|
|
843
|
-
instance ? (Object.assign(instance, thisObj), instance.onUpdate?.()) : (scope[accessor] = thisObj, Object.assign(thisObj, thisObj.onMount?.()),
|
|
809
|
+
instance ? (Object.assign(instance, thisObj), instance.onUpdate?.()) : (scope[accessor] = thisObj, Object.assign(thisObj, thisObj.onMount?.()), onAbort(scope, accessor, (_) => thisObj.onDestroy?.()));
|
|
844
810
|
}
|
|
845
811
|
function removeChildNodes(startNode, endNode) {
|
|
846
812
|
for (endNode = endNode.nextSibling; startNode !== endNode;) {
|
|
@@ -854,8 +820,7 @@ function insertChildNodes(parentNode, referenceNode, startNode, endNode) {
|
|
|
854
820
|
parentNode.insertBefore(startNode, referenceNode), startNode = next;
|
|
855
821
|
}
|
|
856
822
|
}
|
|
857
|
-
|
|
858
|
-
//#region src/dom/resolve-cursor-position.ts
|
|
823
|
+
// src/dom/resolve-cursor-position.ts
|
|
859
824
|
function resolveCursorPosition(inputType, initialPosition, initialValue, updatedValue) {
|
|
860
825
|
if ((initialPosition || initialPosition === 0) && (initialPosition !== initialValue.length || /kw/.test(inputType))) {
|
|
861
826
|
let before = initialValue.slice(0, initialPosition), after = initialValue.slice(initialPosition);
|
|
@@ -867,8 +832,7 @@ function resolveCursorPosition(inputType, initialPosition, initialValue, updated
|
|
|
867
832
|
}
|
|
868
833
|
return -1;
|
|
869
834
|
}
|
|
870
|
-
|
|
871
|
-
//#region src/dom/controllable.ts
|
|
835
|
+
// src/dom/controllable.ts
|
|
872
836
|
function _attr_input_checked_default(scope, nodeAccessor, checked) {
|
|
873
837
|
let el = scope[nodeAccessor], normalizedChecked = isNotNullishOrFalse(checked);
|
|
874
838
|
if (el.defaultChecked !== normalizedChecked) {
|
|
@@ -1059,8 +1023,7 @@ function _controllable_select(scope, nodeAccessor, nextAttrs) {
|
|
|
1059
1023
|
function _controllable_open(scope, nodeAccessor, nextAttrs) {
|
|
1060
1024
|
if ("open" in nextAttrs || "openChange" in nextAttrs) return _attr_details_or_dialog_open(scope, nodeAccessor, nextAttrs.open, nextAttrs.openChange), /^open(?:Change)?$/;
|
|
1061
1025
|
}
|
|
1062
|
-
|
|
1063
|
-
//#region src/dom/control-flow.ts
|
|
1026
|
+
// src/dom/control-flow.ts
|
|
1064
1027
|
function _await_promise(nodeAccessor, params) {
|
|
1065
1028
|
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
1066
1029
|
let promiseAccessor = "L" + nodeAccessor, branchAccessor = "A" + nodeAccessor, tryAccessor = "Q" + nodeAccessor, resolveAwait = (scope, referenceNode, value) => {
|
|
@@ -1079,7 +1042,7 @@ function _await_promise(nodeAccessor, params) {
|
|
|
1079
1042
|
}
|
|
1080
1043
|
if (!isPromise(promise)) return scope[tryAccessor] ? awaitPromise(scope, Promise.resolve(promise)) : resolveAwait(scope, scope[nodeAccessor], promise);
|
|
1081
1044
|
let awaitCounter = tryBranch.O;
|
|
1082
|
-
scope[tryAccessor] || (scope[tryAccessor] = tryBranch,
|
|
1045
|
+
scope[tryAccessor] || (scope[tryAccessor] = tryBranch, onAbort(scope, promiseAccessor, (_) => {
|
|
1083
1046
|
scope[promiseAccessor] = 0, scope[tryAccessor] && queueAsyncRender(scope[tryAccessor], completeAwaitCounter, awaitCounter);
|
|
1084
1047
|
}), awaitBranch && (awaitBranch.W ||= []), tryBranch === awaitBranch ? (awaitCounter?.i || (awaitCounter = createAwaitCounter(tryBranch, (_) => {
|
|
1085
1048
|
if (tryBranch === scope[branchAccessor]) {
|
|
@@ -1420,6 +1383,11 @@ Object.defineProperty(exports, "$", {
|
|
|
1420
1383
|
get: function() {
|
|
1421
1384
|
return _attr_details_or_dialog_open_default;
|
|
1422
1385
|
}
|
|
1386
|
+
}), Object.defineProperty(exports, "Sn", {
|
|
1387
|
+
enumerable: !0,
|
|
1388
|
+
get: function() {
|
|
1389
|
+
return withBranches;
|
|
1390
|
+
}
|
|
1423
1391
|
}), Object.defineProperty(exports, "St", {
|
|
1424
1392
|
enumerable: !0,
|
|
1425
1393
|
get: function() {
|
|
@@ -1503,7 +1471,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1503
1471
|
}), Object.defineProperty(exports, "_n", {
|
|
1504
1472
|
enumerable: !0,
|
|
1505
1473
|
get: function() {
|
|
1506
|
-
return
|
|
1474
|
+
return forUntil;
|
|
1507
1475
|
}
|
|
1508
1476
|
}), Object.defineProperty(exports, "_t", {
|
|
1509
1477
|
enumerable: !0,
|
|
@@ -1518,7 +1486,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1518
1486
|
}), Object.defineProperty(exports, "an", {
|
|
1519
1487
|
enumerable: !0,
|
|
1520
1488
|
get: function() {
|
|
1521
|
-
return
|
|
1489
|
+
return installCatch;
|
|
1522
1490
|
}
|
|
1523
1491
|
}), Object.defineProperty(exports, "at", {
|
|
1524
1492
|
enumerable: !0,
|
|
@@ -1533,7 +1501,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1533
1501
|
}), Object.defineProperty(exports, "bn", {
|
|
1534
1502
|
enumerable: !0,
|
|
1535
1503
|
get: function() {
|
|
1536
|
-
return
|
|
1504
|
+
return _hoist_read_error;
|
|
1537
1505
|
}
|
|
1538
1506
|
}), Object.defineProperty(exports, "bt", {
|
|
1539
1507
|
enumerable: !0,
|
|
@@ -1548,7 +1516,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1548
1516
|
}), Object.defineProperty(exports, "cn", {
|
|
1549
1517
|
enumerable: !0,
|
|
1550
1518
|
get: function() {
|
|
1551
|
-
return
|
|
1519
|
+
return queueEffect;
|
|
1552
1520
|
}
|
|
1553
1521
|
}), Object.defineProperty(exports, "ct", {
|
|
1554
1522
|
enumerable: !0,
|
|
@@ -1563,7 +1531,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1563
1531
|
}), Object.defineProperty(exports, "dn", {
|
|
1564
1532
|
enumerable: !0,
|
|
1565
1533
|
get: function() {
|
|
1566
|
-
return
|
|
1534
|
+
return run;
|
|
1567
1535
|
}
|
|
1568
1536
|
}), Object.defineProperty(exports, "dt", {
|
|
1569
1537
|
enumerable: !0,
|
|
@@ -1588,7 +1556,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1588
1556
|
}), Object.defineProperty(exports, "fn", {
|
|
1589
1557
|
enumerable: !0,
|
|
1590
1558
|
get: function() {
|
|
1591
|
-
return
|
|
1559
|
+
return runEffects;
|
|
1592
1560
|
}
|
|
1593
1561
|
}), Object.defineProperty(exports, "ft", {
|
|
1594
1562
|
enumerable: !0,
|
|
@@ -1603,7 +1571,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1603
1571
|
}), Object.defineProperty(exports, "gn", {
|
|
1604
1572
|
enumerable: !0,
|
|
1605
1573
|
get: function() {
|
|
1606
|
-
return
|
|
1574
|
+
return forTo;
|
|
1607
1575
|
}
|
|
1608
1576
|
}), Object.defineProperty(exports, "gt", {
|
|
1609
1577
|
enumerable: !0,
|
|
@@ -1618,7 +1586,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1618
1586
|
}), Object.defineProperty(exports, "hn", {
|
|
1619
1587
|
enumerable: !0,
|
|
1620
1588
|
get: function() {
|
|
1621
|
-
return
|
|
1589
|
+
return forOf;
|
|
1622
1590
|
}
|
|
1623
1591
|
}), Object.defineProperty(exports, "ht", {
|
|
1624
1592
|
enumerable: !0,
|
|
@@ -1633,7 +1601,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1633
1601
|
}), Object.defineProperty(exports, "in", {
|
|
1634
1602
|
enumerable: !0,
|
|
1635
1603
|
get: function() {
|
|
1636
|
-
return
|
|
1604
|
+
return installBranchRenders;
|
|
1637
1605
|
}
|
|
1638
1606
|
}), Object.defineProperty(exports, "it", {
|
|
1639
1607
|
enumerable: !0,
|
|
@@ -1668,7 +1636,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1668
1636
|
}), Object.defineProperty(exports, "ln", {
|
|
1669
1637
|
enumerable: !0,
|
|
1670
1638
|
get: function() {
|
|
1671
|
-
return
|
|
1639
|
+
return queueRender;
|
|
1672
1640
|
}
|
|
1673
1641
|
}), Object.defineProperty(exports, "lt", {
|
|
1674
1642
|
enumerable: !0,
|
|
@@ -1683,7 +1651,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1683
1651
|
}), Object.defineProperty(exports, "mn", {
|
|
1684
1652
|
enumerable: !0,
|
|
1685
1653
|
get: function() {
|
|
1686
|
-
return
|
|
1654
|
+
return forIn;
|
|
1687
1655
|
}
|
|
1688
1656
|
}), Object.defineProperty(exports, "mt", {
|
|
1689
1657
|
enumerable: !0,
|
|
@@ -1698,7 +1666,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1698
1666
|
}), Object.defineProperty(exports, "nn", {
|
|
1699
1667
|
enumerable: !0,
|
|
1700
1668
|
get: function() {
|
|
1701
|
-
return
|
|
1669
|
+
return onAbort;
|
|
1702
1670
|
}
|
|
1703
1671
|
}), Object.defineProperty(exports, "nt", {
|
|
1704
1672
|
enumerable: !0,
|
|
@@ -1713,7 +1681,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1713
1681
|
}), Object.defineProperty(exports, "on", {
|
|
1714
1682
|
enumerable: !0,
|
|
1715
1683
|
get: function() {
|
|
1716
|
-
return
|
|
1684
|
+
return prepareEffects;
|
|
1717
1685
|
}
|
|
1718
1686
|
}), Object.defineProperty(exports, "ot", {
|
|
1719
1687
|
enumerable: !0,
|
|
@@ -1728,7 +1696,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1728
1696
|
}), Object.defineProperty(exports, "pn", {
|
|
1729
1697
|
enumerable: !0,
|
|
1730
1698
|
get: function() {
|
|
1731
|
-
return
|
|
1699
|
+
return runId;
|
|
1732
1700
|
}
|
|
1733
1701
|
}), Object.defineProperty(exports, "pt", {
|
|
1734
1702
|
enumerable: !0,
|
|
@@ -1753,7 +1721,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1753
1721
|
}), Object.defineProperty(exports, "rn", {
|
|
1754
1722
|
enumerable: !0,
|
|
1755
1723
|
get: function() {
|
|
1756
|
-
return
|
|
1724
|
+
return createBranchRenders;
|
|
1757
1725
|
}
|
|
1758
1726
|
}), Object.defineProperty(exports, "rt", {
|
|
1759
1727
|
enumerable: !0,
|
|
@@ -1768,7 +1736,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1768
1736
|
}), Object.defineProperty(exports, "sn", {
|
|
1769
1737
|
enumerable: !0,
|
|
1770
1738
|
get: function() {
|
|
1771
|
-
return
|
|
1739
|
+
return queueAsyncRender;
|
|
1772
1740
|
}
|
|
1773
1741
|
}), Object.defineProperty(exports, "st", {
|
|
1774
1742
|
enumerable: !0,
|
|
@@ -1798,7 +1766,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1798
1766
|
}), Object.defineProperty(exports, "un", {
|
|
1799
1767
|
enumerable: !0,
|
|
1800
1768
|
get: function() {
|
|
1801
|
-
return
|
|
1769
|
+
return rendering;
|
|
1802
1770
|
}
|
|
1803
1771
|
}), Object.defineProperty(exports, "ut", {
|
|
1804
1772
|
enumerable: !0,
|
|
@@ -1813,7 +1781,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1813
1781
|
}), Object.defineProperty(exports, "vn", {
|
|
1814
1782
|
enumerable: !0,
|
|
1815
1783
|
get: function() {
|
|
1816
|
-
return
|
|
1784
|
+
return _assert_class_toggles;
|
|
1817
1785
|
}
|
|
1818
1786
|
}), Object.defineProperty(exports, "vt", {
|
|
1819
1787
|
enumerable: !0,
|
|
@@ -1838,7 +1806,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1838
1806
|
}), Object.defineProperty(exports, "xn", {
|
|
1839
1807
|
enumerable: !0,
|
|
1840
1808
|
get: function() {
|
|
1841
|
-
return
|
|
1809
|
+
return _call;
|
|
1842
1810
|
}
|
|
1843
1811
|
}), Object.defineProperty(exports, "xt", {
|
|
1844
1812
|
enumerable: !0,
|
|
@@ -1853,7 +1821,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1853
1821
|
}), Object.defineProperty(exports, "yn", {
|
|
1854
1822
|
enumerable: !0,
|
|
1855
1823
|
get: function() {
|
|
1856
|
-
return
|
|
1824
|
+
return _assert_hoist;
|
|
1857
1825
|
}
|
|
1858
1826
|
}), Object.defineProperty(exports, "yt", {
|
|
1859
1827
|
enumerable: !0,
|