react-native-screen-transitions 3.6.0 → 3.7.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.
- package/README.md +2 -2
- package/lib/commonjs/blank-stack/components/stack-view.js +35 -39
- package/lib/commonjs/blank-stack/components/stack-view.js.map +1 -1
- package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js +7 -14
- package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -1
- package/lib/commonjs/component-stack/components/stack-view.js +4 -11
- package/lib/commonjs/component-stack/components/stack-view.js.map +1 -1
- package/lib/commonjs/component-stack/navigators/create-component-stack-navigator.js +1 -1
- package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js +6 -0
- package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
- package/lib/commonjs/shared/adapters/with-screen-transitions/context.js +28 -0
- package/lib/commonjs/shared/adapters/with-screen-transitions/context.js.map +1 -0
- package/lib/commonjs/shared/adapters/with-screen-transitions/index.js +69 -0
- package/lib/commonjs/shared/adapters/with-screen-transitions/index.js.map +1 -0
- package/lib/commonjs/shared/adapters/with-screen-transitions/options.js +57 -0
- package/lib/commonjs/shared/adapters/with-screen-transitions/options.js.map +1 -0
- package/lib/commonjs/shared/adapters/with-screen-transitions/stack-layout.js +143 -0
- package/lib/commonjs/shared/adapters/with-screen-transitions/stack-layout.js.map +1 -0
- package/lib/commonjs/shared/adapters/with-screen-transitions/types.js +6 -0
- package/lib/commonjs/shared/adapters/with-screen-transitions/types.js.map +1 -0
- package/lib/commonjs/shared/components/activity/helpers.js +9 -0
- package/lib/commonjs/shared/components/activity/helpers.js.map +1 -0
- package/lib/commonjs/shared/components/activity/index.js +20 -0
- package/lib/commonjs/shared/components/activity/index.js.map +1 -0
- package/lib/commonjs/shared/components/activity/variants/activity-container.js +29 -0
- package/lib/commonjs/shared/components/activity/variants/activity-container.js.map +1 -0
- package/lib/commonjs/shared/components/activity/variants/activity-screen.js +107 -0
- package/lib/commonjs/shared/components/activity/variants/activity-screen.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-measurer.js +10 -4
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-measurer.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/utils/measured-bounds.js +13 -1
- package/lib/commonjs/shared/components/create-boundary-component/utils/measured-bounds.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js +8 -17
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/index.js +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/index.js.map +1 -1
- package/lib/commonjs/shared/hooks/navigation/use-navigation-helpers.js +10 -4
- package/lib/commonjs/shared/hooks/navigation/use-navigation-helpers.js.map +1 -1
- package/lib/commonjs/shared/hooks/navigation/use-stack.js +63 -6
- package/lib/commonjs/shared/hooks/navigation/use-stack.js.map +1 -1
- package/lib/commonjs/shared/index.js +8 -0
- package/lib/commonjs/shared/index.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/descriptors/descriptors.provider.js +18 -29
- package/lib/commonjs/shared/providers/screen/descriptors/descriptors.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/descriptors/index.js +6 -0
- package/lib/commonjs/shared/providers/screen/descriptors/index.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/ownership/resolve-ownership.js +2 -1
- package/lib/commonjs/shared/providers/screen/gestures/ownership/resolve-ownership.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/ownership/use-walk-up-and-register-shadowing-claims.js +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/ownership/use-walk-up-and-register-shadowing-claims.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-lifecycle.js +4 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-lifecycle.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/use-pan-behavior.js +4 -3
- package/lib/commonjs/shared/providers/screen/gestures/pan/use-pan-behavior.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-lifecycle.js +4 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-lifecycle.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/use-pinch-behavior.js +4 -3
- package/lib/commonjs/shared/providers/screen/gestures/pinch/use-pinch-behavior.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +7 -28
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +16 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js +2 -14
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js.map +1 -1
- package/lib/commonjs/shared/providers/stack/direct.provider.js +4 -3
- package/lib/commonjs/shared/providers/stack/direct.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/build-managed-stack-state.js +197 -0
- package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/build-managed-stack-state.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/derive-managed-stack-state.js +58 -0
- package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/derive-managed-stack-state.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/helpers.js +92 -0
- package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/helpers.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/reconcile-managed-routes.js +118 -0
- package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/reconcile-managed-routes.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/types.js +6 -0
- package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/helpers/types.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/index.js +24 -0
- package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/index.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/managed-stack-controller.js +131 -0
- package/lib/commonjs/shared/providers/stack/helpers/managed-stack-state/managed-stack-controller.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/managed.provider.js +18 -29
- package/lib/commonjs/shared/providers/stack/managed.provider.js.map +1 -1
- package/lib/commonjs/shared/types/stack.types.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js +4 -4
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/config.js +2 -1
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/config.js.map +1 -1
- package/lib/commonjs/shared/utils/create-provider.js +99 -10
- package/lib/commonjs/shared/utils/create-provider.js.map +1 -1
- package/lib/commonjs/shared/utils/navigation/resolve-scene-neighbors.js +8 -5
- package/lib/commonjs/shared/utils/navigation/resolve-scene-neighbors.js.map +1 -1
- package/lib/commonjs/shared/utils/navigation/sync-routes-with-removed.js +23 -6
- package/lib/commonjs/shared/utils/navigation/sync-routes-with-removed.js.map +1 -1
- package/lib/commonjs/shared/utils/visibility-block-offset.js +13 -0
- package/lib/commonjs/shared/utils/visibility-block-offset.js.map +1 -0
- package/lib/module/blank-stack/components/stack-view.js +36 -40
- package/lib/module/blank-stack/components/stack-view.js.map +1 -1
- package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js +7 -14
- package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -1
- package/lib/module/component-stack/components/stack-view.js +4 -11
- package/lib/module/component-stack/components/stack-view.js.map +1 -1
- package/lib/module/component-stack/navigators/create-component-stack-navigator.js +1 -1
- package/lib/module/native-stack/navigators/createNativeStackNavigator.js +6 -0
- package/lib/module/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
- package/lib/module/shared/adapters/with-screen-transitions/context.js +23 -0
- package/lib/module/shared/adapters/with-screen-transitions/context.js.map +1 -0
- package/lib/module/shared/adapters/with-screen-transitions/index.js +65 -0
- package/lib/module/shared/adapters/with-screen-transitions/index.js.map +1 -0
- package/lib/module/shared/adapters/with-screen-transitions/options.js +52 -0
- package/lib/module/shared/adapters/with-screen-transitions/options.js.map +1 -0
- package/lib/module/shared/adapters/with-screen-transitions/stack-layout.js +138 -0
- package/lib/module/shared/adapters/with-screen-transitions/stack-layout.js.map +1 -0
- package/lib/module/shared/adapters/with-screen-transitions/types.js +4 -0
- package/lib/module/shared/adapters/with-screen-transitions/types.js.map +1 -0
- package/lib/module/shared/components/activity/helpers.js +5 -0
- package/lib/module/shared/components/activity/helpers.js.map +1 -0
- package/lib/module/shared/components/activity/index.js +5 -0
- package/lib/module/shared/components/activity/index.js.map +1 -0
- package/lib/module/shared/components/activity/variants/activity-container.js +24 -0
- package/lib/module/shared/components/activity/variants/activity-container.js.map +1 -0
- package/lib/module/shared/components/activity/variants/activity-screen.js +103 -0
- package/lib/module/shared/components/activity/variants/activity-screen.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-measurer.js +11 -5
- package/lib/module/shared/components/create-boundary-component/hooks/use-measurer.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/utils/measured-bounds.js +11 -0
- package/lib/module/shared/components/create-boundary-component/utils/measured-bounds.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js +8 -17
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/index.js +1 -1
- package/lib/module/shared/components/screen-lifecycle/index.js.map +1 -1
- package/lib/module/shared/hooks/navigation/use-navigation-helpers.js +11 -5
- package/lib/module/shared/hooks/navigation/use-navigation-helpers.js.map +1 -1
- package/lib/module/shared/hooks/navigation/use-stack.js +63 -6
- package/lib/module/shared/hooks/navigation/use-stack.js.map +1 -1
- package/lib/module/shared/index.js +3 -0
- package/lib/module/shared/index.js.map +1 -1
- package/lib/module/shared/providers/screen/descriptors/descriptors.provider.js +17 -29
- package/lib/module/shared/providers/screen/descriptors/descriptors.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/descriptors/index.js +1 -1
- package/lib/module/shared/providers/screen/descriptors/index.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/ownership/resolve-ownership.js +2 -1
- package/lib/module/shared/providers/screen/gestures/ownership/resolve-ownership.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/ownership/use-walk-up-and-register-shadowing-claims.js +2 -2
- package/lib/module/shared/providers/screen/gestures/ownership/use-walk-up-and-register-shadowing-claims.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/pan-lifecycle.js +5 -2
- package/lib/module/shared/providers/screen/gestures/pan/pan-lifecycle.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/use-pan-behavior.js +4 -3
- package/lib/module/shared/providers/screen/gestures/pan/use-pan-behavior.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/pinch-lifecycle.js +5 -2
- package/lib/module/shared/providers/screen/gestures/pinch/pinch-lifecycle.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/use-pinch-behavior.js +4 -3
- package/lib/module/shared/providers/screen/gestures/pinch/use-pinch-behavior.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +7 -28
- package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +16 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js +3 -15
- package/lib/module/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js.map +1 -1
- package/lib/module/shared/providers/stack/direct.provider.js +5 -4
- package/lib/module/shared/providers/stack/direct.provider.js.map +1 -1
- package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/build-managed-stack-state.js +192 -0
- package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/build-managed-stack-state.js.map +1 -0
- package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/derive-managed-stack-state.js +53 -0
- package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/derive-managed-stack-state.js.map +1 -0
- package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/helpers.js +78 -0
- package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/helpers.js.map +1 -0
- package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/reconcile-managed-routes.js +113 -0
- package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/reconcile-managed-routes.js.map +1 -0
- package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/types.js +4 -0
- package/lib/module/shared/providers/stack/helpers/managed-stack-state/helpers/types.js.map +1 -0
- package/lib/module/shared/providers/stack/helpers/managed-stack-state/index.js +19 -0
- package/lib/module/shared/providers/stack/helpers/managed-stack-state/index.js.map +1 -0
- package/lib/module/shared/providers/stack/helpers/managed-stack-state/managed-stack-controller.js +126 -0
- package/lib/module/shared/providers/stack/helpers/managed-stack-state/managed-stack-controller.js.map +1 -0
- package/lib/module/shared/providers/stack/managed.provider.js +19 -30
- package/lib/module/shared/providers/stack/managed.provider.js.map +1 -1
- package/lib/module/shared/types/stack.types.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/reveal/build.js +5 -5
- package/lib/module/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/reveal/config.js +1 -0
- package/lib/module/shared/utils/bounds/navigation/reveal/config.js.map +1 -1
- package/lib/module/shared/utils/create-provider.js +100 -11
- package/lib/module/shared/utils/create-provider.js.map +1 -1
- package/lib/module/shared/utils/navigation/resolve-scene-neighbors.js +8 -5
- package/lib/module/shared/utils/navigation/resolve-scene-neighbors.js.map +1 -1
- package/lib/module/shared/utils/navigation/sync-routes-with-removed.js +23 -6
- package/lib/module/shared/utils/navigation/sync-routes-with-removed.js.map +1 -1
- package/lib/module/shared/utils/visibility-block-offset.js +8 -0
- package/lib/module/shared/utils/visibility-block-offset.js.map +1 -0
- package/lib/typescript/blank-stack/components/stack-view.d.ts.map +1 -1
- package/lib/typescript/blank-stack/index.d.ts +1 -1
- package/lib/typescript/blank-stack/index.d.ts.map +1 -1
- package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts +4 -6
- package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts.map +1 -1
- package/lib/typescript/blank-stack/types.d.ts +41 -29
- package/lib/typescript/blank-stack/types.d.ts.map +1 -1
- package/lib/typescript/component-stack/components/stack-view.d.ts.map +1 -1
- package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts +1 -1
- package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts +5 -0
- package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts.map +1 -1
- package/lib/typescript/native-stack/types.d.ts +25 -0
- package/lib/typescript/native-stack/types.d.ts.map +1 -1
- package/lib/typescript/shared/adapters/with-screen-transitions/context.d.ts +15 -0
- package/lib/typescript/shared/adapters/with-screen-transitions/context.d.ts.map +1 -0
- package/lib/typescript/shared/adapters/with-screen-transitions/index.d.ts +10 -0
- package/lib/typescript/shared/adapters/with-screen-transitions/index.d.ts.map +1 -0
- package/lib/typescript/shared/adapters/with-screen-transitions/options.d.ts +9 -0
- package/lib/typescript/shared/adapters/with-screen-transitions/options.d.ts.map +1 -0
- package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts +12 -0
- package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts.map +1 -0
- package/lib/typescript/shared/adapters/with-screen-transitions/types.d.ts +24 -0
- package/lib/typescript/shared/adapters/with-screen-transitions/types.d.ts.map +1 -0
- package/lib/typescript/shared/components/activity/helpers.d.ts +4 -0
- package/lib/typescript/shared/components/activity/helpers.d.ts.map +1 -0
- package/lib/typescript/shared/components/activity/index.d.ts +3 -0
- package/lib/typescript/shared/components/activity/index.d.ts.map +1 -0
- package/lib/typescript/shared/components/activity/variants/activity-container.d.ts +6 -0
- package/lib/typescript/shared/components/activity/variants/activity-container.d.ts.map +1 -0
- package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts +13 -0
- package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-measurer.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts +2 -2
- package/lib/typescript/shared/components/create-boundary-component/utils/measured-bounds.d.ts +1 -0
- package/lib/typescript/shared/components/create-boundary-component/utils/measured-bounds.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition-intent.d.ts +1 -2
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition-intent.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/navigation/use-navigation-helpers.d.ts +1 -0
- package/lib/typescript/shared/hooks/navigation/use-navigation-helpers.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +13 -1
- package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +15 -11
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts +11 -3
- package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/descriptors/index.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/descriptors/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/ownership/resolve-ownership.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/pan-lifecycle.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/pan-lifecycle.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/use-pan-behavior.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/pinch-lifecycle.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/pinch-lifecycle.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/use-pinch-behavior.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts +1 -2
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +3 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.d.ts.map +1 -1
- package/lib/typescript/shared/providers/stack/direct.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/build-managed-stack-state.d.ts +13 -0
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/build-managed-stack-state.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/derive-managed-stack-state.d.ts +12 -0
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/derive-managed-stack-state.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/helpers.d.ts +13 -0
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/helpers.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/reconcile-managed-routes.d.ts +12 -0
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/reconcile-managed-routes.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/types.d.ts +40 -0
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/helpers/types.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/index.d.ts +12 -0
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/index.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/managed-stack-controller.d.ts +13 -0
- package/lib/typescript/shared/providers/stack/helpers/managed-stack-state/managed-stack-controller.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/managed.provider.d.ts.map +1 -1
- package/lib/typescript/shared/types/bounds.types.d.ts +19 -0
- package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/index.d.ts +2 -2
- package/lib/typescript/shared/types/index.d.ts.map +1 -1
- package/lib/typescript/shared/types/providers/managed-stack.types.d.ts +3 -9
- package/lib/typescript/shared/types/providers/managed-stack.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/screen.types.d.ts +24 -0
- package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/stack.types.d.ts +7 -0
- package/lib/typescript/shared/types/stack.types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/reveal/build.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/reveal/config.d.ts +1 -0
- package/lib/typescript/shared/utils/bounds/navigation/reveal/config.d.ts.map +1 -1
- package/lib/typescript/shared/utils/create-provider.d.ts +17 -3
- package/lib/typescript/shared/utils/create-provider.d.ts.map +1 -1
- package/lib/typescript/shared/utils/navigation/resolve-scene-neighbors.d.ts +2 -1
- package/lib/typescript/shared/utils/navigation/resolve-scene-neighbors.d.ts.map +1 -1
- package/lib/typescript/shared/utils/navigation/sync-routes-with-removed.d.ts +2 -1
- package/lib/typescript/shared/utils/navigation/sync-routes-with-removed.d.ts.map +1 -1
- package/lib/typescript/shared/utils/visibility-block-offset.d.ts +2 -0
- package/lib/typescript/shared/utils/visibility-block-offset.d.ts.map +1 -0
- package/package.json +11 -1
- package/src/blank-stack/components/stack-view.tsx +54 -48
- package/src/blank-stack/index.ts +1 -0
- package/src/blank-stack/navigators/create-blank-stack-navigator.tsx +7 -15
- package/src/blank-stack/types.ts +44 -29
- package/src/component-stack/components/stack-view.tsx +4 -11
- package/src/component-stack/navigators/create-component-stack-navigator.tsx +1 -1
- package/src/native-stack/navigators/createNativeStackNavigator.tsx +5 -0
- package/src/native-stack/types.ts +25 -0
- package/src/shared/adapters/with-screen-transitions/context.tsx +42 -0
- package/src/shared/adapters/with-screen-transitions/index.tsx +150 -0
- package/src/shared/adapters/with-screen-transitions/options.ts +101 -0
- package/src/shared/adapters/with-screen-transitions/stack-layout.tsx +233 -0
- package/src/shared/adapters/with-screen-transitions/types.ts +28 -0
- package/src/shared/components/activity/helpers.ts +8 -0
- package/src/shared/components/activity/index.tsx +2 -0
- package/src/shared/components/activity/variants/activity-container.tsx +25 -0
- package/src/shared/components/activity/variants/activity-screen.tsx +133 -0
- package/src/shared/components/create-boundary-component/hooks/use-measurer.ts +23 -4
- package/src/shared/components/create-boundary-component/utils/measured-bounds.ts +15 -0
- package/src/shared/components/screen-lifecycle/hooks/use-close-transition-intent.ts +9 -26
- package/src/shared/components/screen-lifecycle/index.tsx +1 -1
- package/src/shared/hooks/navigation/use-navigation-helpers.ts +9 -3
- package/src/shared/hooks/navigation/use-stack.tsx +115 -6
- package/src/shared/index.ts +5 -0
- package/src/shared/providers/screen/descriptors/descriptors.provider.tsx +31 -31
- package/src/shared/providers/screen/descriptors/index.tsx +1 -0
- package/src/shared/providers/screen/gestures/ownership/resolve-ownership.ts +2 -1
- package/src/shared/providers/screen/gestures/ownership/use-walk-up-and-register-shadowing-claims.ts +2 -2
- package/src/shared/providers/screen/gestures/pan/pan-lifecycle.ts +7 -2
- package/src/shared/providers/screen/gestures/pan/use-pan-behavior.ts +10 -2
- package/src/shared/providers/screen/gestures/pinch/pinch-lifecycle.ts +7 -2
- package/src/shared/providers/screen/gestures/pinch/use-pinch-behavior.ts +8 -3
- package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/index.ts +12 -53
- package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +17 -1
- package/src/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.tsx +3 -16
- package/src/shared/providers/stack/direct.provider.tsx +13 -4
- package/src/shared/providers/stack/helpers/managed-stack-state/helpers/build-managed-stack-state.ts +365 -0
- package/src/shared/providers/stack/helpers/managed-stack-state/helpers/derive-managed-stack-state.ts +121 -0
- package/src/shared/providers/stack/helpers/managed-stack-state/helpers/helpers.ts +158 -0
- package/src/shared/providers/stack/helpers/managed-stack-state/helpers/reconcile-managed-routes.ts +188 -0
- package/src/shared/providers/stack/helpers/managed-stack-state/helpers/types.ts +57 -0
- package/src/shared/providers/stack/helpers/managed-stack-state/index.ts +40 -0
- package/src/shared/providers/stack/helpers/managed-stack-state/managed-stack-controller.ts +160 -0
- package/src/shared/providers/stack/managed.provider.tsx +23 -39
- package/src/shared/types/bounds.types.ts +19 -0
- package/src/shared/types/index.ts +3 -0
- package/src/shared/types/providers/managed-stack.types.ts +6 -8
- package/src/shared/types/screen.types.ts +25 -0
- package/src/shared/types/stack.types.ts +11 -0
- package/src/shared/utils/bounds/navigation/reveal/build.ts +10 -6
- package/src/shared/utils/bounds/navigation/reveal/config.ts +1 -0
- package/src/shared/utils/create-provider.tsx +183 -8
- package/src/shared/utils/navigation/resolve-scene-neighbors.ts +9 -4
- package/src/shared/utils/navigation/sync-routes-with-removed.ts +38 -7
- package/src/shared/utils/visibility-block-offset.ts +4 -0
- package/lib/commonjs/blank-stack/components/stack-view.native.js +0 -64
- package/lib/commonjs/blank-stack/components/stack-view.native.js.map +0 -1
- package/lib/commonjs/shared/components/native-screen-container.js +0 -42
- package/lib/commonjs/shared/components/native-screen-container.js.map +0 -1
- package/lib/commonjs/shared/components/native-screen.js +0 -125
- package/lib/commonjs/shared/components/native-screen.js.map +0 -1
- package/lib/commonjs/shared/providers/stack/helpers/use-local-routes/helpers/align-routes-with-latest.js +0 -51
- package/lib/commonjs/shared/providers/stack/helpers/use-local-routes/helpers/align-routes-with-latest.js.map +0 -1
- package/lib/commonjs/shared/providers/stack/helpers/use-local-routes/helpers/are-descriptors-equal.js +0 -15
- package/lib/commonjs/shared/providers/stack/helpers/use-local-routes/helpers/are-descriptors-equal.js.map +0 -1
- package/lib/commonjs/shared/providers/stack/helpers/use-local-routes/helpers/have-same-route-keys.js +0 -14
- package/lib/commonjs/shared/providers/stack/helpers/use-local-routes/helpers/have-same-route-keys.js.map +0 -1
- package/lib/commonjs/shared/providers/stack/helpers/use-local-routes/helpers/routes-are-identical.js +0 -13
- package/lib/commonjs/shared/providers/stack/helpers/use-local-routes/helpers/routes-are-identical.js.map +0 -1
- package/lib/commonjs/shared/providers/stack/helpers/use-local-routes/index.js +0 -101
- package/lib/commonjs/shared/providers/stack/helpers/use-local-routes/index.js.map +0 -1
- package/lib/module/blank-stack/components/stack-view.native.js +0 -60
- package/lib/module/blank-stack/components/stack-view.native.js.map +0 -1
- package/lib/module/shared/components/native-screen-container.js +0 -37
- package/lib/module/shared/components/native-screen-container.js.map +0 -1
- package/lib/module/shared/components/native-screen.js +0 -119
- package/lib/module/shared/components/native-screen.js.map +0 -1
- package/lib/module/shared/providers/stack/helpers/use-local-routes/helpers/align-routes-with-latest.js +0 -47
- package/lib/module/shared/providers/stack/helpers/use-local-routes/helpers/align-routes-with-latest.js.map +0 -1
- package/lib/module/shared/providers/stack/helpers/use-local-routes/helpers/are-descriptors-equal.js +0 -10
- package/lib/module/shared/providers/stack/helpers/use-local-routes/helpers/are-descriptors-equal.js.map +0 -1
- package/lib/module/shared/providers/stack/helpers/use-local-routes/helpers/have-same-route-keys.js +0 -9
- package/lib/module/shared/providers/stack/helpers/use-local-routes/helpers/have-same-route-keys.js.map +0 -1
- package/lib/module/shared/providers/stack/helpers/use-local-routes/helpers/routes-are-identical.js +0 -8
- package/lib/module/shared/providers/stack/helpers/use-local-routes/helpers/routes-are-identical.js.map +0 -1
- package/lib/module/shared/providers/stack/helpers/use-local-routes/index.js +0 -95
- package/lib/module/shared/providers/stack/helpers/use-local-routes/index.js.map +0 -1
- package/lib/typescript/blank-stack/components/stack-view.native.d.ts +0 -3
- package/lib/typescript/blank-stack/components/stack-view.native.d.ts.map +0 -1
- package/lib/typescript/shared/components/native-screen-container.d.ts +0 -6
- package/lib/typescript/shared/components/native-screen-container.d.ts.map +0 -1
- package/lib/typescript/shared/components/native-screen.d.ts +0 -12
- package/lib/typescript/shared/components/native-screen.d.ts.map +0 -1
- package/lib/typescript/shared/providers/stack/helpers/use-local-routes/helpers/align-routes-with-latest.d.ts +0 -10
- package/lib/typescript/shared/providers/stack/helpers/use-local-routes/helpers/align-routes-with-latest.d.ts.map +0 -1
- package/lib/typescript/shared/providers/stack/helpers/use-local-routes/helpers/are-descriptors-equal.d.ts +0 -2
- package/lib/typescript/shared/providers/stack/helpers/use-local-routes/helpers/are-descriptors-equal.d.ts.map +0 -1
- package/lib/typescript/shared/providers/stack/helpers/use-local-routes/helpers/have-same-route-keys.d.ts +0 -3
- package/lib/typescript/shared/providers/stack/helpers/use-local-routes/helpers/have-same-route-keys.d.ts.map +0 -1
- package/lib/typescript/shared/providers/stack/helpers/use-local-routes/helpers/routes-are-identical.d.ts +0 -3
- package/lib/typescript/shared/providers/stack/helpers/use-local-routes/helpers/routes-are-identical.d.ts.map +0 -1
- package/lib/typescript/shared/providers/stack/helpers/use-local-routes/index.d.ts +0 -19
- package/lib/typescript/shared/providers/stack/helpers/use-local-routes/index.d.ts.map +0 -1
- package/src/blank-stack/components/stack-view.native.tsx +0 -74
- package/src/shared/components/native-screen-container.tsx +0 -33
- package/src/shared/components/native-screen.tsx +0 -176
- package/src/shared/providers/stack/helpers/use-local-routes/helpers/align-routes-with-latest.ts +0 -65
- package/src/shared/providers/stack/helpers/use-local-routes/helpers/are-descriptors-equal.ts +0 -15
- package/src/shared/providers/stack/helpers/use-local-routes/helpers/have-same-route-keys.ts +0 -12
- package/src/shared/providers/stack/helpers/use-local-routes/helpers/routes-are-identical.ts +0 -11
- package/src/shared/providers/stack/helpers/use-local-routes/index.ts +0 -147
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-screen-transitions",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0-beta.0",
|
|
4
4
|
"description": "Easy screen transitions for React Native and Expo",
|
|
5
5
|
"author": "Ed",
|
|
6
6
|
"license": "MIT",
|
|
@@ -9,6 +9,16 @@
|
|
|
9
9
|
"url": "https://github.com/eds2002/react-native-screen-transitions.git",
|
|
10
10
|
"directory": "packages/react-native-screen-transitions"
|
|
11
11
|
},
|
|
12
|
+
"funding": [
|
|
13
|
+
{
|
|
14
|
+
"type": "github",
|
|
15
|
+
"url": "https://github.com/sponsors/eds2002"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"type": "individual",
|
|
19
|
+
"url": "https://buymeacoffee.com/trpfsu"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
12
22
|
"main": "lib/commonjs/shared/index.js",
|
|
13
23
|
"module": "lib/module/shared/index.js",
|
|
14
24
|
"types": "lib/typescript/shared/index.d.ts",
|
|
@@ -1,72 +1,78 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
NavigationContext,
|
|
3
|
+
NavigationRouteContext,
|
|
4
|
+
} from "@react-navigation/native";
|
|
5
|
+
import { Fragment, memo } from "react";
|
|
6
|
+
import {
|
|
7
|
+
ActivityContainer,
|
|
8
|
+
ActivityScreen,
|
|
9
|
+
} from "../../shared/components/activity";
|
|
4
10
|
import { Overlay } from "../../shared/components/overlay";
|
|
5
|
-
import { SceneView } from "../../shared/components/scene-view";
|
|
6
11
|
import { ScreenComposer } from "../../shared/providers/screen/screen-composer";
|
|
7
12
|
import { withStackCore } from "../../shared/providers/stack/core.provider";
|
|
8
13
|
import { withManagedStack } from "../../shared/providers/stack/managed.provider";
|
|
9
|
-
import {
|
|
10
|
-
import { isFabric } from "../../shared/utils/platform";
|
|
14
|
+
import type { BaseStackScene } from "../../shared/types/stack.types";
|
|
11
15
|
import type {
|
|
12
16
|
BlankStackDescriptor,
|
|
13
17
|
BlankStackNavigationHelpers,
|
|
14
18
|
} from "../types";
|
|
15
19
|
|
|
20
|
+
interface BlankSceneRowProps {
|
|
21
|
+
scene: BaseStackScene<BlankStackDescriptor>;
|
|
22
|
+
paintDriverRouteKey?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const BlankSceneRow = memo(function BlankSceneRow({
|
|
26
|
+
scene,
|
|
27
|
+
paintDriverRouteKey,
|
|
28
|
+
}: BlankSceneRowProps) {
|
|
29
|
+
const descriptor = scene.descriptor;
|
|
30
|
+
const route = scene.route;
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<NavigationContext.Provider value={descriptor.navigation}>
|
|
34
|
+
<NavigationRouteContext.Provider value={route}>
|
|
35
|
+
<ActivityScreen
|
|
36
|
+
activity={descriptor.activity}
|
|
37
|
+
inactiveBehavior={descriptor.options.inactiveBehavior}
|
|
38
|
+
paintDriverRouteKey={paintDriverRouteKey}
|
|
39
|
+
hasNestedState={"state" in route}
|
|
40
|
+
>
|
|
41
|
+
<ScreenComposer
|
|
42
|
+
previous={scene.previousDescriptor}
|
|
43
|
+
current={descriptor}
|
|
44
|
+
next={scene.nextDescriptor}
|
|
45
|
+
>
|
|
46
|
+
{descriptor.render?.()}
|
|
47
|
+
</ScreenComposer>
|
|
48
|
+
</ActivityScreen>
|
|
49
|
+
</NavigationRouteContext.Provider>
|
|
50
|
+
</NavigationContext.Provider>
|
|
51
|
+
);
|
|
52
|
+
});
|
|
53
|
+
|
|
16
54
|
export const StackView = withStackCore(
|
|
17
|
-
{ TRANSITIONS_ALWAYS_ON: true, DISABLE_NATIVE_SCREENS:
|
|
55
|
+
{ TRANSITIONS_ALWAYS_ON: true, DISABLE_NATIVE_SCREENS: false },
|
|
18
56
|
withManagedStack<BlankStackDescriptor, BlankStackNavigationHelpers>(
|
|
19
|
-
({
|
|
20
|
-
descriptors,
|
|
21
|
-
focusedIndex,
|
|
22
|
-
scenes,
|
|
23
|
-
shouldShowFloatOverlay,
|
|
24
|
-
closingRouteMap,
|
|
25
|
-
}) => {
|
|
26
|
-
const isRouteClosing = (routeKey: string) =>
|
|
27
|
-
Boolean(closingRouteMap.current[routeKey]);
|
|
28
|
-
|
|
57
|
+
({ scenes, shouldShowFloatOverlay }) => {
|
|
29
58
|
return (
|
|
30
59
|
<Fragment>
|
|
31
60
|
{shouldShowFloatOverlay ? <Overlay.Float /> : null}
|
|
32
61
|
|
|
33
|
-
<
|
|
34
|
-
{scenes.map((scene,
|
|
35
|
-
const descriptor = scene.descriptor;
|
|
62
|
+
<ActivityContainer>
|
|
63
|
+
{scenes.map((scene, index) => {
|
|
36
64
|
const route = scene.route;
|
|
37
|
-
const
|
|
38
|
-
const isBelowFocused = focusedIndex - 1 === sceneIndex;
|
|
39
|
-
|
|
40
|
-
const { previousDescriptor, nextDescriptor } =
|
|
41
|
-
resolveSceneNeighbors(scenes, sceneIndex, isRouteClosing);
|
|
42
|
-
|
|
43
|
-
const isPreloaded = descriptors[route.key] === undefined;
|
|
65
|
+
const paintDriverRouteKey = scenes[index + 2]?.route.key;
|
|
44
66
|
|
|
45
|
-
// On Fabric, when screen is frozen, animated and reanimated values are not updated
|
|
46
|
-
// due to component being unmounted. To avoid this, we don't freeze the previous screen there
|
|
47
|
-
const shouldFreeze = isFabric()
|
|
48
|
-
? !isPreloaded && !isFocused && !isBelowFocused
|
|
49
|
-
: !isPreloaded && !isFocused;
|
|
50
67
|
return (
|
|
51
|
-
<
|
|
68
|
+
<BlankSceneRow
|
|
52
69
|
key={route.key}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
shouldFreeze={shouldFreeze}
|
|
57
|
-
freezeOnBlur={descriptor.options.freezeOnBlur}
|
|
58
|
-
>
|
|
59
|
-
<ScreenComposer
|
|
60
|
-
previous={previousDescriptor}
|
|
61
|
-
current={descriptor}
|
|
62
|
-
next={nextDescriptor}
|
|
63
|
-
>
|
|
64
|
-
<SceneView key={route.key} descriptor={descriptor} />
|
|
65
|
-
</ScreenComposer>
|
|
66
|
-
</NativeScreen>
|
|
70
|
+
scene={scene}
|
|
71
|
+
paintDriverRouteKey={paintDriverRouteKey}
|
|
72
|
+
/>
|
|
67
73
|
);
|
|
68
74
|
})}
|
|
69
|
-
</
|
|
75
|
+
</ActivityContainer>
|
|
70
76
|
</Fragment>
|
|
71
77
|
);
|
|
72
78
|
},
|
package/src/blank-stack/index.ts
CHANGED
|
@@ -28,7 +28,6 @@ type BlankStackNavigatorInnerProps = Omit<
|
|
|
28
28
|
keyof BlankStackFactoryOptions
|
|
29
29
|
> & {
|
|
30
30
|
DISABLE_NATIVE_SCREENS?: boolean;
|
|
31
|
-
DISABLE_NATIVE_SCREEN_CONTAINER?: boolean;
|
|
32
31
|
};
|
|
33
32
|
|
|
34
33
|
const BlankStackContext = React.createContext<boolean>(false);
|
|
@@ -42,8 +41,6 @@ function BlankStackNavigatorInner({
|
|
|
42
41
|
screenListeners,
|
|
43
42
|
screenOptions,
|
|
44
43
|
screenLayout,
|
|
45
|
-
DISABLE_NATIVE_SCREENS,
|
|
46
|
-
DISABLE_NATIVE_SCREEN_CONTAINER,
|
|
47
44
|
...rest
|
|
48
45
|
}: BlankStackNavigatorInnerProps) {
|
|
49
46
|
const { state, describe, descriptors, navigation, NavigationContent } =
|
|
@@ -69,8 +66,6 @@ function BlankStackNavigatorInner({
|
|
|
69
66
|
<NavigationContent>
|
|
70
67
|
<StackView
|
|
71
68
|
{...rest}
|
|
72
|
-
DISABLE_NATIVE_SCREENS={DISABLE_NATIVE_SCREENS}
|
|
73
|
-
DISABLE_NATIVE_SCREEN_CONTAINER={DISABLE_NATIVE_SCREEN_CONTAINER}
|
|
74
69
|
state={state}
|
|
75
70
|
navigation={navigation}
|
|
76
71
|
descriptors={descriptors}
|
|
@@ -81,19 +76,18 @@ function BlankStackNavigatorInner({
|
|
|
81
76
|
}
|
|
82
77
|
|
|
83
78
|
function BlankStackNavigator({
|
|
79
|
+
enableNativeScreens,
|
|
84
80
|
independent = false,
|
|
85
|
-
|
|
81
|
+
nativeScreens,
|
|
86
82
|
...rest
|
|
87
83
|
}: BlankStackNavigatorProps) {
|
|
88
84
|
const isNested = React.useContext(BlankStackContext);
|
|
85
|
+
const nativeScreensEnabled = nativeScreens ?? enableNativeScreens ?? true;
|
|
89
86
|
|
|
90
87
|
const navigator = (
|
|
91
88
|
<BlankStackNavigatorInner
|
|
92
89
|
{...rest}
|
|
93
|
-
{
|
|
94
|
-
DISABLE_NATIVE_SCREENS: true,
|
|
95
|
-
})}
|
|
96
|
-
DISABLE_NATIVE_SCREEN_CONTAINER={independent}
|
|
90
|
+
DISABLE_NATIVE_SCREENS={!nativeScreensEnabled}
|
|
97
91
|
/>
|
|
98
92
|
);
|
|
99
93
|
|
|
@@ -137,14 +131,12 @@ type BlankStackTypeBag<
|
|
|
137
131
|
* Creates a blank stack navigator with gesture-driven transitions.
|
|
138
132
|
*
|
|
139
133
|
* By default, blank stack behaves like the existing top-level blank stack:
|
|
140
|
-
* it participates in the current navigation tree and
|
|
141
|
-
*
|
|
134
|
+
* it participates in the current navigation tree and renders screens with
|
|
135
|
+
* react-native-screens.
|
|
142
136
|
*
|
|
143
137
|
* Blank stack also accepts navigator-specific props for embedded-flow behavior:
|
|
138
|
+
* - `nativeScreens: false` renders blank-stack screens as regular React Native views
|
|
144
139
|
* - `independent: true` creates an isolated navigator for nested flows
|
|
145
|
-
* - `enableNativeScreens: false` renders the stack with regular views instead
|
|
146
|
-
* of `react-native-screens`
|
|
147
|
-
*
|
|
148
140
|
* In the dynamic API, pass these to `<Stack.Navigator />`.
|
|
149
141
|
* In the static API, pass them in the same config object as `screens`.
|
|
150
142
|
*/
|
package/src/blank-stack/types.ts
CHANGED
|
@@ -10,8 +10,11 @@ import type {
|
|
|
10
10
|
StackRouterOptions,
|
|
11
11
|
Theme,
|
|
12
12
|
} from "@react-navigation/native";
|
|
13
|
-
import type { ScreenTransitionConfig } from "../shared";
|
|
13
|
+
import type { InactiveBehavior, ScreenTransitionConfig } from "../shared";
|
|
14
14
|
import type { OverlayProps } from "../shared/types/overlay.types";
|
|
15
|
+
import type { StackSceneActivity } from "../shared/types/stack.types";
|
|
16
|
+
|
|
17
|
+
export type { InactiveBehavior } from "../shared";
|
|
15
18
|
|
|
16
19
|
export type BlankStackNavigationEventMap = {};
|
|
17
20
|
|
|
@@ -60,6 +63,24 @@ export type BlankStackNavigationHelpers = NavigationHelpers<
|
|
|
60
63
|
* The exported name is kept for backward compatibility.
|
|
61
64
|
*/
|
|
62
65
|
export interface BlankStackFactoryOptions {
|
|
66
|
+
/**
|
|
67
|
+
* Controls whether blank-stack screens are rendered with react-native-screens.
|
|
68
|
+
*
|
|
69
|
+
* When enabled, inactive presentation state is backed by
|
|
70
|
+
* `ScreenContainer`/`Screen.activityState`. Set this to `false` to render
|
|
71
|
+
* screens as regular React Native views.
|
|
72
|
+
*
|
|
73
|
+
* @default true
|
|
74
|
+
*/
|
|
75
|
+
nativeScreens?: boolean;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Enables react-native-screens for blank-stack screen retention.
|
|
79
|
+
*
|
|
80
|
+
* @deprecated Use `nativeScreens` instead.
|
|
81
|
+
*/
|
|
82
|
+
enableNativeScreens?: boolean;
|
|
83
|
+
|
|
63
84
|
/**
|
|
64
85
|
* Creates an isolated navigation tree for embedded flows.
|
|
65
86
|
*
|
|
@@ -68,22 +89,10 @@ export interface BlankStackFactoryOptions {
|
|
|
68
89
|
*
|
|
69
90
|
* When enabled, the navigator:
|
|
70
91
|
* - wraps itself in `NavigationIndependentTree` + `NavigationContainer`
|
|
71
|
-
* - skips the shared native `ScreenContainer`
|
|
72
92
|
*
|
|
73
93
|
* Leave this disabled for normal top-level app stacks.
|
|
74
94
|
*/
|
|
75
95
|
independent?: boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Enables native screen primitives on supported native platforms.
|
|
78
|
-
*
|
|
79
|
-
* Use this when you want the embedded blank stack to keep `react-native-screens`
|
|
80
|
-
* behavior such as native activity state and freezing.
|
|
81
|
-
*
|
|
82
|
-
* Set this to `false` when you want the blank stack to render with regular
|
|
83
|
-
* views instead of native screen primitives. This is useful for embedded
|
|
84
|
-
* flows where plain views are a better fit than native screen layering.
|
|
85
|
-
*/
|
|
86
|
-
enableNativeScreens?: boolean;
|
|
87
96
|
}
|
|
88
97
|
|
|
89
98
|
/**
|
|
@@ -94,24 +103,28 @@ export type BlankStackOverlayProps = OverlayProps<
|
|
|
94
103
|
BlankStackNavigationProp<ParamListBase>
|
|
95
104
|
>;
|
|
96
105
|
|
|
97
|
-
type
|
|
98
|
-
/**
|
|
99
|
-
* Whether to detach the previous screen from the view hierarchy to save memory.
|
|
100
|
-
* Set it to `false` if you need the previous screen to be seen through the active screen.
|
|
101
|
-
* Only applicable if `detachInactiveScreens` isn't set to `false`.
|
|
102
|
-
*/
|
|
103
|
-
detachPreviousScreen?: boolean;
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
export type BlankStackNavigationOptions = BlankStackScreenTransitionConfig & {
|
|
106
|
+
export type BlankStackNavigationOptions = ScreenTransitionConfig & {
|
|
107
107
|
/**
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
108
|
+
* Controls how inactive blank-stack screens are retained after they are no
|
|
109
|
+
* longer active.
|
|
110
|
+
*
|
|
111
|
+
* For a stack shaped as A(inactive), B(inert), C(active):
|
|
112
|
+
*
|
|
113
|
+
* - `keep`: keeps A mounted, attached, visible, and non-interactive.
|
|
114
|
+
* - `freeze`: keeps A's last painted UI visible and asks the platform to
|
|
115
|
+
* stop or suspend inactive work where possible.
|
|
116
|
+
* - `detach`: removes A from native/view presentation after the screen that
|
|
117
|
+
* exposes it has safely painted.
|
|
118
|
+
* - `unmount`: removes A's React subtree after safe paint when the route has
|
|
119
|
+
* no nested navigation state.
|
|
111
120
|
*
|
|
112
|
-
*
|
|
121
|
+
* On web, or when native screens are disabled, `keep`, `freeze`, and
|
|
122
|
+
* `detach` currently have no meaningful retention effect. This will change
|
|
123
|
+
* once the implementation can use React 19.2's Activity component.
|
|
124
|
+
*
|
|
125
|
+
* @default "detach" on native, "unmount" on web
|
|
113
126
|
*/
|
|
114
|
-
|
|
127
|
+
inactiveBehavior?: InactiveBehavior;
|
|
115
128
|
};
|
|
116
129
|
|
|
117
130
|
export type BlankStackNavigatorProps = DefaultNavigatorOptions<
|
|
@@ -129,4 +142,6 @@ export type BlankStackDescriptor = Descriptor<
|
|
|
129
142
|
BlankStackNavigationOptions,
|
|
130
143
|
BlankStackNavigationProp<ParamListBase>,
|
|
131
144
|
RouteProp<ParamListBase>
|
|
132
|
-
|
|
145
|
+
> & {
|
|
146
|
+
activity: StackSceneActivity;
|
|
147
|
+
};
|
|
@@ -5,7 +5,6 @@ import { ScreenComposer } from "../../shared/providers/screen/screen-composer";
|
|
|
5
5
|
import { withStackCore } from "../../shared/providers/stack/core.provider";
|
|
6
6
|
import { withManagedStack } from "../../shared/providers/stack/managed.provider";
|
|
7
7
|
import { StackType } from "../../shared/types/stack.types";
|
|
8
|
-
import { resolveSceneNeighbors } from "../../shared/utils/navigation/resolve-scene-neighbors";
|
|
9
8
|
import type {
|
|
10
9
|
ComponentStackDescriptor,
|
|
11
10
|
ComponentStackNavigationHelpers,
|
|
@@ -15,27 +14,21 @@ import { ComponentScreen } from "./component-screen";
|
|
|
15
14
|
export const StackView = withStackCore(
|
|
16
15
|
{ TRANSITIONS_ALWAYS_ON: true, STACK_TYPE: StackType.COMPONENT },
|
|
17
16
|
withManagedStack<ComponentStackDescriptor, ComponentStackNavigationHelpers>(
|
|
18
|
-
({ scenes, shouldShowFloatOverlay
|
|
19
|
-
const isRouteClosing = (routeKey: string) =>
|
|
20
|
-
Boolean(closingRouteMap.current[routeKey]);
|
|
21
|
-
|
|
17
|
+
({ scenes, shouldShowFloatOverlay }) => {
|
|
22
18
|
return (
|
|
23
19
|
<Fragment>
|
|
24
20
|
{shouldShowFloatOverlay ? <Overlay.Float /> : null}
|
|
25
21
|
|
|
26
|
-
{scenes.map((scene
|
|
22
|
+
{scenes.map((scene) => {
|
|
27
23
|
const descriptor = scene.descriptor;
|
|
28
24
|
const route = scene.route;
|
|
29
25
|
|
|
30
|
-
const { previousDescriptor, nextDescriptor } =
|
|
31
|
-
resolveSceneNeighbors(scenes, sceneIndex, isRouteClosing);
|
|
32
|
-
|
|
33
26
|
return (
|
|
34
27
|
<ComponentScreen key={route.key} routeKey={route.key}>
|
|
35
28
|
<ScreenComposer
|
|
36
|
-
previous={previousDescriptor}
|
|
29
|
+
previous={scene.previousDescriptor}
|
|
37
30
|
current={descriptor}
|
|
38
|
-
next={nextDescriptor}
|
|
31
|
+
next={scene.nextDescriptor}
|
|
39
32
|
>
|
|
40
33
|
<SceneView key={route.key} descriptor={descriptor} />
|
|
41
34
|
</ScreenComposer>
|
|
@@ -99,7 +99,7 @@ function IsolatedComponentStackNavigator(props: ComponentStackNavigatorProps) {
|
|
|
99
99
|
* @deprecated Component stack was originally introduced for independent,
|
|
100
100
|
* embedded navigation flows. Blank stack now supports that use case directly
|
|
101
101
|
* via navigator props such as `<BlankStack.Navigator independent />`, with
|
|
102
|
-
* `
|
|
102
|
+
* `nativeScreens` available when you need to switch between native
|
|
103
103
|
* screens and regular views. Prefer blank stack for new work; component stack
|
|
104
104
|
* will be removed in a future release.
|
|
105
105
|
*/
|
|
@@ -62,6 +62,11 @@ function NativeStackNavigator({
|
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated The bundled native-stack integration is deprecated and will be removed in a future major release.
|
|
67
|
+
* Use `@react-navigation/native-stack` or Expo Router's native stack with
|
|
68
|
+
* `withScreenTransitions` from `react-native-screen-transitions` instead.
|
|
69
|
+
*/
|
|
65
70
|
export function createNativeStackNavigator<
|
|
66
71
|
const ParamList extends ParamListBase,
|
|
67
72
|
const NavigatorID extends string | undefined = undefined,
|
|
@@ -50,6 +50,11 @@ export type NativeStackNavigationEventMap = {
|
|
|
50
50
|
sheetDetentChange: { data: { index: number; stable: boolean } };
|
|
51
51
|
};
|
|
52
52
|
|
|
53
|
+
/**
|
|
54
|
+
* @deprecated The bundled native-stack integration is deprecated and will be removed in a future major release.
|
|
55
|
+
* Use `@react-navigation/native-stack` or Expo Router's native stack with
|
|
56
|
+
* `withScreenTransitions` from `react-native-screen-transitions` instead.
|
|
57
|
+
*/
|
|
53
58
|
export type NativeStackNavigationProp<
|
|
54
59
|
ParamList extends ParamListBase,
|
|
55
60
|
RouteName extends keyof ParamList = string,
|
|
@@ -64,6 +69,11 @@ export type NativeStackNavigationProp<
|
|
|
64
69
|
> &
|
|
65
70
|
StackActionHelpers<ParamList>;
|
|
66
71
|
|
|
72
|
+
/**
|
|
73
|
+
* @deprecated The bundled native-stack integration is deprecated and will be removed in a future major release.
|
|
74
|
+
* Use `@react-navigation/native-stack` or Expo Router's native stack with
|
|
75
|
+
* `withScreenTransitions` from `react-native-screen-transitions` instead.
|
|
76
|
+
*/
|
|
67
77
|
export type NativeStackScreenProps<
|
|
68
78
|
ParamList extends ParamListBase,
|
|
69
79
|
RouteName extends keyof ParamList = string,
|
|
@@ -148,6 +158,11 @@ export type NativeStackOverlayProps = OverlayProps<
|
|
|
148
158
|
NativeStackNavigationProp<ParamListBase>
|
|
149
159
|
>;
|
|
150
160
|
|
|
161
|
+
/**
|
|
162
|
+
* @deprecated The bundled native-stack integration is deprecated and will be removed in a future major release.
|
|
163
|
+
* Use `NativeStackAdapterOptions` with `withScreenTransitions` from
|
|
164
|
+
* `react-native-screen-transitions` instead.
|
|
165
|
+
*/
|
|
151
166
|
export type NativeStackScreenTransitionConfig = ScreenTransitionConfig & {
|
|
152
167
|
/**
|
|
153
168
|
* Whether to enable transitions. It sets the presentation to containedTransparentModal, animation none, and headerShown to false.
|
|
@@ -155,6 +170,11 @@ export type NativeStackScreenTransitionConfig = ScreenTransitionConfig & {
|
|
|
155
170
|
enableTransitions?: boolean;
|
|
156
171
|
};
|
|
157
172
|
|
|
173
|
+
/**
|
|
174
|
+
* @deprecated The bundled native-stack integration is deprecated and will be removed in a future major release.
|
|
175
|
+
* Use `NativeStackAdapterOptions<NativeStackNavigationOptions>` with
|
|
176
|
+
* `@react-navigation/native-stack` and `withScreenTransitions` instead.
|
|
177
|
+
*/
|
|
158
178
|
export type NativeStackNavigationOptions = NativeStackScreenTransitionConfig & {
|
|
159
179
|
/**
|
|
160
180
|
* String that can be displayed in the header as a fallback for `headerTitle`.
|
|
@@ -701,6 +721,11 @@ export type NativeStackNavigationOptions = NativeStackScreenTransitionConfig & {
|
|
|
701
721
|
unstable_sheetFooter?: () => React.ReactNode;
|
|
702
722
|
};
|
|
703
723
|
|
|
724
|
+
/**
|
|
725
|
+
* @deprecated The bundled native-stack integration is deprecated and will be removed in a future major release.
|
|
726
|
+
* Use `@react-navigation/native-stack` or Expo Router's native stack with
|
|
727
|
+
* `withScreenTransitions` from `react-native-screen-transitions` instead.
|
|
728
|
+
*/
|
|
704
729
|
export type NativeStackNavigatorProps = DefaultNavigatorOptions<
|
|
705
730
|
ParamListBase,
|
|
706
731
|
string | undefined,
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
import type { BaseStackDescriptor, BaseStackScene } from "../../types";
|
|
3
|
+
|
|
4
|
+
export type ScreenTransitionsAdapterScene =
|
|
5
|
+
BaseStackScene<BaseStackDescriptor> & {
|
|
6
|
+
previousDescriptor?: BaseStackDescriptor;
|
|
7
|
+
nextDescriptor?: BaseStackDescriptor;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export interface ScreenTransitionsAdapterContextValue {
|
|
11
|
+
routeIndexByKey: ReadonlyMap<string, number>;
|
|
12
|
+
scenes: ScreenTransitionsAdapterScene[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const ScreenTransitionsAdapterContext =
|
|
16
|
+
createContext<ScreenTransitionsAdapterContextValue | null>(null);
|
|
17
|
+
|
|
18
|
+
ScreenTransitionsAdapterContext.displayName = "ScreenTransitionsAdapter";
|
|
19
|
+
|
|
20
|
+
export function ScreenTransitionsAdapterProvider({
|
|
21
|
+
children,
|
|
22
|
+
value,
|
|
23
|
+
}: {
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
value: ScreenTransitionsAdapterContextValue;
|
|
26
|
+
}) {
|
|
27
|
+
return (
|
|
28
|
+
<ScreenTransitionsAdapterContext.Provider value={value}>
|
|
29
|
+
{children}
|
|
30
|
+
</ScreenTransitionsAdapterContext.Provider>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function useScreenTransitionsAdapterContext() {
|
|
35
|
+
const context = useContext(ScreenTransitionsAdapterContext);
|
|
36
|
+
if (!context) {
|
|
37
|
+
throw new Error(
|
|
38
|
+
"useScreenTransitionsAdapterContext must be used within withScreenTransitions",
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
return context;
|
|
42
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
NavigatorTypeBagBase,
|
|
3
|
+
TypedNavigator,
|
|
4
|
+
} from "@react-navigation/native";
|
|
5
|
+
import type { ComponentType, ReactNode } from "react";
|
|
6
|
+
import {
|
|
7
|
+
Children,
|
|
8
|
+
cloneElement,
|
|
9
|
+
forwardRef,
|
|
10
|
+
isValidElement,
|
|
11
|
+
useCallback,
|
|
12
|
+
useMemo,
|
|
13
|
+
} from "react";
|
|
14
|
+
import type {
|
|
15
|
+
NativeStackAdapterOptionInput,
|
|
16
|
+
NativeStackAdapterOptions,
|
|
17
|
+
} from "./options";
|
|
18
|
+
import { adaptNativeStackTransitionOptions } from "./options";
|
|
19
|
+
import {
|
|
20
|
+
ScreenTransitionsScreenLayout,
|
|
21
|
+
ScreenTransitionsStackLayout,
|
|
22
|
+
} from "./stack-layout";
|
|
23
|
+
import type {
|
|
24
|
+
NavigatorLayout,
|
|
25
|
+
NavigatorLayoutArgs,
|
|
26
|
+
NavigatorWithScreenTransitions,
|
|
27
|
+
ScreenLayout,
|
|
28
|
+
ScreenLayoutArgs,
|
|
29
|
+
} from "./types";
|
|
30
|
+
|
|
31
|
+
export type { NativeStackAdapterOptions } from "./options";
|
|
32
|
+
|
|
33
|
+
type ScreenTransitionsNavigatorProps = {
|
|
34
|
+
layout?: NavigatorLayout;
|
|
35
|
+
screenLayout?: ScreenLayout;
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
type ScreenTransitionsNavigatorTypeBag<TBag extends NavigatorTypeBagBase> =
|
|
40
|
+
Omit<TBag, "ScreenOptions"> & {
|
|
41
|
+
ScreenOptions: NativeStackAdapterOptions<TBag["ScreenOptions"]>;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
function adaptNavigatorChildren(children: ReactNode): ReactNode {
|
|
45
|
+
return Children.map(children, (child) => {
|
|
46
|
+
if (!isValidElement(child)) {
|
|
47
|
+
return child;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const props = child.props as Record<string, unknown>;
|
|
51
|
+
const nextProps: Record<string, unknown> = {};
|
|
52
|
+
let changed = false;
|
|
53
|
+
|
|
54
|
+
if ("options" in props) {
|
|
55
|
+
nextProps.options = adaptNativeStackTransitionOptions(
|
|
56
|
+
props.options as NativeStackAdapterOptionInput | undefined,
|
|
57
|
+
);
|
|
58
|
+
changed = true;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if ("screenOptions" in props) {
|
|
62
|
+
nextProps.screenOptions = adaptNativeStackTransitionOptions(
|
|
63
|
+
props.screenOptions as NativeStackAdapterOptionInput | undefined,
|
|
64
|
+
);
|
|
65
|
+
changed = true;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (props.children !== undefined && typeof props.children !== "function") {
|
|
69
|
+
nextProps.children = adaptNavigatorChildren(props.children as ReactNode);
|
|
70
|
+
changed = true;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (!changed) {
|
|
74
|
+
return child;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return cloneElement(child, nextProps);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function withScreenTransitions<
|
|
82
|
+
TBag extends NavigatorTypeBagBase,
|
|
83
|
+
TConfig,
|
|
84
|
+
>(
|
|
85
|
+
navigator: TypedNavigator<TBag, TConfig>,
|
|
86
|
+
): TypedNavigator<ScreenTransitionsNavigatorTypeBag<TBag>, TConfig>;
|
|
87
|
+
export function withScreenTransitions<
|
|
88
|
+
TNavigator extends NavigatorWithScreenTransitions,
|
|
89
|
+
>(navigator: TNavigator): TNavigator;
|
|
90
|
+
export function withScreenTransitions(
|
|
91
|
+
navigator: NavigatorWithScreenTransitions,
|
|
92
|
+
): any {
|
|
93
|
+
const BaseNavigator = navigator.Navigator as ComponentType<any>;
|
|
94
|
+
|
|
95
|
+
const Navigator = forwardRef<unknown, ScreenTransitionsNavigatorProps>(
|
|
96
|
+
function ScreenTransitionsNavigator(
|
|
97
|
+
{ layout, screenLayout, ...props },
|
|
98
|
+
ref,
|
|
99
|
+
) {
|
|
100
|
+
const transitionLayout = useCallback(
|
|
101
|
+
(layoutArgs: NavigatorLayoutArgs) => (
|
|
102
|
+
<ScreenTransitionsStackLayout
|
|
103
|
+
layout={layout}
|
|
104
|
+
layoutArgs={layoutArgs}
|
|
105
|
+
/>
|
|
106
|
+
),
|
|
107
|
+
[layout],
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
const transitionScreenLayout = useCallback(
|
|
111
|
+
(screenLayoutArgs: ScreenLayoutArgs) => (
|
|
112
|
+
<ScreenTransitionsScreenLayout
|
|
113
|
+
screenLayout={screenLayout}
|
|
114
|
+
screenLayoutArgs={screenLayoutArgs}
|
|
115
|
+
/>
|
|
116
|
+
),
|
|
117
|
+
[screenLayout],
|
|
118
|
+
);
|
|
119
|
+
const screenOptions = useMemo(
|
|
120
|
+
() => adaptNativeStackTransitionOptions(props.screenOptions),
|
|
121
|
+
[props.screenOptions],
|
|
122
|
+
);
|
|
123
|
+
const children = useMemo(
|
|
124
|
+
() => adaptNavigatorChildren(props.children),
|
|
125
|
+
[props.children],
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
return (
|
|
129
|
+
<BaseNavigator
|
|
130
|
+
{...props}
|
|
131
|
+
screenOptions={screenOptions}
|
|
132
|
+
ref={ref as never}
|
|
133
|
+
layout={transitionLayout}
|
|
134
|
+
screenLayout={transitionScreenLayout}
|
|
135
|
+
>
|
|
136
|
+
{children}
|
|
137
|
+
</BaseNavigator>
|
|
138
|
+
);
|
|
139
|
+
},
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
Navigator.displayName = `withScreenTransitions(${
|
|
143
|
+
BaseNavigator.displayName ?? BaseNavigator.name ?? "Navigator"
|
|
144
|
+
})`;
|
|
145
|
+
|
|
146
|
+
return {
|
|
147
|
+
...navigator,
|
|
148
|
+
Navigator,
|
|
149
|
+
};
|
|
150
|
+
}
|