@oxyhq/services 22.4.2 → 22.6.0

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 (174) hide show
  1. package/LICENSE +661 -21
  2. package/README.md +1 -1
  3. package/lib/commonjs/index.js +20 -1
  4. package/lib/commonjs/index.js.map +1 -1
  5. package/lib/commonjs/ui/client.js +1 -1
  6. package/lib/commonjs/ui/components/FontLoader.js +18 -145
  7. package/lib/commonjs/ui/components/FontLoader.js.map +1 -1
  8. package/lib/commonjs/ui/components/FontLoader.native.js +88 -0
  9. package/lib/commonjs/ui/components/FontLoader.native.js.map +1 -0
  10. package/lib/commonjs/ui/components/OxyProvider.js +1 -1
  11. package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js +16 -27
  12. package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
  13. package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -1
  14. package/lib/commonjs/ui/components/fileManagement/styles.js +1 -225
  15. package/lib/commonjs/ui/components/fileManagement/styles.js.map +1 -1
  16. package/lib/commonjs/ui/context/hooks/useAuthOperations.js +5 -2
  17. package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
  18. package/lib/commonjs/ui/context/useOxyAccountGraph.js +7 -0
  19. package/lib/commonjs/ui/context/useOxyAccountGraph.js.map +1 -1
  20. package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +14 -5
  21. package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +1 -1
  22. package/lib/commonjs/ui/hooks/queries/userCache.js +286 -0
  23. package/lib/commonjs/ui/hooks/queries/userCache.js.map +1 -0
  24. package/lib/commonjs/ui/hooks/useAvatarPicker.js +23 -8
  25. package/lib/commonjs/ui/hooks/useAvatarPicker.js.map +1 -1
  26. package/lib/commonjs/ui/hooks/useFileDownloadUrl.js +7 -21
  27. package/lib/commonjs/ui/hooks/useFileDownloadUrl.js.map +1 -1
  28. package/lib/commonjs/ui/hooks/useResolvedFileUrls.js +163 -0
  29. package/lib/commonjs/ui/hooks/useResolvedFileUrls.js.map +1 -0
  30. package/lib/commonjs/ui/index.js +1 -1
  31. package/lib/commonjs/ui/screens/FileManagementScreen.js +51 -22
  32. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  33. package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +216 -203
  34. package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
  35. package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js +26 -9
  36. package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
  37. package/lib/commonjs/ui/screens/fileManagement/photoGridLayout.js +44 -0
  38. package/lib/commonjs/ui/screens/fileManagement/photoGridLayout.js.map +1 -0
  39. package/lib/commonjs/ui/session/tokenTransport.js +21 -10
  40. package/lib/commonjs/ui/session/tokenTransport.js.map +1 -1
  41. package/lib/commonjs/ui/utils/fileManagement.js +0 -40
  42. package/lib/commonjs/ui/utils/fileManagement.js.map +1 -1
  43. package/lib/module/index.js +7 -1
  44. package/lib/module/index.js.map +1 -1
  45. package/lib/module/ui/client.js +1 -1
  46. package/lib/module/ui/client.js.map +1 -1
  47. package/lib/module/ui/components/FontLoader.js +18 -146
  48. package/lib/module/ui/components/FontLoader.js.map +1 -1
  49. package/lib/module/ui/components/FontLoader.native.js +83 -0
  50. package/lib/module/ui/components/FontLoader.native.js.map +1 -0
  51. package/lib/module/ui/components/OxyProvider.js +1 -1
  52. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  53. package/lib/module/ui/components/fileManagement/FileDetailsModal.js +16 -27
  54. package/lib/module/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
  55. package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -1
  56. package/lib/module/ui/components/fileManagement/styles.js +0 -224
  57. package/lib/module/ui/components/fileManagement/styles.js.map +1 -1
  58. package/lib/module/ui/context/hooks/useAuthOperations.js +5 -2
  59. package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
  60. package/lib/module/ui/context/useOxyAccountGraph.js +7 -0
  61. package/lib/module/ui/context/useOxyAccountGraph.js.map +1 -1
  62. package/lib/module/ui/hooks/queries/useAccountQueries.js +14 -5
  63. package/lib/module/ui/hooks/queries/useAccountQueries.js.map +1 -1
  64. package/lib/module/ui/hooks/queries/userCache.js +282 -0
  65. package/lib/module/ui/hooks/queries/userCache.js.map +1 -0
  66. package/lib/module/ui/hooks/useAvatarPicker.js +23 -8
  67. package/lib/module/ui/hooks/useAvatarPicker.js.map +1 -1
  68. package/lib/module/ui/hooks/useFileDownloadUrl.js +7 -21
  69. package/lib/module/ui/hooks/useFileDownloadUrl.js.map +1 -1
  70. package/lib/module/ui/hooks/useResolvedFileUrls.js +157 -0
  71. package/lib/module/ui/hooks/useResolvedFileUrls.js.map +1 -0
  72. package/lib/module/ui/index.js +1 -1
  73. package/lib/module/ui/index.js.map +1 -1
  74. package/lib/module/ui/screens/FileManagementScreen.js +52 -23
  75. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  76. package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js +218 -205
  77. package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
  78. package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js +26 -9
  79. package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
  80. package/lib/module/ui/screens/fileManagement/photoGridLayout.js +39 -0
  81. package/lib/module/ui/screens/fileManagement/photoGridLayout.js.map +1 -0
  82. package/lib/module/ui/session/tokenTransport.js +21 -10
  83. package/lib/module/ui/session/tokenTransport.js.map +1 -1
  84. package/lib/module/ui/utils/fileManagement.js +0 -39
  85. package/lib/module/ui/utils/fileManagement.js.map +1 -1
  86. package/lib/typescript/commonjs/index.d.ts +2 -0
  87. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  88. package/lib/typescript/commonjs/ui/components/FontLoader.d.ts +14 -5
  89. package/lib/typescript/commonjs/ui/components/FontLoader.d.ts.map +1 -1
  90. package/lib/typescript/commonjs/ui/components/FontLoader.native.d.ts +13 -0
  91. package/lib/typescript/commonjs/ui/components/FontLoader.native.d.ts.map +1 -0
  92. package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
  93. package/lib/typescript/commonjs/ui/components/fileManagement/styles.d.ts +0 -218
  94. package/lib/typescript/commonjs/ui/components/fileManagement/styles.d.ts.map +1 -1
  95. package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  96. package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts.map +1 -1
  97. package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts +9 -0
  98. package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
  99. package/lib/typescript/commonjs/ui/hooks/queries/userCache.d.ts +96 -0
  100. package/lib/typescript/commonjs/ui/hooks/queries/userCache.d.ts.map +1 -0
  101. package/lib/typescript/commonjs/ui/hooks/useAvatarPicker.d.ts.map +1 -1
  102. package/lib/typescript/commonjs/ui/hooks/useFileDownloadUrl.d.ts +3 -2
  103. package/lib/typescript/commonjs/ui/hooks/useFileDownloadUrl.d.ts.map +1 -1
  104. package/lib/typescript/commonjs/ui/hooks/useResolvedFileUrls.d.ts +48 -0
  105. package/lib/typescript/commonjs/ui/hooks/useResolvedFileUrls.d.ts.map +1 -0
  106. package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
  107. package/lib/typescript/commonjs/ui/screens/fileManagement/PhotoPickerSection.d.ts +1 -1
  108. package/lib/typescript/commonjs/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
  109. package/lib/typescript/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
  110. package/lib/typescript/commonjs/ui/screens/fileManagement/photoGridLayout.d.ts +37 -0
  111. package/lib/typescript/commonjs/ui/screens/fileManagement/photoGridLayout.d.ts.map +1 -0
  112. package/lib/typescript/commonjs/ui/session/tokenTransport.d.ts +15 -8
  113. package/lib/typescript/commonjs/ui/session/tokenTransport.d.ts.map +1 -1
  114. package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts +4 -11
  115. package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts.map +1 -1
  116. package/lib/typescript/module/index.d.ts +3 -1
  117. package/lib/typescript/module/index.d.ts.map +1 -1
  118. package/lib/typescript/module/ui/client.d.ts +1 -1
  119. package/lib/typescript/module/ui/client.d.ts.map +1 -1
  120. package/lib/typescript/module/ui/components/FontLoader.d.ts +14 -5
  121. package/lib/typescript/module/ui/components/FontLoader.d.ts.map +1 -1
  122. package/lib/typescript/module/ui/components/FontLoader.native.d.ts +13 -0
  123. package/lib/typescript/module/ui/components/FontLoader.native.d.ts.map +1 -0
  124. package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
  125. package/lib/typescript/module/ui/components/fileManagement/styles.d.ts +0 -218
  126. package/lib/typescript/module/ui/components/fileManagement/styles.d.ts.map +1 -1
  127. package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  128. package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts.map +1 -1
  129. package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts +9 -0
  130. package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
  131. package/lib/typescript/module/ui/hooks/queries/userCache.d.ts +96 -0
  132. package/lib/typescript/module/ui/hooks/queries/userCache.d.ts.map +1 -0
  133. package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts.map +1 -1
  134. package/lib/typescript/module/ui/hooks/useFileDownloadUrl.d.ts +3 -2
  135. package/lib/typescript/module/ui/hooks/useFileDownloadUrl.d.ts.map +1 -1
  136. package/lib/typescript/module/ui/hooks/useResolvedFileUrls.d.ts +48 -0
  137. package/lib/typescript/module/ui/hooks/useResolvedFileUrls.d.ts.map +1 -0
  138. package/lib/typescript/module/ui/index.d.ts +1 -1
  139. package/lib/typescript/module/ui/index.d.ts.map +1 -1
  140. package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
  141. package/lib/typescript/module/ui/screens/fileManagement/PhotoPickerSection.d.ts +1 -1
  142. package/lib/typescript/module/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
  143. package/lib/typescript/module/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
  144. package/lib/typescript/module/ui/screens/fileManagement/photoGridLayout.d.ts +37 -0
  145. package/lib/typescript/module/ui/screens/fileManagement/photoGridLayout.d.ts.map +1 -0
  146. package/lib/typescript/module/ui/session/tokenTransport.d.ts +15 -8
  147. package/lib/typescript/module/ui/session/tokenTransport.d.ts.map +1 -1
  148. package/lib/typescript/module/ui/utils/fileManagement.d.ts +4 -11
  149. package/lib/typescript/module/ui/utils/fileManagement.d.ts.map +1 -1
  150. package/package.json +6 -11
  151. package/src/index.ts +8 -0
  152. package/src/ui/components/FontLoader.native.tsx +88 -0
  153. package/src/ui/components/FontLoader.tsx +16 -151
  154. package/src/ui/components/fileManagement/FileDetailsModal.tsx +17 -18
  155. package/src/ui/components/fileManagement/UploadPreview.tsx +1 -1
  156. package/src/ui/components/fileManagement/styles.ts +0 -225
  157. package/src/ui/context/hooks/useAuthOperations.ts +5 -2
  158. package/src/ui/context/useOxyAccountGraph.ts +5 -0
  159. package/src/ui/hooks/queries/__tests__/userCache.test.ts +361 -0
  160. package/src/ui/hooks/queries/useAccountQueries.ts +14 -5
  161. package/src/ui/hooks/queries/userCache.ts +308 -0
  162. package/src/ui/hooks/useAvatarPicker.ts +27 -7
  163. package/src/ui/hooks/useFileDownloadUrl.ts +7 -23
  164. package/src/ui/hooks/useResolvedFileUrls.ts +170 -0
  165. package/src/ui/screens/FileManagementScreen.tsx +55 -27
  166. package/src/ui/screens/__tests__/photoGridLayout.test.ts +57 -0
  167. package/src/ui/screens/fileManagement/PhotoPickerSection.tsx +215 -213
  168. package/src/ui/screens/fileManagement/hooks/useFileUploadState.ts +27 -3
  169. package/src/ui/screens/fileManagement/photoGridLayout.ts +45 -0
  170. package/src/ui/session/__tests__/tokenTransport.test.ts +25 -10
  171. package/src/ui/session/tokenTransport.ts +21 -10
  172. package/src/ui/utils/fileManagement.ts +3 -46
  173. package/lib/typescript/types/expo-vector-icons.d.ts +0 -22
  174. package/src/types/expo-vector-icons.d.ts +0 -22
