react-native-screen-transitions 1.2.0 → 2.0.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/LICENSE +21 -0
- package/README.md +211 -156
- package/lib/commonjs/__tests__ /geometry.test.js +178 -0
- package/lib/commonjs/__tests__ /geometry.test.js.map +1 -0
- package/lib/commonjs/components/bounds-activator.js +33 -0
- package/lib/commonjs/components/bounds-activator.js.map +1 -0
- package/lib/commonjs/components/controllers/screen-lifecycle.js +66 -0
- package/lib/commonjs/components/controllers/screen-lifecycle.js.map +1 -0
- package/lib/commonjs/components/create-transition-aware-component.js +96 -0
- package/lib/commonjs/components/create-transition-aware-component.js.map +1 -0
- package/lib/commonjs/components/root-transition-aware.js +56 -0
- package/lib/commonjs/components/root-transition-aware.js.map +1 -0
- package/lib/commonjs/configs/index.js +12 -0
- package/lib/commonjs/configs/index.js.map +1 -0
- package/lib/commonjs/configs/presets.js +206 -0
- package/lib/commonjs/configs/presets.js.map +1 -0
- package/lib/commonjs/configs/specs.js +14 -0
- package/lib/commonjs/configs/specs.js.map +1 -0
- package/lib/commonjs/hooks/animation/use-associated-style.js +36 -0
- package/lib/commonjs/hooks/animation/use-associated-style.js.map +1 -0
- package/lib/commonjs/hooks/animation/use-screen-animation.js +120 -0
- package/lib/commonjs/hooks/animation/use-screen-animation.js.map +1 -0
- package/lib/commonjs/hooks/bounds/use-bound-measurer.js +52 -0
- package/lib/commonjs/hooks/bounds/use-bound-measurer.js.map +1 -0
- package/lib/commonjs/hooks/gestures/use-build-gestures.js +239 -0
- package/lib/commonjs/hooks/gestures/use-build-gestures.js.map +1 -0
- package/lib/commonjs/hooks/gestures/use-scroll-progress.js +57 -0
- package/lib/commonjs/hooks/gestures/use-scroll-progress.js.map +1 -0
- package/lib/commonjs/hooks/use-stable-callback.js +17 -0
- package/lib/commonjs/hooks/use-stable-callback.js.map +1 -0
- package/lib/commonjs/index.js +37 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/integrations/native-stack/navigators/createNativeStackNavigator.js +68 -0
- package/lib/commonjs/integrations/native-stack/navigators/createNativeStackNavigator.js.map +1 -0
- package/lib/commonjs/integrations/native-stack/utils/debounce.js +16 -0
- package/lib/commonjs/integrations/native-stack/utils/debounce.js.map +1 -0
- package/lib/commonjs/integrations/native-stack/utils/getModalRoutesKeys.js +17 -0
- package/lib/commonjs/integrations/native-stack/utils/getModalRoutesKeys.js.map +1 -0
- package/lib/commonjs/integrations/native-stack/utils/useAnimatedHeaderHeight.js +18 -0
- package/lib/commonjs/integrations/native-stack/utils/useAnimatedHeaderHeight.js.map +1 -0
- package/lib/commonjs/integrations/native-stack/utils/useDismissedRouteError.js +22 -0
- package/lib/commonjs/integrations/native-stack/utils/useDismissedRouteError.js.map +1 -0
- package/lib/commonjs/integrations/native-stack/utils/useInvalidPreventRemoveError.js +25 -0
- package/lib/commonjs/integrations/native-stack/utils/useInvalidPreventRemoveError.js.map +1 -0
- package/lib/commonjs/integrations/native-stack/views/FontProcessor.js +10 -0
- package/lib/commonjs/integrations/native-stack/views/FontProcessor.js.map +1 -0
- package/lib/commonjs/integrations/native-stack/views/FontProcessor.native.js +18 -0
- package/lib/commonjs/integrations/native-stack/views/FontProcessor.native.js.map +1 -0
- package/lib/commonjs/integrations/native-stack/views/FooterComponent.js +17 -0
- package/lib/commonjs/integrations/native-stack/views/FooterComponent.js.map +1 -0
- package/lib/commonjs/integrations/native-stack/views/NativeStackView.js +138 -0
- package/lib/commonjs/integrations/native-stack/views/NativeStackView.js.map +1 -0
- package/lib/commonjs/integrations/native-stack/views/NativeStackView.native.js +497 -0
- package/lib/commonjs/integrations/native-stack/views/NativeStackView.native.js.map +1 -0
- package/lib/commonjs/integrations/native-stack/views/useHeaderConfigProps.js +203 -0
- package/lib/commonjs/integrations/native-stack/views/useHeaderConfigProps.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/providers/gestures.js +64 -0
- package/lib/commonjs/providers/gestures.js.map +1 -0
- package/lib/commonjs/providers/keys.js +35 -0
- package/lib/commonjs/providers/keys.js.map +1 -0
- package/lib/commonjs/stores/animations.js +39 -0
- package/lib/commonjs/stores/animations.js.map +1 -0
- package/lib/commonjs/stores/bounds.js +64 -0
- package/lib/commonjs/stores/bounds.js.map +1 -0
- package/lib/commonjs/stores/gestures.js +38 -0
- package/lib/commonjs/stores/gestures.js.map +1 -0
- package/lib/commonjs/stores/navigator-dismiss-state.js +23 -0
- package/lib/commonjs/stores/navigator-dismiss-state.js.map +1 -0
- package/lib/commonjs/stores/utils/reset-stores-for-screen.js +20 -0
- package/lib/commonjs/stores/utils/reset-stores-for-screen.js.map +1 -0
- package/lib/commonjs/types/animation.js +6 -0
- package/lib/commonjs/types/animation.js.map +1 -0
- package/lib/commonjs/types/bounds.js +6 -0
- package/lib/commonjs/types/bounds.js.map +1 -0
- package/lib/commonjs/types/core.js +6 -0
- package/lib/commonjs/types/core.js.map +1 -0
- package/lib/commonjs/types/gesture.js +2 -0
- package/lib/commonjs/types/gesture.js.map +1 -0
- package/lib/commonjs/types/navigator.js +6 -0
- package/lib/commonjs/types/navigator.js.map +1 -0
- package/lib/commonjs/types/utils.js +2 -0
- package/lib/commonjs/types/utils.js.map +1 -0
- package/lib/commonjs/utils/animation/animate.js +18 -0
- package/lib/commonjs/utils/animation/animate.js.map +1 -0
- package/lib/commonjs/utils/animation/run-transition.js +48 -0
- package/lib/commonjs/utils/animation/run-transition.js.map +1 -0
- package/lib/commonjs/utils/bounds/_types/builder.js +6 -0
- package/lib/commonjs/utils/bounds/_types/builder.js.map +1 -0
- package/lib/commonjs/utils/bounds/_types/geometry.js +2 -0
- package/lib/commonjs/utils/bounds/_types/geometry.js.map +1 -0
- package/lib/commonjs/utils/bounds/_types/get-bounds.js +6 -0
- package/lib/commonjs/utils/bounds/_types/get-bounds.js.map +1 -0
- package/lib/commonjs/utils/bounds/build-bound-styles.js +145 -0
- package/lib/commonjs/utils/bounds/build-bound-styles.js.map +1 -0
- package/lib/commonjs/utils/bounds/constants.js +31 -0
- package/lib/commonjs/utils/bounds/constants.js.map +1 -0
- package/lib/commonjs/utils/bounds/flatten-styles.js +27 -0
- package/lib/commonjs/utils/bounds/flatten-styles.js.map +1 -0
- package/lib/commonjs/utils/bounds/geometry.js +94 -0
- package/lib/commonjs/utils/bounds/geometry.js.map +1 -0
- package/lib/commonjs/utils/bounds/get-bounds.js +51 -0
- package/lib/commonjs/utils/bounds/get-bounds.js.map +1 -0
- package/lib/commonjs/utils/bounds/index.js +38 -0
- package/lib/commonjs/utils/bounds/index.js.map +1 -0
- package/lib/commonjs/utils/bounds/style-composers.js +199 -0
- package/lib/commonjs/utils/bounds/style-composers.js.map +1 -0
- package/lib/commonjs/utils/gesture/apply-gesture-activation-criteria.js +81 -0
- package/lib/commonjs/utils/gesture/apply-gesture-activation-criteria.js.map +1 -0
- package/lib/commonjs/utils/gesture/map-gesture-to-progress.js +17 -0
- package/lib/commonjs/utils/gesture/map-gesture-to-progress.js.map +1 -0
- package/lib/commonjs/utils/gesture/normalize-gesture-translation.js +21 -0
- package/lib/commonjs/utils/gesture/normalize-gesture-translation.js.map +1 -0
- package/lib/commonjs/utils/index.js +17 -0
- package/lib/commonjs/utils/index.js.map +1 -0
- package/lib/module/__tests__ /geometry.test.js +178 -0
- package/lib/module/__tests__ /geometry.test.js.map +1 -0
- package/lib/module/components/bounds-activator.js +28 -0
- package/lib/module/components/bounds-activator.js.map +1 -0
- package/lib/module/components/controllers/screen-lifecycle.js +60 -0
- package/lib/module/components/controllers/screen-lifecycle.js.map +1 -0
- package/lib/module/components/create-transition-aware-component.js +91 -0
- package/lib/module/components/create-transition-aware-component.js.map +1 -0
- package/lib/module/components/root-transition-aware.js +51 -0
- package/lib/module/components/root-transition-aware.js.map +1 -0
- package/lib/module/configs/index.js +5 -0
- package/lib/module/configs/index.js.map +1 -0
- package/lib/module/configs/presets.js +197 -0
- package/lib/module/configs/presets.js.map +1 -0
- package/lib/module/configs/specs.js +10 -0
- package/lib/module/configs/specs.js.map +1 -0
- package/lib/module/hooks/animation/use-associated-style.js +32 -0
- package/lib/module/hooks/animation/use-associated-style.js.map +1 -0
- package/lib/module/hooks/animation/use-screen-animation.js +115 -0
- package/lib/module/hooks/animation/use-screen-animation.js.map +1 -0
- package/lib/module/hooks/bounds/use-bound-measurer.js +47 -0
- package/lib/module/hooks/bounds/use-bound-measurer.js.map +1 -0
- package/lib/module/hooks/gestures/use-build-gestures.js +234 -0
- package/lib/module/hooks/gestures/use-build-gestures.js.map +1 -0
- package/lib/module/hooks/gestures/use-scroll-progress.js +52 -0
- package/lib/module/hooks/gestures/use-scroll-progress.js.map +1 -0
- package/lib/module/hooks/use-stable-callback.js +13 -0
- package/lib/module/hooks/use-stable-callback.js.map +1 -0
- package/lib/module/index.js +21 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/integrations/native-stack/navigators/createNativeStackNavigator.js +63 -0
- package/lib/module/integrations/native-stack/navigators/createNativeStackNavigator.js.map +1 -0
- package/lib/module/integrations/native-stack/utils/debounce.js +12 -0
- package/lib/module/integrations/native-stack/utils/debounce.js.map +1 -0
- package/lib/module/integrations/native-stack/utils/getModalRoutesKeys.js +12 -0
- package/lib/module/integrations/native-stack/utils/getModalRoutesKeys.js.map +1 -0
- package/lib/module/integrations/native-stack/utils/useAnimatedHeaderHeight.js +12 -0
- package/lib/module/integrations/native-stack/utils/useAnimatedHeaderHeight.js.map +1 -0
- package/lib/module/integrations/native-stack/utils/useDismissedRouteError.js +17 -0
- package/lib/module/integrations/native-stack/utils/useDismissedRouteError.js.map +1 -0
- package/lib/module/integrations/native-stack/utils/useInvalidPreventRemoveError.js +20 -0
- package/lib/module/integrations/native-stack/utils/useInvalidPreventRemoveError.js.map +1 -0
- package/lib/module/integrations/native-stack/views/FontProcessor.js +6 -0
- package/lib/module/integrations/native-stack/views/FontProcessor.js.map +1 -0
- package/lib/module/integrations/native-stack/views/FontProcessor.native.js +12 -0
- package/lib/module/integrations/native-stack/views/FontProcessor.native.js.map +1 -0
- package/lib/module/integrations/native-stack/views/FooterComponent.js +13 -0
- package/lib/module/integrations/native-stack/views/FooterComponent.js.map +1 -0
- package/lib/module/integrations/native-stack/views/NativeStackView.js +133 -0
- package/lib/module/integrations/native-stack/views/NativeStackView.js.map +1 -0
- package/lib/module/integrations/native-stack/views/NativeStackView.native.js +492 -0
- package/lib/module/integrations/native-stack/views/NativeStackView.native.js.map +1 -0
- package/lib/module/integrations/native-stack/views/useHeaderConfigProps.js +199 -0
- package/lib/module/integrations/native-stack/views/useHeaderConfigProps.js.map +1 -0
- package/lib/module/providers/gestures.js +58 -0
- package/lib/module/providers/gestures.js.map +1 -0
- package/lib/module/providers/keys.js +29 -0
- package/lib/module/providers/keys.js.map +1 -0
- package/lib/module/stores/animations.js +33 -0
- package/lib/module/stores/animations.js.map +1 -0
- package/lib/module/stores/bounds.js +60 -0
- package/lib/module/stores/bounds.js.map +1 -0
- package/lib/module/stores/gestures.js +34 -0
- package/lib/module/stores/gestures.js.map +1 -0
- package/lib/module/stores/navigator-dismiss-state.js +19 -0
- package/lib/module/stores/navigator-dismiss-state.js.map +1 -0
- package/lib/module/stores/utils/reset-stores-for-screen.js +16 -0
- package/lib/module/stores/utils/reset-stores-for-screen.js.map +1 -0
- package/lib/module/types/animation.js +4 -0
- package/lib/module/types/animation.js.map +1 -0
- package/lib/module/types/bounds.js +4 -0
- package/lib/module/types/bounds.js.map +1 -0
- package/lib/module/types/core.js +4 -0
- package/lib/module/types/core.js.map +1 -0
- package/lib/module/types/gesture.js +2 -0
- package/lib/module/types/gesture.js.map +1 -0
- package/lib/module/types/navigator.js +4 -0
- package/lib/module/types/navigator.js.map +1 -0
- package/lib/module/types/utils.js +2 -0
- package/lib/module/types/utils.js.map +1 -0
- package/lib/module/utils/animation/animate.js +13 -0
- package/lib/module/utils/animation/animate.js.map +1 -0
- package/lib/module/utils/animation/run-transition.js +43 -0
- package/lib/module/utils/animation/run-transition.js.map +1 -0
- package/lib/module/utils/bounds/_types/builder.js +4 -0
- package/lib/module/utils/bounds/_types/builder.js.map +1 -0
- package/lib/module/utils/bounds/_types/geometry.js +2 -0
- package/lib/module/utils/bounds/_types/geometry.js.map +1 -0
- package/lib/module/utils/bounds/_types/get-bounds.js +4 -0
- package/lib/module/utils/bounds/_types/get-bounds.js.map +1 -0
- package/lib/module/utils/bounds/build-bound-styles.js +141 -0
- package/lib/module/utils/bounds/build-bound-styles.js.map +1 -0
- package/lib/module/utils/bounds/constants.js +26 -0
- package/lib/module/utils/bounds/constants.js.map +1 -0
- package/lib/module/utils/bounds/flatten-styles.js +23 -0
- package/lib/module/utils/bounds/flatten-styles.js.map +1 -0
- package/lib/module/utils/bounds/geometry.js +89 -0
- package/lib/module/utils/bounds/geometry.js.map +1 -0
- package/lib/module/utils/bounds/get-bounds.js +46 -0
- package/lib/module/utils/bounds/get-bounds.js.map +1 -0
- package/lib/module/utils/bounds/index.js +33 -0
- package/lib/module/utils/bounds/index.js.map +1 -0
- package/lib/module/utils/bounds/style-composers.js +191 -0
- package/lib/module/utils/bounds/style-composers.js.map +1 -0
- package/lib/module/utils/gesture/apply-gesture-activation-criteria.js +76 -0
- package/lib/module/utils/gesture/apply-gesture-activation-criteria.js.map +1 -0
- package/lib/module/utils/gesture/map-gesture-to-progress.js +12 -0
- package/lib/module/utils/gesture/map-gesture-to-progress.js.map +1 -0
- package/lib/module/utils/gesture/normalize-gesture-translation.js +16 -0
- package/lib/module/utils/gesture/normalize-gesture-translation.js.map +1 -0
- package/lib/module/utils/index.js +4 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/typescript/components/bounds-activator.d.ts +8 -0
- package/lib/typescript/components/bounds-activator.d.ts.map +1 -0
- package/lib/typescript/components/controllers/screen-lifecycle.d.ts +6 -0
- package/lib/typescript/components/controllers/screen-lifecycle.d.ts.map +1 -0
- package/lib/typescript/components/create-transition-aware-component.d.ts +9 -0
- package/lib/typescript/components/create-transition-aware-component.d.ts.map +1 -0
- package/lib/typescript/components/root-transition-aware.d.ts +6 -0
- package/lib/typescript/components/root-transition-aware.d.ts.map +1 -0
- package/lib/typescript/configs/index.d.ts +3 -0
- package/lib/typescript/configs/index.d.ts.map +1 -0
- package/lib/typescript/configs/presets.d.ts +9 -0
- package/lib/typescript/configs/presets.d.ts.map +1 -0
- package/lib/typescript/configs/specs.d.ts +3 -0
- package/lib/typescript/configs/specs.d.ts.map +1 -0
- package/lib/typescript/hooks/animation/use-associated-style.d.ts +11 -0
- package/lib/typescript/hooks/animation/use-associated-style.d.ts.map +1 -0
- package/lib/typescript/hooks/animation/use-screen-animation.d.ts +7 -0
- package/lib/typescript/hooks/animation/use-screen-animation.d.ts.map +1 -0
- package/lib/typescript/hooks/bounds/use-bound-measurer.d.ts +18 -0
- package/lib/typescript/hooks/bounds/use-bound-measurer.d.ts.map +1 -0
- package/lib/typescript/hooks/gestures/use-build-gestures.d.ts +11 -0
- package/lib/typescript/hooks/gestures/use-build-gestures.d.ts.map +1 -0
- package/lib/typescript/hooks/gestures/use-scroll-progress.d.ts +14 -0
- package/lib/typescript/hooks/gestures/use-scroll-progress.d.ts.map +1 -0
- package/lib/typescript/hooks/use-stable-callback.d.ts +2 -0
- package/lib/typescript/hooks/use-stable-callback.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +1275 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/integrations/native-stack/navigators/createNativeStackNavigator.d.ts +16 -0
- package/lib/typescript/integrations/native-stack/navigators/createNativeStackNavigator.d.ts.map +1 -0
- package/lib/typescript/integrations/native-stack/utils/debounce.d.ts +2 -0
- package/lib/typescript/integrations/native-stack/utils/debounce.d.ts.map +1 -0
- package/lib/typescript/integrations/native-stack/utils/getModalRoutesKeys.d.ts +4 -0
- package/lib/typescript/integrations/native-stack/utils/getModalRoutesKeys.d.ts.map +1 -0
- package/lib/typescript/integrations/native-stack/utils/useAnimatedHeaderHeight.d.ts +5 -0
- package/lib/typescript/integrations/native-stack/utils/useAnimatedHeaderHeight.d.ts.map +1 -0
- package/lib/typescript/integrations/native-stack/utils/useDismissedRouteError.d.ts +6 -0
- package/lib/typescript/integrations/native-stack/utils/useDismissedRouteError.d.ts.map +1 -0
- package/lib/typescript/integrations/native-stack/utils/useInvalidPreventRemoveError.d.ts +3 -0
- package/lib/typescript/integrations/native-stack/utils/useInvalidPreventRemoveError.d.ts.map +1 -0
- package/lib/typescript/integrations/native-stack/views/FontProcessor.d.ts +2 -0
- package/lib/typescript/integrations/native-stack/views/FontProcessor.d.ts.map +1 -0
- package/lib/typescript/integrations/native-stack/views/FontProcessor.native.d.ts +2 -0
- package/lib/typescript/integrations/native-stack/views/FontProcessor.native.d.ts.map +1 -0
- package/lib/typescript/integrations/native-stack/views/FooterComponent.d.ts +7 -0
- package/lib/typescript/integrations/native-stack/views/FooterComponent.d.ts.map +1 -0
- package/lib/typescript/integrations/native-stack/views/NativeStackView.d.ts +11 -0
- package/lib/typescript/integrations/native-stack/views/NativeStackView.d.ts.map +1 -0
- package/lib/typescript/integrations/native-stack/views/NativeStackView.native.d.ts +11 -0
- package/lib/typescript/integrations/native-stack/views/NativeStackView.native.d.ts.map +1 -0
- package/lib/typescript/integrations/native-stack/views/useHeaderConfigProps.d.ts +44 -0
- package/lib/typescript/integrations/native-stack/views/useHeaderConfigProps.d.ts.map +1 -0
- package/lib/typescript/providers/gestures.d.ts +22 -0
- package/lib/typescript/providers/gestures.d.ts.map +1 -0
- package/lib/typescript/providers/keys.d.ts +16 -0
- package/lib/typescript/providers/keys.d.ts.map +1 -0
- package/lib/typescript/stores/animations.d.ts +17 -0
- package/lib/typescript/stores/animations.d.ts.map +1 -0
- package/lib/typescript/stores/bounds.d.ts +21 -0
- package/lib/typescript/stores/bounds.d.ts.map +1 -0
- package/lib/typescript/stores/gestures.d.ts +21 -0
- package/lib/typescript/stores/gestures.d.ts.map +1 -0
- package/lib/typescript/stores/navigator-dismiss-state.d.ts +7 -0
- package/lib/typescript/stores/navigator-dismiss-state.d.ts.map +1 -0
- package/lib/typescript/stores/utils/reset-stores-for-screen.d.ts +6 -0
- package/lib/typescript/stores/utils/reset-stores-for-screen.d.ts.map +1 -0
- package/lib/typescript/types/animation.d.ts +65 -0
- package/lib/typescript/types/animation.d.ts.map +1 -0
- package/lib/typescript/types/bounds.d.ts +73 -0
- package/lib/typescript/types/bounds.d.ts.map +1 -0
- package/lib/typescript/types/core.d.ts +47 -0
- package/lib/typescript/types/core.d.ts.map +1 -0
- package/lib/typescript/types/gesture.d.ts +28 -0
- package/lib/typescript/types/gesture.d.ts.map +1 -0
- package/lib/typescript/types/navigator.d.ts +683 -0
- package/lib/typescript/types/navigator.d.ts.map +1 -0
- package/lib/typescript/types/utils.d.ts +5 -0
- package/lib/typescript/types/utils.d.ts.map +1 -0
- package/lib/typescript/utils/animation/animate.d.ts +4 -0
- package/lib/typescript/utils/animation/animate.d.ts.map +1 -0
- package/lib/typescript/utils/animation/run-transition.d.ts +11 -0
- package/lib/typescript/utils/animation/run-transition.d.ts.map +1 -0
- package/lib/typescript/utils/bounds/_types/builder.d.ts +36 -0
- package/lib/typescript/utils/bounds/_types/builder.d.ts.map +1 -0
- package/lib/typescript/utils/bounds/_types/geometry.d.ts +16 -0
- package/lib/typescript/utils/bounds/_types/geometry.d.ts.map +1 -0
- package/lib/typescript/utils/bounds/_types/get-bounds.d.ts +10 -0
- package/lib/typescript/utils/bounds/_types/get-bounds.d.ts.map +1 -0
- package/lib/typescript/utils/bounds/build-bound-styles.d.ts +4 -0
- package/lib/typescript/utils/bounds/build-bound-styles.d.ts.map +1 -0
- package/lib/typescript/utils/bounds/constants.d.ts +7 -0
- package/lib/typescript/utils/bounds/constants.d.ts.map +1 -0
- package/lib/typescript/utils/bounds/flatten-styles.d.ts +2 -0
- package/lib/typescript/utils/bounds/flatten-styles.d.ts.map +1 -0
- package/lib/typescript/utils/bounds/geometry.d.ts +24 -0
- package/lib/typescript/utils/bounds/geometry.d.ts.map +1 -0
- package/lib/typescript/utils/bounds/get-bounds.d.ts +4 -0
- package/lib/typescript/utils/bounds/get-bounds.d.ts.map +1 -0
- package/lib/typescript/utils/bounds/index.d.ts +15 -0
- package/lib/typescript/utils/bounds/index.d.ts.map +1 -0
- package/lib/typescript/utils/bounds/style-composers.d.ts +40 -0
- package/lib/typescript/utils/bounds/style-composers.d.ts.map +1 -0
- package/lib/typescript/utils/gesture/apply-gesture-activation-criteria.d.ts +17 -0
- package/lib/typescript/utils/gesture/apply-gesture-activation-criteria.d.ts.map +1 -0
- package/lib/typescript/utils/gesture/map-gesture-to-progress.d.ts +5 -0
- package/lib/typescript/utils/gesture/map-gesture-to-progress.d.ts.map +1 -0
- package/lib/typescript/utils/gesture/normalize-gesture-translation.d.ts +6 -0
- package/lib/typescript/utils/gesture/normalize-gesture-translation.d.ts.map +1 -0
- package/lib/typescript/utils/index.d.ts +2 -0
- package/lib/typescript/utils/index.d.ts.map +1 -0
- package/package.json +67 -54
- package/dist/index.d.mts +0 -1513
- package/dist/index.d.ts +0 -1513
- package/dist/index.js +0 -1283
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -1279
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useHeaderConfigProps = useHeaderConfigProps;
|
|
7
|
+
var _elements = require("@react-navigation/elements");
|
|
8
|
+
var _native = require("@react-navigation/native");
|
|
9
|
+
var _reactNative = require("react-native");
|
|
10
|
+
var _reactNativeScreens = require("react-native-screens");
|
|
11
|
+
var _FontProcessor = require("./FontProcessor");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function useHeaderConfigProps({
|
|
14
|
+
headerBackImageSource,
|
|
15
|
+
headerBackButtonDisplayMode,
|
|
16
|
+
headerBackButtonMenuEnabled,
|
|
17
|
+
headerBackTitle,
|
|
18
|
+
headerBackTitleStyle,
|
|
19
|
+
headerBackVisible,
|
|
20
|
+
headerShadowVisible,
|
|
21
|
+
headerLargeStyle,
|
|
22
|
+
headerLargeTitle,
|
|
23
|
+
headerLargeTitleShadowVisible,
|
|
24
|
+
headerLargeTitleStyle,
|
|
25
|
+
headerBackground,
|
|
26
|
+
headerLeft,
|
|
27
|
+
headerRight,
|
|
28
|
+
headerShown,
|
|
29
|
+
headerStyle,
|
|
30
|
+
headerBlurEffect,
|
|
31
|
+
headerTintColor,
|
|
32
|
+
headerTitle,
|
|
33
|
+
headerTitleAlign,
|
|
34
|
+
headerTitleStyle,
|
|
35
|
+
headerTransparent,
|
|
36
|
+
headerSearchBarOptions,
|
|
37
|
+
headerTopInsetEnabled,
|
|
38
|
+
headerBack,
|
|
39
|
+
route,
|
|
40
|
+
title
|
|
41
|
+
}) {
|
|
42
|
+
const {
|
|
43
|
+
direction
|
|
44
|
+
} = (0, _native.useLocale)();
|
|
45
|
+
const {
|
|
46
|
+
colors,
|
|
47
|
+
fonts
|
|
48
|
+
} = (0, _native.useTheme)();
|
|
49
|
+
const tintColor = headerTintColor ?? (_reactNative.Platform.OS === "ios" ? colors.primary : colors.text);
|
|
50
|
+
const headerBackTitleStyleFlattened = _reactNative.StyleSheet.flatten([fonts.regular, headerBackTitleStyle]) || {};
|
|
51
|
+
const headerLargeTitleStyleFlattened = _reactNative.StyleSheet.flatten([_reactNative.Platform.select({
|
|
52
|
+
ios: fonts.heavy,
|
|
53
|
+
default: fonts.medium
|
|
54
|
+
}), headerLargeTitleStyle]) || {};
|
|
55
|
+
const headerTitleStyleFlattened = _reactNative.StyleSheet.flatten([_reactNative.Platform.select({
|
|
56
|
+
ios: fonts.bold,
|
|
57
|
+
default: fonts.medium
|
|
58
|
+
}), headerTitleStyle]) || {};
|
|
59
|
+
const headerStyleFlattened = _reactNative.StyleSheet.flatten(headerStyle) || {};
|
|
60
|
+
const headerLargeStyleFlattened = _reactNative.StyleSheet.flatten(headerLargeStyle) || {};
|
|
61
|
+
const [backTitleFontFamily, largeTitleFontFamily, titleFontFamily] = (0, _FontProcessor.processFonts)([headerBackTitleStyleFlattened.fontFamily, headerLargeTitleStyleFlattened.fontFamily, headerTitleStyleFlattened.fontFamily]);
|
|
62
|
+
const backTitleFontSize = "fontSize" in headerBackTitleStyleFlattened ? headerBackTitleStyleFlattened.fontSize : undefined;
|
|
63
|
+
const titleText = (0, _elements.getHeaderTitle)({
|
|
64
|
+
title,
|
|
65
|
+
headerTitle
|
|
66
|
+
}, route.name);
|
|
67
|
+
const titleColor = "color" in headerTitleStyleFlattened ? headerTitleStyleFlattened.color : headerTintColor ?? colors.text;
|
|
68
|
+
const titleFontSize = "fontSize" in headerTitleStyleFlattened ? headerTitleStyleFlattened.fontSize : undefined;
|
|
69
|
+
const titleFontWeight = headerTitleStyleFlattened.fontWeight;
|
|
70
|
+
const largeTitleBackgroundColor = headerLargeStyleFlattened.backgroundColor;
|
|
71
|
+
const largeTitleColor = "color" in headerLargeTitleStyleFlattened ? headerLargeTitleStyleFlattened.color : undefined;
|
|
72
|
+
const largeTitleFontSize = "fontSize" in headerLargeTitleStyleFlattened ? headerLargeTitleStyleFlattened.fontSize : undefined;
|
|
73
|
+
const largeTitleFontWeight = headerLargeTitleStyleFlattened.fontWeight;
|
|
74
|
+
const headerTitleStyleSupported = {
|
|
75
|
+
color: titleColor
|
|
76
|
+
};
|
|
77
|
+
if (headerTitleStyleFlattened.fontFamily != null) {
|
|
78
|
+
headerTitleStyleSupported.fontFamily = headerTitleStyleFlattened.fontFamily;
|
|
79
|
+
}
|
|
80
|
+
if (titleFontSize != null) {
|
|
81
|
+
headerTitleStyleSupported.fontSize = titleFontSize;
|
|
82
|
+
}
|
|
83
|
+
if (titleFontWeight != null) {
|
|
84
|
+
headerTitleStyleSupported.fontWeight = titleFontWeight;
|
|
85
|
+
}
|
|
86
|
+
const headerBackgroundColor = headerStyleFlattened.backgroundColor ?? (headerBackground != null || headerTransparent ? "transparent" : colors.card);
|
|
87
|
+
const canGoBack = headerBack != null;
|
|
88
|
+
const headerLeftElement = headerLeft?.({
|
|
89
|
+
tintColor,
|
|
90
|
+
canGoBack,
|
|
91
|
+
label: headerBackTitle ?? headerBack?.title,
|
|
92
|
+
// `href` is only applicable to web
|
|
93
|
+
href: undefined
|
|
94
|
+
});
|
|
95
|
+
const headerRightElement = headerRight?.({
|
|
96
|
+
tintColor,
|
|
97
|
+
canGoBack
|
|
98
|
+
});
|
|
99
|
+
const headerTitleElement = typeof headerTitle === "function" ? headerTitle({
|
|
100
|
+
tintColor,
|
|
101
|
+
children: titleText
|
|
102
|
+
}) : null;
|
|
103
|
+
const hasHeaderSearchBar = _reactNativeScreens.isSearchBarAvailableForCurrentPlatform && headerSearchBarOptions != null;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* We need to set this in if:
|
|
107
|
+
* - Back button should stay visible when `headerLeft` is specified
|
|
108
|
+
* - If `headerTitle` for Android is specified, so we only need to remove the title and keep the back button
|
|
109
|
+
*/
|
|
110
|
+
const backButtonInCustomView = headerBackVisible || _reactNative.Platform.OS === "android" && headerTitleElement != null && headerLeftElement == null;
|
|
111
|
+
const translucent = headerBackground != null || headerTransparent ||
|
|
112
|
+
// When using a SearchBar or large title, the header needs to be translucent for it to work on iOS
|
|
113
|
+
(hasHeaderSearchBar || headerLargeTitle) && _reactNative.Platform.OS === "ios" && headerTransparent !== false;
|
|
114
|
+
const isBackButtonDisplayModeAvailable =
|
|
115
|
+
// On iOS 14+
|
|
116
|
+
_reactNative.Platform.OS === "ios" && parseInt(_reactNative.Platform.Version, 10) >= 14 && (
|
|
117
|
+
// Doesn't have custom styling, by default System, see: https://github.com/software-mansion/react-native-screens/pull/2105#discussion_r1565222738
|
|
118
|
+
backTitleFontFamily == null || backTitleFontFamily === "System") && backTitleFontSize == null &&
|
|
119
|
+
// Back button menu is not disabled
|
|
120
|
+
headerBackButtonMenuEnabled !== false;
|
|
121
|
+
const isCenterViewRenderedAndroid = headerTitleAlign === "center";
|
|
122
|
+
const children = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
123
|
+
children: [_reactNative.Platform.OS === "ios" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
124
|
+
children: [headerLeftElement != null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeScreens.ScreenStackHeaderLeftView, {
|
|
125
|
+
children: headerLeftElement
|
|
126
|
+
}) : null, headerTitleElement != null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeScreens.ScreenStackHeaderCenterView, {
|
|
127
|
+
children: headerTitleElement
|
|
128
|
+
}) : null]
|
|
129
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
130
|
+
children: [headerLeftElement != null || typeof headerTitle === "function" ?
|
|
131
|
+
/*#__PURE__*/
|
|
132
|
+
// The style passed to header left, together with title element being wrapped
|
|
133
|
+
// in flex view is reqruied for proper header layout, in particular,
|
|
134
|
+
// for the text truncation to work.
|
|
135
|
+
(0, _jsxRuntime.jsxs)(_reactNativeScreens.ScreenStackHeaderLeftView, {
|
|
136
|
+
style: !isCenterViewRenderedAndroid ? {
|
|
137
|
+
flex: 1
|
|
138
|
+
} : null,
|
|
139
|
+
children: [headerLeftElement, headerTitleAlign !== "center" ? typeof headerTitle === "function" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
140
|
+
style: {
|
|
141
|
+
flex: 1
|
|
142
|
+
},
|
|
143
|
+
children: headerTitleElement
|
|
144
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
145
|
+
style: {
|
|
146
|
+
flex: 1
|
|
147
|
+
},
|
|
148
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_elements.HeaderTitle, {
|
|
149
|
+
tintColor: tintColor,
|
|
150
|
+
style: headerTitleStyleSupported,
|
|
151
|
+
children: titleText
|
|
152
|
+
})
|
|
153
|
+
}) : null]
|
|
154
|
+
}) : null, isCenterViewRenderedAndroid ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeScreens.ScreenStackHeaderCenterView, {
|
|
155
|
+
children: typeof headerTitle === "function" ? headerTitleElement : /*#__PURE__*/(0, _jsxRuntime.jsx)(_elements.HeaderTitle, {
|
|
156
|
+
tintColor: tintColor,
|
|
157
|
+
style: headerTitleStyleSupported,
|
|
158
|
+
children: titleText
|
|
159
|
+
})
|
|
160
|
+
}) : null]
|
|
161
|
+
}), headerBackImageSource !== undefined ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeScreens.ScreenStackHeaderBackButtonImage, {
|
|
162
|
+
source: headerBackImageSource
|
|
163
|
+
}) : null, headerRightElement != null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeScreens.ScreenStackHeaderRightView, {
|
|
164
|
+
children: headerRightElement
|
|
165
|
+
}) : null, hasHeaderSearchBar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeScreens.ScreenStackHeaderSearchBarView, {
|
|
166
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeScreens.SearchBar, {
|
|
167
|
+
...headerSearchBarOptions
|
|
168
|
+
})
|
|
169
|
+
}) : null]
|
|
170
|
+
});
|
|
171
|
+
return {
|
|
172
|
+
backButtonInCustomView,
|
|
173
|
+
backgroundColor: headerBackgroundColor,
|
|
174
|
+
backTitle: headerBackTitle,
|
|
175
|
+
backTitleVisible: isBackButtonDisplayModeAvailable ? undefined : headerBackButtonDisplayMode !== "minimal",
|
|
176
|
+
backButtonDisplayMode: isBackButtonDisplayModeAvailable ? headerBackButtonDisplayMode : undefined,
|
|
177
|
+
backTitleFontFamily,
|
|
178
|
+
backTitleFontSize,
|
|
179
|
+
blurEffect: headerBlurEffect,
|
|
180
|
+
color: tintColor,
|
|
181
|
+
direction,
|
|
182
|
+
disableBackButtonMenu: headerBackButtonMenuEnabled === false,
|
|
183
|
+
hidden: headerShown === false,
|
|
184
|
+
hideBackButton: headerBackVisible === false,
|
|
185
|
+
hideShadow: headerShadowVisible === false || headerBackground != null || headerTransparent && headerShadowVisible !== true,
|
|
186
|
+
largeTitle: headerLargeTitle,
|
|
187
|
+
largeTitleBackgroundColor,
|
|
188
|
+
largeTitleColor,
|
|
189
|
+
largeTitleFontFamily,
|
|
190
|
+
largeTitleFontSize,
|
|
191
|
+
largeTitleFontWeight,
|
|
192
|
+
largeTitleHideShadow: headerLargeTitleShadowVisible === false,
|
|
193
|
+
title: titleText,
|
|
194
|
+
titleColor,
|
|
195
|
+
titleFontFamily,
|
|
196
|
+
titleFontSize,
|
|
197
|
+
titleFontWeight: String(titleFontWeight),
|
|
198
|
+
topInsetEnabled: headerTopInsetEnabled,
|
|
199
|
+
translucent: translucent === true,
|
|
200
|
+
children
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
//# sourceMappingURL=useHeaderConfigProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_elements","require","_native","_reactNative","_reactNativeScreens","_FontProcessor","_jsxRuntime","useHeaderConfigProps","headerBackImageSource","headerBackButtonDisplayMode","headerBackButtonMenuEnabled","headerBackTitle","headerBackTitleStyle","headerBackVisible","headerShadowVisible","headerLargeStyle","headerLargeTitle","headerLargeTitleShadowVisible","headerLargeTitleStyle","headerBackground","headerLeft","headerRight","headerShown","headerStyle","headerBlurEffect","headerTintColor","headerTitle","headerTitleAlign","headerTitleStyle","headerTransparent","headerSearchBarOptions","headerTopInsetEnabled","headerBack","route","title","direction","useLocale","colors","fonts","useTheme","tintColor","Platform","OS","primary","text","headerBackTitleStyleFlattened","StyleSheet","flatten","regular","headerLargeTitleStyleFlattened","select","ios","heavy","default","medium","headerTitleStyleFlattened","bold","headerStyleFlattened","headerLargeStyleFlattened","backTitleFontFamily","largeTitleFontFamily","titleFontFamily","processFonts","fontFamily","backTitleFontSize","fontSize","undefined","titleText","getHeaderTitle","name","titleColor","color","titleFontSize","titleFontWeight","fontWeight","largeTitleBackgroundColor","backgroundColor","largeTitleColor","largeTitleFontSize","largeTitleFontWeight","headerTitleStyleSupported","headerBackgroundColor","card","canGoBack","headerLeftElement","label","href","headerRightElement","headerTitleElement","children","hasHeaderSearchBar","isSearchBarAvailableForCurrentPlatform","backButtonInCustomView","translucent","isBackButtonDisplayModeAvailable","parseInt","Version","isCenterViewRenderedAndroid","jsxs","Fragment","jsx","ScreenStackHeaderLeftView","ScreenStackHeaderCenterView","style","flex","View","HeaderTitle","ScreenStackHeaderBackButtonImage","source","ScreenStackHeaderRightView","ScreenStackHeaderSearchBarView","SearchBar","backTitle","backTitleVisible","backButtonDisplayMode","blurEffect","disableBackButtonMenu","hidden","hideBackButton","hideShadow","largeTitle","largeTitleHideShadow","String","topInsetEnabled"],"sourceRoot":"../../../../../src","sources":["integrations/native-stack/views/useHeaderConfigProps.tsx"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AAWA,IAAAI,cAAA,GAAAJ,OAAA;AAA+C,IAAAK,WAAA,GAAAL,OAAA;AASxC,SAASM,oBAAoBA,CAAC;EACpCC,qBAAqB;EACrBC,2BAA2B;EAC3BC,2BAA2B;EAC3BC,eAAe;EACfC,oBAAoB;EACpBC,iBAAiB;EACjBC,mBAAmB;EACnBC,gBAAgB;EAChBC,gBAAgB;EAChBC,6BAA6B;EAC7BC,qBAAqB;EACrBC,gBAAgB;EAChBC,UAAU;EACVC,WAAW;EACXC,WAAW;EACXC,WAAW;EACXC,gBAAgB;EAChBC,eAAe;EACfC,WAAW;EACXC,gBAAgB;EAChBC,gBAAgB;EAChBC,iBAAiB;EACjBC,sBAAsB;EACtBC,qBAAqB;EACrBC,UAAU;EACVC,KAAK;EACLC;AACM,CAAC,EAAE;EACT,MAAM;IAAEC;EAAU,CAAC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;IACjBmD,UAAU,EAAE3F,gBAAgB;IAC5B+C,KAAK,EAAE/B,SAAS;IAChBL,SAAS;IACTiF,qBAAqB,EAAE1G,2BAA2B,KAAK,KAAK;IAC5D2G,MAAM,EAAE/F,WAAW,KAAK,KAAK;IAC7BgG,cAAc,EAAEzG,iBAAiB,KAAK,KAAK;IAC3C0G,UAAU,EACTzG,mBAAmB,KAAK,KAAK,IAC7BK,gBAAgB,IAAI,IAAI,IACvBU,iBAAiB,IAAIf,mBAAmB,KAAK,IAAK;IACpD0G,UAAU,EAAExG,gBAAgB;IAC5B2D,yBAAyB;IACzBE,eAAe;IACfjB,oBAAoB;IACpBkB,kBAAkB;IAClBC,oBAAoB;IACpB0C,oBAAoB,EAAExG,6BAA6B,KAAK,KAAK;IAC7DiB,KAAK,EAAEiC,SAAS;IAChBG,UAAU;IACVT,eAAe;IACfW,aAAa;IACbC,eAAe,EAAEiD,MAAM,CAACjD,eAAe,CAAC;IACxCkD,eAAe,EAAE5F,qBAAqB;IACtC8D,WAAW,EAAEA,WAAW,KAAK,IAAI;IACjCJ;EACD,CAAC;AACF","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useGestureContext = exports.ScreenGestureProvider = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _reactNativeGestureHandler = require("react-native-gesture-handler");
|
|
10
|
+
var _reactNativeReanimated = require("react-native-reanimated");
|
|
11
|
+
var _useBuildGestures = require("../hooks/gestures/use-build-gestures");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
const DEFAULT_SCROLL_PROGRESS = {
|
|
14
|
+
x: 0,
|
|
15
|
+
y: 0,
|
|
16
|
+
contentHeight: 0,
|
|
17
|
+
contentWidth: 0,
|
|
18
|
+
layoutHeight: 0,
|
|
19
|
+
layoutWidth: 0
|
|
20
|
+
};
|
|
21
|
+
const GestureContext = /*#__PURE__*/(0, _react.createContext)(undefined);
|
|
22
|
+
const ScreenGestureProvider = ({
|
|
23
|
+
children
|
|
24
|
+
}) => {
|
|
25
|
+
const scrollProgress = (0, _reactNativeReanimated.useSharedValue)(DEFAULT_SCROLL_PROGRESS);
|
|
26
|
+
const {
|
|
27
|
+
panGesture,
|
|
28
|
+
nativeGesture
|
|
29
|
+
} = (0, _useBuildGestures.useBuildGestures)({
|
|
30
|
+
scrollProgress
|
|
31
|
+
});
|
|
32
|
+
const value = (0, _react.useMemo)(() => ({
|
|
33
|
+
panGesture,
|
|
34
|
+
scrollProgress,
|
|
35
|
+
nativeGesture
|
|
36
|
+
}), [panGesture, scrollProgress, nativeGesture]);
|
|
37
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeGestureHandler.GestureHandlerRootView, {
|
|
38
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(GestureContext.Provider, {
|
|
39
|
+
value: value,
|
|
40
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeGestureHandler.GestureDetector, {
|
|
41
|
+
gesture: panGesture,
|
|
42
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
43
|
+
style: styles.container,
|
|
44
|
+
children: children
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
exports.ScreenGestureProvider = ScreenGestureProvider;
|
|
51
|
+
const useGestureContext = () => {
|
|
52
|
+
const context = (0, _react.useContext)(GestureContext);
|
|
53
|
+
if (!context) {
|
|
54
|
+
throw new Error("useGestureContext must be used within a ScreenGestureProvider");
|
|
55
|
+
}
|
|
56
|
+
return context;
|
|
57
|
+
};
|
|
58
|
+
exports.useGestureContext = useGestureContext;
|
|
59
|
+
const styles = _reactNative.StyleSheet.create({
|
|
60
|
+
container: {
|
|
61
|
+
flex: 1
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=gestures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_reactNativeGestureHandler","_reactNativeReanimated","_useBuildGestures","_jsxRuntime","DEFAULT_SCROLL_PROGRESS","x","y","contentHeight","contentWidth","layoutHeight","layoutWidth","GestureContext","createContext","undefined","ScreenGestureProvider","children","scrollProgress","useSharedValue","panGesture","nativeGesture","useBuildGestures","value","useMemo","jsx","GestureHandlerRootView","Provider","GestureDetector","gesture","View","style","styles","container","exports","useGestureContext","context","useContext","Error","StyleSheet","create","flex"],"sourceRoot":"../../../src","sources":["providers/gestures.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,0BAAA,GAAAF,OAAA;AAKA,IAAAG,sBAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAAwE,IAAAK,WAAA,GAAAL,OAAA;AAqBxE,MAAMM,uBAAuC,GAAG;EAC/CC,CAAC,EAAE,CAAC;EACJC,CAAC,EAAE,CAAC;EACJC,aAAa,EAAE,CAAC;EAChBC,YAAY,EAAE,CAAC;EACfC,YAAY,EAAE,CAAC;EACfC,WAAW,EAAE;AACd,CAAC;AAED,MAAMC,cAAc,gBAAG,IAAAC,oBAAa,EAAiCC,SAAS,CAAC;AAExE,MAAMC,qBAAqB,GAAGA,CAAC;EACrCC;AAC2B,CAAC,KAAK;EACjC,MAAMC,cAAc,GAAG,IAAAC,qCAAc,EACpCb,uBACD,CAAC;EAED,MAAM;IAAEc,UAAU;IAAEC;EAAc,CAAC,GAAG,IAAAC,kCAAgB,EAAC;IACtDJ;EACD,CAAC,CAAC;EAEF,MAAMK,KAAK,GAAG,IAAAC,cAAO,EACpB,OAAO;IACNJ,UAAU;IACVF,cAAc;IACdG;EACD,CAAC,CAAC,EACF,CAACD,UAAU,EAAEF,cAAc,EAAEG,aAAa,CAC3C,CAA8B;EAE9B,oBACC,IAAAhB,WAAA,CAAAoB,GAAA,EAACvB,0BAAA,CAAAwB,sBAAsB;IAAAT,QAAA,eACtB,IAAAZ,WAAA,CAAAoB,GAAA,EAACZ,cAAc,CAACc,QAAQ;MAACJ,KAAK,EAAEA,KAAM;MAAAN,QAAA,eACrC,IAAAZ,WAAA,CAAAoB,GAAA,EAACvB,0BAAA,CAAA0B,eAAe;QAACC,OAAO,EAAET,UAAW;QAAAH,QAAA,eACpC,IAAAZ,WAAA,CAAAoB,GAAA,EAACxB,YAAA,CAAA6B,IAAI;UAACC,KAAK,EAAEC,MAAM,CAACC,SAAU;UAAAhB,QAAA,EAAEA;QAAQ,CAAO;MAAC,CAChC;IAAC,CACM;EAAC,CACH,CAAC;AAE3B,CAAC;AAACiB,OAAA,CAAAlB,qBAAA,GAAAA,qBAAA;AAEK,MAAMmB,iBAAiB,GAAGA,CAAA,KAAM;EACtC,MAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACxB,cAAc,CAAC;EAE1C,IAAI,CAACuB,OAAO,EAAE;IACb,MAAM,IAAIE,KAAK,CACd,+DACD,CAAC;EACF;EAEA,OAAOF,OAAO;AACf,CAAC;AAACF,OAAA,CAAAC,iBAAA,GAAAA,iBAAA;AAEF,MAAMH,MAAM,GAAGO,uBAAU,CAACC,MAAM,CAAC;EAChCP,SAAS,EAAE;IACVQ,IAAI,EAAE;EACP;AACD,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useKeys = exports.KeysProvider = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
+
const KeysContext = /*#__PURE__*/(0, _react.createContext)(undefined);
|
|
10
|
+
const KeysProvider = ({
|
|
11
|
+
children,
|
|
12
|
+
previous,
|
|
13
|
+
current,
|
|
14
|
+
next
|
|
15
|
+
}) => {
|
|
16
|
+
const value = (0, _react.useMemo)(() => ({
|
|
17
|
+
previous,
|
|
18
|
+
current,
|
|
19
|
+
next
|
|
20
|
+
}), [previous, current, next]);
|
|
21
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(KeysContext.Provider, {
|
|
22
|
+
value: value,
|
|
23
|
+
children: children
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
exports.KeysProvider = KeysProvider;
|
|
27
|
+
const useKeys = () => {
|
|
28
|
+
const context = (0, _react.useContext)(KeysContext);
|
|
29
|
+
if (context === undefined) {
|
|
30
|
+
throw new Error("useKeys must be used within a KeysProvider");
|
|
31
|
+
}
|
|
32
|
+
return context;
|
|
33
|
+
};
|
|
34
|
+
exports.useKeys = useKeys;
|
|
35
|
+
//# sourceMappingURL=keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_jsxRuntime","KeysContext","createContext","undefined","KeysProvider","children","previous","current","next","value","useMemo","jsx","Provider","exports","useKeys","context","useContext","Error"],"sourceRoot":"../../../src","sources":["providers/keys.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAA2D,IAAAC,WAAA,GAAAD,OAAA;AAS3D,MAAME,WAAW,gBAAG,IAAAC,oBAAa,EAA8BC,SAAS,CAAC;AASlE,MAAMC,YAAY,GAAGA,CAAC;EAC5BC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC;AACkB,CAAC,KAAK;EACxB,MAAMC,KAAK,GAAG,IAAAC,cAAO,EACpB,OAAO;IAAEJ,QAAQ;IAAEC,OAAO;IAAEC;EAAK,CAAC,CAAC,EACnC,CAACF,QAAQ,EAAEC,OAAO,EAAEC,IAAI,CACzB,CAAC;EACD,oBAAO,IAAAR,WAAA,CAAAW,GAAA,EAACV,WAAW,CAACW,QAAQ;IAACH,KAAK,EAAEA,KAAM;IAAAJ,QAAA,EAAEA;EAAQ,CAAuB,CAAC;AAC7E,CAAC;AAACQ,OAAA,CAAAT,YAAA,GAAAA,YAAA;AAEK,MAAMU,OAAO,GAAGA,CAAA,KAAuB;EAC7C,MAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACf,WAAW,CAAC;EACvC,IAAIc,OAAO,KAAKZ,SAAS,EAAE;IAC1B,MAAM,IAAIc,KAAK,CAAC,4CAA4C,CAAC;EAC9D;EACA,OAAOF,OAAO;AACf,CAAC;AAACF,OAAA,CAAAC,OAAA,GAAAA,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Animations = void 0;
|
|
7
|
+
exports.getAll = getAll;
|
|
8
|
+
exports.getAnimation = getAnimation;
|
|
9
|
+
var _reactNativeReanimated = require("react-native-reanimated");
|
|
10
|
+
const store = {};
|
|
11
|
+
const ensure = key => {
|
|
12
|
+
let bag = store[key];
|
|
13
|
+
if (!bag) {
|
|
14
|
+
bag = {
|
|
15
|
+
progress: (0, _reactNativeReanimated.makeMutable)(0),
|
|
16
|
+
closing: (0, _reactNativeReanimated.makeMutable)(0),
|
|
17
|
+
animating: (0, _reactNativeReanimated.makeMutable)(0)
|
|
18
|
+
};
|
|
19
|
+
store[key] = bag;
|
|
20
|
+
}
|
|
21
|
+
return bag;
|
|
22
|
+
};
|
|
23
|
+
function getAnimation(key, type) {
|
|
24
|
+
return ensure(key)[type];
|
|
25
|
+
}
|
|
26
|
+
function getAll(key) {
|
|
27
|
+
return ensure(key);
|
|
28
|
+
}
|
|
29
|
+
function clear(routeKey) {
|
|
30
|
+
"worklet";
|
|
31
|
+
|
|
32
|
+
delete store[routeKey];
|
|
33
|
+
}
|
|
34
|
+
const Animations = exports.Animations = {
|
|
35
|
+
getAnimation,
|
|
36
|
+
clear,
|
|
37
|
+
getAll
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=animations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNativeReanimated","require","store","ensure","key","bag","progress","makeMutable","closing","animating","getAnimation","type","getAll","clear","routeKey","Animations","exports"],"sourceRoot":"../../../src","sources":["stores/animations.ts"],"mappings":";;;;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AASA,MAAMC,KAAsC,GAAG,CAAC,CAAC;AAEjD,MAAMC,MAAM,GAAIC,GAAc,IAAK;EAClC,IAAIC,GAAG,GAAGH,KAAK,CAACE,GAAG,CAAC;EACpB,IAAI,CAACC,GAAG,EAAE;IACTA,GAAG,GAAG;MACLC,QAAQ,EAAE,IAAAC,kCAAW,EAAC,CAAC,CAAC;MACxBC,OAAO,EAAE,IAAAD,kCAAW,EAAC,CAAC,CAAC;MACvBE,SAAS,EAAE,IAAAF,kCAAW,EAAC,CAAC;IACzB,CAAC;IACDL,KAAK,CAACE,GAAG,CAAC,GAAGC,GAAG;EACjB;EACA,OAAOA,GAAG;AACX,CAAC;AAEM,SAASK,YAAYA,CAC3BN,GAAc,EACdO,IAA0C,EACpB;EACtB,OAAOR,MAAM,CAACC,GAAG,CAAC,CAACO,IAAI,CAAC;AACzB;AAEO,SAASC,MAAMA,CAACR,GAAc,EAAE;EACtC,OAAOD,MAAM,CAACC,GAAG,CAAC;AACnB;AAEA,SAASS,KAAKA,CAACC,QAAmB,EAAE;EACnC,SAAS;;EACT,OAAOZ,KAAK,CAACY,QAAQ,CAAC;AACvB;AAEO,MAAMC,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG;EACzBL,YAAY;EACZG,KAAK;EACLD;AACD,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Bounds = void 0;
|
|
7
|
+
var _reactNativeReanimated = require("react-native-reanimated");
|
|
8
|
+
const registry = (0, _reactNativeReanimated.makeMutable)({});
|
|
9
|
+
const activeBoundId = (0, _reactNativeReanimated.makeMutable)(null);
|
|
10
|
+
function setBounds(screenId, boundId, bounds = null, styles = {}) {
|
|
11
|
+
"worklet";
|
|
12
|
+
|
|
13
|
+
registry.modify(state => {
|
|
14
|
+
"worklet";
|
|
15
|
+
|
|
16
|
+
if (!state[screenId]) {
|
|
17
|
+
state[screenId] = {};
|
|
18
|
+
}
|
|
19
|
+
state[screenId][boundId] = {
|
|
20
|
+
bounds,
|
|
21
|
+
styles
|
|
22
|
+
};
|
|
23
|
+
return state;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function getBounds(screenId) {
|
|
27
|
+
"worklet";
|
|
28
|
+
|
|
29
|
+
return registry.value[screenId] ?? {};
|
|
30
|
+
}
|
|
31
|
+
function setActiveBoundId(boundId) {
|
|
32
|
+
"worklet";
|
|
33
|
+
|
|
34
|
+
activeBoundId.value = boundId;
|
|
35
|
+
}
|
|
36
|
+
function getActiveBoundId() {
|
|
37
|
+
"worklet";
|
|
38
|
+
|
|
39
|
+
return activeBoundId.value;
|
|
40
|
+
}
|
|
41
|
+
function clear(routeKey) {
|
|
42
|
+
"worklet";
|
|
43
|
+
|
|
44
|
+
registry.modify(state => {
|
|
45
|
+
"worklet";
|
|
46
|
+
|
|
47
|
+
delete state[routeKey];
|
|
48
|
+
return state;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function clearActive() {
|
|
52
|
+
"worklet";
|
|
53
|
+
|
|
54
|
+
activeBoundId.value = null;
|
|
55
|
+
}
|
|
56
|
+
const Bounds = exports.Bounds = {
|
|
57
|
+
setBounds,
|
|
58
|
+
getBounds,
|
|
59
|
+
setActiveBoundId,
|
|
60
|
+
getActiveBoundId,
|
|
61
|
+
clear,
|
|
62
|
+
clearActive
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=bounds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNativeReanimated","require","registry","makeMutable","activeBoundId","setBounds","screenId","boundId","bounds","styles","modify","state","getBounds","value","setActiveBoundId","getActiveBoundId","clear","routeKey","clearActive","Bounds","exports"],"sourceRoot":"../../../src","sources":["stores/bounds.ts"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAaA,MAAMC,QAAQ,GAAG,IAAAC,kCAAW,EAAa,CAAC,CAAC,CAAC;AAC5C,MAAMC,aAAa,GAAG,IAAAD,kCAAW,EAAgB,IAAI,CAAC;AAEtD,SAASE,SAASA,CACjBC,QAAgB,EAChBC,OAAe,EACfC,MAAiC,GAAG,IAAI,EACxCC,MAAkB,GAAG,CAAC,CAAC,EACtB;EACD,SAAS;;EACTP,QAAQ,CAACQ,MAAM,CAAEC,KAAU,IAAK;IAC/B,SAAS;;IACT,IAAI,CAACA,KAAK,CAACL,QAAQ,CAAC,EAAE;MACrBK,KAAK,CAACL,QAAQ,CAAC,GAAG,CAAC,CAAC;IACrB;IACAK,KAAK,CAACL,QAAQ,CAAC,CAACC,OAAO,CAAC,GAAG;MAAEC,MAAM;MAAEC;IAAO,CAAC;IAE7C,OAAOE,KAAK;EACb,CAAC,CAAC;AACH;AAEA,SAASC,SAASA,CAACN,QAAgB,EAAE;EACpC,SAAS;;EACT,OAAOJ,QAAQ,CAACW,KAAK,CAACP,QAAQ,CAAC,IAAI,CAAC,CAAC;AACtC;AAEA,SAASQ,gBAAgBA,CAACP,OAAe,EAAE;EAC1C,SAAS;;EACTH,aAAa,CAACS,KAAK,GAAGN,OAAO;AAC9B;AAEA,SAASQ,gBAAgBA,CAAA,EAAG;EAC3B,SAAS;;EACT,OAAOX,aAAa,CAACS,KAAK;AAC3B;AAEA,SAASG,KAAKA,CAACC,QAAmB,EAAE;EACnC,SAAS;;EACTf,QAAQ,CAACQ,MAAM,CAAEC,KAAU,IAAK;IAC/B,SAAS;;IACT,OAAOA,KAAK,CAACM,QAAQ,CAAC;IACtB,OAAON,KAAK;EACb,CAAC,CAAC;AACH;AAEA,SAASO,WAAWA,CAAA,EAAG;EACtB,SAAS;;EACTd,aAAa,CAACS,KAAK,GAAG,IAAI;AAC3B;AAEO,MAAMM,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAG;EACrBd,SAAS;EACTO,SAAS;EACTE,gBAAgB;EAChBC,gBAAgB;EAChBC,KAAK;EACLE;AACD,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Gestures = void 0;
|
|
7
|
+
var _reactNativeReanimated = require("react-native-reanimated");
|
|
8
|
+
const store = {};
|
|
9
|
+
function ensure(routeKey) {
|
|
10
|
+
let bag = store[routeKey];
|
|
11
|
+
if (!bag) {
|
|
12
|
+
bag = {
|
|
13
|
+
x: (0, _reactNativeReanimated.makeMutable)(0),
|
|
14
|
+
y: (0, _reactNativeReanimated.makeMutable)(0),
|
|
15
|
+
normalizedX: (0, _reactNativeReanimated.makeMutable)(0),
|
|
16
|
+
normalizedY: (0, _reactNativeReanimated.makeMutable)(0),
|
|
17
|
+
isDismissing: (0, _reactNativeReanimated.makeMutable)(0),
|
|
18
|
+
isDragging: (0, _reactNativeReanimated.makeMutable)(0)
|
|
19
|
+
};
|
|
20
|
+
store[routeKey] = bag;
|
|
21
|
+
}
|
|
22
|
+
return bag;
|
|
23
|
+
}
|
|
24
|
+
function getGesture(routeKey, gestureKey) {
|
|
25
|
+
return ensure(routeKey)[gestureKey];
|
|
26
|
+
}
|
|
27
|
+
function getRouteGestures(routeKey) {
|
|
28
|
+
return ensure(routeKey);
|
|
29
|
+
}
|
|
30
|
+
function clear(routeKey) {
|
|
31
|
+
delete store[routeKey];
|
|
32
|
+
}
|
|
33
|
+
const Gestures = exports.Gestures = {
|
|
34
|
+
getGesture,
|
|
35
|
+
getRouteGestures,
|
|
36
|
+
clear
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=gestures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNativeReanimated","require","store","ensure","routeKey","bag","x","makeMutable","y","normalizedX","normalizedY","isDismissing","isDragging","getGesture","gestureKey","getRouteGestures","clear","Gestures","exports"],"sourceRoot":"../../../src","sources":["stores/gestures.ts"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAoBA,MAAMC,KAAoC,GAAG,CAAC,CAAC;AAE/C,SAASC,MAAMA,CAACC,QAAmB,EAAc;EAChD,IAAIC,GAAG,GAAGH,KAAK,CAACE,QAAQ,CAAC;EACzB,IAAI,CAACC,GAAG,EAAE;IACTA,GAAG,GAAG;MACLC,CAAC,EAAE,IAAAC,kCAAW,EAAC,CAAC,CAAC;MACjBC,CAAC,EAAE,IAAAD,kCAAW,EAAC,CAAC,CAAC;MACjBE,WAAW,EAAE,IAAAF,kCAAW,EAAC,CAAC,CAAC;MAC3BG,WAAW,EAAE,IAAAH,kCAAW,EAAC,CAAC,CAAC;MAC3BI,YAAY,EAAE,IAAAJ,kCAAW,EAAC,CAAC,CAAC;MAC5BK,UAAU,EAAE,IAAAL,kCAAW,EAAC,CAAC;IAC1B,CAAC;IACDL,KAAK,CAACE,QAAQ,CAAC,GAAGC,GAAG;EACtB;EACA,OAAOA,GAAG;AACX;AAEA,SAASQ,UAAUA,CAACT,QAAmB,EAAEU,UAAsB,EAAE;EAChE,OAAOX,MAAM,CAACC,QAAQ,CAAC,CAACU,UAAU,CAAC;AACpC;AAEA,SAASC,gBAAgBA,CAACX,QAAmB,EAAE;EAC9C,OAAOD,MAAM,CAACC,QAAQ,CAAC;AACxB;AAEA,SAASY,KAAKA,CAACZ,QAAmB,EAAE;EACnC,OAAOF,KAAK,CAACE,QAAQ,CAAC;AACvB;AAEO,MAAMa,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAG;EACvBJ,UAAU;EACVE,gBAAgB;EAChBC;AACD,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.NavigatorDismissState = void 0;
|
|
7
|
+
const map = new Map();
|
|
8
|
+
const NavigatorDismissState = exports.NavigatorDismissState = {
|
|
9
|
+
get(id) {
|
|
10
|
+
if (!id) return false;
|
|
11
|
+
return map.get(id) === true;
|
|
12
|
+
},
|
|
13
|
+
set(id, val) {
|
|
14
|
+
map.set(id, !!val);
|
|
15
|
+
},
|
|
16
|
+
remove(id) {
|
|
17
|
+
map.delete(id);
|
|
18
|
+
},
|
|
19
|
+
clear() {
|
|
20
|
+
map.clear();
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=navigator-dismiss-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["map","Map","NavigatorDismissState","exports","get","id","set","val","remove","delete","clear"],"sourceRoot":"../../../src","sources":["stores/navigator-dismiss-state.ts"],"mappings":";;;;;;AAAA,MAAMA,GAAG,GAAG,IAAIC,GAAG,CAAkB,CAAC;AAE/B,MAAMC,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG;EACpCE,GAAGA,CAACC,EAAsB,EAAW;IACpC,IAAI,CAACA,EAAE,EAAE,OAAO,KAAK;IACrB,OAAOL,GAAG,CAACI,GAAG,CAACC,EAAE,CAAC,KAAK,IAAI;EAC5B,CAAC;EACDC,GAAGA,CAACD,EAAU,EAAEE,GAAY,EAAE;IAC7BP,GAAG,CAACM,GAAG,CAACD,EAAE,EAAE,CAAC,CAACE,GAAG,CAAC;EACnB,CAAC;EACDC,MAAMA,CAACH,EAAU,EAAE;IAClBL,GAAG,CAACS,MAAM,CAACJ,EAAE,CAAC;EACf,CAAC;EACDK,KAAKA,CAAA,EAAG;IACPV,GAAG,CAACU,KAAK,CAAC,CAAC;EACZ;AACD,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.resetStoresForScreen = void 0;
|
|
7
|
+
var _animations = require("../animations");
|
|
8
|
+
var _bounds = require("../bounds");
|
|
9
|
+
var _gestures = require("../gestures");
|
|
10
|
+
/**
|
|
11
|
+
* Reset all stores for a given screen
|
|
12
|
+
*/
|
|
13
|
+
const resetStoresForScreen = current => {
|
|
14
|
+
_animations.Animations.clear(current.route.key);
|
|
15
|
+
_gestures.Gestures.clear(current.route.key);
|
|
16
|
+
_bounds.Bounds.clear(current.route.key);
|
|
17
|
+
_bounds.Bounds.clearActive();
|
|
18
|
+
};
|
|
19
|
+
exports.resetStoresForScreen = resetStoresForScreen;
|
|
20
|
+
//# sourceMappingURL=reset-stores-for-screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_animations","require","_bounds","_gestures","resetStoresForScreen","current","Animations","clear","route","key","Gestures","Bounds","clearActive","exports"],"sourceRoot":"../../../../src","sources":["stores/utils/reset-stores-for-screen.ts"],"mappings":";;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAEA;AACA;AACA;AACO,MAAMG,oBAAoB,GAAIC,OAA8B,IAAK;EACvEC,sBAAU,CAACC,KAAK,CAACF,OAAO,CAACG,KAAK,CAACC,GAAG,CAAC;EACnCC,kBAAQ,CAACH,KAAK,CAACF,OAAO,CAACG,KAAK,CAACC,GAAG,CAAC;EACjCE,cAAM,CAACJ,KAAK,CAACF,OAAO,CAACG,KAAK,CAACC,GAAG,CAAC;EAC/BE,cAAM,CAACC,WAAW,CAAC,CAAC;AACrB,CAAC;AAACC,OAAA,CAAAT,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/animation.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/bounds.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/core.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/gesture.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/navigator.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/utils.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.animate = void 0;
|
|
7
|
+
var _reactNativeReanimated = require("react-native-reanimated");
|
|
8
|
+
const animate = (toValue, config, callback) => {
|
|
9
|
+
"worklet";
|
|
10
|
+
|
|
11
|
+
const isSpring = typeof config === "object" && !("duration" in config) && !("easing" in config);
|
|
12
|
+
if (!isSpring) {
|
|
13
|
+
return (0, _reactNativeReanimated.withTiming)(toValue, config, callback);
|
|
14
|
+
}
|
|
15
|
+
return (0, _reactNativeReanimated.withSpring)(toValue, config, callback);
|
|
16
|
+
};
|
|
17
|
+
exports.animate = animate;
|
|
18
|
+
//# sourceMappingURL=animate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNativeReanimated","require","animate","toValue","config","callback","isSpring","withTiming","withSpring","exports"],"sourceRoot":"../../../../src","sources":["utils/animation/animate.ts"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAWO,MAAMC,OAAO,GAAGA,CACtBC,OAAU,EACVC,MAA4C,EAC5CC,QAA4B,KACxB;EACJ,SAAS;;EACT,MAAMC,QAAQ,GACb,OAAOF,MAAM,KAAK,QAAQ,IAC1B,EAAE,UAAU,IAAIA,MAAM,CAAC,IACvB,EAAE,QAAQ,IAAIA,MAAM,CAAC;EAEtB,IAAI,CAACE,QAAQ,EAAE;IACd,OAAO,IAAAC,iCAAU,EAACJ,OAAO,EAAEC,MAAM,EAAEC,QAAQ,CAAC;EAC7C;EAEA,OAAO,IAAAG,iCAAU,EAACL,OAAO,EAAEC,MAAM,EAAEC,QAAQ,CAAC;AAC7C,CAAC;AAACI,OAAA,CAAAP,OAAA,GAAAA,OAAA","ignoreList":[]}
|