@draftbit/core 46.12.1-07ad46.2 → 46.12.1-62afc7.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/lib/commonjs/components/ActionSheet/index.js.map +1 -1
- package/lib/commonjs/components/AspectRatio.js +2 -16
- package/lib/commonjs/components/AspectRatio.js.map +1 -1
- package/lib/commonjs/components/AvatarEdit.js +4 -15
- package/lib/commonjs/components/AvatarEdit.js.map +1 -1
- package/lib/commonjs/components/Banner.js +4 -23
- package/lib/commonjs/components/Banner.js.map +1 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +18 -3
- package/lib/commonjs/components/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js +73 -120
- package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js.map +1 -1
- package/lib/commonjs/components/Button.js +10 -32
- package/lib/commonjs/components/Button.js.map +1 -1
- package/lib/commonjs/components/Card.js.map +1 -1
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +22 -5
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js.map +1 -1
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +6 -23
- package/lib/commonjs/components/Checkbox/CheckboxRow.js.map +1 -1
- package/lib/commonjs/components/Checkbox/index.js.map +1 -1
- package/lib/commonjs/components/Container.js +4 -15
- package/lib/commonjs/components/Container.js.map +1 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js.map +1 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponentType.js.map +1 -1
- package/lib/commonjs/components/DeckSwiper/DeckSwiperCard.js.map +1 -1
- package/lib/commonjs/components/DeckSwiper/index.js.map +1 -1
- package/lib/commonjs/components/Divider.js +1 -12
- package/lib/commonjs/components/Divider.js.map +1 -1
- package/lib/commonjs/components/Elevation.js +2 -13
- package/lib/commonjs/components/Elevation.js.map +1 -1
- package/lib/commonjs/components/FAB.js +4 -19
- package/lib/commonjs/components/FAB.js.map +1 -1
- package/lib/commonjs/components/FieldSearchBarFull.js +2 -1
- package/lib/commonjs/components/FieldSearchBarFull.js.map +1 -1
- package/lib/commonjs/components/FormRow.js +3 -17
- package/lib/commonjs/components/FormRow.js.map +1 -1
- package/lib/commonjs/components/Image.js +2 -16
- package/lib/commonjs/components/Image.js.map +1 -1
- package/lib/commonjs/components/Justification.js +1 -2
- package/lib/commonjs/components/Justification.js.map +1 -1
- package/lib/commonjs/components/Layout.js +19 -39
- package/lib/commonjs/components/Layout.js.map +1 -1
- package/lib/commonjs/components/Markdown.js.map +1 -1
- package/lib/commonjs/components/NumberInput.js +3 -11
- package/lib/commonjs/components/NumberInput.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerTypes.js.map +1 -1
- package/lib/commonjs/components/Portal/PortalConsumer.js +2 -1
- package/lib/commonjs/components/Portal/PortalConsumer.js.map +1 -1
- package/lib/commonjs/components/Portal/PortalHost.js +14 -43
- package/lib/commonjs/components/Portal/PortalHost.js.map +1 -1
- package/lib/commonjs/components/Portal/PortalManager.js +8 -34
- package/lib/commonjs/components/Portal/PortalManager.js.map +1 -1
- package/lib/commonjs/components/Pressable.js +2 -15
- package/lib/commonjs/components/Pressable.js.map +1 -1
- package/lib/commonjs/components/ProgressBar.js +7 -36
- package/lib/commonjs/components/ProgressBar.js.map +1 -1
- package/lib/commonjs/components/ProgressIndicator.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButton.js +2 -14
- package/lib/commonjs/components/RadioButton/RadioButton.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +1 -10
- package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +4 -16
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +5 -23
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js.map +1 -1
- package/lib/commonjs/components/ResizeMode.js +1 -2
- package/lib/commonjs/components/ResizeMode.js.map +1 -1
- package/lib/commonjs/components/Row.js.map +1 -1
- package/lib/commonjs/components/RowBodyIcon.js.map +1 -1
- package/lib/commonjs/components/RowHeadlineImageIcon.js.map +1 -1
- package/lib/commonjs/components/SVG.js.map +1 -1
- package/lib/commonjs/components/ScreenContainer.js +6 -23
- package/lib/commonjs/components/ScreenContainer.js.map +1 -1
- package/lib/commonjs/components/Slider.js +4 -21
- package/lib/commonjs/components/Slider.js.map +1 -1
- package/lib/commonjs/components/StarRating.js +4 -22
- package/lib/commonjs/components/StarRating.js.map +1 -1
- package/lib/commonjs/components/StepIndicator.js +18 -57
- package/lib/commonjs/components/StepIndicator.js.map +1 -1
- package/lib/commonjs/components/SwipeableView/SwipeableView.js +155 -0
- package/lib/commonjs/components/SwipeableView/SwipeableView.js.map +1 -0
- package/lib/commonjs/components/SwipeableView/SwipeableViewButton.js +13 -0
- package/lib/commonjs/components/SwipeableView/SwipeableViewButton.js.map +1 -0
- package/lib/commonjs/components/SwipeableView/SwipeableViewSwipeHandler.js +13 -0
- package/lib/commonjs/components/SwipeableView/SwipeableViewSwipeHandler.js.map +1 -0
- package/lib/commonjs/components/SwipeableView/index.js +28 -0
- package/lib/commonjs/components/SwipeableView/index.js.map +1 -0
- package/lib/commonjs/components/Swiper/Swiper.js.map +1 -1
- package/lib/commonjs/components/Swiper/SwiperItem.js.map +1 -1
- package/lib/commonjs/components/Switch.js +10 -19
- package/lib/commonjs/components/Switch.js.map +1 -1
- package/lib/commonjs/components/TabView/TabView.js +7 -14
- package/lib/commonjs/components/TabView/TabView.js.map +1 -1
- package/lib/commonjs/components/TabView/TabViewItem.js.map +1 -1
- package/lib/commonjs/components/Table/Table.js +5 -6
- package/lib/commonjs/components/Table/Table.js.map +1 -1
- package/lib/commonjs/components/Table/TableCommon.js.map +1 -1
- package/lib/commonjs/components/Table/TableRow.js +2 -1
- package/lib/commonjs/components/Table/TableRow.js.map +1 -1
- package/lib/commonjs/components/Text.js +4 -50
- package/lib/commonjs/components/Text.js.map +1 -1
- package/lib/commonjs/components/TextField.js +28 -76
- package/lib/commonjs/components/TextField.js.map +1 -1
- package/lib/commonjs/components/ToggleButton.js +2 -14
- package/lib/commonjs/components/ToggleButton.js.map +1 -1
- package/lib/commonjs/components/Touchable.js +2 -15
- package/lib/commonjs/components/Touchable.js.map +1 -1
- package/lib/commonjs/components/Touchable.web.js.map +1 -1
- package/lib/commonjs/components/Typography.js.map +1 -1
- package/lib/commonjs/components/YoutubePlayer/YoutubePlayer.native.js.map +1 -1
- package/lib/commonjs/components/YoutubePlayer/YoutubePlayerProps.js.map +1 -1
- package/lib/commonjs/components/useAuthState.js.map +1 -1
- package/lib/commonjs/index.js +19 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mappings/BottomSheet.js +37 -9
- package/lib/commonjs/mappings/BottomSheet.js.map +1 -1
- package/lib/commonjs/mappings/MapMarker.js +15 -0
- package/lib/commonjs/mappings/MapMarker.js.map +1 -1
- package/lib/commonjs/mappings/MapView.js +5 -0
- package/lib/commonjs/mappings/MapView.js.map +1 -1
- package/lib/commonjs/mappings/SwipeableView.js +183 -0
- package/lib/commonjs/mappings/SwipeableView.js.map +1 -0
- package/lib/commonjs/utilities.js +27 -2
- package/lib/commonjs/utilities.js.map +1 -1
- package/lib/module/components/BottomSheet/BottomSheet.js +18 -3
- package/lib/module/components/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/module/components/Divider.js +17 -1
- package/lib/module/components/Picker/PickerComponent.ios.js +36 -11
- package/lib/module/components/Picker/PickerComponent.ios.js.map +1 -1
- package/lib/module/components/SwipeableView/SwipeableView.js +147 -0
- package/lib/module/components/SwipeableView/SwipeableView.js.map +1 -0
- package/lib/module/components/SwipeableView/SwipeableViewButton.js +6 -0
- package/lib/module/components/SwipeableView/SwipeableViewButton.js.map +1 -0
- package/lib/module/components/SwipeableView/SwipeableViewSwipeHandler.js +6 -0
- package/lib/module/components/SwipeableView/SwipeableViewSwipeHandler.js.map +1 -0
- package/lib/module/components/SwipeableView/index.js +4 -0
- package/lib/module/components/SwipeableView/index.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/mappings/BottomSheet.js +38 -10
- package/lib/module/mappings/BottomSheet.js.map +1 -1
- package/lib/module/mappings/MapMarker.js +16 -1
- package/lib/module/mappings/MapMarker.js.map +1 -1
- package/lib/module/mappings/MapView.js +6 -1
- package/lib/module/mappings/MapView.js.map +1 -1
- package/lib/module/mappings/SwipeableView.js +175 -0
- package/lib/module/mappings/SwipeableView.js.map +1 -0
- package/lib/module/utilities.js +18 -0
- package/lib/module/utilities.js.map +1 -1
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +6 -1
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/src/components/SwipeableView/SwipeableView.d.ts +29 -0
- package/lib/typescript/src/components/SwipeableView/SwipeableView.d.ts.map +1 -0
- package/lib/typescript/src/components/SwipeableView/SwipeableViewButton.d.ts +13 -0
- package/lib/typescript/src/components/SwipeableView/SwipeableViewButton.d.ts.map +1 -0
- package/lib/typescript/src/components/SwipeableView/SwipeableViewSwipeHandler.d.ts +13 -0
- package/lib/typescript/src/components/SwipeableView/SwipeableViewSwipeHandler.d.ts.map +1 -0
- package/lib/typescript/src/components/SwipeableView/index.d.ts +4 -0
- package/lib/typescript/src/components/SwipeableView/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/BottomSheet.d.ts +48 -4
- package/lib/typescript/src/mappings/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/src/mappings/MapMarker.d.ts +32 -0
- package/lib/typescript/src/mappings/MapMarker.d.ts.map +1 -1
- package/lib/typescript/src/mappings/MapView.d.ts +11 -0
- package/lib/typescript/src/mappings/MapView.d.ts.map +1 -1
- package/lib/typescript/src/mappings/SwipeableView.d.ts +426 -0
- package/lib/typescript/src/mappings/SwipeableView.d.ts.map +1 -0
- package/lib/typescript/src/utilities.d.ts +6 -0
- package/lib/typescript/src/utilities.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/components/BottomSheet/BottomSheet.js +17 -2
- package/src/components/BottomSheet/BottomSheet.tsx +32 -4
- package/src/components/SwipeableView/SwipeableView.js +117 -0
- package/src/components/SwipeableView/SwipeableView.tsx +299 -0
- package/src/components/SwipeableView/SwipeableViewButton.js +5 -0
- package/src/components/SwipeableView/SwipeableViewButton.tsx +18 -0
- package/src/components/SwipeableView/SwipeableViewSwipeHandler.js +5 -0
- package/src/components/SwipeableView/SwipeableViewSwipeHandler.tsx +20 -0
- package/src/components/SwipeableView/index.js +3 -0
- package/src/components/SwipeableView/index.tsx +3 -0
- package/src/index.js +1 -0
- package/src/index.tsx +6 -0
- package/src/mappings/BottomSheet.js +37 -9
- package/src/mappings/BottomSheet.ts +43 -8
- package/src/mappings/MapMarker.js +16 -1
- package/src/mappings/MapMarker.ts +20 -0
- package/src/mappings/MapView.js +6 -1
- package/src/mappings/MapView.ts +8 -0
- package/src/mappings/SwipeableView.js +181 -0
- package/src/mappings/SwipeableView.ts +210 -0
- package/src/utilities.js +41 -0
- package/src/utilities.ts +71 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/ActionSheet/index.
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/ActionSheet/index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAAmE"}
|
|
@@ -7,6 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
10
11
|
const AspectRatio = props => {
|
|
11
12
|
const [layout, setLayout] = _react.default.useState(null);
|
|
12
13
|
const {
|
|
@@ -33,22 +34,7 @@ const AspectRatio = props => {
|
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
37
|
-
...props,
|
|
38
|
-
style: style,
|
|
39
|
-
onLayout: _ref => {
|
|
40
|
-
let {
|
|
41
|
-
nativeEvent: {
|
|
42
|
-
layout: l
|
|
43
|
-
}
|
|
44
|
-
} = _ref;
|
|
45
|
-
return setLayout(l);
|
|
46
|
-
}
|
|
47
|
-
}, props.children);
|
|
48
|
-
};
|
|
49
|
-
var _default = AspectRatio;
|
|
50
|
-
exports.default = _default;
|
|
51
|
-
//# sourceMappingURL=AspectRatio.js.map_react.default.createElement(_reactNative.View, _extends({}, props, {
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({}, props, {
|
|
52
38
|
style: style,
|
|
53
39
|
onLayout: _ref => {
|
|
54
40
|
let {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AspectRatio","props","layout","setLayout","React","useState","aspectRatio","inputStyle","StyleSheet","flatten","style","width","height","push","
|
|
1
|
+
{"version":3,"names":["AspectRatio","props","layout","setLayout","React","useState","aspectRatio","inputStyle","StyleSheet","flatten","style","width","height","push","nativeEvent","l","children"],"sourceRoot":"../../../src","sources":["components/AspectRatio.tsx"],"mappings":";;;;;;AAAA;AACA;AAMsB;AAAA;AAOtB,MAAMA,WAAqD,GAAIC,KAAK,IAAK;EACvE,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAAyB,IAAI,CAAC;EACxE,MAAM;IAAEC,WAAW,GAAG,CAAC;IAAE,GAAGC;EAAW,CAAC,GACtCC,uBAAU,CAACC,OAAO,CAACR,KAAK,CAACS,KAAK,CAAC,IAAI,CAAC,CAAC;EACvC,MAAMA,KAAK,GAAG,CAACH,UAAU,EAAE;IAAED;EAAY,CAAC,CAAC;EAE3C,IAAIJ,MAAM,EAAE;IACV,MAAM;MAAES,KAAK,GAAG,CAAC;MAAEC,MAAM,GAAG;IAAE,CAAC,GAAGV,MAAM;IACxC,IAAIS,KAAK,KAAK,CAAC,EAAE;MACfD,KAAK,CAACG,IAAI,CAAC;QAAEF,KAAK,EAAEC,MAAM,IAAI,CAAC,GAAGN,WAAW,CAAC;QAAEM;MAAO,CAAC,CAAC;IAC3D,CAAC,MAAM;MACLF,KAAK,CAACG,IAAI,CAAC;QAAEF,KAAK;QAAEC,MAAM,EAAED,KAAK,IAAI,CAAC,GAAGL,WAAW;MAAE,CAAC,CAAC;IAC1D;EACF;EACA,oBACE,6BAAC,iBAAI,eACCL,KAAK;IACT,KAAK,EAAES,KAAM;IACb,QAAQ,EAAE;MAAA,IAAC;QAAEI,WAAW,EAAE;UAAEZ,MAAM,EAAEa;QAAE;MAAE,CAAC;MAAA,OAAKZ,SAAS,CAACY,CAAC,CAAC;IAAA;EAAC,IAE1Dd,KAAK,CAACe,QAAQ,CACV;AAEX,CAAC;AAAC,eAEahB,WAAW;AAAA"}
|
|
@@ -12,6 +12,7 @@ var _theming = require("../theming");
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
14
|
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; }
|
|
15
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
16
|
const AvatarEdit = _ref => {
|
|
16
17
|
let {
|
|
17
18
|
Icon,
|
|
@@ -31,10 +32,9 @@ const AvatarEdit = _ref => {
|
|
|
31
32
|
width: size,
|
|
32
33
|
height: size
|
|
33
34
|
};
|
|
34
|
-
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
35
|
-
style: [style, dimensions]
|
|
36
|
-
|
|
37
|
-
}, /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
35
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
|
|
36
|
+
style: [style, dimensions]
|
|
37
|
+
}, rest), /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
38
38
|
onPress: onPress
|
|
39
39
|
}, /*#__PURE__*/React.createElement(_CircleImage.default, {
|
|
40
40
|
source: image,
|
|
@@ -57,15 +57,4 @@ const AvatarEdit = _ref => {
|
|
|
57
57
|
};
|
|
58
58
|
var _default = (0, _theming.withTheme)(AvatarEdit);
|
|
59
59
|
exports.default = _default;
|
|
60
|
-
//# sourceMappingURL=AvatarEdit.js.map borderRadius: size * (3 / 16),
|
|
61
|
-
padding: size * (3 / 32)
|
|
62
|
-
}
|
|
63
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
64
|
-
name: "MaterialIcons/edit",
|
|
65
|
-
color: colorStyles.editIconColor,
|
|
66
|
-
size: size * (3 / 16)
|
|
67
|
-
}))));
|
|
68
|
-
};
|
|
69
|
-
var _default = (0, _theming.withTheme)(AvatarEdit);
|
|
70
|
-
exports.default = _default;
|
|
71
60
|
//# sourceMappingURL=AvatarEdit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AvatarEdit","Icon","image","size","onPress","style","theme","rest","colorStyles","editBackgroundColor","colors","primary","editIconColor","surface","editBorderColor","dimensions","width","height","
|
|
1
|
+
{"version":3,"names":["AvatarEdit","Icon","image","size","onPress","style","theme","rest","colorStyles","editBackgroundColor","colors","primary","editIconColor","surface","editBorderColor","dimensions","width","height","position","top","right","borderColor","backgroundColor","borderRadius","padding","withTheme"],"sourceRoot":"../../../src","sources":["components/AvatarEdit.tsx"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AAAuC;AAAA;AAAA;AAAA;AAavC,MAAMA,UAAoD,GAAG,QAQvD;EAAA,IARwD;IAC5DC,IAAI;IACJC,KAAK;IACLC,IAAI,GAAG,EAAE;IACTC,OAAO,GAAG,MAAM,CAAC,CAAC;IAClBC,KAAK;IACLC,KAAK;IACL,GAAGC;EACL,CAAC;EACC,MAAMC,WAAW,GAAG;IAClBC,mBAAmB,EAAEH,KAAK,CAACI,MAAM,CAACC,OAAO;IACzCC,aAAa,EAAEN,KAAK,CAACI,MAAM,CAACG,OAAO;IACnCC,eAAe,EAAER,KAAK,CAACI,MAAM,CAACG;EAChC,CAAC;EAED,MAAME,UAAU,GAAG;IACjBC,KAAK,EAAEb,IAAI;IACXc,MAAM,EAAEd;EACV,CAAC;EAED,oBACE,oBAAC,iBAAI;IAAC,KAAK,EAAE,CAACE,KAAK,EAAEU,UAAU;EAAE,GAAKR,IAAI,gBACxC,oBAAC,kBAAS;IAAC,OAAO,EAAEH;EAAQ,gBAC1B,oBAAC,oBAAW;IAAC,MAAM,EAAEF,KAAM;IAAC,IAAI,EAAEC;EAAK,EAAG,eAC1C,oBAAC,iBAAI;IACH,KAAK,EAAE;MACLe,QAAQ,EAAE,UAAU;MACpBC,GAAG,EAAE,CAAC,CAAC;MACPC,KAAK,EAAE,CAAC,CAAC;MACTC,WAAW,EAAEb,WAAW,CAACM,eAAe;MACxCQ,eAAe,EAAEd,WAAW,CAACC,mBAAmB;MAChDc,YAAY,EAAEpB,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;MAC7BqB,OAAO,EAAErB,IAAI,IAAI,CAAC,GAAG,EAAE;IACzB;EAAE,gBAEF,oBAAC,IAAI;IACH,IAAI,EAAC,oBAAoB;IACzB,KAAK,EAAEK,WAAW,CAACI,aAAc;IACjC,IAAI,EAAET,IAAI,IAAI,CAAC,GAAG,EAAE;EAAE,EACtB,CACG,CACG,CACP;AAEX,CAAC;AAAC,eAEa,IAAAsB,kBAAS,EAACzB,UAAU,CAAC;AAAA"}
|
|
@@ -12,6 +12,7 @@ var _theming = require("../theming");
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
14
|
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; }
|
|
15
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
16
|
const ELEVATION = 1;
|
|
16
17
|
const DEFAULT_MAX_WIDTH = 960;
|
|
17
18
|
const Banner = _ref => {
|
|
@@ -69,6 +70,7 @@ const Banner = _ref => {
|
|
|
69
70
|
measured: true
|
|
70
71
|
});
|
|
71
72
|
};
|
|
73
|
+
|
|
72
74
|
// The banner animation has 2 parts:
|
|
73
75
|
// 1. Blank spacer element which animates its height to move the content
|
|
74
76
|
// 2. Actual banner which animates its translateY
|
|
@@ -78,10 +80,9 @@ const Banner = _ref => {
|
|
|
78
80
|
// However we can't animated banner's height directly as it'll also resize the content inside
|
|
79
81
|
const height = _reactNative.Animated.multiply(position, layout.height);
|
|
80
82
|
const translateY = _reactNative.Animated.multiply(_reactNative.Animated.add(position, -1), layout.height);
|
|
81
|
-
return /*#__PURE__*/React.createElement(_Surface.default, {
|
|
82
|
-
...rest,
|
|
83
|
+
return /*#__PURE__*/React.createElement(_Surface.default, _extends({}, rest, {
|
|
83
84
|
style: [styles.container, (0, _shadow.default)(ELEVATION), style]
|
|
84
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
85
|
+
}), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
85
86
|
style: [styles.wrapper, contentStyle]
|
|
86
87
|
}, /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
|
|
87
88
|
style: {
|
|
@@ -164,24 +165,4 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
164
165
|
});
|
|
165
166
|
var _default = (0, _theming.withTheme)(Banner);
|
|
166
167
|
exports.default = _default;
|
|
167
|
-
//# sourceMappingURL=Banner.js.map,
|
|
168
|
-
marginHorizontal: 8,
|
|
169
|
-
marginTop: 16,
|
|
170
|
-
marginBottom: 0
|
|
171
|
-
},
|
|
172
|
-
icon: {
|
|
173
|
-
margin: 8
|
|
174
|
-
},
|
|
175
|
-
message: {
|
|
176
|
-
flex: 1,
|
|
177
|
-
margin: 8
|
|
178
|
-
},
|
|
179
|
-
actions: {
|
|
180
|
-
flexDirection: "row",
|
|
181
|
-
justifyContent: "flex-end",
|
|
182
|
-
margin: 8
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
var _default = (0, _theming.withTheme)(Banner);
|
|
186
|
-
exports.default = _default;
|
|
187
168
|
//# sourceMappingURL=Banner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ELEVATION","DEFAULT_MAX_WIDTH","Banner","initiallyVisible","dismissable","icon","buttonColor","content","contentStyle","style","theme","Icon","rest","visible","setVisible","React","useState","useEffect","current","position","useRef","Animated","Value","layout","setLayout","height","measured","timing","duration","toValue","useNativeDriver","start","handleLayout","nativeEvent","multiply","translateY","add","
|
|
1
|
+
{"version":3,"names":["ELEVATION","DEFAULT_MAX_WIDTH","Banner","initiallyVisible","dismissable","icon","buttonColor","content","contentStyle","style","theme","Icon","rest","visible","setVisible","React","useState","useEffect","current","position","useRef","Animated","Value","layout","setLayout","height","measured","timing","duration","toValue","useNativeDriver","start","handleLayout","nativeEvent","multiply","translateY","add","styles","container","shadow","wrapper","absolute","transform","opacity","marginBottom","message","color","colors","text","actions","primary","StyleSheet","create","elevation","overflow","alignSelf","width","maxWidth","top","flexDirection","justifyContent","marginHorizontal","marginTop","margin","flex","withTheme"],"sourceRoot":"../../../src","sources":["components/Banner.tsx"],"mappings":";;;;;;AAAA;AACA;AASA;AAEA;AACA;AAAuC;AAAA;AAAA;AAAA;AAGvC,MAAMA,SAAS,GAAG,CAAC;AACnB,MAAMC,iBA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,MAAM,EAAE;EACV,CAAC;EACDlB,OAAO,EAAE;IACPmB,IAAI,EAAE,CAAC;IACPD,MAAM,EAAE;EACV,CAAC;EACDd,OAAO,EAAE;IACPU,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,UAAU;IAC1BG,MAAM,EAAE;EACV;AACF,CAAC,CAAC;AAAC,eAEY,IAAAE,kBAAS,EAAC/D,MAAM,CAAC;AAAA"}
|
|
@@ -13,8 +13,12 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
13
13
|
const BottomSheet = _ref => {
|
|
14
14
|
let {
|
|
15
15
|
theme,
|
|
16
|
-
snapPoints
|
|
17
|
-
|
|
16
|
+
snapPoints: snapPointsProp,
|
|
17
|
+
topSnapPosition = "10%",
|
|
18
|
+
middleSnapPosition = "50%",
|
|
19
|
+
bottomSnapPosition = "80%",
|
|
20
|
+
initialSnapIndex,
|
|
21
|
+
initialSnapPosition = "bottom",
|
|
18
22
|
showHandle = true,
|
|
19
23
|
handleColor = theme.colors.divider,
|
|
20
24
|
topBorderRadius = 20,
|
|
@@ -26,13 +30,24 @@ const BottomSheet = _ref => {
|
|
|
26
30
|
...rest
|
|
27
31
|
} = _ref;
|
|
28
32
|
const backgroundColor = (style === null || style === void 0 ? void 0 : style.backgroundColor) || theme.colors.background;
|
|
33
|
+
const snapPoints = snapPointsProp || [topSnapPosition, middleSnapPosition, bottomSnapPosition];
|
|
34
|
+
const getSnapIndexFromPosition = position => {
|
|
35
|
+
switch (position) {
|
|
36
|
+
case "top":
|
|
37
|
+
return 0;
|
|
38
|
+
case "middle":
|
|
39
|
+
return 1;
|
|
40
|
+
case "bottom":
|
|
41
|
+
return 2;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
29
44
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
30
45
|
style: styles.parentContainer,
|
|
31
46
|
pointerEvents: "box-none"
|
|
32
47
|
}, /*#__PURE__*/_react.default.createElement(_BottomSheetComponent.default, _extends({
|
|
33
48
|
componentType: "ScrollView",
|
|
34
49
|
snapPoints: snapPoints,
|
|
35
|
-
initialSnapIndex: initialSnapIndex,
|
|
50
|
+
initialSnapIndex: initialSnapIndex !== null && initialSnapIndex !== void 0 ? initialSnapIndex : getSnapIndexFromPosition(initialSnapPosition),
|
|
36
51
|
renderHandle: () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showHandle && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
37
52
|
style: [styles.handleContainer, {
|
|
38
53
|
backgroundColor,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BottomSheet","theme","snapPoints","initialSnapIndex","showHandle","handleColor","colors","divider","topBorderRadius","borderWidth","borderColor","onSettle","style","children","rest","backgroundColor","background","styles","parentContainer","handleContainer","borderTopLeftRadius","borderTopRightRadius","handle","contentContainerStyle","StyleSheet","flatten","containerStyle","create","
|
|
1
|
+
{"version":3,"names":["BottomSheet","theme","snapPoints","snapPointsProp","topSnapPosition","middleSnapPosition","bottomSnapPosition","initialSnapIndex","initialSnapPosition","showHandle","handleColor","colors","divider","topBorderRadius","borderWidth","borderColor","onSettle","style","children","rest","backgroundColor","background","getSnapIndexFromPosition","position","styles","parentContainer","handleContainer","borderTopLeftRadius","borderTopRightRadius","handle","contentContainerStyle","StyleSheet","flatten","containerStyle","create","left","right","top","bottom","zIndex","overflow","paddingHorizontal","paddingVertical","flex","alignItems","width","height","borderRadius","withTheme"],"sourceRoot":"../../../../src","sources":["components/BottomSheet/BottomSheet.tsx"],"mappings":";;;;;;AAAA;AACA;AAQA;AAEA;AAA0C;AAAA;AAoB1C,MAAMA,WAAgE,GAAG,QAiBnE;EAAA,IAjBoE;IACxEC,KAAK;IACLC,UAAU,EAAEC,cAAc;IAC1BC,eAAe,GAAG,KAAK;IACvBC,kBAAkB,GAAG,KAAK;IAC1BC,kBAAkB,GAAG,KAAK;IAC1BC,gBAAgB;IAChBC,mBAAmB,GAAG,QAAQ;IAC9BC,UA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EAAEb,KAAK,CAAE;IAC7D,cAAc,EAAEc,uBAAU,CAACC,OAAO,CAAC,CACjCR,MAAM,CAACS,cAAc,EACrB;MACEb,eAAe;MACfO,mBAAmB,EAAEd,eAAe;MACpCe,oBAAoB,EAAEf,eAAe;MACrCC,WAAW;MACXC;IACF,CAAC,CACF,CAAE;IACH,QAAQ,EAAEC;EAAS,GACfG,IAAI,GAEPD,QAAQ,CACY,CAClB;AAEX,CAAC;AAED,MAAMM,MAAM,GAAGO,uBAAU,CAACG,MAAM,CAAC;EAC/B;EACAT,eAAe,EAAE;IACfF,QAAQ,EAAE,UAAU;IACpBY,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,GAAG,EAAE,CAAC;IACNC,MAAM,EAAE,CAAC;IACTC,MAAM,EAAE,EAAE;IACVC,QAAQ,EAAE;EACZ,CAAC;EACDV,qBAAqB,EAAE;IACrBW,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE;EACnB,CAAC;EACDT,cAAc,EAAE;IACdU,IAAI,EAAE,CAAC;IACPH,QAAQ,EAAE;EACZ,CAAC;EACDd,eAAe,EAAE;IACfkB,UAAU,EAAE,QAAQ;IACpBF,eAAe,EAAE;EACnB,CAAC;EACDb,MAAM,EAAE;IACNgB,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,CAAC;IACTC,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAAC,eAEY,IAAAC,kBAAS,EAAChD,WAAW,CAAC;AAAA"}
|
|
@@ -10,19 +10,10 @@ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reani
|
|
|
10
10
|
var _reactNativeGestureHandler = require("react-native-gesture-handler");
|
|
11
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
12
|
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; }
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*/
|
|
18
|
-
/**
|
|
19
|
-
* Copyright (c) 2020 Raul Gomez Acuna
|
|
20
|
-
*
|
|
21
|
-
* This source code is licensed under the MIT license found in the
|
|
22
|
-
* LICENSE file in the root directory of this source tree.
|
|
23
|
-
*
|
|
24
|
-
*/
|
|
25
|
-
|
|
13
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
16
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
26
17
|
const {
|
|
27
18
|
//@ts-ignore
|
|
28
19
|
interpolate: interpolateDeprecated,
|
|
@@ -82,42 +73,44 @@ const imperativeScrollOptions = {
|
|
|
82
73
|
}
|
|
83
74
|
};
|
|
84
75
|
class ScrollBottomSheet extends _react.Component {
|
|
76
|
+
/**
|
|
77
|
+
* Gesture Handler references
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Flag to indicate imperative snapping
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Manual snapping amount
|
|
86
|
+
*/
|
|
87
|
+
|
|
85
88
|
constructor(props) {
|
|
86
|
-
var _this;
|
|
87
|
-
var _a;
|
|
89
|
+
var _props$animationConfi, _this;
|
|
88
90
|
super(props);
|
|
89
91
|
_this = this;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
this
|
|
94
|
-
this
|
|
95
|
-
this
|
|
96
|
-
this
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
this
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
this
|
|
105
|
-
this
|
|
106
|
-
this
|
|
107
|
-
this
|
|
108
|
-
this
|
|
109
|
-
this
|
|
110
|
-
this
|
|
111
|
-
this
|
|
112
|
-
this.animationFinished = new _reactNativeReanimated.Value(0);
|
|
113
|
-
this.animationFrameTime = new _reactNativeReanimated.Value(0);
|
|
114
|
-
this.velocityY = new _reactNativeReanimated.Value(0);
|
|
115
|
-
this.lastStartScrollY = new _reactNativeReanimated.Value(0);
|
|
116
|
-
this.destSnapPoint = new _reactNativeReanimated.Value(0);
|
|
117
|
-
this.dragWithHandle = new _reactNativeReanimated.Value(0);
|
|
118
|
-
this.scrollUpAndPullDown = new _reactNativeReanimated.Value(0);
|
|
119
|
-
this.convertPercentageToDp = str => Number(str.split("%")[0]) * (windowHeight - this.props.topInset) / 100;
|
|
120
|
-
this.getNormalisedSnapPoints = () => {
|
|
92
|
+
_defineProperty(this, "masterDrawer", /*#__PURE__*/_react.default.createRef());
|
|
93
|
+
_defineProperty(this, "drawerHandleRef", /*#__PURE__*/_react.default.createRef());
|
|
94
|
+
_defineProperty(this, "drawerContentRef", /*#__PURE__*/_react.default.createRef());
|
|
95
|
+
_defineProperty(this, "scrollComponentRef", /*#__PURE__*/_react.default.createRef());
|
|
96
|
+
_defineProperty(this, "isManuallySetValue", new _reactNativeReanimated.Value(0));
|
|
97
|
+
_defineProperty(this, "manualYOffset", new _reactNativeReanimated.Value(0));
|
|
98
|
+
_defineProperty(this, "prevSnapIndex", -1);
|
|
99
|
+
_defineProperty(this, "dragY", new _reactNativeReanimated.Value(0));
|
|
100
|
+
_defineProperty(this, "prevDragY", new _reactNativeReanimated.Value(0));
|
|
101
|
+
_defineProperty(this, "tempDestSnapPoint", new _reactNativeReanimated.Value(0));
|
|
102
|
+
_defineProperty(this, "isAndroid", new _reactNativeReanimated.Value(Number(_reactNative.Platform.OS === "android")));
|
|
103
|
+
_defineProperty(this, "animationClock", new _reactNativeReanimated.Clock());
|
|
104
|
+
_defineProperty(this, "animationPosition", new _reactNativeReanimated.Value(0));
|
|
105
|
+
_defineProperty(this, "animationFinished", new _reactNativeReanimated.Value(0));
|
|
106
|
+
_defineProperty(this, "animationFrameTime", new _reactNativeReanimated.Value(0));
|
|
107
|
+
_defineProperty(this, "velocityY", new _reactNativeReanimated.Value(0));
|
|
108
|
+
_defineProperty(this, "lastStartScrollY", new _reactNativeReanimated.Value(0));
|
|
109
|
+
_defineProperty(this, "destSnapPoint", new _reactNativeReanimated.Value(0));
|
|
110
|
+
_defineProperty(this, "dragWithHandle", new _reactNativeReanimated.Value(0));
|
|
111
|
+
_defineProperty(this, "scrollUpAndPullDown", new _reactNativeReanimated.Value(0));
|
|
112
|
+
_defineProperty(this, "convertPercentageToDp", str => Number(str.split("%")[0]) * (windowHeight - this.props.topInset) / 100);
|
|
113
|
+
_defineProperty(this, "getNormalisedSnapPoints", () => {
|
|
121
114
|
return this.props.snapPoints.map(p => {
|
|
122
115
|
if (typeof p === "string") {
|
|
123
116
|
return this.convertPercentageToDp(p);
|
|
@@ -126,8 +119,8 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
126
119
|
}
|
|
127
120
|
throw new Error("Invalid type for value ".concat(p, ": ").concat(typeof p, ". It should be either a percentage string or a number"));
|
|
128
121
|
});
|
|
129
|
-
};
|
|
130
|
-
this
|
|
122
|
+
});
|
|
123
|
+
_defineProperty(this, "getScrollComponent", () => {
|
|
131
124
|
switch (this.props.componentType) {
|
|
132
125
|
case "FlatList":
|
|
133
126
|
return _reactNative.FlatList;
|
|
@@ -138,32 +131,33 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
138
131
|
default:
|
|
139
132
|
throw new Error("Component type not supported: it should be one of `FlatList`, `ScrollView` or `SectionList`");
|
|
140
133
|
}
|
|
141
|
-
};
|
|
142
|
-
this
|
|
134
|
+
});
|
|
135
|
+
_defineProperty(this, "snapTo", index => {
|
|
143
136
|
const snapPoints = this.getNormalisedSnapPoints();
|
|
144
137
|
this.isManuallySetValue.setValue(1);
|
|
145
138
|
this.manualYOffset.setValue(snapPoints[index]);
|
|
146
139
|
this.nextSnapIndex.setValue(index);
|
|
147
|
-
};
|
|
140
|
+
});
|
|
148
141
|
const {
|
|
149
142
|
initialSnapIndex,
|
|
150
143
|
animationType
|
|
151
144
|
} = props;
|
|
152
145
|
const animationDriver = animationType === "timing" ? 0 : 1;
|
|
153
|
-
const animationDuration = props.animationType === "timing" && ((
|
|
146
|
+
const animationDuration = props.animationType === "timing" && ((_props$animationConfi = props.animationConfig) === null || _props$animationConfi === void 0 ? void 0 : _props$animationConfi.duration) || DEFAULT_ANIMATION_DURATION;
|
|
154
147
|
const ScrollComponent = this.getScrollComponent();
|
|
155
148
|
// @ts-ignore
|
|
156
149
|
this.scrollComponent = _reactNativeReanimated.default.createAnimatedComponent(ScrollComponent);
|
|
157
|
-
const
|
|
158
|
-
const openPosition =
|
|
159
|
-
const closedPosition = this.props.enableOverScroll ? windowHeight :
|
|
160
|
-
const initialSnap =
|
|
150
|
+
const _snapPoints = this.getNormalisedSnapPoints();
|
|
151
|
+
const openPosition = _snapPoints[0];
|
|
152
|
+
const closedPosition = this.props.enableOverScroll ? windowHeight : _snapPoints[_snapPoints.length - 1];
|
|
153
|
+
const initialSnap = _snapPoints[initialSnapIndex];
|
|
161
154
|
this.nextSnapIndex = new _reactNativeReanimated.Value(initialSnapIndex);
|
|
162
155
|
const initialDecelerationRate = _reactNative.Platform.select({
|
|
163
156
|
android: props.initialSnapIndex === 0 ? ANDROID_NORMAL_DECELERATION_RATE : 0,
|
|
164
157
|
ios: IOS_NORMAL_DECELERATION_RATE
|
|
165
158
|
});
|
|
166
159
|
this.decelerationRate = new _reactNativeReanimated.Value(initialDecelerationRate);
|
|
160
|
+
|
|
167
161
|
//@ts-ignore
|
|
168
162
|
const handleGestureState = new _reactNativeReanimated.Value(-1);
|
|
169
163
|
//@ts-ignore
|
|
@@ -202,27 +196,29 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
202
196
|
const didHandleGestureBegin = (0, _reactNativeReanimated.eq)(handleGestureState, _reactNativeGestureHandler.State.ACTIVE);
|
|
203
197
|
const 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));
|
|
204
198
|
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)));
|
|
199
|
+
|
|
205
200
|
// Function that determines if the last snap point is in the range {snapPoints}
|
|
206
201
|
// In the case of interruptions in the middle of an animation, we'll get
|
|
207
202
|
// lastSnap values outside the range
|
|
208
203
|
const isLastSnapPointInRange = function () {
|
|
209
204
|
let i = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
210
|
-
return i ===
|
|
205
|
+
return i === _snapPoints.length ? lastSnapInRange : (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(_this.lastSnap, _snapPoints[i]), [(0, _reactNativeReanimated.set)(lastSnapInRange, 1)], isLastSnapPointInRange(i + 1));
|
|
211
206
|
};
|
|
212
|
-
const 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,
|
|
207
|
+
const 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)(
|
|
213
208
|
// This is to account for a continuous scroll on the drawer from a snap point
|
|
214
209
|
// Different than top, bringing the drawer to the top position, so that if we
|
|
215
210
|
// change scroll direction without releasing the gesture, it doesn't pull down the drawer again
|
|
216
|
-
(0, _reactNativeReanimated.and)((0, _reactNativeReanimated.eq)(this.dragWithHandle, 1), (0, _reactNativeReanimated.greaterThan)(
|
|
211
|
+
(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))];
|
|
217
212
|
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));
|
|
218
213
|
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));
|
|
219
214
|
this.extraOffset = (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(this.scrollUpAndPullDown, 1), this.lastStartScrollY, 0);
|
|
220
215
|
const endOffsetY = (0, _reactNativeReanimated.add)(this.lastSnap, this.translationY, (0, _reactNativeReanimated.multiply)(1 - props.friction, this.velocityY));
|
|
221
216
|
this.calculateNextSnapPoint = function () {
|
|
222
217
|
let i = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
223
|
-
return i ===
|
|
218
|
+
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));
|
|
224
219
|
};
|
|
225
220
|
const runAnimation = _ref => {
|
|
221
|
+
var _props$animationConfi2;
|
|
226
222
|
let {
|
|
227
223
|
clock,
|
|
228
224
|
from,
|
|
@@ -232,7 +228,6 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
232
228
|
velocity,
|
|
233
229
|
frameTime
|
|
234
230
|
} = _ref;
|
|
235
|
-
var _a;
|
|
236
231
|
const state = {
|
|
237
232
|
finished,
|
|
238
233
|
velocity: new _reactNativeReanimated.Value(0),
|
|
@@ -242,7 +237,7 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
242
237
|
};
|
|
243
238
|
const timingConfig = {
|
|
244
239
|
duration: animationDuration,
|
|
245
|
-
easing: props.animationType === "timing" && ((
|
|
240
|
+
easing: props.animationType === "timing" && ((_props$animationConfi2 = props.animationConfig) === null || _props$animationConfi2 === void 0 ? void 0 : _props$animationConfi2.easing) || DEFAULT_EASING,
|
|
246
241
|
toValue: new _reactNativeReanimated.Value(0)
|
|
247
242
|
};
|
|
248
243
|
const springConfig = {
|
|
@@ -258,14 +253,14 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
258
253
|
//@ts-ignore
|
|
259
254
|
(0, _reactNativeReanimated.timing)(clock, state, timingConfig), (0, _reactNativeReanimated.spring)(clock, state, springConfig)), (0, _reactNativeReanimated.cond)(state.finished, [(0, _reactNativeReanimated.call)([this.nextSnapIndex], _ref2 => {
|
|
260
255
|
let [value] = _ref2;
|
|
261
|
-
var _a, _b;
|
|
262
256
|
if (value !== this.prevSnapIndex) {
|
|
263
|
-
|
|
257
|
+
var _this$props$onSettle, _this$props;
|
|
258
|
+
(_this$props$onSettle = (_this$props = this.props).onSettle) === null || _this$props$onSettle === void 0 ? void 0 : _this$props$onSettle.call(_this$props, value);
|
|
264
259
|
}
|
|
265
260
|
this.prevSnapIndex = value;
|
|
266
261
|
}),
|
|
267
262
|
// Resetting appropriate values
|
|
268
|
-
(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,
|
|
263
|
+
(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],
|
|
269
264
|
// We made the block return the updated position,
|
|
270
265
|
state.position)];
|
|
271
266
|
};
|
|
@@ -294,7 +289,7 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
294
289
|
extrapolate: _reactNativeReanimated.Extrapolate.CLAMP
|
|
295
290
|
});
|
|
296
291
|
this.position = interpolate(this.translateY, {
|
|
297
|
-
inputRange: [openPosition,
|
|
292
|
+
inputRange: [openPosition, _snapPoints[_snapPoints.length - 1]],
|
|
298
293
|
outputRange: [1, 0],
|
|
299
294
|
extrapolate: _reactNativeReanimated.Extrapolate.CLAMP
|
|
300
295
|
});
|
|
@@ -335,25 +330,26 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
335
330
|
ref: this.scrollComponentRef,
|
|
336
331
|
waitFor: this.masterDrawer,
|
|
337
332
|
simultaneousHandlers: this.drawerContentRef
|
|
338
|
-
}, /*#__PURE__*/_react.default.createElement(AnimatedScrollableComponent, {
|
|
333
|
+
}, /*#__PURE__*/_react.default.createElement(AnimatedScrollableComponent, _extends({
|
|
339
334
|
overScrollMode: "never",
|
|
340
|
-
bounces: false
|
|
341
|
-
|
|
342
|
-
ref: this.props.innerRef
|
|
335
|
+
bounces: false
|
|
336
|
+
}, rest, {
|
|
337
|
+
ref: this.props.innerRef
|
|
343
338
|
// @ts-ignore
|
|
339
|
+
,
|
|
344
340
|
decelerationRate: this.decelerationRate,
|
|
345
341
|
onScrollBeginDrag: this.onScrollBeginDrag,
|
|
346
342
|
scrollEventThrottle: 1,
|
|
347
343
|
contentContainerStyle: [rest.contentContainerStyle, {
|
|
348
344
|
paddingBottom: this.getNormalisedSnapPoints()[0]
|
|
349
345
|
}]
|
|
350
|
-
})))), this.props.animatedPosition && /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.Code, {
|
|
346
|
+
}))))), this.props.animatedPosition && /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.Code, {
|
|
351
347
|
exec: (0, _reactNativeReanimated.onChange)(this.position, (0, _reactNativeReanimated.set)(this.props.animatedPosition, this.position))
|
|
352
348
|
}), /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.Code, {
|
|
353
349
|
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)))
|
|
354
350
|
}), /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.Code, {
|
|
355
351
|
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)([], () => {
|
|
356
|
-
var
|
|
352
|
+
var _this$props2, _this$props2$data;
|
|
357
353
|
// This prevents the scroll glide from happening on Android when pulling down with inertia.
|
|
358
354
|
// It's not perfect, but does the job for now
|
|
359
355
|
const {
|
|
@@ -362,68 +358,25 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
362
358
|
} = imperativeScrollOptions[this.props.componentType];
|
|
363
359
|
// @ts-ignore
|
|
364
360
|
const node = this.props.innerRef.current;
|
|
365
|
-
if (node && node[method] && (this.props.componentType === "FlatList" && (((
|
|
361
|
+
if (node && node[method] && (this.props.componentType === "FlatList" && (((_this$props2 = this.props) === null || _this$props2 === void 0 ? void 0 : (_this$props2$data = _this$props2.data) === null || _this$props2$data === void 0 ? void 0 : _this$props2$data.length) || 0) > 0 || this.props.componentType === "SectionList" && this.props.sections.length > 0 || this.props.componentType === "ScrollView")) {
|
|
366
362
|
node[method](args);
|
|
367
363
|
}
|
|
368
364
|
})), (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], _ref3 => {
|
|
365
|
+
var _this$masterDrawer, _this$masterDrawer$cu;
|
|
369
366
|
let [value] = _ref3;
|
|
370
|
-
var _a, _b;
|
|
371
367
|
// This is the TapGHandler trick
|
|
372
368
|
// @ts-ignore
|
|
373
|
-
(
|
|
369
|
+
(_this$masterDrawer = this.masterDrawer) === null || _this$masterDrawer === void 0 ? void 0 : (_this$masterDrawer$cu = _this$masterDrawer.current) === null || _this$masterDrawer$cu === void 0 ? void 0 : _this$masterDrawer$cu.setNativeProps({
|
|
374
370
|
maxDeltaY: value - this.getNormalisedSnapPoints()[0]
|
|
375
371
|
});
|
|
376
372
|
}), (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))]))
|
|
377
373
|
}), /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.Code, {
|
|
378
374
|
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], _ref4 => {
|
|
375
|
+
var _this$masterDrawer2, _this$masterDrawer2$c;
|
|
379
376
|
let [value] = _ref4;
|
|
380
|
-
var _a, _b;
|
|
381
377
|
// This is the TapGHandler trick
|
|
382
378
|
// @ts-ignore
|
|
383
|
-
(
|
|
384
|
-
maxDeltaY: value - this.getNormalisedSnapPoints()[0]
|
|
385
|
-
});
|
|
386
|
-
})], [(0, _reactNativeReanimated.set)(this.nextSnapIndex, 0)])])
|
|
387
|
-
}));
|
|
388
|
-
// On Android, having an intermediary view with pointerEvents="box-none", breaks the
|
|
389
|
-
// waitFor logic
|
|
390
|
-
if (_reactNative.Platform.OS === "android") {
|
|
391
|
-
return /*#__PURE__*/_react.default.createElement(_reactNativeGestureHandler.TapGestureHandler, {
|
|
392
|
-
maxDurationMs: 100000,
|
|
393
|
-
ref: this.masterDrawer,
|
|
394
|
-
maxDeltaY: initialSnap - this.getNormalisedSnapPoints()[0],
|
|
395
|
-
shouldCancelWhenOutside: false
|
|
396
|
-
}, Content);
|
|
397
|
-
}
|
|
398
|
-
// On iOS, We need to wrap the content on a view with PointerEvents box-none
|
|
399
|
-
// So that we can start scrolling automatically when reaching the top without
|
|
400
|
-
// Stopping the gesture
|
|
401
|
-
return /*#__PURE__*/_react.default.createElement(_reactNativeGestureHandler.TapGestureHandler, {
|
|
402
|
-
maxDurationMs: 100000,
|
|
403
|
-
ref: this.masterDrawer,
|
|
404
|
-
maxDeltaY: initialSnap - this.getNormalisedSnapPoints()[0]
|
|
405
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
406
|
-
style: _reactNative.StyleSheet.absoluteFillObject,
|
|
407
|
-
pointerEvents: "box-none"
|
|
408
|
-
}, Content));
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
exports.ScrollBottomSheet = ScrollBottomSheet;
|
|
412
|
-
ScrollBottomSheet.defaultProps = {
|
|
413
|
-
topInset: 0,
|
|
414
|
-
friction: 0.95,
|
|
415
|
-
animationType: "timing",
|
|
416
|
-
innerRef: /*#__PURE__*/_react.default.createRef(),
|
|
417
|
-
enableOverScroll: false
|
|
418
|
-
};
|
|
419
|
-
var _default = ScrollBottomSheet;
|
|
420
|
-
exports.default = _default;
|
|
421
|
-
const styles = _reactNative.StyleSheet.create({
|
|
422
|
-
container: {
|
|
423
|
-
flex: 1
|
|
424
|
-
}
|
|
425
|
-
});
|
|
426
|
-
//# sourceMappingURL=BottomSheetComponent.js.map _this$masterDrawer2.current) === null || _this$masterDrawer2$c === void 0 ? void 0 : _this$masterDrawer2$c.setNativeProps({
|
|
379
|
+
(_this$masterDrawer2 = this.masterDrawer) === null || _this$masterDrawer2 === void 0 ? void 0 : (_this$masterDrawer2$c = _this$masterDrawer2.current) === null || _this$masterDrawer2$c === void 0 ? void 0 : _this$masterDrawer2$c.setNativeProps({
|
|
427
380
|
maxDeltaY: value - this.getNormalisedSnapPoints()[0]
|
|
428
381
|
});
|
|
429
382
|
})], [(0, _reactNativeReanimated.set)(this.nextSnapIndex, 0)])])
|