@hero-design/rn 8.64.8-alpha.1 → 8.64.8

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.
@@ -0,0 +1,5 @@
1
+ 
2
+ src/index.ts → lib/index.js, es/index.js...
3
+ (!) Plugin replace: @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
4
+ (!) Plugin node-resolve: preferring built-in module 'events' over local alternative at '/home/runner/work/hero-design/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning
5
+ created lib/index.js, es/index.js in 1m 2.7s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @hero-design/rn
2
2
 
3
+ ## 8.64.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [#3341](https://github.com/Thinkei/hero-design/pull/3341) [`64499bbbdc8c3ee3de9ed61fd1e2d15f95eea7e9`](https://github.com/Thinkei/hero-design/commit/64499bbbdc8c3ee3de9ed61fd1e2d15f95eea7e9) Thanks [@vinhphan-eh](https://github.com/vinhphan-eh)! - [PinInput] Update validation logic
8
+
3
9
  ## 8.64.7
4
10
 
5
11
  ### Patch Changes
package/es/index.js CHANGED
@@ -6,7 +6,6 @@ import { createIconSet } from 'react-native-vector-icons';
6
6
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
7
7
  import { MonthYearPickerViewIOS, MonthYearPickerDialogueAndroid } from '@hero-design/react-native-month-year-picker';
8
8
  import DateTimePicker from '@react-native-community/datetimepicker';
9
- import Clipboard from '@react-native-clipboard/clipboard';
10
9
  import RnSlider from '@react-native-community/slider';
11
10
  import { RectButton, GestureHandlerRootView, Swipeable as Swipeable$1 } from 'react-native-gesture-handler';
12
11
  import LinearGradient from 'react-native-linear-gradient';
@@ -372,36 +371,6 @@ function _typeof(o) {
372
371
  return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
373
372
  }, _typeof(o);
374
373
  }
375
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
376
- try {
377
- var info = gen[key](arg);
378
- var value = info.value;
379
- } catch (error) {
380
- reject(error);
381
- return;
382
- }
383
- if (info.done) {
384
- resolve(value);
385
- } else {
386
- Promise.resolve(value).then(_next, _throw);
387
- }
388
- }
389
- function _asyncToGenerator(fn) {
390
- return function () {
391
- var self = this,
392
- args = arguments;
393
- return new Promise(function (resolve, reject) {
394
- var gen = fn.apply(self, args);
395
- function _next(value) {
396
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
397
- }
398
- function _throw(err) {
399
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
400
- }
401
- _next(undefined);
402
- });
403
- };
404
- }
405
374
  function _classCallCheck(instance, Constructor) {
406
375
  if (!(instance instanceof Constructor)) {
407
376
  throw new TypeError("Cannot call a class as a function");
@@ -15679,35 +15648,6 @@ var PinInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
15679
15648
  blur: blur
15680
15649
  };
15681
15650
  });
