react-native-screen-transitions 3.1.0 → 3.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +103 -8
- package/lib/commonjs/blank-stack/components/adjusted-screen-container.js +36 -0
- package/lib/commonjs/blank-stack/components/adjusted-screen-container.js.map +1 -0
- package/lib/commonjs/blank-stack/components/{screens.js → adjusted-screen.js} +33 -13
- package/lib/commonjs/blank-stack/components/adjusted-screen.js.map +1 -0
- package/lib/commonjs/blank-stack/components/stack-view.js +44 -61
- package/lib/commonjs/blank-stack/components/stack-view.js.map +1 -1
- package/lib/commonjs/blank-stack/components/stack-view.native.js +81 -0
- package/lib/commonjs/blank-stack/components/stack-view.native.js.map +1 -0
- package/lib/commonjs/component-stack/components/component-screen-container.js +23 -0
- package/lib/commonjs/component-stack/components/component-screen-container.js.map +1 -0
- package/lib/commonjs/component-stack/components/component-screen.js +36 -0
- package/lib/commonjs/component-stack/components/component-screen.js.map +1 -0
- package/lib/commonjs/component-stack/components/stack-view.js +64 -0
- package/lib/commonjs/component-stack/components/stack-view.js.map +1 -0
- package/lib/commonjs/component-stack/index.js +13 -0
- package/lib/commonjs/component-stack/index.js.map +1 -0
- package/lib/commonjs/component-stack/navigators/create-component-stack-navigator.js +52 -0
- package/lib/commonjs/component-stack/navigators/create-component-stack-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 +114 -117
- 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 +39 -0
- package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js.map +1 -0
- package/lib/commonjs/shared/components/overlay/index.js +13 -0
- package/lib/commonjs/shared/components/overlay/index.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 +4 -31
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/{components/controllers/blank-stack-lifecycle.js → controller/managed-lifecycle.js} +25 -19
- package/lib/commonjs/shared/controller/managed-lifecycle.js.map +1 -0
- 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 +36 -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 +18 -11
- package/lib/commonjs/shared/hooks/animation/use-screen-animation.js.map +1 -1
- package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js +4 -2
- 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/hooks/reanimated/use-shared-value-state.js +5 -0
- package/lib/commonjs/shared/hooks/reanimated/use-shared-value-state.js.map +1 -1
- 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/layout-anchor.provider.js +73 -0
- package/lib/commonjs/shared/providers/layout-anchor.provider.js.map +1 -0
- package/lib/commonjs/shared/providers/register-bounds.provider.js +19 -8
- 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/screen/styles.provider.js +95 -0
- package/lib/commonjs/shared/providers/screen/styles.provider.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/core.provider.js +84 -0
- package/lib/commonjs/shared/providers/stack/core.provider.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/direct.provider.js +160 -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 +157 -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/{core.types.js → screen.types.js} +1 -1
- package/lib/commonjs/shared/types/screen.types.js.map +1 -0
- package/lib/commonjs/shared/types/stack.types.js +32 -0
- package/lib/commonjs/shared/types/stack.types.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/helpers/styles.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/index.js +13 -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 +70 -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/adjusted-screen-container.js +31 -0
- package/lib/module/blank-stack/components/adjusted-screen-container.js.map +1 -0
- package/lib/module/blank-stack/components/{screens.js → adjusted-screen.js} +32 -12
- package/lib/module/blank-stack/components/adjusted-screen.js.map +1 -0
- package/lib/module/blank-stack/components/stack-view.js +43 -60
- package/lib/module/blank-stack/components/stack-view.js.map +1 -1
- package/lib/module/blank-stack/components/stack-view.native.js +76 -0
- package/lib/module/blank-stack/components/stack-view.native.js.map +1 -0
- package/lib/module/component-stack/components/component-screen-container.js +18 -0
- package/lib/module/component-stack/components/component-screen-container.js.map +1 -0
- package/lib/module/component-stack/components/component-screen.js +30 -0
- package/lib/module/component-stack/components/component-screen.js.map +1 -0
- package/lib/module/component-stack/components/stack-view.js +59 -0
- package/lib/module/component-stack/components/stack-view.js.map +1 -0
- package/lib/module/component-stack/index.js +4 -0
- package/lib/module/component-stack/index.js.map +1 -0
- package/lib/module/component-stack/navigators/create-component-stack-navigator.js +48 -0
- package/lib/module/component-stack/navigators/create-component-stack-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 +115 -118
- 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 +35 -0
- package/lib/module/shared/components/overlay/helpers/get-active-overlay.js.map +1 -0
- package/lib/module/shared/components/overlay/index.js +9 -0
- package/lib/module/shared/components/overlay/index.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 +2 -29
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/controller/managed-lifecycle.js +72 -0
- package/lib/module/shared/controller/managed-lifecycle.js.map +1 -0
- 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 +31 -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 +18 -11
- package/lib/module/shared/hooks/animation/use-screen-animation.js.map +1 -1
- package/lib/module/shared/hooks/gestures/use-build-gestures.js +5 -3
- 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/hooks/reanimated/use-shared-value-state.js +5 -0
- package/lib/module/shared/hooks/reanimated/use-shared-value-state.js.map +1 -1
- 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/layout-anchor.provider.js +67 -0
- package/lib/module/shared/providers/layout-anchor.provider.js.map +1 -0
- package/lib/module/shared/providers/register-bounds.provider.js +19 -8
- 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/screen/styles.provider.js +90 -0
- package/lib/module/shared/providers/screen/styles.provider.js.map +1 -0
- package/lib/module/shared/providers/stack/core.provider.js +78 -0
- package/lib/module/shared/providers/stack/core.provider.js.map +1 -0
- package/lib/module/shared/providers/stack/direct.provider.js +155 -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 +152 -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 +33 -0
- package/lib/module/shared/types/stack.types.js.map +1 -0
- package/lib/module/shared/utils/bounds/helpers/styles.js.map +1 -1
- package/lib/module/shared/utils/bounds/index.js +13 -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 +65 -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/adjusted-screen-container.d.ts +6 -0
- package/lib/typescript/blank-stack/components/adjusted-screen-container.d.ts.map +1 -0
- package/lib/typescript/blank-stack/components/{screens.d.ts → adjusted-screen.d.ts} +2 -2
- package/lib/typescript/blank-stack/components/adjusted-screen.d.ts.map +1 -0
- 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/blank-stack/components/stack-view.native.d.ts +4 -0
- package/lib/typescript/blank-stack/components/stack-view.native.d.ts.map +1 -0
- package/lib/typescript/blank-stack/types.d.ts +10 -49
- package/lib/typescript/blank-stack/types.d.ts.map +1 -1
- package/lib/typescript/component-stack/components/component-screen-container.d.ts +6 -0
- package/lib/typescript/component-stack/components/component-screen-container.d.ts.map +1 -0
- package/lib/typescript/component-stack/components/component-screen.d.ts +8 -0
- package/lib/typescript/component-stack/components/component-screen.d.ts.map +1 -0
- package/lib/typescript/component-stack/components/stack-view.d.ts +4 -0
- package/lib/typescript/component-stack/components/stack-view.d.ts.map +1 -0
- package/lib/typescript/component-stack/index.d.ts +3 -0
- package/lib/typescript/component-stack/index.d.ts.map +1 -0
- package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts +16 -0
- package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts.map +1 -0
- package/lib/typescript/component-stack/types.d.ts +39 -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 +11 -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 +7 -0
- package/lib/typescript/shared/components/overlay/index.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 +2 -16
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/controller/managed-lifecycle.d.ts +9 -0
- package/lib/typescript/shared/controller/managed-lifecycle.d.ts.map +1 -0
- package/lib/typescript/shared/hooks/animation/use-high-refresh-rate.d.ts +13 -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 +2 -1
- 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 +66 -0
- package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -0
- package/lib/typescript/shared/hooks/reanimated/use-shared-value-state.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +41 -43
- 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/layout-anchor.provider.d.ts +34 -0
- package/lib/typescript/shared/providers/layout-anchor.provider.d.ts.map +1 -0
- 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 +22 -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/bounds.types.d.ts +1 -0
- package/lib/typescript/shared/types/bounds.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 +39 -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 +55 -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/adjusted-screen-container.tsx +25 -0
- package/src/blank-stack/components/{screens.tsx → adjusted-screen.tsx} +35 -14
- package/src/blank-stack/components/stack-view.native.tsx +94 -0
- package/src/blank-stack/components/stack-view.tsx +60 -74
- package/src/blank-stack/types.ts +12 -63
- package/src/component-stack/components/component-screen-container.tsx +15 -0
- package/src/component-stack/components/component-screen.tsx +40 -0
- package/src/component-stack/components/stack-view.tsx +74 -0
- package/src/component-stack/index.ts +10 -0
- package/src/component-stack/navigators/create-component-stack-navigator.tsx +88 -0
- package/src/component-stack/types.ts +101 -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 +138 -167
- package/src/shared/__tests__/sync-routes-with-removed.test.ts +137 -0
- package/src/shared/components/create-transition-aware-component.tsx +5 -6
- package/src/shared/components/overlay/helpers/get-active-overlay.ts +38 -0
- package/src/shared/components/overlay/index.ts +7 -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 +3 -32
- package/src/shared/controller/managed-lifecycle.tsx +73 -0
- package/src/shared/hooks/animation/use-associated-style.tsx +2 -2
- package/src/shared/hooks/animation/use-high-refresh-rate.tsx +34 -0
- package/src/shared/hooks/animation/use-screen-animation.tsx +24 -18
- package/src/shared/hooks/gestures/use-build-gestures.tsx +10 -3
- 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 +89 -0
- package/src/shared/hooks/reanimated/use-shared-value-state.ts +5 -0
- package/src/shared/index.ts +8 -3
- package/src/shared/providers/gestures.provider.tsx +6 -2
- package/src/shared/providers/layout-anchor.provider.tsx +81 -0
- package/src/shared/providers/register-bounds.provider.tsx +23 -9
- package/src/shared/providers/{keys.provider.tsx → screen/keys.provider.tsx} +25 -10
- package/src/shared/providers/screen/screen-composer.tsx +38 -0
- package/src/shared/providers/screen/styles.provider.tsx +120 -0
- package/src/shared/providers/stack/core.provider.tsx +87 -0
- package/src/shared/providers/stack/direct.provider.tsx +231 -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 +229 -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/bounds.types.ts +5 -0
- package/src/shared/types/gesture.types.ts +0 -2
- package/src/shared/types/index.ts +46 -0
- package/src/shared/types/overlay.types.ts +49 -0
- package/src/shared/types/{core.types.ts → screen.types.ts} +34 -7
- package/src/shared/types/stack.types.ts +63 -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 +19 -10
- 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 +102 -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/components/screens.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 +0 -62
- package/lib/commonjs/shared/providers/transition-styles.provider.js.map +0 -1
- package/lib/commonjs/shared/types/core.types.js.map +0 -1
- package/lib/commonjs/shared/types/utils.types.js +0 -2
- package/lib/commonjs/shared/types/utils.types.js.map +0 -1
- 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/components/screens.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 +0 -66
- 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 +0 -56
- 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/components/screens.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 +0 -8
- 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/components/controllers/blank-stack-lifecycle.tsx +0 -70
- package/src/shared/providers/flags.provider.tsx +0 -21
- package/src/shared/providers/routes.provider.tsx +0 -54
- package/src/shared/providers/screen-transition.provider.tsx +0 -41
- package/src/shared/providers/transition-styles.provider.tsx +0 -74
- 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,148 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NavigationContext,
|
|
3
|
+
NavigationRouteContext,
|
|
4
|
+
type Route,
|
|
5
|
+
} from "@react-navigation/native";
|
|
6
|
+
import { memo, useMemo } from "react";
|
|
7
|
+
import { Animated, StyleSheet, useWindowDimensions, View } from "react-native";
|
|
8
|
+
import { useDerivedValue } from "react-native-reanimated";
|
|
9
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
10
|
+
import { useScreenAnimation } from "../../../hooks/animation/use-screen-animation";
|
|
11
|
+
import { type StackScene, useStack } from "../../../hooks/navigation/use-stack";
|
|
12
|
+
import { useSharedValueState } from "../../../hooks/reanimated/use-shared-value-state";
|
|
13
|
+
import type { OverlayInterpolationProps } from "../../../types/animation.types";
|
|
14
|
+
import type { OverlayProps } from "../../../types/overlay.types";
|
|
15
|
+
|
|
16
|
+
type OverlayHostProps = {
|
|
17
|
+
scene: StackScene;
|
|
18
|
+
scenes: StackScene[];
|
|
19
|
+
routes: Route<string>[];
|
|
20
|
+
overlayIndex: number;
|
|
21
|
+
isFloating?: boolean;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const OverlayHost = memo(function OverlayHost({
|
|
25
|
+
scene,
|
|
26
|
+
scenes,
|
|
27
|
+
routes,
|
|
28
|
+
overlayIndex,
|
|
29
|
+
isFloating,
|
|
30
|
+
}: OverlayHostProps) {
|
|
31
|
+
const OverlayComponent = scene.descriptor.options.overlay;
|
|
32
|
+
const screen = useWindowDimensions();
|
|
33
|
+
|
|
34
|
+
const { stackProgress, optimisticFocusedIndex, routeKeys } = useStack();
|
|
35
|
+
const insets = useSafeAreaInsets();
|
|
36
|
+
|
|
37
|
+
const relativeProgress = useDerivedValue(() => {
|
|
38
|
+
"worklet";
|
|
39
|
+
return stackProgress.value - overlayIndex;
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// For float overlays: global focused index (can be any screen in the stack)
|
|
43
|
+
// For screen overlays: relative to overlay position (only screens at or after)
|
|
44
|
+
const optimisticActiveIndex = useSharedValueState(
|
|
45
|
+
useDerivedValue(() => {
|
|
46
|
+
"worklet";
|
|
47
|
+
if (isFloating) {
|
|
48
|
+
// For float overlays, use global optimistic focused index directly
|
|
49
|
+
const globalIndex = optimisticFocusedIndex.get();
|
|
50
|
+
const clampedIndex = Math.max(
|
|
51
|
+
0,
|
|
52
|
+
Math.min(globalIndex, routeKeys.length - 1),
|
|
53
|
+
);
|
|
54
|
+
return clampedIndex;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// For screen overlays, compute relative to overlay position
|
|
58
|
+
const screensAbove = routeKeys.length - 1 - overlayIndex;
|
|
59
|
+
const relativeOptimistic = optimisticFocusedIndex.value - overlayIndex;
|
|
60
|
+
const result = Math.max(0, Math.min(relativeOptimistic, screensAbove));
|
|
61
|
+
|
|
62
|
+
return result;
|
|
63
|
+
}),
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
const overlayAnimation = useDerivedValue<OverlayInterpolationProps>(() => ({
|
|
67
|
+
progress: relativeProgress.value,
|
|
68
|
+
layouts: { screen },
|
|
69
|
+
insets,
|
|
70
|
+
}));
|
|
71
|
+
|
|
72
|
+
const focusedScene = useMemo(() => {
|
|
73
|
+
if (overlayIndex === -1) {
|
|
74
|
+
return scene;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (isFloating) {
|
|
78
|
+
// For float overlays, optimisticActiveIndex is the global focused index
|
|
79
|
+
return scenes[optimisticActiveIndex] ?? scene;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// For screen overlays, optimisticActiveIndex is relative to overlayIndex
|
|
83
|
+
const maxOffset = Math.max(scenes.length - overlayIndex - 1, 0);
|
|
84
|
+
const normalizedIndex = Math.min(
|
|
85
|
+
Math.max(optimisticActiveIndex, 0),
|
|
86
|
+
maxOffset,
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
return scenes[overlayIndex + normalizedIndex] ?? scene;
|
|
90
|
+
}, [overlayIndex, optimisticActiveIndex, scenes, scene, isFloating]);
|
|
91
|
+
|
|
92
|
+
const screenAnimation = useScreenAnimation();
|
|
93
|
+
|
|
94
|
+
if (!OverlayComponent) {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const overlayProps: OverlayProps<typeof scene.descriptor.navigation> = {
|
|
99
|
+
routes,
|
|
100
|
+
overlayAnimation,
|
|
101
|
+
screenAnimation,
|
|
102
|
+
focusedRoute: focusedScene.route,
|
|
103
|
+
focusedIndex: optimisticActiveIndex,
|
|
104
|
+
meta: focusedScene.descriptor.options.meta,
|
|
105
|
+
navigation: scene.descriptor.navigation,
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
// Cast to OverlayProps function - container overlays are handled by ContainerOverlay component
|
|
109
|
+
const renderOverlay = OverlayComponent as (
|
|
110
|
+
props: OverlayProps,
|
|
111
|
+
) => React.ReactNode;
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
<Animated.View
|
|
115
|
+
pointerEvents="box-none"
|
|
116
|
+
style={[
|
|
117
|
+
styles.container,
|
|
118
|
+
isFloating ? styles.floating : { zIndex: 1 },
|
|
119
|
+
styles.absolute,
|
|
120
|
+
]}
|
|
121
|
+
>
|
|
122
|
+
<NavigationContext.Provider
|
|
123
|
+
// biome-ignore lint/suspicious/noExplicitAny: navigation type varies by stack
|
|
124
|
+
value={scene.descriptor.navigation as any}
|
|
125
|
+
>
|
|
126
|
+
<NavigationRouteContext.Provider value={scene.route}>
|
|
127
|
+
<View pointerEvents="box-none" style={styles.overlay}>
|
|
128
|
+
{renderOverlay(overlayProps)}
|
|
129
|
+
</View>
|
|
130
|
+
</NavigationRouteContext.Provider>
|
|
131
|
+
</NavigationContext.Provider>
|
|
132
|
+
</Animated.View>
|
|
133
|
+
);
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
const styles = StyleSheet.create({
|
|
137
|
+
overlay: {
|
|
138
|
+
...StyleSheet.absoluteFillObject,
|
|
139
|
+
zIndex: 1,
|
|
140
|
+
},
|
|
141
|
+
container: {
|
|
142
|
+
flex: 1,
|
|
143
|
+
},
|
|
144
|
+
absolute: StyleSheet.absoluteFillObject,
|
|
145
|
+
floating: {
|
|
146
|
+
zIndex: 1000,
|
|
147
|
+
},
|
|
148
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import {
|
|
3
|
+
type StackDescriptor,
|
|
4
|
+
type StackScene,
|
|
5
|
+
useStack,
|
|
6
|
+
} from "../../../hooks/navigation/use-stack";
|
|
7
|
+
import { useKeys } from "../../../providers/screen/keys.provider";
|
|
8
|
+
import { OverlayHost } from "./overlay-host";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Screen overlay component that renders per-screen.
|
|
12
|
+
* Gets current descriptor from keys context.
|
|
13
|
+
*/
|
|
14
|
+
export function ScreenOverlay() {
|
|
15
|
+
const { current } = useKeys<StackDescriptor>();
|
|
16
|
+
const { routeKeys, flags } = useStack();
|
|
17
|
+
|
|
18
|
+
const options = current.options;
|
|
19
|
+
|
|
20
|
+
const scene = useMemo<StackScene>(
|
|
21
|
+
() => ({
|
|
22
|
+
descriptor: current,
|
|
23
|
+
route: current.route,
|
|
24
|
+
}),
|
|
25
|
+
[current],
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
// Find the index of this screen in the stack
|
|
29
|
+
const overlayIndex = useMemo(
|
|
30
|
+
() => routeKeys.indexOf(current.route.key),
|
|
31
|
+
[routeKeys, current.route.key],
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
// Skip screens without enableTransitions (native-stack only)
|
|
35
|
+
if (!flags.TRANSITIONS_ALWAYS_ON && !options.enableTransitions) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (!options.overlayShown || options.overlayMode !== "screen") {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<OverlayHost
|
|
45
|
+
scene={scene}
|
|
46
|
+
scenes={[scene]}
|
|
47
|
+
routes={[]}
|
|
48
|
+
overlayIndex={overlayIndex}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -2,14 +2,14 @@ import { memo } from "react";
|
|
|
2
2
|
import { StyleSheet, View } from "react-native";
|
|
3
3
|
import Animated, { useAnimatedStyle } from "react-native-reanimated";
|
|
4
4
|
import { NO_STYLES } from "../constants";
|
|
5
|
-
import {
|
|
5
|
+
import { useScreenStyles } from "../providers/screen/styles.provider";
|
|
6
6
|
|
|
7
7
|
type Props = {
|
|
8
8
|
children: React.ReactNode;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export const RootTransitionAware = memo(({ children }: Props) => {
|
|
12
|
-
const { stylesMap } =
|
|
12
|
+
const { stylesMap } = useScreenStyles();
|
|
13
13
|
|
|
14
14
|
const animatedContentStyle = useAnimatedStyle(() => {
|
|
15
15
|
"worklet";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
interpolate,
|
|
5
5
|
interpolateColor,
|
|
6
6
|
} from "react-native-reanimated";
|
|
7
|
-
import type { ScreenTransitionConfig } from "../types/
|
|
7
|
+
import type { ScreenTransitionConfig } from "../types/screen.types";
|
|
8
8
|
import { DefaultSpec } from "./specs";
|
|
9
9
|
|
|
10
10
|
const platform = Platform.OS;
|
package/src/shared/constants.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { ParamListBase, RouteProp } from "@react-navigation/native";
|
|
2
|
+
import { Platform } from "react-native";
|
|
2
3
|
import type { MeasuredDimensions } from "react-native-reanimated";
|
|
3
4
|
import type { ScreenTransitionState } from "./types/animation.types";
|
|
4
|
-
import type { BoundEntry } from "./types/bounds.types";
|
|
5
|
-
import type { Layout } from "./types/core.types";
|
|
6
5
|
import type { ActivationArea } from "./types/gesture.types";
|
|
7
|
-
import type {
|
|
8
|
-
import type { BoundsBuilderOptions } from "./utils/bounds/types/builder";
|
|
6
|
+
import type { Layout } from "./types/screen.types";
|
|
9
7
|
|
|
10
8
|
/**
|
|
11
9
|
* Masked view integration
|
|
@@ -41,7 +39,6 @@ export const DEFAULT_SCREEN_TRANSITION_STATE: ScreenTransitionState =
|
|
|
41
39
|
/**
|
|
42
40
|
* Bounds API Defaults
|
|
43
41
|
*/
|
|
44
|
-
export const NO_BOUNDS_MAP: Record<string, BoundEntry> = Object.freeze({});
|
|
45
42
|
export const EMPTY_BOUND_HELPER_RESULT = Object.freeze({});
|
|
46
43
|
export const EMPTY_BOUND_HELPER_RESULT_RAW = Object.freeze({
|
|
47
44
|
scaleX: 1,
|
|
@@ -69,23 +66,6 @@ export const FULLSCREEN_DIMENSIONS = (
|
|
|
69
66
|
};
|
|
70
67
|
};
|
|
71
68
|
|
|
72
|
-
export const DEFAULT_BUILDER_OPTIONS: Complete<
|
|
73
|
-
Omit<BoundsBuilderOptions, "id">
|
|
74
|
-
> = Object.freeze({
|
|
75
|
-
gestures: { x: 0, y: 0 },
|
|
76
|
-
toFullscreen: false,
|
|
77
|
-
absolute: false,
|
|
78
|
-
relative: true,
|
|
79
|
-
method: "transform",
|
|
80
|
-
contentScaleMode: "auto",
|
|
81
|
-
//
|
|
82
|
-
space: "relative",
|
|
83
|
-
target: "bound",
|
|
84
|
-
scaleMode: "match",
|
|
85
|
-
anchor: "center",
|
|
86
|
-
raw: false,
|
|
87
|
-
} as const);
|
|
88
|
-
|
|
89
69
|
/**
|
|
90
70
|
* Default gesture config
|
|
91
71
|
*/
|
|
@@ -95,13 +75,4 @@ export const DEFAULT_GESTURE_ENABLED = false;
|
|
|
95
75
|
export const DEFAULT_GESTURE_DRIVES_PROGRESS = true;
|
|
96
76
|
export const DEFAULT_GESTURE_ACTIVATION_AREA: ActivationArea = "screen";
|
|
97
77
|
|
|
98
|
-
|
|
99
|
-
* Default gesture offset
|
|
100
|
-
*/
|
|
101
|
-
export const GESTURE_ACTIVATION_THRESHOLD_X = 10;
|
|
102
|
-
export const GESTURE_ACTIVATION_THRESHOLD_Y = 10;
|
|
103
|
-
export const GESTURE_FAIL_TOLERANCE_X = 15;
|
|
104
|
-
export const GESTURE_FAIL_TOLERANCE_Y = 20;
|
|
105
|
-
export const DEFAULT_EDGE_DISTANCE_HORIZONTAL = 50;
|
|
106
|
-
export const DEFAULT_EDGE_DISTANCE_VERTICAL = 135;
|
|
107
|
-
export const DEFAULT_ACTIVATION_AREA = "screen" as const;
|
|
78
|
+
export const IS_WEB = Platform.OS === "web";
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { useLayoutEffect } from "react";
|
|
2
|
+
import { runOnJS, useAnimatedReaction } from "react-native-reanimated";
|
|
3
|
+
import type { BlankStackDescriptor } from "../../blank-stack/types";
|
|
4
|
+
import { useHighRefreshRate } from "../hooks/animation/use-high-refresh-rate";
|
|
5
|
+
import useStableCallback from "../hooks/use-stable-callback";
|
|
6
|
+
import { useKeys } from "../providers/screen/keys.provider";
|
|
7
|
+
import { useManagedStackContext } from "../providers/stack/managed.provider";
|
|
8
|
+
import { AnimationStore } from "../stores/animation.store";
|
|
9
|
+
import { startScreenTransition } from "../utils/animation/start-screen-transition";
|
|
10
|
+
import { resetStoresForScreen } from "../utils/reset-stores-for-screen";
|
|
11
|
+
|
|
12
|
+
interface Props {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Lifecycle controller built out for Blank Stack implementation.
|
|
18
|
+
*/
|
|
19
|
+
export const ManagedLifecycle = ({ children }: Props) => {
|
|
20
|
+
const { current } = useKeys<BlankStackDescriptor>();
|
|
21
|
+
const { handleCloseRoute, closingRouteKeysShared } = useManagedStackContext();
|
|
22
|
+
|
|
23
|
+
const animations = AnimationStore.getAll(current.route.key);
|
|
24
|
+
|
|
25
|
+
const { deactivateHighRefreshRate, activateHighRefreshRate } =
|
|
26
|
+
useHighRefreshRate(current);
|
|
27
|
+
|
|
28
|
+
const handleInitialize = useStableCallback(() => {
|
|
29
|
+
activateHighRefreshRate();
|
|
30
|
+
startScreenTransition({
|
|
31
|
+
target: "open",
|
|
32
|
+
spec: current.options.transitionSpec,
|
|
33
|
+
animations,
|
|
34
|
+
onAnimationFinish: deactivateHighRefreshRate,
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const handleCloseEnd = useStableCallback((finished: boolean) => {
|
|
39
|
+
if (!finished) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
handleCloseRoute({ route: current.route });
|
|
43
|
+
requestAnimationFrame(() => {
|
|
44
|
+
deactivateHighRefreshRate();
|
|
45
|
+
resetStoresForScreen(current);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
useAnimatedReaction(
|
|
50
|
+
() => ({
|
|
51
|
+
keys: closingRouteKeysShared.value,
|
|
52
|
+
}),
|
|
53
|
+
({ keys }) => {
|
|
54
|
+
if (!keys.includes(current.route.key)) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
runOnJS(activateHighRefreshRate)();
|
|
59
|
+
startScreenTransition({
|
|
60
|
+
target: "close",
|
|
61
|
+
spec: current.options.transitionSpec,
|
|
62
|
+
animations,
|
|
63
|
+
onAnimationFinish: handleCloseEnd,
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
useLayoutEffect(() => {
|
|
69
|
+
handleInitialize();
|
|
70
|
+
}, [handleInitialize]);
|
|
71
|
+
|
|
72
|
+
return children;
|
|
73
|
+
};
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
useSharedValue,
|
|
6
6
|
} from "react-native-reanimated";
|
|
7
7
|
import { NO_STYLES } from "../../constants";
|
|
8
|
-
import {
|
|
8
|
+
import { useScreenStyles } from "../../providers/screen/styles.provider";
|
|
9
9
|
|
|
10
10
|
type Props = {
|
|
11
11
|
id?: string;
|
|
@@ -16,7 +16,7 @@ type Props = {
|
|
|
16
16
|
* This hook is used to get the associated styles for a given styleId / boundTag.
|
|
17
17
|
*/
|
|
18
18
|
export const useAssociatedStyles = ({ id }: Props = {}) => {
|
|
19
|
-
const { stylesMap, ancestorStylesMaps } =
|
|
19
|
+
const { stylesMap, ancestorStylesMaps } = useScreenStyles();
|
|
20
20
|
const showAfterFirstFrame = useSharedValue(false);
|
|
21
21
|
|
|
22
22
|
useDerivedValue(() => {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useFrameCallback } from "react-native-reanimated";
|
|
2
|
+
import type { BaseDescriptor } from "../../providers/screen/keys.provider";
|
|
3
|
+
import useStableCallback from "../use-stable-callback";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Maintainer Notes:
|
|
7
|
+
* Marking as experimental for now since, I'll be honest, I'm not sure if this does much. This was taken
|
|
8
|
+
* right from this https://github.com/software-mansion/react-native-reanimated/issues/4738
|
|
9
|
+
*
|
|
10
|
+
* Not noticing much of a difference in prod.
|
|
11
|
+
*/
|
|
12
|
+
export const useHighRefreshRate = (current: BaseDescriptor) => {
|
|
13
|
+
const enableHighRefreshRate =
|
|
14
|
+
current.options.experimental_enableHighRefreshRate ?? false;
|
|
15
|
+
|
|
16
|
+
const frameCallback = useFrameCallback(() => {}, false);
|
|
17
|
+
|
|
18
|
+
const activateHighRefreshRate = useStableCallback(() => {
|
|
19
|
+
if (enableHighRefreshRate) {
|
|
20
|
+
frameCallback.setActive(true);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const deactivateHighRefreshRate = useStableCallback(() => {
|
|
25
|
+
if (enableHighRefreshRate) {
|
|
26
|
+
frameCallback.setActive(false);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
activateHighRefreshRate,
|
|
32
|
+
deactivateHighRefreshRate,
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -1,39 +1,37 @@
|
|
|
1
|
-
import type { ParamListBase, RouteProp } from "@react-navigation/native";
|
|
2
1
|
import { useMemo } from "react";
|
|
3
2
|
import { useWindowDimensions } from "react-native";
|
|
4
3
|
import { type SharedValue, useDerivedValue } from "react-native-reanimated";
|
|
5
4
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
6
5
|
import type { NativeStackScreenTransitionConfig } from "../../../native-stack/types";
|
|
7
6
|
import { DEFAULT_SCREEN_TRANSITION_STATE } from "../../constants";
|
|
8
|
-
import { useFlagsContext } from "../../providers/flags.provider";
|
|
9
7
|
import {
|
|
10
|
-
type
|
|
8
|
+
type BaseDescriptor,
|
|
9
|
+
type BaseRoute,
|
|
11
10
|
useKeys,
|
|
12
|
-
} from "../../providers/keys.provider";
|
|
13
|
-
import { useStackAnimationValues } from "../../providers/routes.provider";
|
|
11
|
+
} from "../../providers/screen/keys.provider";
|
|
14
12
|
import { AnimationStore } from "../../stores/animation.store";
|
|
15
13
|
import { GestureStore, type GestureStoreMap } from "../../stores/gesture.store";
|
|
16
14
|
import type {
|
|
17
15
|
ScreenInterpolationProps,
|
|
18
16
|
ScreenTransitionState,
|
|
19
17
|
} from "../../types/animation.types";
|
|
20
|
-
import type { ScreenTransitionConfig } from "../../types/
|
|
21
|
-
import { computeStackProgress } from "../../utils/animation/compute-stack-progress";
|
|
18
|
+
import type { ScreenTransitionConfig } from "../../types/screen.types";
|
|
22
19
|
import { derivations } from "../../utils/animation/derivations";
|
|
23
20
|
import { createBounds } from "../../utils/bounds";
|
|
21
|
+
import { useStack } from "../navigation/use-stack";
|
|
24
22
|
|
|
25
23
|
type BuiltState = {
|
|
26
24
|
progress: SharedValue<number>;
|
|
27
25
|
closing: SharedValue<number>;
|
|
28
26
|
animating: SharedValue<number>;
|
|
29
27
|
gesture: GestureStoreMap;
|
|
30
|
-
route:
|
|
28
|
+
route: BaseRoute;
|
|
31
29
|
meta?: Record<string, unknown>;
|
|
32
30
|
unwrapped: ScreenTransitionState;
|
|
33
31
|
};
|
|
34
32
|
|
|
35
33
|
const createScreenTransitionState = (
|
|
36
|
-
route:
|
|
34
|
+
route: BaseRoute,
|
|
37
35
|
meta?: Record<string, unknown>,
|
|
38
36
|
): ScreenTransitionState => ({
|
|
39
37
|
progress: 0,
|
|
@@ -71,7 +69,7 @@ const unwrapInto = (s: BuiltState): ScreenTransitionState => {
|
|
|
71
69
|
};
|
|
72
70
|
|
|
73
71
|
const useBuildScreenTransitionState = (
|
|
74
|
-
descriptor:
|
|
72
|
+
descriptor: BaseDescriptor | undefined,
|
|
75
73
|
): BuiltState | undefined => {
|
|
76
74
|
const key = descriptor?.route.key;
|
|
77
75
|
const meta = descriptor?.options?.meta;
|
|
@@ -101,10 +99,12 @@ const hasTransitionsEnabled = (
|
|
|
101
99
|
};
|
|
102
100
|
|
|
103
101
|
export function _useScreenAnimation() {
|
|
104
|
-
const
|
|
102
|
+
const windowDimensions = useWindowDimensions();
|
|
103
|
+
const dimensions = windowDimensions;
|
|
104
|
+
|
|
105
105
|
const insets = useSafeAreaInsets();
|
|
106
|
-
const flags =
|
|
107
|
-
const transitionsAlwaysOn = flags
|
|
106
|
+
const { flags, stackProgress: rootStackProgress, routeKeys } = useStack();
|
|
107
|
+
const transitionsAlwaysOn = flags.TRANSITIONS_ALWAYS_ON;
|
|
108
108
|
|
|
109
109
|
const {
|
|
110
110
|
current: currentDescriptor,
|
|
@@ -117,7 +117,7 @@ export function _useScreenAnimation() {
|
|
|
117
117
|
const prevAnimation = useBuildScreenTransitionState(previousDescriptor);
|
|
118
118
|
|
|
119
119
|
const currentRouteKey = currentDescriptor?.route?.key;
|
|
120
|
-
const
|
|
120
|
+
const currentIndex = routeKeys.indexOf(currentRouteKey);
|
|
121
121
|
|
|
122
122
|
const screenInterpolatorProps = useDerivedValue<
|
|
123
123
|
Omit<ScreenInterpolationProps, "bounds">
|
|
@@ -142,7 +142,11 @@ export function _useScreenAnimation() {
|
|
|
142
142
|
next,
|
|
143
143
|
});
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
// Compute relative stack progress: total - currentIndex
|
|
146
|
+
// This gives us the sum of progress values from current screen onwards
|
|
147
|
+
// Falls back to current progress if index is invalid
|
|
148
|
+
const stackProgress =
|
|
149
|
+
currentIndex >= 0 ? rootStackProgress.value - currentIndex : progress;
|
|
146
150
|
|
|
147
151
|
return {
|
|
148
152
|
layouts: { screen: dimensions },
|
|
@@ -160,9 +164,11 @@ export function _useScreenAnimation() {
|
|
|
160
164
|
const currentInterpolator =
|
|
161
165
|
currentDescriptor?.options.screenStyleInterpolator;
|
|
162
166
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
167
|
+
return {
|
|
168
|
+
screenInterpolatorProps,
|
|
169
|
+
nextInterpolator,
|
|
170
|
+
currentInterpolator,
|
|
171
|
+
};
|
|
166
172
|
}
|
|
167
173
|
|
|
168
174
|
export function useScreenAnimation() {
|
|
@@ -22,10 +22,9 @@ import type {
|
|
|
22
22
|
GestureContextType,
|
|
23
23
|
ScrollConfig,
|
|
24
24
|
} from "../../providers/gestures.provider";
|
|
25
|
-
import { useKeys } from "../../providers/keys.provider";
|
|
25
|
+
import { useKeys } from "../../providers/screen/keys.provider";
|
|
26
26
|
import { AnimationStore } from "../../stores/animation.store";
|
|
27
27
|
import { GestureStore, type GestureStoreMap } from "../../stores/gesture.store";
|
|
28
|
-
|
|
29
28
|
import {
|
|
30
29
|
type GestureDirection,
|
|
31
30
|
GestureOffsetState,
|
|
@@ -36,6 +35,7 @@ import { determineDismissal } from "../../utils/gesture/determine-dismissal";
|
|
|
36
35
|
import { mapGestureToProgress } from "../../utils/gesture/map-gesture-to-progress";
|
|
37
36
|
import { resetGestureValues } from "../../utils/gesture/reset-gesture-values";
|
|
38
37
|
import { velocity } from "../../utils/gesture/velocity";
|
|
38
|
+
import { useStack } from "../navigation/use-stack";
|
|
39
39
|
import useStableCallbackValue from "../use-stable-callback-value";
|
|
40
40
|
|
|
41
41
|
interface BuildGesturesHookProps {
|
|
@@ -53,7 +53,11 @@ export const useBuildGestures = ({
|
|
|
53
53
|
gestureAnimationValues: GestureStoreMap;
|
|
54
54
|
} => {
|
|
55
55
|
const dimensions = useWindowDimensions();
|
|
56
|
+
|
|
56
57
|
const { current } = useKeys();
|
|
58
|
+
const navState = current.navigation.getState();
|
|
59
|
+
const isFirstScreen =
|
|
60
|
+
navState.routes.findIndex((r) => r.key === current.route.key) === 0;
|
|
57
61
|
|
|
58
62
|
const initialTouch = useSharedValue({
|
|
59
63
|
x: 0,
|
|
@@ -74,7 +78,6 @@ export const useBuildGestures = ({
|
|
|
74
78
|
|
|
75
79
|
const {
|
|
76
80
|
gestureDirection = DEFAULT_GESTURE_DIRECTION,
|
|
77
|
-
gestureEnabled = DEFAULT_GESTURE_ENABLED,
|
|
78
81
|
gestureVelocityImpact = GESTURE_VELOCITY_IMPACT,
|
|
79
82
|
gestureDrivesProgress = DEFAULT_GESTURE_DRIVES_PROGRESS,
|
|
80
83
|
gestureActivationArea = DEFAULT_GESTURE_ACTIVATION_AREA,
|
|
@@ -82,6 +85,10 @@ export const useBuildGestures = ({
|
|
|
82
85
|
transitionSpec,
|
|
83
86
|
} = current.options;
|
|
84
87
|
|
|
88
|
+
const gestureEnabled = Boolean(
|
|
89
|
+
isFirstScreen ? false : current.options.gestureEnabled,
|
|
90
|
+
);
|
|
91
|
+
|
|
85
92
|
const directions = useMemo(() => {
|
|
86
93
|
const directionsArray = Array.isArray(gestureDirection)
|
|
87
94
|
? gestureDirection
|
|
@@ -5,7 +5,6 @@ import type { LayoutChangeEvent } from "react-native";
|
|
|
5
5
|
import { useAnimatedScrollHandler } from "react-native-reanimated";
|
|
6
6
|
import type { ReanimatedScrollEvent } from "react-native-reanimated/lib/typescript/hook/commonTypes";
|
|
7
7
|
import { useGestureContext } from "../../providers/gestures.provider";
|
|
8
|
-
import type { Any } from "../../types/utils.types";
|
|
9
8
|
import useStableCallback from "../use-stable-callback";
|
|
10
9
|
|
|
11
10
|
interface ScrollProgressHookProps {
|
|
@@ -34,7 +33,7 @@ export const useScrollRegistry = (props: ScrollProgressHookProps) => {
|
|
|
34
33
|
onScroll: (event) => {
|
|
35
34
|
props.onScroll?.(event);
|
|
36
35
|
|
|
37
|
-
const updateScrollPosition = (v:
|
|
36
|
+
const updateScrollPosition = (v: any) => {
|
|
38
37
|
"worklet";
|
|
39
38
|
if (v === null) {
|
|
40
39
|
return {
|
|
@@ -64,7 +63,7 @@ export const useScrollRegistry = (props: ScrollProgressHookProps) => {
|
|
|
64
63
|
(width: number, height: number) => {
|
|
65
64
|
props.onContentSizeChange?.(width, height);
|
|
66
65
|
|
|
67
|
-
const updateContentSize = (v:
|
|
66
|
+
const updateContentSize = (v: any) => {
|
|
68
67
|
"worklet";
|
|
69
68
|
if (v === null) {
|
|
70
69
|
return {
|
|
@@ -93,7 +92,7 @@ export const useScrollRegistry = (props: ScrollProgressHookProps) => {
|
|
|
93
92
|
props.onLayout?.(event);
|
|
94
93
|
const { width, height } = event.nativeEvent.layout;
|
|
95
94
|
|
|
96
|
-
const updateLayout = (v:
|
|
95
|
+
const updateLayout = (v: any) => {
|
|
97
96
|
"worklet";
|
|
98
97
|
if (v === null) {
|
|
99
98
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo, useRef } from "react";
|
|
2
2
|
import { useSharedValue } from "react-native-reanimated";
|
|
3
|
-
import useStableCallback from "
|
|
3
|
+
import useStableCallback from "../use-stable-callback";
|
|
4
4
|
|
|
5
5
|
export const useClosingRouteKeys = () => {
|
|
6
6
|
const keysRef = useRef<Set<string>>(new Set());
|