@momo-kits/carousel 0.92.21-beta.0 → 0.92.21-beta.1

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/index.tsx CHANGED
@@ -791,7 +791,7 @@ class Carousel extends React.PureComponent<CarouselProps, CarouselState> {
791
791
  {...specificProps}
792
792
  ref={c => (this._carouselRef = c)}
793
793
  overScrollMode={'never'}
794
- snapToInterval={snapToInterval}
794
+ snapToInterval={this.props.snapToInterval ? this.props.snapToInterval : snapToInterval}
795
795
  disableIntervalMomentum={disableIntervalMomentum}
796
796
  pointerEvents={hideCarousel ? 'none' : 'auto'}
797
797
  decelerationRate={'fast'}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/carousel",
3
- "version": "0.92.21-beta.0",
3
+ "version": "0.92.21-beta.1",
4
4
  "private": false,
5
5
  "main": "index.tsx",
6
6
  "peerDependencies": {
@@ -16,4 +16,4 @@
16
16
  "dependencies": {
17
17
  "moment": "^2.24.0"
18
18
  }
19
- }
19
+ }
package/publish.sh CHANGED
@@ -7,16 +7,16 @@ rsync -r --exclude=/dist ./* dist
7
7
  cd dist
8
8
 
9
9
  if [ "$1" == "stable" ]; then
10
- #npm version $(npm view @momo-kits/carousel@stable version)
11
- #npm version patch
10
+ npm version $(npm view @momo-kits/carousel@stable version)
11
+ npm version patch
12
12
  npm publish --tag stable --access=public
13
13
  elif [ "$1" == "latest" ]; then
14
- #npm version $(npm view @momo-kits/foundation@latest version)
15
- #npm version prerelease --preid=rc
14
+ npm version $(npm view @momo-kits/carousel@latest version)
15
+ npm version prerelease --preid=rc
16
16
  npm publish --tag latest --access=public
17
17
  else
18
- #npm version $(npm view @momo-kits/carousel@beta version)
19
- #npm version prerelease --preid=beta
18
+ npm version $(npm view @momo-kits/carousel@beta version)
19
+ npm version prerelease --preid=beta
20
20
  npm publish --tag beta --access=public
21
21
  fi
22
22
 
package/types.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import {
2
+ Animated,
2
3
  NativeScrollEvent,
3
4
  NativeSyntheticEvent,
4
5
  StyleProp,
@@ -22,7 +23,7 @@ export type CarouselProps = {
22
23
  disableIntervalMomentum?: boolean;
23
24
  itemWidth?: number;
24
25
  data: any[];
25
- renderItem: (info: {item: any; index: number}) => React.ReactNode;
26
+ renderItem: (info: { item: any; index: number }) => React.ReactNode;
26
27
  onScroll?: any;
27
28
  onScrollIndexChanged?: (index: number) => void;
28
29
  onSnapToItem?: (index: number) => void;
@@ -36,11 +37,12 @@ export type CarouselProps = {
36
37
  getItemLayout?: (
37
38
  data: any,
38
39
  index: number
39
- ) => {length: number; offset: number; index: number};
40
+ ) => { length: number; offset: number; index: number };
40
41
  style?: ViewStyle;
41
42
  visibleItem?: number;
42
43
  contentContainerStyle?: StyleProp<ViewStyle>;
43
44
  full?: boolean;
45
+ snapToInterval?: number | Animated.Value | Animated.AnimatedInterpolation | undefined
44
46
  };
45
47
 
46
48
  export type CarouselRef = {