15682
- useEffect(function () {
15683
- var autoFillInterval = setInterval( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
15684
- var clipboardContent, canAutoFill, isValidClipboardContent;
15685
- return _regeneratorRuntime().wrap(function _callee$(_context) {
15686
- while (1) switch (_context.prev = _context.next) {
15687
- case 0:
15688
- if (!(Platform.OS === 'android')) {
15689
- _context.next = 7;
15690
- break;
15691
- }
15692
- _context.next = 3;
15693
- return Clipboard.getString();
15694
- case 3:
15695
- clipboardContent = _context.sent;
15696
- canAutoFill = autoComplete === 'one-time-code' || textContentType === 'oneTimeCode';
15697
- isValidClipboardContent = clipboardContent && clipboardContent.match(/^\d+$/) || normalizeValue(clipboardContent, length) !== trimmedValue;
15698
- if (canAutoFill && isValidClipboardContent) {
15699
- onChangeText === null || onChangeText === void 0 || onChangeText(clipboardContent);
15700
- }
15701
- case 7:
15702
- case "end":
15703
- return _context.stop();
15704
- }
15705
- }, _callee);
15706
- })), 1000);
15707
- return function () {
15708
- clearInterval(autoFillInterval);
15709
- };
15710
- }, [autoComplete, textContentType, onChangeText, trimmedValue, length]);
15711
15651
  return /*#__PURE__*/React__default.createElement(StyledWrapper$5, {
15712
15652
  style: style,
15713
15653
  testID: testID
package/lib/index.js CHANGED
@@ -8,7 +8,6 @@ var reactNativeVectorIcons = require('react-native-vector-icons');
8
8
  var reactNativeSafeAreaContext = require('react-native-safe-area-context');
9
9
  var reactNativeMonthYearPicker = require('@hero-design/react-native-month-year-picker');
10
10
  var DateTimePicker = require('@react-native-community/datetimepicker');
11
- var Clipboard = require('@react-native-clipboard/clipboard');
12
11
  var RnSlider = require('@react-native-community/slider');
13
12
  var reactNativeGestureHandler = require('react-native-gesture-handler');
14
13
  var LinearGradient = require('react-native-linear-gradient');
@@ -40,7 +39,6 @@ var reactNative__namespace = /*#__PURE__*/_interopNamespace(reactNative);
40
39
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
41
40
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
42
41
  var DateTimePicker__default = /*#__PURE__*/_interopDefaultLegacy(DateTimePicker);
43
- var Clipboard__default = /*#__PURE__*/_interopDefaultLegacy(Clipboard);
44
42
  var RnSlider__default = /*#__PURE__*/_interopDefaultLegacy(RnSlider);
45
43
  var LinearGradient__default = /*#__PURE__*/_interopDefaultLegacy(LinearGradient);
46
44
  var PagerView__default = /*#__PURE__*/_interopDefaultLegacy(PagerView);
@@ -403,36 +401,6 @@ function _typeof(o) {
403
401
  return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
404
402
  }, _typeof(o);
405
403
  }
406
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
407
- try {
408
- var info = gen[key](arg);
409
- var value = info.value;
410
- } catch (error) {
411
- reject(error);
412
- return;
413
- }
414
- if (info.done) {
415
- resolve(value);
416
- } else {
417
- Promise.resolve(value).then(_next, _throw);
418
- }
419
- }
420
- function _asyncToGenerator(fn) {
421
- return function () {
422
- var self = this,
423
- args = arguments;
424
- return new Promise(function (resolve, reject) {
425
- var gen = fn.apply(self, args);
426
- function _next(value) {
427
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
428
- }
429
- function _throw(err) {
430
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
431
- }
432
- _next(undefined);
433
- });
434
- };
435
- }
436
404
  function _classCallCheck(instance, Constructor) {
437
405
  if (!(instance instanceof Constructor)) {
438
406
  throw new TypeError("Cannot call a class as a function");
@@ -15710,35 +15678,6 @@ var PinInput = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
15710
15678
  blur: blur
15711
15679
  };
15712
15680
  });
