react-native-screen-transitions 3.6.0-alpha.2 → 3.6.0-alpha.4

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 (160) hide show
  1. package/lib/commonjs/shared/constants.js +5 -6
  2. package/lib/commonjs/shared/constants.js.map +1 -1
  3. package/lib/commonjs/shared/hooks/navigation/use-stack.js.map +1 -1
  4. package/lib/commonjs/shared/providers/screen/animation/helpers/build-screen-transition-options.js +2 -1
  5. package/lib/commonjs/shared/providers/screen/animation/helpers/build-screen-transition-options.js.map +1 -1
  6. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +33 -3
  7. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  8. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/snap-points.js +2 -2
  9. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/snap-points.js.map +1 -1
  10. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +8 -4
  11. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  12. package/lib/commonjs/shared/providers/screen/animation/helpers/selected-interpolator-options.js +1 -1
  13. package/lib/commonjs/shared/providers/screen/animation/helpers/selected-interpolator-options.js.map +1 -1
  14. package/lib/commonjs/shared/providers/screen/animation/helpers/stack-progress.js +25 -0
  15. package/lib/commonjs/shared/providers/screen/animation/helpers/stack-progress.js.map +1 -0
  16. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +4 -4
  17. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
  18. package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js +13 -4
  19. package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js.map +1 -1
  20. package/lib/commonjs/shared/providers/screen/options/helpers.js +10 -3
  21. package/lib/commonjs/shared/providers/screen/options/helpers.js.map +1 -1
  22. package/lib/commonjs/shared/providers/stack/direct.provider.js +1 -3
  23. package/lib/commonjs/shared/providers/stack/direct.provider.js.map +1 -1
  24. package/lib/commonjs/shared/providers/stack/helpers/use-stack-derived.js +2 -12
  25. package/lib/commonjs/shared/providers/stack/helpers/use-stack-derived.js.map +1 -1
  26. package/lib/commonjs/shared/providers/stack/managed.provider.js +1 -3
  27. package/lib/commonjs/shared/providers/stack/managed.provider.js.map +1 -1
  28. package/lib/commonjs/shared/stores/animation.store.js +5 -3
  29. package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
  30. package/lib/commonjs/shared/utils/bounds/index.js +3 -2
  31. package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
  32. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js +36 -15
  33. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  34. package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js +24 -4
  35. package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
  36. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +2 -2
  37. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  38. package/lib/module/shared/constants.js +4 -5
  39. package/lib/module/shared/constants.js.map +1 -1
  40. package/lib/module/shared/hooks/navigation/use-stack.js.map +1 -1
  41. package/lib/module/shared/providers/screen/animation/helpers/build-screen-transition-options.js +2 -1
  42. package/lib/module/shared/providers/screen/animation/helpers/build-screen-transition-options.js.map +1 -1
  43. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +33 -3
  44. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  45. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/snap-points.js +2 -2
  46. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/snap-points.js.map +1 -1
  47. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +8 -4
  48. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  49. package/lib/module/shared/providers/screen/animation/helpers/selected-interpolator-options.js +1 -1
  50. package/lib/module/shared/providers/screen/animation/helpers/selected-interpolator-options.js.map +1 -1
  51. package/lib/module/shared/providers/screen/animation/helpers/stack-progress.js +20 -0
  52. package/lib/module/shared/providers/screen/animation/helpers/stack-progress.js.map +1 -0
  53. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +4 -4
  54. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
  55. package/lib/module/shared/providers/screen/gestures/shared/policy.js +14 -5
  56. package/lib/module/shared/providers/screen/gestures/shared/policy.js.map +1 -1
  57. package/lib/module/shared/providers/screen/options/helpers.js +11 -4
  58. package/lib/module/shared/providers/screen/options/helpers.js.map +1 -1
  59. package/lib/module/shared/providers/stack/direct.provider.js +1 -3
  60. package/lib/module/shared/providers/stack/direct.provider.js.map +1 -1
  61. package/lib/module/shared/providers/stack/helpers/use-stack-derived.js +2 -12
  62. package/lib/module/shared/providers/stack/helpers/use-stack-derived.js.map +1 -1
  63. package/lib/module/shared/providers/stack/managed.provider.js +1 -3
  64. package/lib/module/shared/providers/stack/managed.provider.js.map +1 -1
  65. package/lib/module/shared/stores/animation.store.js +5 -3
  66. package/lib/module/shared/stores/animation.store.js.map +1 -1
  67. package/lib/module/shared/types/animation.types.js +2 -1
  68. package/lib/module/shared/types/animation.types.js.map +1 -1
  69. package/lib/module/shared/types/bounds.types.js.map +1 -1
  70. package/lib/module/shared/utils/bounds/index.js +3 -2
  71. package/lib/module/shared/utils/bounds/index.js.map +1 -1
  72. package/lib/module/shared/utils/bounds/navigation/reveal/build.js +38 -17
  73. package/lib/module/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  74. package/lib/module/shared/utils/bounds/navigation/reveal/math.js +24 -5
  75. package/lib/module/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
  76. package/lib/module/shared/utils/bounds/navigation/zoom/build.js +2 -2
  77. package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  78. package/lib/typescript/shared/components/create-boundary-component/components/boundary-target.d.ts +4 -207
  79. package/lib/typescript/shared/components/create-boundary-component/components/boundary-target.d.ts.map +1 -1
  80. package/lib/typescript/shared/components/create-boundary-component/index.d.ts +2 -2
  81. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts +1 -1
  82. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
  83. package/lib/typescript/shared/components/scene-view.d.ts +1 -1
  84. package/lib/typescript/shared/components/scene-view.d.ts.map +1 -1
  85. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts +2 -2
  86. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
  87. package/lib/typescript/shared/constants.d.ts +3 -2
  88. package/lib/typescript/shared/constants.d.ts.map +1 -1
  89. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +0 -1
  90. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -1
  91. package/lib/typescript/shared/index.d.ts +14 -14
  92. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts +2 -2
  93. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts.map +1 -1
  94. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/snap-points.d.ts +1 -1
  95. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/snap-points.d.ts.map +1 -1
  96. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts +2 -1
  97. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts.map +1 -1
  98. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  99. package/lib/typescript/shared/providers/screen/animation/helpers/selected-interpolator-options.d.ts.map +1 -1
  100. package/lib/typescript/shared/providers/screen/animation/helpers/stack-progress.d.ts +3 -0
  101. package/lib/typescript/shared/providers/screen/animation/helpers/stack-progress.d.ts.map +1 -0
  102. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +2 -1
  103. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -1
  104. package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts +4 -4
  105. package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts.map +1 -1
  106. package/lib/typescript/shared/providers/screen/options/helpers.d.ts.map +1 -1
  107. package/lib/typescript/shared/providers/screen/options/types.d.ts +2 -1
  108. package/lib/typescript/shared/providers/screen/options/types.d.ts.map +1 -1
  109. package/lib/typescript/shared/providers/screen/styles/components/maybe-floating-container.d.ts +1 -1
  110. package/lib/typescript/shared/providers/screen/styles/components/maybe-floating-container.d.ts.map +1 -1
  111. package/lib/typescript/shared/providers/stack/direct.provider.d.ts +1 -1
  112. package/lib/typescript/shared/providers/stack/direct.provider.d.ts.map +1 -1
  113. package/lib/typescript/shared/providers/stack/helpers/use-stack-derived.d.ts +5 -5
  114. package/lib/typescript/shared/providers/stack/helpers/use-stack-derived.d.ts.map +1 -1
  115. package/lib/typescript/shared/providers/stack/managed.provider.d.ts +1 -1
  116. package/lib/typescript/shared/providers/stack/managed.provider.d.ts.map +1 -1
  117. package/lib/typescript/shared/stores/animation.store.d.ts +4 -3
  118. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
  119. package/lib/typescript/shared/types/animation.types.d.ts +7 -3
  120. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  121. package/lib/typescript/shared/types/bounds.types.d.ts +69 -1
  122. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
  123. package/lib/typescript/shared/types/index.d.ts +2 -2
  124. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  125. package/lib/typescript/shared/types/screen.types.d.ts +13 -26
  126. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
  127. package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
  128. package/lib/typescript/shared/utils/bounds/navigation/reveal/build.d.ts +1 -1
  129. package/lib/typescript/shared/utils/bounds/navigation/reveal/build.d.ts.map +1 -1
  130. package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts +12 -2
  131. package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts.map +1 -1
  132. package/lib/typescript/shared/utils/bounds/navigation/reveal/types.d.ts +2 -1
  133. package/lib/typescript/shared/utils/bounds/navigation/reveal/types.d.ts.map +1 -1
  134. package/package.json +4 -3
  135. package/src/shared/constants.ts +6 -4
  136. package/src/shared/hooks/navigation/use-stack.tsx +0 -1
  137. package/src/shared/providers/screen/animation/helpers/build-screen-transition-options.ts +2 -2
  138. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/index.ts +58 -4
  139. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/snap-points.ts +2 -1
  140. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/types.ts +2 -1
  141. package/src/shared/providers/screen/animation/helpers/pipeline.ts +20 -6
  142. package/src/shared/providers/screen/animation/helpers/selected-interpolator-options.ts +0 -2
  143. package/src/shared/providers/screen/animation/helpers/stack-progress.ts +29 -0
  144. package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +5 -12
  145. package/src/shared/providers/screen/gestures/shared/policy.ts +20 -7
  146. package/src/shared/providers/screen/options/helpers.ts +22 -9
  147. package/src/shared/providers/screen/options/types.ts +2 -1
  148. package/src/shared/providers/stack/direct.provider.tsx +3 -13
  149. package/src/shared/providers/stack/helpers/use-stack-derived.ts +6 -15
  150. package/src/shared/providers/stack/managed.provider.tsx +2 -6
  151. package/src/shared/stores/animation.store.ts +6 -3
  152. package/src/shared/types/animation.types.ts +11 -3
  153. package/src/shared/types/bounds.types.ts +72 -1
  154. package/src/shared/types/index.ts +2 -0
  155. package/src/shared/types/screen.types.ts +13 -26
  156. package/src/shared/utils/bounds/index.ts +3 -1
  157. package/src/shared/utils/bounds/navigation/reveal/build.ts +56 -24
  158. package/src/shared/utils/bounds/navigation/reveal/math.ts +34 -4
  159. package/src/shared/utils/bounds/navigation/reveal/types.ts +2 -0
  160. package/src/shared/utils/bounds/navigation/zoom/build.ts +2 -2