@@ -383,43 +383,6 @@ export declare const fileManagementStyles: {
383
383
  flex: number;
384
384
  padding: number;
385
385
  };
386
- fileDetailCard: {
387
- padding: number;
388
- borderRadius: number;
389
- borderWidth: number;
390
- alignItems: "center";
391
- };
392
- fileDetailIcon: {
393
- marginBottom: number;
394
- };
395
- fileDetailName: {
396
- fontSize: number;
397
- fontWeight: "bold";
398
- textAlign: "center";
399
- marginBottom: number;
400
- };
401
- fileDetailInfo: {
402
- width: "100%";
403
- marginBottom: number;
404
- };
405
- detailRow: {
406
- flexDirection: "row";
407
- justifyContent: "space-between";
408
- alignItems: "flex-start";
409
- marginBottom: number;
410
- flexWrap: "wrap";
411
- };
412
- detailLabel: {
413
- fontSize: number;
414
- fontWeight: "500";
415
- flex: number;
416
- minWidth: number;
417
- };
418
- detailValue: {
419
- fontSize: number;
420
- flex: number;
421
- textAlign: "right";
422
- };
423
386
  modalActions: {
424
387
  flexDirection: "row";
425
388
  gap: number;
@@ -859,185 +822,4 @@ export declare const fileManagementStyles: {
859
822
  borderRadius: number;
860
823
  };
861
824
  };
