@draftbit/core 49.0.1-c3bbf3.2 → 49.0.1-ecd6ba.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "49.0.1-c3bbf3.2+c3bbf33",
3
+ "version": "49.0.1-ecd6ba.2+ecd6bad",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "types": "lib/typescript/src/index.d.ts",
@@ -41,14 +41,14 @@
41
41
  "dependencies": {
42
42
  "@date-io/date-fns": "^1.3.13",
43
43
  "@draftbit/react-theme-provider": "^2.1.1",
44
- "@draftbit/types": "^49.0.1-c3bbf3.2+c3bbf33",
44
+ "@draftbit/types": "^49.0.1-ecd6ba.2+ecd6bad",
45
45
  "@expo/vector-icons": "^13.0.0",
46
+ "@gorhom/bottom-sheet": "^5.0.0-alpha.4",
46
47
  "@material-ui/core": "^4.11.0",
47
48
  "@material-ui/pickers": "^3.2.10",
48
49
  "@react-native-community/slider": "4.4.2",
49
50
  "@react-native-picker/picker": "2.4.10",
50
51
  "@shopify/flash-list": "1.4.3",
51
- "@youssefhenna/react-native-reanimated2": "2.18.0",
52
52
  "color": "^3.1.2",
53
53
  "date-fns": "^2.16.1",
54
54
  "dateformat": "^3.0.3",
@@ -104,5 +104,5 @@
104
104
  ],
105
105
  "testEnvironment": "node"
106
106
  },
107
- "gitHead": "c3bbf33ca92b74065004854ee727405316dae9e9"
107
+ "gitHead": "ecd6bade2b52d4893dd22709696ebf79690142ef"
108
108
  }
@@ -1,72 +1,81 @@
1
1
  import React from "react";
2
- import { StyleSheet, View, } from "react-native";
3
- import BottomSheetComponent from "./BottomSheetComponent";
2
+ import { StyleSheet, Dimensions, } from "react-native";
3
+ import BottomSheetComponent, { BottomSheetScrollView, } from "@gorhom/bottom-sheet";
4
4
  import { withTheme } from "../../theming";
