react-native-screen-transitions 3.9.0-alpha.3 → 3.9.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js +31 -1
  2. package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -1
  3. package/lib/commonjs/shared/components/boundary/portal/components/portal.js +7 -43
  4. package/lib/commonjs/shared/components/boundary/portal/components/portal.js.map +1 -1
  5. package/lib/commonjs/shared/components/boundary/portal/hooks/use-placeholder-styles.js +57 -0
  6. package/lib/commonjs/shared/components/boundary/portal/hooks/use-placeholder-styles.js.map +1 -0
  7. package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js +4 -3
  8. package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js.map +1 -1
  9. package/lib/commonjs/shared/components/masked-view.js +5 -0
  10. package/lib/commonjs/shared/components/masked-view.js.map +1 -1
  11. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +18 -8
  12. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
  13. package/lib/commonjs/shared/components/screen-container/layers/content.js +34 -16
  14. package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
  15. package/lib/commonjs/shared/components/screen-container/layers/render-component.js +10 -0
  16. package/lib/commonjs/shared/components/screen-container/layers/render-component.js.map +1 -0
  17. package/lib/commonjs/shared/components/screen-container/layers/surface-container.js +5 -3
  18. package/lib/commonjs/shared/components/screen-container/layers/surface-container.js.map +1 -1
  19. package/lib/commonjs/shared/index.js +4 -0
  20. package/lib/commonjs/shared/index.js.map +1 -1
  21. package/lib/commonjs/shared/providers/register-bounds.provider.js +6 -0
  22. package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
  23. package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js +31 -1
  24. package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -1
  25. package/lib/module/shared/components/boundary/portal/components/portal.js +8 -44
  26. package/lib/module/shared/components/boundary/portal/components/portal.js.map +1 -1
  27. package/lib/module/shared/components/boundary/portal/hooks/use-placeholder-styles.js +52 -0
  28. package/lib/module/shared/components/boundary/portal/hooks/use-placeholder-styles.js.map +1 -0
  29. package/lib/module/shared/components/boundary/portal/utils/offset-style.js +4 -3
  30. package/lib/module/shared/components/boundary/portal/utils/offset-style.js.map +1 -1
  31. package/lib/module/shared/components/masked-view.js +5 -0
  32. package/lib/module/shared/components/masked-view.js.map +1 -1
  33. package/lib/module/shared/components/screen-container/layers/backdrop.js +19 -9
  34. package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
  35. package/lib/module/shared/components/screen-container/layers/content.js +35 -17
  36. package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
  37. package/lib/module/shared/components/screen-container/layers/render-component.js +6 -0
  38. package/lib/module/shared/components/screen-container/layers/render-component.js.map +1 -0
  39. package/lib/module/shared/components/screen-container/layers/surface-container.js +5 -3
  40. package/lib/module/shared/components/screen-container/layers/surface-container.js.map +1 -1
  41. package/lib/module/shared/index.js +4 -0
  42. package/lib/module/shared/index.js.map +1 -1
  43. package/lib/module/shared/providers/register-bounds.provider.js +6 -0
  44. package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
  45. package/lib/typescript/component-stack/types.d.ts +26 -0
  46. package/lib/typescript/component-stack/types.d.ts.map +1 -1
  47. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts.map +1 -1
  48. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts.map +1 -1
  49. package/lib/typescript/shared/components/boundary/portal/hooks/use-placeholder-styles.d.ts +17 -0
  50. package/lib/typescript/shared/components/boundary/portal/hooks/use-placeholder-styles.d.ts.map +1 -0
  51. package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts +10 -1
  52. package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts.map +1 -1
  53. package/lib/typescript/shared/components/masked-view.d.ts +4 -0
  54. package/lib/typescript/shared/components/masked-view.d.ts.map +1 -1
  55. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
  56. package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
  57. package/lib/typescript/shared/components/screen-container/layers/render-component.d.ts +3 -0
  58. package/lib/typescript/shared/components/screen-container/layers/render-component.d.ts.map +1 -0
  59. package/lib/typescript/shared/components/screen-container/layers/surface-container.d.ts.map +1 -1
  60. package/lib/typescript/shared/index.d.ts +37 -33
  61. package/lib/typescript/shared/index.d.ts.map +1 -1
  62. package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
  63. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +1 -1
  64. package/lib/typescript/shared/types/index.d.ts +1 -1
  65. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  66. package/lib/typescript/shared/types/screen.types.d.ts +99 -4
  67. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
  68. package/lib/typescript/shared/utils/bounds/types/options.d.ts +2 -0
  69. package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
  70. package/package.json +1 -1
  71. package/src/component-stack/types.ts +26 -0
  72. package/src/shared/components/boundary/portal/components/portal-boundary-host.tsx +51 -0
  73. package/src/shared/components/boundary/portal/components/portal.tsx +7 -39
  74. package/src/shared/components/boundary/portal/hooks/use-placeholder-styles.ts +55 -0
  75. package/src/shared/components/boundary/portal/utils/offset-style.ts +9 -2
  76. package/src/shared/components/masked-view.tsx +4 -0
  77. package/src/shared/components/screen-container/layers/backdrop.tsx +31 -10
  78. package/src/shared/components/screen-container/layers/content.tsx +61 -22
  79. package/src/shared/components/screen-container/layers/render-component.ts +9 -0
  80. package/src/shared/components/screen-container/layers/surface-container.tsx +5 -4
  81. package/src/shared/index.ts +9 -0
  82. package/src/shared/providers/register-bounds.provider.tsx +5 -0
  83. package/src/shared/types/index.ts +5 -0
  84. package/src/shared/types/screen.types.ts +111 -4
  85. package/src/shared/utils/bounds/types/options.ts +2 -0
