@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["queryKeys","accounts","all","lists","list","sessionIds","details","detail","sessionId","current","settings","users","userIds","userId","detailForViewer","viewerId","byUsername","username","trim","toLowerCase","profile","sessions","active","device","deviceId","devices","accountScope","privacy","security","activity","limit","offset","eventType","recent","infinite","authMethods","storage","usage","connectedApps","follow","counts","payments","subscription","history","wallet","walletTransactions","invalidateAccountQueries","queryClient","invalidateQueries","queryKey","invalidateUserQueries","invalidateSessionQueries","invalidateDeviceQueries","invalidatePrivacyQueries","invalidateSecurityQueries","invalidateStorageQueries","invalidateAuthMethodsQueries","invalidatePaymentsQueries","invalidateConnectedAppsQueries"],"sourceRoot":"../../../../../src","sources":["ui/hooks/queries/queryKeys.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,MAAMA,SAAS,GAAG;EACvB;EACAC,QAAQ,EAAE;IACRC,GAAG,EAAE,CAAC,UAAU,CAAU;IAC1BC,KAAK,EAAEA,CAAA,KAAM,CAAC,GAAGH,SAAS,CAACC,QAAQ,CAACC,GAAG,EAAE,MAAM,CAAU;IACzDE,IAAI,EAAGC,UAAoB,IAAK,CAAC,GAAGL,SAAS,CAACC,QAAQ,CAACE,KAAK,CAAC,CAAC,EAAEE,UAAU,CAAU;IACpFC,OAAO,EAAEA,CAAA,KAAM,CAAC,GAAGN,SAAS,CAACC,QAAQ,CAACC,GAAG,EAAE,QAAQ,CAAU;IAC7DK,MAAM,EAAGC,SAAiB,IAAK,CAAC,GAAGR,SAAS,CAACC,QAAQ,CAACK,OAAO,CAAC,CAAC,EAAEE,SAAS,CAAU;IACpFC,OAAO,EAAGD,SAAyB,IACjCA,SAAS,GACJ,CAAC,GAAGR,SAAS,CAACC,QAAQ,CAACC,GAAG,EAAE,SAAS,EAAEM,SAAS,CAAC,GACjD,CAAC,GAAGR,SAAS,CAACC,QAAQ,CAACC,GAAG,EAAE,SAAS,CAAW;IACvDQ,QAAQ,EAAEA,CAAA,KAAM,CAAC,GAAGV,SAAS,CAACC,QAAQ,CAACC,GAAG,EAAE,UAAU;EACxD,CAAC;EAED;EACAS,KAAK,EAAE;IACLT,GAAG,EAAE,CAAC,OAAO,CAAU;IACvBC,KAAK,EAAEA,CAAA,KAAM,CAAC,GAAGH,SAAS,CAACW,KAAK,CAACT,GAAG,EAAE,MAAM,CAAU;IACtDE,IAAI,EAAGQ,OAAiB,IAAK,CAAC,GAAGZ,SAAS,CAACW,KAAK,CAACR,KAAK,CAAC,CAAC,EAAES,OAAO,CAAU;IAC3EN,OAAO,EAAEA,CAAA,K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IACvDI,QAAQ,EAAEA,CAACJ,KAAa,EAAEE,SAAkB,KAC1C,CAAC,GAAGhC,SAAS,CAAC4B,QAAQ,CAAC1B,GAAG,EAAE,UAAU,EAAE4B,KAAK,EAAEE,SAAS;EAC5D,CAAC;EAED;EACAG,WAAW,EAAE;IACXjC,GAAG,EAAE,CAAC,aAAa,CAAU;IAC7BE,IAAI,EAAGS,MAAe,IAAK,CAAC,GAAGb,SAAS,CAACmC,WAAW,CAACjC,GAAG,EAAE,MAAM,EAAEW,MAAM,IAAI,SAAS;EACvF,CAAC;EAED;EACAuB,OAAO,EAAE;IACPlC,GAAG,EAAE,CAAC,SAAS,CAAU;IACzBmC,KAAK,EAAGX,YAAqB,IAAK,CAAC,GAAG1B,SAAS,CAACoC,OAAO,CAAClC,GAAG,EAAE,OAAO,EAAEwB,YAAY;EACpF,CAAC;EAED;EACAY,aAAa,EAAE;
|
|
1
|
+
{"version":3,"names":["queryKeys","accounts","all","lists","list","sessionIds","details","detail","sessionId","current","settings","users","userIds","userId","detailForViewer","viewerId","byUsername","username","trim","toLowerCase","profile","sessions","active","device","deviceId","devices","accountScope","privacy","security","activity","limit","offset","eventType","recent","infinite","authMethods","storage","usage","files","ownerId","connectedApps","follow","counts","payments","subscription","history","wallet","walletTransactions","invalidateAccountQueries","queryClient","invalidateQueries","queryKey","invalidateUserQueries","invalidateSessionQueries","invalidateDeviceQueries","invalidatePrivacyQueries","invalidateSecurityQueries","invalidateStorageQueries","invalidateAuthMethodsQueries","invalidatePaymentsQueries","invalidateConnectedAppsQueries","invalidateFileQueries"],"sourceRoot":"../../../../../src","sources":["ui/hooks/queries/queryKeys.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,MAAMA,SAAS,GAAG;EACvB;EACAC,QAAQ,EAAE;IACRC,GAAG,EAAE,CAAC,UAAU,CAAU;IAC1BC,KAAK,EAAEA,CAAA,KAAM,CAAC,GAAGH,SAAS,CAACC,QAAQ,CA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C1B;EAAI,CAAC,CAAC;AACrE,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMuD,wBAAwB,GAAIR,WAAwB,IAAW;EAC1EA,WAAW,CAACC,iBAAiB,CAAC;IAAEC,QAAQ,EAAEnD,SAAS,CAACoC,OAAO,CAAClC;EAAI,CAAC,CAAC;AACpE,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMwD,4BAA4B,GAAIT,WAAwB,IAAW;EAC9EA,WAAW,CAACC,iBAAiB,CAAC;IAAEC,QAAQ,EAAEnD,SAAS,CAACmC,WAAW,CAACjC;EAAI,CAAC,CAAC;AACxE,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMyD,yBAAyB,GAAIV,WAAwB,IAAW;EAC3EA,WAAW,CAACC,iBAAiB,CAAC;IAAEC,QAAQ,EAAEnD,SAAS,CAAC2C,QAAQ,CAACzC;EAAI,CAAC,CAAC;AACrE,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAM0D,8BAA8B,GAAIX,WAAwB,IAAW;EAChFA,WAAW,CAACC,iBAAiB,CAAC;IAAEC,QAAQ,EAAEnD,SAAS,CAACwC,aAAa,CAACtC;EAAI,CAAC,CAAC;AAC1E,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAM2D,qBAAqB,GAAIZ,WAAwB,IAAW;EACvEA,WAAW,CAACC,iBAAiB,CAAC;IAAEC,QAAQ,EAAEnD,SAAS,CAACsC,KAAK,CAACpC;EAAI,CAAC,CAAC;AAClE,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* User file-library queries + cache helpers.
|
|
5
|
+
*
|
|
6
|
+
* The file list is owned by React Query (`useInfiniteQuery`), NOT a zustand
|
|
7
|
+
* store: server pages live in the query cache, and every optimistic mutation
|
|
8
|
+
* (upload / delete / visibility) edits that cache via the pure `*InCache`
|
|
9
|
+
* helpers below. The `queryFn` is side-effect-free — it only fetches and maps a
|
|
10
|
+
* page. This is what lets the file manager stay effect-free while preserving
|
|
11
|
+
* infinite scroll, pull-to-refresh, and optimistic upload reconciliation.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { useInfiniteQuery } from '@tanstack/react-query';
|
|
15
|
+
import { useOxy } from "../../context/OxyContext.js";
|
|
16
|
+
import { queryKeys } from "./queryKeys.js";
|
|
17
|
+
|
|
18
|
+
/** Files fetched per page. */
|
|
19
|
+
export const FILES_PAGE_SIZE = 40;
|
|
20
|
+
|
|
21
|
+
/** Raw file record as returned by `oxyServices.listUserFiles` / `assetUpload`. */
|
|
22
|
+
|
|
23
|
+
/** One page of the infinite file list. */
|
|
24
|
+
|
|
25
|
+
/** Normalize a raw API file record into the client `FileMetadata` shape. */
|
|
26
|
+
export function mapRawFileToMetadata(raw) {
|
|
27
|
+
return {
|
|
28
|
+
id: raw.id,
|
|
29
|
+
filename: raw.originalName ?? raw.sha256 ?? '',
|
|
30
|
+
contentType: raw.mime ?? '',
|
|
31
|
+
length: raw.size ?? 0,
|
|
32
|
+
chunkSize: 0,
|
|
33
|
+
uploadDate: raw.createdAt ?? '',
|
|
34
|
+
metadata: raw.metadata ?? {},
|
|
35
|
+
variants: raw.variants ?? []
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Infinite-paginated list of the owner's files. Fires on mount and whenever
|
|
41
|
+
* `ownerId` changes (a new key); `staleTime: 0` reloads on every open. The
|
|
42
|
+
* rendered list is `data.pages.flatMap(p => p.files)`.
|
|
43
|
+
*/
|
|
44
|
+
export const useUserFilesInfinite = ownerId => {
|
|
45
|
+
const {
|
|
46
|
+
oxyServices
|
|
47
|
+
} = useOxy();
|
|
48
|
+
return useInfiniteQuery({
|
|
49
|
+
queryKey: queryKeys.files.list(ownerId),
|
|
50
|
+
queryFn: async ({
|
|
51
|
+
pageParam
|
|
52
|
+
}) => {
|
|
53
|
+
const offset = typeof pageParam === 'number' ? pageParam : 0;
|
|
54
|
+
const response = await oxyServices.listUserFiles(FILES_PAGE_SIZE, offset);
|
|
55
|
+
const raw = response.files ?? [];
|
|
56
|
+
const files = raw.map(mapRawFileToMetadata);
|
|
57
|
+
return {
|
|
58
|
+
files,
|
|
59
|
+
total: response.total ?? offset + files.length,
|
|
60
|
+
hasMore: Boolean(response.hasMore),
|
|
61
|
+
nextOffset: offset + FILES_PAGE_SIZE
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
initialPageParam: 0,
|
|
65
|
+
getNextPageParam: lastPage => lastPage.hasMore ? lastPage.nextOffset : undefined,
|
|
66
|
+
enabled: Boolean(ownerId),
|
|
67
|
+
staleTime: 0,
|
|
68
|
+
refetchOnWindowFocus: false
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// --- Pure cache transforms (optimistic updates) -----------------------------
|
|
73
|
+
// Each edits the cached `InfiniteData` for one owner. All no-op when nothing is
|
|
74
|
+
// cached yet (e.g. an upload before the first page loads) — the subsequent
|
|
75
|
+
// `invalidateQueries` reconcile then brings the authoritative record.
|
|
76
|
+
|
|
77
|
+
const fileListKey = ownerId => queryKeys.files.list(ownerId);
|
|
78
|
+
const mapPages = (data, fn) => ({
|
|
79
|
+
...data,
|
|
80
|
+
pages: data.pages.map(page => ({
|
|
81
|
+
...page,
|
|
82
|
+
files: fn(page.files)
|
|
83
|
+
}))
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
/** Prepend an (optimistic) file to the first page. */
|
|
87
|
+
export function prependFileToCache(queryClient, ownerId, file) {
|
|
88
|
+
queryClient.setQueryData(fileListKey(ownerId), data => {
|
|
89
|
+
if (!data || data.pages.length === 0) return data;
|
|
90
|
+
return {
|
|
91
|
+
...data,
|
|
92
|
+
pages: data.pages.map((page, index) => index === 0 ? {
|
|
93
|
+
...page,
|
|
94
|
+
files: [file, ...page.files]
|
|
95
|
+
} : page)
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Remove a file (by id) from every page. */
|
|
101
|
+
export function removeFileFromCache(queryClient, ownerId, fileId) {
|
|
102
|
+
queryClient.setQueryData(fileListKey(ownerId), data => data ? mapPages(data, files => files.filter(f => f.id !== fileId)) : data);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** Swap an optimistic file (by id) for its persisted counterpart. */
|
|
106
|
+
export function replaceFileInCache(queryClient, ownerId, oldId, newFile) {
|
|
107
|
+
queryClient.setQueryData(fileListKey(ownerId), data => data ? mapPages(data, files => files.map(f => f.id === oldId ? newFile : f)) : data);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** Shallow-merge a metadata patch into a cached file (e.g. visibility change). */
|
|
111
|
+
export function patchFileMetadataInCache(queryClient, ownerId, fileId, metadataPatch) {
|
|
112
|
+
queryClient.setQueryData(fileListKey(ownerId), data => data ? mapPages(data, files => files.map(f => f.id === fileId ? {
|
|
113
|
+
...f,
|
|
114
|
+
metadata: {
|
|
115
|
+
...f.metadata,
|
|
116
|
+
...metadataPatch
|
|
117
|
+
}
|
|
118
|
+
} : f)) : data);
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=useFileQueries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useInfiniteQuery","useOxy","queryKeys","FILES_PAGE_SIZE","mapRawFileToMetadata","raw","id","filename","originalName","sha256","contentType","mime","length","size","chunkSize","uploadDate","createdAt","metadata","variants","useUserFilesInfinite","ownerId","oxyServices","queryKey","files","list","queryFn","pageParam","offset","response","listUserFiles","map","total","hasMore","Boolean","nextOffset","initialPageParam","getNextPageParam","lastPage","undefined","enabled","staleTime","refetchOnWindowFocus","fileListKey","mapPages","data","fn","pages","page","prependFileToCache","queryClient","file","setQueryData","index","removeFileFromCache","fileId","filter","f","replaceFileInCache","oldId","newFile","patchFileMetadataInCache","metadataPatch"],"sourceRoot":"../../../../../src","sources":["ui/hooks/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ClD,EAAE,KAAKgD,MAAM,GACT;IAAE,GAAGE,CAAC;IAAEvC,QAAQ,EAAE;MAAE,GAAGuC,CAAC,CAACvC,QAAQ;MAAE,GAAG4C;IAAc;EAA8B,CAAC,GACnFL,CACV,CACJ,CAAC,GACCZ,IACV,CAAC;AACL","ignoreList":[]}
|
|
@@ -3,25 +3,30 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Avatar Picker Hook
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* The ONE write path for a user's profile picture. It owns no UI: the whole
|
|
7
|
+
* choose-and-crop experience is a single surface.
|
|
7
8
|
*
|
|
8
|
-
* Flow (typed
|
|
9
|
-
* 1. `
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
9
|
+
* Flow (typed promise over the shared surface stack — no callback props):
|
|
10
|
+
* 1. `openWithinOrPresent('ChangeAvatar')` opens the source list (device gallery,
|
|
11
|
+
* camera, existing Oxy files, remove) — MORPHING into the caller's surface
|
|
12
|
+
* when one is open, else presenting cold. Whichever source the user picks, it
|
|
13
|
+
* navigates WITHIN to the crop editor — so there is exactly one cropper and
|
|
14
|
+
* one entry into it.
|
|
15
|
+
* 2. The surface resolves with the cropped JPEG, with `{ removed: true }` when
|
|
16
|
+
* the user removed their photo, or `undefined` when they cancelled.
|
|
17
|
+
* 3. A crop is uploaded as a NEW file via `oxyServices.assetUpload` and set as
|
|
18
|
+
* the avatar; a removal clears the avatar field.
|
|
15
19
|
*
|
|
16
|
-
* `expo-image-manipulator` is required for the crop step
|
|
17
|
-
*
|
|
20
|
+
* `expo-image-manipulator` is required for the crop step and `expo-image-picker`
|
|
21
|
+
* for the device/camera sources (both declared as optional peers in the
|
|
22
|
+
* consuming app) — see AvatarCropScreen / ChangeAvatarScreen.
|
|
18
23
|
*/
|
|
19
24
|
|
|
20
25
|
import { useCallback } from 'react';
|
|
21
26
|
import { translate, updateAvatarVisibility } from '@oxyhq/core';
|
|
22
27
|
import { toast } from '@oxyhq/bloom';
|
|
23
28
|
import { updateProfileWithAvatar } from "../utils/avatarUtils.js";
|
|
24
|
-
import {
|
|
29
|
+
import { openWithinOrPresent } from "../navigation/surfaces.js";
|
|
25
30
|
|
|
26
31
|
/** Upload result shape returned by oxyServices.assetUpload (single-file path). */
|
|
27
32
|
|
|
@@ -64,50 +69,33 @@ export function useAvatarPicker({
|
|
|
64
69
|
toast.error(message || translate(currentLanguage ?? undefined, 'editProfile.toasts.updateAvatarFailed') || 'Failed to update avatar');
|
|
65
70
|
}
|
|
66
71
|
}, [activeSessionId, currentLanguage, oxyServices, queryClient]);
|
|
67
|
-
const openAvatarPicker = useCallback(async () => {
|
|
68
|
-
// 1. Present the image-only picker; it dismisses with the picked file when
|
|
69
|
-
// the user taps one, or `undefined` if they cancel.
|
|
70
|
-
const file = await surfaces.present('FileManagement', {
|
|
71
|
-
selectMode: true,
|
|
72
|
-
multiSelect: false,
|
|
73
|
-
disabledMimeTypes: ['video/', 'audio/', 'application/pdf']
|
|
74
|
-
});
|
|
75
|
-
if (!file) return;
|
|
76
|
-
if (!file.contentType?.startsWith('image/')) {
|
|
77
|
-
toast.error(translate(currentLanguage ?? undefined, 'editProfile.toasts.selectImage') || 'Please select an image file');
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
72
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
// the crop screen's `Image.getSize` would fail silently. `assetGetUrl`
|
|
84
|
-
// throws on failure (unlike `getFileDownloadUrlAsync`, which swallows
|
|
85
|
-
// errors and falls back to the broken public URL), so a failure surfaces
|
|
86
|
-
// a real user-facing error instead of a blank crop canvas. No variant is
|
|
87
|
-
// requested — cropping needs the original.
|
|
88
|
-
let sourceUri;
|
|
73
|
+
/** Clear the avatar so the profile falls back to the user's initials. */
|
|
74
|
+
const removeAvatar = useCallback(async () => {
|
|
89
75
|
try {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
sourceUri = resolved.url;
|
|
76
|
+
await updateProfileWithAvatar({
|
|
77
|
+
avatar: ''
|
|
78
|
+
}, oxyServices, activeSessionId, queryClient);
|
|
79
|
+
toast.success(translate(currentLanguage ?? undefined, 'editProfile.toasts.avatarRemoved'));
|
|
95
80
|
} catch (e) {
|
|
96
81
|
const message = e instanceof Error ? e.message : undefined;
|
|
97
|
-
toast.error(message || translate(currentLanguage ?? undefined, 'editProfile.toasts.
|
|
82
|
+
toast.error(message || translate(currentLanguage ?? undefined, 'editProfile.toasts.updateAvatarFailed'));
|
|
83
|
+
}
|
|
84
|
+
}, [activeSessionId, currentLanguage, oxyServices, queryClient]);
|
|
85
|
+
const openAvatarPicker = useCallback(async () => {
|
|
86
|
+
// The source list + crop editor are ONE flow. When triggered from a screen
|
|
87
|
+
// already inside a surface (EditProfile, ManageAccount, WelcomeNewUser — every
|
|
88
|
+
// current entry point), it MORPHS into that surface and pops back on finish;
|
|
89
|
+
// triggered with no surface open it presents cold. Either way it resolves with
|
|
90
|
+
// the cropped JPEG, a removal, or `undefined` when the user backs out.
|
|
91
|
+
const result = await openWithinOrPresent('ChangeAvatar');
|
|
92
|
+
if (!result) return;
|
|
93
|
+
if ('removed' in result) {
|
|
94
|
+
await removeAvatar();
|
|
98
95
|
return;
|
|
99
96
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
// with the cropped JPEG on confirm, or `undefined` if cancelled.
|
|
103
|
-
const cropped = await surfaces.present('AvatarCrop', {
|
|
104
|
-
imageUri: sourceUri
|
|
105
|
-
});
|
|
106
|
-
if (!cropped) return;
|
|
107
|
-
|
|
108
|
-
// 4. Upload + set as the user's avatar.
|
|
109
|
-
await finalizeCroppedAvatar(cropped);
|
|
110
|
-
}, [currentLanguage, finalizeCroppedAvatar, oxyServices]);
|
|
97
|
+
await finalizeCroppedAvatar(result);
|
|
98
|
+
}, [finalizeCroppedAvatar, removeAvatar]);
|
|
111
99
|
return {
|
|
112
100
|
openAvatarPicker
|
|
113
101
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","translate","updateAvatarVisibility","toast","updateProfileWithAvatar","
|
|
1
|
+
{"version":3,"names":["useCallback","translate","updateAvatarVisibility","toast","updateProfileWithAvatar","openWithinOrPresent","extractUploadedFileId","result","undefined","id","file","first","files","useAvatarPicker","oxyServices","currentLanguage","activeSessionId","queryClient","finalizeCroppedAvatar","cropped","uploadResult","assetUpload","uri","type","mime","name","Date","now","newFileId","Error","avatar","success","e","message","error","removeAvatar","openAvatarPicker"],"sourceRoot":"../../../../src","sources":["ui/hooks/useAvatarPicker.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,QAAQ,OAAO;AAEnC,SAASC,SAAS,EAAEC,sBAAsB,QAAQ,aAAa;AAE/D,SAASC,KAAK,QAAQ,cAAc;AACpC,SAASC,uBAAuB,QAAQ,yBAAsB;AAC9D,SAASC,mBAAmB,QAAQ,2BAAwB;;AAU5D;;AAOA,SAASC,qBAAqBA,CAACC,MAAqC,EAAsB;EACxF,IAAI,CAACA,MAAM,EAAE,OAAOC,SAAS;EAC7B,IAAI,OAAOD,MAAM,CAACE,EAAE,KAAK,QAAQ,EAAE,OAAOF,MAAM,CAACE,EAAE;EACnD,IAAIF,MAAM,CAACG,IAAI,EAAED,EAAE,EAAE,OAAOF,MAAM,CAACG,IAAI,CAACD,EAAE;EAC1C,MAAME,KAAK,GAAGJ,MAAM,CAACK,KAAK,GAAG,CAAC,CAAC;EAC/B,IAAID,KAAK,EAAEF,EAAE,EAAE,OAAOE,KAAK,CAACF,EAAE;EAC9B,OAAOD,SAAS;AAClB;AAEA,OAAO,SAASK,eAAeA,CAAC;EAC9BC,WAAW;EACXC,eAAe;EACfC,eAAe;EACfC;AACsB,CAAC,EAAE;EACzB;AACF;AACA;AACA;EACE,MAAMC,qB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AS,CAACc,eAAe,IAAIP,SAAS,EAAE,kCAAkC,CAC5E,CAAC;IACH,CAAC,CAAC,OAAOwB,CAAU,EAAE;MACnB,MAAMC,OAAO,GAAGD,CAAC,YAAYH,KAAK,GAAGG,CAAC,CAACC,OAAO,GAAGzB,SAAS;MAC1DL,KAAK,CAAC+B,KAAK,CACTD,OAAO,IACLhC,SAAS,CAACc,eAAe,IAAIP,SAAS,EAAE,uCAAuC,CACnF,CAAC;IACH;EACF,CAAC,EAAE,CAACQ,eAAe,EAAED,eAAe,EAAED,WAAW,EAAEG,WAAW,CAAC,CAAC;EAEhE,MAAMmB,gBAAgB,GAAGpC,WAAW,CAAC,YAAY;IAC/C;IACA;IACA;IACA;IACA;IACA,MAAMO,MAAM,GAAG,MAAMF,mBAAmB,CAAC,cAAc,CAAC;IACxD,IAAI,CAACE,MAAM,EAAE;IACb,IAAI,SAAS,IAAIA,MAAM,EAAE;MACvB,MAAM4B,YAAY,CAAC,CAAC;MACpB;IACF;IACA,MAAMjB,qBAAqB,CAACX,MAAM,CAAC;EACrC,CAAC,EAAE,CAACW,qBAAqB,EAAEiB,YAAY,CAAC,CAAC;EAEzC,OAAO;IAAEC;EAAiB,CAAC;AAC7B","ignoreList":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* useReduceMotion
|
|
5
|
+
*
|
|
6
|
+
* Reactive boolean reflecting the OS "reduce motion" accessibility preference.
|
|
7
|
+
* Wraps `AccessibilityInfo` as an external store via `useSyncExternalStore` — the
|
|
8
|
+
* effect-free, React-Compiler-safe way to read an external mutable source. The
|
|
9
|
+
* initial value is read asynchronously once (the platform API is a Promise) and
|
|
10
|
+
* cached module-side; subsequent changes arrive via the `reduceMotionChanged`
|
|
11
|
+
* event. Mirrors the `useOnlineStatus` pattern.
|
|
12
|
+
*
|
|
13
|
+
* Consumers use it to pin entrance/stagger animations off under reduce-motion.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { useSyncExternalStore } from 'react';
|
|
17
|
+
import { AccessibilityInfo } from 'react-native';
|
|
18
|
+
let cachedReduceMotion = false;
|
|
19
|
+
let initialized = false;
|
|
20
|
+
const listeners = new Set();
|
|
21
|
+
const notifyAll = () => {
|
|
22
|
+
for (const listener of listeners) listener();
|
|
23
|
+
};
|
|
24
|
+
const setCached = value => {
|
|
25
|
+
if (cachedReduceMotion === value) return;
|
|
26
|
+
cachedReduceMotion = value;
|
|
27
|
+
notifyAll();
|
|
28
|
+
};
|
|
29
|
+
const subscribeReduceMotion = notify => {
|
|
30
|
+
// Populate the cache the first time anyone subscribes (the platform read is
|
|
31
|
+
// async, so it cannot be a synchronous `getSnapshot`).
|
|
32
|
+
if (!initialized) {
|
|
33
|
+
initialized = true;
|
|
34
|
+
AccessibilityInfo.isReduceMotionEnabled().then(setCached).catch(() => {
|
|
35
|
+
// No preference available — the `false` default stands.
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
listeners.add(notify);
|
|
39
|
+
const sub = AccessibilityInfo.addEventListener('reduceMotionChanged', setCached);
|
|
40
|
+
return () => {
|
|
41
|
+
listeners.delete(notify);
|
|
42
|
+
sub.remove();
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
const getSnapshot = () => cachedReduceMotion;
|
|
46
|
+
|
|
47
|
+
// SSR/web-first paint: assume motion is allowed (no reduce) until the async read
|
|
48
|
+
// resolves — matches the prior default.
|
|
49
|
+
const getServerSnapshot = () => false;
|
|
50
|
+
export function useReduceMotion() {
|
|
51
|
+
return useSyncExternalStore(subscribeReduceMotion, getSnapshot, getServerSnapshot);
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=useReduceMotion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useSyncExternalStore","AccessibilityInfo","cachedReduceMotion","initialized","listeners","Set","notifyAll","listener","setCached","value","subscribeReduceMotion","notify","isReduceMotionEnabled","then","catch","add","sub","addEventListener","delete","remove","getSnapshot","getServerSnapshot","useReduceMotion"],"sourceRoot":"../../../../src","sources":["ui/hooks/useReduceMotion.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,oBAAoB,QAAQ,OAAO;AAC5C,SAASC,iBAAiB,QAAQ,cAAc;AAEhD,IAAIC,kBAAkB,GAAG,KAAK;AAC9B,IAAIC,WAAW,GAAG,KAAK;AACvB,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAAa,CAAC;AAEvC,MAAMC,SAAS,GAAGA,CAAA,KAAY;EAC1B,KAAK,MAAMC,QAAQ,IAAIH,SAAS,EAAEG,QAAQ,CAAC,CAAC;AAChD,CAAC;AAED,MAAMC,SAAS,GAAIC,KAAc,IAAW;EACxC,IAAIP,kBAAkB,KAAKO,KAAK,EAAE;EAClCP,kBAAkB,GAAGO,KAAK;EAC1BH,SAAS,CAAC,CAAC;AACf,CAAC;AAED,MAAMI,qBAAqB,GAAIC,MAAkB,IAAmB;EAChE;EACA;EACA,IAAI,CAACR,WAAW,EAAE;IACdA,WAAW,GAAG,IAAI;IAClBF,iBAAiB,CAACW,qBAAqB,CAAC,CAAC,CACpCC,IAAI,CAACL,SAAS,CAAC,CACfM,KAAK,CAAC,MAAM;MACT;IAAA,CACH,CAAC;EACV;EACAV,SAAS,CAACW,GAAG,CAACJ,MAAM,CAAC;EACrB,MAAMK,GAAG,GAAGf,iBAAiB,CAACgB,gBAAgB,CAAC,qBAAqB,EAAET,SAAS,CAAC;EAChF,OAAO,MAAM;IACTJ,SAAS,CAACc,MAAM,CAACP,MAAM,CAAC;IACxBK,GAAG,CAACG,MAAM,CAAC,CAAC;EAChB,CAAC;AACL,CAAC;AAED,MAAMC,WAAW,GAAGA,CAAA,KAAelB,kBAAkB;;AAErD;AACA;AACA,MAAMmB,iBAAiB,GAAGA,CAAA,KAAe,KAAK;AAE9C,OAAO,SAASC,eAAeA,CAAA,EAAY;EACvC,OAAOtB,oBAAoB,CAACU,qBAAqB,EAAEU,WAAW,EAAEC,iBAAiB,CAAC;AACtF","ignoreList":[]}
|
|
@@ -37,6 +37,6 @@ export function useSurfaceHeader(content) {
|
|
|
37
37
|
set(content ?? null);
|
|
38
38
|
return () => set(null);
|
|
39
39
|
// Slot nodes (`left`/`right`) are compared by identity; callers memoize them.
|
|
40
|
-
}, [set, content?.title, content?.subtitle, content?.largeTitle, content?.left, content?.right, content?.onBack]);
|
|
40
|
+
}, [set, content?.title, content?.titleContent, content?.subtitle, content?.largeTitle, content?.left, content?.right, content?.onBack]);
|
|
41
41
|
}
|
|
42
42
|
//# sourceMappingURL=useSurfaceHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","useContext","useLayoutEffect","SurfaceHeaderContext","useSurfaceHeader","content","ctx","set","setContent","title","subtitle","largeTitle","left","right","onBack"],"sourceRoot":"../../../../src","sources":["ui/hooks/useSurfaceHeader.ts"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,UAAU,EAAEC,eAAe,QAAQ,OAAO;;AAGlE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,gBAAGH,aAAa,CAAmC,IAAI,CAAC;;AAEzF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,gBAAgBA,CAACC,OAAgD,EAAQ;EACvF,MAAMC,GAAG,GAAGL,UAAU,CAACE,oBAAoB,CAAC;EAC5C,MAAMI,GAAG,GAAGD,GAAG,EAAEE,UAAU;EAC3B;EACA;EACAN,eAAe,CAAC,MAAM;IACpB,IAAI,CAACK,GAAG,EAAE;IACVA,GAAG,CAACF,OAAO,IAAI,IAAI,CAAC;IACpB,OAAO,MAAME,GAAG,CAAC,IAAI,CAAC;IACtB;EACF,CAAC,EAAE,CACDA,GAAG,EACHF,OAAO,EAAEI,KAAK,EACdJ,OAAO,EAAEK,
|
|
1
|
+
{"version":3,"names":["createContext","useContext","useLayoutEffect","SurfaceHeaderContext","useSurfaceHeader","content","ctx","set","setContent","title","titleContent","subtitle","largeTitle","left","right","onBack"],"sourceRoot":"../../../../src","sources":["ui/hooks/useSurfaceHeader.ts"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,UAAU,EAAEC,eAAe,QAAQ,OAAO;;AAGlE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,gBAAGH,aAAa,CAAmC,IAAI,CAAC;;AAEzF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,gBAAgBA,CAACC,OAAgD,EAAQ;EACvF,MAAMC,GAAG,GAAGL,UAAU,CAACE,oBAAoB,CAAC;EAC5C,MAAMI,GAAG,GAAGD,GAAG,EAAEE,UAAU;EAC3B;EACA;EACAN,eAAe,CAAC,MAAM;IACpB,IAAI,CAACK,GAAG,EAAE;IACVA,GAAG,CAACF,OAAO,IAAI,IAAI,CAAC;IACpB,OAAO,MAAME,GAAG,CAAC,IAAI,CAAC;IACtB;EACF,CAAC,EAAE,CACDA,GAAG,EACHF,OAAO,EAAEI,KAAK,EACdJ,OAAO,EAAEK,YAAY,EACrBL,OAAO,EAAEM,QAAQ,EACjBN,OAAO,EAAEO,UAAU,EACnBP,OAAO,EAAEQ,IAAI,EACbR,OAAO,EAAES,KAAK,EACdT,OAAO,EAAEU,MAAM,CAChB,CAAC;AACJ","ignoreList":[]}
|
|
@@ -18,7 +18,14 @@
|
|
|
18
18
|
* are stack operations — this interface never carries visibility state.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Optional consumer overrides for account-dialog actions. `ProfileButton` (and
|
|
23
|
+
* similar hosts) register these while mounted so inbox/accounts can route
|
|
24
|
+
* "Manage" / "Add account" to app-local navigation instead of the SDK default.
|
|
25
|
+
*/
|
|
26
|
+
|
|
21
27
|
let controls = null;
|
|
28
|
+
let consumerHooks = null;
|
|
22
29
|
const visibilityListeners = new Set();
|
|
23
30
|
export function registerAccountDialogControls(next) {
|
|
24
31
|
controls = next;
|
|
@@ -29,6 +36,19 @@ export function registerAccountDialogControls(next) {
|
|
|
29
36
|
};
|
|
30
37
|
}
|
|
31
38
|
|
|
39
|
+
/** Register app-local manage/add/profile handlers for the account dialog. */
|
|
40
|
+
export function registerAccountDialogConsumerHooks(next) {
|
|
41
|
+
consumerHooks = next;
|
|
42
|
+
return () => {
|
|
43
|
+
if (consumerHooks === next) {
|
|
44
|
+
consumerHooks = null;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export function getAccountDialogConsumerHooks() {
|
|
49
|
+
return consumerHooks;
|
|
50
|
+
}
|
|
51
|
+
|
|
32
52
|
/** Open the account dialog on `view` (default `accounts`). No-op before mount. */
|
|
33
53
|
export function openAccountDialog(view) {
|
|
34
54
|
controls?.open(view);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["controls","visibilityListeners","Set","registerAccountDialogControls","next","openAccountDialog","view","open","closeAccountDialog","close","notifyAccountDialogVisibility","visible","listener","subscribeToAccountDialog","add","delete"],"sourceRoot":"../../../../src","sources":["ui/navigation/accountDialogManager.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;;AAMA,IAAIA,QAAsC,GAAG,IAAI;AACjD,MAAMC,mBAAmB,GAAG,IAAIC,GAAG,CAA6B,CAAC;AAEjE,OAAO,SAASC,6BAA6BA,CAACC,IAA2B,EAAc;
|
|
1
|
+
{"version":3,"names":["controls","consumerHooks","visibilityListeners","Set","registerAccountDialogControls","next","registerAccountDialogConsumerHooks","getAccountDialogConsumerHooks","openAccountDialog","view","open","closeAccountDialog","close","notifyAccountDialogVisibility","visible","listener","subscribeToAccountDialog","add","delete"],"sourceRoot":"../../../../src","sources":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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { isValidRoute } from "./routes.js";
|
|
4
|
-
import {
|
|
4
|
+
import { getSurfaceConfig } from "./surfaceRegistry.js";
|
|
5
5
|
import { closeAllRouteSurfaces, presentRoute, topRouteSurface } from "./surfaces.js";
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -17,11 +17,10 @@ import { closeAllRouteSurfaces, presentRoute, topRouteSurface } from "./surfaces
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* Open a bottom-sheet route.
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* first one.
|
|
20
|
+
* Open a bottom-sheet route. By DEFAULT it drills into the top-most active
|
|
21
|
+
* surface — morphing it in place (every screen morphs). A NEW surface is stacked
|
|
22
|
+
* on top only when the target route declares `stacks` (reserved for genuine
|
|
23
|
+
* overlays — none today). Opening with no active surface presents the first one.
|
|
25
24
|
*
|
|
26
25
|
* `fullScreen` is accepted for signature compatibility and ignored — a route's
|
|
27
26
|
* surface is now derived from its registry config, not a per-call flag.
|
|
@@ -34,7 +33,7 @@ export const showBottomSheet = screenOrConfig => {
|
|
|
34
33
|
return;
|
|
35
34
|
}
|
|
36
35
|
const top = topRouteSurface();
|
|
37
|
-
if (top &&
|
|
36
|
+
if (top && !getSurfaceConfig(screen, props).stacks) {
|
|
38
37
|
top.navigate(screen, props);
|
|
39
38
|
} else {
|
|
40
39
|
presentRoute(screen, props);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isValidRoute","
|
|
1
|
+
{"version":3,"names":["isValidRoute","getSurfaceConfig","closeAllRouteSurfaces","presentRoute","topRouteSurface","showBottomSheet","screenOrConfig","screen","props","__DEV__","console","warn","top","stacks","navigate","closeBottomSheet","goBack"],"sourceRoot":"../../../../src","sources":["ui/navigation/bottomSheetManager.ts"],"mappings":";;AACA,SAASA,YAAY,QAA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../screens/CreateAccountScreen').default,
|
|
47
47
|
AccountMembers: () => require('../screens/AccountMembersScreen').default,
|
|
48
48
|
AccountSettings: () => require('../screens/AccountSettingsScreen').default,
|
|
49
|
+
ChangeAvatar: () => require('../screens/ChangeAvatarScreen').default,
|
|
49
50
|
AvatarCrop: () => require('../screens/AvatarCropScreen').default,
|
|
50
51
|
Notifications: () => require('../screens/NotificationsScreen').default,
|
|
51
52
|
ConnectedApps: () => require('../screens/ConnectedAppsScreen').default,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["screenLoaders","ManageAccount","require","default","AccountVerification","PaymentGateway","Profile","LanguageSelector","PrivacySettings","SearchSettings","FileManagement","HelpSupport","FAQ","Feedback","LegalDocuments","AppInfo","PremiumSubscription","WelcomeNewUser","UserLinks","HistoryView","SavesCollections","EditProfile","EditProfileField","LearnMoreUsernames","TrustCenter","TrustLeaderboard","TrustRewards","TrustRules","AboutTrust","TrustFAQ","FollowersList","FollowingList","CreateAccount","AccountMembers","AccountSettings","AvatarCrop","Notifications","ConnectedApps","Preferences","AccountDialog","screenCache","Map","getScreenComponent","routeName","has","get","loader","component","set","error","__DEV__","console","undefined","isValidRoute"],"sourceRoot":"../../../../src","sources":["ui/navigation/routes.ts"],"mappings":";;AAGA;AACA;AACA;;AAEA;;
|
|
1
|
+
{"version":3,"names":["screenLoaders","ManageAccount","require","default","AccountVerification","PaymentGateway","Profile","LanguageSelector","PrivacySettings","SearchSettings","FileManagement","HelpSupport","FAQ","Feedback","LegalDocuments","AppInfo","PremiumSubscription","WelcomeNewUser","UserLinks","HistoryView","SavesCollections","EditProfile","EditProfileField","LearnMoreUsernames","TrustCenter","TrustLeaderboard","TrustRewards","TrustRules","AboutTrust","TrustFAQ","FollowersList","FollowingList","CreateAccount","AccountMembers","AccountSettings","ChangeAvatar","AvatarCrop","Notifications","ConnectedApps","Preferences","AccountDialog","screenCache","Map","getScreenComponent","routeName","has","get","loader","component","set","error","__DEV__","console","undefined","isValidRoute"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,OAAOA,SAAS,IAAI5C,aAAa;AACrC,CAAC","ignoreList":[]}
|
|
@@ -41,9 +41,46 @@ export function createSurfaceNavStack(route, props) {
|
|
|
41
41
|
} = store.getState();
|
|
42
42
|
return frames[frames.length - 1];
|
|
43
43
|
};
|
|
44
|
+
|
|
45
|
+
// Result-bearing sub-flows currently running in this surface (the morphed-in
|
|
46
|
+
// avatar picker, and — NESTED within it — the "My Oxy files" media selector).
|
|
47
|
+
// A STACK: flows nest (ChangeAvatar → FileManagement → back to ChangeAvatar).
|
|
48
|
+
// Held OUTSIDE the store (resolvers are functions; flow presence must not
|
|
49
|
+
// re-render frames). Each flow's `returnLength` is the frame count BEFORE its
|
|
50
|
+
// entry frame was pushed, so settling pops back to exactly the frame that
|
|
51
|
+
// started it. `flowStack` is ordered outer → inner; the top is the innermost.
|
|
52
|
+
const flowStack = [];
|
|
53
|
+
const requestDismiss = result => {
|
|
54
|
+
// Dismissing the whole surface abandons EVERY pending sub-flow — settle each
|
|
55
|
+
// promise so an awaiting caller (the avatar picker) never hangs.
|
|
56
|
+
while (flowStack.length) flowStack.pop()?.resolve(undefined);
|
|
57
|
+
if (store.getState().closing) return;
|
|
58
|
+
store.setState({
|
|
59
|
+
closing: true,
|
|
60
|
+
closeResult: result
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
const goBack = () => {
|
|
64
|
+
const {
|
|
65
|
+
frames
|
|
66
|
+
} = store.getState();
|
|
67
|
+
if (frames.length <= 1) return false;
|
|
68
|
+
const nextLength = frames.length - 1;
|
|
69
|
+
store.setState({
|
|
70
|
+
frames: frames.slice(0, -1)
|
|
71
|
+
});
|
|
72
|
+
// Backing out past a sub-flow's entry frame cancels it (resolve undefined).
|
|
73
|
+
// A single pop crosses at most one boundary, but loop for safety.
|
|
74
|
+
while (flowStack.length && nextLength <= flowStack[flowStack.length - 1].returnLength) {
|
|
75
|
+
flowStack.pop()?.resolve(undefined);
|
|
76
|
+
}
|
|
77
|
+
return true;
|
|
78
|
+
};
|
|
44
79
|
return {
|
|
45
80
|
store,
|
|
46
81
|
getTop,
|
|
82
|
+
requestDismiss,
|
|
83
|
+
goBack,
|
|
47
84
|
navigate(nextRoute, nextProps) {
|
|
48
85
|
store.setState(state => ({
|
|
49
86
|
frames: [...state.frames, makeFrame(nextRoute, nextProps)]
|
|
@@ -54,16 +91,6 @@ export function createSurfaceNavStack(route, props) {
|
|
|
54
91
|
frames: [...state.frames.slice(0, -1), makeFrame(nextRoute, nextProps)]
|
|
55
92
|
}));
|
|
56
93
|
},
|
|
57
|
-
goBack() {
|
|
58
|
-
const {
|
|
59
|
-
frames
|
|
60
|
-
} = store.getState();
|
|
61
|
-
if (frames.length <= 1) return false;
|
|
62
|
-
store.setState({
|
|
63
|
-
frames: frames.slice(0, -1)
|
|
64
|
-
});
|
|
65
|
-
return true;
|
|
66
|
-
},
|
|
67
94
|
canGoBack() {
|
|
68
95
|
const {
|
|
69
96
|
frames
|
|
@@ -83,12 +110,32 @@ export function createSurfaceNavStack(route, props) {
|
|
|
83
110
|
};
|
|
84
111
|
});
|
|
85
112
|
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
store.setState({
|
|
89
|
-
|
|
90
|
-
|
|
113
|
+
beginFlow(nextRoute, nextProps) {
|
|
114
|
+
const returnLength = store.getState().frames.length;
|
|
115
|
+
store.setState(state => ({
|
|
116
|
+
frames: [...state.frames, makeFrame(nextRoute, nextProps)]
|
|
117
|
+
}));
|
|
118
|
+
return new Promise(resolve => {
|
|
119
|
+
flowStack.push({
|
|
120
|
+
returnLength,
|
|
121
|
+
resolve
|
|
122
|
+
});
|
|
91
123
|
});
|
|
124
|
+
},
|
|
125
|
+
resolveFlowOrDismiss(result) {
|
|
126
|
+
const flow = flowStack.pop();
|
|
127
|
+
if (!flow) {
|
|
128
|
+
// No flow → this screen owns its surface; dismiss it as before.
|
|
129
|
+
requestDismiss(result);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
store.setState(state => ({
|
|
133
|
+
frames: state.frames.slice(0, flow.returnLength)
|
|
134
|
+
}));
|
|
135
|
+
flow.resolve(result);
|
|
136
|
+
},
|
|
137
|
+
abandonActiveFlow() {
|
|
138
|
+
while (flowStack.length) flowStack.pop()?.resolve(undefined);
|
|
92
139
|
}
|
|
93
140
|
};
|
|
94
141
|
}
|