octane 0.1.25 → 0.1.27
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/runtime.js +247 -57
- package/dist/universal-core.d.ts +1 -0
- package/dist/universal-core.js +439 -90
- package/package.json +1 -1
package/dist/runtime.js
CHANGED
|
@@ -100,6 +100,14 @@ function profilePortalComponent(rawBody) {
|
|
|
100
100
|
function ensureHooks(scope) {
|
|
101
101
|
return scope.hooks ?? (scope.hooks = /* @__PURE__ */ new Map());
|
|
102
102
|
}
|
|
103
|
+
function registerHookCleanup(scope, cleanup) {
|
|
104
|
+
if (process.env.NODE_ENV !== "production") {
|
|
105
|
+
if (scope.block.body[HMR] !== void 0) {
|
|
106
|
+
cleanup[HMR] = true;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
(scope.cleanups ??= []).push(cleanup);
|
|
110
|
+
}
|
|
103
111
|
let nextHookSlot = 0;
|
|
104
112
|
function hookSlots(count) {
|
|
105
113
|
const base = nextHookSlot;
|
|
@@ -1176,12 +1184,18 @@ function drainQueue() {
|
|
|
1176
1184
|
}
|
|
1177
1185
|
const crossRenderUpdate = block.crossRenderUpdate;
|
|
1178
1186
|
block.crossRenderUpdate = false;
|
|
1187
|
+
const hiddenOwner = findHiddenRenderOwner(block, true);
|
|
1188
|
+
let hiddenActivity = null;
|
|
1189
|
+
let hiddenTry = null;
|
|
1190
|
+
if (hiddenOwner !== null) {
|
|
1191
|
+
if (hiddenOwner.__kind === "trySlotSlot") hiddenTry = hiddenOwner;
|
|
1192
|
+
else hiddenActivity = hiddenOwner;
|
|
1193
|
+
}
|
|
1179
1194
|
try {
|
|
1180
1195
|
if (block.nestedUpdateError) {
|
|
1181
1196
|
block.nestedUpdateError = false;
|
|
1182
1197
|
throw maximumUpdateDepthError();
|
|
1183
1198
|
}
|
|
1184
|
-
const hiddenTry = findSuspenseHiddenTry(block);
|
|
1185
1199
|
if (hiddenTry !== null) {
|
|
1186
1200
|
attemptHiddenReveal(hiddenTry, block.pendingMode ?? "urgent");
|
|
1187
1201
|
continue;
|
|
@@ -1213,6 +1227,8 @@ function drainQueue() {
|
|
|
1213
1227
|
while (root.parentBlock !== null) root = root.parentBlock;
|
|
1214
1228
|
if (root.kind === "root" && !root.disposed) unmountBlock(root);
|
|
1215
1229
|
}
|
|
1230
|
+
} finally {
|
|
1231
|
+
if (hiddenActivity !== null) rehideActivityAfterDescendantRender(hiddenActivity);
|
|
1216
1232
|
}
|
|
1217
1233
|
}
|
|
1218
1234
|
QUEUE.length = 0;
|
|
@@ -2446,7 +2462,7 @@ function unmountScope(scope, detachDom = true) {
|
|
|
2446
2462
|
unmountScopeChildrenAndSlots(scope, detachDom);
|
|
2447
2463
|
});
|
|
2448
2464
|
}
|
|
2449
|
-
function
|
|
2465
|
+
function runScopeCleanups(scope) {
|
|
2450
2466
|
const c = scope.cleanups;
|
|
2451
2467
|
if (c !== null)
|
|
2452
2468
|
for (let i = c.length - 1; i >= 0; i--) {
|
|
@@ -2456,6 +2472,12 @@ function unmountScopeChildrenAndSlots(scope, detachDom) {
|
|
|
2456
2472
|
reportTeardownError(err);
|
|
2457
2473
|
}
|
|
2458
2474
|
}
|
|
2475
|
+
}
|
|
2476
|
+
function unmountScopeChildrenAndSlots(scope, detachDom) {
|
|
2477
|
+
runScopeCleanups(scope);
|
|
2478
|
+
unmountScopeChildrenAndSlotsOnly(scope, detachDom);
|
|
2479
|
+
}
|
|
2480
|
+
function unmountScopeChildrenAndSlotsOnly(scope, detachDom) {
|
|
2459
2481
|
const children = scope.children;
|
|
2460
2482
|
if (children !== null)
|
|
2461
2483
|
for (let i = 0, n = children.length; i < n; i++) unmountScope(children[i].scope, detachDom);
|
|
@@ -3123,7 +3145,7 @@ function useEffectEvent(fn, slot) {
|
|
|
3123
3145
|
s = { impl: fn, active: true };
|
|
3124
3146
|
ensureHooks(scope).set(slot, s);
|
|
3125
3147
|
const cell2 = s;
|
|
3126
|
-
(scope
|
|
3148
|
+
registerHookCleanup(scope, () => {
|
|
3127
3149
|
cell2.active = false;
|
|
3128
3150
|
});
|
|
3129
3151
|
} else {
|
|
@@ -3205,6 +3227,87 @@ function scopedChildrenAsBody(props) {
|
|
|
3205
3227
|
return (_props, scope, extra) => childrenAsBody(props.children)(void 0, scope, extra);
|
|
3206
3228
|
}
|
|
3207
3229
|
const CHILDREN_DIALECT_SLOT = /* @__PURE__ */ Symbol("octane.childrenDialect");
|
|
3230
|
+
function hasResettableHmrRange(block) {
|
|
3231
|
+
const start = block.startMarker;
|
|
3232
|
+
const end = block.endMarker;
|
|
3233
|
+
if (start === void 0 || end === void 0) return false;
|
|
3234
|
+
if (start === null || end === null) {
|
|
3235
|
+
return start === null && end === null && (block.kind === "root" || block.exclusiveMarkers === true);
|
|
3236
|
+
}
|
|
3237
|
+
if (start !== end) {
|
|
3238
|
+
return start.parentNode === block.parentNode && end.parentNode === block.parentNode;
|
|
3239
|
+
}
|
|
3240
|
+
for (let parent = block.parentBlock; parent !== null; parent = parent.parentBlock) {
|
|
3241
|
+
if (parent.startMarker === start && parent.endMarker === end) return false;
|
|
3242
|
+
}
|
|
3243
|
+
return start.parentNode === block.parentNode;
|
|
3244
|
+
}
|
|
3245
|
+
function promoteHmrBlockRange(block) {
|
|
3246
|
+
const root = block.startMarker;
|
|
3247
|
+
if (root === null || root !== block.endMarker) return;
|
|
3248
|
+
const parent = block.parentNode;
|
|
3249
|
+
const rangeStart = document.createComment("hmr");
|
|
3250
|
+
const rangeEnd = document.createComment("/hmr");
|
|
3251
|
+
parent.insertBefore(rangeStart, root);
|
|
3252
|
+
parent.insertBefore(rangeEnd, root.nextSibling);
|
|
3253
|
+
block.startMarker = rangeStart;
|
|
3254
|
+
block.endMarker = rangeEnd;
|
|
3255
|
+
block.exclusiveMarkers = false;
|
|
3256
|
+
}
|
|
3257
|
+
function resetHmrBlock(block) {
|
|
3258
|
+
if (TEARDOWN_DEPTH === 0) {
|
|
3259
|
+
TEARDOWN_HANDLER = findTryHandler(block.parentBlock) ?? rendererRegionTryHandler(block);
|
|
3260
|
+
}
|
|
3261
|
+
TEARDOWN_DEPTH++;
|
|
3262
|
+
let abortedRefs = null;
|
|
3263
|
+
if (!block.mounted) {
|
|
3264
|
+
abortedRefs = [];
|
|
3265
|
+
collectVisibleSubtreeRefs(block, abortedRefs);
|
|
3266
|
+
}
|
|
3267
|
+
try {
|
|
3268
|
+
withRefDetachSuppression(abortedRefs, () => {
|
|
3269
|
+
if (block.deoptNode !== null) detachDeoptTreeRefs(block.deoptNode, null);
|
|
3270
|
+
const cleanups = block.cleanups;
|
|
3271
|
+
let preserved = null;
|
|
3272
|
+
if (cleanups !== null) {
|
|
3273
|
+
for (let i = cleanups.length - 1; i >= 0; i--) {
|
|
3274
|
+
const cleanup = cleanups[i];
|
|
3275
|
+
if (cleanup[HMR] === true) continue;
|
|
3276
|
+
try {
|
|
3277
|
+
runEffectLifecycleCallback(cleanup);
|
|
3278
|
+
} catch (err) {
|
|
3279
|
+
reportTeardownError(err);
|
|
3280
|
+
}
|
|
3281
|
+
}
|
|
3282
|
+
for (let i = 0; i < cleanups.length; i++) {
|
|
3283
|
+
const cleanup = cleanups[i];
|
|
3284
|
+
if (cleanup[HMR] === true) (preserved ??= []).push(cleanup);
|
|
3285
|
+
}
|
|
3286
|
+
}
|
|
3287
|
+
unmountScopeChildrenAndSlotsOnly(block, true);
|
|
3288
|
+
removeRange(
|
|
3289
|
+
block.startMarker !== null ? block.startMarker.nextSibling : block.parentNode.firstChild,
|
|
3290
|
+
block.endMarker
|
|
3291
|
+
);
|
|
3292
|
+
block.children = null;
|
|
3293
|
+
block.cleanups = preserved;
|
|
3294
|
+
block._slots = null;
|
|
3295
|
+
block.refFields = null;
|
|
3296
|
+
block.slots = [];
|
|
3297
|
+
block.deoptNode = null;
|
|
3298
|
+
});
|
|
3299
|
+
const hooks = block.hooks;
|
|
3300
|
+
if (hooks !== null) {
|
|
3301
|
+
for (const value of hooks.values()) {
|
|
3302
|
+
if (value !== null && typeof value === "object" && Object.prototype.hasOwnProperty.call(value, "deps")) {
|
|
3303
|
+
value.deps = void 0;
|
|
3304
|
+
}
|
|
3305
|
+
}
|
|
3306
|
+
}
|
|
3307
|
+
} finally {
|
|
3308
|
+
if (--TEARDOWN_DEPTH === 0) dispatchTeardownErrors();
|
|
3309
|
+
}
|
|
3310
|
+
}
|
|
3208
3311
|
function resetScopeChildren(scope) {
|
|
3209
3312
|
const block = scope.block;
|
|
3210
3313
|
if (TEARDOWN_DEPTH === 0) {
|
|
@@ -10559,6 +10662,13 @@ function hmr(fn) {
|
|
|
10559
10662
|
const nextFn = incomingMeta ? incomingMeta.fn : incoming;
|
|
10560
10663
|
if (meta.fn.__octaneReturnedOutput !== nextFn.__octaneReturnedOutput)
|
|
10561
10664
|
return false;
|
|
10665
|
+
for (const b of meta.liveBlocks) {
|
|
10666
|
+
if (b.disposed) {
|
|
10667
|
+
meta.liveBlocks.delete(b);
|
|
10668
|
+
continue;
|
|
10669
|
+
}
|
|
10670
|
+
if (!hasResettableHmrRange(b)) return false;
|
|
10671
|
+
}
|
|
10562
10672
|
meta.fn = nextFn;
|
|
10563
10673
|
if (typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__)
|
|
10564
10674
|
__profileComponentSource(wrapper, meta.fn);
|
|
@@ -10573,6 +10683,8 @@ function hmr(fn) {
|
|
|
10573
10683
|
b.body = wrapper;
|
|
10574
10684
|
if (typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__)
|
|
10575
10685
|
__profileSchedule(b, "hmr");
|
|
10686
|
+
promoteHmrBlockRange(b);
|
|
10687
|
+
resetHmrBlock(b);
|
|
10576
10688
|
scheduleRender(b);
|
|
10577
10689
|
}
|
|
10578
10690
|
return true;
|
|
@@ -10596,8 +10708,63 @@ function setTransitionFallbackTimeout(ms) {
|
|
|
10596
10708
|
function getTransitionFallbackTimeout() {
|
|
10597
10709
|
return TRANSITION_FALLBACK_TIMEOUT_MS;
|
|
10598
10710
|
}
|
|
10599
|
-
const
|
|
10600
|
-
const
|
|
10711
|
+
const HIDDEN_DISPLAYS = /* @__PURE__ */ new WeakMap();
|
|
10712
|
+
const HIDDEN_TEXTS = /* @__PURE__ */ new WeakMap();
|
|
10713
|
+
function enforceHiddenDisplay(el) {
|
|
10714
|
+
const hidden = HIDDEN_DISPLAYS.get(el);
|
|
10715
|
+
el.style.setProperty(
|
|
10716
|
+
"display",
|
|
10717
|
+
"none",
|
|
10718
|
+
hidden !== void 0 && hidden.importantOwners > 0 ? "important" : ""
|
|
10719
|
+
);
|
|
10720
|
+
}
|
|
10721
|
+
function retainHiddenDisplay(el, important) {
|
|
10722
|
+
const existing = HIDDEN_DISPLAYS.get(el);
|
|
10723
|
+
if (existing === void 0) {
|
|
10724
|
+
HIDDEN_DISPLAYS.set(el, {
|
|
10725
|
+
owners: 1,
|
|
10726
|
+
importantOwners: important ? 1 : 0,
|
|
10727
|
+
value: el.style.getPropertyValue("display"),
|
|
10728
|
+
priority: el.style.getPropertyPriority("display"),
|
|
10729
|
+
hadStyle: el.hasAttribute("style")
|
|
10730
|
+
});
|
|
10731
|
+
} else {
|
|
10732
|
+
existing.owners++;
|
|
10733
|
+
if (important) existing.importantOwners++;
|
|
10734
|
+
}
|
|
10735
|
+
enforceHiddenDisplay(el);
|
|
10736
|
+
}
|
|
10737
|
+
function releaseHiddenDisplay(el, important) {
|
|
10738
|
+
const display = HIDDEN_DISPLAYS.get(el);
|
|
10739
|
+
if (display === void 0) return;
|
|
10740
|
+
if (important) display.importantOwners--;
|
|
10741
|
+
if (--display.owners === 0) {
|
|
10742
|
+
HIDDEN_DISPLAYS.delete(el);
|
|
10743
|
+
if (display.value === "") el.style.removeProperty("display");
|
|
10744
|
+
else el.style.setProperty("display", display.value, display.priority);
|
|
10745
|
+
if (!display.hadStyle && el.getAttribute("style") === "") el.removeAttribute("style");
|
|
10746
|
+
} else {
|
|
10747
|
+
enforceHiddenDisplay(el);
|
|
10748
|
+
}
|
|
10749
|
+
}
|
|
10750
|
+
function enforceHiddenText(text) {
|
|
10751
|
+
if (text.data !== "") text.data = "";
|
|
10752
|
+
}
|
|
10753
|
+
function retainHiddenText(text) {
|
|
10754
|
+
const existing = HIDDEN_TEXTS.get(text);
|
|
10755
|
+
if (existing === void 0) HIDDEN_TEXTS.set(text, { owners: 1, data: text.data });
|
|
10756
|
+
else existing.owners++;
|
|
10757
|
+
}
|
|
10758
|
+
function releaseHiddenText(text) {
|
|
10759
|
+
const saved = HIDDEN_TEXTS.get(text);
|
|
10760
|
+
if (saved === void 0) return;
|
|
10761
|
+
if (--saved.owners === 0) {
|
|
10762
|
+
HIDDEN_TEXTS.delete(text);
|
|
10763
|
+
text.data = saved.data;
|
|
10764
|
+
} else {
|
|
10765
|
+
enforceHiddenText(text);
|
|
10766
|
+
}
|
|
10767
|
+
}
|
|
10601
10768
|
function setTryBranch(slot, next) {
|
|
10602
10769
|
slot.branch = next;
|
|
10603
10770
|
if (typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__) {
|
|
@@ -10959,31 +11126,17 @@ function hideBlockHostRange(block, hidden) {
|
|
|
10959
11126
|
const el = node;
|
|
10960
11127
|
if (!hidden.displays.has(el)) {
|
|
10961
11128
|
hidden.displays.add(el);
|
|
10962
|
-
|
|
10963
|
-
|
|
10964
|
-
|
|
10965
|
-
owners: 1,
|
|
10966
|
-
value: el.style.getPropertyValue("display"),
|
|
10967
|
-
priority: el.style.getPropertyPriority("display"),
|
|
10968
|
-
hadStyle: el.hasAttribute("style")
|
|
10969
|
-
});
|
|
10970
|
-
} else {
|
|
10971
|
-
existing.owners++;
|
|
10972
|
-
}
|
|
11129
|
+
retainHiddenDisplay(el, true);
|
|
11130
|
+
} else {
|
|
11131
|
+
enforceHiddenDisplay(el);
|
|
10973
11132
|
}
|
|
10974
|
-
el.style.setProperty("display", "none", "important");
|
|
10975
11133
|
} else if (node.nodeType === 3) {
|
|
10976
11134
|
const text = node;
|
|
10977
11135
|
if (!hidden.texts.has(text)) {
|
|
10978
11136
|
hidden.texts.add(text);
|
|
10979
|
-
|
|
10980
|
-
if (existing === void 0) {
|
|
10981
|
-
SUSPENSE_HIDDEN_TEXTS.set(text, { owners: 1, data: text.data });
|
|
10982
|
-
} else {
|
|
10983
|
-
existing.owners++;
|
|
10984
|
-
}
|
|
11137
|
+
retainHiddenText(text);
|
|
10985
11138
|
}
|
|
10986
|
-
|
|
11139
|
+
enforceHiddenText(text);
|
|
10987
11140
|
}
|
|
10988
11141
|
node = node.nextSibling;
|
|
10989
11142
|
}
|
|
@@ -11011,26 +11164,10 @@ function showTryBlock(state) {
|
|
|
11011
11164
|
if (hidden === null) return;
|
|
11012
11165
|
state.hiddenDom = null;
|
|
11013
11166
|
for (const el of hidden.displays) {
|
|
11014
|
-
|
|
11015
|
-
if (display === void 0) continue;
|
|
11016
|
-
if (--display.owners === 0) {
|
|
11017
|
-
SUSPENSE_HIDDEN_DISPLAYS.delete(el);
|
|
11018
|
-
if (display.value === "") el.style.removeProperty("display");
|
|
11019
|
-
else el.style.setProperty("display", display.value, display.priority);
|
|
11020
|
-
if (!display.hadStyle && el.getAttribute("style") === "") el.removeAttribute("style");
|
|
11021
|
-
} else {
|
|
11022
|
-
el.style.setProperty("display", "none", "important");
|
|
11023
|
-
}
|
|
11167
|
+
releaseHiddenDisplay(el, true);
|
|
11024
11168
|
}
|
|
11025
11169
|
for (const text of hidden.texts) {
|
|
11026
|
-
|
|
11027
|
-
if (saved === void 0) continue;
|
|
11028
|
-
if (--saved.owners === 0) {
|
|
11029
|
-
SUSPENSE_HIDDEN_TEXTS.delete(text);
|
|
11030
|
-
text.data = saved.data;
|
|
11031
|
-
} else if (text.data !== "") {
|
|
11032
|
-
text.data = "";
|
|
11033
|
-
}
|
|
11170
|
+
releaseHiddenText(text);
|
|
11034
11171
|
}
|
|
11035
11172
|
}
|
|
11036
11173
|
function releaseHeldTransition(state) {
|
|
@@ -11182,6 +11319,7 @@ function commitResume(state) {
|
|
|
11182
11319
|
}
|
|
11183
11320
|
function commitResumeInner(state) {
|
|
11184
11321
|
if (state.parentBlock.disposed) return;
|
|
11322
|
+
const hiddenActivity = findHiddenActivity(state.parentBlock);
|
|
11185
11323
|
const wasHeld = state.transitionHeld;
|
|
11186
11324
|
if (wasHeld) state.transitionHeld = false;
|
|
11187
11325
|
HELD_TRANSITIONS.delete(state);
|
|
@@ -11273,14 +11411,33 @@ function commitResumeInner(state) {
|
|
|
11273
11411
|
}
|
|
11274
11412
|
if (!deferringStagedRevealEffects) commitEffects();
|
|
11275
11413
|
} finally {
|
|
11414
|
+
if (hiddenActivity !== null) rehideActivityAfterDescendantRender(hiddenActivity);
|
|
11276
11415
|
if (wasHeld) tickTransitionCount(-1);
|
|
11277
11416
|
}
|
|
11278
11417
|
}
|
|
11279
|
-
function
|
|
11418
|
+
function findHiddenRenderOwner(block, includeActivity) {
|
|
11419
|
+
let activity = null;
|
|
11280
11420
|
for (let p = block; p !== null; p = p.parentBlock) {
|
|
11421
|
+
if (includeActivity && activity === null && p.inactive) {
|
|
11422
|
+
const candidate = p.__activitySlot;
|
|
11423
|
+
if (candidate !== void 0 && candidate.block === p && candidate.hidden) {
|
|
11424
|
+
activity = candidate;
|
|
11425
|
+
}
|
|
11426
|
+
}
|
|
11281
11427
|
const slot = p.__trySlot;
|
|
11282
11428
|
if (slot !== void 0 && slot.tryBlock === p && slot.hiddenDom !== null) return slot;
|
|
11283
11429
|
}
|
|
11430
|
+
return activity;
|
|
11431
|
+
}
|
|
11432
|
+
function findSuspenseHiddenTry(block) {
|
|
11433
|
+
return findHiddenRenderOwner(block, false);
|
|
11434
|
+
}
|
|
11435
|
+
function findHiddenActivity(block) {
|
|
11436
|
+
for (let p = block; p !== null; p = p.parentBlock) {
|
|
11437
|
+
if (!p.inactive) continue;
|
|
11438
|
+
const candidate = p.__activitySlot;
|
|
11439
|
+
if (candidate !== void 0 && candidate.block === p && candidate.hidden) return candidate;
|
|
11440
|
+
}
|
|
11284
11441
|
return null;
|
|
11285
11442
|
}
|
|
11286
11443
|
function snapshotSubtreeEffectDeps(scope) {
|
|
@@ -11396,11 +11553,19 @@ function queueCurrentHiddenRefs(state) {
|
|
|
11396
11553
|
}
|
|
11397
11554
|
}
|
|
11398
11555
|
function attemptHiddenReveal(state, scheduledMode) {
|
|
11556
|
+
const hiddenActivity = findHiddenActivity(state.tryBlock);
|
|
11557
|
+
try {
|
|
11558
|
+
attemptHiddenRevealInner(state, scheduledMode);
|
|
11559
|
+
} finally {
|
|
11560
|
+
if (hiddenActivity !== null) rehideActivityAfterDescendantRender(hiddenActivity);
|
|
11561
|
+
}
|
|
11562
|
+
}
|
|
11563
|
+
function attemptHiddenRevealInner(state, scheduledMode) {
|
|
11399
11564
|
const tryBlock2 = state.tryBlock;
|
|
11400
11565
|
if (tryBlock2 === null || tryBlock2.disposed || state.hiddenDom === null) return;
|
|
11401
11566
|
const hiddenAncestor = findSuspenseHiddenTry(tryBlock2.parentBlock);
|
|
11402
11567
|
if (hiddenAncestor !== null) {
|
|
11403
|
-
|
|
11568
|
+
attemptHiddenRevealInner(hiddenAncestor, scheduledMode);
|
|
11404
11569
|
return;
|
|
11405
11570
|
}
|
|
11406
11571
|
STAGED_REVEALS.delete(state);
|
|
@@ -11684,7 +11849,7 @@ function useTransition(slot) {
|
|
|
11684
11849
|
}
|
|
11685
11850
|
};
|
|
11686
11851
|
TRANSITION_LISTENERS.add(listener);
|
|
11687
|
-
(scope
|
|
11852
|
+
registerHookCleanup(scope, () => TRANSITION_LISTENERS.delete(listener));
|
|
11688
11853
|
}
|
|
11689
11854
|
return [s.isPending, s.start];
|
|
11690
11855
|
}
|
|
@@ -11786,7 +11951,7 @@ function useFormStatus(slot) {
|
|
|
11786
11951
|
s = { form: null, listener: null };
|
|
11787
11952
|
const slotRef = s;
|
|
11788
11953
|
ensureHooks(scope).set(slot, slotRef);
|
|
11789
|
-
(scope
|
|
11954
|
+
registerHookCleanup(scope, () => {
|
|
11790
11955
|
if (slotRef.form && slotRef.listener)
|
|
11791
11956
|
FORM_STATUS_LISTENERS.get(slotRef.form)?.delete(slotRef.listener);
|
|
11792
11957
|
});
|
|
@@ -11861,7 +12026,7 @@ function useOptimistic(passthrough, updateFnOrSlot, slot) {
|
|
|
11861
12026
|
if (TRANSITION_PENDING_COUNT === 0 && slotRef.armed) clear();
|
|
11862
12027
|
};
|
|
11863
12028
|
TRANSITION_LISTENERS.add(listener);
|
|
11864
|
-
(scope
|
|
12029
|
+
registerHookCleanup(scope, () => TRANSITION_LISTENERS.delete(listener));
|
|
11865
12030
|
}
|
|
11866
12031
|
s.updateFn = updateFn;
|
|
11867
12032
|
let optimistic = passthrough;
|
|
@@ -12388,25 +12553,49 @@ function ifBlock(parentScope, slotKey, domParent, cond, thenBody, elseBody, anch
|
|
|
12388
12553
|
function hideActivityRange(state) {
|
|
12389
12554
|
const b = state.block;
|
|
12390
12555
|
if (!b) return;
|
|
12556
|
+
for (const el of state.hiddenDisplays) {
|
|
12557
|
+
if (el.parentNode !== b.parentNode) {
|
|
12558
|
+
state.hiddenDisplays.delete(el);
|
|
12559
|
+
releaseHiddenDisplay(el, false);
|
|
12560
|
+
}
|
|
12561
|
+
}
|
|
12562
|
+
for (const text of state.hiddenTexts) {
|
|
12563
|
+
if (text.parentNode !== b.parentNode) {
|
|
12564
|
+
state.hiddenTexts.delete(text);
|
|
12565
|
+
releaseHiddenText(text);
|
|
12566
|
+
}
|
|
12567
|
+
}
|
|
12391
12568
|
let node = b.startMarker.nextSibling;
|
|
12392
12569
|
while (node && node !== b.endMarker) {
|
|
12393
12570
|
if (node.nodeType === 1) {
|
|
12394
12571
|
const el = node;
|
|
12395
|
-
if (!state.
|
|
12396
|
-
|
|
12572
|
+
if (!state.hiddenDisplays.has(el)) {
|
|
12573
|
+
state.hiddenDisplays.add(el);
|
|
12574
|
+
retainHiddenDisplay(el, false);
|
|
12575
|
+
} else {
|
|
12576
|
+
enforceHiddenDisplay(el);
|
|
12577
|
+
}
|
|
12397
12578
|
} else if (node.nodeType === 3) {
|
|
12398
12579
|
const t = node;
|
|
12399
|
-
if (!state.
|
|
12400
|
-
|
|
12580
|
+
if (!state.hiddenTexts.has(t)) {
|
|
12581
|
+
state.hiddenTexts.add(t);
|
|
12582
|
+
retainHiddenText(t);
|
|
12583
|
+
}
|
|
12584
|
+
enforceHiddenText(t);
|
|
12401
12585
|
}
|
|
12402
12586
|
node = node.nextSibling;
|
|
12403
12587
|
}
|
|
12404
12588
|
}
|
|
12589
|
+
function rehideActivityAfterDescendantRender(state) {
|
|
12590
|
+
const b = state.block;
|
|
12591
|
+
if (b === null || !state.hidden || state.deactivationPending || blockSubtreeDisposed(b)) return;
|
|
12592
|
+
hideActivityRange(state);
|
|
12593
|
+
}
|
|
12405
12594
|
function showActivityRange(state) {
|
|
12406
|
-
for (const
|
|
12407
|
-
state.
|
|
12408
|
-
for (const
|
|
12409
|
-
state.
|
|
12595
|
+
for (const el of state.hiddenDisplays) releaseHiddenDisplay(el, false);
|
|
12596
|
+
state.hiddenDisplays.clear();
|
|
12597
|
+
for (const text of state.hiddenTexts) releaseHiddenText(text);
|
|
12598
|
+
state.hiddenTexts.clear();
|
|
12410
12599
|
}
|
|
12411
12600
|
function queueActivityDeactivation(state, block, commitVersion) {
|
|
12412
12601
|
enqueueEffectEventCommitAction(() => {
|
|
@@ -12456,9 +12645,10 @@ function activityBlock(parentScope, slotKey, domParent, mode, body, anchor, env)
|
|
|
12456
12645
|
hidden: false,
|
|
12457
12646
|
commitVersion: 0,
|
|
12458
12647
|
deactivationPending: false,
|
|
12459
|
-
|
|
12460
|
-
|
|
12648
|
+
hiddenDisplays: /* @__PURE__ */ new Set(),
|
|
12649
|
+
hiddenTexts: /* @__PURE__ */ new Set()
|
|
12461
12650
|
};
|
|
12651
|
+
b2.__activitySlot = state;
|
|
12462
12652
|
parentScope.slots[slotKey] = state;
|
|
12463
12653
|
registerSlot(parentScope, state);
|
|
12464
12654
|
const adopted = open !== null;
|
package/dist/universal-core.d.ts
CHANGED
|
@@ -611,6 +611,7 @@ export interface ObjectHostInstance {
|
|
|
611
611
|
}
|
|
612
612
|
interface ObjectDriverState {
|
|
613
613
|
instances: Map<number, ObjectHostInstance>;
|
|
614
|
+
parents: Map<number, number | null>;
|
|
614
615
|
events: Map<number, Map<string, UniversalEventListenerDescriptor>>;
|
|
615
616
|
lifecycles: Map<number, Map<string, UniversalListenerDescriptor>>;
|
|
616
617
|
localCallbacks: Map<number, Map<string, UniversalListenerDescriptor>>;
|