react-native-swipeable-actions 0.1.12 → 1.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +147 -0
  2. package/LICENSE +21 -0
  3. package/README.md +377 -207
  4. package/android/src/main/java/expo/modules/swipeable/SwipePhysics.kt +39 -0
  5. package/android/src/main/java/expo/modules/swipeable/SwipeableModule.kt +24 -10
  6. package/android/src/main/java/expo/modules/swipeable/SwipeableView.kt +804 -420
  7. package/build/Swipeable.d.ts +3 -8
  8. package/build/Swipeable.d.ts.map +1 -1
  9. package/build/Swipeable.js +87 -33
  10. package/build/Swipeable.js.map +1 -1
  11. package/build/Swipeable.types.d.ts +59 -9
  12. package/build/Swipeable.types.d.ts.map +1 -1
  13. package/build/SwipeableActions.d.ts +1 -1
  14. package/build/SwipeableActions.d.ts.map +1 -1
  15. package/build/SwipeableActions.js +4 -2
  16. package/build/SwipeableActions.js.map +1 -1
  17. package/build/SwipeableView.d.ts +11 -2
  18. package/build/SwipeableView.d.ts.map +1 -1
  19. package/build/SwipeableView.js.map +1 -1
  20. package/build/constants.d.ts +0 -1
  21. package/build/constants.d.ts.map +1 -1
  22. package/build/constants.js +0 -1
  23. package/build/constants.js.map +1 -1
  24. package/build/index.d.ts +1 -1
  25. package/build/index.d.ts.map +1 -1
  26. package/build/index.js.map +1 -1
  27. package/build/nativeModuleUtils.d.ts +3 -1
  28. package/build/nativeModuleUtils.d.ts.map +1 -1
  29. package/build/nativeModuleUtils.js +20 -9
  30. package/build/nativeModuleUtils.js.map +1 -1
  31. package/build/resolveSwipeableActions.d.ts +18 -0
  32. package/build/resolveSwipeableActions.d.ts.map +1 -0
  33. package/build/resolveSwipeableActions.js +26 -0
  34. package/build/resolveSwipeableActions.js.map +1 -0
  35. package/docs/migration-v1.md +191 -0
  36. package/docs/support.md +90 -0
  37. package/ios/SwipeAnimationConfig.swift +32 -0
  38. package/ios/SwipePhysics.swift +418 -0
  39. package/ios/SwipeableModule.swift +34 -12
  40. package/ios/SwipeableView.swift +1062 -613
  41. package/jestSetup.js +17 -5
  42. package/package.json +11 -5
  43. package/src/Swipeable.tsx +147 -54
  44. package/src/Swipeable.types.ts +50 -9
  45. package/src/SwipeableActions.tsx +6 -3
  46. package/src/SwipeableView.tsx +10 -3
  47. package/src/constants.ts +0 -1
  48. package/src/index.ts +7 -0
  49. package/src/nativeModuleUtils.ts +19 -8
  50. package/src/resolveSwipeableActions.ts +37 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,147 @@
