@oxyhq/services 6.9.11 → 6.9.13

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 (117) hide show
  1. package/lib/commonjs/ui/components/FollowButton.js +135 -118
  2. package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
  3. package/lib/commonjs/ui/components/GroupedSection.js.map +1 -1
  4. package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
  5. package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -1
  6. package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
  7. package/lib/commonjs/ui/components/payment/PaymentReviewStep.js.map +1 -1
  8. package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js.map +1 -1
  9. package/lib/commonjs/ui/context/hooks/useAuthOperations.js +6 -2
  10. package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
  11. package/lib/commonjs/ui/hooks/mutations/useServicesMutations.js.map +1 -1
  12. package/lib/commonjs/ui/hooks/useAuth.js +9 -3
  13. package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
  14. package/lib/commonjs/ui/hooks/useFollow.js +134 -74
  15. package/lib/commonjs/ui/hooks/useFollow.js.map +1 -1
  16. package/lib/commonjs/ui/hooks/useWebSSO.js.map +1 -1
  17. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +30 -11
  18. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
  19. package/lib/commonjs/ui/screens/FAQScreen.js +1 -0
  20. package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
  21. package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
  22. package/lib/commonjs/ui/screens/FileManagementScreen.js +0 -1
  23. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  24. package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
  25. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  26. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  27. package/lib/commonjs/ui/stores/fileStore.js +6 -6
  28. package/lib/commonjs/ui/stores/fileStore.js.map +1 -1
  29. package/lib/commonjs/ui/utils/fileManagement.js +6 -3
  30. package/lib/commonjs/ui/utils/fileManagement.js.map +1 -1
  31. package/lib/module/ui/components/FollowButton.js +137 -121
  32. package/lib/module/ui/components/FollowButton.js.map +1 -1
  33. package/lib/module/ui/components/GroupedSection.js.map +1 -1
  34. package/lib/module/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
  35. package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -1
  36. package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
  37. package/lib/module/ui/components/payment/PaymentReviewStep.js.map +1 -1
  38. package/lib/module/ui/components/payment/PaymentSummaryStep.js.map +1 -1
  39. package/lib/module/ui/context/hooks/useAuthOperations.js +7 -2
  40. package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
  41. package/lib/module/ui/hooks/mutations/useServicesMutations.js.map +1 -1
  42. package/lib/module/ui/hooks/useAuth.js +9 -3
  43. package/lib/module/ui/hooks/useAuth.js.map +1 -1
  44. package/lib/module/ui/hooks/useFollow.js +132 -72
  45. package/lib/module/ui/hooks/useFollow.js.map +1 -1
  46. package/lib/module/ui/hooks/useWebSSO.js.map +1 -1
  47. package/lib/module/ui/screens/EditProfileFieldScreen.js +30 -11
  48. package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
  49. package/lib/module/ui/screens/FAQScreen.js +1 -0
  50. package/lib/module/ui/screens/FAQScreen.js.map +1 -1
  51. package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
  52. package/lib/module/ui/screens/FileManagementScreen.js +0 -1
  53. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  54. package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
  55. package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  56. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  57. package/lib/module/ui/stores/fileStore.js +6 -6
  58. package/lib/module/ui/stores/fileStore.js.map +1 -1
  59. package/lib/module/ui/utils/fileManagement.js +6 -3
  60. package/lib/module/ui/utils/fileManagement.js.map +1 -1
  61. package/lib/typescript/commonjs/ui/components/FollowButton.d.ts +12 -1
  62. package/lib/typescript/commonjs/ui/components/FollowButton.d.ts.map +1 -1
  63. package/lib/typescript/commonjs/ui/components/GroupedSection.d.ts +5 -0
  64. package/lib/typescript/commonjs/ui/components/GroupedSection.d.ts.map +1 -1
  65. package/lib/typescript/commonjs/ui/components/feedback/types.d.ts +2 -2
  66. package/lib/typescript/commonjs/ui/components/feedback/types.d.ts.map +1 -1
  67. package/lib/typescript/commonjs/ui/components/internal/GroupedPillButtons.d.ts +7 -1
  68. package/lib/typescript/commonjs/ui/components/internal/GroupedPillButtons.d.ts.map +1 -1
  69. package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  70. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
  71. package/lib/typescript/commonjs/ui/hooks/useFollow.d.ts +31 -0
  72. package/lib/typescript/commonjs/ui/hooks/useFollow.d.ts.map +1 -1
  73. package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
  74. package/lib/typescript/commonjs/ui/screens/FAQScreen.d.ts.map +1 -1
  75. package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
  76. package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  77. package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts.map +1 -1
  78. package/lib/typescript/module/ui/components/FollowButton.d.ts +12 -1
  79. package/lib/typescript/module/ui/components/FollowButton.d.ts.map +1 -1
  80. package/lib/typescript/module/ui/components/GroupedSection.d.ts +5 -0
  81. package/lib/typescript/module/ui/components/GroupedSection.d.ts.map +1 -1
  82. package/lib/typescript/module/ui/components/feedback/types.d.ts +2 -2
  83. package/lib/typescript/module/ui/components/feedback/types.d.ts.map +1 -1
  84. package/lib/typescript/module/ui/components/internal/GroupedPillButtons.d.ts +7 -1
  85. package/lib/typescript/module/ui/components/internal/GroupedPillButtons.d.ts.map +1 -1
  86. package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  87. package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
  88. package/lib/typescript/module/ui/hooks/useFollow.d.ts +31 -0
  89. package/lib/typescript/module/ui/hooks/useFollow.d.ts.map +1 -1
  90. package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
  91. package/lib/typescript/module/ui/screens/FAQScreen.d.ts.map +1 -1
  92. package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
  93. package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  94. package/lib/typescript/module/ui/utils/fileManagement.d.ts.map +1 -1
  95. package/package.json +2 -2
  96. package/src/ui/components/FollowButton.tsx +117 -109
  97. package/src/ui/components/GroupedSection.tsx +5 -0
  98. package/src/ui/components/feedback/types.ts +2 -2
  99. package/src/ui/components/fileManagement/FileDetailsModal.tsx +1 -1
  100. package/src/ui/components/fileManagement/UploadPreview.tsx +1 -1
  101. package/src/ui/components/internal/GroupedPillButtons.tsx +17 -8
  102. package/src/ui/components/payment/PaymentReviewStep.tsx +1 -1
  103. package/src/ui/components/payment/PaymentSummaryStep.tsx +1 -1
  104. package/src/ui/context/hooks/useAuthOperations.ts +8 -3
  105. package/src/ui/hooks/mutations/useServicesMutations.ts +3 -3
  106. package/src/ui/hooks/useAuth.ts +10 -4
  107. package/src/ui/hooks/useFollow.ts +161 -74
  108. package/src/ui/hooks/useWebSSO.ts +3 -3
  109. package/src/ui/screens/EditProfileFieldScreen.tsx +28 -16
  110. package/src/ui/screens/FAQScreen.tsx +2 -1
  111. package/src/ui/screens/FeedbackScreen.tsx +7 -7
  112. package/src/ui/screens/FileManagementScreen.tsx +1 -2
  113. package/src/ui/screens/HistoryViewScreen.tsx +5 -1
  114. package/src/ui/screens/PremiumSubscriptionScreen.tsx +1 -1
  115. package/src/ui/screens/karma/KarmaRewardsScreen.tsx +1 -1
  116. package/src/ui/stores/fileStore.ts +9 -9
  117. package/src/ui/utils/fileManagement.ts +16 -10
