@momo-kits/swipe 0.0.44-beta → 0.0.44-beta.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/SwipeAction.js CHANGED
@@ -627,7 +627,9 @@ SwipeAction.propTypes = {
627
627
  onPress: PropTypes.func,
628
628
  children: PropTypes.element.isRequired,
629
629
  actionBackground: PropTypes.string,
630
- actionTextStyle: PropTypes.object
630
+ actionTextStyle: PropTypes.object,
631
+ swipeGestureBegan: PropTypes.func,
632
+ swipeGestureEnd: PropTypes.func,
631
633
  };
632
634
 
633
635
  SwipeAction.defaultProps = {
@@ -66,6 +66,8 @@ class SwipeActionList extends Component {
66
66
  onPress,
67
67
  onClose,
68
68
  actionBackground,
69
+ swipeGestureBegan,
70
+ swipeGestureEnd,
69
71
  } = this.props;
70
72
  return (
71
73
  <View>
@@ -86,6 +88,8 @@ class SwipeActionList extends Component {
86
88
  rowIndex={index}
87
89
  renderLeftAction={renderLeftAction}
88
90
  renderRightAction={renderRightAction}
91
+ swipeGestureBegan={swipeGestureBegan}
92
+ swipeGestureEnd={swipeGestureEnd}
89
93
  >
90
94
  {renderItem?.(item, index)}
91
95
  </SwipeAction>
@@ -127,7 +131,9 @@ SwipeActionList.propTypes = {
127
131
  onOpen: PropTypes.func,
128
132
  onClose: PropTypes.func,
129
133
  onPress: PropTypes.func,
130
- actionBackground: PropTypes.string
134
+ actionBackground: PropTypes.string,
135
+ swipeGestureBegan: PropTypes.func,
136
+ swipeGestureEnd: PropTypes.func,
131
137
  };
132
138
 
133
139
  SwipeActionList.defaultProps = {
package/Swiper.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  Platform,
24
24
  ActivityIndicator
25
25
  } from 'react-native';
26
- import ViewPagerAndroid from 'react-native-pager-view';
26
+ import { ViewPager as ViewPagerAndroid } from '@momo-kits/core';
27
27
 
28
28
  /**
29
29
  * Default styles
@@ -325,7 +325,7 @@ export default class Swiper extends Component {
325
325
  * Automatic rolling
326
326
  */
327
327
  autoplay = () => {
328
- if (!Array.isArray(this.props.children)
328
+ if (!Array.isArray(this?.props?.children)
329
329
  || !this.props.autoplay
330
330
  || this.internals.isScrolling
331
331
  || this.state.autoplayEnd) return;
@@ -577,15 +577,14 @@ export default class Swiper extends Component {
577
577
  }
578
578
 
579
579
  renderTitle = () => {
580
- const child = this.props.children[this.state.index];
581
- const title = child && child.props && child.props.title;
582
- return title
583
- ? (
584
- <View style={styles.title}>
585
- {this.props.children[this.state.index].props.title}
586
- </View>
587
- )
588
- : null;
580
+ let { children = [] } = this.props;
581
+ const child = children[this.state.index];
582
+ const title = child && child.props && child.props.title
583
+ return !!title ? (
584
+ <View style={styles.title}>
585
+ {this.props.children?.[this.state.index].props.title}
586
+ </View>
587
+ ) : null
589
588
  }
590
589
 
591
590
  renderNextButton = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/swipe",
3
- "version": "0.0.44-beta",
3
+ "version": "0.0.44-beta.2",
4
4
  "private": false,
5
5
  "main": "index.js",
6
6
  "dependencies": {},
@@ -8,8 +8,7 @@
8
8
  "prop-types": "^15.7.2",
9
9
  "react": "^16.9.0",
10
10
  "react-native": ">=0.55",
11
- "@momo-kits/core": ">=0.0.5-beta",
12
- "react-native-pager-view": "5.1.8"
11
+ "@momo-kits/core": ">=0.0.5-beta"
13
12
  },
14
13
  "devDependencies": {},
15
14
  "license": "MoMo"
package/publish.sh CHANGED
@@ -21,9 +21,9 @@ rsync -r --verbose --exclude '*.mdx' --exclude '*Demo.js' --exclude 'props-type
21
21
  #npm login
22
22
  #publish dist to npm
23
23
  cd dist
24
- npm publish --access=public
24
+ npm publish --tag beta --access=public
25
25
  cd ..
26
26
  rm -rf dist
27
27
 
28
28
 
29
- curl -X POST -H 'Content-Type: application/json' 'https://chat.googleapis.com/v1/spaces/AAAAbP8987c/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=UGSFRvk_oYb9uGsAgs31bVvMm6jDkmD8zihGm3eyaQA%3D&threadKey=JoaXTEYaNNkl' -d '{"text": "@momo-kits/swipe new version release: '*"$VERSION"*' https://www.npmjs.com/package/@momo-kits/swipe"}'
29
+ #curl -X POST -H 'Content-Type: application/json' 'https://chat.googleapis.com/v1/spaces/AAAAbP8987c/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=UGSFRvk_oYb9uGsAgs31bVvMm6jDkmD8zihGm3eyaQA%3D&threadKey=JoaXTEYaNNkl' -d '{"text": "@momo-kits/swipe new version release: '*"$VERSION"*' https://www.npmjs.com/package/@momo-kits/swipe"}'