react-native-screen-transitions 4.0.0-alpha.8 → 4.0.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 +6 -11
- package/lib/commonjs/components/boundary/create-boundary-component.js +5 -1
- package/lib/commonjs/components/boundary/create-boundary-component.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js +53 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +43 -8
- package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +2 -3
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/teleport.js +1 -13
- package/lib/commonjs/components/boundary/portal/teleport.js.map +1 -1
- package/lib/commonjs/components/boundary/utils/source-signals.js +6 -4
- package/lib/commonjs/components/boundary/utils/source-signals.js.map +1 -1
- package/lib/commonjs/components/overlay/helpers/get-active-overlay.js +3 -24
- package/lib/commonjs/components/overlay/helpers/get-active-overlay.js.map +1 -1
- package/lib/commonjs/components/overlay/helpers/retain-ready-overlay-resources.js +4 -3
- package/lib/commonjs/components/overlay/helpers/retain-ready-overlay-resources.js.map +1 -1
- package/lib/commonjs/components/overlay/hooks/use-overlay-slot.js +1 -2
- package/lib/commonjs/components/overlay/hooks/use-overlay-slot.js.map +1 -1
- package/lib/commonjs/components/overlay/variations/float-overlay.js +0 -2
- package/lib/commonjs/components/overlay/variations/float-overlay.js.map +1 -1
- package/lib/commonjs/components/overlay/variations/overlay-host.js +18 -15
- package/lib/commonjs/components/overlay/variations/overlay-host.js.map +1 -1
- package/lib/commonjs/components/screen-container/layers/content.js +10 -5
- package/lib/commonjs/components/screen-container/layers/content.js.map +1 -1
- package/lib/commonjs/components/screen-container/layers/surface.js +50 -0
- package/lib/commonjs/components/screen-container/layers/surface.js.map +1 -0
- package/lib/commonjs/components/stack-view.js +7 -29
- package/lib/commonjs/components/stack-view.js.map +1 -1
- package/lib/commonjs/configs/index.js +1 -4
- package/lib/commonjs/configs/index.js.map +1 -1
- package/lib/commonjs/configs/presets.js +1 -384
- package/lib/commonjs/configs/presets.js.map +1 -1
- package/lib/commonjs/constants.js +2 -1
- package/lib/commonjs/constants.js.map +1 -1
- package/lib/commonjs/navigators/create-blank-stack-navigator.js +7 -67
- package/lib/commonjs/navigators/create-blank-stack-navigator.js.map +1 -1
- package/lib/commonjs/navigators/expo-router/index.js +1 -18
- package/lib/commonjs/navigators/expo-router/index.js.map +1 -1
- package/lib/commonjs/navigators/react-navigation/index.js +1 -3
- package/lib/commonjs/navigators/react-navigation/index.js.map +1 -1
- package/lib/commonjs/providers/screen/animation/animation.provider.js +6 -1
- package/lib/commonjs/providers/screen/animation/animation.provider.js.map +1 -1
- package/lib/commonjs/providers/screen/animation/helpers/build-screen-transition-options.js +1 -0
- package/lib/commonjs/providers/screen/animation/helpers/build-screen-transition-options.js.map +1 -1
- package/lib/commonjs/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.js +20 -5
- package/lib/commonjs/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.js.map +1 -1
- package/lib/commonjs/providers/screen/animation/helpers/hydrate-transition-state/index.js +16 -1
- package/lib/commonjs/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
- package/lib/commonjs/providers/screen/animation/helpers/selected-interpolator-options.js +1 -1
- package/lib/commonjs/providers/screen/animation/helpers/selected-interpolator-options.js.map +1 -1
- package/lib/commonjs/providers/screen/animation/use-screen-animation.js +1 -8
- package/lib/commonjs/providers/screen/animation/use-screen-animation.js.map +1 -1
- package/lib/commonjs/providers/screen/gestures/pan/behavior/pan-release.js +28 -6
- package/lib/commonjs/providers/screen/gestures/pan/behavior/pan-release.js.map +1 -1
- package/lib/commonjs/providers/screen/gestures/pinch/behavior/pinch-release.js +26 -6
- package/lib/commonjs/providers/screen/gestures/pinch/behavior/pinch-release.js.map +1 -1
- package/lib/commonjs/providers/screen/gestures/shared/policy.js +1 -0
- package/lib/commonjs/providers/screen/gestures/shared/policy.js.map +1 -1
- package/lib/commonjs/providers/screen/gestures/shared/snap-points.js +71 -1
- package/lib/commonjs/providers/screen/gestures/shared/snap-points.js.map +1 -1
- package/lib/commonjs/providers/screen/options/helpers.js +8 -1
- package/lib/commonjs/providers/screen/options/helpers.js.map +1 -1
- package/lib/commonjs/providers/screen/styles/constants.js +4 -1
- package/lib/commonjs/providers/screen/styles/constants.js.map +1 -1
- package/lib/commonjs/providers/screen/styles/hooks/slot-resolvers.js +1 -9
- package/lib/commonjs/providers/screen/styles/hooks/slot-resolvers.js.map +1 -1
- package/lib/commonjs/providers/screen/styles/slot.provider.js +3 -1
- package/lib/commonjs/providers/screen/styles/slot.provider.js.map +1 -1
- package/lib/commonjs/providers/stack/blank-stack-state/helpers/build-blank-stack-state.js +10 -4
- package/lib/commonjs/providers/stack/blank-stack-state/helpers/build-blank-stack-state.js.map +1 -1
- package/lib/commonjs/providers/stack/blank-stack-state/helpers/derive-blank-stack-state.js +4 -3
- package/lib/commonjs/providers/stack/blank-stack-state/helpers/derive-blank-stack-state.js.map +1 -1
- package/lib/commonjs/providers/stack/blank-stack-state/helpers/reconcile-blank-stack-routes.js.map +1 -1
- package/lib/commonjs/providers/stack/blank-stack-state/helpers/state-equality.js +9 -2
- package/lib/commonjs/providers/stack/blank-stack-state/helpers/state-equality.js.map +1 -1
- package/lib/commonjs/utils/create-provider.js +14 -3
- package/lib/commonjs/utils/create-provider.js.map +1 -1
- package/lib/module/components/boundary/create-boundary-component.js +6 -2
- package/lib/module/components/boundary/create-boundary-component.js.map +1 -1
- package/lib/module/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js +50 -0
- package/lib/module/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js.map +1 -1
- package/lib/module/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +44 -9
- package/lib/module/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +2 -3
- package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
- package/lib/module/components/boundary/portal/teleport.js +1 -14
- package/lib/module/components/boundary/portal/teleport.js.map +1 -1
- package/lib/module/components/boundary/utils/source-signals.js +6 -4
- package/lib/module/components/boundary/utils/source-signals.js.map +1 -1
- package/lib/module/components/overlay/helpers/get-active-overlay.js +3 -24
- package/lib/module/components/overlay/helpers/get-active-overlay.js.map +1 -1
- package/lib/module/components/overlay/helpers/retain-ready-overlay-resources.js +4 -3
- package/lib/module/components/overlay/helpers/retain-ready-overlay-resources.js.map +1 -1
- package/lib/module/components/overlay/hooks/use-overlay-slot.js +1 -2
- package/lib/module/components/overlay/hooks/use-overlay-slot.js.map +1 -1
- package/lib/module/components/overlay/variations/float-overlay.js +0 -2
- package/lib/module/components/overlay/variations/float-overlay.js.map +1 -1
- package/lib/module/components/overlay/variations/overlay-host.js +19 -16
- package/lib/module/components/overlay/variations/overlay-host.js.map +1 -1
- package/lib/module/components/screen-container/layers/content.js +10 -5
- package/lib/module/components/screen-container/layers/content.js.map +1 -1
- package/lib/module/components/screen-container/layers/surface.js +45 -0
- package/lib/module/components/screen-container/layers/surface.js.map +1 -0
- package/lib/module/components/stack-view.js +7 -29
- package/lib/module/components/stack-view.js.map +1 -1
- package/lib/module/configs/index.js +2 -5
- package/lib/module/configs/index.js.map +1 -1
- package/lib/module/configs/presets.js +0 -380
- package/lib/module/configs/presets.js.map +1 -1
- package/lib/module/constants.js +1 -0
- package/lib/module/constants.js.map +1 -1
- package/lib/module/navigators/create-blank-stack-navigator.js +7 -66
- package/lib/module/navigators/create-blank-stack-navigator.js.map +1 -1
- package/lib/module/navigators/expo-router/index.js +1 -18
- package/lib/module/navigators/expo-router/index.js.map +1 -1
- package/lib/module/navigators/react-navigation/index.js +1 -3
- package/lib/module/navigators/react-navigation/index.js.map +1 -1
- package/lib/module/providers/screen/animation/animation.provider.js +4 -0
- package/lib/module/providers/screen/animation/animation.provider.js.map +1 -1
- package/lib/module/providers/screen/animation/helpers/build-screen-transition-options.js +1 -0
- package/lib/module/providers/screen/animation/helpers/build-screen-transition-options.js.map +1 -1
- package/lib/module/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.js +20 -5
- package/lib/module/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.js.map +1 -1
- package/lib/module/providers/screen/animation/helpers/hydrate-transition-state/index.js +16 -1
- package/lib/module/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
- package/lib/module/providers/screen/animation/helpers/selected-interpolator-options.js +1 -1
- package/lib/module/providers/screen/animation/helpers/selected-interpolator-options.js.map +1 -1
- package/lib/module/providers/screen/animation/use-screen-animation.js +2 -9
- package/lib/module/providers/screen/animation/use-screen-animation.js.map +1 -1
- package/lib/module/providers/screen/gestures/pan/behavior/pan-release.js +29 -7
- package/lib/module/providers/screen/gestures/pan/behavior/pan-release.js.map +1 -1
- package/lib/module/providers/screen/gestures/pinch/behavior/pinch-release.js +27 -7
- package/lib/module/providers/screen/gestures/pinch/behavior/pinch-release.js.map +1 -1
- package/lib/module/providers/screen/gestures/shared/policy.js +2 -1
- package/lib/module/providers/screen/gestures/shared/policy.js.map +1 -1
- package/lib/module/providers/screen/gestures/shared/snap-points.js +66 -0
- package/lib/module/providers/screen/gestures/shared/snap-points.js.map +1 -1
- package/lib/module/providers/screen/options/helpers.js +9 -2
- package/lib/module/providers/screen/options/helpers.js.map +1 -1
- package/lib/module/providers/screen/styles/constants.js +4 -1
- package/lib/module/providers/screen/styles/constants.js.map +1 -1
- package/lib/module/providers/screen/styles/hooks/slot-resolvers.js +2 -10
- package/lib/module/providers/screen/styles/hooks/slot-resolvers.js.map +1 -1
- package/lib/module/providers/screen/styles/slot.provider.js +1 -0
- package/lib/module/providers/screen/styles/slot.provider.js.map +1 -1
- package/lib/module/providers/stack/blank-stack-state/helpers/build-blank-stack-state.js +11 -5
- package/lib/module/providers/stack/blank-stack-state/helpers/build-blank-stack-state.js.map +1 -1
- package/lib/module/providers/stack/blank-stack-state/helpers/derive-blank-stack-state.js +5 -4
- package/lib/module/providers/stack/blank-stack-state/helpers/derive-blank-stack-state.js.map +1 -1
- package/lib/module/providers/stack/blank-stack-state/helpers/reconcile-blank-stack-routes.js.map +1 -1
- package/lib/module/providers/stack/blank-stack-state/helpers/state-equality.js +7 -1
- package/lib/module/providers/stack/blank-stack-state/helpers/state-equality.js.map +1 -1
- package/lib/module/types/animation.types.js +10 -0
- package/lib/module/types/animation.types.js.map +1 -1
- package/lib/module/utils/create-provider.js +14 -3
- package/lib/module/utils/create-provider.js.map +1 -1
- package/lib/typescript/components/boundary/create-boundary-component.d.ts.map +1 -1
- package/lib/typescript/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.d.ts +20 -1
- package/lib/typescript/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.d.ts.map +1 -1
- package/lib/typescript/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts.map +1 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -1
- package/lib/typescript/components/boundary/portal/teleport.d.ts +1 -1
- package/lib/typescript/components/boundary/portal/teleport.d.ts.map +1 -1
- package/lib/typescript/components/boundary/utils/source-signals.d.ts.map +1 -1
- package/lib/typescript/components/overlay/helpers/get-active-overlay.d.ts +2 -8
- package/lib/typescript/components/overlay/helpers/get-active-overlay.d.ts.map +1 -1
- package/lib/typescript/components/overlay/helpers/retain-ready-overlay-resources.d.ts +2 -1
- package/lib/typescript/components/overlay/helpers/retain-ready-overlay-resources.d.ts.map +1 -1
- package/lib/typescript/components/overlay/hooks/use-overlay-slot.d.ts.map +1 -1
- package/lib/typescript/components/overlay/variations/float-overlay.d.ts.map +1 -1
- package/lib/typescript/components/overlay/variations/overlay-host.d.ts +2 -3
- package/lib/typescript/components/overlay/variations/overlay-host.d.ts.map +1 -1
- package/lib/typescript/components/screen-container/layers/content.d.ts.map +1 -1
- package/lib/typescript/components/screen-container/layers/surface.d.ts +7 -0
- package/lib/typescript/components/screen-container/layers/surface.d.ts.map +1 -0
- package/lib/typescript/components/stack-view.d.ts +1 -1
- package/lib/typescript/components/stack-view.d.ts.map +1 -1
- package/lib/typescript/configs/index.d.ts +0 -9
- package/lib/typescript/configs/index.d.ts.map +1 -1
- package/lib/typescript/configs/presets.d.ts +0 -9
- package/lib/typescript/configs/presets.d.ts.map +1 -1
- package/lib/typescript/constants.d.ts +2 -1
- package/lib/typescript/constants.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +1 -10
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/navigators/create-blank-stack-navigator.d.ts +2 -4
- package/lib/typescript/navigators/create-blank-stack-navigator.d.ts.map +1 -1
- package/lib/typescript/navigators/expo-router/index.d.ts +3 -3
- package/lib/typescript/navigators/expo-router/index.d.ts.map +1 -1
- package/lib/typescript/navigators/react-navigation/index.d.ts +1 -1
- package/lib/typescript/navigators/react-navigation/index.d.ts.map +1 -1
- package/lib/typescript/providers/screen/animation/animation.provider.d.ts +10 -1
- package/lib/typescript/providers/screen/animation/animation.provider.d.ts.map +1 -1
- package/lib/typescript/providers/screen/animation/helpers/build-screen-transition-options.d.ts.map +1 -1
- package/lib/typescript/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.d.ts +2 -1
- package/lib/typescript/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.d.ts.map +1 -1
- package/lib/typescript/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts.map +1 -1
- package/lib/typescript/providers/screen/animation/helpers/selected-interpolator-options.d.ts.map +1 -1
- package/lib/typescript/providers/screen/animation/use-screen-animation.d.ts.map +1 -1
- package/lib/typescript/providers/screen/gestures/pan/behavior/pan-release.d.ts.map +1 -1
- package/lib/typescript/providers/screen/gestures/pinch/behavior/pinch-release.d.ts.map +1 -1
- package/lib/typescript/providers/screen/gestures/shared/policy.d.ts +2 -1
- package/lib/typescript/providers/screen/gestures/shared/policy.d.ts.map +1 -1
- package/lib/typescript/providers/screen/gestures/shared/snap-points.d.ts +11 -0
- package/lib/typescript/providers/screen/gestures/shared/snap-points.d.ts.map +1 -1
- package/lib/typescript/providers/screen/gestures/types.d.ts +2 -0
- package/lib/typescript/providers/screen/gestures/types.d.ts.map +1 -1
- package/lib/typescript/providers/screen/options/helpers.d.ts.map +1 -1
- package/lib/typescript/providers/screen/options/types.d.ts +1 -0
- package/lib/typescript/providers/screen/options/types.d.ts.map +1 -1
- package/lib/typescript/providers/screen/styles/constants.d.ts.map +1 -1
- package/lib/typescript/providers/screen/styles/hooks/slot-resolvers.d.ts.map +1 -1
- package/lib/typescript/providers/screen/styles/slot.provider.d.ts +11 -2
- package/lib/typescript/providers/screen/styles/slot.provider.d.ts.map +1 -1
- package/lib/typescript/providers/stack/blank-stack-state/helpers/build-blank-stack-state.d.ts +3 -3
- package/lib/typescript/providers/stack/blank-stack-state/helpers/build-blank-stack-state.d.ts.map +1 -1
- package/lib/typescript/providers/stack/blank-stack-state/helpers/derive-blank-stack-state.d.ts.map +1 -1
- package/lib/typescript/providers/stack/blank-stack-state/helpers/reconcile-blank-stack-routes.d.ts +3 -2
- package/lib/typescript/providers/stack/blank-stack-state/helpers/reconcile-blank-stack-routes.d.ts.map +1 -1
- package/lib/typescript/providers/stack/blank-stack-state/helpers/state-equality.d.ts +4 -4
- package/lib/typescript/providers/stack/blank-stack-state/helpers/state-equality.d.ts.map +1 -1
- package/lib/typescript/providers/stack/blank-stack-state/helpers/types.d.ts +6 -5
- package/lib/typescript/providers/stack/blank-stack-state/helpers/types.d.ts.map +1 -1
- package/lib/typescript/providers/stack/blank-stack.provider.d.ts +3 -1
- package/lib/typescript/providers/stack/blank-stack.provider.d.ts.map +1 -1
- package/lib/typescript/types/animation.types.d.ts +16 -12
- package/lib/typescript/types/animation.types.d.ts.map +1 -1
- package/lib/typescript/types/blank-stack.types.d.ts +2 -23
- package/lib/typescript/types/blank-stack.types.d.ts.map +1 -1
- package/lib/typescript/types/index.d.ts +2 -2
- package/lib/typescript/types/index.d.ts.map +1 -1
- package/lib/typescript/types/providers/blank-stack-provider.types.d.ts +8 -6
- package/lib/typescript/types/providers/blank-stack-provider.types.d.ts.map +1 -1
- package/lib/typescript/types/screen.types.d.ts +50 -0
- package/lib/typescript/types/screen.types.d.ts.map +1 -1
- package/lib/typescript/utils/create-provider.d.ts +4 -1
- package/lib/typescript/utils/create-provider.d.ts.map +1 -1
- package/package.json +3 -8
- package/src/components/boundary/create-boundary-component.tsx +10 -2
- package/src/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.ts +89 -0
- package/src/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +97 -14
- package/src/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +2 -6
- package/src/components/boundary/portal/teleport.ts +2 -23
- package/src/components/boundary/utils/source-signals.ts +6 -4
- package/src/components/overlay/helpers/get-active-overlay.ts +4 -36
- package/src/components/overlay/helpers/retain-ready-overlay-resources.ts +10 -1
- package/src/components/overlay/hooks/use-overlay-slot.ts +1 -5
- package/src/components/overlay/variations/float-overlay.tsx +9 -12
- package/src/components/overlay/variations/overlay-host.tsx +24 -22
- package/src/components/screen-container/layers/content.tsx +12 -7
- package/src/components/screen-container/layers/surface.tsx +65 -0
- package/src/components/stack-view.tsx +8 -39
- package/src/configs/index.ts +0 -6
- package/src/configs/presets.ts +0 -447
- package/src/constants.ts +2 -0
- package/src/index.ts +4 -1
- package/src/navigators/create-blank-stack-navigator.tsx +16 -124
- package/src/navigators/expo-router/index.tsx +0 -23
- package/src/navigators/react-navigation/index.tsx +0 -3
- package/src/providers/screen/animation/animation.provider.tsx +60 -54
- package/src/providers/screen/animation/helpers/build-screen-transition-options.ts +1 -0
- package/src/providers/screen/animation/helpers/hydrate-transition-state/gesture-progress.ts +26 -0
- package/src/providers/screen/animation/helpers/hydrate-transition-state/index.ts +20 -0
- package/src/providers/screen/animation/helpers/selected-interpolator-options.ts +1 -0
- package/src/providers/screen/animation/use-screen-animation.tsx +2 -14
- package/src/providers/screen/gestures/pan/behavior/pan-release.ts +46 -7
- package/src/providers/screen/gestures/pinch/behavior/pinch-release.ts +45 -4
- package/src/providers/screen/gestures/shared/policy.ts +4 -0
- package/src/providers/screen/gestures/shared/snap-points.ts +87 -0
- package/src/providers/screen/gestures/types.ts +2 -0
- package/src/providers/screen/options/helpers.ts +18 -0
- package/src/providers/screen/options/types.ts +1 -0
- package/src/providers/screen/styles/constants.ts +2 -1
- package/src/providers/screen/styles/hooks/slot-resolvers.tsx +2 -17
- package/src/providers/screen/styles/slot.provider.tsx +2 -1
- package/src/providers/stack/blank-stack-state/helpers/build-blank-stack-state.ts +30 -12
- package/src/providers/stack/blank-stack-state/helpers/derive-blank-stack-state.ts +11 -3
- package/src/providers/stack/blank-stack-state/helpers/reconcile-blank-stack-routes.ts +2 -2
- package/src/providers/stack/blank-stack-state/helpers/state-equality.ts +27 -16
- package/src/providers/stack/blank-stack-state/helpers/types.ts +9 -4
- package/src/types/animation.types.ts +16 -13
- package/src/types/blank-stack.types.ts +1 -29
- package/src/types/index.ts +4 -1
- package/src/types/providers/blank-stack-provider.types.ts +14 -11
- package/src/types/screen.types.ts +57 -0
- package/src/utils/create-provider.tsx +22 -4
- package/lib/commonjs/components/boundary/portal/utils/teleport-control.js +0 -16
- package/lib/commonjs/components/boundary/portal/utils/teleport-control.js.map +0 -1
- package/lib/commonjs/providers/navigation/navigation-host.provider.js +0 -56
- package/lib/commonjs/providers/navigation/navigation-host.provider.js.map +0 -1
- package/lib/commonjs/providers/navigation/react-navigation-host.js +0 -23
- package/lib/commonjs/providers/navigation/react-navigation-host.js.map +0 -1
- package/lib/module/components/boundary/portal/utils/teleport-control.js +0 -11
- package/lib/module/components/boundary/portal/utils/teleport-control.js.map +0 -1
- package/lib/module/providers/navigation/navigation-host.provider.js +0 -50
- package/lib/module/providers/navigation/navigation-host.provider.js.map +0 -1
- package/lib/module/providers/navigation/react-navigation-host.js +0 -19
- package/lib/module/providers/navigation/react-navigation-host.js.map +0 -1
- package/lib/typescript/components/boundary/portal/utils/teleport-control.d.ts +0 -3
- package/lib/typescript/components/boundary/portal/utils/teleport-control.d.ts.map +0 -1
- package/lib/typescript/providers/navigation/navigation-host.provider.d.ts +0 -21
- package/lib/typescript/providers/navigation/navigation-host.provider.d.ts.map +0 -1
- package/lib/typescript/providers/navigation/react-navigation-host.d.ts +0 -3
- package/lib/typescript/providers/navigation/react-navigation-host.d.ts.map +0 -1
- package/src/components/boundary/portal/utils/teleport-control.ts +0 -13
- package/src/providers/navigation/navigation-host.provider.tsx +0 -75
- package/src/providers/navigation/react-navigation-host.tsx +0 -24
package/src/configs/presets.ts
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
import { Platform } from "react-native";
|
|
2
1
|
import {
|
|
3
2
|
Extrapolation,
|
|
4
3
|
interpolate,
|
|
5
4
|
interpolateColor,
|
|
6
5
|
} from "react-native-reanimated";
|
|
7
|
-
import {
|
|
8
|
-
NAVIGATION_MASK_CONTAINER_STYLE_ID,
|
|
9
|
-
NAVIGATION_MASK_ELEMENT_STYLE_ID,
|
|
10
|
-
} from "../constants";
|
|
11
6
|
import type { ScreenTransitionConfig } from "../types/screen.types";
|
|
12
|
-
import { normalizeInterpolatedStyle } from "../utils/normalize-interpolated-style";
|
|
13
7
|
import { DefaultSpec } from "./specs";
|
|
14
8
|
|
|
15
|
-
const platform = Platform.OS;
|
|
16
|
-
|
|
17
9
|
export const SlideFromTop = (
|
|
18
10
|
config: Partial<ScreenTransitionConfig> = {},
|
|
19
11
|
): ScreenTransitionConfig => {
|
|
@@ -235,442 +227,3 @@ export const ElasticCard = (
|
|
|
235
227
|
...config,
|
|
236
228
|
};
|
|
237
229
|
};
|
|
238
|
-
|
|
239
|
-
export const SharedIGImage = ({
|
|
240
|
-
id,
|
|
241
|
-
...config
|
|
242
|
-
}: Partial<ScreenTransitionConfig> & {
|
|
243
|
-
id: string;
|
|
244
|
-
}): ScreenTransitionConfig => {
|
|
245
|
-
return {
|
|
246
|
-
gestureEnabled: true,
|
|
247
|
-
gestureDirection: ["vertical", "horizontal"],
|
|
248
|
-
enableTransitions: true,
|
|
249
|
-
screenStyleInterpolator: ({
|
|
250
|
-
current,
|
|
251
|
-
layouts: {
|
|
252
|
-
screen: { height, width },
|
|
253
|
-
},
|
|
254
|
-
bounds,
|
|
255
|
-
progress,
|
|
256
|
-
focused,
|
|
257
|
-
active,
|
|
258
|
-
}) => {
|
|
259
|
-
"worklet";
|
|
260
|
-
|
|
261
|
-
const normX = active.gesture.handoff.normX;
|
|
262
|
-
const normY = active.gesture.handoff.normY;
|
|
263
|
-
|
|
264
|
-
const dragX = interpolate(
|
|
265
|
-
normX,
|
|
266
|
-
[-1, 0, 1],
|
|
267
|
-
[-width * 0.7, 0, width * 0.7],
|
|
268
|
-
"clamp",
|
|
269
|
-
);
|
|
270
|
-
const dragY = interpolate(
|
|
271
|
-
normY,
|
|
272
|
-
[-1, 0, 1],
|
|
273
|
-
[-height * 0.4, 0, height * 0.4],
|
|
274
|
-
"clamp",
|
|
275
|
-
);
|
|
276
|
-
const dragXScale = interpolate(normX, [0, 1], [1, 0.8]);
|
|
277
|
-
const dragYScale = interpolate(normY, [0, 1], [1, 0.8]);
|
|
278
|
-
|
|
279
|
-
const navigationStyles =
|
|
280
|
-
bounds({
|
|
281
|
-
id,
|
|
282
|
-
}).navigation.zoom() ?? {};
|
|
283
|
-
|
|
284
|
-
// Read the bound-specific slots before normalizing the full result.
|
|
285
|
-
const sourceStyle = navigationStyles[id] as
|
|
286
|
-
| Record<string, unknown>
|
|
287
|
-
| undefined;
|
|
288
|
-
const containerStyle = navigationStyles[
|
|
289
|
-
NAVIGATION_MASK_CONTAINER_STYLE_ID
|
|
290
|
-
] as Record<string, unknown> | undefined;
|
|
291
|
-
const maskStyle = navigationStyles[NAVIGATION_MASK_ELEMENT_STYLE_ID] as
|
|
292
|
-
| Record<string, unknown>
|
|
293
|
-
| undefined;
|
|
294
|
-
|
|
295
|
-
const normalizedNav = normalizeInterpolatedStyle(
|
|
296
|
-
navigationStyles as Record<string, any>,
|
|
297
|
-
);
|
|
298
|
-
|
|
299
|
-
if (focused) {
|
|
300
|
-
return {
|
|
301
|
-
...normalizedNav,
|
|
302
|
-
backdrop: {
|
|
303
|
-
style: {
|
|
304
|
-
backgroundColor: "black",
|
|
305
|
-
opacity: interpolate(progress, [0, 1], [0, 0.5]),
|
|
306
|
-
},
|
|
307
|
-
},
|
|
308
|
-
content: {
|
|
309
|
-
style: {
|
|
310
|
-
transform: [
|
|
311
|
-
{ translateX: dragX },
|
|
312
|
-
{ translateY: dragY },
|
|
313
|
-
{ scale: dragXScale },
|
|
314
|
-
{ scale: dragYScale },
|
|
315
|
-
],
|
|
316
|
-
},
|
|
317
|
-
},
|
|
318
|
-
[NAVIGATION_MASK_CONTAINER_STYLE_ID]: containerStyle
|
|
319
|
-
? {
|
|
320
|
-
style: {
|
|
321
|
-
...containerStyle,
|
|
322
|
-
transform: [
|
|
323
|
-
...(((containerStyle.transform as any[]) ?? []) as any[]),
|
|
324
|
-
{ translateX: dragX * 0.2 },
|
|
325
|
-
{ translateY: dragY * 0.2 },
|
|
326
|
-
],
|
|
327
|
-
},
|
|
328
|
-
}
|
|
329
|
-
: undefined,
|
|
330
|
-
[NAVIGATION_MASK_ELEMENT_STYLE_ID]: maskStyle
|
|
331
|
-
? {
|
|
332
|
-
style: {
|
|
333
|
-
...maskStyle,
|
|
334
|
-
borderRadius: interpolate(progress, [0, 1], [0, 24]),
|
|
335
|
-
},
|
|
336
|
-
}
|
|
337
|
-
: undefined,
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
return {
|
|
342
|
-
...normalizedNav,
|
|
343
|
-
content: {
|
|
344
|
-
style: {
|
|
345
|
-
...(normalizedNav.content?.style ?? {}),
|
|
346
|
-
pointerEvents: current.gesture.dismissing ? "none" : "auto",
|
|
347
|
-
},
|
|
348
|
-
},
|
|
349
|
-
[id]: {
|
|
350
|
-
style: {
|
|
351
|
-
...(sourceStyle ?? {}),
|
|
352
|
-
transform: [
|
|
353
|
-
{ translateX: dragX || 0 },
|
|
354
|
-
{ translateY: dragY || 0 },
|
|
355
|
-
...(((sourceStyle?.transform as any[]) ?? []) as any[]),
|
|
356
|
-
{ scale: dragXScale },
|
|
357
|
-
{ scale: dragYScale },
|
|
358
|
-
],
|
|
359
|
-
},
|
|
360
|
-
},
|
|
361
|
-
};
|
|
362
|
-
},
|
|
363
|
-
transitionSpec: {
|
|
364
|
-
open: {
|
|
365
|
-
stiffness: 1500,
|
|
366
|
-
damping: 1000,
|
|
367
|
-
mass: 3,
|
|
368
|
-
overshootClamping: true,
|
|
369
|
-
//@ts-expect-error
|
|
370
|
-
restSpeedThreshold: 0.02,
|
|
371
|
-
},
|
|
372
|
-
close: {
|
|
373
|
-
stiffness: 1500,
|
|
374
|
-
damping: 1000,
|
|
375
|
-
mass: 3,
|
|
376
|
-
overshootClamping: true,
|
|
377
|
-
//@ts-expect-error
|
|
378
|
-
restSpeedThreshold: 0.02,
|
|
379
|
-
},
|
|
380
|
-
},
|
|
381
|
-
...config,
|
|
382
|
-
};
|
|
383
|
-
};
|
|
384
|
-
|
|
385
|
-
export const SharedAppleMusic = ({
|
|
386
|
-
id,
|
|
387
|
-
...config
|
|
388
|
-
}: Partial<ScreenTransitionConfig> & {
|
|
389
|
-
id: string;
|
|
390
|
-
}): ScreenTransitionConfig => {
|
|
391
|
-
return {
|
|
392
|
-
enableTransitions: true,
|
|
393
|
-
gestureEnabled: true,
|
|
394
|
-
gestureDirection: ["vertical", "horizontal"],
|
|
395
|
-
screenStyleInterpolator: ({
|
|
396
|
-
bounds,
|
|
397
|
-
focused,
|
|
398
|
-
progress,
|
|
399
|
-
layouts: { screen },
|
|
400
|
-
current,
|
|
401
|
-
active,
|
|
402
|
-
}) => {
|
|
403
|
-
"worklet";
|
|
404
|
-
|
|
405
|
-
const normX = active.gesture.handoff.normX;
|
|
406
|
-
const normY = active.gesture.handoff.normY;
|
|
407
|
-
const initialGesture = active.gesture.handoff.active;
|
|
408
|
-
|
|
409
|
-
/**
|
|
410
|
-
* ===============================
|
|
411
|
-
* Animations for both bounds
|
|
412
|
-
* ===============================
|
|
413
|
-
*/
|
|
414
|
-
const xResistance = initialGesture === "horizontal" ? 0.7 : 0.4;
|
|
415
|
-
const yResistance = initialGesture === "vertical" ? 0.7 : 0.4;
|
|
416
|
-
|
|
417
|
-
const xScaleOuput = initialGesture === "horizontal" ? [1, 0.5] : [1, 1];
|
|
418
|
-
const yScaleOuput = initialGesture === "vertical" ? [1, 0.5] : [1, 1];
|
|
419
|
-
|
|
420
|
-
const dragX = interpolate(
|
|
421
|
-
normX,
|
|
422
|
-
[-1, 0, 1],
|
|
423
|
-
[-screen.width * xResistance, 0, screen.width * xResistance],
|
|
424
|
-
"clamp",
|
|
425
|
-
);
|
|
426
|
-
const dragY = interpolate(
|
|
427
|
-
normY,
|
|
428
|
-
[-1, 0, 1],
|
|
429
|
-
[-screen.height * yResistance, 0, screen.height * yResistance],
|
|
430
|
-
"clamp",
|
|
431
|
-
);
|
|
432
|
-
const dragXScale = interpolate(normX, [0, 1], xScaleOuput);
|
|
433
|
-
const dragYScale = interpolate(normY, [0, 1], yScaleOuput);
|
|
434
|
-
|
|
435
|
-
const boundValues = bounds({ id }).values({
|
|
436
|
-
method: focused ? "content" : "transform",
|
|
437
|
-
anchor: "top",
|
|
438
|
-
scaleMode: "uniform",
|
|
439
|
-
});
|
|
440
|
-
|
|
441
|
-
const opacity = interpolate(
|
|
442
|
-
progress,
|
|
443
|
-
[0, 0.25, 1.25, 2],
|
|
444
|
-
[0, 1, 1, 0],
|
|
445
|
-
"clamp",
|
|
446
|
-
);
|
|
447
|
-
|
|
448
|
-
/**
|
|
449
|
-
* ===============================
|
|
450
|
-
* Focused specific animations
|
|
451
|
-
* ===============================
|
|
452
|
-
*/
|
|
453
|
-
if (focused) {
|
|
454
|
-
const maskedValues = bounds({ id }).values({
|
|
455
|
-
space: "absolute",
|
|
456
|
-
method: "size",
|
|
457
|
-
target: "fullscreen",
|
|
458
|
-
});
|
|
459
|
-
|
|
460
|
-
// Apple Music style drop shadow that increases with drag magnitude
|
|
461
|
-
const dragMagnitude = Math.max(Math.abs(normX), Math.abs(normY));
|
|
462
|
-
const shadowOpacity = interpolate(
|
|
463
|
-
dragMagnitude,
|
|
464
|
-
[0, 1],
|
|
465
|
-
[0, 0.25],
|
|
466
|
-
"clamp",
|
|
467
|
-
);
|
|
468
|
-
const shadowRadius = interpolate(
|
|
469
|
-
dragMagnitude,
|
|
470
|
-
[0, 1],
|
|
471
|
-
[0, 24],
|
|
472
|
-
"clamp",
|
|
473
|
-
);
|
|
474
|
-
const shadowOffsetY = interpolate(
|
|
475
|
-
dragMagnitude,
|
|
476
|
-
[0, 1],
|
|
477
|
-
[0, 20],
|
|
478
|
-
"clamp",
|
|
479
|
-
);
|
|
480
|
-
const elevation = interpolate(dragMagnitude, [0, 1], [0, 24], "clamp");
|
|
481
|
-
|
|
482
|
-
const IOSShadowStyle = {
|
|
483
|
-
shadowColor: "#000",
|
|
484
|
-
shadowOpacity,
|
|
485
|
-
shadowRadius,
|
|
486
|
-
shadowOffset: { width: 0, height: shadowOffsetY },
|
|
487
|
-
};
|
|
488
|
-
|
|
489
|
-
const AndroidShadowStyle = {
|
|
490
|
-
elevation,
|
|
491
|
-
shadowColor: "#000",
|
|
492
|
-
};
|
|
493
|
-
|
|
494
|
-
return {
|
|
495
|
-
content: {
|
|
496
|
-
style: {
|
|
497
|
-
pointerEvents: current.animating ? "none" : "auto",
|
|
498
|
-
transform: [
|
|
499
|
-
{ translateX: dragX || 0 },
|
|
500
|
-
{ translateY: dragY || 0 },
|
|
501
|
-
{ scale: dragXScale },
|
|
502
|
-
{ scale: dragYScale },
|
|
503
|
-
],
|
|
504
|
-
opacity,
|
|
505
|
-
...(platform === "ios" ? IOSShadowStyle : AndroidShadowStyle),
|
|
506
|
-
},
|
|
507
|
-
},
|
|
508
|
-
_ROOT_CONTAINER: {
|
|
509
|
-
style: {
|
|
510
|
-
transform: [
|
|
511
|
-
{ translateX: boundValues.translateX || 0 },
|
|
512
|
-
{ translateY: boundValues.translateY || 0 },
|
|
513
|
-
//@ts-expect-error
|
|
514
|
-
{ scale: boundValues.scale || 1 },
|
|
515
|
-
],
|
|
516
|
-
},
|
|
517
|
-
},
|
|
518
|
-
_ROOT_MASKED: {
|
|
519
|
-
style: {
|
|
520
|
-
width: maskedValues.width,
|
|
521
|
-
height: maskedValues.height,
|
|
522
|
-
transform: [
|
|
523
|
-
{ translateX: maskedValues.translateX || 0 },
|
|
524
|
-
{ translateY: maskedValues.translateY || 0 },
|
|
525
|
-
],
|
|
526
|
-
borderRadius: interpolate(progress, [0, 1], [0, 24]),
|
|
527
|
-
},
|
|
528
|
-
},
|
|
529
|
-
};
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
/**
|
|
533
|
-
* ===============================
|
|
534
|
-
* Unfocused specific animations
|
|
535
|
-
* ===============================
|
|
536
|
-
*/
|
|
537
|
-
|
|
538
|
-
const scaledBoundTranslateX = (boundValues.translateX || 0) * dragXScale;
|
|
539
|
-
const scaledBoundTranslateY = (boundValues.translateY || 0) * dragYScale;
|
|
540
|
-
const scaledBoundScaleX = (boundValues.scaleX || 1) * dragXScale;
|
|
541
|
-
const scaledBoundScaleY = (boundValues.scaleY || 1) * dragYScale;
|
|
542
|
-
|
|
543
|
-
const contentScale = interpolate(progress, [1, 2], [1, 0.9], "clamp");
|
|
544
|
-
|
|
545
|
-
return {
|
|
546
|
-
[id]: {
|
|
547
|
-
style: {
|
|
548
|
-
transform: [
|
|
549
|
-
{ translateX: dragX || 0 },
|
|
550
|
-
{ translateY: dragY || 0 },
|
|
551
|
-
{ translateX: scaledBoundTranslateX },
|
|
552
|
-
{ translateY: scaledBoundTranslateY },
|
|
553
|
-
{ scale: dragXScale },
|
|
554
|
-
{ scale: dragYScale },
|
|
555
|
-
{ scaleX: scaledBoundScaleX },
|
|
556
|
-
{ scaleY: scaledBoundScaleY },
|
|
557
|
-
],
|
|
558
|
-
opacity,
|
|
559
|
-
zIndex: current.animating ? 999 : -1,
|
|
560
|
-
position: "relative",
|
|
561
|
-
},
|
|
562
|
-
},
|
|
563
|
-
content: {
|
|
564
|
-
style: {
|
|
565
|
-
transform: [{ scale: contentScale }],
|
|
566
|
-
},
|
|
567
|
-
},
|
|
568
|
-
};
|
|
569
|
-
},
|
|
570
|
-
transitionSpec: {
|
|
571
|
-
open: {
|
|
572
|
-
stiffness: 1000,
|
|
573
|
-
damping: 500,
|
|
574
|
-
mass: 3,
|
|
575
|
-
overshootClamping: true,
|
|
576
|
-
//@ts-expect-error - Should not lead to any issues
|
|
577
|
-
restSpeedThreshold: 0.02,
|
|
578
|
-
},
|
|
579
|
-
close: {
|
|
580
|
-
stiffness: 600,
|
|
581
|
-
damping: 60,
|
|
582
|
-
mass: 4,
|
|
583
|
-
overshootClamping: false,
|
|
584
|
-
//@ts-expect-error - Should not lead to any issues
|
|
585
|
-
restSpeedThreshold: 0.02,
|
|
586
|
-
restDisplacementThreshold: 0.002,
|
|
587
|
-
},
|
|
588
|
-
},
|
|
589
|
-
...config,
|
|
590
|
-
};
|
|
591
|
-
};
|
|
592
|
-
|
|
593
|
-
export const SharedXImage = ({
|
|
594
|
-
id,
|
|
595
|
-
...config
|
|
596
|
-
}: Partial<ScreenTransitionConfig> & {
|
|
597
|
-
id: string;
|
|
598
|
-
}): ScreenTransitionConfig => {
|
|
599
|
-
return {
|
|
600
|
-
//@ts-expect-error - Should not lead to any issues
|
|
601
|
-
enableTransitions: true,
|
|
602
|
-
gestureEnabled: true,
|
|
603
|
-
gestureDirection: ["vertical", "vertical-inverted"],
|
|
604
|
-
screenStyleInterpolator: ({
|
|
605
|
-
focused,
|
|
606
|
-
bounds,
|
|
607
|
-
current,
|
|
608
|
-
layouts: { screen },
|
|
609
|
-
progress,
|
|
610
|
-
}) => {
|
|
611
|
-
"worklet";
|
|
612
|
-
|
|
613
|
-
if (!focused) return {};
|
|
614
|
-
|
|
615
|
-
const navigationStyles =
|
|
616
|
-
bounds({
|
|
617
|
-
id,
|
|
618
|
-
}).navigation.zoom() ?? {};
|
|
619
|
-
const maskStyle = navigationStyles[NAVIGATION_MASK_ELEMENT_STYLE_ID] as
|
|
620
|
-
| Record<string, unknown>
|
|
621
|
-
| undefined;
|
|
622
|
-
|
|
623
|
-
const normalizedNav = normalizeInterpolatedStyle(
|
|
624
|
-
navigationStyles as Record<string, any>,
|
|
625
|
-
);
|
|
626
|
-
|
|
627
|
-
const dragY = interpolate(
|
|
628
|
-
current.gesture.normY,
|
|
629
|
-
[-1, 0, 1],
|
|
630
|
-
[-screen.height, 0, screen.height],
|
|
631
|
-
);
|
|
632
|
-
|
|
633
|
-
const contentY = interpolate(
|
|
634
|
-
progress,
|
|
635
|
-
[0, 1],
|
|
636
|
-
[dragY >= 0 ? screen.height : -screen.height, 0],
|
|
637
|
-
);
|
|
638
|
-
|
|
639
|
-
const overlayClr = interpolateColor(
|
|
640
|
-
current.progress - Math.abs(current.gesture.normY),
|
|
641
|
-
[0, 1],
|
|
642
|
-
["rgba(0,0,0,0)", "rgba(0,0,0,1)"],
|
|
643
|
-
);
|
|
644
|
-
|
|
645
|
-
const borderRadius = interpolate(current.progress, [0, 1], [12, 0]);
|
|
646
|
-
|
|
647
|
-
return {
|
|
648
|
-
...normalizedNav,
|
|
649
|
-
[NAVIGATION_MASK_ELEMENT_STYLE_ID]: maskStyle
|
|
650
|
-
? {
|
|
651
|
-
style: {
|
|
652
|
-
...maskStyle,
|
|
653
|
-
borderRadius,
|
|
654
|
-
},
|
|
655
|
-
}
|
|
656
|
-
: undefined,
|
|
657
|
-
content: {
|
|
658
|
-
style: {
|
|
659
|
-
transform: [{ translateY: contentY }, { translateY: dragY }],
|
|
660
|
-
pointerEvents: current.animating ? "none" : "auto",
|
|
661
|
-
},
|
|
662
|
-
},
|
|
663
|
-
backdrop: {
|
|
664
|
-
style: {
|
|
665
|
-
backgroundColor: overlayClr,
|
|
666
|
-
},
|
|
667
|
-
},
|
|
668
|
-
};
|
|
669
|
-
},
|
|
670
|
-
transitionSpec: {
|
|
671
|
-
open: DefaultSpec,
|
|
672
|
-
close: DefaultSpec,
|
|
673
|
-
},
|
|
674
|
-
...config,
|
|
675
|
-
};
|
|
676
|
-
};
|
package/src/constants.ts
CHANGED
|
@@ -10,6 +10,7 @@ import type {
|
|
|
10
10
|
GestureTracking,
|
|
11
11
|
Layout,
|
|
12
12
|
SheetScrollGestureBehavior,
|
|
13
|
+
SheetSnapBehavior,
|
|
13
14
|
} from "./types/screen.types";
|
|
14
15
|
import type { BaseStackRoute } from "./types/stack.types";
|
|
15
16
|
|
|
@@ -167,6 +168,7 @@ export const DEFAULT_GESTURE_RELEASE_VELOCITY_SCALE = 1;
|
|
|
167
168
|
export const DEFAULT_GESTURE_DIRECTION = "horizontal";
|
|
168
169
|
export const DEFAULT_GESTURE_TRACKING: GestureTracking = "auto";
|
|
169
170
|
export const DEFAULT_GESTURE_SNAP_LOCKED = false;
|
|
171
|
+
export const DEFAULT_SHEET_SNAP_BEHAVIOR: SheetSnapBehavior = "continuous";
|
|
170
172
|
export const DEFAULT_GESTURE_ACTIVATION_AREA: ActivationArea = "screen";
|
|
171
173
|
export const DEFAULT_SHEET_SCROLL_GESTURE_BEHAVIOR: SheetScrollGestureBehavior =
|
|
172
174
|
"expand-and-collapse";
|
package/src/index.ts
CHANGED
|
@@ -50,7 +50,7 @@ export {
|
|
|
50
50
|
export type {
|
|
51
51
|
AnimatedViewStyle,
|
|
52
52
|
AnimationConfig,
|
|
53
|
-
|
|
53
|
+
BoundaryHandoffTarget,
|
|
54
54
|
BoundsMotion,
|
|
55
55
|
BoundsMotionFrame,
|
|
56
56
|
BoundsMotionTransform,
|
|
@@ -73,6 +73,8 @@ export type {
|
|
|
73
73
|
ScreenInterpolationProps,
|
|
74
74
|
ScreenLayerComponentProps,
|
|
75
75
|
ScreenStyleInterpolator,
|
|
76
|
+
ScreenSurfaceComponent,
|
|
77
|
+
ScreenSurfaceComponentProps,
|
|
76
78
|
ScreenTransitionAccessor,
|
|
77
79
|
ScreenTransitionConfig,
|
|
78
80
|
ScreenTransitionDepthTarget,
|
|
@@ -81,6 +83,7 @@ export type {
|
|
|
81
83
|
ScrollGestureAxisState,
|
|
82
84
|
ScrollGestureState,
|
|
83
85
|
ScrollMetadataState,
|
|
86
|
+
SheetSnapBehavior,
|
|
84
87
|
TransitionInterpolatedStyle,
|
|
85
88
|
TransitionSlotProps,
|
|
86
89
|
TransitionSlotStyle,
|
|
@@ -1,19 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
createStandardNavigator,
|
|
4
|
-
type NavigatorDescriptor,
|
|
5
|
-
} from "standard-navigation";
|
|
1
|
+
import { createStandardNavigator } from "standard-navigation";
|
|
6
2
|
import { StackView } from "../components/stack-view";
|
|
7
|
-
import {
|
|
8
|
-
type NavigationHostContextValue,
|
|
9
|
-
NavigationHostProvider,
|
|
10
|
-
} from "../providers/navigation/navigation-host.provider";
|
|
11
|
-
import type {
|
|
12
|
-
BlankStackDescriptor,
|
|
13
|
-
BlankStackFactoryOptions,
|
|
14
|
-
BlankStackNavigationHelpers,
|
|
15
|
-
BlankStackNavigationOptions,
|
|
16
|
-
} from "../types/blank-stack.types";
|
|
3
|
+
import type { BlankStackNavigationOptions } from "../types/blank-stack.types";
|
|
17
4
|
import type {
|
|
18
5
|
BaseStackNavigation,
|
|
19
6
|
BaseStackRoute,
|
|
@@ -22,122 +9,27 @@ import type {
|
|
|
22
9
|
|
|
23
10
|
export type BlankStackStandardEventMap = {};
|
|
24
11
|
|
|
25
|
-
export type BlankStackStandardNavigatorProps =
|
|
12
|
+
export type BlankStackStandardNavigatorProps = {
|
|
26
13
|
navigationState?: BaseStackState<BaseStackRoute>;
|
|
27
14
|
navigation?: BaseStackNavigation;
|
|
28
|
-
navigationHost?: NavigationHostContextValue;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
type StandardDescriptor = NavigatorDescriptor<BlankStackNavigationOptions> & {
|
|
32
|
-
navigation?: BaseStackNavigation;
|
|
33
|
-
route?: BaseStackRoute;
|
|
34
15
|
};
|
|
35
16
|
|
|
36
|
-
type StandardDescriptorMap = Record<string, StandardDescriptor>;
|
|
37
|
-
type BlankStackDescriptorMap = Record<string, BlankStackDescriptor>;
|
|
38
|
-
|
|
39
|
-
function createDescriptorMap({
|
|
40
|
-
routes,
|
|
41
|
-
descriptors,
|
|
42
|
-
navigation,
|
|
43
|
-
}: {
|
|
44
|
-
routes: BaseStackRoute[];
|
|
45
|
-
descriptors: StandardDescriptorMap;
|
|
46
|
-
navigation: BaseStackNavigation;
|
|
47
|
-
}): BlankStackDescriptorMap {
|
|
48
|
-
const result: BlankStackDescriptorMap = {};
|
|
49
|
-
|
|
50
|
-
for (const route of routes) {
|
|
51
|
-
const descriptor = descriptors[route.key];
|
|
52
|
-
|
|
53
|
-
if (!descriptor) {
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
result[route.key] = {
|
|
58
|
-
route: descriptor.route ?? route,
|
|
59
|
-
navigation: (descriptor.navigation ??
|
|
60
|
-
navigation) as BlankStackDescriptor["navigation"],
|
|
61
|
-
options: descriptor.options,
|
|
62
|
-
render: () => descriptor.render() as React.JSX.Element,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return result;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
17
|
export const BlankStackNavigator = createStandardNavigator<
|
|
70
18
|
BlankStackNavigationOptions,
|
|
71
19
|
BlankStackStandardEventMap,
|
|
72
20
|
BlankStackStandardNavigatorProps
|
|
73
|
-
>(
|
|
74
|
-
({
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
state,
|
|
78
|
-
navigation,
|
|
79
|
-
navigationHost,
|
|
80
|
-
navigationState,
|
|
81
|
-
}) => {
|
|
82
|
-
const stackState = navigationState ?? {
|
|
83
|
-
key: "blank-stack",
|
|
84
|
-
index: state.index,
|
|
85
|
-
routes: state.routes as BaseStackRoute[],
|
|
86
|
-
};
|
|
87
|
-
const stackStateRef = React.useRef(stackState);
|
|
88
|
-
stackStateRef.current = stackState;
|
|
89
|
-
|
|
90
|
-
const fallbackNavigation = React.useMemo<BaseStackNavigation>(
|
|
91
|
-
() => ({
|
|
92
|
-
getState: () => stackStateRef.current,
|
|
93
|
-
dispatch: (action) => {
|
|
94
|
-
if (action?.type === "GO_BACK" || action?.type === "POP") {
|
|
95
|
-
actions.back();
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const name = action?.payload?.name;
|
|
100
|
-
if (action?.type === "NAVIGATE" && typeof name === "string") {
|
|
101
|
-
actions.navigate(name, action.payload.params);
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
}),
|
|
105
|
-
[actions],
|
|
106
|
-
);
|
|
107
|
-
const stackNavigation = navigation ?? fallbackNavigation;
|
|
108
|
-
const stackDescriptors = React.useMemo(
|
|
109
|
-
() =>
|
|
110
|
-
createDescriptorMap({
|
|
111
|
-
routes: stackState.routes,
|
|
112
|
-
descriptors,
|
|
113
|
-
navigation: stackNavigation,
|
|
114
|
-
}),
|
|
115
|
-
[descriptors, stackNavigation, stackState.routes],
|
|
116
|
-
);
|
|
117
|
-
const describe = React.useCallback(
|
|
118
|
-
(route: BlankStackDescriptor["route"]) => {
|
|
119
|
-
const descriptor = stackDescriptors[route.key];
|
|
120
|
-
|
|
121
|
-
if (!descriptor) {
|
|
122
|
-
throw new Error(
|
|
123
|
-
`BlankStack could not find a descriptor for route "${route.key}".`,
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return descriptor;
|
|
128
|
-
},
|
|
129
|
-
[stackDescriptors],
|
|
21
|
+
>(({ descriptors, navigation, navigationState }) => {
|
|
22
|
+
if (!navigationState || !navigation) {
|
|
23
|
+
throw new Error(
|
|
24
|
+
"BlankStack requires navigation state and helpers from its integration.",
|
|
130
25
|
);
|
|
26
|
+
}
|
|
131
27
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
</NavigationHostProvider>
|
|
141
|
-
);
|
|
142
|
-
},
|
|
143
|
-
);
|
|
28
|
+
return (
|
|
29
|
+
<StackView
|
|
30
|
+
state={navigationState}
|
|
31
|
+
navigation={navigation}
|
|
32
|
+
descriptors={descriptors}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
});
|
|
@@ -4,11 +4,6 @@ import {
|
|
|
4
4
|
type StackRouterOptions,
|
|
5
5
|
unstable_integrateWithRouter,
|
|
6
6
|
} from "expo-router";
|
|
7
|
-
import {
|
|
8
|
-
NavigationContext,
|
|
9
|
-
NavigationRouteContext,
|
|
10
|
-
} from "expo-router/react-navigation";
|
|
11
|
-
import type { NavigationScreenProviderComponent } from "../../providers/navigation/navigation-host.provider";
|
|
12
7
|
import type { BlankStackNavigationOptions } from "../../types/blank-stack.types";
|
|
13
8
|
import {
|
|
14
9
|
BlankStackNavigator,
|
|
@@ -18,22 +13,6 @@ import {
|
|
|
18
13
|
|
|
19
14
|
type BlankStackExpoRouterParamList = Record<string, object | undefined>;
|
|
20
15
|
|
|
21
|
-
const ExpoRouterScreenProvider: NavigationScreenProviderComponent = ({
|
|
22
|
-
children,
|
|
23
|
-
navigation,
|
|
24
|
-
route,
|
|
25
|
-
}) => (
|
|
26
|
-
<NavigationContext.Provider value={navigation as never}>
|
|
27
|
-
<NavigationRouteContext.Provider value={route as never}>
|
|
28
|
-
{children}
|
|
29
|
-
</NavigationRouteContext.Provider>
|
|
30
|
-
</NavigationContext.Provider>
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
const expoRouterNavigationHost = {
|
|
34
|
-
ScreenProvider: ExpoRouterScreenProvider,
|
|
35
|
-
};
|
|
36
|
-
|
|
37
16
|
export const BlankStack = unstable_integrateWithRouter<
|
|
38
17
|
BlankStackNavigationOptions,
|
|
39
18
|
StackNavigationState<BlankStackExpoRouterParamList>,
|
|
@@ -44,14 +23,12 @@ export const BlankStack = unstable_integrateWithRouter<
|
|
|
44
23
|
createProps: ({ state, navigation }) => ({
|
|
45
24
|
navigationState: state,
|
|
46
25
|
navigation,
|
|
47
|
-
navigationHost: expoRouterNavigationHost,
|
|
48
26
|
}),
|
|
49
27
|
});
|
|
50
28
|
|
|
51
29
|
export const BlankStackScreen = BlankStack.Screen;
|
|
52
30
|
|
|
53
31
|
export type {
|
|
54
|
-
BlankStackFactoryOptions,
|
|
55
32
|
BlankStackNavigationEventMap,
|
|
56
33
|
BlankStackNavigationOptions,
|
|
57
34
|
BlankStackNavigationProp,
|