react-native-screen-transitions 2.0.6 → 2.2.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 +100 -77
- package/lib/commonjs/components/{bounds-activator.js → bound-capture.js} +4 -4
- package/lib/commonjs/components/bound-capture.js.map +1 -0
- package/lib/commonjs/components/controllers/screen-lifecycle.js +18 -4
- package/lib/commonjs/components/controllers/screen-lifecycle.js.map +1 -1
- package/lib/commonjs/components/create-transition-aware-component.js +23 -12
- package/lib/commonjs/components/create-transition-aware-component.js.map +1 -1
- package/lib/commonjs/components/integrations/masked-view.js +52 -0
- package/lib/commonjs/components/integrations/masked-view.js.map +1 -0
- package/lib/commonjs/components/root-transition-aware.js +6 -15
- package/lib/commonjs/components/root-transition-aware.js.map +1 -1
- package/lib/commonjs/configs/index.js +4 -1
- package/lib/commonjs/configs/index.js.map +1 -1
- package/lib/commonjs/configs/presets.js +378 -7
- package/lib/commonjs/configs/presets.js.map +1 -1
- package/lib/commonjs/configs/specs.js +2 -1
- package/lib/commonjs/configs/specs.js.map +1 -1
- package/lib/commonjs/hooks/animation/use-associated-style.js +7 -10
- package/lib/commonjs/hooks/animation/use-associated-style.js.map +1 -1
- package/lib/commonjs/hooks/animation/use-screen-animation.js +37 -37
- package/lib/commonjs/hooks/animation/use-screen-animation.js.map +1 -1
- package/lib/commonjs/hooks/bounds/use-bound-registry.js +64 -0
- package/lib/commonjs/hooks/bounds/use-bound-registry.js.map +1 -0
- package/lib/commonjs/hooks/gestures/use-build-gestures.js +156 -152
- package/lib/commonjs/hooks/gestures/use-build-gestures.js.map +1 -1
- package/lib/commonjs/hooks/gestures/use-parent-gesture-registry.js +28 -0
- package/lib/commonjs/hooks/gestures/use-parent-gesture-registry.js.map +1 -0
- package/lib/commonjs/hooks/gestures/use-scroll-registry.js +146 -0
- package/lib/commonjs/hooks/gestures/use-scroll-registry.js.map +1 -0
- package/lib/commonjs/index.js +3 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/integrations/native-stack/views/NativeStackView.native.js +7 -4
- package/lib/commonjs/integrations/native-stack/views/NativeStackView.native.js.map +1 -1
- package/lib/commonjs/providers/gestures.js +16 -16
- package/lib/commonjs/providers/gestures.js.map +1 -1
- package/lib/commonjs/providers/transition-styles.js +44 -0
- package/lib/commonjs/providers/transition-styles.js.map +1 -0
- package/lib/commonjs/stores/bounds.js +142 -1
- package/lib/commonjs/stores/bounds.js.map +1 -1
- package/lib/commonjs/stores/utils/reset-stores-for-screen.js +4 -2
- package/lib/commonjs/stores/utils/reset-stores-for-screen.js.map +1 -1
- package/lib/commonjs/types/gesture.js +11 -0
- package/lib/commonjs/types/gesture.js.map +1 -1
- package/lib/commonjs/utils/animation/derivations.js +39 -0
- package/lib/commonjs/utils/animation/derivations.js.map +1 -0
- package/lib/commonjs/utils/animation/run-transition.js +6 -2
- package/lib/commonjs/utils/animation/run-transition.js.map +1 -1
- package/lib/commonjs/utils/bounds/_utils/flatten-styles.js.map +1 -0
- package/lib/commonjs/utils/bounds/_utils/geometry.js +179 -0
- package/lib/commonjs/utils/bounds/_utils/geometry.js.map +1 -0
- package/lib/commonjs/utils/bounds/{get-bounds.js → _utils/get-bounds.js} +7 -9
- package/lib/commonjs/utils/bounds/_utils/get-bounds.js.map +1 -0
- package/lib/commonjs/utils/bounds/_utils/is-bounds-equal.js +19 -0
- package/lib/commonjs/utils/bounds/_utils/is-bounds-equal.js.map +1 -0
- package/lib/commonjs/utils/bounds/_utils/style-composers.js +201 -0
- package/lib/commonjs/utils/bounds/_utils/style-composers.js.map +1 -0
- package/lib/commonjs/utils/bounds/constants.js +14 -3
- package/lib/commonjs/utils/bounds/constants.js.map +1 -1
- package/lib/commonjs/utils/bounds/index.js +210 -17
- package/lib/commonjs/utils/bounds/index.js.map +1 -1
- package/lib/commonjs/utils/gesture/apply-offset-rules.js +233 -0
- package/lib/commonjs/utils/gesture/apply-offset-rules.js.map +1 -0
- package/lib/commonjs/utils/gesture/check-gesture-activation.js +231 -0
- package/lib/commonjs/utils/gesture/check-gesture-activation.js.map +1 -0
- package/lib/commonjs/utils/gesture/determine-dismissal.js +98 -0
- package/lib/commonjs/utils/gesture/determine-dismissal.js.map +1 -0
- package/lib/module/components/{bounds-activator.js → bound-capture.js} +2 -2
- package/lib/module/components/bound-capture.js.map +1 -0
- package/lib/module/components/controllers/screen-lifecycle.js +18 -4
- package/lib/module/components/controllers/screen-lifecycle.js.map +1 -1
- package/lib/module/components/create-transition-aware-component.js +23 -12
- package/lib/module/components/create-transition-aware-component.js.map +1 -1
- package/lib/module/components/integrations/masked-view.js +48 -0
- package/lib/module/components/integrations/masked-view.js.map +1 -0
- package/lib/module/components/root-transition-aware.js +7 -16
- package/lib/module/components/root-transition-aware.js.map +1 -1
- package/lib/module/configs/index.js +6 -3
- package/lib/module/configs/index.js.map +1 -1
- package/lib/module/configs/presets.js +374 -6
- package/lib/module/configs/presets.js.map +1 -1
- package/lib/module/configs/specs.js +2 -1
- package/lib/module/configs/specs.js.map +1 -1
- package/lib/module/hooks/animation/use-associated-style.js +6 -10
- package/lib/module/hooks/animation/use-associated-style.js.map +1 -1
- package/lib/module/hooks/animation/use-screen-animation.js +37 -37
- package/lib/module/hooks/animation/use-screen-animation.js.map +1 -1
- package/lib/module/hooks/bounds/use-bound-registry.js +59 -0
- package/lib/module/hooks/bounds/use-bound-registry.js.map +1 -0
- package/lib/module/hooks/gestures/use-build-gestures.js +156 -153
- package/lib/module/hooks/gestures/use-build-gestures.js.map +1 -1
- package/lib/module/hooks/gestures/use-parent-gesture-registry.js +23 -0
- package/lib/module/hooks/gestures/use-parent-gesture-registry.js.map +1 -0
- package/lib/module/hooks/gestures/use-scroll-registry.js +140 -0
- package/lib/module/hooks/gestures/use-scroll-registry.js.map +1 -0
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/integrations/native-stack/views/NativeStackView.native.js +7 -4
- package/lib/module/integrations/native-stack/views/NativeStackView.native.js.map +1 -1
- package/lib/module/providers/gestures.js +16 -16
- package/lib/module/providers/gestures.js.map +1 -1
- package/lib/module/providers/transition-styles.js +39 -0
- package/lib/module/providers/transition-styles.js.map +1 -0
- package/lib/module/stores/bounds.js +142 -1
- package/lib/module/stores/bounds.js.map +1 -1
- package/lib/module/stores/utils/reset-stores-for-screen.js +4 -2
- package/lib/module/stores/utils/reset-stores-for-screen.js.map +1 -1
- package/lib/module/types/gesture.js +7 -0
- package/lib/module/types/gesture.js.map +1 -1
- package/lib/module/utils/animation/derivations.js +34 -0
- package/lib/module/utils/animation/derivations.js.map +1 -0
- package/lib/module/utils/animation/run-transition.js +6 -2
- package/lib/module/utils/animation/run-transition.js.map +1 -1
- package/lib/module/utils/bounds/_utils/flatten-styles.js.map +1 -0
- package/lib/module/utils/bounds/_utils/geometry.js +174 -0
- package/lib/module/utils/bounds/_utils/geometry.js.map +1 -0
- package/lib/module/utils/bounds/{get-bounds.js → _utils/get-bounds.js} +7 -9
- package/lib/module/utils/bounds/_utils/get-bounds.js.map +1 -0
- package/lib/module/utils/bounds/_utils/is-bounds-equal.js +14 -0
- package/lib/module/utils/bounds/_utils/is-bounds-equal.js.map +1 -0
- package/lib/module/utils/bounds/_utils/style-composers.js +194 -0
- package/lib/module/utils/bounds/_utils/style-composers.js.map +1 -0
- package/lib/module/utils/bounds/constants.js +14 -3
- package/lib/module/utils/bounds/constants.js.map +1 -1
- package/lib/module/utils/bounds/index.js +208 -15
- package/lib/module/utils/bounds/index.js.map +1 -1
- package/lib/module/utils/gesture/apply-offset-rules.js +228 -0
- package/lib/module/utils/gesture/apply-offset-rules.js.map +1 -0
- package/lib/module/utils/gesture/check-gesture-activation.js +226 -0
- package/lib/module/utils/gesture/check-gesture-activation.js.map +1 -0
- package/lib/module/utils/gesture/determine-dismissal.js +93 -0
- package/lib/module/utils/gesture/determine-dismissal.js.map +1 -0
- package/lib/typescript/components/bound-capture.d.ts +8 -0
- package/lib/typescript/components/bound-capture.d.ts.map +1 -0
- package/lib/typescript/components/controllers/screen-lifecycle.d.ts.map +1 -1
- package/lib/typescript/components/create-transition-aware-component.d.ts.map +1 -1
- package/lib/typescript/components/integrations/masked-view.d.ts +6 -0
- package/lib/typescript/components/integrations/masked-view.d.ts.map +1 -0
- package/lib/typescript/components/root-transition-aware.d.ts +3 -3
- package/lib/typescript/components/root-transition-aware.d.ts.map +1 -1
- package/lib/typescript/configs/index.d.ts +3 -0
- package/lib/typescript/configs/index.d.ts.map +1 -1
- package/lib/typescript/configs/presets.d.ts +3 -0
- package/lib/typescript/configs/presets.d.ts.map +1 -1
- package/lib/typescript/configs/specs.d.ts.map +1 -1
- package/lib/typescript/hooks/animation/use-associated-style.d.ts +6 -4
- package/lib/typescript/hooks/animation/use-associated-style.d.ts.map +1 -1
- package/lib/typescript/hooks/animation/use-screen-animation.d.ts.map +1 -1
- package/lib/typescript/hooks/bounds/{use-bound-measurer.d.ts → use-bound-registry.d.ts} +4 -4
- package/lib/typescript/hooks/bounds/{use-bound-measurer.d.ts.map → use-bound-registry.d.ts.map} +1 -1
- package/lib/typescript/hooks/gestures/use-build-gestures.d.ts +6 -5
- package/lib/typescript/hooks/gestures/use-build-gestures.d.ts.map +1 -1
- package/lib/typescript/hooks/gestures/use-parent-gesture-registry.d.ts +6 -0
- package/lib/typescript/hooks/gestures/use-parent-gesture-registry.d.ts.map +1 -0
- package/lib/typescript/hooks/gestures/{use-scroll-progress.d.ts → use-scroll-registry.d.ts} +2 -2
- package/lib/typescript/hooks/gestures/use-scroll-registry.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +17 -8
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/integrations/native-stack/views/NativeStackView.native.d.ts.map +1 -1
- package/lib/typescript/providers/gestures.d.ts +4 -2
- package/lib/typescript/providers/gestures.d.ts.map +1 -1
- package/lib/typescript/providers/transition-styles.d.ts +8 -0
- package/lib/typescript/providers/transition-styles.d.ts.map +1 -0
- package/lib/typescript/stores/bounds.d.ts +11 -0
- package/lib/typescript/stores/bounds.d.ts.map +1 -1
- package/lib/typescript/stores/utils/reset-stores-for-screen.d.ts +3 -1
- package/lib/typescript/stores/utils/reset-stores-for-screen.d.ts.map +1 -1
- package/lib/typescript/types/bounds.d.ts +5 -1
- package/lib/typescript/types/bounds.d.ts.map +1 -1
- package/lib/typescript/types/core.d.ts +8 -0
- package/lib/typescript/types/core.d.ts.map +1 -1
- package/lib/typescript/types/gesture.d.ts +14 -0
- package/lib/typescript/types/gesture.d.ts.map +1 -1
- package/lib/typescript/types/navigator.d.ts +5 -1
- package/lib/typescript/types/navigator.d.ts.map +1 -1
- package/lib/typescript/utils/animation/derivations.d.ts +19 -0
- package/lib/typescript/utils/animation/derivations.d.ts.map +1 -0
- package/lib/typescript/utils/animation/run-transition.d.ts +2 -1
- package/lib/typescript/utils/animation/run-transition.d.ts.map +1 -1
- package/lib/typescript/utils/bounds/_types/builder.d.ts +96 -14
- package/lib/typescript/utils/bounds/_types/builder.d.ts.map +1 -1
- package/lib/typescript/utils/bounds/_types/geometry.d.ts +0 -1
- package/lib/typescript/utils/bounds/_types/geometry.d.ts.map +1 -1
- package/lib/typescript/utils/bounds/_utils/flatten-styles.d.ts.map +1 -0
- package/lib/typescript/utils/bounds/{geometry.d.ts → _utils/geometry.d.ts} +8 -5
- package/lib/typescript/utils/bounds/_utils/geometry.d.ts.map +1 -0
- package/lib/typescript/utils/bounds/_utils/get-bounds.d.ts +4 -0
- package/lib/typescript/utils/bounds/_utils/get-bounds.d.ts.map +1 -0
- package/lib/typescript/utils/bounds/_utils/is-bounds-equal.d.ts +7 -0
- package/lib/typescript/utils/bounds/_utils/is-bounds-equal.d.ts.map +1 -0
- package/lib/typescript/utils/bounds/{style-composers.d.ts → _utils/style-composers.d.ts} +7 -10
- package/lib/typescript/utils/bounds/_utils/style-composers.d.ts.map +1 -0
- package/lib/typescript/utils/bounds/constants.d.ts +5 -5
- package/lib/typescript/utils/bounds/constants.d.ts.map +1 -1
- package/lib/typescript/utils/bounds/index.d.ts +2 -4
- package/lib/typescript/utils/bounds/index.d.ts.map +1 -1
- package/lib/typescript/utils/gesture/apply-offset-rules.d.ts +38 -0
- package/lib/typescript/utils/gesture/apply-offset-rules.d.ts.map +1 -0
- package/lib/typescript/utils/gesture/check-gesture-activation.d.ts +38 -0
- package/lib/typescript/utils/gesture/check-gesture-activation.d.ts.map +1 -0
- package/lib/typescript/utils/gesture/determine-dismissal.d.ts +25 -0
- package/lib/typescript/utils/gesture/determine-dismissal.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/__tests__/geometry.test.ts +15 -12
- package/src/components/{bounds-activator.tsx → bound-capture.tsx} +1 -1
- package/src/components/controllers/screen-lifecycle.tsx +13 -5
- package/src/components/create-transition-aware-component.tsx +34 -13
- package/src/components/integrations/masked-view.tsx +56 -0
- package/src/components/root-transition-aware.tsx +31 -39
- package/src/configs/index.ts +20 -8
- package/src/configs/presets.ts +401 -6
- package/src/configs/specs.ts +1 -0
- package/src/hooks/animation/use-associated-style.tsx +12 -11
- package/src/hooks/animation/use-screen-animation.tsx +48 -49
- package/src/hooks/bounds/{use-bound-measurer.tsx → use-bound-registry.tsx} +24 -20
- package/src/hooks/gestures/use-build-gestures.tsx +193 -228
- package/src/hooks/gestures/use-parent-gesture-registry.tsx +18 -0
- package/src/hooks/gestures/use-scroll-registry.tsx +145 -0
- package/src/index.ts +2 -0
- package/src/integrations/native-stack/views/NativeStackView.native.tsx +8 -5
- package/src/providers/gestures.tsx +19 -22
- package/src/providers/transition-styles.tsx +52 -0
- package/src/stores/bounds.ts +156 -0
- package/src/stores/utils/reset-stores-for-screen.ts +7 -2
- package/src/types/bounds.ts +8 -1
- package/src/types/core.ts +9 -0
- package/src/types/gesture.ts +19 -0
- package/src/types/navigator.ts +5 -1
- package/src/utils/animation/derivations.ts +38 -0
- package/src/utils/animation/run-transition.ts +4 -1
- package/src/utils/bounds/_types/builder.ts +127 -11
- package/src/utils/bounds/_types/geometry.ts +0 -1
- package/src/utils/bounds/_utils/geometry.ts +166 -0
- package/src/utils/bounds/_utils/get-bounds.ts +54 -0
- package/src/utils/bounds/_utils/is-bounds-equal.ts +24 -0
- package/src/utils/bounds/_utils/style-composers.ts +216 -0
- package/src/utils/bounds/constants.ts +37 -22
- package/src/utils/bounds/index.ts +269 -19
- package/src/utils/gesture/apply-offset-rules.ts +314 -0
- package/src/utils/gesture/check-gesture-activation.ts +310 -0
- package/src/utils/gesture/determine-dismissal.ts +131 -0
- package/lib/commonjs/components/bounds-activator.js.map +0 -1
- package/lib/commonjs/hooks/bounds/use-bound-measurer.js +0 -52
- package/lib/commonjs/hooks/bounds/use-bound-measurer.js.map +0 -1
- package/lib/commonjs/hooks/gestures/use-scroll-progress.js +0 -57
- package/lib/commonjs/hooks/gestures/use-scroll-progress.js.map +0 -1
- package/lib/commonjs/utils/bounds/build-bound-styles.js +0 -145
- package/lib/commonjs/utils/bounds/build-bound-styles.js.map +0 -1
- package/lib/commonjs/utils/bounds/flatten-styles.js.map +0 -1
- package/lib/commonjs/utils/bounds/geometry.js +0 -94
- package/lib/commonjs/utils/bounds/geometry.js.map +0 -1
- package/lib/commonjs/utils/bounds/get-bounds.js.map +0 -1
- package/lib/commonjs/utils/bounds/style-composers.js +0 -199
- package/lib/commonjs/utils/bounds/style-composers.js.map +0 -1
- package/lib/commonjs/utils/gesture/apply-gesture-activation-criteria.js +0 -81
- package/lib/commonjs/utils/gesture/apply-gesture-activation-criteria.js.map +0 -1
- package/lib/commonjs/utils/gesture/normalize-gesture-translation.js +0 -21
- package/lib/commonjs/utils/gesture/normalize-gesture-translation.js.map +0 -1
- package/lib/module/components/bounds-activator.js.map +0 -1
- package/lib/module/hooks/bounds/use-bound-measurer.js +0 -47
- package/lib/module/hooks/bounds/use-bound-measurer.js.map +0 -1
- package/lib/module/hooks/gestures/use-scroll-progress.js +0 -52
- package/lib/module/hooks/gestures/use-scroll-progress.js.map +0 -1
- package/lib/module/utils/bounds/build-bound-styles.js +0 -141
- package/lib/module/utils/bounds/build-bound-styles.js.map +0 -1
- package/lib/module/utils/bounds/flatten-styles.js.map +0 -1
- package/lib/module/utils/bounds/geometry.js +0 -89
- package/lib/module/utils/bounds/geometry.js.map +0 -1
- package/lib/module/utils/bounds/get-bounds.js.map +0 -1
- package/lib/module/utils/bounds/style-composers.js +0 -191
- package/lib/module/utils/bounds/style-composers.js.map +0 -1
- package/lib/module/utils/gesture/apply-gesture-activation-criteria.js +0 -76
- package/lib/module/utils/gesture/apply-gesture-activation-criteria.js.map +0 -1
- package/lib/module/utils/gesture/normalize-gesture-translation.js +0 -16
- package/lib/module/utils/gesture/normalize-gesture-translation.js.map +0 -1
- package/lib/typescript/components/bounds-activator.d.ts +0 -8
- package/lib/typescript/components/bounds-activator.d.ts.map +0 -1
- package/lib/typescript/hooks/gestures/use-scroll-progress.d.ts.map +0 -1
- package/lib/typescript/utils/bounds/build-bound-styles.d.ts +0 -4
- package/lib/typescript/utils/bounds/build-bound-styles.d.ts.map +0 -1
- package/lib/typescript/utils/bounds/flatten-styles.d.ts.map +0 -1
- package/lib/typescript/utils/bounds/geometry.d.ts.map +0 -1
- package/lib/typescript/utils/bounds/get-bounds.d.ts +0 -4
- package/lib/typescript/utils/bounds/get-bounds.d.ts.map +0 -1
- package/lib/typescript/utils/bounds/style-composers.d.ts.map +0 -1
- package/lib/typescript/utils/gesture/apply-gesture-activation-criteria.d.ts +0 -17
- package/lib/typescript/utils/gesture/apply-gesture-activation-criteria.d.ts.map +0 -1
- package/lib/typescript/utils/gesture/normalize-gesture-translation.d.ts +0 -6
- package/lib/typescript/utils/gesture/normalize-gesture-translation.d.ts.map +0 -1
- package/src/hooks/gestures/use-scroll-progress.tsx +0 -60
- package/src/utils/bounds/build-bound-styles.ts +0 -184
- package/src/utils/bounds/geometry.ts +0 -113
- package/src/utils/bounds/get-bounds.ts +0 -56
- package/src/utils/bounds/style-composers.ts +0 -172
- package/src/utils/gesture/apply-gesture-activation-criteria.ts +0 -109
- package/src/utils/gesture/normalize-gesture-translation.ts +0 -20
- /package/lib/commonjs/utils/bounds/{flatten-styles.js → _utils/flatten-styles.js} +0 -0
- /package/lib/module/utils/bounds/{flatten-styles.js → _utils/flatten-styles.js} +0 -0
- /package/lib/typescript/utils/bounds/{flatten-styles.d.ts → _utils/flatten-styles.d.ts} +0 -0
- /package/src/utils/bounds/{flatten-styles.ts → _utils/flatten-styles.ts} +0 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { GestureOffsetState } from "../../types/gesture";
|
|
4
|
+
/**
|
|
5
|
+
* 10 seems like the correct threshold for compatability with nested gestures outside of our package.
|
|
6
|
+
*/
|
|
7
|
+
const GESTURE_ACTIVATION_THRESHOLD_X = 10;
|
|
8
|
+
const GESTURE_ACTIVATION_THRESHOLD_Y = 10;
|
|
9
|
+
const GESTURE_FAIL_TOLERANCE_X = 15;
|
|
10
|
+
const GESTURE_FAIL_TOLERANCE_Y = 20;
|
|
11
|
+
const DEFAULT_EDGE_DISTANCE_HORIZONTAL = 50;
|
|
12
|
+
const DEFAULT_EDGE_DISTANCE_VERTICAL = 135;
|
|
13
|
+
const DEFAULT_ACTIVATION_AREA = "screen";
|
|
14
|
+
function normalizeSides(area) {
|
|
15
|
+
"worklet";
|
|
16
|
+
|
|
17
|
+
if (!area || typeof area === "string") {
|
|
18
|
+
const mode = area ?? DEFAULT_ACTIVATION_AREA;
|
|
19
|
+
return {
|
|
20
|
+
left: mode,
|
|
21
|
+
right: mode,
|
|
22
|
+
top: mode,
|
|
23
|
+
bottom: mode
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const s = area;
|
|
27
|
+
return {
|
|
28
|
+
left: s.left ?? DEFAULT_ACTIVATION_AREA,
|
|
29
|
+
right: s.right ?? DEFAULT_ACTIVATION_AREA,
|
|
30
|
+
top: s.top ?? DEFAULT_ACTIVATION_AREA,
|
|
31
|
+
bottom: s.bottom ?? DEFAULT_ACTIVATION_AREA
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function computeEdgeConstraints(initialTouch, dimensions, sides, responseDistance) {
|
|
35
|
+
"worklet";
|
|
36
|
+
|
|
37
|
+
const xDist = responseDistance ?? DEFAULT_EDGE_DISTANCE_HORIZONTAL;
|
|
38
|
+
const yDist = responseDistance ?? DEFAULT_EDGE_DISTANCE_VERTICAL;
|
|
39
|
+
const horizontalRight = sides.left === "screen" || initialTouch.x <= xDist; // right swipe checks left edge
|
|
40
|
+
const horizontalLeft = sides.right === "screen" || initialTouch.x >= dimensions.width - xDist; // left swipe checks right edge
|
|
41
|
+
const verticalDown = sides.top === "screen" || initialTouch.y <= yDist; // down swipe checks top edge
|
|
42
|
+
const verticalUp = sides.bottom === "screen" || initialTouch.y >= dimensions.height - yDist; // up swipe checks bottom edge
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
horizontalRight,
|
|
46
|
+
horizontalLeft,
|
|
47
|
+
verticalDown,
|
|
48
|
+
verticalUp
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function calculateSwipeDirs(deltaX, deltaY) {
|
|
52
|
+
"worklet";
|
|
53
|
+
|
|
54
|
+
const isVerticalSwipe = Math.abs(deltaY) > Math.abs(deltaX);
|
|
55
|
+
const isHorizontalSwipe = Math.abs(deltaX) > Math.abs(deltaY);
|
|
56
|
+
const isSwipingDown = isVerticalSwipe && deltaY > 0;
|
|
57
|
+
const isSwipingUp = isVerticalSwipe && deltaY < 0;
|
|
58
|
+
const isSwipingRight = isHorizontalSwipe && deltaX > 0;
|
|
59
|
+
const isSwipingLeft = isHorizontalSwipe && deltaX < 0;
|
|
60
|
+
return {
|
|
61
|
+
isSwipingDown,
|
|
62
|
+
isSwipingUp,
|
|
63
|
+
isSwipingRight,
|
|
64
|
+
isSwipingLeft,
|
|
65
|
+
isVerticalSwipe,
|
|
66
|
+
isHorizontalSwipe
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function shouldActivateOrFail(params) {
|
|
70
|
+
"worklet";
|
|
71
|
+
|
|
72
|
+
const {
|
|
73
|
+
deltaX,
|
|
74
|
+
deltaY,
|
|
75
|
+
hasHorizontal,
|
|
76
|
+
hasVertical,
|
|
77
|
+
isHorizontalSwipe,
|
|
78
|
+
isVerticalSwipe,
|
|
79
|
+
allowedRight,
|
|
80
|
+
allowedLeft,
|
|
81
|
+
allowedUp,
|
|
82
|
+
allowedDown,
|
|
83
|
+
horizontalGateRight,
|
|
84
|
+
horizontalGateLeft,
|
|
85
|
+
verticalGateUp,
|
|
86
|
+
verticalGateDown,
|
|
87
|
+
isSwipingRight,
|
|
88
|
+
isSwipingLeft,
|
|
89
|
+
isSwipingUp,
|
|
90
|
+
isSwipingDown
|
|
91
|
+
} = params;
|
|
92
|
+
let shouldActivate = false;
|
|
93
|
+
let shouldFail = false;
|
|
94
|
+
if (hasHorizontal && isHorizontalSwipe) {
|
|
95
|
+
const hasEnoughHorizontalMovement = Math.abs(deltaX) >= GESTURE_ACTIVATION_THRESHOLD_X;
|
|
96
|
+
const hasAcceptableVerticalDeviation = Math.abs(deltaY) <= GESTURE_FAIL_TOLERANCE_X;
|
|
97
|
+
if (hasEnoughHorizontalMovement && hasAcceptableVerticalDeviation) {
|
|
98
|
+
const rightOk = isSwipingRight && allowedRight && horizontalGateRight;
|
|
99
|
+
const leftOk = isSwipingLeft && allowedLeft && horizontalGateLeft;
|
|
100
|
+
if (rightOk || leftOk) {
|
|
101
|
+
shouldActivate = true;
|
|
102
|
+
}
|
|
103
|
+
} else if (!hasAcceptableVerticalDeviation) {
|
|
104
|
+
shouldFail = true;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (hasVertical && isVerticalSwipe) {
|
|
108
|
+
const hasEnoughVerticalMovement = Math.abs(deltaY) >= GESTURE_ACTIVATION_THRESHOLD_Y;
|
|
109
|
+
const hasAcceptableHorizontalDeviation = Math.abs(deltaX) <= GESTURE_FAIL_TOLERANCE_Y;
|
|
110
|
+
if (hasEnoughVerticalMovement && hasAcceptableHorizontalDeviation) {
|
|
111
|
+
const upOk = isSwipingUp && allowedUp && verticalGateUp;
|
|
112
|
+
const downOk = isSwipingDown && allowedDown && verticalGateDown;
|
|
113
|
+
if (upOk || downOk) {
|
|
114
|
+
shouldActivate = true;
|
|
115
|
+
}
|
|
116
|
+
} else if (!hasAcceptableHorizontalDeviation) {
|
|
117
|
+
shouldFail = true;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (hasHorizontal && isHorizontalSwipe) {
|
|
121
|
+
if (isSwipingLeft && !allowedLeft || isSwipingRight && !allowedRight) {
|
|
122
|
+
shouldFail = true;
|
|
123
|
+
}
|
|
124
|
+
// If gating prohibits the dominant horizontal swipe, fail early
|
|
125
|
+
if (isSwipingRight && allowedRight && !horizontalGateRight || isSwipingLeft && allowedLeft && !horizontalGateLeft) {
|
|
126
|
+
shouldFail = true;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (hasVertical && isVerticalSwipe) {
|
|
130
|
+
if (isSwipingUp && !allowedUp || isSwipingDown && !allowedDown) {
|
|
131
|
+
shouldFail = true;
|
|
132
|
+
}
|
|
133
|
+
// If gating prohibits the dominant vertical swipe, fail early
|
|
134
|
+
if (isSwipingUp && allowedUp && !verticalGateUp || isSwipingDown && allowedDown && !verticalGateDown) {
|
|
135
|
+
shouldFail = true;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return {
|
|
139
|
+
shouldActivate,
|
|
140
|
+
shouldFail
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Since we're using onTouchesMove to activate our pan, faillOffset and activateOffset don't actually work. In that case we'll create this function to use in onTouchesMove which acts simarly to the original functionality.
|
|
146
|
+
*/
|
|
147
|
+
export const applyOffsetRules = ({
|
|
148
|
+
initialTouch,
|
|
149
|
+
touch,
|
|
150
|
+
directions,
|
|
151
|
+
manager,
|
|
152
|
+
gestureOffsetState,
|
|
153
|
+
activationArea,
|
|
154
|
+
dimensions,
|
|
155
|
+
responseDistance
|
|
156
|
+
}) => {
|
|
157
|
+
"worklet";
|
|
158
|
+
|
|
159
|
+
const deltaX = touch.x - initialTouch.x;
|
|
160
|
+
const deltaY = touch.y - initialTouch.y;
|
|
161
|
+
const allowedDown = directions.vertical;
|
|
162
|
+
const allowedUp = directions.verticalInverted;
|
|
163
|
+
const allowedRight = directions.horizontal;
|
|
164
|
+
const allowedLeft = directions.horizontalInverted;
|
|
165
|
+
const hasHorizontal = allowedLeft || allowedRight;
|
|
166
|
+
const hasVertical = allowedUp || allowedDown;
|
|
167
|
+
const {
|
|
168
|
+
isSwipingDown,
|
|
169
|
+
isSwipingUp,
|
|
170
|
+
isSwipingRight,
|
|
171
|
+
isSwipingLeft,
|
|
172
|
+
isVerticalSwipe,
|
|
173
|
+
isHorizontalSwipe
|
|
174
|
+
} = calculateSwipeDirs(deltaX, deltaY);
|
|
175
|
+
if (gestureOffsetState.value !== GestureOffsetState.PENDING) {
|
|
176
|
+
return {
|
|
177
|
+
isSwipingDown,
|
|
178
|
+
isSwipingUp,
|
|
179
|
+
isSwipingRight,
|
|
180
|
+
isSwipingLeft
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
const sides = normalizeSides(activationArea);
|
|
184
|
+
const {
|
|
185
|
+
horizontalRight: horizontalGateRight,
|
|
186
|
+
horizontalLeft: horizontalGateLeft,
|
|
187
|
+
verticalDown: verticalGateDown,
|
|
188
|
+
verticalUp: verticalGateUp
|
|
189
|
+
} = computeEdgeConstraints(initialTouch, dimensions, sides, responseDistance);
|
|
190
|
+
const {
|
|
191
|
+
shouldActivate,
|
|
192
|
+
shouldFail
|
|
193
|
+
} = shouldActivateOrFail({
|
|
194
|
+
deltaX,
|
|
195
|
+
deltaY,
|
|
196
|
+
hasHorizontal,
|
|
197
|
+
hasVertical,
|
|
198
|
+
isHorizontalSwipe,
|
|
199
|
+
isVerticalSwipe,
|
|
200
|
+
allowedRight,
|
|
201
|
+
allowedLeft,
|
|
202
|
+
allowedUp,
|
|
203
|
+
allowedDown,
|
|
204
|
+
horizontalGateRight,
|
|
205
|
+
horizontalGateLeft,
|
|
206
|
+
verticalGateUp,
|
|
207
|
+
verticalGateDown,
|
|
208
|
+
isSwipingRight,
|
|
209
|
+
isSwipingLeft,
|
|
210
|
+
isSwipingUp,
|
|
211
|
+
isSwipingDown
|
|
212
|
+
});
|
|
213
|
+
if (shouldActivate) {
|
|
214
|
+
gestureOffsetState.value = GestureOffsetState.PASSED;
|
|
215
|
+
} else if (shouldFail) {
|
|
216
|
+
gestureOffsetState.value = GestureOffsetState.FAILED;
|
|
217
|
+
manager?.fail();
|
|
218
|
+
}
|
|
219
|
+
return {
|
|
220
|
+
isSwipingDown,
|
|
221
|
+
isSwipingUp,
|
|
222
|
+
isSwipingRight,
|
|
223
|
+
isSwipingLeft
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
//# sourceMappingURL=check-gesture-activation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["GestureOffsetState","GESTURE_ACTIVATION_THRESHOLD_X","GESTURE_ACTIVATION_THRESHOLD_Y","GESTURE_FAIL_TOLERANCE_X","GESTURE_FAIL_TOLERANCE_Y","DEFAULT_EDGE_DISTANCE_HORIZONTAL","DEFAULT_EDGE_DISTANCE_VERTICAL","DEFAULT_ACTIVATION_AREA","normalizeSides","area","mode","left","right","top","bottom","s","computeEdgeConstraints","initialTouch","dimensions","sides","responseDistance","xDist","yDist","horizontalRight","x","horizontalLeft","width","verticalDown","y","verticalUp","height","calculateSwipeDirs","deltaX","deltaY","isVerticalSwipe","Math","abs","isHorizontalSwipe","isSwipingDown","isSwipingUp","isSwipingRight","isSwipingLeft","shouldActivateOrFail","params","hasHorizontal","hasVertical","allowedRight","allowedLeft","allowedUp","allowedDown","horizontalGateRight","horizontalGateLeft","verticalGateUp","verticalGateDown","shouldActivate","shouldFail","hasEnoughHorizontalMovement","hasAcceptableVerticalDeviation","rightOk","leftOk","hasEnoughVerticalMovement","hasAcceptableHorizontalDeviation","upOk","downOk","applyOffsetRules","touch","directions","manager","gestureOffsetState","activationArea","vertical","verticalInverted","horizontal","horizontalInverted","value","PENDING","PASSED","FAILED","fail"],"sourceRoot":"../../../../src","sources":["utils/gesture/check-gesture-activation.ts"],"mappings":";;AAGA,SAGCA,kBAAkB,QAEZ,qBAAqB;AAuD5B;AACA;AACA;AACA,MAAMC,8BAA8B,GAAG,EAAE;AACzC,MAAMC,8BAA8B,GAAG,EAAE;AACzC,MAAMC,wBAAwB,GAAG,EAAE;AACnC,MAAMC,wBAAwB,GAAG,EAAE;AACnC,MAAMC,gCAAgC,GAAG,EAAE;AAC3C,MAAMC,8BAA8B,GAAG,GAAG;AAC1C,MAAMC,uBAAuB,GAAG,QAAiB;AAEjD,SAASC,cAAcA,CAACC,IAA4B,EAAmB;EACtE,SAAS;;EACT,IAAI,CAACA,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;IACtC,MAAMC,IAAoB,GAAGD,IAAI,IAAIF,uBAAuB;IAC5D,OAAO;MAAEI,IAAI,EAAED,IAAI;MAAEE,KAAK,EAAEF,IAAI;MAAEG,GAAG,EAAEH,IAAI;MAAEI,MAAM,EAAEJ;IAAK,CAAC;EAC5D;EAEA,MAAMK,CAAiB,GAAGN,IAAsB;EAChD,OAAO;IACNE,IAAI,EAAEI,CAAC,CAACJ,IAAI,IAAIJ,uBAAuB;IACvCK,KAAK,EAAEG,CAAC,CAACH,KAAK,IAAIL,uBAAuB;IACzCM,GAAG,EAAEE,CAAC,CAACF,GAAG,IAAIN,uBAAuB;IACrCO,MAAM,EAAEC,CAAC,CAACD,MAAM,IAAIP;EACrB,CAAC;AACF;AAEA,SAASS,sBAAsBA,CAC9BC,YAAsC,EACtCC,UAAsB,EACtBC,KAAsB,EACtBC,gBAAyB,EACxB;EACD,SAAS;;EACT,MAAMC,KAAK,GAAGD,gBAAgB,IAAIf,gCAA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AACM,KAAK,GAAG1E,kBAAkB,CAAC6E,MAAM;IACpDV,OAAO,EAAEW,IAAI,CAAC,CAAC;EAChB;EAEA,OAAO;IACNxC,aAAa;IACbC,WAAW;IACXC,cAAc;IACdC;EACD,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Note: we normalize velocity by the axis dimension to map px/s to progress/s.
|
|
4
|
+
// This produces consistent behavior across devices and enables realistic bounce.
|
|
5
|
+
|
|
6
|
+
const MAX_PROGRESS_VELOCITY = 3.5; // ~3 progress units/second
|
|
7
|
+
|
|
8
|
+
const getAxisThreshold = ({
|
|
9
|
+
translation,
|
|
10
|
+
velocity,
|
|
11
|
+
screenSize,
|
|
12
|
+
gestureVelocityImpact
|
|
13
|
+
}) => {
|
|
14
|
+
"worklet";
|
|
15
|
+
|
|
16
|
+
const finalTranslation = translation + velocity * gestureVelocityImpact;
|
|
17
|
+
return Math.abs(finalTranslation) > screenSize / 2 && (velocity !== 0 || translation !== 0);
|
|
18
|
+
};
|
|
19
|
+
const getVelocity = (dimensions, velocityX, velocityY, dismissAxis) => {
|
|
20
|
+
"worklet";
|
|
21
|
+
|
|
22
|
+
const axisSize = dismissAxis === "y" ? dimensions.height : dimensions.width;
|
|
23
|
+
const axisVelocityPx = dismissAxis === "y" ? velocityY : velocityX;
|
|
24
|
+
let velocity = axisVelocityPx / Math.max(1, axisSize);
|
|
25
|
+
if (velocity > MAX_PROGRESS_VELOCITY) velocity = MAX_PROGRESS_VELOCITY;
|
|
26
|
+
if (velocity < -MAX_PROGRESS_VELOCITY) velocity = -MAX_PROGRESS_VELOCITY;
|
|
27
|
+
return velocity;
|
|
28
|
+
};
|
|
29
|
+
export const determineDismissal = ({
|
|
30
|
+
event,
|
|
31
|
+
directions,
|
|
32
|
+
dimensions,
|
|
33
|
+
gestureVelocityImpact
|
|
34
|
+
}) => {
|
|
35
|
+
"worklet";
|
|
36
|
+
|
|
37
|
+
let shouldDismiss = false;
|
|
38
|
+
let dismissAxis = "x";
|
|
39
|
+
if (directions.vertical && event.translationY > 0) {
|
|
40
|
+
const dismiss = getAxisThreshold({
|
|
41
|
+
translation: event.translationY,
|
|
42
|
+
velocity: event.velocityY,
|
|
43
|
+
screenSize: dimensions.height,
|
|
44
|
+
gestureVelocityImpact
|
|
45
|
+
});
|
|
46
|
+
if (dismiss) {
|
|
47
|
+
dismissAxis = "y";
|
|
48
|
+
shouldDismiss = true;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (directions.verticalInverted && event.translationY < 0) {
|
|
52
|
+
const dismiss = getAxisThreshold({
|
|
53
|
+
translation: event.translationY,
|
|
54
|
+
velocity: event.velocityY,
|
|
55
|
+
screenSize: dimensions.height,
|
|
56
|
+
gestureVelocityImpact
|
|
57
|
+
});
|
|
58
|
+
if (dismiss) {
|
|
59
|
+
dismissAxis = "y";
|
|
60
|
+
shouldDismiss = true;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (directions.horizontal && event.translationX > 0) {
|
|
64
|
+
const dismiss = getAxisThreshold({
|
|
65
|
+
translation: event.translationX,
|
|
66
|
+
velocity: event.velocityX,
|
|
67
|
+
screenSize: dimensions.width,
|
|
68
|
+
gestureVelocityImpact
|
|
69
|
+
});
|
|
70
|
+
if (dismiss) {
|
|
71
|
+
dismissAxis = "x";
|
|
72
|
+
shouldDismiss = true;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (directions.horizontalInverted && event.translationX < 0) {
|
|
76
|
+
const dismiss = getAxisThreshold({
|
|
77
|
+
translation: event.translationX,
|
|
78
|
+
velocity: event.velocityX,
|
|
79
|
+
screenSize: dimensions.width,
|
|
80
|
+
gestureVelocityImpact
|
|
81
|
+
});
|
|
82
|
+
if (dismiss) {
|
|
83
|
+
dismissAxis = "x";
|
|
84
|
+
shouldDismiss = true;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const velocity = getVelocity(dimensions, event.velocityX, event.velocityY, dismissAxis);
|
|
88
|
+
return {
|
|
89
|
+
shouldDismiss,
|
|
90
|
+
velocity
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=determine-dismissal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MAX_PROGRESS_VELOCITY","getAxisThreshold","translation","velocity","screenSize","gestureVelocityImpact","finalTranslation","Math","abs","getVelocity","dimensions","velocityX","velocityY","dismissAxis","axisSize","height","width","axisVelocityPx","max","determineDismissal","event","directions","shouldDismiss","vertical","translationY","dismiss","verticalInverted","horizontal","translationX","horizontalInverted"],"sourceRoot":"../../../../src","sources":["utils/gesture/determine-dismissal.ts"],"mappings":";;AAwBA;AACA;;AAEA,MAAMA,qBAAqB,GAAG,GAAG,CAAC,CAAC;;AAEnC,MAAMC,gBAAgB,GAAGA,CAAC;EACzBC,WAAW;EACXC,QAAQ;EACRC,UAAU;EACVC;AACsB,CAAC,KAAK;EAC5B,SAAS;;EACT,MAAMC,gBAAgB,GAAGJ,WAAW,GAAGC,QAAQ,GAAGE,qBAAqB;EAEvE,OACCE,IAAI,CAACC,GAAG,CAACF,gBAAgB,CAAC,GAAGF,UAAU,GAAG,CAAC,KAC1CD,QAAQ,KAAK,CAAC,IAAID,WAAW,KAAK,CAAC,CAAC;AAEvC,CAAC;AAED,MAAMO,WAAW,GAAGA,CACnBC,UAA6C,EAC7CC,SAAiB,EACjBC,SAAiB,EACjBC,WAAsB,KAClB;EACJ,SAAS;;EACT,MAAMC,QAAQ,GAAGD,WAAW,KAAK,GAAG,GAAGH,UAAU,CAACK,MAAM,GAAGL,UAAU,CAACM,KAAK;EAC3E,MAAMC,cAAc,GAAGJ,WAAW,KAAK,GAAG,GAAGD,SAAS,GAAGD,SAAS;EAClE,IAAIR,QAAQ,GAAGc,cAAc,GAAGV,IAAI,CAACW,GAAG,CAAC,CAAC,EAAEJ,QAAQ,CAAC;EAErD,IAA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,KAAK,CAACT,SAAS;MACzBP,UAAU,EAAEM,UAAU,CAACM,KAAK;MAC5BX;IACD,CAAC,CAAC;IACF,IAAIoB,OAAO,EAAE;MACZZ,WAAW,GAAG,GAAG;MACjBS,aAAa,GAAG,IAAI;IACrB;EACD;EACA,IAAID,UAAU,CAACQ,kBAAkB,IAAIT,KAAK,CAACQ,YAAY,GAAG,CAAC,EAAE;IAC5D,MAAMH,OAAO,GAAGxB,gBAAgB,CAAC;MAChCC,WAAW,EAAEkB,KAAK,CAACQ,YAAY;MAC/BzB,QAAQ,EAAEiB,KAAK,CAACT,SAAS;MACzBP,UAAU,EAAEM,UAAU,CAACM,KAAK;MAC5BX;IACD,CAAC,CAAC;IAEF,IAAIoB,OAAO,EAAE;MACZZ,WAAW,GAAG,GAAG;MACjBS,aAAa,GAAG,IAAI;IACrB;EACD;EAEA,MAAMnB,QAAQ,GAAGM,WAAW,CAC3BC,UAAU,EACVU,KAAK,CAACT,SAAS,EACfS,KAAK,CAACR,SAAS,EACfC,WACD,CAAC;EAED,OAAO;IAAES,aAAa;IAAEnB;EAAS,CAAC;AACnC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface BoundActivatorProps {
|
|
2
|
+
sharedBoundTag?: string;
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
measure: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const BoundCapture: ({ sharedBoundTag, children, measure, }: BoundActivatorProps) => string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=bound-capture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bound-capture.d.ts","sourceRoot":"","sources":["../../../src/components/bound-capture.tsx"],"names":[],"mappings":"AAIA,UAAU,mBAAmB;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,GAAI,wCAI1B,mBAAmB,4WAcrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen-lifecycle.d.ts","sourceRoot":"","sources":["../../../../src/components/controllers/screen-lifecycle.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"screen-lifecycle.d.ts","sourceRoot":"","sources":["../../../../src/components/controllers/screen-lifecycle.tsx"],"names":[],"mappings":"AASA,UAAU,oBAAoB;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED,eAAO,MAAM,yBAAyB,GAAI,eAEvC,oBAAoB,8BAgEtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-transition-aware-component.d.ts","sourceRoot":"","sources":["../../../src/components/create-transition-aware-component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,aAAa,EAAoB,MAAM,OAAO,CAAC;AAS7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAI1D,UAAU,qCAAqC;IAC9C,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,8BAA8B,CAAC,CAAC,SAAS,MAAM,EAC9D,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,EACzB,OAAO,GAAE,qCAA0C,
|
|
1
|
+
{"version":3,"file":"create-transition-aware-component.d.ts","sourceRoot":"","sources":["../../../src/components/create-transition-aware-component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,aAAa,EAAoB,MAAM,OAAO,CAAC;AAS7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAI1D,UAAU,qCAAqC;IAC9C,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,8BAA8B,CAAC,CAAC,SAAS,MAAM,EAC9D,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,EACzB,OAAO,GAAE,qCAA0C,GA6F7B,KAAK,CAAC,mBAAmB,CAC9C,KAAK,CAAC,yBAAyB,CAC9B,oBAAoB,CAAC,CAAC,CAAC,GACtB,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,OAAO,CAAC,CAAC,CACxD,CACD,CACD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type StyleProp, type ViewStyle } from "react-native";
|
|
2
|
+
export default function MaskedView({ children, style: userStyles, }: {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
style?: StyleProp<ViewStyle>;
|
|
5
|
+
}): string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
6
|
+
//# sourceMappingURL=masked-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"masked-view.d.ts","sourceRoot":"","sources":["../../../../src/components/integrations/masked-view.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAgBhF,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAClC,QAAQ,EACR,KAAK,EAAE,UAAe,GACtB,EAAE;IACF,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC7B,2WAqBA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
type Props = {
|
|
2
2
|
children: React.ReactNode;
|
|
3
|
-
}
|
|
4
|
-
export declare const RootTransitionAware: import("react").MemoExoticComponent<({ children }:
|
|
3
|
+
};
|
|
4
|
+
export declare const RootTransitionAware: import("react").MemoExoticComponent<({ children }: Props) => import("react/jsx-runtime").JSX.Element>;
|
|
5
5
|
export {};
|
|
6
6
|
//# sourceMappingURL=root-transition-aware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root-transition-aware.d.ts","sourceRoot":"","sources":["../../../src/components/root-transition-aware.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"root-transition-aware.d.ts","sourceRoot":"","sources":["../../../src/components/root-transition-aware.tsx"],"names":[],"mappings":"AAQA,KAAK,KAAK,GAAG;IACZ,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,CAAC;AAIF,eAAO,MAAM,mBAAmB,qDAAuB,KAAK,6CAwB1D,CAAC"}
|
|
@@ -9,5 +9,8 @@ export declare const presets: {
|
|
|
9
9
|
ElasticCard: (config?: Partial<import("../types/navigator").ScreenTransitionConfig> & {
|
|
10
10
|
elasticFactor?: number;
|
|
11
11
|
}) => import("../types/navigator").ScreenTransitionConfig;
|
|
12
|
+
SharedIGImage: (config?: Partial<import("../types/navigator").ScreenTransitionConfig>) => import("../types/navigator").ScreenTransitionConfig;
|
|
13
|
+
SharedAppleMusic: (config?: Partial<import("../types/navigator").ScreenTransitionConfig>) => import("../types/navigator").ScreenTransitionConfig;
|
|
14
|
+
SharedXImage: (config?: Partial<import("../types/navigator").ScreenTransitionConfig>) => import("../types/navigator").ScreenTransitionConfig;
|
|
12
15
|
};
|
|
13
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/configs/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/configs/index.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,KAAK;;CAEjB,CAAC;AAEF,eAAO,MAAM,OAAO;;;;;;qBAU6zF,CAAC;;;;;CADj1F,CAAC"}
|
|
@@ -6,4 +6,7 @@ export declare const DraggableCard: (config?: Partial<ScreenTransitionConfig>) =
|
|
|
6
6
|
export declare const ElasticCard: (config?: Partial<ScreenTransitionConfig> & {
|
|
7
7
|
elasticFactor?: number;
|
|
8
8
|
}) => ScreenTransitionConfig;
|
|
9
|
+
export declare const SharedIGImage: (config?: Partial<ScreenTransitionConfig>) => ScreenTransitionConfig;
|
|
10
|
+
export declare const SharedAppleMusic: (config?: Partial<ScreenTransitionConfig>) => ScreenTransitionConfig;
|
|
11
|
+
export declare const SharedXImage: (config?: Partial<ScreenTransitionConfig>) => ScreenTransitionConfig;
|
|
9
12
|
//# sourceMappingURL=presets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../../src/configs/presets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../../src/configs/presets.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAKjE,eAAO,MAAM,YAAY,GACxB,SAAQ,OAAO,CAAC,sBAAsB,CAAM,KAC1C,sBA+BF,CAAC;AAEF,eAAO,MAAM,MAAM,GAClB,SAAQ,OAAO,CAAC,sBAAsB,CAAM,KAC1C,sBAoCF,CAAC;AAEF,eAAO,MAAM,eAAe,GAC3B,SAAQ,OAAO,CAAC,sBAAsB,CAAM,KAC1C,sBA8BF,CAAC;AAEF,eAAO,MAAM,aAAa,GACzB,SAAQ,OAAO,CAAC,sBAAsB,CAAM,KAC1C,sBAuCF,CAAC;AAEF,eAAO,MAAM,WAAW,GACvB,SAAQ,OAAO,CAAC,sBAAsB,CAAC,GAAG;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;CACE,KACxB,sBA0DF,CAAC;AAEF,eAAO,MAAM,aAAa,GACzB,SAAQ,OAAO,CAAC,sBAAsB,CAAM,KAC1C,sBA6HF,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC5B,SAAQ,OAAO,CAAC,sBAAsB,CAAM,KAC1C,sBAoLF,CAAC;AAEF,eAAO,MAAM,YAAY,GACxB,SAAQ,OAAO,CAAC,sBAAsB,CAAM,KAC1C,sBA+EF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specs.d.ts","sourceRoot":"","sources":["../../../src/configs/specs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"specs.d.ts","sourceRoot":"","sources":["../../../src/configs/specs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,eAAO,MAAM,WAAW,EAAE,gBAMzB,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
id?: string;
|
|
3
|
+
};
|
|
1
4
|
/**
|
|
2
5
|
* This hook is used to get the associated styles for a given styleId.
|
|
3
6
|
* It is used to get the associated styles for a given styleId.
|
|
4
7
|
* It is used to get the associated styles for a given styleId.
|
|
5
8
|
*/
|
|
6
|
-
export declare const useAssociatedStyles: ({ id }?: {
|
|
7
|
-
|
|
8
|
-
}) => {
|
|
9
|
-
associatedStyles: import("react-native-reanimated").StyleProps;
|
|
9
|
+
export declare const useAssociatedStyles: ({ id }?: Props) => {
|
|
10
|
+
associatedStyles: Readonly<{}>;
|
|
10
11
|
};
|
|
12
|
+
export {};
|
|
11
13
|
//# sourceMappingURL=use-associated-style.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-associated-style.d.ts","sourceRoot":"","sources":["../../../../src/hooks/animation/use-associated-style.tsx"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAQ
|
|
1
|
+
{"version":3,"file":"use-associated-style.d.ts","sourceRoot":"","sources":["../../../../src/hooks/animation/use-associated-style.tsx"],"names":[],"mappings":"AAGA,KAAK,KAAK,GAAG;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;CACZ,CAAC;AAIF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAQ,KAAU;;CAcrD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-screen-animation.d.ts","sourceRoot":"","sources":["../../../../src/hooks/animation/use-screen-animation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-screen-animation.d.ts","sourceRoot":"","sources":["../../../../src/hooks/animation/use-screen-animation.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EACX,wBAAwB,EAExB,MAAM,uBAAuB,CAAC;AAyE/B,wBAAgB,mBAAmB;;;EAiDlC;AAED,wBAAgB,kBAAkB,6EAIjC"}
|
|
@@ -10,9 +10,9 @@ interface BoundMeasurerHookProps {
|
|
|
10
10
|
};
|
|
11
11
|
style: StyleProps;
|
|
12
12
|
}
|
|
13
|
-
export declare const
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
export declare const useBoundsRegistry: ({ sharedBoundTag, animatedRef, current, style, }: BoundMeasurerHookProps) => {
|
|
14
|
+
measureBounds: () => void;
|
|
15
|
+
handleLayout: () => void;
|
|
16
16
|
};
|
|
17
17
|
export {};
|
|
18
|
-
//# sourceMappingURL=use-bound-
|
|
18
|
+
//# sourceMappingURL=use-bound-registry.d.ts.map
|
package/lib/typescript/hooks/bounds/{use-bound-measurer.d.ts.map → use-bound-registry.d.ts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-bound-
|
|
1
|
+
{"version":3,"file":"use-bound-registry.d.ts","sourceRoot":"","sources":["../../../../src/hooks/bounds/use-bound-registry.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EACN,KAAK,WAAW,EAEhB,KAAK,UAAU,EAEf,MAAM,yBAAyB,CAAC;AAOjC,UAAU,sBAAsB;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IAC/B,OAAO,EAAE;QAAE,KAAK,EAAE;YAAE,GAAG,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IACpC,KAAK,EAAE,UAAU,CAAC;CAClB;AAED,eAAO,MAAM,iBAAiB,GAAI,kDAK/B,sBAAsB;;;CAgDxB,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { type GestureType } from "react-native-gesture-handler";
|
|
1
2
|
import { type SharedValue } from "react-native-reanimated";
|
|
2
|
-
import type {
|
|
3
|
+
import type { ScrollConfig } from "../../providers/gestures";
|
|
3
4
|
interface BuildGesturesHookProps {
|
|
4
|
-
|
|
5
|
+
scrollConfig: SharedValue<ScrollConfig | null>;
|
|
5
6
|
}
|
|
6
|
-
export declare const useBuildGestures: ({
|
|
7
|
-
panGesture:
|
|
8
|
-
nativeGesture:
|
|
7
|
+
export declare const useBuildGestures: ({ scrollConfig, }: BuildGesturesHookProps) => {
|
|
8
|
+
panGesture: GestureType;
|
|
9
|
+
nativeGesture: GestureType;
|
|
9
10
|
};
|
|
10
11
|
export {};
|
|
11
12
|
//# sourceMappingURL=use-build-gestures.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-build-gestures.d.ts","sourceRoot":"","sources":["../../../../src/hooks/gestures/use-build-gestures.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-build-gestures.d.ts","sourceRoot":"","sources":["../../../../src/hooks/gestures/use-build-gestures.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIN,KAAK,WAAW,EAGhB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAEN,KAAK,WAAW,EAEhB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAmB7D,UAAU,sBAAsB;IAC/B,YAAY,EAAE,WAAW,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;CAC/C;AAED,eAAO,MAAM,gBAAgB,GAAI,mBAE9B,sBAAsB,KAAG;IAC3B,UAAU,EAAE,WAAW,CAAC;IACxB,aAAa,EAAE,WAAW,CAAC;CAkS3B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registers native gestures with parent gestures to enable proper gesture handling
|
|
3
|
+
* in nested navigators that contain scrollable content.
|
|
4
|
+
*/
|
|
5
|
+
export declare const useParentGestureRegistry: () => void;
|
|
6
|
+
//# sourceMappingURL=use-parent-gesture-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-parent-gesture-registry.d.ts","sourceRoot":"","sources":["../../../../src/hooks/gestures/use-parent-gesture-registry.tsx"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,wBAAwB,YASpC,CAAC"}
|
|
@@ -5,10 +5,10 @@ interface ScrollProgressHookProps {
|
|
|
5
5
|
onContentSizeChange?: (width: number, height: number) => void;
|
|
6
6
|
onLayout?: (event: LayoutChangeEvent) => void;
|
|
7
7
|
}
|
|
8
|
-
export declare const
|
|
8
|
+
export declare const useScrollRegistry: (props: ScrollProgressHookProps) => {
|
|
9
9
|
scrollHandler: import("react-native-reanimated").ScrollHandlerProcessed<Record<string, unknown>>;
|
|
10
10
|
onContentSizeChange: (width: number, height: number) => void;
|
|
11
11
|
onLayout: (event: LayoutChangeEvent) => void;
|
|
12
12
|
};
|
|
13
13
|
export {};
|
|
14
|
-
//# sourceMappingURL=use-scroll-
|
|
14
|
+
//# sourceMappingURL=use-scroll-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-scroll-registry.d.ts","sourceRoot":"","sources":["../../../../src/hooks/gestures/use-scroll-registry.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yDAAyD,CAAC;AAKrG,UAAU,uBAAuB;IAChC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAClD,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9D,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAC9C;AAED,eAAO,MAAM,iBAAiB,GAAI,OAAO,uBAAuB;;;;CAmI/D,CAAC"}
|