react-native-screen-transitions 3.4.0-alpha.2 → 3.4.0-alpha.3
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/create-boundary-component/index.js +1 -2
- package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/commonjs/shared/components/create-transition-aware-component.js +1 -2
- package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js +43 -0
- package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js.map +1 -0
- package/lib/commonjs/shared/components/screen-container/index.js +7 -4
- package/lib/commonjs/shared/components/screen-container/index.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/content.js +28 -12
- package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +4 -24
- package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
- package/lib/commonjs/shared/configs/presets.js +6 -6
- package/lib/commonjs/shared/configs/presets.js.map +1 -1
- package/lib/commonjs/shared/constants.js +10 -4
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/hooks/animation/use-associated-style.js +9 -34
- package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +1 -1
- package/lib/commonjs/shared/index.js +4 -10
- package/lib/commonjs/shared/index.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js +36 -0
- package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles.provider.js +31 -10
- package/lib/commonjs/shared/providers/screen/styles.provider.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js +2 -2
- package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/zoom/build.js +8 -12
- package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/index.js +1 -2
- package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/module/shared/components/create-transition-aware-component.js +1 -2
- package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/module/shared/components/screen-container/deferred-visibility-host.js +38 -0
- package/lib/module/shared/components/screen-container/deferred-visibility-host.js.map +1 -0
- package/lib/module/shared/components/screen-container/index.js +7 -4
- package/lib/module/shared/components/screen-container/index.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/content.js +29 -13
- package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +6 -26
- package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
- package/lib/module/shared/configs/presets.js +7 -7
- package/lib/module/shared/configs/presets.js.map +1 -1
- package/lib/module/shared/constants.js +9 -3
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/hooks/animation/use-associated-style.js +10 -35
- package/lib/module/shared/hooks/animation/use-associated-style.js.map +1 -1
- package/lib/module/shared/index.js +1 -1
- package/lib/module/shared/index.js.map +1 -1
- package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js +31 -0
- package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +1 -0
- package/lib/module/shared/providers/screen/styles.provider.js +30 -11
- package/lib/module/shared/providers/screen/styles.provider.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js +3 -3
- package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
- package/lib/module/shared/utils/bounds/zoom/build.js +9 -13
- package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/deferred-visibility-host.d.ts +13 -0
- package/lib/typescript/shared/components/screen-container/deferred-visibility-host.d.ts.map +1 -0
- package/lib/typescript/shared/components/screen-container/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts +1 -1
- package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
- package/lib/typescript/shared/configs/index.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts +9 -3
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts +5 -11
- package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +1 -1
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts +10 -0
- package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles.provider.d.ts +4 -2
- package/lib/typescript/shared/providers/screen/styles.provider.d.ts.map +1 -1
- package/lib/typescript/shared/types/animation.types.d.ts +6 -1
- package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/screen.types.d.ts +5 -0
- package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts +11 -1
- package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts +2 -2
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/shared/components/create-boundary-component/index.tsx +0 -1
- package/src/shared/components/create-transition-aware-component.tsx +0 -1
- package/src/shared/components/screen-container/deferred-visibility-host.tsx +37 -0
- package/src/shared/components/screen-container/index.tsx +5 -2
- package/src/shared/components/screen-container/layers/content.tsx +50 -15
- package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +8 -31
- package/src/shared/configs/presets.ts +10 -10
- package/src/shared/constants.ts +5 -3
- package/src/shared/hooks/animation/use-associated-style.ts +10 -54
- package/src/shared/index.ts +2 -3
- package/src/shared/providers/screen/helpers/resolve-interpolated-style-output.ts +41 -0
- package/src/shared/providers/screen/styles.provider.tsx +95 -72
- package/src/shared/types/animation.types.ts +6 -1
- package/src/shared/types/screen.types.ts +5 -0
- package/src/shared/utils/bounds/helpers/compute-bounds-styles.ts +3 -2
- package/src/shared/utils/bounds/zoom/build.ts +19 -15
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NormalizedTransitionInterpolatedStyle } from "../../../types/animation.types";
|
|
2
|
+
export type ScreenStyleResolutionMode = "pass-through" | "deferred" | "live";
|
|
3
|
+
export type ResolvedInterpolatedStyleOutput = {
|
|
4
|
+
stylesMap: NormalizedTransitionInterpolatedStyle;
|
|
5
|
+
resolutionMode: ScreenStyleResolutionMode;
|
|
6
|
+
wasLegacy: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const PASS_THROUGH_STYLE_OUTPUT: ResolvedInterpolatedStyleOutput;
|
|
9
|
+
export declare const resolveInterpolatedStyleOutput: (raw: Record<string, any> | null | undefined) => ResolvedInterpolatedStyleOutput;
|
|
10
|
+
//# sourceMappingURL=resolve-interpolated-style-output.d.ts.map
|
package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-interpolated-style-output.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/providers/screen/helpers/resolve-interpolated-style-output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,gCAAgC,CAAC;AAG5F,MAAM,MAAM,yBAAyB,GAAG,cAAc,GAAG,UAAU,GAAG,MAAM,CAAC;AAE7E,MAAM,MAAM,+BAA+B,GAAG;IAC7C,SAAS,EAAE,qCAAqC,CAAC;IACjD,cAAc,EAAE,yBAAyB,CAAC;IAC1C,SAAS,EAAE,OAAO,CAAC;CACnB,CAAC;AAIF,eAAO,MAAM,yBAAyB,EAAE,+BAIvC,CAAC;AAEF,eAAO,MAAM,8BAA8B,GAC1C,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,KACzC,+BAmBF,CAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import { type SharedValue } from "react-native-reanimated";
|
|
3
3
|
import type { NormalizedTransitionInterpolatedStyle } from "../../types/animation.types";
|
|
4
|
+
import { type ScreenStyleResolutionMode } from "./helpers/resolve-interpolated-style-output";
|
|
4
5
|
type Props = {
|
|
5
6
|
children: ReactNode;
|
|
6
7
|
};
|
|
7
8
|
type ScreenStylesContextValue = {
|
|
8
9
|
stylesMap: SharedValue<NormalizedTransitionInterpolatedStyle>;
|
|
9
10
|
ancestorStylesMaps: SharedValue<NormalizedTransitionInterpolatedStyle>[];
|
|
11
|
+
resolutionMode: SharedValue<ScreenStyleResolutionMode>;
|
|
10
12
|
};
|
|
11
|
-
declare const ScreenStylesProvider: import("react").FC<Props>, useScreenStyles: () => ScreenStylesContextValue;
|
|
12
|
-
export {
|
|
13
|
+
export declare const ScreenStylesProvider: import("react").FC<Props>, ScreenStylesContext: import("react").Context<ScreenStylesContextValue>, useScreenStyles: () => ScreenStylesContextValue;
|
|
14
|
+
export {};
|
|
13
15
|
//# sourceMappingURL=styles.provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.provider.d.ts","sourceRoot":"","sources":["../../../../../src/shared/providers/screen/styles.provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAC5D,OAAO,EACN,KAAK,WAAW,EAGhB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"styles.provider.d.ts","sourceRoot":"","sources":["../../../../../src/shared/providers/screen/styles.provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAC5D,OAAO,EACN,KAAK,WAAW,EAGhB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,6BAA6B,CAAC;AAIzF,OAAO,EAGN,KAAK,yBAAyB,EAC9B,MAAM,6CAA6C,CAAC;AAErD,KAAK,KAAK,GAAG;IACZ,QAAQ,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC/B,SAAS,EAAE,WAAW,CAAC,qCAAqC,CAAC,CAAC;IAC9D,kBAAkB,EAAE,WAAW,CAAC,qCAAqC,CAAC,EAAE,CAAC;IACzE,cAAc,EAAE,WAAW,CAAC,yBAAyB,CAAC,CAAC;CACvD,CAAC;AAEF,eAAO,MACN,oBAAoB,6BACpB,mBAAmB,qDACK,eAAe,gCAiIvC,CAAC"}
|
|
@@ -142,7 +142,12 @@ export interface ScreenInterpolationProps {
|
|
|
142
142
|
*/
|
|
143
143
|
inactive: ScreenTransitionState | undefined;
|
|
144
144
|
}
|
|
145
|
-
|
|
145
|
+
/**
|
|
146
|
+
* Returning `null` explicitly defers rendering of the screen's visual subtree
|
|
147
|
+
* for the current frame. Returning an object applies transition styles
|
|
148
|
+
* immediately.
|
|
149
|
+
*/
|
|
150
|
+
export type ScreenStyleInterpolator = (props: ScreenInterpolationProps) => TransitionInterpolatedStyle | null;
|
|
146
151
|
/**
|
|
147
152
|
* Animated style properties with full autocomplete.
|
|
148
153
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animation.types.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/animation.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EACX,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,MAAM,MAAM,qBAAqB,GAAG;IACnC;;;;;;;OAOG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,OAAO,EAAE,aAAa,CAAC;IAEvB;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE/B;;OAEG;IACH,KAAK,EAAE,cAAc,CAAC;CACtB,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACxC;;OAEG;IACH,QAAQ,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAE5C;;OAEG;IACH,OAAO,EAAE,qBAAqB,CAAC;IAE/B;;OAEG;IACH,IAAI,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAExC;;OAEG;IACH,OAAO,EAAE;QACR;;WAEG;QACH,MAAM,EAAE,MAAM,CAAC;QAC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AC,EAAE,eAAe,CAAC;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB;;;OAGG;IACH,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC3B"}
|
|
@@ -68,6 +68,11 @@ export type TransitionAwareProps<T extends object> = AnimatedProps<T> & {
|
|
|
68
68
|
export type ScreenTransitionConfig = {
|
|
69
69
|
/**
|
|
70
70
|
* The user-provided function to calculate styles based on animation progress.
|
|
71
|
+
*
|
|
72
|
+
* Return `null` to explicitly defer rendering of the screen's visual subtree
|
|
73
|
+
* until a later frame. This is useful for transitions such as
|
|
74
|
+
* `bounds().navigation.zoom()` where the screen should stay hidden until the
|
|
75
|
+
* interpolator has enough state to produce a safe first frame.
|
|
71
76
|
*/
|
|
72
77
|
screenStyleInterpolator?: ScreenStyleInterpolator;
|
|
73
78
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen.types.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/screen.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EACX,uBAAuB,EACvB,cAAc,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,MAAM,MAAM,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAC/B,MAAM,MAAM,0BAA0B,GACnC,qBAAqB,GACrB,eAAe,CAAC;AAEnB;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAExC,MAAM,MA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ExD;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;;;;;;OAQG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC;IAEpE;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAE7C;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;CAC5C,CAAC"}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import { type ResolvedTransitionPair } from "../../../stores/bounds";
|
|
2
2
|
import type { BoundsComputeParams, BoundsOptions } from "../types/options";
|
|
3
|
-
export declare const computeBoundStyles: ({ id, previous, current, next, progress, dimensions }: BoundsComputeParams, computeOptions?: BoundsOptions, resolvedPair?: ResolvedTransitionPair) => Readonly<{
|
|
3
|
+
export declare const computeBoundStyles: ({ id, previous, current, next, progress, dimensions }: BoundsComputeParams, computeOptions?: BoundsOptions, resolvedPair?: ResolvedTransitionPair) => import("react-native-reanimated").StyleProps | Readonly<{
|
|
4
|
+
opacity: 0;
|
|
5
|
+
}> | Readonly<{
|
|
6
|
+
scaleX: 1;
|
|
7
|
+
scaleY: 1;
|
|
8
|
+
scale: 1;
|
|
9
|
+
translateX: 0;
|
|
10
|
+
translateY: 0;
|
|
11
|
+
width: 0;
|
|
12
|
+
height: 0;
|
|
13
|
+
}>;
|
|
4
14
|
//# sourceMappingURL=compute-bounds-styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute-bounds-styles.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/helpers/compute-bounds-styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compute-bounds-styles.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/helpers/compute-bounds-styles.ts"],"names":[],"mappings":"AASA,OAAO,EAEN,KAAK,sBAAsB,EAC3B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAEX,mBAAmB,EACnB,aAAa,EACb,MAAM,kBAAkB,CAAC;AAoG1B,eAAO,MAAM,kBAAkB,GAC9B,uDAAuD,mBAAmB,EAC1E,iBAAgB,aAAkC,EAClD,eAAe,sBAAsB;;;;;;;;;;EAiGrC,CAAC"}
|
|
@@ -11,7 +11,7 @@ type ZoomAccessorParams = {
|
|
|
11
11
|
zoomBaseOptions?: Pick<BoundsNavigationZoomOptions, "anchor" | "scaleMode" | "target">;
|
|
12
12
|
};
|
|
13
13
|
export declare const createZoomAccessor: ({ id, group, getProps, resolveBoundTag, computeRaw, zoomBaseOptions, }: ZoomAccessorParams) => {
|
|
14
|
-
zoom: (options?: BoundsNavigationZoomOptions) => import("../../..").TransitionInterpolatedStyle;
|
|
14
|
+
zoom: (options?: BoundsNavigationZoomOptions) => import("../../..").TransitionInterpolatedStyle | null;
|
|
15
15
|
};
|
|
16
16
|
export {};
|
|
17
17
|
//# sourceMappingURL=accessor.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ScreenStyleInterpolator } from "../../../types/animation.types";
|
|
2
2
|
import type { BuildZoomStylesParams } from "./types";
|
|
3
|
-
export declare const buildZoomStyles: ({ id, group, zoomOptions, props, resolveTag, computeRaw, }: BuildZoomStylesParams) =>
|
|
3
|
+
export declare const buildZoomStyles: ({ id, group, zoomOptions, props, resolveTag, computeRaw, }: BuildZoomStylesParams) => ReturnType<ScreenStyleInterpolator>;
|
|
4
4
|
//# sourceMappingURL=build.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/zoom/build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/zoom/build.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACX,uBAAuB,EAEvB,MAAM,gCAAgC,CAAC;AASxC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAwarD,eAAO,MAAM,eAAe,GAAI,4DAO7B,qBAAqB,KAAG,UAAU,CAAC,uBAAuB,CAuQ5D,CAAC"}
|
package/package.json
CHANGED
|
@@ -108,7 +108,6 @@ export function createBoundaryComponent<P extends object>(
|
|
|
108
108
|
const { associatedStyles } = useAssociatedStyles({
|
|
109
109
|
id: sharedBoundTag,
|
|
110
110
|
resetTransformOnUnset: true,
|
|
111
|
-
waitForFirstResolvedStyle: true,
|
|
112
111
|
});
|
|
113
112
|
|
|
114
113
|
const maybeMeasureAndStore = useBoundaryMeasureAndStore({
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { memo } from "react";
|
|
2
|
+
import { StyleSheet } from "react-native";
|
|
3
|
+
import Animated, { useAnimatedStyle } from "react-native-reanimated";
|
|
4
|
+
import { HIDDEN_STYLE, NO_STYLES } from "../../constants";
|
|
5
|
+
import { useScreenStyles } from "../../providers/screen/styles.provider";
|
|
6
|
+
|
|
7
|
+
type Props = {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Hides the full screen visual subtree while an interpolator explicitly reports
|
|
13
|
+
* that it is not safe to reveal yet.
|
|
14
|
+
*
|
|
15
|
+
* This sits above backdrop/content/mask/surface so a deferred transition does
|
|
16
|
+
* not leak raw first-paint UI from nested layers.
|
|
17
|
+
*/
|
|
18
|
+
export const DeferredVisibilityHost = memo(({ children }: Props) => {
|
|
19
|
+
const { resolutionMode } = useScreenStyles();
|
|
20
|
+
|
|
21
|
+
const animatedStyle = useAnimatedStyle(() => {
|
|
22
|
+
"worklet";
|
|
23
|
+
return resolutionMode.value === "deferred" ? HIDDEN_STYLE : NO_STYLES;
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Animated.View collapsable={false} style={[styles.host, animatedStyle]}>
|
|
28
|
+
{children}
|
|
29
|
+
</Animated.View>
|
|
30
|
+
);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const styles = StyleSheet.create({
|
|
34
|
+
host: {
|
|
35
|
+
flex: 1,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { memo } from "react";
|
|
2
2
|
import { StyleSheet, View } from "react-native";
|
|
3
|
+
import { DeferredVisibilityHost } from "./deferred-visibility-host";
|
|
3
4
|
import { useBackdropPointerEvents } from "./hooks/use-backdrop-pointer-events";
|
|
4
5
|
import { BackdropLayer } from "./layers/backdrop";
|
|
5
6
|
import { ContentLayer } from "./layers/content";
|
|
@@ -13,8 +14,10 @@ export const ScreenContainer = memo(({ children }: Props) => {
|
|
|
13
14
|
|
|
14
15
|
return (
|
|
15
16
|
<View style={styles.container} pointerEvents={pointerEvents}>
|
|
16
|
-
<
|
|
17
|
-
|
|
17
|
+
<DeferredVisibilityHost>
|
|
18
|
+
<BackdropLayer />
|
|
19
|
+
<ContentLayer>{children}</ContentLayer>
|
|
20
|
+
</DeferredVisibilityHost>
|
|
18
21
|
</View>
|
|
19
22
|
);
|
|
20
23
|
});
|
|
@@ -6,7 +6,11 @@ import Animated, {
|
|
|
6
6
|
useAnimatedProps,
|
|
7
7
|
useAnimatedStyle,
|
|
8
8
|
} from "react-native-reanimated";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
NAVIGATION_MASK_CONTAINER_STYLE_ID,
|
|
11
|
+
NO_PROPS,
|
|
12
|
+
NO_STYLES,
|
|
13
|
+
} from "../../../constants";
|
|
10
14
|
import { useGestureContext } from "../../../providers/gestures";
|
|
11
15
|
import { useDescriptors } from "../../../providers/screen/descriptors";
|
|
12
16
|
import { useScreenStyles } from "../../../providers/screen/styles.provider";
|
|
@@ -29,6 +33,7 @@ export const ContentLayer = memo(({ children }: Props) => {
|
|
|
29
33
|
const contentPointerEvents = isBackdropActive ? "box-none" : pointerEvents;
|
|
30
34
|
const hasAutoSnapPoint =
|
|
31
35
|
current.options.snapPoints?.includes("auto") ?? false;
|
|
36
|
+
|
|
32
37
|
const handleContentLayout = useContentLayout();
|
|
33
38
|
|
|
34
39
|
const animatedContentStyle = useAnimatedStyle(() => {
|
|
@@ -36,11 +41,51 @@ export const ContentLayer = memo(({ children }: Props) => {
|
|
|
36
41
|
return stylesMap.value.content?.style || NO_STYLES;
|
|
37
42
|
});
|
|
38
43
|
|
|
44
|
+
const animatedNavigationContainerStyle = useAnimatedStyle(() => {
|
|
45
|
+
"worklet";
|
|
46
|
+
return (
|
|
47
|
+
stylesMap.value[NAVIGATION_MASK_CONTAINER_STYLE_ID]?.style || NO_STYLES
|
|
48
|
+
);
|
|
49
|
+
});
|
|
50
|
+
|
|
39
51
|
const animatedContentProps = useAnimatedProps(() => {
|
|
40
52
|
"worklet";
|
|
41
53
|
return stylesMap.value.content?.props ?? NO_PROPS;
|
|
42
54
|
});
|
|
43
55
|
|
|
56
|
+
const surfaceChildren = (
|
|
57
|
+
<SurfaceContainer pointerEvents={contentPointerEvents}>
|
|
58
|
+
{hasAutoSnapPoint ? (
|
|
59
|
+
<View collapsable={false} onLayout={handleContentLayout}>
|
|
60
|
+
{children}
|
|
61
|
+
</View>
|
|
62
|
+
) : (
|
|
63
|
+
children
|
|
64
|
+
)}
|
|
65
|
+
</SurfaceContainer>
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
const navigationContainer = (
|
|
69
|
+
<Animated.View
|
|
70
|
+
style={[styles.navigationContainer, animatedNavigationContainerStyle]}
|
|
71
|
+
pointerEvents={contentPointerEvents}
|
|
72
|
+
collapsable={false}
|
|
73
|
+
>
|
|
74
|
+
{surfaceChildren}
|
|
75
|
+
</Animated.View>
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
const navigationScopedChildren = isNavigationMaskEnabled ? (
|
|
79
|
+
<MaybeMaskedNavigationContainer
|
|
80
|
+
pointerEvents={contentPointerEvents}
|
|
81
|
+
enabled={isNavigationMaskEnabled}
|
|
82
|
+
>
|
|
83
|
+
{navigationContainer}
|
|
84
|
+
</MaybeMaskedNavigationContainer>
|
|
85
|
+
) : (
|
|
86
|
+
navigationContainer
|
|
87
|
+
);
|
|
88
|
+
|
|
44
89
|
return (
|
|
45
90
|
<GestureDetector gesture={gestureContext!.panGesture}>
|
|
46
91
|
<Animated.View
|
|
@@ -48,20 +93,7 @@ export const ContentLayer = memo(({ children }: Props) => {
|
|
|
48
93
|
animatedProps={animatedContentProps}
|
|
49
94
|
pointerEvents={contentPointerEvents}
|
|
50
95
|
>
|
|
51
|
-
|
|
52
|
-
pointerEvents={contentPointerEvents}
|
|
53
|
-
enabled={isNavigationMaskEnabled}
|
|
54
|
-
>
|
|
55
|
-
<SurfaceContainer pointerEvents={contentPointerEvents}>
|
|
56
|
-
{hasAutoSnapPoint ? (
|
|
57
|
-
<View collapsable={false} onLayout={handleContentLayout}>
|
|
58
|
-
{children}
|
|
59
|
-
</View>
|
|
60
|
-
) : (
|
|
61
|
-
children
|
|
62
|
-
)}
|
|
63
|
-
</SurfaceContainer>
|
|
64
|
-
</MaybeMaskedNavigationContainer>
|
|
96
|
+
{navigationScopedChildren}
|
|
65
97
|
</Animated.View>
|
|
66
98
|
</GestureDetector>
|
|
67
99
|
);
|
|
@@ -71,4 +103,7 @@ const styles = StyleSheet.create({
|
|
|
71
103
|
content: {
|
|
72
104
|
flex: 1,
|
|
73
105
|
},
|
|
106
|
+
navigationContainer: {
|
|
107
|
+
flex: 1,
|
|
108
|
+
},
|
|
74
109
|
});
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { memo, useEffect } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { StyleSheet, View, type ViewProps } from "react-native";
|
|
3
3
|
import Animated, { useAnimatedStyle } from "react-native-reanimated";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
NAVIGATION_MASK_STYLE_ID,
|
|
5
|
+
NAVIGATION_MASK_ELEMENT_STYLE_ID,
|
|
7
6
|
NO_STYLES,
|
|
8
7
|
} from "../../../constants";
|
|
9
8
|
import { useScreenStyles } from "../../../providers/screen/styles.provider";
|
|
@@ -24,19 +23,15 @@ try {
|
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
let hasWarnedMissingMaskedView = false;
|
|
27
|
-
const IS_ANDROID = Platform.OS === "android";
|
|
28
26
|
|
|
29
27
|
export const MaybeMaskedNavigationContainer = memo(
|
|
30
28
|
({ enabled, children, pointerEvents }: Props) => {
|
|
31
29
|
const { stylesMap } = useScreenStyles();
|
|
32
|
-
const animatedNavigationContainerStyle = useAnimatedStyle(() => {
|
|
33
|
-
"worklet";
|
|
34
|
-
return stylesMap.value[NAVIGATION_CONTAINER_STYLE_ID]?.style || NO_STYLES;
|
|
35
|
-
});
|
|
36
|
-
|
|
37
30
|
const animatedNavigationMaskStyle = useAnimatedStyle(() => {
|
|
38
31
|
"worklet";
|
|
39
|
-
return
|
|
32
|
+
return (
|
|
33
|
+
stylesMap.value[NAVIGATION_MASK_ELEMENT_STYLE_ID]?.style || NO_STYLES
|
|
34
|
+
);
|
|
40
35
|
});
|
|
41
36
|
|
|
42
37
|
useEffect(() => {
|
|
@@ -49,25 +44,10 @@ export const MaybeMaskedNavigationContainer = memo(
|
|
|
49
44
|
"navigationMaskEnabled requires @react-native-masked-view/masked-view. Install it to enable navigation bounds masking.",
|
|
50
45
|
);
|
|
51
46
|
}, [enabled]);
|
|
52
|
-
|
|
53
|
-
const navigationContainer = (
|
|
54
|
-
<Animated.View
|
|
55
|
-
style={[styles.navigationContainer, animatedNavigationContainerStyle]}
|
|
56
|
-
pointerEvents={pointerEvents}
|
|
57
|
-
collapsable={false}
|
|
58
|
-
renderToHardwareTextureAndroid={IS_ANDROID && !enabled}
|
|
59
|
-
needsOffscreenAlphaCompositing={IS_ANDROID && !enabled}
|
|
60
|
-
>
|
|
61
|
-
{children}
|
|
62
|
-
</Animated.View>
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
// Navigation zoom uses the root container transform even when the mask
|
|
66
|
-
// wrapper is disabled. Only the mask element itself is optional.
|
|
67
|
-
if (!enabled) return navigationContainer;
|
|
47
|
+
if (!enabled) return children;
|
|
68
48
|
|
|
69
49
|
if (LazyMaskedView === View) {
|
|
70
|
-
return
|
|
50
|
+
return children;
|
|
71
51
|
}
|
|
72
52
|
|
|
73
53
|
return (
|
|
@@ -82,7 +62,7 @@ export const MaybeMaskedNavigationContainer = memo(
|
|
|
82
62
|
}
|
|
83
63
|
pointerEvents={pointerEvents}
|
|
84
64
|
>
|
|
85
|
-
{
|
|
65
|
+
{children}
|
|
86
66
|
</LazyMaskedView>
|
|
87
67
|
);
|
|
88
68
|
},
|
|
@@ -95,7 +75,4 @@ const styles = StyleSheet.create({
|
|
|
95
75
|
navigationMaskElement: {
|
|
96
76
|
backgroundColor: "white",
|
|
97
77
|
},
|
|
98
|
-
navigationContainer: {
|
|
99
|
-
flex: 1,
|
|
100
|
-
},
|
|
101
78
|
});
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
interpolateColor,
|
|
6
6
|
} from "react-native-reanimated";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
NAVIGATION_MASK_CONTAINER_STYLE_ID,
|
|
9
|
+
NAVIGATION_MASK_ELEMENT_STYLE_ID,
|
|
10
10
|
} from "../constants";
|
|
11
11
|
import type { ScreenTransitionConfig } from "../types/screen.types";
|
|
12
12
|
import { normalizeInterpolatedStyle } from "../utils/normalize-interpolated-style";
|
|
@@ -286,10 +286,10 @@ export const SharedIGImage = ({
|
|
|
286
286
|
const sourceStyle = navigationStyles[sharedBoundTag] as
|
|
287
287
|
| Record<string, unknown>
|
|
288
288
|
| undefined;
|
|
289
|
-
const containerStyle = navigationStyles[
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
const maskStyle = navigationStyles[
|
|
289
|
+
const containerStyle = navigationStyles[
|
|
290
|
+
NAVIGATION_MASK_CONTAINER_STYLE_ID
|
|
291
|
+
] as Record<string, unknown> | undefined;
|
|
292
|
+
const maskStyle = navigationStyles[NAVIGATION_MASK_ELEMENT_STYLE_ID] as
|
|
293
293
|
| Record<string, unknown>
|
|
294
294
|
| undefined;
|
|
295
295
|
|
|
@@ -317,7 +317,7 @@ export const SharedIGImage = ({
|
|
|
317
317
|
],
|
|
318
318
|
},
|
|
319
319
|
},
|
|
320
|
-
[
|
|
320
|
+
[NAVIGATION_MASK_CONTAINER_STYLE_ID]: containerStyle
|
|
321
321
|
? {
|
|
322
322
|
style: {
|
|
323
323
|
...containerStyle,
|
|
@@ -329,7 +329,7 @@ export const SharedIGImage = ({
|
|
|
329
329
|
},
|
|
330
330
|
}
|
|
331
331
|
: undefined,
|
|
332
|
-
[
|
|
332
|
+
[NAVIGATION_MASK_ELEMENT_STYLE_ID]: maskStyle
|
|
333
333
|
? {
|
|
334
334
|
style: {
|
|
335
335
|
...maskStyle,
|
|
@@ -623,7 +623,7 @@ export const SharedXImage = ({
|
|
|
623
623
|
const navigationStyles = bounds({
|
|
624
624
|
id: sharedBoundTag,
|
|
625
625
|
}).navigation.zoom();
|
|
626
|
-
const maskStyle = navigationStyles[
|
|
626
|
+
const maskStyle = navigationStyles[NAVIGATION_MASK_ELEMENT_STYLE_ID] as
|
|
627
627
|
| Record<string, unknown>
|
|
628
628
|
| undefined;
|
|
629
629
|
|
|
@@ -654,7 +654,7 @@ export const SharedXImage = ({
|
|
|
654
654
|
|
|
655
655
|
return {
|
|
656
656
|
...normalizedNav,
|
|
657
|
-
[
|
|
657
|
+
[NAVIGATION_MASK_ELEMENT_STYLE_ID]: maskStyle
|
|
658
658
|
? {
|
|
659
659
|
style: {
|
|
660
660
|
...maskStyle,
|
package/src/shared/constants.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { BaseStackRoute } from "./types/stack.types";
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Masked view integration
|
|
11
|
+
* @deprecated No longer in use. Use {@link NAVIGATION_MASK_ELEMENT_STYLE_ID} and {@link NAVIGATION_MASK_CONTAINER_STYLE_ID} instead.
|
|
11
12
|
*/
|
|
12
13
|
export const MASK_STYLE_ID = "_ROOT_MASKED";
|
|
13
14
|
export const CONTAINER_STYLE_ID = "_ROOT_CONTAINER";
|
|
@@ -15,14 +16,15 @@ export const CONTAINER_STYLE_ID = "_ROOT_CONTAINER";
|
|
|
15
16
|
/**
|
|
16
17
|
* Navigation mask integration
|
|
17
18
|
*/
|
|
18
|
-
export const
|
|
19
|
-
export const
|
|
20
|
-
export const NAVIGATION_CONTAINER_STYLE_ID = "_NAVIGATION_ROOT_CONTAINER";
|
|
19
|
+
export const NAVIGATION_MASK_ELEMENT_STYLE_ID = "_NAVIGATION_ROOT_MASK";
|
|
20
|
+
export const NAVIGATION_MASK_CONTAINER_STYLE_ID = "_NAVIGATION_ROOT_CONTAINER";
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Styles
|
|
24
24
|
*/
|
|
25
25
|
export const NO_STYLES = Object.freeze({});
|
|
26
|
+
export const HIDDEN_STYLE = Object.freeze({ opacity: 0 });
|
|
27
|
+
export const VISIBLE_STYLE = Object.freeze({ opacity: 1 });
|
|
26
28
|
export const NO_PROPS = Object.freeze({});
|
|
27
29
|
|
|
28
30
|
/**
|