@draftbit/core 46.9.1-1f5cbe.2 → 46.9.1-200936.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.
@@ -68,7 +68,8 @@ const styles = _reactNative.StyleSheet.create({
68
68
  },
69
69
  contentContainerStyle: {
70
70
  paddingHorizontal: 16,
71
- paddingVertical: 10
71
+ paddingVertical: 10,
72
+ flex: 1
72
73
  },
73
74
  containerStyle: {
74
75
  flex: 1,
@@ -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
- * Slightly modfied version as taken from https://github.com/rgommezz/react-native-scroll-bottom-sheet
15
- * Main previously breaking change:
16
- * const node = this.props.innerRef.current?.getNode() ==> const node = this.props.innerRef.current as any
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,85 @@ const imperativeScrollOptions = {
82
73
  }
83
74
  };
84
75
  class ScrollBottomSheet extends _react.Component {
76
+ /**
77
+ * Gesture Handler references
78
+ */
79
+
80
+ /**
81
+ * ScrollView prop
82
+ */
83
+
84
+ /**
85
+ * Pan gesture handler events for drawer handle and content
86
+ */
87
+
88
+ /**
89
+ * Main Animated Value that drives the top position of the UI drawer at any point in time
90
+ */
91
+
92
+ /**
93
+ * Animated value that keeps track of the position: 0 => closed, 1 => opened
94
+ */
95
+
96
+ /**
97
+ * Flag to indicate imperative snapping
98
+ */
99
+
100
+ /**
101
+ * Manual snapping amount
102
+ */
103
+
104
+ /**
105
+ * Keeps track of the current index
106
+ */
107
+
108
+ /**
109
+ * Deceleration rate of the scroll component. This is used only on Android to
110
+ * compensate the unexpected glide it gets sometimes.
111
+ */
112
+
85
113
  constructor(props) {
86
- var _this;
87
- var _a;
114
+ var _props$animationConfi, _this;
88
115
  super(props);
89
116
  _this = this;
90
- /**
91
- * Gesture Handler references
92
- */
93
- this.masterDrawer = /*#__PURE__*/_react.default.createRef();
94
- this.drawerHandleRef = /*#__PURE__*/_react.default.createRef();
95
- this.drawerContentRef = /*#__PURE__*/_react.default.createRef();
96
- this.scrollComponentRef = /*#__PURE__*/_react.default.createRef();
97
- /**
98
- * Flag to indicate imperative snapping
99
- */
100
- this.isManuallySetValue = new _reactNativeReanimated.Value(0);
101
- /**
102
- * Manual snapping amount
103
- */
104
- this.manualYOffset = new _reactNativeReanimated.Value(0);
105
- this.prevSnapIndex = -1;
106
- this.dragY = new _reactNativeReanimated.Value(0);
107
- this.prevDragY = new _reactNativeReanimated.Value(0);
108
- this.tempDestSnapPoint = new _reactNativeReanimated.Value(0);
109
- this.isAndroid = new _reactNativeReanimated.Value(Number(_reactNative.Platform.OS === "android"));
110
- this.animationClock = new _reactNativeReanimated.Clock();
111
- this.animationPosition = new _reactNativeReanimated.Value(0);
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 = () => {
117
+ _defineProperty(this, "masterDrawer", /*#__PURE__*/_react.default.createRef());
118
+ _defineProperty(this, "drawerHandleRef", /*#__PURE__*/_react.default.createRef());
119
+ _defineProperty(this, "drawerContentRef", /*#__PURE__*/_react.default.createRef());
120
+ _defineProperty(this, "scrollComponentRef", /*#__PURE__*/_react.default.createRef());
121
+ _defineProperty(this, "onScrollBeginDrag", void 0);
122
+ _defineProperty(this, "onHandleGestureEvent", void 0);
123
+ _defineProperty(this, "onDrawerGestureEvent", void 0);
124
+ _defineProperty(this, "translateY", void 0);
125
+ _defineProperty(this, "position", void 0);
126
+ _defineProperty(this, "isManuallySetValue", new _reactNativeReanimated.Value(0));
127
+ _defineProperty(this, "manualYOffset", new _reactNativeReanimated.Value(0));
128
+ _defineProperty(this, "nextSnapIndex", void 0);
129
+ _defineProperty(this, "decelerationRate", void 0);
130
+ _defineProperty(this, "prevSnapIndex", -1);
131
+ _defineProperty(this, "dragY", new _reactNativeReanimated.Value(0));
132
+ _defineProperty(this, "prevDragY", new _reactNativeReanimated.Value(0));
133
+ _defineProperty(this, "tempDestSnapPoint", new _reactNativeReanimated.Value(0));
134
+ _defineProperty(this, "isAndroid", new _reactNativeReanimated.Value(Number(_reactNative.Platform.OS === "android")));
135
+ _defineProperty(this, "animationClock", new _reactNativeReanimated.Clock());
136
+ _defineProperty(this, "animationPosition", new _reactNativeReanimated.Value(0));
137
+ _defineProperty(this, "animationFinished", new _reactNativeReanimated.Value(0));
138
+ _defineProperty(this, "animationFrameTime", new _reactNativeReanimated.Value(0));
139
+ _defineProperty(this, "velocityY", new _reactNativeReanimated.Value(0));
140
+ _defineProperty(this, "lastStartScrollY", new _reactNativeReanimated.Value(0));
141
+ _defineProperty(this, "prevTranslateYOffset", void 0);
142
+ _defineProperty(this, "translationY", void 0);
143
+ _defineProperty(this, "destSnapPoint", new _reactNativeReanimated.Value(0));
144
+ _defineProperty(this, "lastSnap", void 0);
145
+ _defineProperty(this, "dragWithHandle", new _reactNativeReanimated.Value(0));
146
+ _defineProperty(this, "scrollUpAndPullDown", new _reactNativeReanimated.Value(0));
147
+ _defineProperty(this, "didGestureFinish", void 0);
148
+ _defineProperty(this, "didScrollUpAndPullDown", void 0);
149
+ _defineProperty(this, "setTranslationY", void 0);
150
+ _defineProperty(this, "extraOffset", void 0);
151
+ _defineProperty(this, "calculateNextSnapPoint", void 0);
152
+ _defineProperty(this, "scrollComponent", void 0);
153
+ _defineProperty(this, "convertPercentageToDp", str => Number(str.split("%")[0]) * (windowHeight - this.props.topInset) / 100);
154
+ _defineProperty(this, "getNormalisedSnapPoints", () => {
121
155
  return this.props.snapPoints.map(p => {
122
156
  if (typeof p === "string") {
123
157
  return this.convertPercentageToDp(p);
@@ -126,8 +160,8 @@ class ScrollBottomSheet extends _react.Component {
126
160
  }
127
161
  throw new Error("Invalid type for value ".concat(p, ": ").concat(typeof p, ". It should be either a percentage string or a number"));
128
162
  });
129
- };
130
- this.getScrollComponent = () => {
163
+ });
164
+ _defineProperty(this, "getScrollComponent", () => {
131
165
  switch (this.props.componentType) {
132
166
  case "FlatList":
133
167
  return _reactNative.FlatList;
@@ -138,32 +172,33 @@ class ScrollBottomSheet extends _react.Component {
138
172
  default:
139
173
  throw new Error("Component type not supported: it should be one of `FlatList`, `ScrollView` or `SectionList`");
140
174
  }
141
- };
142
- this.snapTo = index => {
175
+ });
176
+ _defineProperty(this, "snapTo", index => {
143
177
  const snapPoints = this.getNormalisedSnapPoints();
144
178
  this.isManuallySetValue.setValue(1);
145
179
  this.manualYOffset.setValue(snapPoints[index]);
146
180
  this.nextSnapIndex.setValue(index);
147
- };
181
+ });
148
182
  const {
149
183
  initialSnapIndex,
150
184
  animationType
151
185
  } = props;
152
186
  const animationDriver = animationType === "timing" ? 0 : 1;
153
- const animationDuration = props.animationType === "timing" && ((_a = props.animationConfig) === null || _a === void 0 ? void 0 : _a.duration) || DEFAULT_ANIMATION_DURATION;
187
+ const animationDuration = props.animationType === "timing" && ((_props$animationConfi = props.animationConfig) === null || _props$animationConfi === void 0 ? void 0 : _props$animationConfi.duration) || DEFAULT_ANIMATION_DURATION;
154
188
  const ScrollComponent = this.getScrollComponent();
155
189
  // @ts-ignore
156
190
  this.scrollComponent = _reactNativeReanimated.default.createAnimatedComponent(ScrollComponent);
157
- const snapPoints = this.getNormalisedSnapPoints();
158
- const openPosition = snapPoints[0];
159
- const closedPosition = this.props.enableOverScroll ? windowHeight : snapPoints[snapPoints.length - 1];
160
- const initialSnap = snapPoints[initialSnapIndex];
191
+ const _snapPoints = this.getNormalisedSnapPoints();
192
+ const openPosition = _snapPoints[0];
193
+ const closedPosition = this.props.enableOverScroll ? windowHeight : _snapPoints[_snapPoints.length - 1];
194
+ const initialSnap = _snapPoints[initialSnapIndex];
161
195
  this.nextSnapIndex = new _reactNativeReanimated.Value(initialSnapIndex);
162
196
  const initialDecelerationRate = _reactNative.Platform.select({
163
197
  android: props.initialSnapIndex === 0 ? ANDROID_NORMAL_DECELERATION_RATE : 0,
164
198
  ios: IOS_NORMAL_DECELERATION_RATE
165
199
  });
166
200
  this.decelerationRate = new _reactNativeReanimated.Value(initialDecelerationRate);
201
+
167
202
  //@ts-ignore
168
203
  const handleGestureState = new _reactNativeReanimated.Value(-1);
169
204
  //@ts-ignore
@@ -202,27 +237,29 @@ class ScrollBottomSheet extends _react.Component {
202
237
  const didHandleGestureBegin = (0, _reactNativeReanimated.eq)(handleGestureState, _reactNativeGestureHandler.State.ACTIVE);
203
238
  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
239
  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)));
240
+
205
241
  // Function that determines if the last snap point is in the range {snapPoints}
206
242
  // In the case of interruptions in the middle of an animation, we'll get
207
243
  // lastSnap values outside the range
208
244
  const isLastSnapPointInRange = function () {
209
245
  let i = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
210
- return i === snapPoints.length ? lastSnapInRange : (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(_this.lastSnap, snapPoints[i]), [(0, _reactNativeReanimated.set)(lastSnapInRange, 1)], isLastSnapPointInRange(i + 1));
246
+ return i === _snapPoints.length ? lastSnapInRange : (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(_this.lastSnap, _snapPoints[i]), [(0, _reactNativeReanimated.set)(lastSnapInRange, 1)], isLastSnapPointInRange(i + 1));
211
247
  };
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, snapPoints[0])))), [(0, _reactNativeReanimated.set)(this.dragWithHandle, 1), 0]), (0, _reactNativeReanimated.cond)(
248
+ 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
249
  // This is to account for a continuous scroll on the drawer from a snap point
214
250
  // Different than top, bringing the drawer to the top position, so that if we
215
251
  // 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)(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))];
252
+ (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
253
  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
254
  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
255
  this.extraOffset = (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(this.scrollUpAndPullDown, 1), this.lastStartScrollY, 0);
220
256
  const endOffsetY = (0, _reactNativeReanimated.add)(this.lastSnap, this.translationY, (0, _reactNativeReanimated.multiply)(1 - props.friction, this.velocityY));
221
257
  this.calculateNextSnapPoint = function () {
222
258
  let i = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
223
- 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));
259
+ 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
260
  };
