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