862
- /**
863
- * Styles for the dedicated photo picker view used when `selectMode + image-only`
864
- * is active (e.g. the avatar picker context). This view is intentionally
865
- * flagship-grade: black backdrop, translucent header, edge-to-edge grid.
866
- *
867
- * Kept in a separate StyleSheet so the rest of `fileManagementStyles` does not
868
- * carry a black-background bias when used elsewhere.
869
- */
870
- export declare const photoPickerStyles: {
871
- root: {
872
- flex: number;
873
- backgroundColor: string;
874
- };
875
- headerSpacer: {
876
- backgroundColor: string;
877
- };
878
- header: {
879
- position: "absolute";
880
- top: number;
881
- left: number;
882
- right: number;
883
- backgroundColor: string;
884
- flexDirection: "row";
885
- alignItems: "center";
886
- justifyContent: "space-between";
887
- paddingHorizontal: number;
888
- zIndex: number;
889
- };
890
- headerRow: {
891
- flexDirection: "row";
892
- alignItems: "center";
893
- justifyContent: "space-between";
894
- width: "100%";
895
- height: number;
896
- };
897
- headerSide: {
898
- flexBasis: number;
899
- flexGrow: number;
900
- flexDirection: "row";
901
- alignItems: "center";
902
- };
903
- headerSideRight: {
904
- justifyContent: "flex-end";
905
- };
906
- headerSideLeft: {
907
- justifyContent: "flex-start";
908
- };
909
- headerTitle: {
910
- fontSize: number;
911
- fontWeight: "600";
912
- color: string;
913
- letterSpacing: number;
914
- textAlign: "center";
915
- };
916
- headerCancel: {
917
- paddingHorizontal: number;
918
- paddingVertical: number;
919
- minHeight: number;
920
- minWidth: number;
921
- justifyContent: "center";
922
- };
923
- headerCancelText: {
924
- fontSize: number;
925
- fontWeight: "500";
926
- color: string;
927
- };
928
- headerPrimaryPill: {
929
- flexDirection: "row";
930
- alignItems: "center";
931
- gap: number;
932
- paddingHorizontal: number;
933
- paddingVertical: number;
934
- borderRadius: number;
935
- minHeight: number;
936
- };
937
- headerPrimaryPillIconOnly: {
938
- paddingHorizontal: number;
939
- width: number;
940
- justifyContent: "center";
941
- };
942
- headerPrimaryText: {
943
- color: string;
944
- fontSize: number;
945
- fontWeight: "600";
946
- };
947
- headerProgressBarTrack: {
948
- position: "absolute";
949
- left: number;
950
- right: number;
951
- bottom: number;
952
- height: number;
953
- backgroundColor: string;
954
- };
955
- headerProgressBarFill: {
956
- height: "100%";
957
- };
958
- grid: {
959
- flex: number;
960
- };
961
- gridContent: {
962
- paddingBottom: number;
963
- };
964
- cellWrapper: {
965
- position: "relative";
966
- };
967
- cellInner: {
968
- flex: number;
969
- borderRadius: number;
970
- overflow: "hidden";
971
- backgroundColor: string;
972
- };
973
- cellImage: {
974
- width: "100%";
975
- height: "100%";
976
- };
977
- cellRing: {
978
- position: "absolute";
979
- top: number;
980
- left: number;
981
- right: number;
982
- bottom: number;
983
- borderRadius: number;
984
- borderWidth: number;
985
- };
986
- cellDim: {
987
- opacity: number;
988
- };
989
- cellBadge: {
990
- position: "absolute";
991
- top: number;
992
- right: number;
993
- minWidth: number;
994
- height: number;
995
- paddingHorizontal: number;
996
- borderRadius: number;
997
- alignItems: "center";
998
- justifyContent: "center";
999
- };
1000
- cellBadgeText: {
1001
- color: string;
1002
- fontSize: number;
1003
- fontWeight: "700";
1004
- lineHeight: number;
1005
- };
1006
- empty: {
1007
- flex: number;
1008
- alignItems: "center";
1009
- justifyContent: "center";
1010
- paddingHorizontal: number;
1011
- };
1012
- emptyIconWrap: {
1013
- opacity: number;
1014
- marginBottom: number;
1015
- };
1016
- emptyTitle: {
1017
- fontSize: number;
1018
- fontWeight: "600";
1019
- textAlign: "center";
1020
- marginBottom: number;
1021
- };
1022
- emptySubtitle: {
1023
- fontSize: number;
1024
- fontWeight: "400";
1025
- textAlign: "center";
1026
- opacity: number;
1027
- marginBottom: number;
1028
- };
1029
- emptyCta: {
1030
- flexDirection: "row";
1031
- alignItems: "center";
1032
- gap: number;
1033
- paddingHorizontal: number;
1034
- paddingVertical: number;
1035
- borderRadius: number;
1036
- };
1037
- emptyCtaText: {
1038
- color: string;
1039
- fontSize: number;
1040
- fontWeight: "600";
1041
- };
1042
- };
1043
825
  //# sourceMappingURL=styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/fileManagement/styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiE7B;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAK,EAAE,WAAW,EAAE,OAAO,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxG,WAAW,EAAE,WAAW,CAAC;IACzB,0BAA0B,EAAE,SAAS,CAAC,uBAAuB,GAAG,IAAI,CAAC,CAAC;IACtE,oBAAoB,EAAE,SAAS,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;CACtD;AAED,wBAAgB,kBAAkB,CAAC,EACjC,eAAe,EACf,UAAU,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACb,cAAc,EACd,aAAa,EACb,WAAW,EACX,0BAA0B,EAC1B,oBAAoB,GACrB,EAAE,wBAAwB;;2BAGqB,OAAO,CAAC,IAAI,CAAC;iCAsCvC,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;0BAiC3B,kBAAkB,KAAG,OAAO,CAAC,WAAW,CAAC;EAczD"}