5
+ import { useDeepCompareMemo } from "../../utilities";
6
+ const windowHeight = Dimensions.get("window").height;
7
+ // Clarification:
8
+ // Input of snap points is sorted top -> bottom where each value represents distance from top
9
+ // Implementation using `@gorhom/bottom-sheet` is sorted bottom -> top where each value represents distance from bottom
5
10
  const BottomSheet = React.forwardRef(({ theme, snapPoints: snapPointsProp, topSnapPosition = "10%", middleSnapPosition = "50%", bottomSnapPosition = "80%", initialSnapIndex, initialSnapPosition = "bottom", showHandle = true, handleColor = theme.colors.divider, topBorderRadius = 20, borderWidth = 1, borderColor = theme.colors.divider, onSettle, style, children, ...rest }, ref) => {
6
11
  const backgroundColor = (style === null || style === void 0 ? void 0 : style.backgroundColor) || theme.colors.background;
7
- const snapPoints = snapPointsProp || [
12
+ const snapPoints = snapPointsProp !== null && snapPointsProp !== void 0 ? snapPointsProp : [
8
13
  topSnapPosition,
9
14
  middleSnapPosition,
10
15
  bottomSnapPosition,
11
16
  ];
17
+ const mappedSnapPoints = useDeepCompareMemo(() => convertSnapPointsForNewImplementation(snapPoints), snapPoints);
12
18
  const getSnapIndexFromPosition = (position) => {
13
19
  switch (position) {
14
- case "top":
20
+ case "bottom":
15
21
  return 0;
16
22
  case "middle":
17
23
  return 1;
18
- case "bottom":
24
+ case "top":
19
25
  return 2;
20
26
  }
21
27
  };
22
- return (React.createElement(View, { style: styles.parentContainer, pointerEvents: "box-none" },
23
- React.createElement(BottomSheetComponent, { ref: ref, componentType: "ScrollView", snapPoints: snapPoints, initialSnapIndex: initialSnapIndex !== null && initialSnapIndex !== void 0 ? initialSnapIndex : getSnapIndexFromPosition(initialSnapPosition), renderHandle: () => (React.createElement(React.Fragment, null, showHandle && (React.createElement(View, { style: [
24
- styles.handleContainer,
25
- {
26
- backgroundColor,
27
- borderTopLeftRadius: topBorderRadius,
28
- borderTopRightRadius: topBorderRadius,
29
- },
30
- ] },
31
- React.createElement(View, { style: [styles.handle, { backgroundColor: handleColor }] }))))), contentContainerStyle: [styles.contentContainerStyle, style], containerStyle: StyleSheet.flatten([
32
- styles.containerStyle,
33
- {
34
- backgroundColor,
35
- borderTopLeftRadius: topBorderRadius,
36
- borderTopRightRadius: topBorderRadius,
37
- borderWidth,
38
- borderColor,
39
- },
40
- ]), onSettle: onSettle, ...rest }, children)));
28
+ return (React.createElement(BottomSheetComponent, { ref: ref, snapPoints: mappedSnapPoints, index: initialSnapIndex != undefined
29
+ ? mappedSnapPoints.length - initialSnapIndex - 1
30
+ : getSnapIndexFromPosition(initialSnapPosition), handleIndicatorStyle: [
31
+ { backgroundColor: handleColor },
32
+ !showHandle ? { display: "none" } : {},
33
+ ], backgroundStyle: {
34
+ backgroundColor,
35
+ borderTopLeftRadius: topBorderRadius,
36
+ borderTopRightRadius: topBorderRadius,
37
+ borderWidth,
38
+ borderColor,
39
+ }, onChange: (index) => onSettle === null || onSettle === void 0 ? void 0 : onSettle(mappedSnapPoints.length - index - 1) },
40
+ React.createElement(BottomSheetScrollView, { contentContainerStyle: [styles.contentContainerStyle, style], ...rest }, children)));
41
41
  });
42
+ // @gorhom/bottom-sheet has a different format for snap points and requires some manipulation
43
+ function convertSnapPointsForNewImplementation(snapPoints) {
44
+ // Older implementation required snap points sorted top -> bottom, new library requires bottom -> top
45
+ const reversedSnapPoints = [...snapPoints].reverse();
46
+ // Older implementation required snap points as distance from top, new library requires them as distance from bottom
47
+ return reversedSnapPoints.map((point) => {
48
+ if (typeof point === "string") {
49
+ const percentNumber = extractPercentNumber(point);
50
+ if (percentNumber !== undefined) {
51
+ return `${100 - percentNumber}%`;
52
+ }
53
+ return point;
54
+ }
55
+ else if (typeof point === "number") {
56
+ return windowHeight - point;
57
+ }
58
+ else {
59
+ return point;
60
+ }
61
+ });
62
+ }
63
+ function extractPercentNumber(percentString) {
64
+ const percentRegex = /(\d+)?%/;
65
+ const matches = percentString.match(percentRegex);
66
+ if (matches === null || matches === void 0 ? void 0 : matches.length) {
67
+ const percentNumber = Number(matches[1]);
68
+ if (!isNaN(percentNumber)) {
69
+ return percentNumber;
70
+ }
71
+ }
72
+ return undefined;
73
+ }
42
74
  const styles = StyleSheet.create({
43
- //Render on top of everything
44
- parentContainer: {
45
- position: "absolute",
46
- left: 0,
47
- right: 0,
48
- top: 0,
49
- bottom: 0,
50
- zIndex: 10,
51
- overflow: "hidden",
52
- },
53
75
  contentContainerStyle: {
54
76
  paddingHorizontal: 16,
55
77
  paddingVertical: 10,
56
78
  },
57
- containerStyle: {
58
- flex: 1,
59
- overflow: "hidden",
60
- },
61
- handleContainer: {
62
- alignItems: "center",
63
- paddingVertical: 20,
64
- },
65
- handle: {
66
- width: 40,
67
- height: 2,
68
- borderRadius: 4,
69
- },
70
79
  });
71
80
  export default withTheme(BottomSheet);
72
81
  //# sourceMappingURL=BottomSheet.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BottomSheet.js","sourceRoot":"","sources":["BottomSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,UAAU,EACV,IAAI,GAIL,MAAM,cAAc,CAAC;AAEtB,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAuB1C,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAIlC,CACE,EACE,KAAK,EACL,UAAU,EAAE,cAAc,EAC1B,eAAe,GAAG,KAAK,EACvB,kBAAkB,GAAG,KAAK,EAC1B,kBAAkB,GAAG,KAAK,EAC1B,gBAAgB,EAChB,mBAAmB,GAAG,QAAQ,EAC9B,UAAU,GAAG,IAAI,EACjB,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,EAClC,eAAe,GAAG,EAAE,EACpB,WAAW,GAAG,CAAC,EACf,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,EAClC,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACR,EACD,GAAG,EACH,EAAE;IACF,MAAM,eAAe,GACnB,CAAC,KAAmB,aAAnB,K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AAM,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAClD,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE;QACnB,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QACzC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE;YACzB,OAAO,aAAa,CAAC;SACtB;KACF;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,qBAAqB,EAAE;QACrB,iBAAiB,EAAE,EAAE;QACrB,eAAe,EAAE,EAAE;KACpB;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC,WAAW,CAAC,CAAC"}
@@ -1,21 +1,30 @@
1
1
  import React from "react";
2
2
  import {
3
3
  StyleSheet,
4
- View,
5
4
  StyleProp,
6
5
  ViewStyle,
7
6
  ScrollViewProps,
7
+ Dimensions,
8
8
  } from "react-native";
9
9
 
10
- import BottomSheetComponent from "./BottomSheetComponent";
10
+ import BottomSheetComponent, {
11
+ BottomSheetScrollView,
12
+ } from "@gorhom/bottom-sheet";
11
13
  import type { Theme } from "../../styles/DefaultTheme";
12
14
  import { withTheme } from "../../theming";
15
+ import { useDeepCompareMemo } from "../../utilities";
13
16
 
14
17
  type SnapPosition = "top" | "middle" | "bottom";
18
+
19
+ const windowHeight = Dimensions.get("window").height;
20
+
15
21
  export interface BottomSheetProps extends ScrollViewProps {
16
22
  topSnapPosition?: string | number;
17
23
  middleSnapPosition?: string | number;
18
24
  bottomSnapPosition?: string | number;
25
+ /**
26
+ * As distance from top (number or percentage string), sorted from top to bottom
27
+ */
19
28
  snapPoints?: (string | number)[];
20
29
  initialSnapIndex?: number;
21
30
  initialSnapPosition?: SnapPosition;
@@ -32,10 +41,10 @@ export interface BottomSheetProps extends ScrollViewProps {
32
41
  theme: Theme;
33
42
  }
34
43
 
35
- const BottomSheet = React.forwardRef<
36
- BottomSheetComponent<any>,
37
- BottomSheetProps
38
- >(
44
+ // Clarification:
45
+ // Input of snap points is sorted top -> bottom where each value represents distance from top
46
+ // Implementation using `@gorhom/bottom-sheet` is sorted bottom -> top where each value represents distance from bottom
47
+ const BottomSheet = React.forwardRef<BottomSheetComponent, BottomSheetProps>(
39
48
  (
40
49
  {
41
50
  theme,
@@ -60,101 +69,101 @@ const BottomSheet = React.forwardRef<
60
69
  const backgroundColor =
61
70
  (style as ViewStyle)?.backgroundColor || theme.colors.background;
62
71
 
63
- const snapPoints = snapPointsProp || [
72
+ const snapPoints = snapPointsProp ?? [
64
73
  topSnapPosition,
65
74
  middleSnapPosition,
66
75
  bottomSnapPosition,
67
76
  ];
68
77
 
78
+ const mappedSnapPoints = useDeepCompareMemo(
79
+ () => convertSnapPointsForNewImplementation(snapPoints),
80
+ snapPoints
81
+ );
82
+
69
83
  const getSnapIndexFromPosition = (position: SnapPosition) => {
70
84
  switch (position) {
71
- case "top":
85
+ case "bottom":
72
86
  return 0;
73
87
  case "middle":
74
88
  return 1;
75
- case "bottom":
89
+ case "top":
76
90
  return 2;
77
91
  }
78
92
  };
79
93
 
80
94
  return (
81
- <View style={styles.parentContainer} pointerEvents="box-none">
82
- <BottomSheetComponent
83
- ref={ref}
84
- componentType="ScrollView"
85
- snapPoints={snapPoints}
86
- initialSnapIndex={
87
- initialSnapIndex ?? getSnapIndexFromPosition(initialSnapPosition)
88
- }
89
- renderHandle={() => (
90
- <>
91
- {showHandle && (
92
- <View
93
- style={[
94
- styles.handleContainer,
95
- {
96
- backgroundColor,
97
- borderTopLeftRadius: topBorderRadius,
98
- borderTopRightRadius: topBorderRadius,
99
- },
100
- ]}
101
- >
102
- <View
103
- style={[styles.handle, { backgroundColor: handleColor }]}
104
- />
105
- </View>
106
- )}
107
- </>
108
- )}
95
+ <BottomSheetComponent
96
+ ref={ref}
97
+ snapPoints={mappedSnapPoints}
98
+ index={
99
+ initialSnapIndex != undefined
100
+ ? mappedSnapPoints.length - initialSnapIndex - 1
101
+ : getSnapIndexFromPosition(initialSnapPosition)
102
+ }
103
+ handleIndicatorStyle={[
104
+ { backgroundColor: handleColor },
105
+ !showHandle ? { display: "none" } : {},
106
+ ]}
107
+ backgroundStyle={{
108
+ backgroundColor,
109
+ borderTopLeftRadius: topBorderRadius,
110
+ borderTopRightRadius: topBorderRadius,
111
+ borderWidth,
112
+ borderColor,
113
+ }}
114
+ onChange={(index) => onSettle?.(mappedSnapPoints.length - index - 1)}
115
+ >
116
+ <BottomSheetScrollView
109
117
  contentContainerStyle={[styles.contentContainerStyle, style]}
110
- containerStyle={StyleSheet.flatten([
111
- styles.containerStyle,
112
- {
113
- backgroundColor,
114
- borderTopLeftRadius: topBorderRadius,
115
- borderTopRightRadius: topBorderRadius,
116
- borderWidth,
117
- borderColor,
118
- },
119
- ])}
120
- onSettle={onSettle}
121
118
  {...rest}
122
119
  >
123
120
  {children}
124
- </BottomSheetComponent>
125
- </View>
121
+ </BottomSheetScrollView>
122
+ </BottomSheetComponent>
126
123
  );
127
124
  }
128
125
  );
129
126
 
127
+ // @gorhom/bottom-sheet has a different format for snap points and requires some manipulation
128
+ function convertSnapPointsForNewImplementation(
129
+ snapPoints: (string | number)[]
130
+ ) {
131
+ // Older implementation required snap points sorted top -> bottom, new library requires bottom -> top
132
+ const reversedSnapPoints = [...snapPoints].reverse();
133
+
134
+ // Older implementation required snap points as distance from top, new library requires them as distance from bottom
135
+ return reversedSnapPoints.map((point) => {
136
+ if (typeof point === "string") {
137
+ const percentNumber = extractPercentNumber(point);
138
+ if (percentNumber !== undefined) {
139
+ return `${100 - percentNumber}%`;
140
+ }
141
+ return point;
142
+ } else if (typeof point === "number") {
143
+ return windowHeight - point;
144
+ } else {
145
+ return point;
146
+ }
147
+ });
148
+ }
149
+
150
+ function extractPercentNumber(percentString: string) {
151
+ const percentRegex = /(\d+)?%/;
152
+ const matches = percentString.match(percentRegex);
153
+ if (matches?.length) {
154
+ const percentNumber = Number(matches[1]);
155
+ if (!isNaN(percentNumber)) {
156
+ return percentNumber;
157
+ }
158
+ }
159
+ return undefined;
160
+ }
161
+
130
162
  const styles = StyleSheet.create({
131
- //Render on top of everything
132
- parentContainer: {
133
- position: "absolute",
134
- left: 0,
135
- right: 0,
136
- top: 0,
137
- bottom: 0,
138
- zIndex: 10,
139
- overflow: "hidden",
140
- },
141
163
  contentContainerStyle: {
142
164
  paddingHorizontal: 16,
143
165
  paddingVertical: 10,
144
166
  },
145
- containerStyle: {
146
- flex: 1,
147
- overflow: "hidden",
148
- },
149
- handleContainer: {
150
- alignItems: "center",
151
- paddingVertical: 20,
152
- },
153
- handle: {
154
- width: 40,
155
- height: 2,
156
- borderRadius: 4,
157
- },
158
167
  });
159
168
 
160
169
  export default withTheme(BottomSheet);
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { View, StyleSheet, } from "react-native";
2
+ import { View, StyleSheet, Platform, } from "react-native";
3
3
  import TextInput from "../TextInput";
4
4
  import { CodeField, useClearByFocusCell, } from "react-native-confirmation-code-field";
5
5
  import { withTheme } from "../../theming";
@@ -54,7 +54,12 @@ const PinInput = React.forwardRef(({ theme, onInputFull, cellCount = 4, clearOnC
54
54
  onLayout: clearOnCellFocus ? getCellOnLayout(index) : undefined,
55
55
  });
56
56
  };
57
- return (React.createElement(CodeField, { ref: pinInputRef, ...(clearOnCellFocus ? codeFieldProps : {}), value: value, onChangeText: onChangeText, rootStyle: styles.rootContainer, textInputStyle: { height: "100%" }, InputComponent: TextInput, cellCount: cellCount, renderCell: ({ symbol: cellValue, index, isFocused }) => (React.createElement(React.Fragment, { key: index }, renderCell(cellValue, index, isFocused))), ...rest }));
57
+ return (React.createElement(CodeField, { ref: pinInputRef, ...(clearOnCellFocus ? codeFieldProps : {}), value: value, onChangeText: onChangeText, rootStyle: styles.rootContainer, textInputStyle: [
58
+ // addresses issue on firefox where the hidden input did not fill the height
59
+ { height: "100%" },
60
+ //@ts-ignore Web specific prop. Removes default blue outline that appears on the hidden TextInput
61
+ Platform.OS === "web" ? { outlineWidth: 0 } : {},
62
+ ], InputComponent: TextInput, cellCount: cellCount, renderCell: ({ symbol: cellValue, index, isFocused }) => (React.createElement(React.Fragment, { key: index }, renderCell(cellValue, index, isFocused))), ...rest }));
58
63
  });
59
64
  const styles = StyleSheet.create({
60
65
  rootContainer: {
@@ -1 +1 @@
1
- {"version":3,"file":"PinInput.js","sourceRoot":"","sources":["PinInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAKL,IAAI,EACJ,UAAU,GACX,MAAM,cAAc,CAAC;AACtB,OAAO,SAA6B,MAAM,cAAc,CAAC;AACzD,OAAO,EACL,SAAS,EACT,mBAAmB,GACpB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAsBhD,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAC/B,CACE,EACE,KAAK,EACL,WAAW,EACX,SAAS,GAAG,CAAC,EACb,gBAAgB,GAAG,IAAI,EACvB,UAAU,GAAG,IAAI,EACjB,UAAU,EACV,KAAK,EACL,YAAY,EACZ,kBAAkB,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,EACzC,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,EACL,GAAG,IAAI,EACR,EACD,GAAG,EACH,EAAE;IACF,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CAAkB,IAAI,CAAC,CAAC;IAE3D,+DAA+D;IAC/D,MAAM,WAAW,GAAG,GAAG;QACrB,CAAC,CAAE,GAAwC;QAC3C,CAAC,CAAC,cAAc,CAAC;IAEnB,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IAExD,mNAAmN;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AC,SAAS,EAAE,KAAK,EAAE,SAAS,CAAC,CACzB,CAClB,KACG,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,aAAa,EAAE;QACb,cAAc,EAAE,QAAQ;KACzB;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,CAAC;QACb,WAAW,EAAE,CAAC;QACd,OAAO,EAAE,CAAC;QACV,YAAY,EAAE,CAAC;QACf,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,WAAW,EAAE,CAAC;QACd,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,CAAC;QACd,IAAI,EAAE,CAAC;KACR;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,EAAE;KACb;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC,QAAQ,CAAC,CAAC"}
@@ -6,6 +6,7 @@ import {
6
6
  TextInput as NativeTextInput,
7
7
  View,
8
8
  StyleSheet,
9
+ Platform,
9
10
  } from "react-native";
10
11
  import TextInput, { TextInputProps } from "../TextInput";
11
12
  import {
@@ -133,7 +134,12 @@ const PinInput = React.forwardRef<NativeTextInput, PinInputProps>(
133
134
  value={value}
134
135
  onChangeText={onChangeText}
135
136
  rootStyle={styles.rootContainer}
136
- textInputStyle={{ height: "100%" }} // addresses issue on firefox where the hidden input did not fill the height
137
+ textInputStyle={[
138
+ // addresses issue on firefox where the hidden input did not fill the height
139
+ { height: "100%" },
140
+ //@ts-ignore Web specific prop. Removes default blue outline that appears on the hidden TextInput
141
+ Platform.OS === "web" ? { outlineWidth: 0 } : {},
142
+ ]}
137
143
  InputComponent={TextInput}
138
144
  cellCount={cellCount}
139
145
  renderCell={({ symbol: cellValue, index, isFocused }) => (
@@ -1 +0,0 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.ScrollBottomSheet=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativeReanimated=_interopRequireWildcard(require("@youssefhenna/react-native-reanimated2"));var _reactNativeGestureHandler=require("react-native-gesture-handler");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["renderHandle","initialSnapIndex","containerStyle"];var _imperativeScrollOpti,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/BottomSheet/BottomSheetComponent.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=(0,_getPrototypeOf2.default)(Derived),result;if(hasNativeReflectConstruct){var NewTarget=(0,_getPrototypeOf2.default)(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return(0,_possibleConstructorReturn2.default)(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}var interpolateDeprecated=_reactNativeReanimated.default.interpolate,interpolateNode=_reactNativeReanimated.default.interpolateNode;var interpolate=interpolateNode!=null?interpolateNode:interpolateDeprecated;var Easing=_reactNativeReanimated.EasingNode!=null?_reactNativeReanimated.EasingNode:_reactNativeReanimated.Easing;var FlatListComponentType="FlatList";var ScrollViewComponentType="ScrollView";var SectionListComponentType="SectionList";var TimingAnimationType="timing";var SpringAnimationType="spring";var DEFAULT_SPRING_PARAMS={damping:50,mass:0.3,stiffness:121.6,overshootClamping:true,restSpeedThreshold:0.3,restDisplacementThreshold:0.3};var _Dimensions$get=_reactNative.Dimensions.get("window"),windowHeight=_Dimensions$get.height;var IOS_NORMAL_DECELERATION_RATE=0.998;var ANDROID_NORMAL_DECELERATION_RATE=0.985;var DEFAULT_ANIMATION_DURATION=250;var DEFAULT_EASING=Easing.inOut(Easing.linear);var imperativeScrollOptions=(_imperativeScrollOpti={},(0,_defineProperty2.default)(_imperativeScrollOpti,FlatListComponentType,{method:"scrollToIndex",args:{index:0,viewPosition:0,viewOffset:1000,animated:true}}),(0,_defineProperty2.default)(_imperativeScrollOpti,ScrollViewComponentType,{method:"scrollTo",args:{x:0,y:0,animated:true}}),(0,_defineProperty2.default)(_imperativeScrollOpti,SectionListComponentType,{method:"scrollToLocation",args:{itemIndex:0,sectionIndex:0,viewPosition:0,viewOffset:1000,animated:true}}),_imperativeScrollOpti);var ScrollBottomSheet=function(_Component){(0,_inherits2.default)(ScrollBottomSheet,_Component);var _super=_createSuper(ScrollBottomSheet);function ScrollBottomSheet(props){var _props$animationConfi;var _this;(0,_classCallCheck2.default)(this,ScrollBottomSheet);_this=_super.call(this,props);_this.masterDrawer=_react.default.createRef();_this.drawerHandleRef=_react.default.createRef();_this.drawerContentRef=_react.default.createRef();_this.scrollComponentRef=_react.default.createRef();_this.isManuallySetValue=new _reactNativeReanimated.Value(0);_this.manualYOffset=new _reactNativeReanimated.Value(0);_this.prevSnapIndex=-1;_this.dragY=new _reactNativeReanimated.Value(0);_this.prevDragY=new _reactNativeReanimated.Value(0);_this.tempDestSnapPoint=new _reactNativeReanimated.Value(0);_this.isAndroid=new _reactNativeReanimated.Value(Number(_reactNative.Platform.OS==="android"));_this.animationClock=new _reactNativeReanimated.Clock();_this.animationPosition=new _reactNativeReanimated.Value(0);_this.animationFinished=new _reactNativeReanimated.Value(0);_this.animationFrameTime=new _reactNativeReanimated.Value(0);_this.velocityY=new _reactNativeReanimated.Value(0);_this.lastStartScrollY=new _reactNativeReanimated.Value(0);_this.destSnapPoint=new _reactNativeReanimated.Value(0);_this.dragWithHandle=new _reactNativeReanimated.Value(0);_this.scrollUpAndPullDown=new _reactNativeReanimated.Value(0);_this.convertPercentageToDp=function(str){return Number(str.split("%")[0])*(windowHeight-_this.props.topInset)/100;};_this.getNormalisedSnapPoints=function(){return _this.props.snapPoints.map(function(p){if(typeof p==="string"){return _this.convertPercentageToDp(p);}else if(typeof p==="number"){return p;}throw new Error(`Invalid type for value ${p}: ${typeof p}. It should be either a percentage string or a number`);});};_this.getScrollComponent=function(){switch(_this.props.componentType){case"FlatList":return _reactNative.FlatList;case"ScrollView":return _reactNative.ScrollView;case"SectionList":return _reactNative.SectionList;default:throw new Error("Component type not supported: it should be one of `FlatList`, `ScrollView` or `SectionList`");}};_this.snapTo=function(index){var snapPoints=_this.getNormalisedSnapPoints();_this.isManuallySetValue.setValue(1);_this.manualYOffset.setValue(snapPoints[index]);_this.nextSnapIndex.setValue(index);};var initialSnapIndex=props.initialSnapIndex,animationType=props.animationType;var animationDriver=animationType==="timing"?0:1;var animationDuration=props.animationType==="timing"&&((_props$animationConfi=props.animationConfig)==null?void 0:_props$animationConfi.duration)||DEFAULT_ANIMATION_DURATION;var ScrollComponent=_this.getScrollComponent();_this.scrollComponent=_reactNativeReanimated.default.createAnimatedComponent(ScrollComponent);var _snapPoints=_this.getNormalisedSnapPoints();var openPosition=_snapPoints[0];var closedPosition=_this.props.enableOverScroll?windowHeight:_snapPoints[_snapPoints.length-1];var initialSnap=_snapPoints[initialSnapIndex];_this.nextSnapIndex=new _reactNativeReanimated.Value(initialSnapIndex);var initialDecelerationRate=_reactNative.Platform.select({android:props.initialSnapIndex===0?ANDROID_NORMAL_DECELERATION_RATE:0,ios:IOS_NORMAL_DECELERATION_RATE});_this.decelerationRate=new _reactNativeReanimated.Value(initialDecelerationRate);var handleGestureState=new _reactNativeReanimated.Value(-1);var handleOldGestureState=new _reactNativeReanimated.Value(-1);var drawerGestureState=new _reactNativeReanimated.Value(-1);var drawerOldGestureState=new _reactNativeReanimated.Value(-1);var lastSnapInRange=new _reactNativeReanimated.Value(1);_this.prevTranslateYOffset=new _reactNativeReanimated.Value(initialSnap);_this.translationY=new _reactNativeReanimated.Value(initialSnap);_this.lastSnap=new _reactNativeReanimated.Value(initialSnap);_this.onHandleGestureEvent=(0,_reactNativeReanimated.event)([{nativeEvent:{translationY:_this.dragY,oldState:handleOldGestureState,state:handleGestureState,velocityY:_this.velocityY}}]);_this.onDrawerGestureEvent=(0,_reactNativeReanimated.event)([{nativeEvent:{translationY:_this.dragY,oldState:drawerOldGestureState,state:drawerGestureState,velocityY:_this.velocityY}}]);_this.onScrollBeginDrag=(0,_reactNativeReanimated.event)([{nativeEvent:{contentOffset:{y:_this.lastStartScrollY}}}]);var didHandleGestureBegin=(0,_reactNativeReanimated.eq)(handleGestureState,_reactNativeGestureHandler.State.ACTIVE);var isAnimationInterrupted=(0,_reactNativeReanimated.and)((0,_reactNativeReanimated.or)((0,_reactNativeReanimated.eq)(handleGestureState,_reactNativeGestureHandler.State.BEGAN),(0,_reactNativeReanimated.eq)(drawerGestureState,_reactNativeGestureHandler.State.BEGAN),(0,_reactNativeReanimated.and)((0,_reactNativeReanimated.eq)(_this.isAndroid,0),(0,_reactNativeReanimated.eq)(animationDriver,1),(0,_reactNativeReanimated.or)((0,_reactNativeReanimated.eq)(drawerGestureState,_reactNativeGestureHandler.State.ACTIVE),(0,_reactNativeReanimated.eq)(handleGestureState,_reactNativeGestureHandler.State.ACTIVE)))),(0,_reactNativeReanimated.clockRunning)(_this.animationClock));_this.didGestureFinish=(0,_reactNativeReanimated.or)((0,_reactNativeReanimated.and)((0,_reactNativeReanimated.eq)(handleOldGestureState,_reactNativeGestureHandler.State.ACTIVE),(0,_reactNativeReanimated.eq)(handleGestureState,_reactNativeGestureHandler.State.END)),(0,_reactNativeReanimated.and)((0,_reactNativeReanimated.eq)(drawerOldGestureState,_reactNativeGestureHandler.State.ACTIVE),(0,_reactNativeReanimated.eq)(drawerGestureState,_reactNativeGestureHandler.State.END)));var isLastSnapPointInRange=function isLastSnapPointInRange(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return i===_snapPoints.length?lastSnapInRange:(0,_reactNativeReanimated.cond)((0,_reactNativeReanimated.eq)(_this.lastSnap,_snapPoints[i]),[(0,_reactNativeReanimated.set)(lastSnapInRange,1)],isLastSnapPointInRange(i+1));};var scrollY=[(0,_reactNativeReanimated.set)(lastSnapInRange,0),isLastSnapPointInRange(),(0,_reactNativeReanimated.cond)((0,_reactNativeReanimated.or)(didHandleGestureBegin,(0,_reactNativeReanimated.and)(_this.isManuallySetValue,(0,_reactNativeReanimated.not)((0,_reactNativeReanimated.eq)(_this.manualYOffset,_snapPoints[0])))),[(0,_reactNativeReanimated.set)(_this.dragWithHandle,1),0]),(0,_reactNativeReanimated.cond)((0,_reactNativeReanimated.and)((0,_reactNativeReanimated.eq)(_this.dragWithHandle,1),(0,_reactNativeReanimated.greaterThan)(_snapPoints[0],(0,_reactNativeReanimated.add)(_this.lastSnap,_this.dragY)),(0,_reactNativeReanimated.and)((0,_reactNativeReanimated.not)((0,_reactNativeReanimated.eq)(_this.lastSnap,_snapPoints[0])),lastSnapInRange)),[(0,_reactNativeReanimated.set)(_this.lastSnap,_snapPoints[0]),(0,_reactNativeReanimated.set)(_this.dragWithHandle,0),_this.lastStartScrollY],(0,_reactNativeReanimated.cond)((0,_reactNativeReanimated.eq)(_this.dragWithHandle,1),0,_this.lastStartScrollY))];_this.didScrollUpAndPullDown=(0,_reactNativeReanimated.cond)((0,_reactNativeReanimated.and)((0,_reactNativeReanimated.greaterOrEq)(_this.dragY,_this.lastStartScrollY),(0,_reactNativeReanimated.greaterThan)(_this.lastStartScrollY,0)),(0,_reactNativeReanimated.set)(_this.scrollUpAndPullDown,1));_this.setTranslationY=(0,_reactNativeReanimated.cond)((0,_reactNativeReanimated.and)((0,_reactNativeReanimated.not)(_this.dragWithHandle),(0,_reactNativeReanimated.not)((0,_reactNativeReanimated.greaterOrEq)(_this.dragY,_this.lastStartScrollY))),(0,_reactNativeReanimated.set)(_this.translationY,(0,_reactNativeReanimated.sub)(_this.dragY,_this.lastStartScrollY)),(0,_reactNativeReanimated.set)(_this.translationY,_this.dragY));_this.extraOffset=(0,_reactNativeReanimated.cond)((0,_reactNativeReanimated.eq)(_this.scrollUpAndPullDown,1),_this.lastStartScrollY,0);var endOffsetY=(0,_reactNativeReanimated.add)(_this.lastSnap,_this.translationY,(0,_reactNativeReanimated.multiply)(1-props.friction,_this.velocityY));_this.calculateNextSnapPoint=function(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return i===_snapPoints.length?_this.tempDestSnapPoint:(0,_reactNativeReanimated.cond)((0,_reactNativeReanimated.greaterThan)((0,_reactNativeReanimated.abs)((0,_reactNativeReanimated.sub)(_this.tempDestSnapPoint,endOffsetY)),(0,_reactNativeReanimated.abs)((0,_reactNativeReanimated.sub)((0,_reactNativeReanimated.add)(_snapPoints[i],_this.extraOffset),endOffsetY))),[(0,_reactNativeReanimated.set)(_this.tempDestSnapPoint,(0,_reactNativeReanimated.add)(_snapPoints[i],_this.extraOffset)),(0,_reactNativeReanimated.set)(_this.nextSnapIndex,i),_this.calculateNextSnapPoint(i+1)],_this.calculateNextSnapPoint(i+1));};var runAnimation=function runAnimation(_ref){var _props$animationConfi2;var clock=_ref.clock,from=_ref.from,to=_ref.to,position=_ref.position,finished=_ref.finished,velocity=_ref.velocity,frameTime=_ref.frameTime;var state={finished:finished,velocity:new _reactNativeReanimated.Value(0),position:position,time:new _reactNativeReanimated.Value(0),frameTime:frameTime};var timingConfig={duration:animationDuration,easing:props.animationType==="timing"&&((_props$animationConfi2=props.animationConfig)==null?void 0:_props$animationConfi2.easing)||DEFAULT_EASING,toValue:new _reactNativeReanimated.Value(0)};var springConfig=Object.assign({},DEFAULT_SPRING_PARAMS,props.animationType==="spring"&&props.animationConfig||{},{toValue:new _reactNativeReanimated.Value(0)});return[(0,_reactNativeReanimated.cond)((0,_reactNativeReanimated.and)((0,_reactNativeReanimated.not)((0,_reactNativeReanimated.clockRunning)(clock)),(0,_reactNativeReanimated.not)((0,_reactNativeReanimated.eq)(finished,1))),[(0,_reactNativeReanimated.set)(state.finished,0),(0,_reactNativeReanimated.set)(state.velocity,velocity),(0,_reactNativeReanimated.set)(state.time,0),(0,_reactNativeReanimated.set)(state.position,from),(0,_reactNativeReanimated.set)(state.frameTime,0),(0,_reactNativeReanimated.set)(timingConfig.toValue,to),(0,_reactNativeReanimated.set)(springConfig.toValue,to),(0,_reactNativeReanimated.startClock)(clock)]),(0,_reactNativeReanimated.cond)((0,_reactNativeReanimated.eq)(animationDriver,0),(0,_reactNativeReanimated.timing)(clock,state,timingConfig),(0,_reactNativeReanimated.spring)(clock,state,springConfig)),(0,_reactNativeReanimated.cond)(state.finished,[(0,_reactNativeReanimated.call)([_this.nextSnapIndex],function(_ref2){var _ref3=(0,_slicedToArray2.default)(_ref2,1),value=_ref3[0];if(value!==_this.prevSnapIndex){_this.props.onSettle==null?void 0:_this.props.onSettle(value);}_this.prevSnapIndex=value;}),(0,_reactNativeReanimated.set)(drawerOldGestureState,_reactNativeGestureHandler.State.END),(0,_reactNativeReanimated.set)(handleOldGestureState,_reactNativeGestureHandler.State.END),(0,_reactNativeReanimated.set)(_this.prevTranslateYOffset,state.position),(0,_reactNativeReanimated.cond)((0,_reactNativeReanimated.eq)(_this.scrollUpAndPullDown,1),[(0,_reactNativeReanimated.set)(_this.prevTranslateYOffset,(0,_reactNativeReanimated.sub)(_this.prevTranslateYOffset,_this.lastStartScrollY)),(0,_reactNativeReanimated.set)(_this.lastStartScrollY,0),(0,_reactNativeReanimated.set)(_this.scrollUpAndPullDown,0)]),(0,_reactNativeReanimated.cond)((0,_reactNativeReanimated.eq)(_this.destSnapPoint,_snapPoints[0]),[(0,_reactNativeReanimated.set)(_this.dragWithHandle,0)]),(0,_reactNativeReanimated.set)(_this.isManuallySetValue,0),(0,_reactNativeReanimated.set)(_this.manualYOffset,0),(0,_reactNativeReanimated.stopClock)(clock),_this.prevTranslateYOffset],state.position)];};var translateYOffset=(0,_reactNativeReanimated.cond)(isAnimationInterrupted,[(0,_reactNativeReanimated.cond)((0,_reactNativeReanimated.or)(_this.dragWithHandle,(0,_reactNativeReanimated.greaterOrEq)((0,_reactNativeReanimated.abs)(_this.prevDragY),_this.lastStartScrollY)),(0,_reactNativeReanimated.set)(_this.prevTranslateYOffset,_this.animationPosition)),(0,_reactNativeReanimated.set)(_this.animationFinished,1),(0,_reactNativeReanimated.set)(_this.translationY,0),(0,_reactNativeReanimated.set)(drawerOldGestureState,_reactNativeGestureHandler.State.END),(0,_reactNativeReanimated.set)(handleOldGestureState,_reactNativeGestureHandler.State.END),(0,_reactNativeReanimated.set)(_this.animationFrameTime,(0,_reactNativeReanimated.add)(animationDuration,1000)),(0,_reactNativeReanimated.set)(_this.velocityY,0),(0,_reactNativeReanimated.stopClock)(_this.animationClock),_this.prevTranslateYOffset],(0,_reactNativeReanimated.cond)((0,_reactNativeReanimated.or)(_this.didGestureFinish,_this.isManuallySetValue,(0,_reactNativeReanimated.clockRunning)(_this.animationClock)),[runAnimation({clock:_this.animationClock,from:(0,_reactNativeReanimated.cond)(_this.isManuallySetValue,_this.prevTranslateYOffset,(0,_reactNativeReanimated.add)(_this.prevTranslateYOffset,_this.translationY)),to:_this.destSnapPoint,position:_this.animationPosition,finished:_this.animationFinished,frameTime:_this.animationFrameTime,velocity:_this.velocityY})],[(0,_reactNativeReanimated.set)(_this.animationFrameTime,0),(0,_reactNativeReanimated.set)(_this.animationFinished,0),_this.prevTranslateYOffset]));_this.translateY=interpolate((0,_reactNativeReanimated.add)(translateYOffset,_this.dragY,(0,_reactNativeReanimated.multiply)(scrollY,-1)),{inputRange:[openPosition,closedPosition],outputRange:[openPosition,closedPosition],extrapolate:_reactNativeReanimated.Extrapolate.CLAMP});_this.position=interpolate(_this.translateY,{inputRange:[openPosition,_snapPoints[_snapPoints.length-1]],outputRange:[1,0],extrapolate:_reactNativeReanimated.Extrapolate.CLAMP});return _this;}(0,_createClass2.default)(ScrollBottomSheet,[{key:"render",value:function render(){var _this2=this;var _this$props=this.props,renderHandle=_this$props.renderHandle,initialSnapIndex=_this$props.initialSnapIndex,containerStyle=_this$props.containerStyle,rest=(0,_objectWithoutProperties2.default)(_this$props,_excluded);var AnimatedScrollableComponent=this.scrollComponent;var normalisedSnapPoints=this.getNormalisedSnapPoints();var initialSnap=normalisedSnapPoints[initialSnapIndex];var Content=(0,_jsxRuntime.jsxs)(_reactNativeReanimated.default.View,{style:[_reactNative.StyleSheet.absoluteFillObject,containerStyle,{transform:[{translateY:this.translateY}]}],children:[(0,_jsxRuntime.jsx)(_reactNativeGestureHandler.PanGestureHandler,{ref:this.drawerHandleRef,shouldCancelWhenOutside:false,simultaneousHandlers:this.masterDrawer,onGestureEvent:this.onHandleGestureEvent,onHandlerStateChange:this.onHandleGestureEvent,children:(0,_jsxRuntime.jsx)(_reactNativeReanimated.default.View,{children:renderHandle()})}),(0,_jsxRuntime.jsx)(_reactNativeGestureHandler.PanGestureHandler,{ref:this.drawerContentRef,simultaneousHandlers:[this.scrollComponentRef,this.masterDrawer],shouldCancelWhenOutside:false,onGestureEvent:this.onDrawerGestureEvent,onHandlerStateChange:this.onDrawerGestureEvent,children:(0,_jsxRuntime.jsx)(_reactNativeReanimated.default.View,{style:styles.container,children:(0,_jsxRuntime.jsx)(_reactNativeGestureHandler.NativeViewGestureHandler,{ref:this.scrollComponentRef,waitFor:this.masterDrawer,simultaneousHandlers:this.drawerContentRef,children:(0,_jsxRuntime.jsx)(AnimatedScrollableComponent,Object.assign({overScrollMode:"never",bounces:false},rest,{ref:this.props.innerRef,decelerationRate:this.decelerationRate,onScrollBeginDrag:this.onScrollBeginDrag,scrollEventThrottle:1,contentContainerStyle:[rest.contentContainerStyle,{paddingBottom:this.getNormalisedSnapPoints()[0]}]}))})})}),this.props.animatedPosition&&(0,_jsxRuntime.jsx)(_reactNativeReanimated.default.Code,{exec:(0,_reactNativeReanimated.onChange)(this.position,(0,_reactNativeReanimated.set)(this.props.animatedPosition,this.position))}),(0,_jsxRuntime.jsx)(_reactNativeReanimated.default.Code,{exec:(0,_reactNativeReanimated.onChange)(this.dragY,(0,_reactNativeReanimated.cond)((0,_reactNativeReanimated.not)((0,_reactNativeReanimated.eq)(this.dragY,0)),(0,_reactNativeReanimated.set)(this.prevDragY,this.dragY)))}),(0,_jsxRuntime.jsx)(_reactNativeReanimated.default.Code,{exec:(0,_reactNativeReanimated.onChange)(this.didGestureFinish,(0,_reactNativeReanimated.cond)(this.didGestureFinish,[this.didScrollUpAndPullDown,this.setTranslationY,(0,_reactNativeReanimated.set)(this.tempDestSnapPoint,(0,_reactNativeReanimated.add)(normalisedSnapPoints[0],this.extraOffset)),(0,_reactNativeReanimated.set)(this.nextSnapIndex,0),(0,_reactNativeReanimated.set)(this.destSnapPoint,this.calculateNextSnapPoint()),(0,_reactNativeReanimated.cond)((0,_reactNativeReanimated.and)((0,_reactNativeReanimated.greaterThan)(this.dragY,this.lastStartScrollY),this.isAndroid,(0,_reactNativeReanimated.not)(this.dragWithHandle)),(0,_reactNativeReanimated.call)([],function(){var _this2$props,_this2$props$data;var _imperativeScrollOpti2=imperativeScrollOptions[_this2.props.componentType],method=_imperativeScrollOpti2.method,args=_imperativeScrollOpti2.args;var node=_this2.props.innerRef.current;if(node&&node[method]&&(_this2.props.componentType==="FlatList"&&(((_this2$props=_this2.props)==null?void 0:(_this2$props$data=_this2$props.data)==null?void 0:_this2$props$data.length)||0)>0||_this2.props.componentType==="SectionList"&&_this2.props.sections.length>0||_this2.props.componentType==="ScrollView")){node[method](args);}})),(0,_reactNativeReanimated.set)(this.dragY,0),(0,_reactNativeReanimated.set)(this.velocityY,0),(0,_reactNativeReanimated.set)(this.lastSnap,(0,_reactNativeReanimated.sub)(this.destSnapPoint,(0,_reactNativeReanimated.cond)((0,_reactNativeReanimated.eq)(this.scrollUpAndPullDown,1),this.lastStartScrollY,0))),(0,_reactNativeReanimated.call)([this.lastSnap],function(_ref4){var _this2$masterDrawer,_this2$masterDrawer$c;var _ref5=(0,_slicedToArray2.default)(_ref4,1),value=_ref5[0];(_this2$masterDrawer=_this2.masterDrawer)==null?void 0:(_this2$masterDrawer$c=_this2$masterDrawer.current)==null?void 0:_this2$masterDrawer$c.setNativeProps({maxDeltaY:value-_this2.getNormalisedSnapPoints()[0]});}),(0,_reactNativeReanimated.set)(this.decelerationRate,(0,_reactNativeReanimated.cond)((0,_reactNativeReanimated.eq)(this.isAndroid,1),(0,_reactNativeReanimated.cond)((0,_reactNativeReanimated.eq)(this.lastSnap,normalisedSnapPoints[0]),ANDROID_NORMAL_DECELERATION_RATE,0),IOS_NORMAL_DECELERATION_RATE))]))}),(0,_jsxRuntime.jsx)(_reactNativeReanimated.default.Code,{exec:(0,_reactNativeReanimated.onChange)(this.isManuallySetValue,[(0,_reactNativeReanimated.cond)(this.isManuallySetValue,[(0,_reactNativeReanimated.set)(this.destSnapPoint,this.manualYOffset),(0,_reactNativeReanimated.set)(this.animationFinished,0),(0,_reactNativeReanimated.set)(this.lastSnap,this.manualYOffset),(0,_reactNativeReanimated.call)([this.lastSnap],function(_ref6){var _this2$masterDrawer2,_this2$masterDrawer2$;var _ref7=(0,_slicedToArray2.default)(_ref6,1),value=_ref7[0];(_this2$masterDrawer2=_this2.masterDrawer)==null?void 0:(_this2$masterDrawer2$=_this2$masterDrawer2.current)==null?void 0:_this2$masterDrawer2$.setNativeProps({maxDeltaY:value-_this2.getNormalisedSnapPoints()[0]});})],[(0,_reactNativeReanimated.set)(this.nextSnapIndex,0)])])})]});if(_reactNative.Platform.OS==="android"){return(0,_jsxRuntime.jsx)(_reactNativeGestureHandler.TapGestureHandler,{maxDurationMs:100000,ref:this.masterDrawer,maxDeltaY:initialSnap-this.getNormalisedSnapPoints()[0],shouldCancelWhenOutside:false,children:Content});}return(0,_jsxRuntime.jsx)(_reactNativeGestureHandler.TapGestureHandler,{maxDurationMs:100000,ref:this.masterDrawer,maxDeltaY:initialSnap-this.getNormalisedSnapPoints()[0],children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:_reactNative.StyleSheet.absoluteFillObject,pointerEvents:"box-none",children:Content})});}}]);return ScrollBottomSheet;}(_react.Component);exports.ScrollBottomSheet=ScrollBottomSheet;ScrollBottomSheet.defaultProps={topInset:0,friction:0.95,animationType:"timing",innerRef:_react.default.createRef(),enableOverScroll:false};var _default=ScrollBottomSheet;exports.default=_default;var styles=_reactNative.StyleSheet.create({container:{flex:1}});