marko 6.0.0-next.3.71 → 6.0.0-next.3.72
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/types.d.ts +5 -5
- package/dist/debug/dom.js +93 -85
- package/dist/debug/dom.mjs +93 -85
- package/dist/debug/html.js +4 -3
- package/dist/debug/html.mjs +4 -3
- package/dist/dom/control-flow.d.ts +1 -1
- package/dist/dom/queue.d.ts +1 -1
- package/dist/dom/resume.d.ts +1 -1
- package/dist/dom/schedule.d.ts +0 -1
- package/dist/dom.js +105 -98
- package/dist/dom.mjs +105 -98
- package/dist/html.js +4 -3
- package/dist/html.mjs +4 -3
- package/dist/translator/index.js +63 -72
- package/dist/translator/util/signals.d.ts +0 -1
- package/index.d.ts +22 -14
- package/package.json +1 -1
package/dist/dom.js
CHANGED
@@ -263,13 +263,13 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
|
|
263
263
|
}
|
264
264
|
if (resumes)
|
265
265
|
try {
|
266
|
-
render.r = [], isResuming =
|
266
|
+
render.r = [], isResuming = 1;
|
267
267
|
for (let i = 0; i < resumes.length; i++) {
|
268
268
|
let serialized = resumes[i];
|
269
269
|
if (typeof serialized == "function")
|
270
270
|
for (let scope of serialized(serializeContext))
|
271
271
|
if (!$global)
|
272
|
-
$global = scope || {}, $global.runtimeId = runtimeId, $global.renderId = renderId, $global.
|
272
|
+
$global = scope || {}, $global.runtimeId = runtimeId, $global.renderId = renderId, $global.o = 1e6;
|
273
273
|
else if (typeof scope == "number")
|
274
274
|
lastScopeId += scope;
|
275
275
|
else {
|
@@ -281,7 +281,7 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
|
|
281
281
|
let parentBranchId = scope.g || parentBranchIds.get(scopeId);
|
282
282
|
if (parentBranchId && (scope.k = scopeLookup[parentBranchId]), branchIds.has(scopeId)) {
|
283
283
|
let branch = scope, parentBranch = branch.k;
|
284
|
-
scope.k = branch, parentBranch && (branch.
|
284
|
+
scope.k = branch, parentBranch && (branch.t = parentBranch, (parentBranch.z ||= /* @__PURE__ */ new Set()).add(
|
285
285
|
branch
|
286
286
|
));
|
287
287
|
}
|
@@ -293,7 +293,7 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
|
|
293
293
|
);
|
294
294
|
}
|
295
295
|
} finally {
|
296
|
-
isResuming =
|
296
|
+
isResuming = 0;
|
297
297
|
}
|
298
298
|
}, render;
|
299
299
|
}
|
@@ -309,7 +309,7 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
|
|
309
309
|
set: initRuntime
|
310
310
|
});
|
311
311
|
}
|
312
|
-
var isResuming
|
312
|
+
var isResuming;
|
313
313
|
function register(id, obj) {
|
314
314
|
return registeredValues[id] = obj, obj;
|
315
315
|
}
|
@@ -714,34 +714,34 @@ function toInsertNode(startNode, endNode) {
|
|
714
714
|
var pendingScopes = [];
|
715
715
|
function createScope($global, closestBranch) {
|
716
716
|
let scope = {
|
717
|
-
m: $global.
|
718
|
-
|
717
|
+
m: $global.o++,
|
718
|
+
p: 1,
|
719
719
|
k: closestBranch,
|
720
720
|
$global
|
721
721
|
};
|
722
722
|
return pendingScopes.push(scope), scope;
|
723
723
|
}
|
724
724
|
function skipScope(scope) {
|
725
|
-
return scope.$global.
|
725
|
+
return scope.$global.o++;
|
726
726
|
}
|
727
727
|
function finishPendingScopes() {
|
728
728
|
for (let scope of pendingScopes)
|
729
|
-
scope.
|
729
|
+
scope.p = 0;
|
730
730
|
pendingScopes = [];
|
731
731
|
}
|
732
732
|
function findBranchWithKey(scope, key) {
|
733
733
|
let branch = scope.k;
|
734
734
|
for (; branch && !branch[key]; )
|
735
|
-
branch = branch.
|
735
|
+
branch = branch.t;
|
736
736
|
return branch;
|
737
737
|
}
|
738
738
|
function destroyBranch(branch) {
|
739
|
-
branch.
|
739
|
+
branch.t?.z?.delete(branch), destroyNestedBranches(branch);
|
740
740
|
}
|
741
741
|
function destroyNestedBranches(branch) {
|
742
|
-
branch.
|
743
|
-
for (let id in scope.
|
744
|
-
scope.
|
742
|
+
branch.A = 1, branch.z?.forEach(destroyNestedBranches), branch.J?.forEach((scope) => {
|
743
|
+
for (let id in scope.u)
|
744
|
+
scope.u[id]?.abort();
|
745
745
|
});
|
746
746
|
}
|
747
747
|
function removeAndDestroyBranch(branch) {
|
@@ -881,7 +881,7 @@ function walkInternal(currentWalkIndex, walkCodes, scope) {
|
|
881
881
|
// src/dom/renderer.ts
|
882
882
|
function createBranch($global, renderer, parentScope, parentNode) {
|
883
883
|
let branch = createScope($global), parentBranch = parentScope?.k;
|
884
|
-
return branch._ = renderer.
|
884
|
+
return branch._ = renderer.x || parentScope, branch.k = branch, parentBranch && (branch.t = parentBranch, (parentBranch.z ||= /* @__PURE__ */ new Set()).add(branch)), renderer.B?.(
|
885
885
|
branch,
|
886
886
|
parentNode.namespaceURI
|
887
887
|
), branch;
|
@@ -918,11 +918,11 @@ function createContent(id, template, walks, setup, params, closures, dynamicScop
|
|
918
918
|
return (owner) => ({
|
919
919
|
m: id,
|
920
920
|
B: clone,
|
921
|
-
|
921
|
+
x: owner,
|
922
922
|
C: setup,
|
923
923
|
l: params,
|
924
924
|
E: closures,
|
925
|
-
|
925
|
+
y: dynamicScopesAccessor
|
926
926
|
});
|
927
927
|
}
|
928
928
|
function registerContent(id, template, walks, setup, params, closures, dynamicScopesAccessor) {
|
@@ -961,11 +961,11 @@ function createCloneableHTML(html2, ns) {
|
|
961
961
|
var port2 = /* @__PURE__ */ (() => {
|
962
962
|
let { port1, port2: port22 } = new MessageChannel();
|
963
963
|
return port1.onmessage = () => {
|
964
|
-
isScheduled =
|
964
|
+
isScheduled = 0, run();
|
965
965
|
}, port22;
|
966
966
|
})(), isScheduled;
|
967
967
|
function schedule() {
|
968
|
-
isScheduled || (isScheduled =
|
968
|
+
isScheduled || (isScheduled = 1, queueMicrotask(flushAndWaitFrame));
|
969
969
|
}
|
970
970
|
function flushAndWaitFrame() {
|
971
971
|
run(), requestAnimationFrame(triggerMacroTask);
|
@@ -996,7 +996,7 @@ function value(valueAccessor, fn = () => {
|
|
996
996
|
}
|
997
997
|
function intersection(id, fn, defaultPending = 1, scopeIdAccessor = /* @__KEY__ */ "m") {
|
998
998
|
return (scope) => {
|
999
|
-
scope.
|
999
|
+
scope.p ? scope[id] === void 0 ? scope[id] = defaultPending : --scope[id] || fn(scope) : queueRender(scope, fn, id, 0, scope[scopeIdAccessor]);
|
1000
1000
|
};
|
1001
1001
|
}
|
1002
1002
|
function loopClosure(valueAccessor, ownerLoopNodeAccessor, fn) {
|
@@ -1006,7 +1006,7 @@ function loopClosure(valueAccessor, ownerLoopNodeAccessor, fn) {
|
|
1006
1006
|
ownerScope,
|
1007
1007
|
() => {
|
1008
1008
|
for (let scope of scopes)
|
1009
|
-
!scope.
|
1009
|
+
!scope.p && !scope.A && childSignal(scope);
|
1010
1010
|
},
|
1011
1011
|
-1,
|
1012
1012
|
0,
|
@@ -1018,7 +1018,7 @@ function loopClosure(valueAccessor, ownerLoopNodeAccessor, fn) {
|
|
1018
1018
|
function conditionalClosure(valueAccessor, ownerConditionalNodeAccessor, branch, fn) {
|
1019
1019
|
let childSignal = closure(valueAccessor, fn), scopeAccessor = "d" /* ConditionalScope */ + ownerConditionalNodeAccessor, branchAccessor = "c" /* ConditionalRenderer */ + ownerConditionalNodeAccessor, ownerSignal = (scope) => {
|
1020
1020
|
let ifScope = scope[scopeAccessor];
|
1021
|
-
ifScope && !ifScope.
|
1021
|
+
ifScope && !ifScope.p && scope[branchAccessor] === branch && queueRender(ifScope, childSignal, -1);
|
1022
1022
|
};
|
1023
1023
|
return ownerSignal._ = childSignal, ownerSignal;
|
1024
1024
|
}
|
@@ -1036,7 +1036,7 @@ function dynamicClosure(...closureSignals) {
|
|
1036
1036
|
return (scope) => {
|
1037
1037
|
if (scope[___scopeInstancesAccessor])
|
1038
1038
|
for (let childScope of scope[___scopeInstancesAccessor])
|
1039
|
-
childScope.
|
1039
|
+
childScope.p || queueRender(
|
1040
1040
|
childScope,
|
1041
1041
|
closureSignals[childScope[___signalIndexAccessor]],
|
1042
1042
|
-1
|
@@ -1096,54 +1096,65 @@ function awaitTag(nodeAccessor, renderer) {
|
|
1096
1096
|
let tryWithPlaceholder = findBranchWithKey(
|
1097
1097
|
scope,
|
1098
1098
|
"d" /* PlaceholderContent */
|
1099
|
-
),
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
() => renderImmediate(() => {
|
1124
|
-
if (tryWithPlaceholder.q && !tryWithPlaceholder.p) {
|
1125
|
-
let placeholderBranch = tryWithPlaceholder.c = createAndSetupBranch(
|
1126
|
-
scope.$global,
|
1127
|
-
tryWithPlaceholder.d,
|
1128
|
-
tryWithPlaceholder._,
|
1129
|
-
tryWithPlaceholder.h.parentNode
|
1130
|
-
);
|
1131
|
-
insertBranchBefore(
|
1132
|
-
placeholderBranch,
|
1133
|
-
tryWithPlaceholder.h.parentNode,
|
1134
|
-
tryWithPlaceholder.h
|
1135
|
-
), tempDetatchBranch(tryWithPlaceholder);
|
1136
|
-
}
|
1137
|
-
})
|
1138
|
-
)), tryWithPlaceholder.q++) : awaitBranch && (awaitBranch.h.parentNode.insertBefore(
|
1099
|
+
), referenceNode = scope[nodeAccessor], awaitBranch = scope[branchAccessor];
|
1100
|
+
tryWithPlaceholder ? (placeholderShown.add(pendingEffects), !scope[promiseAccessor] && (tryWithPlaceholder.n = (tryWithPlaceholder.n || 0) + 1) === 1 && requestAnimationFrame(
|
1101
|
+
() => tryWithPlaceholder.n && runEffects(
|
1102
|
+
prepareEffects(
|
1103
|
+
() => queueRender(
|
1104
|
+
tryWithPlaceholder,
|
1105
|
+
() => {
|
1106
|
+
let placeholderBranch = tryWithPlaceholder.c = createAndSetupBranch(
|
1107
|
+
scope.$global,
|
1108
|
+
tryWithPlaceholder.d,
|
1109
|
+
tryWithPlaceholder._,
|
1110
|
+
tryWithPlaceholder.h.parentNode
|
1111
|
+
);
|
1112
|
+
insertBranchBefore(
|
1113
|
+
placeholderBranch,
|
1114
|
+
tryWithPlaceholder.h.parentNode,
|
1115
|
+
tryWithPlaceholder.h
|
1116
|
+
), tempDetatchBranch(tryWithPlaceholder);
|
1117
|
+
},
|
1118
|
+
-1
|
1119
|
+
)
|
1120
|
+
)
|
1121
|
+
)
|
1122
|
+
)) : awaitBranch && (awaitBranch.h.parentNode.insertBefore(
|
1139
1123
|
referenceNode,
|
1140
1124
|
awaitBranch.h
|
1141
1125
|
), tempDetatchBranch(awaitBranch));
|
1126
|
+
let thisPromise = scope[promiseAccessor] = promise.then(
|
1127
|
+
(data2) => {
|
1128
|
+
thisPromise === scope[promiseAccessor] && (scope[promiseAccessor] = 0, schedule(), queueRender(
|
1129
|
+
scope,
|
1130
|
+
() => {
|
1131
|
+
if ((!awaitBranch || !tryWithPlaceholder) && (insertBranchBefore(
|
1132
|
+
awaitBranch ??= scope[branchAccessor] = createAndSetupBranch(
|
1133
|
+
scope.$global,
|
1134
|
+
renderer,
|
1135
|
+
scope,
|
1136
|
+
referenceNode.parentNode
|
1137
|
+
),
|
1138
|
+
referenceNode.parentNode,
|
1139
|
+
referenceNode
|
1140
|
+
), referenceNode.remove()), renderer.l?.(awaitBranch, [data2]), tryWithPlaceholder && (placeholderShown.add(pendingEffects), !--tryWithPlaceholder.n)) {
|
1141
|
+
let placeholderBranch = tryWithPlaceholder.c;
|
1142
|
+
tryWithPlaceholder.c = 0, placeholderBranch && (insertBranchBefore(
|
1143
|
+
tryWithPlaceholder,
|
1144
|
+
placeholderBranch.h.parentNode,
|
1145
|
+
placeholderBranch.h
|
1146
|
+
), removeAndDestroyBranch(placeholderBranch)), tryWithPlaceholder.H && runEffects(tryWithPlaceholder.H, !0);
|
1147
|
+
}
|
1148
|
+
},
|
1149
|
+
-1
|
1150
|
+
));
|
1151
|
+
},
|
1152
|
+
(error) => {
|
1153
|
+
thisPromise === scope[promiseAccessor] && (tryWithPlaceholder && (tryWithPlaceholder.n = 0), scope[promiseAccessor] = 0, schedule(), queueRender(scope, renderCatch, -1, error));
|
1154
|
+
}
|
1155
|
+
);
|
1142
1156
|
};
|
1143
1157
|
}
|
1144
|
-
function renderImmediate(cb) {
|
1145
|
-
return runEffects(prepareEffects(cb));
|
1146
|
-
}
|
1147
1158
|
function createTry(nodeAccessor, tryContent) {
|
1148
1159
|
let branchAccessor = "d" /* ConditionalScope */ + nodeAccessor;
|
1149
1160
|
return (scope, input) => {
|
@@ -1159,11 +1170,11 @@ function createTry(nodeAccessor, tryContent) {
|
|
1159
1170
|
));
|
1160
1171
|
};
|
1161
1172
|
}
|
1162
|
-
function renderCatch(scope, error
|
1173
|
+
function renderCatch(scope, error) {
|
1163
1174
|
let tryWithCatch = findBranchWithKey(scope, "b" /* CatchContent */);
|
1164
1175
|
if (tryWithCatch) {
|
1165
1176
|
let placeholderBranch = tryWithCatch.c;
|
1166
|
-
placeholderBranch && (tryWithCatch._["d" /* ConditionalScope */ + tryWithCatch.a] = placeholderBranch, destroyBranch(tryWithCatch)), caughtError.add(pendingEffects), setConditionalRenderer(
|
1177
|
+
placeholderBranch && (tryWithCatch.n = 0, tryWithCatch._["d" /* ConditionalScope */ + tryWithCatch.a] = placeholderBranch, destroyBranch(tryWithCatch)), caughtError.add(pendingEffects), setConditionalRenderer(
|
1167
1178
|
tryWithCatch._,
|
1168
1179
|
tryWithCatch.a,
|
1169
1180
|
tryWithCatch.b,
|
@@ -1172,11 +1183,7 @@ function renderCatch(scope, error, async) {
|
|
1172
1183
|
tryWithCatch._["d" /* ConditionalScope */ + tryWithCatch.a],
|
1173
1184
|
[error]
|
1174
1185
|
);
|
1175
|
-
} else
|
1176
|
-
setTimeout(() => {
|
1177
|
-
throw error;
|
1178
|
-
});
|
1179
|
-
else
|
1186
|
+
} else
|
1180
1187
|
throw error;
|
1181
1188
|
}
|
1182
1189
|
function conditional(nodeAccessor, ...branches) {
|
@@ -1211,15 +1218,15 @@ var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
|
1211
1218
|
0,
|
1212
1219
|
content,
|
1213
1220
|
createAndSetupBranch
|
1214
|
-
), content.
|
1221
|
+
), content.y && subscribeToScopeSet(
|
1222
|
+
content.x,
|
1215
1223
|
content.y,
|
1216
|
-
content.z,
|
1217
1224
|
scope[childScopeAccessor]["d" /* ConditionalScope */ + 0]
|
1218
1225
|
);
|
1219
1226
|
}
|
1220
|
-
} else normalizedRenderer?.
|
1227
|
+
} else normalizedRenderer?.y && subscribeToScopeSet(
|
1228
|
+
normalizedRenderer.x,
|
1221
1229
|
normalizedRenderer.y,
|
1222
|
-
normalizedRenderer.z,
|
1223
1230
|
scope[childScopeAccessor]
|
1224
1231
|
);
|
1225
1232
|
if (normalizedRenderer) {
|
@@ -1310,21 +1317,21 @@ function byFirstArg(name) {
|
|
1310
1317
|
}
|
1311
1318
|
|
1312
1319
|
// src/dom/queue.ts
|
1313
|
-
var pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map(), caughtError = /* @__PURE__ */ new WeakSet(), placeholderShown = /* @__PURE__ */ new WeakSet(), pendingEffects = [], rendering
|
1320
|
+
var pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map(), caughtError = /* @__PURE__ */ new WeakSet(), placeholderShown = /* @__PURE__ */ new WeakSet(), pendingEffects = [], rendering, scopeKeyOffset = 1e3;
|
1314
1321
|
function queueRender(scope, signal, signalKey, value2, scopeKey = scope.m) {
|
1315
1322
|
let key = scopeKey * scopeKeyOffset + signalKey, existingRender = signalKey >= 0 && pendingRendersLookup.get(key);
|
1316
1323
|
if (existingRender)
|
1317
1324
|
existingRender.I = value2;
|
1318
1325
|
else {
|
1319
1326
|
let render = {
|
1320
|
-
|
1327
|
+
q: key,
|
1321
1328
|
D: scope,
|
1322
1329
|
L: signal,
|
1323
1330
|
I: value2
|
1324
1331
|
}, i = pendingRenders.push(render) - 1;
|
1325
1332
|
for (; i; ) {
|
1326
1333
|
let parentIndex = i - 1 >> 1, parent = pendingRenders[parentIndex];
|
1327
|
-
if (key - parent.
|
1334
|
+
if (key - parent.q >= 0) break;
|
1328
1335
|
pendingRenders[i] = parent, i = parentIndex;
|
1329
1336
|
}
|
1330
1337
|
signalKey >= 0 && pendingRendersLookup.set(key, render), pendingRenders[i] = render;
|
@@ -1336,9 +1343,9 @@ function queueEffect(scope, fn) {
|
|
1336
1343
|
function run() {
|
1337
1344
|
let effects = pendingEffects;
|
1338
1345
|
try {
|
1339
|
-
rendering =
|
1346
|
+
rendering = 1, runRenders();
|
1340
1347
|
} finally {
|
1341
|
-
pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map(), pendingEffects = [], rendering =
|
1348
|
+
pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map(), pendingEffects = [], rendering = 0;
|
1342
1349
|
}
|
1343
1350
|
runEffects(effects);
|
1344
1351
|
}
|
@@ -1346,9 +1353,9 @@ function prepareEffects(fn) {
|
|
1346
1353
|
let prevRenders = pendingRenders, prevRendersLookup = pendingRendersLookup, prevEffects = pendingEffects, preparedEffects = pendingEffects = [];
|
1347
1354
|
pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map();
|
1348
1355
|
try {
|
1349
|
-
rendering =
|
1356
|
+
rendering = 1, fn(), runRenders();
|
1350
1357
|
} finally {
|
1351
|
-
rendering =
|
1358
|
+
rendering = 0, pendingRenders = prevRenders, pendingRendersLookup = prevRendersLookup, pendingEffects = prevEffects;
|
1352
1359
|
}
|
1353
1360
|
return preparedEffects;
|
1354
1361
|
}
|
@@ -1363,16 +1370,16 @@ function runRenders() {
|
|
1363
1370
|
for (; pendingRenders.length; ) {
|
1364
1371
|
let render = pendingRenders[0], item = pendingRenders.pop();
|
1365
1372
|
if (render !== item) {
|
1366
|
-
let i = 0, mid = pendingRenders.length >> 1, key = (pendingRenders[0] = item).
|
1373
|
+
let i = 0, mid = pendingRenders.length >> 1, key = (pendingRenders[0] = item).q;
|
1367
1374
|
for (; i < mid; ) {
|
1368
1375
|
let bestChild = (i << 1) + 1, right = bestChild + 1;
|
1369
|
-
if (right < pendingRenders.length && pendingRenders[right].
|
1376
|
+
if (right < pendingRenders.length && pendingRenders[right].q - pendingRenders[bestChild].q < 0 && (bestChild = right), pendingRenders[bestChild].q - key >= 0)
|
1370
1377
|
break;
|
1371
1378
|
pendingRenders[i] = pendingRenders[bestChild], i = bestChild;
|
1372
1379
|
}
|
1373
1380
|
pendingRenders[i] = item;
|
1374
1381
|
}
|
1375
|
-
render.D.k?.
|
1382
|
+
render.D.k?.A || runRender(render);
|
1376
1383
|
}
|
1377
1384
|
finishPendingScopes();
|
1378
1385
|
}
|
@@ -1381,16 +1388,16 @@ var runRender = (render) => render.L(render.D, render.I), enableCatch = () => {
|
|
1381
1388
|
};
|
1382
1389
|
let handlePendingTry = (fn, scope, branch) => {
|
1383
1390
|
for (; branch; ) {
|
1384
|
-
if (branch.
|
1391
|
+
if (branch.n)
|
1385
1392
|
return (branch.H ||= []).push(fn, scope);
|
1386
|
-
branch = branch.
|
1393
|
+
branch = branch.t;
|
1387
1394
|
}
|
1388
1395
|
};
|
1389
1396
|
runEffects = /* @__PURE__ */ ((runEffects2) => (effects, checkPending = placeholderShown.has(effects)) => {
|
1390
1397
|
if (checkPending || caughtError.has(effects)) {
|
1391
1398
|
let i = 0, fn, scope, branch;
|
1392
1399
|
for (; i < effects.length; )
|
1393
|
-
fn = effects[i++], scope = effects[i++], branch = scope.k, !branch?.
|
1400
|
+
fn = effects[i++], scope = effects[i++], branch = scope.k, !branch?.A && !(checkPending && handlePendingTry(fn, scope, branch)) && fn(scope, scope);
|
1394
1401
|
} else
|
1395
1402
|
runEffects2(effects);
|
1396
1403
|
})(runEffects), runRender = /* @__PURE__ */ ((runRender2) => (render) => {
|
@@ -1404,11 +1411,11 @@ var runRender = (render) => render.L(render.D, render.I), enableCatch = () => {
|
|
1404
1411
|
|
1405
1412
|
// src/dom/abort-signal.ts
|
1406
1413
|
function resetAbortSignal(scope, id) {
|
1407
|
-
let ctrl = scope.
|
1408
|
-
ctrl && (queueEffect(ctrl, abort), scope.
|
1414
|
+
let ctrl = scope.u?.[id];
|
1415
|
+
ctrl && (queueEffect(ctrl, abort), scope.u[id] = void 0);
|
1409
1416
|
}
|
1410
1417
|
function getAbortSignal(scope, id) {
|
1411
|
-
return scope.k && (scope.k.J ||= /* @__PURE__ */ new Set()).add(scope), ((scope.
|
1418
|
+
return scope.k && (scope.k.J ||= /* @__PURE__ */ new Set()).add(scope), ((scope.u ||= {})[id] ||= new AbortController()).signal;
|
1412
1419
|
}
|
1413
1420
|
function abort(ctrl) {
|
1414
1421
|
ctrl.abort();
|
@@ -1463,17 +1470,17 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
1463
1470
|
render(out, component, renderer, args) {
|
1464
1471
|
let branch = component.scope;
|
1465
1472
|
branch || (branch = classIdToBranch.get(component.id), branch && (component.scope = branch, classIdToBranch.delete(component.id)));
|
1466
|
-
let existing
|
1473
|
+
let existing;
|
1467
1474
|
if (typeof args[0] == "object" && "renderBody" in args[0]) {
|
1468
1475
|
let input = args[0], normalizedInput = args[0] = {};
|
1469
1476
|
for (let key in input)
|
1470
1477
|
normalizedInput[key === "renderBody" ? "content" : key] = input[key];
|
1471
1478
|
}
|
1472
1479
|
if (component.effects = prepareEffects(() => {
|
1473
|
-
branch ? existing =
|
1480
|
+
branch ? existing = 1 : (out.global.o ||= 0, branch = component.scope = createAndSetupBranch(
|
1474
1481
|
out.global,
|
1475
1482
|
renderer,
|
1476
|
-
renderer.
|
1483
|
+
renderer.x,
|
1477
1484
|
document.body
|
1478
1485
|
)), renderer.l?.(branch, renderer._ ? args[0] : args);
|
1479
1486
|
}), !existing)
|
@@ -1495,12 +1502,12 @@ var createTemplate = (id, template, walks, setup, inputSignal) => {
|
|
1495
1502
|
function mount(input = {}, reference, position) {
|
1496
1503
|
let branch, parentNode = reference, nextSibling = null, { $global } = input;
|
1497
1504
|
switch ($global ? ({ $global, ...input } = input, $global = {
|
1498
|
-
|
1505
|
+
o: 0,
|
1499
1506
|
runtimeId: DEFAULT_RUNTIME_ID,
|
1500
1507
|
renderId: DEFAULT_RENDER_ID,
|
1501
1508
|
...$global
|
1502
1509
|
}) : $global = {
|
1503
|
-
|
1510
|
+
o: 0,
|
1504
1511
|
runtimeId: DEFAULT_RUNTIME_ID,
|
1505
1512
|
renderId: DEFAULT_RENDER_ID
|
1506
1513
|
}, position) {
|