@hero-design/rn 8.46.0 → 8.46.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.
@@ -3,6 +3,6 @@ $ rollup -c
3
3
  
4
4
  src/index.ts → lib/index.js, es/index.js...
5
5
  (!) 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`.
6
- (!) Plugin node-resolve: preferring built-in module 'events' over local alternative at '/root/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning
7
- created lib/index.js, es/index.js in 27.2s
6
+ (!) Plugin node-resolve: preferring built-in module 'events' over local alternative at '/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
7
+ created lib/index.js, es/index.js in 22s
8
8
  $ tsc --noEmit false --emitDeclarationOnly --project tsconfig.prod.json
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @hero-design/rn
2
2
 
3
+ ## 8.46.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2432](https://github.com/Thinkei/hero-design/pull/2432) [`82d119eb0`](https://github.com/Thinkei/hero-design/commit/82d119eb076b934474494eeaa49ae51abfc245d5) Thanks [@vinhphan-eh](https://github.com/vinhphan-eh)! - [DatePicker] Update useCalculateDate comparison logic
8
+
9
+ ## 8.46.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#2426](https://github.com/Thinkei/hero-design/pull/2426) [`696e01db8`](https://github.com/Thinkei/hero-design/commit/696e01db8033379871d718dc20f5fdfb448a02e1) Thanks [@vinhphan-eh](https://github.com/vinhphan-eh)! - [PageControl] Disable useNativeDriver to prevent crash
14
+
3
15
  ## 8.46.0
4
16
 
5
17
  ### Minor Changes
package/es/index.js CHANGED
@@ -11949,7 +11949,7 @@ var PageControl = function PageControl(_ref) {
11949
11949
  React.useEffect(function () {
11950
11950
  Animated.spring(animatedValue, {
11951
11951
  toValue: currentPage,
11952
- useNativeDriver: Platform.OS !== 'web'
11952
+ useNativeDriver: false // Native driver does not support animating width, it will cause the app to crash if set to true
11953
11953
  }).start();
11954
11954
  }, [currentPage]);
11955
11955
  return /*#__PURE__*/React.createElement(StyledPageControl$2, {
@@ -13099,7 +13099,7 @@ var useCalculateDate = function useCalculateDate(_ref) {
13099
13099
  value = _ref.value;
13100
13100
  useEffect(function () {
13101
13101
  var newDate = getDateValue(value || new Date(), minDate, maxDate);
13102
- if (newDate !== value) {
13102
+ if (value && newDate.toDateString() !== value.toDateString()) {
13103
13103
  onChange(newDate);
13104
13104
  }
13105
13105
  }, [maxDate, minDate, value]);
package/lib/index.js CHANGED
@@ -11979,7 +11979,7 @@ var PageControl = function PageControl(_ref) {
11979
11979
  React__default["default"].useEffect(function () {
11980
11980
  reactNative.Animated.spring(animatedValue, {
11981
11981
  toValue: currentPage,
11982
- useNativeDriver: reactNative.Platform.OS !== 'web'
11982
+ useNativeDriver: false // Native driver does not support animating width, it will cause the app to crash if set to true
11983
11983
  }).start();
11984
11984
  }, [currentPage]);
11985
11985
  return /*#__PURE__*/React__default["default"].createElement(StyledPageControl$2, {
@@ -13129,7 +13129,7 @@ var useCalculateDate = function useCalculateDate(_ref) {
13129
13129
  value = _ref.value;
13130
13130
  React.useEffect(function () {
13131
13131
  var newDate = getDateValue(value || new Date(), minDate, maxDate);
13132
- if (newDate !== value) {
13132
+ if (value && newDate.toDateString() !== value.toDateString()) {
13133
13133
  onChange(newDate);
13134
13134
  }
13135
13135
  }, [maxDate, minDate, value]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "8.46.0",
3
+ "version": "8.46.2",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -25,7 +25,7 @@ const useCalculateDate = ({
25
25
  }: Pick<DatePickerProps, 'maxDate' | 'minDate' | 'onChange' | 'value'>) => {
26
26
  useEffect(() => {
27
27
  const newDate = getDateValue(value || new Date(), minDate, maxDate);
28
- if (newDate !== value) {
28
+ if (value && newDate.toDateString() !== value.toDateString()) {
29
29
  onChange(newDate);
30
30
  }
31
31
  }, [maxDate, minDate, value]);
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
- import { Animated, Platform, StyleProp, ViewStyle } from 'react-native';
2
+ import { Animated, StyleProp, ViewStyle } from 'react-native';
3
3
 
4
+ import { useTheme } from '../../theme';
4
5
  import {
5
- StyledPageControlAnimatedView,
6
6
  StyledPageControl,
7
+ StyledPageControlAnimatedView,
7
8
  } from './StyledPageControl';
8
- import { useTheme } from '../../theme';
9
9
 
10
10
  export interface PageControlProps {
11
11
  /**
@@ -37,7 +37,7 @@ const PageControl = ({
37
37
  React.useEffect(() => {
38
38
  Animated.spring(animatedValue, {
39
39
  toValue: currentPage,
40
- useNativeDriver: Platform.OS !== 'web',
40
+ useNativeDriver: false, // Native driver does not support animating width, it will cause the app to crash if set to true
41
41
  }).start();
42
42
  }, [currentPage]);
43
43