@oxyhq/services 22.10.0 → 22.11.1
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/AvatarCameraBadge.js +42 -0
- package/lib/commonjs/ui/components/AvatarCameraBadge.js.map +1 -0
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js +41 -19
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAuthChooser.js +640 -168
- package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileButton.js +14 -0
- package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileSummaryCard.js +3 -23
- package/lib/commonjs/ui/components/ProfileSummaryCard.js.map +1 -1
- package/lib/commonjs/ui/components/SurfaceScreen.js +41 -5
- package/lib/commonjs/ui/components/SurfaceScreen.js.map +1 -1
- package/lib/commonjs/ui/components/oxyAuthChooserStyles.js +78 -26
- package/lib/commonjs/ui/components/oxyAuthChooserStyles.js.map +1 -1
- package/lib/commonjs/ui/components/photogrid/JustifiedPhotoGrid.js +83 -23
- package/lib/commonjs/ui/components/photogrid/JustifiedPhotoGrid.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +73 -37
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/queryKeys.js +18 -1
- package/lib/commonjs/ui/hooks/queries/queryKeys.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useFileQueries.js +129 -0
- package/lib/commonjs/ui/hooks/queries/useFileQueries.js.map +1 -0
- package/lib/commonjs/ui/hooks/useAvatarPicker.js +36 -48
- package/lib/commonjs/ui/hooks/useAvatarPicker.js.map +1 -1
- package/lib/commonjs/ui/hooks/useReduceMotion.js +57 -0
- package/lib/commonjs/ui/hooks/useReduceMotion.js.map +1 -0
- package/lib/commonjs/ui/hooks/useSurfaceHeader.js +1 -1
- package/lib/commonjs/ui/hooks/useSurfaceHeader.js.map +1 -1
- package/lib/commonjs/ui/navigation/accountDialogManager.js +22 -0
- package/lib/commonjs/ui/navigation/accountDialogManager.js.map +1 -1
- package/lib/commonjs/ui/navigation/bottomSheetManager.js +5 -6
- package/lib/commonjs/ui/navigation/bottomSheetManager.js.map +1 -1
- package/lib/commonjs/ui/navigation/routes.js +1 -0
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/navigation/surfaceNavStack.js +62 -15
- package/lib/commonjs/ui/navigation/surfaceNavStack.js.map +1 -1
- package/lib/commonjs/ui/navigation/surfaceRegistry.js +38 -17
- package/lib/commonjs/ui/navigation/surfaceRegistry.js.map +1 -1
- package/lib/commonjs/ui/navigation/surfaces.js +98 -21
- package/lib/commonjs/ui/navigation/surfaces.js.map +1 -1
- package/lib/commonjs/ui/screens/AvatarCropScreen.js +281 -279
- package/lib/commonjs/ui/screens/AvatarCropScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ChangeAvatarScreen.js +301 -0
- package/lib/commonjs/ui/screens/ChangeAvatarScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/FileManagementScreen.js +194 -431
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +16 -48
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/FileLibraryError.js +63 -0
- package/lib/commonjs/ui/screens/fileManagement/FileLibraryError.js.map +1 -0
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +71 -39
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js +44 -81
- package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
- package/lib/commonjs/ui/stores/resetSessionScopedStores.js +8 -3
- package/lib/commonjs/ui/stores/resetSessionScopedStores.js.map +1 -1
- package/lib/commonjs/ui/utils/avatarUtils.js +11 -2
- package/lib/commonjs/ui/utils/avatarUtils.js.map +1 -1
- package/lib/commonjs/ui/utils/fileManagement.js +0 -79
- package/lib/commonjs/ui/utils/fileManagement.js.map +1 -1
- package/lib/module/ui/components/AvatarCameraBadge.js +40 -0
- package/lib/module/ui/components/AvatarCameraBadge.js.map +1 -0
- package/lib/module/ui/components/OxyAccountDialogScreen.js +41 -19
- package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -1
- package/lib/module/ui/components/OxyAuthChooser.js +642 -171
- package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/module/ui/components/ProfileButton.js +15 -1
- package/lib/module/ui/components/ProfileButton.js.map +1 -1
- package/lib/module/ui/components/ProfileSummaryCard.js +2 -23
- package/lib/module/ui/components/ProfileSummaryCard.js.map +1 -1
- package/lib/module/ui/components/SurfaceScreen.js +43 -7
- package/lib/module/ui/components/SurfaceScreen.js.map +1 -1
- package/lib/module/ui/components/oxyAuthChooserStyles.js +78 -26
- package/lib/module/ui/components/oxyAuthChooserStyles.js.map +1 -1
- package/lib/module/ui/components/photogrid/JustifiedPhotoGrid.js +83 -25
- package/lib/module/ui/components/photogrid/JustifiedPhotoGrid.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +74 -38
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/queries/queryKeys.js +16 -0
- package/lib/module/ui/hooks/queries/queryKeys.js.map +1 -1
- package/lib/module/ui/hooks/queries/useFileQueries.js +120 -0
- package/lib/module/ui/hooks/queries/useFileQueries.js.map +1 -0
- package/lib/module/ui/hooks/useAvatarPicker.js +37 -49
- package/lib/module/ui/hooks/useAvatarPicker.js.map +1 -1
- package/lib/module/ui/hooks/useReduceMotion.js +53 -0
- package/lib/module/ui/hooks/useReduceMotion.js.map +1 -0
- package/lib/module/ui/hooks/useSurfaceHeader.js +1 -1
- package/lib/module/ui/hooks/useSurfaceHeader.js.map +1 -1
- package/lib/module/ui/navigation/accountDialogManager.js +20 -0
- package/lib/module/ui/navigation/accountDialogManager.js.map +1 -1
- package/lib/module/ui/navigation/bottomSheetManager.js +6 -7
- package/lib/module/ui/navigation/bottomSheetManager.js.map +1 -1
- package/lib/module/ui/navigation/routes.js +1 -0
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/navigation/surfaceNavStack.js +62 -15
- package/lib/module/ui/navigation/surfaceNavStack.js.map +1 -1
- package/lib/module/ui/navigation/surfaceRegistry.js +38 -17
- package/lib/module/ui/navigation/surfaceRegistry.js.map +1 -1
- package/lib/module/ui/navigation/surfaces.js +97 -22
- package/lib/module/ui/navigation/surfaces.js.map +1 -1
- package/lib/module/ui/screens/AvatarCropScreen.js +283 -281
- package/lib/module/ui/screens/AvatarCropScreen.js.map +1 -1
- package/lib/module/ui/screens/ChangeAvatarScreen.js +298 -0
- package/lib/module/ui/screens/ChangeAvatarScreen.js.map +1 -0
- package/lib/module/ui/screens/FileManagementScreen.js +196 -433
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +17 -49
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/FileLibraryError.js +59 -0
- package/lib/module/ui/screens/fileManagement/FileLibraryError.js.map +1 -0
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js +71 -40
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js +45 -81
- package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
- package/lib/module/ui/stores/resetSessionScopedStores.js +8 -3
- package/lib/module/ui/stores/resetSessionScopedStores.js.map +1 -1
- package/lib/module/ui/utils/avatarUtils.js +11 -2
- package/lib/module/ui/utils/avatarUtils.js.map +1 -1
- package/lib/module/ui/utils/fileManagement.js +0 -78
- package/lib/module/ui/utils/fileManagement.js.map +1 -1
- package/lib/typescript/commonjs/ui/components/AvatarCameraBadge.d.ts +4 -0
- package/lib/typescript/commonjs/ui/components/AvatarCameraBadge.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts +2 -1
- package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ProfileSummaryCard.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/SurfaceScreen.d.ts +1 -4
- package/lib/typescript/commonjs/ui/components/SurfaceScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/oxyAuthChooserStyles.d.ts +71 -19
- package/lib/typescript/commonjs/ui/components/oxyAuthChooserStyles.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/photogrid/JustifiedPhotoGrid.d.ts +10 -8
- package/lib/typescript/commonjs/ui/components/photogrid/JustifiedPhotoGrid.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts +9 -0
- package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useFileQueries.d.ts +50 -0
- package/lib/typescript/commonjs/ui/hooks/queries/useFileQueries.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/useAvatarPicker.d.ts +15 -10
- package/lib/typescript/commonjs/ui/hooks/useAvatarPicker.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useReduceMotion.d.ts +14 -0
- package/lib/typescript/commonjs/ui/hooks/useReduceMotion.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts +13 -0
- package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts +4 -5
- package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/surfaceNavStack.d.ts +21 -0
- package/lib/typescript/commonjs/ui/navigation/surfaceNavStack.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts +73 -13
- package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/surfaces.d.ts +42 -11
- package/lib/typescript/commonjs/ui/navigation/surfaces.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AvatarCropScreen.d.ts +18 -5
- package/lib/typescript/commonjs/ui/screens/AvatarCropScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ChangeAvatarScreen.d.ts +34 -0
- package/lib/typescript/commonjs/ui/screens/ChangeAvatarScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/fileManagement/FileLibraryError.d.ts +23 -0
- package/lib/typescript/commonjs/ui/screens/fileManagement/FileLibraryError.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/fileManagement/PhotoPickerSection.d.ts +4 -0
- package/lib/typescript/commonjs/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.d.ts +10 -2
- package/lib/typescript/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/stores/resetSessionScopedStores.d.ts +8 -1
- package/lib/typescript/commonjs/ui/stores/resetSessionScopedStores.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +2 -0
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/avatarUtils.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts +0 -48
- package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/AvatarCameraBadge.d.ts +4 -0
- package/lib/typescript/module/ui/components/AvatarCameraBadge.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts +2 -1
- package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ProfileSummaryCard.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/SurfaceScreen.d.ts +1 -4
- package/lib/typescript/module/ui/components/SurfaceScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/oxyAuthChooserStyles.d.ts +71 -19
- package/lib/typescript/module/ui/components/oxyAuthChooserStyles.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/photogrid/JustifiedPhotoGrid.d.ts +10 -8
- package/lib/typescript/module/ui/components/photogrid/JustifiedPhotoGrid.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts +9 -0
- package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/useFileQueries.d.ts +50 -0
- package/lib/typescript/module/ui/hooks/queries/useFileQueries.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts +15 -10
- package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useReduceMotion.d.ts +14 -0
- package/lib/typescript/module/ui/hooks/useReduceMotion.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts +13 -0
- package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts +4 -5
- package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/surfaceNavStack.d.ts +21 -0
- package/lib/typescript/module/ui/navigation/surfaceNavStack.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts +73 -13
- package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/surfaces.d.ts +42 -11
- package/lib/typescript/module/ui/navigation/surfaces.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts +18 -5
- package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ChangeAvatarScreen.d.ts +34 -0
- package/lib/typescript/module/ui/screens/ChangeAvatarScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/fileManagement/FileLibraryError.d.ts +23 -0
- package/lib/typescript/module/ui/screens/fileManagement/FileLibraryError.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/fileManagement/PhotoPickerSection.d.ts +4 -0
- package/lib/typescript/module/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/fileManagement/hooks/useFileUploadState.d.ts +10 -2
- package/lib/typescript/module/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
- package/lib/typescript/module/ui/stores/resetSessionScopedStores.d.ts +8 -1
- package/lib/typescript/module/ui/stores/resetSessionScopedStores.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts +2 -0
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/avatarUtils.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/fileManagement.d.ts +0 -48
- package/lib/typescript/module/ui/utils/fileManagement.d.ts.map +1 -1
- package/package.json +11 -7
- package/src/ui/components/AvatarCameraBadge.tsx +35 -0
- package/src/ui/components/OxyAccountDialogScreen.tsx +38 -15
- package/src/ui/components/OxyAuthChooser.tsx +722 -185
- package/src/ui/components/ProfileButton.tsx +16 -1
- package/src/ui/components/ProfileSummaryCard.tsx +2 -25
- package/src/ui/components/SurfaceScreen.tsx +48 -14
- package/src/ui/components/oxyAuthChooserStyles.ts +75 -23
- package/src/ui/components/photogrid/JustifiedPhotoGrid.tsx +158 -84
- package/src/ui/components/photogrid/__tests__/chunkPhotos.test.ts +51 -0
- package/src/ui/context/OxyContext.tsx +74 -34
- package/src/ui/hooks/queries/queryKeys.ts +15 -0
- package/src/ui/hooks/queries/useFileQueries.ts +162 -0
- package/src/ui/hooks/useAvatarPicker.ts +38 -53
- package/src/ui/hooks/useReduceMotion.ts +58 -0
- package/src/ui/hooks/useSurfaceHeader.ts +2 -1
- package/src/ui/navigation/__tests__/getSurfaceConfig.test.ts +55 -7
- package/src/ui/navigation/__tests__/surfaceNavStack.test.ts +81 -0
- package/src/ui/navigation/accountDialogManager.ts +28 -0
- package/src/ui/navigation/bottomSheetManager.ts +6 -7
- package/src/ui/navigation/routes.ts +3 -1
- package/src/ui/navigation/surfaceNavStack.ts +72 -9
- package/src/ui/navigation/surfaceRegistry.ts +91 -17
- package/src/ui/navigation/surfaces.ts +108 -29
- package/src/ui/screens/AvatarCropScreen.tsx +336 -298
- package/src/ui/screens/ChangeAvatarScreen.tsx +359 -0
- package/src/ui/screens/FileManagementScreen.tsx +189 -432
- package/src/ui/screens/WelcomeNewUserScreen.tsx +18 -48
- package/src/ui/screens/fileManagement/FileLibraryError.tsx +56 -0
- package/src/ui/screens/fileManagement/PhotoPickerSection.tsx +73 -44
- package/src/ui/screens/fileManagement/hooks/useFileUploadState.ts +55 -71
- package/src/ui/stores/resetSessionScopedStores.ts +8 -3
- package/src/ui/types/navigation.ts +2 -0
- package/src/ui/utils/avatarUtils.ts +11 -2
- package/src/ui/utils/fileManagement.ts +1 -101
- package/lib/commonjs/ui/stores/fileStore.js +0 -153
- package/lib/commonjs/ui/stores/fileStore.js.map +0 -1
- package/lib/module/ui/stores/fileStore.js +0 -145
- package/lib/module/ui/stores/fileStore.js.map +0 -1
- package/lib/typescript/commonjs/ui/stores/fileStore.d.ts +0 -31
- package/lib/typescript/commonjs/ui/stores/fileStore.d.ts.map +0 -1
- package/lib/typescript/module/ui/stores/fileStore.d.ts +0 -31
- package/lib/typescript/module/ui/stores/fileStore.d.ts.map +0 -1
- package/src/ui/stores/fileStore.ts +0 -118
|
@@ -9,8 +9,6 @@ import SurfaceScreen from '../components/SurfaceScreen';
|
|
|
9
9
|
import type { RouteName } from './routes';
|
|
10
10
|
import {
|
|
11
11
|
getSurfaceConfig,
|
|
12
|
-
getSurfacePresentation,
|
|
13
|
-
type SurfacePresentation,
|
|
14
12
|
type SurfaceProps,
|
|
15
13
|
type SurfaceResult,
|
|
16
14
|
type SurfaceRouteConfig,
|
|
@@ -51,6 +49,11 @@ function bloomOptionsFor(config: SurfaceRouteConfig): PresentOptions {
|
|
|
51
49
|
// Threaded onto every placement so a route that owns its own scroll container
|
|
52
50
|
// (`scrollable: false`) opts out of the Dialog's internal ScrollView.
|
|
53
51
|
const scrollable = config.scrollable;
|
|
52
|
+
// Surface-level morph opt-out (the DEPTH axis is untouched — this only governs
|
|
53
|
+
// whether the panel reshapes when the content is swapped in place). Each frame
|
|
54
|
+
// additionally declares its own opt-out through `useDialogFrame` in
|
|
55
|
+
// `SurfaceScreen`, so a surface can morph for most routes and not for one.
|
|
56
|
+
const morph = config.morph;
|
|
54
57
|
// Nav-header mode marker: turns on the Dialog's OWN sticky gradient nav bar +
|
|
55
58
|
// large collapsing title over its scroll content. The title/subtitle/action
|
|
56
59
|
// slots are contributed at runtime by the mounted screen via `useSurfaceHeader`
|
|
@@ -58,9 +61,15 @@ function bloomOptionsFor(config: SurfaceRouteConfig): PresentOptions {
|
|
|
58
61
|
const header = config.header ? { largeTitle: true } : undefined;
|
|
59
62
|
switch (config.presentation) {
|
|
60
63
|
case 'center':
|
|
61
|
-
return { placement: 'center', scrollable, header, ...SDK_SURFACE_CHROME };
|
|
64
|
+
return { placement: 'center', scrollable, header, morph, ...SDK_SURFACE_CHROME };
|
|
62
65
|
case 'drawer':
|
|
63
|
-
return {
|
|
66
|
+
return {
|
|
67
|
+
placement: { base: 'bottom', md: 'left' },
|
|
68
|
+
scrollable,
|
|
69
|
+
header,
|
|
70
|
+
morph,
|
|
71
|
+
...SDK_SURFACE_CHROME,
|
|
72
|
+
};
|
|
64
73
|
case 'fullScreen':
|
|
65
74
|
// Approximate a full-screen surface with the shared `Dialog`: a tall
|
|
66
75
|
// sheet / large centered card, flush content, a black canvas and
|
|
@@ -72,11 +81,12 @@ function bloomOptionsFor(config: SurfaceRouteConfig): PresentOptions {
|
|
|
72
81
|
maxHeightRatio: 0.9,
|
|
73
82
|
dismissOnBackdrop: false,
|
|
74
83
|
scrollable,
|
|
84
|
+
morph,
|
|
75
85
|
style: FULLSCREEN_SURFACE_STYLE,
|
|
76
86
|
panelStyle: FULLSCREEN_SURFACE_STYLE,
|
|
77
87
|
};
|
|
78
88
|
default:
|
|
79
|
-
return { placement: SHEET_PLACEMENT, scrollable, header, ...SDK_SURFACE_CHROME };
|
|
89
|
+
return { placement: SHEET_PLACEMENT, scrollable, header, morph, ...SDK_SURFACE_CHROME };
|
|
80
90
|
}
|
|
81
91
|
}
|
|
82
92
|
|
|
@@ -88,12 +98,13 @@ function bloomOptionsFor(config: SurfaceRouteConfig): PresentOptions {
|
|
|
88
98
|
*/
|
|
89
99
|
export interface SurfaceInstance<K extends RouteName = RouteName> {
|
|
90
100
|
readonly route: RouteName;
|
|
91
|
-
readonly presentation: SurfacePresentation;
|
|
92
101
|
navigate: (route: RouteName, props?: Record<string, unknown>) => void;
|
|
93
102
|
replace: (route: RouteName, props?: Record<string, unknown>) => void;
|
|
94
103
|
goBack: () => boolean;
|
|
95
104
|
canGoBack: () => boolean;
|
|
96
105
|
setStep: (step: number) => void;
|
|
106
|
+
/** Open a result-bearing sub-flow WITHIN this surface (morph). See {@link openWithinOrPresent}. */
|
|
107
|
+
beginFlow: (route: RouteName, props?: Record<string, unknown>) => Promise<unknown>;
|
|
97
108
|
dismiss: (result?: SurfaceResult<K>) => void;
|
|
98
109
|
readonly result: Promise<SurfaceResult<K> | undefined>;
|
|
99
110
|
}
|
|
@@ -102,12 +113,15 @@ export interface SurfaceInstance<K extends RouteName = RouteName> {
|
|
|
102
113
|
* The type-erased handle the `showBottomSheet` adapter needs from a tracked
|
|
103
114
|
* surface: what it hosts, and how to drive/dismiss it. Kept result-type-free so
|
|
104
115
|
* the (generic) `SurfaceInstance<K>` never has to be widened into a shared array.
|
|
116
|
+
* Exported so `OxyContext` can hold the surface it MORPHS the account dialog into
|
|
117
|
+
* (see {@link topRouteSurface}).
|
|
105
118
|
*/
|
|
106
|
-
interface TrackedSurface {
|
|
119
|
+
export interface TrackedSurface {
|
|
107
120
|
readonly route: RouteName;
|
|
108
|
-
readonly presentation: SurfacePresentation;
|
|
109
121
|
navigate: (route: RouteName, props?: Record<string, unknown>) => void;
|
|
110
122
|
goBack: () => boolean;
|
|
123
|
+
/** Open a result-bearing sub-flow WITHIN this surface (morph). See {@link openWithinOrPresent}. */
|
|
124
|
+
beginFlow: (route: RouteName, props?: Record<string, unknown>) => Promise<unknown>;
|
|
111
125
|
dismiss: () => void;
|
|
112
126
|
}
|
|
113
127
|
|
|
@@ -119,6 +133,17 @@ interface TrackedSurface {
|
|
|
119
133
|
*/
|
|
120
134
|
const activeRouteSurfaces: TrackedSurface[] = [];
|
|
121
135
|
|
|
136
|
+
/**
|
|
137
|
+
* The frontmost DETACHED surface (the AccountDialog), while open. Detached
|
|
138
|
+
* surfaces are kept OUT of `activeRouteSurfaces` so `closeAllRouteSurfaces` never
|
|
139
|
+
* touches them — but the AccountDialog IS a valid morph target: a result-bearing
|
|
140
|
+
* flow opened from within it (the account-menu hero avatar → `ChangeAvatar`) must
|
|
141
|
+
* morph INTO it, not stack a new surface behind it. Invariant: whenever set, this
|
|
142
|
+
* surface is frontmost — every account-menu action that opens a tracked surface
|
|
143
|
+
* (Manage, Help, …) dismisses the dialog FIRST, so the two never overlap.
|
|
144
|
+
*/
|
|
145
|
+
let detachedFrontSurface: TrackedSurface | null = null;
|
|
146
|
+
|
|
122
147
|
function presentInternal<K extends RouteName>(
|
|
123
148
|
route: K,
|
|
124
149
|
props: Record<string, unknown>,
|
|
@@ -133,7 +158,6 @@ function presentInternal<K extends RouteName>(
|
|
|
133
158
|
createElement(SurfaceScreen, {
|
|
134
159
|
navStack,
|
|
135
160
|
surface,
|
|
136
|
-
presentation: config.presentation,
|
|
137
161
|
dismissOnBackdrop: bloomOpts.dismissOnBackdrop ?? true,
|
|
138
162
|
}),
|
|
139
163
|
bloomOpts,
|
|
@@ -141,7 +165,6 @@ function presentInternal<K extends RouteName>(
|
|
|
141
165
|
|
|
142
166
|
const instance: SurfaceInstance<K> = {
|
|
143
167
|
route,
|
|
144
|
-
presentation: config.presentation,
|
|
145
168
|
navigate: (nextRoute, nextProps) => {
|
|
146
169
|
const top = navStack.getTop();
|
|
147
170
|
if (top.route === nextRoute) navStack.replace(nextRoute, nextProps);
|
|
@@ -151,23 +174,36 @@ function presentInternal<K extends RouteName>(
|
|
|
151
174
|
goBack: () => navStack.goBack(),
|
|
152
175
|
canGoBack: () => navStack.canGoBack(),
|
|
153
176
|
setStep: (step) => navStack.setStep(step),
|
|
177
|
+
beginFlow: (nextRoute, nextProps) => navStack.beginFlow(nextRoute, nextProps),
|
|
154
178
|
dismiss: (dismissResult) => navStack.requestDismiss(dismissResult),
|
|
155
179
|
result,
|
|
156
180
|
};
|
|
157
181
|
|
|
182
|
+
// If the surface is torn down (backdrop, `closeAll`, host unmount) while a
|
|
183
|
+
// result-bearing sub-flow is still open, settle that flow so an awaiting caller
|
|
184
|
+
// never hangs. Runs for tracked and detached surfaces alike.
|
|
185
|
+
result.finally(() => navStack.abandonActiveFlow());
|
|
186
|
+
|
|
187
|
+
const tracked: TrackedSurface = {
|
|
188
|
+
route: instance.route,
|
|
189
|
+
navigate: instance.navigate,
|
|
190
|
+
goBack: instance.goBack,
|
|
191
|
+
beginFlow: instance.beginFlow,
|
|
192
|
+
dismiss: () => instance.dismiss(),
|
|
193
|
+
};
|
|
158
194
|
if (track) {
|
|
159
|
-
const tracked: TrackedSurface = {
|
|
160
|
-
route: instance.route,
|
|
161
|
-
presentation: instance.presentation,
|
|
162
|
-
navigate: instance.navigate,
|
|
163
|
-
goBack: instance.goBack,
|
|
164
|
-
dismiss: () => instance.dismiss(),
|
|
165
|
-
};
|
|
166
195
|
activeRouteSurfaces.push(tracked);
|
|
167
196
|
result.finally(() => {
|
|
168
197
|
const index = activeRouteSurfaces.indexOf(tracked);
|
|
169
198
|
if (index >= 0) activeRouteSurfaces.splice(index, 1);
|
|
170
199
|
});
|
|
200
|
+
} else {
|
|
201
|
+
// Detached (the AccountDialog): NOT in the closeAll lineage, but recorded as
|
|
202
|
+
// the frontmost morph target so a flow opened from within it morphs IN.
|
|
203
|
+
detachedFrontSurface = tracked;
|
|
204
|
+
result.finally(() => {
|
|
205
|
+
if (detachedFrontSurface === tracked) detachedFrontSurface = null;
|
|
206
|
+
});
|
|
171
207
|
}
|
|
172
208
|
|
|
173
209
|
return instance;
|
|
@@ -210,6 +246,16 @@ export function topRouteSurface(): TrackedSurface | undefined {
|
|
|
210
246
|
return activeRouteSurfaces[activeRouteSurfaces.length - 1];
|
|
211
247
|
}
|
|
212
248
|
|
|
249
|
+
/**
|
|
250
|
+
* The frontmost surface a result-bearing flow should morph INTO: the detached
|
|
251
|
+
* AccountDialog if open (it sits on top of everything), else the top tracked
|
|
252
|
+
* route surface. Used by {@link openWithinOrPresent} so the account-menu hero
|
|
253
|
+
* avatar morphs the dialog into `ChangeAvatar` instead of stacking a new surface.
|
|
254
|
+
*/
|
|
255
|
+
export function topMorphableSurface(): TrackedSurface | undefined {
|
|
256
|
+
return detachedFrontSurface ?? topRouteSurface();
|
|
257
|
+
}
|
|
258
|
+
|
|
213
259
|
/**
|
|
214
260
|
* Dismiss every active route surface (the whole `showBottomSheet` session). The
|
|
215
261
|
* AccountDialog is untracked, so it is untouched. Iterates a snapshot because
|
|
@@ -220,37 +266,70 @@ export function closeAllRouteSurfaces(): void {
|
|
|
220
266
|
}
|
|
221
267
|
|
|
222
268
|
/**
|
|
223
|
-
* Drill in from a screen
|
|
224
|
-
*
|
|
225
|
-
*
|
|
269
|
+
* Drill in from a screen. From inside a surface the DEFAULT is to navigate WITHIN
|
|
270
|
+
* it — the panel MORPHS from the current frame's size to the next's. EVERY screen
|
|
271
|
+
* morphs; a NEW surface is stacked on top ONLY when the target route declares
|
|
272
|
+
* `stacks` (reserved for genuine overlays — none today, since action sheets /
|
|
273
|
+
* confirms / prompts are Bloom-raw `surfaces.present` calls outside this
|
|
274
|
+
* registry). A stacked surface gets its own backdrop + entry animation; dismissing
|
|
275
|
+
* it unwinds back to the surface that opened it.
|
|
226
276
|
*/
|
|
227
277
|
export function navigateWithinOrPresent(
|
|
228
|
-
currentPresentation: SurfacePresentation,
|
|
229
278
|
navStack: SurfaceNavStack,
|
|
230
279
|
route: RouteName,
|
|
231
280
|
props?: Record<string, unknown>,
|
|
232
281
|
): void {
|
|
233
282
|
const nextProps = props ?? {};
|
|
234
|
-
if (
|
|
235
|
-
navStack.navigate(route, nextProps);
|
|
236
|
-
} else {
|
|
283
|
+
if (getSurfaceConfig(route, nextProps).stacks) {
|
|
237
284
|
presentRoute(route, nextProps);
|
|
285
|
+
} else {
|
|
286
|
+
navStack.navigate(route, nextProps);
|
|
238
287
|
}
|
|
239
288
|
}
|
|
240
289
|
|
|
241
|
-
/** Replace variant of {@link navigateWithinOrPresent}. */
|
|
290
|
+
/** Replace variant of {@link navigateWithinOrPresent} (swaps the top frame). */
|
|
242
291
|
export function replaceWithinOrPresent(
|
|
243
|
-
currentPresentation: SurfacePresentation,
|
|
244
292
|
navStack: SurfaceNavStack,
|
|
245
293
|
route: RouteName,
|
|
246
294
|
props?: Record<string, unknown>,
|
|
247
295
|
): void {
|
|
248
296
|
const nextProps = props ?? {};
|
|
249
|
-
if (
|
|
250
|
-
navStack.replace(route, nextProps);
|
|
251
|
-
} else {
|
|
297
|
+
if (getSurfaceConfig(route, nextProps).stacks) {
|
|
252
298
|
presentRoute(route, nextProps);
|
|
299
|
+
} else {
|
|
300
|
+
navStack.replace(route, nextProps);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Open a result-bearing route the SAME way a drill-in navigates (the morph-by-
|
|
306
|
+
* default rule), but returning the route's dismissal RESULT to the caller.
|
|
307
|
+
*
|
|
308
|
+
* When a surface is already open and the target morphs into it (the default —
|
|
309
|
+
* anything not marked `stacks`), it runs as a SUB-FLOW inside that surface: the
|
|
310
|
+
* panel morphs from the current screen into the target, and the promise resolves
|
|
311
|
+
* with the target's `dismiss(result)` (or `undefined` when cancelled), popping
|
|
312
|
+
* back to the caller's frame WITHOUT closing the host. Otherwise (no surface, or a
|
|
313
|
+
* route that stacks) it presents a fresh surface and resolves with its dismissal —
|
|
314
|
+
* identical to the historical `present(route).result`.
|
|
315
|
+
*
|
|
316
|
+
* The entry seam for the avatar picker AND its nested "My Oxy files" media
|
|
317
|
+
* selector: each awaits its result whether it morphed into the caller's surface
|
|
318
|
+
* or opened cold, with no morph-vs-present branch of its own.
|
|
319
|
+
*/
|
|
320
|
+
export function openWithinOrPresent<K extends RouteName>(
|
|
321
|
+
route: K,
|
|
322
|
+
props?: SurfaceProps<K>,
|
|
323
|
+
): Promise<SurfaceResult<K> | undefined> {
|
|
324
|
+
const nextProps = (props ?? {}) as Record<string, unknown>;
|
|
325
|
+
const host = topMorphableSurface();
|
|
326
|
+
if (host && !getSurfaceConfig(route, nextProps).stacks) {
|
|
327
|
+
// Morph: run as a sub-flow inside the host. The erased `Promise<unknown>` is
|
|
328
|
+
// narrowed to this route's result at the typed boundary (the sub-flow resolves
|
|
329
|
+
// with exactly the value a descendant screen passes to `dismiss(result)`).
|
|
330
|
+
return host.beginFlow(route, nextProps) as Promise<SurfaceResult<K> | undefined>;
|
|
253
331
|
}
|
|
332
|
+
return present(route, props).result;
|
|
254
333
|
}
|
|
255
334
|
|
|
256
335
|
/**
|