react-native-bottom-sheet-stack 1.0.3 → 1.3.0
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/README.md +263 -49
- package/lib/commonjs/BottomSheetHost.js +146 -56
- package/lib/commonjs/BottomSheetHost.js.map +1 -1
- package/lib/commonjs/BottomSheetManager.provider.js +7 -4
- package/lib/commonjs/BottomSheetManager.provider.js.map +1 -1
- package/lib/commonjs/BottomSheetPortal.js +46 -0
- package/lib/commonjs/BottomSheetPortal.js.map +1 -0
- package/lib/commonjs/bottomSheet.store.js +19 -0
- package/lib/commonjs/bottomSheet.store.js.map +1 -1
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/portal.types.js +2 -0
- package/lib/commonjs/portal.types.js.map +1 -0
- package/lib/commonjs/useBottomSheetControl.js +81 -0
- package/lib/commonjs/useBottomSheetControl.js.map +1 -0
- package/lib/typescript/example/src/App.d.ts.map +1 -1
- package/lib/typescript/src/BottomSheetHost.d.ts.map +1 -1
- package/lib/typescript/src/BottomSheetManager.provider.d.ts.map +1 -1
- package/lib/typescript/src/BottomSheetPortal.d.ts +9 -0
- package/lib/typescript/src/BottomSheetPortal.d.ts.map +1 -0
- package/lib/typescript/src/bottomSheet.store.d.ts +5 -0
- package/lib/typescript/src/bottomSheet.store.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/portal.types.d.ts +24 -0
- package/lib/typescript/src/portal.types.d.ts.map +1 -0
- package/lib/typescript/src/useBottomSheetControl.d.ts +10 -0
- package/lib/typescript/src/useBottomSheetControl.d.ts.map +1 -0
- package/lib/typescript/src/useBottomSheetManager.d.ts +2 -0
- package/lib/typescript/src/useBottomSheetManager.d.ts.map +1 -1
- package/package.json +3 -1
- package/src/BottomSheetHost.tsx +32 -11
- package/src/BottomSheetManager.provider.tsx +6 -3
- package/src/BottomSheetPortal.tsx +39 -0
- package/src/bottomSheet.store.ts +27 -0
- package/src/index.tsx +6 -0
- package/src/portal.types.ts +25 -0
- package/src/useBottomSheetControl.ts +52 -0
package/README.md
CHANGED
|
@@ -1,88 +1,302 @@
|
|
|
1
|
-
#
|
|
1
|
+
# react-native-bottom-sheet-stack
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A stack manager for [@gorhom/bottom-sheet](https://github.com/gorhom/react-native-bottom-sheet) with `push`, `switch`, and `replace` navigation modes, iOS-style scale animations, and React context preservation.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
> This library is currently in active development and is not yet considered production-ready.
|
|
5
|
+
**[Documentation](https://arekkubaczkowski.github.io/react-native-bottom-sheet-stack/)**
|
|
7
6
|
|
|
8
|
-
##
|
|
9
|
-
https://x.com/tsolfitsmexx/status/1913103288834089056?s=46&t=kx6uESwbDrRgTUOCDr1tMQ
|
|
7
|
+
## Features
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
- **Stack Navigation** — `push`, `switch`, and `replace` modes for managing multiple sheets
|
|
10
|
+
- **Scale Animation** — iOS-style background scaling effect when sheets are stacked
|
|
11
|
+
- **Context Preservation** — Portal-based API that preserves React context in bottom sheets
|
|
12
|
+
- **Underlying Sheets Stay Mounted** — Sheets remain in the stack until explicitly closed
|
|
13
|
+
- **Group Support** — Isolated stacks for different parts of your app
|
|
12
14
|
|
|
13
|
-
##
|
|
14
|
-
|
|
15
|
-
- 🧱 `push` — stack a new sheet above the current one
|
|
16
|
-
- 🔄 `switch` — override current sheet temporarily, restore the previous one when closing
|
|
17
|
-
- 🔁 `replace` — fully swap and remove the current sheet
|
|
18
|
-
- 🧠 Underlying sheets remain mounted
|
|
19
|
-
- 🗂️ Group support for isolated stacks
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## 📦 Installation
|
|
15
|
+
## Installation
|
|
24
16
|
|
|
25
17
|
```bash
|
|
26
|
-
yarn add
|
|
18
|
+
yarn add react-native-bottom-sheet-stack
|
|
27
19
|
```
|
|
28
20
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
### 🧠 Important: Use <BottomSheetManaged /> instead of <BottomSheet />
|
|
21
|
+
### Peer Dependencies
|
|
32
22
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
```tsx
|
|
36
|
-
import { BottomSheetManaged } from 'react-native-bottom-sheet-stack';
|
|
23
|
+
```bash
|
|
24
|
+
yarn add @gorhom/bottom-sheet react-native-reanimated react-native-gesture-handler react-native-safe-area-context react-native-teleport zustand
|
|
37
25
|
```
|
|
38
26
|
|
|
39
|
-
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
### 1. Setup Provider and Host
|
|
40
30
|
|
|
41
31
|
```tsx
|
|
42
32
|
import {
|
|
33
|
+
BottomSheetManagerProvider,
|
|
43
34
|
BottomSheetHost,
|
|
44
|
-
|
|
45
|
-
initBottomSheetCoordinator,
|
|
35
|
+
BottomSheetScaleView,
|
|
46
36
|
} from 'react-native-bottom-sheet-stack';
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
38
|
+
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
49
39
|
|
|
50
40
|
export default function App() {
|
|
51
41
|
return (
|
|
52
|
-
<
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
42
|
+
<SafeAreaProvider>
|
|
43
|
+
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
44
|
+
<BottomSheetManagerProvider id="default">
|
|
45
|
+
<BottomSheetScaleView>
|
|
46
|
+
<YourAppContent />
|
|
47
|
+
</BottomSheetScaleView>
|
|
48
|
+
<BottomSheetHost />
|
|
49
|
+
</BottomSheetManagerProvider>
|
|
50
|
+
</GestureHandlerRootView>
|
|
51
|
+
</SafeAreaProvider>
|
|
56
52
|
);
|
|
57
53
|
}
|
|
58
54
|
```
|
|
59
55
|
|
|
60
|
-
|
|
56
|
+
### 2. Create a Bottom Sheet Component
|
|
57
|
+
|
|
58
|
+
Use `BottomSheetManaged` instead of `BottomSheet` from `@gorhom/bottom-sheet`:
|
|
61
59
|
|
|
62
60
|
```tsx
|
|
63
|
-
import {
|
|
61
|
+
import { forwardRef } from 'react';
|
|
62
|
+
import { View, Text } from 'react-native';
|
|
63
|
+
import { BottomSheetView } from '@gorhom/bottom-sheet';
|
|
64
|
+
import { BottomSheetManaged, useBottomSheetState } from 'react-native-bottom-sheet-stack';
|
|
64
65
|
|
|
65
|
-
|
|
66
|
-
const {
|
|
66
|
+
const MySheet = forwardRef((props, ref) => {
|
|
67
|
+
const { close } = useBottomSheetState();
|
|
67
68
|
|
|
68
69
|
return (
|
|
69
|
-
<
|
|
70
|
-
<
|
|
71
|
-
|
|
70
|
+
<BottomSheetManaged ref={ref} snapPoints={['50%']}>
|
|
71
|
+
<BottomSheetView>
|
|
72
|
+
<View style={{ padding: 20 }}>
|
|
73
|
+
<Text>Hello from Bottom Sheet!</Text>
|
|
74
|
+
<Button title="Close" onPress={close} />
|
|
75
|
+
</View>
|
|
76
|
+
</BottomSheetView>
|
|
77
|
+
</BottomSheetManaged>
|
|
72
78
|
);
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 3. Open Bottom Sheets
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
import { useBottomSheetManager } from 'react-native-bottom-sheet-stack';
|
|
86
|
+
|
|
87
|
+
function MyComponent() {
|
|
88
|
+
const { openBottomSheet } = useBottomSheetManager();
|
|
89
|
+
|
|
90
|
+
const handleOpen = () => {
|
|
91
|
+
openBottomSheet(<MySheet />, {
|
|
92
|
+
mode: 'push', // 'push' | 'switch' | 'replace'
|
|
93
|
+
scaleBackground: true,
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
return <Button title="Open Sheet" onPress={handleOpen} />;
|
|
73
98
|
}
|
|
74
99
|
```
|
|
75
100
|
|
|
76
|
-
|
|
101
|
+
## Navigation Modes
|
|
102
|
+
|
|
103
|
+
| Mode | Description |
|
|
104
|
+
|------|-------------|
|
|
105
|
+
| `push` | Stack a new sheet on top. Previous sheet remains visible underneath. |
|
|
106
|
+
| `switch` | Hide current sheet and show new one. Previous sheet is restored when new one closes. |
|
|
107
|
+
| `replace` | Close current sheet and open new one. Previous sheet is removed from stack. |
|
|
108
|
+
|
|
109
|
+
## Scale Animation
|
|
110
|
+
|
|
111
|
+
Wrap your app content in `BottomSheetScaleView` to enable iOS-style scaling:
|
|
112
|
+
|
|
113
|
+
```tsx
|
|
114
|
+
<BottomSheetManagerProvider
|
|
115
|
+
id="default"
|
|
116
|
+
scaleConfig={{ scale: 0.92, translateY: 0, borderRadius: 24 }}
|
|
117
|
+
>
|
|
118
|
+
<BottomSheetScaleView>
|
|
119
|
+
<YourAppContent />
|
|
120
|
+
</BottomSheetScaleView>
|
|
121
|
+
<BottomSheetHost />
|
|
122
|
+
</BottomSheetManagerProvider>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
> **Important:** `BottomSheetHost` must be **outside** of `BottomSheetScaleView`. If you wrap `BottomSheetHost` inside `BottomSheetScaleView`, the bottom sheets themselves will also scale, which is not the desired behavior.
|
|
126
|
+
|
|
127
|
+
Open sheets with `scaleBackground: true`:
|
|
77
128
|
|
|
78
129
|
```tsx
|
|
79
|
-
|
|
130
|
+
openBottomSheet(<MySheet />, { scaleBackground: true });
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Context Preservation (Portal API)
|
|
134
|
+
|
|
135
|
+
The imperative `openBottomSheet()` API stores content in a Zustand store and renders it in `BottomSheetHost`. This means **React context from your component tree is lost**.
|
|
136
|
+
|
|
137
|
+
For cases where you need context (themes, auth, i18n, etc.), use the **portal-based API**:
|
|
138
|
+
|
|
139
|
+
```tsx
|
|
140
|
+
import {
|
|
141
|
+
BottomSheetPortal,
|
|
142
|
+
useBottomSheetControl,
|
|
143
|
+
} from 'react-native-bottom-sheet-stack';
|
|
144
|
+
|
|
145
|
+
function MyComponent() {
|
|
146
|
+
const { open, close, isOpen } = useBottomSheetControl('my-sheet');
|
|
80
147
|
|
|
81
|
-
export default function YourBottomSheet() {
|
|
82
148
|
return (
|
|
83
|
-
<
|
|
84
|
-
{/*
|
|
85
|
-
|
|
149
|
+
<View>
|
|
150
|
+
{/* Declare the portal - content is rendered here in your React tree */}
|
|
151
|
+
<BottomSheetPortal id="my-sheet">
|
|
152
|
+
<MySheet />
|
|
153
|
+
</BottomSheetPortal>
|
|
154
|
+
|
|
155
|
+
{/* Control it imperatively */}
|
|
156
|
+
<Button title="Open" onPress={() => open({ scaleBackground: true })} />
|
|
157
|
+
</View>
|
|
86
158
|
);
|
|
87
159
|
}
|
|
88
|
-
```
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### How It Works
|
|
163
|
+
|
|
164
|
+
| API | Context | Use Case |
|
|
165
|
+
|-----|---------|----------|
|
|
166
|
+
| `openBottomSheet()` | Lost | Dynamic sheets, simple cases |
|
|
167
|
+
| `BottomSheetPortal` | Preserved | Sheets needing theme, auth, i18n, etc. |
|
|
168
|
+
|
|
169
|
+
The portal API uses [react-native-teleport](https://github.com/nicklockwood/react-native-teleport) to render content in your component tree while displaying it in `BottomSheetHost`.
|
|
170
|
+
|
|
171
|
+
### Type-Safe Portal IDs
|
|
172
|
+
|
|
173
|
+
You can get autocomplete and type checking for portal sheet IDs by augmenting the `BottomSheetPortalRegistry` interface.
|
|
174
|
+
|
|
175
|
+
**Step 1:** Create a type declaration file in your project (e.g., `src/types/bottom-sheet.d.ts`):
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
import 'react-native-bottom-sheet-stack';
|
|
179
|
+
|
|
180
|
+
declare module 'react-native-bottom-sheet-stack' {
|
|
181
|
+
interface BottomSheetPortalRegistry {
|
|
182
|
+
'settings-sheet': true;
|
|
183
|
+
'profile-sheet': true;
|
|
184
|
+
'confirm-dialog': true;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Step 2:** Make sure the file is included in your `tsconfig.json`:
|
|
190
|
+
|
|
191
|
+
```json
|
|
192
|
+
{
|
|
193
|
+
"compilerOptions": {
|
|
194
|
+
// ...
|
|
195
|
+
},
|
|
196
|
+
"include": [
|
|
197
|
+
"src/**/*",
|
|
198
|
+
"src/types/**/*.d.ts" // include your declaration files
|
|
199
|
+
]
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**Step 3:** Now TypeScript will autocomplete and validate the `id` prop:
|
|
204
|
+
|
|
205
|
+
```tsx
|
|
206
|
+
// ✅ Valid - 'settings-sheet' is in registry
|
|
207
|
+
<BottomSheetPortal id="settings-sheet">
|
|
208
|
+
const control = useBottomSheetControl('settings-sheet');
|
|
209
|
+
|
|
210
|
+
// ❌ Error - 'unknown-sheet' is not in registry
|
|
211
|
+
<BottomSheetPortal id="unknown-sheet">
|
|
212
|
+
const control = useBottomSheetControl('unknown-sheet');
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
If you don't augment the registry, the `id` accepts any `string` for flexibility.
|
|
216
|
+
|
|
217
|
+
## API Reference
|
|
218
|
+
|
|
219
|
+
### Components
|
|
220
|
+
|
|
221
|
+
#### `BottomSheetManagerProvider`
|
|
222
|
+
|
|
223
|
+
| Prop | Type | Description |
|
|
224
|
+
|------|------|-------------|
|
|
225
|
+
| `id` | `string` | Unique identifier for this stack group |
|
|
226
|
+
| `scaleConfig` | `ScaleConfig` | Optional scale animation configuration |
|
|
227
|
+
|
|
228
|
+
#### `BottomSheetHost`
|
|
229
|
+
|
|
230
|
+
Renders the bottom sheet stack. Place after your app content inside `BottomSheetManagerProvider`.
|
|
231
|
+
|
|
232
|
+
#### `BottomSheetScaleView`
|
|
233
|
+
|
|
234
|
+
Wrapper that applies scale animation to its children when sheets are opened with `scaleBackground: true`.
|
|
235
|
+
|
|
236
|
+
#### `BottomSheetManaged`
|
|
237
|
+
|
|
238
|
+
Drop-in replacement for `BottomSheet` from `@gorhom/bottom-sheet`. Accepts all the same props.
|
|
239
|
+
|
|
240
|
+
#### `BottomSheetPortal`
|
|
241
|
+
|
|
242
|
+
| Prop | Type | Description |
|
|
243
|
+
|------|------|-------------|
|
|
244
|
+
| `id` | `BottomSheetPortalId` | Unique identifier for this portal sheet (type-safe if registry is augmented) |
|
|
245
|
+
| `children` | `ReactElement` | The bottom sheet component to render |
|
|
246
|
+
|
|
247
|
+
### Hooks
|
|
248
|
+
|
|
249
|
+
#### `useBottomSheetManager()`
|
|
250
|
+
|
|
251
|
+
```tsx
|
|
252
|
+
const {
|
|
253
|
+
openBottomSheet, // (content, options?) => id
|
|
254
|
+
close, // (id) => void
|
|
255
|
+
clearAll, // () => void
|
|
256
|
+
} = useBottomSheetManager();
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
#### `useBottomSheetState()`
|
|
260
|
+
|
|
261
|
+
Use inside a bottom sheet component:
|
|
262
|
+
|
|
263
|
+
```tsx
|
|
264
|
+
const {
|
|
265
|
+
bottomSheetState, // { id, status, groupId, ... }
|
|
266
|
+
close, // () => void
|
|
267
|
+
} = useBottomSheetState();
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
#### `useBottomSheetControl(id: BottomSheetPortalId)`
|
|
271
|
+
|
|
272
|
+
Control portal-based sheets:
|
|
273
|
+
|
|
274
|
+
```tsx
|
|
275
|
+
const {
|
|
276
|
+
open, // (options?) => void
|
|
277
|
+
close, // () => void
|
|
278
|
+
isOpen, // boolean
|
|
279
|
+
status, // 'opening' | 'open' | 'closing' | 'hidden' | null
|
|
280
|
+
} = useBottomSheetControl('my-sheet');
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Types
|
|
284
|
+
|
|
285
|
+
#### `BottomSheetPortalRegistry`
|
|
286
|
+
|
|
287
|
+
Interface to augment for type-safe portal IDs. See [Type-Safe Portal IDs](#type-safe-portal-ids).
|
|
288
|
+
|
|
289
|
+
#### `BottomSheetPortalId`
|
|
290
|
+
|
|
291
|
+
Type for portal sheet IDs. If `BottomSheetPortalRegistry` is augmented, this is a union of registered keys. Otherwise, it's `string`.
|
|
292
|
+
|
|
293
|
+
## Example
|
|
294
|
+
|
|
295
|
+
See the [example app](./example) for a full demo including:
|
|
296
|
+
- Navigation flow (push, switch, replace)
|
|
297
|
+
- Nested scale animations
|
|
298
|
+
- Context preservation comparison
|
|
299
|
+
|
|
300
|
+
## License
|
|
301
|
+
|
|
302
|
+
MIT
|
|
@@ -9,6 +9,7 @@ var _react = require("react");
|
|
|
9
9
|
var _reactNative = require("react-native");
|
|
10
10
|
var _reactNativeReanimated = _interopRequireDefault(require("react-native-reanimated"));
|
|
11
11
|
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
|
|
12
|
+
var _reactNativeTeleport = require("react-native-teleport");
|
|
12
13
|
var _shallow = require("zustand/shallow");
|
|
13
14
|
var _animatedRegistry = require("./animatedRegistry");
|
|
14
15
|
var _BottomSheetBackdrop = require("./BottomSheetBackdrop");
|
|
@@ -19,6 +20,65 @@ var _bottomSheetCoordinator = require("./bottomSheetCoordinator");
|
|
|
19
20
|
var _useScaleAnimation = require("./useScaleAnimation");
|
|
20
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
22
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
23
|
+
function PortalHostWrapper(t0) {
|
|
24
|
+
const $ = (0, _compilerRuntime.c)(12);
|
|
25
|
+
const {
|
|
26
|
+
id,
|
|
27
|
+
width,
|
|
28
|
+
height
|
|
29
|
+
} = t0;
|
|
30
|
+
let t1;
|
|
31
|
+
if ($[0] !== height || $[1] !== width) {
|
|
32
|
+
t1 = {
|
|
33
|
+
flex: 1,
|
|
34
|
+
width,
|
|
35
|
+
height
|
|
36
|
+
};
|
|
37
|
+
$[0] = height;
|
|
38
|
+
$[1] = width;
|
|
39
|
+
$[2] = t1;
|
|
40
|
+
} else {
|
|
41
|
+
t1 = $[2];
|
|
42
|
+
}
|
|
43
|
+
const t2 = `bottomsheet-${id}`;
|
|
44
|
+
let t3;
|
|
45
|
+
if ($[3] !== height || $[4] !== width) {
|
|
46
|
+
t3 = {
|
|
47
|
+
width,
|
|
48
|
+
height
|
|
49
|
+
};
|
|
50
|
+
$[3] = height;
|
|
51
|
+
$[4] = width;
|
|
52
|
+
$[5] = t3;
|
|
53
|
+
} else {
|
|
54
|
+
t3 = $[5];
|
|
55
|
+
}
|
|
56
|
+
let t4;
|
|
57
|
+
if ($[6] !== t2 || $[7] !== t3) {
|
|
58
|
+
t4 = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeTeleport.PortalHost, {
|
|
59
|
+
name: t2,
|
|
60
|
+
style: t3
|
|
61
|
+
});
|
|
62
|
+
$[6] = t2;
|
|
63
|
+
$[7] = t3;
|
|
64
|
+
$[8] = t4;
|
|
65
|
+
} else {
|
|
66
|
+
t4 = $[8];
|
|
67
|
+
}
|
|
68
|
+
let t5;
|
|
69
|
+
if ($[9] !== t1 || $[10] !== t4) {
|
|
70
|
+
t5 = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
71
|
+
style: t1,
|
|
72
|
+
children: t4
|
|
73
|
+
});
|
|
74
|
+
$[9] = t1;
|
|
75
|
+
$[10] = t4;
|
|
76
|
+
$[11] = t5;
|
|
77
|
+
} else {
|
|
78
|
+
t5 = $[11];
|
|
79
|
+
}
|
|
80
|
+
return t5;
|
|
81
|
+
}
|
|
22
82
|
function BottomSheetHostComp() {
|
|
23
83
|
const $ = (0, _compilerRuntime.c)(15);
|
|
24
84
|
const queueIds = useQueueIds();
|
|
@@ -64,10 +124,11 @@ function BottomSheetHostComp() {
|
|
|
64
124
|
if ($[6] !== groupId || $[7] !== queueIds || $[8] !== scaleConfig) {
|
|
65
125
|
let t5;
|
|
66
126
|
if ($[10] !== groupId || $[11] !== scaleConfig) {
|
|
67
|
-
t5 = id => /*#__PURE__*/(0, _jsxRuntime.jsx)(QueueItem, {
|
|
127
|
+
t5 = (id, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(QueueItem, {
|
|
68
128
|
id: id,
|
|
69
129
|
groupId: groupId,
|
|
70
|
-
scaleConfig: scaleConfig
|
|
130
|
+
scaleConfig: scaleConfig,
|
|
131
|
+
stackIndex: index
|
|
71
132
|
}, id);
|
|
72
133
|
$[10] = groupId;
|
|
73
134
|
$[11] = scaleConfig;
|
|
@@ -99,21 +160,22 @@ function _temp(store) {
|
|
|
99
160
|
return store.clearAll;
|
|
100
161
|
}
|
|
101
162
|
function QueueItem(t0) {
|
|
102
|
-
const $ = (0, _compilerRuntime.c)(
|
|
163
|
+
const $ = (0, _compilerRuntime.c)(34);
|
|
103
164
|
const {
|
|
104
165
|
id,
|
|
105
166
|
groupId,
|
|
106
|
-
scaleConfig
|
|
167
|
+
scaleConfig,
|
|
168
|
+
stackIndex
|
|
107
169
|
} = t0;
|
|
108
170
|
let t1;
|
|
109
171
|
if ($[0] !== id) {
|
|
110
|
-
t1 = state => state.sheetsById[id]
|
|
172
|
+
t1 = state => state.sheetsById[id];
|
|
111
173
|
$[0] = id;
|
|
112
174
|
$[1] = t1;
|
|
113
175
|
} else {
|
|
114
176
|
t1 = $[1];
|
|
115
177
|
}
|
|
116
|
-
const
|
|
178
|
+
const sheet = (0, _bottomSheet.useBottomSheetStore)(t1);
|
|
117
179
|
const {
|
|
118
180
|
width,
|
|
119
181
|
height
|
|
@@ -146,73 +208,105 @@ function QueueItem(t0) {
|
|
|
146
208
|
t4 = $[6];
|
|
147
209
|
}
|
|
148
210
|
(0, _react.useEffect)(t3, t4);
|
|
211
|
+
const backdropZIndex = stackIndex * 2;
|
|
212
|
+
const contentZIndex = stackIndex * 2 + 1;
|
|
149
213
|
let t5;
|
|
150
|
-
if ($[7]
|
|
151
|
-
t5 = [_reactNative.StyleSheet.absoluteFillObject,
|
|
152
|
-
|
|
214
|
+
if ($[7] !== backdropZIndex) {
|
|
215
|
+
t5 = [_reactNative.StyleSheet.absoluteFillObject, {
|
|
216
|
+
zIndex: backdropZIndex
|
|
217
|
+
}];
|
|
218
|
+
$[7] = backdropZIndex;
|
|
219
|
+
$[8] = t5;
|
|
153
220
|
} else {
|
|
154
|
-
t5 = $[
|
|
221
|
+
t5 = $[8];
|
|
155
222
|
}
|
|
156
223
|
let t6;
|
|
157
|
-
if ($[
|
|
158
|
-
t6 = /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
159
|
-
|
|
160
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_BottomSheetBackdrop.BottomSheetBackdrop, {
|
|
161
|
-
sheetId: id
|
|
162
|
-
})
|
|
224
|
+
if ($[9] !== id) {
|
|
225
|
+
t6 = /*#__PURE__*/(0, _jsxRuntime.jsx)(_BottomSheetBackdrop.BottomSheetBackdrop, {
|
|
226
|
+
sheetId: id
|
|
163
227
|
});
|
|
164
|
-
$[
|
|
165
|
-
$[
|
|
228
|
+
$[9] = id;
|
|
229
|
+
$[10] = t6;
|
|
166
230
|
} else {
|
|
167
|
-
t6 = $[
|
|
231
|
+
t6 = $[10];
|
|
168
232
|
}
|
|
169
233
|
let t7;
|
|
170
|
-
if ($[
|
|
171
|
-
t7 = {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
};
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
234
|
+
if ($[11] !== t5 || $[12] !== t6) {
|
|
235
|
+
t7 = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
236
|
+
style: t5,
|
|
237
|
+
children: t6
|
|
238
|
+
});
|
|
239
|
+
$[11] = t5;
|
|
240
|
+
$[12] = t6;
|
|
241
|
+
$[13] = t7;
|
|
178
242
|
} else {
|
|
179
|
-
t7 = $[
|
|
243
|
+
t7 = $[13];
|
|
180
244
|
}
|
|
181
245
|
let t8;
|
|
182
|
-
if ($[
|
|
183
|
-
t8 =
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
246
|
+
if ($[14] !== contentZIndex || $[15] !== height || $[16] !== width) {
|
|
247
|
+
t8 = {
|
|
248
|
+
width,
|
|
249
|
+
height,
|
|
250
|
+
zIndex: contentZIndex
|
|
251
|
+
};
|
|
252
|
+
$[14] = contentZIndex;
|
|
253
|
+
$[15] = height;
|
|
254
|
+
$[16] = width;
|
|
255
|
+
$[17] = t8;
|
|
187
256
|
} else {
|
|
188
|
-
t8 = $[
|
|
257
|
+
t8 = $[17];
|
|
189
258
|
}
|
|
190
259
|
let t9;
|
|
191
|
-
if ($[
|
|
192
|
-
t9 =
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
$[16] = content;
|
|
197
|
-
$[17] = t8;
|
|
198
|
-
$[18] = t9;
|
|
260
|
+
if ($[18] !== scaleStyle || $[19] !== t8) {
|
|
261
|
+
t9 = [_reactNative.StyleSheet.absoluteFillObject, styles.container, t8, scaleStyle];
|
|
262
|
+
$[18] = scaleStyle;
|
|
263
|
+
$[19] = t8;
|
|
264
|
+
$[20] = t9;
|
|
199
265
|
} else {
|
|
200
|
-
t9 = $[
|
|
266
|
+
t9 = $[20];
|
|
201
267
|
}
|
|
202
268
|
let t10;
|
|
203
|
-
if ($[
|
|
204
|
-
t10 = /*#__PURE__*/(0, _jsxRuntime.
|
|
269
|
+
if ($[21] !== height || $[22] !== id || $[23] !== sheet?.content || $[24] !== sheet?.usePortal || $[25] !== width) {
|
|
270
|
+
t10 = sheet?.usePortal ? /*#__PURE__*/(0, _jsxRuntime.jsx)(PortalHostWrapper, {
|
|
271
|
+
id: id,
|
|
272
|
+
width: width,
|
|
273
|
+
height: height
|
|
274
|
+
}) : sheet?.content;
|
|
275
|
+
$[21] = height;
|
|
276
|
+
$[22] = id;
|
|
277
|
+
$[23] = sheet?.content;
|
|
278
|
+
$[24] = sheet?.usePortal;
|
|
279
|
+
$[25] = width;
|
|
280
|
+
$[26] = t10;
|
|
281
|
+
} else {
|
|
282
|
+
t10 = $[26];
|
|
283
|
+
}
|
|
284
|
+
let t11;
|
|
285
|
+
if ($[27] !== t10 || $[28] !== t9) {
|
|
286
|
+
t11 = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
|
|
287
|
+
style: t9,
|
|
288
|
+
children: t10
|
|
289
|
+
});
|
|
290
|
+
$[27] = t10;
|
|
291
|
+
$[28] = t9;
|
|
292
|
+
$[29] = t11;
|
|
293
|
+
} else {
|
|
294
|
+
t11 = $[29];
|
|
295
|
+
}
|
|
296
|
+
let t12;
|
|
297
|
+
if ($[30] !== t11 || $[31] !== t7 || $[32] !== value) {
|
|
298
|
+
t12 = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_BottomSheet.BottomSheetContext.Provider, {
|
|
205
299
|
value: value,
|
|
206
|
-
children: [
|
|
300
|
+
children: [t7, t11]
|
|
207
301
|
});
|
|
208
|
-
$[
|
|
209
|
-
$[
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
302
|
+
$[30] = t11;
|
|
303
|
+
$[31] = t7;
|
|
304
|
+
$[32] = value;
|
|
305
|
+
$[33] = t12;
|
|
212
306
|
} else {
|
|
213
|
-
|
|
307
|
+
t12 = $[33];
|
|
214
308
|
}
|
|
215
|
-
return
|
|
309
|
+
return t12;
|
|
216
310
|
}
|
|
217
311
|
const useQueueIds = () => {
|
|
218
312
|
const $ = (0, _compilerRuntime.c)(2);
|
|
@@ -231,11 +325,7 @@ const useQueueIds = () => {
|
|
|
231
325
|
};
|
|
232
326
|
const BottomSheetHost = exports.BottomSheetHost = BottomSheetHostComp;
|
|
233
327
|
const styles = _reactNative.StyleSheet.create({
|
|
234
|
-
backdropContainer: {
|
|
235
|
-
zIndex: 99_999_999
|
|
236
|
-
},
|
|
237
328
|
container: {
|
|
238
|
-
zIndex: 100_000_000,
|
|
239
329
|
pointerEvents: 'box-none'
|
|
240
330
|
}
|
|
241
331
|
});
|