@@ -14,6 +14,15 @@ export declare const useUserProfiles: (sessionIds: string[], options?: {
14
14
  /**
15
15
  * Get current authenticated user.
16
16
  *
17
+ * Hydrates from `GET /users/me` (the bearer identifies the session) rather than
18
+ * `GET /session/user/:activeSessionId`. Post zero-cookie cutover the bearer is
19
+ * the single source of session truth, so keying the CURRENT user off a session
20
+ * id in the URL was a second, independently-updated source that could disagree
21
+ * with the bearer during an account switch — the request fired under the
22
+ * previous account's token against the new account's session id and 404'd. The
23
+ * query KEY stays scoped to the active account so the cache re-scopes (and
24
+ * refetches) on a switch; only the URL stopped carrying a session id.
25
+ *
17
26
  * The store-mirror effect must NOT overwrite the in-memory user while a
18
27
  * write mutation is in flight — otherwise a stale background refetch
19
28
  * landing between optimistic update and server-confirmed update would
@@ -1 +1 @@
1
- {"version":3,"file":"useAccountQueries.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/hooks/queries/useAccountQueries.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,Y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,aAAa,CAAC;AAMtD;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,WAAW,MAAM,GAAG,IAAI,EAAE,UAAU;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,yEAevF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,YAAY,MAAM,EAAE,EAAE,UAAU;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,yEAepF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,yEA2D7D,CAAC;AAsBF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,GAAG,IAAI,EAAE,UAAU;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,yEAejF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,UAAU,MAAM,GAAG,IAAI,EAAE,UAAU;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,yEA6BzF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,YAAY,MAAM,EAAE,EAAE,UAAU;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE;;;YAevF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,UAAU;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,mFAgB/D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,MAAM,EAAE,UAAU;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,0GAwBlF,CAAC"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Canonical user-cache UPSERT for the Oxy React Query cache.
3
+ *
4
+ * The problem this solves: many places across an app write a user object into
5
+ * the React Query cache and REPLACE the existing entry — profile fetch, feed /
6
+ * post hydration, search, notifications, lists. Each of those sources carries a
7
+ * DIFFERENT (often sparse) slice of the user: a feed author has no viewer
8
+ * `relationship`, a search hit has no `createdAt`, a notification actor has no
9
+ * `_count`. A plain `setQueryData(key, sparseUser)` therefore STRIPS whatever
10
+ * fields the authoritative single-profile fetch had already stored — the
11
+ * "Follows you tag vanishes when the feed loads" / "counts flash to zero" class
12
+ * of bug.
13
+ *
14
+ * The fix (owned here, in the SDK): ONE canonical upsert that MERGES. It writes
15
+ * under BOTH keys the SDK's user hooks read from:
16
+ * - by-id: `queryKeys.users.detail(id)` (read by `useUserById`)
17
+ * - by-username: `queryKeys.users.byUsername(username, viewerId)` (viewer-scoped;
18
+ * read by `useUserByUsername`, carries the viewer `relationship`)
19
+ *
20
+ * Merge semantics (per key):
21
+ * - No existing entry -> seed the (normalized) incoming object and mark it
22
+ * STALE (`updatedAt: 0`) so react-query refetches the full authoritative
23
+ * profile (viewer-relative `relationship`, counts, `createdAt`, …). Instant
24
+ * first paint, then the real fetch.
25
+ * - Existing entry -> `{ ...existing, ...pickMeaningful(incoming) }`: only
26
+ * the DEFINED, non-empty fields of `incoming` win; every other field is kept
27
+ * from `existing`. A sparse source can never NULL-out or STRIP a field the
28
+ * authoritative fetch set. The entry's freshness is left untouched (never
29
+ * marked stale — it is already managed).
30
+ * - Nested objects (`name`, `_count`, `relationship`) merge field-by-field, so
31
+ * a partial `name`/`_count`/`relationship` never replaces a fuller one.
32
+ * - `relationship` is written ONLY under the viewer-scoped by-username key —
33
+ * the viewer-independent by-id key never stores it (prevents one viewer's
34
+ * follow state from leaking into every other viewer's identity cache).
35
+ * - Anti-degradation: a good `username` / `name.displayName` / `avatar` is
36
+ * never overwritten by a degraded/empty one (empty username, the
37
+ * `'Unknown user'` ghost-author sentinel, `null` avatar).
38
+ *
39
+ * It is a cache write only — zero network, one `setQueryData` per key.
40
+ */
41
+ import type { QueryClient } from '@tanstack/react-query';
42
+ import type { UserNameResponse } from '@oxyhq/contracts';
43
+ /**
44
+ * A user-shaped object that can be upserted into the cache. Intentionally
45
+ * permissive: it covers the SDK `User` PLUS the looser actor objects embedded on
46
+ * posts / notifications / lists, where `name` may be a plain string and the id
47
+ * may arrive as Mongo `_id`. Every field is optional — a sparse feed author is a
48
+ * valid `CacheableUser`. The index signature lets any additional `User` field
49
+ * pass through untouched (so the upsert never has to know the full DTO shape).
50
+ */
51
+ export interface CacheableUser {
52
+ id?: string;
53
+ /** Some sources (post/notification actors) carry the id as Mongo `_id`. */
54
+ _id?: string;
55
+ username?: string;
56
+ /**
57
+ * Canonical structured name (`UserNameResponse`) OR a plain display string on
58
+ * the looser actor objects. Normalized to the object shape on write.
59
+ */
60
+ name?: string | UserNameResponse;
61
+ /** Avatar file id. `null`/`''` are treated as "no avatar" (never degrade). */
62
+ avatar?: string | null;
63
+ /** Social counts. A partial `_count` never replaces a fuller one. */
64
+ _count?: {
65
+ followers?: number;
66
+ following?: number;
67
+ } | null;
68
+ /**
69
+ * Viewer-relative follow relationship. Present ONLY on an authenticated
70
+ * single-profile fetch; `null`/absent for anon/self/bulk/feed. Never stripped
71
+ * from an existing entry by a source that lacks it.
72
+ */
73
+ relationship?: {
74
+ isFollowing?: boolean;
75
+ followsYou?: boolean;
76
+ } | null;
77
+ [key: string]: unknown;
78
+ }
79
+ /**
80
+ * Merge-upsert a (possibly partial) user into the SDK's user query cache under
81
+ * both the by-id key and, when a username is present, the viewer-scoped
82
+ * by-username key.
83
+ *
84
+ * @param queryClient The app's React Query client.
85
+ * @param user A `User`-shaped object (may be sparse).
86
+ * @param viewerId The active viewer id for the by-username key. Defaults to
87
+ * the current auth-store user id.
88
+ */
89
+ export declare function upsertCachedUser(queryClient: QueryClient, user: CacheableUser, viewerId?: string): void;
90
+ /**
91
+ * Batch merge-upsert many users at once (for a feed / list / search response).
92
+ * Resolves the viewer id once and upserts each user cumulatively — a user that
93
+ * appears twice merges both slices into the single cache entry.
94
+ */
95
+ export declare function upsertCachedUsers(queryClient: QueryClient, users: readonly CacheableUser[] | null | undefined, viewerId?: string): void;
96
+ //# sourceMappingURL=userCache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"userCache.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/hooks/queries/userCache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAIzD;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,2EAA2E;IAC3E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAAC;IACjC,8EAA8E;IAC9E,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,qEAAqE;IACrE,MAAM,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC3D;;;;OAIG;IACH,YAAY,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,OAAO,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IACtE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAqLD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,aAAa,EACnB,QAAQ,CAAC,EAAE,MAAM,GAChB,IAAI,CAoBN;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,SAAS,aAAa,EAAE,GAAG,IAAI,GAAG,SAAS,EAClD,QAAQ,CAAC,EAAE,MAAM,GAChB,IAAI,CAMN"}
@@ -1 +1 @@
1
- {"version":3,"file":"useAvatarPicker.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useAvatarPicker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAgB,WAAW,EAAE,MAAM,aAAa,CAAC;AAE7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAItD,UAAU,sBAAsB;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,eAAe,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,WAAW,EAAE,WAAW,CAAC;IACzB,eAAe,EAAE,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,SAAS,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,KAAK,IAAI,CAAC;CAC3F;AAkBD,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,eAAe,EACf,eAAe,EACf,WAAW,EACX,eAAe,GAChB,EAAE,sBAAsB;;EA0FxB"}
1
+ {"version":3,"file":"useAvatarPicker.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useAvatarPicker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAgB,WAAW,EAAE,MAAM,aAAa,CAAC;AAE7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAItD,UAAU,sBAAsB;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,eAAe,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,WAAW,EAAE,WAAW,CAAC;IACzB,eAAe,EAAE,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,SAAS,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,KAAK,IAAI,CAAC;CAC3F;AAkBD,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,eAAe,EACf,eAAe,EACf,WAAW,EACX,eAAe,GAChB,EAAE,sBAAsB;;EA8GxB"}
@@ -11,8 +11,9 @@ export interface UseFileDownloadUrlResult {
11
11
  /**
12
12
  * Hook to resolve a file's download URL asynchronously.
13
13
  *
14
- * Uses `getFileDownloadUrlAsync` first, falling back to the synchronous
15
- * `getFileDownloadUrl` if the async call fails.
14
+ * Uses `getFileDownloadUrlAsync`, which returns a scoped media-token stream URL
15
+ * for private assets. There is no sync CDN fallback — the synchronous
16
+ * `getFileDownloadUrl` is public-CDN-only and 404s for private uploads.
16
17
  */
17
18
  export declare const useFileDownloadUrl: (oxyServices: OxyServices | null | undefined, fileId: string | null | undefined, options?: UseFileDownloadUrlOptions) => UseFileDownloadUrlResult;
18
19
  //# sourceMappingURL=useFileDownloadUrl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFileDownloadUrl.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useFileDownloadUrl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,WAAW,yBAAyB;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACvC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAC7B,aAAa,WAAW,GAAG,IAAI,GAAG,SAAS,EAC3C,QAAQ,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,UAAU,yBAAyB,KAClC,wBA8EF,CAAC"}
1
+ {"version":3,"file":"useFileDownloadUrl.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useFileDownloadUrl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,WAAW,yBAAyB;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACvC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAC7B,aAAa,WAAW,GAAG,IAAI,GAAG,SAAS,EAC3C,QAAQ,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,UAAU,yBAAyB,KAClC,wBA6DF,CAAC"}
@@ -0,0 +1,48 @@
1
+ import type { FileMetadata } from '@oxyhq/core';
2
+ /**
3
+ * The variant-aware batch resolver contract (`@oxyhq/core`).
4
+ *
5
+ * `getFileDownloadUrls` takes a per-file `{ fileId, variant }` list and returns
6
+ * a map keyed by `fileId`; ids that are denied or missing are OMITTED (never an
7
+ * empty string), and PRIVATE assets resolve to a working scoped-media-token
8
+ * stream URL. Typed here rather than `Pick<OxyServices, …>` so this file states
9
+ * the exact contract it depends on.
10
+ */
11
+ export interface AssetUrlBatchResolver {
12
+ getFileDownloadUrls(requests: Array<{
13
+ fileId: string;
14
+ variant?: string;
15
+ }>, options?: {
16
+ expiresIn?: number;
17
+ context?: string;
18
+ }): Promise<Record<string, string>>;
19
+ }
20
+ /** React Query prefix — scoped media URLs must never leak across accounts. */
21
+ export declare const ASSET_DOWNLOAD_URLS_QUERY_KEY: "assetDownloadUrls";
22
+ /**
23
+ * True when a file is an optimistic placeholder that has not been persisted by
24
+ * the server yet — either its id is still the client-minted `temp-…` id, or it
25
+ * carries the `uploading` flag. Mirrors the `temp-` id guard precedent in
26
+ * `@oxyhq/core`'s `avatarUtils.updateAvatarVisibility`.
27
+ */
28
+ export declare function isOptimisticFile(file: Pick<FileMetadata, 'id' | 'metadata'>): boolean;
29
+ /**
30
+ * Resolve the image source for a grid tile.
31
+ *
32
+ * - Optimistic entry → its locally-picked preview uri (never an asset URL).
33
+ * - Persisted entry → the private-safe URL from {@link useResolvedFileUrls},
34
+ * or `undefined` while it is still resolving / was denied (tile shows a
35
+ * placeholder instead of a guaranteed-404 CDN URL).
36
+ */
37
+ export declare function fileThumbSource(file: FileMetadata, resolved: ReadonlyMap<string, string>): string | undefined;
38
+ /**
39
+ * Batch-resolve private-safe thumbnail URLs for the given files.
40
+ *
41
+ * Only image/video, non-optimistic files are resolved (documents render an
42
+ * icon, optimistic entries render their local preview). Returns a stable
43
+ * `Map<fileId, url>`; missing entries mean "not resolved yet or access denied".
44
+ */
45
+ export declare function useResolvedFileUrls(oxyServices: AssetUrlBatchResolver, files: FileMetadata[],
46
+ /** Active viewer account id — media tokens are minted per user; must be in the query key. */
47
+ viewerId?: string | null): ReadonlyMap<string, string>;
48
+ //# sourceMappingURL=useResolvedFileUrls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useResolvedFileUrls.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useResolvedFileUrls.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAqB;IACpC,mBAAmB,CACjB,QAAQ,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EACrD,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GACjD,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACpC;AAiCD,8EAA8E;AAC9E,eAAO,MAAM,6BAA6B,EAAG,mBAA4B,CAAC;AAE1E;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,GAAG,UAAU,CAAC,GAAG,OAAO,CAGrF;AAkBD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACpC,MAAM,GAAG,SAAS,CAKpB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,qBAAqB,EAClC,KAAK,EAAE,YAAY,EAAE;AACrB,6FAA6F;AAC7F,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GACvB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CA0D7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"FileManagementScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/FileManagementScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAgBjF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAgFzE,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAk1D7D,CAAC;AAIF,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"FileManagementScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/FileManagementScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAgBjF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAgFzE,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA82D7D,CAAC;AAIF,eAAe,oBAAoB,CAAC"}
@@ -21,7 +21,7 @@ export interface PhotoPickerViewProps {
21
21
  hasMore: boolean;
22
22
  loadingMore: boolean;
23
23
  reduceMotion: boolean;
24
- getThumbUrl: (file: FileMetadata, variant?: string) => string;
24
+ getThumbUrl: (file: FileMetadata) => string | undefined;
25
25
  primaryColor: string;
26
26
  isOwner: boolean;
27
27
  onTogglePhoto: (photo: FileMetadata) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"PhotoPickerSection.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/screens/fileManagement/PhotoPickerSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAqBvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA6EhD;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACjC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC1D,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9D,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IA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,YAAY,KAAK,MAAM,GAAG,SAAS,CAAC;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAC7C,cAAc,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAC9C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;CACtE;AAoJD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA+TnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useFileUploadState.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/screens/fileManagement/hooks/useFileUploadState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAoB,YAAY,EAAE,MAAM,aAAa,CAAC;AAElE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAElF,OAAO,EACH,KAAK,iBAAiB,EAQzB,MAAM,WAAW,CAAC;AAEnB,8EAA8E;AAC9E,MAAM,WAAW,wBAAwB;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;IACrD,iBAAiB,EAAE,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAC;IACrD,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IACvC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACxC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAClE,SAAS,EAAE,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACtF,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;CACtE;AAED,mDAAmD;AACnD,MAAM,WAAW,wBAAwB;IACrC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,YAAY,EAAE,iBAAiB,EAAE,CAAC;IAClC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,gBAAgB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,mBAAmB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,sKAchC,wBAAwB,KAAG,wBA4a7B,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"useFileUploadState.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/screens/fileManagement/hooks/useFileUploadState.ts"],"names":[],"mappings":"AAAA,OAAO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;IAC3B,gBAAgB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,mBAAmB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,sKAchC,wBAAwB,KAAG,wBAyb7B,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Column / tile geometry for the "Choose photo" grid.
3
+ *
4
+ * CRITICAL: the grid MUST size its tiles from the width of the bottom-sheet
5
+ * container it actually renders in — NOT the device screen. On wide viewports
6
+ * the sheet is centered and narrower than the screen (Bloom `<Dialog>` centers
7
+ * on `md+`), so deriving columns/tiles from `Dimensions.get('window').width`
8
+ * (or `useWindowDimensions`) overflows / mis-sizes the tiles. The caller
9
+ * therefore measures the grid container (`onLayout` on a `style`-only wrapper —
10
+ * RN-Web does not fire `onLayout` for `className`'d nodes) and passes that
11
+ * measured width here.
12
+ *
13
+ * Pure and side-effect free so it is unit-testable in Jest (which cannot catch
14
+ * layout bugs in the rendered tree).
15
+ */
16
+ /** Inter-tile gutter, in px. Apple Photos-style hairline gap. */
17
+ export declare const PHOTO_GRID_GUTTER = 2;
18
+ /** Container width (px) at/above which the grid switches to 4 columns. */
19
+ export declare const PHOTO_GRID_WIDE_BREAKPOINT = 600;
20
+ export interface PhotoGridLayout {
21
+ /** Number of columns for the current container width. */
22
+ columns: number;
23
+ /**
24
+ * Square tile edge in px. Floored so a full row (columns tiles + gutters)
25
+ * never exceeds the container width.
26
+ */
27
+ cellSize: number;
28
+ /** Inter-tile gutter used to derive `cellSize`. */
29
+ gutter: number;
30
+ }
31
+ /**
32
+ * Derive the column count + square tile size from the measured grid-container
33
+ * width. Returns `cellSize: 0` for a not-yet-measured (`<= 0`) width so callers
34
+ * can gate rendering until a real measurement arrives.
35
+ */
36
+ export declare function computePhotoGridLayout(containerWidth: number): PhotoGridLayout;
37
+ //# sourceMappingURL=photoGridLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"photoGridLayout.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/screens/fileManagement/photoGridLayout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,iEAAiE;AACjE,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC,0EAA0E;AAC1E,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAE9C,MAAM,WAAW,eAAe;IAC5B,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,MAAM,GAAG,eAAe,CAK9E"}
@@ -3,14 +3,21 @@ import { type OxyServices, type TokenTransport } from '@oxyhq/core';
3
3
  * Platform `TokenTransport` for `SessionClient` (device-first model).
4
4
  *
5
5
  * `ensureActiveToken` is the fallback the client uses when a `session_state`
6
- * push arrived WITHOUT an embedded `activeToken` and the app currently holds no
7
- * bearer. It mints one through the ONE unified single-flight the scheduler, the
8
- * request-time preflight, and the 401 retry all use —
9
- * `oxyServices.httpService.refreshAccessToken(...)` — which runs the installed
10
- * refresh handler (present the persisted zero-cookie `deviceId` + `deviceSecret`
11
- * at `POST /session/device/token`). Routing through the SAME entry point means
12
- * this lane can never double-rotate the device secret against the others: it has
13
- * NO private single-flight of its own.
6
+ * push arrived WITHOUT an embedded `activeToken` and the planted bearer does not
7
+ * already belong to the state's active account. It mints one through the ONE
8
+ * unified single-flight the scheduler, the request-time preflight, and the 401
9
+ * retry all use — `oxyServices.httpService.refreshAccessToken(...)` — which runs
10
+ * the installed refresh handler (present the persisted zero-cookie `deviceId` +
11
+ * `deviceSecret` at `POST /session/device/token`, which mints for the device's
12
+ * CURRENT active account). Routing through the SAME entry point means this lane
13
+ * can never double-rotate the device secret against the others: it has NO
14
+ * private single-flight of its own.
15
+ *
16
+ * The short-circuit compares the planted bearer's ACCOUNT against
17
+ * `state.activeAccountId`, not mere token presence: a bearer for the PREVIOUS
18
+ * account (an account switch) must still mint the new account's token — skipping
19
+ * on presence alone would leave a subscriber observing the new active account
20
+ * under the old account's bearer (the account-switch 404 race).
14
21
  *
15
22
  * A failure is logged and swallowed: this method must never throw out (it runs
16
23
  * inside the socket state handler).
@@ -1 +1 @@
1
- {"version":3,"file":"tokenTransport.d.ts","sourceRoot":"","sources":["../../../../../src/ui/session/tokenTransport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAG5E;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,GAAG,cAAc,CA0B7E"}
1
+ {"version":3,"file":"tokenTransport.d.ts","sourceRoot":"","sources":["../../../../../src/ui/session/tokenTransport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAG5E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,GAAG,cAAc,CA8B7E"}
@@ -1,4 +1,6 @@
1
- import type { AssetUploadInput, FileMetadata, RNFileDescriptor } from '@oxyhq/core';
1
+ import type { Ionicons } from '@expo/vector-icons';
2
+ import type { AssetUploadInput, RNFileDescriptor } from '@oxyhq/core';
3
+ import type { ComponentProps } from 'react';
2
4
  import type { RouteName } from '../navigation/routes';
3
5
  /**
4
6
  * Extended File interface that includes a `uri` property for mobile preview support.
@@ -32,7 +34,7 @@ export declare function formatFileSize(bytes: number): string;
32
34
  /**
33
35
  * Get icon name for file based on content type
34
36
  */
35
- export declare function getFileIcon(contentType: string): string;
37
+ export declare function getFileIcon(contentType: string): ComponentProps<typeof Ionicons>['name'];
36
38
  /**
37
39
  * Convert a document/image picker asset into a value that
38
40
  * `OxyServices.assetUpload` can accept.
@@ -46,15 +48,6 @@ export declare function getFileIcon(contentType: string): string;
46
48
  * 'ArrayBuffer' and 'ArrayBufferView' are not supported").
47
49
  */
48
50
  export declare function convertDocumentPickerAssetToFile(doc: PickerAsset, index: number): Promise<FileWithUri | RNFileDescriptor | null>;
49
- /**
50
- * Helper to safely request a thumbnail variant only for image mime types.
51
- * Prevents backend warnings: "Variant thumb not supported for mime application/pdf".
52
- *
53
- * @param file - File metadata
54
- * @param variant - Variant type (default: 'thumb')
55
- * @param getFileDownloadUrl - Function to get download URL from oxyServices
56
- */
57
- export declare function getSafeDownloadUrl(file: FileMetadata, variant: string, getFileDownloadUrl: (fileId: string, variant?: string) => string): string;
58
51
  /**
59
52
  * Upload file raw - helper function for file uploads
60
53
  */
@@ -1 +1 @@
1
- {"version":3,"file":"fileManagement.d.ts","sourceRoot":"","sources":["../../../../../src/ui/utils/fileManagement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAIpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD;;;;GAIG;AACH,UAAU,WAAY,SAAQ,IAAI;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,kBA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