marko 6.0.0-next.3.59 → 6.0.0-next.3.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/accessor.d.ts +24 -0
- package/dist/common/accessor.debug.d.ts +24 -0
- package/dist/common/types.d.ts +2 -17
- package/dist/debug/dom.js +348 -183
- package/dist/debug/dom.mjs +348 -183
- package/dist/debug/html.js +123 -44
- package/dist/debug/html.mjs +123 -44
- package/dist/dom/control-flow.d.ts +5 -0
- package/dist/dom/queue.d.ts +2 -1
- package/dist/dom/scope.d.ts +1 -0
- package/dist/dom.d.ts +2 -2
- package/dist/dom.js +282 -159
- package/dist/dom.mjs +282 -159
- package/dist/html/dynamic-tag.d.ts +3 -4
- package/dist/html/serializer.d.ts +2 -1
- package/dist/html/writer.d.ts +2 -3
- package/dist/html.js +107 -39
- package/dist/html.mjs +107 -39
- package/dist/translator/core/await.d.ts +7 -0
- package/dist/translator/core/try.d.ts +7 -0
- package/dist/translator/index.js +222 -43
- package/dist/translator/util/get-accessor-char.d.ts +4 -0
- package/dist/translator/util/sections.d.ts +1 -1
- package/package.json +1 -1
package/dist/dom.mjs
CHANGED
@@ -151,11 +151,11 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
|
|
151
151
|
commentPrefixLen + 1,
|
152
152
|
dataIndex ? dataIndex - 1 : commentText.length
|
153
153
|
), scope = scopeLookup[scopeId] ||= {
|
154
|
-
|
154
|
+
e: +scopeId
|
155
155
|
}, data2 = dataIndex ? commentText.slice(dataIndex) : "", token = commentText[commentPrefixLen];
|
156
156
|
if (token === "*" /* Node */) {
|
157
157
|
let node = scope[data2] = visit.previousSibling;
|
158
|
-
scope[
|
158
|
+
scope["j" /* Getter */ + data2] = () => node;
|
159
159
|
} else if (token === "$" /* ClosestBranch */)
|
160
160
|
closestBranchMarkers.set(scopeId, visit);
|
161
161
|
else if (token === "[" /* BranchStart */)
|
@@ -193,14 +193,14 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
|
|
193
193
|
for (let scopeId in scopes)
|
194
194
|
if (scopeId !== "$") {
|
195
195
|
let scope = scopes[scopeId], prevScope = scopeLookup[scopeId];
|
196
|
-
scope.$global = $global, scope.
|
196
|
+
scope.$global = $global, scope.e = +scopeId, prevScope !== scope && (scopeLookup[scopeId] = Object.assign(
|
197
197
|
scope,
|
198
198
|
prevScope
|
199
199
|
));
|
200
200
|
let parentBranchId = parentBranchIds.get(scopeId);
|
201
201
|
if (parentBranchId && (scope.c = scopes[parentBranchId]), branchIds.has(scopeId)) {
|
202
202
|
let branch = scope, parentBranch = branch.c;
|
203
|
-
scope.c = branch, parentBranch && (branch.
|
203
|
+
scope.c = branch, parentBranch && (branch.g = parentBranch, (parentBranch.p ||= /* @__PURE__ */ new Set()).add(
|
204
204
|
branch
|
205
205
|
));
|
206
206
|
}
|
@@ -256,7 +256,7 @@ function controllable_input_checked(scope, nodeAccessor, checked, checkedChange)
|
|
256
256
|
function controllable_input_checked_effect(scope, nodeAccessor) {
|
257
257
|
let el = scope[nodeAccessor];
|
258
258
|
syncControllable(el, "input", hasCheckboxChanged, () => {
|
259
|
-
let checkedChange = scope[
|
259
|
+
let checkedChange = scope["e" /* ControlledHandler */ + nodeAccessor];
|
260
260
|
if (checkedChange) {
|
261
261
|
let newValue = el.checked;
|
262
262
|
el.checked = !newValue, checkedChange(newValue), run();
|
@@ -264,7 +264,7 @@ function controllable_input_checked_effect(scope, nodeAccessor) {
|
|
264
264
|
});
|
265
265
|
}
|
266
266
|
function controllable_input_checkedValue(scope, nodeAccessor, checkedValue, checkedValueChange, value2) {
|
267
|
-
scope[
|
267
|
+
scope["g" /* ControlledValue */ + nodeAccessor] = checkedValue, attr(scope[nodeAccessor], "value", value2), setCheckboxValue(
|
268
268
|
scope,
|
269
269
|
nodeAccessor,
|
270
270
|
1 /* InputCheckedValue */,
|
@@ -275,9 +275,9 @@ function controllable_input_checkedValue(scope, nodeAccessor, checkedValue, chec
|
|
275
275
|
function controllable_input_checkedValue_effect(scope, nodeAccessor) {
|
276
276
|
let el = scope[nodeAccessor];
|
277
277
|
syncControllable(el, "input", hasCheckboxChanged, () => {
|
278
|
-
let checkedValueChange = scope[
|
278
|
+
let checkedValueChange = scope["e" /* ControlledHandler */ + nodeAccessor];
|
279
279
|
if (checkedValueChange) {
|
280
|
-
let oldValue = scope[
|
280
|
+
let oldValue = scope["g" /* ControlledValue */ + nodeAccessor], newValue = Array.isArray(oldValue) ? updateList(oldValue, el.value, el.checked) : el.checked ? el.value : void 0;
|
281
281
|
if (el.name && el.type[0] === "r")
|
282
282
|
for (let radio of el.getRootNode().querySelectorAll(
|
283
283
|
`[type=radio][name=${CSS.escape(el.name)}]`
|
@@ -291,23 +291,23 @@ function controllable_input_checkedValue_effect(scope, nodeAccessor) {
|
|
291
291
|
}
|
292
292
|
function controllable_input_value(scope, nodeAccessor, value2, valueChange) {
|
293
293
|
let el = scope[nodeAccessor], normalizedValue = normalizeStrProp(value2);
|
294
|
-
scope[
|
294
|
+
scope["e" /* ControlledHandler */ + nodeAccessor] = valueChange, valueChange ? (scope["f" /* ControlledType */ + nodeAccessor] = 0 /* InputChecked */, scope["g" /* ControlledValue */ + nodeAccessor] = value2, el.isConnected ? setValueAndUpdateSelection(el, normalizedValue) : el.defaultValue = normalizedValue) : (scope["f" /* ControlledType */ + nodeAccessor] = 5 /* None */, el.defaultValue = normalizedValue);
|
295
295
|
}
|
296
296
|
function controllable_input_value_effect(scope, nodeAccessor) {
|
297
297
|
let el = scope[nodeAccessor];
|
298
|
-
isResuming && (scope[
|
299
|
-
let valueChange = scope[
|
298
|
+
isResuming && (scope["g" /* ControlledValue */ + nodeAccessor] = el.defaultValue), syncControllable(el, "input", hasValueChanged, (ev) => {
|
299
|
+
let valueChange = scope["e" /* ControlledHandler */ + nodeAccessor];
|
300
300
|
if (valueChange) {
|
301
301
|
let newValue = el.value;
|
302
302
|
inputType = ev?.inputType, setValueAndUpdateSelection(
|
303
303
|
el,
|
304
|
-
scope[
|
304
|
+
scope["g" /* ControlledValue */ + nodeAccessor]
|
305
305
|
), valueChange(newValue), run(), inputType = "";
|
306
306
|
}
|
307
307
|
});
|
308
308
|
}
|
309
309
|
function controllable_select_value(scope, nodeAccessor, value2, valueChange) {
|
310
|
-
scope[
|
310
|
+
scope["e" /* ControlledHandler */ + nodeAccessor] = valueChange, valueChange ? (scope["f" /* ControlledType */ + nodeAccessor] = 3 /* SelectValue */, scope["g" /* ControlledValue */ + nodeAccessor] = value2) : scope["f" /* ControlledType */ + nodeAccessor] = 5 /* None */, pendingEffects.unshift(
|
311
311
|
() => setSelectOptions(
|
312
312
|
scope[nodeAccessor],
|
313
313
|
value2,
|
@@ -318,20 +318,20 @@ function controllable_select_value(scope, nodeAccessor, value2, valueChange) {
|
|
318
318
|
}
|
319
319
|
function controllable_select_value_effect(scope, nodeAccessor) {
|
320
320
|
let el = scope[nodeAccessor], onChange = () => {
|
321
|
-
let valueChange = scope[
|
321
|
+
let valueChange = scope["e" /* ControlledHandler */ + nodeAccessor];
|
322
322
|
if (valueChange) {
|
323
323
|
let newValue = Array.isArray(
|
324
|
-
scope[
|
324
|
+
scope["g" /* ControlledValue */ + nodeAccessor]
|
325
325
|
) ? Array.from(el.selectedOptions, toValueProp) : el.value;
|
326
326
|
setSelectOptions(
|
327
327
|
el,
|
328
|
-
scope[
|
328
|
+
scope["g" /* ControlledValue */ + nodeAccessor],
|
329
329
|
valueChange
|
330
330
|
), valueChange(newValue), run();
|
331
331
|
}
|
332
332
|
};
|
333
333
|
el._ || new MutationObserver(() => {
|
334
|
-
let value2 = scope[
|
334
|
+
let value2 = scope["g" /* ControlledValue */ + nodeAccessor];
|
335
335
|
(Array.isArray(value2) ? value2.length !== el.selectedOptions.length || value2.some((value3, i) => value3 != el.selectedOptions[i].value) : el.value != value2) && onChange();
|
336
336
|
}).observe(el, {
|
337
337
|
childList: !0,
|
@@ -354,16 +354,16 @@ function setSelectOptions(el, value2, valueChange) {
|
|
354
354
|
}
|
355
355
|
}
|
356
356
|
function controllable_detailsOrDialog_open(scope, nodeAccessor, open, openChange) {
|
357
|
-
scope[
|
357
|
+
scope["e" /* ControlledHandler */ + nodeAccessor] = openChange, openChange ? scope["f" /* ControlledType */ + nodeAccessor] = 4 /* DetailsOrDialogOpen */ : scope["f" /* ControlledType */ + nodeAccessor] = 5 /* None */, scope[nodeAccessor].open = scope["g" /* ControlledValue */ + nodeAccessor] = normalizeBoolProp(open);
|
358
358
|
}
|
359
359
|
function controllable_detailsOrDialog_open_effect(scope, nodeAccessor) {
|
360
|
-
let el = scope[nodeAccessor], hasChanged = () => el.open !== scope[
|
360
|
+
let el = scope[nodeAccessor], hasChanged = () => el.open !== scope["g" /* ControlledValue */ + nodeAccessor];
|
361
361
|
syncControllable(
|
362
362
|
el,
|
363
363
|
el.tagName === "DIALOG" ? "close" : "toggle",
|
364
364
|
hasChanged,
|
365
365
|
() => {
|
366
|
-
let openChange = scope[
|
366
|
+
let openChange = scope["e" /* ControlledHandler */ + nodeAccessor];
|
367
367
|
if (openChange && hasChanged()) {
|
368
368
|
let newValue = el.open;
|
369
369
|
el.open = !newValue, openChange(newValue), run();
|
@@ -384,7 +384,7 @@ function setValueAndUpdateSelection(el, value2) {
|
|
384
384
|
}
|
385
385
|
}
|
386
386
|
function setCheckboxValue(scope, nodeAccessor, type, checked, checkedChange) {
|
387
|
-
scope[
|
387
|
+
scope["e" /* ControlledHandler */ + nodeAccessor] = checkedChange, checkedChange ? (scope["f" /* ControlledType */ + nodeAccessor] = type, scope[nodeAccessor].checked = checked) : (scope["f" /* ControlledType */ + nodeAccessor] = 5 /* None */, scope[nodeAccessor].defaultChecked = checked);
|
388
388
|
}
|
389
389
|
var controllableDelegate = createDelegator();
|
390
390
|
function syncControllable(el, event, hasChanged, onChange) {
|
@@ -548,13 +548,13 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
|
|
548
548
|
case "content":
|
549
549
|
break;
|
550
550
|
default:
|
551
|
-
isEventHandler(name) ? (events ||= scope[
|
551
|
+
isEventHandler(name) ? (events ||= scope["i" /* EventAttributes */ + nodeAccessor] = {})[getEventHandlerName(name)] = value2 : skip?.test(name) || attr(el, name, value2);
|
552
552
|
}
|
553
553
|
}
|
554
554
|
}
|
555
555
|
function attrsEvents(scope, nodeAccessor) {
|
556
|
-
let el = scope[nodeAccessor], events = scope[
|
557
|
-
switch (scope[
|
556
|
+
let el = scope[nodeAccessor], events = scope["i" /* EventAttributes */ + nodeAccessor];
|
557
|
+
switch (scope["f" /* ControlledType */ + nodeAccessor]) {
|
558
558
|
case 0 /* InputChecked */:
|
559
559
|
controllable_input_checked_effect(scope, nodeAccessor);
|
560
560
|
break;
|
@@ -575,7 +575,7 @@ function attrsEvents(scope, nodeAccessor) {
|
|
575
575
|
on(el, name, events[name]);
|
576
576
|
}
|
577
577
|
function html(scope, value2, accessor) {
|
578
|
-
let firstChild = scope[accessor], parentNode = firstChild.parentNode, lastChild = scope[
|
578
|
+
let firstChild = scope[accessor], parentNode = firstChild.parentNode, lastChild = scope["h" /* DynamicPlaceholderLastChild */ + accessor] || firstChild, newContent = parseHTML(
|
579
579
|
value2 || value2 === 0 ? value2 + "" : "",
|
580
580
|
parentNode.namespaceURI
|
581
581
|
);
|
@@ -583,7 +583,7 @@ function html(scope, value2, accessor) {
|
|
583
583
|
parentNode,
|
584
584
|
firstChild,
|
585
585
|
scope[accessor] = newContent.firstChild || newContent.appendChild(new Text()),
|
586
|
-
scope[
|
586
|
+
scope["h" /* DynamicPlaceholderLastChild */ + accessor] = newContent.lastChild
|
587
587
|
), removeChildNodes(firstChild, lastChild);
|
588
588
|
}
|
589
589
|
function props(scope, nodeIndex, index) {
|
@@ -606,7 +606,7 @@ function lifecycle(scope, index, thisObj) {
|
|
606
606
|
let instance = scope[index];
|
607
607
|
instance ? (Object.assign(instance, thisObj), instance.onUpdate?.()) : (scope[index] = thisObj, thisObj.onMount?.(), getAbortSignal(
|
608
608
|
scope,
|
609
|
-
"
|
609
|
+
"k" /* LifecycleAbortController */ + index
|
610
610
|
).onabort = () => thisObj.onDestroy?.());
|
611
611
|
}
|
612
612
|
function removeChildNodes(startNode, endNode) {
|
@@ -633,8 +633,8 @@ function toInsertNode(startNode, endNode) {
|
|
633
633
|
var pendingScopes = [];
|
634
634
|
function createScope($global, closestBranch) {
|
635
635
|
let scope = {
|
636
|
-
|
637
|
-
|
636
|
+
e: $global.f++,
|
637
|
+
h: 1,
|
638
638
|
c: closestBranch,
|
639
639
|
$global
|
640
640
|
};
|
@@ -645,16 +645,16 @@ function skipScope(scope) {
|
|
645
645
|
}
|
646
646
|
function finishPendingScopes() {
|
647
647
|
for (let scope of pendingScopes)
|
648
|
-
scope.
|
648
|
+
scope.h = 0;
|
649
649
|
pendingScopes = [];
|
650
650
|
}
|
651
651
|
function destroyBranch(branch) {
|
652
|
-
branch.p?.
|
652
|
+
branch.g?.p?.delete(branch), destroyNestedBranches(branch);
|
653
653
|
}
|
654
654
|
function destroyNestedBranches(branch) {
|
655
|
-
branch.
|
656
|
-
for (let id in scope.
|
657
|
-
scope.
|
655
|
+
branch.k = 1, branch.p?.forEach(destroyNestedBranches), branch.B?.forEach((scope) => {
|
656
|
+
for (let id in scope.l)
|
657
|
+
scope.l[id]?.abort();
|
658
658
|
});
|
659
659
|
}
|
660
660
|
function removeAndDestroyBranch(branch) {
|
@@ -668,90 +668,15 @@ function insertBranchBefore(branch, parentNode, nextSibling) {
|
|
668
668
|
branch.b
|
669
669
|
);
|
670
670
|
}
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
else {
|
679
|
-
let render = {
|
680
|
-
h: key,
|
681
|
-
u: scope,
|
682
|
-
B: signal,
|
683
|
-
t: value2
|
684
|
-
}, i = pendingRenders.push(render) - 1;
|
685
|
-
for (; i; ) {
|
686
|
-
let parentIndex = i - 1 >> 1, parent = pendingRenders[parentIndex];
|
687
|
-
if (key - parent.h >= 0) break;
|
688
|
-
pendingRenders[i] = parent, i = parentIndex;
|
689
|
-
}
|
690
|
-
signalKey >= 0 && pendingRendersLookup.set(key, render), pendingRenders[i] = render;
|
691
|
-
}
|
692
|
-
}
|
693
|
-
function queueEffect(scope, fn) {
|
694
|
-
pendingEffects.push(fn, scope);
|
695
|
-
}
|
696
|
-
function run() {
|
697
|
-
let effects = pendingEffects;
|
698
|
-
try {
|
699
|
-
rendering = !0, runRenders();
|
700
|
-
} finally {
|
701
|
-
pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map(), pendingEffects = [], rendering = !1;
|
702
|
-
}
|
703
|
-
runEffects(effects);
|
704
|
-
}
|
705
|
-
function prepareEffects(fn) {
|
706
|
-
let prevRenders = pendingRenders, prevRendersLookup = pendingRendersLookup, prevEffects = pendingEffects, preparedEffects = pendingEffects = [];
|
707
|
-
pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map();
|
708
|
-
try {
|
709
|
-
rendering = !0, fn(), runRenders();
|
710
|
-
} finally {
|
711
|
-
rendering = !1, pendingRenders = prevRenders, pendingRendersLookup = prevRendersLookup, pendingEffects = prevEffects;
|
712
|
-
}
|
713
|
-
return preparedEffects;
|
714
|
-
}
|
715
|
-
function runEffects(effects) {
|
716
|
-
for (let i = 0, scope; i < effects.length; )
|
717
|
-
effects[i++](
|
718
|
-
scope = effects[i++],
|
719
|
-
scope
|
720
|
-
);
|
721
|
-
}
|
722
|
-
function runRenders() {
|
723
|
-
for (; pendingRenders.length; ) {
|
724
|
-
let render = pendingRenders[0], item = pendingRenders.pop();
|
725
|
-
if (render !== item) {
|
726
|
-
let i = 0, mid = pendingRenders.length >> 1, key = (pendingRenders[0] = item).h;
|
727
|
-
for (; i < mid; ) {
|
728
|
-
let bestChild = (i << 1) + 1, right = bestChild + 1;
|
729
|
-
if (right < pendingRenders.length && pendingRenders[right].h - pendingRenders[bestChild].h < 0 && (bestChild = right), pendingRenders[bestChild].h - key >= 0)
|
730
|
-
break;
|
731
|
-
pendingRenders[i] = pendingRenders[bestChild], i = bestChild;
|
732
|
-
}
|
733
|
-
pendingRenders[i] = item;
|
734
|
-
}
|
735
|
-
render.u.c?.q || render.B(render.u, render.t);
|
736
|
-
}
|
737
|
-
finishPendingScopes();
|
738
|
-
}
|
739
|
-
|
740
|
-
// src/dom/abort-signal.ts
|
741
|
-
function resetAbortSignal(scope, id) {
|
742
|
-
let ctrl = scope.j?.[id];
|
743
|
-
ctrl && (queueEffect(ctrl, abort), scope.j[id] = void 0);
|
744
|
-
}
|
745
|
-
function getAbortSignal(scope, id) {
|
746
|
-
return scope.c && (scope.c.A ||= /* @__PURE__ */ new Set()).add(scope), ((scope.j ||= {})[id] ||= new AbortController()).signal;
|
747
|
-
}
|
748
|
-
function abort(ctrl) {
|
749
|
-
ctrl.abort();
|
671
|
+
function tempDetatchBranch(branch) {
|
672
|
+
insertChildNodes(
|
673
|
+
new DocumentFragment(),
|
674
|
+
null,
|
675
|
+
branch.a,
|
676
|
+
branch.b
|
677
|
+
);
|
750
678
|
}
|
751
679
|
|
752
|
-
// src/common/compat-meta.ts
|
753
|
-
var prefix = "$C_", RENDERER_REGISTER_ID = prefix + "r", SET_SCOPE_REGISTER_ID = prefix + "s", RENDER_BODY_ID = prefix + "b";
|
754
|
-
|
755
680
|
// src/dom/reconcile.ts
|
756
681
|
var WRONG_POS = 2147483647;
|
757
682
|
function reconcile(parent, oldBranches, newBranches, afterReference) {
|
@@ -837,7 +762,7 @@ function walkInternal(currentWalkIndex, walkCodes, scope) {
|
|
837
762
|
for (; currentWalkIndex < walkCodes.length; )
|
838
763
|
if (value2 = walkCodes.charCodeAt(currentWalkIndex++), currentMultiplier = storedMultiplier, storedMultiplier = 0, value2 === 32 /* Get */) {
|
839
764
|
let node = walker.currentNode;
|
840
|
-
scope[currentScopeIndex] = node, scope[
|
765
|
+
scope[currentScopeIndex] = node, scope["j" /* Getter */ + currentScopeIndex++] = () => node;
|
841
766
|
} else if (value2 === 37 /* Replace */ || value2 === 49 /* DynamicTagWithVar */)
|
842
767
|
walker.currentNode.replaceWith(
|
843
768
|
walker.currentNode = scope[currentScopeIndex++] = new Text()
|
@@ -869,7 +794,7 @@ function walkInternal(currentWalkIndex, walkCodes, scope) {
|
|
869
794
|
// src/dom/renderer.ts
|
870
795
|
function createBranch($global, renderer, parentScope, parentNode) {
|
871
796
|
let branch = createScope($global), parentBranch = parentScope?.c;
|
872
|
-
return branch._ = renderer.
|
797
|
+
return branch._ = renderer.m || parentScope, branch.c = branch, parentBranch && (branch.g = parentBranch, (parentBranch.p ||= /* @__PURE__ */ new Set()).add(branch)), renderer.q?.(
|
873
798
|
branch,
|
874
799
|
parentNode.namespaceURI
|
875
800
|
), branch;
|
@@ -881,10 +806,10 @@ function createAndSetupBranch($global, renderer, parentScope, parentNode) {
|
|
881
806
|
);
|
882
807
|
}
|
883
808
|
function setupBranch(renderer, branch) {
|
884
|
-
return (renderer.
|
809
|
+
return (renderer.t || renderer.x) && queueRender(
|
885
810
|
branch,
|
886
811
|
(branch2) => {
|
887
|
-
renderer.
|
812
|
+
renderer.t?.(branch2), renderer.x?.(branch2);
|
888
813
|
},
|
889
814
|
-1
|
890
815
|
), branch;
|
@@ -904,13 +829,13 @@ function createContent(id, template, walks, setup, params, closures, dynamicScop
|
|
904
829
|
);
|
905
830
|
};
|
906
831
|
return (owner) => ({
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
832
|
+
e: id,
|
833
|
+
q: clone,
|
834
|
+
m: owner,
|
835
|
+
t: setup,
|
836
|
+
d: params,
|
912
837
|
x: closures,
|
913
|
-
|
838
|
+
n: dynamicScopesAccessor
|
914
839
|
});
|
915
840
|
}
|
916
841
|
function registerContent(id, template, walks, setup, params, closures, dynamicScopesAccessor) {
|
@@ -966,7 +891,7 @@ function triggerMacroTask() {
|
|
966
891
|
function state(valueAccessor, fn) {
|
967
892
|
if (0)
|
968
893
|
var id;
|
969
|
-
let valueChangeAccessor =
|
894
|
+
let valueChangeAccessor = "@" /* TagVariableChange */ + valueAccessor, update = (scope, value2) => {
|
970
895
|
scope[valueAccessor] !== value2 && (scope[valueAccessor] = value2, fn(scope, value2));
|
971
896
|
};
|
972
897
|
return (scope, value2, valueChange) => (rendering ? ((scope[valueChangeAccessor] = valueChange) && scope[valueAccessor] !== value2 || !(valueAccessor in scope)) && (scope[valueAccessor] = value2, fn(scope, value2)) : scope[valueChangeAccessor] ? scope[valueChangeAccessor](value2) : (schedule(), queueRender(
|
@@ -982,31 +907,31 @@ function value(valueAccessor, fn = () => {
|
|
982
907
|
(!(valueAccessor in scope) || scope[valueAccessor] !== value2) && (scope[valueAccessor] = value2, fn(scope, value2));
|
983
908
|
};
|
984
909
|
}
|
985
|
-
function intersection(id, fn, defaultPending = 1, scopeIdAccessor = /* @__KEY__ */ "
|
910
|
+
function intersection(id, fn, defaultPending = 1, scopeIdAccessor = /* @__KEY__ */ "e") {
|
986
911
|
return (scope) => {
|
987
|
-
scope.
|
912
|
+
scope.h ? scope[id] === void 0 ? scope[id] = defaultPending : --scope[id] || fn(scope) : queueRender(scope, fn, id, 0, scope[scopeIdAccessor]);
|
988
913
|
};
|
989
914
|
}
|
990
915
|
function loopClosure(valueAccessor, ownerLoopNodeAccessor, fn) {
|
991
|
-
let childSignal = closure(valueAccessor, fn), loopScopeAccessor =
|
916
|
+
let childSignal = closure(valueAccessor, fn), loopScopeAccessor = "l" /* LoopScopeArray */ + ownerLoopNodeAccessor, loopScopeMapAccessor = "m" /* LoopScopeMap */ + ownerLoopNodeAccessor, ownerSignal = (ownerScope) => {
|
992
917
|
let scopes = ownerScope[loopScopeAccessor] || ownerScope[loopScopeMapAccessor]?.values() || [], [firstScope] = scopes;
|
993
918
|
firstScope && queueRender(
|
994
919
|
ownerScope,
|
995
920
|
() => {
|
996
921
|
for (let scope of scopes)
|
997
|
-
!scope.
|
922
|
+
!scope.h && !scope.k && childSignal(scope);
|
998
923
|
},
|
999
924
|
-1,
|
1000
925
|
0,
|
1001
|
-
firstScope.
|
926
|
+
firstScope.e
|
1002
927
|
);
|
1003
928
|
};
|
1004
929
|
return ownerSignal._ = childSignal, ownerSignal;
|
1005
930
|
}
|
1006
931
|
function conditionalClosure(valueAccessor, ownerConditionalNodeAccessor, branch, fn) {
|
1007
|
-
let childSignal = closure(valueAccessor, fn), scopeAccessor =
|
932
|
+
let childSignal = closure(valueAccessor, fn), scopeAccessor = "d" /* ConditionalScope */ + ownerConditionalNodeAccessor, branchAccessor = "c" /* ConditionalRenderer */ + ownerConditionalNodeAccessor, ownerSignal = (scope) => {
|
1008
933
|
let ifScope = scope[scopeAccessor];
|
1009
|
-
ifScope && !ifScope.
|
934
|
+
ifScope && !ifScope.h && scope[branchAccessor] === branch && queueRender(ifScope, childSignal, -1);
|
1010
935
|
};
|
1011
936
|
return ownerSignal._ = childSignal, ownerSignal;
|
1012
937
|
}
|
@@ -1024,7 +949,7 @@ function dynamicClosure(...closureSignals) {
|
|
1024
949
|
return (scope) => {
|
1025
950
|
if (scope[___scopeInstancesAccessor])
|
1026
951
|
for (let childScope of scope[___scopeInstancesAccessor])
|
1027
|
-
childScope.
|
952
|
+
childScope.h || queueRender(
|
1028
953
|
childScope,
|
1029
954
|
closureSignals[childScope[___signalIndexAccessor]],
|
1030
955
|
-1
|
@@ -1039,7 +964,7 @@ function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
|
|
1039
964
|
scope
|
1040
965
|
);
|
1041
966
|
};
|
1042
|
-
return closureSignal.y =
|
967
|
+
return closureSignal.y = "a" /* ClosureScopes */ + valueAccessor, closureSignal.z = "b" /* ClosureSignalIndex */ + valueAccessor, closureSignal;
|
1043
968
|
}
|
1044
969
|
function closure(valueAccessor, fn, getOwnerScope) {
|
1045
970
|
return (scope) => {
|
@@ -1078,8 +1003,96 @@ function hoist(...path) {
|
|
1078
1003
|
}
|
1079
1004
|
|
1080
1005
|
// src/dom/control-flow.ts
|
1006
|
+
function awaitTag(nodeAccessor, renderer) {
|
1007
|
+
let promiseAccessor = "n" /* Promise */ + nodeAccessor, branchAccessor = "d" /* ConditionalScope */ + nodeAccessor;
|
1008
|
+
return (scope, promise) => {
|
1009
|
+
let tryBranch = scope.c, awaitBranch = scope[branchAccessor], referenceNode = scope[nodeAccessor], namespaceNode = (awaitBranch?.a ?? referenceNode).parentNode;
|
1010
|
+
for (; tryBranch && !tryBranch["%" /* PlaceholderContent */]; )
|
1011
|
+
tryBranch = tryBranch.g;
|
1012
|
+
let thisPromise = scope[promiseAccessor] = promise.then((data2) => {
|
1013
|
+
if (scope.c?.k || scope[promiseAccessor] !== thisPromise)
|
1014
|
+
return;
|
1015
|
+
scope[promiseAccessor] = void 0;
|
1016
|
+
let effects = prepareEffects(() => {
|
1017
|
+
(!awaitBranch || !tryBranch) && (insertBranchBefore(
|
1018
|
+
awaitBranch ??= scope[branchAccessor] = createAndSetupBranch(
|
1019
|
+
scope.$global,
|
1020
|
+
renderer,
|
1021
|
+
scope,
|
1022
|
+
namespaceNode
|
1023
|
+
),
|
1024
|
+
referenceNode.parentNode,
|
1025
|
+
referenceNode
|
1026
|
+
), referenceNode.remove()), renderer.d?.(awaitBranch, [data2]);
|
1027
|
+
});
|
1028
|
+
if (tryBranch) {
|
1029
|
+
if (!--tryBranch.o) {
|
1030
|
+
let placeholderBranch = tryBranch["#" /* PlaceholderBranch */];
|
1031
|
+
placeholderBranch ? (insertBranchBefore(
|
1032
|
+
tryBranch,
|
1033
|
+
placeholderBranch.a.parentNode,
|
1034
|
+
placeholderBranch.a
|
1035
|
+
), removeAndDestroyBranch(placeholderBranch)) : insertBranchBefore(
|
1036
|
+
tryBranch,
|
1037
|
+
referenceNode.parentNode,
|
1038
|
+
referenceNode
|
1039
|
+
);
|
1040
|
+
}
|
1041
|
+
} else
|
1042
|
+
runEffects(effects);
|
1043
|
+
}).catch((error) => {
|
1044
|
+
let tryBranch2 = scope.c;
|
1045
|
+
for (; tryBranch2 && !tryBranch2["^" /* CatchContent */]; )
|
1046
|
+
tryBranch2 = tryBranch2.g;
|
1047
|
+
tryBranch2 ? (setConditionalRenderer(
|
1048
|
+
tryBranch2._,
|
1049
|
+
tryBranch2["*" /* BranchAccessor */],
|
1050
|
+
tryBranch2["^" /* CatchContent */],
|
1051
|
+
createAndSetupBranch
|
1052
|
+
), tryBranch2["^" /* CatchContent */].d?.(
|
1053
|
+
tryBranch2._["d" /* ConditionalScope */ + tryBranch2["*" /* BranchAccessor */]],
|
1054
|
+
[error]
|
1055
|
+
)) : setTimeout(() => {
|
1056
|
+
throw error;
|
1057
|
+
});
|
1058
|
+
});
|
1059
|
+
tryBranch ? (tryBranch.o || (tryBranch.o = 0, requestAnimationFrame(() => {
|
1060
|
+
if (tryBranch.o && !tryBranch.k) {
|
1061
|
+
let placeholderBranch = tryBranch["#" /* PlaceholderBranch */] = createAndSetupBranch(
|
1062
|
+
scope.$global,
|
1063
|
+
tryBranch["%" /* PlaceholderContent */],
|
1064
|
+
tryBranch._,
|
1065
|
+
tryBranch.a.parentNode
|
1066
|
+
);
|
1067
|
+
insertBranchBefore(
|
1068
|
+
placeholderBranch,
|
1069
|
+
tryBranch.a.parentNode,
|
1070
|
+
tryBranch.a
|
1071
|
+
), tempDetatchBranch(tryBranch);
|
1072
|
+
}
|
1073
|
+
})), tryBranch.o++) : awaitBranch && (awaitBranch.a.parentNode.insertBefore(
|
1074
|
+
referenceNode,
|
1075
|
+
awaitBranch.a
|
1076
|
+
), tempDetatchBranch(awaitBranch));
|
1077
|
+
};
|
1078
|
+
}
|
1079
|
+
function createTry(nodeAccessor, tryContent) {
|
1080
|
+
let branchAccessor = "d" /* ConditionalScope */ + nodeAccessor;
|
1081
|
+
return (scope, input) => {
|
1082
|
+
scope[branchAccessor] || setConditionalRenderer(
|
1083
|
+
scope,
|
1084
|
+
nodeAccessor,
|
1085
|
+
tryContent,
|
1086
|
+
createAndSetupBranch
|
1087
|
+
);
|
1088
|
+
let branch = scope[branchAccessor];
|
1089
|
+
branch && (branch["*" /* BranchAccessor */] = nodeAccessor, branch["^" /* CatchContent */] = normalizeDynamicRenderer(input.catch), branch["%" /* PlaceholderContent */] = normalizeDynamicRenderer(
|
1090
|
+
input.placeholder
|
1091
|
+
));
|
1092
|
+
};
|
1093
|
+
}
|
1081
1094
|
function conditional(nodeAccessor, ...branches) {
|
1082
|
-
let branchAccessor =
|
1095
|
+
let branchAccessor = "c" /* ConditionalRenderer */ + nodeAccessor;
|
1083
1096
|
return (scope, newBranch) => {
|
1084
1097
|
newBranch !== scope[branchAccessor] && setConditionalRenderer(
|
1085
1098
|
scope,
|
@@ -1093,10 +1106,10 @@ function patchDynamicTag(fn) {
|
|
1093
1106
|
dynamicTag = fn(dynamicTag);
|
1094
1107
|
}
|
1095
1108
|
var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
1096
|
-
let childScopeAccessor =
|
1109
|
+
let childScopeAccessor = "d" /* ConditionalScope */ + nodeAccessor, rendererAccessor = "c" /* ConditionalRenderer */ + nodeAccessor;
|
1097
1110
|
return (scope, newRenderer, getInput) => {
|
1098
1111
|
let normalizedRenderer = normalizeDynamicRenderer(newRenderer);
|
1099
|
-
if (scope[rendererAccessor] !== (scope[rendererAccessor] = normalizedRenderer?.
|
1112
|
+
if (scope[rendererAccessor] !== (scope[rendererAccessor] = normalizedRenderer?.e || normalizedRenderer) || getContent && !(normalizedRenderer || scope[childScopeAccessor]))
|
1100
1113
|
if (setConditionalRenderer(
|
1101
1114
|
scope,
|
1102
1115
|
nodeAccessor,
|
@@ -1110,15 +1123,15 @@ var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
|
1110
1123
|
0,
|
1111
1124
|
content,
|
1112
1125
|
createAndSetupBranch
|
1113
|
-
), content.
|
1114
|
-
content.
|
1115
|
-
content.
|
1116
|
-
scope[childScopeAccessor][
|
1126
|
+
), content.n && subscribeToScopeSet(
|
1127
|
+
content.m,
|
1128
|
+
content.n,
|
1129
|
+
scope[childScopeAccessor]["d" /* ConditionalScope */ + 0]
|
1117
1130
|
);
|
1118
1131
|
}
|
1119
|
-
} else normalizedRenderer?.
|
1120
|
-
normalizedRenderer.
|
1121
|
-
normalizedRenderer.
|
1132
|
+
} else normalizedRenderer?.n && subscribeToScopeSet(
|
1133
|
+
normalizedRenderer.m,
|
1134
|
+
normalizedRenderer.n,
|
1122
1135
|
scope[childScopeAccessor]
|
1123
1136
|
);
|
1124
1137
|
if (normalizedRenderer) {
|
@@ -1129,9 +1142,9 @@ var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
|
1129
1142
|
0,
|
1130
1143
|
(inputIsArgs ? args[0] : args) || {}
|
1131
1144
|
);
|
1132
|
-
else if (normalizedRenderer.
|
1145
|
+
else if (normalizedRenderer.d)
|
1133
1146
|
if (inputIsArgs)
|
1134
|
-
normalizedRenderer.
|
1147
|
+
normalizedRenderer.d(
|
1135
1148
|
scope[childScopeAccessor],
|
1136
1149
|
normalizedRenderer._ ? args[0] : args
|
1137
1150
|
);
|
@@ -1140,7 +1153,7 @@ var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
|
1140
1153
|
...args,
|
1141
1154
|
content: getContent(scope)
|
1142
1155
|
} : args || {};
|
1143
|
-
normalizedRenderer.
|
1156
|
+
normalizedRenderer.d(
|
1144
1157
|
scope[childScopeAccessor],
|
1145
1158
|
normalizedRenderer._ ? inputWithContent : [inputWithContent]
|
1146
1159
|
);
|
@@ -1149,7 +1162,7 @@ var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
|
1149
1162
|
};
|
1150
1163
|
};
|
1151
1164
|
function setConditionalRenderer(scope, nodeAccessor, newRenderer, createBranch2) {
|
1152
|
-
let referenceNode = scope[nodeAccessor], prevBranch = scope[
|
1165
|
+
let referenceNode = scope[nodeAccessor], prevBranch = scope["d" /* ConditionalScope */ + nodeAccessor], parentNode = referenceNode.nodeType > 1 /* Element */ ? (prevBranch?.a || referenceNode).parentNode : referenceNode, newBranch = scope["d" /* ConditionalScope */ + nodeAccessor] = newRenderer && createBranch2(scope.$global, newRenderer, scope, parentNode);
|
1153
1166
|
referenceNode === parentNode ? (prevBranch && (destroyBranch(prevBranch), referenceNode.textContent = ""), newBranch && insertBranchBefore(newBranch, parentNode, null)) : prevBranch ? (newBranch ? insertBranchBefore(newBranch, parentNode, prevBranch.a) : parentNode.insertBefore(referenceNode, prevBranch.a), removeAndDestroyBranch(prevBranch)) : newBranch && (insertBranchBefore(newBranch, parentNode, referenceNode), referenceNode.remove());
|
1154
1167
|
}
|
1155
1168
|
function loopOf(nodeAccessor, renderer) {
|
@@ -1179,11 +1192,11 @@ function loopTo(nodeAccessor, renderer) {
|
|
1179
1192
|
);
|
1180
1193
|
}
|
1181
1194
|
function loop(nodeAccessor, renderer, forEach) {
|
1182
|
-
let params = renderer.
|
1195
|
+
let params = renderer.d;
|
1183
1196
|
return (scope, value2) => {
|
1184
|
-
let referenceNode = scope[nodeAccessor], oldMap = scope[
|
1197
|
+
let referenceNode = scope[nodeAccessor], oldMap = scope["m" /* LoopScopeMap */ + nodeAccessor], oldArray = oldMap ? scope["l" /* LoopScopeArray */ + nodeAccessor] || [
|
1185
1198
|
...oldMap.values()
|
1186
|
-
] : [], parentNode = referenceNode.nodeType > 1 /* Element */ ? referenceNode.parentNode || oldArray[0].a.parentNode : referenceNode, newMap = scope[
|
1199
|
+
] : [], parentNode = referenceNode.nodeType > 1 /* Element */ ? referenceNode.parentNode || oldArray[0].a.parentNode : referenceNode, newMap = scope["m" /* LoopScopeMap */ + nodeAccessor] = /* @__PURE__ */ new Map(), newArray = scope["l" /* LoopScopeArray */ + nodeAccessor] = [];
|
1187
1200
|
forEach(value2, (key, args) => {
|
1188
1201
|
let branch = oldMap?.get(key) || createAndSetupBranch(scope.$global, renderer, scope, parentNode);
|
1189
1202
|
params?.(branch, args), newMap.set(key, branch), newArray.push(branch);
|
@@ -1211,6 +1224,113 @@ function byFirstArg(name) {
|
|
1211
1224
|
return name;
|
1212
1225
|
}
|
1213
1226
|
|
1227
|
+
// src/dom/queue.ts
|
1228
|
+
var pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map(), pendingEffects = [], rendering = !1, scopeKeyOffset = 1e3;
|
1229
|
+
function queueRender(scope, signal, signalKey, value2, scopeKey = scope.e) {
|
1230
|
+
let key = scopeKey * scopeKeyOffset + signalKey, existingRender = signalKey >= 0 && pendingRendersLookup.get(key);
|
1231
|
+
if (existingRender)
|
1232
|
+
existingRender.A = value2;
|
1233
|
+
else {
|
1234
|
+
let render = {
|
1235
|
+
j: key,
|
1236
|
+
u: scope,
|
1237
|
+
D: signal,
|
1238
|
+
A: value2
|
1239
|
+
}, i = pendingRenders.push(render) - 1;
|
1240
|
+
for (; i; ) {
|
1241
|
+
let parentIndex = i - 1 >> 1, parent = pendingRenders[parentIndex];
|
1242
|
+
if (key - parent.j >= 0) break;
|
1243
|
+
pendingRenders[i] = parent, i = parentIndex;
|
1244
|
+
}
|
1245
|
+
signalKey >= 0 && pendingRendersLookup.set(key, render), pendingRenders[i] = render;
|
1246
|
+
}
|
1247
|
+
}
|
1248
|
+
function queueEffect(scope, fn) {
|
1249
|
+
pendingEffects.push(fn, scope);
|
1250
|
+
}
|
1251
|
+
function run() {
|
1252
|
+
let effects = pendingEffects;
|
1253
|
+
try {
|
1254
|
+
rendering = !0, runRenders();
|
1255
|
+
} finally {
|
1256
|
+
pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map(), pendingEffects = [], rendering = !1;
|
1257
|
+
}
|
1258
|
+
runEffects(effects);
|
1259
|
+
}
|
1260
|
+
function prepareEffects(fn) {
|
1261
|
+
let prevRenders = pendingRenders, prevRendersLookup = pendingRendersLookup, prevEffects = pendingEffects, preparedEffects = pendingEffects = [];
|
1262
|
+
pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map();
|
1263
|
+
try {
|
1264
|
+
rendering = !0, fn(), runRenders();
|
1265
|
+
} finally {
|
1266
|
+
rendering = !1, pendingRenders = prevRenders, pendingRendersLookup = prevRendersLookup, pendingEffects = prevEffects;
|
1267
|
+
}
|
1268
|
+
return preparedEffects;
|
1269
|
+
}
|
1270
|
+
function runEffects(effects) {
|
1271
|
+
for (let i = 0, scope; i < effects.length; )
|
1272
|
+
effects[i++](
|
1273
|
+
scope = effects[i++],
|
1274
|
+
scope
|
1275
|
+
);
|
1276
|
+
}
|
1277
|
+
function runRenders() {
|
1278
|
+
for (; pendingRenders.length; ) {
|
1279
|
+
let render = pendingRenders[0], item = pendingRenders.pop();
|
1280
|
+
if (render !== item) {
|
1281
|
+
let i = 0, mid = pendingRenders.length >> 1, key = (pendingRenders[0] = item).j;
|
1282
|
+
for (; i < mid; ) {
|
1283
|
+
let bestChild = (i << 1) + 1, right = bestChild + 1;
|
1284
|
+
if (right < pendingRenders.length && pendingRenders[right].j - pendingRenders[bestChild].j < 0 && (bestChild = right), pendingRenders[bestChild].j - key >= 0)
|
1285
|
+
break;
|
1286
|
+
pendingRenders[i] = pendingRenders[bestChild], i = bestChild;
|
1287
|
+
}
|
1288
|
+
pendingRenders[i] = item;
|
1289
|
+
}
|
1290
|
+
render.u.c?.k || runRender(render);
|
1291
|
+
}
|
1292
|
+
finishPendingScopes();
|
1293
|
+
}
|
1294
|
+
var runRender = (render) => render.D(render.u, render.A), enableCatch = () => {
|
1295
|
+
enableCatch = () => {
|
1296
|
+
}, runRender = /* @__PURE__ */ ((runRender2) => (render) => {
|
1297
|
+
try {
|
1298
|
+
runRender2(render);
|
1299
|
+
} catch (error) {
|
1300
|
+
let branch = render.u.c;
|
1301
|
+
for (; branch && !branch["^" /* CatchContent */]; )
|
1302
|
+
branch = branch.g;
|
1303
|
+
if (branch)
|
1304
|
+
setConditionalRenderer(
|
1305
|
+
branch._,
|
1306
|
+
branch["*" /* BranchAccessor */],
|
1307
|
+
branch["^" /* CatchContent */],
|
1308
|
+
createAndSetupBranch
|
1309
|
+
), branch["^" /* CatchContent */].d?.(
|
1310
|
+
branch._["d" /* ConditionalScope */ + branch["*" /* BranchAccessor */]],
|
1311
|
+
[error]
|
1312
|
+
);
|
1313
|
+
else
|
1314
|
+
throw error;
|
1315
|
+
}
|
1316
|
+
})(runRender);
|
1317
|
+
};
|
1318
|
+
|
1319
|
+
// src/dom/abort-signal.ts
|
1320
|
+
function resetAbortSignal(scope, id) {
|
1321
|
+
let ctrl = scope.l?.[id];
|
1322
|
+
ctrl && (queueEffect(ctrl, abort), scope.l[id] = void 0);
|
1323
|
+
}
|
1324
|
+
function getAbortSignal(scope, id) {
|
1325
|
+
return scope.c && (scope.c.B ||= /* @__PURE__ */ new Set()).add(scope), ((scope.l ||= {})[id] ||= new AbortController()).signal;
|
1326
|
+
}
|
1327
|
+
function abort(ctrl) {
|
1328
|
+
ctrl.abort();
|
1329
|
+
}
|
1330
|
+
|
1331
|
+
// src/common/compat-meta.ts
|
1332
|
+
var prefix = "$C_", RENDERER_REGISTER_ID = prefix + "r", SET_SCOPE_REGISTER_ID = prefix + "s", RENDER_BODY_ID = prefix + "b";
|
1333
|
+
|
1214
1334
|
// src/dom/compat.ts
|
1215
1335
|
var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
1216
1336
|
patchDynamicTag,
|
@@ -1224,7 +1344,7 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
1224
1344
|
register(RENDERER_REGISTER_ID, fn);
|
1225
1345
|
},
|
1226
1346
|
isRenderer(renderer) {
|
1227
|
-
return renderer.
|
1347
|
+
return renderer.q;
|
1228
1348
|
},
|
1229
1349
|
getStartNode(branch) {
|
1230
1350
|
return branch.a;
|
@@ -1249,7 +1369,7 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
1249
1369
|
},
|
1250
1370
|
createRenderer(params, clone) {
|
1251
1371
|
let renderer = createRenderer(0, 0, 0, params);
|
1252
|
-
return renderer.
|
1372
|
+
return renderer.q = (branch) => {
|
1253
1373
|
let cloned = clone();
|
1254
1374
|
branch.a = cloned.startNode, branch.b = cloned.endNode;
|
1255
1375
|
}, renderer;
|
@@ -1267,9 +1387,9 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
1267
1387
|
branch ? existing = !0 : (out.global.f ||= 0, branch = component.scope = createAndSetupBranch(
|
1268
1388
|
out.global,
|
1269
1389
|
renderer,
|
1270
|
-
renderer.
|
1390
|
+
renderer.m,
|
1271
1391
|
document.body
|
1272
|
-
)), renderer.
|
1392
|
+
)), renderer.d?.(branch, renderer._ ? args[0] : args);
|
1273
1393
|
}), !existing)
|
1274
1394
|
return toInsertNode(branch.a, branch.b);
|
1275
1395
|
}
|
@@ -1308,13 +1428,13 @@ function mount(input = {}, reference, position) {
|
|
1308
1428
|
parentNode = reference.parentNode, nextSibling = reference.nextSibling;
|
1309
1429
|
break;
|
1310
1430
|
}
|
1311
|
-
let args = this.
|
1431
|
+
let args = this.d, effects = prepareEffects(() => {
|
1312
1432
|
branch = createBranch(
|
1313
1433
|
$global,
|
1314
1434
|
this,
|
1315
1435
|
void 0,
|
1316
1436
|
parentNode
|
1317
|
-
), this.
|
1437
|
+
), this.t?.(branch), args?.(branch, input);
|
1318
1438
|
});
|
1319
1439
|
return insertChildNodes(
|
1320
1440
|
parentNode,
|
@@ -1340,6 +1460,7 @@ export {
|
|
1340
1460
|
attrTags,
|
1341
1461
|
attrs,
|
1342
1462
|
attrsEvents,
|
1463
|
+
awaitTag,
|
1343
1464
|
classAttr,
|
1344
1465
|
compat,
|
1345
1466
|
conditional,
|
@@ -1359,11 +1480,13 @@ export {
|
|
1359
1480
|
createContent,
|
1360
1481
|
createRenderer,
|
1361
1482
|
createTemplate,
|
1483
|
+
createTry,
|
1362
1484
|
data,
|
1363
1485
|
dynamicClosure,
|
1364
1486
|
dynamicClosureRead,
|
1365
1487
|
dynamicTag,
|
1366
1488
|
effect,
|
1489
|
+
enableCatch,
|
1367
1490
|
forIn,
|
1368
1491
|
forOf,
|
1369
1492
|
forTo,
|