From e9f7b9e4f4f49644d8a639d2835011b97d42ff3b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 12 Sep 2024 04:53:59 +0000 Subject: [PATCH 1/7] Version Packages (canary) --- .changeset/pre.json | 1 + CHANGELOG.md | 6 ++++++ package.json | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.changeset/pre.json b/.changeset/pre.json index 6a40a61c..05921c5c 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -8,6 +8,7 @@ "bright-socks-change", "brown-onions-wave", "clever-pants-approve", + "cyan-snails-move", "eighty-points-drum", "gold-onions-chew", "hungry-actors-grab", diff --git a/CHANGELOG.md b/CHANGELOG.md index add5f7ce..31607042 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # react-native-reanimated-carousel +## 4.0.0-canary.14 + +### Patch Changes + +- [#672](https://github.com/dohooo/react-native-reanimated-carousel/pull/672) [`5fa78a7`](https://github.com/dohooo/react-native-reanimated-carousel/commit/5fa78a765116d155b3fd0fabc83576e1403f13e1) Thanks [@dohooo](https://github.com/dohooo)! - revert autoPlay changes + ## 4.0.0-canary.13 ### Patch Changes diff --git a/package.json b/package.json index 072a4649..263cc262 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-reanimated-carousel", - "version": "4.0.0-canary.13", + "version": "4.0.0-canary.14", "packageManager": "yarn@4.0.2", "description": "Simple carousel component.fully implemented using Reanimated 2.Infinitely scrolling, very smooth.", "author": "Doho (https://github.com/dohooo)", From 8232a1d6b3c9240b375770d66eb486f558f97b90 Mon Sep 17 00:00:00 2001 From: Nate Massey Date: Sat, 14 Sep 2024 21:05:49 -0700 Subject: [PATCH 2/7] fix: standardize TouchableWithoutFeedback import, as per #676 -- thanks @qwertychouskie --- src/components/Pagination/Custom/index.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/Pagination/Custom/index.tsx b/src/components/Pagination/Custom/index.tsx index 2afff44a..f44b694a 100644 --- a/src/components/Pagination/Custom/index.tsx +++ b/src/components/Pagination/Custom/index.tsx @@ -1,7 +1,6 @@ import React from "react"; import type { StyleProp, ViewStyle } from "react-native"; -import { View } from "react-native"; -import { TouchableWithoutFeedback } from "react-native-gesture-handler"; +import { TouchableWithoutFeedback, View } from "react-native"; import type { SharedValue } from "react-native-reanimated"; import type { DefaultStyle } from "react-native-reanimated/lib/typescript/hook/commonTypes"; From 88c180913f23a922f05f05002b711b64b714e7d1 Mon Sep 17 00:00:00 2001 From: Nate Massey Date: Sat, 14 Sep 2024 21:10:30 -0700 Subject: [PATCH 3/7] fix: custom: lower TouchableWithoutFeedback to PaginationItem instead, re: #676 --- src/components/Pagination/Custom/PaginationItem.tsx | 9 +++++++-- src/components/Pagination/Custom/index.tsx | 13 +++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/components/Pagination/Custom/PaginationItem.tsx b/src/components/Pagination/Custom/PaginationItem.tsx index 5e2a78d5..04cac2c8 100644 --- a/src/components/Pagination/Custom/PaginationItem.tsx +++ b/src/components/Pagination/Custom/PaginationItem.tsx @@ -1,5 +1,6 @@ import type { PropsWithChildren } from "react"; import React from "react"; +import { TouchableWithoutFeedback } from "react-native"; import type { ViewStyle } from "react-native"; import type { SharedValue } from "react-native-reanimated"; import Animated, { @@ -33,6 +34,7 @@ export const PaginationItem: React.FC< horizontal?: boolean; dotStyle?: DotStyle; activeDotStyle?: DotStyle; + onPress: () => void; customReanimatedStyle?: ( progress: number, index: number, @@ -51,6 +53,7 @@ export const PaginationItem: React.FC< horizontal, children, customReanimatedStyle, + onPress, } = props; const customReanimatedStyleRef = useSharedValue({}); const handleCustomAnimation = (progress: number) => { @@ -126,6 +129,7 @@ export const PaginationItem: React.FC< ]); return ( + - {children} - + {children} + + ); }; diff --git a/src/components/Pagination/Custom/index.tsx b/src/components/Pagination/Custom/index.tsx index f44b694a..766ee3e0 100644 --- a/src/components/Pagination/Custom/index.tsx +++ b/src/components/Pagination/Custom/index.tsx @@ -1,6 +1,6 @@ import React from "react"; import type { StyleProp, ViewStyle } from "react-native"; -import { TouchableWithoutFeedback, View } from "react-native"; +import { View } from "react-native"; import type { SharedValue } from "react-native-reanimated"; import type { DefaultStyle } from "react-native-reanimated/lib/typescript/hook/commonTypes"; @@ -72,12 +72,9 @@ export const Custom = (props: ShapeProps) => { > {data.map((item, index) => { return ( - onPress?.(index)} - > (props: ShapeProps) => { horizontal={!horizontal} activeDotStyle={activeDotStyle} customReanimatedStyle={customReanimatedStyle} - > + onPress={() => onPress?.(index)} + > {renderItem?.(item, index)} - ); })} From fea3885d352a7ec72962906baa4ff67b195f7ac4 Mon Sep 17 00:00:00 2001 From: Nate Massey Date: Sat, 14 Sep 2024 21:12:54 -0700 Subject: [PATCH 4/7] fix: basic: lower TouchableWithoutFeedback to PaginationItem instead, re: #676 --- src/components/Pagination/Basic/PaginationItem.tsx | 14 +++++++++----- src/components/Pagination/Basic/index.tsx | 11 ++++------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/components/Pagination/Basic/PaginationItem.tsx b/src/components/Pagination/Basic/PaginationItem.tsx index 2d13b12f..05f9bc94 100644 --- a/src/components/Pagination/Basic/PaginationItem.tsx +++ b/src/components/Pagination/Basic/PaginationItem.tsx @@ -1,7 +1,7 @@ import type { PropsWithChildren } from "react"; import React from "react"; import type { ViewStyle } from "react-native"; -import { View } from "react-native"; +import { TouchableWithoutFeedback, View } from "react-native"; import Animated, { Extrapolation, interpolate, @@ -22,6 +22,7 @@ PropsWithChildren<{ horizontal?: boolean dotStyle?: DotStyle activeDotStyle?: DotStyle + onPress: () => void }> > = (props) => { const { @@ -33,6 +34,7 @@ PropsWithChildren<{ size, horizontal, children, + onPress, } = props; const defaultDotSize = 10; @@ -79,8 +81,9 @@ PropsWithChildren<{ }, [animValue, index, count, horizontal]); return ( - + {children} - - + + + ); }; diff --git a/src/components/Pagination/Basic/index.tsx b/src/components/Pagination/Basic/index.tsx index 8df84838..517d0155 100644 --- a/src/components/Pagination/Basic/index.tsx +++ b/src/components/Pagination/Basic/index.tsx @@ -1,6 +1,6 @@ import React from "react"; import type { StyleProp, ViewStyle } from "react-native"; -import { View, TouchableWithoutFeedback } from "react-native"; +import { View } from "react-native"; import type { SharedValue } from "react-native-reanimated"; import type { DotStyle } from "./PaginationItem"; @@ -57,11 +57,8 @@ export const Basic = (props: BasicProps) => { > {data.map((item, index) => { return ( - onPress?.(index)} - > (props: BasicProps) => { animValue={progress} horizontal={!horizontal} activeDotStyle={activeDotStyle} - > + onPress={() => onPress?.(index)} + > {renderItem?.(item, index)} - ); })} From a24442980364f88b56428bb4c0e148cbdfcc36b9 Mon Sep 17 00:00:00 2001 From: Nate Massey Date: Sat, 14 Sep 2024 21:28:39 -0700 Subject: [PATCH 5/7] fix: whitespace --- .../Pagination/Basic/PaginationItem.tsx | 44 +++++++++---------- src/components/Pagination/Basic/index.tsx | 26 +++++------ .../Pagination/Custom/PaginationItem.tsx | 28 ++++++------ src/components/Pagination/Custom/index.tsx | 24 +++++----- 4 files changed, 61 insertions(+), 61 deletions(-) diff --git a/src/components/Pagination/Basic/PaginationItem.tsx b/src/components/Pagination/Basic/PaginationItem.tsx index 05f9bc94..2974c138 100644 --- a/src/components/Pagination/Basic/PaginationItem.tsx +++ b/src/components/Pagination/Basic/PaginationItem.tsx @@ -83,32 +83,32 @@ PropsWithChildren<{ return ( - - {children} - + + {children} + ); diff --git a/src/components/Pagination/Basic/index.tsx b/src/components/Pagination/Basic/index.tsx index 517d0155..e1c679fc 100644 --- a/src/components/Pagination/Basic/index.tsx +++ b/src/components/Pagination/Basic/index.tsx @@ -57,20 +57,20 @@ export const Basic = (props: BasicProps) => { > {data.map((item, index) => { return ( - onPress?.(index)} - > - {renderItem?.(item, index)} - - ); + index={index} + size={size} + count={data.length} + dotStyle={dotStyle} + animValue={progress} + horizontal={!horizontal} + activeDotStyle={activeDotStyle} + onPress={() => onPress?.(index)} + > + {renderItem?.(item, index)} + + ); })} ); diff --git a/src/components/Pagination/Custom/PaginationItem.tsx b/src/components/Pagination/Custom/PaginationItem.tsx index 04cac2c8..56d96846 100644 --- a/src/components/Pagination/Custom/PaginationItem.tsx +++ b/src/components/Pagination/Custom/PaginationItem.tsx @@ -130,20 +130,20 @@ export const PaginationItem: React.FC< return ( - + {children} diff --git a/src/components/Pagination/Custom/index.tsx b/src/components/Pagination/Custom/index.tsx index 766ee3e0..119a9749 100644 --- a/src/components/Pagination/Custom/index.tsx +++ b/src/components/Pagination/Custom/index.tsx @@ -72,20 +72,20 @@ export const Custom = (props: ShapeProps) => { > {data.map((item, index) => { return ( - onPress?.(index)} - > - {renderItem?.(item, index)} - + size={size} + count={data.length} + dotStyle={dotStyle} + animValue={progress} + horizontal={!horizontal} + activeDotStyle={activeDotStyle} + customReanimatedStyle={customReanimatedStyle} + onPress={() => onPress?.(index)} + > + {renderItem?.(item, index)} + ); })} From 00c948bca03ab1aeeaff97e5f077b1b4cd61e2e4 Mon Sep 17 00:00:00 2001 From: Nate Massey Date: Sat, 14 Sep 2024 21:45:07 -0700 Subject: [PATCH 6/7] chore: npx changeset --- .changeset/cyan-pillows-swim.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/cyan-pillows-swim.md diff --git a/.changeset/cyan-pillows-swim.md b/.changeset/cyan-pillows-swim.md new file mode 100644 index 00000000..6e21ec2e --- /dev/null +++ b/.changeset/cyan-pillows-swim.md @@ -0,0 +1,6 @@ +--- +"react-native-reanimated-carousel": patch +--- + +fix Pagination.Basic and Pagination.Custom usage of TouchableWithoutFeedback. +This fixes press event handler not working correctly. (Thanks to @qwertychouskie for reporting!) From 19770ceabcdc3ddb2ed94385be1208e7e9fa1c2a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Sep 2024 13:39:54 +0000 Subject: [PATCH 7/7] Version Packages (canary) --- .changeset/pre.json | 1 + CHANGELOG.md | 7 +++++++ package.json | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.changeset/pre.json b/.changeset/pre.json index 05921c5c..a777c8d7 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -8,6 +8,7 @@ "bright-socks-change", "brown-onions-wave", "clever-pants-approve", + "cyan-pillows-swim", "cyan-snails-move", "eighty-points-drum", "gold-onions-chew", diff --git a/CHANGELOG.md b/CHANGELOG.md index 31607042..16cc9400 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # react-native-reanimated-carousel +## 4.0.0-canary.15 + +### Patch Changes + +- [#677](https://github.com/dohooo/react-native-reanimated-carousel/pull/677) [`00c948b`](https://github.com/dohooo/react-native-reanimated-carousel/commit/00c948bca03ab1aeeaff97e5f077b1b4cd61e2e4) Thanks [@nmassey](https://github.com/nmassey)! - fix Pagination.Basic and Pagination.Custom usage of TouchableWithoutFeedback. + This fixes press event handler not working correctly. (Thanks to @qwertychouskie for reporting!) + ## 4.0.0-canary.14 ### Patch Changes diff --git a/package.json b/package.json index 263cc262..ceabf051 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-reanimated-carousel", - "version": "4.0.0-canary.14", + "version": "4.0.0-canary.15", "packageManager": "yarn@4.0.2", "description": "Simple carousel component.fully implemented using Reanimated 2.Infinitely scrolling, very smooth.", "author": "Doho (https://github.com/dohooo)",