@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
@@ -47,36 +47,88 @@ const authChooserStyles = exports.authChooserStyles = _reactNative.StyleSheet.cr
47
47
  fontSize: 12.5,
48
48
  marginTop: 1
49
49
  },
50
- /** Prominent current-account header (Google-style collapsed row). */
51
- currentAccountRow: {
52
- flexDirection: 'row',
53
- alignItems: 'center',
54
- gap: 12,
55
- paddingVertical: 8,
56
- paddingHorizontal: 4
57
- },
58
- currentAccountMeta: {
59
- flex: 1,
60
- minWidth: 0
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
- currentAccountName: {
63
- fontSize: 16,
64
- fontWeight: '700'
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
- currentAccountEmail: {
67
- fontSize: 13,
68
- marginTop: 2
114
+ heroGreeting: {
115
+ fontSize: 22,
116
+ fontWeight: '600',
117
+ textAlign: 'center'
69
118
  },
70
- manageButton: {
71
- width: '100%',
72
- borderRadius: 14,
73
- marginTop: 4
119
+ /** The account address (`username@oxy.so` / `@handle`) under the greeting. */
120
+ heroAddress: {
121
+ fontSize: 14,
122
+ textAlign: 'center'
74
123
  },
75
- addBadge: {
76
- width: 40,
77
- height: 40,
78
- borderRadius: 9999,
79
- borderWidth: _reactNative.StyleSheet.hairlineWidth,
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","currentAccountRow","currentAccountMeta","currentAccountName","currentAccountEmail","manageButton","addBadge","height","justifyContent","footerLink","alignSelf","linkText","signInBlock","primaryButton","secondaryButton","usernameInput","dividerRow","marginVertical","dividerLine","dividerText","marginHorizontal","centeredBlock","mutedText","textAlign","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,CAAC;IACPC,QAAQ,EAAE;EACZ,CAAC;EACDC,OAAO,EAAE;IACPC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EACd,CAAC;EACDC,SAAS,EAAE;IACTF,QAAQ,EAAE,IAAI;IACdG,SAAS,EAAE;EACb,CAAC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nBC,iBAAiB,EAAE,EAAE;IACrBS,QAAQ,EAAE,EAAE;IACZG,SAAS,EAAE;EACb,CAAC;EACDgB,UAAU,EAAE;IACVlC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBJ,KAAK,EAAE,MAAM;IACbsC,cAAc,EAAE;EAClB,CAAC;EACDC,WAAW,EAAE;IACXxB,IAAI,EAAE,CAAC;IACPa,MAAM,EAAE/B,uBAAU,CAACS;EACrB,CAAC;EACDkC,WAAW,EAAE;IACXC,gBAAgB,EAAE,EAAE;IACpBvB,QAAQ,EAAE;EACZ,CAAC;EACDwB,aAAa,EAAE;IACbtC,UAAU,EAAE,QAAQ;IACpByB,cAAc,EAAE,QAAQ;IACxB5B,GAAG,EAAE,EAAE;IACPO,eAAe,EAAE;EACnB,CAAC;EACDmC,SAAS,EAAE;IACTzB,QAAQ,EAAE,EAAE;IACZ0B,SAAS,EAAE;EACb,CAAC;EACDC,UAAU,EAAE;IACV3B,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjByB,SAAS,EAAE;EACb,CAAC;EACDE,OAAO,EAAE;IACPjC,OAAO,EAAE,EAAE;IACXN,YAAY,EAAE,EAAE;IAChBwC,eAAe,EAAErD;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
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,CAAC;IACPC,QAAQ,EAAE;EACZ,CAAC;EACDC,OAAO,EAAE;IACPC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EACd,CAAC;EACDC,SAAS,EAAE;IACTF,QAAQ,EAAE,IAAI;IACdG,SAAS,EAAE;EACb,CAAC;EACD;AACF;AACA;AACA;AACA;AACA;EACEC,QAAQ,EAAE;IACRC,QAAQ,EAAE;EACZ,CAAC;EACDC,eAAe,EAAE;IACfxB,KAAK,EAAE;EACT,CAAC;EACD;AACF;AACA;AACA;AACA;AACA;AACA;EACEyB,IAAI,EAAE;IACJrB,UAAU,EAAE,QAAQ;IACpBsB,UAAU,EAAE,CAAC;IACbC,aAAa,EAAE,EAAE;IACjB1B,GAAG,EAAE;EACP,CAAC;EACD;AACF;A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/C,KAAK,EAAE,MAAM;IACbO,YAAY,EAAE,EAAE;IAChBc,SAAS,EAAE;EACb,CAAC;EACD2B,eAAe,EAAE;IACfhD,KAAK,EAAE,MAAM;IACbO,YAAY,EAAE,EAAE;IAChBc,SAAS,EAAE;EACb,CAAC;EACD4B,aAAa,EAAE;IACbjD,KAAK,EAAE,MAAM;IACbK,WAAW,EAAER,uBAAU,CAACS,aAAa;IACrCC,YAAY,EAAE,EAAE;IAChBC,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE,EAAE;IACrBS,QAAQ,EAAE,EAAE;IACZG,SAAS,EAAE;EACb,CAAC;EACD6B,UAAU,EAAE;IACV/C,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBJ,KAAK,EAAE,MAAM;IACbmD,cAAc,EAAE;EAClB,CAAC;EACDC,WAAW,EAAE;IACXrC,IAAI,EAAE,CAAC;IACP0B,MAAM,EAAE5C,uBAAU,CAACS;EACrB,CAAC;EACD+C,WAAW,EAAE;IACXC,gBAAgB,EAAE,EAAE;IACpBpC,QAAQ,EAAE;EACZ,CAAC;EACDqC,aAAa,EAAE;IACbnD,UAAU,EAAE,QAAQ;IACpBsC,cAAc,EAAE,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
- photoDimensions,
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
- // Ensure dimensions are loaded for displayed photos
44
- (0, _react.useEffect)(() => {
45
- loadPhotoDimensions(photos);
46
- // eslint-disable-next-line react-hooks/exhaustive-deps
47
- }, [photos.map(p => p.id).join(',')]);
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
- // createJustifiedRows should build rows such that the "ideal" height (availableWidth / totalAspect) stays within min/max.
76
- // We pass the effective container width.
77
- const dateWidth = dateWidths[date] ?? effectiveWidth; // fallback to overall width until measured
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
- // Compute total aspect ratios using loaded dimensions (fallback 4/3)
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
- // We rely on row construction keeping idealHeight within min/max bounds; if not, clamp but then distribute leftover/overflow.
176
+ // Clamp to min/max, then distribute the leftover/overflow proportionally.
114
177
  let rowHeight = idealHeight;
115
- let widthAdjustment = 0; // difference to distribute if clamped
178
+ let widthAdjustment = 0;
116
179
  if (idealHeight < minRowHeight) {
117
180
  rowHeight = minRowHeight;
118
- widthAdjustment = availableWidth - rowHeight * totalAspect; // negative means overflow
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
- // To combat rounding issues, adjust last item width to fill precisely
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; // minimal correction
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","JustifiedPhotoGrid","photos","photoDimensions","loadPhotoDimensions","createJustifiedRows","renderJustifiedPhotoItem","textColor","containerWidth","explicitWidth","gap","minRowHeight","maxRowHeight","dateFormatLocale","width","windowWidth","useWindowDimensions","measuredWidth","setMeasuredWidth","useState","resolvedExplicitWidth","resolvedMeasuredWidth","effectiveWidth","onLayoutContainer","useCallback","w","nativeEvent","layout","prev","useEffect","map","p","id","join","photosByDate","useMemo","reduce","groups","photo","date","Date","uploadDate","toDateString","push","sortedDates","keys","sort","a","b","getTime","dateWidths","setDateWidths","onLayoutDate","jsx","View","style","onLayout","children","dayPhotos","dateWidth","rows","jsxs","marginBottom","Text","fontSize","fontWeight","color","toLocaleDateString","weekday","year","month","day","row","rowIndex","aspects","dims","height","totalAspect","gapsTotal","length","availableWidth","idealHeight","rowHeight","widthAdjustment","widths","ar","widthSum","widthSumRounded","roundingDiff","Math","abs","flexDirection","photoWidth","marginRight","_default","exports","React","memo"],"sourceRoot":"../../../../../src","sources":["ui/components/photogrid/JustifiedPhotoGrid.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAAuF,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,CAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GA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,KAAK;gBACf,MAAMuG,UAAU,GAAGR,MAAM,CAAC/F,CAAC,CAAC;gBAC5B,oBACI,IAAAR,WAAA,CAAAwE,GAAA,EAACzE,YAAA,CAAA0E,IAAI;kBAEDC,KAAK,EAAE;oBAAEzC,KAAK,EAAE8E,UAAU;oBAAEhB,MAAM,EAAEM,SAAS;oBAAEW,WAAW,EAAExG,CAAC,KAAKmF,GAAG,CAACO,MAAM,GAAG,CAAC,GAAG,CAAC,GAAGrE;kBAAI,CAAE;kBAAA+C,QAAA,EAE5FnD,wBAAwB,CAACyB,CAAC,EAAE6D,UAAU,EAAEV,SAAS,EAAE7F,CAAC,KAAKmF,GAAG,CAACO,MAAM,GAAG,CAAC;gBAAC,GAHpEhD,CAAC,CAACC,EAIL,CAAC;cAEf,CAAC;YAAC,GAXKyC,QAYL,CAAC;UAEf,CAAC;QAAC,CACA,CAAC;MAAA,GA7DFlC,IA8DH,CAAC;IAEf,CAAC;EAAC,CACR,CAAC;AAEf,CAAC;AAAC,IAAAuD,QAAA,GAAAC,OAAA,CAAAvG,OAAA,gBAEawG,cAAK,CAACC,IAAI,CAAChG,kBAAkB,CAAC","ignoreList":[]}
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;AACA,IAAAE,WAAA,GAAAF,OAAA;AAAmE,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAA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,KAAK,EAAE;gBAAEiC,aAAa,EAAE,KAAK;gBAAErG,KAAK,EAAE,MAAM;gBAAE0E,YAAY,EAAE;cAAE,CAAE;cAAAJ,QAAA,EAC9Fc,GAAG,CAAC1F,GAAG,CAAC,CAAC0C,CAAC,EAAE7D,CAAC,KAAK;gBACf,MAAM+H,UAAU,GAAGR,MAAM,CAACvH,CAAC,CAAC;gBAC5B,oBACI,IAAAR,WAAA,CAAAmG,GAAA,EAACrG,YAAA,CAAAsG,IAAI;kBAEDC,KAAK,EAAE;oBAAEpE,KAAK,EAAEsG,UAAU;oBAAErG,MAAM,EAAE2F,SAAS;oBAAEW,WAAW,EAAEhI,CAAC,KAAK6G,GAAG,CAAC5E,MAAM,GAAG,CAAC,GAAG,CAAC,GAAGQ;kBAAI,CAAE;kBAAAsD,QAAA,EAE5F1D,wBAAwB,CAACwB,CAAC,EAAEkE,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
- // Dismiss the surface; its settle (`result.finally` below) is what flips
611
- // `accountDialogOpen` false. The surface's present→settle lifecycle is the
612
- // SINGLE source of truth for "is the account dialog open" — never a manual
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
- accountDialogControllerRef.current?.setView(view ?? 'accounts');
639
- // Present the AccountDialog surface on the shared Bloom stack the FIRST time
640
- // (subsequent opens just re-point the controller's view above). `presentDetached`
641
- // keeps it OUT of the `showBottomSheet` route-surface lineage, so closing the
642
- // bottom-sheet session never touches the account dialog and vice-versa. When a
643
- // route surface (e.g. ManageAccount) is already open, this stacks the dialog
644
- // ABOVE it; dismissing the dialog unwinds back to that surface.
645
- if (!accountDialogSurfaceRef.current) {
646
- const instance = (0, _surfaces.presentDetached)('AccountDialog', {
647
- initialView: view ?? 'accounts'
648
- }, {
649
- placement: {
650
- base: 'bottom',
651
- md: 'center'
652
- },
653
- dismissOnBackdrop: false,
654
- maxWidth: 420
655
- });
656
- accountDialogSurfaceRef.current = instance;
657
- // The surface settling is the ONE place `accountDialogOpen` flips false —
658
- // covering every dismiss path (close button, `onSignedIn`, programmatic
659
- // `closeAccountDialog`, host unmount). So the stack owns the open state.
660
- instance.result.finally(() => {
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
- // Dismiss the surface; its settle (`result.finally` above) flips
672
- // `accountDialogOpen` false. Do NOT flip it here — the surface lifecycle is
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)(() => {