react-native-screen-transitions 3.7.0-alpha.0 → 3.7.0-beta.1

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 (102) hide show
  1. package/lib/commonjs/shared/adapters/with-screen-transitions/index.js +0 -6
  2. package/lib/commonjs/shared/adapters/with-screen-transitions/index.js.map +1 -1
  3. package/lib/commonjs/shared/adapters/with-screen-transitions/options.js +22 -68
  4. package/lib/commonjs/shared/adapters/with-screen-transitions/options.js.map +1 -1
  5. package/lib/commonjs/shared/adapters/with-screen-transitions/stack-layout.js +1 -1
  6. package/lib/commonjs/shared/adapters/with-screen-transitions/stack-layout.js.map +1 -1
  7. package/lib/commonjs/shared/components/activity/helpers.js +1 -1
  8. package/lib/commonjs/shared/components/activity/helpers.js.map +1 -1
  9. package/lib/commonjs/shared/components/activity/variants/activity-screen.js +4 -3
  10. package/lib/commonjs/shared/components/activity/variants/activity-screen.js.map +1 -1
  11. package/lib/commonjs/shared/index.js.map +1 -1
  12. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +7 -28
  13. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
  14. package/lib/commonjs/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js +2 -14
  15. package/lib/commonjs/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js.map +1 -1
  16. package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/build-managed-stack-state.js +5 -7
  17. package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/build-managed-stack-state.js.map +1 -1
  18. package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/derive-managed-stack-state.js +1 -5
  19. package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/derive-managed-stack-state.js.map +1 -1
  20. package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/helpers.js +12 -1
  21. package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/helpers.js.map +1 -1
  22. package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/reconcile-managed-routes.js +2 -7
  23. package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/reconcile-managed-routes.js.map +1 -1
  24. package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/managed-stack-controller.js +4 -4
  25. package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/managed-stack-controller.js.map +1 -1
  26. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js +4 -4
  27. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  28. package/lib/commonjs/shared/utils/bounds/navigation/reveal/config.js +2 -1
  29. package/lib/commonjs/shared/utils/bounds/navigation/reveal/config.js.map +1 -1
  30. package/lib/module/shared/adapters/with-screen-transitions/index.js +0 -1
  31. package/lib/module/shared/adapters/with-screen-transitions/index.js.map +1 -1
  32. package/lib/module/shared/adapters/with-screen-transitions/options.js +21 -67
  33. package/lib/module/shared/adapters/with-screen-transitions/options.js.map +1 -1
  34. package/lib/module/shared/adapters/with-screen-transitions/stack-layout.js +2 -2
  35. package/lib/module/shared/adapters/with-screen-transitions/stack-layout.js.map +1 -1
  36. package/lib/module/shared/components/activity/helpers.js +1 -1
  37. package/lib/module/shared/components/activity/helpers.js.map +1 -1
  38. package/lib/module/shared/components/activity/variants/activity-screen.js +4 -3
  39. package/lib/module/shared/components/activity/variants/activity-screen.js.map +1 -1
  40. package/lib/module/shared/index.js.map +1 -1
  41. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +7 -28
  42. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
  43. package/lib/module/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js +3 -15
  44. package/lib/module/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js.map +1 -1
  45. package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/build-managed-stack-state.js +6 -8
  46. package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/build-managed-stack-state.js.map +1 -1
  47. package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/derive-managed-stack-state.js +2 -6
  48. package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/derive-managed-stack-state.js.map +1 -1
  49. package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/helpers.js +9 -0
  50. package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/helpers.js.map +1 -1
  51. package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/reconcile-managed-routes.js +2 -7
  52. package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/reconcile-managed-routes.js.map +1 -1
  53. package/lib/module/shared/providers/stack/helpers/managed-stack-state/managed-stack-controller.js +4 -4
  54. package/lib/module/shared/providers/stack/helpers/managed-stack-state/managed-stack-controller.js.map +1 -1
  55. package/lib/module/shared/utils/bounds/navigation/reveal/build.js +5 -5
  56. package/lib/module/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  57. package/lib/module/shared/utils/bounds/navigation/reveal/config.js +1 -0
  58. package/lib/module/shared/utils/bounds/navigation/reveal/config.js.map +1 -1
  59. package/lib/typescript/blank-stack/types.d.ts +10 -9
  60. package/lib/typescript/blank-stack/types.d.ts.map +1 -1
  61. package/lib/typescript/shared/adapters/with-screen-transitions/index.d.ts +1 -2
  62. package/lib/typescript/shared/adapters/with-screen-transitions/index.d.ts.map +1 -1
  63. package/lib/typescript/shared/adapters/with-screen-transitions/options.d.ts +3 -10
  64. package/lib/typescript/shared/adapters/with-screen-transitions/options.d.ts.map +1 -1
  65. package/lib/typescript/shared/components/activity/helpers.d.ts.map +1 -1
  66. package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts.map +1 -1
  67. package/lib/typescript/shared/index.d.ts +1 -1
  68. package/lib/typescript/shared/index.d.ts.map +1 -1
  69. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts +1 -2
  70. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts.map +1 -1
  71. package/lib/typescript/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.d.ts.map +1 -1
  72. package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/build-managed-stack-state.d.ts.map +1 -1
  73. package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/derive-managed-stack-state.d.ts.map +1 -1
  74. package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/helpers.d.ts +2 -0
  75. package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/helpers.d.ts.map +1 -1
  76. package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/reconcile-managed-routes.d.ts.map +1 -1
  77. package/lib/typescript/shared/types/bounds.types.d.ts +19 -0
  78. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
  79. package/lib/typescript/shared/types/screen.types.d.ts +15 -14
  80. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
  81. package/lib/typescript/shared/utils/bounds/navigation/reveal/build.d.ts.map +1 -1
  82. package/lib/typescript/shared/utils/bounds/navigation/reveal/config.d.ts +1 -0
  83. package/lib/typescript/shared/utils/bounds/navigation/reveal/config.d.ts.map +1 -1
  84. package/package.json +1 -1
  85. package/src/blank-stack/types.ts +10 -9
  86. package/src/shared/adapters/with-screen-transitions/index.tsx +1 -6
  87. package/src/shared/adapters/with-screen-transitions/options.ts +38 -109
  88. package/src/shared/adapters/with-screen-transitions/stack-layout.tsx +5 -5
  89. package/src/shared/components/activity/helpers.ts +1 -1
  90. package/src/shared/components/activity/variants/activity-screen.tsx +4 -3
  91. package/src/shared/index.ts +1 -5
  92. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/index.ts +12 -53
  93. package/src/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.tsx +3 -16
  94. package/src/shared/providers/stack/helpers/managed-stack-state/helpers/build-managed-stack-state.ts +9 -12
  95. package/src/shared/providers/stack/helpers/managed-stack-state/helpers/derive-managed-stack-state.ts +2 -10
  96. package/src/shared/providers/stack/helpers/managed-stack-state/helpers/helpers.ts +19 -0
  97. package/src/shared/providers/stack/helpers/managed-stack-state/helpers/reconcile-managed-routes.ts +2 -12
  98. package/src/shared/providers/stack/helpers/managed-stack-state/managed-stack-controller.ts +4 -4
  99. package/src/shared/types/bounds.types.ts +19 -0
  100. package/src/shared/types/screen.types.ts +15 -14
  101. package/src/shared/utils/bounds/navigation/reveal/build.ts +10 -6
  102. package/src/shared/utils/bounds/navigation/reveal/config.ts +1 -0
