@momo-kits/auto-complete 0.0.73-beta → 0.0.74-beta.30

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.
Files changed (3) hide show
  1. package/AutoComplete.js +324 -292
  2. package/package.json +15 -15
  3. package/publish.sh +2 -2
package/AutoComplete.js CHANGED
@@ -1,342 +1,374 @@
1
1
  /* eslint-disable no-extra-boolean-cast */
2
2
  /* eslint-disable no-param-reassign */
3
- import React, { Component } from 'react';
3
+ import React, {Component} from 'react';
4
4
  import {
5
- findNodeHandle,
6
- StyleSheet,
7
- UIManager,
8
- View,
9
- Platform
5
+ findNodeHandle,
6
+ StyleSheet,
7
+ UIManager,
8
+ View,
9
+ Platform,
10
10
  } from 'react-native';
11
- import { get } from 'lodash';
11
+ import {debounce, get} from 'lodash';
12
12
  import PropTypes from 'prop-types';
13
13
  import {
14
- ValueUtil, NumberUtils, Colors, Text, RNGestureHandler
14
+ ValueUtil,
15
+ NumberUtils,
16
+ Colors,
17
+ Text,
18
+ RNGestureHandler,
19
+ Spacing,
20
+ Shadow,
21
+ Radius,
15
22
  } from '@momo-kits/core';
16
23
 
