@startupjs-ui/carousel 0.2.0-alpha.0 → 0.2.0-alpha.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/CHANGELOG.md +16 -0
- package/index.tsx +5 -7
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.2.0-alpha.2](https://github.com/startupjs/startupjs-ui/compare/v0.2.0-alpha.1...v0.2.0-alpha.2) (2026-04-20)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @startupjs-ui/carousel
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [0.2.0-alpha.1](https://github.com/startupjs/startupjs-ui/compare/v0.2.0-alpha.0...v0.2.0-alpha.1) (2026-04-10)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @startupjs-ui/carousel
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# [0.2.0-alpha.0](https://github.com/startupjs/startupjs-ui/compare/v0.1.22...v0.2.0-alpha.0) (2026-03-27)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @startupjs-ui/carousel
|
package/index.tsx
CHANGED
|
@@ -113,7 +113,6 @@ function Carousel ({
|
|
|
113
113
|
const [isRender, setIsRender] = useState(false)
|
|
114
114
|
const [isAnimate, setIsAnimate] = useState(false)
|
|
115
115
|
|
|
116
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
117
116
|
useImperativeHandle(ref, () => {
|
|
118
117
|
return new Proxy(refRoot.current, {
|
|
119
118
|
get (target: any, prop: any) {
|
|
@@ -137,7 +136,6 @@ function Carousel ({
|
|
|
137
136
|
isRender
|
|
138
137
|
])
|
|
139
138
|
|
|
140
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
141
139
|
useEffect(() => {
|
|
142
140
|
if (isRender && isLoop && !isAnimate) {
|
|
143
141
|
refTimeout.current = setTimeout(onNext, 3000)
|
|
@@ -319,7 +317,6 @@ function Carousel ({
|
|
|
319
317
|
})
|
|
320
318
|
}
|
|
321
319
|
|
|
322
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
323
320
|
useEffect(() => {
|
|
324
321
|
if (!endDrag) return
|
|
325
322
|
if (startDrag === endDrag) return
|
|
@@ -428,7 +425,6 @@ function Carousel ({
|
|
|
428
425
|
return { panHandlers: {} }
|
|
429
426
|
}, [animateTranslate, coardName, isAnimate, isSwipe])
|
|
430
427
|
|
|
431
|
-
// eslint-disable-next-line @typescript-eslint/promise-function-async
|
|
432
428
|
const renderChildren = React.Children.toArray(validChildren).map((child: any, index, arr) => {
|
|
433
429
|
const _style = StyleSheet.flatten([child.props.style])
|
|
434
430
|
|
|
@@ -475,7 +471,7 @@ function Carousel ({
|
|
|
475
471
|
return pug`
|
|
476
472
|
View(
|
|
477
473
|
key=index
|
|
478
|
-
onLayout=e=> onLayoutChild(e, index)
|
|
474
|
+
onLayout=e => onLayoutChild(e, index)
|
|
479
475
|
)= child
|
|
480
476
|
`
|
|
481
477
|
})
|
|
@@ -553,10 +549,12 @@ function Carousel ({
|
|
|
553
549
|
|
|
554
550
|
if hasDots && isResponsive
|
|
555
551
|
Div.dots(row)
|
|
556
|
-
each
|
|
552
|
+
each _dummy, index in dots
|
|
553
|
+
// noop on _dummy value to prevent eslint no-unused-vars error, since we only need the index here
|
|
554
|
+
- _dummy?.noop?.()
|
|
557
555
|
Div.dot(
|
|
558
556
|
key=index
|
|
559
|
-
onPress=()=> toIndex(index)
|
|
557
|
+
onPress=() => toIndex(index)
|
|
560
558
|
styleName={ dotActive: activeIndex === (isEndless ? (index + children.length) : index) }
|
|
561
559
|
)
|
|
562
560
|
`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startupjs-ui/carousel",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
"types": "index.d.ts",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@startupjs-ui/core": "^0.2.0-alpha.
|
|
12
|
-
"@startupjs-ui/div": "^0.2.0-alpha.
|
|
13
|
-
"@startupjs-ui/icon": "^0.2.0-alpha.
|
|
11
|
+
"@startupjs-ui/core": "^0.2.0-alpha.1",
|
|
12
|
+
"@startupjs-ui/div": "^0.2.0-alpha.1",
|
|
13
|
+
"@startupjs-ui/icon": "^0.2.0-alpha.1"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"react": "*",
|
|
17
17
|
"react-native": "*",
|
|
18
18
|
"startupjs": "*"
|
|
19
19
|
},
|
|
20
|
-
"gitHead": "
|
|
20
|
+
"gitHead": "8a6ae7871e4c82f3e24d5911a9df42338e057e7a"
|
|
21
21
|
}
|