marko 6.4.8 → 6.4.10
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/constants/closure-signal-prop.d.ts +1 -1
- package/dist/common/constants/closure-signal-prop.debug.d.ts +1 -1
- 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-CFCBDift.mjs → dom-C1V5vpFs.mjs} +60 -98
- package/dist/debug/{dom-D8znnhpf.js → dom-DNB5yq3U.js} +59 -109
- package/dist/debug/dom.js +9 -14
- package/dist/debug/dom.mjs +9 -14
- package/dist/debug/html.js +39 -51
- package/dist/debug/html.mjs +37 -49
- package/dist/dom/catch.feat.js +4 -5
- package/dist/dom/catch.feat.mjs +2 -3
- package/dist/dom/compat.d.ts +1 -1
- package/dist/dom/control-flow.d.ts +1 -1
- 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/dom.d.ts +2 -3
- 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/placeholder.feat.js +4 -5
- package/dist/dom/placeholder.feat.mjs +2 -3
- package/dist/dom/resume.d.ts +1 -1
- package/dist/dom/scope.d.ts +1 -1
- package/dist/dom/signals.d.ts +1 -1
- package/dist/{dom-Bpkm72vV.js → dom-C2-Flitp.js} +122 -166
- package/dist/{dom-CVAevsbz.mjs → dom-DsHYWMCR.mjs} +59 -94
- package/dist/dom.js +36 -40
- package/dist/dom.mjs +9 -14
- package/dist/html/serializer.d.ts +1 -1
- package/dist/html/writer.d.ts +3 -3
- package/dist/html.d.ts +1 -1
- package/dist/html.js +60 -74
- package/dist/html.mjs +60 -75
- package/dist/translator/core/show.d.ts +3 -4
- package/dist/translator/index.js +1193 -1295
- package/dist/translator/util/assert.d.ts +9 -2
- package/dist/translator/util/bindings.d.ts +6 -5
- package/dist/translator/util/branch-tag.d.ts +1 -1
- package/dist/translator/util/constants/slot-kind.d.ts +1 -1
- package/dist/translator/util/known-tag.d.ts +3 -0
- package/dist/translator/util/module-registrations.d.ts +1 -1
- package/dist/translator/util/optional.d.ts +1 -0
- package/dist/translator/util/params-tree.d.ts +3 -3
- package/dist/translator/util/reasons.d.ts +2 -2
- package/dist/translator/util/references.d.ts +13 -10
- package/dist/translator/util/replace-with-statements.d.ts +4 -0
- package/dist/translator/util/runtime.d.ts +1 -0
- package/dist/translator/util/scope-accessor.d.ts +1 -1
- package/dist/translator/util/sections.d.ts +38 -14
- package/dist/translator/util/signals.d.ts +3 -11
- package/dist/translator/util/slots.d.ts +1 -1
- package/dist/translator/util/solve-reasons.d.ts +5 -0
- package/dist/translator/util/sources.d.ts +1 -1
- package/dist/translator/util/static-text.d.ts +1 -0
- package/dist/translator/util/structure.d.ts +3 -2
- package/dist/translator/util/tag-import.d.ts +0 -2
- package/dist/translator/util/tag-name-type.d.ts +3 -0
- package/dist/translator/util/write-guard.d.ts +2 -0
- package/dist/translator/visitors/placeholder.d.ts +4 -4
- package/package.json +6 -6
- package/tags/lifecycle.d.marko +2 -0
- package/dist/translator/visitors/constants/sibling-text.d.ts +0 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
// src/common/constants/accessor-prefix.debug.ts
|
|
3
3
|
const BranchScopes$1 = "BranchScopes:";
|
|
4
4
|
const ClosureScopes = "ClosureScopes:";
|
|
5
5
|
const ClosureSignalIndex = "ClosureSignalIndex:";
|
|
@@ -16,8 +16,7 @@ const Lifecycle = "Lifecycle:";
|
|
|
16
16
|
const Promise$1 = "Promise:";
|
|
17
17
|
const TagVariableChange$1 = "TagVariableChange:";
|
|
18
18
|
const TryBranch$1 = "TryBranch:";
|
|
19
|
-
|
|
20
|
-
//#region src/common/constants/accessor-prop.debug.ts
|
|
19
|
+
// src/common/constants/accessor-prop.debug.ts
|
|
21
20
|
const Global = "$global";
|
|
22
21
|
const AbortControllers = "#AbortControllers";
|
|
23
22
|
const AbortScopes = "#AbortScopes";
|
|
@@ -47,16 +46,13 @@ const Subscriptions = "#Subscriptions";
|
|
|
47
46
|
const TagVariable = "#TagVariable";
|
|
48
47
|
const TagVariableChange = "#TagVariableChange";
|
|
49
48
|
const TryBranch = "#TryBranch";
|
|
50
|
-
|
|
51
|
-
//#region src/common/constants/closure-scopes-prop.debug.ts
|
|
49
|
+
// src/common/constants/closure-scopes-prop.debug.ts
|
|
52
50
|
const Changed = "Changed";
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const ScopeInstancesAccessor = "scopeInstancesAccessor";
|
|
51
|
+
// src/common/constants/closure-signal-prop.debug.ts
|
|
52
|
+
const ScopesAccessor = "scopesAccessor";
|
|
56
53
|
const SignalIndexAccessor = "signalIndexAccessor";
|
|
57
54
|
const Index = "index";
|
|
58
|
-
|
|
59
|
-
//#region src/common/constants/keyed-scopes-prop.debug.ts
|
|
55
|
+
// src/common/constants/keyed-scopes-prop.debug.ts
|
|
60
56
|
const PreviousKey = "PreviousKey:";
|
|
61
57
|
const Scope = "scope";
|
|
62
58
|
const Signal = "signal";
|
|
@@ -70,8 +66,7 @@ const Accessor = "accessor";
|
|
|
70
66
|
const LocalClosures = "localClosures";
|
|
71
67
|
const Returns = "returns";
|
|
72
68
|
const Lazy = "lazy";
|
|
73
|
-
|
|
74
|
-
//#region src/common/helpers.ts
|
|
69
|
+
// src/common/helpers.ts
|
|
75
70
|
const invalidNativeAttrNameReg = /^[^a-z_]|[^a-z0-9._:-]/i;
|
|
76
71
|
const knownWrongAttrs = {
|
|
77
72
|
className: "class",
|
|
@@ -195,8 +190,7 @@ function withDynamicHtml(runtime) {
|
|
|
195
190
|
dynamicHtmlEnabled = 1;
|
|
196
191
|
return runtime;
|
|
197
192
|
}
|
|
198
|
-
|
|
199
|
-
//#region src/common/errors.ts
|
|
193
|
+
// src/common/errors.ts
|
|
200
194
|
const lowercaseOnAttrReg = /^on[a-z]/;
|
|
201
195
|
function assertValidAttrValue(name, value) {
|
|
202
196
|
if (value && typeof value !== "string" && lowercaseOnAttrReg.test(name)) throw new Error(`The \`${name}\` attribute must be a string or a falsey value (\`null\`, \`undefined\`, \`false\`, \`0\`, …), but received type "${typeof value}". To attach an event listener, use the \`on${name[2].toUpperCase()}${name.slice(3)}\` event handler instead.`);
|
|
@@ -311,8 +305,7 @@ function joinWithAnd(a) {
|
|
|
311
305
|
default: return `${a.slice(0, -1).join(", ")}, and ${a[a.length - 1]}`;
|
|
312
306
|
}
|
|
313
307
|
}
|
|
314
|
-
|
|
315
|
-
//#region src/common/for.ts
|
|
308
|
+
// src/common/for.ts
|
|
316
309
|
function forIn(obj, cb) {
|
|
317
310
|
for (const key in obj) cb(key, obj[key]);
|
|
318
311
|
}
|
|
@@ -339,8 +332,7 @@ function forUntil(until, from, step, cb) {
|
|
|
339
332
|
const delta = step || 1;
|
|
340
333
|
for (let steps = (until - start) / delta, i = 0; i < steps; i++) cb(start + i * delta);
|
|
341
334
|
}
|
|
342
|
-
|
|
343
|
-
//#region src/dom/queue.ts
|
|
335
|
+
// src/dom/queue.ts
|
|
344
336
|
let rendering;
|
|
345
337
|
let runId = 2;
|
|
346
338
|
let pendingEffects = [];
|
|
@@ -480,8 +472,7 @@ function runRenders(renders = pendingRenders) {
|
|
|
480
472
|
runRender(render);
|
|
481
473
|
}
|
|
482
474
|
}
|
|
483
|
-
|
|
484
|
-
//#region src/dom/abort-signal.ts
|
|
475
|
+
// src/dom/abort-signal.ts
|
|
485
476
|
function $signalReset(scope, id) {
|
|
486
477
|
const ctrl = scope[AbortControllers]?.[id];
|
|
487
478
|
if (ctrl) {
|
|
@@ -515,8 +506,7 @@ let subscriptionsEnabled;
|
|
|
515
506
|
function abort(ctrl) {
|
|
516
507
|
ctrl.abort();
|
|
517
508
|
}
|
|
518
|
-
|
|
519
|
-
//#region src/common/opt.ts
|
|
509
|
+
// src/common/opt.ts
|
|
520
510
|
function toArray(opt) {
|
|
521
511
|
return opt ? Array.isArray(opt) ? opt : [opt] : [];
|
|
522
512
|
}
|
|
@@ -529,8 +519,7 @@ function forEach(opt, cb) {
|
|
|
529
519
|
function push(opt, item) {
|
|
530
520
|
return opt ? Array.isArray(opt) ? (opt.push(item), opt) : [opt, item] : item;
|
|
531
521
|
}
|
|
532
|
-
|
|
533
|
-
//#region src/dom/event.ts
|
|
522
|
+
// src/dom/event.ts
|
|
534
523
|
function _on(element, type, handler) {
|
|
535
524
|
assertHandlerIsFunction("on" + type[0].toUpperCase() + type.slice(1), handler);
|
|
536
525
|
delegate(type, handleDelegated);
|
|
@@ -552,21 +541,18 @@ function handleDelegated(ev) {
|
|
|
552
541
|
}
|
|
553
542
|
delete ev.currentTarget;
|
|
554
543
|
}
|
|
555
|
-
|
|
556
|
-
//#region src/dom/parse-html.ts
|
|
544
|
+
// src/dom/parse-html.ts
|
|
557
545
|
const parsers = {};
|
|
558
546
|
function parseHTML(html, ns) {
|
|
559
547
|
const parser = parsers[ns] ||= document.createElementNS(ns, "template");
|
|
560
548
|
parser.innerHTML = html;
|
|
561
549
|
return parser.content || parser;
|
|
562
550
|
}
|
|
563
|
-
|
|
564
|
-
//#region src/common/meta.ts
|
|
551
|
+
// src/common/meta.ts
|
|
565
552
|
const DYNAMIC_TAG_SCRIPT_REGISTER_ID = "_dynamicTagScript";
|
|
566
553
|
const DYNAMIC_TAG_VAR_REGISTER_ID = "_dynamicTagVar";
|
|
567
554
|
const PLACEHOLDER_DISMISS_REGISTER_ID = "_placeholderDismiss";
|
|
568
|
-
|
|
569
|
-
//#region src/dom/scope.ts
|
|
555
|
+
// src/dom/scope.ts
|
|
570
556
|
let nextScopeId = 1e6;
|
|
571
557
|
let collectingScopes;
|
|
572
558
|
function createScope($global, closestBranch) {
|
|
@@ -626,15 +612,14 @@ function removeAndDestroyBranch(branch) {
|
|
|
626
612
|
removeChildNodes(branch[StartNode], branch[EndNode]);
|
|
627
613
|
}
|
|
628
614
|
function insertBranchBefore(branch, parentNode, nextSibling) {
|
|
629
|
-
|
|
615
|
+
parentNode.insertBefore(branch["#StartNode"].parentNode || branch["#StartNode"], nextSibling);
|
|
630
616
|
}
|
|
631
|
-
function
|
|
617
|
+
function detachBranch(branch) {
|
|
632
618
|
const fragment = new DocumentFragment();
|
|
633
619
|
fragment.namespaceURI = branch[StartNode].parentNode.namespaceURI;
|
|
634
620
|
insertChildNodes(fragment, null, branch[StartNode], branch[EndNode]);
|
|
635
621
|
}
|
|
636
|
-
|
|
637
|
-
//#region src/dom/schedule.ts
|
|
622
|
+
// src/dom/schedule.ts
|
|
638
623
|
let runTask;
|
|
639
624
|
let isScheduled;
|
|
640
625
|
let channel;
|
|
@@ -666,8 +651,7 @@ function triggerMacroTask() {
|
|
|
666
651
|
}
|
|
667
652
|
channel.port2.postMessage(0);
|
|
668
653
|
}
|
|
669
|
-
|
|
670
|
-
//#region src/dom/signals.ts
|
|
654
|
+
// src/dom/signals.ts
|
|
671
655
|
function _let(id, fn) {
|
|
672
656
|
const valueAccessor = id.slice(0, id.lastIndexOf("/"));
|
|
673
657
|
id = +id.slice(id.lastIndexOf("/") + 1);
|
|
@@ -780,7 +764,7 @@ function subscribeToScopeSet(owner, accessor, scope) {
|
|
|
780
764
|
}
|
|
781
765
|
function _closure(...closureSignals) {
|
|
782
766
|
const [firstSignal] = closureSignals;
|
|
783
|
-
const scopeInstances = firstSignal[
|
|
767
|
+
const scopeInstances = firstSignal[ScopesAccessor];
|
|
784
768
|
const signalIndex = firstSignal[SignalIndexAccessor];
|
|
785
769
|
for (let i = closureSignals.length; i--;) closureSignals[i][Index] = i;
|
|
786
770
|
return (scope) => {
|
|
@@ -794,11 +778,11 @@ function _closure_get(valueAccessor, fn, getOwnerScope, resumeId) {
|
|
|
794
778
|
const closureSignal = ((scope, resumed) => {
|
|
795
779
|
const ownerScope = getOwnerScope ? getOwnerScope(scope) : scope["_"];
|
|
796
780
|
scope[closureSignal[SignalIndexAccessor]] = closureSignal[Index];
|
|
797
|
-
subscribeToScopeSet(ownerScope, closureSignal[
|
|
781
|
+
subscribeToScopeSet(ownerScope, closureSignal[ScopesAccessor], scope);
|
|
798
782
|
if (!resumed) queueRender(scope, fn, -1);
|
|
799
|
-
else if (ownerScope[closureSignal["
|
|
783
|
+
else if (ownerScope[closureSignal["scopesAccessor"]]["Changed"]) queueAsyncRender(scope, fn);
|
|
800
784
|
});
|
|
801
|
-
closureSignal[
|
|
785
|
+
closureSignal[ScopesAccessor] = ClosureScopes + valueAccessor;
|
|
802
786
|
closureSignal[SignalIndexAccessor] = ClosureSignalIndex + valueAccessor;
|
|
803
787
|
if (resumeId) _resumed[resumeId] = (scope) => closureSignal(scope, 1);
|
|
804
788
|
return closureSignal;
|
|
@@ -865,8 +849,7 @@ function _hoist(...path) {
|
|
|
865
849
|
function _hoist_resume(id, ...path) {
|
|
866
850
|
return _resumed[id] = _hoist(...path);
|
|
867
851
|
}
|
|
868
|
-
|
|
869
|
-
//#region src/dom/walker.ts
|
|
852
|
+
// src/dom/walker.ts
|
|
870
853
|
/** Cloned templates are small, where a TreeWalker's per-step cost dominates. */
|
|
871
854
|
let currentNode;
|
|
872
855
|
function walk(startNode, walkCodes, branch) {
|
|
@@ -918,8 +901,7 @@ function getDebugKey(index, node) {
|
|
|
918
901
|
return index;
|
|
919
902
|
}
|
|
920
903
|
const walkNextSibling = (_) => currentNode = currentNode.nextSibling || currentNode;
|
|
921
|
-
|
|
922
|
-
//#region src/dom/resume.ts
|
|
904
|
+
// src/dom/resume.ts
|
|
923
905
|
const _resumed = {};
|
|
924
906
|
let curRenders;
|
|
925
907
|
let embedRenders;
|
|
@@ -1141,7 +1123,7 @@ function runResumeEffects(render) {
|
|
|
1141
1123
|
isResuming = 0;
|
|
1142
1124
|
}
|
|
1143
1125
|
}
|
|
1144
|
-
function getRegisteredWithScope(
|
|
1126
|
+
function getRegisteredWithScope(scope, id) {
|
|
1145
1127
|
return scope ? _resumed[id](scope) : _resumed[id];
|
|
1146
1128
|
}
|
|
1147
1129
|
function _var_resume(id, signal) {
|
|
@@ -1157,8 +1139,7 @@ function _dynamic_tag_var_resume(accessor) {
|
|
|
1157
1139
|
return _el_read(node.nodeType === 8 ? node.previousSibling : node);
|
|
1158
1140
|
};
|
|
1159
1141
|
}
|
|
1160
|
-
|
|
1161
|
-
//#region src/dom/renderer.ts
|
|
1142
|
+
// src/dom/renderer.ts
|
|
1162
1143
|
function createBranch($global, renderer, parentScope, parentNode) {
|
|
1163
1144
|
const branch = createScope($global);
|
|
1164
1145
|
branch["_"] = renderer["owner"] || parentScope;
|
|
@@ -1236,19 +1217,19 @@ function _content_closures(renderer, closureFns) {
|
|
|
1236
1217
|
const cloneCache = {};
|
|
1237
1218
|
function createCloneableHTML(html, ns) {
|
|
1238
1219
|
const { firstChild, lastChild } = parseHTML(html, ns);
|
|
1239
|
-
const parent =
|
|
1220
|
+
const parent = new DocumentFragment();
|
|
1240
1221
|
insertChildNodes(parent, null, firstChild, lastChild);
|
|
1241
1222
|
return firstChild === lastChild && firstChild.nodeType < 8 ? (branch, walks) => {
|
|
1242
1223
|
walk(branch[StartNode] = branch[EndNode] = firstChild.cloneNode(true), walks, branch);
|
|
1243
1224
|
} : (branch, walks) => {
|
|
1244
1225
|
const clone = parent.cloneNode(true);
|
|
1226
|
+
clone.namespaceURI = ns;
|
|
1245
1227
|
walk(clone.firstChild, walks, branch);
|
|
1246
1228
|
branch[StartNode] = clone.firstChild;
|
|
1247
1229
|
branch[EndNode] = clone.lastChild;
|
|
1248
1230
|
};
|
|
1249
1231
|
}
|
|
1250
|
-
|
|
1251
|
-
//#region src/dom/dom.ts
|
|
1232
|
+
// src/dom/dom.ts
|
|
1252
1233
|
function _to_text(value) {
|
|
1253
1234
|
assertValidTextValue(value);
|
|
1254
1235
|
return value || value === 0 ? value + "" : "";
|
|
@@ -1409,7 +1390,7 @@ const _html = /*@__PURE__*/ withDynamicHtml(function _html(scope, value, accesso
|
|
|
1409
1390
|
const branch = scope[ClosestBranch];
|
|
1410
1391
|
if (branch?.["#StartNode"] === firstChild) branch[StartNode] = newFirstChild;
|
|
1411
1392
|
if (branch?.["#EndNode"] === lastChild) branch[EndNode] = newLastChild;
|
|
1412
|
-
|
|
1393
|
+
firstChild.before(...newContent.childNodes);
|
|
1413
1394
|
removeChildNodes(firstChild, lastChild);
|
|
1414
1395
|
}
|
|
1415
1396
|
});
|
|
@@ -1440,30 +1421,22 @@ function _lifecycle(scope, thisObj, index = 0) {
|
|
|
1440
1421
|
}
|
|
1441
1422
|
}
|
|
1442
1423
|
function removeChildNodes(startNode, endNode) {
|
|
1443
|
-
|
|
1444
|
-
while (startNode !==
|
|
1424
|
+
endNode = endNode.nextSibling;
|
|
1425
|
+
while (startNode !== endNode) {
|
|
1445
1426
|
const next = startNode.nextSibling;
|
|
1446
1427
|
startNode.remove();
|
|
1447
1428
|
startNode = next;
|
|
1448
1429
|
}
|
|
1449
1430
|
}
|
|
1450
1431
|
function insertChildNodes(parentNode, referenceNode, startNode, endNode) {
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
const
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
parentNode.insertBefore(startNode, referenceNode);
|
|
1457
|
-
startNode = next;
|
|
1458
|
-
}
|
|
1432
|
+
endNode = endNode.nextSibling;
|
|
1433
|
+
while (startNode !== endNode) {
|
|
1434
|
+
const next = startNode.nextSibling;
|
|
1435
|
+
parentNode.insertBefore(startNode, referenceNode);
|
|
1436
|
+
startNode = next;
|
|
1459
1437
|
}
|
|
1460
|
-
return parentNode;
|
|
1461
|
-
}
|
|
1462
|
-
function toInsertNode(startNode, endNode) {
|
|
1463
|
-
return startNode === endNode ? startNode : insertChildNodes(new DocumentFragment(), null, startNode, endNode);
|
|
1464
1438
|
}
|
|
1465
|
-
|
|
1466
|
-
//#region src/dom/resolve-cursor-position.ts
|
|
1439
|
+
// src/dom/resolve-cursor-position.ts
|
|
1467
1440
|
const R = /[\p{L}\p{N}]/gu;
|
|
1468
1441
|
function resolveCursorPosition(inputType, initialPosition, initialValue, updatedValue) {
|
|
1469
1442
|
if ((initialPosition || initialPosition === 0) && (initialPosition !== initialValue.length || /kw/.test(inputType))) {
|
|
@@ -1477,8 +1450,7 @@ function resolveCursorPosition(inputType, initialPosition, initialValue, updated
|
|
|
1477
1450
|
}
|
|
1478
1451
|
return -1;
|
|
1479
1452
|
}
|
|
1480
|
-
|
|
1481
|
-
//#region src/dom/controllable.ts
|
|
1453
|
+
// src/dom/controllable.ts
|
|
1482
1454
|
let inputType = "";
|
|
1483
1455
|
function _attr_input_checked_default(scope, nodeAccessor, checked) {
|
|
1484
1456
|
const el = scope[nodeAccessor];
|
|
@@ -1773,8 +1745,7 @@ function _controllable_open(scope, nodeAccessor, nextAttrs) {
|
|
|
1773
1745
|
return /^open(?:Change)?$/;
|
|
1774
1746
|
}
|
|
1775
1747
|
}
|
|
1776
|
-
|
|
1777
|
-
//#region src/dom/control-flow.ts
|
|
1748
|
+
// src/dom/control-flow.ts
|
|
1778
1749
|
function _await_promise(nodeAccessor, params) {
|
|
1779
1750
|
const promiseAccessor = Promise$1 + nodeAccessor;
|
|
1780
1751
|
const branchAccessor = BranchScopes$1 + nodeAccessor;
|
|
@@ -1828,7 +1799,7 @@ function _await_promise(nodeAccessor, params) {
|
|
|
1828
1799
|
countAwait(awaitCounter, scope, (_) => {
|
|
1829
1800
|
if (!awaitBranch["#DetachedAwait"]) {
|
|
1830
1801
|
awaitBranch[StartNode].parentNode.insertBefore(scope[nodeAccessor], awaitBranch[StartNode]);
|
|
1831
|
-
|
|
1802
|
+
detachBranch(tryBranch);
|
|
1832
1803
|
}
|
|
1833
1804
|
});
|
|
1834
1805
|
}
|
|
@@ -1881,7 +1852,7 @@ function startAwait(scope, tryBranch = findTryWithPlaceholder(scope)) {
|
|
|
1881
1852
|
countAwait(awaitCounter, tryBranch, (_) => {
|
|
1882
1853
|
(tryBranch[PlaceholderBranch] = createAndSetupBranch(tryBranch[Global], tryBranch[PlaceholderContent](), tryBranch["_"], tryBranch[StartNode].parentNode))[TryBranch] = tryBranch;
|
|
1883
1854
|
insertBranchBefore(tryBranch[PlaceholderBranch], tryBranch[StartNode].parentNode, tryBranch[StartNode]);
|
|
1884
|
-
|
|
1855
|
+
detachBranch(tryBranch);
|
|
1885
1856
|
});
|
|
1886
1857
|
return awaitCounter;
|
|
1887
1858
|
}
|
|
@@ -1928,7 +1899,7 @@ function dismissPlaceholder(tryBranch) {
|
|
|
1928
1899
|
const placeholderBranch = tryBranch[PlaceholderBranch];
|
|
1929
1900
|
if (placeholderBranch) {
|
|
1930
1901
|
tryBranch[PlaceholderBranch] = 0;
|
|
1931
|
-
|
|
1902
|
+
insertBranchBefore(tryBranch, placeholderBranch[StartNode].parentNode, placeholderBranch[StartNode]);
|
|
1932
1903
|
removeAndDestroyBranch(placeholderBranch);
|
|
1933
1904
|
}
|
|
1934
1905
|
}
|
|
@@ -1982,7 +1953,7 @@ const _if = /*@__PURE__*/ withBranches((nodeAccessor, ...branchesArgs) => {
|
|
|
1982
1953
|
if (newBranch !== (scope[branchAccessor] ?? (scope["BranchScopes:" + nodeAccessor] && 0))) setBranch(scope, nodeAccessor, branches[scope[branchAccessor] = newBranch], createAndSetupBranch);
|
|
1983
1954
|
};
|
|
1984
1955
|
});
|
|
1985
|
-
const _show = /*@__PURE__*/ withBranches((nodeAccessor, startNodeAccessor
|
|
1956
|
+
const _show = /*@__PURE__*/ withBranches((nodeAccessor, startNodeAccessor) => {
|
|
1986
1957
|
const rangeAccessor = BranchScopes$1 + nodeAccessor;
|
|
1987
1958
|
return (scope, display) => {
|
|
1988
1959
|
const referenceNode = scope[nodeAccessor];
|
|
@@ -1991,27 +1962,16 @@ const _show = /*@__PURE__*/ withBranches((nodeAccessor, startNodeAccessor, endNo
|
|
|
1991
1962
|
let range = scope[rangeAccessor];
|
|
1992
1963
|
if (!range) {
|
|
1993
1964
|
range = scope[rangeAccessor] = {};
|
|
1994
|
-
range[StartNode] = onlyChild ? parentNode.firstChild : scope[startNodeAccessor];
|
|
1995
|
-
range[EndNode] = onlyChild ? parentNode.lastChild : endNodeAccessor === void 0 ? referenceNode.previousSibling : scope[endNodeAccessor];
|
|
1965
|
+
range[StartNode] = onlyChild ? parentNode.insertBefore(new Text(), parentNode.firstChild) : startNodeAccessor ? scope[startNodeAccessor] : referenceNode.previousSibling;
|
|
1996
1966
|
}
|
|
1997
|
-
|
|
1998
|
-
if (range["#Id"] && startNode
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
range[EndNode] =
|
|
2004
|
-
|
|
2005
|
-
}
|
|
2006
|
-
const inDom = onlyChild ? !!parentNode.firstChild : startNode.parentNode === parentNode;
|
|
2007
|
-
if (display) {
|
|
2008
|
-
if (!inDom) insertBranchBefore(range, parentNode, onlyChild ? null : referenceNode);
|
|
2009
|
-
} else if (inDom) {
|
|
2010
|
-
if (onlyChild) {
|
|
2011
|
-
range[StartNode] = parentNode.firstChild;
|
|
2012
|
-
range[EndNode] = parentNode.lastChild;
|
|
2013
|
-
}
|
|
2014
|
-
tempDetachBranch(range);
|
|
1967
|
+
const startNode = range[StartNode];
|
|
1968
|
+
if (range["#Id"] && startNode.tagName === "T") {
|
|
1969
|
+
if (display) startNode.replaceWith(range[StartNode] = new Text(), ...startNode.childNodes);
|
|
1970
|
+
} else if (display) {
|
|
1971
|
+
if (startNode.parentNode !== parentNode) parentNode.insertBefore(startNode.parentNode, onlyChild ? null : referenceNode);
|
|
1972
|
+
} else if (startNode.parentNode === parentNode) {
|
|
1973
|
+
range[EndNode] = onlyChild ? parentNode.lastChild : referenceNode.previousSibling;
|
|
1974
|
+
detachBranch(range);
|
|
2015
1975
|
}
|
|
2016
1976
|
};
|
|
2017
1977
|
});
|
|
@@ -2238,7 +2198,10 @@ function reorderKeyed(newScopes, start, newEnd, parentNode, afterReference) {
|
|
|
2238
2198
|
}
|
|
2239
2199
|
for (let i = diffLen; i--;) {
|
|
2240
2200
|
if (~tail && i === tails[tail]) tail--;
|
|
2241
|
-
else
|
|
2201
|
+
else {
|
|
2202
|
+
if (~sources[i]) detachBranch(newScopes[start + i]);
|
|
2203
|
+
insertBranchBefore(newScopes[start + i], parentNode, afterReference);
|
|
2204
|
+
}
|
|
2242
2205
|
afterReference = newScopes[start + i][StartNode];
|
|
2243
2206
|
}
|
|
2244
2207
|
}
|
|
@@ -2248,7 +2211,6 @@ function bySecondArg(_item, index) {
|
|
|
2248
2211
|
function byFirstArg(name) {
|
|
2249
2212
|
return name;
|
|
2250
2213
|
}
|
|
2251
|
-
//#endregion
|
|
2252
2214
|
Object.defineProperty(exports, "$signal", {
|
|
2253
2215
|
enumerable: true,
|
|
2254
2216
|
get: function() {
|
|
@@ -3041,12 +3003,6 @@ Object.defineProperty(exports, "insertBranchBefore", {
|
|
|
3041
3003
|
return insertBranchBefore;
|
|
3042
3004
|
}
|
|
3043
3005
|
});
|
|
3044
|
-
Object.defineProperty(exports, "insertChildNodes", {
|
|
3045
|
-
enumerable: true,
|
|
3046
|
-
get: function() {
|
|
3047
|
-
return insertChildNodes;
|
|
3048
|
-
}
|
|
3049
|
-
});
|
|
3050
3006
|
Object.defineProperty(exports, "installBranchRenders", {
|
|
3051
3007
|
enumerable: true,
|
|
3052
3008
|
get: function() {
|
|
@@ -3167,12 +3123,6 @@ Object.defineProperty(exports, "syncGen", {
|
|
|
3167
3123
|
return syncGen;
|
|
3168
3124
|
}
|
|
3169
3125
|
});
|
|
3170
|
-
Object.defineProperty(exports, "toInsertNode", {
|
|
3171
|
-
enumerable: true,
|
|
3172
|
-
get: function() {
|
|
3173
|
-
return toInsertNode;
|
|
3174
|
-
}
|
|
3175
|
-
});
|
|
3176
3126
|
Object.defineProperty(exports, "withBranches", {
|
|
3177
3127
|
enumerable: true,
|
|
3178
3128
|
get: function() {
|
package/dist/debug/dom.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_control_flow = require("./dom-
|
|
4
|
-
|
|
3
|
+
const require_control_flow = require("./dom-DNB5yq3U.js");
|
|
4
|
+
// src/common/attr-tag.ts
|
|
5
5
|
const empty = [];
|
|
6
6
|
const rest = Symbol("Attribute Tag");
|
|
7
7
|
function attrTag(attrs) {
|
|
@@ -21,12 +21,10 @@ function* attrTagIterator() {
|
|
|
21
21
|
yield this;
|
|
22
22
|
yield* this[rest];
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
//#region src/common/compat-meta.ts
|
|
24
|
+
// src/common/compat-meta.ts
|
|
26
25
|
const SET_SCOPE_REGISTER_ID = "$compat_setScope";
|
|
27
26
|
const RENDER_BODY_ID = "$compat_renderBody";
|
|
28
|
-
|
|
29
|
-
//#region src/dom/compat.ts
|
|
27
|
+
// src/dom/compat.ts
|
|
30
28
|
const classIdToBranch = /* @__PURE__ */ new Map();
|
|
31
29
|
let classEventResolver;
|
|
32
30
|
const scopesByRender = /* @__PURE__ */ new WeakMap();
|
|
@@ -83,7 +81,7 @@ const compat = {
|
|
|
83
81
|
if (this.scope) require_control_flow.destroyBranch(this.scope);
|
|
84
82
|
},
|
|
85
83
|
resolveRegistered(value, $global) {
|
|
86
|
-
if (Array.isArray(value) && typeof value[0] === "string") return require_control_flow.getRegisteredWithScope(
|
|
84
|
+
if (Array.isArray(value) && typeof value[0] === "string") return require_control_flow.getRegisteredWithScope(getRenderScopes($global)?.[value[1]], value[0]);
|
|
87
85
|
return value;
|
|
88
86
|
},
|
|
89
87
|
createRenderer(params, clone) {
|
|
@@ -117,11 +115,10 @@ const compat = {
|
|
|
117
115
|
renderer[require_control_flow.Params]?.(branch, renderer._ ? args[0] : args);
|
|
118
116
|
};
|
|
119
117
|
component.effects = require_control_flow.rendering ? renderBranch() : require_control_flow.prepareEffects(renderBranch);
|
|
120
|
-
if (created) return
|
|
118
|
+
if (created) return branch["#StartNode"].parentNode || branch["#StartNode"];
|
|
121
119
|
}
|
|
122
120
|
};
|
|
123
|
-
|
|
124
|
-
//#region src/dom/template.ts
|
|
121
|
+
// src/dom/template.ts
|
|
125
122
|
const _template = (id, template, walks, setup, inputSignal) => {
|
|
126
123
|
const renderer = require_control_flow._content(id, template, walks, setup, inputSignal)();
|
|
127
124
|
renderer.mount = mount;
|
|
@@ -171,7 +168,7 @@ function mount(input = {}, reference, position) {
|
|
|
171
168
|
this[require_control_flow.Setup]?.(branch);
|
|
172
169
|
args?.(branch, input);
|
|
173
170
|
});
|
|
174
|
-
require_control_flow.
|
|
171
|
+
require_control_flow.insertBranchBefore(branch, parentNode, nextSibling);
|
|
175
172
|
require_control_flow.runEffects(effects);
|
|
176
173
|
return {
|
|
177
174
|
get value() {
|
|
@@ -193,8 +190,7 @@ function mount(input = {}, reference, position) {
|
|
|
193
190
|
}
|
|
194
191
|
};
|
|
195
192
|
}
|
|
196
|
-
|
|
197
|
-
//#region src/dom/load.ts
|
|
193
|
+
// src/dom/load.ts
|
|
198
194
|
const noop = (_) => 0;
|
|
199
195
|
function _load_template(id, load) {
|
|
200
196
|
let pending;
|
|
@@ -294,7 +290,6 @@ function _load_race_trigger(...triggers) {
|
|
|
294
290
|
function getSelectorOrResolve(selector, resolve) {
|
|
295
291
|
return document.querySelector(selector) || (console.warn(`A lazy load trigger could not find an element matching "${selector}". The module was loaded immediately.`), resolve());
|
|
296
292
|
}
|
|
297
|
-
//#endregion
|
|
298
293
|
exports.$signal = require_control_flow.$signal;
|
|
299
294
|
exports.$signalReset = require_control_flow.$signalReset;
|
|
300
295
|
exports._assert_class_toggles = require_control_flow._assert_class_toggles;
|
package/dist/debug/dom.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as _attr_style_items,
|
|
2
|
-
|
|
1
|
+
import { $ as _attr_style_items, A as _attr_input_value, An as Setup, At as _closure_get, B as _controllable_select, Bt as _let, C as _attr_details_or_dialog_open_script, Ct as getRegisteredWithScope, D as _attr_input_checkedValue_script, Dn as Owner, Dt as readyFailed, E as _attr_input_checkedValue_default, En as LocalClosures, Et as ready, F as _attr_select_value, Ft as _global_read, G as _attr_class, Gn as StartNode, Gt as _script, Ht as _or, I as _attr_select_value_default, In as EndNode, It as _hoist, J as _attr_class_names, Jt as _assert_init, K as _attr_class_item, Kn as TagVariable, Kt as _var, L as _attr_select_value_script, Lt as _hoist_resume, M as _attr_input_value_default, Mt as _el_read, N as _attr_input_value_dynamic_default, Nt as _for_closure, O as _attr_input_checked_default, On as Params, P as _attr_input_value_script, Pt as _for_selector, Q as _attr_style_item, Qt as syncGen, R as _controllable_input, Rn as Global, Rt as _id, S as _attr_details_or_dialog_open_default, Sn as _call, St as _var_resume, T as _attr_input_checkedValue, Tn as Lazy, Tt as initEmbedded, Ut as _return, V as _controllable_textarea, Vt as _let_change, W as _attr, Wt as _return_change, X as _attr_nonce, Xt as insertBranchBefore, Y as _attr_content, Yt as destroyBranch, Z as _attr_style, Zt as removeAndDestroyBranch, _ as patchDynamicTag, _n as forTo, _t as createBranch, a as _for_in, at as _html, b as startAwait, bn as _assert_hoist, bt as _el, c as _for_to, cn as queueAsyncRender, ct as _style_shell, d as _for_until_unkeyed, dn as rendering, dt as _to_text, et as _attrs, f as _if, fn as run, ft as _content, gn as forOf, gt as createAndSetupBranch, hn as forIn, ht as _return_setup, i as _dynamic_tag_content, it as _attrs_script, j as _attr_input_value_attribute_default, jt as _const, k as _attr_input_checked_script, kt as _closure, l as _for_to_unkeyed, ln as queueEffect, lt as _text, m as _try, mn as runId, mt as _content_resume, n as _await_promise, nn as $signal, nt as _attrs_partial, o as _for_of, ot as _lifecycle, p as _show, pn as runEffects, pt as _content_closures, q as _attr_class_items, qt as _var_change, r as _dynamic_tag, rn as $signalReset, rt as _attrs_partial_content, s as _for_of_unkeyed, sn as prepareEffects, st as _style_rule_item, t as _await_content, tn as _on, tt as _attrs_content, u as _for_until, un as queueRender, ut as _text_content, v as renderCatch, vn as forUntil, vt as setupBranch, w as _attr_input_checked, wn as Clone, wt as init, x as _attr_details_or_dialog_open, xn as _hoist_read_error, xt as _resumed, yn as _assert_class_toggles, yt as _dynamic_tag_var_resume, z as _controllable_open, zn as Load, zt as _if_closure } from "./dom-C1V5vpFs.mjs";
|
|
2
|
+
// src/common/attr-tag.ts
|
|
3
3
|
const empty = [];
|
|
4
4
|
const rest = Symbol("Attribute Tag");
|
|
5
5
|
function attrTag(attrs) {
|
|
@@ -19,12 +19,10 @@ function* attrTagIterator() {
|
|
|
19
19
|
yield this;
|
|
20
20
|
yield* this[rest];
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
//#region src/common/compat-meta.ts
|
|
22
|
+
// src/common/compat-meta.ts
|
|
24
23
|
const SET_SCOPE_REGISTER_ID = "$compat_setScope";
|
|
25
24
|
const RENDER_BODY_ID = "$compat_renderBody";
|
|
26
|
-
|
|
27
|
-
//#region src/dom/compat.ts
|
|
25
|
+
// src/dom/compat.ts
|
|
28
26
|
const classIdToBranch = /* @__PURE__ */ new Map();
|
|
29
27
|
let classEventResolver;
|
|
30
28
|
const scopesByRender = /* @__PURE__ */ new WeakMap();
|
|
@@ -81,7 +79,7 @@ const compat = {
|
|
|
81
79
|
if (this.scope) destroyBranch(this.scope);
|
|
82
80
|
},
|
|
83
81
|
resolveRegistered(value, $global) {
|
|
84
|
-
if (Array.isArray(value) && typeof value[0] === "string") return getRegisteredWithScope(
|
|
82
|
+
if (Array.isArray(value) && typeof value[0] === "string") return getRegisteredWithScope(getRenderScopes($global)?.[value[1]], value[0]);
|
|
85
83
|
return value;
|
|
86
84
|
},
|
|
87
85
|
createRenderer(params, clone) {
|
|
@@ -115,11 +113,10 @@ const compat = {
|
|
|
115
113
|
renderer[Params]?.(branch, renderer._ ? args[0] : args);
|
|
116
114
|
};
|
|
117
115
|
component.effects = rendering ? renderBranch() : prepareEffects(renderBranch);
|
|
118
|
-
if (created) return
|
|
116
|
+
if (created) return branch["#StartNode"].parentNode || branch["#StartNode"];
|
|
119
117
|
}
|
|
120
118
|
};
|
|
121
|
-
|
|
122
|
-
//#region src/dom/template.ts
|
|
119
|
+
// src/dom/template.ts
|
|
123
120
|
const _template = (id, template, walks, setup, inputSignal) => {
|
|
124
121
|
const renderer = _content(id, template, walks, setup, inputSignal)();
|
|
125
122
|
renderer.mount = mount;
|
|
@@ -169,7 +166,7 @@ function mount(input = {}, reference, position) {
|
|
|
169
166
|
this[Setup]?.(branch);
|
|
170
167
|
args?.(branch, input);
|
|
171
168
|
});
|
|
172
|
-
|
|
169
|
+
insertBranchBefore(branch, parentNode, nextSibling);
|
|
173
170
|
runEffects(effects);
|
|
174
171
|
return {
|
|
175
172
|
get value() {
|
|
@@ -191,8 +188,7 @@ function mount(input = {}, reference, position) {
|
|
|
191
188
|
}
|
|
192
189
|
};
|
|
193
190
|
}
|
|
194
|
-
|
|
195
|
-
//#region src/dom/load.ts
|
|
191
|
+
// src/dom/load.ts
|
|
196
192
|
const noop = (_) => 0;
|
|
197
193
|
function _load_template(id, load) {
|
|
198
194
|
let pending;
|
|
@@ -292,5 +288,4 @@ function _load_race_trigger(...triggers) {
|
|
|
292
288
|
function getSelectorOrResolve(selector, resolve) {
|
|
293
289
|
return document.querySelector(selector) || (console.warn(`A lazy load trigger could not find an element matching "${selector}". The module was loaded immediately.`), resolve());
|
|
294
290
|
}
|
|
295
|
-
//#endregion
|
|
296
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, compat, forIn, forOf, forTo, forUntil, init, initEmbedded, ready, readyFailed, run };
|