@momo-kits/swipe 0.125.5-beta.2 → 0.150.1-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/SwipeView.tsx CHANGED
@@ -26,7 +26,7 @@ export const Swipe: ForwardRefRenderFunction<SwipeableRef, SwipeProps> = (
26
26
  index: number,
27
27
  length: number,
28
28
  direction: 'left' | 'right',
29
- dragX: Animated.AnimatedInterpolation
29
+ dragX: Animated.AnimatedInterpolation<number | string>
30
30
  ) => {
31
31
  const {
32
32
  label,
@@ -54,6 +54,7 @@ export const Swipe: ForwardRefRenderFunction<SwipeableRef, SwipeProps> = (
54
54
 
55
55
  return (
56
56
  <TouchableHighlight
57
+ key={`swipe-action-${direction}-${index}`}
57
58
  underlayColor={Colors.black_01}
58
59
  activeOpacity={0.8}
59
60
  style={{zIndex: zIndex}}
@@ -84,7 +85,7 @@ export const Swipe: ForwardRefRenderFunction<SwipeableRef, SwipeProps> = (
84
85
  const renderActions = (
85
86
  actions: SwipeAction[] = [],
86
87
  direction: 'left' | 'right',
87
- dragX: Animated.AnimatedInterpolation
88
+ dragX: Animated.AnimatedInterpolation<number | string>
88
89
  ) => {
89
90
  let overlayPosition: {[key: string]: number} = {left: 0};
90
91
  if (direction === 'right') {
package/package.json CHANGED
@@ -1,20 +1,19 @@
1
1
  {
2
- "name": "@momo-kits/swipe",
3
- "version": "0.125.5-beta.2",
4
- "private": false,
5
- "main": "index.tsx",
6
- "dependencies": {},
7
- "peerDependencies": {
8
- "@momo-kits/foundation": "latest",
9
- "prop-types": "^15.7.2",
10
- "react": "16.9.0",
11
- "react-native": ">=0.55"
12
- },
13
- "devDependencies": {
14
- "@momo-platform/versions": "4.1.11"
15
- },
16
- "license": "MoMo",
17
- "publishConfig": {
18
- "registry": "https://registry.npmjs.org/"
19
- }
20
- }
2
+ "name": "@momo-kits/swipe",
3
+ "version": "0.150.1-beta.2",
4
+ "private": false,
5
+ "main": "index.tsx",
6
+ "peerDependencies": {
7
+ "@momo-kits/foundation": "latest",
8
+ "react": "*",
9
+ "react-native": "*"
10
+ },
11
+ "devDependencies": {
12
+ "@momo-platform/versions": "4.1.11"
13
+ },
14
+ "license": "MoMo",
15
+ "publishConfig": {
16
+ "registry": "https://registry.npmjs.org/"
17
+ },
18
+ "dependencies": {}
19
+ }
package/publish.sh CHANGED
@@ -1,12 +1,5 @@
1
1
  #!/bin/bash
2
2
 
3
- # Prepare dist files
4
- rm -rf dist
5
- mkdir dist
6
- rsync -r --exclude=/dist ./* dist
7
- cd dist
8
-
9
-
10
3
  if [ "$1" == "stable" ]; then
11
4
  npm version $(npm view @momo-kits/foundation@stable version)
12
5
  npm version patch
@@ -14,15 +7,13 @@ if [ "$1" == "stable" ]; then
14
7
  elif [ "$1" == "latest" ]; then
15
8
  npm version $(npm view @momo-kits/foundation@latest version)
16
9
  npm publish --tag latest --access=public
17
- else
10
+ elif [ "$1" == "beta" ]; then
18
11
  npm version $(npm view @momo-kits/swipe@beta version)
19
12
  npm version prerelease --preid=beta
20
13
  npm publish --tag beta --access=public
14
+ else
15
+ npm publish --tag alpha --access=public
21
16
  fi
22
17
 
23
18
  PACKAGE_NAME=$(npm pkg get name)
24
19
  NEW_PACKAGE_VERSION=$(npm pkg get version)
25
-
26
- # Clean up
27
- cd ..
28
- rm -rf dist
package/types.ts CHANGED
@@ -30,6 +30,7 @@ export type SwipeAction = {
30
30
  * Properties for the Swipe component, which allows swipeable actions on an item.
31
31
  */
32
32
  export type SwipeProps = {
33
+ children?: React.ReactNode;
33
34
  /**
34
35
  * Optional. An array of `SwipeAction` items representing the actions available
35
36
  * on swiping to the left. Each action is rendered as a button on the swipeable surface.
@@ -90,8 +91,14 @@ export type SwipeProps = {
90
91
  */
91
92
  onSwipeableWillClose?: () => void;
92
93
 
94
+ /**
95
+ * Optional. A reference to the swipeable component, allowing external control
96
+ */
93
97
  height?: number;
94
98
 
99
+ /**
100
+ * Optional. A reference to the swipeable component, allowing external control radius of the item.
101
+ */
95
102
  itemRadius?: number;
96
103
 
97
104
  children?: ReactElement;