marko 6.3.55 → 6.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cheatsheet.md +3 -2
- package/dist/common/accessor.d.ts +3 -0
- package/dist/common/accessor.debug.d.ts +3 -0
- package/dist/common/constants/accessor-prefix.d.ts +1 -0
- package/dist/common/constants/accessor-prefix.debug.d.ts +1 -0
- package/dist/common/constants/accessor-prop.d.ts +3 -0
- package/dist/common/constants/accessor-prop.debug.d.ts +3 -0
- package/dist/common/constants/closure-scopes-prop.d.ts +4 -0
- package/dist/common/constants/closure-scopes-prop.debug.d.ts +4 -0
- package/dist/common/types.d.ts +9 -3
- package/dist/debug/dom/catch.feat.js +12 -14
- package/dist/debug/dom/catch.feat.mjs +12 -14
- package/dist/debug/dom/controllable-input.feat.js +1 -1
- package/dist/debug/dom/controllable-input.feat.mjs +1 -1
- package/dist/debug/dom/controllable-open.feat.js +1 -1
- package/dist/debug/dom/controllable-open.feat.mjs +1 -1
- package/dist/debug/dom/controllable-select.feat.js +1 -1
- package/dist/debug/dom/controllable-select.feat.mjs +1 -1
- package/dist/debug/dom/controllable-textarea.feat.js +1 -1
- package/dist/debug/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/debug/dom/controllable.feat.js +1 -1
- package/dist/debug/dom/controllable.feat.mjs +1 -1
- package/dist/debug/dom/dynamic-tag-script.feat.js +1 -1
- package/dist/debug/dom/dynamic-tag-script.feat.mjs +1 -1
- package/dist/debug/dom/dynamic-tag-var.feat.js +1 -1
- package/dist/debug/dom/dynamic-tag-var.feat.mjs +1 -1
- package/dist/debug/dom/lazy.feat.js +4 -0
- package/dist/debug/dom/lazy.feat.mjs +4 -0
- package/dist/debug/dom/placeholder.feat.js +1 -1
- package/dist/debug/dom/placeholder.feat.mjs +1 -1
- package/dist/debug/{dom-CI0Vojyk.js → dom-BRO5aArp.js} +248 -193
- package/dist/debug/{dom-tl43c2wO.mjs → dom-Btj2QJhk.mjs} +225 -176
- package/dist/debug/dom.js +15 -13
- package/dist/debug/dom.mjs +15 -13
- package/dist/debug/html.js +605 -523
- package/dist/debug/html.mjs +604 -524
- package/dist/dom/abort-signal.d.ts +2 -0
- package/dist/dom/catch.feat.js +6 -7
- package/dist/dom/catch.feat.mjs +5 -7
- package/dist/dom/control-flow.d.ts +3 -5
- package/dist/dom/controllable-input.feat.js +3 -2
- package/dist/dom/controllable-input.feat.mjs +1 -1
- package/dist/dom/controllable-open.feat.js +3 -2
- package/dist/dom/controllable-open.feat.mjs +1 -1
- package/dist/dom/controllable-select.feat.js +3 -2
- package/dist/dom/controllable-select.feat.mjs +1 -1
- package/dist/dom/controllable-textarea.feat.js +3 -2
- package/dist/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/dom/controllable.feat.js +3 -2
- package/dist/dom/controllable.feat.mjs +1 -1
- package/dist/dom/dynamic-tag-script.feat.js +3 -2
- package/dist/dom/dynamic-tag-script.feat.mjs +1 -1
- package/dist/dom/dynamic-tag-var.feat.js +2 -1
- package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
- package/dist/dom/lazy.feat.d.ts +1 -0
- package/dist/dom/lazy.feat.js +4 -0
- package/dist/dom/lazy.feat.mjs +4 -0
- package/dist/dom/load.d.ts +3 -3
- package/dist/dom/placeholder.feat.js +4 -3
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/dom/queue.d.ts +2 -4
- package/dist/dom/resume.d.ts +2 -2
- package/dist/dom/scope.d.ts +0 -1
- package/dist/dom/signals.d.ts +1 -1
- package/dist/{dom-4udEPZaj.mjs → dom-B-v8Gw6T.mjs} +122 -92
- package/dist/{dom-C1mr-TA7.js → dom-BSsI9OPC.js} +218 -187
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +59 -56
- package/dist/dom.mjs +35 -33
- package/dist/html/attrs.d.ts +2 -0
- package/dist/html/writer.d.ts +5 -11
- package/dist/html.d.ts +1 -1
- package/dist/html.js +367 -327
- package/dist/html.mjs +366 -327
- package/dist/translator/index.js +866 -748
- package/dist/translator/util/binding-has-prop.d.ts +2 -0
- package/dist/translator/util/entry-builder.d.ts +2 -0
- package/dist/translator/util/generate-uid.d.ts +5 -0
- package/dist/translator/util/optional.d.ts +1 -3
- package/dist/translator/util/references.d.ts +6 -2
- package/dist/translator/util/runtime.d.ts +3 -3
- package/dist/translator/util/sections.d.ts +8 -2
- package/dist/translator/util/serialize-reasons.d.ts +3 -1
- package/dist/translator/util/setup-work.d.ts +5 -0
- package/dist/translator/util/signals.d.ts +5 -7
- package/dist/translator/util/translate-attrs.d.ts +2 -1
- package/dist/translator/visitors/tag/native-tag.d.ts +1 -0
- package/package.json +3 -3
- package/tags-html.d.ts +4 -3
- package/dist/translator/util/setup-statements.d.ts +0 -5
|
@@ -14,6 +14,7 @@ const KeyedScopes = "KeyedScopes:";
|
|
|
14
14
|
const Lifecycle = "Lifecycle:";
|
|
15
15
|
const Promise$1 = "Promise:";
|
|
16
16
|
const TagVariableChange$1 = "TagVariableChange:";
|
|
17
|
+
const TryBranch$1 = "TryBranch:";
|
|
17
18
|
//#endregion
|
|
18
19
|
//#region src/common/constants/accessor-prop.debug.ts
|
|
19
20
|
const Global = "$global";
|
|
@@ -32,15 +33,21 @@ const Load = "#Load";
|
|
|
32
33
|
const LoopKey = "#LoopKey";
|
|
33
34
|
const ParentBranch = "#ParentBranch";
|
|
34
35
|
const PendingEffects = "#PendingEffects";
|
|
36
|
+
const PendingEffectScopes = "#PendingEffectScopes";
|
|
35
37
|
const PendingRenders = "#PendingRenders";
|
|
36
38
|
const PendingScopes = "#PendingScopes";
|
|
37
39
|
const PlaceholderBranch = "#PlaceholderBranch";
|
|
38
40
|
const PlaceholderContent = "#PlaceholderContent";
|
|
39
41
|
const Renderer = "#Renderer";
|
|
42
|
+
const ReturnValue = "#ReturnValue";
|
|
40
43
|
const StartNode = "#StartNode";
|
|
41
44
|
const Subscriptions = "#Subscriptions";
|
|
42
45
|
const TagVariable = "#TagVariable";
|
|
43
46
|
const TagVariableChange = "#TagVariableChange";
|
|
47
|
+
const TryBranch = "#TryBranch";
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/common/constants/closure-scopes-prop.debug.ts
|
|
50
|
+
const Changed = "Changed";
|
|
44
51
|
//#endregion
|
|
45
52
|
//#region src/common/constants/closure-signal-prop.debug.ts
|
|
46
53
|
const ScopeInstancesAccessor = "scopeInstancesAccessor";
|
|
@@ -132,19 +139,21 @@ const toDelimitedString = function toDelimitedString(val, delimiter, stringify)
|
|
|
132
139
|
let str = "";
|
|
133
140
|
let sep = "";
|
|
134
141
|
let part;
|
|
135
|
-
if (val)
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
if (val) {
|
|
143
|
+
if (typeof val !== "object") str += val;
|
|
144
|
+
else if (Array.isArray(val)) for (const v of val) {
|
|
145
|
+
part = toDelimitedString(v, delimiter, stringify);
|
|
146
|
+
if (part) {
|
|
147
|
+
str += sep + part;
|
|
148
|
+
sep = delimiter;
|
|
149
|
+
}
|
|
141
150
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
151
|
+
else for (const name in val) {
|
|
152
|
+
part = stringify(name, val[name]);
|
|
153
|
+
if (part) {
|
|
154
|
+
str += sep + part;
|
|
155
|
+
sep = delimiter;
|
|
156
|
+
}
|
|
148
157
|
}
|
|
149
158
|
}
|
|
150
159
|
return str;
|
|
@@ -245,7 +254,7 @@ function _hoist_read_error() {
|
|
|
245
254
|
throw new Error("Hoisted values can only be read in scripts and event handlers.");
|
|
246
255
|
}
|
|
247
256
|
function _assert_hoist(value) {
|
|
248
|
-
if (typeof value !== "function") throw new Error(`Hoisted values must be functions, received type "${typeof value}".`);
|
|
257
|
+
if (value !== void 0 && typeof value !== "function") throw new Error(`Hoisted values must be functions, received type "${typeof value}".`);
|
|
249
258
|
}
|
|
250
259
|
function assertExclusiveAttrs(attrs, onError = throwErr) {
|
|
251
260
|
if (attrs) {
|
|
@@ -317,8 +326,6 @@ function forUntil(until, from, step, cb) {
|
|
|
317
326
|
//#region src/dom/queue.ts
|
|
318
327
|
let rendering;
|
|
319
328
|
let runId = 2;
|
|
320
|
-
const caughtError = /* @__PURE__ */ new WeakSet();
|
|
321
|
-
const placeholderShown = /* @__PURE__ */ new WeakSet();
|
|
322
329
|
let pendingEffects = [];
|
|
323
330
|
let pendingRenders = [];
|
|
324
331
|
const scopeKeyOffset = 1e6;
|
|
@@ -395,10 +402,10 @@ let runRender = (render) => {
|
|
|
395
402
|
if (!branchesEnabled || render["scope"]["#ClosestBranch"]?.["#Gen"] !== 0) render[Signal](render[Scope], render[Value]);
|
|
396
403
|
};
|
|
397
404
|
let catchEnabled;
|
|
398
|
-
function installCatch(
|
|
405
|
+
function installCatch(catchEffects, wrapRender) {
|
|
399
406
|
catchEnabled = 1;
|
|
400
407
|
withBranches();
|
|
401
|
-
runEffects =
|
|
408
|
+
runEffects = catchEffects;
|
|
402
409
|
runRender = wrapRender(runRender);
|
|
403
410
|
}
|
|
404
411
|
function runRenders() {
|
|
@@ -439,6 +446,12 @@ function $signal(scope, id) {
|
|
|
439
446
|
trackCleanup(scope);
|
|
440
447
|
return ((scope[AbortControllers] ||= {})[id] ||= new AbortController()).signal;
|
|
441
448
|
}
|
|
449
|
+
/** Runs `abort` as a destroyed scope's `$signal` would fire, without creating one. */
|
|
450
|
+
function trackAbort(scope, id, abort) {
|
|
451
|
+
abortsEnabled = 1;
|
|
452
|
+
trackCleanup(scope);
|
|
453
|
+
(scope[AbortControllers] ||= {})[id] = { abort };
|
|
454
|
+
}
|
|
442
455
|
/** Enrols `scope` with its branch so destroying the branch cleans it up. */
|
|
443
456
|
function trackCleanup(scope, subscribers) {
|
|
444
457
|
const branch = scope[ClosestBranch];
|
|
@@ -459,8 +472,10 @@ function toArray(opt) {
|
|
|
459
472
|
return opt ? Array.isArray(opt) ? opt : [opt] : [];
|
|
460
473
|
}
|
|
461
474
|
function forEach(opt, cb) {
|
|
462
|
-
if (opt)
|
|
463
|
-
|
|
475
|
+
if (opt) {
|
|
476
|
+
if (Array.isArray(opt)) for (const item of opt) cb(item);
|
|
477
|
+
else cb(opt);
|
|
478
|
+
}
|
|
464
479
|
}
|
|
465
480
|
function push(opt, item) {
|
|
466
481
|
return opt ? Array.isArray(opt) ? (opt.push(item), opt) : [opt, item] : item;
|
|
@@ -535,11 +550,6 @@ function collectScopes(fn) {
|
|
|
535
550
|
function skipScope() {
|
|
536
551
|
return nextScopeId++;
|
|
537
552
|
}
|
|
538
|
-
function findBranchWithKey(scope, key) {
|
|
539
|
-
let branch = scope[ClosestBranch];
|
|
540
|
-
while (branch && branch[key] == null) branch = branch[ParentBranch];
|
|
541
|
-
return branch;
|
|
542
|
-
}
|
|
543
553
|
function destroyBranch(branch) {
|
|
544
554
|
branch[ParentBranch]?.[BranchScopes]?.delete(branch);
|
|
545
555
|
destroyNestedScopes(branch);
|
|
@@ -630,11 +640,12 @@ function _let_change(id, fn) {
|
|
|
630
640
|
const valueChangeAccessor = TagVariableChange$1 + valueAccessor;
|
|
631
641
|
const base = _let(id, fn);
|
|
632
642
|
return (scope, value, valueChange) => {
|
|
633
|
-
if (rendering)
|
|
634
|
-
scope[
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
643
|
+
if (rendering) {
|
|
644
|
+
if ((scope[valueChangeAccessor] = valueChange) && (scope[valueAccessor] !== value || !(valueAccessor in scope))) {
|
|
645
|
+
scope[valueAccessor] = value;
|
|
646
|
+
fn?.(scope);
|
|
647
|
+
} else base(scope, value);
|
|
648
|
+
} else if (scope[valueChangeAccessor]) scope[valueChangeAccessor](value);
|
|
638
649
|
else base(scope, value);
|
|
639
650
|
return value;
|
|
640
651
|
};
|
|
@@ -649,10 +660,11 @@ function _const(valueAccessor, fn) {
|
|
|
649
660
|
}
|
|
650
661
|
function _or(id, fn, defaultPending = 1, scopeIdAccessor = "#Id") {
|
|
651
662
|
return (scope) => {
|
|
652
|
-
if (scope["#Gen"] === runId)
|
|
653
|
-
if (
|
|
654
|
-
|
|
655
|
-
|
|
663
|
+
if (scope["#Gen"] === runId) {
|
|
664
|
+
if (~id in scope) {
|
|
665
|
+
if (!--scope[~id]) fn(scope);
|
|
666
|
+
} else scope[~id] = defaultPending;
|
|
667
|
+
} else queueRender(scope, fn, id, 0, scope[scopeIdAccessor]);
|
|
656
668
|
};
|
|
657
669
|
}
|
|
658
670
|
function _for_closure(ownerLoopNodeAccessor, fn) {
|
|
@@ -726,23 +738,22 @@ function _closure(...closureSignals) {
|
|
|
726
738
|
for (let i = closureSignals.length; i--;) closureSignals[i][Index] = i;
|
|
727
739
|
return (scope) => {
|
|
728
740
|
if (scope[scopeInstances]) {
|
|
741
|
+
scope[scopeInstances][Changed] = 1;
|
|
729
742
|
for (const childScope of scope[scopeInstances]) if (childScope["#Gen"] > 0 && childScope["#Gen"] < runId) queueRender(childScope, closureSignals[childScope[signalIndex] || 0], -1);
|
|
730
743
|
}
|
|
731
744
|
};
|
|
732
745
|
}
|
|
733
|
-
function _closure_get(valueAccessor, fn, getOwnerScope, resumeId
|
|
746
|
+
function _closure_get(valueAccessor, fn, getOwnerScope, resumeId) {
|
|
734
747
|
const closureSignal = ((scope, resumed) => {
|
|
735
748
|
const ownerScope = getOwnerScope ? getOwnerScope(scope) : scope["_"];
|
|
736
749
|
scope[closureSignal[SignalIndexAccessor]] = closureSignal[Index];
|
|
737
|
-
if (!resumed
|
|
750
|
+
if (!resumed) fn(scope);
|
|
751
|
+
else if (ownerScope[closureSignal["scopeInstancesAccessor"]]["Changed"]) queueAsyncRender(scope, closureSignal);
|
|
738
752
|
subscribeToScopeSet(ownerScope, closureSignal[ScopeInstancesAccessor], scope);
|
|
739
753
|
});
|
|
740
754
|
closureSignal[ScopeInstancesAccessor] = ClosureScopes + valueAccessor;
|
|
741
755
|
closureSignal[SignalIndexAccessor] = ClosureSignalIndex + valueAccessor;
|
|
742
|
-
if (resumeId)
|
|
743
|
-
ownerValueAccessor = valueAccessor;
|
|
744
|
-
_resumed[resumeId] = (scope) => closureSignal(scope, 1);
|
|
745
|
-
}
|
|
756
|
+
if (resumeId) _resumed[resumeId] = (scope) => closureSignal(scope, 1);
|
|
746
757
|
return closureSignal;
|
|
747
758
|
}
|
|
748
759
|
function _child_setup(setup) {
|
|
@@ -753,9 +764,11 @@ function _child_setup(setup) {
|
|
|
753
764
|
return setup;
|
|
754
765
|
}
|
|
755
766
|
function _var(scope, childAccessor, signal) {
|
|
756
|
-
scope[childAccessor]
|
|
767
|
+
const childScope = scope[childAccessor];
|
|
768
|
+
childScope[TagVariable] = (value) => signal(scope, value);
|
|
769
|
+
if ("#ReturnValue" in childScope) signal(scope, childScope[ReturnValue]);
|
|
757
770
|
}
|
|
758
|
-
const _return = (scope, value) => scope[TagVariable]
|
|
771
|
+
const _return = (scope, value) => scope["#TagVariable"] ? scope[TagVariable](value) : scope[ReturnValue] = value;
|
|
759
772
|
function _return_change(scope, changeHandler) {
|
|
760
773
|
scope[TagVariableChange] = changeHandler || void 0;
|
|
761
774
|
}
|
|
@@ -782,7 +795,7 @@ function _script(id, fn) {
|
|
|
782
795
|
};
|
|
783
796
|
}
|
|
784
797
|
function _global_read($global, key) {
|
|
785
|
-
if (!(key in $global)) console.error(`\`$global.${key}\` is not serialized to the client, so this read is \`undefined\`.
|
|
798
|
+
if (!(key in $global)) console.error(`\`$global.${key}\` is not serialized to the client, so this read is \`undefined\`. Serialized globals are embedded in the page: add \`${key}\` to \`serializedGlobals\` at the render call only if it holds no secrets; otherwise copy the field the client needs into its own \`$global\` key and serialize that.`);
|
|
786
799
|
return $global[key];
|
|
787
800
|
}
|
|
788
801
|
function _el_read(value) {
|
|
@@ -791,12 +804,14 @@ function _el_read(value) {
|
|
|
791
804
|
}
|
|
792
805
|
function* traverse(scope, path, args, i = path.length - 1) {
|
|
793
806
|
if (rendering) _hoist_read_error();
|
|
794
|
-
if (scope)
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
807
|
+
if (scope) {
|
|
808
|
+
if (Symbol.iterator in scope) {
|
|
809
|
+
for (const childScope of scope.values()) if (childScope["#Gen"] !== 0) yield* traverse(childScope, path, args, i);
|
|
810
|
+
} else {
|
|
811
|
+
const item = scope[path[i]];
|
|
812
|
+
if (i) yield* traverse(item, path, args, i - 1);
|
|
813
|
+
else yield typeof item === "function" ? item(...args) : item;
|
|
814
|
+
}
|
|
800
815
|
}
|
|
801
816
|
}
|
|
802
817
|
function _hoist(...path) {
|
|
@@ -880,9 +895,8 @@ function readyFailed(readyId) {
|
|
|
880
895
|
(failedIds ||= /* @__PURE__ */ new Set()).add(readyId);
|
|
881
896
|
console.error(`The lazy module for "${readyId}" failed to load; its server-rendered content cannot become interactive.`);
|
|
882
897
|
}
|
|
883
|
-
function withLazy(
|
|
898
|
+
function withLazy() {
|
|
884
899
|
lazyEnabled = 1;
|
|
885
|
-
return runtime;
|
|
886
900
|
}
|
|
887
901
|
function initEmbedded(readyId, runtimeId) {
|
|
888
902
|
if (!embedRenders) {
|
|
@@ -956,7 +970,7 @@ function init(runtimeId = "M") {
|
|
|
956
970
|
setParentBranch(branch, branch[ClosestBranch]);
|
|
957
971
|
if (branch["#AwaitCounter"] = render.p?.[branchId]) branch[AwaitCounter].m = render.m;
|
|
958
972
|
if (singleNode) {
|
|
959
|
-
while (startVisit.previousSibling &&
|
|
973
|
+
while (startVisit.previousSibling && (startVisit = startVisit.previousSibling).nodeType > 1);
|
|
960
974
|
branch["_"] ??= visitScope;
|
|
961
975
|
branch[EndNode] = branch[StartNode] = startVisit;
|
|
962
976
|
if (visitType === "(") branch[getDebugKey(0, startVisit)] = startVisit;
|
|
@@ -1023,6 +1037,7 @@ function init(runtimeId = "M") {
|
|
|
1023
1037
|
let embedAnchor;
|
|
1024
1038
|
serializeContext._ = _resumed;
|
|
1025
1039
|
if (render.m) throw new Error(`Marko rendered multiple times with $global.runtimeId as ${JSON.stringify(runtimeId)} and $global.renderId as ${JSON.stringify(renderId)}. Ensure each render into a page has a unique $global.renderId.`);
|
|
1040
|
+
for (const otherId in curRenders) if (otherId !== renderId && (otherId.startsWith(renderId) || renderId.startsWith(otherId))) console.error(`Marko rendered with $global.runtimeId as ${JSON.stringify(runtimeId)} and $global.renderId as both ${JSON.stringify(otherId)} and ${JSON.stringify(renderId)}, so one render claims the other's resume comments. Ensure no $global.renderId in a page starts another.`);
|
|
1026
1041
|
render.m = (effects) => {
|
|
1027
1042
|
processResumes(render.r, effects);
|
|
1028
1043
|
if (readyIds && render.b) for (let progress = 1; progress;) {
|
|
@@ -1038,13 +1053,14 @@ function init(runtimeId = "M") {
|
|
|
1038
1053
|
visitText = visit.data;
|
|
1039
1054
|
visitType = visitText[lastTokenIndex++];
|
|
1040
1055
|
visitScope = getScope(nextToken());
|
|
1041
|
-
if (dynamicHtmlEnabled && visitType > "%" && visitType <= "'")
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1056
|
+
if (dynamicHtmlEnabled && visitType > "%" && visitType <= "'") {
|
|
1057
|
+
if (visitType === "&") htmlStart = visit;
|
|
1058
|
+
else {
|
|
1059
|
+
visitScope[nextToken()] = htmlStart;
|
|
1060
|
+
visitScope[DynamicHTMLLastChild + lastToken] = visit;
|
|
1061
|
+
if ((branchesEnabled || lazyEnabled) && pending[pending.length - 1] !== visitScope) pending.push(visitScope);
|
|
1062
|
+
}
|
|
1063
|
+
} else if (branchesEnabled && visitType > "'") (visitBranches ||= createVisitBranches())();
|
|
1048
1064
|
else if (lazyEnabled && render.b && visitType > "%") visits[retained++] = visit;
|
|
1049
1065
|
else {
|
|
1050
1066
|
visitScope[nextToken()] = visitType === "%" ? visit.parentNode.insertBefore(new Text(), visit) : visit.previousSibling;
|
|
@@ -1079,7 +1095,7 @@ let isResuming;
|
|
|
1079
1095
|
function runResumeEffects(render) {
|
|
1080
1096
|
try {
|
|
1081
1097
|
isResuming = 1;
|
|
1082
|
-
runEffects(render.m([])
|
|
1098
|
+
runEffects(render.m([]));
|
|
1083
1099
|
} finally {
|
|
1084
1100
|
isResuming = 0;
|
|
1085
1101
|
}
|
|
@@ -1094,7 +1110,7 @@ function _var_resume(id, signal) {
|
|
|
1094
1110
|
function _el(id, accessor) {
|
|
1095
1111
|
return _resumed[id] = (scope) => () => _el_read(scope[accessor]);
|
|
1096
1112
|
}
|
|
1097
|
-
function
|
|
1113
|
+
function _dynamic_tag_var_resume(accessor) {
|
|
1098
1114
|
_resumed[DYNAMIC_TAG_VAR_REGISTER_ID + accessor] = (scope) => () => {
|
|
1099
1115
|
const node = scope[accessor];
|
|
1100
1116
|
return _el_read(node.nodeType === 8 ? node.previousSibling : node);
|
|
@@ -1195,8 +1211,10 @@ function _attr(element, name, value) {
|
|
|
1195
1211
|
setAttribute(element, name, normalizeAttrValue(value));
|
|
1196
1212
|
}
|
|
1197
1213
|
function setAttribute(element, name, value) {
|
|
1198
|
-
if (element.getAttribute(name) != value)
|
|
1199
|
-
|
|
1214
|
+
if (element.getAttribute(name) != value) {
|
|
1215
|
+
if (value === void 0) element.removeAttribute(name);
|
|
1216
|
+
else element.setAttribute(name, value);
|
|
1217
|
+
}
|
|
1200
1218
|
}
|
|
1201
1219
|
function _attr_class(element, value) {
|
|
1202
1220
|
setAttribute(element, "class", toDelimitedString(value, " ", stringifyClassObject) || void 0);
|
|
@@ -1301,7 +1319,6 @@ function attrsInternal(scope, nodeAccessor, nextAttrs, controllable) {
|
|
|
1301
1319
|
assertValidAttrName(name);
|
|
1302
1320
|
if (isEventHandler(name)) (events ||= scope[EventAttributes + nodeAccessor] = {})[getEventHandlerName(name)] = value;
|
|
1303
1321
|
else if (!(skip?.test(name) || name === "content" && el.tagName !== "META")) _attr(el, name, value);
|
|
1304
|
-
break;
|
|
1305
1322
|
}
|
|
1306
1323
|
}
|
|
1307
1324
|
}
|
|
@@ -1334,8 +1351,10 @@ const _html = /*@__PURE__*/ withDynamicHtml(function _html(scope, value, accesso
|
|
|
1334
1351
|
});
|
|
1335
1352
|
function normalizeClientRender(value) {
|
|
1336
1353
|
const renderer = normalizeDynamicRenderer(value);
|
|
1337
|
-
if (renderer)
|
|
1338
|
-
|
|
1354
|
+
if (renderer) {
|
|
1355
|
+
if (renderer["id"]) return renderer;
|
|
1356
|
+
else throw new Error(`Invalid \`content\` attribute. Received ${typeof value}`);
|
|
1357
|
+
}
|
|
1339
1358
|
}
|
|
1340
1359
|
function normalizeAttrValue(value) {
|
|
1341
1360
|
if (isNotVoid(value)) return value === true ? "" : value + "";
|
|
@@ -1353,7 +1372,7 @@ function _lifecycle(scope, thisObj, index = 0) {
|
|
|
1353
1372
|
Object.assign(thisObj, thisObj.onMount?.());
|
|
1354
1373
|
for (const prop in snapshot) if (!Object.is(snapshot[prop], thisObj[prop])) throw new Error(`Tried to overwrite existing property "${prop}" in <lifecycle> onMount.`);
|
|
1355
1374
|
}
|
|
1356
|
-
|
|
1375
|
+
trackAbort(scope, accessor, () => thisObj.onDestroy?.());
|
|
1357
1376
|
}
|
|
1358
1377
|
}
|
|
1359
1378
|
function removeChildNodes(startNode, endNode) {
|
|
@@ -1455,8 +1474,10 @@ function _attr_input_checkedValue(scope, nodeAccessor, checkedValue, checkedValu
|
|
|
1455
1474
|
}
|
|
1456
1475
|
function _attr_input_checkedValue_script(scope, nodeAccessor) {
|
|
1457
1476
|
const el = scope[nodeAccessor];
|
|
1458
|
-
if (isResuming && el.defaultChecked)
|
|
1459
|
-
|
|
1477
|
+
if (isResuming && el.defaultChecked) {
|
|
1478
|
+
if (scope["ControlledValue:" + nodeAccessor]) scope[ControlledValue + nodeAccessor].push(el.value);
|
|
1479
|
+
else scope[ControlledValue + nodeAccessor] = el.value;
|
|
1480
|
+
}
|
|
1460
1481
|
syncControllableFormInput(el, hasCheckboxChanged, () => {
|
|
1461
1482
|
const checkedValueChange = scope[ControlledHandler + nodeAccessor];
|
|
1462
1483
|
if (checkedValueChange) {
|
|
@@ -1565,14 +1586,16 @@ function _attr_select_value_script(scope, nodeAccessor) {
|
|
|
1565
1586
|
run();
|
|
1566
1587
|
}
|
|
1567
1588
|
};
|
|
1568
|
-
if (isResuming)
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1589
|
+
if (isResuming) {
|
|
1590
|
+
if (el.multiple) {
|
|
1591
|
+
scope[ControlledValue + nodeAccessor] = [];
|
|
1592
|
+
for (const opt of el.options) if (opt.defaultSelected) scope[ControlledValue + nodeAccessor].push(opt.value);
|
|
1593
|
+
} else {
|
|
1594
|
+
scope[ControlledValue + nodeAccessor] = "";
|
|
1595
|
+
for (const opt of el.options) if (opt.defaultSelected) {
|
|
1596
|
+
scope[ControlledValue + nodeAccessor] = opt.value;
|
|
1597
|
+
break;
|
|
1598
|
+
}
|
|
1576
1599
|
}
|
|
1577
1600
|
}
|
|
1578
1601
|
syncControllableFormInput(el, hasSelectChanged, onChange);
|
|
@@ -1694,6 +1717,7 @@ function _controllable_open(scope, nodeAccessor, nextAttrs) {
|
|
|
1694
1717
|
function _await_promise(nodeAccessor, params) {
|
|
1695
1718
|
const promiseAccessor = Promise$1 + nodeAccessor;
|
|
1696
1719
|
const branchAccessor = BranchScopes$1 + nodeAccessor;
|
|
1720
|
+
const tryAccessor = TryBranch$1 + nodeAccessor;
|
|
1697
1721
|
const resolveAwait = (scope, referenceNode, value) => {
|
|
1698
1722
|
const awaitBranch = scope[branchAccessor];
|
|
1699
1723
|
if (awaitBranch["#DetachedAwait"]) {
|
|
@@ -1709,80 +1733,73 @@ function _await_promise(nodeAccessor, params) {
|
|
|
1709
1733
|
const awaitPromise = (scope, promise) => {
|
|
1710
1734
|
if (!isPromise(scope[promiseAccessor])) scope[promiseAccessor] = 0;
|
|
1711
1735
|
let awaitBranch = scope[branchAccessor];
|
|
1712
|
-
const
|
|
1713
|
-
const tryBranch = tryPlaceholder || awaitBranch;
|
|
1736
|
+
const tryBranch = scope[tryAccessor] || isPromise(promise) && findTryWithPlaceholder(scope) || awaitBranch;
|
|
1714
1737
|
if (!tryBranch) {
|
|
1715
|
-
const
|
|
1716
|
-
const awaitCounter =
|
|
1738
|
+
const deferred = scope[promiseAccessor] = () => deferred === scope[promiseAccessor] && awaitPromise(scope, promise);
|
|
1739
|
+
const awaitCounter = findTryWithPlaceholder(scope)?.[AwaitCounter];
|
|
1717
1740
|
if (awaitCounter?.i) {
|
|
1718
1741
|
const complete = awaitCounter.c;
|
|
1719
|
-
awaitCounter.c = () => complete() || queueAsyncRender(scope,
|
|
1742
|
+
awaitCounter.c = () => complete() || queueAsyncRender(scope, deferred);
|
|
1720
1743
|
}
|
|
1721
1744
|
return;
|
|
1722
1745
|
}
|
|
1723
|
-
if (!isPromise(promise)) return scope[
|
|
1746
|
+
if (!isPromise(promise)) return scope[tryAccessor] ? awaitPromise(scope, Promise.resolve(promise)) : resolveAwait(scope, scope[nodeAccessor], promise);
|
|
1724
1747
|
let awaitCounter = tryBranch[AwaitCounter];
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
if (
|
|
1730
|
-
const detachedParent = scope[branchAccessor][StartNode].parentNode;
|
|
1731
|
-
if (detachedParent === anchor.parentNode) anchor.remove();
|
|
1732
|
-
else anchor.replaceWith(detachedParent);
|
|
1733
|
-
}
|
|
1734
|
-
}
|
|
1735
|
-
});
|
|
1736
|
-
if (!scope[promiseAccessor]) {
|
|
1737
|
-
if (awaitBranch) awaitBranch[PendingRenders] ||= [];
|
|
1738
|
-
if (tryPlaceholder) awaitCounter = addAwaitCounter(scope, tryPlaceholder);
|
|
1739
|
-
else scheduleAwaitFrame(awaitCounter, scope, () => {
|
|
1740
|
-
if (!awaitBranch["#DetachedAwait"]) {
|
|
1741
|
-
awaitBranch[StartNode].parentNode.insertBefore(scope[nodeAccessor], awaitBranch[StartNode]);
|
|
1742
|
-
tempDetachBranch(tryBranch);
|
|
1743
|
-
}
|
|
1748
|
+
if (!scope[tryAccessor]) {
|
|
1749
|
+
scope[tryAccessor] = tryBranch;
|
|
1750
|
+
trackAbort(scope, promiseAccessor, () => {
|
|
1751
|
+
scope[promiseAccessor] = 0;
|
|
1752
|
+
if (scope[tryAccessor]) queueAsyncRender(scope[tryAccessor], completeAwaitCounter, awaitCounter);
|
|
1744
1753
|
});
|
|
1754
|
+
if (awaitBranch) awaitBranch[PendingRenders] ||= [];
|
|
1755
|
+
if (tryBranch !== awaitBranch) awaitCounter = addAwaitCounter(scope, tryBranch);
|
|
1756
|
+
else {
|
|
1757
|
+
if (!awaitCounter?.i) awaitCounter = createAwaitCounter(tryBranch, () => {
|
|
1758
|
+
if (tryBranch === scope[branchAccessor]) {
|
|
1759
|
+
const anchor = scope[nodeAccessor];
|
|
1760
|
+
if (anchor.parentNode) {
|
|
1761
|
+
const detachedParent = scope[branchAccessor][StartNode].parentNode;
|
|
1762
|
+
if (detachedParent === anchor.parentNode) anchor.remove();
|
|
1763
|
+
else anchor.replaceWith(detachedParent);
|
|
1764
|
+
}
|
|
1765
|
+
}
|
|
1766
|
+
});
|
|
1767
|
+
scheduleAwaitFrame(awaitCounter, scope, () => {
|
|
1768
|
+
if (!awaitBranch["#DetachedAwait"]) {
|
|
1769
|
+
awaitBranch[StartNode].parentNode.insertBefore(scope[nodeAccessor], awaitBranch[StartNode]);
|
|
1770
|
+
tempDetachBranch(tryBranch);
|
|
1771
|
+
}
|
|
1772
|
+
});
|
|
1773
|
+
}
|
|
1745
1774
|
}
|
|
1746
1775
|
const thisPromise = scope[promiseAccessor] = promise.then((data) => {
|
|
1747
1776
|
if (thisPromise === scope[promiseAccessor]) {
|
|
1748
1777
|
const referenceNode = scope[nodeAccessor];
|
|
1749
1778
|
scope[promiseAccessor] = 0;
|
|
1750
|
-
if (!scope[branchAccessor]
|
|
1751
|
-
|
|
1779
|
+
if (!scope[branchAccessor]) {
|
|
1780
|
+
scope[tryAccessor] = 0;
|
|
1781
|
+
awaitPromise(scope, data);
|
|
1752
1782
|
awaitCounter.c();
|
|
1753
1783
|
run();
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
awaitCounter.c();
|
|
1763
|
-
if (awaitCounter.m) {
|
|
1764
|
-
const fnScopes = /* @__PURE__ */ new Map();
|
|
1765
|
-
const effects = awaitCounter.m([]);
|
|
1766
|
-
for (let i = 0; i < pendingEffects.length;) {
|
|
1767
|
-
const fn = pendingEffects[i++];
|
|
1768
|
-
let scopes = fnScopes.get(fn);
|
|
1769
|
-
if (!scopes) fnScopes.set(fn, scopes = /* @__PURE__ */ new Set());
|
|
1770
|
-
scopes.add(pendingEffects[i++]);
|
|
1771
|
-
}
|
|
1772
|
-
for (let i = 0; i < effects.length;) {
|
|
1773
|
-
const fn = effects[i++];
|
|
1774
|
-
const scope = effects[i++];
|
|
1775
|
-
if (!fnScopes.get(fn)?.has(scope)) queueEffect(scope, fn);
|
|
1776
|
-
}
|
|
1784
|
+
} else queueAsyncRender(scope, () => {
|
|
1785
|
+
if (!scope[promiseAccessor]) {
|
|
1786
|
+
awaitBranch = resolveAwait(scope, referenceNode, data);
|
|
1787
|
+
const pendingRenders = awaitBranch[PendingRenders];
|
|
1788
|
+
awaitBranch[PendingRenders] = 0;
|
|
1789
|
+
pendingRenders?.forEach(queuePendingRender);
|
|
1790
|
+
scope[tryAccessor] = 0;
|
|
1791
|
+
queueCompleteAwaitCounter(tryBranch, awaitCounter);
|
|
1777
1792
|
}
|
|
1778
1793
|
});
|
|
1779
1794
|
}
|
|
1780
1795
|
}, (error) => {
|
|
1781
1796
|
if (thisPromise === scope[promiseAccessor]) {
|
|
1782
|
-
scope[promiseAccessor] = 0;
|
|
1783
|
-
if (tryPlaceholder && !awaitCounter.m) awaitCounter.c();
|
|
1784
|
-
else awaitCounter.i = 0;
|
|
1797
|
+
scope[promiseAccessor] = scope[tryAccessor] = 0;
|
|
1785
1798
|
queueAsyncRender(scope, renderCatch, error);
|
|
1799
|
+
if (tryBranch !== awaitBranch && !awaitCounter.m) {
|
|
1800
|
+
if (findTryWithCatch(scope)) queueCompleteAwaitCounter(tryBranch, awaitCounter);
|
|
1801
|
+
else awaitCounter.c();
|
|
1802
|
+
} else awaitCounter.i = 0;
|
|
1786
1803
|
}
|
|
1787
1804
|
});
|
|
1788
1805
|
};
|
|
@@ -1798,13 +1815,13 @@ function _await_content(nodeAccessor, template, walks, setup) {
|
|
|
1798
1815
|
if (typeof scope[promiseAccessor] === "function") scope[promiseAccessor]();
|
|
1799
1816
|
};
|
|
1800
1817
|
}
|
|
1801
|
-
function addAwaitCounter(scope, tryBranch =
|
|
1818
|
+
function addAwaitCounter(scope, tryBranch = findTryWithPlaceholder(scope)) {
|
|
1802
1819
|
if (!tryBranch) return;
|
|
1803
1820
|
let awaitCounter = tryBranch[AwaitCounter];
|
|
1804
1821
|
if (!awaitCounter?.i) awaitCounter = createAwaitCounter(tryBranch, () => dismissPlaceholder(tryBranch));
|
|
1805
|
-
placeholderShown.add(pendingEffects);
|
|
1806
1822
|
scheduleAwaitFrame(awaitCounter, tryBranch, () => {
|
|
1807
|
-
|
|
1823
|
+
(tryBranch[PlaceholderBranch] = createAndSetupBranch(tryBranch[Global], tryBranch[PlaceholderContent](), tryBranch["_"], tryBranch[StartNode].parentNode))[TryBranch] = tryBranch;
|
|
1824
|
+
insertBranchBefore(tryBranch[PlaceholderBranch], tryBranch[StartNode].parentNode, tryBranch[StartNode]);
|
|
1808
1825
|
tempDetachBranch(tryBranch);
|
|
1809
1826
|
});
|
|
1810
1827
|
return awaitCounter;
|
|
@@ -1812,10 +1829,32 @@ function addAwaitCounter(scope, tryBranch = findBranchWithKey(scope, Placeholder
|
|
|
1812
1829
|
function scheduleAwaitFrame(awaitCounter, scope, render) {
|
|
1813
1830
|
if (!awaitCounter.i++) requestAnimationFrame(() => awaitCounter.i && runEffects(prepareEffects(() => queueRender(scope, render, -1))));
|
|
1814
1831
|
}
|
|
1832
|
+
function queueCompleteAwaitCounter(tryBranch, awaitCounter) {
|
|
1833
|
+
queueRender(tryBranch, completeAwaitCounter, -1, awaitCounter, tryBranch["#Id"] + 1e9);
|
|
1834
|
+
}
|
|
1835
|
+
function completeAwaitCounter(_scope, awaitCounter) {
|
|
1836
|
+
awaitCounter.c();
|
|
1837
|
+
if (awaitCounter.m) {
|
|
1838
|
+
const fnScopes = /* @__PURE__ */ new Map();
|
|
1839
|
+
const effects = awaitCounter.m([]);
|
|
1840
|
+
for (let i = 0; i < pendingEffects.length;) {
|
|
1841
|
+
const fn = pendingEffects[i++];
|
|
1842
|
+
let scopes = fnScopes.get(fn);
|
|
1843
|
+
if (!scopes) fnScopes.set(fn, scopes = /* @__PURE__ */ new Set());
|
|
1844
|
+
scopes.add(pendingEffects[i++]);
|
|
1845
|
+
}
|
|
1846
|
+
for (let i = 0; i < effects.length;) {
|
|
1847
|
+
const fn = effects[i++];
|
|
1848
|
+
const scope = effects[i++];
|
|
1849
|
+
if (!fnScopes.get(fn)?.has(scope)) queueEffect(scope, fn);
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1815
1853
|
function createAwaitCounter(tryBranch, done) {
|
|
1816
1854
|
const awaitCounter = tryBranch[AwaitCounter] = {
|
|
1817
1855
|
i: 0,
|
|
1818
1856
|
c() {
|
|
1857
|
+
if (awaitCounter.i < 1) throw new Error("An await counter completed more counts than it took.");
|
|
1819
1858
|
if (--awaitCounter.i) return 1;
|
|
1820
1859
|
done();
|
|
1821
1860
|
queueEffect(tryBranch, runPendingEffects);
|
|
@@ -1823,12 +1862,8 @@ function createAwaitCounter(tryBranch, done) {
|
|
|
1823
1862
|
};
|
|
1824
1863
|
return awaitCounter;
|
|
1825
1864
|
}
|
|
1826
|
-
function runPendingEffects(
|
|
1827
|
-
|
|
1828
|
-
if (effects) {
|
|
1829
|
-
scope[PendingEffects] = [];
|
|
1830
|
-
runEffects(effects, 1);
|
|
1831
|
-
}
|
|
1865
|
+
function runPendingEffects(tryBranch) {
|
|
1866
|
+
tryBranch[PendingEffectScopes]?.forEach((scope) => scope[PendingEffects].forEach((fn) => runEffects([fn, scope]), scope[PendingEffects] = null), tryBranch[PendingEffectScopes] = null);
|
|
1832
1867
|
}
|
|
1833
1868
|
function dismissPlaceholder(tryBranch) {
|
|
1834
1869
|
const placeholderBranch = tryBranch[PlaceholderBranch];
|
|
@@ -1838,21 +1873,19 @@ function dismissPlaceholder(tryBranch) {
|
|
|
1838
1873
|
removeAndDestroyBranch(placeholderBranch);
|
|
1839
1874
|
}
|
|
1840
1875
|
}
|
|
1841
|
-
function _try(nodeAccessor, template, walks, setup) {
|
|
1876
|
+
function _try(nodeAccessor, template, walks, setup, placeholderContent, catchContent) {
|
|
1842
1877
|
const branchAccessor = BranchScopes$1 + nodeAccessor;
|
|
1843
1878
|
const renderer = _content("", template, walks, setup)();
|
|
1844
|
-
return (scope
|
|
1845
|
-
|
|
1879
|
+
return (scope) => {
|
|
1880
|
+
setConditionalRenderer(scope, nodeAccessor, renderer, createAndSetupBranch);
|
|
1846
1881
|
const branch = scope[branchAccessor];
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
branch[PlaceholderContent] = normalizeDynamicRenderer(input.placeholder);
|
|
1851
|
-
}
|
|
1882
|
+
branch[BranchAccessor] = nodeAccessor;
|
|
1883
|
+
branch[CatchContent] = catchContent;
|
|
1884
|
+
branch[PlaceholderContent] = placeholderContent || void 0;
|
|
1852
1885
|
};
|
|
1853
1886
|
}
|
|
1854
1887
|
function renderCatch(scope, error) {
|
|
1855
|
-
const tryWithCatch =
|
|
1888
|
+
const tryWithCatch = findTryWithCatch(scope);
|
|
1856
1889
|
if (!tryWithCatch) throw error;
|
|
1857
1890
|
else {
|
|
1858
1891
|
const owner = tryWithCatch["_"];
|
|
@@ -1862,11 +1895,21 @@ function renderCatch(scope, error) {
|
|
|
1862
1895
|
owner[BranchScopes$1 + tryWithCatch[BranchAccessor]] = placeholderBranch;
|
|
1863
1896
|
destroyBranch(tryWithCatch);
|
|
1864
1897
|
}
|
|
1865
|
-
|
|
1866
|
-
setConditionalRenderer(owner, tryWithCatch[BranchAccessor],
|
|
1867
|
-
|
|
1898
|
+
const catchContent = tryWithCatch[CatchContent]();
|
|
1899
|
+
setConditionalRenderer(owner, tryWithCatch[BranchAccessor], catchContent, createAndSetupBranch);
|
|
1900
|
+
catchContent[Params]?.(owner[BranchScopes$1 + tryWithCatch[BranchAccessor]], [error]);
|
|
1868
1901
|
}
|
|
1869
1902
|
}
|
|
1903
|
+
function findTryWithPlaceholder(scope) {
|
|
1904
|
+
let branch = scope[ClosestBranch];
|
|
1905
|
+
while (branch && !branch["#PlaceholderContent"]) branch = branch[ParentBranch];
|
|
1906
|
+
return branch;
|
|
1907
|
+
}
|
|
1908
|
+
function findTryWithCatch(scope) {
|
|
1909
|
+
let branch = scope[ClosestBranch];
|
|
1910
|
+
while (branch && !branch["#CatchContent"]) branch = branch["#TryBranch"] || branch["#ParentBranch"];
|
|
1911
|
+
return branch;
|
|
1912
|
+
}
|
|
1870
1913
|
const _if = /*@__PURE__*/ withBranches((nodeAccessor, ...branchesArgs) => {
|
|
1871
1914
|
const branchAccessor = ConditionalRenderer + nodeAccessor;
|
|
1872
1915
|
const branches = [];
|
|
@@ -1923,10 +1966,12 @@ let _dynamic_tag = /*@__PURE__*/ withBranches((nodeAccessor, getContent, getTagV
|
|
|
1923
1966
|
if (scope[rendererAccessor] !== (scope[rendererAccessor] = rendererKey(normalizedRenderer)) || getContent && !(normalizedRenderer || scope[childScopeAccessor])) {
|
|
1924
1967
|
const renderer = normalizedRenderer || (getContent ? getContent(scope) : void 0);
|
|
1925
1968
|
setConditionalRenderer(scope, nodeAccessor, renderer, createBranchWithTagNameOrRenderer);
|
|
1926
|
-
if (getTagVar)
|
|
1927
|
-
scope[childScopeAccessor]
|
|
1928
|
-
|
|
1929
|
-
|
|
1969
|
+
if (getTagVar) {
|
|
1970
|
+
if (scope[childScopeAccessor]) {
|
|
1971
|
+
scope[childScopeAccessor][TagVariable] = (value) => getTagVar()(scope, value);
|
|
1972
|
+
if (typeof normalizedRenderer === "string") bindNativeTagVar?.(scope[childScopeAccessor]);
|
|
1973
|
+
} else getTagVar()(scope, void 0);
|
|
1974
|
+
}
|
|
1930
1975
|
if (typeof renderer === "string") {
|
|
1931
1976
|
if (getContent) {
|
|
1932
1977
|
const content = getContent(scope);
|
|
@@ -1944,13 +1989,15 @@ let _dynamic_tag = /*@__PURE__*/ withBranches((nodeAccessor, getContent, getTagV
|
|
|
1944
1989
|
if (childScope["EventAttributes:" + nodeAccessor] || childScope["ControlledHandler:" + nodeAccessor]) queueEffect(childScope, dynamicTagScript);
|
|
1945
1990
|
} else {
|
|
1946
1991
|
normalizedRenderer[LocalClosures]?.(childScope);
|
|
1947
|
-
if (normalizedRenderer["params"])
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1992
|
+
if (normalizedRenderer["params"]) {
|
|
1993
|
+
if (inputIsArgs) normalizedRenderer[Params](childScope, normalizedRenderer._ ? args[0] : args);
|
|
1994
|
+
else {
|
|
1995
|
+
const inputWithContent = getContent ? {
|
|
1996
|
+
...args,
|
|
1997
|
+
content: getContent(scope)
|
|
1998
|
+
} : args || {};
|
|
1999
|
+
normalizedRenderer[Params](childScope, normalizedRenderer._ ? inputWithContent : [inputWithContent]);
|
|
2000
|
+
}
|
|
1954
2001
|
}
|
|
1955
2002
|
}
|
|
1956
2003
|
}
|
|
@@ -2088,20 +2135,22 @@ function reorderKeyed(newScopes, start, newEnd, parentNode, afterReference) {
|
|
|
2088
2135
|
let hi;
|
|
2089
2136
|
let mid;
|
|
2090
2137
|
for (let i = diffLen; i--;) sources[i] = newScopes[start + i]["#LoopIndex"] ?? -1;
|
|
2091
|
-
for (let i = 0; i < diffLen; i++) if (~sources[i])
|
|
2092
|
-
if (
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
if (
|
|
2104
|
-
|
|
2138
|
+
for (let i = 0; i < diffLen; i++) if (~sources[i]) {
|
|
2139
|
+
if (tail < 0 || sources[tails[tail]] < sources[i]) {
|
|
2140
|
+
if (~tail) pred[i] = tails[tail];
|
|
2141
|
+
tails[++tail] = i;
|
|
2142
|
+
} else {
|
|
2143
|
+
lo = 0;
|
|
2144
|
+
hi = tail;
|
|
2145
|
+
while (lo < hi) {
|
|
2146
|
+
mid = (lo + hi) / 2 | 0;
|
|
2147
|
+
if (sources[tails[mid]] < sources[i]) lo = mid + 1;
|
|
2148
|
+
else hi = mid;
|
|
2149
|
+
}
|
|
2150
|
+
if (sources[i] < sources[tails[lo]]) {
|
|
2151
|
+
if (lo > 0) pred[i] = tails[lo - 1];
|
|
2152
|
+
tails[lo] = i;
|
|
2153
|
+
}
|
|
2105
2154
|
}
|
|
2106
2155
|
}
|
|
2107
2156
|
hi = tails[tail];
|
|
@@ -2220,6 +2269,12 @@ Object.defineProperty(exports, "Pending", {
|
|
|
2220
2269
|
return Pending;
|
|
2221
2270
|
}
|
|
2222
2271
|
});
|
|
2272
|
+
Object.defineProperty(exports, "PendingEffectScopes", {
|
|
2273
|
+
enumerable: true,
|
|
2274
|
+
get: function() {
|
|
2275
|
+
return PendingEffectScopes;
|
|
2276
|
+
}
|
|
2277
|
+
});
|
|
2223
2278
|
Object.defineProperty(exports, "PendingEffects", {
|
|
2224
2279
|
enumerable: true,
|
|
2225
2280
|
get: function() {
|
|
@@ -2556,6 +2611,12 @@ Object.defineProperty(exports, "_dynamic_tag_content", {
|
|
|
2556
2611
|
return _dynamic_tag_content;
|
|
2557
2612
|
}
|
|
2558
2613
|
});
|
|
2614
|
+
Object.defineProperty(exports, "_dynamic_tag_var_resume", {
|
|
2615
|
+
enumerable: true,
|
|
2616
|
+
get: function() {
|
|
2617
|
+
return _dynamic_tag_var_resume;
|
|
2618
|
+
}
|
|
2619
|
+
});
|
|
2559
2620
|
Object.defineProperty(exports, "_el", {
|
|
2560
2621
|
enumerable: true,
|
|
2561
2622
|
get: function() {
|
|
@@ -2700,12 +2761,6 @@ Object.defineProperty(exports, "_or", {
|
|
|
2700
2761
|
return _or;
|
|
2701
2762
|
}
|
|
2702
2763
|
});
|
|
2703
|
-
Object.defineProperty(exports, "_resume_dynamic_tag_var", {
|
|
2704
|
-
enumerable: true,
|
|
2705
|
-
get: function() {
|
|
2706
|
-
return _resume_dynamic_tag_var;
|
|
2707
|
-
}
|
|
2708
|
-
});
|
|
2709
2764
|
Object.defineProperty(exports, "_resumed", {
|
|
2710
2765
|
enumerable: true,
|
|
2711
2766
|
get: function() {
|
|
@@ -2796,12 +2851,6 @@ Object.defineProperty(exports, "addAwaitCounter", {
|
|
|
2796
2851
|
return addAwaitCounter;
|
|
2797
2852
|
}
|
|
2798
2853
|
});
|
|
2799
|
-
Object.defineProperty(exports, "caughtError", {
|
|
2800
|
-
enumerable: true,
|
|
2801
|
-
get: function() {
|
|
2802
|
-
return caughtError;
|
|
2803
|
-
}
|
|
2804
|
-
});
|
|
2805
2854
|
Object.defineProperty(exports, "controllableRenders", {
|
|
2806
2855
|
enumerable: true,
|
|
2807
2856
|
get: function() {
|
|
@@ -2910,12 +2959,6 @@ Object.defineProperty(exports, "patchDynamicTag", {
|
|
|
2910
2959
|
return patchDynamicTag;
|
|
2911
2960
|
}
|
|
2912
2961
|
});
|
|
2913
|
-
Object.defineProperty(exports, "placeholderShown", {
|
|
2914
|
-
enumerable: true,
|
|
2915
|
-
get: function() {
|
|
2916
|
-
return placeholderShown;
|
|
2917
|
-
}
|
|
2918
|
-
});
|
|
2919
2962
|
Object.defineProperty(exports, "prepareEffects", {
|
|
2920
2963
|
enumerable: true,
|
|
2921
2964
|
get: function() {
|
|
@@ -2964,6 +3007,12 @@ Object.defineProperty(exports, "renderCatch", {
|
|
|
2964
3007
|
return renderCatch;
|
|
2965
3008
|
}
|
|
2966
3009
|
});
|
|
3010
|
+
Object.defineProperty(exports, "rendering", {
|
|
3011
|
+
enumerable: true,
|
|
3012
|
+
get: function() {
|
|
3013
|
+
return rendering;
|
|
3014
|
+
}
|
|
3015
|
+
});
|
|
2967
3016
|
Object.defineProperty(exports, "run", {
|
|
2968
3017
|
enumerable: true,
|
|
2969
3018
|
get: function() {
|
|
@@ -2982,6 +3031,12 @@ Object.defineProperty(exports, "runId", {
|
|
|
2982
3031
|
return runId;
|
|
2983
3032
|
}
|
|
2984
3033
|
});
|
|
3034
|
+
Object.defineProperty(exports, "runPendingEffects", {
|
|
3035
|
+
enumerable: true,
|
|
3036
|
+
get: function() {
|
|
3037
|
+
return runPendingEffects;
|
|
3038
|
+
}
|
|
3039
|
+
});
|
|
2985
3040
|
Object.defineProperty(exports, "setupBranch", {
|
|
2986
3041
|
enumerable: true,
|
|
2987
3042
|
get: function() {
|