@draftbit/core 51.0.1 → 51.0.2-134446.2
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.
- package/lib/commonjs/components/Swiper/Swiper.js +1 -1
- package/lib/typescript/src/components/Swiper/Swiper.d.ts +1 -0
- package/lib/typescript/src/components/Swiper/Swiper.js +13 -3
- package/lib/typescript/src/components/Swiper/Swiper.js.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/components/Swiper/Swiper.js +13 -3
- package/src/components/Swiper/Swiper.js.map +1 -1
- package/src/components/Swiper/Swiper.tsx +14 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "51.0.
|
|
3
|
+
"version": "51.0.2-134446.2+134446b",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"types": "lib/typescript/src/index.d.ts",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@dotlottie/react-player": "1.6.1",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/theme": "51.0.
|
|
44
|
+
"@draftbit/theme": "^51.0.2-134446.2+134446b",
|
|
45
45
|
"@emotion/react": "^11.13.5",
|
|
46
46
|
"@emotion/styled": "^11.13.5",
|
|
47
47
|
"@expo/vector-icons": "^14.0.3",
|
|
@@ -118,5 +118,5 @@
|
|
|
118
118
|
],
|
|
119
119
|
"testEnvironment": "node"
|
|
120
120
|
},
|
|
121
|
-
"gitHead": "
|
|
121
|
+
"gitHead": "134446b5c1c73e46308fb7c6fd16c57515fe59b0"
|
|
122
122
|
}
|
|
@@ -2,7 +2,7 @@ import { withTheme } from "@draftbit/theme";
|
|
|
2
2
|
import React, { forwardRef, useImperativeHandle } from "react";
|
|
3
3
|
import { View } from "react-native";
|
|
4
4
|
import SwiperComponent from "react-native-web-swiper";
|
|
5
|
-
const Swiper = forwardRef(({ theme, vertical = false, loop = false, timeout = 0, from = 0, prevTitle = "", nextTitle = "", prevTitleColor, nextTitleColor, dotsTouchable = true, dotColor = theme === null || theme === void 0 ? void 0 : theme.colors.foreground.brand, dotActiveColor = theme === null || theme === void 0 ? void 0 : theme.colors.branding.primary, data, keyExtractor, renderItem, children: childrenProp, onIndexChanged: onIndexChangedProp, onSwipe, onSwipedNext, onSwipedPrevious, minDistanceForAction, minDistanceToCapture, style, }, ref) => {
|
|
5
|
+
const Swiper = forwardRef(({ theme, vertical = false, loop = false, timeout = 0, from = 0, prevTitle = "", nextTitle = "", prevTitleColor, nextTitleColor, dotsTouchable = true, dotColor = theme === null || theme === void 0 ? void 0 : theme.colors.foreground.brand, dotActiveColor = theme === null || theme === void 0 ? void 0 : theme.colors.branding.primary, data, keyExtractor, renderItem, children: childrenProp, onIndexChanged: onIndexChangedProp, onSwipe, onSwipedNext, onSwipedPrevious, minDistanceForAction, minDistanceToCapture, style, hideDots = false, }, ref) => {
|
|
6
6
|
var _a;
|
|
7
7
|
const [currentIndex, setCurrentIndex] = React.useState(0);
|
|
8
8
|
const numberOfItems = (_a = data === null || data === void 0 ? void 0 : data.length) !== null && _a !== void 0 ? _a : React.Children.count(childrenProp);
|
|
@@ -78,10 +78,20 @@ const Swiper = forwardRef(({ theme, vertical = false, loop = false, timeout = 0,
|
|
|
78
78
|
nextTitleStyle: { color: nextTitleColor },
|
|
79
79
|
dotsTouchable,
|
|
80
80
|
...(dotColor
|
|
81
|
-
? {
|
|
81
|
+
? {
|
|
82
|
+
dotProps: {
|
|
83
|
+
badgeStyle: {
|
|
84
|
+
backgroundColor: hideDots ? "transparent" : dotColor,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
}
|
|
82
88
|
: {}),
|
|
83
89
|
...(dotActiveColor
|
|
84
|
-
? {
|
|
90
|
+
? {
|
|
91
|
+
dotActiveStyle: {
|
|
92
|
+
backgroundColor: hideDots ? "transparent" : dotActiveColor,
|
|
93
|
+
},
|
|
94
|
+
}
|
|
85
95
|
: {}),
|
|
86
96
|
} }, children)));
|
|
87
97
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Swiper.js","sourceRoot":"","sources":["Swiper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAwB,MAAM,cAAc,CAAC;AAC1D,OAAO,eAAe,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"Swiper.js","sourceRoot":"","sources":["Swiper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAwB,MAAM,cAAc,CAAC;AAC1D,OAAO,eAAe,MAAM,yBAAyB,CAAC;AAmCtD,MAAM,MAAM,GAAG,UAAU,CACvB,CACE,EACE,KAAK,EACL,QAAQ,GAAG,KAAK,EAChB,IAAI,GAAG,KAAK,EACZ,OAAO,GAAG,CAAC,EACX,IAAI,GAAG,CAAC,EACR,SAAS,GAAG,EAAE,EACd,SAAS,GAAG,EAAE,EACd,cAAc,EACd,cAAc,EACd,aAAa,GAAG,IAAI,EACpB,QAAQ,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAC,UAAU,CAAC,KAAK,EACzC,cAAc,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,EAC/C,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,QAAQ,EAAE,YAAY,EACtB,cAAc,EAAE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EA,QAAQ,CACO,CACb,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,SAAS,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -33,6 +33,7 @@ export interface SwiperProps<T> {
|
|
|
33
33
|
minDistanceForAction?: number;
|
|
34
34
|
minDistanceToCapture?: number;
|
|
35
35
|
theme: ReadTheme;
|
|
36
|
+
hideDots?: boolean;
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
const Swiper = forwardRef<SwiperRef, SwiperProps<any>>(
|
|
@@ -61,6 +62,7 @@ const Swiper = forwardRef<SwiperRef, SwiperProps<any>>(
|
|
|
61
62
|
minDistanceForAction,
|
|
62
63
|
minDistanceToCapture,
|
|
63
64
|
style,
|
|
65
|
+
hideDots = false,
|
|
64
66
|
}: SwiperProps<any>,
|
|
65
67
|
ref
|
|
66
68
|
) => {
|
|
@@ -157,10 +159,20 @@ const Swiper = forwardRef<SwiperRef, SwiperProps<any>>(
|
|
|
157
159
|
nextTitleStyle: { color: nextTitleColor },
|
|
158
160
|
dotsTouchable,
|
|
159
161
|
...(dotColor
|
|
160
|
-
? {
|
|
162
|
+
? {
|
|
163
|
+
dotProps: {
|
|
164
|
+
badgeStyle: {
|
|
165
|
+
backgroundColor: hideDots ? "transparent" : dotColor,
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
}
|
|
161
169
|
: {}),
|
|
162
170
|
...(dotActiveColor
|
|
163
|
-
? {
|
|
171
|
+
? {
|
|
172
|
+
dotActiveStyle: {
|
|
173
|
+
backgroundColor: hideDots ? "transparent" : dotActiveColor,
|
|
174
|
+
},
|
|
175
|
+
}
|
|
164
176
|
: {}),
|
|
165
177
|
}}
|
|
166
178
|
>
|