react-native-screen-transitions 1.2.0 → 2.0.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/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,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.composeContentStyle = composeContentStyle;
|
|
7
|
+
exports.composeSizeAbsolute = composeSizeAbsolute;
|
|
8
|
+
exports.composeSizeRelative = composeSizeRelative;
|
|
9
|
+
exports.composeTransformAbsolute = composeTransformAbsolute;
|
|
10
|
+
exports.composeTransformRelative = composeTransformRelative;
|
|
11
|
+
/**
|
|
12
|
+
* Common interpolation helper signature used by composers.
|
|
13
|
+
* It maps from a -> b over the already-determined progress range.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Element-level (relative) params shared by size/transform composers.
|
|
18
|
+
* - start/end: absolute window bounds of the element in previous/next phases
|
|
19
|
+
* - geometry: relative deltas and scales between start/end (dx, dy, scaleX, scaleY, ...)
|
|
20
|
+
* - interp: function to interpolate between numbers using the correct progress range
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Screen-level content transform params (for aligning destination bound to source).
|
|
25
|
+
* - start/end: absolute window bounds for the shared id (source/destination)
|
|
26
|
+
* - geometry: precomputed screen-level tx/ty/sx/sy plus ranges/entering
|
|
27
|
+
* - interp: function to interpolate between numbers using the correct progress range
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
function composeSizeAbsolute(params) {
|
|
31
|
+
"worklet";
|
|
32
|
+
|
|
33
|
+
const {
|
|
34
|
+
start,
|
|
35
|
+
end,
|
|
36
|
+
geometry,
|
|
37
|
+
interp
|
|
38
|
+
} = params;
|
|
39
|
+
if (geometry.entering) {
|
|
40
|
+
return {
|
|
41
|
+
width: interp(start.width, end.width),
|
|
42
|
+
height: interp(start.height, end.height),
|
|
43
|
+
transform: [{
|
|
44
|
+
translateX: interp(start.pageX, end.pageX)
|
|
45
|
+
}, {
|
|
46
|
+
translateY: interp(start.pageY, end.pageY)
|
|
47
|
+
}]
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
width: interp(end.width, start.width),
|
|
52
|
+
height: interp(end.height, start.height),
|
|
53
|
+
transform: [{
|
|
54
|
+
translateX: interp(end.pageX, start.pageX)
|
|
55
|
+
}, {
|
|
56
|
+
translateY: interp(end.pageY, start.pageY)
|
|
57
|
+
}]
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function composeSizeRelative(params) {
|
|
61
|
+
"worklet";
|
|
62
|
+
|
|
63
|
+
const {
|
|
64
|
+
start,
|
|
65
|
+
end,
|
|
66
|
+
geometry,
|
|
67
|
+
interp
|
|
68
|
+
} = params;
|
|
69
|
+
if (geometry.entering) {
|
|
70
|
+
return {
|
|
71
|
+
transform: [{
|
|
72
|
+
translateX: interp(geometry.dx, 0)
|
|
73
|
+
}, {
|
|
74
|
+
translateY: interp(geometry.dy, 0)
|
|
75
|
+
}],
|
|
76
|
+
width: interp(start.width, end.width),
|
|
77
|
+
height: interp(start.height, end.height)
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
transform: [{
|
|
82
|
+
translateX: interp(0, -geometry.dx)
|
|
83
|
+
}, {
|
|
84
|
+
translateY: interp(0, -geometry.dy)
|
|
85
|
+
}],
|
|
86
|
+
width: interp(end.width, start.width),
|
|
87
|
+
height: interp(end.height, start.height)
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function composeTransformAbsolute(params) {
|
|
91
|
+
"worklet";
|
|
92
|
+
|
|
93
|
+
const {
|
|
94
|
+
start,
|
|
95
|
+
end,
|
|
96
|
+
geometry,
|
|
97
|
+
interp
|
|
98
|
+
} = params;
|
|
99
|
+
if (geometry.entering) {
|
|
100
|
+
return {
|
|
101
|
+
transform: [{
|
|
102
|
+
translateX: interp(start.pageX, end.pageX)
|
|
103
|
+
}, {
|
|
104
|
+
translateY: interp(start.pageY, end.pageY)
|
|
105
|
+
}, {
|
|
106
|
+
scaleX: interp(geometry.scaleX, 1)
|
|
107
|
+
}, {
|
|
108
|
+
scaleY: interp(geometry.scaleY, 1)
|
|
109
|
+
}]
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
transform: [{
|
|
114
|
+
translateX: interp(end.pageX, start.pageX)
|
|
115
|
+
}, {
|
|
116
|
+
translateY: interp(end.pageY, start.pageY)
|
|
117
|
+
}, {
|
|
118
|
+
scaleX: interp(1, 1 / geometry.scaleX)
|
|
119
|
+
}, {
|
|
120
|
+
scaleY: interp(1, 1 / geometry.scaleY)
|
|
121
|
+
}]
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
function composeTransformRelative(params) {
|
|
125
|
+
"worklet";
|
|
126
|
+
|
|
127
|
+
const {
|
|
128
|
+
geometry,
|
|
129
|
+
computeOptions,
|
|
130
|
+
interp
|
|
131
|
+
} = params;
|
|
132
|
+
if (geometry.entering) {
|
|
133
|
+
return {
|
|
134
|
+
transform: [{
|
|
135
|
+
translateX: computeOptions.gestures?.x ?? 0
|
|
136
|
+
}, {
|
|
137
|
+
translateY: computeOptions.gestures?.y ?? 0
|
|
138
|
+
}, {
|
|
139
|
+
translateX: interp(geometry.dx, 0)
|
|
140
|
+
}, {
|
|
141
|
+
translateY: interp(geometry.dy, 0)
|
|
142
|
+
}, {
|
|
143
|
+
scaleX: interp(geometry.scaleX, 1)
|
|
144
|
+
}, {
|
|
145
|
+
scaleY: interp(geometry.scaleY, 1)
|
|
146
|
+
}]
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
transform: [{
|
|
151
|
+
translateX: computeOptions.gestures?.x ?? 0
|
|
152
|
+
}, {
|
|
153
|
+
translateY: computeOptions.gestures?.y ?? 0
|
|
154
|
+
}, {
|
|
155
|
+
translateX: interp(0, -geometry.dx)
|
|
156
|
+
}, {
|
|
157
|
+
translateY: interp(0, -geometry.dy)
|
|
158
|
+
}, {
|
|
159
|
+
scaleX: interp(1, 1 / geometry.scaleX)
|
|
160
|
+
}, {
|
|
161
|
+
scaleY: interp(1, 1 / geometry.scaleY)
|
|
162
|
+
}]
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
function composeContentStyle(params) {
|
|
166
|
+
"worklet";
|
|
167
|
+
|
|
168
|
+
const {
|
|
169
|
+
geometry,
|
|
170
|
+
interp
|
|
171
|
+
} = params;
|
|
172
|
+
const {
|
|
173
|
+
s,
|
|
174
|
+
tx,
|
|
175
|
+
ty,
|
|
176
|
+
entering
|
|
177
|
+
} = geometry;
|
|
178
|
+
if (entering) {
|
|
179
|
+
return {
|
|
180
|
+
transform: [{
|
|
181
|
+
translateX: interp(tx, 0)
|
|
182
|
+
}, {
|
|
183
|
+
translateY: interp(ty, 0)
|
|
184
|
+
}, {
|
|
185
|
+
scale: interp(s, 1)
|
|
186
|
+
}]
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
return {
|
|
190
|
+
transform: [{
|
|
191
|
+
translateX: interp(0, tx)
|
|
192
|
+
}, {
|
|
193
|
+
translateY: interp(0, ty)
|
|
194
|
+
}, {
|
|
195
|
+
scale: interp(1, s)
|
|
196
|
+
}]
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
//# sourceMappingURL=style-composers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["composeSizeAbsolute","params","start","end","geometry","interp","entering","width","height","transform","translateX","pageX","translateY","pageY","composeSizeRelative","dx","dy","composeTransformAbsolute","scaleX","scaleY","composeTransformRelative","computeOptions","gestures","x","y","composeContentStyle","s","tx","ty","scale"],"sourceRoot":"../../../../src","sources":["utils/bounds/style-composers.ts"],"mappings":";;;;;;;;;;AAOA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;;AASO,SAASA,mBAAmBA,CAACC,MAA4B,EAAc;EAC7E,SAAS;;EACT,MAAM;IAAEC,KAAK;IAAEC,GAAG;IAAEC,QAAQ;IAAEC;EAAO,CAAC,GAAGJ,MAAM;EAE/C,IAAIG,QAAQ,CAACE,QAAQ,EAAE;IACtB,OAAO;MACNC,KAAK,EAAEF,MAAM,CAACH,KAAK,CAACK,KAAK,EAAEJ,GAAG,CAACI,KAAK,CAAC;MACrCC,MAAM,EAAEH,MAAM,CAACH,KAAK,CAACM,MAAM,EAAEL,GAAG,CAACK,MAAM,CAAC;MACxCC,SAAS,EAAE,CACV;QAAEC,UAAU,EAAEL,MAAM,CAACH,KAAK,CAACS,KAAK,EAAER,GAAG,CAACQ,KAAK;MAAE,CAAC,EAC9C;QAAEC,UAAU,EAAEP,MAAM,CAACH,KAAK,CAACW,KAAK,EAAEV,GAAG,CAACU,KAAK;MAAE,CAAC;IAEhD,CAAC;EACF;EAEA,OAAO;IACNN,KAAK,E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MAAM;EACnC,MAAM;IAAEyB,CAAC;IAAEC,EAAE;IAAEC,EAAE;IAAEtB;EAAS,CAAC,GAAGF,QAAQ;EAExC,IAAIE,QAAQ,EAAE;IACb,OAAO;MACNG,SAAS,EAAE,CACV;QAAEC,UAAU,EAAEL,MAAM,CAACsB,EAAE,EAAE,CAAC;MAAE,CAAC,EAC7B;QAAEf,UAAU,EAAEP,MAAM,CAACuB,EAAE,EAAE,CAAC;MAAE,CAAC,EAC7B;QAAEC,KAAK,EAAExB,MAAM,CAACqB,CAAC,EAAE,CAAC;MAAE,CAAC;IAEzB,CAAC;EACF;EAEA,OAAO;IACNjB,SAAS,EAAE,CACV;MAAEC,UAAU,EAAEL,MAAM,CAAC,CAAC,EAAEsB,EAAE;IAAE,CAAC,EAC7B;MAAEf,UAAU,EAAEP,MAAM,CAAC,CAAC,EAAEuB,EAAE;IAAE,CAAC,EAC7B;MAAEC,KAAK,EAAExB,MAAM,CAAC,CAAC,EAAEqB,CAAC;IAAE,CAAC;EAEzB,CAAC;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.applyGestureActivationCriteria = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* rngh requires this type instead a number[]. We're returning a num[] which is still correct, this is just to remove the type error.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const applyGestureActivationCriteria = ({
|
|
12
|
+
gestureDirection,
|
|
13
|
+
gestureResponseDistance,
|
|
14
|
+
panGesture
|
|
15
|
+
}) => {
|
|
16
|
+
const directions = Array.isArray(gestureDirection) ? gestureDirection : [gestureDirection];
|
|
17
|
+
if (directions.includes("bidirectional")) {
|
|
18
|
+
return {
|
|
19
|
+
activeOffsetX: [-gestureResponseDistance, gestureResponseDistance],
|
|
20
|
+
activeOffsetY: [-gestureResponseDistance, gestureResponseDistance]
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const allowedDown = directions.includes("vertical");
|
|
24
|
+
const allowedUp = directions.includes("vertical-inverted");
|
|
25
|
+
const allowedRight = directions.includes("horizontal");
|
|
26
|
+
const allowedLeft = directions.includes("horizontal-inverted");
|
|
27
|
+
const toleranceX = 15;
|
|
28
|
+
const toleranceY = 20;
|
|
29
|
+
const dist = gestureResponseDistance;
|
|
30
|
+
const result = {};
|
|
31
|
+
const hasHorizontal = allowedLeft || allowedRight;
|
|
32
|
+
if (hasHorizontal) {
|
|
33
|
+
if (allowedLeft && allowedRight) {
|
|
34
|
+
result.activeOffsetX = [-dist, dist];
|
|
35
|
+
} else if (allowedLeft) {
|
|
36
|
+
result.activeOffsetX = -dist;
|
|
37
|
+
} else if (allowedRight) {
|
|
38
|
+
result.activeOffsetX = dist;
|
|
39
|
+
}
|
|
40
|
+
if (allowedRight && !allowedLeft) {
|
|
41
|
+
result.failOffsetX = -dist;
|
|
42
|
+
} else if (allowedLeft && !allowedRight) {
|
|
43
|
+
result.failOffsetX = dist;
|
|
44
|
+
}
|
|
45
|
+
} else {
|
|
46
|
+
result.failOffsetX = [-toleranceX, toleranceX];
|
|
47
|
+
}
|
|
48
|
+
const hasVertical = allowedUp || allowedDown;
|
|
49
|
+
if (hasVertical) {
|
|
50
|
+
if (allowedUp && allowedDown) {
|
|
51
|
+
result.activeOffsetY = [-dist, dist];
|
|
52
|
+
} else if (allowedUp) {
|
|
53
|
+
result.activeOffsetY = -dist;
|
|
54
|
+
} else if (allowedDown) {
|
|
55
|
+
result.activeOffsetY = dist;
|
|
56
|
+
}
|
|
57
|
+
if (allowedDown && !allowedUp) {
|
|
58
|
+
result.failOffsetY = -dist;
|
|
59
|
+
} else if (allowedUp && !allowedDown) {
|
|
60
|
+
result.failOffsetY = dist;
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
result.failOffsetY = [-toleranceY, toleranceY];
|
|
64
|
+
}
|
|
65
|
+
if (result?.activeOffsetX) {
|
|
66
|
+
panGesture.activeOffsetX(result.activeOffsetX);
|
|
67
|
+
}
|
|
68
|
+
if (result?.activeOffsetY) {
|
|
69
|
+
panGesture.activeOffsetY(result.activeOffsetY);
|
|
70
|
+
}
|
|
71
|
+
if (result?.failOffsetX) {
|
|
72
|
+
panGesture.failOffsetX(result.failOffsetX);
|
|
73
|
+
}
|
|
74
|
+
if (result?.failOffsetY) {
|
|
75
|
+
panGesture.failOffsetY(result.failOffsetY);
|
|
76
|
+
}
|
|
77
|
+
panGesture.enableTrackpadTwoFingerGesture(true);
|
|
78
|
+
return panGesture;
|
|
79
|
+
};
|
|
80
|
+
exports.applyGestureActivationCriteria = applyGestureActivationCriteria;
|
|
81
|
+
//# sourceMappingURL=apply-gesture-activation-criteria.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["applyGestureActivationCriteria","gestureDirection","gestureResponseDistance","panGesture","directions","Array","isArray","includes","activeOffsetX","activeOffsetY","allowedDown","allowedUp","allowedRight","allowedLeft","toleranceX","toleranceY","dist","result","hasHorizontal","failOffsetX","hasVertical","failOffsetY","enableTrackpadTwoFingerGesture","exports"],"sourceRoot":"../../../../src","sources":["utils/gesture/apply-gesture-activation-criteria.ts"],"mappings":";;;;;;AAWA;AACA;AACA;;AAGO,MAAMA,8BAA8B,GAAGA,CAAC;EAC9CC,gBAAgB;EAChBC,uBAAuB;EACvBC;AACyB,CAAC,KAAK;EAC/B,MAAMC,UAAU,GAAGC,KAAK,CAACC,OAAO,CAACL,gBAAgB,CAAC,GAC/CA,gBAAgB,GAChB,CAACA,gBAAgB,CAAC;EAErB,IAAIG,UAAU,CAACG,QAAQ,CAAC,eAAe,CAAC,EAAE;IACzC,OAAO;MACNC,aAAa,EAAE,CACd,CAACN,uBAAuB,EACxBA,uBAAuB,CACE;MAC1BO,aAAa,EAAE,CACd,CAACP,uBAAuB,EACxBA,uBAAuB;IAEzB,CAAC;EACF;EAEA,MAAMQ,WAAW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AM,CAACR,aAAa,GAAG,CAACO,IAAI;IAC7B,CAAC,MAAM,IAAIN,WAAW,EAAE;MACvBO,MAAM,CAACR,aAAa,GAAGO,IAAI;IAC5B;IAEA,IAAIN,WAAW,IAAI,CAACC,SAAS,EAAE;MAC9BM,MAAM,CAACI,WAAW,GAAG,CAACL,IAAI;IAC3B,CAAC,MAAM,IAAIL,SAAS,IAAI,CAACD,WAAW,EAAE;MACrCO,MAAM,CAACI,WAAW,GAAGL,IAAI;IAC1B;EACD,CAAC,MAAM;IACNC,MAAM,CAACI,WAAW,GAAG,CAAC,CAACN,UAAU,EAAEA,UAAU,CAA0B;EACxE;EAEA,IAAIE,MAAM,EAAET,aAAa,EAAE;IAC1BL,UAAU,CAACK,aAAa,CAACS,MAAM,CAACT,aAAa,CAAC;EAC/C;EACA,IAAIS,MAAM,EAAER,aAAa,EAAE;IAC1BN,UAAU,CAACM,aAAa,CAACQ,MAAM,CAACR,aAAa,CAAC;EAC/C;EACA,IAAIQ,MAAM,EAAEE,WAAW,EAAE;IACxBhB,UAAU,CAACgB,WAAW,CAACF,MAAM,CAACE,WAAW,CAAC;EAC3C;EACA,IAAIF,MAAM,EAAEI,WAAW,EAAE;IACxBlB,UAAU,CAACkB,WAAW,CAACJ,MAAM,CAACI,WAAW,CAAC;EAC3C;EAEAlB,UAAU,CAACmB,8BAA8B,CAAC,IAAI,CAAC;EAE/C,OAAOnB,UAAU;AAClB,CAAC;AAACoB,OAAA,CAAAvB,8BAAA,GAAAA,8BAAA","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.mapGestureToProgress = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Utility function to map raw gesture translation to a progress value.
|
|
9
|
+
*/
|
|
10
|
+
const mapGestureToProgress = (translation, dimension) => {
|
|
11
|
+
"worklet";
|
|
12
|
+
|
|
13
|
+
const rawProgress = translation / dimension;
|
|
14
|
+
return Math.max(0, Math.min(1, rawProgress));
|
|
15
|
+
};
|
|
16
|
+
exports.mapGestureToProgress = mapGestureToProgress;
|
|
17
|
+
//# sourceMappingURL=map-gesture-to-progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["mapGestureToProgress","translation","dimension","rawProgress","Math","max","min","exports"],"sourceRoot":"../../../../src","sources":["utils/gesture/map-gesture-to-progress.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACO,MAAMA,oBAAoB,GAAGA,CACnCC,WAAmB,EACnBC,SAAiB,KACb;EACJ,SAAS;;EACT,MAAMC,WAAW,GAAGF,WAAW,GAAGC,SAAS;EAC3C,OAAOE,IAAI,CAACC,GAAG,CAAC,CAAC,EAAED,IAAI,CAACE,GAAG,CAAC,CAAC,EAAEH,WAAW,CAAC,CAAC;AAC7C,CAAC;AAACI,OAAA,CAAAP,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.normalizeGestureTranslation = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Utility function to normalize gesture translation based on direction.
|
|
9
|
+
*/
|
|
10
|
+
const normalizeGestureTranslation = (translation, gestureDirection) => {
|
|
11
|
+
"worklet";
|
|
12
|
+
|
|
13
|
+
const isInverted = gestureDirection.includes("inverted");
|
|
14
|
+
const translated = Math.abs(translation) * (isInverted ? -1 : 1);
|
|
15
|
+
if (isInverted) {
|
|
16
|
+
return Math.min(0, translated);
|
|
17
|
+
}
|
|
18
|
+
return Math.max(0, translated);
|
|
19
|
+
};
|
|
20
|
+
exports.normalizeGestureTranslation = normalizeGestureTranslation;
|
|
21
|
+
//# sourceMappingURL=normalize-gesture-translation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["normalizeGestureTranslation","translation","gestureDirection","isInverted","includes","translated","Math","abs","min","max","exports"],"sourceRoot":"../../../../src","sources":["utils/gesture/normalize-gesture-translation.ts"],"mappings":";;;;;;AAEA;AACA;AACA;AACO,MAAMA,2BAA2B,GAAGA,CAC1CC,WAAmB,EACnBC,gBAAkC,KAC9B;EACJ,SAAS;;EACT,MAAMC,UAAU,GAAGD,gBAAgB,CAACE,QAAQ,CAAC,UAAU,CAAC;EAExD,MAAMC,UAAU,GAAGC,IAAI,CAACC,GAAG,CAACN,WAAW,CAAC,IAAIE,UAAU,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;EAEhE,IAAIA,UAAU,EAAE;IACf,OAAOG,IAAI,CAACE,GAAG,CAAC,CAAC,EAAEH,UAAU,CAAC;EAC/B;EAEA,OAAOC,IAAI,CAACG,GAAG,CAAC,CAAC,EAAEJ,UAAU,CAAC;AAC/B,CAAC;AAACK,OAAA,CAAAV,2BAAA,GAAAA,2BAAA","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _animate = require("./animation/animate");
|
|
7
|
+
Object.keys(_animate).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _animate[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _animate[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_animate","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":";;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,QAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,QAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,QAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { describe, expect, it } from "bun:test";
|
|
4
|
+
import { computeContentTransformGeometry, computeRelativeGeometry } from "../utils/bounds/geometry";
|
|
5
|
+
describe("computeRelativeGeometry", () => {
|
|
6
|
+
it("calculates correct relative geometry when entering", () => {
|
|
7
|
+
const start = {
|
|
8
|
+
x: 10,
|
|
9
|
+
y: 20,
|
|
10
|
+
pageX: 10,
|
|
11
|
+
pageY: 20,
|
|
12
|
+
width: 100,
|
|
13
|
+
height: 200
|
|
14
|
+
};
|
|
15
|
+
const end = {
|
|
16
|
+
x: 50,
|
|
17
|
+
y: 100,
|
|
18
|
+
pageX: 50,
|
|
19
|
+
pageY: 100,
|
|
20
|
+
width: 200,
|
|
21
|
+
height: 400
|
|
22
|
+
};
|
|
23
|
+
const result = computeRelativeGeometry({
|
|
24
|
+
start,
|
|
25
|
+
end,
|
|
26
|
+
entering: true
|
|
27
|
+
});
|
|
28
|
+
expect(result.dx).toBe(-90); // center diff X
|
|
29
|
+
expect(result.dy).toBe(-180); // center diff Y
|
|
30
|
+
expect(result.scaleX).toBe(0.5); // width ratio
|
|
31
|
+
expect(result.scaleY).toBe(0.5); // height ratio
|
|
32
|
+
expect(result.ranges).toEqual([0, 1]);
|
|
33
|
+
expect(result.entering).toBe(true);
|
|
34
|
+
});
|
|
35
|
+
it("calculates correct relative geometry when exiting", () => {
|
|
36
|
+
const start = {
|
|
37
|
+
x: 0,
|
|
38
|
+
y: 0,
|
|
39
|
+
pageX: 10,
|
|
40
|
+
pageY: 20,
|
|
41
|
+
width: 100,
|
|
42
|
+
height: 200
|
|
43
|
+
};
|
|
44
|
+
const end = {
|
|
45
|
+
x: 0,
|
|
46
|
+
y: 0,
|
|
47
|
+
pageX: 50,
|
|
48
|
+
pageY: 100,
|
|
49
|
+
width: 200,
|
|
50
|
+
height: 400
|
|
51
|
+
};
|
|
52
|
+
const result = computeRelativeGeometry({
|
|
53
|
+
start,
|
|
54
|
+
end,
|
|
55
|
+
entering: false
|
|
56
|
+
});
|
|
57
|
+
expect(result.ranges).toEqual([1, 2]);
|
|
58
|
+
expect(result.entering).toBe(false);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
describe("computeContentTransformGeometry", () => {
|
|
62
|
+
const dimensions = {
|
|
63
|
+
width: 375,
|
|
64
|
+
height: 812,
|
|
65
|
+
scale: 1,
|
|
66
|
+
fontScale: 1
|
|
67
|
+
};
|
|
68
|
+
it("calculates transform with aspectFit mode", () => {
|
|
69
|
+
const start = {
|
|
70
|
+
x: 0,
|
|
71
|
+
y: 0,
|
|
72
|
+
pageX: 50,
|
|
73
|
+
pageY: 100,
|
|
74
|
+
width: 100,
|
|
75
|
+
height: 100
|
|
76
|
+
};
|
|
77
|
+
const end = {
|
|
78
|
+
x: 0,
|
|
79
|
+
y: 0,
|
|
80
|
+
pageX: 100,
|
|
81
|
+
pageY: 200,
|
|
82
|
+
width: 200,
|
|
83
|
+
height: 50
|
|
84
|
+
};
|
|
85
|
+
const result = computeContentTransformGeometry({
|
|
86
|
+
start,
|
|
87
|
+
end,
|
|
88
|
+
entering: true,
|
|
89
|
+
dimensions,
|
|
90
|
+
contentScaleMode: "aspectFit"
|
|
91
|
+
});
|
|
92
|
+
expect(result.s).toBe(0.5);
|
|
93
|
+
expect(result.entering).toBe(true);
|
|
94
|
+
expect(result.ranges).toEqual([0, 1]);
|
|
95
|
+
});
|
|
96
|
+
it("calculates transform with aspectFill mode", () => {
|
|
97
|
+
const start = {
|
|
98
|
+
x: 0,
|
|
99
|
+
y: 0,
|
|
100
|
+
pageX: 50,
|
|
101
|
+
pageY: 100,
|
|
102
|
+
width: 100,
|
|
103
|
+
height: 100
|
|
104
|
+
};
|
|
105
|
+
const end = {
|
|
106
|
+
x: 0,
|
|
107
|
+
y: 0,
|
|
108
|
+
pageX: 100,
|
|
109
|
+
pageY: 200,
|
|
110
|
+
width: 200,
|
|
111
|
+
height: 50
|
|
112
|
+
};
|
|
113
|
+
const result = computeContentTransformGeometry({
|
|
114
|
+
start,
|
|
115
|
+
end,
|
|
116
|
+
entering: true,
|
|
117
|
+
dimensions,
|
|
118
|
+
contentScaleMode: "aspectFill"
|
|
119
|
+
});
|
|
120
|
+
expect(result.s).toBe(2);
|
|
121
|
+
});
|
|
122
|
+
it("handles auto mode based on aspect ratio difference", () => {
|
|
123
|
+
const start = {
|
|
124
|
+
x: 0,
|
|
125
|
+
y: 0,
|
|
126
|
+
pageX: 0,
|
|
127
|
+
pageY: 0,
|
|
128
|
+
width: 100,
|
|
129
|
+
height: 100
|
|
130
|
+
};
|
|
131
|
+
const end = {
|
|
132
|
+
x: 0,
|
|
133
|
+
y: 0,
|
|
134
|
+
pageX: 0,
|
|
135
|
+
pageY: 0,
|
|
136
|
+
width: 200,
|
|
137
|
+
height: 195
|
|
138
|
+
};
|
|
139
|
+
const result = computeContentTransformGeometry({
|
|
140
|
+
start,
|
|
141
|
+
end,
|
|
142
|
+
entering: true,
|
|
143
|
+
dimensions,
|
|
144
|
+
contentScaleMode: "auto"
|
|
145
|
+
});
|
|
146
|
+
expect(result.s).toBeCloseTo(0.512, 2);
|
|
147
|
+
});
|
|
148
|
+
it("handles zero dimensions safely", () => {
|
|
149
|
+
const start = {
|
|
150
|
+
x: 0,
|
|
151
|
+
y: 0,
|
|
152
|
+
pageX: 0,
|
|
153
|
+
pageY: 0,
|
|
154
|
+
width: 0,
|
|
155
|
+
height: 100
|
|
156
|
+
};
|
|
157
|
+
const end = {
|
|
158
|
+
x: 0,
|
|
159
|
+
y: 0,
|
|
160
|
+
pageX: 0,
|
|
161
|
+
pageY: 0,
|
|
162
|
+
width: 200,
|
|
163
|
+
height: 200
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
// Should not throw and use safe fallback
|
|
167
|
+
const result = computeContentTransformGeometry({
|
|
168
|
+
start,
|
|
169
|
+
end,
|
|
170
|
+
entering: true,
|
|
171
|
+
dimensions,
|
|
172
|
+
contentScaleMode: "aspectFit"
|
|
173
|
+
});
|
|
174
|
+
expect(result.s).toBeDefined();
|
|
175
|
+
expect(Number.isFinite(result.s)).toBe(true);
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
//# sourceMappingURL=geometry.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["describe","expect","it","computeContentTransformGeometry","computeRelativeGeometry","start","x","y","pageX","pageY","width","height","end","result","entering","dx","toBe","dy","scaleX","scaleY","ranges","toEqual","dimensions","scale","fontScale","contentScaleMode","s","toBeCloseTo","toBeDefined","Number","isFinite"],"sourceRoot":"../../../src","sources":["__tests__ /geometry.test.ts"],"mappings":";;AAAA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,UAAU;AAC/C,SACCC,+BAA+B,EAC/BC,uBAAuB,QACjB,0BAA0B;AAEjCJ,QAAQ,CAAC,yBAAyB,EAAE,MAAM;EACzCE,EAAE,CAAC,oDAAoD,EAAE,MAAM;IAC9D,MAAMG,KAAK,GAAG;MACbC,CAAC,EAAE,EAAE;MACLC,CAAC,EAAE,EAAE;MACLC,KAAK,EAAE,EAAE;MACTC,KAAK,EAAE,EAAE;MACTC,KAAK,EAAE,GAAG;MACVC,MAAM,EAAE;IACT,CAAC;IACD,MAAMC,GAAG,GAAG;MACXN,CAAC,EAAE,EAAE;MACLC,CAAC,EAAE,GA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C,CAACC,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC;EACvC,CAAC,CAAC;EAEFzB,EAAE,CAAC,gCAAgC,EAAE,MAAM;IAC1C,MAAMG,KAAK,GAAG;MAAEC,CAAC,EAAE,CAAC;MAAEC,CAAC,EAAE,CAAC;MAAEC,KAAK,EAAE,CAAC;MAAEC,KAAK,EAAE,CAAC;MAAEC,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAI,CAAC;IACvE,MAAMC,GAAG,GAAG;MAAEN,CAAC,EAAE,CAAC;MAAEC,CAAC,EAAE,CAAC;MAAEC,KAAK,EAAE,CAAC;MAAEC,KAAK,EAAE,CAAC;MAAEC,KAAK,EAAE,GAAG;MAAEC,MAAM,EAAE;IAAI,CAAC;;IAEvE;IACA,MAAME,MAAM,GAAGV,+BAA+B,CAAC;MAC9CE,KAAK;MACLO,GAAG;MACHE,QAAQ,EAAE,IAAI;MACdQ,UAAU;MACVG,gBAAgB,EAAE;IACnB,CAAC,CAAC;IAEFxB,MAAM,CAACY,MAAM,CAACa,CAAC,CAAC,CAACE,WAAW,CAAC,CAAC;IAC9B3B,MAAM,CAAC4B,MAAM,CAACC,QAAQ,CAACjB,MAAM,CAACa,CAAC,CAAC,CAAC,CAACV,IAAI,CAAC,IAAI,CAAC;EAC7C,CAAC,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
|
5
|
+
import { Bounds } from "../stores/bounds";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
export const BoundActivator = ({
|
|
8
|
+
sharedBoundTag,
|
|
9
|
+
children,
|
|
10
|
+
measure
|
|
11
|
+
}) => {
|
|
12
|
+
const tapGesture = useMemo(() => {
|
|
13
|
+
return Gesture.Tap().onStart(() => {
|
|
14
|
+
"worklet";
|
|
15
|
+
|
|
16
|
+
if (sharedBoundTag) {
|
|
17
|
+
Bounds.setActiveBoundId(sharedBoundTag);
|
|
18
|
+
measure();
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}, [sharedBoundTag, measure]);
|
|
22
|
+
if (!sharedBoundTag) return children;
|
|
23
|
+
return /*#__PURE__*/_jsx(GestureDetector, {
|
|
24
|
+
gesture: tapGesture,
|
|
25
|
+
children: children
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=bounds-activator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useMemo","Gesture","GestureDetector","Bounds","jsx","_jsx","BoundActivator","sharedBoundTag","children","measure","tapGesture","Tap","onStart","setActiveBoundId","gesture"],"sourceRoot":"../../../src","sources":["components/bounds-activator.tsx"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,OAAO,EAAEC,eAAe,QAAQ,8BAA8B;AACvE,SAASC,MAAM,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAQ1C,OAAO,MAAMC,cAAc,GAAGA,CAAC;EAC9BC,cAAc;EACdC,QAAQ;EACRC;AACoB,CAAC,KAAK;EAC1B,MAAMC,UAAU,GAAGV,OAAO,CAAC,MAAM;IAChC,OAAOC,OAAO,CAACU,GAAG,CAAC,CAAC,CAACC,OAAO,CAAC,MAAM;MAClC,SAAS;;MACT,IAAIL,cAAc,EAAE;QACnBJ,MAAM,CAACU,gBAAgB,CAACN,cAAc,CAAC;QACvCE,OAAO,CAAC,CAAC;MACV;IACD,CAAC,CAAC;EACH,CAAC,EAAE,CAACF,cAAc,EAAEE,OAAO,CAAC,CAAC;EAE7B,IAAI,CAACF,cAAc,EAAE,OAAOC,QAAQ;EAEpC,oBAAOH,IAAA,CAACH,eAAe;IAACY,OAAO,EAAEJ,UAAW;IAAAF,QAAA,EAAEA;EAAQ,CAAkB,CAAC;AAC1E,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useLayoutEffect } from "react";
|
|
4
|
+
import useStableCallback from "../../hooks/use-stable-callback";
|
|
5
|
+
import { useKeys } from "../../providers/keys";
|
|
6
|
+
import { Animations } from "../../stores/animations";
|
|
7
|
+
import { NavigatorDismissState } from "../../stores/navigator-dismiss-state";
|
|
8
|
+
import { resetStoresForScreen } from "../../stores/utils/reset-stores-for-screen";
|
|
9
|
+
import { runTransition } from "../../utils/animation/run-transition";
|
|
10
|
+
export const ScreenLifecycleController = ({
|
|
11
|
+
children
|
|
12
|
+
}) => {
|
|
13
|
+
const {
|
|
14
|
+
current
|
|
15
|
+
} = useKeys();
|
|
16
|
+
const animations = Animations.getAll(current.route.key);
|
|
17
|
+
const handleBeforeRemove = useStableCallback(e => {
|
|
18
|
+
const key = current.navigation.getParent()?.getState().key;
|
|
19
|
+
const requestedDismissOnNavigator = NavigatorDismissState.get(key);
|
|
20
|
+
|
|
21
|
+
// Don't run e.preventDefault when the dismissal was on the local root
|
|
22
|
+
if (requestedDismissOnNavigator) {
|
|
23
|
+
resetStoresForScreen(current);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Don't run e.preventDefault when this is the first screen of the stack
|
|
28
|
+
if (current.navigation.getState().index === 0) {
|
|
29
|
+
resetStoresForScreen(current);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
e.preventDefault();
|
|
33
|
+
const onFinish = finished => {
|
|
34
|
+
if (finished) {
|
|
35
|
+
resetStoresForScreen(current);
|
|
36
|
+
current.navigation.dispatch(e.data.action);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
runTransition({
|
|
40
|
+
target: "close",
|
|
41
|
+
spec: current.options.transitionSpec,
|
|
42
|
+
onFinish,
|
|
43
|
+
animations
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
const handleInitialize = useStableCallback(() => {
|
|
47
|
+
runTransition({
|
|
48
|
+
target: "open",
|
|
49
|
+
spec: current.options.transitionSpec,
|
|
50
|
+
animations
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
useLayoutEffect(handleInitialize, []);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
const unsubscribe = current.navigation.addListener("beforeRemove", handleBeforeRemove);
|
|
56
|
+
return unsubscribe;
|
|
57
|
+
}, [current.navigation, handleBeforeRemove]);
|
|
58
|
+
return children;
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=screen-lifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useLayoutEffect","useStableCallback","useKeys","Animations","NavigatorDismissState","resetStoresForScreen","runTransition","ScreenLifecycleController","children","current","animations","getAll","route","key","handleBeforeRemove","e","navigation","getParent","getState","requestedDismissOnNavigator","get","index","preventDefault","onFinish","finished","dispatch","data","action","target","spec","options","transitionSpec","handleInitialize","unsubscribe","addListener"],"sourceRoot":"../../../../src","sources":["components/controllers/screen-lifecycle.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,eAAe,QAAQ,OAAO;AAClD,OAAOC,iBAAiB,MAAM,iCAAiC;AAC/D,SAASC,OAAO,QAAQ,sBAAsB;AAC9C,SAASC,UAAU,QAAQ,yBAAyB;AACpD,SAASC,qBAAqB,QAAQ,sCAAsC;AAC5E,SAASC,oBAAoB,QAAQ,4CAA4C;AACjF,SAASC,aAAa,QAAQ,sCAAsC;AAMpE,OAAO,MAAMC,yBAAyB,GAAGA,CAAC;EACzCC;AACqB,CAAC,KAAK;EAC3B,MAAM;IAAEC;EAAQ,CAAC,GAAGP,OAAO,CAAC,CAAC;EAE7B,MAAMQ,UAAU,GAAGP,UAAU,CAACQ,MAAM,CAACF,OAAO,CAACG,KAAK,CAACC,GAAG,CAAC;EAEvD,MAAMC,kBAAkB,GAAGb,iBAAiB,CAAEc,CAAM,IAAK;IACxD,MAAMF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