@applicaster/quick-brick-core 13.0.0-rc.127 → 13.0.0-rc.128

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.
@@ -56,6 +56,7 @@ export class DraggableBottomSheet extends Component<Props, ComponentState> {
56
56
  _translateYOffset: Animated.Value;
57
57
  _translateY: Animated.AnimatedAddition;
58
58
  _snapPoints: SnapPoints;
59
+ _prevContentHeight = 0;
59
60
 
60
61
  _callWhenMounted: () => void | null;
61
62
 
@@ -89,6 +90,14 @@ export class DraggableBottomSheet extends Component<Props, ComponentState> {
89
90
  this._lastScrollY
90
91
  );
91
92
 
93
+ const initialSnapPoints = new SnapPoints(props.height, props.sheetHeight);
94
+
95
+ this._translateYOffset = new Animated.Value(
96
+ props.visible ? initialSnapPoints.top : initialSnapPoints.bottom
97
+ );
98
+
99
+ this._prevContentHeight = initialSnapPoints.contentHeight;
100
+
92
101
  this.state = {
93
102
  lastSnap: props.height,
94
103
  dragging: false,
@@ -150,12 +159,25 @@ export class DraggableBottomSheet extends Component<Props, ComponentState> {
150
159
 
151
160
  if (!this._snapPoints) {
152
161
  this._snapPoints = new SnapPoints(windowHeight, totalSheetHeight);
162
+ this._prevContentHeight = totalSheetHeight;
153
163
  } else {
154
164
  this._snapPoints.windowHeight = windowHeight;
155
165
  this._snapPoints.contentHeight = totalSheetHeight;
156
- }
157
166
 
158
- this._translateYOffset = new Animated.Value(this._snapPoints.bottom);
167
+ if (this.props.visible && this._isMounted) {
168
+ Animated.timing(this._translateYOffset, {
169
+ toValue: this._snapPoints.top,
170
+ duration: ANIMATION_DURATION,
171
+ easing: ANIMATION_EASING,
172
+ delay: ANIMATION_DELAY,
173
+ useNativeDriver: USE_NATIVE_DRIVER,
174
+ }).start();
175
+ } else {
176
+ this._translateYOffset.setValue(this._snapPoints.top);
177
+ }
178
+
179
+ this._prevContentHeight = totalSheetHeight;
180
+ }
159
181
 
160
182
  this._translateY = Animated.add(
161
183
  this._translateYOffset,
@@ -254,6 +276,7 @@ export class DraggableBottomSheet extends Component<Props, ComponentState> {
254
276
  getDraggableAreaStyles() {
255
277
  return {
256
278
  width: this.props.maxWidth,
279
+ top: 0,
257
280
  left: (this.props.width - this.props.maxWidth) / 2 || 0,
258
281
  };
259
282
  }
@@ -91,7 +91,7 @@ export function ModalBottomSheetFrame(props: Props) {
91
91
  const { height } = event.nativeEvent.layout;
92
92
 
93
93
  if (height !== 0) {
94
- setHeight((oldHeight) => oldHeight || height);
94
+ setHeight(height);
95
95
  }
96
96
  };
97
97
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/quick-brick-core",
3
- "version": "13.0.0-rc.127",
3
+ "version": "13.0.0-rc.128",
4
4
  "description": "Core package for Applicaster's Quick Brick App",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -28,13 +28,13 @@
28
28
  },
29
29
  "homepage": "https://github.com/applicaster/quickbrick#readme",
30
30
  "dependencies": {
31
- "@applicaster/applicaster-types": "13.0.0-rc.127",
32
- "@applicaster/quick-brick-core-plugins": "13.0.0-rc.127",
33
- "@applicaster/zapp-pipes-v2-client": "13.0.0-rc.127",
34
- "@applicaster/zapp-react-native-bridge": "13.0.0-rc.127",
35
- "@applicaster/zapp-react-native-redux": "13.0.0-rc.127",
36
- "@applicaster/zapp-react-native-ui-components": "13.0.0-rc.127",
37
- "@applicaster/zapp-react-native-utils": "13.0.0-rc.127",
31
+ "@applicaster/applicaster-types": "13.0.0-rc.128",
32
+ "@applicaster/quick-brick-core-plugins": "13.0.0-rc.128",
33
+ "@applicaster/zapp-pipes-v2-client": "13.0.0-rc.128",
34
+ "@applicaster/zapp-react-native-bridge": "13.0.0-rc.128",
35
+ "@applicaster/zapp-react-native-redux": "13.0.0-rc.128",
36
+ "@applicaster/zapp-react-native-ui-components": "13.0.0-rc.128",
37
+ "@applicaster/zapp-react-native-utils": "13.0.0-rc.128",
38
38
  "atob": "^2.1.2",
39
39
  "axios": "^0.28.0",
40
40
  "btoa": "^1.2.1",
@@ -1 +0,0 @@
1
- export { Fragment as ModalChildrenWrapper } from "react";