react-native-screen-transitions 3.11.0 → 3.11.2
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/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +27 -15
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js +3 -1
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js +3 -5
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js +5 -4
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +4 -15
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js +22 -24
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +3 -36
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +8 -4
- package/lib/commonjs/shared/components/boundary/utils/destination-signals.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js +2 -4
- package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/descriptors/descriptors.provider.js +3 -7
- package/lib/commonjs/shared/providers/screen/descriptors/descriptors.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js +1 -3
- package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js +3 -20
- package/lib/commonjs/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/create-interpolator-scope.js +40 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/create-interpolator-scope.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-interpolator-style-handoff.js +15 -14
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-interpolator-style-handoff.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +22 -27
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/entries.js +27 -0
- package/lib/commonjs/shared/stores/bounds/internals/entries.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/links.js +25 -0
- package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js +2 -12
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js +2 -2
- package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +30 -18
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js +3 -1
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js +3 -5
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +5 -4
- package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +4 -15
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js +22 -24
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +3 -36
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js +2 -2
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -1
- package/lib/module/shared/components/boundary/utils/destination-signals.js +8 -4
- package/lib/module/shared/components/boundary/utils/destination-signals.js.map +1 -1
- package/lib/module/shared/components/boundary/utils/refresh-signals.js +2 -4
- package/lib/module/shared/components/boundary/utils/refresh-signals.js.map +1 -1
- package/lib/module/shared/providers/screen/descriptors/descriptors.provider.js +4 -8
- package/lib/module/shared/providers/screen/descriptors/descriptors.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js +1 -3
- package/lib/module/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js.map +1 -1
- package/lib/module/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js +3 -19
- package/lib/module/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/helpers/create-interpolator-scope.js +35 -0
- package/lib/module/shared/providers/screen/styles/helpers/create-interpolator-scope.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/helpers/resolve-interpolator-style-handoff.js +15 -14
- package/lib/module/shared/providers/screen/styles/helpers/resolve-interpolator-style-handoff.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +22 -27
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/entries.js +27 -1
- package/lib/module/shared/stores/bounds/internals/entries.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/links.js +25 -2
- package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/resolver.js +3 -13
- package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js +3 -3
- package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.d.ts +1 -5
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts +0 -2
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts +2 -3
- package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts +0 -2
- package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.d.ts +1 -3
- package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/descriptors/helpers/get-ancestor-keys.d.ts +0 -8
- package/lib/typescript/shared/providers/screen/descriptors/helpers/get-ancestor-keys.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/create-interpolator-scope.d.ts +9 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/create-interpolator-scope.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-interpolator-style-handoff.d.ts +1 -3
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-interpolator-style-handoff.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts +4 -4
- package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/entries.d.ts +2 -1
- package/lib/typescript/shared/stores/bounds/internals/entries.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/links.d.ts +3 -1
- package/lib/typescript/shared/stores/bounds/internals/links.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/create-link-accessor.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts +67 -24
- package/src/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.ts +6 -1
- package/src/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.ts +8 -9
- package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +5 -4
- package/src/shared/components/boundary/portal/components/boundary-content-portal/components/host.tsx +1 -1
- package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx +4 -20
- package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.ts +27 -37
- package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +10 -57
- package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.ts +1 -8
- package/src/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.ts +0 -3
- package/src/shared/components/boundary/utils/destination-signals.ts +8 -8
- package/src/shared/components/boundary/utils/refresh-signals.ts +2 -10
- package/src/shared/providers/screen/descriptors/descriptors.provider.tsx +4 -11
- package/src/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.ts +0 -4
- package/src/shared/providers/screen/descriptors/helpers/get-ancestor-keys.ts +3 -30
- package/src/shared/providers/screen/styles/helpers/create-interpolator-scope.ts +45 -0
- package/src/shared/providers/screen/styles/helpers/resolve-interpolator-style-handoff.ts +16 -16
- package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +28 -35
- package/src/shared/stores/bounds/internals/entries.ts +38 -1
- package/src/shared/stores/bounds/internals/links.ts +36 -0
- package/src/shared/stores/bounds/internals/resolver.ts +7 -21
- package/src/shared/utils/bounds/helpers/create-link-accessor.ts +9 -3
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.js +0 -18
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-bounds-accessor.js +0 -21
- package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-bounds-accessor.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.js +0 -13
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.js.map +0 -1
- package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-bounds-accessor.js +0 -16
- package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-bounds-accessor.js.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.d.ts +0 -3
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/accessors/use-build-bounds-accessor.d.ts +0 -2
- package/lib/typescript/shared/providers/screen/animation/helpers/accessors/use-build-bounds-accessor.d.ts.map +0 -1
- package/src/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.ts +0 -16
- package/src/shared/providers/screen/animation/helpers/accessors/use-build-bounds-accessor.tsx +0 -15
|
@@ -18,7 +18,6 @@ import type {
|
|
|
18
18
|
} from "../../../../types/animation.types";
|
|
19
19
|
import { logger } from "../../../../utils/logger";
|
|
20
20
|
import { useScreenAnimationStore } from "../../animation";
|
|
21
|
-
import { useBuildBoundsAccessor } from "../../animation/helpers/accessors/use-build-bounds-accessor";
|
|
22
21
|
import { useBuildTransitionAccessor } from "../../animation/helpers/accessors/use-build-transition-accessor";
|
|
23
22
|
import type { ScreenInterpolatorFrame } from "../../animation/helpers/pipeline";
|
|
24
23
|
import { readScreenAnimationRevisions } from "../../animation/helpers/read-screen-animation-revisions";
|
|
@@ -29,6 +28,7 @@ import {
|
|
|
29
28
|
useScreenOptionsStore,
|
|
30
29
|
} from "../../options";
|
|
31
30
|
import { collectInterpolatorSharedValues } from "../helpers/collect-interpolator-shared-values";
|
|
31
|
+
import { createInterpolatorScope } from "../helpers/create-interpolator-scope";
|
|
32
32
|
import { normalizeSlots } from "../helpers/normalize-slots";
|
|
33
33
|
import { resolveInterpolatorStyleHandoff } from "../helpers/resolve-interpolator-style-handoff";
|
|
34
34
|
import type { LocalStyleLayers } from "../helpers/resolve-slot-styles";
|
|
@@ -54,7 +54,6 @@ type RunInterpolatorParams = {
|
|
|
54
54
|
interpolator: ScreenStyleInterpolator | undefined;
|
|
55
55
|
props: ScreenInterpolatorFrame;
|
|
56
56
|
selectedFrame: SelectedInterpolatorFrame;
|
|
57
|
-
bounds: Parameters<ScreenStyleInterpolator>[0]["bounds"];
|
|
58
57
|
transition: Parameters<ScreenStyleInterpolator>[0]["transition"];
|
|
59
58
|
};
|
|
60
59
|
|
|
@@ -76,7 +75,6 @@ const runInterpolator = ({
|
|
|
76
75
|
interpolator,
|
|
77
76
|
props,
|
|
78
77
|
selectedFrame,
|
|
79
|
-
bounds,
|
|
80
78
|
transition,
|
|
81
79
|
}: RunInterpolatorParams): InterpolatorResult | undefined => {
|
|
82
80
|
"worklet";
|
|
@@ -86,12 +84,13 @@ const runInterpolator = ({
|
|
|
86
84
|
}
|
|
87
85
|
|
|
88
86
|
try {
|
|
89
|
-
const raw = interpolator(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
87
|
+
const raw = interpolator(
|
|
88
|
+
createInterpolatorScope({
|
|
89
|
+
frame: props,
|
|
90
|
+
selectedFrame,
|
|
91
|
+
transition,
|
|
92
|
+
}),
|
|
93
|
+
);
|
|
95
94
|
|
|
96
95
|
const rawStyleMap: TransitionInterpolatedStyle | undefined =
|
|
97
96
|
typeof raw === "object" && raw != null ? raw : undefined;
|
|
@@ -125,10 +124,10 @@ const runInterpolator = ({
|
|
|
125
124
|
* normal interpolator selection once the gesture-driven close is no longer in
|
|
126
125
|
* play.
|
|
127
126
|
*
|
|
128
|
-
* At an ownership handoff, the
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
127
|
+
* At an ownership handoff, the current interpolator remains live but is
|
|
128
|
+
* evaluated without the next-screen relationship. The next owner replaces
|
|
129
|
+
* matching scalar keys and composes its live transforms after the current
|
|
130
|
+
* screen's self-owned transforms.
|
|
132
131
|
*/
|
|
133
132
|
export const useInterpolatedStylesMap = ({
|
|
134
133
|
enabled,
|
|
@@ -154,7 +153,6 @@ export const useInterpolatedStylesMap = ({
|
|
|
154
153
|
ancestorScreenAnimationSources,
|
|
155
154
|
descendantScreenAnimationSources,
|
|
156
155
|
} = useScreenAnimationStore();
|
|
157
|
-
const boundsAccessor = useBuildBoundsAccessor();
|
|
158
156
|
const transition = useBuildTransitionAccessor();
|
|
159
157
|
const nextInterpolatorReady = useSharedValue(0);
|
|
160
158
|
|
|
@@ -177,8 +175,6 @@ export const useInterpolatedStylesMap = ({
|
|
|
177
175
|
|
|
178
176
|
const isGesturingDuringCloseAnimation = useSharedValue(false);
|
|
179
177
|
const initialDestinationStylesReady = useSharedValue(0);
|
|
180
|
-
const frozenCurrentStylesMap =
|
|
181
|
-
useSharedValue<NormalizedTransitionInterpolatedStyle>(NO_STYLES);
|
|
182
178
|
const shouldPrepareInitialDestinationStyles =
|
|
183
179
|
enabled && !!destinationPairKey && !nextScreenKey && !!currentInterpolator;
|
|
184
180
|
|
|
@@ -261,17 +257,20 @@ export const useInterpolatedStylesMap = ({
|
|
|
261
257
|
? "current"
|
|
262
258
|
: "next";
|
|
263
259
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
260
|
+
// Once the next interpolator owns the relationship, the current
|
|
261
|
+
// interpolator remains responsible only for its own live presentation.
|
|
262
|
+
// This preserves snap-point transforms without letting current-screen
|
|
263
|
+
// unfocus rules compete with the next screen's outgoing transition.
|
|
264
|
+
const currentSelectedFrame = selectInterpolatorFrame(
|
|
265
|
+
props,
|
|
266
|
+
isInGestureMode || !!nextInterpolator,
|
|
267
|
+
);
|
|
268
|
+
const currentResult = runInterpolator({
|
|
269
|
+
interpolator: currentInterpolator,
|
|
270
|
+
props,
|
|
271
|
+
selectedFrame: currentSelectedFrame,
|
|
272
|
+
transition,
|
|
273
|
+
});
|
|
275
274
|
|
|
276
275
|
const initialDestinationStyleGate = resolveInitialDestinationStyleGate({
|
|
277
276
|
shouldPrepareStyles: shouldPrepareInitialDestinationStyles,
|
|
@@ -295,23 +294,18 @@ export const useInterpolatedStylesMap = ({
|
|
|
295
294
|
currentOwnsInterpolator: true,
|
|
296
295
|
currentStylesMap: currentResult?.stylesMap,
|
|
297
296
|
nextStylesMap: undefined,
|
|
298
|
-
frozenCurrentStylesMap: frozenCurrentStylesMap.get(),
|
|
299
297
|
});
|
|
300
298
|
|
|
301
|
-
if (handoff.nextFrozenCurrentStylesMap !== frozenCurrentStylesMap.get()) {
|
|
302
|
-
frozenCurrentStylesMap.set(handoff.nextFrozenCurrentStylesMap);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
299
|
return handoff.localStylesMaps.length
|
|
306
300
|
? handoff.localStylesMaps
|
|
307
301
|
: NO_STYLE_LAYERS;
|
|
308
302
|
}
|
|
309
303
|
|
|
304
|
+
const nextSelectedFrame = selectInterpolatorFrame(props, false);
|
|
310
305
|
const nextResult = runInterpolator({
|
|
311
306
|
interpolator: nextInterpolator,
|
|
312
307
|
props,
|
|
313
|
-
selectedFrame,
|
|
314
|
-
bounds: boundsAccessor,
|
|
308
|
+
selectedFrame: nextSelectedFrame,
|
|
315
309
|
transition,
|
|
316
310
|
});
|
|
317
311
|
|
|
@@ -326,7 +320,6 @@ export const useInterpolatedStylesMap = ({
|
|
|
326
320
|
currentOwnsInterpolator: false,
|
|
327
321
|
currentStylesMap: currentResult?.stylesMap,
|
|
328
322
|
nextStylesMap: nextResult?.stylesMap,
|
|
329
|
-
frozenCurrentStylesMap: frozenCurrentStylesMap.get(),
|
|
330
323
|
});
|
|
331
324
|
|
|
332
325
|
return handoff.localStylesMaps.length
|
|
@@ -62,6 +62,43 @@ function getEntry(tag: TagID, key: ScreenKey): Entry | null {
|
|
|
62
62
|
return boundaryRegistry.get()[tag]?.screens[key] ?? null;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
function getMatchingSourceScreenKey(
|
|
66
|
+
tag: TagID,
|
|
67
|
+
destinationScreenKey: ScreenKey,
|
|
68
|
+
preferredScreenKey?: ScreenKey,
|
|
69
|
+
excludedScreenKeys?: readonly ScreenKey[],
|
|
70
|
+
): ScreenKey | null {
|
|
71
|
+
"worklet";
|
|
72
|
+
const screens = boundaryRegistry.get()[tag]?.screens;
|
|
73
|
+
if (!screens) return null;
|
|
74
|
+
const isExcluded = (screenKey: ScreenKey) => {
|
|
75
|
+
"worklet";
|
|
76
|
+
for (let index = 0; index < (excludedScreenKeys?.length ?? 0); index++) {
|
|
77
|
+
if (excludedScreenKeys?.[index] === screenKey) {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return false;
|
|
82
|
+
};
|
|
83
|
+
if (
|
|
84
|
+
preferredScreenKey &&
|
|
85
|
+
preferredScreenKey !== destinationScreenKey &&
|
|
86
|
+
!isExcluded(preferredScreenKey) &&
|
|
87
|
+
screens[preferredScreenKey]
|
|
88
|
+
) {
|
|
89
|
+
return preferredScreenKey;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
let latestScreenKey: ScreenKey | null = null;
|
|
93
|
+
for (const screenKey in screens) {
|
|
94
|
+
if (screenKey !== destinationScreenKey && !isExcluded(screenKey)) {
|
|
95
|
+
latestScreenKey = screenKey;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return latestScreenKey;
|
|
100
|
+
}
|
|
101
|
+
|
|
65
102
|
function setEntry(tag: TagID, screenKey: ScreenKey, patch: EntryPatch) {
|
|
66
103
|
"worklet";
|
|
67
104
|
boundaryRegistry.modify(<T extends BoundaryEntriesState>(state: T): T => {
|
|
@@ -90,4 +127,4 @@ function removeEntry(tag: TagID, screenKey: ScreenKey) {
|
|
|
90
127
|
});
|
|
91
128
|
}
|
|
92
129
|
|
|
93
|
-
export { getEntry, removeEntry, setEntry };
|
|
130
|
+
export { getEntry, getMatchingSourceScreenKey, removeEntry, setEntry };
|
|
@@ -4,12 +4,14 @@ import {
|
|
|
4
4
|
ensurePairGroups,
|
|
5
5
|
ensurePairLinks,
|
|
6
6
|
ensurePairSourceRequests,
|
|
7
|
+
getDestinationScreenKeyFromPairKey,
|
|
7
8
|
getGroupKeyFromTag,
|
|
8
9
|
getLinkKeyFromTag,
|
|
9
10
|
getActiveGroupId as getPairActiveGroupId,
|
|
10
11
|
getDestination as getPairDestination,
|
|
11
12
|
getLink as getPairLink,
|
|
12
13
|
getSource as getPairSource,
|
|
14
|
+
getSourceScreenKeyFromPairKey,
|
|
13
15
|
} from "../helpers/link-pairs.helpers";
|
|
14
16
|
import type {
|
|
15
17
|
BoundaryRuntimeFlags,
|
|
@@ -402,6 +404,38 @@ function getResolvedLink(
|
|
|
402
404
|
};
|
|
403
405
|
}
|
|
404
406
|
|
|
407
|
+
function getPairKeyForSource(
|
|
408
|
+
tag: TagID,
|
|
409
|
+
screenKey: ScreenKey,
|
|
410
|
+
): ScreenPairKey | null {
|
|
411
|
+
"worklet";
|
|
412
|
+
const state = pairs.get();
|
|
413
|
+
const linkKey = getLinkKeyFromTag(tag);
|
|
414
|
+
for (const pairKey in state) {
|
|
415
|
+
if (getSourceScreenKeyFromPairKey(pairKey) !== screenKey) continue;
|
|
416
|
+
if (
|
|
417
|
+
getResolvedLink(pairKey, tag).link?.destination ||
|
|
418
|
+
state[pairKey]?.sourceRequests?.[linkKey]
|
|
419
|
+
) {
|
|
420
|
+
return pairKey;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
return null;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
function getPairKeyForDestination(
|
|
427
|
+
tag: TagID,
|
|
428
|
+
screenKey: ScreenKey,
|
|
429
|
+
): ScreenPairKey | null {
|
|
430
|
+
"worklet";
|
|
431
|
+
const state = pairs.get();
|
|
432
|
+
for (const pairKey in state) {
|
|
433
|
+
if (getDestinationScreenKeyFromPairKey(pairKey) !== screenKey) continue;
|
|
434
|
+
if (getResolvedLink(pairKey, tag).link) return pairKey;
|
|
435
|
+
}
|
|
436
|
+
return null;
|
|
437
|
+
}
|
|
438
|
+
|
|
405
439
|
function getSource(
|
|
406
440
|
pairKey: ScreenPairKey,
|
|
407
441
|
tag: TagID,
|
|
@@ -422,6 +456,8 @@ export {
|
|
|
422
456
|
getActiveGroupId,
|
|
423
457
|
getDestination,
|
|
424
458
|
getLink,
|
|
459
|
+
getPairKeyForDestination,
|
|
460
|
+
getPairKeyForSource,
|
|
425
461
|
getResolvedLink,
|
|
426
462
|
getSource,
|
|
427
463
|
requestSourceMeasure,
|
|
@@ -1,35 +1,21 @@
|
|
|
1
|
-
import { createScreenPairKey } from "../helpers/link-pairs.helpers";
|
|
2
1
|
import type {
|
|
3
2
|
ResolvedTransitionPair,
|
|
4
3
|
ResolveTransitionContext,
|
|
5
|
-
ScreenPairKey,
|
|
6
4
|
TagID,
|
|
7
5
|
} from "../types";
|
|
8
|
-
import { getResolvedLink } from "./links";
|
|
9
|
-
|
|
10
|
-
function resolvePairKey(
|
|
11
|
-
context: ResolveTransitionContext,
|
|
12
|
-
): ScreenPairKey | null {
|
|
13
|
-
"worklet";
|
|
14
|
-
|
|
15
|
-
if (context.entering) {
|
|
16
|
-
if (!context.previousScreenKey || !context.currentScreenKey) return null;
|
|
17
|
-
return createScreenPairKey(
|
|
18
|
-
context.previousScreenKey,
|
|
19
|
-
context.currentScreenKey,
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (!context.currentScreenKey || !context.nextScreenKey) return null;
|
|
24
|
-
return createScreenPairKey(context.currentScreenKey, context.nextScreenKey);
|
|
25
|
-
}
|
|
6
|
+
import { getPairKeyForDestination, getResolvedLink } from "./links";
|
|
26
7
|
|
|
27
8
|
function resolveTransitionPair(
|
|
28
9
|
tag: TagID,
|
|
29
10
|
context: ResolveTransitionContext,
|
|
30
11
|
): ResolvedTransitionPair {
|
|
31
12
|
"worklet";
|
|
32
|
-
const
|
|
13
|
+
const destinationScreenKey = context.entering
|
|
14
|
+
? context.currentScreenKey
|
|
15
|
+
: context.nextScreenKey;
|
|
16
|
+
const pairKey = destinationScreenKey
|
|
17
|
+
? getPairKeyForDestination(tag, destinationScreenKey)
|
|
18
|
+
: null;
|
|
33
19
|
const matchedLink = pairKey ? getResolvedLink(pairKey, tag).link : null;
|
|
34
20
|
|
|
35
21
|
return {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
getPairKeyForDestination,
|
|
3
|
+
getResolvedLink,
|
|
4
|
+
} from "../../../stores/bounds/internals/links";
|
|
2
5
|
import type {
|
|
3
6
|
BoundsInterpolationProps,
|
|
4
7
|
BoundsLink,
|
|
5
8
|
} from "../../../types/bounds.types";
|
|
6
9
|
import type { BoundId } from "../types/options";
|
|
7
|
-
import { resolveBoundsPairKey } from "./resolve-bounds-pair-key";
|
|
8
10
|
|
|
9
11
|
type GetProps = () => BoundsInterpolationProps;
|
|
10
12
|
|
|
@@ -19,7 +21,11 @@ export const createLinkAccessor = (getProps: GetProps): LinkAccessor => {
|
|
|
19
21
|
"worklet";
|
|
20
22
|
const props = getProps();
|
|
21
23
|
const stringTag = String(tag);
|
|
22
|
-
const
|
|
24
|
+
const destinationScreenKey =
|
|
25
|
+
props.next?.route.key ?? props.current?.route.key;
|
|
26
|
+
const pairKey = destinationScreenKey
|
|
27
|
+
? getPairKeyForDestination(stringTag, destinationScreenKey)
|
|
28
|
+
: null;
|
|
23
29
|
if (!pairKey) return null;
|
|
24
30
|
|
|
25
31
|
const resolved = getResolvedLink(pairKey, stringTag);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.hasLocalSlot = void 0;
|
|
7
|
-
const hasLocalSlot = (localStylesMaps, slotId) => {
|
|
8
|
-
"worklet";
|
|
9
|
-
|
|
10
|
-
for (let index = 0; index < localStylesMaps.length; index++) {
|
|
11
|
-
if (localStylesMaps[index]?.[slotId] !== undefined) {
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return false;
|
|
16
|
-
};
|
|
17
|
-
exports.hasLocalSlot = hasLocalSlot;
|
|
18
|
-
//# sourceMappingURL=has-local-slot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["hasLocalSlot","localStylesMaps","slotId","index","length","undefined","exports"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.ts"],"mappings":";;;;;;AAEO,MAAMA,YAAY,GAAGA,CAC3BC,eAAiC,EACjCC,MAAc,KACV;EACJ,SAAS;;EAET,KAAK,IAAIC,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAGF,eAAe,CAACG,MAAM,EAAED,KAAK,EAAE,EAAE;IAC5D,IAAIF,eAAe,CAACE,KAAK,CAAC,GAAGD,MAAM,CAAC,KAAKG,SAAS,EAAE;MACnD,OAAO,IAAI;IACZ;EACD;EAEA,OAAO,KAAK;AACb,CAAC;AAACC,OAAA,CAAAN,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useBuildBoundsAccessor = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _bounds = require("../../../../../utils/bounds");
|
|
9
|
-
var _animation = require("../../animation.provider");
|
|
10
|
-
const useBuildBoundsAccessor = () => {
|
|
11
|
-
const screenInterpolatorProps = (0, _animation.useScreenAnimationStore)(store => store.screenInterpolatorProps);
|
|
12
|
-
return (0, _react.useMemo)(() => {
|
|
13
|
-
return (0, _bounds.createBoundsAccessor)(() => {
|
|
14
|
-
"worklet";
|
|
15
|
-
|
|
16
|
-
return screenInterpolatorProps.get();
|
|
17
|
-
});
|
|
18
|
-
}, [screenInterpolatorProps]);
|
|
19
|
-
};
|
|
20
|
-
exports.useBuildBoundsAccessor = useBuildBoundsAccessor;
|
|
21
|
-
//# sourceMappingURL=use-build-bounds-accessor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_bounds","_animation","useBuildBoundsAccessor","screenInterpolatorProps","useScreenAnimationStore","store","useMemo","createBoundsAccessor","get","exports"],"sourceRoot":"../../../../../../../../src","sources":["shared/providers/screen/animation/helpers/accessors/use-build-bounds-accessor.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAEO,MAAMG,sBAAsB,GAAGA,CAAA,KAAM;EAC3C,MAAMC,uBAAuB,GAAG,IAAAC,kCAAuB,EACrDC,KAAK,IAAKA,KAAK,CAACF,uBAClB,CAAC;EACD,OAAO,IAAAG,cAAO,EAAC,MAAM;IACpB,OAAO,IAAAC,4BAAoB,EAAC,MAAM;MACjC,SAAS;;MACT,OAAOJ,uBAAuB,CAACK,GAAG,CAAC,CAAC;IACrC,CAAC,CAAC;EACH,CAAC,EAAE,CAACL,uBAAuB,CAAC,CAAC;AAC9B,CAAC;AAACM,OAAA,CAAAP,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
export const hasLocalSlot = (localStylesMaps, slotId) => {
|
|
4
|
-
"worklet";
|
|
5
|
-
|
|
6
|
-
for (let index = 0; index < localStylesMaps.length; index++) {
|
|
7
|
-
if (localStylesMaps[index]?.[slotId] !== undefined) {
|
|
8
|
-
return true;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
return false;
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=has-local-slot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["hasLocalSlot","localStylesMaps","slotId","index","length","undefined"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.ts"],"mappings":";;AAEA,OAAO,MAAMA,YAAY,GAAGA,CAC3BC,eAAiC,EACjCC,MAAc,KACV;EACJ,SAAS;;EAET,KAAK,IAAIC,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAGF,eAAe,CAACG,MAAM,EAAED,KAAK,EAAE,EAAE;IAC5D,IAAIF,eAAe,CAACE,KAAK,CAAC,GAAGD,MAAM,CAAC,KAAKG,SAAS,EAAE;MACnD,OAAO,IAAI;IACZ;EACD;EAEA,OAAO,KAAK;AACb,CAAC","ignoreList":[]}
|
package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-bounds-accessor.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { useMemo } from "react";
|
|
4
|
-
import { createBoundsAccessor } from "../../../../../utils/bounds";
|
|
5
|
-
import { useScreenAnimationStore } from "../../animation.provider";
|
|
6
|
-
export const useBuildBoundsAccessor = () => {
|
|
7
|
-
const screenInterpolatorProps = useScreenAnimationStore(store => store.screenInterpolatorProps);
|
|
8
|
-
return useMemo(() => {
|
|
9
|
-
return createBoundsAccessor(() => {
|
|
10
|
-
"worklet";
|
|
11
|
-
|
|
12
|
-
return screenInterpolatorProps.get();
|
|
13
|
-
});
|
|
14
|
-
}, [screenInterpolatorProps]);
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=use-build-bounds-accessor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","createBoundsAccessor","useScreenAnimationStore","useBuildBoundsAccessor","screenInterpolatorProps","store","get"],"sourceRoot":"../../../../../../../../src","sources":["shared/providers/screen/animation/helpers/accessors/use-build-bounds-accessor.tsx"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,oBAAoB,QAAQ,6BAA6B;AAClE,SAASC,uBAAuB,QAAQ,0BAA0B;AAElE,OAAO,MAAMC,sBAAsB,GAAGA,CAAA,KAAM;EAC3C,MAAMC,uBAAuB,GAAGF,uBAAuB,CACrDG,KAAK,IAAKA,KAAK,CAACD,uBAClB,CAAC;EACD,OAAOJ,OAAO,CAAC,MAAM;IACpB,OAAOC,oBAAoB,CAAC,MAAM;MACjC,SAAS;;MACT,OAAOG,uBAAuB,CAACE,GAAG,CAAC,CAAC;IACrC,CAAC,CAAC;EACH,CAAC,EAAE,CAACF,uBAAuB,CAAC,CAAC;AAC9B,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"has-local-slot.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uEAAuE,CAAC;AAE9G,eAAO,MAAM,YAAY,GACxB,iBAAiB,gBAAgB,EACjC,QAAQ,MAAM,YAWd,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-build-bounds-accessor.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shared/providers/screen/animation/helpers/accessors/use-build-bounds-accessor.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB,qDAUlC,CAAC"}
|
package/src/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { LocalStyleLayers } from "../../../../../../providers/screen/styles/helpers/resolve-slot-styles";
|
|
2
|
-
|
|
3
|
-
export const hasLocalSlot = (
|
|
4
|
-
localStylesMaps: LocalStyleLayers,
|
|
5
|
-
slotId: string,
|
|
6
|
-
) => {
|
|
7
|
-
"worklet";
|
|
8
|
-
|
|
9
|
-
for (let index = 0; index < localStylesMaps.length; index++) {
|
|
10
|
-
if (localStylesMaps[index]?.[slotId] !== undefined) {
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return false;
|
|
16
|
-
};
|
package/src/shared/providers/screen/animation/helpers/accessors/use-build-bounds-accessor.tsx
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
2
|
-
import { createBoundsAccessor } from "../../../../../utils/bounds";
|
|
3
|
-
import { useScreenAnimationStore } from "../../animation.provider";
|
|
4
|
-
|
|
5
|
-
export const useBuildBoundsAccessor = () => {
|
|
6
|
-
const screenInterpolatorProps = useScreenAnimationStore(
|
|
7
|
-
(store) => store.screenInterpolatorProps,
|
|
8
|
-
);
|
|
9
|
-
return useMemo(() => {
|
|
10
|
-
return createBoundsAccessor(() => {
|
|
11
|
-
"worklet";
|
|
12
|
-
return screenInterpolatorProps.get();
|
|
13
|
-
});
|
|
14
|
-
}, [screenInterpolatorProps]);
|
|
15
|
-
};
|