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
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
import { type Route, StackActions } from "@react-navigation/native";
|
|
2
|
-
import { useLayoutEffect, useState } from "react";
|
|
3
|
-
import useStableCallback from "../../../../shared/hooks/use-stable-callback";
|
|
4
|
-
import type { BlankStackDescriptorMap } from "../../../types";
|
|
5
|
-
import { areDescriptorsEqual } from "../helpers/are-descriptors-equal";
|
|
6
|
-
import { composeDescriptors } from "../helpers/compose-descriptors";
|
|
7
|
-
import { haveSameRouteKeys } from "../helpers/have-same-route-keys";
|
|
8
|
-
import { routesAreIdentical } from "../helpers/routes-are-identical";
|
|
9
|
-
import type { StackNavigationContextProps } from "../types";
|
|
10
|
-
import { useClosingRouteKeys } from "./use-closing-route-keys";
|
|
11
|
-
import { usePrevious } from "./use-previous";
|
|
12
|
-
|
|
13
|
-
type SyncRoutesWithRemovedParams = {
|
|
14
|
-
prevRoutes: Route<string>[];
|
|
15
|
-
prevDescriptors: BlankStackDescriptorMap;
|
|
16
|
-
nextRoutes: Route<string>[];
|
|
17
|
-
nextDescriptors: BlankStackDescriptorMap;
|
|
18
|
-
closingRouteKeys: ReturnType<typeof useClosingRouteKeys>;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Aligns current routes with the latest route data while preserving references
|
|
23
|
-
* when possible for performance optimization
|
|
24
|
-
*/
|
|
25
|
-
const alignRoutesWithLatest = (
|
|
26
|
-
currentRoutes: Route<string>[],
|
|
27
|
-
currentDescriptors: BlankStackDescriptorMap,
|
|
28
|
-
nextRoutes: Route<string>[],
|
|
29
|
-
nextDescriptors: BlankStackDescriptorMap,
|
|
30
|
-
) => {
|
|
31
|
-
// Early return for empty current routes
|
|
32
|
-
if (currentRoutes.length === 0) {
|
|
33
|
-
return {
|
|
34
|
-
routes: nextRoutes,
|
|
35
|
-
descriptors: composeDescriptors(
|
|
36
|
-
nextRoutes,
|
|
37
|
-
nextDescriptors,
|
|
38
|
-
currentDescriptors,
|
|
39
|
-
),
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Create lookup map for efficient route finding
|
|
44
|
-
const nextRouteLookup = new Map<string, Route<string>>();
|
|
45
|
-
for (const route of nextRoutes) {
|
|
46
|
-
nextRouteLookup.set(route.key, route);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Track if any changes occurred
|
|
50
|
-
let didChange = currentRoutes.length !== nextRoutes.length;
|
|
51
|
-
|
|
52
|
-
// Align routes, updating references where needed
|
|
53
|
-
const alignedRoutes = currentRoutes.map((route) => {
|
|
54
|
-
const nextRoute = nextRouteLookup.get(route.key);
|
|
55
|
-
|
|
56
|
-
if (!nextRoute) {
|
|
57
|
-
return route; // Keep current route if not in next
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (nextRoute !== route) {
|
|
61
|
-
didChange = true;
|
|
62
|
-
return nextRoute; // Update to new route reference
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return route; // Keep current route reference
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
// Only create new array if changes occurred
|
|
69
|
-
const routesResult = didChange ? alignedRoutes : currentRoutes;
|
|
70
|
-
|
|
71
|
-
return {
|
|
72
|
-
routes: routesResult,
|
|
73
|
-
descriptors: composeDescriptors(
|
|
74
|
-
routesResult,
|
|
75
|
-
nextDescriptors,
|
|
76
|
-
currentDescriptors,
|
|
77
|
-
),
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Synchronizes routes while handling removed routes that may still be animating out.
|
|
83
|
-
* This manages the complex logic of keeping closing routes visible during transitions.
|
|
84
|
-
*/
|
|
85
|
-
const syncRoutesWithRemoved = ({
|
|
86
|
-
prevRoutes,
|
|
87
|
-
prevDescriptors,
|
|
88
|
-
nextRoutes,
|
|
89
|
-
nextDescriptors,
|
|
90
|
-
closingRouteKeys,
|
|
91
|
-
}: SyncRoutesWithRemovedParams) => {
|
|
92
|
-
if (nextRoutes.length === 0) {
|
|
93
|
-
closingRouteKeys.clear();
|
|
94
|
-
return {
|
|
95
|
-
routes: nextRoutes,
|
|
96
|
-
descriptors: {},
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// Start with next routes, will mutate if needed
|
|
101
|
-
const derivedRoutes: Route<string>[] = nextRoutes.slice();
|
|
102
|
-
|
|
103
|
-
// Get focused (last) routes for comparison
|
|
104
|
-
const previousFocusedRoute = prevRoutes[prevRoutes.length - 1];
|
|
105
|
-
const nextFocusedRoute = nextRoutes[nextRoutes.length - 1];
|
|
106
|
-
|
|
107
|
-
// Handle focus changes between routes
|
|
108
|
-
if (
|
|
109
|
-
previousFocusedRoute &&
|
|
110
|
-
nextFocusedRoute &&
|
|
111
|
-
previousFocusedRoute.key !== nextFocusedRoute.key
|
|
112
|
-
) {
|
|
113
|
-
const nextRouteWasPresent = prevRoutes.some(
|
|
114
|
-
(route) => route.key === nextFocusedRoute.key,
|
|
115
|
-
);
|
|
116
|
-
const previousRouteStillPresent = nextRoutes.some(
|
|
117
|
-
(route) => route.key === previousFocusedRoute.key,
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
if (nextRouteWasPresent && !previousRouteStillPresent) {
|
|
121
|
-
// Previous route was removed, mark as closing
|
|
122
|
-
closingRouteKeys.add(previousFocusedRoute.key);
|
|
123
|
-
|
|
124
|
-
derivedRoutes.push(previousFocusedRoute);
|
|
125
|
-
} else {
|
|
126
|
-
// Next route is now active, not closing
|
|
127
|
-
closingRouteKeys.remove(nextFocusedRoute.key);
|
|
128
|
-
|
|
129
|
-
if (!previousRouteStillPresent) {
|
|
130
|
-
// Previous route needs to be inserted for transition
|
|
131
|
-
closingRouteKeys.remove(previousFocusedRoute.key);
|
|
132
|
-
|
|
133
|
-
const insertIndex = Math.max(derivedRoutes.length - 1, 0);
|
|
134
|
-
derivedRoutes.splice(insertIndex, 0, previousFocusedRoute);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
} else if (nextFocusedRoute) {
|
|
138
|
-
// Same focused route, ensure it's not marked as closing
|
|
139
|
-
closingRouteKeys.remove(nextFocusedRoute.key);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// Clean up closing keys that are no longer in the route list
|
|
143
|
-
const activeKeys = new Set(derivedRoutes.map((route) => route.key));
|
|
144
|
-
for (const key of Array.from(closingRouteKeys.ref.current)) {
|
|
145
|
-
if (!activeKeys.has(key)) {
|
|
146
|
-
closingRouteKeys.remove(key);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
return {
|
|
151
|
-
routes: derivedRoutes,
|
|
152
|
-
descriptors: composeDescriptors(
|
|
153
|
-
derivedRoutes,
|
|
154
|
-
nextDescriptors,
|
|
155
|
-
prevDescriptors,
|
|
156
|
-
),
|
|
157
|
-
};
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
export const useStackNavigationState = (props: StackNavigationContextProps) => {
|
|
161
|
-
const previousRoutes = usePrevious(props.state.routes) ?? [];
|
|
162
|
-
const closingRouteKeys = useClosingRouteKeys();
|
|
163
|
-
|
|
164
|
-
const [localState, setLocalState] = useState(() => ({
|
|
165
|
-
routes: props.state.routes,
|
|
166
|
-
descriptors: props.descriptors,
|
|
167
|
-
}));
|
|
168
|
-
|
|
169
|
-
useLayoutEffect(() => {
|
|
170
|
-
const nextRoutesSnapshot = props.state.routes;
|
|
171
|
-
const previousRoutesSnapshot = previousRoutes;
|
|
172
|
-
|
|
173
|
-
setLocalState((current) => {
|
|
174
|
-
const routeKeysUnchanged = haveSameRouteKeys(
|
|
175
|
-
previousRoutesSnapshot,
|
|
176
|
-
nextRoutesSnapshot,
|
|
177
|
-
);
|
|
178
|
-
|
|
179
|
-
let derivedRoutes: Route<string>[];
|
|
180
|
-
let derivedDescriptors: BlankStackDescriptorMap;
|
|
181
|
-
|
|
182
|
-
if (routeKeysUnchanged) {
|
|
183
|
-
const result = alignRoutesWithLatest(
|
|
184
|
-
current.routes,
|
|
185
|
-
current.descriptors,
|
|
186
|
-
nextRoutesSnapshot,
|
|
187
|
-
props.descriptors,
|
|
188
|
-
);
|
|
189
|
-
|
|
190
|
-
derivedRoutes = result.routes;
|
|
191
|
-
derivedDescriptors = result.descriptors;
|
|
192
|
-
} else {
|
|
193
|
-
const fallbackRoutes =
|
|
194
|
-
previousRoutesSnapshot.length > 0
|
|
195
|
-
? previousRoutesSnapshot
|
|
196
|
-
: current.routes;
|
|
197
|
-
|
|
198
|
-
const result = syncRoutesWithRemoved({
|
|
199
|
-
prevRoutes: fallbackRoutes,
|
|
200
|
-
prevDescriptors: current.descriptors,
|
|
201
|
-
nextRoutes: nextRoutesSnapshot,
|
|
202
|
-
nextDescriptors: props.descriptors,
|
|
203
|
-
closingRouteKeys,
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
derivedRoutes = result.routes;
|
|
207
|
-
derivedDescriptors = result.descriptors;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
const routesChanged = !routesAreIdentical(current.routes, derivedRoutes);
|
|
211
|
-
const descriptorsChanged = !areDescriptorsEqual(
|
|
212
|
-
current.descriptors,
|
|
213
|
-
derivedDescriptors,
|
|
214
|
-
);
|
|
215
|
-
|
|
216
|
-
if (!routesChanged && !descriptorsChanged) {
|
|
217
|
-
return current;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
return {
|
|
221
|
-
routes: routesChanged ? derivedRoutes : current.routes,
|
|
222
|
-
descriptors: descriptorsChanged
|
|
223
|
-
? derivedDescriptors
|
|
224
|
-
: current.descriptors,
|
|
225
|
-
};
|
|
226
|
-
});
|
|
227
|
-
}, [props.state.routes, props.descriptors, previousRoutes, closingRouteKeys]);
|
|
228
|
-
|
|
229
|
-
const handleCloseRoute = useStableCallback(
|
|
230
|
-
({ route }: { route: Route<string> }) => {
|
|
231
|
-
if (props.state.routes.some((r) => r.key === route.key)) {
|
|
232
|
-
props.navigation.dispatch({
|
|
233
|
-
...StackActions.pop(),
|
|
234
|
-
source: route.key,
|
|
235
|
-
target: props.state.key,
|
|
236
|
-
});
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
closingRouteKeys.remove(route.key);
|
|
241
|
-
|
|
242
|
-
setLocalState((current) => {
|
|
243
|
-
if (!current.routes.some((candidate) => candidate.key === route.key)) {
|
|
244
|
-
return current;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
const nextRoutes = current.routes.filter(
|
|
248
|
-
(candidate) => candidate.key !== route.key,
|
|
249
|
-
);
|
|
250
|
-
|
|
251
|
-
const nextDescriptors = { ...current.descriptors };
|
|
252
|
-
delete nextDescriptors[route.key];
|
|
253
|
-
|
|
254
|
-
return {
|
|
255
|
-
routes: nextRoutes,
|
|
256
|
-
descriptors: nextDescriptors,
|
|
257
|
-
};
|
|
258
|
-
});
|
|
259
|
-
},
|
|
260
|
-
);
|
|
261
|
-
|
|
262
|
-
return {
|
|
263
|
-
state: localState,
|
|
264
|
-
handleCloseRoute,
|
|
265
|
-
closingRouteKeys,
|
|
266
|
-
};
|
|
267
|
-
};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
2
|
-
import createProvider from "../../../shared/utils/create-provider";
|
|
3
|
-
import type { BlankStackScene } from "../../types";
|
|
4
|
-
import { calculateActiveScreensLimit } from "./helpers/calculate-active-screens-limit";
|
|
5
|
-
import { useStackNavigationState } from "./hooks/use-stack-navigation-state";
|
|
6
|
-
import type {
|
|
7
|
-
StackNavigationContextProps,
|
|
8
|
-
StackNavigationContextValue,
|
|
9
|
-
} from "./types";
|
|
10
|
-
|
|
11
|
-
const { withStackNavigationProvider, useStackNavigationContext } =
|
|
12
|
-
createProvider("StackNavigation")<
|
|
13
|
-
StackNavigationContextProps,
|
|
14
|
-
StackNavigationContextValue
|
|
15
|
-
>((props) => {
|
|
16
|
-
const { state, handleCloseRoute, closingRouteKeys } =
|
|
17
|
-
useStackNavigationState(props);
|
|
18
|
-
|
|
19
|
-
const { scenes, activeScreensLimit, shouldShowFloatOverlay } =
|
|
20
|
-
useMemo(() => {
|
|
21
|
-
const scenes: BlankStackScene[] = [];
|
|
22
|
-
let shouldShowFloatOverlay = false;
|
|
23
|
-
|
|
24
|
-
for (const route of state.routes) {
|
|
25
|
-
const descriptor = state.descriptors[route.key];
|
|
26
|
-
scenes.push({ route, descriptor });
|
|
27
|
-
|
|
28
|
-
if (!shouldShowFloatOverlay) {
|
|
29
|
-
const options = descriptor?.options;
|
|
30
|
-
shouldShowFloatOverlay =
|
|
31
|
-
options?.overlayMode === "float" &&
|
|
32
|
-
options?.overlayShown === true;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return {
|
|
37
|
-
scenes,
|
|
38
|
-
activeScreensLimit: calculateActiveScreensLimit(
|
|
39
|
-
state.routes,
|
|
40
|
-
state.descriptors,
|
|
41
|
-
),
|
|
42
|
-
shouldShowFloatOverlay,
|
|
43
|
-
};
|
|
44
|
-
}, [state.routes, state.descriptors]);
|
|
45
|
-
|
|
46
|
-
const value = useMemo(
|
|
47
|
-
() => ({
|
|
48
|
-
routes: state.routes,
|
|
49
|
-
focusedIndex: props.state.index,
|
|
50
|
-
descriptors: state.descriptors,
|
|
51
|
-
closingRouteKeysShared: closingRouteKeys.shared,
|
|
52
|
-
activeScreensLimit,
|
|
53
|
-
handleCloseRoute,
|
|
54
|
-
scenes,
|
|
55
|
-
shouldShowFloatOverlay,
|
|
56
|
-
}),
|
|
57
|
-
[
|
|
58
|
-
state.routes,
|
|
59
|
-
state.descriptors,
|
|
60
|
-
props.state.index,
|
|
61
|
-
closingRouteKeys.shared,
|
|
62
|
-
activeScreensLimit,
|
|
63
|
-
handleCloseRoute,
|
|
64
|
-
scenes,
|
|
65
|
-
shouldShowFloatOverlay,
|
|
66
|
-
],
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
return {
|
|
70
|
-
value,
|
|
71
|
-
};
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
export { useStackNavigationContext, withStackNavigationProvider };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
NavigationRoute,
|
|
3
|
-
ParamListBase,
|
|
4
|
-
Route,
|
|
5
|
-
RouteProp,
|
|
6
|
-
StackNavigationState,
|
|
7
|
-
} from "@react-navigation/native";
|
|
8
|
-
import type { SharedValue } from "react-native-reanimated";
|
|
9
|
-
import type {
|
|
10
|
-
BlankStackDescriptor,
|
|
11
|
-
BlankStackDescriptorMap,
|
|
12
|
-
BlankStackNavigationHelpers,
|
|
13
|
-
BlankStackScene,
|
|
14
|
-
} from "../../types";
|
|
15
|
-
|
|
16
|
-
export interface StackNavigationContextValue {
|
|
17
|
-
routes: NavigationRoute<ParamListBase, string>[];
|
|
18
|
-
descriptors: BlankStackDescriptorMap;
|
|
19
|
-
scenes: BlankStackScene[];
|
|
20
|
-
activeScreensLimit: number;
|
|
21
|
-
closingRouteKeysShared: SharedValue<string[]>;
|
|
22
|
-
handleCloseRoute: (payload: { route: Route<string> }) => void;
|
|
23
|
-
shouldShowFloatOverlay: boolean;
|
|
24
|
-
focusedIndex: number;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface StackNavigationContextProps {
|
|
28
|
-
state: StackNavigationState<ParamListBase>;
|
|
29
|
-
navigation: BlankStackNavigationHelpers;
|
|
30
|
-
descriptors: BlankStackDescriptorMap;
|
|
31
|
-
describe: (
|
|
32
|
-
route: RouteProp<ParamListBase>,
|
|
33
|
-
placeholder: boolean,
|
|
34
|
-
) => BlankStackDescriptor;
|
|
35
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type React from "react";
|
|
2
|
-
import { ScreenFooter } from "react-native-screens";
|
|
3
|
-
|
|
4
|
-
type FooterProps = {
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export function FooterComponent({ children }: FooterProps) {
|
|
9
|
-
return <ScreenFooter collapsable={false}>{children}</ScreenFooter>;
|
|
10
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { useLayoutEffect } from "react";
|
|
2
|
-
import { useAnimatedReaction } from "react-native-reanimated";
|
|
3
|
-
import type { BlankStackDescriptor } from "../../../blank-stack/types";
|
|
4
|
-
import { useStackNavigationContext } from "../../../blank-stack/utils/with-stack-navigation";
|
|
5
|
-
import useStableCallback from "../../hooks/use-stable-callback";
|
|
6
|
-
import { useKeys } from "../../providers/keys.provider";
|
|
7
|
-
import { AnimationStore } from "../../stores/animation.store";
|
|
8
|
-
import { startScreenTransition } from "../../utils/animation/start-screen-transition";
|
|
9
|
-
import { resetStoresForScreen } from "../../utils/reset-stores-for-screen";
|
|
10
|
-
|
|
11
|
-
export interface Props {
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Lifecycle controller built out for Blank Stack implementation.
|
|
17
|
-
*/
|
|
18
|
-
export const BlankStackScreenLifecycleController = ({ children }: Props) => {
|
|
19
|
-
const { current } = useKeys<BlankStackDescriptor>();
|
|
20
|
-
const { handleCloseRoute, closingRouteKeysShared } =
|
|
21
|
-
useStackNavigationContext();
|
|
22
|
-
|
|
23
|
-
const animations = AnimationStore.getAll(current.route.key);
|
|
24
|
-
|
|
25
|
-
const handleInitialize = useStableCallback(() => {
|
|
26
|
-
startScreenTransition({
|
|
27
|
-
target: "open",
|
|
28
|
-
spec: current.options.transitionSpec,
|
|
29
|
-
animations,
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
const handleCleanup = useStableCallback(() => {
|
|
34
|
-
resetStoresForScreen(current);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
const handleCloseEnd = useStableCallback((finished: boolean) => {
|
|
38
|
-
if (!finished) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
handleCloseRoute({ route: current.route });
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
useAnimatedReaction(
|
|
45
|
-
() => ({
|
|
46
|
-
keys: closingRouteKeysShared.value,
|
|
47
|
-
}),
|
|
48
|
-
({ keys }) => {
|
|
49
|
-
if (!keys.includes(current.route.key)) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
startScreenTransition({
|
|
54
|
-
target: "close",
|
|
55
|
-
spec: current.options.transitionSpec,
|
|
56
|
-
animations,
|
|
57
|
-
onAnimationFinish: handleCloseEnd,
|
|
58
|
-
});
|
|
59
|
-
},
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
useLayoutEffect(() => {
|
|
63
|
-
handleInitialize();
|
|
64
|
-
return () => {
|
|
65
|
-
handleCleanup();
|
|
66
|
-
};
|
|
67
|
-
}, [handleInitialize, handleCleanup]);
|
|
68
|
-
|
|
69
|
-
return children;
|
|
70
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import createProvider from "../utils/create-provider";
|
|
2
|
-
|
|
3
|
-
interface FlagsValue {
|
|
4
|
-
TRANSITIONS_ALWAYS_ON: boolean;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
interface FlagsProviderProps {
|
|
8
|
-
TRANSITIONS_ALWAYS_ON?: boolean;
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const { FlagsProvider, useFlagsContext } = createProvider("Flags", {
|
|
13
|
-
guarded: false,
|
|
14
|
-
})<FlagsProviderProps, FlagsValue>(
|
|
15
|
-
({ TRANSITIONS_ALWAYS_ON = false, children }) => ({
|
|
16
|
-
value: { TRANSITIONS_ALWAYS_ON },
|
|
17
|
-
children,
|
|
18
|
-
}),
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
export { FlagsProvider, useFlagsContext };
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
2
|
-
import {
|
|
3
|
-
AnimationStore,
|
|
4
|
-
type AnimationStoreMap,
|
|
5
|
-
} from "../stores/animation.store";
|
|
6
|
-
import createProvider from "../utils/create-provider";
|
|
7
|
-
|
|
8
|
-
interface RoutesProviderProps {
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
routeKeys: string[];
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface RoutesContextValue {
|
|
14
|
-
/**
|
|
15
|
-
* Array of route keys for all routes in the stack, in order.
|
|
16
|
-
*/
|
|
17
|
-
routeKeys: string[];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const { RoutesProvider, useRoutesContext } = createProvider("Routes", {
|
|
21
|
-
guarded: false,
|
|
22
|
-
})<RoutesProviderProps, RoutesContextValue>(({ routeKeys }) => ({
|
|
23
|
-
value: { routeKeys },
|
|
24
|
-
}));
|
|
25
|
-
|
|
26
|
-
export { RoutesProvider, useRoutesContext };
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Hook to get animation values for all screens from a given index onwards.
|
|
30
|
-
* Useful for computing accumulated progress across multiple screens.
|
|
31
|
-
*/
|
|
32
|
-
export function useStackAnimationValues(
|
|
33
|
-
currentRouteKey: string | undefined,
|
|
34
|
-
): AnimationStoreMap[] {
|
|
35
|
-
const routesContext = useRoutesContext();
|
|
36
|
-
|
|
37
|
-
return useMemo(() => {
|
|
38
|
-
if (!currentRouteKey || !routesContext) {
|
|
39
|
-
return [];
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const { routeKeys } = routesContext;
|
|
43
|
-
const currentIndex = routeKeys.indexOf(currentRouteKey);
|
|
44
|
-
|
|
45
|
-
if (currentIndex === -1) {
|
|
46
|
-
return [];
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Get animation values for all screens from current index onwards
|
|
50
|
-
return routeKeys
|
|
51
|
-
.slice(currentIndex)
|
|
52
|
-
.map((key) => AnimationStore.getAll(key));
|
|
53
|
-
}, [currentRouteKey, routesContext]);
|
|
54
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type React from "react";
|
|
2
|
-
import type { ComponentType } from "react";
|
|
3
|
-
import { RootTransitionAware } from "../components/root-transition-aware";
|
|
4
|
-
import type { Any } from "../types/utils.types";
|
|
5
|
-
import { ScreenGestureProvider } from "./gestures.provider";
|
|
6
|
-
import { KeysProvider, type TransitionDescriptor } from "./keys.provider";
|
|
7
|
-
import { TransitionStylesProvider } from "./transition-styles.provider";
|
|
8
|
-
|
|
9
|
-
type Props<TDescriptor extends TransitionDescriptor> = {
|
|
10
|
-
previous?: TDescriptor;
|
|
11
|
-
current: TDescriptor;
|
|
12
|
-
next?: TDescriptor;
|
|
13
|
-
children: React.ReactNode;
|
|
14
|
-
LifecycleController: ComponentType<Any>;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export function ScreenTransitionProvider<
|
|
18
|
-
TDescriptor extends TransitionDescriptor,
|
|
19
|
-
>({
|
|
20
|
-
previous,
|
|
21
|
-
current,
|
|
22
|
-
next,
|
|
23
|
-
children,
|
|
24
|
-
LifecycleController,
|
|
25
|
-
}: Props<TDescriptor>) {
|
|
26
|
-
return (
|
|
27
|
-
<KeysProvider<TDescriptor>
|
|
28
|
-
previous={previous}
|
|
29
|
-
current={current}
|
|
30
|
-
next={next}
|
|
31
|
-
>
|
|
32
|
-
<ScreenGestureProvider>
|
|
33
|
-
<LifecycleController>
|
|
34
|
-
<TransitionStylesProvider>
|
|
35
|
-
<RootTransitionAware>{children}</RootTransitionAware>
|
|
36
|
-
</TransitionStylesProvider>
|
|
37
|
-
</LifecycleController>
|
|
38
|
-
</ScreenGestureProvider>
|
|
39
|
-
</KeysProvider>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext, useMemo } from "react";
|
|
2
|
-
import { type SharedValue, useDerivedValue } from "react-native-reanimated";
|
|
3
|
-
import { NO_STYLES } from "../constants";
|
|
4
|
-
import { _useScreenAnimation } from "../hooks/animation/use-screen-animation";
|
|
5
|
-
import type { TransitionInterpolatedStyle } from "../types/animation.types";
|
|
6
|
-
import { createBounds } from "../utils/bounds";
|
|
7
|
-
|
|
8
|
-
type Props = {
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
type TransitionStylesContextValue = {
|
|
13
|
-
stylesMap: SharedValue<TransitionInterpolatedStyle>;
|
|
14
|
-
ancestorStylesMaps: SharedValue<TransitionInterpolatedStyle>[];
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const TransitionStylesContext =
|
|
18
|
-
createContext<TransitionStylesContextValue | null>(null);
|
|
19
|
-
|
|
20
|
-
export function TransitionStylesProvider({ children }: Props) {
|
|
21
|
-
const parentCtx = useContext(TransitionStylesContext);
|
|
22
|
-
|
|
23
|
-
const { screenInterpolatorProps, screenStyleInterpolator } =
|
|
24
|
-
_useScreenAnimation();
|
|
25
|
-
|
|
26
|
-
const stylesMap = useDerivedValue<TransitionInterpolatedStyle>(() => {
|
|
27
|
-
"worklet";
|
|
28
|
-
const props = screenInterpolatorProps.value;
|
|
29
|
-
const bounds = createBounds(props);
|
|
30
|
-
try {
|
|
31
|
-
if (!screenStyleInterpolator) return NO_STYLES;
|
|
32
|
-
return screenStyleInterpolator({
|
|
33
|
-
...props,
|
|
34
|
-
bounds,
|
|
35
|
-
});
|
|
36
|
-
} catch (err) {
|
|
37
|
-
if (__DEV__) {
|
|
38
|
-
console.warn(
|
|
39
|
-
"[react-native-screen-transitions] screenStyleInterpolator must be a worklet",
|
|
40
|
-
err,
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
return NO_STYLES;
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
const value = useMemo(() => {
|
|
48
|
-
// Build ancestor chain: [parent, grandparent, great-grandparent, ...]
|
|
49
|
-
const ancestorStylesMaps = parentCtx
|
|
50
|
-
? [parentCtx.stylesMap, ...parentCtx.ancestorStylesMaps]
|
|
51
|
-
: [];
|
|
52
|
-
|
|
53
|
-
return {
|
|
54
|
-
stylesMap,
|
|
55
|
-
ancestorStylesMaps,
|
|
56
|
-
};
|
|
57
|
-
}, [stylesMap, parentCtx]);
|
|
58
|
-
|
|
59
|
-
return (
|
|
60
|
-
<TransitionStylesContext.Provider value={value}>
|
|
61
|
-
{children}
|
|
62
|
-
</TransitionStylesContext.Provider>
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export function useTransitionStyles() {
|
|
67
|
-
const ctx = useContext(TransitionStylesContext);
|
|
68
|
-
if (!ctx) {
|
|
69
|
-
throw new Error(
|
|
70
|
-
"useTransitionStyles must be used within a TransitionStylesProvider",
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
return ctx;
|
|
74
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { AnimationStoreMap } from "../../stores/animation.store";
|
|
2
|
-
|
|
3
|
-
export const computeStackProgress = (
|
|
4
|
-
stackAnimationValues: AnimationStoreMap[],
|
|
5
|
-
fallback: number = 0,
|
|
6
|
-
) => {
|
|
7
|
-
"worklet";
|
|
8
|
-
let computedStackProgress: number | undefined;
|
|
9
|
-
if (stackAnimationValues.length > 0) {
|
|
10
|
-
computedStackProgress = 0;
|
|
11
|
-
for (let i = 0; i < stackAnimationValues.length; i += 1) {
|
|
12
|
-
computedStackProgress += stackAnimationValues[i].progress.value;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return computedStackProgress ?? fallback;
|
|
16
|
-
};
|