@hero-design/rn 8.55.1-rc2.3 → 8.55.1

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.
@@ -2,4 +2,4 @@
2
2
  src/index.ts → lib/index.js, es/index.js...
3
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
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 58.8s
5
+ created lib/index.js, es/index.js in 57.1s
package/CHANGELOG.md CHANGED
@@ -1,45 +1,10 @@
1
1
  # @hero-design/rn
2
2
 
3
- ## 8.55.1-rc2.3
3
+ ## 8.55.1
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Updated dependencies [[`25ae9a822`](https://github.com/Thinkei/hero-design/commit/25ae9a822f6981c2d874b204ac927dbc1785c837), [`6f0724064`](https://github.com/Thinkei/hero-design/commit/6f0724064299a409b8c3b0047f9c17a549ddb58a)]:
8
- - @hero-design/colors@8.42.6-rc2.3
9
-
10
- ## 8.55.1-rc2.2
11
-
12
- ### Patch Changes
13
-
14
- - [#2647](https://github.com/Thinkei/hero-design/pull/2647) [`c5d38100f`](https://github.com/Thinkei/hero-design/commit/c5d38100f7a484a90164b06405f78e09f13d5a5b) Thanks [@ttkien](https://github.com/ttkien)! - fix
15
-
16
- - [#2647](https://github.com/Thinkei/hero-design/pull/2647) [`d24b42494`](https://github.com/Thinkei/hero-design/commit/d24b42494b3915b2500067a51b3970a528224c5b) Thanks [@ttkien](https://github.com/ttkien)! - fix release flow
17
-
18
- - Updated dependencies [[`c5d38100f`](https://github.com/Thinkei/hero-design/commit/c5d38100f7a484a90164b06405f78e09f13d5a5b), [`d24b42494`](https://github.com/Thinkei/hero-design/commit/d24b42494b3915b2500067a51b3970a528224c5b)]:
19
- - @hero-design/colors@8.42.6-rc2.2
20
- - @hero-design/react-native-month-year-picker@8.42.7-rc2.2
21
-
22
- ## 8.55.1-rc2.1
23
-
24
- ### Patch Changes
25
-
26
- - [#2647](https://github.com/Thinkei/hero-design/pull/2647) [`286e61897`](https://github.com/Thinkei/hero-design/commit/286e61897f3d3a187dfec6f62f46ec8e0028801f) Thanks [@ttkien](https://github.com/ttkien)! - update release flow
27
-
28
- - Updated dependencies [[`286e61897`](https://github.com/Thinkei/hero-design/commit/286e61897f3d3a187dfec6f62f46ec8e0028801f)]:
29
- - @hero-design/colors@8.42.6-rc2.1
30
- - @hero-design/react-native-month-year-picker@8.42.7-rc2.1
31
-
32
- ## 8.55.1-rc2.0
33
-
34
- ### Patch Changes
35
-
36
- - [#2647](https://github.com/Thinkei/hero-design/pull/2647) [`96d0a79e0`](https://github.com/Thinkei/hero-design/commit/96d0a79e008db83c915bbadc8d70a5403d6bd4e3) Thanks [@ttkien](https://github.com/ttkien)! - add pre-commit
37
-
38
- - [#2647](https://github.com/Thinkei/hero-design/pull/2647) [`35fcc3812`](https://github.com/Thinkei/hero-design/commit/35fcc3812a090140848c80ed8d5f39026c4c5ee2) Thanks [@ttkien](https://github.com/ttkien)! - yarn install after bump version
39
-
40
- - Updated dependencies [[`96d0a79e0`](https://github.com/Thinkei/hero-design/commit/96d0a79e008db83c915bbadc8d70a5403d6bd4e3), [`35fcc3812`](https://github.com/Thinkei/hero-design/commit/35fcc3812a090140848c80ed8d5f39026c4c5ee2)]:
41
- - @hero-design/colors@8.42.6-rc2.0
42
- - @hero-design/react-native-month-year-picker@8.42.7-rc2.0
7
+ - [#2666](https://github.com/Thinkei/hero-design/pull/2666) [`61807698e`](https://github.com/Thinkei/hero-design/commit/61807698e94cc831a9083f3d531131c86f4af220) Thanks [@ttkien](https://github.com/ttkien)! - [Carousel] replace useWindowsDimension with onLayout and convert Carousel example to react-native-web
43
8
 
44
9
  ## 8.55.0
45
10
 
package/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as reactNative from 'react-native';
2
- import { Platform, Dimensions, StyleSheet as StyleSheet$1, Animated, View, UIManager, LayoutAnimation, TouchableOpacity, Text as Text$1, Easing, Image as Image$1, TouchableWithoutFeedback, Pressable, SafeAreaView, KeyboardAvoidingView, TouchableHighlight, ScrollView, Modal as Modal$1, FlatList, useWindowDimensions, TextInput as TextInput$1, PanResponder, BackHandler, InteractionManager, Keyboard, SectionList, RefreshControl as RefreshControl$1 } from 'react-native';
2
+ import { Platform, Dimensions, StyleSheet as StyleSheet$1, Animated, View, UIManager, LayoutAnimation, TouchableOpacity, Text as Text$1, Easing, Image as Image$1, TouchableWithoutFeedback, Pressable, SafeAreaView, KeyboardAvoidingView, TouchableHighlight, ScrollView, Modal as Modal$1, FlatList, TextInput as TextInput$1, PanResponder, BackHandler, InteractionManager, useWindowDimensions, Keyboard, SectionList, RefreshControl as RefreshControl$1 } from 'react-native';
3
3
  import React, { useContext, createContext, createElement, useMemo, forwardRef, useEffect, useCallback, useRef, useState, memo, useReducer, useLayoutEffect, useImperativeHandle, isValidElement } from 'react';
4
4
  import { createIconSet } from 'react-native-vector-icons';
5
5
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
@@ -12376,8 +12376,15 @@ var Carousel = function Carousel(_ref) {
12376
12376
  onItemIndexChange(index);
12377
12377
  }
12378
12378
  }, [setCurrentSlideIndex, onItemIndexChange]);
12379
- var _useWindowDimensions = useWindowDimensions(),
12380
- width = _useWindowDimensions.width;
12379
+ var _useState3 = useState(0),
12380
+ _useState4 = _slicedToArray(_useState3, 2),
12381
+ flatListWidth = _useState4[0],
12382
+ setFlatListWidth = _useState4[1];
12383
+ var itemWidth = flatListWidth;
12384
+ var flatListOnLayout = useCallback(function (e) {
12385
+ setFlatListWidth(e.nativeEvent.layout.width);
12386
+ }, [setFlatListWidth]);
12387
+ var width = flatListWidth;
12381
12388
  var scrollX = useRef(new Animated.Value(0)).current;
12382
12389
  useEffect(function () {
12383
12390
  // must use setTimeout since when layout is mounted, the pagination dots are not set correct scrollX
@@ -12392,7 +12399,7 @@ var Carousel = function Carousel(_ref) {
12392
12399
  return function () {
12393
12400
  clearTimeout(handle);
12394
12401
  };
12395
- }, [currentSlideIndex, carouselRef]);
12402
+ }, [currentSlideIndex, carouselRef, scrollX, width]);
12396
12403
  var viewConfig = useRef({
12397
12404
  viewAreaCoveragePercentThreshold: 50
12398
12405
  }).current;
@@ -12413,6 +12420,7 @@ var Carousel = function Carousel(_ref) {
12413
12420
  numberOfPages: items.length,
12414
12421
  currentPage: currentSlideIndex
12415
12422
  })), /*#__PURE__*/React.createElement(StyledCarouselView, null, /*#__PURE__*/React.createElement(FlatList, {
12423
+ onLayout: flatListOnLayout,
12416
12424
  testID: testID ? "".concat(testID, "_flatlist") : undefined,
12417
12425
  horizontal: true,
12418
12426
  showsHorizontalScrollIndicator: false,
@@ -12446,6 +12454,13 @@ var Carousel = function Carousel(_ref) {
12446
12454
  content: content,
12447
12455
  width: width
12448
12456
  });
12457
+ },
12458
+ getItemLayout: function getItemLayout(_, index) {
12459
+ return {
12460
+ length: itemWidth,
12461
+ offset: itemWidth * index,
12462
+ index: index
12463
+ };
12449
12464
  }
12450
12465
  }), /*#__PURE__*/React.createElement(StyledCarouselFooterWrapper, null, renderActions && renderActions(currentSlideIndex), pageControlPosition === 'bottom' && shouldRenderPagination && /*#__PURE__*/React.createElement(StyledPageControl, {
12451
12466
  numberOfPages: items.length,
package/lib/index.js CHANGED
@@ -12406,8 +12406,15 @@ var Carousel = function Carousel(_ref) {
12406
12406
  onItemIndexChange(index);
12407
12407
  }
12408
12408
  }, [setCurrentSlideIndex, onItemIndexChange]);
12409
- var _useWindowDimensions = reactNative.useWindowDimensions(),
12410
- width = _useWindowDimensions.width;
12409
+ var _useState3 = React.useState(0),
12410
+ _useState4 = _slicedToArray(_useState3, 2),
12411
+ flatListWidth = _useState4[0],
12412
+ setFlatListWidth = _useState4[1];
12413
+ var itemWidth = flatListWidth;
12414
+ var flatListOnLayout = React.useCallback(function (e) {
12415
+ setFlatListWidth(e.nativeEvent.layout.width);
12416
+ }, [setFlatListWidth]);
12417
+ var width = flatListWidth;
12411
12418
  var scrollX = React.useRef(new reactNative.Animated.Value(0)).current;
12412
12419
  React.useEffect(function () {
12413
12420
  // must use setTimeout since when layout is mounted, the pagination dots are not set correct scrollX
@@ -12422,7 +12429,7 @@ var Carousel = function Carousel(_ref) {
12422
12429
  return function () {
12423
12430
  clearTimeout(handle);
12424
12431
  };
12425
- }, [currentSlideIndex, carouselRef]);
12432
+ }, [currentSlideIndex, carouselRef, scrollX, width]);
12426
12433
  var viewConfig = React.useRef({
12427
12434
  viewAreaCoveragePercentThreshold: 50
12428
12435
  }).current;
@@ -12443,6 +12450,7 @@ var Carousel = function Carousel(_ref) {
12443
12450
  numberOfPages: items.length,
12444
12451
  currentPage: currentSlideIndex
12445
12452
  })), /*#__PURE__*/React__default["default"].createElement(StyledCarouselView, null, /*#__PURE__*/React__default["default"].createElement(reactNative.FlatList, {
12453
+ onLayout: flatListOnLayout,
12446
12454
  testID: testID ? "".concat(testID, "_flatlist") : undefined,
12447
12455
  horizontal: true,
12448
12456
  showsHorizontalScrollIndicator: false,
@@ -12476,6 +12484,13 @@ var Carousel = function Carousel(_ref) {
12476
12484
  content: content,
12477
12485
  width: width
12478
12486
  });
12487
+ },
12488
+ getItemLayout: function getItemLayout(_, index) {
12489
+ return {
12490
+ length: itemWidth,
12491
+ offset: itemWidth * index,
12492
+ index: index
12493
+ };
12479
12494
  }
12480
12495
  }), /*#__PURE__*/React__default["default"].createElement(StyledCarouselFooterWrapper, null, renderActions && renderActions(currentSlideIndex), pageControlPosition === 'bottom' && shouldRenderPagination && /*#__PURE__*/React__default["default"].createElement(StyledPageControl, {
12481
12496
  numberOfPages: items.length,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "8.55.1-rc2.3",
3
+ "version": "8.55.1",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -10,7 +10,7 @@
10
10
  "type-check": "tsc --noEmit",
11
11
  "test": "jest --runInBand",
12
12
  "test:watch": "jest --runInBand --watch",
13
- "test:ci": "jest --c=jest-ci.config.js --i --logHeapUsage",
13
+ "test:ci": "jest --c=jest-ci.config.js --i --logHeapUsage --coverage && cat ./coverage/lcov.info",
14
14
  "build:js": "rollup -c",
15
15
  "build:types": "tsc --noEmit false --emitDeclarationOnly --project tsconfig.prod.json",
16
16
  "build": "yarn build:js && yarn build:types",
@@ -22,14 +22,14 @@
22
22
  "@emotion/native": "^11.9.3",
23
23
  "@emotion/primitives-core": "11.0.0",
24
24
  "@emotion/react": "^11.9.3",
25
- "@hero-design/colors": "8.42.6-rc2.3",
25
+ "@hero-design/colors": "8.42.5",
26
26
  "date-fns": "^2.16.1",
27
27
  "events": "^3.2.0",
28
28
  "hero-editor": "^1.9.21",
29
29
  "nanoid": "^4.0.2"
30
30
  },
31
31
  "peerDependencies": {
32
- "@hero-design/react-native-month-year-picker": "^8.42.7-rc2.2",
32
+ "@hero-design/react-native-month-year-picker": "^8.42.6",
33
33
  "@react-native-community/datetimepicker": "^3.5.2",
34
34
  "@react-native-community/slider": "4.4.3",
35
35
  "react": "18.2.0",
@@ -48,8 +48,8 @@
48
48
  "@babel/preset-typescript": "^7.20.0",
49
49
  "@babel/runtime": "^7.20.0",
50
50
  "@emotion/jest": "^11.11.0",
51
- "@hero-design/eslint-plugin": "9.0.1-rc2.2",
52
- "@hero-design/react-native-month-year-picker": "^8.42.7-rc2.2",
51
+ "@hero-design/eslint-plugin": "9.0.0",
52
+ "@hero-design/react-native-month-year-picker": "^8.42.6",
53
53
  "@react-native-community/datetimepicker": "3.5.2",
54
54
  "@react-native-community/slider": "4.4.3",
55
55
  "@rollup/plugin-babel": "^5.3.1",
@@ -66,12 +66,12 @@
66
66
  "babel-plugin-inline-import": "^3.0.0",
67
67
  "core-js": "^3.33.0",
68
68
  "eslint": "^8.56.0",
69
- "eslint-config-hd": "8.42.5-rc2.2",
69
+ "eslint-config-hd": "8.42.4",
70
70
  "eslint-plugin-import": "^2.27.5",
71
71
  "jest": "^29.2.1",
72
72
  "jest-environment-jsdom": "^29.2.1",
73
73
  "jest-junit": "^16.0.0",
74
- "prettier-config-hd": "8.42.5-rc2.2",
74
+ "prettier-config-hd": "8.42.4",
75
75
  "react": "18.2.0",
76
76
  "react-native": "0.71.14",
77
77
  "react-native-gesture-handler": "~2.5.0",
@@ -7,3 +7,4 @@ sonar.sources=.
7
7
  sonar.inclusions=**/*
8
8
  sonar.exclusions=**/__tests__/**,**/public/**
9
9
  sonar.java.binaries=**/src/main/java
10
+ sonar.javascript.lcov.reportPaths=./coverage/lcov.info