react-native-screen-transitions 3.3.0-beta.2 → 3.3.0-beta.4

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.
Files changed (119) hide show
  1. package/README.md +95 -31
  2. package/lib/commonjs/shared/animation/snap-to.js +17 -10
  3. package/lib/commonjs/shared/animation/snap-to.js.map +1 -1
  4. package/lib/commonjs/shared/components/create-transition-aware-component.js +20 -18
  5. package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
  6. package/lib/commonjs/shared/components/screen-container.js +68 -9
  7. package/lib/commonjs/shared/components/screen-container.js.map +1 -1
  8. package/lib/commonjs/shared/constants.js +8 -1
  9. package/lib/commonjs/shared/constants.js.map +1 -1
  10. package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js +49 -39
  11. package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js.map +1 -1
  12. package/lib/commonjs/shared/hooks/gestures/use-screen-gesture-handlers.js +110 -61
  13. package/lib/commonjs/shared/hooks/gestures/use-screen-gesture-handlers.js.map +1 -1
  14. package/lib/commonjs/shared/hooks/gestures/use-scroll-registry.js +67 -70
  15. package/lib/commonjs/shared/hooks/gestures/use-scroll-registry.js.map +1 -1
  16. package/lib/commonjs/shared/providers/gestures.provider.js +113 -25
  17. package/lib/commonjs/shared/providers/gestures.provider.js.map +1 -1
  18. package/lib/commonjs/shared/types/ownership.types.js +71 -0
  19. package/lib/commonjs/shared/types/ownership.types.js.map +1 -0
  20. package/lib/commonjs/shared/utils/gesture/check-gesture-activation.js +72 -128
  21. package/lib/commonjs/shared/utils/gesture/check-gesture-activation.js.map +1 -1
  22. package/lib/commonjs/shared/utils/gesture/compute-claimed-directions.js +81 -0
  23. package/lib/commonjs/shared/utils/gesture/compute-claimed-directions.js.map +1 -0
  24. package/lib/commonjs/shared/utils/gesture/determine-snap-target.js +1 -1
  25. package/lib/commonjs/shared/utils/gesture/determine-snap-target.js.map +1 -1
  26. package/lib/commonjs/shared/utils/gesture/find-collapse-target.js +48 -0
  27. package/lib/commonjs/shared/utils/gesture/find-collapse-target.js.map +1 -0
  28. package/lib/commonjs/shared/utils/gesture/resolve-ownership.js +87 -0
  29. package/lib/commonjs/shared/utils/gesture/resolve-ownership.js.map +1 -0
  30. package/lib/commonjs/shared/utils/gesture/velocity.js +16 -5
  31. package/lib/commonjs/shared/utils/gesture/velocity.js.map +1 -1
  32. package/lib/module/shared/animation/snap-to.js +16 -10
  33. package/lib/module/shared/animation/snap-to.js.map +1 -1
  34. package/lib/module/shared/components/create-transition-aware-component.js +20 -18
  35. package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
  36. package/lib/module/shared/components/screen-container.js +68 -10
  37. package/lib/module/shared/components/screen-container.js.map +1 -1
  38. package/lib/module/shared/constants.js +7 -0
  39. package/lib/module/shared/constants.js.map +1 -1
  40. package/lib/module/shared/hooks/gestures/use-build-gestures.js +49 -39
  41. package/lib/module/shared/hooks/gestures/use-build-gestures.js.map +1 -1
  42. package/lib/module/shared/hooks/gestures/use-screen-gesture-handlers.js +112 -63
  43. package/lib/module/shared/hooks/gestures/use-screen-gesture-handlers.js.map +1 -1
  44. package/lib/module/shared/hooks/gestures/use-scroll-registry.js +68 -70
  45. package/lib/module/shared/hooks/gestures/use-scroll-registry.js.map +1 -1
  46. package/lib/module/shared/providers/gestures.provider.js +113 -25
  47. package/lib/module/shared/providers/gestures.provider.js.map +1 -1
  48. package/lib/module/shared/types/ownership.types.js +67 -0
  49. package/lib/module/shared/types/ownership.types.js.map +1 -0
  50. package/lib/module/shared/utils/gesture/check-gesture-activation.js +70 -126
  51. package/lib/module/shared/utils/gesture/check-gesture-activation.js.map +1 -1
  52. package/lib/module/shared/utils/gesture/compute-claimed-directions.js +77 -0
  53. package/lib/module/shared/utils/gesture/compute-claimed-directions.js.map +1 -0
  54. package/lib/module/shared/utils/gesture/determine-snap-target.js +1 -1
  55. package/lib/module/shared/utils/gesture/determine-snap-target.js.map +1 -1
  56. package/lib/module/shared/utils/gesture/find-collapse-target.js +44 -0
  57. package/lib/module/shared/utils/gesture/find-collapse-target.js.map +1 -0
  58. package/lib/module/shared/utils/gesture/resolve-ownership.js +83 -0
  59. package/lib/module/shared/utils/gesture/resolve-ownership.js.map +1 -0
  60. package/lib/module/shared/utils/gesture/velocity.js +16 -5
  61. package/lib/module/shared/utils/gesture/velocity.js.map +1 -1
  62. package/lib/typescript/shared/animation/snap-to.d.ts.map +1 -1
  63. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  64. package/lib/typescript/shared/components/screen-container.d.ts.map +1 -1
  65. package/lib/typescript/shared/constants.d.ts +6 -0
  66. package/lib/typescript/shared/constants.d.ts.map +1 -1
  67. package/lib/typescript/shared/hooks/gestures/use-build-gestures.d.ts +15 -3
  68. package/lib/typescript/shared/hooks/gestures/use-build-gestures.d.ts.map +1 -1
  69. package/lib/typescript/shared/hooks/gestures/use-screen-gesture-handlers.d.ts +52 -2
  70. package/lib/typescript/shared/hooks/gestures/use-screen-gesture-handlers.d.ts.map +1 -1
  71. package/lib/typescript/shared/hooks/gestures/use-scroll-registry.d.ts +11 -6
  72. package/lib/typescript/shared/hooks/gestures/use-scroll-registry.d.ts.map +1 -1
  73. package/lib/typescript/shared/hooks/use-backdrop-pointer-events.d.ts +1 -1
  74. package/lib/typescript/shared/hooks/use-backdrop-pointer-events.d.ts.map +1 -1
  75. package/lib/typescript/shared/providers/gestures.provider.d.ts +28 -3
  76. package/lib/typescript/shared/providers/gestures.provider.d.ts.map +1 -1
  77. package/lib/typescript/shared/types/ownership.types.d.ts +52 -0
  78. package/lib/typescript/shared/types/ownership.types.d.ts.map +1 -0
  79. package/lib/typescript/shared/types/screen.types.d.ts +22 -1
  80. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
  81. package/lib/typescript/shared/utils/gesture/check-gesture-activation.d.ts +23 -19
  82. package/lib/typescript/shared/utils/gesture/check-gesture-activation.d.ts.map +1 -1
  83. package/lib/typescript/shared/utils/gesture/compute-claimed-directions.d.ts +23 -0
  84. package/lib/typescript/shared/utils/gesture/compute-claimed-directions.d.ts.map +1 -0
  85. package/lib/typescript/shared/utils/gesture/determine-snap-target.d.ts +5 -1
  86. package/lib/typescript/shared/utils/gesture/determine-snap-target.d.ts.map +1 -1
  87. package/lib/typescript/shared/utils/gesture/find-collapse-target.d.ts +17 -0
  88. package/lib/typescript/shared/utils/gesture/find-collapse-target.d.ts.map +1 -0
  89. package/lib/typescript/shared/utils/gesture/resolve-ownership.d.ts +36 -0
  90. package/lib/typescript/shared/utils/gesture/resolve-ownership.d.ts.map +1 -0
  91. package/lib/typescript/shared/utils/gesture/velocity.d.ts.map +1 -1
  92. package/package.json +121 -120
  93. package/src/shared/animation/snap-to.ts +17 -11
  94. package/src/shared/components/create-transition-aware-component.tsx +28 -25
  95. package/src/shared/components/screen-container.tsx +79 -12
  96. package/src/shared/constants.ts +7 -0
  97. package/src/shared/hooks/gestures/use-build-gestures.tsx +80 -44
  98. package/src/shared/hooks/gestures/use-screen-gesture-handlers.ts +147 -71
  99. package/src/shared/hooks/gestures/use-scroll-registry.tsx +94 -86
  100. package/src/shared/hooks/use-backdrop-pointer-events.ts +1 -1
  101. package/src/shared/providers/gestures.provider.tsx +168 -25
  102. package/src/shared/types/ownership.types.ts +77 -0
  103. package/src/shared/types/screen.types.ts +24 -1
  104. package/src/shared/utils/gesture/check-gesture-activation.ts +82 -116
  105. package/src/shared/utils/gesture/compute-claimed-directions.ts +93 -0
  106. package/src/shared/utils/gesture/determine-snap-target.ts +6 -2
  107. package/src/shared/utils/gesture/find-collapse-target.ts +42 -0
  108. package/src/shared/utils/gesture/resolve-ownership.ts +110 -0
  109. package/src/shared/utils/gesture/velocity.ts +16 -6
  110. package/src/shared/__tests__/bounds.store.test.ts +0 -394
  111. package/src/shared/__tests__/derivations.test.ts +0 -156
  112. package/src/shared/__tests__/determine-dismissal.test.ts +0 -111
  113. package/src/shared/__tests__/determine-snap-target.test.ts +0 -268
  114. package/src/shared/__tests__/geometry.test.ts +0 -130
  115. package/src/shared/__tests__/gesture-activation.test.ts +0 -471
  116. package/src/shared/__tests__/gesture.velocity.test.ts +0 -131
  117. package/src/shared/__tests__/history.store.test.ts +0 -550
  118. package/src/shared/__tests__/sync-routes-with-removed.test.ts +0 -137
  119. package/src/shared/__tests__/validate-snap-points.test.ts +0 -125
