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.
Files changed (101) hide show
  1. package/lib/commonjs/shared/components/create-boundary-component/index.js +1 -2
  2. package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
  3. package/lib/commonjs/shared/components/create-transition-aware-component.js +1 -2
  4. package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
  5. package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js +43 -0
  6. package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js.map +1 -0
  7. package/lib/commonjs/shared/components/screen-container/index.js +7 -4
  8. package/lib/commonjs/shared/components/screen-container/index.js.map +1 -1
  9. package/lib/commonjs/shared/components/screen-container/layers/content.js +28 -12
  10. package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
  11. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +4 -24
  12. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  13. package/lib/commonjs/shared/configs/presets.js +6 -6
  14. package/lib/commonjs/shared/configs/presets.js.map +1 -1
  15. package/lib/commonjs/shared/constants.js +10 -4
  16. package/lib/commonjs/shared/constants.js.map +1 -1
  17. package/lib/commonjs/shared/hooks/animation/use-associated-style.js +9 -34
  18. package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +1 -1
  19. package/lib/commonjs/shared/index.js +4 -10
  20. package/lib/commonjs/shared/index.js.map +1 -1
  21. package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js +36 -0
  22. package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +1 -0
  23. package/lib/commonjs/shared/providers/screen/styles.provider.js +31 -10
  24. package/lib/commonjs/shared/providers/screen/styles.provider.js.map +1 -1
  25. package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js +2 -2
  26. package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
  27. package/lib/commonjs/shared/utils/bounds/zoom/build.js +8 -12
  28. package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -1
  29. package/lib/module/shared/components/create-boundary-component/index.js +1 -2
  30. package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
  31. package/lib/module/shared/components/create-transition-aware-component.js +1 -2
  32. package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
  33. package/lib/module/shared/components/screen-container/deferred-visibility-host.js +38 -0
  34. package/lib/module/shared/components/screen-container/deferred-visibility-host.js.map +1 -0
  35. package/lib/module/shared/components/screen-container/index.js +7 -4
  36. package/lib/module/shared/components/screen-container/index.js.map +1 -1
  37. package/lib/module/shared/components/screen-container/layers/content.js +29 -13
  38. package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
  39. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +6 -26
  40. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  41. package/lib/module/shared/configs/presets.js +7 -7
  42. package/lib/module/shared/configs/presets.js.map +1 -1
  43. package/lib/module/shared/constants.js +9 -3
  44. package/lib/module/shared/constants.js.map +1 -1
  45. package/lib/module/shared/hooks/animation/use-associated-style.js +10 -35
  46. package/lib/module/shared/hooks/animation/use-associated-style.js.map +1 -1
  47. package/lib/module/shared/index.js +1 -1
  48. package/lib/module/shared/index.js.map +1 -1
  49. package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js +31 -0
  50. package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +1 -0
  51. package/lib/module/shared/providers/screen/styles.provider.js +30 -11
  52. package/lib/module/shared/providers/screen/styles.provider.js.map +1 -1
  53. package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js +3 -3
  54. package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
  55. package/lib/module/shared/utils/bounds/zoom/build.js +9 -13
  56. package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -1
  57. package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
  58. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  59. package/lib/typescript/shared/components/screen-container/deferred-visibility-host.d.ts +13 -0
  60. package/lib/typescript/shared/components/screen-container/deferred-visibility-host.d.ts.map +1 -0
  61. package/lib/typescript/shared/components/screen-container/index.d.ts.map +1 -1
  62. package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
  63. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts +1 -1
  64. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
  65. package/lib/typescript/shared/configs/index.d.ts.map +1 -1
  66. package/lib/typescript/shared/constants.d.ts +9 -3
  67. package/lib/typescript/shared/constants.d.ts.map +1 -1
  68. package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts +5 -11
  69. package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts.map +1 -1
  70. package/lib/typescript/shared/index.d.ts +1 -1
  71. package/lib/typescript/shared/index.d.ts.map +1 -1
  72. package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts +10 -0
  73. package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts.map +1 -0
  74. package/lib/typescript/shared/providers/screen/styles.provider.d.ts +4 -2
  75. package/lib/typescript/shared/providers/screen/styles.provider.d.ts.map +1 -1
  76. package/lib/typescript/shared/types/animation.types.d.ts +6 -1
  77. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  78. package/lib/typescript/shared/types/screen.types.d.ts +5 -0
  79. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
  80. package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts +11 -1
  81. package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts.map +1 -1
  82. package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts +1 -1
  83. package/lib/typescript/shared/utils/bounds/zoom/build.d.ts +2 -2
  84. package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -1
  85. package/package.json +1 -1
  86. package/src/shared/components/create-boundary-component/index.tsx +0 -1
  87. package/src/shared/components/create-transition-aware-component.tsx +0 -1
  88. package/src/shared/components/screen-container/deferred-visibility-host.tsx +37 -0
  89. package/src/shared/components/screen-container/index.tsx +5 -2
  90. package/src/shared/components/screen-container/layers/content.tsx +50 -15
  91. package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +8 -31
  92. package/src/shared/configs/presets.ts +10 -10
  93. package/src/shared/constants.ts +5 -3
  94. package/src/shared/hooks/animation/use-associated-style.ts +10 -54
  95. package/src/shared/index.ts +2 -3
  96. package/src/shared/providers/screen/helpers/resolve-interpolated-style-output.ts +41 -0
  97. package/src/shared/providers/screen/styles.provider.tsx +95 -72
  98. package/src/shared/types/animation.types.ts +6 -1
  99. package/src/shared/types/screen.types.ts +5 -0
  100. package/src/shared/utils/bounds/helpers/compute-bounds-styles.ts +3 -2
  101. 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