15713
- React.useEffect(function () {
15714
- var autoFillInterval = setInterval( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
15715
- var clipboardContent, canAutoFill, isValidClipboardContent;
15716
- return _regeneratorRuntime().wrap(function _callee$(_context) {
15717
- while (1) switch (_context.prev = _context.next) {
15718
- case 0:
15719
- if (!(reactNative.Platform.OS === 'android')) {
15720
- _context.next = 7;
15721
- break;
15722
- }
15723
- _context.next = 3;
15724
- return Clipboard__default["default"].getString();
15725
- case 3:
15726
- clipboardContent = _context.sent;
15727
- canAutoFill = autoComplete === 'one-time-code' || textContentType === 'oneTimeCode';
15728
- isValidClipboardContent = clipboardContent && clipboardContent.match(/^\d+$/) || normalizeValue(clipboardContent, length) !== trimmedValue;
15729
- if (canAutoFill && isValidClipboardContent) {
15730
- onChangeText === null || onChangeText === void 0 || onChangeText(clipboardContent);
15731
- }
15732
- case 7:
15733
- case "end":
15734
- return _context.stop();
15735
- }
15736
- }, _callee);
15737
- })), 1000);
15738
- return function () {
15739
- clearInterval(autoFillInterval);
15740
- };
15741
- }, [autoComplete, textContentType, onChangeText, trimmedValue, length]);
15742
15681
  return /*#__PURE__*/React__default["default"].createElement(StyledWrapper$5, {
15743
15682
  style: style,
15744
15683
  testID: testID
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "8.64.8-alpha.1",
3
+ "version": "8.64.8",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -29,7 +29,6 @@
29
29
  },
30
30
  "peerDependencies": {
31
31
  "@hero-design/react-native-month-year-picker": "^8.42.10",
32
- "@react-native-clipboard/clipboard": "^1.13.2",
33
32
  "@react-native-community/datetimepicker": "^3.5.2 || ^7.6.1",
34
33
  "@react-native-community/slider": "^4.5.1",
35
34
  "react": "18.2.0",
@@ -53,7 +52,6 @@
53
52
  "@eslint/js": "^9.8.0",
54
53
  "@hero-design/eslint-plugin": "9.2.0",
55
54
  "@hero-design/react-native-month-year-picker": "^8.42.10",
56
- "@react-native-clipboard/clipboard": "^1.14.2",
57
55
  "@react-native-community/datetimepicker": "7.6.1",
58
56
  "@react-native-community/slider": "^4.5.1",
59
57
  "@rollup/plugin-babel": "^5.3.1",
@@ -95,6 +93,5 @@
95
93
  "ts-jest": "^29.1.1",
96
94
  "typescript": "4.8.4"
97
95
  },
98
- "prettier": "prettier-config-hd",
99
- "react-native": "src/index.ts"
96
+ "prettier": "prettier-config-hd"
100
97
  }
package/rollup.config.js CHANGED
@@ -40,7 +40,6 @@ export default {
40
40
  'react-native-vector-icons',
41
41
  'react-native-linear-gradient',
42
42
  '@hero-design/react-native-month-year-picker',
43
- '@react-native-clipboard/clipboard',
44
43
  ],
45
44
  plugins: [
46
45
  replace({
@@ -9,7 +9,6 @@ import React, {
9
9
  } from 'react';
10
10
  import { InteractionManager, Platform, TextInput } from 'react-native';
11
11
  import type { StyleProp, ViewStyle } from 'react-native';
12
- import Clipboard from '@react-native-clipboard/clipboard';
13
12
  import Icon from '../Icon';
14
13
  import PinCell from './PinCell';
15
14
  import {
@@ -171,28 +170,6 @@ const PinInput = forwardRef<PinInputHandler, PinInputProps>(
171
170
  blur,
172
171
  }));
173
172
 
174
- useEffect(() => {
175
- const autoFillInterval = setInterval(async () => {
176
- if (Platform.OS === 'android') {
177
- const clipboardContent = await Clipboard.getString();
178
- const canAutoFill =
179
- autoComplete === 'one-time-code' ||
180
- textContentType === 'oneTimeCode';
181
- const isValidClipboardContent =
182
- (clipboardContent && clipboardContent.match(/^\d+$/)) ||
183
- normalizeValue(clipboardContent, length) !== trimmedValue;
184
-
185
- if (canAutoFill && isValidClipboardContent) {
186
- onChangeText?.(clipboardContent);
187
- }
188
- }
189
- }, 1000);
190
-
191
- return () => {
192
- clearInterval(autoFillInterval);
193
- };
194
- }, [autoComplete, textContentType, onChangeText, trimmedValue, length]);
195
-
196
173
  return (
197
174
  <StyledWrapper style={style} testID={testID}>
198
175
  <StyledPinWrapper>