marko 6.0.112 → 6.0.114
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/README.md +1 -1
- package/dist/common/accessor.d.ts +2 -2
- package/dist/common/accessor.debug.d.ts +2 -2
- package/dist/common/types.d.ts +6 -1
- package/dist/debug/dom.js +140 -90
- package/dist/debug/dom.mjs +140 -90
- package/dist/debug/html.js +34 -24
- package/dist/debug/html.mjs +34 -24
- package/dist/dom/control-flow.d.ts +2 -1
- package/dist/dom/queue.d.ts +1 -1
- package/dist/dom/resume.d.ts +21 -1
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +120 -95
- package/dist/dom.mjs +120 -95
- package/dist/html/writer.d.ts +2 -0
- package/dist/html.js +28 -24
- package/dist/html.mjs +28 -24
- package/dist/translator/index.js +35 -13
- package/dist/translator/util/sections.d.ts +1 -1
- package/package.json +1 -1
package/dist/dom.js
CHANGED
|
@@ -47,7 +47,8 @@ __export(dom_exports, {
|
|
|
47
47
|
_attrs_partial: () => _attrs_partial,
|
|
48
48
|
_attrs_partial_content: () => _attrs_partial_content,
|
|
49
49
|
_attrs_script: () => _attrs_script,
|
|
50
|
-
|
|
50
|
+
_await_content: () => _await_content,
|
|
51
|
+
_await_promise: () => _await_promise,
|
|
51
52
|
_call: () => _call,
|
|
52
53
|
_child_setup: () => _child_setup,
|
|
53
54
|
_closure: () => _closure,
|
|
@@ -176,7 +177,7 @@ function normalizeDynamicRenderer(value) {
|
|
|
176
177
|
if (value) {
|
|
177
178
|
if (typeof value == "string") return value;
|
|
178
179
|
let normalized = value.content || value.default || value;
|
|
179
|
-
if (/* @__KEY__ */ "
|
|
180
|
+
if (/* @__KEY__ */ "g" in normalized)
|
|
180
181
|
return normalized;
|
|
181
182
|
}
|
|
182
183
|
}
|
|
@@ -372,35 +373,30 @@ function init(runtimeId = "M") {
|
|
|
372
373
|
endedBranches && (orphanBranches.push(...endedBranches), singleNode && (visitScope[accessor] = endedBranches.length > 1 ? endedBranches.reverse() : endedBranches[0])), visitType === "[" /* BranchStart */ && (endedBranches || (branchScopesStack.push(curBranchScopes), curBranchScopes = void 0), branchStarts.push(visit));
|
|
373
374
|
})(), $global, lastEffect, visits, resumes, visit, visitText, visitType, visitScope, lastToken, lastTokenIndex, lastScopeId = 0, nextToken = () => lastToken = visitText.slice(
|
|
374
375
|
lastTokenIndex,
|
|
375
|
-
|
|
376
|
-
(lastTokenIndex = visitText.indexOf(" ", lastTokenIndex) + 1) ? lastTokenIndex - 1 : visitText.length
|
|
376
|
+
(lastTokenIndex = visitText.indexOf(" ", lastTokenIndex) + 1 || visitText.length + 1) - 1
|
|
377
377
|
);
|
|
378
|
-
return render.
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
registeredValues[lastEffect],
|
|
387
|
-
scopeLookup[serialized] ||= {
|
|
388
|
-
L: serialized
|
|
378
|
+
return render.m = (effects = []) => {
|
|
379
|
+
for (let serialized of resumes = render.r || [])
|
|
380
|
+
if (typeof serialized == "string")
|
|
381
|
+
for (lastTokenIndex = 0, visitText = serialized; nextToken(); )
|
|
382
|
+
/\D/.test(lastToken) ? lastEffect = registeredValues[lastToken] : effects.push(
|
|
383
|
+
lastEffect,
|
|
384
|
+
scopeLookup[lastToken] ||= {
|
|
385
|
+
L: +lastToken
|
|
389
386
|
}
|
|
390
387
|
);
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
}
|
|
388
|
+
else
|
|
389
|
+
for (let scope of serialized(serializeContext))
|
|
390
|
+
$global ? typeof scope == "number" ? lastScopeId += scope : (scopeLookup[scope.L = ++lastScopeId] = scope, scope.$ = $global, branchesEnabled && (scope.F = scopeLookup[scope.G])) : ($global = scope || {}, $global.runtimeId = runtimeId, $global.renderId = renderId);
|
|
391
|
+
for (visit of visits = render.v)
|
|
392
|
+
lastTokenIndex = render.i.length, visitText = visit.data, visitType = visitText[lastTokenIndex++], visitScope = scopeLookup[+nextToken(
|
|
393
|
+
/* read scope id */
|
|
394
|
+
)] ||= {
|
|
395
|
+
L: +lastToken
|
|
396
|
+
}, visitType === "*" /* Node */ ? visitScope["J" /* Getter */ + nextToken()] = /* @__PURE__ */ ((node) => () => node)(visitScope[lastToken] = visit.previousSibling) : branchesEnabled && visitBranches();
|
|
397
|
+
return visits.length = resumes.length = 0, effects;
|
|
398
|
+
}, render.w = () => {
|
|
399
|
+
walk2(), runResumeEffects(render);
|
|
404
400
|
}, render;
|
|
405
401
|
})
|
|
406
402
|
});
|
|
@@ -408,7 +404,7 @@ function init(runtimeId = "M") {
|
|
|
408
404
|
if (renders) {
|
|
409
405
|
initRuntime(renders);
|
|
410
406
|
for (let renderId in renders)
|
|
411
|
-
resumeRender(renderId)
|
|
407
|
+
runResumeEffects(resumeRender(renderId));
|
|
412
408
|
} else
|
|
413
409
|
defineRuntime({
|
|
414
410
|
configurable: !0,
|
|
@@ -416,6 +412,13 @@ function init(runtimeId = "M") {
|
|
|
416
412
|
});
|
|
417
413
|
}
|
|
418
414
|
var isResuming;
|
|
415
|
+
function runResumeEffects(render) {
|
|
416
|
+
try {
|
|
417
|
+
isResuming = 1, runEffects(render.m(), 1);
|
|
418
|
+
} finally {
|
|
419
|
+
isResuming = 0;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
419
422
|
function getRegisteredWithScope(id, scope) {
|
|
420
423
|
let val = registeredValues[id];
|
|
421
424
|
return scope ? val(scope) : val;
|
|
@@ -687,9 +690,9 @@ function subscribeToScopeSet(ownerScope, accessor, scope) {
|
|
|
687
690
|
));
|
|
688
691
|
}
|
|
689
692
|
function _closure(...closureSignals) {
|
|
690
|
-
let [{
|
|
693
|
+
let [{ l: ___scopeInstancesAccessor, n: ___signalIndexAccessor }] = closureSignals;
|
|
691
694
|
for (let i = closureSignals.length; i--; )
|
|
692
|
-
closureSignals[i].
|
|
695
|
+
closureSignals[i].t = i;
|
|
693
696
|
return (scope) => {
|
|
694
697
|
if (scope[___scopeInstancesAccessor])
|
|
695
698
|
for (let childScope of scope[___scopeInstancesAccessor])
|
|
@@ -703,13 +706,13 @@ function _closure(...closureSignals) {
|
|
|
703
706
|
function _closure_get(valueAccessor, fn, getOwnerScope) {
|
|
704
707
|
valueAccessor = decodeAccessor(valueAccessor);
|
|
705
708
|
let closureSignal = ((scope) => {
|
|
706
|
-
scope[closureSignal.
|
|
709
|
+
scope[closureSignal.n] = closureSignal.t, fn(scope), subscribeToScopeSet(
|
|
707
710
|
getOwnerScope ? getOwnerScope(scope) : scope._,
|
|
708
|
-
closureSignal.
|
|
711
|
+
closureSignal.l,
|
|
709
712
|
scope
|
|
710
713
|
);
|
|
711
714
|
});
|
|
712
|
-
return closureSignal.
|
|
715
|
+
return closureSignal.l = "B" /* ClosureScopes */ + valueAccessor, closureSignal.n = "C" /* ClosureSignalIndex */ + valueAccessor, closureSignal;
|
|
713
716
|
}
|
|
714
717
|
function _child_setup(setup) {
|
|
715
718
|
return setup._ = (scope, owner) => {
|
|
@@ -753,7 +756,7 @@ function _hoist(...path) {
|
|
|
753
756
|
// src/dom/renderer.ts
|
|
754
757
|
function createBranch($global, renderer, parentScope, parentNode) {
|
|
755
758
|
let branch = createScope($global), parentBranch = parentScope?.F;
|
|
756
|
-
return branch._ = renderer.
|
|
759
|
+
return branch._ = renderer.e || parentScope, branch.F = branch, parentBranch && (branch.N = parentBranch, (parentBranch.D ||= /* @__PURE__ */ new Set()).add(branch)), renderer.h?.(
|
|
757
760
|
branch,
|
|
758
761
|
parentNode.namespaceURI
|
|
759
762
|
), branch;
|
|
@@ -765,7 +768,7 @@ function createAndSetupBranch($global, renderer, parentScope, parentNode) {
|
|
|
765
768
|
);
|
|
766
769
|
}
|
|
767
770
|
function setupBranch(renderer, branch) {
|
|
768
|
-
return renderer.
|
|
771
|
+
return renderer.j && queueRender(branch, renderer.j, -1), branch;
|
|
769
772
|
}
|
|
770
773
|
function _content(id, template, walks, setup, params, dynamicScopesAccessor) {
|
|
771
774
|
walks = walks ? walks.replace(/[^\0-1]+$/, "") : "", setup = setup ? setup._ || setup : void 0, params ||= void 0;
|
|
@@ -782,10 +785,10 @@ function _content(id, template, walks, setup, params, dynamicScopesAccessor) {
|
|
|
782
785
|
);
|
|
783
786
|
};
|
|
784
787
|
return (owner) => ({
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
788
|
+
g: id,
|
|
789
|
+
h: clone,
|
|
790
|
+
e: owner,
|
|
791
|
+
j: setup,
|
|
789
792
|
a: params,
|
|
790
793
|
b: dynamicScopesAccessor
|
|
791
794
|
});
|
|
@@ -802,7 +805,7 @@ function _content_closures(renderer, closureFns) {
|
|
|
802
805
|
closureSignals[key] = _const(+key, closureFns[key]);
|
|
803
806
|
return (owner, closureValues) => {
|
|
804
807
|
let instance = renderer(owner);
|
|
805
|
-
return instance.
|
|
808
|
+
return instance.o = closureSignals, instance.u = closureValues, instance;
|
|
806
809
|
};
|
|
807
810
|
}
|
|
808
811
|
var cloneCache = {};
|
|
@@ -956,8 +959,8 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
|
|
|
956
959
|
}
|
|
957
960
|
function _attr_content(scope, nodeAccessor, value) {
|
|
958
961
|
let content = normalizeClientRender(value), rendererAccessor = "D" /* ConditionalRenderer */ + nodeAccessor;
|
|
959
|
-
scope[rendererAccessor] !== (scope[rendererAccessor] = content?.
|
|
960
|
-
content.
|
|
962
|
+
scope[rendererAccessor] !== (scope[rendererAccessor] = content?.g) && (setConditionalRenderer(scope, nodeAccessor, content, createAndSetupBranch), content?.b && subscribeToScopeSet(
|
|
963
|
+
content.e,
|
|
961
964
|
content.b,
|
|
962
965
|
scope["A" /* BranchScopes */ + nodeAccessor]
|
|
963
966
|
));
|
|
@@ -998,7 +1001,7 @@ function _html(scope, value, accessor) {
|
|
|
998
1001
|
}
|
|
999
1002
|
function normalizeClientRender(value) {
|
|
1000
1003
|
let renderer = normalizeDynamicRenderer(value);
|
|
1001
|
-
if (renderer && renderer.
|
|
1004
|
+
if (renderer && renderer.g)
|
|
1002
1005
|
return renderer;
|
|
1003
1006
|
}
|
|
1004
1007
|
function normalizeAttrValue(value) {
|
|
@@ -1108,16 +1111,31 @@ function longestIncreasingSubsequence(a) {
|
|
|
1108
1111
|
}
|
|
1109
1112
|
|
|
1110
1113
|
// src/dom/control-flow.ts
|
|
1111
|
-
function
|
|
1114
|
+
function _await_promise(nodeAccessor, params) {
|
|
1112
1115
|
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
1113
|
-
let promiseAccessor = "L" /* Promise */ + nodeAccessor, branchAccessor = "A" /* BranchScopes */ + nodeAccessor,
|
|
1114
|
-
return
|
|
1115
|
-
let
|
|
1116
|
+
let promiseAccessor = "L" /* Promise */ + nodeAccessor, branchAccessor = "A" /* BranchScopes */ + nodeAccessor, rendererAccessor = "D" /* ConditionalRenderer */ + nodeAccessor;
|
|
1117
|
+
return _enable_catch(), (scope, promise) => {
|
|
1118
|
+
let awaitCounter, renderData, tryWithPlaceholder = findBranchWithKey(
|
|
1116
1119
|
scope,
|
|
1117
1120
|
"Q" /* PlaceholderContent */
|
|
1118
|
-
)
|
|
1119
|
-
tryWithPlaceholder ? (
|
|
1120
|
-
|
|
1121
|
+
);
|
|
1122
|
+
tryWithPlaceholder ? (renderData = self[tryWithPlaceholder.$.runtimeId]?.[tryWithPlaceholder.$.renderId], awaitCounter = tryWithPlaceholder.O ||= renderData?.p?.[tryWithPlaceholder.L], awaitCounter?.i || (awaitCounter = tryWithPlaceholder.O = {
|
|
1123
|
+
d: 1,
|
|
1124
|
+
i: 0,
|
|
1125
|
+
c() {
|
|
1126
|
+
if (!--awaitCounter.i) {
|
|
1127
|
+
let placeholderBranch = tryWithPlaceholder.P;
|
|
1128
|
+
tryWithPlaceholder.P = 0, placeholderBranch && (placeholderBranch.S.parentNode.insertBefore(
|
|
1129
|
+
tryWithPlaceholder.S.parentNode,
|
|
1130
|
+
placeholderBranch.S
|
|
1131
|
+
), removeAndDestroyBranch(placeholderBranch)), queueEffect(tryWithPlaceholder, (scope2) => {
|
|
1132
|
+
let pendingEffects2 = scope2.J;
|
|
1133
|
+
pendingEffects2 && (scope2.J = [], runEffects(pendingEffects2, !0));
|
|
1134
|
+
});
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
}), placeholderShown.add(pendingEffects), !scope[promiseAccessor] && !awaitCounter.i++ && requestAnimationFrame(
|
|
1138
|
+
() => awaitCounter.i && runEffects(
|
|
1121
1139
|
prepareEffects(
|
|
1122
1140
|
() => queueRender(
|
|
1123
1141
|
tryWithPlaceholder,
|
|
@@ -1137,46 +1155,53 @@ function _await(nodeAccessor, template, walks, setup, params) {
|
|
|
1137
1155
|
)
|
|
1138
1156
|
)
|
|
1139
1157
|
)
|
|
1140
|
-
)) :
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
), tempDetachBranch(
|
|
1158
|
+
)) : scope[branchAccessor] && !scope[promiseAccessor] && (scope[branchAccessor].S.parentNode.insertBefore(
|
|
1159
|
+
scope[nodeAccessor],
|
|
1160
|
+
scope[branchAccessor].S
|
|
1161
|
+
), tempDetachBranch(scope[branchAccessor]));
|
|
1144
1162
|
let thisPromise = scope[promiseAccessor] = promise.then(
|
|
1145
1163
|
(data) => {
|
|
1146
1164
|
thisPromise === scope[promiseAccessor] && (scope[promiseAccessor] = 0, schedule(), queueRender(
|
|
1147
1165
|
scope,
|
|
1148
1166
|
() => {
|
|
1149
|
-
if (
|
|
1150
|
-
|
|
1167
|
+
if (scope[branchAccessor] ? tryWithPlaceholder || scope[nodeAccessor].replaceWith(
|
|
1168
|
+
scope[branchAccessor].S.parentNode
|
|
1151
1169
|
) : (insertBranchBefore(
|
|
1152
|
-
|
|
1170
|
+
scope[branchAccessor] = createAndSetupBranch(
|
|
1153
1171
|
scope.$,
|
|
1154
|
-
|
|
1172
|
+
scope[rendererAccessor],
|
|
1155
1173
|
scope,
|
|
1156
|
-
|
|
1174
|
+
scope[nodeAccessor].parentNode
|
|
1157
1175
|
),
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
),
|
|
1161
|
-
let
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1176
|
+
scope[nodeAccessor].parentNode,
|
|
1177
|
+
scope[nodeAccessor]
|
|
1178
|
+
), scope[nodeAccessor].remove()), params?.(scope[branchAccessor], [data]), awaitCounter && (placeholderShown.add(pendingEffects), awaitCounter.c(), !awaitCounter.d)) {
|
|
1179
|
+
let fnScopes = /* @__PURE__ */ new Map(), effects = renderData.m();
|
|
1180
|
+
for (let i = 0; i < pendingEffects.length; ) {
|
|
1181
|
+
let fn = pendingEffects[i++], scopes = fnScopes.get(fn);
|
|
1182
|
+
scopes || fnScopes.set(fn, scopes = /* @__PURE__ */ new Set()), scopes.add(pendingEffects[i++]);
|
|
1183
|
+
}
|
|
1184
|
+
for (let i = 0; i < effects.length; ) {
|
|
1185
|
+
let fn = effects[i++], scope2 = effects[i++];
|
|
1186
|
+
fnScopes.get(fn)?.has(scope2) || queueEffect(scope2, fn);
|
|
1187
|
+
}
|
|
1169
1188
|
}
|
|
1170
1189
|
},
|
|
1171
1190
|
-1
|
|
1172
1191
|
));
|
|
1173
1192
|
},
|
|
1174
1193
|
(error) => {
|
|
1175
|
-
thisPromise === scope[promiseAccessor] && (
|
|
1194
|
+
thisPromise === scope[promiseAccessor] && (awaitCounter && (awaitCounter.i = 0), scope[promiseAccessor] = 0, schedule(), queueRender(scope, renderCatch, -1, error));
|
|
1176
1195
|
}
|
|
1177
1196
|
);
|
|
1178
1197
|
};
|
|
1179
1198
|
}
|
|
1199
|
+
function _await_content(nodeAccessor, template, walks, setup) {
|
|
1200
|
+
let rendererAccessor = "D" /* ConditionalRenderer */ + decodeAccessor(nodeAccessor), renderer = _content("", template, walks, setup)();
|
|
1201
|
+
return (scope) => {
|
|
1202
|
+
scope[rendererAccessor] = renderer;
|
|
1203
|
+
};
|
|
1204
|
+
}
|
|
1180
1205
|
function _try(nodeAccessor, template, walks, setup) {
|
|
1181
1206
|
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
1182
1207
|
let branchAccessor = "A" /* BranchScopes */ + nodeAccessor, renderer = _content("", template, walks, setup)();
|
|
@@ -1197,7 +1222,7 @@ function renderCatch(scope, error) {
|
|
|
1197
1222
|
let tryWithCatch = findBranchWithKey(scope, "E" /* CatchContent */);
|
|
1198
1223
|
if (tryWithCatch) {
|
|
1199
1224
|
let owner = tryWithCatch._, placeholderBranch = tryWithCatch.P;
|
|
1200
|
-
placeholderBranch && (tryWithCatch.O = 0, owner["A" /* BranchScopes */ + tryWithCatch.C] = placeholderBranch, destroyBranch(tryWithCatch)), caughtError.add(pendingEffects), setConditionalRenderer(
|
|
1225
|
+
placeholderBranch && (tryWithCatch.O && (tryWithCatch.O.i = 0), owner["A" /* BranchScopes */ + tryWithCatch.C] = placeholderBranch, destroyBranch(tryWithCatch)), caughtError.add(pendingEffects), setConditionalRenderer(
|
|
1201
1226
|
owner,
|
|
1202
1227
|
tryWithCatch.C,
|
|
1203
1228
|
tryWithCatch.E,
|
|
@@ -1238,7 +1263,7 @@ var _dynamic_tag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
|
|
1238
1263
|
let childScopeAccessor = "A" /* BranchScopes */ + nodeAccessor, rendererAccessor = "D" /* ConditionalRenderer */ + nodeAccessor;
|
|
1239
1264
|
return enableBranches(), (scope, newRenderer, getInput) => {
|
|
1240
1265
|
let normalizedRenderer = normalizeDynamicRenderer(newRenderer);
|
|
1241
|
-
if (scope[rendererAccessor] !== (scope[rendererAccessor] = normalizedRenderer?.
|
|
1266
|
+
if (scope[rendererAccessor] !== (scope[rendererAccessor] = normalizedRenderer?.g || normalizedRenderer) || getContent && !(normalizedRenderer || scope[childScopeAccessor]))
|
|
1242
1267
|
if (setConditionalRenderer(
|
|
1243
1268
|
scope,
|
|
1244
1269
|
nodeAccessor,
|
|
@@ -1253,13 +1278,13 @@ var _dynamic_tag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
|
|
1253
1278
|
content,
|
|
1254
1279
|
createAndSetupBranch
|
|
1255
1280
|
), content.b && subscribeToScopeSet(
|
|
1256
|
-
content.
|
|
1281
|
+
content.e,
|
|
1257
1282
|
content.b,
|
|
1258
1283
|
scope[childScopeAccessor]["Aa"]
|
|
1259
1284
|
);
|
|
1260
1285
|
}
|
|
1261
1286
|
} else normalizedRenderer?.b && subscribeToScopeSet(
|
|
1262
|
-
normalizedRenderer.
|
|
1287
|
+
normalizedRenderer.e,
|
|
1263
1288
|
normalizedRenderer.b,
|
|
1264
1289
|
scope[childScopeAccessor]
|
|
1265
1290
|
);
|
|
@@ -1272,10 +1297,10 @@ var _dynamic_tag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
|
|
1272
1297
|
(inputIsArgs ? args[0] : args) || {}
|
|
1273
1298
|
), (childScope["Ia"] || childScope["Ea"]) && queueEffect(childScope, dynamicTagScript);
|
|
1274
1299
|
else {
|
|
1275
|
-
for (let accessor in normalizedRenderer.
|
|
1276
|
-
normalizedRenderer.
|
|
1300
|
+
for (let accessor in normalizedRenderer.o)
|
|
1301
|
+
normalizedRenderer.o[accessor](
|
|
1277
1302
|
childScope,
|
|
1278
|
-
normalizedRenderer.
|
|
1303
|
+
normalizedRenderer.u[accessor]
|
|
1279
1304
|
);
|
|
1280
1305
|
if (normalizedRenderer.a)
|
|
1281
1306
|
if (inputIsArgs)
|
|
@@ -1373,17 +1398,17 @@ var pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map(), caugh
|
|
|
1373
1398
|
function queueRender(scope, signal, signalKey, value, scopeKey = scope.L) {
|
|
1374
1399
|
let key = scopeKey * scopeKeyOffset + signalKey, existingRender = signalKey >= 0 && pendingRendersLookup.get(key);
|
|
1375
1400
|
if (existingRender)
|
|
1376
|
-
existingRender.
|
|
1401
|
+
existingRender.q = value;
|
|
1377
1402
|
else {
|
|
1378
1403
|
let render = {
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1404
|
+
f: key,
|
|
1405
|
+
k: scope,
|
|
1406
|
+
x: signal,
|
|
1407
|
+
q: value
|
|
1383
1408
|
}, i = pendingRenders.push(render) - 1;
|
|
1384
1409
|
for (; i; ) {
|
|
1385
1410
|
let parentIndex = i - 1 >> 1, parent = pendingRenders[parentIndex];
|
|
1386
|
-
if (key - parent.
|
|
1411
|
+
if (key - parent.f >= 0) break;
|
|
1387
1412
|
pendingRenders[i] = parent, i = parentIndex;
|
|
1388
1413
|
}
|
|
1389
1414
|
signalKey >= 0 && pendingRendersLookup.set(key, render), pendingRenders[i] = render;
|
|
@@ -1419,27 +1444,27 @@ function runRenders() {
|
|
|
1419
1444
|
for (; pendingRenders.length; ) {
|
|
1420
1445
|
let render = pendingRenders[0], item = pendingRenders.pop();
|
|
1421
1446
|
if (render !== item) {
|
|
1422
|
-
let i = 0, mid = pendingRenders.length >> 1, key = (pendingRenders[0] = item).
|
|
1447
|
+
let i = 0, mid = pendingRenders.length >> 1, key = (pendingRenders[0] = item).f;
|
|
1423
1448
|
for (; i < mid; ) {
|
|
1424
1449
|
let bestChild = (i << 1) + 1, right = bestChild + 1;
|
|
1425
|
-
if (right < pendingRenders.length && pendingRenders[right].
|
|
1450
|
+
if (right < pendingRenders.length && pendingRenders[right].f - pendingRenders[bestChild].f < 0 && (bestChild = right), pendingRenders[bestChild].f - key >= 0)
|
|
1426
1451
|
break;
|
|
1427
1452
|
pendingRenders[i] = pendingRenders[bestChild], i = bestChild;
|
|
1428
1453
|
}
|
|
1429
1454
|
pendingRenders[i] = item;
|
|
1430
1455
|
}
|
|
1431
|
-
render.
|
|
1456
|
+
render.k.F?.I || runRender(render);
|
|
1432
1457
|
}
|
|
1433
1458
|
for (let scope of pendingScopes)
|
|
1434
1459
|
scope.H = 0;
|
|
1435
1460
|
pendingScopes = [];
|
|
1436
1461
|
}
|
|
1437
|
-
var runRender = (render) => render.
|
|
1462
|
+
var runRender = (render) => render.x(render.k, render.q), _enable_catch = () => {
|
|
1438
1463
|
_enable_catch = () => {
|
|
1439
1464
|
}, enableBranches();
|
|
1440
1465
|
let handlePendingTry = (fn, scope, branch) => {
|
|
1441
1466
|
for (; branch; ) {
|
|
1442
|
-
if (branch.O)
|
|
1467
|
+
if (branch.O?.i)
|
|
1443
1468
|
return (branch.J ||= []).push(fn, scope);
|
|
1444
1469
|
branch = branch.N;
|
|
1445
1470
|
}
|
|
@@ -1455,7 +1480,7 @@ var runRender = (render) => render.p(render.h, render.m), _enable_catch = () =>
|
|
|
1455
1480
|
try {
|
|
1456
1481
|
runRender2(render);
|
|
1457
1482
|
} catch (error) {
|
|
1458
|
-
renderCatch(render.
|
|
1483
|
+
renderCatch(render.k, error);
|
|
1459
1484
|
}
|
|
1460
1485
|
})(runRender);
|
|
1461
1486
|
};
|
|
@@ -1488,7 +1513,7 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
|
1488
1513
|
_resume(RENDERER_REGISTER_ID, fn);
|
|
1489
1514
|
},
|
|
1490
1515
|
isRenderer(renderer) {
|
|
1491
|
-
return renderer.
|
|
1516
|
+
return renderer.h;
|
|
1492
1517
|
},
|
|
1493
1518
|
getStartNode(branch) {
|
|
1494
1519
|
return branch.S;
|
|
@@ -1510,7 +1535,7 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
|
1510
1535
|
},
|
|
1511
1536
|
createRenderer(params, clone) {
|
|
1512
1537
|
let renderer = _content("", 0, 0, 0, params)();
|
|
1513
|
-
return renderer.
|
|
1538
|
+
return renderer.h = (branch) => {
|
|
1514
1539
|
let cloned = clone();
|
|
1515
1540
|
branch.S = cloned.startNode, branch.K = cloned.endNode;
|
|
1516
1541
|
}, renderer;
|
|
@@ -1526,7 +1551,7 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
|
1526
1551
|
branch || (created = 1, branch = component.scope = createAndSetupBranch(
|
|
1527
1552
|
out.global,
|
|
1528
1553
|
renderer,
|
|
1529
|
-
renderer.
|
|
1554
|
+
renderer.e,
|
|
1530
1555
|
document.body
|
|
1531
1556
|
)), renderer.a?.(branch, renderer._ ? args[0] : args);
|
|
1532
1557
|
}), created)
|
|
@@ -1576,7 +1601,7 @@ function mount(input = {}, reference, position) {
|
|
|
1576
1601
|
parentNode
|
|
1577
1602
|
), branch.T = (newValue) => {
|
|
1578
1603
|
curValue = newValue;
|
|
1579
|
-
}, this.
|
|
1604
|
+
}, this.j?.(branch), args?.(branch, input);
|
|
1580
1605
|
});
|
|
1581
1606
|
return insertChildNodes(
|
|
1582
1607
|
parentNode,
|