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,46 @@
|
|
|
1
|
+
export type {
|
|
2
|
+
AnimationConfig,
|
|
3
|
+
OverlayInterpolationProps,
|
|
4
|
+
ScreenInterpolationProps,
|
|
5
|
+
ScreenStyleInterpolator,
|
|
6
|
+
ScreenTransitionState,
|
|
7
|
+
TransitionInterpolatedStyle,
|
|
8
|
+
TransitionSpec,
|
|
9
|
+
} from "./animation.types";
|
|
10
|
+
|
|
11
|
+
export type {
|
|
12
|
+
BoundEntry,
|
|
13
|
+
BoundsAccessor,
|
|
14
|
+
BoundsLink,
|
|
15
|
+
BoundsMethod,
|
|
16
|
+
} from "./bounds.types";
|
|
17
|
+
|
|
18
|
+
export type {
|
|
19
|
+
ActivationArea,
|
|
20
|
+
GestureActivationArea,
|
|
21
|
+
GestureDirection,
|
|
22
|
+
GestureValues,
|
|
23
|
+
SideActivation,
|
|
24
|
+
} from "./gesture.types";
|
|
25
|
+
|
|
26
|
+
export type {
|
|
27
|
+
OverlayMode,
|
|
28
|
+
OverlayProps,
|
|
29
|
+
} from "./overlay.types";
|
|
30
|
+
|
|
31
|
+
export type {
|
|
32
|
+
Layout,
|
|
33
|
+
ScreenKey,
|
|
34
|
+
ScreenTransitionConfig,
|
|
35
|
+
TransitionAwareProps,
|
|
36
|
+
} from "./screen.types";
|
|
37
|
+
|
|
38
|
+
export type {
|
|
39
|
+
BaseStackDescriptor,
|
|
40
|
+
BaseStackNavigation,
|
|
41
|
+
BaseStackRoute,
|
|
42
|
+
BaseStackScene,
|
|
43
|
+
BaseStackState,
|
|
44
|
+
} from "./stack.types";
|
|
45
|
+
|
|
46
|
+
export { FALSE, TRUE } from "./state.types";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Route } from "@react-navigation/native";
|
|
2
|
+
import type { DerivedValue } from "react-native-reanimated";
|
|
3
|
+
import type {
|
|
4
|
+
OverlayInterpolationProps,
|
|
5
|
+
ScreenInterpolationProps,
|
|
6
|
+
} from "./animation.types";
|
|
7
|
+
|
|
8
|
+
export type OverlayMode = "float" | "screen";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Props passed to overlay components.
|
|
12
|
+
* Generic over the navigation type since different stacks have different navigation props.
|
|
13
|
+
*/
|
|
14
|
+
export type OverlayProps<TNavigation = unknown> = {
|
|
15
|
+
/**
|
|
16
|
+
* Route of the currently focused screen in the stack.
|
|
17
|
+
*/
|
|
18
|
+
focusedRoute: Route<string>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Index of the focused route in the stack.
|
|
22
|
+
*/
|
|
23
|
+
focusedIndex: number;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* All routes currently in the stack.
|
|
27
|
+
*/
|
|
28
|
+
routes: Route<string>[];
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Custom metadata from the focused screen's options.
|
|
32
|
+
*/
|
|
33
|
+
meta?: Record<string, unknown>;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Navigation prop for the overlay.
|
|
37
|
+
*/
|
|
38
|
+
navigation: TNavigation;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Animation values for the overlay.
|
|
42
|
+
*/
|
|
43
|
+
overlayAnimation: DerivedValue<OverlayInterpolationProps>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Animation values for the screen.
|
|
47
|
+
*/
|
|
48
|
+
screenAnimation: DerivedValue<ScreenInterpolationProps>;
|
|
49
|
+
};
|
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
TransitionSpec,
|
|
5
5
|
} from "./animation.types";
|
|
6
6
|
import type { GestureActivationArea, GestureDirection } from "./gesture.types";
|
|
7
|
+
import type { OverlayMode, OverlayProps } from "./overlay.types";
|
|
7
8
|
|
|
8
9
|
export type Layout = {
|
|
9
10
|
width: number;
|
|
@@ -12,8 +13,6 @@ export type Layout = {
|
|
|
12
13
|
|
|
13
14
|
export type ScreenKey = string;
|
|
14
15
|
|
|
15
|
-
export type ScreenPhase = "previous" | "current" | "next";
|
|
16
|
-
|
|
17
16
|
export type TransitionAwareProps<T extends object> = AnimatedProps<T> & {
|
|
18
17
|
/**
|
|
19
18
|
* Connects this component to custom animated styles defined in screenStyleInterpolator.
|
|
@@ -55,11 +54,6 @@ export type TransitionAwareProps<T extends object> = AnimatedProps<T> & {
|
|
|
55
54
|
sharedBoundTag?: string;
|
|
56
55
|
};
|
|
57
56
|
|
|
58
|
-
export type TransitionConfig = {
|
|
59
|
-
open: TransitionSpec;
|
|
60
|
-
close: TransitionSpec;
|
|
61
|
-
};
|
|
62
|
-
|
|
63
57
|
export type ScreenTransitionConfig = {
|
|
64
58
|
/**
|
|
65
59
|
* The user-provided function to calculate styles based on animation progress.
|
|
@@ -108,4 +102,37 @@ export type ScreenTransitionConfig = {
|
|
|
108
102
|
* options={{ meta: { scalesOthers: true } }}
|
|
109
103
|
*/
|
|
110
104
|
meta?: Record<string, unknown>;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Function that returns a React Element to display as an overlay.
|
|
108
|
+
* For container overlays (overlayMode: 'container'), use ContainerOverlayProps which includes children.
|
|
109
|
+
*/
|
|
110
|
+
overlay?: (props: OverlayProps) => React.ReactNode;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* How the overlay is positioned relative to screens.
|
|
114
|
+
* - 'float': Single persistent overlay above all screens (like iOS tab bar)
|
|
115
|
+
* - 'screen': Per-screen overlay that transitions with content
|
|
116
|
+
* - 'container': Wraps all screen content, receives children prop (for MaskedView, custom containers)
|
|
117
|
+
* @default 'screen'
|
|
118
|
+
*/
|
|
119
|
+
overlayMode?: OverlayMode;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Whether to show the overlay. The overlay is shown by default when `overlay` is provided.
|
|
123
|
+
* Setting this to `false` hides the overlay.
|
|
124
|
+
*/
|
|
125
|
+
overlayShown?: boolean;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Forces the display to run at its maximum refresh rate during screen transitions.
|
|
129
|
+
* Prevents iOS/Android from throttling to 60fps for battery savings.
|
|
130
|
+
*
|
|
131
|
+
* Useful for smoother animations on high refresh rate displays (90/120/144Hz).
|
|
132
|
+
* Note: Increases battery usage while active.
|
|
133
|
+
*
|
|
134
|
+
* @experimental This API may change in future versions.
|
|
135
|
+
* @default false
|
|
136
|
+
*/
|
|
137
|
+
experimental_enableHighRefreshRate?: boolean;
|
|
111
138
|
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { ScreenTransitionConfig } from "./screen.types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Base route interface - minimal contract all stacks satisfy.
|
|
5
|
+
* Uses `object` for params to be compatible with React Navigation's `Readonly<object | undefined>`.
|
|
6
|
+
*/
|
|
7
|
+
export interface BaseStackRoute {
|
|
8
|
+
key: string;
|
|
9
|
+
name: string;
|
|
10
|
+
params?: object;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Base navigation interface - minimal contract for gesture handling.
|
|
15
|
+
* Both React Navigation helpers and ComponentNavigation satisfy this.
|
|
16
|
+
*/
|
|
17
|
+
export interface BaseStackNavigation {
|
|
18
|
+
getState: () => { routes: Array<{ key: string }>; key: string };
|
|
19
|
+
dispatch: (action: any) => void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Base descriptor interface - generic over route, navigation, and options.
|
|
24
|
+
* All stack descriptors (BlankStack, NativeStack) extend this.
|
|
25
|
+
*/
|
|
26
|
+
export interface BaseStackDescriptor<
|
|
27
|
+
TRoute extends BaseStackRoute = BaseStackRoute,
|
|
28
|
+
TNavigation extends BaseStackNavigation = BaseStackNavigation,
|
|
29
|
+
TOptions extends ScreenTransitionConfig = ScreenTransitionConfig,
|
|
30
|
+
> {
|
|
31
|
+
route: TRoute;
|
|
32
|
+
navigation: TNavigation;
|
|
33
|
+
options: TOptions;
|
|
34
|
+
render?: () => React.JSX.Element | null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Base scene interface - route + descriptor pair.
|
|
39
|
+
* Used by all stack views to iterate over screens.
|
|
40
|
+
*/
|
|
41
|
+
export interface BaseStackScene<
|
|
42
|
+
TDescriptor extends BaseStackDescriptor = BaseStackDescriptor,
|
|
43
|
+
> {
|
|
44
|
+
route: TDescriptor["route"];
|
|
45
|
+
descriptor: TDescriptor;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Base state interface - routes array with index.
|
|
50
|
+
* Common structure across all navigation states.
|
|
51
|
+
*/
|
|
52
|
+
export interface BaseStackState<
|
|
53
|
+
TRoute extends BaseStackRoute = BaseStackRoute,
|
|
54
|
+
> {
|
|
55
|
+
routes: TRoute[];
|
|
56
|
+
index: number;
|
|
57
|
+
key: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export enum StackType {
|
|
61
|
+
NATIVE = "native",
|
|
62
|
+
BLANK = "blank",
|
|
63
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MeasuredDimensions } from "react-native-reanimated";
|
|
2
|
-
import type { Layout } from "../../../types/
|
|
2
|
+
import type { Layout } from "../../../types/screen.types";
|
|
3
3
|
import type { BoundsAnchor, BoundsScaleMode } from "../types/builder";
|
|
4
4
|
import type {
|
|
5
5
|
ContentTransformGeometry,
|
|
@@ -30,7 +30,7 @@ export type ElementComposeParams = {
|
|
|
30
30
|
* - geometry: precomputed screen-level tx/ty/sx/sy plus ranges/entering
|
|
31
31
|
* - interp: function to interpolate between numbers using the correct progress range
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
type ContentComposeParams = {
|
|
34
34
|
start: MeasuredDimensions;
|
|
35
35
|
end: MeasuredDimensions;
|
|
36
36
|
geometry: ContentTransformGeometry;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { ImageStyle, StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
2
2
|
import { isSharedValue } from "react-native-reanimated";
|
|
3
|
-
import type { Any } from "../../../types/utils.types";
|
|
4
3
|
|
|
5
4
|
type AnyStyle = ViewStyle | TextStyle | ImageStyle;
|
|
6
5
|
type StyleValue = StyleProp<AnyStyle>;
|
|
7
|
-
type PlainStyleObject = Record<string,
|
|
6
|
+
type PlainStyleObject = Record<string, any>;
|
|
8
7
|
|
|
9
8
|
function mergeStyleArrays<T extends StyleValue>(style: T): T {
|
|
10
9
|
"worklet";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { interpolate, type MeasuredDimensions } from "react-native-reanimated";
|
|
2
2
|
import {
|
|
3
3
|
EMPTY_BOUND_HELPER_RESULT,
|
|
4
4
|
EMPTY_BOUND_HELPER_RESULT_RAW,
|
|
@@ -12,7 +12,7 @@ import type {
|
|
|
12
12
|
ScreenTransitionState,
|
|
13
13
|
} from "../../types/animation.types";
|
|
14
14
|
import type { BoundsAccessor, BoundsLink } from "../../types/bounds.types";
|
|
15
|
-
import type { Layout } from "../../types/
|
|
15
|
+
import type { Layout } from "../../types/screen.types";
|
|
16
16
|
import {
|
|
17
17
|
computeContentTransformGeometry,
|
|
18
18
|
computeRelativeGeometry,
|
|
@@ -31,14 +31,6 @@ import type {
|
|
|
31
31
|
BoundsComputeParams,
|
|
32
32
|
} from "./types/builder";
|
|
33
33
|
|
|
34
|
-
export interface BuildBoundsAccessorParams {
|
|
35
|
-
current: ScreenTransitionState;
|
|
36
|
-
previous?: ScreenTransitionState;
|
|
37
|
-
next?: ScreenTransitionState;
|
|
38
|
-
progress: number;
|
|
39
|
-
dimensions: Layout;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
34
|
const resolveBounds = (props: {
|
|
43
35
|
id: string;
|
|
44
36
|
previous?: ScreenTransitionState;
|
|
@@ -235,9 +227,26 @@ export const createBounds = (
|
|
|
235
227
|
});
|
|
236
228
|
};
|
|
237
229
|
|
|
230
|
+
const interpolateBounds = (
|
|
231
|
+
tag: string,
|
|
232
|
+
property: keyof MeasuredDimensions,
|
|
233
|
+
fallback?: number,
|
|
234
|
+
): number => {
|
|
235
|
+
"worklet";
|
|
236
|
+
const link = getLink(tag);
|
|
237
|
+
const entering = !props.next;
|
|
238
|
+
const range = entering ? ENTER_RANGE : EXIT_RANGE;
|
|
239
|
+
|
|
240
|
+
const sourceValue = link?.source?.bounds?.[property] ?? fallback ?? 0;
|
|
241
|
+
const destValue = link?.destination?.bounds?.[property] ?? fallback ?? 0;
|
|
242
|
+
|
|
243
|
+
return interpolate(props.progress, range, [sourceValue, destValue], "clamp");
|
|
244
|
+
};
|
|
245
|
+
|
|
238
246
|
return Object.assign(boundsFunction, {
|
|
239
247
|
getSnapshot,
|
|
240
248
|
getLink,
|
|
241
249
|
interpolateStyle,
|
|
250
|
+
interpolateBounds,
|
|
242
251
|
}) as BoundsAccessor;
|
|
243
252
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { MeasuredDimensions, StyleProps } from "react-native-reanimated";
|
|
2
2
|
import type { ScreenTransitionState } from "../../../types/animation.types";
|
|
3
3
|
import type { BoundsMethod } from "../../../types/bounds.types";
|
|
4
|
-
import type { Layout } from "../../../types/
|
|
4
|
+
import type { Layout } from "../../../types/screen.types";
|
|
5
5
|
|
|
6
6
|
export type BoundsAnchor =
|
|
7
7
|
| "topLeading"
|
|
@@ -16,9 +16,9 @@ export type BoundsAnchor =
|
|
|
16
16
|
|
|
17
17
|
export type BoundsScaleMode = "match" | "none" | "uniform";
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
type BoundsTarget = "bound" | "fullscreen" | MeasuredDimensions;
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
type BoundsSpace = "relative" | "absolute";
|
|
22
22
|
|
|
23
23
|
export type BoundsComputeParams = {
|
|
24
24
|
id?: string;
|
|
@@ -29,35 +29,35 @@ export type BoundsComputeParams = {
|
|
|
29
29
|
dimensions: Layout;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
type RawSizeAbsoluteReturn = {
|
|
33
33
|
width: number;
|
|
34
34
|
height: number;
|
|
35
35
|
translateX: number;
|
|
36
36
|
translateY: number;
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
type RawSizeRelativeReturn = {
|
|
40
40
|
translateX: number;
|
|
41
41
|
translateY: number;
|
|
42
42
|
width: number;
|
|
43
43
|
height: number;
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
type RawTransformAbsoluteReturn = {
|
|
47
47
|
translateX: number;
|
|
48
48
|
translateY: number;
|
|
49
49
|
scaleX: number;
|
|
50
50
|
scaleY: number;
|
|
51
51
|
};
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
type RawTransformRelativeReturn = {
|
|
54
54
|
translateX: number;
|
|
55
55
|
translateY: number;
|
|
56
56
|
scaleX: number;
|
|
57
57
|
scaleY: number;
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
type RawContentReturn = {
|
|
61
61
|
translateX: number;
|
|
62
62
|
translateY: number;
|
|
63
63
|
scale: number;
|
|
@@ -90,25 +90,23 @@ export default function createProvider<
|
|
|
90
90
|
return context;
|
|
91
91
|
};
|
|
92
92
|
|
|
93
|
+
/**
|
|
94
|
+
* HOC that wraps a component with the provider.
|
|
95
|
+
* Uses the Provider component internally to ensure hooks are called correctly.
|
|
96
|
+
*/
|
|
93
97
|
const withProvider = (Component: ComponentType<ContextValue>) => {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
if (!
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
const memoValue = useMemo(
|
|
104
|
-
() => (enabled ? value : null),
|
|
105
|
-
[enabled, value],
|
|
106
|
-
);
|
|
98
|
+
// Consumer component that reads context and passes to wrapped component
|
|
99
|
+
const ContextConsumer = () => {
|
|
100
|
+
const contextValue = useEnhancedContext();
|
|
101
|
+
if (!contextValue) return null;
|
|
102
|
+
return <Component {...contextValue} />;
|
|
103
|
+
};
|
|
107
104
|
|
|
105
|
+
return function WithProviderWrapper(props: ProviderProps) {
|
|
108
106
|
return (
|
|
109
|
-
<
|
|
110
|
-
<
|
|
111
|
-
</
|
|
107
|
+
<Provider {...props}>
|
|
108
|
+
<ContextConsumer />
|
|
109
|
+
</Provider>
|
|
112
110
|
);
|
|
113
111
|
};
|
|
114
112
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { GestureStateManagerType } from "react-native-gesture-handler/lib/typescript/handlers/gestures/gestureStateManager";
|
|
2
2
|
import type { SharedValue } from "react-native-reanimated";
|
|
3
|
-
import type { Layout } from "../../types/core.types";
|
|
4
3
|
import {
|
|
5
4
|
type ActivationArea,
|
|
6
5
|
type GestureActivationArea,
|
|
7
6
|
GestureOffsetState,
|
|
8
7
|
type SideActivation,
|
|
9
8
|
} from "../../types/gesture.types";
|
|
9
|
+
import type { Layout } from "../../types/screen.types";
|
|
10
10
|
|
|
11
11
|
type Directions = {
|
|
12
12
|
vertical: boolean;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { composeDescriptors } from "./compose-descriptors";
|
|
2
|
+
|
|
3
|
+
interface RouteWithKey {
|
|
4
|
+
key: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Aligns current routes with the latest route data while preserving references
|
|
9
|
+
* when possible for performance optimization
|
|
10
|
+
*/
|
|
11
|
+
export const alignRoutesWithLatest = <
|
|
12
|
+
Route extends RouteWithKey,
|
|
13
|
+
DescriptorMap extends Record<string, unknown>,
|
|
14
|
+
>(
|
|
15
|
+
currentRoutes: Route[],
|
|
16
|
+
currentDescriptors: DescriptorMap,
|
|
17
|
+
nextRoutes: Route[],
|
|
18
|
+
nextDescriptors: DescriptorMap,
|
|
19
|
+
): { routes: Route[]; descriptors: DescriptorMap } => {
|
|
20
|
+
// Early return for empty current routes
|
|
21
|
+
if (currentRoutes.length === 0) {
|
|
22
|
+
return {
|
|
23
|
+
routes: nextRoutes,
|
|
24
|
+
descriptors: composeDescriptors(
|
|
25
|
+
nextRoutes,
|
|
26
|
+
nextDescriptors,
|
|
27
|
+
currentDescriptors,
|
|
28
|
+
),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Create lookup map for efficient route finding
|
|
33
|
+
const nextRouteLookup = new Map<string, Route>();
|
|
34
|
+
for (const route of nextRoutes) {
|
|
35
|
+
nextRouteLookup.set(route.key, route);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Track if any changes occurred
|
|
39
|
+
let didChange = currentRoutes.length !== nextRoutes.length;
|
|
40
|
+
|
|
41
|
+
// Align routes, updating references where needed
|
|
42
|
+
const alignedRoutes = currentRoutes.map((route) => {
|
|
43
|
+
const nextRoute = nextRouteLookup.get(route.key);
|
|
44
|
+
|
|
45
|
+
if (!nextRoute) {
|
|
46
|
+
return route; // Keep current route if not in next
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (nextRoute !== route) {
|
|
50
|
+
didChange = true;
|
|
51
|
+
return nextRoute; // Update to new route reference
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return route; // Keep current route reference
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// Only create new array if changes occurred
|
|
58
|
+
const routesResult = didChange ? alignedRoutes : currentRoutes;
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
routes: routesResult,
|
|
62
|
+
descriptors: composeDescriptors(
|
|
63
|
+
routesResult,
|
|
64
|
+
nextDescriptors,
|
|
65
|
+
currentDescriptors,
|
|
66
|
+
),
|
|
67
|
+
};
|
|
68
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
a:
|
|
5
|
-
b:
|
|
1
|
+
export const areDescriptorsEqual = <
|
|
2
|
+
DescriptorMap extends Record<string, unknown>,
|
|
3
|
+
>(
|
|
4
|
+
a: DescriptorMap,
|
|
5
|
+
b: DescriptorMap,
|
|
6
6
|
): boolean => {
|
|
7
7
|
if (a === b) return true;
|
|
8
8
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
interface RouteWithKey {
|
|
2
|
+
key: string;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export const composeDescriptors = <
|
|
6
|
+
Route extends RouteWithKey,
|
|
7
|
+
DescriptorMap extends Record<string, unknown>,
|
|
8
|
+
>(
|
|
9
|
+
routes: Route[],
|
|
10
|
+
nextDescriptors: DescriptorMap,
|
|
11
|
+
currentDescriptors: DescriptorMap,
|
|
12
|
+
): DescriptorMap => {
|
|
13
|
+
const composed = {} as DescriptorMap;
|
|
14
|
+
|
|
15
|
+
for (const route of routes) {
|
|
16
|
+
(composed as Record<string, unknown>)[route.key] =
|
|
17
|
+
nextDescriptors[route.key] ?? currentDescriptors[route.key];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return composed;
|
|
21
|
+
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
interface RouteWithKey {
|
|
2
|
+
key: string;
|
|
3
|
+
}
|
|
2
4
|
|
|
3
|
-
export const haveSameRouteKeys = (
|
|
4
|
-
previous: Route
|
|
5
|
-
next: Route
|
|
5
|
+
export const haveSameRouteKeys = <Route extends RouteWithKey>(
|
|
6
|
+
previous: Route[],
|
|
7
|
+
next: Route[],
|
|
6
8
|
): boolean => {
|
|
7
9
|
if (previous.length !== next.length) {
|
|
8
10
|
return false;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
interface RouteWithKey {
|
|
2
|
+
key: string;
|
|
3
|
+
}
|
|
2
4
|
|
|
3
|
-
export const routesAreIdentical = (
|
|
4
|
-
a: Route
|
|
5
|
-
b: Route
|
|
5
|
+
export const routesAreIdentical = <Route extends RouteWithKey>(
|
|
6
|
+
a: Route[],
|
|
7
|
+
b: Route[],
|
|
6
8
|
): boolean => {
|
|
7
9
|
if (a === b) return true;
|
|
8
10
|
if (a.length !== b.length) return false;
|