@@ -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 { ScreenStylesProvider, useScreenStyles };
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;AAMzF,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;CACzE,CAAC;AAEF,QAAA,MACC,oBAAoB,6BAEI,eAAe,gCA6GvC,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,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
- export type ScreenStyleInterpolator = (props: ScreenInterpolationProps) => TransitionInterpolatedStyle;
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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AAM,EAAE,OAAO,CAAC,CAAC;CAChC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,qCAAqC,GAAG;IACnD,iEAAiE;IACjE,OAAO,CAAC,EAAE,6BAA6B,CAAC;IACxC,uEAAuE;IACvE,QAAQ,CAAC,EAAE,6BAA6B,CAAC;IACzC,kFAAkF;IAClF,OAAO,CAAC,EAAE,6BAA6B,CAAC;IACxC,gEAAgE;IAChE,CAAC,EAAE,EAAE,MAAM,GAAG,6BAA6B,GAAG,SAAS,CAAC;CACxD,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACzC,iEAAiE;IACjE,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,uEAAuE;IACvE,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,kFAAkF;IAClF,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,gEAAgE;IAChE,CAAC,EAAE,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAAC;IAC9C;;;OAGG;IACH,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC;;;OAGG;IACH,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC;;;OAGG;IACH,YAAY,CAAC,EAAE,iBAAiB,CAAC;CACjC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,IAAI,CAAC,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"}
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,EAA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AAM,MAAM,2BAA2B,GAAG;IACzC,iEAAiE;IACjE,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,uEAAuE;IACvE,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,kFAAkF;IAClF,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,gEAAgE;IAChE,CAAC,EAAE,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAAC;IAC9C;;;OAGG;IACH,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC;;;OAGG;IACH,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC;;;OAGG;IACH,YAAY,CAAC,EAAE,iBAAiB,CAAC;CACjC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,IAAI,CAAC,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,KA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,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":"AAQA,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,iBAiGrC,CAAC"}
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 { TransitionInterpolatedStyle } from "../../../types/animation.types";
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) => TransitionInterpolatedStyle;
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":"AAWA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AASlF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAwarD,eAAO,MAAM,eAAe,GAAI,4DAO7B,qBAAqB,KAAG,2BAuQ1B,CAAC"}
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-screen-transitions",
3
- "version": "3.4.0-alpha.2",
3
+ "version": "3.4.0-alpha.3",
4
4
  "description": "Easy screen transitions for React Native and Expo",
5
5
  "author": "Ed",
6
6
  "license": "MIT",
@@ -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({
@@ -140,7 +140,6 @@ export function createTransitionAwareComponent<P extends object>(
140
140
  id: sharedBoundTag || styleId,
141
141
  style,
142
142
  resetTransformOnUnset: !!sharedBoundTag,
143
- waitForFirstResolvedStyle: false,
144
143
  });
145
144
 
146
145
  return (
@@ -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
- <BackdropLayer />
17
- <ContentLayer>{children}</ContentLayer>
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 { NO_PROPS, NO_STYLES } from "../../../constants";
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
- <MaybeMaskedNavigationContainer
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 { Platform, StyleSheet, View, type ViewProps } from "react-native";
2
+ import { StyleSheet, View, type ViewProps } from "react-native";
3
3
  import Animated, { useAnimatedStyle } from "react-native-reanimated";
4
4
  import {
5
- NAVIGATION_CONTAINER_STYLE_ID,
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 stylesMap.value[NAVIGATION_MASK_STYLE_ID]?.style || NO_STYLES;
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 navigationContainer;
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
- {navigationContainer}
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
- NAVIGATION_CONTAINER_STYLE_ID,
9
- NAVIGATION_MASK_STYLE_ID,
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[NAVIGATION_CONTAINER_STYLE_ID] as
290
- | Record<string, unknown>
291
- | undefined;
292
- const maskStyle = navigationStyles[NAVIGATION_MASK_STYLE_ID] as
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
- [NAVIGATION_CONTAINER_STYLE_ID]: containerStyle
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
- [NAVIGATION_MASK_STYLE_ID]: maskStyle
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[NAVIGATION_MASK_STYLE_ID] as
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
- [NAVIGATION_MASK_STYLE_ID]: maskStyle
657
+ [NAVIGATION_MASK_ELEMENT_STYLE_ID]: maskStyle
658
658
  ? {
659
659
  style: {
660
660
  ...maskStyle,
@@ -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 NAVIGATION_MASK_HOST_FLAG_STYLE_ID = "_NAVIGATION_MASK_HOST";
19
- export const NAVIGATION_MASK_STYLE_ID = "_NAVIGATION_ROOT_MASK";
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
  /**