@@ -1,13 +1,100 @@
1
1
  "use strict";
2
2
 
3
- import { StyleSheet, View } from "react-native";
4
- import { GestureDetector } from "react-native-gesture-handler";
3
+ /**
4
+ * Gesture System - Core Provider
5
+ *
6
+ * Each screen gets a GestureContext containing:
7
+ * - panGesture: Pan gesture handler for dismiss/snap
8
+ * - scrollConfig: Scroll state for boundary detection
9
+ * - claimedDirections: Which directions this screen handles
10
+ * - childDirectionClaims: Claims registered by descendant screens
11
+ *
12
+ * ScrollView coordination is handled by useScrollRegistry, which finds the
13
+ * gesture owner for the scroll axis and creates appropriate Native gestures.
14
+ */
15
+
16
+ import { useNavigationState } from "@react-navigation/native";
17
+ import { useEffect, useMemo } from "react";
5
18
  import { useSharedValue } from "react-native-reanimated";
6
19
  import { useBuildGestures } from "../hooks/gestures/use-build-gestures";
7
- import { useBackdropPointerEvents } from "../hooks/use-backdrop-pointer-events";
20
+ import { GestureStore } from "../stores/gesture.store";
21
+ import { StackType } from "../types/stack.types";
8
22
  import createProvider from "../utils/create-provider";
23
+ import { computeClaimedDirections } from "../utils/gesture/compute-claimed-directions";
9
24
  import { useKeys } from "./screen/keys.provider";