@@ -5,6 +5,15 @@ import { toast } from '../../lib/sonner';
5
5
  import type { RouteName } from '../navigation/routes';
6
6
  import { updateAvatarVisibility } from '@oxyhq/core';
7
7
 
8
+ /**
9
+ * Extended File interface that includes a `uri` property for mobile preview support.
10
+ * React Native file pickers return URI-based references that need to be preserved
11
+ * on the File object for preview rendering.
12
+ */
13
+ interface FileWithUri extends File {
14
+ uri?: string;
15
+ }
16
+
8
17
  /**
9
18
  * Format file size in bytes to human-readable string
10
19
  */
@@ -69,12 +78,12 @@ export async function convertDocumentPickerAssetToFile(
69
78
  index: number
70
79
  ): Promise<File | null> {
71
80
  try {
72
- let file: File | null = null;
81
+ let file: FileWithUri | null = null;
73
82
 
74
83
  // Priority 1: Use doc.file if available (web native File API)
75
84
  // This is the most efficient path as it doesn't require fetching
76
85
  if (doc.file && doc.file instanceof globalThis.File) {
77
- file = doc.file as File;
86
+ file = doc.file as FileWithUri;
78
87
  // Ensure file has required properties
79
88
  if (!file.name && doc.name) {
80
89
  // Create new File with proper name if missing
@@ -82,8 +91,7 @@ export async function convertDocumentPickerAssetToFile(
82
91
  }
83
92
  // Preserve URI for preview if available (useful for mobile previews)
84
93
  if (doc.uri) {
85
- // biome-ignore lint/suspicious/noExplicitAny: attaching uri for mobile preview on a File object requires dynamic property assignment
86
- (file as any).uri = doc.uri;
94
+ file.uri = doc.uri;
87
95
  }
88
96
  return file;
89
97
  }
@@ -101,10 +109,9 @@ export async function convertDocumentPickerAssetToFile(
101
109
  const blob = await response.blob();
102
110
  const fileName = doc.name || `file-${index + 1}`;
103
111
  const fileType = doc.mimeType || blob.type || 'application/octet-stream';
104
- file = new globalThis.File([blob], fileName, { type: fileType });
112
+ file = new globalThis.File([blob], fileName, { type: fileType }) as FileWithUri;
105
113
  // Preserve URI for preview
106
- // biome-ignore lint/suspicious/noExplicitAny: attaching uri for mobile preview on a File object requires dynamic property assignment
107
- (file as any).uri = doc.uri;
114
+ file.uri = doc.uri;
108
115
  return file;
109
116
  }
110
117
 
@@ -119,10 +126,9 @@ export async function convertDocumentPickerAssetToFile(
119
126
  throw new Error(`Failed to fetch file: ${response.statusText}`);
120
127
  }
121
128
  const blob = await response.blob();
122
- file = new globalThis.File([blob], fileName, { type: fileType });
129
+ file = new globalThis.File([blob], fileName, { type: fileType }) as FileWithUri;
123
130
  // Preserve URI for preview (especially important for mobile)
124
- // biome-ignore lint/suspicious/noExplicitAny: attaching uri for mobile preview on a File object requires dynamic property assignment
125
- (file as any).uri = doc.uri;
131
+ file.uri = doc.uri;
126
132
  return file;
127
133
  } catch (error: unknown) {
128
134
  console.error('Failed to read file from URI:', error);