react-native-screen-transitions 3.1.0 → 3.2.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/blank-stack/components/screens.js +2 -2
- package/lib/commonjs/blank-stack/components/screens.js.map +1 -1
- package/lib/commonjs/blank-stack/components/stack-view.js +42 -51
- package/lib/commonjs/blank-stack/components/stack-view.js.map +1 -1
- package/lib/commonjs/{shared/components → blank-stack}/controllers/blank-stack-lifecycle.js +17 -8
- package/lib/commonjs/blank-stack/controllers/blank-stack-lifecycle.js.map +1 -0
- package/lib/commonjs/component-stack/components/component-view.js +63 -0
- package/lib/commonjs/component-stack/components/component-view.js.map +1 -0
- package/lib/commonjs/component-stack/components/screens.js +64 -0
- package/lib/commonjs/component-stack/components/screens.js.map +1 -0
- package/lib/commonjs/component-stack/controllers/component-stack-lifecycle.js +82 -0
- package/lib/commonjs/component-stack/controllers/component-stack-lifecycle.js.map +1 -0
- package/lib/commonjs/component-stack/hooks/use-component-navigation-builder.js +321 -0
- package/lib/commonjs/component-stack/hooks/use-component-navigation-builder.js.map +1 -0
- package/lib/commonjs/component-stack/hooks/use-component-navigation.js +28 -0
- package/lib/commonjs/component-stack/hooks/use-component-navigation.js.map +1 -0
- package/lib/commonjs/component-stack/index.js +20 -0
- package/lib/commonjs/component-stack/index.js.map +1 -0
- package/lib/commonjs/component-stack/navigators/create-component-navigator.js +97 -0
- package/lib/commonjs/component-stack/navigators/create-component-navigator.js.map +1 -0
- package/lib/commonjs/component-stack/types.js.map +1 -0
- package/lib/commonjs/{shared/components → native-stack}/controllers/native-stack-lifecycle.js +18 -9
- package/lib/commonjs/native-stack/controllers/native-stack-lifecycle.js.map +1 -0
- package/lib/commonjs/native-stack/views/NativeStackView.native.js +120 -121
- package/lib/commonjs/native-stack/views/NativeStackView.native.js.map +1 -1
- package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js +64 -0
- package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js.map +1 -0
- package/lib/commonjs/shared/components/overlay/index.js +15 -0
- package/lib/commonjs/shared/components/overlay/index.js.map +1 -0
- package/lib/commonjs/shared/components/overlay/variations/container-overlay.js +99 -0
- package/lib/commonjs/shared/components/overlay/variations/container-overlay.js.map +1 -0
- package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +51 -0
- package/lib/commonjs/shared/components/overlay/variations/float-overlay.js.map +1 -0
- package/lib/commonjs/shared/components/overlay/variations/overlay-host.js +124 -0
- package/lib/commonjs/shared/components/overlay/variations/overlay-host.js.map +1 -0
- package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js +47 -0
- package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js.map +1 -0
- package/lib/commonjs/shared/components/root-transition-aware.js +2 -2
- package/lib/commonjs/shared/components/root-transition-aware.js.map +1 -1
- package/lib/commonjs/shared/constants.js +2 -31
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/hooks/animation/use-associated-style.js +2 -2
- package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +1 -1
- package/lib/commonjs/shared/hooks/animation/use-high-refresh-rate.js +30 -0
- package/lib/commonjs/shared/hooks/animation/use-high-refresh-rate.js.map +1 -0
- package/lib/commonjs/shared/hooks/animation/use-screen-animation.js +16 -9
- package/lib/commonjs/shared/hooks/animation/use-screen-animation.js.map +1 -1
- package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js +1 -1
- package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js.map +1 -1
- package/lib/commonjs/shared/hooks/gestures/use-scroll-registry.js.map +1 -1
- package/lib/commonjs/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-closing-route-keys.js +1 -1
- package/lib/commonjs/shared/hooks/navigation/use-closing-route-keys.js.map +1 -0
- package/lib/commonjs/shared/hooks/navigation/use-previous.js.map +1 -0
- package/lib/commonjs/shared/hooks/navigation/use-stack.js +37 -0
- package/lib/commonjs/shared/hooks/navigation/use-stack.js.map +1 -0
- package/lib/commonjs/shared/providers/gestures.provider.js +1 -1
- package/lib/commonjs/shared/providers/gestures.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/register-bounds.provider.js +11 -5
- package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/{keys.provider.js → screen/keys.provider.js} +12 -0
- package/lib/commonjs/shared/providers/screen/keys.provider.js.map +1 -0
- package/lib/commonjs/shared/providers/{screen-transition.provider.js → screen/screen-composer.js} +7 -7
- package/lib/commonjs/shared/providers/screen/screen-composer.js.map +1 -0
- package/lib/commonjs/shared/providers/{transition-styles.provider.js → screen/styles.provider.js} +12 -13
- package/lib/commonjs/shared/providers/screen/styles.provider.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/core.provider.js +61 -0
- package/lib/commonjs/shared/providers/stack/core.provider.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/direct.provider.js +158 -0
- package/lib/commonjs/shared/providers/stack/direct.provider.js.map +1 -0
- package/lib/commonjs/{blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.js → shared/providers/stack/helpers/active-screens-limit.js} +1 -1
- package/lib/commonjs/shared/providers/stack/helpers/active-screens-limit.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/helpers/use-local-routes.js +93 -0
- package/lib/commonjs/shared/providers/stack/helpers/use-local-routes.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/managed.provider.js +155 -0
- package/lib/commonjs/shared/providers/stack/managed.provider.js.map +1 -0
- package/lib/commonjs/shared/stores/bounds.store.js.map +1 -1
- package/lib/commonjs/shared/types/index.js +19 -0
- package/lib/commonjs/shared/types/index.js.map +1 -0
- package/lib/commonjs/shared/types/overlay.types.js +6 -0
- package/lib/commonjs/shared/types/overlay.types.js.map +1 -0
- package/lib/commonjs/shared/types/screen.types.js +6 -0
- package/lib/commonjs/shared/types/screen.types.js.map +1 -0
- package/lib/commonjs/shared/types/{core.types.js → stack.types.js} +1 -1
- package/lib/commonjs/shared/types/{core.types.js.map → stack.types.js.map} +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/styles.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
- package/lib/commonjs/shared/utils/create-provider.js +16 -13
- package/lib/commonjs/shared/utils/create-provider.js.map +1 -1
- package/lib/commonjs/shared/utils/gesture/check-gesture-activation.js.map +1 -1
- package/lib/commonjs/shared/utils/navigation/align-routes-with-latest.js +51 -0
- package/lib/commonjs/shared/utils/navigation/align-routes-with-latest.js.map +1 -0
- package/lib/commonjs/shared/utils/navigation/are-descriptors-equal.js.map +1 -0
- package/lib/commonjs/shared/utils/navigation/compose-descriptors.js.map +1 -0
- package/lib/commonjs/shared/utils/navigation/have-same-route-keys.js.map +1 -0
- package/lib/commonjs/shared/utils/navigation/routes-are-identical.js.map +1 -0
- package/lib/commonjs/shared/utils/navigation/sync-routes-with-removed.js +95 -0
- package/lib/commonjs/shared/utils/navigation/sync-routes-with-removed.js.map +1 -0
- package/lib/commonjs/shared/utils/read-shared-value.js +17 -0
- package/lib/commonjs/shared/utils/read-shared-value.js.map +1 -0
- package/lib/commonjs/shared/utils/reset-stores-for-screen.js +2 -1
- package/lib/commonjs/shared/utils/reset-stores-for-screen.js.map +1 -1
- package/lib/module/blank-stack/components/screens.js +2 -2
- package/lib/module/blank-stack/components/screens.js.map +1 -1
- package/lib/module/blank-stack/components/stack-view.js +41 -50
- package/lib/module/blank-stack/components/stack-view.js.map +1 -1
- package/lib/module/{shared/components → blank-stack}/controllers/blank-stack-lifecycle.js +18 -9
- package/lib/module/blank-stack/controllers/blank-stack-lifecycle.js.map +1 -0
- package/lib/module/component-stack/components/component-view.js +58 -0
- package/lib/module/component-stack/components/component-view.js.map +1 -0
- package/lib/module/component-stack/components/screens.js +58 -0
- package/lib/module/component-stack/components/screens.js.map +1 -0
- package/lib/module/component-stack/controllers/component-stack-lifecycle.js +76 -0
- package/lib/module/component-stack/controllers/component-stack-lifecycle.js.map +1 -0
- package/lib/module/component-stack/hooks/use-component-navigation-builder.js +316 -0
- package/lib/module/component-stack/hooks/use-component-navigation-builder.js.map +1 -0
- package/lib/module/component-stack/hooks/use-component-navigation.js +25 -0
- package/lib/module/component-stack/hooks/use-component-navigation.js.map +1 -0
- package/lib/module/component-stack/index.js +5 -0
- package/lib/module/component-stack/index.js.map +1 -0
- package/lib/module/component-stack/navigators/create-component-navigator.js +91 -0
- package/lib/module/component-stack/navigators/create-component-navigator.js.map +1 -0
- package/lib/module/component-stack/types.js.map +1 -0
- package/lib/module/{shared/components → native-stack}/controllers/native-stack-lifecycle.js +18 -9
- package/lib/module/native-stack/controllers/native-stack-lifecycle.js.map +1 -0
- package/lib/module/native-stack/views/NativeStackView.native.js +121 -122
- package/lib/module/native-stack/views/NativeStackView.native.js.map +1 -1
- package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/module/shared/components/overlay/helpers/get-active-overlay.js +59 -0
- package/lib/module/shared/components/overlay/helpers/get-active-overlay.js.map +1 -0
- package/lib/module/shared/components/overlay/index.js +11 -0
- package/lib/module/shared/components/overlay/index.js.map +1 -0
- package/lib/module/shared/components/overlay/variations/container-overlay.js +97 -0
- package/lib/module/shared/components/overlay/variations/container-overlay.js.map +1 -0
- package/lib/module/shared/components/overlay/variations/float-overlay.js +48 -0
- package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -0
- package/lib/module/shared/components/overlay/variations/overlay-host.js +120 -0
- package/lib/module/shared/components/overlay/variations/overlay-host.js.map +1 -0
- package/lib/module/shared/components/overlay/variations/screen-overlay.js +44 -0
- package/lib/module/shared/components/overlay/variations/screen-overlay.js.map +1 -0
- package/lib/module/shared/components/root-transition-aware.js +2 -2
- package/lib/module/shared/components/root-transition-aware.js.map +1 -1
- package/lib/module/shared/constants.js +0 -29
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/hooks/animation/use-associated-style.js +2 -2
- package/lib/module/shared/hooks/animation/use-associated-style.js.map +1 -1
- package/lib/module/shared/hooks/animation/use-high-refresh-rate.js +24 -0
- package/lib/module/shared/hooks/animation/use-high-refresh-rate.js.map +1 -0
- package/lib/module/shared/hooks/animation/use-screen-animation.js +16 -9
- package/lib/module/shared/hooks/animation/use-screen-animation.js.map +1 -1
- package/lib/module/shared/hooks/gestures/use-build-gestures.js +1 -1
- package/lib/module/shared/hooks/gestures/use-build-gestures.js.map +1 -1
- package/lib/module/shared/hooks/gestures/use-scroll-registry.js.map +1 -1
- package/lib/module/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-closing-route-keys.js +1 -1
- package/lib/module/shared/hooks/navigation/use-closing-route-keys.js.map +1 -0
- package/lib/module/shared/hooks/navigation/use-previous.js.map +1 -0
- package/lib/module/shared/hooks/navigation/use-stack.js +33 -0
- package/lib/module/shared/hooks/navigation/use-stack.js.map +1 -0
- package/lib/module/shared/providers/gestures.provider.js +1 -1
- package/lib/module/shared/providers/gestures.provider.js.map +1 -1
- package/lib/module/shared/providers/register-bounds.provider.js +11 -5
- package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
- package/lib/module/shared/providers/{keys.provider.js → screen/keys.provider.js} +12 -0
- package/lib/module/shared/providers/screen/keys.provider.js.map +1 -0
- package/lib/module/shared/providers/{screen-transition.provider.js → screen/screen-composer.js} +6 -6
- package/lib/module/shared/providers/screen/screen-composer.js.map +1 -0
- package/lib/module/shared/providers/{transition-styles.provider.js → screen/styles.provider.js} +10 -10
- package/lib/module/shared/providers/screen/styles.provider.js.map +1 -0
- package/lib/module/shared/providers/stack/core.provider.js +55 -0
- package/lib/module/shared/providers/stack/core.provider.js.map +1 -0
- package/lib/module/shared/providers/stack/direct.provider.js +153 -0
- package/lib/module/shared/providers/stack/direct.provider.js.map +1 -0
- package/lib/module/{blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.js → shared/providers/stack/helpers/active-screens-limit.js} +1 -1
- package/lib/module/shared/providers/stack/helpers/active-screens-limit.js.map +1 -0
- package/lib/module/shared/providers/stack/helpers/use-local-routes.js +87 -0
- package/lib/module/shared/providers/stack/helpers/use-local-routes.js.map +1 -0
- package/lib/module/shared/providers/stack/managed.provider.js +150 -0
- package/lib/module/shared/providers/stack/managed.provider.js.map +1 -0
- package/lib/module/shared/stores/bounds.store.js.map +1 -1
- package/lib/module/shared/types/index.js +4 -0
- package/lib/module/shared/types/index.js.map +1 -0
- package/lib/module/shared/types/overlay.types.js +4 -0
- package/lib/module/shared/types/overlay.types.js.map +1 -0
- package/lib/module/shared/types/screen.types.js +4 -0
- package/lib/module/shared/types/screen.types.js.map +1 -0
- package/lib/module/shared/types/stack.types.js +4 -0
- package/lib/{commonjs/shared/types/utils.types.js.map → module/shared/types/stack.types.js.map} +1 -1
- package/lib/module/shared/utils/bounds/helpers/styles.js.map +1 -1
- package/lib/module/shared/utils/bounds/index.js.map +1 -1
- package/lib/module/shared/utils/create-provider.js +16 -13
- package/lib/module/shared/utils/create-provider.js.map +1 -1
- package/lib/module/shared/utils/gesture/check-gesture-activation.js.map +1 -1
- package/lib/module/shared/utils/navigation/align-routes-with-latest.js +46 -0
- package/lib/module/shared/utils/navigation/align-routes-with-latest.js.map +1 -0
- package/lib/module/shared/utils/navigation/are-descriptors-equal.js.map +1 -0
- package/lib/module/shared/utils/navigation/compose-descriptors.js.map +1 -0
- package/lib/module/shared/utils/navigation/have-same-route-keys.js.map +1 -0
- package/lib/module/shared/utils/navigation/routes-are-identical.js.map +1 -0
- package/lib/module/shared/utils/navigation/sync-routes-with-removed.js +90 -0
- package/lib/module/shared/utils/navigation/sync-routes-with-removed.js.map +1 -0
- package/lib/module/shared/utils/read-shared-value.js +14 -0
- package/lib/module/shared/utils/read-shared-value.js.map +1 -0
- package/lib/module/shared/utils/reset-stores-for-screen.js +2 -2
- package/lib/module/shared/utils/reset-stores-for-screen.js.map +1 -1
- package/lib/typescript/blank-stack/components/stack-view.d.ts +2 -1
- package/lib/typescript/blank-stack/components/stack-view.d.ts.map +1 -1
- package/lib/typescript/{shared/components → blank-stack}/controllers/blank-stack-lifecycle.d.ts +2 -1
- package/lib/typescript/blank-stack/controllers/blank-stack-lifecycle.d.ts.map +1 -0
- package/lib/typescript/blank-stack/types.d.ts +9 -50
- package/lib/typescript/blank-stack/types.d.ts.map +1 -1
- package/lib/typescript/component-stack/components/component-view.d.ts +4 -0
- package/lib/typescript/component-stack/components/component-view.d.ts.map +1 -0
- package/lib/typescript/component-stack/components/screens.d.ts +9 -0
- package/lib/typescript/component-stack/components/screens.d.ts.map +1 -0
- package/lib/typescript/component-stack/controllers/component-stack-lifecycle.d.ts +10 -0
- package/lib/typescript/component-stack/controllers/component-stack-lifecycle.d.ts.map +1 -0
- package/lib/typescript/component-stack/hooks/use-component-navigation-builder.d.ts +19 -0
- package/lib/typescript/component-stack/hooks/use-component-navigation-builder.d.ts.map +1 -0
- package/lib/typescript/component-stack/hooks/use-component-navigation.d.ts +19 -0
- package/lib/typescript/component-stack/hooks/use-component-navigation.d.ts.map +1 -0
- package/lib/typescript/component-stack/index.d.ts +4 -0
- package/lib/typescript/component-stack/index.d.ts.map +1 -0
- package/lib/typescript/component-stack/navigators/create-component-navigator.d.ts +35 -0
- package/lib/typescript/component-stack/navigators/create-component-navigator.d.ts.map +1 -0
- package/lib/typescript/component-stack/types.d.ts +206 -0
- package/lib/typescript/component-stack/types.d.ts.map +1 -0
- package/lib/typescript/native-stack/controllers/native-stack-lifecycle.d.ts.map +1 -0
- package/lib/typescript/native-stack/index.d.ts +1 -1
- package/lib/typescript/native-stack/index.d.ts.map +1 -1
- package/lib/typescript/native-stack/types.d.ts +9 -6
- package/lib/typescript/native-stack/types.d.ts.map +1 -1
- package/lib/typescript/native-stack/views/NativeStackView.native.d.ts +2 -10
- package/lib/typescript/native-stack/views/NativeStackView.native.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts +20 -0
- package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts.map +1 -0
- package/lib/typescript/shared/components/overlay/index.d.ts +9 -0
- package/lib/typescript/shared/components/overlay/index.d.ts.map +1 -0
- package/lib/typescript/shared/components/overlay/variations/container-overlay.d.ts +8 -0
- package/lib/typescript/shared/components/overlay/variations/container-overlay.d.ts.map +1 -0
- package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts +6 -0
- package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts.map +1 -0
- package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts +12 -0
- package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -0
- package/lib/typescript/shared/components/overlay/variations/screen-overlay.d.ts +6 -0
- package/lib/typescript/shared/components/overlay/variations/screen-overlay.d.ts.map +1 -0
- package/lib/typescript/shared/configs/index.d.ts.map +1 -1
- package/lib/typescript/shared/configs/presets.d.ts +1 -1
- package/lib/typescript/shared/configs/presets.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts +1 -16
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/animation/use-high-refresh-rate.d.ts +6 -0
- package/lib/typescript/shared/hooks/animation/use-high-refresh-rate.d.ts.map +1 -0
- package/lib/typescript/shared/hooks/animation/use-screen-animation.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/gestures/use-build-gestures.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/gestures/use-scroll-registry.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/navigation/use-closing-route-keys.d.ts.map +1 -0
- package/lib/typescript/shared/hooks/navigation/use-previous.d.ts.map +1 -0
- package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +71 -0
- package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -0
- package/lib/typescript/shared/index.d.ts +31 -33
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures.provider.d.ts +4 -2
- package/lib/typescript/shared/providers/gestures.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/keys.provider.d.ts +29 -0
- package/lib/typescript/shared/providers/screen/keys.provider.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/screen-composer.d.ts +13 -0
- package/lib/typescript/shared/providers/screen/screen-composer.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles.provider.d.ts +13 -0
- package/lib/typescript/shared/providers/screen/styles.provider.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/core.provider.d.ts +11 -0
- package/lib/typescript/shared/providers/stack/core.provider.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/direct.provider.d.ts +34 -0
- package/lib/typescript/shared/providers/stack/direct.provider.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/helpers/active-screens-limit.d.ts +9 -0
- package/lib/typescript/shared/providers/stack/helpers/active-screens-limit.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/helpers/use-local-routes.d.ts +19 -0
- package/lib/typescript/shared/providers/stack/helpers/use-local-routes.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/managed.provider.d.ts +39 -0
- package/lib/typescript/shared/providers/stack/managed.provider.d.ts.map +1 -0
- package/lib/typescript/shared/stores/animation.store.d.ts +1 -1
- package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/gesture.store.d.ts +2 -2
- package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
- package/lib/typescript/shared/types/animation.types.d.ts +3 -3
- package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/gesture.types.d.ts +0 -1
- package/lib/typescript/shared/types/gesture.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/index.d.ts +8 -0
- package/lib/typescript/shared/types/index.d.ts.map +1 -0
- package/lib/typescript/shared/types/overlay.types.d.ts +50 -0
- package/lib/typescript/shared/types/overlay.types.d.ts.map +1 -0
- package/lib/typescript/shared/types/{core.types.d.ts → screen.types.d.ts} +31 -6
- package/lib/typescript/shared/types/screen.types.d.ts.map +1 -0
- package/lib/typescript/shared/types/stack.types.d.ts +52 -0
- package/lib/typescript/shared/types/stack.types.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts +2 -1
- package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/styles.d.ts +1 -2
- package/lib/typescript/shared/utils/bounds/helpers/styles.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/index.d.ts +1 -9
- package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/types/builder.d.ts +9 -8
- package/lib/typescript/shared/utils/bounds/types/builder.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/types/geometry.d.ts +2 -1
- package/lib/typescript/shared/utils/bounds/types/geometry.d.ts.map +1 -1
- package/lib/typescript/shared/utils/create-provider.d.ts.map +1 -1
- package/lib/typescript/shared/utils/gesture/check-gesture-activation.d.ts +1 -1
- package/lib/typescript/shared/utils/gesture/check-gesture-activation.d.ts.map +1 -1
- package/lib/typescript/shared/utils/navigation/align-routes-with-latest.d.ts +13 -0
- package/lib/typescript/shared/utils/navigation/align-routes-with-latest.d.ts.map +1 -0
- package/lib/typescript/shared/utils/navigation/are-descriptors-equal.d.ts +2 -0
- package/lib/typescript/shared/utils/navigation/are-descriptors-equal.d.ts.map +1 -0
- package/lib/typescript/shared/utils/navigation/compose-descriptors.d.ts +6 -0
- package/lib/typescript/shared/utils/navigation/compose-descriptors.d.ts.map +1 -0
- package/lib/typescript/shared/utils/navigation/have-same-route-keys.d.ts +6 -0
- package/lib/typescript/shared/utils/navigation/have-same-route-keys.d.ts.map +1 -0
- package/lib/typescript/shared/utils/navigation/routes-are-identical.d.ts +6 -0
- package/lib/typescript/shared/utils/navigation/routes-are-identical.d.ts.map +1 -0
- package/lib/typescript/shared/utils/navigation/sync-routes-with-removed.d.ts +21 -0
- package/lib/typescript/shared/utils/navigation/sync-routes-with-removed.d.ts.map +1 -0
- package/lib/typescript/shared/utils/read-shared-value.d.ts +7 -0
- package/lib/typescript/shared/utils/read-shared-value.d.ts.map +1 -0
- package/lib/typescript/shared/utils/reset-stores-for-screen.d.ts +4 -3
- package/lib/typescript/shared/utils/reset-stores-for-screen.d.ts.map +1 -1
- package/package.json +7 -2
- package/src/blank-stack/components/screens.tsx +2 -2
- package/src/blank-stack/components/stack-view.tsx +59 -67
- package/src/{shared/components → blank-stack}/controllers/blank-stack-lifecycle.tsx +18 -11
- package/src/blank-stack/types.ts +10 -62
- package/src/component-stack/components/component-view.tsx +72 -0
- package/src/component-stack/components/screens.tsx +86 -0
- package/src/component-stack/controllers/component-stack-lifecycle.tsx +80 -0
- package/src/component-stack/hooks/use-component-navigation-builder.tsx +388 -0
- package/src/component-stack/hooks/use-component-navigation.tsx +22 -0
- package/src/component-stack/index.ts +16 -0
- package/src/component-stack/navigators/create-component-navigator.tsx +104 -0
- package/src/component-stack/types.ts +209 -0
- package/src/{shared/components → native-stack}/controllers/native-stack-lifecycle.tsx +18 -11
- package/src/native-stack/index.ts +1 -0
- package/src/native-stack/types.ts +11 -7
- package/src/native-stack/views/NativeStackView.native.tsx +42 -69
- package/src/shared/__tests__/sync-routes-with-removed.test.ts +283 -0
- package/src/shared/components/create-transition-aware-component.tsx +5 -6
- package/src/shared/components/overlay/helpers/get-active-overlay.ts +64 -0
- package/src/shared/components/overlay/index.ts +9 -0
- package/src/shared/components/overlay/variations/container-overlay.tsx +98 -0
- package/src/shared/components/overlay/variations/float-overlay.tsx +44 -0
- package/src/shared/components/overlay/variations/overlay-host.tsx +148 -0
- package/src/shared/components/overlay/variations/screen-overlay.tsx +51 -0
- package/src/shared/components/root-transition-aware.tsx +2 -2
- package/src/shared/configs/presets.ts +1 -1
- package/src/shared/constants.ts +1 -33
- package/src/shared/hooks/animation/use-associated-style.tsx +2 -2
- package/src/shared/hooks/animation/use-high-refresh-rate.tsx +28 -0
- package/src/shared/hooks/animation/use-screen-animation.tsx +19 -15
- package/src/shared/hooks/gestures/use-build-gestures.tsx +1 -2
- package/src/shared/hooks/gestures/use-scroll-registry.tsx +3 -4
- package/src/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-closing-route-keys.tsx +1 -1
- package/src/shared/hooks/navigation/use-stack.tsx +100 -0
- package/src/shared/index.ts +7 -3
- package/src/shared/providers/gestures.provider.tsx +6 -2
- package/src/shared/providers/register-bounds.provider.tsx +13 -6
- package/src/shared/providers/screen/keys.provider.tsx +72 -0
- package/src/shared/providers/screen/screen-composer.tsx +38 -0
- package/src/shared/providers/{transition-styles.provider.tsx → screen/styles.provider.tsx} +14 -13
- package/src/shared/providers/stack/core.provider.tsx +64 -0
- package/src/shared/providers/stack/direct.provider.tsx +228 -0
- package/src/{blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.ts → shared/providers/stack/helpers/active-screens-limit.ts} +10 -4
- package/src/shared/providers/stack/helpers/use-local-routes.tsx +133 -0
- package/src/shared/providers/stack/managed.provider.tsx +226 -0
- package/src/shared/stores/animation.store.ts +1 -1
- package/src/shared/stores/bounds.store.ts +4 -5
- package/src/shared/stores/gesture.store.ts +2 -2
- package/src/shared/types/animation.types.ts +3 -3
- package/src/shared/types/gesture.types.ts +0 -2
- package/src/shared/types/index.ts +47 -0
- package/src/shared/types/overlay.types.ts +62 -0
- package/src/shared/types/{core.types.ts → screen.types.ts} +40 -7
- package/src/shared/types/stack.types.ts +59 -0
- package/src/shared/utils/bounds/helpers/geometry.ts +1 -1
- package/src/shared/utils/bounds/helpers/style-composers.ts +1 -1
- package/src/shared/utils/bounds/helpers/styles.ts +1 -2
- package/src/shared/utils/bounds/index.ts +1 -9
- package/src/shared/utils/bounds/types/builder.ts +8 -8
- package/src/shared/utils/bounds/types/geometry.ts +1 -1
- package/src/shared/utils/create-provider.tsx +14 -16
- package/src/shared/utils/gesture/check-gesture-activation.ts +1 -1
- package/src/shared/utils/navigation/align-routes-with-latest.ts +68 -0
- package/src/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/are-descriptors-equal.ts +5 -5
- package/src/shared/utils/navigation/compose-descriptors.ts +21 -0
- package/src/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/have-same-route-keys.ts +6 -4
- package/src/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/routes-are-identical.ts +6 -4
- package/src/shared/utils/navigation/sync-routes-with-removed.ts +132 -0
- package/src/shared/utils/read-shared-value.ts +15 -0
- package/src/shared/utils/reset-stores-for-screen.ts +4 -3
- package/lib/commonjs/blank-stack/components/overlay.js +0 -156
- package/lib/commonjs/blank-stack/components/overlay.js.map +0 -1
- package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js +0 -72
- package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-closing-route-keys.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-previous.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js +0 -196
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/index.js +0 -61
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/index.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/types.js.map +0 -1
- package/lib/commonjs/native-stack/views/FooterComponent.js +0 -17
- package/lib/commonjs/native-stack/views/FooterComponent.js.map +0 -1
- package/lib/commonjs/shared/components/controllers/blank-stack-lifecycle.js.map +0 -1
- package/lib/commonjs/shared/components/controllers/native-stack-lifecycle.js.map +0 -1
- package/lib/commonjs/shared/providers/flags.provider.js +0 -25
- package/lib/commonjs/shared/providers/flags.provider.js.map +0 -1
- package/lib/commonjs/shared/providers/keys.provider.js.map +0 -1
- package/lib/commonjs/shared/providers/routes.provider.js +0 -48
- package/lib/commonjs/shared/providers/routes.provider.js.map +0 -1
- package/lib/commonjs/shared/providers/screen-transition.provider.js.map +0 -1
- package/lib/commonjs/shared/providers/transition-styles.provider.js.map +0 -1
- package/lib/commonjs/shared/types/utils.types.js +0 -2
- package/lib/commonjs/shared/utils/animation/compute-stack-progress.js +0 -20
- package/lib/commonjs/shared/utils/animation/compute-stack-progress.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/constants.js +0 -42
- package/lib/commonjs/shared/utils/bounds/constants.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/is-bounds-equal.js +0 -19
- package/lib/commonjs/shared/utils/bounds/helpers/is-bounds-equal.js.map +0 -1
- package/lib/commonjs/shared/utils/gesture/apply-offset-rules.js +0 -224
- package/lib/commonjs/shared/utils/gesture/apply-offset-rules.js.map +0 -1
- package/lib/commonjs/shared/utils/reanimated/version.js +0 -12
- package/lib/commonjs/shared/utils/reanimated/version.js.map +0 -1
- package/lib/module/blank-stack/components/overlay.js +0 -152
- package/lib/module/blank-stack/components/overlay.js.map +0 -1
- package/lib/module/blank-stack/hooks/use-overlay-animation.js +0 -68
- package/lib/module/blank-stack/hooks/use-overlay-animation.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-closing-route-keys.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-previous.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js +0 -190
- package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/index.js +0 -55
- package/lib/module/blank-stack/utils/with-stack-navigation/index.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/types.js.map +0 -1
- package/lib/module/native-stack/views/FooterComponent.js +0 -13
- package/lib/module/native-stack/views/FooterComponent.js.map +0 -1
- package/lib/module/shared/components/controllers/blank-stack-lifecycle.js.map +0 -1
- package/lib/module/shared/components/controllers/native-stack-lifecycle.js.map +0 -1
- package/lib/module/shared/providers/flags.provider.js +0 -19
- package/lib/module/shared/providers/flags.provider.js.map +0 -1
- package/lib/module/shared/providers/keys.provider.js.map +0 -1
- package/lib/module/shared/providers/routes.provider.js +0 -42
- package/lib/module/shared/providers/routes.provider.js.map +0 -1
- package/lib/module/shared/providers/screen-transition.provider.js.map +0 -1
- package/lib/module/shared/providers/transition-styles.provider.js.map +0 -1
- package/lib/module/shared/types/core.types.js +0 -4
- package/lib/module/shared/types/core.types.js.map +0 -1
- package/lib/module/shared/types/utils.types.js +0 -2
- package/lib/module/shared/types/utils.types.js.map +0 -1
- package/lib/module/shared/utils/animation/compute-stack-progress.js +0 -15
- package/lib/module/shared/utils/animation/compute-stack-progress.js.map +0 -1
- package/lib/module/shared/utils/bounds/constants.js +0 -37
- package/lib/module/shared/utils/bounds/constants.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/is-bounds-equal.js +0 -14
- package/lib/module/shared/utils/bounds/helpers/is-bounds-equal.js.map +0 -1
- package/lib/module/shared/utils/gesture/apply-offset-rules.js +0 -219
- package/lib/module/shared/utils/gesture/apply-offset-rules.js.map +0 -1
- package/lib/module/shared/utils/reanimated/version.js +0 -7
- package/lib/module/shared/utils/reanimated/version.js.map +0 -1
- package/lib/typescript/blank-stack/components/overlay.d.ts +0 -5
- package/lib/typescript/blank-stack/components/overlay.d.ts.map +0 -1
- package/lib/typescript/blank-stack/hooks/use-overlay-animation.d.ts +0 -12
- package/lib/typescript/blank-stack/hooks/use-overlay-animation.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.d.ts +0 -3
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.d.ts +0 -4
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.d.ts +0 -4
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.d.ts +0 -3
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.d.ts +0 -3
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/hooks/use-closing-route-keys.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/hooks/use-previous.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.d.ts +0 -20
- package/lib/typescript/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/index.d.ts +0 -4
- package/lib/typescript/blank-stack/utils/with-stack-navigation/index.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/types.d.ts +0 -22
- package/lib/typescript/blank-stack/utils/with-stack-navigation/types.d.ts.map +0 -1
- package/lib/typescript/native-stack/views/FooterComponent.d.ts +0 -7
- package/lib/typescript/native-stack/views/FooterComponent.d.ts.map +0 -1
- package/lib/typescript/shared/components/controllers/blank-stack-lifecycle.d.ts.map +0 -1
- package/lib/typescript/shared/components/controllers/native-stack-lifecycle.d.ts.map +0 -1
- package/lib/typescript/shared/providers/flags.provider.d.ts +0 -10
- package/lib/typescript/shared/providers/flags.provider.d.ts.map +0 -1
- package/lib/typescript/shared/providers/keys.provider.d.ts +0 -18
- package/lib/typescript/shared/providers/keys.provider.d.ts.map +0 -1
- package/lib/typescript/shared/providers/routes.provider.d.ts +0 -19
- package/lib/typescript/shared/providers/routes.provider.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen-transition.provider.d.ts +0 -14
- package/lib/typescript/shared/providers/screen-transition.provider.d.ts.map +0 -1
- package/lib/typescript/shared/providers/transition-styles.provider.d.ts +0 -14
- package/lib/typescript/shared/providers/transition-styles.provider.d.ts.map +0 -1
- package/lib/typescript/shared/types/core.types.d.ts.map +0 -1
- package/lib/typescript/shared/types/utils.types.d.ts +0 -5
- package/lib/typescript/shared/types/utils.types.d.ts.map +0 -1
- package/lib/typescript/shared/utils/animation/compute-stack-progress.d.ts +0 -3
- package/lib/typescript/shared/utils/animation/compute-stack-progress.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/constants.d.ts +0 -7
- package/lib/typescript/shared/utils/bounds/constants.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/is-bounds-equal.d.ts +0 -7
- package/lib/typescript/shared/utils/bounds/helpers/is-bounds-equal.d.ts.map +0 -1
- package/lib/typescript/shared/utils/gesture/apply-offset-rules.d.ts +0 -38
- package/lib/typescript/shared/utils/gesture/apply-offset-rules.d.ts.map +0 -1
- package/lib/typescript/shared/utils/reanimated/version.d.ts +0 -2
- package/lib/typescript/shared/utils/reanimated/version.d.ts.map +0 -1
- package/src/blank-stack/components/overlay.tsx +0 -169
- package/src/blank-stack/hooks/use-overlay-animation.tsx +0 -86
- package/src/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.ts +0 -17
- package/src/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.tsx +0 -267
- package/src/blank-stack/utils/with-stack-navigation/index.tsx +0 -74
- package/src/blank-stack/utils/with-stack-navigation/types.ts +0 -35
- package/src/native-stack/views/FooterComponent.tsx +0 -10
- package/src/shared/providers/flags.provider.tsx +0 -21
- package/src/shared/providers/keys.provider.tsx +0 -57
- package/src/shared/providers/routes.provider.tsx +0 -54
- package/src/shared/providers/screen-transition.provider.tsx +0 -41
- package/src/shared/types/utils.types.ts +0 -4
- package/src/shared/utils/animation/compute-stack-progress.ts +0 -16
- package/src/shared/utils/bounds/constants.ts +0 -40
- package/src/shared/utils/bounds/helpers/is-bounds-equal.ts +0 -24
- package/src/shared/utils/gesture/apply-offset-rules.ts +0 -312
- package/src/shared/utils/reanimated/version.ts +0 -5
- /package/lib/commonjs/{blank-stack/utils/with-stack-navigation → component-stack}/types.js +0 -0
- /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-previous.js +0 -0
- /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/are-descriptors-equal.js +0 -0
- /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/compose-descriptors.js +0 -0
- /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/have-same-route-keys.js +0 -0
- /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/routes-are-identical.js +0 -0
- /package/lib/module/{blank-stack/utils/with-stack-navigation → component-stack}/types.js +0 -0
- /package/lib/module/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-previous.js +0 -0
- /package/lib/module/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/are-descriptors-equal.js +0 -0
- /package/lib/module/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/compose-descriptors.js +0 -0
- /package/lib/module/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/have-same-route-keys.js +0 -0
- /package/lib/module/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/routes-are-identical.js +0 -0
- /package/lib/typescript/{shared/components → native-stack}/controllers/native-stack-lifecycle.d.ts +0 -0
- /package/lib/typescript/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-closing-route-keys.d.ts +0 -0
- /package/lib/typescript/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-previous.d.ts +0 -0
- /package/src/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-previous.tsx +0 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import type { Route } from "@react-navigation/native";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import {
|
|
5
|
+
type DerivedValue,
|
|
6
|
+
type SharedValue,
|
|
7
|
+
useDerivedValue,
|
|
8
|
+
} from "react-native-reanimated";
|
|
9
|
+
import {
|
|
10
|
+
StackContext,
|
|
11
|
+
type StackContextValue,
|
|
12
|
+
} from "../../hooks/navigation/use-stack";
|
|
13
|
+
import { AnimationStore } from "../../stores/animation.store";
|
|
14
|
+
import type {
|
|
15
|
+
BaseStackDescriptor,
|
|
16
|
+
BaseStackNavigation,
|
|
17
|
+
BaseStackRoute,
|
|
18
|
+
BaseStackScene,
|
|
19
|
+
BaseStackState,
|
|
20
|
+
} from "../../types/stack.types";
|
|
21
|
+
import { calculateActiveScreensLimit } from "./helpers/active-screens-limit";
|
|
22
|
+
import { useLocalRoutes } from "./helpers/use-local-routes";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Props for managed stack - generic over descriptor and navigation types.
|
|
26
|
+
* Defaults to base types for backward compatibility.
|
|
27
|
+
*/
|
|
28
|
+
export interface ManagedStackProps<
|
|
29
|
+
TDescriptor extends BaseStackDescriptor = BaseStackDescriptor,
|
|
30
|
+
TNavigation extends BaseStackNavigation = BaseStackNavigation,
|
|
31
|
+
> {
|
|
32
|
+
state: BaseStackState<TDescriptor["route"]>;
|
|
33
|
+
navigation: TNavigation;
|
|
34
|
+
descriptors: Record<string, TDescriptor>;
|
|
35
|
+
describe: (route: TDescriptor["route"], placeholder: boolean) => TDescriptor;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Context value for managed stack - generic over descriptor type.
|
|
40
|
+
*/
|
|
41
|
+
interface ManagedStackContextValue<
|
|
42
|
+
TDescriptor extends BaseStackDescriptor = BaseStackDescriptor,
|
|
43
|
+
> {
|
|
44
|
+
routes: TDescriptor["route"][];
|
|
45
|
+
descriptors: Record<string, TDescriptor>;
|
|
46
|
+
scenes: BaseStackScene<TDescriptor>[];
|
|
47
|
+
activeScreensLimit: number;
|
|
48
|
+
closingRouteKeysShared: SharedValue<string[]>;
|
|
49
|
+
handleCloseRoute: (payload: { route: BaseStackRoute }) => void;
|
|
50
|
+
shouldShowFloatOverlay: boolean;
|
|
51
|
+
focusedIndex: number;
|
|
52
|
+
stackProgress: DerivedValue<number>;
|
|
53
|
+
optimisticFocusedIndex: DerivedValue<number>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const ManagedStackContext =
|
|
57
|
+
React.createContext<ManagedStackContextValue | null>(null);
|
|
58
|
+
ManagedStackContext.displayName = "ManagedStack";
|
|
59
|
+
|
|
60
|
+
function useManagedStackContext<
|
|
61
|
+
TDescriptor extends BaseStackDescriptor = BaseStackDescriptor,
|
|
62
|
+
>(): ManagedStackContextValue<TDescriptor> {
|
|
63
|
+
const context = React.useContext(ManagedStackContext);
|
|
64
|
+
if (!context) {
|
|
65
|
+
throw new Error(
|
|
66
|
+
"useManagedStackContext must be used within ManagedStackProvider",
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
return context as ManagedStackContextValue<TDescriptor>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function useManagedStackValue<
|
|
73
|
+
TDescriptor extends BaseStackDescriptor,
|
|
74
|
+
TNavigation extends BaseStackNavigation,
|
|
75
|
+
>(
|
|
76
|
+
props: ManagedStackProps<TDescriptor, TNavigation>,
|
|
77
|
+
): ManagedStackContextValue<TDescriptor> & {
|
|
78
|
+
stackContextValue: StackContextValue;
|
|
79
|
+
} {
|
|
80
|
+
const { state, handleCloseRoute, closingRouteKeys } = useLocalRoutes(props);
|
|
81
|
+
|
|
82
|
+
const { scenes, activeScreensLimit, shouldShowFloatOverlay, routeKeys } =
|
|
83
|
+
useMemo(() => {
|
|
84
|
+
const scenes: BaseStackScene<TDescriptor>[] = [];
|
|
85
|
+
const routeKeys: string[] = [];
|
|
86
|
+
let shouldShowFloatOverlay = false;
|
|
87
|
+
|
|
88
|
+
for (const route of state.routes) {
|
|
89
|
+
const descriptor = state.descriptors[route.key] as TDescriptor;
|
|
90
|
+
scenes.push({ route, descriptor });
|
|
91
|
+
routeKeys.push(route.key);
|
|
92
|
+
|
|
93
|
+
if (!shouldShowFloatOverlay) {
|
|
94
|
+
const options = descriptor?.options;
|
|
95
|
+
shouldShowFloatOverlay =
|
|
96
|
+
options?.overlayMode === "float" && options?.overlayShown === true;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
scenes,
|
|
102
|
+
routeKeys,
|
|
103
|
+
activeScreensLimit: calculateActiveScreensLimit(
|
|
104
|
+
state.routes,
|
|
105
|
+
state.descriptors,
|
|
106
|
+
),
|
|
107
|
+
shouldShowFloatOverlay,
|
|
108
|
+
};
|
|
109
|
+
}, [state.routes, state.descriptors]);
|
|
110
|
+
|
|
111
|
+
// Get animation store maps for LOCAL routes (including closing routes)
|
|
112
|
+
const animationMaps = useMemo(
|
|
113
|
+
() => state.routes.map((route) => AnimationStore.getAll(route.key)),
|
|
114
|
+
[state.routes],
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
// Aggregated stack progress from LOCAL routes (includes closing routes)
|
|
118
|
+
const stackProgress = useDerivedValue(() => {
|
|
119
|
+
"worklet";
|
|
120
|
+
let total = 0;
|
|
121
|
+
for (let i = 0; i < animationMaps.length; i++) {
|
|
122
|
+
total += animationMaps[i].progress.value;
|
|
123
|
+
}
|
|
124
|
+
return total;
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
// Optimistic focused index: accounts for closing screens
|
|
128
|
+
const optimisticFocusedIndex = useDerivedValue(() => {
|
|
129
|
+
"worklet";
|
|
130
|
+
const currentIndex = animationMaps.length - 1;
|
|
131
|
+
let isAnyClosing = false;
|
|
132
|
+
for (let i = 0; i < animationMaps.length; i++) {
|
|
133
|
+
if (animationMaps[i].closing.value > 0) {
|
|
134
|
+
isAnyClosing = true;
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return currentIndex - Number(isAnyClosing);
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
const focusedIndex = props.state.index;
|
|
142
|
+
|
|
143
|
+
// StackContext value - for overlays via useStack()
|
|
144
|
+
const stackContextValue = useMemo<StackContextValue>(
|
|
145
|
+
() => ({
|
|
146
|
+
flags: { TRANSITIONS_ALWAYS_ON: true },
|
|
147
|
+
routeKeys,
|
|
148
|
+
routes: state.routes as Route<string>[],
|
|
149
|
+
descriptors: state.descriptors as Record<string, BaseStackDescriptor>,
|
|
150
|
+
scenes: scenes as BaseStackScene[],
|
|
151
|
+
focusedIndex,
|
|
152
|
+
stackProgress,
|
|
153
|
+
optimisticFocusedIndex,
|
|
154
|
+
}),
|
|
155
|
+
[
|
|
156
|
+
routeKeys,
|
|
157
|
+
state.routes,
|
|
158
|
+
state.descriptors,
|
|
159
|
+
scenes,
|
|
160
|
+
focusedIndex,
|
|
161
|
+
stackProgress,
|
|
162
|
+
optimisticFocusedIndex,
|
|
163
|
+
],
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
// ManagedStack context value
|
|
167
|
+
const lifecycleValue = useMemo<ManagedStackContextValue<TDescriptor>>(
|
|
168
|
+
() => ({
|
|
169
|
+
routes: state.routes,
|
|
170
|
+
focusedIndex,
|
|
171
|
+
descriptors: state.descriptors,
|
|
172
|
+
closingRouteKeysShared: closingRouteKeys.shared,
|
|
173
|
+
activeScreensLimit,
|
|
174
|
+
handleCloseRoute,
|
|
175
|
+
scenes,
|
|
176
|
+
shouldShowFloatOverlay,
|
|
177
|
+
stackProgress,
|
|
178
|
+
optimisticFocusedIndex,
|
|
179
|
+
}),
|
|
180
|
+
[
|
|
181
|
+
state.routes,
|
|
182
|
+
state.descriptors,
|
|
183
|
+
focusedIndex,
|
|
184
|
+
closingRouteKeys.shared,
|
|
185
|
+
activeScreensLimit,
|
|
186
|
+
handleCloseRoute,
|
|
187
|
+
scenes,
|
|
188
|
+
shouldShowFloatOverlay,
|
|
189
|
+
stackProgress,
|
|
190
|
+
optimisticFocusedIndex,
|
|
191
|
+
],
|
|
192
|
+
);
|
|
193
|
+
|
|
194
|
+
return { ...lifecycleValue, stackContextValue };
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* HOC that wraps component with ManagedStack provider AND StackContext.
|
|
199
|
+
* Used by blank-stack and component-stack which manage local route state for closing animations.
|
|
200
|
+
* Generic over descriptor type - defaults to BaseStackDescriptor.
|
|
201
|
+
*/
|
|
202
|
+
function withManagedStack<
|
|
203
|
+
TDescriptor extends BaseStackDescriptor = BaseStackDescriptor,
|
|
204
|
+
TNavigation extends BaseStackNavigation = BaseStackNavigation,
|
|
205
|
+
>(
|
|
206
|
+
Component: React.ComponentType<ManagedStackContextValue<TDescriptor>>,
|
|
207
|
+
): React.FC<ManagedStackProps<TDescriptor, TNavigation>> {
|
|
208
|
+
return function ManagedStackProvider(
|
|
209
|
+
props: ManagedStackProps<TDescriptor, TNavigation>,
|
|
210
|
+
) {
|
|
211
|
+
const { stackContextValue, ...lifecycleValue } = useManagedStackValue<
|
|
212
|
+
TDescriptor,
|
|
213
|
+
TNavigation
|
|
214
|
+
>(props);
|
|
215
|
+
|
|
216
|
+
return (
|
|
217
|
+
<StackContext.Provider value={stackContextValue}>
|
|
218
|
+
<ManagedStackContext.Provider value={lifecycleValue}>
|
|
219
|
+
<Component {...lifecycleValue} />
|
|
220
|
+
</ManagedStackContext.Provider>
|
|
221
|
+
</StackContext.Provider>
|
|
222
|
+
);
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export { useManagedStackContext, withManagedStack };
|
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
makeMutable,
|
|
4
4
|
type StyleProps,
|
|
5
5
|
} from "react-native-reanimated";
|
|
6
|
-
import type { Any } from "../types/utils.types";
|
|
7
6
|
|
|
8
7
|
type TagID = string;
|
|
9
8
|
type ScreenKey = string;
|
|
@@ -38,7 +37,7 @@ function registerSnapshot(
|
|
|
38
37
|
ancestorKeys?: ScreenKey[],
|
|
39
38
|
) {
|
|
40
39
|
"worklet";
|
|
41
|
-
registry.modify((state:
|
|
40
|
+
registry.modify((state: any) => {
|
|
42
41
|
"worklet";
|
|
43
42
|
if (!state[tag]) {
|
|
44
43
|
state[tag] = { snapshots: {}, linkStack: [] };
|
|
@@ -56,7 +55,7 @@ function setLinkSource(
|
|
|
56
55
|
ancestorKeys?: ScreenKey[],
|
|
57
56
|
) {
|
|
58
57
|
"worklet";
|
|
59
|
-
registry.modify((state:
|
|
58
|
+
registry.modify((state: any) => {
|
|
60
59
|
"worklet";
|
|
61
60
|
if (!state[tag]) state[tag] = { snapshots: {}, linkStack: [] };
|
|
62
61
|
|
|
@@ -76,7 +75,7 @@ function setLinkDestination(
|
|
|
76
75
|
ancestorKeys?: ScreenKey[],
|
|
77
76
|
) {
|
|
78
77
|
"worklet";
|
|
79
|
-
registry.modify((state:
|
|
78
|
+
registry.modify((state: any) => {
|
|
80
79
|
"worklet";
|
|
81
80
|
const stack = state[tag]?.linkStack;
|
|
82
81
|
if (!stack || stack.length === 0) return state;
|
|
@@ -173,7 +172,7 @@ function getActiveLink(tag: TagID, screenKey?: ScreenKey): TagLink | null {
|
|
|
173
172
|
*/
|
|
174
173
|
function clear(screenKey: ScreenKey) {
|
|
175
174
|
"worklet";
|
|
176
|
-
registry.modify((state:
|
|
175
|
+
registry.modify((state: any) => {
|
|
177
176
|
"worklet";
|
|
178
177
|
for (const tag in state) {
|
|
179
178
|
// Remove snapshot
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
makeMutable,
|
|
4
4
|
type SharedValue,
|
|
5
5
|
} from "react-native-reanimated";
|
|
6
|
-
import type { ScreenKey } from "../types/core.types";
|
|
7
6
|
import type { GestureDirection } from "../types/gesture.types";
|
|
7
|
+
import type { ScreenKey } from "../types/screen.types";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
type GestureKey =
|
|
10
10
|
| "x"
|
|
11
11
|
| "y"
|
|
12
12
|
| "normalizedX"
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { ParamListBase, RouteProp } from "@react-navigation/native";
|
|
2
1
|
import type {
|
|
3
2
|
StyleProps,
|
|
4
3
|
WithSpringConfig,
|
|
5
4
|
WithTimingConfig,
|
|
6
5
|
} from "react-native-reanimated";
|
|
7
6
|
import type { EdgeInsets } from "react-native-safe-area-context";
|
|
7
|
+
import type { BaseRoute } from "../providers/screen/keys.provider";
|
|
8
8
|
import type { BoundsAccessor } from "./bounds.types";
|
|
9
|
-
import type { Layout } from "./core.types";
|
|
10
9
|
import type { GestureValues } from "./gesture.types";
|
|
10
|
+
import type { Layout } from "./screen.types";
|
|
11
11
|
|
|
12
12
|
export interface OverlayInterpolationProps {
|
|
13
13
|
progress: number;
|
|
@@ -74,7 +74,7 @@ export type ScreenTransitionState = {
|
|
|
74
74
|
* Pass route params via options: `options={({ route }) => ({ meta: { id: route.params.id } })}`
|
|
75
75
|
* This field may be removed in a future version.
|
|
76
76
|
*/
|
|
77
|
-
route:
|
|
77
|
+
route: BaseRoute;
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
export interface ScreenInterpolationProps {
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
ContainerOverlayProps,
|
|
28
|
+
OverlayMode,
|
|
29
|
+
OverlayProps,
|
|
30
|
+
} from "./overlay.types";
|
|
31
|
+
|
|
32
|
+
export type {
|
|
33
|
+
Layout,
|
|
34
|
+
ScreenKey,
|
|
35
|
+
ScreenTransitionConfig,
|
|
36
|
+
TransitionAwareProps,
|
|
37
|
+
} from "./screen.types";
|
|
38
|
+
|
|
39
|
+
export type {
|
|
40
|
+
BaseStackDescriptor,
|
|
41
|
+
BaseStackNavigation,
|
|
42
|
+
BaseStackRoute,
|
|
43
|
+
BaseStackScene,
|
|
44
|
+
BaseStackState,
|
|
45
|
+
} from "./stack.types";
|
|
46
|
+
|
|
47
|
+
export { FALSE, TRUE } from "./state.types";
|
|
@@ -0,0 +1,62 @@
|
|
|
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" | "container";
|
|
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
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Props passed to container overlay components.
|
|
53
|
+
* Extends OverlayProps with children - the screen content to wrap.
|
|
54
|
+
*/
|
|
55
|
+
export type ContainerOverlayProps<TNavigation = unknown> =
|
|
56
|
+
OverlayProps<TNavigation> & {
|
|
57
|
+
/**
|
|
58
|
+
* The screen content to be wrapped by the container overlay.
|
|
59
|
+
* This allows the overlay to act as a wrapper (e.g., MaskedView) around screens.
|
|
60
|
+
*/
|
|
61
|
+
children: React.ReactNode;
|
|
62
|
+
};
|
|
@@ -4,6 +4,11 @@ import type {
|
|
|
4
4
|
TransitionSpec,
|
|
5
5
|
} from "./animation.types";
|
|
6
6
|
import type { GestureActivationArea, GestureDirection } from "./gesture.types";
|
|
7
|
+
import type {
|
|
8
|
+
ContainerOverlayProps,
|
|
9
|
+
OverlayMode,
|
|
10
|
+
OverlayProps,
|
|
11
|
+
} from "./overlay.types";
|
|
7
12
|
|
|
8
13
|
export type Layout = {
|
|
9
14
|
width: number;
|
|
@@ -12,8 +17,6 @@ export type Layout = {
|
|
|
12
17
|
|
|
13
18
|
export type ScreenKey = string;
|
|
14
19
|
|
|
15
|
-
export type ScreenPhase = "previous" | "current" | "next";
|
|
16
|
-
|
|
17
20
|
export type TransitionAwareProps<T extends object> = AnimatedProps<T> & {
|
|
18
21
|
/**
|
|
19
22
|
* Connects this component to custom animated styles defined in screenStyleInterpolator.
|
|
@@ -55,11 +58,6 @@ export type TransitionAwareProps<T extends object> = AnimatedProps<T> & {
|
|
|
55
58
|
sharedBoundTag?: string;
|
|
56
59
|
};
|
|
57
60
|
|
|
58
|
-
export type TransitionConfig = {
|
|
59
|
-
open: TransitionSpec;
|
|
60
|
-
close: TransitionSpec;
|
|
61
|
-
};
|
|
62
|
-
|
|
63
61
|
export type ScreenTransitionConfig = {
|
|
64
62
|
/**
|
|
65
63
|
* The user-provided function to calculate styles based on animation progress.
|
|
@@ -108,4 +106,39 @@ export type ScreenTransitionConfig = {
|
|
|
108
106
|
* options={{ meta: { scalesOthers: true } }}
|
|
109
107
|
*/
|
|
110
108
|
meta?: Record<string, unknown>;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Function that returns a React Element to display as an overlay.
|
|
112
|
+
* For container overlays (overlayMode: 'container'), use ContainerOverlayProps which includes children.
|
|
113
|
+
*/
|
|
114
|
+
overlay?:
|
|
115
|
+
| ((props: OverlayProps) => React.ReactNode)
|
|
116
|
+
| ((props: ContainerOverlayProps) => React.ReactNode);
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* How the overlay is positioned relative to screens.
|
|
120
|
+
* - 'float': Single persistent overlay above all screens (like iOS tab bar)
|
|
121
|
+
* - 'screen': Per-screen overlay that transitions with content
|
|
122
|
+
* - 'container': Wraps all screen content, receives children prop (for MaskedView, custom containers)
|
|
123
|
+
* @default 'screen'
|
|
124
|
+
*/
|
|
125
|
+
overlayMode?: OverlayMode;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Whether to show the overlay. The overlay is shown by default when `overlay` is provided.
|
|
129
|
+
* Setting this to `false` hides the overlay.
|
|
130
|
+
*/
|
|
131
|
+
overlayShown?: boolean;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Forces the display to run at its maximum refresh rate during screen transitions.
|
|
135
|
+
* Prevents iOS/Android from throttling to 60fps for battery savings.
|
|
136
|
+
*
|
|
137
|
+
* Useful for smoother animations on high refresh rate displays (90/120/144Hz).
|
|
138
|
+
* Note: Increases battery usage while active.
|
|
139
|
+
*
|
|
140
|
+
* @experimental This API may change in future versions.
|
|
141
|
+
* @default false
|
|
142
|
+
*/
|
|
143
|
+
experimental_enableHighRefreshRate?: boolean;
|
|
111
144
|
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ScreenTransitionConfig } from "./screen.types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Base route interface - minimal contract all stacks satisfy.
|
|
5
|
+
* React Navigation routes and ComponentStack routes both extend this.
|
|
6
|
+
* Uses `object` for params to be compatible with React Navigation's `Readonly<object | undefined>`.
|
|
7
|
+
*/
|
|
8
|
+
export interface BaseStackRoute {
|
|
9
|
+
key: string;
|
|
10
|
+
name: string;
|
|
11
|
+
params?: object;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Base navigation interface - minimal contract for gesture handling.
|
|
16
|
+
* Both React Navigation helpers and ComponentNavigation satisfy this.
|
|
17
|
+
*/
|
|
18
|
+
export interface BaseStackNavigation {
|
|
19
|
+
getState: () => { routes: Array<{ key: string }>; key: string };
|
|
20
|
+
dispatch: (action: any) => void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Base descriptor interface - generic over route, navigation, and options.
|
|
25
|
+
* All stack descriptors (BlankStack, NativeStack, ComponentStack) extend this.
|
|
26
|
+
*/
|
|
27
|
+
export interface BaseStackDescriptor<
|
|
28
|
+
TRoute extends BaseStackRoute = BaseStackRoute,
|
|
29
|
+
TNavigation extends BaseStackNavigation = BaseStackNavigation,
|
|
30
|
+
TOptions extends ScreenTransitionConfig = ScreenTransitionConfig,
|
|
31
|
+
> {
|
|
32
|
+
route: TRoute;
|
|
33
|
+
navigation: TNavigation;
|
|
34
|
+
options: TOptions;
|
|
35
|
+
render?: () => React.JSX.Element | null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Base scene interface - route + descriptor pair.
|
|
40
|
+
* Used by all stack views to iterate over screens.
|
|
41
|
+
*/
|
|
42
|
+
export interface BaseStackScene<
|
|
43
|
+
TDescriptor extends BaseStackDescriptor = BaseStackDescriptor,
|
|
44
|
+
> {
|
|
45
|
+
route: TDescriptor["route"];
|
|
46
|
+
descriptor: TDescriptor;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Base state interface - routes array with index.
|
|
51
|
+
* Common structure across all navigation states.
|
|
52
|
+
*/
|
|
53
|
+
export interface BaseStackState<
|
|
54
|
+
TRoute extends BaseStackRoute = BaseStackRoute,
|
|
55
|
+
> {
|
|
56
|
+
routes: TRoute[];
|
|
57
|
+
index: number;
|
|
58
|
+
key: string;
|
|
59
|
+
}
|
|
@@ -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";
|
|
@@ -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;
|
|
@@ -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;
|