10
- import { jsx as _jsx } from "react/jsx-runtime";
25
+ import { useStackCoreContext } from "./stack/core.provider";
26
+ const NO_CLAIMS = {
27
+ vertical: null,
28
+ "vertical-inverted": null,
29
+ horizontal: null,
30
+ "horizontal-inverted": null
31
+ };
32
+ const DIRECTIONS = ["vertical", "vertical-inverted", "horizontal", "horizontal-inverted"];
33
+
34
+ /**
35
+ * Registers direction claims on ancestors that this screen shadows.
36
+ * Only registers claims when this screen is the current (topmost) route
37
+ * in its navigator, preventing unfocused screens from blocking gestures.
38
+ */
39
+ function useRegisterDirectionClaims(ancestorContext, claimedDirections, routeKey, isIsolated, isCurrentRoute) {
40
+ useEffect(() => {
41
+ // Only register claims when this screen is the current route
42
+ if (!isCurrentRoute || !ancestorContext) {
43
+ return;
44
+ }
45
+ const gestureValues = GestureStore.getRouteGestures(routeKey);
46
+ const isDismissing = gestureValues.isDismissing;
47
+ const claimedAncestors = [];
48
+ let ancestor = ancestorContext;
49
+ while (ancestor) {
50
+ if (ancestor.isIsolated !== isIsolated) break;
51
+ const shadowedDirections = [];
52
+ for (const dir of DIRECTIONS) {
53
+ if (claimedDirections[dir] && ancestor.claimedDirections?.[dir]) {
54
+ shadowedDirections.push(dir);
55
+ }
56
+ }
57
+ if (shadowedDirections.length > 0) {
58
+ claimedAncestors.push({
59
+ ancestor,
60
+ directions: shadowedDirections
61
+ });
62
+ const newClaims = {
63
+ ...ancestor.childDirectionClaims.value
64
+ };
65
+ for (const dir of shadowedDirections) {
66
+ newClaims[dir] = {
67
+ routeKey,
68
+ isDismissing
69
+ };
70
+ }
71
+ ancestor.childDirectionClaims.value = newClaims;
72
+ }
73
+ ancestor = ancestor.ancestorContext;
74
+ }
75
+ return () => {
76
+ for (const {
77
+ ancestor,
78
+ directions
79
+ } of claimedAncestors) {
80
+ const currentClaims = ancestor.childDirectionClaims.value;
81
+ const newClaims = {
82
+ ...currentClaims
83
+ };
84
+ let needsUpdate = false;
85
+ for (const dir of directions) {
86
+ if (currentClaims[dir]?.routeKey === routeKey) {
87
+ newClaims[dir] = null;
88
+ needsUpdate = true;
89
+ }
90
+ }
91
+ if (needsUpdate) {
92
+ ancestor.childDirectionClaims.value = newClaims;
93
+ }
94
+ }
95
+ };
96
+ }, [ancestorContext, claimedDirections, routeKey, isIsolated, isCurrentRoute]);
97
+ }
11
98
  export const {
12
99
  ScreenGestureProvider,
13
100
  useScreenGestureContext: useGestureContext
@@ -19,45 +106,46 @@ export const {
19
106
  const {
20
107
  current
21
108
  } = useKeys();
22
- const ancestorContext = useGestureContext();
23
- const scrollConfig = useSharedValue(null);
24
109
  const {
25
- pointerEvents
26
- } = useBackdropPointerEvents();
110
+ flags
111
+ } = useStackCoreContext();
112
+ const ancestorContext = useGestureContext();
27
113
  const hasGestures = current.options.gestureEnabled === true;
114
+ const isIsolated = flags.STACK_TYPE === StackType.COMPONENT;
115
+ const hasSnapPoints = Array.isArray(current.options.snapPoints) && current.options.snapPoints.length > 0;
116
+ const claimedDirections = useMemo(() => computeClaimedDirections(hasGestures, current.options.gestureDirection, hasSnapPoints), [hasGestures, current.options.gestureDirection, hasSnapPoints]);
117
+ const routeKey = current.route.key;
118
+
119
+ // Check if this screen is the current (topmost) route in its navigator
120
+ const isCurrentRoute = useNavigationState(state => state.routes[state.index]?.key === routeKey);
121
+ const scrollConfig = useSharedValue(null);
122
+ const childDirectionClaims = useSharedValue(NO_CLAIMS);
123
+ useRegisterDirectionClaims(ancestorContext, claimedDirections, routeKey, isIsolated, isCurrentRoute);
28
124
  const {
29
125
  panGesture,
30
126
  panGestureRef,
31
- nativeGesture,
32
127
  gestureAnimationValues
33
128
  } = useBuildGestures({
34
129
  scrollConfig,
35
- ancestorContext
130
+ ancestorContext,
131
+ claimedDirections,
132
+ childDirectionClaims,
133
+ isIsolated
36
134
  });
37
135
  const value = {
38
136
  panGesture,
39
137
  panGestureRef,
40
138
  scrollConfig,
41
- nativeGesture,
42
139
  gestureAnimationValues,
43
140
  ancestorContext,
44
- gestureEnabled: hasGestures
141
+ gestureEnabled: hasGestures,
142
+ isIsolated,
143
+ claimedDirections,
144
+ childDirectionClaims
45
145
  };
46
146
  return {
47
147
  value,
48
- children: /*#__PURE__*/_jsx(GestureDetector, {
49
- gesture: panGesture,
50
- children: /*#__PURE__*/_jsx(View, {
51
- style: styles.container,
52
- pointerEvents: pointerEvents,
53
- children: children
54
- })
55
- })
148
+ children
56
149
  };
57
150
  });
