@hero-design/rn 8.84.2 → 8.84.3

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.
@@ -1,7 +1,7 @@
1
- (node:2992) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
1
+ (node:3013) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
2
2
  (Use `node --trace-warnings ...` to show where the warning was created)
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
6
  (!) [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.or passing a function to 'preferBuiltins' to provide more fine-grained control over which built-in modules to prefer.
7
- created lib/index.js, es/index.js in 52.3s
7
+ created lib/index.js, es/index.js in 51.4s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @hero-design/rn
2
2
 
3
+ ## 8.84.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#3598](https://github.com/Thinkei/hero-design/pull/3598) [`b837f8d5986633709c679de6132c10b8d404c398`](https://github.com/Thinkei/hero-design/commit/b837f8d5986633709c679de6132c10b8d404c398) Thanks [@nhatle684](https://github.com/nhatle684)! - [BottomSheet.ScrollView] Add support ref
8
+
3
9
  ## 8.84.2
4
10
 
5
11
  ### Patch Changes
package/es/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as reactNative from 'react-native';
2
2
  import { Platform, Dimensions, StyleSheet as StyleSheet$1, Animated, View, UIManager, LayoutAnimation, TouchableOpacity, Text as Text$1, Easing, useWindowDimensions, TouchableWithoutFeedback, Modal as Modal$1, Image as Image$1, Pressable, SafeAreaView, KeyboardAvoidingView, TouchableHighlight, ScrollView, FlatList, TextInput as TextInput$1, PanResponder, BackHandler, InteractionManager, Keyboard, SectionList, RefreshControl as RefreshControl$1 } from 'react-native';
3
3
  import * as React from 'react';
4
- import React__default, { useMemo, useEffect, useCallback, useRef, useLayoutEffect, useState, createContext, useContext, forwardRef, memo, useReducer, useImperativeHandle, isValidElement } from 'react';
4
+ import React__default, { useMemo, useEffect, useCallback, useRef, useLayoutEffect, useState, createContext, forwardRef, useContext, memo, useReducer, useImperativeHandle, isValidElement } from 'react';
5
5
  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';
@@ -10133,7 +10133,7 @@ var Header = function Header(_ref) {
10133
10133
  };
10134
10134
 
10135
10135
  var _excluded$x = ["scrollEventThrottle"];
10136
- var BottomSheetScrollView = function BottomSheetScrollView(_ref) {
10136
+ var BottomSheetScrollView = /*#__PURE__*/forwardRef(function (_ref, ref) {
10137
10137
  var _ref$scrollEventThrot = _ref.scrollEventThrottle,
10138
10138
  scrollEventThrottle = _ref$scrollEventThrot === void 0 ? 100 : _ref$scrollEventThrot,
10139
10139
  props = _objectWithoutProperties(_ref, _excluded$x);
@@ -10155,12 +10155,13 @@ var BottomSheetScrollView = function BottomSheetScrollView(_ref) {
10155
10155
  props === null || props === void 0 || (_props$onMomentumScro2 = props.onMomentumScrollEnd) === null || _props$onMomentumScro2 === void 0 || _props$onMomentumScro2.call(props, e);
10156
10156
  }, []);
10157
10157
  return /*#__PURE__*/React__default.createElement(ScrollView, _extends$1({}, props, {
10158
+ ref: ref,
10158
10159
  onScrollBeginDrag: onScrollBeginDrag,
10159
10160
  onMomentumScrollBegin: onMomentumScrollBegin,
10160
10161
  onMomentumScrollEnd: onMomentumScrollEnd,
10161
10162
  scrollEventThrottle: scrollEventThrottle
10162
10163
  }));
10163
- };
10164
+ });
10164
10165
 
10165
10166
  var BottomSheet = function BottomSheet(_ref) {
10166
10167
  var open = _ref.open,
package/lib/index.js CHANGED
@@ -10161,7 +10161,7 @@ var Header = function Header(_ref) {
10161
10161
  };
10162
10162
 
10163
10163
  var _excluded$x = ["scrollEventThrottle"];
10164
- var BottomSheetScrollView = function BottomSheetScrollView(_ref) {
10164
+ var BottomSheetScrollView = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
10165
10165
  var _ref$scrollEventThrot = _ref.scrollEventThrottle,
10166
10166
  scrollEventThrottle = _ref$scrollEventThrot === void 0 ? 100 : _ref$scrollEventThrot,
10167
10167
  props = _objectWithoutProperties(_ref, _excluded$x);
@@ -10183,12 +10183,13 @@ var BottomSheetScrollView = function BottomSheetScrollView(_ref) {
10183
10183
  props === null || props === void 0 || (_props$onMomentumScro2 = props.onMomentumScrollEnd) === null || _props$onMomentumScro2 === void 0 || _props$onMomentumScro2.call(props, e);
10184
10184
  }, []);
10185
10185
  return /*#__PURE__*/React__namespace.default.createElement(reactNative.ScrollView, _extends$1({}, props, {
10186
+ ref: ref,
10186
10187
  onScrollBeginDrag: onScrollBeginDrag,
10187
10188
  onMomentumScrollBegin: onMomentumScrollBegin,
10188
10189
  onMomentumScrollEnd: onMomentumScrollEnd,
10189
10190
  scrollEventThrottle: scrollEventThrottle
10190
10191
  }));
10191
- };
10192
+ });
10192
10193
 
