react-native-screen-transitions 3.1.0 → 3.2.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/lib/commonjs/blank-stack/components/screens.js +2 -2
- package/lib/commonjs/blank-stack/components/screens.js.map +1 -1
- package/lib/commonjs/blank-stack/components/stack-view.js +42 -51
- package/lib/commonjs/blank-stack/components/stack-view.js.map +1 -1
- package/lib/commonjs/{shared/components → blank-stack}/controllers/blank-stack-lifecycle.js +17 -8
- package/lib/commonjs/blank-stack/controllers/blank-stack-lifecycle.js.map +1 -0
- package/lib/commonjs/component-stack/components/component-view.js +63 -0
- package/lib/commonjs/component-stack/components/component-view.js.map +1 -0
- package/lib/commonjs/component-stack/components/screens.js +64 -0
- package/lib/commonjs/component-stack/components/screens.js.map +1 -0
- package/lib/commonjs/component-stack/controllers/component-stack-lifecycle.js +82 -0
- package/lib/commonjs/component-stack/controllers/component-stack-lifecycle.js.map +1 -0
- package/lib/commonjs/component-stack/hooks/use-component-navigation-builder.js +321 -0
- package/lib/commonjs/component-stack/hooks/use-component-navigation-builder.js.map +1 -0
- package/lib/commonjs/component-stack/hooks/use-component-navigation.js +28 -0
- package/lib/commonjs/component-stack/hooks/use-component-navigation.js.map +1 -0
- package/lib/commonjs/component-stack/index.js +20 -0
- package/lib/commonjs/component-stack/index.js.map +1 -0
- package/lib/commonjs/component-stack/navigators/create-component-navigator.js +97 -0
- package/lib/commonjs/component-stack/navigators/create-component-navigator.js.map +1 -0
- package/lib/commonjs/component-stack/types.js.map +1 -0
- package/lib/commonjs/{shared/components → native-stack}/controllers/native-stack-lifecycle.js +18 -9
- package/lib/commonjs/native-stack/controllers/native-stack-lifecycle.js.map +1 -0
- package/lib/commonjs/native-stack/views/NativeStackView.native.js +120 -121
- package/lib/commonjs/native-stack/views/NativeStackView.native.js.map +1 -1
- package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js +64 -0
- package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js.map +1 -0
- package/lib/commonjs/shared/components/overlay/index.js +15 -0
- package/lib/commonjs/shared/components/overlay/index.js.map +1 -0
- package/lib/commonjs/shared/components/overlay/variations/container-overlay.js +99 -0
- package/lib/commonjs/shared/components/overlay/variations/container-overlay.js.map +1 -0
- package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +51 -0
- package/lib/commonjs/shared/components/overlay/variations/float-overlay.js.map +1 -0
- package/lib/commonjs/shared/components/overlay/variations/overlay-host.js +124 -0
- package/lib/commonjs/shared/components/overlay/variations/overlay-host.js.map +1 -0
- package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js +47 -0
- package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js.map +1 -0
- package/lib/commonjs/shared/components/root-transition-aware.js +2 -2
- package/lib/commonjs/shared/components/root-transition-aware.js.map +1 -1
- package/lib/commonjs/shared/constants.js +2 -31
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/hooks/animation/use-associated-style.js +2 -2
- package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +1 -1
- package/lib/commonjs/shared/hooks/animation/use-high-refresh-rate.js +30 -0
- package/lib/commonjs/shared/hooks/animation/use-high-refresh-rate.js.map +1 -0
- package/lib/commonjs/shared/hooks/animation/use-screen-animation.js +16 -9
- package/lib/commonjs/shared/hooks/animation/use-screen-animation.js.map +1 -1
- package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js +1 -1
- package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js.map +1 -1
- package/lib/commonjs/shared/hooks/gestures/use-scroll-registry.js.map +1 -1
- package/lib/commonjs/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-closing-route-keys.js +1 -1
- package/lib/commonjs/shared/hooks/navigation/use-closing-route-keys.js.map +1 -0
- package/lib/commonjs/shared/hooks/navigation/use-previous.js.map +1 -0
- package/lib/commonjs/shared/hooks/navigation/use-stack.js +37 -0
- package/lib/commonjs/shared/hooks/navigation/use-stack.js.map +1 -0
- package/lib/commonjs/shared/providers/gestures.provider.js +1 -1
- package/lib/commonjs/shared/providers/gestures.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/register-bounds.provider.js +11 -5
- package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/{keys.provider.js → screen/keys.provider.js} +12 -0
- package/lib/commonjs/shared/providers/screen/keys.provider.js.map +1 -0
- package/lib/commonjs/shared/providers/{screen-transition.provider.js → screen/screen-composer.js} +7 -7
- package/lib/commonjs/shared/providers/screen/screen-composer.js.map +1 -0
- package/lib/commonjs/shared/providers/{transition-styles.provider.js → screen/styles.provider.js} +12 -13
- package/lib/commonjs/shared/providers/screen/styles.provider.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/core.provider.js +61 -0
- package/lib/commonjs/shared/providers/stack/core.provider.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/direct.provider.js +158 -0
- package/lib/commonjs/shared/providers/stack/direct.provider.js.map +1 -0
- package/lib/commonjs/{blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.js → shared/providers/stack/helpers/active-screens-limit.js} +1 -1
- package/lib/commonjs/shared/providers/stack/helpers/active-screens-limit.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/helpers/use-local-routes.js +93 -0
- package/lib/commonjs/shared/providers/stack/helpers/use-local-routes.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/managed.provider.js +155 -0
- package/lib/commonjs/shared/providers/stack/managed.provider.js.map +1 -0
- package/lib/commonjs/shared/stores/bounds.store.js.map +1 -1
- package/lib/commonjs/shared/types/index.js +19 -0
- package/lib/commonjs/shared/types/index.js.map +1 -0
- package/lib/commonjs/shared/types/overlay.types.js +6 -0
- package/lib/commonjs/shared/types/overlay.types.js.map +1 -0
- package/lib/commonjs/shared/types/screen.types.js +6 -0
- package/lib/commonjs/shared/types/screen.types.js.map +1 -0
- package/lib/commonjs/shared/types/{core.types.js → stack.types.js} +1 -1
- package/lib/commonjs/shared/types/{core.types.js.map → stack.types.js.map} +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/styles.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
- package/lib/commonjs/shared/utils/create-provider.js +16 -13
- package/lib/commonjs/shared/utils/create-provider.js.map +1 -1
- package/lib/commonjs/shared/utils/gesture/check-gesture-activation.js.map +1 -1
- package/lib/commonjs/shared/utils/navigation/align-routes-with-latest.js +51 -0
- package/lib/commonjs/shared/utils/navigation/align-routes-with-latest.js.map +1 -0
- package/lib/commonjs/shared/utils/navigation/are-descriptors-equal.js.map +1 -0
- package/lib/commonjs/shared/utils/navigation/compose-descriptors.js.map +1 -0
- package/lib/commonjs/shared/utils/navigation/have-same-route-keys.js.map +1 -0
- package/lib/commonjs/shared/utils/navigation/routes-are-identical.js.map +1 -0
- package/lib/commonjs/shared/utils/navigation/sync-routes-with-removed.js +95 -0
- package/lib/commonjs/shared/utils/navigation/sync-routes-with-removed.js.map +1 -0
- package/lib/commonjs/shared/utils/read-shared-value.js +17 -0
- package/lib/commonjs/shared/utils/read-shared-value.js.map +1 -0
- package/lib/commonjs/shared/utils/reset-stores-for-screen.js +2 -1
- package/lib/commonjs/shared/utils/reset-stores-for-screen.js.map +1 -1
- package/lib/module/blank-stack/components/screens.js +2 -2
- package/lib/module/blank-stack/components/screens.js.map +1 -1
- package/lib/module/blank-stack/components/stack-view.js +41 -50
- package/lib/module/blank-stack/components/stack-view.js.map +1 -1
- package/lib/module/{shared/components → blank-stack}/controllers/blank-stack-lifecycle.js +18 -9
- package/lib/module/blank-stack/controllers/blank-stack-lifecycle.js.map +1 -0
- package/lib/module/component-stack/components/component-view.js +58 -0
- package/lib/module/component-stack/components/component-view.js.map +1 -0
- package/lib/module/component-stack/components/screens.js +58 -0
- package/lib/module/component-stack/components/screens.js.map +1 -0
- package/lib/module/component-stack/controllers/component-stack-lifecycle.js +76 -0
- package/lib/module/component-stack/controllers/component-stack-lifecycle.js.map +1 -0
- package/lib/module/component-stack/hooks/use-component-navigation-builder.js +316 -0
- package/lib/module/component-stack/hooks/use-component-navigation-builder.js.map +1 -0
- package/lib/module/component-stack/hooks/use-component-navigation.js +25 -0
- package/lib/module/component-stack/hooks/use-component-navigation.js.map +1 -0
- package/lib/module/component-stack/index.js +5 -0
- package/lib/module/component-stack/index.js.map +1 -0
- package/lib/module/component-stack/navigators/create-component-navigator.js +91 -0
- package/lib/module/component-stack/navigators/create-component-navigator.js.map +1 -0
- package/lib/module/component-stack/types.js.map +1 -0
- package/lib/module/{shared/components → native-stack}/controllers/native-stack-lifecycle.js +18 -9
- package/lib/module/native-stack/controllers/native-stack-lifecycle.js.map +1 -0
- package/lib/module/native-stack/views/NativeStackView.native.js +121 -122
- package/lib/module/native-stack/views/NativeStackView.native.js.map +1 -1
- package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/module/shared/components/overlay/helpers/get-active-overlay.js +59 -0
- package/lib/module/shared/components/overlay/helpers/get-active-overlay.js.map +1 -0
- package/lib/module/shared/components/overlay/index.js +11 -0
- package/lib/module/shared/components/overlay/index.js.map +1 -0
- package/lib/module/shared/components/overlay/variations/container-overlay.js +97 -0
- package/lib/module/shared/components/overlay/variations/container-overlay.js.map +1 -0
- package/lib/module/shared/components/overlay/variations/float-overlay.js +48 -0
- package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -0
- package/lib/module/shared/components/overlay/variations/overlay-host.js +120 -0
- package/lib/module/shared/components/overlay/variations/overlay-host.js.map +1 -0
- package/lib/module/shared/components/overlay/variations/screen-overlay.js +44 -0
- package/lib/module/shared/components/overlay/variations/screen-overlay.js.map +1 -0
- package/lib/module/shared/components/root-transition-aware.js +2 -2
- package/lib/module/shared/components/root-transition-aware.js.map +1 -1
- package/lib/module/shared/constants.js +0 -29
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/hooks/animation/use-associated-style.js +2 -2
- package/lib/module/shared/hooks/animation/use-associated-style.js.map +1 -1
- package/lib/module/shared/hooks/animation/use-high-refresh-rate.js +24 -0
- package/lib/module/shared/hooks/animation/use-high-refresh-rate.js.map +1 -0
- package/lib/module/shared/hooks/animation/use-screen-animation.js +16 -9
- package/lib/module/shared/hooks/animation/use-screen-animation.js.map +1 -1
- package/lib/module/shared/hooks/gestures/use-build-gestures.js +1 -1
- package/lib/module/shared/hooks/gestures/use-build-gestures.js.map +1 -1
- package/lib/module/shared/hooks/gestures/use-scroll-registry.js.map +1 -1
- package/lib/module/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-closing-route-keys.js +1 -1
- package/lib/module/shared/hooks/navigation/use-closing-route-keys.js.map +1 -0
- package/lib/module/shared/hooks/navigation/use-previous.js.map +1 -0
- package/lib/module/shared/hooks/navigation/use-stack.js +33 -0
- package/lib/module/shared/hooks/navigation/use-stack.js.map +1 -0
- package/lib/module/shared/providers/gestures.provider.js +1 -1
- package/lib/module/shared/providers/gestures.provider.js.map +1 -1
- package/lib/module/shared/providers/register-bounds.provider.js +11 -5
- package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
- package/lib/module/shared/providers/{keys.provider.js → screen/keys.provider.js} +12 -0
- package/lib/module/shared/providers/screen/keys.provider.js.map +1 -0
- package/lib/module/shared/providers/{screen-transition.provider.js → screen/screen-composer.js} +6 -6
- package/lib/module/shared/providers/screen/screen-composer.js.map +1 -0
- package/lib/module/shared/providers/{transition-styles.provider.js → screen/styles.provider.js} +10 -10
- package/lib/module/shared/providers/screen/styles.provider.js.map +1 -0
- package/lib/module/shared/providers/stack/core.provider.js +55 -0
- package/lib/module/shared/providers/stack/core.provider.js.map +1 -0
- package/lib/module/shared/providers/stack/direct.provider.js +153 -0
- package/lib/module/shared/providers/stack/direct.provider.js.map +1 -0
- package/lib/module/{blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.js → shared/providers/stack/helpers/active-screens-limit.js} +1 -1
- package/lib/module/shared/providers/stack/helpers/active-screens-limit.js.map +1 -0
- package/lib/module/shared/providers/stack/helpers/use-local-routes.js +87 -0
- package/lib/module/shared/providers/stack/helpers/use-local-routes.js.map +1 -0
- package/lib/module/shared/providers/stack/managed.provider.js +150 -0
- package/lib/module/shared/providers/stack/managed.provider.js.map +1 -0
- package/lib/module/shared/stores/bounds.store.js.map +1 -1
- package/lib/module/shared/types/index.js +4 -0
- package/lib/module/shared/types/index.js.map +1 -0
- package/lib/module/shared/types/overlay.types.js +4 -0
- package/lib/module/shared/types/overlay.types.js.map +1 -0
- package/lib/module/shared/types/screen.types.js +4 -0
- package/lib/module/shared/types/screen.types.js.map +1 -0
- package/lib/module/shared/types/stack.types.js +4 -0
- package/lib/{commonjs/shared/types/utils.types.js.map → module/shared/types/stack.types.js.map} +1 -1
- package/lib/module/shared/utils/bounds/helpers/styles.js.map +1 -1
- package/lib/module/shared/utils/bounds/index.js.map +1 -1
- package/lib/module/shared/utils/create-provider.js +16 -13
- package/lib/module/shared/utils/create-provider.js.map +1 -1
- package/lib/module/shared/utils/gesture/check-gesture-activation.js.map +1 -1
- package/lib/module/shared/utils/navigation/align-routes-with-latest.js +46 -0
- package/lib/module/shared/utils/navigation/align-routes-with-latest.js.map +1 -0
- package/lib/module/shared/utils/navigation/are-descriptors-equal.js.map +1 -0
- package/lib/module/shared/utils/navigation/compose-descriptors.js.map +1 -0
- package/lib/module/shared/utils/navigation/have-same-route-keys.js.map +1 -0
- package/lib/module/shared/utils/navigation/routes-are-identical.js.map +1 -0
- package/lib/module/shared/utils/navigation/sync-routes-with-removed.js +90 -0
- package/lib/module/shared/utils/navigation/sync-routes-with-removed.js.map +1 -0
- package/lib/module/shared/utils/read-shared-value.js +14 -0
- package/lib/module/shared/utils/read-shared-value.js.map +1 -0
- package/lib/module/shared/utils/reset-stores-for-screen.js +2 -2
- package/lib/module/shared/utils/reset-stores-for-screen.js.map +1 -1
- package/lib/typescript/blank-stack/components/stack-view.d.ts +2 -1
- package/lib/typescript/blank-stack/components/stack-view.d.ts.map +1 -1
- package/lib/typescript/{shared/components → blank-stack}/controllers/blank-stack-lifecycle.d.ts +2 -1
- package/lib/typescript/blank-stack/controllers/blank-stack-lifecycle.d.ts.map +1 -0
- package/lib/typescript/blank-stack/types.d.ts +9 -50
- package/lib/typescript/blank-stack/types.d.ts.map +1 -1
- package/lib/typescript/component-stack/components/component-view.d.ts +4 -0
- package/lib/typescript/component-stack/components/component-view.d.ts.map +1 -0
- package/lib/typescript/component-stack/components/screens.d.ts +9 -0
- package/lib/typescript/component-stack/components/screens.d.ts.map +1 -0
- package/lib/typescript/component-stack/controllers/component-stack-lifecycle.d.ts +10 -0
- package/lib/typescript/component-stack/controllers/component-stack-lifecycle.d.ts.map +1 -0
- package/lib/typescript/component-stack/hooks/use-component-navigation-builder.d.ts +19 -0
- package/lib/typescript/component-stack/hooks/use-component-navigation-builder.d.ts.map +1 -0
- package/lib/typescript/component-stack/hooks/use-component-navigation.d.ts +19 -0
- package/lib/typescript/component-stack/hooks/use-component-navigation.d.ts.map +1 -0
- package/lib/typescript/component-stack/index.d.ts +4 -0
- package/lib/typescript/component-stack/index.d.ts.map +1 -0
- package/lib/typescript/component-stack/navigators/create-component-navigator.d.ts +35 -0
- package/lib/typescript/component-stack/navigators/create-component-navigator.d.ts.map +1 -0
- package/lib/typescript/component-stack/types.d.ts +206 -0
- package/lib/typescript/component-stack/types.d.ts.map +1 -0
- package/lib/typescript/native-stack/controllers/native-stack-lifecycle.d.ts.map +1 -0
- package/lib/typescript/native-stack/index.d.ts +1 -1
- package/lib/typescript/native-stack/index.d.ts.map +1 -1
- package/lib/typescript/native-stack/types.d.ts +9 -6
- package/lib/typescript/native-stack/types.d.ts.map +1 -1
- package/lib/typescript/native-stack/views/NativeStackView.native.d.ts +2 -10
- package/lib/typescript/native-stack/views/NativeStackView.native.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts +20 -0
- package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts.map +1 -0
- package/lib/typescript/shared/components/overlay/index.d.ts +9 -0
- package/lib/typescript/shared/components/overlay/index.d.ts.map +1 -0
- package/lib/typescript/shared/components/overlay/variations/container-overlay.d.ts +8 -0
- package/lib/typescript/shared/components/overlay/variations/container-overlay.d.ts.map +1 -0
- package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts +6 -0
- package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts.map +1 -0
- package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts +12 -0
- package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -0
- package/lib/typescript/shared/components/overlay/variations/screen-overlay.d.ts +6 -0
- package/lib/typescript/shared/components/overlay/variations/screen-overlay.d.ts.map +1 -0
- package/lib/typescript/shared/configs/index.d.ts.map +1 -1
- package/lib/typescript/shared/configs/presets.d.ts +1 -1
- package/lib/typescript/shared/configs/presets.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts +1 -16
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/animation/use-high-refresh-rate.d.ts +6 -0
- package/lib/typescript/shared/hooks/animation/use-high-refresh-rate.d.ts.map +1 -0
- package/lib/typescript/shared/hooks/animation/use-screen-animation.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/gestures/use-build-gestures.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/gestures/use-scroll-registry.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/navigation/use-closing-route-keys.d.ts.map +1 -0
- package/lib/typescript/shared/hooks/navigation/use-previous.d.ts.map +1 -0
- package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +71 -0
- package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -0
- package/lib/typescript/shared/index.d.ts +31 -33
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures.provider.d.ts +4 -2
- package/lib/typescript/shared/providers/gestures.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/keys.provider.d.ts +29 -0
- package/lib/typescript/shared/providers/screen/keys.provider.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/screen-composer.d.ts +13 -0
- package/lib/typescript/shared/providers/screen/screen-composer.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles.provider.d.ts +13 -0
- package/lib/typescript/shared/providers/screen/styles.provider.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/core.provider.d.ts +11 -0
- package/lib/typescript/shared/providers/stack/core.provider.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/direct.provider.d.ts +34 -0
- package/lib/typescript/shared/providers/stack/direct.provider.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/helpers/active-screens-limit.d.ts +9 -0
- package/lib/typescript/shared/providers/stack/helpers/active-screens-limit.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/helpers/use-local-routes.d.ts +19 -0
- package/lib/typescript/shared/providers/stack/helpers/use-local-routes.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/managed.provider.d.ts +39 -0
- package/lib/typescript/shared/providers/stack/managed.provider.d.ts.map +1 -0
- package/lib/typescript/shared/stores/animation.store.d.ts +1 -1
- package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/gesture.store.d.ts +2 -2
- package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
- package/lib/typescript/shared/types/animation.types.d.ts +3 -3
- package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/gesture.types.d.ts +0 -1
- package/lib/typescript/shared/types/gesture.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/index.d.ts +8 -0
- package/lib/typescript/shared/types/index.d.ts.map +1 -0
- package/lib/typescript/shared/types/overlay.types.d.ts +50 -0
- package/lib/typescript/shared/types/overlay.types.d.ts.map +1 -0
- package/lib/typescript/shared/types/{core.types.d.ts → screen.types.d.ts} +31 -6
- package/lib/typescript/shared/types/screen.types.d.ts.map +1 -0
- package/lib/typescript/shared/types/stack.types.d.ts +52 -0
- package/lib/typescript/shared/types/stack.types.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts +2 -1
- package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/styles.d.ts +1 -2
- package/lib/typescript/shared/utils/bounds/helpers/styles.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/index.d.ts +1 -9
- package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/types/builder.d.ts +9 -8
- package/lib/typescript/shared/utils/bounds/types/builder.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/types/geometry.d.ts +2 -1
- package/lib/typescript/shared/utils/bounds/types/geometry.d.ts.map +1 -1
- package/lib/typescript/shared/utils/create-provider.d.ts.map +1 -1
- package/lib/typescript/shared/utils/gesture/check-gesture-activation.d.ts +1 -1
- package/lib/typescript/shared/utils/gesture/check-gesture-activation.d.ts.map +1 -1
- package/lib/typescript/shared/utils/navigation/align-routes-with-latest.d.ts +13 -0
- package/lib/typescript/shared/utils/navigation/align-routes-with-latest.d.ts.map +1 -0
- package/lib/typescript/shared/utils/navigation/are-descriptors-equal.d.ts +2 -0
- package/lib/typescript/shared/utils/navigation/are-descriptors-equal.d.ts.map +1 -0
- package/lib/typescript/shared/utils/navigation/compose-descriptors.d.ts +6 -0
- package/lib/typescript/shared/utils/navigation/compose-descriptors.d.ts.map +1 -0
- package/lib/typescript/shared/utils/navigation/have-same-route-keys.d.ts +6 -0
- package/lib/typescript/shared/utils/navigation/have-same-route-keys.d.ts.map +1 -0
- package/lib/typescript/shared/utils/navigation/routes-are-identical.d.ts +6 -0
- package/lib/typescript/shared/utils/navigation/routes-are-identical.d.ts.map +1 -0
- package/lib/typescript/shared/utils/navigation/sync-routes-with-removed.d.ts +21 -0
- package/lib/typescript/shared/utils/navigation/sync-routes-with-removed.d.ts.map +1 -0
- package/lib/typescript/shared/utils/read-shared-value.d.ts +7 -0
- package/lib/typescript/shared/utils/read-shared-value.d.ts.map +1 -0
- package/lib/typescript/shared/utils/reset-stores-for-screen.d.ts +4 -3
- package/lib/typescript/shared/utils/reset-stores-for-screen.d.ts.map +1 -1
- package/package.json +7 -2
- package/src/blank-stack/components/screens.tsx +2 -2
- package/src/blank-stack/components/stack-view.tsx +59 -67
- package/src/{shared/components → blank-stack}/controllers/blank-stack-lifecycle.tsx +18 -11
- package/src/blank-stack/types.ts +10 -62
- package/src/component-stack/components/component-view.tsx +72 -0
- package/src/component-stack/components/screens.tsx +86 -0
- package/src/component-stack/controllers/component-stack-lifecycle.tsx +80 -0
- package/src/component-stack/hooks/use-component-navigation-builder.tsx +388 -0
- package/src/component-stack/hooks/use-component-navigation.tsx +22 -0
- package/src/component-stack/index.ts +16 -0
- package/src/component-stack/navigators/create-component-navigator.tsx +104 -0
- package/src/component-stack/types.ts +209 -0
- package/src/{shared/components → native-stack}/controllers/native-stack-lifecycle.tsx +18 -11
- package/src/native-stack/index.ts +1 -0
- package/src/native-stack/types.ts +11 -7
- package/src/native-stack/views/NativeStackView.native.tsx +42 -69
- package/src/shared/__tests__/sync-routes-with-removed.test.ts +283 -0
- package/src/shared/components/create-transition-aware-component.tsx +5 -6
- package/src/shared/components/overlay/helpers/get-active-overlay.ts +64 -0
- package/src/shared/components/overlay/index.ts +9 -0
- package/src/shared/components/overlay/variations/container-overlay.tsx +98 -0
- package/src/shared/components/overlay/variations/float-overlay.tsx +44 -0
- package/src/shared/components/overlay/variations/overlay-host.tsx +148 -0
- package/src/shared/components/overlay/variations/screen-overlay.tsx +51 -0
- package/src/shared/components/root-transition-aware.tsx +2 -2
- package/src/shared/configs/presets.ts +1 -1
- package/src/shared/constants.ts +1 -33
- package/src/shared/hooks/animation/use-associated-style.tsx +2 -2
- package/src/shared/hooks/animation/use-high-refresh-rate.tsx +28 -0
- package/src/shared/hooks/animation/use-screen-animation.tsx +19 -15
- package/src/shared/hooks/gestures/use-build-gestures.tsx +1 -2
- package/src/shared/hooks/gestures/use-scroll-registry.tsx +3 -4
- package/src/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-closing-route-keys.tsx +1 -1
- package/src/shared/hooks/navigation/use-stack.tsx +100 -0
- package/src/shared/index.ts +7 -3
- package/src/shared/providers/gestures.provider.tsx +6 -2
- package/src/shared/providers/register-bounds.provider.tsx +13 -6
- package/src/shared/providers/screen/keys.provider.tsx +72 -0
- package/src/shared/providers/screen/screen-composer.tsx +38 -0
- package/src/shared/providers/{transition-styles.provider.tsx → screen/styles.provider.tsx} +14 -13
- package/src/shared/providers/stack/core.provider.tsx +64 -0
- package/src/shared/providers/stack/direct.provider.tsx +228 -0
- package/src/{blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.ts → shared/providers/stack/helpers/active-screens-limit.ts} +10 -4
- package/src/shared/providers/stack/helpers/use-local-routes.tsx +133 -0
- package/src/shared/providers/stack/managed.provider.tsx +226 -0
- package/src/shared/stores/animation.store.ts +1 -1
- package/src/shared/stores/bounds.store.ts +4 -5
- package/src/shared/stores/gesture.store.ts +2 -2
- package/src/shared/types/animation.types.ts +3 -3
- package/src/shared/types/gesture.types.ts +0 -2
- package/src/shared/types/index.ts +47 -0
- package/src/shared/types/overlay.types.ts +62 -0
- package/src/shared/types/{core.types.ts → screen.types.ts} +40 -7
- package/src/shared/types/stack.types.ts +59 -0
- package/src/shared/utils/bounds/helpers/geometry.ts +1 -1
- package/src/shared/utils/bounds/helpers/style-composers.ts +1 -1
- package/src/shared/utils/bounds/helpers/styles.ts +1 -2
- package/src/shared/utils/bounds/index.ts +1 -9
- package/src/shared/utils/bounds/types/builder.ts +8 -8
- package/src/shared/utils/bounds/types/geometry.ts +1 -1
- package/src/shared/utils/create-provider.tsx +14 -16
- package/src/shared/utils/gesture/check-gesture-activation.ts +1 -1
- package/src/shared/utils/navigation/align-routes-with-latest.ts +68 -0
- package/src/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/are-descriptors-equal.ts +5 -5
- package/src/shared/utils/navigation/compose-descriptors.ts +21 -0
- package/src/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/have-same-route-keys.ts +6 -4
- package/src/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/routes-are-identical.ts +6 -4
- package/src/shared/utils/navigation/sync-routes-with-removed.ts +132 -0
- package/src/shared/utils/read-shared-value.ts +15 -0
- package/src/shared/utils/reset-stores-for-screen.ts +4 -3
- package/lib/commonjs/blank-stack/components/overlay.js +0 -156
- package/lib/commonjs/blank-stack/components/overlay.js.map +0 -1
- package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js +0 -72
- package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-closing-route-keys.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-previous.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js +0 -196
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/index.js +0 -61
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/index.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/types.js.map +0 -1
- package/lib/commonjs/native-stack/views/FooterComponent.js +0 -17
- package/lib/commonjs/native-stack/views/FooterComponent.js.map +0 -1
- package/lib/commonjs/shared/components/controllers/blank-stack-lifecycle.js.map +0 -1
- package/lib/commonjs/shared/components/controllers/native-stack-lifecycle.js.map +0 -1
- package/lib/commonjs/shared/providers/flags.provider.js +0 -25
- package/lib/commonjs/shared/providers/flags.provider.js.map +0 -1
- package/lib/commonjs/shared/providers/keys.provider.js.map +0 -1
- package/lib/commonjs/shared/providers/routes.provider.js +0 -48
- package/lib/commonjs/shared/providers/routes.provider.js.map +0 -1
- package/lib/commonjs/shared/providers/screen-transition.provider.js.map +0 -1
- package/lib/commonjs/shared/providers/transition-styles.provider.js.map +0 -1
- package/lib/commonjs/shared/types/utils.types.js +0 -2
- package/lib/commonjs/shared/utils/animation/compute-stack-progress.js +0 -20
- package/lib/commonjs/shared/utils/animation/compute-stack-progress.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/constants.js +0 -42
- package/lib/commonjs/shared/utils/bounds/constants.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/is-bounds-equal.js +0 -19
- package/lib/commonjs/shared/utils/bounds/helpers/is-bounds-equal.js.map +0 -1
- package/lib/commonjs/shared/utils/gesture/apply-offset-rules.js +0 -224
- package/lib/commonjs/shared/utils/gesture/apply-offset-rules.js.map +0 -1
- package/lib/commonjs/shared/utils/reanimated/version.js +0 -12
- package/lib/commonjs/shared/utils/reanimated/version.js.map +0 -1
- package/lib/module/blank-stack/components/overlay.js +0 -152
- package/lib/module/blank-stack/components/overlay.js.map +0 -1
- package/lib/module/blank-stack/hooks/use-overlay-animation.js +0 -68
- package/lib/module/blank-stack/hooks/use-overlay-animation.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-closing-route-keys.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-previous.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js +0 -190
- package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/index.js +0 -55
- package/lib/module/blank-stack/utils/with-stack-navigation/index.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/types.js.map +0 -1
- package/lib/module/native-stack/views/FooterComponent.js +0 -13
- package/lib/module/native-stack/views/FooterComponent.js.map +0 -1
- package/lib/module/shared/components/controllers/blank-stack-lifecycle.js.map +0 -1
- package/lib/module/shared/components/controllers/native-stack-lifecycle.js.map +0 -1
- package/lib/module/shared/providers/flags.provider.js +0 -19
- package/lib/module/shared/providers/flags.provider.js.map +0 -1
- package/lib/module/shared/providers/keys.provider.js.map +0 -1
- package/lib/module/shared/providers/routes.provider.js +0 -42
- package/lib/module/shared/providers/routes.provider.js.map +0 -1
- package/lib/module/shared/providers/screen-transition.provider.js.map +0 -1
- package/lib/module/shared/providers/transition-styles.provider.js.map +0 -1
- package/lib/module/shared/types/core.types.js +0 -4
- package/lib/module/shared/types/core.types.js.map +0 -1
- package/lib/module/shared/types/utils.types.js +0 -2
- package/lib/module/shared/types/utils.types.js.map +0 -1
- package/lib/module/shared/utils/animation/compute-stack-progress.js +0 -15
- package/lib/module/shared/utils/animation/compute-stack-progress.js.map +0 -1
- package/lib/module/shared/utils/bounds/constants.js +0 -37
- package/lib/module/shared/utils/bounds/constants.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/is-bounds-equal.js +0 -14
- package/lib/module/shared/utils/bounds/helpers/is-bounds-equal.js.map +0 -1
- package/lib/module/shared/utils/gesture/apply-offset-rules.js +0 -219
- package/lib/module/shared/utils/gesture/apply-offset-rules.js.map +0 -1
- package/lib/module/shared/utils/reanimated/version.js +0 -7
- package/lib/module/shared/utils/reanimated/version.js.map +0 -1
- package/lib/typescript/blank-stack/components/overlay.d.ts +0 -5
- package/lib/typescript/blank-stack/components/overlay.d.ts.map +0 -1
- package/lib/typescript/blank-stack/hooks/use-overlay-animation.d.ts +0 -12
- package/lib/typescript/blank-stack/hooks/use-overlay-animation.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.d.ts +0 -3
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.d.ts +0 -4
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.d.ts +0 -4
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.d.ts +0 -3
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.d.ts +0 -3
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/hooks/use-closing-route-keys.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/hooks/use-previous.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.d.ts +0 -20
- package/lib/typescript/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/index.d.ts +0 -4
- package/lib/typescript/blank-stack/utils/with-stack-navigation/index.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/types.d.ts +0 -22
- package/lib/typescript/blank-stack/utils/with-stack-navigation/types.d.ts.map +0 -1
- package/lib/typescript/native-stack/views/FooterComponent.d.ts +0 -7
- package/lib/typescript/native-stack/views/FooterComponent.d.ts.map +0 -1
- package/lib/typescript/shared/components/controllers/blank-stack-lifecycle.d.ts.map +0 -1
- package/lib/typescript/shared/components/controllers/native-stack-lifecycle.d.ts.map +0 -1
- package/lib/typescript/shared/providers/flags.provider.d.ts +0 -10
- package/lib/typescript/shared/providers/flags.provider.d.ts.map +0 -1
- package/lib/typescript/shared/providers/keys.provider.d.ts +0 -18
- package/lib/typescript/shared/providers/keys.provider.d.ts.map +0 -1
- package/lib/typescript/shared/providers/routes.provider.d.ts +0 -19
- package/lib/typescript/shared/providers/routes.provider.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen-transition.provider.d.ts +0 -14
- package/lib/typescript/shared/providers/screen-transition.provider.d.ts.map +0 -1
- package/lib/typescript/shared/providers/transition-styles.provider.d.ts +0 -14
- package/lib/typescript/shared/providers/transition-styles.provider.d.ts.map +0 -1
- package/lib/typescript/shared/types/core.types.d.ts.map +0 -1
- package/lib/typescript/shared/types/utils.types.d.ts +0 -5
- package/lib/typescript/shared/types/utils.types.d.ts.map +0 -1
- package/lib/typescript/shared/utils/animation/compute-stack-progress.d.ts +0 -3
- package/lib/typescript/shared/utils/animation/compute-stack-progress.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/constants.d.ts +0 -7
- package/lib/typescript/shared/utils/bounds/constants.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/is-bounds-equal.d.ts +0 -7
- package/lib/typescript/shared/utils/bounds/helpers/is-bounds-equal.d.ts.map +0 -1
- package/lib/typescript/shared/utils/gesture/apply-offset-rules.d.ts +0 -38
- package/lib/typescript/shared/utils/gesture/apply-offset-rules.d.ts.map +0 -1
- package/lib/typescript/shared/utils/reanimated/version.d.ts +0 -2
- package/lib/typescript/shared/utils/reanimated/version.d.ts.map +0 -1
- package/src/blank-stack/components/overlay.tsx +0 -169
- package/src/blank-stack/hooks/use-overlay-animation.tsx +0 -86
- package/src/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.ts +0 -17
- package/src/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.tsx +0 -267
- package/src/blank-stack/utils/with-stack-navigation/index.tsx +0 -74
- package/src/blank-stack/utils/with-stack-navigation/types.ts +0 -35
- package/src/native-stack/views/FooterComponent.tsx +0 -10
- package/src/shared/providers/flags.provider.tsx +0 -21
- package/src/shared/providers/keys.provider.tsx +0 -57
- package/src/shared/providers/routes.provider.tsx +0 -54
- package/src/shared/providers/screen-transition.provider.tsx +0 -41
- package/src/shared/types/utils.types.ts +0 -4
- package/src/shared/utils/animation/compute-stack-progress.ts +0 -16
- package/src/shared/utils/bounds/constants.ts +0 -40
- package/src/shared/utils/bounds/helpers/is-bounds-equal.ts +0 -24
- package/src/shared/utils/gesture/apply-offset-rules.ts +0 -312
- package/src/shared/utils/reanimated/version.ts +0 -5
- /package/lib/commonjs/{blank-stack/utils/with-stack-navigation → component-stack}/types.js +0 -0
- /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-previous.js +0 -0
- /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/are-descriptors-equal.js +0 -0
- /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/compose-descriptors.js +0 -0
- /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/have-same-route-keys.js +0 -0
- /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/routes-are-identical.js +0 -0
- /package/lib/module/{blank-stack/utils/with-stack-navigation → component-stack}/types.js +0 -0
- /package/lib/module/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-previous.js +0 -0
- /package/lib/module/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/are-descriptors-equal.js +0 -0
- /package/lib/module/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/compose-descriptors.js +0 -0
- /package/lib/module/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/have-same-route-keys.js +0 -0
- /package/lib/module/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/routes-are-identical.js +0 -0
- /package/lib/typescript/{shared/components → native-stack}/controllers/native-stack-lifecycle.d.ts +0 -0
- /package/lib/typescript/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-closing-route-keys.d.ts +0 -0
- /package/lib/typescript/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-previous.d.ts +0 -0
- /package/src/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-previous.tsx +0 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import type { DerivedValue } from "react-native-reanimated";
|
|
2
|
+
import type { ScreenTransitionConfig } from "../shared";
|
|
3
|
+
import type {
|
|
4
|
+
OverlayInterpolationProps,
|
|
5
|
+
ScreenInterpolationProps,
|
|
6
|
+
} from "../shared/types/animation.types";
|
|
7
|
+
import type { OverlayMode } from "../shared/types/overlay.types";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A synthetic route object for component navigation.
|
|
11
|
+
* Mimics React Navigation's Route type but without the navigation dependency.
|
|
12
|
+
*/
|
|
13
|
+
export interface ComponentRoute<Params = Record<string, unknown>> {
|
|
14
|
+
/** Unique identifier for this route instance */
|
|
15
|
+
key: string;
|
|
16
|
+
/** Name identifier for the screen */
|
|
17
|
+
name: string;
|
|
18
|
+
/** Optional parameters passed to the screen */
|
|
19
|
+
params?: Params;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Navigation action for dispatch method.
|
|
24
|
+
*/
|
|
25
|
+
type ComponentNavigationAction =
|
|
26
|
+
| { type: "PUSH"; name: string; params?: Record<string, unknown> }
|
|
27
|
+
| { type: "POP" }
|
|
28
|
+
| { type: "POP_BY_KEY"; key: string }
|
|
29
|
+
| { type: "NAVIGATE"; name: string; params?: Record<string, unknown> }
|
|
30
|
+
| { type: "RESET"; name?: string; params?: Record<string, unknown> }
|
|
31
|
+
| { type: string; source?: string; target?: string; payload?: unknown };
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Navigation object provided to screens and available via useComponentNavigation hook.
|
|
35
|
+
*/
|
|
36
|
+
export interface ComponentNavigation {
|
|
37
|
+
/** Push a new screen by name */
|
|
38
|
+
push: (name: string, params?: Record<string, unknown>) => void;
|
|
39
|
+
/** Pop the current screen */
|
|
40
|
+
pop: () => void;
|
|
41
|
+
/** Navigate back (alias for pop) */
|
|
42
|
+
goBack: () => void;
|
|
43
|
+
/** Navigate to a specific screen by name, reusing existing if present */
|
|
44
|
+
navigate: (name: string, params?: Record<string, unknown>) => void;
|
|
45
|
+
/** Check if we can go back */
|
|
46
|
+
canGoBack: () => boolean;
|
|
47
|
+
/** Reset to a specific screen or initial state */
|
|
48
|
+
reset: (name?: string, params?: Record<string, unknown>) => void;
|
|
49
|
+
/** Dispatch a navigation action (compatible with React Navigation's StackActions) */
|
|
50
|
+
dispatch: (action: ComponentNavigationAction) => void;
|
|
51
|
+
/** Get current navigation state (for gesture handling compatibility) */
|
|
52
|
+
getState: () => ComponentStackState;
|
|
53
|
+
/** Current index in the stack */
|
|
54
|
+
index: number;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Screen options for component stack, extending the base transition config.
|
|
59
|
+
*/
|
|
60
|
+
export type ComponentStackScreenTransitionConfig = ScreenTransitionConfig & {
|
|
61
|
+
/**
|
|
62
|
+
* Whether to detach the previous screen from the view hierarchy to save memory.
|
|
63
|
+
* Set it to `false` if you need the previous screen to be seen through the active screen.
|
|
64
|
+
*/
|
|
65
|
+
detachPreviousScreen?: boolean;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Props passed to overlay components.
|
|
70
|
+
*/
|
|
71
|
+
export type ComponentStackOverlayProps = {
|
|
72
|
+
/** Route of the currently focused screen in the stack. */
|
|
73
|
+
focusedRoute: ComponentRoute;
|
|
74
|
+
/** Index of the focused route in the stack. */
|
|
75
|
+
focusedIndex: number;
|
|
76
|
+
/** All routes currently in the stack. */
|
|
77
|
+
routes: ComponentRoute[];
|
|
78
|
+
/** Custom metadata from the focused screen's options. */
|
|
79
|
+
meta?: Record<string, unknown>;
|
|
80
|
+
/** Navigation object for the overlay. */
|
|
81
|
+
navigation: ComponentNavigation;
|
|
82
|
+
/** Animation values for the overlay. */
|
|
83
|
+
overlayAnimation: DerivedValue<OverlayInterpolationProps>;
|
|
84
|
+
/** Animation values for the screen. */
|
|
85
|
+
screenAnimation: DerivedValue<ScreenInterpolationProps>;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Props passed to container overlay components.
|
|
90
|
+
* Extends overlay props with children to wrap screen content.
|
|
91
|
+
*/
|
|
92
|
+
export type ComponentStackContainerOverlayProps = ComponentStackOverlayProps & {
|
|
93
|
+
/** The screen content to be wrapped by the container overlay. */
|
|
94
|
+
children: React.ReactNode;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Full navigation options for a component stack screen.
|
|
99
|
+
*/
|
|
100
|
+
export type ComponentStackNavigationOptions =
|
|
101
|
+
ComponentStackScreenTransitionConfig & {
|
|
102
|
+
/** Function that returns a React Element to display as overlay. */
|
|
103
|
+
overlay?:
|
|
104
|
+
| ((props: ComponentStackOverlayProps) => React.ReactNode)
|
|
105
|
+
| ((props: ComponentStackContainerOverlayProps) => React.ReactNode);
|
|
106
|
+
/**
|
|
107
|
+
* Layout: How the Overlay is positioned
|
|
108
|
+
* - 'float': Single persistent overlay above all screens (like iOS)
|
|
109
|
+
* - 'screen': Per-screen overlay that transitions with content
|
|
110
|
+
* - 'container': Wraps all screen content (for MaskedView, custom containers)
|
|
111
|
+
* @default 'screen'
|
|
112
|
+
*/
|
|
113
|
+
overlayMode?: OverlayMode;
|
|
114
|
+
/** Whether to show the overlay. Defaults to true when overlay is provided. */
|
|
115
|
+
overlayShown?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Whether inactive screens should be suspended from re-rendering.
|
|
118
|
+
* Defaults to `true` when `enableFreeze()` is run at the top of the application.
|
|
119
|
+
*/
|
|
120
|
+
freezeOnBlur?: boolean;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Descriptor for a component stack screen.
|
|
125
|
+
* Similar to React Navigation's Descriptor but simplified.
|
|
126
|
+
*/
|
|
127
|
+
export interface ComponentStackDescriptor {
|
|
128
|
+
/** The route object for this screen */
|
|
129
|
+
route: ComponentRoute;
|
|
130
|
+
/** Navigation object */
|
|
131
|
+
navigation: ComponentNavigation;
|
|
132
|
+
/** Render function for the screen content */
|
|
133
|
+
render: () => React.JSX.Element | null;
|
|
134
|
+
/** Screen options/configuration */
|
|
135
|
+
options: ComponentStackNavigationOptions;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* A scene in the component stack (route + descriptor pair).
|
|
140
|
+
*/
|
|
141
|
+
export interface ComponentStackScene {
|
|
142
|
+
route: ComponentRoute;
|
|
143
|
+
descriptor: ComponentStackDescriptor;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Map of route keys to descriptors.
|
|
148
|
+
*/
|
|
149
|
+
export type ComponentStackDescriptorMap = {
|
|
150
|
+
[key: string]: ComponentStackDescriptor;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Props passed to screen components.
|
|
155
|
+
*/
|
|
156
|
+
export interface ComponentStackScreenProps<Params = Record<string, unknown>> {
|
|
157
|
+
/** Navigation object for controlling the stack */
|
|
158
|
+
navigation: ComponentNavigation;
|
|
159
|
+
/** Route object with params */
|
|
160
|
+
route: ComponentRoute<Params>;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* State of the component navigation stack.
|
|
165
|
+
*/
|
|
166
|
+
export interface ComponentStackState {
|
|
167
|
+
/** All routes in the stack */
|
|
168
|
+
routes: ComponentRoute[];
|
|
169
|
+
/** Index of the currently focused route */
|
|
170
|
+
index: number;
|
|
171
|
+
/** Unique key for this stack instance */
|
|
172
|
+
key: string;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Screen definition for the component navigator.
|
|
177
|
+
*/
|
|
178
|
+
export interface ComponentScreenConfig {
|
|
179
|
+
/** Unique name for this screen */
|
|
180
|
+
name: string;
|
|
181
|
+
/** Component to render for this screen */
|
|
182
|
+
component: React.ComponentType<ComponentStackScreenProps<any>>;
|
|
183
|
+
/** Screen-specific options */
|
|
184
|
+
options?: ComponentStackNavigationOptions;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Props for the ComponentNavigator component.
|
|
189
|
+
*/
|
|
190
|
+
export interface ComponentNavigatorProps {
|
|
191
|
+
/** Screen definitions */
|
|
192
|
+
children: React.ReactNode;
|
|
193
|
+
/** Initial screen name to display */
|
|
194
|
+
initialRouteName?: string;
|
|
195
|
+
/** Default options applied to all screens */
|
|
196
|
+
screenOptions?: ComponentStackNavigationOptions;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Props for the ComponentScreen component.
|
|
201
|
+
*/
|
|
202
|
+
export interface ComponentScreenProps {
|
|
203
|
+
/** Unique name for this screen */
|
|
204
|
+
name: string;
|
|
205
|
+
/** Component to render */
|
|
206
|
+
component: React.ComponentType<ComponentStackScreenProps<any>>;
|
|
207
|
+
/** Screen-specific options */
|
|
208
|
+
options?: ComponentStackNavigationOptions;
|
|
209
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/** biome-ignore-all lint/style/noNonNullAssertion: <Lifecycles are rendered right under the gesture provider> */
|
|
2
2
|
import { useEffect, useLayoutEffect } from "react";
|
|
3
3
|
import { useDerivedValue } from "react-native-reanimated";
|
|
4
|
-
import
|
|
5
|
-
import { useSharedValueState } from "../../hooks/reanimated/use-shared-value-state";
|
|
6
|
-
import useStableCallback from "../../hooks/use-stable-callback";
|
|
7
|
-
import { useGestureContext } from "../../providers/gestures.provider";
|
|
8
|
-
import { useKeys } from "../../providers/keys.provider";
|
|
9
|
-
import { AnimationStore } from "../../stores/animation.store";
|
|
10
|
-
import { TRUE } from "../../types/state.types";
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
4
|
+
import { useHighRefreshRate } from "../../shared/hooks/animation/use-high-refresh-rate";
|
|
5
|
+
import { useSharedValueState } from "../../shared/hooks/reanimated/use-shared-value-state";
|
|
6
|
+
import useStableCallback from "../../shared/hooks/use-stable-callback";
|
|
7
|
+
import { useGestureContext } from "../../shared/providers/gestures.provider";
|
|
8
|
+
import { useKeys } from "../../shared/providers/screen/keys.provider";
|
|
9
|
+
import { AnimationStore } from "../../shared/stores/animation.store";
|
|
10
|
+
import { TRUE } from "../../shared/types/state.types";
|
|
11
|
+
import { startScreenTransition } from "../../shared/utils/animation/start-screen-transition";
|
|
12
|
+
import { resetStoresForScreen } from "../../shared/utils/reset-stores-for-screen";
|
|
13
|
+
import type { NativeStackDescriptor } from "../types";
|
|
14
14
|
|
|
15
15
|
export interface Props {
|
|
16
16
|
children: React.ReactNode;
|
|
@@ -34,7 +34,10 @@ export const NativeStackScreenLifecycleController = ({ children }: Props) => {
|
|
|
34
34
|
|
|
35
35
|
const animations = AnimationStore.getAll(current.route.key);
|
|
36
36
|
|
|
37
|
-
const
|
|
37
|
+
const { deactivateHighRefreshRate, activateHighRefreshRate } =
|
|
38
|
+
useHighRefreshRate(current);
|
|
39
|
+
|
|
40
|
+
const handleBeforeRemove = useStableCallback((e: any) => {
|
|
38
41
|
const isEnabled = current.options.enableTransitions;
|
|
39
42
|
|
|
40
43
|
const isFirstScreen = current.navigation.getState().index === 0;
|
|
@@ -47,7 +50,9 @@ export const NativeStackScreenLifecycleController = ({ children }: Props) => {
|
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
e.preventDefault();
|
|
53
|
+
activateHighRefreshRate();
|
|
50
54
|
const onAnimationFinish = (finished: boolean) => {
|
|
55
|
+
deactivateHighRefreshRate();
|
|
51
56
|
if (finished) {
|
|
52
57
|
current.navigation.dispatch(e.data.action);
|
|
53
58
|
|
|
@@ -67,10 +72,12 @@ export const NativeStackScreenLifecycleController = ({ children }: Props) => {
|
|
|
67
72
|
});
|
|
68
73
|
|
|
69
74
|
const handleInitialize = useStableCallback(() => {
|
|
75
|
+
activateHighRefreshRate();
|
|
70
76
|
startScreenTransition({
|
|
71
77
|
target: "open",
|
|
72
78
|
spec: current.options.transitionSpec,
|
|
73
79
|
animations,
|
|
80
|
+
onAnimationFinish: deactivateHighRefreshRate,
|
|
74
81
|
});
|
|
75
82
|
});
|
|
76
83
|
|
|
@@ -22,12 +22,8 @@ import type {
|
|
|
22
22
|
ScreenStackHeaderConfigProps,
|
|
23
23
|
SearchBarProps,
|
|
24
24
|
} from "react-native-screens";
|
|
25
|
-
import type {
|
|
26
|
-
|
|
27
|
-
export type Layout = {
|
|
28
|
-
width: number;
|
|
29
|
-
height: number;
|
|
30
|
-
};
|
|
25
|
+
import type { OverlayProps } from "../shared/types/overlay.types";
|
|
26
|
+
import type { ScreenTransitionConfig } from "../shared/types/screen.types";
|
|
31
27
|
|
|
32
28
|
export type NativeStackNavigationEventMap = {
|
|
33
29
|
/**
|
|
@@ -90,7 +86,7 @@ export type NativeStackNavigationHelpers = NavigationHelpers<
|
|
|
90
86
|
>;
|
|
91
87
|
|
|
92
88
|
// We want it to be an empty object because navigator does not have any additional props
|
|
93
|
-
|
|
89
|
+
type NativeStackNavigationConfig = {};
|
|
94
90
|
|
|
95
91
|
export type NativeStackHeaderProps = {
|
|
96
92
|
/**
|
|
@@ -143,6 +139,14 @@ export type NativeStackHeaderLeftProps = NativeStackHeaderRightProps & {
|
|
|
143
139
|
href?: string;
|
|
144
140
|
};
|
|
145
141
|
|
|
142
|
+
/**
|
|
143
|
+
* Props passed to overlay components in native-stack.
|
|
144
|
+
* Uses the shared OverlayProps type with native-stack's navigation type.
|
|
145
|
+
*/
|
|
146
|
+
export type NativeStackOverlayProps = OverlayProps<
|
|
147
|
+
NativeStackNavigationProp<ParamListBase>
|
|
148
|
+
>;
|
|
149
|
+
|
|
146
150
|
export type NativeStackScreenTransitionConfig = ScreenTransitionConfig & {
|
|
147
151
|
/**
|
|
148
152
|
* Whether to enable transitions. It sets the presentation to containedTransparentModal, animation none, and headerShown to false.
|
|
@@ -4,16 +4,12 @@ import {
|
|
|
4
4
|
HeaderBackContext,
|
|
5
5
|
HeaderHeightContext,
|
|
6
6
|
HeaderShownContext,
|
|
7
|
-
SafeAreaProviderCompat,
|
|
8
7
|
useFrameSize,
|
|
9
8
|
} from "@react-navigation/elements";
|
|
10
9
|
import {
|
|
11
10
|
NavigationContext,
|
|
12
11
|
NavigationRouteContext,
|
|
13
|
-
type ParamListBase,
|
|
14
|
-
type RouteProp,
|
|
15
12
|
StackActions,
|
|
16
|
-
type StackNavigationState,
|
|
17
13
|
usePreventRemoveContext,
|
|
18
14
|
useTheme,
|
|
19
15
|
} from "@react-navigation/native";
|
|
@@ -26,21 +22,21 @@ import {
|
|
|
26
22
|
useAnimatedValue,
|
|
27
23
|
View,
|
|
28
24
|
} from "react-native";
|
|
29
|
-
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
30
25
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
31
26
|
import {
|
|
32
27
|
type ScreenProps,
|
|
33
28
|
ScreenStack,
|
|
34
29
|
ScreenStackItem,
|
|
35
30
|
} from "react-native-screens";
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
} from "../
|
|
31
|
+
import { Overlay } from "../../shared/components/overlay";
|
|
32
|
+
import { ScreenComposer } from "../../shared/providers/screen/screen-composer";
|
|
33
|
+
import { withStackCore } from "../../shared/providers/stack/core.provider";
|
|
34
|
+
import {
|
|
35
|
+
type DirectStackContextValue,
|
|
36
|
+
withDirectStack,
|
|
37
|
+
} from "../../shared/providers/stack/direct.provider";
|
|
38
|
+
import { NativeStackScreenLifecycleController } from "../controllers/native-stack-lifecycle";
|
|
39
|
+
import type { NativeStackDescriptor } from "../types";
|
|
44
40
|
import { debounce } from "../utils/debounce";
|
|
45
41
|
import { getModalRouteKeys } from "../utils/getModalRoutesKeys";
|
|
46
42
|
import { AnimatedHeaderHeightContext } from "../utils/useAnimatedHeaderHeight";
|
|
@@ -468,14 +464,14 @@ const SceneView = ({
|
|
|
468
464
|
value={isParentHeaderShown || headerShown !== false}
|
|
469
465
|
>
|
|
470
466
|
<HeaderBackContext.Provider value={headerBack}>
|
|
471
|
-
<
|
|
467
|
+
<ScreenComposer
|
|
472
468
|
previous={previousDescriptor}
|
|
473
469
|
current={descriptor}
|
|
474
470
|
next={nextDescriptor}
|
|
475
471
|
LifecycleController={NativeStackScreenLifecycleController}
|
|
476
472
|
>
|
|
477
473
|
{render()}
|
|
478
|
-
</
|
|
474
|
+
</ScreenComposer>
|
|
479
475
|
</HeaderBackContext.Provider>
|
|
480
476
|
</HeaderShownContext.Provider>
|
|
481
477
|
</HeaderHeightContext.Provider>
|
|
@@ -486,52 +482,33 @@ const SceneView = ({
|
|
|
486
482
|
);
|
|
487
483
|
};
|
|
488
484
|
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
const modalRouteKeys = getModalRouteKeys(state.routes, descriptors);
|
|
510
|
-
|
|
511
|
-
const preloadedDescriptors =
|
|
512
|
-
state.preloadedRoutes.reduce<NativeStackDescriptorMap>((acc, route) => {
|
|
513
|
-
acc[route.key] = acc[route.key] || describe(route, true);
|
|
514
|
-
return acc;
|
|
515
|
-
}, {});
|
|
516
|
-
|
|
517
|
-
const routes = state.routes.concat(state.preloadedRoutes);
|
|
518
|
-
|
|
519
|
-
// Memoize route keys array for RoutesProvider
|
|
520
|
-
const routeKeys = React.useMemo(
|
|
521
|
-
() => routes.map((route) => route.key),
|
|
522
|
-
[routes],
|
|
523
|
-
);
|
|
524
|
-
|
|
525
|
-
return (
|
|
526
|
-
<RoutesProvider routeKeys={routeKeys}>
|
|
527
|
-
<GestureHandlerRootView>
|
|
528
|
-
<SafeAreaProviderCompat>
|
|
485
|
+
export const NativeStackView = withStackCore(
|
|
486
|
+
{ TRANSITIONS_ALWAYS_ON: false },
|
|
487
|
+
withDirectStack(function NativeStackViewContent({
|
|
488
|
+
state,
|
|
489
|
+
navigation,
|
|
490
|
+
descriptors,
|
|
491
|
+
scenes,
|
|
492
|
+
focusedIndex,
|
|
493
|
+
shouldShowFloatOverlay,
|
|
494
|
+
}: DirectStackContextValue) {
|
|
495
|
+
const { setNextDismissedKey } = useDismissedRouteError(state);
|
|
496
|
+
|
|
497
|
+
useInvalidPreventRemoveError(descriptors);
|
|
498
|
+
|
|
499
|
+
const modalRouteKeys = getModalRouteKeys(state.routes, descriptors);
|
|
500
|
+
|
|
501
|
+
return (
|
|
502
|
+
<>
|
|
503
|
+
{shouldShowFloatOverlay ? <Overlay.Float /> : null}
|
|
504
|
+
<Overlay.Container>
|
|
529
505
|
<ScreenStack style={styles.container}>
|
|
530
|
-
{
|
|
531
|
-
const descriptor =
|
|
532
|
-
|
|
533
|
-
const
|
|
534
|
-
|
|
506
|
+
{scenes.map((scene, index) => {
|
|
507
|
+
const { route, descriptor, isPreloaded } = scene;
|
|
508
|
+
const isFocused = focusedIndex === index;
|
|
509
|
+
const isBelowFocused = focusedIndex - 1 === index;
|
|
510
|
+
|
|
511
|
+
// Get previous/next descriptors from state.routes (not scenes) for proper navigation
|
|
535
512
|
const previousKey = state.routes[index - 1]?.key;
|
|
536
513
|
const nextKey = state.routes[index + 1]?.key;
|
|
537
514
|
const previousDescriptor = previousKey
|
|
@@ -541,10 +518,6 @@ export function NativeStackView({
|
|
|
541
518
|
|
|
542
519
|
const isModal = modalRouteKeys.includes(route.key);
|
|
543
520
|
|
|
544
|
-
const isPreloaded =
|
|
545
|
-
preloadedDescriptors[route.key] !== undefined &&
|
|
546
|
-
descriptors[route.key] === undefined;
|
|
547
|
-
|
|
548
521
|
// On Fabric, when screen is frozen, animated and reanimated values are not updated
|
|
549
522
|
// due to component being unmounted. To avoid this, we don't freeze the previous screen there
|
|
550
523
|
const shouldFreeze = isFabric()
|
|
@@ -633,11 +606,11 @@ export function NativeStackView({
|
|
|
633
606
|
);
|
|
634
607
|
})}
|
|
635
608
|
</ScreenStack>
|
|
636
|
-
</
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
)
|
|
640
|
-
|
|
609
|
+
</Overlay.Container>
|
|
610
|
+
</>
|
|
611
|
+
);
|
|
612
|
+
}),
|
|
613
|
+
);
|
|
641
614
|
|
|
642
615
|
const styles = StyleSheet.create({
|
|
643
616
|
container: {
|