58
- const styles = StyleSheet.create({
59
- container: {
60
- flex: 1
61
- }
62
- });
63
151
  //# sourceMappingURL=gestures.provider.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["StyleSheet","View","GestureDetector","useSharedValue","useBuildGestures","useBackdropPointerEvents","createProvider","useKeys","jsx","_jsx","ScreenGestureProvider","useScreenGestureContext","useGestureContext","guarded","children","current","ancestorContext","scrollConfig","pointerEvents","hasGestures","options","gestureEnabled","panGesture","panGestureRef","nativeGesture","gestureAnimationValues","value","gesture","style","styles","container","create","flex"],"sourceRoot":"../../../../src","sources":["shared/providers/gestures.provider.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SACCC,eAAe,QAET,8BAA8B;AAErC,SAASC,cAAc,QAAQ,yBAAyB;AACxD,SAASC,gBAAgB,QAAQ,sCAAsC;AACvE,SAASC,wBAAwB,QAAQ,sCAAsC;AAE/E,OAAOC,cAAc,MAAM,0BAA0B;AACrD,SAASC,OAAO,QAAQ,wBAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AA0BjD,OAAO,MAAM;EACZC,qBAAqB;EACrBC,uBAAuB,EAAEC;AAC1B,CAAC,GAAGN,cAAc,CAAC,eAAe,EAAE;EAAEO,OAAO,EAAE;AAAM,CAAC,CAAC,CAGrD,CAAC;EAAEC;AAAS,CAAC,KAAK;EACnB,MAAM;IAAEC;EAAQ,CAAC,GAAGR,OAAO,CAAC,CAAC;EAC7B,MAAMS,eAAe,GAAGJ,iBAAiB,CAAC,CAAC;EAC3C,MAAMK,YAAY,GAAGd,cAAc,CAAsB,IAAI,CAAC;EAC9D,MAAM;IAAEe;EAAc,CAAC,GAAGb,wBAAwB,CAAC,CAAC;EAEpD,MAAMc,WAAW,GAAGJ,OAAO,CAACK,OAAO,CAACC,cAAc,KAAK,IAAI;EAE3D,MAAM;IAAEC,UAAU;IAAEC,aAAa;IAAEC,aAAa;IAAEC;EAAuB,CAAC,GACzErB,gBAAgB,CAAC;IAChBa,YAAY;IACZD;EACD,CAAC,CAAC;EAEH,MAAMU,KAAyB,GAAG;IACjCJ,UAAU;IACVC,aAAa;IACbN,YAAY;IACZO,aAAa;IACbC,sBAAsB;IACtBT,eAAe;IACfK,cAAc,EAAEF;EACjB,CAAC;EAED,OAAO;IACNO,KAAK;IACLZ,QAAQ,eACPL,IAAA,CAACP,eAAe;MAACyB,OAAO,EAAEL,UAAW;MAAAR,QAAA,eACpCL,IAAA,CAACR,IAAI;QAAC2B,KAAK,EAAEC,MAAM,CAACC,SAAU;QAACZ,aAAa,EAAEA,aAAc;QAAAJ,QAAA,EAC1DA;MAAQ,CACJ;IAAC,CACS;EAEnB,CAAC;AACF,CAAC,CAAC;AAEF,MAAMe,MAAM,GAAG7B,UAAU,CAAC+B,MAAM,CAAC;EAChCD,SAAS,EAAE;IACVE,IAAI,EAAE;EACP;AACD,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useNavigationState","useEffect","useMemo","useSharedValue","useBuildGestures","GestureStore","StackType","createProvider","computeClaimedDirections","useKeys","useStackCoreContext","NO_CLAIMS","vertical","horizontal","DIRECTIONS","useRegisterDirectionClaims","ancestorContext","claimedDirections","routeKey","isIsolated","isCurrentRoute","gestureValues","getRouteGestures","isDismissing","claimedAncestors","ancestor","shadowedDirections","dir","push","length","directions","newClaims","childDirectionClaims","value","currentClaims","needsUpdate","ScreenGestureProvider","useScreenGestureContext","useGestureContext","guarded","children","current","flags","hasGestures","options","gestureEnabled","STACK_TYPE","COMPONENT","hasSnapPoints","Array","isArray","snapPoints","gestureDirection","route","key","state","routes","index","scrollConfig","panGesture","panGestureRef","gestureAnimationValues"],"sourceRoot":"../../../../src","sources":["shared/providers/gestures.provider.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAG1C,SAASC,cAAc,QAAQ,yBAAyB;AACxD,SAASC,gBAAgB,QAAQ,sCA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UAAU;IACVC,aAAa;IACbF,YAAY;IACZG,sBAAsB;IACtB7C,eAAe;IACf6B,cAAc,EAAEF,WAAW;IAC3BxB,UAAU;IACVF,iBAAiB;IACjBe;EACD,CAAC;EAED,OAAO;IACNC,KAAK;IACLO;EACD,CAAC;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Gesture Ownership System Types