10193
10194
  var BottomSheet = function BottomSheet(_ref) {
10194
10195
  var open = _ref.open,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "8.84.2",
3
+ "version": "8.84.3",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -1,4 +1,4 @@
1
- import React, { useContext, useCallback } from 'react';
1
+ import React, { useContext, useCallback, forwardRef } from 'react';
2
2
  import {
3
3
  NativeScrollEvent,
4
4
  NativeSyntheticEvent,
@@ -9,49 +9,49 @@ import BottomSheetContext, {
9
9
  BottomSheetContextType,
10
10
  } from './BottomSheetContext';
11
11
 
12
- const BottomSheetScrollView = ({
13
- scrollEventThrottle = 100,
14
- ...props
15
- }: ScrollViewProps): JSX.Element => {
16
- const { setInternalShowDivider } =
17
- useContext<BottomSheetContextType>(BottomSheetContext);
18
-
19
- const onScrollBeginDrag = useCallback(
20
- (e: NativeSyntheticEvent<NativeScrollEvent>) => {
21
- setInternalShowDivider(true);
22
-
23
- props?.onScrollBeginDrag?.(e);
24
- },
25
- []
26
- );
27
-
28
- const onMomentumScrollBegin = useCallback(
29
- (e: NativeSyntheticEvent<NativeScrollEvent>) => {
30
- setInternalShowDivider(true);
31
-
32
- props?.onMomentumScrollEnd?.(e);
33
- },
34
- []
35
- );
36
-
37
- const onMomentumScrollEnd = useCallback(
38
- (e: NativeSyntheticEvent<NativeScrollEvent>) => {
39
- setInternalShowDivider(false);
40
-
41
- props?.onMomentumScrollEnd?.(e);
42
- },
43
- []
44
- );
45
-
46
- return (
47
- <ScrollView
48
- {...props}
49
- onScrollBeginDrag={onScrollBeginDrag}
50
- onMomentumScrollBegin={onMomentumScrollBegin}
51
- onMomentumScrollEnd={onMomentumScrollEnd}
52
- scrollEventThrottle={scrollEventThrottle}
53
- />
54
- );
55
- };
12
+ const BottomSheetScrollView = forwardRef<ScrollView, ScrollViewProps>(
13
+ ({ scrollEventThrottle = 100, ...props }, ref): JSX.Element => {
14
+ const { setInternalShowDivider } =
15
+ useContext<BottomSheetContextType>(BottomSheetContext);
16
+
17
+ const onScrollBeginDrag = useCallback(
18
+ (e: NativeSyntheticEvent<NativeScrollEvent>) => {
19
+ setInternalShowDivider(true);
20
+
21
+ props?.onScrollBeginDrag?.(e);
22
+ },
23
+ []
24
+ );
25
+
26
+ const onMomentumScrollBegin = useCallback(
27
+ (e: NativeSyntheticEvent<NativeScrollEvent>) => {
28
+ setInternalShowDivider(true);
29
+
30
+ props?.onMomentumScrollEnd?.(e);
31
+ },
32
+ []
33
+ );
34
+
35
+ const onMomentumScrollEnd = useCallback(
36
+ (e: NativeSyntheticEvent<NativeScrollEvent>) => {
37
+ setInternalShowDivider(false);
38
+
39
+ props?.onMomentumScrollEnd?.(e);
40
+ },
41
+ []
42
+ );
43
+
44
+ return (
45
+ <ScrollView
46
+ {...props}
47
+ ref={ref}
48
+ onScrollBeginDrag={onScrollBeginDrag}
49
+ onMomentumScrollBegin={onMomentumScrollBegin}
50
+ onMomentumScrollEnd={onMomentumScrollEnd}
51
+ scrollEventThrottle={scrollEventThrottle}
52
+ />
53
+ );
54
+ }
55
+ );
56
56
 
57
57
  export default BottomSheetScrollView;
@@ -4840,3 +4840,5 @@ var drawChart = (function (exports) {
4840
4840
  </body>
4841
4841
  </html>
4842
4842
 
4843
+
4844
+