@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
|
@@ -47,36 +47,88 @@ const authChooserStyles = exports.authChooserStyles = _reactNative.StyleSheet.cr
|
|
|
47
47
|
fontSize: 12.5,
|
|
48
48
|
marginTop: 1
|
|
49
49
|
},
|
|
50
|
-
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Animated-collapse container for the account switch list — the outer clip and
|
|
52
|
+
* the inner measuring wrapper. Style-based (NOT NativeWind): the container
|
|
53
|
+
* carries the animated `height`/`opacity` off a reanimated style, and the
|
|
54
|
+
* measuring wrapper must stay className-free so its `onLayout` fires on RN-Web.
|
|
55
|
+
*/
|
|
56
|
+
collapse: {
|
|
57
|
+
overflow: 'hidden'
|
|
58
|
+
},
|
|
59
|
+
collapseMeasure: {
|
|
60
|
+
width: '100%'
|
|
61
61
|
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
/**
|
|
63
|
+
* The HERO block that opens the account menu: the current account's large
|
|
64
|
+
* avatar, a greeting, and the "Manage your Oxy account" pill — centred and
|
|
65
|
+
* deliberately chrome-free (no card, no grouped-section surface) so the
|
|
66
|
+
* grouped cards below read as the menu proper. The account's email sits above
|
|
67
|
+
* it in the Dialog's own nav bar, not here.
|
|
68
|
+
*/
|
|
69
|
+
hero: {
|
|
70
|
+
alignItems: 'center',
|
|
71
|
+
paddingTop: 4,
|
|
72
|
+
paddingBottom: 20,
|
|
73
|
+
gap: 12
|
|
74
|
+
},
|
|
75
|
+
/**
|
|
76
|
+
* The current account's accent ring in the switch list, drawn OUTSIDE its
|
|
77
|
+
* avatar as an overlay so it adds no width to the row — every avatar in the
|
|
78
|
+
* list keeps the same footprint and the same content line. The 3px offset is
|
|
79
|
+
* the ring's 2px stroke plus a 1px gap.
|
|
80
|
+
*/
|
|
81
|
+
currentAvatarRing: {
|
|
82
|
+
position: 'absolute',
|
|
83
|
+
top: -3,
|
|
84
|
+
left: -3,
|
|
85
|
+
right: -3,
|
|
86
|
+
bottom: -3,
|
|
87
|
+
borderWidth: 2,
|
|
88
|
+
borderRadius: 9999
|
|
89
|
+
},
|
|
90
|
+
/**
|
|
91
|
+
* The hero avatar's pressable wrapper — the "change your photo" entry point.
|
|
92
|
+
* `relative` so the accent ring + camera badge (both absolutely positioned)
|
|
93
|
+
* anchor to the avatar box.
|
|
94
|
+
*/
|
|
95
|
+
heroAvatarPressable: {
|
|
96
|
+
position: 'relative'
|
|
97
|
+
},
|
|
98
|
+
/** The hero avatar's accent ring — an overlay, like the row-level one. */
|
|
99
|
+
heroAvatarRing: {
|
|
100
|
+
position: 'absolute',
|
|
101
|
+
top: -4,
|
|
102
|
+
left: -4,
|
|
103
|
+
right: -4,
|
|
104
|
+
bottom: -4,
|
|
105
|
+
borderWidth: 3,
|
|
106
|
+
borderRadius: 9999
|
|
107
|
+
},
|
|
108
|
+
/** Greeting + address stacked tight, centred (the hero's own 12px gap sits
|
|
109
|
+
* between this block and the avatar / manage pill, not between these lines). */
|
|
110
|
+
heroNameBlock: {
|
|
111
|
+
alignItems: 'center',
|
|
112
|
+
gap: 2
|
|
65
113
|
},
|
|
66
|
-
|
|
67
|
-
fontSize:
|
|
68
|
-
|
|
114
|
+
heroGreeting: {
|
|
115
|
+
fontSize: 22,
|
|
116
|
+
fontWeight: '600',
|
|
117
|
+
textAlign: 'center'
|
|
69
118
|
},
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
119
|
+
/** The account address (`username@oxy.so` / `@handle`) under the greeting. */
|
|
120
|
+
heroAddress: {
|
|
121
|
+
fontSize: 14,
|
|
122
|
+
textAlign: 'center'
|
|
74
123
|
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
124
|
+
/**
|
|
125
|
+
* The switch row's disclosure affordance — a filled circle around the chevron,
|
|
126
|
+
* right-aligned to the same 12px row inset every other trailing element uses.
|
|
127
|
+
*/
|
|
128
|
+
chevronCircle: {
|
|
129
|
+
width: 32,
|
|
130
|
+
height: 32,
|
|
131
|
+
borderRadius: 16,
|
|
80
132
|
alignItems: 'center',
|
|
81
133
|
justifyContent: 'center'
|
|
82
134
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","QR_PLATE_BG","authChooserStyles","exports","StyleSheet","create","rows","width","gap","accountRow","flexDirection","alignItems","borderWidth","hairlineWidth","borderRadius","paddingVertical","paddingHorizontal","rowDisabled","opacity","avatarRing","padding","rowMeta","flex","minWidth","rowName","fontSize","fontWeight","rowHandle","marginTop","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","QR_PLATE_BG","authChooserStyles","exports","StyleSheet","create","rows","width","gap","accountRow","flexDirection","alignItems","borderWidth","hairlineWidth","borderRadius","paddingVertical","paddingHorizontal","rowDisabled","opacity","avatarRing","padding","rowMeta","flex","minWidth","rowName","fontSize","fontWeight","rowHandle","marginTop","collapse","overflow","collapseMeasure","hero","paddingTop","paddingBottom","currentAvatarRing","position","top","left","right","bottom","heroAvatarPressable","heroAvatarRing","heroNameBlock","heroGreeting","textAlign","heroAddress","chevronCircle","height","justifyContent","footerLink","alignSelf","linkText","signInBlock","primaryButton","secondaryButton","usernameInput","dividerRow","marginVertical","dividerLine","dividerText","marginHorizontal","centeredBlock","mutedText","qrHeadline","qrPlate","backgroundColor"],"sourceRoot":"../../../../src","sources":["ui/components/oxyAuthChooserStyles.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA;AACA,MAAMC,WAAW,GAAG,SAAS;;AAE7B;AACA;AACA;AACA;AACA;AACO,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAGE,uBAAU,CAACC,MAAM,CAAC;EACjDC,IAAI,EAAE;IACJC,KAAK,EAAE,MAAM;IACbC,GAAG,EAAE;EACP,CAAC;EACDC,UAAU,EAAE;IACVC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBH,GAAG,EAAE,EAAE;IACPI,WAAW,EAAER,uBAAU,CAACS,aAAa;IACrCC,YAAY,EAAE,EAAE;IAChBC,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE;EACrB,CAAC;EACDC,WAAW,EAAE;IACXC,OAAO,EAAE;EACX,CAAC;EACDC,UAAU,EAAE;IACVL,YAAY,EAAE,IAAI;IAClBF,WAAW,EAAE,CAAC;IACdQ,OAAO,EAAE;EACX,CAAC;EACDC,OAAO,EAAE;IACPC,IAAI,EAAE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AAE,QAAQ;IACxBzC,GAAG,EAAE,EAAE;IACPO,eAAe,EAAE;EACnB,CAAC;EACDgD,SAAS,EAAE;IACTtC,QAAQ,EAAE,EAAE;IACZoB,SAAS,EAAE;EACb,CAAC;EACDmB,UAAU,EAAE;IACVvC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBmB,SAAS,EAAE;EACb,CAAC;EACDoB,OAAO,EAAE;IACP7C,OAAO,EAAE,EAAE;IACXN,YAAY,EAAE,EAAE;IAChBoD,eAAe,EAAEjE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -3,20 +3,71 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.PHOTOS_PER_ROW = void 0;
|
|
7
|
+
exports.chunkPhotos = chunkPhotos;
|
|
6
8
|
exports.default = void 0;
|
|
7
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
10
|
var _reactNative = require("react-native");
|
|
11
|
+
var _reactQuery = require("@tanstack/react-query");
|
|
9
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
13
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
+
/** Stable empty map so an unresolved query yields a referentially-stable value. */
|
|
15
|
+
const EMPTY_DIMENSIONS = {};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Measure the intrinsic size of every photo whose thumbnail URL has resolved,
|
|
19
|
+
* via `Image.getSize`. Pure/async (no React state) so it can be a React Query
|
|
20
|
+
* `queryFn`. Photos without a resolved URL are skipped and re-measured on the
|
|
21
|
+
* next signature change; a load error falls back to 1×1 (→ the 4/3 default).
|
|
22
|
+
*/
|
|
23
|
+
async function measurePhotoDimensions(photos, getThumbUrl) {
|
|
24
|
+
const measured = {};
|
|
25
|
+
await Promise.all(photos.map(photo => new Promise(resolve => {
|
|
26
|
+
const url = getThumbUrl(photo);
|
|
27
|
+
if (!url) {
|
|
28
|
+
resolve();
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
_reactNative.Image.getSize(url, (width, height) => {
|
|
32
|
+
measured[photo.id] = {
|
|
33
|
+
width,
|
|
34
|
+
height
|
|
35
|
+
};
|
|
36
|
+
resolve();
|
|
37
|
+
}, () => {
|
|
38
|
+
measured[photo.id] = {
|
|
39
|
+
width: 1,
|
|
40
|
+
height: 1
|
|
41
|
+
};
|
|
42
|
+
resolve();
|
|
43
|
+
});
|
|
44
|
+
})));
|
|
45
|
+
return measured;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Fixed photos-per-row for the justified grid (Apple Photos-style trio). */
|
|
49
|
+
const PHOTOS_PER_ROW = exports.PHOTOS_PER_ROW = 3;
|
|
50
|
+
|
|
51
|
+
/** Chunk a photo list into fixed-length rows (last row may be short). */
|
|
52
|
+
function chunkPhotos(photos, perRow) {
|
|
53
|
+
const rows = [];
|
|
54
|
+
for (let i = 0; i < photos.length; i += perRow) {
|
|
55
|
+
rows.push(photos.slice(i, i + perRow));
|
|
56
|
+
}
|
|
57
|
+
return rows;
|
|
58
|
+
}
|
|
11
59
|
/**
|
|
12
60
|
* Responsive justified photo grid that stretches to the provided containerWidth.
|
|
13
61
|
* Uses flex rows with proportional children widths instead of absolute pixel widths so it always fills.
|
|
62
|
+
*
|
|
63
|
+
* Owns its own intrinsic-dimension measurement: it calls `Image.getSize` on each
|
|
64
|
+
* photo's resolved thumbnail URL and reflows once real aspect ratios are known
|
|
65
|
+
* (falling back to 4/3 until then). Measurement re-runs whenever a photo is added
|
|
66
|
+
* OR its (asynchronously-resolved) private-safe URL first appears.
|
|
14
67
|
*/
|
|
15
68
|
const JustifiedPhotoGrid = ({
|
|
16
69
|
photos,
|
|
17
|
-
|
|
18
|
-
loadPhotoDimensions,
|
|
19
|
-
createJustifiedRows,
|
|
70
|
+
getThumbUrl,
|
|
20
71
|
renderJustifiedPhotoItem,
|
|
21
72
|
textColor,
|
|
22
73
|
containerWidth: explicitWidth,
|
|
@@ -40,11 +91,24 @@ const JustifiedPhotoGrid = ({
|
|
|
40
91
|
const w = e.nativeEvent.layout.width;
|
|
41
92
|
setMeasuredWidth(prev => prev === w ? prev : w);
|
|
42
93
|
}, [resolvedExplicitWidth]);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
94
|
+
|
|
95
|
+
// Signature of every photo id + its currently-resolved URL — the measurement
|
|
96
|
+
// query key. A private tile's URL resolves asynchronously after it enters the
|
|
97
|
+
// list, so keying on THIS (not just the photo set) re-measures the moment a
|
|
98
|
+
// URL lands, not just when photos are added.
|
|
99
|
+
const urlSignature = (0, _react.useMemo)(() => photos.map(p => `${p.id}:${getThumbUrl(p) ?? ''}`).join('|'), [photos, getThumbUrl]);
|
|
100
|
+
|
|
101
|
+
// Intrinsic dimensions via React Query (no effect): re-runs when the signature
|
|
102
|
+
// changes and reflows the justified rows. `keepPreviousData` holds the last
|
|
103
|
+
// measured map during a re-measure so tiles never flash back to the 4/3 default.
|
|
104
|
+
const dimensionsQuery = (0, _reactQuery.useQuery)({
|
|
105
|
+
queryKey: ['justifiedPhotoDimensions', urlSignature],
|
|
106
|
+
queryFn: () => measurePhotoDimensions(photos, getThumbUrl),
|
|
107
|
+
placeholderData: _reactQuery.keepPreviousData,
|
|
108
|
+
staleTime: Number.POSITIVE_INFINITY,
|
|
109
|
+
gcTime: 5 * 60 * 1000
|
|
110
|
+
});
|
|
111
|
+
const photoDimensions = dimensionsQuery.data ?? EMPTY_DIMENSIONS;
|
|
48
112
|
|
|
49
113
|
// Group photos by date first
|
|
50
114
|
const photosByDate = (0, _react.useMemo)(() => {
|
|
@@ -72,10 +136,9 @@ const JustifiedPhotoGrid = ({
|
|
|
72
136
|
onLayout: onLayoutContainer,
|
|
73
137
|
children: sortedDates.map(date => {
|
|
74
138
|
const dayPhotos = photosByDate[date];
|
|
75
|
-
//
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
const rows = dateWidth > 0 ? createJustifiedRows(dayPhotos, dateWidth) : [];
|
|
139
|
+
// Fall back to the overall width until this section is measured.
|
|
140
|
+
const dateWidth = dateWidths[date] ?? effectiveWidth;
|
|
141
|
+
const rows = dateWidth > 0 ? chunkPhotos(dayPhotos, PHOTOS_PER_ROW) : [];
|
|
79
142
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
80
143
|
style: {
|
|
81
144
|
marginBottom: 24,
|
|
@@ -100,7 +163,7 @@ const JustifiedPhotoGrid = ({
|
|
|
100
163
|
width: '100%'
|
|
101
164
|
},
|
|
102
165
|
children: rows.map((row, rowIndex) => {
|
|
103
|
-
//
|
|
166
|
+
// Total aspect ratio of the row, using measured dims (fallback 4/3).
|
|
104
167
|
const aspects = row.map(p => {
|
|
105
168
|
const dims = photoDimensions[p.id];
|
|
106
169
|
return dims ? dims.width / dims.height : 4 / 3;
|
|
@@ -108,32 +171,29 @@ const JustifiedPhotoGrid = ({
|
|
|
108
171
|
const totalAspect = aspects.reduce((a, b) => a + b, 0);
|
|
109
172
|
const gapsTotal = gap * (row.length - 1);
|
|
110
173
|
const availableWidth = dateWidth - gapsTotal;
|
|
111
|
-
// Ideal height that perfectly fills width when preserving aspect ratios
|
|
174
|
+
// Ideal height that perfectly fills width when preserving aspect ratios.
|
|
112
175
|
const idealHeight = availableWidth / totalAspect;
|
|
113
|
-
//
|
|
176
|
+
// Clamp to min/max, then distribute the leftover/overflow proportionally.
|
|
114
177
|
let rowHeight = idealHeight;
|
|
115
|
-
let widthAdjustment = 0;
|
|
178
|
+
let widthAdjustment = 0;
|
|
116
179
|
if (idealHeight < minRowHeight) {
|
|
117
180
|
rowHeight = minRowHeight;
|
|
118
|
-
widthAdjustment = availableWidth - rowHeight * totalAspect;
|
|
181
|
+
widthAdjustment = availableWidth - rowHeight * totalAspect;
|
|
119
182
|
} else if (idealHeight > maxRowHeight) {
|
|
120
183
|
rowHeight = maxRowHeight;
|
|
121
184
|
widthAdjustment = availableWidth - rowHeight * totalAspect;
|
|
122
185
|
}
|
|
123
|
-
|
|
124
|
-
// Pre-compute widths maintaining aspect ratios
|
|
125
186
|
let widths = aspects.map(ar => ar * rowHeight);
|
|
126
|
-
// If we have widthAdjustment (due to clamping) distribute proportionally so row still fills exactly
|
|
127
187
|
if (widthAdjustment !== 0) {
|
|
128
188
|
const widthSum = widths.reduce((a, b) => a + b, 0);
|
|
129
189
|
widths = widths.map(w => w + w / widthSum * widthAdjustment);
|
|
130
190
|
}
|
|
131
191
|
|
|
132
|
-
//
|
|
192
|
+
// Correct any rounding drift on the last tile so the row fills exactly.
|
|
133
193
|
const widthSumRounded = widths.reduce((a, b) => a + b, 0);
|
|
134
194
|
const roundingDiff = availableWidth - widthSumRounded;
|
|
135
195
|
if (Math.abs(roundingDiff) > 0.5) {
|
|
136
|
-
widths[widths.length - 1] += roundingDiff;
|
|
196
|
+
widths[widths.length - 1] += roundingDiff;
|
|
137
197
|
}
|
|
138
198
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
139
199
|
style: {
|
|
@@ -152,7 +212,7 @@ const JustifiedPhotoGrid = ({
|
|
|
152
212
|
children: renderJustifiedPhotoItem(p, photoWidth, rowHeight, i === row.length - 1)
|
|
153
213
|
}, p.id);
|
|
154
214
|
})
|
|
155
|
-
}, rowIndex);
|
|
215
|
+
}, row[0]?.id ?? rowIndex);
|
|
156
216
|
})
|
|
157
217
|
})]
|
|
158
218
|
}, date);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactQuery","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","EMPTY_DIMENSIONS","measurePhotoDimensions","photos","getThumbUrl","measured","Promise","all","map","photo","resolve","url","Image","getSize","width","height","id","PHOTOS_PER_ROW","exports","chunkPhotos","perRow","rows","length","push","slice","JustifiedPhotoGrid","renderJustifiedPhotoItem","textColor","containerWidth","explicitWidth","gap","minRowHeight","maxRowHeight","dateFormatLocale","windowWidth","useWindowDimensions","measuredWidth","setMeasuredWidth","useState","resolvedExplicitWidth","resolvedMeasuredWidth","effectiveWidth","onLayoutContainer","useCallback","w","nativeEvent","layout","prev","urlSignature","useMemo","p","join","dimensionsQuery","useQuery","queryKey","queryFn","placeholderData","keepPreviousData","staleTime","Number","POSITIVE_INFINITY","gcTime","photoDimensions","data","photosByDate","reduce","groups","date","Date","uploadDate","toDateString","sortedDates","keys","sort","a","b","getTime","dateWidths","setDateWidths","onLayoutDate","jsx","View","style","onLayout","children","dayPhotos","dateWidth","jsxs","marginBottom","Text","fontSize","fontWeight","color","toLocaleDateString","weekday","year","month","day","row","rowIndex","aspects","dims","totalAspect","gapsTotal","availableWidth","idealHeight","rowHeight","widthAdjustment","widths","ar","widthSum","widthSumRounded","roundingDiff","Math","abs","flexDirection","photoWidth","marginRight","_default","React","memo"],"sourceRoot":"../../../../../src","sources":["ui/components/photogrid/JustifiedPhotoGrid.tsx"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;A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AEkE,UAAU,EAAEV,SAAS,EAAErH,CAAC,KAAK6G,GAAG,CAAC5E,MAAM,GAAG,CAAC;gBAAC,GAHpE4B,CAAC,CAAClC,EAIL,CAAC;cAEf,CAAC;YAAC,GAXKkF,GAAG,CAAC,CAAC,CAAC,EAAElF,EAAE,IAAImF,QAYnB,CAAC;UAEf,CAAC;QAAC,CACA,CAAC;MAAA,GA3DFhC,IA4DH,CAAC;IAEf,CAAC;EAAC,CACA,CAAC;AAEf,CAAC;AAAC,IAAAmD,QAAA,GAAApG,OAAA,CAAA1B,OAAA,gBAEa+H,cAAK,CAACC,IAAI,CAAC/F,kBAAkB,CAAC","ignoreList":[]}
|
|
@@ -594,6 +594,28 @@ const OxyProvider = ({
|
|
|
594
594
|
// reactive `accountDialogOpen` mirror below: presenting flips it true, the
|
|
595
595
|
// surface settling (`result.finally`) flips it false — no other write site.
|
|
596
596
|
const accountDialogSurfaceRef = (0, _react.useRef)(null);
|
|
597
|
+
|
|
598
|
+
// When the account dialog is shown by MORPHING an already-open route surface
|
|
599
|
+
// (e.g. ManageAccount → the account switcher) it is pushed as a frame ONTO that
|
|
600
|
+
// surface rather than presented as its own. This holds that host surface so the
|
|
601
|
+
// close path can pop the AccountDialog frame back to it. `null` when the dialog
|
|
602
|
+
// is its OWN detached surface (opened cold, with no surface underneath).
|
|
603
|
+
const accountDialogHostRef = (0, _react.useRef)(null);
|
|
604
|
+
|
|
605
|
+
// The single teardown for the account dialog wherever it lives: pop the morphed
|
|
606
|
+
// frame back to its host surface (reshaping Manage ← switcher), or dismiss the
|
|
607
|
+
// detached surface (whose settle then flips `accountDialogOpen`). Reads only
|
|
608
|
+
// stable refs + `setAccountDialogOpen`, so its identity never changes.
|
|
609
|
+
const dismissAccountDialogSurface = (0, _react.useCallback)(() => {
|
|
610
|
+
const host = accountDialogHostRef.current;
|
|
611
|
+
if (host) {
|
|
612
|
+
accountDialogHostRef.current = null;
|
|
613
|
+
setAccountDialogOpen(false);
|
|
614
|
+
host.goBack();
|
|
615
|
+
return;
|
|
616
|
+
}
|
|
617
|
+
accountDialogSurfaceRef.current?.dismiss();
|
|
618
|
+
}, []);
|
|
597
619
|
const accountDialogControllerRef = (0, _react.useRef)(null);
|
|
598
620
|
if (!accountDialogControllerRef.current) {
|
|
599
621
|
accountDialogControllerRef.current = (0, _core.createAccountDialogController)({
|
|
@@ -607,11 +629,9 @@ const OxyProvider = ({
|
|
|
607
629
|
commitSession: session => handleWebSessionRef.current(session),
|
|
608
630
|
commitSwitchedSession: session => commitSwitchedSessionRef.current(session),
|
|
609
631
|
onSignedIn: () => {
|
|
610
|
-
//
|
|
611
|
-
//
|
|
612
|
-
|
|
613
|
-
// flip here.
|
|
614
|
-
accountDialogSurfaceRef.current?.dismiss();
|
|
632
|
+
// Close the dialog: pop the morphed frame back to its host surface, or
|
|
633
|
+
// dismiss the detached surface (whose settle flips `accountDialogOpen`).
|
|
634
|
+
dismissAccountDialogSurface();
|
|
615
635
|
},
|
|
616
636
|
openUrl: url => {
|
|
617
637
|
if ((0, _isWebBrowser.isWebBrowser)()) {
|
|
@@ -635,44 +655,60 @@ const OxyProvider = ({
|
|
|
635
655
|
}
|
|
636
656
|
const accountDialogController = accountDialogControllerRef.current;
|
|
637
657
|
const openAccountDialog = (0, _react.useCallback)(view => {
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
//
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
if (accountDialogSurfaceRef.current === instance) {
|
|
662
|
-
accountDialogSurfaceRef.current = null;
|
|
663
|
-
setAccountDialogOpen(false);
|
|
664
|
-
}
|
|
658
|
+
const nextView = view ?? 'accounts';
|
|
659
|
+
accountDialogControllerRef.current?.setView(nextView);
|
|
660
|
+
|
|
661
|
+
// Its own detached surface is already open → just re-point the view above.
|
|
662
|
+
if (accountDialogSurfaceRef.current) {
|
|
663
|
+
setAccountDialogOpen(true);
|
|
664
|
+
return;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
// When a route surface (e.g. ManageAccount) is already open, MORPH it in
|
|
668
|
+
// place: push the AccountDialog as a frame ONTO that surface, so the panel
|
|
669
|
+
// reshapes from that surface to the switcher and a back returns to it. With no
|
|
670
|
+
// surface open (opened cold from a sign-in button), present the dialog as its
|
|
671
|
+
// OWN detached surface — kept OUT of the `showBottomSheet` route-surface
|
|
672
|
+
// lineage so closing the bottom-sheet session never touches it and vice-versa.
|
|
673
|
+
// `navigate` is idempotent for the top frame (it replaces rather than
|
|
674
|
+
// duplicates), so calling this while already morphed in just re-points the
|
|
675
|
+
// view, and calling it after a back re-pushes the frame — no stale guard.
|
|
676
|
+
const host = (0, _surfaces.topRouteSurface)();
|
|
677
|
+
if (host) {
|
|
678
|
+
accountDialogHostRef.current = host;
|
|
679
|
+
host.navigate('AccountDialog', {
|
|
680
|
+
initialView: nextView
|
|
665
681
|
});
|
|
682
|
+
setAccountDialogOpen(true);
|
|
683
|
+
return;
|
|
666
684
|
}
|
|
685
|
+
const instance = (0, _surfaces.presentDetached)('AccountDialog', {
|
|
686
|
+
initialView: nextView
|
|
687
|
+
}, {
|
|
688
|
+
placement: {
|
|
689
|
+
base: 'bottom',
|
|
690
|
+
md: 'center'
|
|
691
|
+
},
|
|
692
|
+
dismissOnBackdrop: false,
|
|
693
|
+
maxWidth: 420
|
|
694
|
+
});
|
|
695
|
+
accountDialogSurfaceRef.current = instance;
|
|
696
|
+
// The surface settling is the ONE place `accountDialogOpen` flips false for
|
|
697
|
+
// the detached path — covering every dismiss (close button, `onSignedIn`,
|
|
698
|
+
// programmatic `closeAccountDialog`, host unmount). The morphed path clears
|
|
699
|
+
// its own state in `dismissAccountDialogSurface`.
|
|
700
|
+
instance.result.finally(() => {
|
|
701
|
+
if (accountDialogSurfaceRef.current === instance) {
|
|
702
|
+
accountDialogSurfaceRef.current = null;
|
|
703
|
+
setAccountDialogOpen(false);
|
|
704
|
+
}
|
|
705
|
+
});
|
|
667
706
|
setAccountDialogOpen(true);
|
|
668
707
|
}, []);
|
|
669
708
|
const closeAccountDialog = (0, _react.useCallback)(() => {
|
|
670
709
|
accountDialogControllerRef.current?.cancelSignIn();
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
// the single source of truth, so a manual write would be a second authority.
|
|
674
|
-
accountDialogSurfaceRef.current?.dismiss();
|
|
675
|
-
}, []);
|
|
710
|
+
dismissAccountDialogSurface();
|
|
711
|
+
}, [dismissAccountDialogSurface]);
|
|
676
712
|
|
|
677
713
|
// Start driving the dialog on mount; tear it down on unmount.
|
|
678
714
|
(0, _react.useEffect)(() => {
|