react-native-swipeable-actions 0.1.11 → 1.0.0-rc.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 +78 -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 +1061 -600
  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,78 @@
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-rc.0 - 2026-10-17
9
+
10
+ First release candidate for 1.0.0. Install it with
11
+ `npm install react-native-swipeable-actions@next`. Rebuild the iOS and Android
12
+ apps after you upgrade. Read the [v1 migration guide](docs/migration-v1.md).
13
+
14
+ ### BREAKING CHANGES
15
+
16
+ - The package requires the New Architecture (Fabric) on iOS and Android. The
17
+ legacy architecture (Paper) is not supported. The iOS view does not compile on it.
18
+ - The minimum peer versions are now Expo SDK 54 (`expo >=54.0.0`), React Native
19
+ 0.81 (`react-native >=0.81.0`) and React 19.1 (`react >=19.1.0`).
20
+ - Removed `actions`, `actionsWidth` and `actionsPosition`. Pass explicit pairs:
21
+ `rightActions` + `rightActionsWidth` and/or `leftActions` + `leftActionsWidth`
22
+ ([#15](https://github.com/chocky335/react-native-swipeable-actions/issues/15)).
23
+ - Removed `SWIPE_DEFAULTS.ACTIONS_POSITION`. There is no default side.
24
+ - Removed `actionsWidth` and `actionsPosition` from the raw `SwipeableView` props.
25
+ - `SwipeableProps` is now a union type of valid side configurations, not an
26
+ interface. Use `SwipeableProps & { ... }` for wrapper props.
27
+ - Every row uses one native engine. Rows migrated from the single-sided API take
28
+ its behavior:
29
+ - A drag toward a disabled side stays closed and does not start a swipe. The
30
+ old wrong-direction rubber band is gone.
31
+ - `onSwipeStateChange` follows the active side. Do not depend on the old
32
+ callback cadence.
33
+ - `close(false)` and `cancel()` also clear the cached open state for the key.
34
+ - Cache restoration and width updates are not swipes. Do not use the swipe
35
+ callbacks to detect them.
36
+ - `open()` with no side opens the right side if it is enabled, else the left side.
37
+
38
+ ### Added
39
+
40
+ - Independent left and right actions on one row, each with its own width.
41
+ - `open(side)` and `Swipeable.open(key, side)`.
42
+ - `onLeftSwipeEnd` and `onRightSwipeEnd`. They run after `onSwipeEnd`.
43
+ - Opt-in `appearance="ios26"` iOS action motion, and the `hapticFeedback`
44
+ prop for the iOS threshold haptic. Reduce Motion removes the motion scaling
45
+ ([#19](https://github.com/chocky335/react-native-swipeable-actions/issues/19)).
46
+ - Type exports `SwipeSide`, `SwipeAppearance`, `SwipeableCommonProps`,
47
+ `SwipeStartEvent`, and the aliases `TwoSidedSwipeableProps` and
48
+ `SwipeableComponentProps`.
49
+
50
+ ### Fixed
51
+
52
+ - Action alignment on the physical edge in RTL layouts.
53
+ - A recycled or rebound row no longer receives commands, callbacks or open state
54
+ from its previous key.
55
+ - A drag that crosses the closed position no longer opens the opposite side.
56
+ - On Android, content replaced during a drag no longer keeps the drag offset.
57
+ - `Swipeable.closeAll()` now also closes rows that are not mounted (scrolled off
58
+ or on a covered screen), like `Swipeable.close(key)`.
59
+ - `expo-modules-core` is no longer a peer dependency. A fresh `npm install`
60
+ could pull a newer expo-modules-core than the app's Expo SDK uses. The app now
61
+ gets the version its `expo` package brings.
62
+ - The shipped Jest mock (`jestSetup.js`) no longer calls `onSwipeStart` when a row
63
+ mounts. Tests that relied on that call must fire the native event themselves,
64
+ as the README shows.
65
+ - On Android, a swipe with no touch events for 5 seconds is now cancelled
66
+ without an `onSwipeEnd`, and the rest of that touch is ignored.
67
+ - A cancelled swipe now reports the position where the row settles to
68
+ `onProgress` and `onSwipeStateChange`, so a progress UI does not stay mid-drag.
69
+ - An `autoClose` row that a cancelled drag returns to open now waits
70
+ `autoCloseTimeout` again and closes. Before, it stayed open.
71
+ - On iOS, a pan that has not passed `dragOffsetFromEdge` no longer stops a
72
+ pending auto-close or a settling animation. That work and a props change also
73
+ no longer swallow the pan, so the pan can still start a swipe, like on Android.
74
+
75
+ ## 0.1.12 and earlier
76
+
77
+ Not recorded in this file. See the
78
+ [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.