|
1 | 1 | # @react-native-motion-kit/swipe-deck |
2 | 2 |
|
| 3 | +## 1.5.0 |
| 4 | + |
| 5 | +### Minor Changes |
| 6 | + |
| 7 | +- [#23](https://github.com/react-native-motion-kit/react-native-swipe-deck/pull/23) [`3fecbb0`](https://github.com/react-native-motion-kit/react-native-swipe-deck/commit/3fecbb0f6a6055c4150b930f9da49740f8430d3a) Thanks [@saseungmin](https://github.com/saseungmin)! - Add opt-in upward swipe support across gestures, programmatic actions, events, interaction state, |
| 8 | + and undo, with a public live `interaction.intentDirection` source for one-at-a-time reaction UI. |
| 9 | + |
| 10 | + ```tsx |
| 11 | + function DeckControls() { |
| 12 | + const { swipeUp } = ProfileDeck.useDeckActions(); |
| 13 | + |
| 14 | + return ( |
| 15 | + <Pressable onPress={swipeUp}> |
| 16 | + <Text>Super Like</Text> |
| 17 | + </Pressable> |
| 18 | + ); |
| 19 | + } |
| 20 | + |
| 21 | + <ProfileDeck.Root |
| 22 | + data={profiles} |
| 23 | + getKey={(item) => item.id} |
| 24 | + allowedDirections={["left", "right", "up"]} |
| 25 | + > |
| 26 | + <ProfileDeck.Card> |
| 27 | + {({ item }) => <ProfileCard profile={item} />} |
| 28 | + </ProfileDeck.Card> |
| 29 | + </ProfileDeck.Root>; |
| 30 | + ``` |
| 31 | + |
| 32 | + Upward dismisses are backward-compatible and explicitly opt-in: omitting `allowedDirections` |
| 33 | + continues to allow only left and right. Gesture-driven up requires the default `drag.mode: 'free'`; |
| 34 | + horizontal drag mode rejects an upward release through the existing snap-back motion, while |
| 35 | + `swipeUp()` remains available when `'up'` is allowed. |
| 36 | + |
| 37 | + `SwipeDirection`, committed swipe and undo events, `interaction.intentDirection`, and |
| 38 | + `interaction.dismissDirection` now include `'up'`. Only centered upward gestures enter the internal |
| 39 | + up cone; upper-left and upper-right diagonals stay horizontal. When the raw semantic winner is not |
| 40 | + allowed, `intentDirection`, `progress`, `signedProgress`, and numeric `direction` stay neutral while |
| 41 | + physical card translation still follows the finger. Programmatic up actions support the existing |
| 42 | + direct and springboard action-motion recipes, and an upward card can be restored through the |
| 43 | + existing undo flow. |
| 44 | + |
| 45 | + TypeScript consumers with exhaustive `switch` statements or `Record<SwipeDirection, ...>` mappings |
| 46 | + must add an `'up'` branch even when a deck does not opt into upward dismisses. |
| 47 | + |
| 48 | +### Patch Changes |
| 49 | + |
| 50 | +- [#25](https://github.com/react-native-motion-kit/react-native-swipe-deck/pull/25) [`9be410c`](https://github.com/react-native-motion-kit/react-native-swipe-deck/commit/9be410cb8bfb82d8b739ad1899e6ff377ce64d53) Thanks [@saseungmin](https://github.com/saseungmin)! - Prevent gesture-driven dismisses from briefly jumping when the finger is released on Android. |
| 51 | + Committed swipes now animate only their primary dismiss axis, preserving the final cross-axis drag |
| 52 | + position instead of restarting an unnecessary timing animation during the gesture handoff. |
| 53 | + |
3 | 54 | ## 1.4.1 |
4 | 55 |
|
5 | 56 | ### Patch Changes |
|
0 commit comments