@@ -9,6 +9,7 @@ import {
9
9
  CONTENT_ENTERING_OPACITY_OUTPUT,
10
10
  CONTENT_ENTERING_OPACITY_RANGE,
11
11
  CONTENT_SHADOW_OPACITY_OUTPUT,
12
+ DISMISS_SCALE_ORBIT_DEPTH,
12
13
  DRAG_MASK_HEIGHT_COLLAPSE_END,
13
14
  HORIZONTAL_DRAG_MASK_COLLAPSE_SCALE,
14
15
  IDENTITY_DRAG_SCALE_OUTPUT,
@@ -21,6 +22,7 @@ import {
21
22
  import {
22
23
  interpolateClamped,
23
24
  mixUnit,
25
+ resolveAspectRatioMaskHeight,
24
26
  resolveDismissScaleHandoff,
25
27
  resolveRevealContentBaseTransform,
26
28
  resolveRevealDirectionalDragScale,
@@ -39,6 +41,7 @@ import type { BuildRevealStylesParams, RevealInterpolatedStyle } from "./types";
39
41
  export function buildRevealStyles({
40
42
  tag,
41
43
  props,
44
+ revealOptions,
42
45
  }: BuildRevealStylesParams): RevealInterpolatedStyle {
43
46
  "worklet";
44
47
 
@@ -53,6 +56,19 @@ export function buildRevealStyles({
53
56
  progress,
54
57
  layouts: { screen: screenLayout },
55
58
  } = props;
59
+ const borderRadius = revealOptions?.borderRadius ?? REVEAL_BORDER_RADIUS;
60
+ const borderContinuous = revealOptions?.borderContinuous ?? true;
61
+ const maxSensitivity = revealOptions?.maxSensitivity ?? 0.8;
62
+ const velocityDepth =
63
+ revealOptions?.velocityDepth ?? DISMISS_SCALE_ORBIT_DEPTH;
64
+ const gestureProgressMode = revealOptions?.gestureProgressMode ?? "freeform";
65
+ const disablePointerEventsTillElementTransition =
66
+ revealOptions?.disablePointerEventsTillElementTransition ?? true;
67
+ const maskSizingMode = revealOptions?.maskSizingMode ?? "auto";
68
+ const usesTransformMask =
69
+ maskSizingMode === "auto"
70
+ ? REVEAL_USES_TRANSFORM_MASK
71
+ : maskSizingMode === "transform";
56
72
 
57
73
  const boundsAccessor = createLinkAccessor(() => props);
58
74
  const link = boundsAccessor.getLink(tag);
@@ -79,15 +95,15 @@ export function buildRevealStyles({
79
95
  ? Math.abs(props.active.gesture.raw.normY)
80
96
  : 0;
81
97
 
82
- const dragX =
83
- props.active.gesture.x === 0
84
- ? 0
85
- : resolveUnitDragTranslation(props.active.gesture.x, screenLayout.width);
98
+ const dragX = resolveUnitDragTranslation(
99
+ props.active.gesture.x,
100
+ screenLayout.width,
101
+ );
86
102
 
87
- const dragY =
88
- props.active.gesture.y === 0
89
- ? 0
90
- : resolveUnitDragTranslation(props.active.gesture.y, screenLayout.height);
103
+ const dragY = resolveUnitDragTranslation(
104
+ props.active.gesture.y,
105
+ screenLayout.height,
106
+ );
91
107
 
92
108
  const dragXScale = isHorizontalDismiss
93
109
  ? resolveRevealDirectionalDragScale(
@@ -130,9 +146,12 @@ export function buildRevealStyles({
130
146
 
131
147
  const maskBorderRadius = mixUnit(
132
148
  sourceBorderRadius,
133
- REVEAL_BORDER_RADIUS,
149
+ borderRadius,
134
150
  progress,
135
151
  );
152
+ const maskBorderCurve = borderContinuous
153
+ ? ("continuous" as const)
154
+ : undefined;
136
155
 
137
156
  const maskSizeMultiplier = props.active.closing
138
157
  ? mixUnit(0.9, 1, props.active.progress)
@@ -148,19 +167,23 @@ export function buildRevealStyles({
148
167
  if (props.active.gesture.dismissing) {
149
168
  const contentTargetBounds =
150
169
  initialDestinationTarget ?? link.destination.bounds;
170
+
151
171
  const sourceContentScale = resolveUniformScale({
152
172
  sourceWidth: link.source.bounds.width,
153
173
  sourceHeight: link.source.bounds.height,
154
174
  destinationWidth: contentTargetBounds.width,
155
175
  destinationHeight: contentTargetBounds.height,
156
176
  });
177
+
157
178
  contentScale = resolveDismissScaleHandoff({
158
179
  progress: props.active.progress,
159
180
  releaseScale: dragScale,
160
181
  targetScale: sourceContentScale,
161
182
  velocity: props.active.gesture.velocity,
183
+ velocityDepth,
162
184
  });
163
185
  }
186
+
164
187
  const contentTranslateX = contentRaw.translateX + dragX;
165
188
  const contentTranslateY = contentRaw.translateY + dragY;
166
189
 
@@ -190,10 +213,13 @@ export function buildRevealStyles({
190
213
  )
191
214
  : 0;
192
215
 
193
- const minMaskHeight = Math.min(
216
+ const maskAspectBounds = link.initialSource?.bounds ?? link.source.bounds;
217
+ const minMaskHeight = resolveAspectRatioMaskHeight({
218
+ maskWidth,
194
219
  maskHeight,
195
- Math.max(maskWidth, link.source.bounds.height),
196
- );
220
+ targetWidth: maskAspectBounds.width,
221
+ targetHeight: maskAspectBounds.height,
222
+ });
197
223
 
198
224
  const renderedMaskHeight = interpolateClamped(
199
225
  maskHeightCollapseDrag,
@@ -242,12 +268,12 @@ export function buildRevealStyles({
242
268
  compensatedMaskTranslateX + (maskWidth - maskBaseWidth) / 2;
243
269
  const transformMaskTranslateY =
244
270
  compensatedMaskTranslateY + (renderedMaskHeight - maskBaseHeight) / 2;
245
- const maskElementStyle = REVEAL_USES_TRANSFORM_MASK
271
+ const maskElementStyle = usesTransformMask
246
272
  ? {
247
273
  width: maskBaseWidth,
248
274
  height: maskBaseHeight,
249
275
  borderRadius: props.active.settled ? 0 : maskBorderRadius,
250
- borderCurve: "continuous" as const,
276
+ borderCurve: maskBorderCurve,
251
277
  transform: [
252
278
  { translateX: transformMaskTranslateX },
253
279
  { translateY: transformMaskTranslateY },
@@ -259,7 +285,7 @@ export function buildRevealStyles({
259
285
  width: maskWidth,
260
286
  height: renderedMaskHeight,
261
287
  borderRadius: props.active.settled ? 0 : maskBorderRadius,
262
- borderCurve: "continuous" as const,
288
+ borderCurve: maskBorderCurve,
263
289
  transform: [
264
290
  { translateX: compensatedMaskTranslateX },
265
291
  { translateY: compensatedMaskTranslateY },
@@ -295,11 +321,14 @@ export function buildRevealStyles({
295
321
  : 0;
296
322
 
297
323
  const { gestureSensitivity, gestureReleaseVelocityScale } =
298
- resolveRevealGestureHandoff(rawDrag);
324
+ resolveRevealGestureHandoff({
325
+ rawDrag,
326
+ maxSensitivity,
327
+ });
299
328
 
300
329
  return {
301
330
  options: {
302
- gestureProgressMode: "freeform",
331
+ gestureProgressMode,
303
332
  gestureSensitivity,
304
333
  gestureReleaseVelocityScale,
305
334
  },
@@ -374,6 +403,7 @@ export function buildRevealStyles({
374
403
  releaseScale: dragScale,
375
404
  targetScale: trackingTargetScale,
376
405
  velocity: props.active.gesture.velocity,
406
+ velocityDepth,
377
407
  });
378
408
  }
379
409
  const trackingContentTranslateX =
@@ -393,18 +423,20 @@ export function buildRevealStyles({
393
423
 
394
424
  return {
395
425
  options: {
396
- gestureProgressMode: "freeform",
426
+ gestureProgressMode,
397
427
  },
398
428
  content: {
399
429
  style: {
400
430
  transform: [{ scale: unfocusedContentScale }],
401
431
  },
402
- props: {
403
- pointerEvents:
404
- props.active.progress <= CLOSE_SOURCE_HANDOFF_PROGRESS
405
- ? "auto"
406
- : "none",
407
- },
432
+ props: disablePointerEventsTillElementTransition
433
+ ? {
434
+ pointerEvents:
435
+ props.active.progress <= CLOSE_SOURCE_HANDOFF_PROGRESS
436
+ ? "auto"
437
+ : "none",
438
+ }
439
+ : undefined,
408
440
  },
409
441
  [link.id]: {
410
442
  style: {
@@ -3,7 +3,6 @@ import { EPSILON } from "../../../../constants";
3
3
  import type { Layout } from "../../../../types/screen.types";
4
4
  import { computeContentTransformGeometry } from "../../helpers/geometry";
5
5
  import {
6
- DISMISS_SCALE_ORBIT_DEPTH,
7
6
  DRAG_DIRECTIONAL_SCALE_EXPONENT,
8
7
  DRAG_DIRECTIONAL_SCALE_MAX,
9
8
  DRAG_DIRECTIONAL_SCALE_MIN,
@@ -98,11 +97,17 @@ export function resolveUniformScale({
98
97
  return aspectDifference < 0.1 ? Math.max(sx, sy) : Math.min(sx, sy);
99
98
  }
100
99
 
101
- export function resolveRevealGestureHandoff(rawDrag: number) {
100
+ export function resolveRevealGestureHandoff({
101
+ rawDrag,
102
+ maxSensitivity,
103
+ }: {
104
+ rawDrag: number;
105
+ maxSensitivity: number;
106
+ }) {
102
107
  "worklet";
103
108
 
104
109
  const clampedRawDrag = clampUnit(rawDrag);
105
- const gestureSensitivity = mixUnit(0.8, 0.1, clampedRawDrag);
110
+ const gestureSensitivity = mixUnit(maxSensitivity, 0.1, clampedRawDrag);
106
111
 
107
112
  const releaseBoost = mixUnit(1, 1.1, clampedRawDrag);
108
113
 
@@ -125,11 +130,13 @@ export function resolveDismissScaleHandoff({
125
130
  releaseScale,
126
131
  targetScale,
127
132
  velocity,
133
+ velocityDepth,
128
134
  }: {
129
135
  progress: number;
130
136
  releaseScale: number;
131
137
  targetScale: number;
132
138
  velocity: number;
139
+ velocityDepth: number;
133
140
  }) {
134
141
  "worklet";
135
142
 
@@ -137,12 +144,35 @@ export function resolveDismissScaleHandoff({
137
144
  const scaleProgress = Math.sin((Math.PI / 2) * closeProgress);
138
145
  const baseScale = releaseScale + (targetScale - releaseScale) * scaleProgress;
139
146
 
140
- const orbitDepth = DISMISS_SCALE_ORBIT_DEPTH * velocity;
147
+ const orbitDepth = velocityDepth * velocity;
141
148
  const orbitScale = 1 - orbitDepth * Math.sin(Math.PI * closeProgress);
142
149
 
143
150
  return baseScale * orbitScale;
144
151
  }
145
152
 
153
+ export function resolveAspectRatioMaskHeight({
154
+ maskWidth,
155
+ maskHeight,
156
+ targetWidth,
157
+ targetHeight,
158
+ }: {
159
+ maskWidth: number;
160
+ maskHeight: number;
161
+ targetWidth: number;
162
+ targetHeight: number;
163
+ }) {
164
+ "worklet";
165
+
166
+ const safeMaskWidth = Math.max(1, Math.abs(maskWidth));
167
+ const safeMaskHeight = Math.max(1, Math.abs(maskHeight));
168
+ const safeTargetWidth = Math.max(Math.abs(targetWidth), EPSILON);
169
+ const safeTargetHeight = Math.max(Math.abs(targetHeight), EPSILON);
170
+ const targetAspectHeight =
171
+ safeMaskWidth * (safeTargetHeight / safeTargetWidth);
172
+
173
+ return Math.min(safeMaskHeight, Math.max(1, targetAspectHeight));
174
+ }
175
+
146
176
  function getBoundsCenterX(bounds: MeasuredDimensions) {
147
177
  "worklet";
148
178
  return bounds.pageX + bounds.width / 2;
@@ -4,6 +4,7 @@ import {
4
4
  } from "../../../../constants";
5
5
  import type {
6
6
  BoundsInterpolationProps,
7
+ BoundsNavigationRevealOptions,
7
8
  BoundsNavigationRevealStyle,
8
9
  } from "../../../../types/bounds.types";
9
10
 
@@ -15,4 +16,5 @@ export type RevealInterpolatedStyle = BoundsNavigationRevealStyle & {
15
16
  export type BuildRevealStylesParams = {
16
17
  tag?: string;
17
18
  props: BoundsInterpolationProps;
19
+ revealOptions?: BoundsNavigationRevealOptions;
18
20
  };
@@ -168,7 +168,7 @@ export function buildZoomStyles({
168
168
  style: VISIBLE_STYLE,
169
169
  },
170
170
  } satisfies TransitionInterpolatedStyle;
171
- const focusedContentSlot = props.current.layouts.navigationMaskEnabled
171
+ const focusedContentSlot = props.current.options.navigationMaskEnabled
172
172
  ? NAVIGATION_MASK_CONTAINER_STYLE_ID
173
173
  : "content";
174
174
 
@@ -325,7 +325,7 @@ export function buildZoomStyles({
325
325
  ...sourceVisibilityStyle,
326
326
  };
327
327
 
328
- if (props.current.layouts.navigationMaskEnabled) {
328
+ if (props.current.options.navigationMaskEnabled) {
329
329
  focusedStyles[NAVIGATION_MASK_ELEMENT_STYLE_ID] = {
330
330
  style: {
331
331
  width: maskWidth,