5
+ *
6
+ * Core principles:
7
+ * 1. Gestures dismiss stacks, not screens
8
+ * 2. Ownership is per-direction (4 independent directions)
9
+ * 3. Shadowing: child claiming same direction blocks parent
10
+ * 4. Inheritance: no local claim walks up tree to find owner
11
+ */
12
+
13
+ /**
14
+ * The four independent gesture directions.
15
+ * Each direction is owned independently.
16
+ *
17
+ * Uses the same format as GestureDirection from gesture.types.ts
18
+ * (excluding 'bidirectional' which expands to all four).
19
+ */
20
+
21
+ /**
22
+ * All possible directions as an array for iteration.
23
+ */
24
+ export const DIRECTIONS = ["vertical", "vertical-inverted", "horizontal", "horizontal-inverted"];
25
+
26
+ /**
27
+ * Map of which directions a screen claims ownership of.
28
+ * A screen claims a direction when:
29
+ * - gestureEnabled is true AND
30
+ * - gestureDirection includes that direction
31
+ *
32
+ * For snap points, both directions on the axis are claimed automatically.
33
+ */
34
+
35
+ /**
36
+ * Empty claims - used when gestureEnabled is false.
37
+ */
38
+ export const NO_CLAIMS = {
39
+ vertical: false,
40
+ "vertical-inverted": false,
41
+ horizontal: false,
42
+ "horizontal-inverted": false
43
+ };
44
+
45
+ /**
46
+ * Ownership status for a direction relative to the current screen.
47
+ *
48
+ * - 'self': Current screen owns this direction (should activate)
49
+ * - 'ancestor': An ancestor owns this direction (should fail to bubble up)
50
+ * - 'none': No one owns this direction (should fail, no gesture response)
51
+ */
52
+
53
+ /**
54
+ * Map of ownership status for all four directions.
55
+ * Pre-computed during render for worklet access.
56
+ */
57
+
58
+ /**
59
+ * Empty ownership - used when no gestures are configured anywhere.
60
+ */
61
+ export const NO_OWNERSHIP = {
62
+ vertical: "none",
63
+ "vertical-inverted": "none",
64
+ horizontal: "none",
65
+ "horizontal-inverted": "none"
66
+ };
67
+ //# sourceMappingURL=ownership.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["DIRECTIONS","NO_CLAIMS","vertical","horizontal","NO_OWNERSHIP"],"sourceRoot":"../../../../src","sources":["shared/types/ownership.types.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA;AACA;AACA;AACA,OAAO,MAAMA,UAAuB,GAAG,CACtC,UAAU,EACV,mBAAmB,EACnB,YAAY,EACZ,qBAAqB,CACrB;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA,OAAO,MAAMC,SAA4B,GAAG;EAC3CC,QAAQ,EAAE,KAAK;EACf,mBAAmB,EAAE,KAAK;EAC1BC,UAAU,EAAE,KAAK;EACjB,qBAAqB,EAAE;AACxB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA,OAAO,MAAMC,YAAgC,GAAG;EAC/CF,QAAQ,EAAE,MAAM;EAChB,mBAAmB,EAAE,MAAM;EAC3BC,UAAU,EAAE,MAAM;EAClB,qBAAqB,EAAE;AACxB,CAAC","ignoreList":[]}
@@ -223,141 +223,85 @@ export const applyOffsetRules = ({
223
223
  isSwipingLeft
224
224
  };
225
225
  };
226
+
226
227
  /**
227
- * Checks if a gesture should activate based on scroll position.
228
- * Returns the direction to activate for, or null if activation should not occur.
228
+ * Checks if a ScrollView is at its boundary for the given swipe direction.
229
+ * This is a simplified boundary check that respects axis isolation.
230
+ *
231
+ * Per the spec:
232
+ * - A vertical ScrollView never yields to horizontal gestures
233
+ * - A horizontal ScrollView never yields to vertical gestures
234
+ * - ScrollView must be at boundary before yielding control
235
+ *
236
+ * For snap point sheets, the boundary depends on where the sheet originates from:
237
+ * - Bottom sheet (vertical): scrollY = 0 (top/base)
238
+ * - Top sheet (verticalInverted): scrollY >= maxY (bottom/end)
239
+ * - Right drawer (horizontal): scrollX = 0 (left/base)
240
+ * - Left drawer (horizontalInverted): scrollX >= maxX (right/end)
241
+ *
242
+ * The rule: "when the ScrollView can't scroll any further in the direction
243
+ * the sheet came from, yield to the gesture."
244
+ *
245
+ * @param scrollConfig - The current scroll state
246
+ * @param direction - The swipe direction to check
247
+ * @param snapAxisInverted - For snap point sheets, whether the axis is inverted (top sheet / left drawer)
248
+ * @returns true if at boundary (gesture should activate), false otherwise
229
249
  */