225
261
  const runAnimation = _ref => {
262
+ var _props$animationConfi2;
226
263
  let {
227
264
  clock,
228
265
  from,
@@ -232,7 +269,6 @@ class ScrollBottomSheet extends _react.Component {
232
269
  velocity,
233
270
  frameTime
234
271
  } = _ref;
235
- var _a;
236
272
  const state = {
237
273
  finished,
238
274
  velocity: new _reactNativeReanimated.Value(0),
@@ -242,7 +278,7 @@ class ScrollBottomSheet extends _react.Component {
242
278
  };
243
279
  const timingConfig = {
244
280
  duration: animationDuration,
245
- easing: props.animationType === "timing" && ((_a = props.animationConfig) === null || _a === void 0 ? void 0 : _a.easing) || DEFAULT_EASING,
281
+ easing: props.animationType === "timing" && ((_props$animationConfi2 = props.animationConfig) === null || _props$animationConfi2 === void 0 ? void 0 : _props$animationConfi2.easing) || DEFAULT_EASING,
246
282
  toValue: new _reactNativeReanimated.Value(0)
247
283
  };
248
284
  const springConfig = {
@@ -258,14 +294,14 @@ class ScrollBottomSheet extends _react.Component {
258
294
  //@ts-ignore
259
295
  (0, _reactNativeReanimated.timing)(clock, state, timingConfig), (0, _reactNativeReanimated.spring)(clock, state, springConfig)), (0, _reactNativeReanimated.cond)(state.finished, [(0, _reactNativeReanimated.call)([this.nextSnapIndex], _ref2 => {
260
296
  let [value] = _ref2;
261
- var _a, _b;
262
297
  if (value !== this.prevSnapIndex) {
263
- (_b = (_a = this.props).onSettle) === null || _b === void 0 ? void 0 : _b.call(_a, value);
298
+ var _this$props$onSettle, _this$props;
299
+ (_this$props$onSettle = (_this$props = this.props).onSettle) === null || _this$props$onSettle === void 0 ? void 0 : _this$props$onSettle.call(_this$props, value);
264
300
  }
265
301
  this.prevSnapIndex = value;
266
302
  }),
267
303
  // 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, 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],
304
+ (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
305
  // We made the block return the updated position,
270
306
  state.position)];
271
307
  };
@@ -294,7 +330,7 @@ class ScrollBottomSheet extends _react.Component {
294
330
  extrapolate: _reactNativeReanimated.Extrapolate.CLAMP
295
331
  });
296
332
  this.position = interpolate(this.translateY, {
297
- inputRange: [openPosition, snapPoints[snapPoints.length - 1]],
333
+ inputRange: [openPosition, _snapPoints[_snapPoints.length - 1]],
298
334
  outputRange: [1, 0],
299
335
  extrapolate: _reactNativeReanimated.Extrapolate.CLAMP
300
336
  });
@@ -335,25 +371,26 @@ class ScrollBottomSheet extends _react.Component {
335
371
  ref: this.scrollComponentRef,
336
372
  waitFor: this.masterDrawer,
337
373
  simultaneousHandlers: this.drawerContentRef
338
- }, /*#__PURE__*/_react.default.createElement(AnimatedScrollableComponent, {
374
+ }, /*#__PURE__*/_react.default.createElement(AnimatedScrollableComponent, _extends({
339
375
  overScrollMode: "never",
340
- bounces: false,
341
- ...rest,
342
- ref: this.props.innerRef,
376
+ bounces: false
377
+ }, rest, {
378
+ ref: this.props.innerRef
343
379
  // @ts-ignore
380
+ ,
344
381
  decelerationRate: this.decelerationRate,
345
382
  onScrollBeginDrag: this.onScrollBeginDrag,
346
383
  scrollEventThrottle: 1,
347
384
  contentContainerStyle: [rest.contentContainerStyle, {
348
385
  paddingBottom: this.getNormalisedSnapPoints()[0]
349
386
  }]
350
- })))), this.props.animatedPosition && /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.Code, {
387
+ }))))), this.props.animatedPosition && /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.Code, {
351
388
  exec: (0, _reactNativeReanimated.onChange)(this.position, (0, _reactNativeReanimated.set)(this.props.animatedPosition, this.position))
352
389
  }), /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.Code, {
353
390
  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
391
  }), /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.Code, {
355
392
  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 _a, _b;
393
+ var _this$props2, _this$props2$data;
357
394
  // This prevents the scroll glide from happening on Android when pulling down with inertia.
358
395
  // It's not perfect, but does the job for now
359
396
  const {
@@ -362,67 +399,14 @@ class ScrollBottomSheet extends _react.Component {
362
399
  } = imperativeScrollOptions[this.props.componentType];
363
400
  // @ts-ignore
364
401
  const node = this.props.innerRef.current;
365
- if (node && node[method] && (this.props.componentType === "FlatList" && (((_b = (_a = this.props) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.length) || 0) > 0 || this.props.componentType === "SectionList" && this.props.sections.length > 0 || this.props.componentType === "ScrollView")) {
402
+ 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
403
  node[method](args);
367
404
  }
368
405
  })), (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 => {
406
+ var _this$masterDrawer, _this$masterDrawer$cu;
369
407
  let [value] = _ref3;
370
- var _a, _b;
371
- // This is the TapGHandler trick
372
- // @ts-ignore
373
- (_b = (_a = this.masterDrawer) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.setNativeProps({
374
- maxDeltaY: value - this.getNormalisedSnapPoints()[0]
375
- });
376
- }), (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
- }), /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.Code, {
378
- 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 => {
379
- let [value] = _ref4;
380
- var _a, _b;
381
408
  // This is the TapGHandler trick
382
409
  // @ts-ignore
383
- (_b = (_a = this.masterDrawer) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.setNativeProps({
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
- }); @ts-ignore
426
410
  (_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({
427
411
  maxDeltaY: value - this.getNormalisedSnapPoints()[0]
428
412
  });
@@ -12,4 +12,4 @@ const APPROX_STATUSBAR_HEIGHT = _reactNative.Platform.select({
12
12
  android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
13
13
  ios: _reactNative.Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
14
14
  });
15
- exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;AR_HEIGHT;
15
+ exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
@@ -13,7 +13,8 @@ const SEED_DATA = {
13
13
  stylesPanelSections: _types.CONTAINER_COMPONENT_STYLES_SECTIONS,
14
14
  layout: {
15
15
  paddingHorizontal: 16,
16
- paddingVertical: 10
16
+ paddingVertical: 10,
17
+ flex: 1
17
18
  },
18
19
  triggers: [_types.Triggers.OnSettle],
19
20
  props: {
@@ -21,7 +22,7 @@ const SEED_DATA = {
21
22
  label: "On settle",
22
23
  description: "Action to execute when sheet settles on a snap point"
23
24
  }),
24
- snapPoints: (0, _types.createArrayProp)({
25
+ snapPoints: (0, _types.createStaticArrayProp)({
25
26
  label: "Snap points",
26
27
  description: "An array of numerical values (that represent distance from the top) where bottom sheet can snap to place. Accepts numbers and percentages (minimum 2 snap points)",
27
28
  defaultValue: ["10%", "50%", "80%"]
@@ -34,7 +35,7 @@ const SEED_DATA = {
34
35
  }),
35
36
  showHandle: (0, _types.createStaticBoolProp)({
36
37
  label: "Show handle",
37
- description: "Whether to show the top sheet handle or not",
38
+ description: "Whether to show the top handle or not",
38
39
  defaultValue: true
39
40
  }),
40
41
  handleColor: (0, _types.createColorProp)({
@@ -61,7 +61,8 @@ const styles = StyleSheet.create({
61
61
  },
62
62
  contentContainerStyle: {
63
63
  paddingHorizontal: 16,
64
- paddingVertical: 10
64
+ paddingVertical: 10,
65
+ flex: 1
65
66
  },
66
67
  containerStyle: {
67
68
  flex: 1,
@@ -6,4 +6,5 @@ const DEFAULT_STATUSBAR_HEIGHT_EXPO = expo !== null && expo !== void 0 && expo.C
6
6
  export const APPROX_STATUSBAR_HEIGHT = Platform.select({
7
7
  android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
8
8
  ios: Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
9
+ });O : 0
9
10
  });
@@ -36,7 +36,6 @@ export { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
36
36
  export { TabView, TabViewItem } from "./components/TabView";
37
37
  export { default as Markdown } from "./components/Markdown";
38
38
  export { BottomSheet } from "./components/BottomSheet";
39
-
40
39
  /* Deprecated: Fix or Delete! */
41
40
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
42
41
  export { default as Picker } from "./components/Picker/Picker";
@@ -48,5 +47,4 @@ export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIc
48
47
  export { default as Slider } from "./components/Slider";
49
48
  export { default as Stepper } from "./components/Stepper";
50
49
  export { useAuthState } from "./components/useAuthState";
51
-
52
- // a comment to fix sourcemap comment issue
50
+ // a comment to fix sourcemap comment issueue
@@ -1,4 +1,4 @@
1
- import { COMPONENT_TYPES, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createColorProp, createStaticNumberProp, createArrayProp } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createColorProp, createStaticArrayProp, createStaticNumberProp } from "@draftbit/types";
2
2
  export const SEED_DATA = {
3
3
  name: "Bottom Sheet",
4
4
  tag: "BottomSheet",
@@ -7,7 +7,8 @@ export const SEED_DATA = {
7
7
  stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
8
8
  layout: {
9
9
  paddingHorizontal: 16,
10
- paddingVertical: 10
10
+ paddingVertical: 10,
11
+ flex: 1
11
12
  },
12
13
  triggers: [Triggers.OnSettle],
13
14
  props: {
@@ -15,7 +16,7 @@ export const SEED_DATA = {
15
16
  label: "On settle",
16
17
  description: "Action to execute when sheet settles on a snap point"
17
18
  }),
18
- snapPoints: createArrayProp({
19
+ snapPoints: createStaticArrayProp({
19
20
  label: "Snap points",
20
21
  description: "An array of numerical values (that represent distance from the top) where bottom sheet can snap to place. Accepts numbers and percentages (minimum 2 snap points)",
21
22
  defaultValue: ["10%", "50%", "80%"]
@@ -28,7 +29,7 @@ export const SEED_DATA = {
28
29
  }),
29
30
  showHandle: createStaticBoolProp({
30
31
  label: "Show handle",
31
- description: "Whether to show the top sheet handle or not",
32
+ description: "Whether to show the top handle or not",
32
33
  defaultValue: true
33
34
  }),
34
35
  handleColor: createColorProp({
@@ -1 +1 @@
1
- {"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAGL,SAAS,EACT,SAAS,EACT,eAAe,EAChB,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAGvD,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,UAAU,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;CACd;;;;AA+FD,wBAAsC"}
1
+ {"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAGL,SAAS,EACT,SAAS,EACT,eAAe,EAChB,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAGvD,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,UAAU,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;CACd;;;;AAgGD,wBAAsC"}
@@ -7,6 +7,7 @@ export declare const SEED_DATA: {
7
7
  layout: {
8
8
  paddingHorizontal: number;
9
9
  paddingVertical: number;
10
+ flex: number;
10
11
  };
11
12
  triggers: string[];
12
13
  props: {
@@ -1 +1 @@
1
- {"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../../src/mappings/BottomSheet.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkErB,CAAC"}
1
+ {"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../../src/mappings/BottomSheet.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkErB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.9.1-1f5cbe.2+1f5cbed",
3
+ "version": "46.9.1-200936.2+200936e",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "@date-io/date-fns": "^1.3.13",
43
43
  "@draftbit/react-theme-provider": "^2.1.1",
44
- "@draftbit/types": "^46.9.1-1f5cbe.2+1f5cbed",
44
+ "@draftbit/types": "^46.9.1-200936.2+200936e",
45
45
  "@material-ui/core": "^4.11.0",
46
46
  "@material-ui/pickers": "^3.2.10",
47
47
  "@react-native-community/slider": "4.2.3",
@@ -54,11 +54,9 @@
54
54
  "lodash.omit": "^4.5.0",
55
55
  "lodash.tonumber": "^4.0.3",
56
56
  "react-native-deck-swiper": "^2.0.12",
57
- "react-native-gesture-handler": "^2.9.0",
58
57
  "react-native-markdown-display": "^7.0.0-alpha.2",
59
58
  "react-native-modal-datetime-picker": "^13.0.0",
60
59
  "react-native-pager-view": "5.4.24",
61
- "react-native-reanimated": "^2.14.4",
62
60
  "react-native-shadow-2": "^7.0.6",
63
61
  "react-native-svg": "12.3.0",
64
62
  "react-native-tab-view": "^3.4.0",
@@ -98,5 +96,5 @@
98
96
  ]
99
97
  ]
100
98
  },
101
- "gitHead": "1f5cbed730910f473dfdfa1027962fa2a9f16665"
99
+ "gitHead": "200936ee0d452b1ab256bd1d2cbe18017e703f8b"
102
100
  }
@@ -38,6 +38,7 @@ const styles = StyleSheet.create({
38
38
  contentContainerStyle: {
39
39
  paddingHorizontal: 16,
40
40
  paddingVertical: 10,
41
+ flex: 1,
41
42
  },
42
43
  containerStyle: {
43
44
  flex: 1,
@@ -101,6 +101,7 @@ const styles = StyleSheet.create({
101
101
  contentContainerStyle: {
102
102
  paddingHorizontal: 16,
103
103
  paddingVertical: 10,
104
+ flex: 1,
104
105
  },
105
106
  containerStyle: {
106
107
  flex: 1,
@@ -1,18 +1,18 @@
1
- import { COMPONENT_TYPES, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createColorProp, createStaticNumberProp, createArrayProp, } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createColorProp, createStaticArrayProp, createStaticNumberProp, } from "@draftbit/types";
2
2
  export const SEED_DATA = {
3
3
  name: "Bottom Sheet",
4
4
  tag: "BottomSheet",
5
5
  description: "A draggable Bottom sheet that snaps to specific points. Renders children in ScrollView",
6
6
  category: COMPONENT_TYPES.bottomsheet,
7
7
  stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
8
- layout: { paddingHorizontal: 16, paddingVertical: 10 },
8
+ layout: { paddingHorizontal: 16, paddingVertical: 10, flex: 1 },
9
9
  triggers: [Triggers.OnSettle],
10
10
  props: {
11
11
  onSettle: createActionProp({
12
12
  label: "On settle",
13
13
  description: "Action to execute when sheet settles on a snap point",
14
14
  }),
15
- snapPoints: createArrayProp({
15
+ snapPoints: createStaticArrayProp({
16
16
  label: "Snap points",
17
17
  description: "An array of numerical values (that represent distance from the top) where bottom sheet can snap to place. Accepts numbers and percentages (minimum 2 snap points)",
18
18
  defaultValue: ["10%", "50%", "80%"],
@@ -25,7 +25,7 @@ export const SEED_DATA = {
25
25
  }),
26
26
  showHandle: createStaticBoolProp({
27
27
  label: "Show handle",
28
- description: "Whether to show the top sheet handle or not",
28
+ description: "Whether to show the top handle or not",
29
29
  defaultValue: true,
30
30
  }),
31
31
  handleColor: createColorProp({
@@ -5,8 +5,8 @@ import {
5
5
  Triggers,
6
6
  createActionProp,
7
7
  createColorProp,
8
+ createStaticArrayProp,
8
9
  createStaticNumberProp,
9
- createArrayProp,
10
10
  } from "@draftbit/types";
11
11
 
12
12
  export const SEED_DATA = {
@@ -16,14 +16,14 @@ export const SEED_DATA = {
16
16
  "A draggable Bottom sheet that snaps to specific points. Renders children in ScrollView",
17
17
  category: COMPONENT_TYPES.bottomsheet,
18
18
  stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
19
- layout: { paddingHorizontal: 16, paddingVertical: 10 },
19
+ layout: { paddingHorizontal: 16, paddingVertical: 10, flex: 1 },
20
20
  triggers: [Triggers.OnSettle],
21
21
  props: {
22
22
  onSettle: createActionProp({
23
23
  label: "On settle",
24
24
  description: "Action to execute when sheet settles on a snap point",
25
25
  }),
26
- snapPoints: createArrayProp({
26
+ snapPoints: createStaticArrayProp({
27
27
  label: "Snap points",
28
28
  description:
29
29
  "An array of numerical values (that represent distance from the top) where bottom sheet can snap to place. Accepts numbers and percentages (minimum 2 snap points)",
@@ -37,7 +37,7 @@ export const SEED_DATA = {
37
37
  }),
38
38
  showHandle: createStaticBoolProp({
39
39
  label: "Show handle",
40
- description: "Whether to show the top sheet handle or not",
40
+ description: "Whether to show the top handle or not",
41
41
  defaultValue: true,
42
42
  }),
43
43
  handleColor: createColorProp({