@lookiero/checkout 3.8.0-beta.11 → 3.8.0-beta.12
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.
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { clamp } from "@react-spring/shared";
|
|
2
1
|
import React, { useCallback, useMemo, useRef, useState } from "react";
|
|
3
2
|
import { View } from "react-native";
|
|
4
3
|
import { Gesture, GestureDetector, GestureHandlerRootView } from "react-native-gesture-handler";
|
|
@@ -9,6 +8,10 @@ const SPRING_CONFIG = {
|
|
|
9
8
|
mass: 1,
|
|
10
9
|
stiffness: 300,
|
|
11
10
|
};
|
|
11
|
+
const clamp = (min, max, value) => {
|
|
12
|
+
"worklet";
|
|
13
|
+
return Math.min(max, Math.max(min, value));
|
|
14
|
+
};
|
|
12
15
|
const Carousel2 = ({ data, children, bullets, onActiveIndexChanged }) => {
|
|
13
16
|
const [carouselDimensions, setCarouselDimensions] = useState({
|
|
14
17
|
width: 0,
|
|
@@ -60,8 +63,7 @@ const Carousel2 = ({ data, children, bullets, onActiveIndexChanged }) => {
|
|
|
60
63
|
React.createElement(View, { style: style.container, onLayout: handleOnLayout },
|
|
61
64
|
React.createElement(GestureHandlerRootView, { style: { flex: 1 } },
|
|
62
65
|
React.createElement(GestureDetector, { gesture: panGesture },
|
|
63
|
-
React.createElement(View, { style: {
|
|
64
|
-
React.createElement(Animated.View, { style: [style.carousel, { width: carouselDimensions.width * data.length }, animatedStyle] }, data.map((item, index) => (React.createElement(View, { key: index, style: [style.carouselItem, { width: carouselDimensions.width }] }, children({ index, item }))))))))),
|
|
66
|
+
React.createElement(Animated.View, { style: [style.carousel, { width: carouselDimensions.width * data.length }, animatedStyle] }, data.map((item, index) => (React.createElement(View, { key: index, style: [style.carouselItem, { width: carouselDimensions.width }] }, children({ index, item })))))))),
|
|
65
67
|
bullets({ activeIndex, count: data.length, onChange: handleOnActiveIndexChanged })));
|
|
66
68
|
};
|
|
67
69
|
export { Carousel2 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "3.8.0-beta.
|
|
3
|
+
"version": "3.8.0-beta.12",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"react-native-gesture-handler": "^2.12.0",
|
|
61
61
|
"react-native-get-random-values": "^1.8.0",
|
|
62
62
|
"react-native-web": "^0.18.11",
|
|
63
|
-
"react-native-reanimated": "^3.
|
|
63
|
+
"react-native-reanimated": "^3.3.0",
|
|
64
64
|
"react-native-reanimated-carousel": "^3.4.0",
|
|
65
65
|
"react-router-dom": "^6.8.1",
|
|
66
66
|
"react-router-native": "^6.8.1"
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"react-native-gesture-handler": "^2.12.0",
|
|
123
123
|
"react-native-get-random-values": "^1.8.0",
|
|
124
124
|
"react-native-web": "^0.18.11",
|
|
125
|
-
"react-native-reanimated": "^3.
|
|
125
|
+
"react-native-reanimated": "^3.3.0",
|
|
126
126
|
"react-native-reanimated-carousel": "^3.4.0",
|
|
127
127
|
"react-router-dom": "^6.8.1",
|
|
128
128
|
"react-router-native": "^6.8.1",
|