Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions .changeset/swipe-event-source.md

This file was deleted.

25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# @react-native-motion-kit/swipe-deck

## 1.3.0

### Minor Changes

- [#13](https://github.com/react-native-motion-kit/react-native-swipe-deck/pull/13) [`335c5cf`](https://github.com/react-native-motion-kit/react-native-swipe-deck/commit/335c5cf0b8461e0538179b6c9c82e73e6c0c5ae4) Thanks [@saseungmin](https://github.com/saseungmin)! - Add `source` to committed swipe events so apps can distinguish gesture commits from programmatic action commits.

```tsx
ProfileDeck.useDeckEventListener("swipe", (event) => {
if (event.source === "gesture") {
console.log("User swiped", event.direction);
return;
}

console.log("Programmatic action swiped", event.direction);
});
```

`event.source` is `'gesture'` when a pan release commits the swipe and `'programmatic'` when
`actions.swipeLeft()` or `actions.swipeRight()` commits it. `programmatic` does not mean button; map
it to a button only when that matches your app's UI.

This is a TypeScript-visible event payload shape change: `source` is a required field on
`SwipeEvent<T>`, so object literals, fixtures, or `useDeckEvent('swipe', initialValue)` values must
include it.

## 1.2.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-motion-kit/swipe-deck",
"version": "1.2.0",
"version": "1.3.0",
"description": "High-performance Tinder-style swipe deck and swipe cards for React Native, powered by Reanimated and Gesture Handler.",
"keywords": [
"android",
Expand Down