@@ -46,27 +46,28 @@ export type BackdropBehavior = "block" | "passthrough" | "dismiss" | "collapse";
46
46
  /**
47
47
  * Controls how an inactive screen is retained after it is no longer active.
48
48
  *
49
- * - `keep`
50
- * keep inactive screen mounted, attached, visible, not interactive
51
- * RNS: activityState=1, visible=true
52
- * React Activity: mode="visible"
49
+ * - `hide`
50
+ * keep inactive screen mounted, pause/freeze inactive work where supported,
51
+ * and hide inactive paint/native presentation after safe paint
52
+ * RNS: activityState=0, visible=false, shouldFreeze=true
53
+ * React Activity: mode="hidden" with paint hidden
53
54
  *
54
- * - `freeze`
55
- * keep last painted UI visible but stop/suspend inactive work where platform allows
56
- * RNS: activityState=1, visible=true, maybe freezeOnBlur/shouldFreeze later
55
+ * - `pause`
56
+ * keep last painted UI visible but pause/freeze inactive work where supported
57
+ * RNS: activityState=1, visible=true, shouldFreeze=true
57
58
  * React Activity: mode="hidden" with paint preserved
58
59
  *
59
- * - `detach`
60
- * remove inactive screen from native/view presentation after safe paint
61
- * RNS: activityState=0, visible=false
62
- * React Activity: mode="hidden" + display none, or equivalent
63
- *
64
60
  * - `unmount`
65
- * actually remove React subtree when the inactive screen is safe to remove
61
+ * remove React subtree when the inactive screen is safe to remove
66
62
  * RNS native: only after safe paint for non-nested screens
67
63
  * web: return null
64
+ *
65
+ * - `keep`
66
+ * keep inactive screen mounted, attached, visible, not interactive, and running
67
+ * RNS: activityState=1, visible=true
68
+ * React Activity: mode="visible"
68
69
  */