230
- export function checkScrollAwareActivation({
231
- swipeInfo,
232
- directions,
233
- scrollConfig,
234
- hasSnapPoints,
235
- canExpandMore
236
- }) {
250
+ export function checkScrollBoundary(scrollConfig, direction, snapAxisInverted) {
237
251
  "worklet";
238
252
 
253
+ if (!scrollConfig) {
254
+ // No scroll config means no ScrollView - allow gesture
255
+ return true;
256
+ }
239
257
  const {
240
- isSwipingDown,
241
- isSwipingUp,
242
- isSwipingRight,
243
- isSwipingLeft
244
- } = swipeInfo;
258
+ x: scrollX,
259
+ y: scrollY,
260
+ contentWidth,
261
+ contentHeight,
262
+ layoutWidth,
263
+ layoutHeight
264
+ } = scrollConfig;
245
265
 
246
- // Extract scroll values from config
247
- const scrollX = scrollConfig?.x ?? 0;
248
- const scrollY = scrollConfig?.y ?? 0;
249
- const maxScrollX = scrollConfig ? scrollConfig.contentWidth - scrollConfig.layoutWidth : 0;
250
- const maxScrollY = scrollConfig ? scrollConfig.contentHeight - scrollConfig.layoutHeight : 0;
251
- const snapAxisInverted = directions.snapAxisInverted;
266
+ // Calculate max scroll values
267
+ const maxScrollX = Math.max(0, contentWidth - layoutWidth);
268
+ const maxScrollY = Math.max(0, contentHeight - layoutHeight);
252
269
 
253
- // With snap points, gestures should only activate based on the PRIMARY scroll edge
254
- // (the edge where the sheet originates from), not the opposite edge.
255
- // This prevents the auto-enabled opposite direction from hijacking scrolls.
256
- if (hasSnapPoints) {
257
- const isVerticalAxis = directions.vertical || directions.verticalInverted;
258
- const isHorizontalAxis = directions.horizontal || directions.horizontalInverted;
259
- if (isVerticalAxis) {
260
- if (snapAxisInverted) {
261
- // Sheet from TOP (vertical-inverted): only activate at scroll BOTTOM
262
- if (scrollY >= maxScrollY) {
263
- if (isSwipingUp) {
264
- return {
265
- shouldActivate: true,
266
- direction: "vertical-inverted"
267
- };
268
- }
269
- if (isSwipingDown && canExpandMore) {
270
- return {
271
- shouldActivate: true,
272
- direction: "vertical"
273
- };
274
- }
275
- }
276
- } else {
277
- // Sheet from BOTTOM (vertical): only activate at scroll TOP
278
- if (scrollY <= 0) {
279
- if (isSwipingDown) {
280
- return {
281
- shouldActivate: true,
282
- direction: "vertical"
283
- };
284
- }
285
- if (isSwipingUp && canExpandMore) {
286
- return {
287
- shouldActivate: true,
288
- direction: "vertical-inverted"
289
- };
290
- }
291
- }
292
- }
293
- }
294
- if (isHorizontalAxis) {
295
- if (snapAxisInverted) {
296
- // Sheet from LEFT (horizontal-inverted): only activate at scroll RIGHT
297
- if (scrollX >= maxScrollX) {
298
- if (isSwipingLeft) {
299
- return {
300
- shouldActivate: true,
301
- direction: "horizontal-inverted"
302
- };
303
- }
304
- if (isSwipingRight && canExpandMore) {
305
- return {
306
- shouldActivate: true,
307
- direction: "horizontal"
308
- };
309
- }
310
- }
311
- } else {
312
- // Sheet from RIGHT (horizontal): only activate at scroll LEFT
313
- if (scrollX <= 0) {
314
- if (isSwipingRight) {
315
- return {
316
- shouldActivate: true,
317
- direction: "horizontal"
318
- };
319
- }
320
- if (isSwipingLeft && canExpandMore) {
321
- return {
322
- shouldActivate: true,
323
- direction: "horizontal-inverted"
324
- };
325
- }
326
- }
327
- }
270
+ // For snap point sheets (snapAxisInverted is defined), boundary depends on sheet origin
271
+ // Even if content isn't scrollable, respect bounce/overscroll state
272
+ if (snapAxisInverted !== undefined) {
273
+ const isVerticalDirection = direction === "vertical" || direction === "vertical-inverted";
274
+ if (isVerticalDirection) {
275
+ // Bottom sheet (not inverted): boundary at scroll top
276
+ // Top sheet (inverted): boundary at scroll bottom
277
+ return snapAxisInverted ? scrollY >= maxScrollY : scrollY <= 0;
328
278
  }
329
- return {
330
- shouldActivate: false,
331
- direction: null
332
- };
333
- }
334
- if (directions.vertical && isSwipingDown && scrollY <= 0) {
335
- return {
336
- shouldActivate: true,
337
- direction: "vertical"
338
- };
279
+ // Horizontal direction
280
+ // Right drawer (not inverted): boundary at scroll left
281
+ // Left drawer (inverted): boundary at scroll right
282
+ return snapAxisInverted ? scrollX >= maxScrollX : scrollX <= 0;
339
283
  }
340
- if (directions.horizontal && isSwipingRight && scrollX <= 0) {
341
- return {
342
- shouldActivate: true,
343
- direction: "horizontal"
344
- };
345
- }
346
- if (directions.verticalInverted && isSwipingUp && scrollY >= maxScrollY) {
347
- return {
348
- shouldActivate: true,
349
- direction: "vertical-inverted"
350
- };
351
- }
352
- if (directions.horizontalInverted && isSwipingLeft && scrollX >= maxScrollX) {
353
- return {
354
- shouldActivate: true,
355
- direction: "horizontal-inverted"
356
- };
284
+
285
+ // Non-sheet screens: each direction has its own boundary
286
+ switch (direction) {
287
+ case "vertical":
288
+ // Swipe down - check if at top of vertical scroll
289
+ // Even if content isn't scrollable, respect bounce/overscroll state
290
+ return scrollY <= 0;
291
+ case "vertical-inverted":
292
+ // Swipe up - check if at bottom of vertical scroll
293
+ // Even if content isn't scrollable, respect bounce/overscroll state
294
+ return scrollY >= maxScrollY;
295
+ case "horizontal":
296
+ // Swipe right - check if at left of horizontal scroll
297
+ // Even if content isn't scrollable, respect bounce/overscroll state
298
+ return scrollX <= 0;
299
+ case "horizontal-inverted":
300
+ // Swipe left - check if at right of horizontal scroll
301
+ // Even if content isn't scrollable, respect bounce/overscroll state
302
+ return scrollX >= maxScrollX;
303
+ default:
304
+ return true;
357
305
  }
358
- return {
359
- shouldActivate: false,
360
- direction: null
361
- };
362
306
  }
363
307
  //# sourceMappingURL=check-gesture-activation.js.map
@@ -1 +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","checkScrollAwareActivation","swipeInfo","scrollConfig","hasSnapPoints","canExpandMore","scrollX","scrollY","maxScrollX","contentWidth","layoutWidth","maxScrollY","contentHeight","layoutHeight","snapAxisInverted","isVerticalAxis","isHorizontalAxis","direction"],"sourceRoot":"../../../../../src","sources":["shared/utils/gesture/check-gesture-activation.ts"],"mappings":";;AAGA,SAGCA,kBAAkB,QAEZ,2BAA2B;AAyDlC;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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EA,OAAO;IAAEzC,cAAc,EAAE,KAAK;IAAEyC,SAAS,EAAE;EAAK,CAAC;AAClD","ignoreList":[]}
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","checkScrollBoundary","scrollConfig","direction","snapAxisInverted","scrollX","scrollY","contentWidth","contentHeight","layoutWidth","layoutHeight","maxScrollX","max","maxScrollY","undefined","isVerticalDirection"],"sourceRoot":"../../../../../src","sources":["shared/utils/gesture/check-gesture-activation.ts"],"mappings":";;AAGA,SAGCA,kBAAkB,QAEZ,2BAA2B;AA0DlC;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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;EAEA,MAAM;IACLxD,CAAC,EAAE2D,OAAO;IACVvD,CAAC,EAAEwD,OAAO;IACVC,YAAY;IACZC,aAAa;IACbC,WAAW;IACXC;EACD,CAAC,GAAGR,YAAY;;EAEhB;EACA,MAAMS,UAAU,GAAGtD,IAAI,CAACuD,GAAG,CAAC,CAAC,EAAEL,YAAY,GAAGE,WAAW,CAAC;EAC1D,MAAMI,UAAU,GAAGxD,IAAI,CAACuD,GAAG,CAAC,CAAC,EAAEJ,aAAa,GAAGE,YAAY,CAAC;;EAE5D;EACA;EACA,IAAIN,gBAAgB,KAAKU,SAAS,EAAE;IACnC,MAAMC,mBAAmB,GACxBZ,SAAS,KAAK,UAAU,IAAIA,SAAS,KAAK,mBAAmB;IAE9D,IAAIY,mBAAmB,EAAE;MACxB;MACA;MACA,OAAOX,gBAAgB,GAAGE,OAAO,IAAIO,UAAU,GAAGP,OAAO,IAAI,CAAC;IAC/D;IACA;IACA;IACA;IACA,OAAOF,gBAAgB,GAAGC,OAAO,IAAIM,UAAU,GAAGN,OAAO,IAAI,CAAC;EAC/D;;EAEA;EACA,QAAQF,SAAS;IAChB,KAAK,UAAU;MACd;MACA;MACA,OAAOG,OAAO,IAAI,CAAC;IAEpB,KAAK,mBAAmB;MACvB;MACA;MACA,OAAOA,OAAO,IAAIO,UAAU;IAE7B,KAAK,YAAY;MAChB;MACA;MACA,OAAOR,OAAO,IAAI,CAAC;IAEpB,KAAK,qBAAqB;MACzB;MACA;MACA,OAAOA,OAAO,IAAIM,UAAU;IAE7B;MACC,OAAO,IAAI;EACb;AACD","ignoreList":[]}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+
3
+ import { NO_CLAIMS } from "../../types/ownership.types";
4
+
5
+ /**
6
+ * Computes which directions a screen claims ownership of.
7
+ *
8
+ * A screen claims a direction when:
9
+ * 1. gestureEnabled is true AND
10
+ * 2. gestureDirection includes that direction
11
+ *
12
+ * For snap points, both directions on the axis are claimed automatically.
13
+ * This is because a snap point sheet handles both expand (inverse) and collapse (primary) gestures.
14
+ *
15
+ * @param gestureEnabled - Whether gestures are enabled for this screen
16
+ * @param gestureDirection - The gesture direction(s) configured for this screen
17
+ * @param hasSnapPoints - Whether this screen has snap points configured
18
+ * @returns The claimed directions for this screen
19
+ */
20
+ export function computeClaimedDirections(gestureEnabled, gestureDirection, hasSnapPoints) {
21
+ // If gestures are not enabled, claim nothing
22
+ if (!gestureEnabled) {
23
+ return NO_CLAIMS;
24
+ }
25
+
26
+ // Default to vertical if no direction specified
27
+ const direction = gestureDirection ?? "vertical";
28
+
29
+ // Normalize to array
30
+ const directions = Array.isArray(direction) ? direction : [direction];
31
+
32
+ // Start with no claims
33
+ const claims = {
34
+ vertical: false,
35
+ "vertical-inverted": false,
36
+ horizontal: false,
37
+ "horizontal-inverted": false
38
+ };
39
+
40
+ // Process each direction
41
+ for (const dir of directions) {
42
+ if (dir === "bidirectional") {
43
+ // Bidirectional claims all four directions
44
+ claims.vertical = true;
45
+ claims["vertical-inverted"] = true;
46
+ claims.horizontal = true;
47
+ claims["horizontal-inverted"] = true;
48
+ } else {
49
+ // Claim the specific direction
50
+ claims[dir] = true;
51
+ }
52
+ }
53
+
54
+ // For snap points, claim both directions on the axis
55
+ // This enables both expand (inverse) and collapse/dismiss (primary) gestures
56
+ if (hasSnapPoints) {
57
+ const hasVerticalAxis = claims.vertical || claims["vertical-inverted"];
58
+ const hasHorizontalAxis = claims.horizontal || claims["horizontal-inverted"];
59
+ if (hasVerticalAxis) {
60
+ claims.vertical = true;
61
+ claims["vertical-inverted"] = true;
62
+ }
63
+ if (hasHorizontalAxis) {
64
+ claims.horizontal = true;
65
+ claims["horizontal-inverted"] = true;
66
+ }
67
+ }
68
+ return claims;
69
+ }
70
+
71
+ /**
72
+ * Checks if any direction is claimed.
73
+ */
74
+ export function claimsAnyDirection(claims) {
75
+ return claims.vertical || claims["vertical-inverted"] || claims.horizontal || claims["horizontal-inverted"];
76
+ }
77
+ //# sourceMappingURL=compute-claimed-directions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NO_CLAIMS","computeClaimedDirections","gestureEnabled","gestureDirection","hasSnapPoints","direction","directions","Array","isArray","claims","vertical","horizontal","dir","hasVerticalAxis","hasHorizontalAxis","claimsAnyDirection"],"sourceRoot":"../../../../../src","sources":["shared/utils/gesture/compute-claimed-directions.ts"],"mappings":";;AACA,SAGCA,SAAS,QACH,6BAA6B;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,wBAAwBA,CACvCC,cAAuB,EACvBC,gBAAmE,EACnEC,aAAsB,EACF;EACpB;EACA,IAAI,CAACF,cAAc,EAAE;IACpB,OAAOF,SAAS;EACjB;;EAEA;EACA,MAAMK,SAAS,GAAGF,gBAAgB,IAAI,UAAU;;EAEhD;EACA,MAAMG,UAA8B,GAAGC,KAAK,CAACC,OAAO,CAACH,SAAS,CAAC,GAC5DA,SAAS,GACT,CAACA,SAAS,CAAC;;EAEd;EACA,MAAMI,MAAyB,GAAG;IACjCC,QAAQ,EAAE,KAAK;IACf,mBAAmB,EAAE,KAAK;IAC1BC,UAAU,EAAE,KAAK;IACjB,qBAAqB,EAAE;EACxB,CAAC;;EAED;EACA,KAAK,MAAMC,GAAG,IAAIN,UAAU,EAAE;IAC7B,IAAIM,GAAG,KAAK,eAAe,EAAE;MAC5B;MACAH,MAAM,CAACC,QAAQ,GAAG,IAAI;MACtBD,MAAM,CAAC,mBAAmB,CAAC,GAAG,IAAI;MAClCA,MAAM,CAACE,UAAU,GAAG,IAAI;MACxBF,MAAM,CAAC,qBAAqB,CAAC,GAAG,IAAI;IACrC,CAAC,MAAM;MACN;MACAA,MAAM,CAACG,GAAG,CAAc,GAAG,IAAI;IAChC;EACD;;EAEA;EACA;EACA,IAAIR,aAAa,EAAE;IAClB,MAAMS,eAAe,GAAGJ,MAAM,CAACC,QAAQ,IAAID,MAAM,CAAC,mBAAmB,CAAC;IACtE,MAAMK,iBAAiB,GACtBL,MAAM,CAACE,UAAU,IAAIF,MAAM,CAAC,qBAAqB,CAAC;IAEnD,IAAII,eAAe,EAAE;MACpBJ,MAAM,CAACC,QAAQ,GAAG,IAAI;MACtBD,MAAM,CAAC,mBAAmB,CAAC,GAAG,IAAI;IACnC;IACA,IAAIK,iBAAiB,EAAE;MACtBL,MAAM,CAACE,UAAU,GAAG,IAAI;MACxBF,MAAM,CAAC,qBAAqB,CAAC,GAAG,IAAI;IACrC;EACD;EAEA,OAAOA,MAAM;AACd;;AAEA;AACA;AACA;AACA,OAAO,SAASM,kBAAkBA,CAACN,MAAyB,EAAW;EACtE,OACCA,MAAM,CAACC,QAAQ,IACfD,MAAM,CAAC,mBAAmB,CAAC,IAC3BA,MAAM,CAACE,UAAU,IACjBF,MAAM,CAAC,qBAAqB,CAAC;AAE/B","ignoreList":[]}
@@ -12,7 +12,7 @@ export function determineSnapTarget({
12
12
  snapPoints,
13
13
  velocity,
14
14
  dimension,
15
- velocityFactor = 0.15,
15
+ velocityFactor = 0.1,
16
16
  canDismiss = true
17
17
  }) {
18
18
  "worklet";
@@ -1 +1 @@
1
- {"version":3,"names":["determineSnapTarget","currentProgress","snapPoints","velocity","dimension","velocityFactor","canDismiss","velocityInProgress","projectedProgress","allTargets","sort","a","b","targetProgress","i","length","current","next","undefined","midpoint","shouldDismiss"],"sourceRoot":"../../../../../src","sources":["shared/utils/gesture/determine-snap-target.ts"],"mappings":";;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,mBAAmBA,CAAC;EACnCC,eAAe;EACfC,UAAU;EACVC,QAAQ;EACRC,SAAS;EACTC,cAAc,GAAG,IAAI;EACrBC,UAAU,GAAG;AACY,CAAC,EAA6B;EACvD,SAAS;;EAET;EACA,MAAMC,kBAAkB,GAAIJ,QAAQ,GAAGC,SAAS,GAAIC,cAAc;;EAElE;EACA,MAAMG,iBAAiB,GAAGP,eAAe,GAAGM,kBAAkB;;EAE9D;EACA,MAAME,UAAU,GAAGH,UAAU,GAC1B,CAAC,CAAC,EAAE,GAAGJ,UAAU,CAAC,CAACQ,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,GAAGC,CAAC,CAAC,GACxC,CAAC,GAAGV,UAAU,CAAC,CAACQ,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,GAAGC,CAAC,CAAC;;EAExC;EACA;EACA,IAAIC,cAAc,GAAGJ,UAAU,CAAC,CAAC,CAAC;EAElC,KAAK,IAAIK,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGL,UAAU,CAACM,MAAM,EAAED,CAAC,EAAE,EAAE;IAC3C,MAAME,OAAO,GAAGP,UAAU,CAACK,CAAC,CAAC;IAC7B,MAAMG,IAAI,GAAGR,UAAU,CAACK,CAAC,GAAG,CAAC,CAAC;IAE9B,IAAIG,IAAI,KAAKC,SAAS,EAAE;MACvB;MACAL,cAAc,GAAGG,OAAO;MACxB;IACD;IAEA,MAAMG,QAAQ,GAAG,CAACH,OAAO,GAAGC,IAAI,IAAI,CAAC;IAErC,IAAIT,iBAAiB,GAAGW,QAAQ,EAAE;MACjCN,cAAc,GAAGG,OAAO;MACxB;IACD;IAEAH,cAAc,GAAGI,IAAI;EACtB;EAEA,OAAO;IACNJ,cAAc;IACdO,aAAa,EAAEP,cAAc,KAAK;EACnC,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["determineSnapTarget","currentProgress","snapPoints","velocity","dimension","velocityFactor","canDismiss","velocityInProgress","projectedProgress","allTargets","sort","a","b","targetProgress","i","length","current","next","undefined","midpoint","shouldDismiss"],"sourceRoot":"../../../../../src","sources":["shared/utils/gesture/determine-snap-target.ts"],"mappings":";;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,mBAAmBA,CAAC;EACnCC,eAAe;EACfC,UAAU;EACVC,QAAQ;EACRC,SAAS;EACTC,cAAc,GAAG,GAAG;EACpBC,UAAU,GA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