@@ -1,4 +1,4 @@
1
- import { memo, useCallback, useMemo } from "react";
1
+ import { type ComponentType, memo, useCallback, useMemo } from "react";
2
2
  import { Pressable, StyleSheet } from "react-native";
3
3
  import Animated, { runOnUI } from "react-native-reanimated";
4
4
  import { DefaultSnapSpec } from "../../../configs/specs";
@@ -8,9 +8,13 @@ import { useSlotProps, useSlotStyles } from "../../../providers/screen/styles";
8
8
  import { AnimationStore } from "../../../stores/animation.store";
9
9
  import { GestureStore } from "../../../stores/gesture.store";
10
10
  import { SystemStore } from "../../../stores/system.store";
11
- import type { BackdropBehavior } from "../../../types/screen.types";
11
+ import type {
12
+ BackdropBehavior,
13
+ ScreenBackdropComponentProps,
14
+ } from "../../../types/screen.types";
12
15
  import { animateToProgress } from "../../../utils/animation/animate-to-progress";
13
16
  import { findCollapseTarget } from "../helpers/find-collapse-target";
17
+ import { usesLayerRenderProps } from "./render-component";
14
18
 
15
19
  export const BackdropLayer = memo(function BackdropLayer({
16
20
  backdropBehavior,
@@ -30,8 +34,10 @@ export const BackdropLayer = memo(function BackdropLayer({
30
34
 
31
35
  const AnimatedBackdropComponent = useMemo(
32
36
  () =>
33
- BackdropComponent
34
- ? Animated.createAnimatedComponent(BackdropComponent)
37
+ BackdropComponent && !usesLayerRenderProps(BackdropComponent)
38
+ ? Animated.createAnimatedComponent(
39
+ BackdropComponent as ComponentType<any>,
40
+ )
35
41
  : null,
36
42
  [BackdropComponent],
37
43
  );
@@ -108,6 +114,13 @@ export const BackdropLayer = memo(function BackdropLayer({
108
114
 
109
115
  const animatedBackdropStyle = useSlotStyles("backdrop");
110
116
  const animatedBackdropProps = useSlotProps("backdrop");
117
+ const backdropPointerEvents = isBackdropActive ? "auto" : "none";
118
+ const backdropStyles = [
119
+ StyleSheet.absoluteFill,
120
+ animatedBackdropStyle,
121
+ ] as ScreenBackdropComponentProps["styles"];
122
+ const backdropProps =
123
+ animatedBackdropProps as ScreenBackdropComponentProps["props"];
111
124
 
112
125
  return (
113
126
  <Pressable
@@ -115,16 +128,24 @@ export const BackdropLayer = memo(function BackdropLayer({
115
128
  pointerEvents={isBackdropActive ? "auto" : "none"}
116
129
  onPress={isBackdropActive ? handleBackdropPress : undefined}
117
130
  >
118
- {/* Keep blur props and visual style separated.
119
- * BlurView's animatable ref points at the inner native blur view, and mixing
120
- * animated style with animatedProps can break intensity updates. */}
121
- {AnimatedBackdropComponent && (
131
+ {AnimatedBackdropComponent ? (
122
132
  <AnimatedBackdropComponent
123
- style={[StyleSheet.absoluteFill]}
133
+ style={backdropStyles}
124
134
  animatedProps={animatedBackdropProps}
135
+ pointerEvents={backdropPointerEvents}
136
+ />
137
+ ) : BackdropComponent ? (
138
+ <BackdropComponent
139
+ styles={backdropStyles}
140
+ props={backdropProps}
141
+ pointerEvents={backdropPointerEvents}
142
+ />
143
+ ) : (
144
+ <Animated.View
145
+ style={backdropStyles}
146
+ pointerEvents={backdropPointerEvents}
125
147
  />
126
148
  )}
127
- <Animated.View style={[StyleSheet.absoluteFill, animatedBackdropStyle]} />
128
149
  </Pressable>
129
150
  );
130
151
  });
@@ -1,5 +1,5 @@
1
1
  /** biome-ignore-all lint/style/noNonNullAssertion: <Screen gesture is under the gesture context, so this will always exist.> */
2
- import { memo } from "react";
2
+ import { type ComponentType, memo, useMemo } from "react";
3
3
  import { StyleSheet, View } from "react-native";
4
4
  import { GestureDetector } from "react-native-gesture-handler";
5
5
  import Animated from "react-native-reanimated";
@@ -7,9 +7,11 @@ import { useDescriptors } from "../../../providers/screen/descriptors";
7
7
  import { useGestureContext } from "../../../providers/screen/gestures";
8
8
  import { OriginProvider } from "../../../providers/screen/origin.provider";
9
9
  import { useSlotProps, useSlotStyles } from "../../../providers/screen/styles";
10
+ import type { ScreenContentComponentProps } from "../../../types";
10
11
  import { ScreenFallbackHost } from "../../boundary/portal/components/host";
11
12
  import { useContentLayout } from "../hooks/use-content-layout";
12
13
  import { MaybeMaskedNavigationContainer } from "./maybe-masked-navigation-container";
14
+ import { usesLayerRenderProps } from "./render-component";
13
15
  import { SurfaceContainer } from "./surface-container";
14
16
 
15
17
  type Props = {
@@ -23,9 +25,18 @@ export const ContentLayer = memo(
23
25
  const { current } = useDescriptors();
24
26
 
25
27
  const gestureContext = useGestureContext();
28
+ const ContentComponent = current.options.contentComponent;
26
29
  const isNavigationMaskEnabled = !!current.options.navigationMaskEnabled;
27
30
  const contentPointerEvents = isBackdropActive ? "box-none" : pointerEvents;
28
31
 
32
+ const AnimatedContentComponent = useMemo(() => {
33
+ return ContentComponent && !usesLayerRenderProps(ContentComponent)
34
+ ? Animated.createAnimatedComponent(
35
+ ContentComponent as ComponentType<any>,
36
+ )
37
+ : null;
38
+ }, [ContentComponent]);
39
+
29
40
  const hasAutoSnapPoint =
30
41
  current.options.snapPoints?.includes("auto") ?? false;
31
42
 
@@ -33,32 +44,60 @@ export const ContentLayer = memo(
33
44
 
34
45
  const animatedContentStyle = useSlotStyles("content");
35
46
  const animatedContentProps = useSlotProps("content");
47
+ const contentStyles = [
48
+ styles.content,
49
+ animatedContentStyle,
50
+ ] as ScreenContentComponentProps["styles"];
51
+ const contentProps =
52
+ animatedContentProps as ScreenContentComponentProps["props"];
53
+
54
+ const contentChildren = (
55
+ <MaybeMaskedNavigationContainer
56
+ pointerEvents={contentPointerEvents}
57
+ enabled={isNavigationMaskEnabled}
58
+ >
59
+ <SurfaceContainer pointerEvents={contentPointerEvents}>
60
+ <OriginProvider>
61
+ {hasAutoSnapPoint ? (
62
+ <View collapsable={false} onLayout={handleContentLayout}>
63
+ {children}
64
+ </View>
65
+ ) : (
66
+ children
67
+ )}
68
+ <ScreenFallbackHost />
69
+ </OriginProvider>
70
+ </SurfaceContainer>
71
+ </MaybeMaskedNavigationContainer>
72
+ );
36
73
 
37
74
  return (
38
75
  <GestureDetector gesture={gestureContext!.detectorGesture}>
39
- <Animated.View
40
- style={[styles.content, animatedContentStyle]}
41
- animatedProps={animatedContentProps}
42
- pointerEvents={contentPointerEvents}
43
- >
44
- <MaybeMaskedNavigationContainer
76
+ {AnimatedContentComponent ? (
77
+ <AnimatedContentComponent
78
+ style={contentStyles}
79
+ animatedProps={animatedContentProps}
80
+ pointerEvents={contentPointerEvents}
81
+ >
82
+ {contentChildren}
83
+ </AnimatedContentComponent>
84
+ ) : ContentComponent ? (
85
+ <ContentComponent
86
+ styles={contentStyles}
87
+ props={contentProps}
88
+ pointerEvents={contentPointerEvents}
89
+ >
90
+ {contentChildren}
91
+ </ContentComponent>
92
+ ) : (
93
+ <Animated.View
94
+ style={contentStyles}
95
+ animatedProps={animatedContentProps}
45
96
  pointerEvents={contentPointerEvents}
46
- enabled={isNavigationMaskEnabled}
47
97
  >
48
- <SurfaceContainer pointerEvents={contentPointerEvents}>
49
- <OriginProvider>
50
- {hasAutoSnapPoint ? (
51
- <View collapsable={false} onLayout={handleContentLayout}>
52
- {children}
53
- </View>
54
- ) : (
55
- children
56
- )}
57
- <ScreenFallbackHost />
58
- </OriginProvider>
59
- </SurfaceContainer>
60
- </MaybeMaskedNavigationContainer>
61
- </Animated.View>
98
+ {contentChildren}
99
+ </Animated.View>
100
+ )}
62
101
  </GestureDetector>
63
102
  );
64
103
  },
@@ -0,0 +1,9 @@
1
+ import type { ComponentType } from "react";
2
+
3
+ export function usesLayerRenderProps(
4
+ component: ComponentType<any>,
5
+ ): component is ComponentType<Record<string, unknown>> {
6
+ return (
7
+ typeof component === "function" && !component.prototype?.isReactComponent
8
+ );
9
+ }
@@ -12,13 +12,14 @@ type Props = {
12
12
  export const SurfaceContainer = memo(({ children, pointerEvents }: Props) => {
13
13
  const { current } = useDescriptors();
14
14
 
15
- const SurfaceComponent = current.options.surfaceComponent;
15
+ /** @deprecated Use `contentComponent` instead. */
16
+ const DeprecatedSurfaceComponent = current.options.surfaceComponent;
16
17
 
17
18
  const AnimatedSurfaceComponent = useMemo<ComponentType<any> | null>(() => {
18
- return SurfaceComponent
19
- ? Animated.createAnimatedComponent(SurfaceComponent)
19
+ return DeprecatedSurfaceComponent
20
+ ? Animated.createAnimatedComponent(DeprecatedSurfaceComponent)
20
21
  : null;
21
- }, [SurfaceComponent]);
22
+ }, [DeprecatedSurfaceComponent]);
22
23
 
23
24
  if (!AnimatedSurfaceComponent) return children;
24
25
 
@@ -18,6 +18,10 @@ export default {
18
18
  FlatList: createTransitionAwareComponent(FlatList, {
19
19
  isScrollable: true,
20
20
  }),
21
+ /**
22
+ * @deprecated Use `navigationMaskEnabled` with the navigation mask style IDs
23
+ * instead.
24
+ */
21
25
  MaskedView: MaskedView,
22
26
  Presets,
23
27
  Specs,
@@ -63,7 +67,12 @@ export type {
63
67
  InactiveBehavior,
64
68
  OverlayProps,
65
69
  RawGestureValues,
70
+ ScreenBackdropComponent,
71
+ ScreenBackdropComponentProps,
72
+ ScreenContentComponent,
73
+ ScreenContentComponentProps,
66
74
  ScreenInterpolationProps,
75
+ ScreenLayerComponentProps,
67
76
  ScreenStyleInterpolator,
68
77
  ScreenTransitionAccessor,
69
78
  ScreenTransitionConfig,
@@ -25,6 +25,11 @@ import createProvider from "../utils/create-provider";
25
25
  import { applyMeasuredBoundsWrites } from "./helpers/measured-bounds-writes";
26
26
  import { useDescriptorDerivations, useDescriptors } from "./screen/descriptors";
27
27
 
28
+ /**
29
+ * @deprecated Internal legacy provider for the old shared-bound-tag registration
30
+ * path. Do not build new boundary behavior here; use the Transition.Boundary
31
+ * measurement pipeline instead.
32
+ */
28
33
  interface MaybeMeasureAndStoreParams {
29
34
  onPress?: ((...args: unknown[]) => void) | undefined;
30
35
  shouldSetSource?: boolean;
@@ -54,7 +54,12 @@ export type {
54
54
  GestureTracking,
55
55
  InactiveBehavior,
56
56
  Layout,
57
+ ScreenBackdropComponent,
58
+ ScreenBackdropComponentProps,
59
+ ScreenContentComponent,
60
+ ScreenContentComponentProps,
57
61
  ScreenKey,
62
+ ScreenLayerComponentProps,
58
63
  ScreenTransitionConfig,
59
64
  TransitionAwareProps,
60
65
  } from "./screen.types";
@@ -1,3 +1,5 @@
1
+ import type { ComponentType, ReactNode } from "react";
2
+ import type { ViewProps } from "react-native";
1
3
  import type { AnimatedProps } from "react-native-reanimated";
2
4
  import type {
3
5
  ScreenStyleInterpolator,
@@ -51,6 +53,71 @@ export type SnapPoint = number | "auto";
51
53
 
52
54
  export type BackdropBehavior = "block" | "passthrough" | "dismiss" | "collapse";
53
55
 
56
+ /**
57
+ * Props passed to custom screen layer component renderers such as
58
+ * {@linkcode ScreenTransitionConfig.backdropComponent}.
59
+ */
60
+ export type ScreenLayerComponentProps = {
61
+ /**
62
+ * Animated styles for the target layer, including the library-owned base
63
+ * layout style for that layer.
64
+ */
65
+ styles: AnimatedProps<ViewProps>["style"];
66
+
67
+ /**
68
+ * Animated props resolved from the matching `screenStyleInterpolator` slot.
69
+ */
70
+ props: AnimatedProps<Record<string, unknown>>["animatedProps"];
71
+
72
+ /**
73
+ * Pointer-event behavior resolved for the current layer state.
74
+ */
75
+ pointerEvents: ViewProps["pointerEvents"];
76
+ };
77
+
78
+ /**
79
+ * Props passed to {@linkcode ScreenTransitionConfig.backdropComponent} when it
80
+ * is provided as a render-style component.
81
+ */
82
+ export type ScreenBackdropComponentProps = ScreenLayerComponentProps;
83
+
84
+ /**
85
+ * Props passed to {@linkcode ScreenTransitionConfig.contentComponent} when it
86
+ * is provided as a render-style component.
87
+ */
88
+ export type ScreenContentComponentProps = ScreenLayerComponentProps & {
89
+ /**
90
+ * The screen subtree rendered inside the content layer.
91
+ */
92
+ children: ReactNode;
93
+ };
94
+
95
+ /**
96
+ * Custom renderer for the backdrop layer.
97
+ *
98
+ * Component types such as `BlurView` are still accepted for compatibility.
99
+ * Function components can also receive {@linkcode ScreenBackdropComponentProps}
100
+ * to render the animated styles and props manually.
101
+ *
102
+ * @see {@linkcode ScreenTransitionConfig.backdropComponent}
103
+ */
104
+ export type ScreenBackdropComponent =
105
+ | ComponentType<any>
106
+ | ComponentType<ScreenBackdropComponentProps>;
107
+
108
+ /**
109
+ * Custom renderer for the screen content layer.
110
+ *
111
+ * Component types such as a custom native view are accepted directly. Function
112
+ * components can also receive {@linkcode ScreenContentComponentProps} to render
113
+ * the animated styles, props, pointer-events, and children manually.
114
+ *
115
+ * @see {@linkcode ScreenTransitionConfig.contentComponent}
116
+ */
117
+ export type ScreenContentComponent =
118
+ | ComponentType<any>
119
+ | ComponentType<ScreenContentComponentProps>;
120
+
54
121
  /**
55
122
  * Controls how an inactive screen is retained after it is no longer active.
56
123
  *
@@ -117,6 +184,8 @@ export type TransitionAwareProps<T extends object> = AnimatedProps<T> & {
117
184
  * <Transition.View sharedBoundTag="profile-avatar">
118
185
  * <Avatar size="large" />
119
186
  * </Transition.View>
187
+ *
188
+ * @deprecated Use `Transition.Boundary` with `id` instead.
120
189
  */
121
190
  sharedBoundTag?: string;
122
191
 
@@ -127,6 +196,8 @@ export type TransitionAwareProps<T extends object> = AnimatedProps<T> & {
127
196
  * Useful when layout can change while unfocused (for example, programmatic
128
197
  * ScrollView/FlatList scrolling triggered from another screen).
129
198
  *
199
+ * @deprecated Legacy `sharedBoundTag` refresh option. The boundary
200
+ * measurement pipeline refreshes layout through `Transition.Boundary`.
130
201
  * @default false
131
202
  */
132
203
  remeasureOnFocus?: boolean;
@@ -209,6 +280,8 @@ export type ScreenTransitionConfig = {
209
280
  /**
210
281
  * How much velocity affects snap point targeting. Lower values make snapping
211
282
  * feel more deliberate (iOS-like), higher values make it more responsive to flicks.
283
+ *
284
+ * @deprecated Use `gestureSnapVelocityImpact` instead.
212
285
  * @default 0.1
213
286
  */
214
287
  snapVelocityImpact?: number;
@@ -400,13 +473,21 @@ export type ScreenTransitionConfig = {
400
473
  /**
401
474
  * Custom component to render as the backdrop layer (between screens).
402
475
  *
403
- * The library wraps this component with `Animated.createAnimatedComponent` internally.
404
- * Animated styles and props are driven by the `backdrop` slot in the interpolator return value.
476
+ * Direct component types are wrapped with `Animated.createAnimatedComponent`
477
+ * internally. Function components can receive `{ styles, props, pointerEvents }`
478
+ * and decide how to render the layer. Animated styles and props are driven by
479
+ * the `backdrop` slot in the interpolator return value.
405
480
  *
406
481
  * `backdropBehavior` still controls the wrapping Pressable for dismiss/collapse handling.
407
482
  *
408
483
  * @example
409
- * backdropComponent: BlurView,
484
+ * backdropComponent: ({ styles, props, pointerEvents }) => (
485
+ * <AnimatedBlurView
486
+ * style={styles}
487
+ * animatedProps={props}
488
+ * pointerEvents={pointerEvents}
489
+ * />
490
+ * ),
410
491
  * screenStyleInterpolator: ({ progress }) => {
411
492
  * "worklet";
412
493
  * return {
@@ -419,7 +500,32 @@ export type ScreenTransitionConfig = {
419
500
  *
420
501
  * @default undefined
421
502
  */
422
- backdropComponent?: React.ComponentType<any>;
503
+ backdropComponent?: ScreenBackdropComponent;
504
+
505
+ /**
506
+ * Custom component to render as the screen's content layer.
507
+ *
508
+ * The component receives the `content` slot's animated styles and props. A
509
+ * direct component type is wrapped with `Animated.createAnimatedComponent`;
510
+ * a function component can receive `{ styles, props, pointerEvents, children }`
511
+ * and decide how to render the layer.
512
+ *
513
+ * `contentComponent` replaces `surfaceComponent` for custom screen shells.
514
+ *
515
+ * @example
516
+ * contentComponent: ({ styles, props, pointerEvents, children }) => (
517
+ * <AnimatedSquircleView
518
+ * style={styles}
519
+ * animatedProps={props}
520
+ * pointerEvents={pointerEvents}
521
+ * >
522
+ * {children}
523
+ * </AnimatedSquircleView>
524
+ * )
525
+ *
526
+ * @default undefined
527
+ */
528
+ contentComponent?: ScreenContentComponent;
423
529
 
424
530
  /**
425
531
  * Custom component to render as the screen's surface layer.
@@ -443,6 +549,7 @@ export type ScreenTransitionConfig = {
443
549
  * }
444
550
  *
445
551
  * @default undefined
552
+ * @deprecated Use `contentComponent` instead.
446
553
  */
447
554
  surfaceComponent?: React.ComponentType<any>;
448
555
  };
@@ -237,6 +237,8 @@ export type BoundsOptions = {
237
237
 
238
238
  /**
239
239
  * If true, the raw values will be returned instead of the computed values.
240
+ *
241
+ * @deprecated Use `bounds(id).math(options)` instead of passing `raw`.
240
242
  * @default false
241
243
  */
242
244
  raw?: boolean;