69
- export type InactiveBehavior = "keep" | "freeze" | "detach" | "unmount";
70
+ export type InactiveBehavior = "hide" | "pause" | "unmount" | "keep";
70
71
 
71
72
  export type TransitionAwareProps<T extends object> = AnimatedProps<T> & {
72
73
  /**
@@ -13,6 +13,7 @@ import {
13
13
  DRAG_MASK_HEIGHT_COLLAPSE_END,
14
14
  HORIZONTAL_DRAG_MASK_COLLAPSE_SCALE,
15
15
  IDENTITY_DRAG_SCALE_OUTPUT,
16
+ REVEAL_BACKGROUND_SCALE,
16
17
  REVEAL_BORDER_RADIUS,
17
18
  REVEAL_SHADOW_OFFSET,
18
19
  REVEAL_USES_TRANSFORM_MASK,
@@ -65,6 +66,10 @@ export function buildRevealStyles({
65
66
  const disablePointerEventsTillElementTransition =
66
67
  revealOptions?.disablePointerEventsTillElementTransition ?? true;
67
68
  const maskSizingMode = revealOptions?.maskSizingMode ?? "auto";
69
+ const backgroundScale =
70
+ revealOptions?.backgroundScale ?? REVEAL_BACKGROUND_SCALE;
71
+ const shouldBackgroundScaleResetOnSettled =
72
+ revealOptions?.shouldBackgroundScaleResetOnSettled ?? true;
68
73
  const usesTransformMask =
69
74
  maskSizingMode === "auto"
70
75
  ? REVEAL_USES_TRANSFORM_MASK
@@ -366,8 +371,6 @@ export function buildRevealStyles({
366
371
  },
367
372
  [link.id]: {
368
373
  style: {
369
- position: "relative",
370
- zIndex: 999,
371
374
  transform: [{ translateX: elementTX }, { translateY: elementY }],
372
375
  },
373
376
  },
@@ -376,10 +379,11 @@ export function buildRevealStyles({
376
379
 
377
380
  /* ---------------------------- Unfocused Screen ---------------------------- */
378
381
 
379
- const unfocusedScale = mixUnit(1, 0.9375, props.active.progress);
380
- const unfocusedContentScale = props.active.logicallySettled
381
- ? 1
382
- : unfocusedScale;
382
+ const unfocusedScale = mixUnit(1, backgroundScale, props.active.progress);
383
+ const unfocusedContentScale =
384
+ props.active.logicallySettled && shouldBackgroundScaleResetOnSettled
385
+ ? 1
386
+ : unfocusedScale;
383
387
 
384
388
  const trackingContentTarget =
385
389
  initialDestinationTarget ?? link.destination.bounds;
@@ -15,6 +15,7 @@ export const DRAG_MASK_HEIGHT_COLLAPSE_END = 0.7;
15
15
  export const HORIZONTAL_DRAG_MASK_COLLAPSE_SCALE = 0.5;
16
16
  export const DISMISS_SCALE_ORBIT_DEPTH = 0.5;
17
17
  export const CLOSE_SOURCE_HANDOFF_PROGRESS = 0.25;
18
+ export const REVEAL_BACKGROUND_SCALE = 0.9375;
18
19
 
19
20
  export const IDENTITY_DRAG_SCALE_OUTPUT = [1, 1] as const;
20
21
  export const ZERO_TO_ONE_RANGE = [0, 1] as const;