@oxyhq/services 22.8.3 → 22.8.5
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/ui/components/BottomSheetRouter.js +68 -23
- package/lib/commonjs/ui/components/BottomSheetRouter.js.map +1 -1
- package/lib/commonjs/ui/navigation/routes.js +7 -4
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/FileListSection.js +3 -0
- package/lib/commonjs/ui/screens/fileManagement/FileListSection.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +111 -195
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/module/ui/components/BottomSheetRouter.js +69 -24
- package/lib/module/ui/components/BottomSheetRouter.js.map +1 -1
- package/lib/module/ui/navigation/routes.js +7 -4
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/FileListSection.js +3 -0
- package/lib/module/ui/screens/fileManagement/FileListSection.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js +112 -196
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/typescript/commonjs/ui/components/BottomSheetRouter.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts +12 -0
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/fileManagement/FileListSection.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/BottomSheetRouter.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts +12 -0
- package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/fileManagement/FileListSection.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/ui/components/BottomSheetRouter.tsx +81 -28
- package/src/ui/navigation/__tests__/getSheetConfig.test.ts +36 -0
- package/src/ui/navigation/routes.ts +19 -4
- package/src/ui/screens/fileManagement/FileListSection.tsx +1 -0
- package/src/ui/screens/fileManagement/PhotoPickerSection.tsx +127 -192
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileListSection.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/screens/fileManagement/FileListSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAIH,UAAU,EAGb,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;AAEzD,6EAA6E;AAC7E,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAClC;AAED,MAAM,WAAW,oBAAoB;IACjC,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IAClD,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,MAAM,EAAE;QAAE,WAAW,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IACnD,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,WAAW,CAAC;IACpB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;IACnE,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;CAC3C;AAED;;;;GAIG;AACH,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"FileListSection.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/screens/fileManagement/FileListSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAIH,UAAU,EAGb,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;AAEzD,6EAA6E;AAC7E,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAClC;AAED,MAAM,WAAW,oBAAoB;IACjC,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IAClD,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,MAAM,EAAE;QAAE,WAAW,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IACnD,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,WAAW,CAAC;IACpB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;IACnE,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;CAC3C;AAED;;;;GAIG;AACH,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA6EnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PhotoPickerSection.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/screens/fileManagement/PhotoPickerSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PhotoPickerSection.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/screens/fileManagement/PhotoPickerSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAgBjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA2FhD;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACjC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC1D,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,MAAM,GAAG,SAAS,CAAC;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAC7C,cAAc,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAC9C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;CACtE;AAmLD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAqWnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxyhq/services",
|
|
3
|
-
"version": "22.8.
|
|
3
|
+
"version": "22.8.5",
|
|
4
4
|
"description": "OxyHQ Expo/React Native SDK — UI components, screens, and native features",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
},
|
|
177
177
|
"peerDependencies": {
|
|
178
178
|
"@expo/vector-icons": "^15.0.3",
|
|
179
|
-
"@oxyhq/bloom": ">=0.
|
|
179
|
+
"@oxyhq/bloom": ">=0.44.1",
|
|
180
180
|
"@oxyhq/core": "^12.9.0",
|
|
181
181
|
"@react-native-async-storage/async-storage": "^2.0.0",
|
|
182
182
|
"@react-native-community/netinfo": "^11.4.1",
|
|
@@ -5,6 +5,7 @@ import type { RouteName } from '../navigation/routes';
|
|
|
5
5
|
import { getScreenComponent, getSheetConfig, isValidRoute } from '../navigation/routes';
|
|
6
6
|
import type { BaseScreenProps } from '../types/navigation';
|
|
7
7
|
import { useTheme } from '@oxyhq/bloom/theme';
|
|
8
|
+
import { Dialog } from '@oxyhq/bloom/dialog';
|
|
8
9
|
import BottomSheet, { type BottomSheetRef } from './BottomSheet';
|
|
9
10
|
import {
|
|
10
11
|
bottomSheetStore,
|
|
@@ -67,6 +68,15 @@ const errorStyles = StyleSheet.create({
|
|
|
67
68
|
message: { fontSize: 13, textAlign: 'center' },
|
|
68
69
|
});
|
|
69
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Responsive placement for `presentation: 'dialog'` routes: a bottom-sheet on
|
|
73
|
+
* narrow viewports, a centered card at `md+` (≥768dp). Module-scoped so the
|
|
74
|
+
* object identity is stable across renders (Bloom's placement resolver memoizes
|
|
75
|
+
* on it). PhotoPickerSection keys its center-vs-bottom layout off the SAME `md`
|
|
76
|
+
* breakpoint — keep the two in sync if this map changes.
|
|
77
|
+
*/
|
|
78
|
+
const DIALOG_PLACEMENT = { base: 'bottom', md: 'center' } as const;
|
|
79
|
+
|
|
70
80
|
export interface BottomSheetRouterProps {
|
|
71
81
|
onScreenChange?: (screen: RouteName | null) => void;
|
|
72
82
|
onDismiss?: () => void;
|
|
@@ -93,6 +103,15 @@ const BottomSheetRouter: React.FC<BottomSheetRouterProps> = ({ onScreenChange, o
|
|
|
93
103
|
return component ?? null;
|
|
94
104
|
}, [currentScreen]);
|
|
95
105
|
|
|
106
|
+
// Route-level sheet config (which surface hosts the route, whether the sheet
|
|
107
|
+
// provides its own ScrollView, etc.). Computed early so the visibility
|
|
108
|
+
// effect can gate the in-tree sheet on the resolved presentation.
|
|
109
|
+
const sheetConfig = useMemo(
|
|
110
|
+
() => getSheetConfig(currentScreen, screenProps),
|
|
111
|
+
[currentScreen, screenProps],
|
|
112
|
+
);
|
|
113
|
+
const isDialogPresentation = sheetConfig.presentation === 'dialog';
|
|
114
|
+
|
|
96
115
|
// Notify screen changes
|
|
97
116
|
useEffect(() => {
|
|
98
117
|
if (prevScreenRef.current !== currentScreen) {
|
|
@@ -101,16 +120,19 @@ const BottomSheetRouter: React.FC<BottomSheetRouterProps> = ({ onScreenChange, o
|
|
|
101
120
|
}
|
|
102
121
|
}, [currentScreen, onScreenChange]);
|
|
103
122
|
|
|
104
|
-
// Control visibility
|
|
123
|
+
// Control visibility. The in-tree BottomSheet only ever presents for
|
|
124
|
+
// 'sheet'-presentation routes — 'dialog' routes render in the Bloom
|
|
125
|
+
// `<Dialog>` below, so the sheet stays dismissed for them (both surfaces
|
|
126
|
+
// remain mounted, so the pick→crop dialog→sheet handoff has no unmount jank).
|
|
105
127
|
useEffect(() => {
|
|
106
128
|
if (!sheetRef.current) return;
|
|
107
129
|
|
|
108
|
-
if (isOpen) {
|
|
130
|
+
if (isOpen && !isDialogPresentation) {
|
|
109
131
|
sheetRef.current.present();
|
|
110
132
|
} else {
|
|
111
133
|
sheetRef.current.dismiss();
|
|
112
134
|
}
|
|
113
|
-
}, [isOpen]);
|
|
135
|
+
}, [isOpen, isDialogPresentation]);
|
|
114
136
|
|
|
115
137
|
// Android back button
|
|
116
138
|
useEffect(() => {
|
|
@@ -210,33 +232,56 @@ const BottomSheetRouter: React.FC<BottomSheetRouterProps> = ({ onScreenChange, o
|
|
|
210
232
|
};
|
|
211
233
|
}, [navigate, handleGoBack, theme.mode, currentScreen, currentStep, screenProps, handleStepChange, scrollTo]);
|
|
212
234
|
|
|
213
|
-
//
|
|
214
|
-
//
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
235
|
+
// The active screen, wrapped in its error boundary. Routed into EXACTLY ONE
|
|
236
|
+
// surface (the in-tree sheet OR the Dialog) based on the resolved
|
|
237
|
+
// presentation, so it never double-mounts.
|
|
238
|
+
const screenNode =
|
|
239
|
+
ScreenComponent && currentScreen ? (
|
|
240
|
+
<ScreenErrorBoundary screenName={currentScreen}>
|
|
241
|
+
<ScreenComponent {...screenPropsValue} />
|
|
242
|
+
</ScreenErrorBoundary>
|
|
243
|
+
) : null;
|
|
219
244
|
|
|
220
245
|
return (
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
246
|
+
<>
|
|
247
|
+
<BottomSheet
|
|
248
|
+
ref={sheetRef}
|
|
249
|
+
enablePanDownToClose
|
|
250
|
+
enableHandlePanningGesture
|
|
251
|
+
backgroundComponent={renderBackground}
|
|
252
|
+
style={styles.container}
|
|
253
|
+
onDismiss={handleDismiss}
|
|
254
|
+
onDismissAttempt={handleDismissAttempt}
|
|
255
|
+
scrollable={sheetConfig.scrollable}
|
|
256
|
+
manualActivation={sheetConfig.manualActivation}
|
|
257
|
+
dynamicBackdrop={sheetConfig.dynamicBackdrop}
|
|
258
|
+
handleComponent={sheetConfig.handleComponent}
|
|
259
|
+
>
|
|
260
|
+
{!isDialogPresentation && screenNode}
|
|
261
|
+
</BottomSheet>
|
|
262
|
+
{/* Always-mounted responsive Dialog surface for `presentation:
|
|
263
|
+
'dialog'` routes (currently the flagship photo picker). It stays
|
|
264
|
+
inert (`open={false}`, no child) for the ~28 sheet routes, so they
|
|
265
|
+
keep byte-for-byte identical behavior. `contentPadding={0}` +
|
|
266
|
+
the full-bleed black, rounded, clipped surface let the picker
|
|
267
|
+
paint edge-to-edge; `dismissOnBackdrop={false}` keeps the
|
|
268
|
+
controlled open state authoritative (dismissal flows through the
|
|
269
|
+
store, matching OxyAccountDialog). */}
|
|
270
|
+
<Dialog
|
|
271
|
+
open={isOpen && isDialogPresentation}
|
|
272
|
+
onClose={handleDismiss}
|
|
273
|
+
placement={DIALOG_PLACEMENT}
|
|
274
|
+
dismissOnBackdrop={false}
|
|
275
|
+
contentPadding={0}
|
|
276
|
+
maxWidth={640}
|
|
277
|
+
maxHeightRatio={0.9}
|
|
278
|
+
style={styles.dialogSurface}
|
|
279
|
+
panelStyle={styles.dialogSurface}
|
|
280
|
+
label={currentScreen ?? undefined}
|
|
281
|
+
>
|
|
282
|
+
{isDialogPresentation ? screenNode : null}
|
|
283
|
+
</Dialog>
|
|
284
|
+
</>
|
|
240
285
|
);
|
|
241
286
|
};
|
|
242
287
|
|
|
@@ -252,6 +297,14 @@ const styles = StyleSheet.create({
|
|
|
252
297
|
borderTopRightRadius: 20,
|
|
253
298
|
overflow: 'hidden',
|
|
254
299
|
},
|
|
300
|
+
// Full-bleed black surface for `presentation: 'dialog'` routes. `overflow:
|
|
301
|
+
// 'hidden'` clips the picker's edge-to-edge black content to the panel's
|
|
302
|
+
// rounded corners (Dialog supplies the radius per placement); the black
|
|
303
|
+
// fill covers any sub-pixel gap behind the picker during entrance.
|
|
304
|
+
dialogSurface: {
|
|
305
|
+
backgroundColor: '#000000',
|
|
306
|
+
overflow: 'hidden',
|
|
307
|
+
},
|
|
255
308
|
});
|
|
256
309
|
|
|
257
310
|
export default React.memo(BottomSheetRouter);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { getSheetConfig } from '../routes';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* `getSheetConfig` drives which surface `BottomSheetRouter` mounts a route in.
|
|
5
|
+
* The flagship image picker (FileManagement in image-only select mode) resolves
|
|
6
|
+
* to `presentation: 'dialog'`; every other route stays `'sheet'`. These guard
|
|
7
|
+
* the routing contract so the ~28 sheet screens keep the in-tree BottomSheet.
|
|
8
|
+
*/
|
|
9
|
+
describe('getSheetConfig presentation', () => {
|
|
10
|
+
const imageOnlyPickerProps = {
|
|
11
|
+
selectMode: true,
|
|
12
|
+
disabledMimeTypes: ['video/', 'audio/', 'application/pdf'],
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
it('defaults every route to the in-tree sheet', () => {
|
|
16
|
+
expect(getSheetConfig('ManageAccount', {}).presentation).toBe('sheet');
|
|
17
|
+
expect(getSheetConfig('AvatarCrop', {}).presentation).toBe('sheet');
|
|
18
|
+
expect(getSheetConfig(null, {}).presentation).toBe('sheet');
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('routes the FileManagement image-only picker to the Dialog', () => {
|
|
22
|
+
expect(getSheetConfig('FileManagement', imageOnlyPickerProps).presentation).toBe('dialog');
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('keeps FileManagement on the sheet when it is not an image-only picker', () => {
|
|
26
|
+
// Browse mode (no selectMode) — the standard file manager.
|
|
27
|
+
expect(getSheetConfig('FileManagement', {}).presentation).toBe('sheet');
|
|
28
|
+
// Select mode that still allows non-image types is not the flagship picker.
|
|
29
|
+
expect(
|
|
30
|
+
getSheetConfig('FileManagement', {
|
|
31
|
+
selectMode: true,
|
|
32
|
+
disabledMimeTypes: ['video/'],
|
|
33
|
+
}).presentation,
|
|
34
|
+
).toBe('sheet');
|
|
35
|
+
});
|
|
36
|
+
});
|
|
@@ -128,11 +128,23 @@ export const isValidRoute = (routeName: string): routeName is RouteName => {
|
|
|
128
128
|
* remove fields without bumping the consumer surface as a breaking change.
|
|
129
129
|
*/
|
|
130
130
|
export interface SheetRouteConfig {
|
|
131
|
+
/**
|
|
132
|
+
* Which surface hosts the route. `'sheet'` (default) renders the screen in
|
|
133
|
+
* the in-tree `BottomSheet`. `'dialog'` renders it in a responsive Bloom
|
|
134
|
+
* `<Dialog>` (bottom-sheet on narrow, centered card on `md+`) — used for the
|
|
135
|
+
* flagship image picker, which reads better as a centered panel on wide
|
|
136
|
+
* viewports than a full-width sheet. `BottomSheetRouter` keeps BOTH surfaces
|
|
137
|
+
* mounted and routes the active screen into exactly one based on this value.
|
|
138
|
+
*/
|
|
139
|
+
presentation: 'sheet' | 'dialog';
|
|
131
140
|
/**
|
|
132
141
|
* When `false`, BottomSheet skips its internal ScrollView and lets the
|
|
133
142
|
* screen own scrolling. Required for screens that render a FlatList,
|
|
134
143
|
* SectionList, or any other VirtualizedList — nesting one inside a
|
|
135
144
|
* plain ScrollView breaks windowing and triggers a RN warning.
|
|
145
|
+
*
|
|
146
|
+
* Ignored for `presentation: 'dialog'` routes — those don't render in the
|
|
147
|
+
* in-tree `BottomSheet` at all.
|
|
136
148
|
*/
|
|
137
149
|
scrollable: boolean;
|
|
138
150
|
/**
|
|
@@ -187,6 +199,7 @@ const isFileManagementImageOnlyPicker = (props: Record<string, unknown>): boolea
|
|
|
187
199
|
|
|
188
200
|
/** Defaults shared across all routes — preserves the historical in-tree BS UX. */
|
|
189
201
|
const DEFAULT_SHEET_CONFIG: SheetRouteConfig = {
|
|
202
|
+
presentation: 'sheet',
|
|
190
203
|
scrollable: true,
|
|
191
204
|
manualActivation: true,
|
|
192
205
|
dynamicBackdrop: true,
|
|
@@ -203,10 +216,12 @@ export const getSheetConfig = (
|
|
|
203
216
|
): SheetRouteConfig => {
|
|
204
217
|
if (!routeName) return DEFAULT_SHEET_CONFIG;
|
|
205
218
|
if (routeName === 'FileManagement' && isFileManagementImageOnlyPicker(screenProps)) {
|
|
206
|
-
//
|
|
207
|
-
//
|
|
208
|
-
//
|
|
209
|
-
|
|
219
|
+
// The flagship photo picker renders in a responsive Bloom `<Dialog>`
|
|
220
|
+
// (bottom-sheet on narrow, centered card on `md+`) rather than the
|
|
221
|
+
// in-tree BottomSheet — it owns its own FlatList and reads better as a
|
|
222
|
+
// centered panel on wide viewports. The Dialog surface, not this
|
|
223
|
+
// config's `scrollable`, governs its scrolling.
|
|
224
|
+
return { ...DEFAULT_SHEET_CONFIG, presentation: 'dialog' };
|
|
210
225
|
}
|
|
211
226
|
return DEFAULT_SHEET_CONFIG;
|
|
212
227
|
};
|