1
+ # Changelog
2
+
3
+ All notable changes to this package are recorded here. GitHub release notes use
4
+ the entry for the matching version.
5
+
6
+ ## Unreleased
7
+
8
+ ## 1.0.0 - 2026-10-20
9
+
10
+ First stable v1 release. Install it with
11
+ `npx expo install react-native-swipeable-actions@^1`. Rebuild the iOS and Android
12
+ apps after you upgrade. Read the [v1 migration guide](docs/migration-v1.md).
13
+ The package code is the same as in 1.0.0-rc.0. The lists below are the changes
14
+ since 0.1.12.
15
+
16
+ ### BREAKING CHANGES
17
+
18
+ - The package requires the New Architecture (Fabric) on iOS and Android. The
19
+ legacy architecture (Paper) is not supported. The iOS view does not compile on it.
20
+ - The minimum peer versions are now Expo SDK 54 (`expo >=54.0.0`), React Native
21
+ 0.81 (`react-native >=0.81.0`) and React 19.1 (`react >=19.1.0`).
22
+ - Removed `actions`, `actionsWidth` and `actionsPosition`. Pass explicit pairs:
23
+ `rightActions` + `rightActionsWidth` and/or `leftActions` + `leftActionsWidth`
24
+ ([#15](https://github.com/chocky335/react-native-swipeable-actions/issues/15)).
25
+ - Removed `SWIPE_DEFAULTS.ACTIONS_POSITION`. There is no default side.
26
+ - Removed `actionsWidth` and `actionsPosition` from the raw `SwipeableView` props.
27
+ - `SwipeableProps` is now a union type of valid side configurations, not an
28
+ interface. Use `SwipeableProps & { ... }` for wrapper props.
29
+ - Every row uses one native engine. Rows migrated from the single-sided API take
30
+ its behavior:
31
+ - A drag toward a disabled side stays closed and does not start a swipe. The
32
+ old wrong-direction rubber band is gone.
33
+ - `onSwipeStateChange` follows the active side. Do not depend on the old
34
+ callback cadence.
35
+ - `close(false)` and `cancel()` also clear the cached open state for the key.
36
+ - Cache restoration and width updates are not swipes. Do not use the swipe
37
+ callbacks to detect them.
38
+ - `open()` with no side opens the right side if it is enabled, else the left side.
39
+
40
+ ### Added
41
+
42
+ - Independent left and right actions on one row, each with its own width.
43
+ - `open(side)` and `Swipeable.open(key, side)`.
44
+ - `onLeftSwipeEnd` and `onRightSwipeEnd`. They run after `onSwipeEnd`.
45
+ - Opt-in `appearance="ios26"` iOS action motion, and the `hapticFeedback`
46
+ prop for the iOS threshold haptic. Reduce Motion removes the motion scaling
47
+ ([#19](https://github.com/chocky335/react-native-swipeable-actions/issues/19)).
48
+ - Type exports `SwipeSide`, `SwipeAppearance`, `SwipeableCommonProps`,
49
+ `SwipeStartEvent`, and the aliases `TwoSidedSwipeableProps` and
50
+ `SwipeableComponentProps`.
51
+
52
+ ### Fixed
53
+
54
+ - Action alignment on the physical edge in RTL layouts.
55
+ - A recycled or rebound row no longer receives commands, callbacks or open state
56
+ from its previous key.
57
+ - A drag that crosses the closed position no longer opens the opposite side.
58
+ - On Android, content replaced during a drag no longer keeps the drag offset.
59
+ - `Swipeable.closeAll()` now also closes rows that are not mounted (scrolled off
60
+ or on a covered screen), like `Swipeable.close(key)`.
61
+ - `expo-modules-core` is no longer a peer dependency. A fresh `npm install`
62
+ could pull a newer expo-modules-core than the app's Expo SDK uses. The app now
63
+ gets the version its `expo` package brings.
64
+ - The shipped Jest mock (`jestSetup.js`) no longer calls `onSwipeStart` when a row
65
+ mounts. Tests that relied on that call must fire the native event themselves,
66
+ as the README shows.
67
+ - On Android, a swipe with no touch events for 5 seconds is now cancelled
68
+ without an `onSwipeEnd`, and the rest of that touch is ignored.
69
+ - A cancelled swipe now reports the position where the row settles to
70
+ `onProgress` and `onSwipeStateChange`, so a progress UI does not stay mid-drag.
71
+ - An `autoClose` row that a cancelled drag returns to open now waits
72
+ `autoCloseTimeout` again and closes. Before, it stayed open.
73
+ - On iOS, a pan that has not passed `dragOffsetFromEdge` no longer stops a
74
+ pending auto-close or a settling animation. That work and a props change also
75
+ no longer swallow the pan, so the pan can still start a swipe, like on Android.
76
+
77
+ ## 1.0.0-rc.0 - 2026-10-17
78
+
79
+ First release candidate for 1.0.0. Install it with
80
+ `npm install react-native-swipeable-actions@next`. Rebuild the iOS and Android
81
+ apps after you upgrade. Read the [v1 migration guide](docs/migration-v1.md).
82
+
83
+ ### BREAKING CHANGES
84
+
85
+ - The package requires the New Architecture (Fabric) on iOS and Android. The
86
+ legacy architecture (Paper) is not supported. The iOS view does not compile on it.
87
+ - The minimum peer versions are now Expo SDK 54 (`expo >=54.0.0`), React Native
88
+ 0.81 (`react-native >=0.81.0`) and React 19.1 (`react >=19.1.0`).
89
+ - Removed `actions`, `actionsWidth` and `actionsPosition`. Pass explicit pairs:
90
+ `rightActions` + `rightActionsWidth` and/or `leftActions` + `leftActionsWidth`
91
+ ([#15](https://github.com/chocky335/react-native-swipeable-actions/issues/15)).
92
+ - Removed `SWIPE_DEFAULTS.ACTIONS_POSITION`. There is no default side.
93
+ - Removed `actionsWidth` and `actionsPosition` from the raw `SwipeableView` props.
94
+ - `SwipeableProps` is now a union type of valid side configurations, not an
95
+ interface. Use `SwipeableProps & { ... }` for wrapper props.
96
+ - Every row uses one native engine. Rows migrated from the single-sided API take
97
+ its behavior:
98
+ - A drag toward a disabled side stays closed and does not start a swipe. The
99
+ old wrong-direction rubber band is gone.
100
+ - `onSwipeStateChange` follows the active side. Do not depend on the old
101
+ callback cadence.
102
+ - `close(false)` and `cancel()` also clear the cached open state for the key.
103
+ - Cache restoration and width updates are not swipes. Do not use the swipe
104
+ callbacks to detect them.
105
+ - `open()` with no side opens the right side if it is enabled, else the left side.
106
+
107
+ ### Added
108
+
109
+ - Independent left and right actions on one row, each with its own width.
110
+ - `open(side)` and `Swipeable.open(key, side)`.
111
+ - `onLeftSwipeEnd` and `onRightSwipeEnd`. They run after `onSwipeEnd`.
112
+ - Opt-in `appearance="ios26"` iOS action motion, and the `hapticFeedback`
113
+ prop for the iOS threshold haptic. Reduce Motion removes the motion scaling
114
+ ([#19](https://github.com/chocky335/react-native-swipeable-actions/issues/19)).
115
+ - Type exports `SwipeSide`, `SwipeAppearance`, `SwipeableCommonProps`,
116
+ `SwipeStartEvent`, and the aliases `TwoSidedSwipeableProps` and
117
+ `SwipeableComponentProps`.
118
+
119
+ ### Fixed
120
+
121
+ - Action alignment on the physical edge in RTL layouts.
122
+ - A recycled or rebound row no longer receives commands, callbacks or open state
123
+ from its previous key.
124
+ - A drag that crosses the closed position no longer opens the opposite side.
125
+ - On Android, content replaced during a drag no longer keeps the drag offset.
126
+ - `Swipeable.closeAll()` now also closes rows that are not mounted (scrolled off
127
+ or on a covered screen), like `Swipeable.close(key)`.
128
+ - `expo-modules-core` is no longer a peer dependency. A fresh `npm install`
129
+ could pull a newer expo-modules-core than the app's Expo SDK uses. The app now
130
+ gets the version its `expo` package brings.
131
+ - The shipped Jest mock (`jestSetup.js`) no longer calls `onSwipeStart` when a row
132
+ mounts. Tests that relied on that call must fire the native event themselves,
133
+ as the README shows.
134
+ - On Android, a swipe with no touch events for 5 seconds is now cancelled
135
+ without an `onSwipeEnd`, and the rest of that touch is ignored.
136
+ - A cancelled swipe now reports the position where the row settles to
137
+ `onProgress` and `onSwipeStateChange`, so a progress UI does not stay mid-drag.
138
+ - An `autoClose` row that a cancelled drag returns to open now waits
139
+ `autoCloseTimeout` again and closes. Before, it stayed open.
140
+ - On iOS, a pan that has not passed `dragOffsetFromEdge` no longer stops a
141
+ pending auto-close or a settling animation. That work and a props change also
142
+ no longer swallow the pan, so the pan can still start a swipe, like on Android.
143
+
144
+ ## 0.1.12 and earlier
145
+
146
+ Not recorded in this file. See the
147
+ [GitHub releases](https://github.com/chocky335/react-native-swipeable-actions/releases).
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Bohdan Pomohaibo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.