17
- const { TouchableOpacity } = RNGestureHandler;
24
+ const {TouchableOpacity} = RNGestureHandler;
18
25
  export default class AutoComplete extends Component {
19
- constructor(props) {
20
- super(props);
21
- this.hashmapRefs = {};
22
- this.hashmapPosition = {};
23
- this.hashmapInputValue = {};
24
- this.selectedItem = null;
25
- this.childrenWithProps = null;
26
- }
26
+ constructor(props) {
27
+ super(props);
28
+ this.hashmapRefs = {};
29
+ this.hashmapPosition = {};
30
+ this.hashmapInputValue = {};
31
+ this.selectedItem = null;
32
+ this.childrenWithProps = null;
33
+ }
27
34
 
28
- /**
29
- * func measure all component have keyAutoComplete to get it's position
30
- */
31
- measure() {
32
- try {
33
- if (this.hashmapRefs) {
34
- Object.keys(this.hashmapRefs)
35
- .forEach((key) => {
36
- if (Platform.OS === 'android') {
37
- UIManager.measureLayoutRelativeToParent(findNodeHandle(this.hashmapRefs[key]), (e) => { console.error(e); }, (x, y, width, height) => {
38
- this.hashmapPosition[key] = {
39
- x,
40
- y: y + height,
41
- width
42
- };
43
- });
44
- } else {
45
- UIManager.measure(findNodeHandle(this.hashmapRefs[key]), (x, y, width, height) => {
46
- this.hashmapPosition[key] = {
47
- x,
48
- y: y + height,
49
- width
50
- };
51
- });
52
- }
53
- });
54
- }
55
- } catch (e) {
56
- console.log(`try catch :: ${e}`);
35
+ /**
36
+ * func measure all component have keyAutoComplete to get it's position
37
+ */
38
+ measure() {
39
+ try {
40
+ Object.keys(this.hashmapRefs)?.forEach(key => {
41
+ const node = findNodeHandle(this.hashmapRefs[key]);
42
+ if (node) {
43
+ if (Platform.OS === 'android') {
44
+ UIManager.measureLayoutRelativeToParent(
45
+ node,
46
+ e => {
47
+ console.error(e);
48
+ },
49
+ (x, y, width, height) => {
50
+ this.hashmapPosition[key] = {
51
+ x,
52
+ y: y + height - 26,
53
+ width,
54
+ };
55
+ },
56
+ );
57
+ } else {
58
+ UIManager.measure(node, (x, y, width, height) => {
59
+ this.hashmapPosition[key] = {
60
+ x,
61
+ y: y + height - 26,
62
+ width,
63
+ };
64
+ });
65
+ }
57
66
  }
67
+ });
68
+ } catch (e) {
69
+ console.log(`try catch :: ${e}`);
58
70
  }
71
+ }
59
72
 
60
- componentDidMount() {
61
- // setTimeout to fix async
62
- setTimeout(() => {
63
- this.measure();
64
- }, 500);
65
- }
73
+ componentDidMount() {
74
+ // setTimeout to fix async
75
+ setTimeout(() => {
76
+ this.measure();
77
+ }, 500);
78
+ }
66
79
 
67
- getValueByKey = (key, value) => {
68
- const splitKey = key.split('-');
69
- return splitKey.length > 1 ? splitKey.reduce((result, item, index) => result = result + value[item] + (index === splitKey.length - 1 ? '' : !!value[item] ? ' ' : ''), '')
70
- : key === 'phone' ? NumberUtils.formatPhoneNumberVN(value[key]) : value[key];
71
- };
80
+ getValueByKey = (key, value) => {
81
+ const splitKey = key.split('-');
82
+ return splitKey.length > 1
83
+ ? splitKey.reduce(
84
+ (result, item, index) =>
85
+ (result =
86
+ result +
87
+ value[item] +
88
+ (index === splitKey.length - 1 ? '' : !!value[item] ? ' ' : '')),
89
+ '',
90
+ )
91
+ : key === 'phone'
92
+ ? NumberUtils.formatPhoneNumberVN(value[key])
93
+ : value[key];
94
+ };
72
95
 
73
- /**
74
- * loop all child components
75
- * @param {"Children"} components ;
76
- */
77
- cloneChildren(components) {
78
- if (components) {
79
- return React.Children.map(components, (child) => {
80
- if (!child?.props) return child;
81
- if (child?.props?.children && React.Children.count(child?.props?.children) > 0 && child.type.name !== Text) {
82
- // component have children -> clone it and all it's children
83
- return React.cloneElement(child, {
84
- children: this.cloneChildren(child.props.children)
85
- });
86
- }
96
+ /**
97
+ * loop all child components
98
+ * @param {"Children"} components ;
99
+ */
100
+ cloneChildren(components) {
101
+ if (components) {
102
+ return React.Children.map(components, child => {
103
+ if (!child?.props) return child;
104
+ if (
105
+ child?.props?.children &&
106
+ React.Children.count(child?.props?.children) > 0 &&
107
+ child.type.name !== Text
108
+ ) {
109
+ // component have children -> clone it and all it's children
110
+ return React.cloneElement(child, {
111
+ children: this.cloneChildren(child.props.children),
112
+ });
113
+ }
87
114
 
88
- const {
89
- onChangeText,
90
- keyAutoComplete,
91
- onFocus,
92
- onEndEditing
93
- } = child.props;
94
- if (keyAutoComplete) {
95
- // Update props when component have keyAutoComplete
96
- if (this.selectedItem) {
97
- this.hashmapInputValue[keyAutoComplete] = this.getValueByKey(keyAutoComplete, this.selectedItem);// this.selectedItem[keyAutoComplete];
98
- return React.cloneElement(child, {
99
- ref: (view) => this.hashmapRefs[keyAutoComplete] = view,
100
- onChangeText: (text) => this.changeTextHandle(child, text, onChangeText),
101
- onFocus: (e) => this.focusHandle(e, child, onFocus),
102
- // value: this.getValueByKey(keyAutoComplete, this.selectedItem),
103
- onEndEditing: (e) => this.endFocusHandle(e, onEndEditing)
104
- });
105
- }
106
- return React.cloneElement(child, {
107
- ref: (view) => this.hashmapRefs[keyAutoComplete] = view,
108
- onChangeText: (text) => this.changeTextHandle(child, text, onChangeText),
109
- onFocus: (e) => this.focusHandle(e, child, onFocus),
110
- onEndEditing: (e) => this.endFocusHandle(e, onEndEditing)
111
- });
112
- }
113
- return child;
115
+ const {onChangeText, keyAutoComplete, onFocus, onEndEditing} =
116
+ child.props;
117
+ if (keyAutoComplete) {
118
+ // Update props when component have keyAutoComplete
119
+ if (this.selectedItem) {
120
+ this.hashmapInputValue[keyAutoComplete] = this.getValueByKey(
121
+ keyAutoComplete,
122
+ this.selectedItem,
123
+ ); // this.selectedItem[keyAutoComplete];
124
+ return React.cloneElement(child, {
125
+ ref: view => (this.hashmapRefs[keyAutoComplete] = view),
126
+ onChangeText: text =>
127
+ this.changeTextHandle(child, text, onChangeText),
128
+ onFocus: e => this.focusHandle(e, child, onFocus),
129
+ // value: this.getValueByKey(keyAutoComplete, this.selectedItem),
130
+ onEndEditing: e => this.endFocusHandle(e, onEndEditing),
114
131
  });
132
+ }
133
+ return React.cloneElement(child, {
134
+ ref: view => (this.hashmapRefs[keyAutoComplete] = view),
135
+ onChangeText: text =>
136
+ this.changeTextHandle(child, text, onChangeText),
137
+ onFocus: e => this.focusHandle(e, child, onFocus),
138
+ onEndEditing: e => this.endFocusHandle(e, onEndEditing),
139
+ });
115
140
  }
116
-
117
- return components;
141
+ return child;
142
+ });
118
143
  }
119
144
 
120
- render() {
121
- const {
122
- style = {},
123
- } = this.props;
124
- const suggest = get(this.state, 'suggest', {});
125
- const childrenWithProps = this.cloneChildren(get(this.props, 'children', null));
126
- return (
127
- <View style={[{ zIndex: 1 }, style]}>
128
- {childrenWithProps}
129
- {this.renderSuggest(suggest)}
130
- </View>
131
- );
132
- }
145
+ return components;
146
+ }
133
147
 
134
- querySearch = (child, text) => {
135
- const keyAutoComplete = get(child.props, 'keyAutoComplete', '');
136
- const isShowAutoComplete = get(child.props, 'isShowAutoComplete', true);
137
- const { data } = this.props;
138
- const dataOutput = data && data.length > 0 && this.filter(data, keyAutoComplete, text);
139
- if (this.hashmapRefs[keyAutoComplete]) {
140
- this.setState({
141
- suggest: {
142
- data: dataOutput,
143
- position: this.hashmapPosition[keyAutoComplete],
144
- isShowAutoComplete
145
- }
146
- });
147
- }
148
- };
148
+ render() {
149
+ const {style = {}} = this.props;
150
+ const suggest = get(this.state, 'suggest', {});
151
+ const childrenWithProps = this.cloneChildren(
152
+ get(this.props, 'children', null),
153
+ );
154
+ return (
155
+ <View style={[{zIndex: 1}, style]}>
156
+ {childrenWithProps}
157
+ {this.renderSuggest(suggest)}
158
+ </View>
159
+ );
160
+ }
149
161
 
150
- changeTextHandle = (child, text, onChangeText) => {
151
- this.querySearch(child, text);
152
- if (onChangeText && typeof onChangeText === 'function') {
153
- onChangeText(text);
154
- }
155
- };
162
+ querySearch = (child, text) => {
163
+ const keyAutoComplete = get(child.props, 'keyAutoComplete', '');
164
+ const isShowAutoComplete = get(child.props, 'isShowAutoComplete', true);
165
+ const {data} = this.props;
166
+ const dataOutput =
167
+ data && data.length > 0 && this.filter(data, keyAutoComplete, text);
168
+ if (this.hashmapRefs[keyAutoComplete]) {
169
+ this.setState({
170
+ suggest: {
171
+ data: dataOutput,
172
+ position: this.hashmapPosition[keyAutoComplete],
173
+ isShowAutoComplete,
174
+ },
175
+ });
176
+ }
177
+ };
156
178
 
157
- focusHandle = (e, child, onFocus) => {
158
- let text = '';
159
- if (child && typeof child.getText === 'function') {
160
- text = child.getText();
161
- }
179
+ changeTextHandle = (child, text, onChangeText) => {
180
+ this.querySearch(child, text);
181
+ if (onChangeText && typeof onChangeText === 'function') {
182
+ onChangeText(text);
183
+ }
184
+ };
162
185
 
163
- this.querySearch(child, text);
186
+ focusHandle = (e, child, onFocus) => {
187
+ let text = '';
188
+ if (child && typeof child.getText === 'function') {
189
+ text = child.getText();
190
+ }
164
191
 
165
- if (onFocus && typeof onFocus === 'function') {
166
- onFocus(e);
167
- }
168
- };
192
+ this.querySearch(child, text);
169
193
 
170
- endFocusHandle = (e, onEndEditing) => {
171
- if (this.isShowingSuggest()) {
172
- this.hideSuggest();
173
- }
174
- if (onEndEditing && typeof onEndEditing === 'function') {
175
- onEndEditing(e);
176
- }
177
- };
194
+ if (onFocus && typeof onFocus === 'function') {
195
+ onFocus(e);
196
+ }
197
+ };
178
198
 
179
- filter = (data, key, query) => {
180
- if (!data || !key) {
181
- return null;
182
- }
183
- if (query === '') {
184
- return data;
185
- }
199
+ endFocusHandle = (e, onEndEditing) => {
200
+ if (this.isShowingSuggest()) {
201
+ this.hideSuggest();
202
+ }
203
+ if (onEndEditing && typeof onEndEditing === 'function') {
204
+ onEndEditing(e);
205
+ }
206
+ };
186
207
 
187
- return data.filter((item) => {
188
- const valueStr = item ? this.getValueByKey(key, item) : '';
189
- const valueStrFormated = ValueUtil.removeAlias(valueStr)
190
- .toLowerCase()
191
- .trim()
192
- .replace(/\s/g, '');
193
- const queryFormated = ValueUtil.removeAlias(query)
194
- .toLowerCase()
195
- .trim()
196
- .replace(/\s/g, '');
197
- return (
198
- valueStrFormated.indexOf(queryFormated) !== -1
199
- );
200
- });
201
- };
208
+ filter = (data, key, query) => {
209
+ if (!data || !key) {
210
+ return null;
211
+ }
212
+ if (query === '') {
213
+ return data;
214
+ }
202
215
 
203
- renderSuggest(suggest) {
204
- const { numSuggest } = this.props;
205
- if (suggest && suggest.data && suggest.data.length > 0 && suggest.isShowAutoComplete) {
206
- const { x = 0, y = 0, width = 0 } = suggest.position || {};
207
- const sliceData = suggest.data.slice(0, numSuggest);
216
+ return data.filter(item => {
217
+ const valueStr = item ? this.getValueByKey(key, item) : '';
218
+ const valueStrFormated = ValueUtil.removeAlias(valueStr)
219
+ .toLowerCase()
220
+ .trim()
221
+ .replace(/\s/g, '');
222
+ const queryFormated = ValueUtil.removeAlias(query)
223
+ .toLowerCase()
224
+ .trim()
225
+ .replace(/\s/g, '');
226
+ return valueStrFormated.indexOf(queryFormated) !== -1;
227
+ });
228
+ };
208
229
 
209
- return (
210
- <View style={
211
- [styles.containerSuggest, {
212
- left: x,
213
- top: y,
214
- width
215
- }]
216
- }
217
- >
218
- {
219
- sliceData.map((item, index) => (
220
- <View key={index.toString()}>
221
- {this.renderItem({ item, index })}
222
- {index !== sliceData.length - 1 && this.renderSeparator()}
223
- </View>
224
- ))
225
- }
226
- </View>
230
+ renderSuggest(suggest) {
231
+ const {numSuggest} = this.props;
232
+ if (
233
+ suggest &&
234
+ suggest.data &&
235
+ suggest.data.length > 0 &&
236
+ suggest.isShowAutoComplete
237
+ ) {
238
+ const {x = 0, y = 0, width = 0} = suggest.position || {};
239
+ const sliceData = suggest.data.slice(0, numSuggest);
227
240
 
228
- );
229
- }
230
- return null;
241
+ return (
242
+ <View
243
+ style={[
244
+ styles.containerSuggest,
245
+ Shadow.Light,
246
+ {
247
+ left: x,
248
+ top: y,
249
+ width,
250
+ },
251
+ ]}>
252
+ {sliceData.map((item, index) => (
253
+ <View key={index.toString()}>
254
+ {this.renderItem({item, index})}
255
+ {index !== sliceData.length - 1 && this.renderSeparator()}
256
+ </View>
257
+ ))}
258
+ </View>
259
+ );
231
260
  }
261
+ return null;
262
+ }
232
263
 
233
- renderItem = ({ item, index }) => {
234
- const {
235
- renderSuggestItem
236
- } = this.props;
237
- return (
238
- <TouchableOpacity onPress={() => this.onPressItemSuggest(item)}>
239
- {
240
- (renderSuggestItem && typeof renderSuggestItem === 'function')
241
- ? renderSuggestItem({ item, index })
242
- : this.renderSuggestItemDefault({ item, index })
243
- }
244
- </TouchableOpacity>
245
- );
246
- };
264
+ renderItem = ({item, index}) => {
265
+ const {renderSuggestItem} = this.props;
266
+ return (
267
+ <TouchableOpacity onPress={() => this.onPressItemSuggest(item)}>
268
+ {renderSuggestItem && typeof renderSuggestItem === 'function'
269
+ ? renderSuggestItem({item, index})
270
+ : this.renderSuggestItemDefault({item, index})}
271
+ </TouchableOpacity>
272
+ );
273
+ };
247
274
 
248
- renderSeparator = () => (
249
- <View
250
- style={styles.separator}
251
- />
275
+ renderSeparator = () => <View style={styles.separator} />;
276
+
277
+ renderSuggestItemDefault = ({item}) => {
278
+ const {title, value} = item;
279
+ return (
280
+ <View style={[styles.viewSuggest]}>
281
+ <Text.Title>{title}</Text.Title>
282
+ <Text.Title>{value}</Text.Title>
283
+ </View>
252
284
  );
285
+ };
253
286
 
254
- renderSuggestItemDefault = ({ item }) => {
255
- const { title, value } = item;
256
- return (
257
- <View style={[styles.viewSuggest]}>
258
- <Text.Title>{title}</Text.Title>
259
- <Text.Title>{value}</Text.Title>
260
- </View>
287
+ onPressItemSuggest = item => {
288
+ this.selectedItem = item;
289
+ // Loop hashRef to update value of child
290
+ Object.keys(this.hashmapRefs).forEach(key => {
291
+ if (
292
+ this.hashmapRefs[key].setText &&
293
+ typeof this.hashmapRefs[key].setText === 'function'
294
+ )
295
+ this.hashmapRefs[key].setText(
296
+ this.getValueByKey(key, this.selectedItem),
261
297
  );
262
- };
263
-
264
- onPressItemSuggest = (item) => {
265
- this.selectedItem = item;
266
- // Loop hashRef to update value of child
267
- Object.keys(this.hashmapRefs).forEach((key) => {
268
- if (this.hashmapRefs[key].setText && typeof this.hashmapRefs[key].setText === 'function') this.hashmapRefs[key].setText(this.getValueByKey(key, this.selectedItem));
269
- if (this.hashmapRefs[key].setValue && typeof this.hashmapRefs[key].setValue === 'function') this.hashmapRefs[key].setValue(this.getValueByKey(key, this.selectedItem));
270
- });
298
+ if (
299
+ this.hashmapRefs[key].setValue &&
300
+ typeof this.hashmapRefs[key].setValue === 'function'
301
+ )
302
+ this.hashmapRefs[key].setValue(
303
+ this.getValueByKey(key, this.selectedItem),
304
+ );
305
+ });
271
306
 
272
- const {
273
- onSelected
274
- } = this.props;
275
- this.setState({
276
- suggest: {}
277
- }, () => {
278
- if (onSelected && typeof onSelected === 'function') {
279
- onSelected(item);
280
- }
281
- this.selectedItem = null;
282
- });
283
- };
307
+ const {onSelected} = this.props;
308
+ this.setState(
309
+ {
310
+ suggest: {},
311
+ },
312
+ () => {
313
+ if (onSelected && typeof onSelected === 'function') {
314
+ onSelected(item);
315
+ }
316
+ this.selectedItem = null;
317
+ },
318
+ );
319
+ };
284
320
 
285
- isShowingSuggest = () => {
286
- const { suggest } = this.state;
287
- return suggest && suggest.data && suggest.data.length > 0;
288
- };
321
+ isShowingSuggest = () => {
322
+ const {suggest} = this.state;
323
+ return suggest && suggest.data && suggest.data.length > 0;
324
+ };
289
325
 
290
- hideSuggest = () => {
291
- this.setState({
292
- suggest: {}
293
- }, () => {
294
- this.selectedItem = null;
295
- });
296
- };
326
+ hideSuggest = () => {
327
+ this.setState(
328
+ {
329
+ suggest: {},
330
+ },
331
+ () => {
332
+ this.selectedItem = null;
333
+ },
334
+ );
335
+ };
297
336
  }
298
337
 
299
338
  const styles = StyleSheet.create({
300
- viewSuggest: {
301
- flexDirection: 'row',
302
- justifyContent: 'space-between',
303
- alignItems: 'center',
304
- paddingVertical: 5,
305
- },
306
- containerSuggest: {
307
- backgroundColor: 'white',
308
- paddingVertical: 10,
309
- paddingHorizontal: 12,
310
- position: 'absolute',
311
- maxHeight: 240,
312
- borderColor: '#DADADA',
313
- borderRadius: 4,
314
- borderWidth: 1,
315
- shadowColor: '#000000',
316
- shadowOffset: {
317
- width: 0,
318
- height: 1
319
- },
320
- shadowRadius: 1,
321
- elevation: 2,
322
- shadowOpacity: 0.5,
323
- },
324
- separator: {
325
- height: 1,
326
- width: '100%',
327
- backgroundColor: Colors.placeholder,
328
- marginVertical: 10
329
- }
339
+ viewSuggest: {
340
+ flexDirection: 'row',
341
+ justifyContent: 'space-between',
342
+ alignItems: 'center',
343
+ paddingVertical: 5,
344
+ },
345
+ containerSuggest: {
346
+ backgroundColor: 'white',
347
+ padding: Spacing.M,
348
+ position: 'absolute',
349
+ maxHeight: 240,
350
+ borderRadius: Radius.S,
351
+ },
352
+ separator: {
353
+ height: 1,
354
+ width: '100%',
355
+ backgroundColor: Colors.background_default,
356
+ marginVertical: 10,
357
+ },
330
358
  });
331
359
 
332
360
  AutoComplete.propTypes = {
333
- style: PropTypes.oneOfType([PropTypes.array, PropTypes.object, PropTypes.number]),
334
- data: PropTypes.arrayOf(PropTypes.object).isRequired,
335
- renderSuggestItem: PropTypes.func,
336
- onSelected: PropTypes.func.isRequired,
337
- numSuggest: PropTypes.number,
361
+ style: PropTypes.oneOfType([
362
+ PropTypes.array,
363
+ PropTypes.object,
364
+ PropTypes.number,
365
+ ]),
366
+ data: PropTypes.arrayOf(PropTypes.object).isRequired,
367
+ renderSuggestItem: PropTypes.func,
368
+ onSelected: PropTypes.func.isRequired,
369
+ numSuggest: PropTypes.number,
338
370
  };
339
371
 
340
372
  AutoComplete.defaultProps = {
341
- numSuggest: 2,
373
+ numSuggest: 2,
342
374
  };
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
- "name": "@momo-kits/auto-complete",
3
- "version": "0.0.73-beta",
4
- "private": false,
5
- "main": "index.js",
6
- "dependencies": {},
7
- "peerDependencies": {
8
- "react": "16.9.0",
9
- "react-native": ">=0.55",
10
- "@momo-kits/core": ">=0.0.4-beta",
11
- "lodash": "^4.17.15",
12
- "prop-types": "^15.7.2"
13
- },
14
- "devDependencies": {},
15
- "license": "MoMo"
16
- }
2
+ "name": "@momo-kits/auto-complete",
3
+ "version": "0.0.74-beta.30",
4
+ "private": false,
5
+ "main": "index.js",
6
+ "dependencies": {},
7
+ "peerDependencies": {
8
+ "react": "16.9.0",
9
+ "react-native": ">=0.55",
10
+ "@momo-kits/core": ">=0.0.4-beta",
11
+ "lodash": "^4.17.15",
12
+ "prop-types": "^15.7.2"
13
+ },
14
+ "devDependencies": {},
15
+ "license": "MoMo"
16
+ }
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/auto-complete new version release: '*"$VERSION"*' https://www.npmjs.com/package/@momo-kits/auto-complete"}'
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/auto-complete new version release: '*"$VERSION"*' https://www.npmjs.com/package/@momo-kits/auto-complete"}'