foldkit 0.168.0-canary.e93c434c9368 → 0.169.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dom/inert.d.ts +7 -3
- package/dist/dom/inert.d.ts.map +1 -1
- package/dist/dom/inert.js +19 -9
- package/dist/dom/streamFromKeyBindings.d.ts +5 -3
- package/dist/dom/streamFromKeyBindings.d.ts.map +1 -1
- package/dist/dom/streamFromKeyBindings.js +7 -4
- package/dist/html/boundary.d.ts +17 -16
- package/dist/html/boundary.d.ts.map +1 -1
- package/dist/html/boundary.js +9 -9
- package/dist/html/childAttribute.d.ts +5 -5
- package/dist/html/index.d.ts.map +1 -1
- package/dist/html/index.js +24 -17
- package/dist/html/lazy.d.ts +130 -0
- package/dist/html/lazy.d.ts.map +1 -1
- package/dist/html/lazy.js +54 -6
- package/dist/html/runtimeSingleton.d.ts +2 -2
- package/dist/html/runtimeSingleton.d.ts.map +1 -1
- package/dist/html/runtimeSingleton.js +2 -2
- package/dist/html/submodel.d.ts.map +1 -1
- package/dist/html/submodel.js +20 -11
- package/dist/imeComposition.d.ts +3 -0
- package/dist/imeComposition.d.ts.map +1 -0
- package/dist/imeComposition.js +6 -0
- package/dist/mount/index.d.ts +6 -5
- package/dist/mount/index.d.ts.map +1 -1
- package/dist/route/transition.d.ts +50 -0
- package/dist/route/transition.d.ts.map +1 -1
- package/dist/route/transition.js +48 -0
- package/dist/runtime/messageQueue.d.ts +1 -0
- package/dist/runtime/messageQueue.d.ts.map +1 -1
- package/dist/runtime/messageQueue.js +2 -0
- package/dist/runtime/renderer.d.ts.map +1 -1
- package/dist/runtime/renderer.js +18 -3
- package/dist/snabbdom/hooks.d.ts +2 -0
- package/dist/snabbdom/hooks.d.ts.map +1 -1
- package/dist/snabbdom/init.d.ts.map +1 -1
- package/dist/snabbdom/init.js +42 -12
- package/dist/test/internal.d.ts.map +1 -1
- package/dist/test/internal.js +9 -2
- package/dist/test/lazy.d.ts +26 -0
- package/dist/test/lazy.d.ts.map +1 -0
- package/dist/test/lazy.js +103 -0
- package/dist/test/public.d.ts +1 -0
- package/dist/test/public.d.ts.map +1 -1
- package/dist/test/public.js +1 -0
- package/package.json +1 -1
package/dist/dom/inert.d.ts
CHANGED
|
@@ -10,9 +10,13 @@ export declare const isolateOutsideElements: (allowedElements: ReadonlyArray<HTM
|
|
|
10
10
|
/**
|
|
11
11
|
* Marks all DOM elements outside the given selectors as `inert` and
|
|
12
12
|
* `aria-hidden="true"`. Walks each allowed element up to `document.body`,
|
|
13
|
-
* marking siblings that don't contain an allowed element.
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* marking siblings that don't contain an allowed element. Reference counting
|
|
14
|
+
* allows nested calls with different ids.
|
|
15
|
+
*
|
|
16
|
+
* Reusing an id acquires the replacement isolation before releasing the
|
|
17
|
+
* previous one, so shared elements keep `inert` and `aria-hidden` throughout.
|
|
18
|
+
* One `restoreInert` releases that id's isolation. Calling it before the
|
|
19
|
+
* pending render commits discards the request.
|
|
16
20
|
*
|
|
17
21
|
* @example
|
|
18
22
|
* ```typescript
|
package/dist/dom/inert.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inert.d.ts","sourceRoot":"","sources":["../../src/dom/inert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAA2C,MAAM,QAAQ,CAAA;AAc/E,KAAK,cAAc,GAAG,aAAa,GAAG,OAAO,CAAA;AAoH7C,eAAO,MAAM,oBAAoB,QAAO,QAAQ,CAAC;IAC/C,MAAM,EAAE,CAAC,eAAe,EAAE,aAAa,CAAC,WAAW,CAAC,KAAK,IAAI,CAAA;IAC7D,QAAQ,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAA;IAC3C,uBAAuB,EAAE,CACvB,OAAO,EAAE,WAAW,EACpB,aAAa,EAAE,cAAc,KAC1B,IAAI,CAAA;IACT,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAyCA,CAAA;AAED,eAAO,MAAM,sBAAsB,oBAChB,aAAa,CAAC,WAAW,CAAC,KAC1C,CAAC,MAAM,IAAI,CAKb,CAAA;
|
|
1
|
+
{"version":3,"file":"inert.d.ts","sourceRoot":"","sources":["../../src/dom/inert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAA2C,MAAM,QAAQ,CAAA;AAc/E,KAAK,cAAc,GAAG,aAAa,GAAG,OAAO,CAAA;AAoH7C,eAAO,MAAM,oBAAoB,QAAO,QAAQ,CAAC;IAC/C,MAAM,EAAE,CAAC,eAAe,EAAE,aAAa,CAAC,WAAW,CAAC,KAAK,IAAI,CAAA;IAC7D,QAAQ,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAA;IAC3C,uBAAuB,EAAE,CACvB,OAAO,EAAE,WAAW,EACpB,aAAa,EAAE,cAAc,KAC1B,IAAI,CAAA;IACT,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAyCA,CAAA;AAED,eAAO,MAAM,sBAAsB,oBAChB,aAAa,CAAC,WAAW,CAAC,KAC1C,CAAC,MAAM,IAAI,CAKb,CAAA;AAaD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,WAAW,OAClB,MAAM,oBACQ,aAAa,CAAC,MAAM,CAAC,KACtC,MAAM,CAAC,MAAM,CAAC,IAAI,CAmBjB,CAAA;AAEJ;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,OAAQ,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAIxD,CAAA"}
|
package/dist/dom/inert.js
CHANGED
|
@@ -123,12 +123,24 @@ export const isolateOutsideElements = (allowedElements) => {
|
|
|
123
123
|
isolation.update(allowedElements);
|
|
124
124
|
return isolation.dispose;
|
|
125
125
|
};
|
|
126
|
+
const releaseStoredCleanups = (id) => {
|
|
127
|
+
const cleanupFunctions = inertState.cleanups.get(id);
|
|
128
|
+
if (cleanupFunctions === undefined) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
inertState.cleanups.delete(id);
|
|
132
|
+
Array.forEach(cleanupFunctions, cleanup => cleanup());
|
|
133
|
+
};
|
|
126
134
|
/**
|
|
127
135
|
* Marks all DOM elements outside the given selectors as `inert` and
|
|
128
136
|
* `aria-hidden="true"`. Walks each allowed element up to `document.body`,
|
|
129
|
-
* marking siblings that don't contain an allowed element.
|
|
130
|
-
*
|
|
131
|
-
*
|
|
137
|
+
* marking siblings that don't contain an allowed element. Reference counting
|
|
138
|
+
* allows nested calls with different ids.
|
|
139
|
+
*
|
|
140
|
+
* Reusing an id acquires the replacement isolation before releasing the
|
|
141
|
+
* previous one, so shared elements keep `inert` and `aria-hidden` throughout.
|
|
142
|
+
* One `restoreInert` releases that id's isolation. Calling it before the
|
|
143
|
+
* pending render commits discards the request.
|
|
132
144
|
*
|
|
133
145
|
* @example
|
|
134
146
|
* ```typescript
|
|
@@ -146,7 +158,9 @@ export const inertOthers = (id, allowedSelectors) => Effect.gen(function* () {
|
|
|
146
158
|
return;
|
|
147
159
|
}
|
|
148
160
|
const allowedElements = resolveElements(allowedSelectors);
|
|
149
|
-
|
|
161
|
+
const dispose = isolateOutsideElements(allowedElements);
|
|
162
|
+
releaseStoredCleanups(id);
|
|
163
|
+
inertState.cleanups.set(id, [dispose]);
|
|
150
164
|
});
|
|
151
165
|
/**
|
|
152
166
|
* Restores all elements previously marked inert by `inertOthers` for the
|
|
@@ -160,9 +174,5 @@ export const inertOthers = (id, allowedSelectors) => Effect.gen(function* () {
|
|
|
160
174
|
*/
|
|
161
175
|
export const restoreInert = (id) => Effect.sync(() => {
|
|
162
176
|
inertState.requests.delete(id);
|
|
163
|
-
|
|
164
|
-
if (cleanupFunctions) {
|
|
165
|
-
Array.forEach(cleanupFunctions, cleanup => cleanup());
|
|
166
|
-
inertState.cleanups.delete(id);
|
|
167
|
-
}
|
|
177
|
+
releaseStoredCleanups(id);
|
|
168
178
|
});
|
|
@@ -52,9 +52,11 @@ export type StreamFromKeyBindingsConfig<Output> = Readonly<{
|
|
|
52
52
|
* Bindings are suppressed by default when the event's composed path contains
|
|
53
53
|
* an `input`, `textarea`, `select`, or contenteditable element. Set
|
|
54
54
|
* `whileTyping` to `'Allow'` for a binding that must work there. Events emitted
|
|
55
|
-
* during IME composition are always ignored
|
|
56
|
-
*
|
|
57
|
-
*
|
|
55
|
+
* during IME composition are always ignored, including a keydown some browsers
|
|
56
|
+
* report with `keyCode` 229 and `isComposing` false. Repeated keydowns are
|
|
57
|
+
* ignored for one-press bindings unless `whenRepeated` is `'Allow'`. An event
|
|
58
|
+
* another handler already canceled is ignored and clears any sequence in
|
|
59
|
+
* progress.
|
|
58
60
|
*
|
|
59
61
|
* Matched key presses call `preventDefault()` before dispatching. For a
|
|
60
62
|
* sequence, that policy applies to every matched press. Set `preventDefault`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamFromKeyBindings.d.ts","sourceRoot":"","sources":["../../src/dom/streamFromKeyBindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAOR,MAAM,EAGP,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"streamFromKeyBindings.d.ts","sourceRoot":"","sources":["../../src/dom/streamFromKeyBindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAOR,MAAM,EAGP,MAAM,QAAQ,CAAA;AAIf,oFAAoF;AACpF,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,OAAO,CAAA;AAE9C,mEAAmE;AACnE,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;AAE/E,KAAK,WAAW,CAAC,MAAM,IAAI,QAAQ,CAAC;IAClC,IAAI,EAAE,WAAW,CAAA;IACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,MAAM,CAAA;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB,CAAC,CAAA;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,CAAC,MAAM,IAAI,WAAW,CAAC,MAAM,CAAC,GAClD,CACI,QAAQ,CAAC;IACP,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;CAClC,CAAC,GACF,QAAQ,CAAC;IACP,IAAI,EAAE,QAAQ,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IAClD,YAAY,CAAC,EAAE,KAAK,CAAA;CACrB,CAAC,CACL,CAAA;AAEH,KAAK,MAAM,GAAG,SAAS,GAAG,MAAM,CAAA;AAEhC,yEAAyE;AACzE,MAAM,MAAM,2BAA2B,CAAC,MAAM,IAAI,QAAQ,CAAC;IACzD,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAA;IAC3C,MAAM,CAAC,EAAE,WAAW,GAAG,CAAC,MAAM,WAAW,CAAC,CAAA;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,eAAe,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAA;CACjC,CAAC,CAAA;AAwzBF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EG;AACH,eAAO,MAAM,qBAAqB,GAAI,MAAM,UAClC,2BAA2B,CAAC,MAAM,CAAC,KAC1C,MAAM,CAAC,MAAM,CAAC,MAAM,CACuC,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Array, Duration, Effect, Match, Number, Option, Predicate, Queue, Stream, String, pipe, } from 'effect';
|
|
2
|
+
import { isImeCompositionKeydown } from '../imeComposition.js';
|
|
2
3
|
const DEFAULT_SEQUENCE_TIMEOUT = Duration.seconds(1);
|
|
3
4
|
const APPLE_PLATFORM_PATTERN = /Mac|iPhone|iPad|iPod/;
|
|
4
5
|
const MODIFIER_KEYS = [
|
|
@@ -312,7 +313,7 @@ const handleKeyBindingEvent = (context, event) => {
|
|
|
312
313
|
if (!isKeyboardEvent(event)) {
|
|
313
314
|
return;
|
|
314
315
|
}
|
|
315
|
-
if (event.defaultPrevented || event
|
|
316
|
+
if (event.defaultPrevented || isImeCompositionKeydown(event)) {
|
|
316
317
|
context.sequenceController.clearSequence();
|
|
317
318
|
return;
|
|
318
319
|
}
|
|
@@ -432,9 +433,11 @@ const keyBindingStream = (config) => Stream.callback(queue => {
|
|
|
432
433
|
* Bindings are suppressed by default when the event's composed path contains
|
|
433
434
|
* an `input`, `textarea`, `select`, or contenteditable element. Set
|
|
434
435
|
* `whileTyping` to `'Allow'` for a binding that must work there. Events emitted
|
|
435
|
-
* during IME composition are always ignored
|
|
436
|
-
*
|
|
437
|
-
*
|
|
436
|
+
* during IME composition are always ignored, including a keydown some browsers
|
|
437
|
+
* report with `keyCode` 229 and `isComposing` false. Repeated keydowns are
|
|
438
|
+
* ignored for one-press bindings unless `whenRepeated` is `'Allow'`. An event
|
|
439
|
+
* another handler already canceled is ignored and clears any sequence in
|
|
440
|
+
* progress.
|
|
438
441
|
*
|
|
439
442
|
* Matched key presses call `preventDefault()` before dispatching. For a
|
|
440
443
|
* sequence, that policy applies to every matched press. Set `preventDefault`
|
package/dist/html/boundary.d.ts
CHANGED
|
@@ -37,9 +37,9 @@ export declare const composeBoundary: (parent: BoundaryId, childId: string) => B
|
|
|
37
37
|
/** Per-runtime registry of Submodel wrapping descriptors. The runtime
|
|
38
38
|
* creates one of these in `start` and reuses it across renders.
|
|
39
39
|
* `h.submodel` writes into `wraps` each render and attaches a snabbdom
|
|
40
|
-
* `
|
|
41
|
-
*
|
|
42
|
-
*
|
|
40
|
+
* `postdestroy` hook that calls `deregisterBoundaryWrap` when snabbdom
|
|
41
|
+
* destroys the corresponding vnode. The dispatch path reads from `wraps` at
|
|
42
|
+
* event-fire time.
|
|
43
43
|
*
|
|
44
44
|
* `boundaryDispatches` caches per-(outerDispatch, boundaryId) dispatcher
|
|
45
45
|
* closures so `requireDispatch` returns a stable reference across
|
|
@@ -56,8 +56,9 @@ export declare const composeBoundary: (parent: BoundaryId, childId: string) => B
|
|
|
56
56
|
* replay render's wraps occupy `wraps`. Its dispatcher therefore reads only
|
|
57
57
|
* the wraps registered by renders with the same root Mount dispatcher, while
|
|
58
58
|
* still seeing replacements from later live renders. `mountWrapOwners`
|
|
59
|
-
* records every owner that has occupied a boundary so its final
|
|
60
|
-
* can clear entries whose earlier hooks were replaced by
|
|
59
|
+
* records every owner that has occupied a boundary so its final
|
|
60
|
+
* `postdestroy` hook can clear entries whose earlier hooks were replaced by
|
|
61
|
+
* in-place patches.
|
|
61
62
|
*
|
|
62
63
|
* `seenThisRender` tracks boundaries marked alive during the current
|
|
63
64
|
* render for duplicate-slotId detection: two `h.submodel` calls
|
|
@@ -69,8 +70,8 @@ export declare const composeBoundary: (parent: BoundaryId, childId: string) => B
|
|
|
69
70
|
* cache hit are replayed into this map via
|
|
70
71
|
* {@link restoreBoundaryWrapsForLazyHit} so the duplicate-slotId guard
|
|
71
72
|
* catches collisions against memoized siblings, not just against siblings
|
|
72
|
-
* that re-ran this frame. It does not drive pruning; VNode
|
|
73
|
-
* remove a descriptor only when it is still the current entry, so an old
|
|
73
|
+
* that re-ran this frame. It does not drive pruning; VNode `postdestroy`
|
|
74
|
+
* hooks remove a descriptor only when it is still the current entry, so an old
|
|
74
75
|
* root cannot delete a same-cycle remount.
|
|
75
76
|
*
|
|
76
77
|
* `lazyTrackingStack` is a stack of maps used by `createLazy` and
|
|
@@ -88,7 +89,7 @@ export declare const composeBoundary: (parent: BoundaryId, childId: string) => B
|
|
|
88
89
|
* Submodel view's registration and lazy-cache writes transactional. If that
|
|
89
90
|
* view throws or returns `null`, every nested registration and cache entry it
|
|
90
91
|
* produced is restored because none of those VNodes will reach snabbdom and
|
|
91
|
-
* run its
|
|
92
|
+
* run its `postdestroy` hook. */
|
|
92
93
|
export type BoundaryRegistry = {
|
|
93
94
|
readonly wraps: Map<BoundaryId, WrapDescriptor>;
|
|
94
95
|
readonly boundaryDispatches: WeakMap<DispatchSync, Map<BoundaryId, DispatchSync>>;
|
|
@@ -124,8 +125,9 @@ export declare const endLazyTracking: (registry: BoundaryRegistry) => void;
|
|
|
124
125
|
export declare const restoreBoundaryWrapsForLazyHit: (registry: BoundaryRegistry, trackedBoundaries: ReadonlyMap<BoundaryId, TrackedBoundaryWrap>) => void;
|
|
125
126
|
/** Removes a boundary's wrap when it still matches the descriptor owned by the
|
|
126
127
|
* VNode being destroyed. A replacement registered earlier in the same patch
|
|
127
|
-
* is left intact. Called by `h.submodel`'s
|
|
128
|
-
* VNode
|
|
128
|
+
* is left intact. Called by `h.submodel`'s `postdestroy` hook when snabbdom
|
|
129
|
+
* destroys the corresponding VNode, after every `destroy` hook in that VNode's
|
|
130
|
+
* subtree has run.
|
|
129
131
|
*
|
|
130
132
|
* Does not touch `boundaryDispatches`: it is a WeakMap keyed by
|
|
131
133
|
* outerDispatch, so per-outerDispatch inner Maps become unreachable and
|
|
@@ -154,11 +156,10 @@ export declare const rollbackBoundaryWrapTransaction: (registry: BoundaryRegistr
|
|
|
154
156
|
* which defers the chain lookup to fire time, this snapshots the chain at call
|
|
155
157
|
* time so the resulting thunk survives the boundary being deregistered.
|
|
156
158
|
*
|
|
157
|
-
* Used by `OnUnmount
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
* avoids that race. Throws here (at resolve time, boundary alive) if a wrap is
|
|
159
|
+
* Used by `OnUnmount`, whose dispatch runs during teardown or, after a failed
|
|
160
|
+
* replay patch, later still. Resolving eagerly while the chain is live means
|
|
161
|
+
* that dispatch does not depend on what the registry holds at teardown time.
|
|
162
|
+
* Throws here (at resolve time, boundary alive) if a wrap is
|
|
162
163
|
* somehow already missing, surfacing a real corruption rather than misrouting. */
|
|
163
164
|
export declare const resolveBoundaryDispatchThunk: (registry: BoundaryRegistry, outerDispatch: DispatchSync, boundaryId: BoundaryId, message: unknown) => (() => void);
|
|
164
165
|
/** Collects the `toParentMessage` wrapping chain for `boundaryId`, innermost
|
|
@@ -181,7 +182,7 @@ export declare const resolveMountBoundaryDispatch: (registry: BoundaryRegistry,
|
|
|
181
182
|
* per-render duplicate-slotId tracking map so siblings inside the
|
|
182
183
|
* same parent boundary can be re-validated. Does not touch the wrap
|
|
183
184
|
* or dispatcher tables. Those persist across renders and are evicted
|
|
184
|
-
* by VNode
|
|
185
|
+
* by VNode `postdestroy` hooks instead. */
|
|
185
186
|
export declare const beginRender: (registry: BoundaryRegistry) => void;
|
|
186
187
|
export {};
|
|
187
188
|
//# sourceMappingURL=boundary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boundary.d.ts","sourceRoot":"","sources":["../../src/html/boundary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,wDAAwD;AACxD,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IACpC,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAA;CAC/C,CAAC,CAAA;AAEF;;;;eAIe;AACf,MAAM,MAAM,UAAU,GAAG,MAAM,CAAA;AAI/B,KAAK,wBAAwB,GAAG,QAAQ,CAAC;IACvC,IAAI,EAAE,cAAc,CAAA;IACpB,UAAU,EAAE,UAAU,CAAA;IACtB,UAAU,EAAE,cAAc,CAAA;IAC1B,kBAAkB,EAAE,YAAY,CAAA;IAChC,kBAAkB,EAAE,cAAc,GAAG,SAAS,CAAA;IAC9C,uBAAuB,EAAE,cAAc,GAAG,SAAS,CAAA;CACpD,CAAC,CAAA;AAEF,KAAK,oBAAoB,GAAG,QAAQ,CAAC;IACnC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IAAI,CAYb,CAAA;AAED;;;;;;;8EAO8E;AAC9E,eAAO,MAAM,eAAe,aAChB,gBAAgB,cACd,UAAU,KACrB,aAAa,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAQ7C,CAAA;AAED,eAAO,MAAM,2BAA2B,aAC5B,gBAAgB,iBACX,YAAY,cACf,UAAU,KACrB,YAkBF,CAAA;AAED;;;;gFAIgF;AAChF,eAAO,MAAM,4BAA4B,aAC7B,gBAAgB,sBACN,YAAY,cACpB,UAAU,KACrB,YAsBF,CAAA;AAED;;;;4CAI4C;AAC5C,eAAO,MAAM,WAAW,aAAc,gBAAgB,KAAG,IAGxD,CAAA"}
|
package/dist/html/boundary.js
CHANGED
|
@@ -149,8 +149,9 @@ export const restoreBoundaryWrapsForLazyHit = (registry, trackedBoundaries) => {
|
|
|
149
149
|
};
|
|
150
150
|
/** Removes a boundary's wrap when it still matches the descriptor owned by the
|
|
151
151
|
* VNode being destroyed. A replacement registered earlier in the same patch
|
|
152
|
-
* is left intact. Called by `h.submodel`'s
|
|
153
|
-
* VNode
|
|
152
|
+
* is left intact. Called by `h.submodel`'s `postdestroy` hook when snabbdom
|
|
153
|
+
* destroys the corresponding VNode, after every `destroy` hook in that VNode's
|
|
154
|
+
* subtree has run.
|
|
154
155
|
*
|
|
155
156
|
* Does not touch `boundaryDispatches`: it is a WeakMap keyed by
|
|
156
157
|
* outerDispatch, so per-outerDispatch inner Maps become unreachable and
|
|
@@ -183,7 +184,7 @@ export const deregisterBoundaryWrap = (registry, boundaryId, descriptor, mountOu
|
|
|
183
184
|
};
|
|
184
185
|
/** Restores the registry entries replaced by one boundary registration that
|
|
185
186
|
* did not produce a VNode. Used when a Submodel view throws or returns
|
|
186
|
-
* `null`, where no
|
|
187
|
+
* `null`, where no `postdestroy` hook will run and cleanup must undo only that
|
|
187
188
|
* render owner's write without evicting descriptors retained by the
|
|
188
189
|
* currently rendered tree. */
|
|
189
190
|
const rollbackBoundaryWrapRegistration = (registry, boundaryId, descriptor, mountOuterDispatch, previousDescriptor, previousMountDescriptor) => {
|
|
@@ -382,11 +383,10 @@ const dispatchAcrossBoundary = (registry, outerDispatch, boundaryId, message) =>
|
|
|
382
383
|
* which defers the chain lookup to fire time, this snapshots the chain at call
|
|
383
384
|
* time so the resulting thunk survives the boundary being deregistered.
|
|
384
385
|
*
|
|
385
|
-
* Used by `OnUnmount
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
*
|
|
389
|
-
* avoids that race. Throws here (at resolve time, boundary alive) if a wrap is
|
|
386
|
+
* Used by `OnUnmount`, whose dispatch runs during teardown or, after a failed
|
|
387
|
+
* replay patch, later still. Resolving eagerly while the chain is live means
|
|
388
|
+
* that dispatch does not depend on what the registry holds at teardown time.
|
|
389
|
+
* Throws here (at resolve time, boundary alive) if a wrap is
|
|
390
390
|
* somehow already missing, surfacing a real corruption rather than misrouting. */
|
|
391
391
|
export const resolveBoundaryDispatchThunk = (registry, outerDispatch, boundaryId, message) => {
|
|
392
392
|
if (boundaryId === ROOT_BOUNDARY) {
|
|
@@ -449,7 +449,7 @@ export const resolveMountBoundaryDispatch = (registry, mountOuterDispatch, bound
|
|
|
449
449
|
* per-render duplicate-slotId tracking map so siblings inside the
|
|
450
450
|
* same parent boundary can be re-validated. Does not touch the wrap
|
|
451
451
|
* or dispatcher tables. Those persist across renders and are evicted
|
|
452
|
-
* by VNode
|
|
452
|
+
* by VNode `postdestroy` hooks instead. */
|
|
453
453
|
export const beginRender = (registry) => {
|
|
454
454
|
registry.seenThisRender.clear();
|
|
455
455
|
registry.dedupeSeen.clear();
|
|
@@ -9,11 +9,11 @@ declare const BRAND = "__childAttribute";
|
|
|
9
9
|
*
|
|
10
10
|
* `resolveUnmount` snapshots the boundary's wrapping chain at the time the
|
|
11
11
|
* group was published (child boundary alive) so `OnUnmount` can dispatch a
|
|
12
|
-
* root message
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
12
|
+
* root message after the boundary has been torn down. `boundaryMappers`
|
|
13
|
+
* snapshots the `toParentMessage` lifts (innermost first) for the Scene test
|
|
14
|
+
* harness. Groups containing `OnMount` also carry `resolveMountDispatch`,
|
|
15
|
+
* which binds the Mount to the acquiring render's dispatch owner while
|
|
16
|
+
* following that owner's current live wrappers.
|
|
17
17
|
*
|
|
18
18
|
* Created via {@link childAttributes}. Element constructors accept
|
|
19
19
|
* `ChildAttribute` alongside `Attribute<Message>` in their attribute
|