@oxyhq/services 10.2.10 → 10.3.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.
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/components/ActingAsBanner.js +2 -1
- package/lib/commonjs/ui/components/ActingAsBanner.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +107 -1
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/StepBasedScreen.js +19 -10
- package/lib/commonjs/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +38 -122
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +9 -7
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/commonjs/ui/hooks/useDeviceAccounts.js +20 -25
- package/lib/commonjs/ui/hooks/useDeviceAccounts.js.map +1 -1
- package/lib/commonjs/ui/hooks/useFollow.js +7 -0
- package/lib/commonjs/ui/hooks/useFollow.js.map +1 -1
- package/lib/commonjs/ui/hooks/useFollow.types.js +4 -0
- package/lib/commonjs/ui/hooks/useProfileEditing.js +19 -10
- package/lib/commonjs/ui/hooks/useProfileEditing.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +1 -2
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +1 -2
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +11 -13
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +2 -3
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HelpSupportScreen.js +2 -2
- package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +2 -2
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +2 -3
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +2 -2
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +1 -2
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/NotificationsScreen.js +2 -2
- package/lib/commonjs/ui/screens/NotificationsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +2 -2
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PreferencesScreen.js +2 -2
- package/lib/commonjs/ui/screens/PreferencesScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +4 -3
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +3 -4
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +2 -2
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustFAQScreen.js +2 -2
- package/lib/commonjs/ui/screens/trust/TrustFAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +2 -2
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/stores/authStore.js.map +1 -1
- package/lib/commonjs/ui/stores/followStore.js +68 -0
- package/lib/commonjs/ui/stores/followStore.js.map +1 -1
- package/lib/commonjs/ui/utils/avatarUtils.js +1 -1
- package/lib/commonjs/ui/utils/avatarUtils.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/ActingAsBanner.js +2 -1
- package/lib/module/ui/components/ActingAsBanner.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +109 -3
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/StepBasedScreen.js +19 -10
- package/lib/module/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +38 -122
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/module/ui/hooks/mutations/useAccountMutations.js +9 -7
- package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/module/ui/hooks/useDeviceAccounts.js +20 -25
- package/lib/module/ui/hooks/useDeviceAccounts.js.map +1 -1
- package/lib/module/ui/hooks/useFollow.js +7 -0
- package/lib/module/ui/hooks/useFollow.js.map +1 -1
- package/lib/module/ui/hooks/useFollow.types.js +2 -0
- package/lib/module/ui/hooks/useProfileEditing.js +19 -10
- package/lib/module/ui/hooks/useProfileEditing.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/ConnectedAppsScreen.js +1 -1
- package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +10 -11
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/NotificationsScreen.js +1 -1
- package/lib/module/ui/screens/NotificationsScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/PreferencesScreen.js +1 -1
- package/lib/module/ui/screens/PreferencesScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +5 -4
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +2 -3
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustCenterScreen.js +1 -1
- package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustFAQScreen.js +1 -1
- package/lib/module/ui/screens/trust/TrustFAQScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js +1 -1
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/module/ui/stores/authStore.js.map +1 -1
- package/lib/module/ui/stores/followStore.js +68 -0
- package/lib/module/ui/stores/followStore.js.map +1 -1
- package/lib/module/ui/utils/avatarUtils.js +1 -1
- package/lib/module/ui/utils/avatarUtils.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +1 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ActingAsBanner.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/FollowButton.d.ts +24 -4
- package/lib/typescript/commonjs/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/StepBasedScreen.d.ts +5 -3
- package/lib/typescript/commonjs/ui/components/StepBasedScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts +1 -1
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts +52 -6
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useDeviceAccounts.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useFollow.d.ts +3 -1
- package/lib/typescript/commonjs/ui/hooks/useFollow.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useFollow.types.d.ts +2 -0
- package/lib/typescript/commonjs/ui/hooks/useFollow.types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useProfileEditing.d.ts +22 -18
- package/lib/typescript/commonjs/ui/hooks/useProfileEditing.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/stores/authStore.d.ts +2 -10
- package/lib/typescript/commonjs/ui/stores/authStore.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/stores/followStore.d.ts +2 -1
- package/lib/typescript/commonjs/ui/stores/followStore.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +0 -1
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/avatarUtils.d.ts +2 -1
- package/lib/typescript/commonjs/ui/utils/avatarUtils.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +1 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ActingAsBanner.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/FollowButton.d.ts +24 -4
- package/lib/typescript/module/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/StepBasedScreen.d.ts +5 -3
- package/lib/typescript/module/ui/components/StepBasedScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts +1 -1
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +52 -6
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useDeviceAccounts.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useFollow.d.ts +3 -1
- package/lib/typescript/module/ui/hooks/useFollow.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useFollow.types.d.ts +2 -0
- package/lib/typescript/module/ui/hooks/useFollow.types.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useProfileEditing.d.ts +22 -18
- package/lib/typescript/module/ui/hooks/useProfileEditing.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/stores/authStore.d.ts +2 -10
- package/lib/typescript/module/ui/stores/authStore.d.ts.map +1 -1
- package/lib/typescript/module/ui/stores/followStore.d.ts +2 -1
- package/lib/typescript/module/ui/stores/followStore.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts +0 -1
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/avatarUtils.d.ts +2 -1
- package/lib/typescript/module/ui/utils/avatarUtils.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/index.ts +1 -0
- package/src/ui/components/ActingAsBanner.tsx +2 -4
- package/src/ui/components/FollowButton.tsx +154 -10
- package/src/ui/components/StepBasedScreen.tsx +37 -22
- package/src/ui/context/hooks/useAuthOperations.ts +51 -144
- package/src/ui/hooks/mutations/useAccountMutations.ts +9 -8
- package/src/ui/hooks/useDeviceAccounts.ts +20 -24
- package/src/ui/hooks/useFollow.ts +8 -1
- package/src/ui/hooks/useFollow.types.ts +3 -0
- package/src/ui/hooks/useProfileEditing.ts +43 -30
- package/src/ui/screens/AppInfoScreen.tsx +1 -1
- package/src/ui/screens/ConnectedAppsScreen.tsx +1 -1
- package/src/ui/screens/EditProfileFieldScreen.tsx +24 -14
- package/src/ui/screens/FeedbackScreen.tsx +1 -1
- package/src/ui/screens/HelpSupportScreen.tsx +1 -1
- package/src/ui/screens/HistoryViewScreen.tsx +1 -1
- package/src/ui/screens/LanguageSelectorScreen.tsx +1 -1
- package/src/ui/screens/LegalDocumentsScreen.tsx +1 -1
- package/src/ui/screens/ManageAccountScreen.tsx +1 -1
- package/src/ui/screens/NotificationsScreen.tsx +1 -1
- package/src/ui/screens/PaymentGatewayScreen.tsx +1 -1
- package/src/ui/screens/PreferencesScreen.tsx +1 -1
- package/src/ui/screens/ProfileScreen.tsx +4 -4
- package/src/ui/screens/SavesCollectionsScreen.tsx +3 -6
- package/src/ui/screens/trust/TrustCenterScreen.tsx +1 -1
- package/src/ui/screens/trust/TrustFAQScreen.tsx +1 -1
- package/src/ui/screens/trust/TrustRewardsScreen.tsx +1 -1
- package/src/ui/stores/authStore.ts +4 -13
- package/src/ui/stores/followStore.ts +47 -1
- package/src/ui/types/navigation.ts +0 -4
- package/src/ui/utils/avatarUtils.ts +3 -2
- package/lib/commonjs/ui/styles/spacing.js +0 -68
- package/lib/commonjs/ui/styles/spacing.js.map +0 -1
- package/lib/commonjs/ui/utils/themeUtils.js +0 -37
- package/lib/commonjs/ui/utils/themeUtils.js.map +0 -1
- package/lib/module/ui/styles/spacing.js +0 -16
- package/lib/module/ui/styles/spacing.js.map +0 -1
- package/lib/module/ui/utils/themeUtils.js +0 -13
- package/lib/module/ui/utils/themeUtils.js.map +0 -1
- package/lib/typescript/commonjs/ui/styles/spacing.d.ts +0 -13
- package/lib/typescript/commonjs/ui/styles/spacing.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/utils/themeUtils.d.ts +0 -11
- package/lib/typescript/commonjs/ui/utils/themeUtils.d.ts.map +0 -1
- package/lib/typescript/module/ui/styles/spacing.d.ts +0 -13
- package/lib/typescript/module/ui/styles/spacing.d.ts.map +0 -1
- package/lib/typescript/module/ui/utils/themeUtils.d.ts +0 -11
- package/lib/typescript/module/ui/utils/themeUtils.d.ts.map +0 -1
- package/src/ui/styles/spacing.ts +0 -22
- package/src/ui/utils/themeUtils.ts +0 -18
|
@@ -2,7 +2,51 @@ import type { AssetUploadInput, NotificationPreferences, PrivacySettings, User,
|
|
|
2
2
|
/**
|
|
3
3
|
* Update user profile with optimistic updates and offline queue support
|
|
4
4
|
*/
|
|
5
|
-
export declare const useUpdateProfile: () => import("@tanstack/react-query").UseMutationResult<User, Error,
|
|
5
|
+
export declare const useUpdateProfile: () => import("@tanstack/react-query").UseMutationResult<User, Error, import("zod").objectOutputType<{
|
|
6
|
+
name: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
7
|
+
first: import("zod").ZodOptional<import("zod").ZodString>;
|
|
8
|
+
last: import("zod").ZodOptional<import("zod").ZodString>;
|
|
9
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
10
|
+
first?: string | undefined;
|
|
11
|
+
last?: string | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
first?: string | undefined;
|
|
14
|
+
last?: string | undefined;
|
|
15
|
+
}>>;
|
|
16
|
+
username: import("zod").ZodOptional<import("zod").ZodString>;
|
|
17
|
+
email: import("zod").ZodOptional<import("zod").ZodString>;
|
|
18
|
+
avatar: import("zod").ZodOptional<import("zod").ZodString>;
|
|
19
|
+
color: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
20
|
+
bio: import("zod").ZodOptional<import("zod").ZodString>;
|
|
21
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
22
|
+
location: import("zod").ZodOptional<import("zod").ZodString>;
|
|
23
|
+
locations: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodUnknown, "many">>;
|
|
24
|
+
links: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
25
|
+
linksMetadata: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
26
|
+
url: import("zod").ZodString;
|
|
27
|
+
title: import("zod").ZodOptional<import("zod").ZodString>;
|
|
28
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
29
|
+
image: import("zod").ZodOptional<import("zod").ZodString>;
|
|
30
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
31
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
32
|
+
url: string;
|
|
33
|
+
id?: string | undefined;
|
|
34
|
+
description?: string | undefined;
|
|
35
|
+
title?: string | undefined;
|
|
36
|
+
image?: string | undefined;
|
|
37
|
+
}, {
|
|
38
|
+
url: string;
|
|
39
|
+
id?: string | undefined;
|
|
40
|
+
description?: string | undefined;
|
|
41
|
+
title?: string | undefined;
|
|
42
|
+
image?: string | undefined;
|
|
43
|
+
}>, "many">>;
|
|
44
|
+
language: import("zod").ZodOptional<import("zod").ZodString>;
|
|
45
|
+
accountExpiresAfterInactivityDays: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
|
|
46
|
+
notificationPreferences: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
47
|
+
userPreferences: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
48
|
+
privacySettings: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
49
|
+
}, import("zod").ZodTypeAny, "passthrough">, {
|
|
6
50
|
previousUser: User | undefined;
|
|
7
51
|
}>;
|
|
8
52
|
/**
|
|
@@ -117,19 +161,21 @@ export declare const useUpdateAccountSettings: () => {
|
|
|
117
161
|
publicKey: string;
|
|
118
162
|
username: string;
|
|
119
163
|
email?: string;
|
|
120
|
-
avatar?: string;
|
|
121
|
-
color?: string;
|
|
122
|
-
name
|
|
164
|
+
avatar?: string | null;
|
|
165
|
+
color?: string | null;
|
|
166
|
+
name: import("@oxyhq/contracts").UserNameResponse;
|
|
123
167
|
bio?: string;
|
|
124
168
|
location?: string;
|
|
125
169
|
website?: string;
|
|
126
170
|
createdAt?: string;
|
|
127
171
|
updatedAt?: string;
|
|
128
|
-
links?:
|
|
172
|
+
links?: string[];
|
|
173
|
+
linksMetadata?: Array<{
|
|
174
|
+
url: string;
|
|
129
175
|
title?: string;
|
|
130
176
|
description?: string;
|
|
131
177
|
image?: string;
|
|
132
|
-
|
|
178
|
+
id?: string;
|
|
133
179
|
}>;
|
|
134
180
|
_count?: {
|
|
135
181
|
followers?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAccountMutations.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/hooks/mutations/useAccountMutations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,IAAI,EACJ,eAAe,EAChB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"useAccountMutations.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/hooks/mutations/useAccountMutations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,IAAI,EACJ,eAAe,EAChB,MAAM,aAAa,CAAC;AAerB;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;aAsOY,CAAC;YAClC,CAAL;;aAEK,CAAN;YAAkC,CAAC;;;;;;;;;;;;;;;;;;;UAoBzB,CAAV;mBAEM,CAAD;aAGc,CAAC;aAEH,CAAC;;;UACc,CAAC;mBAC7B,CAAN;aAAmC,CAAC;aACX,CAAC;;;;;;;;;EAzKzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe;SAMQ,MAAM;WAAS,MAAM;WAAS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AAG,IAAI,CAAC;AAE7D;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC1B,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,SAAS,EAAE,OAAO,CAAC;IACnB,6EAA6E;IAC7E,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,oFAAoF;IACpF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,gFAAgF;IAChF,IAAI,EAAE,iBAAiB,CAAC;CAC3B;AAED,MAAM,WAAW,uBAAuB;IACpC,kFAAkF;IAClF,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,8CAA8C;IAC9C,SAAS,EAAE,OAAO,CAAC;IACnB,4EAA4E;IAC5E,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC;;;;;OAKG;IACH,cAAc,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAC9B,QAAQ,EAAE,aAAa,EAAE,EACzB,eAAe,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC1C,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACrC,eAAe,EAAE,OAAO,GACzB,aAAa,EAAE,CAiCjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,iBAAiB,IAAI,uBAAuB,CA4J3D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type OxyServices } from '@oxyhq/core';
|
|
1
|
+
import { type OxyServices, type BulkFollowResult } from '@oxyhq/core';
|
|
2
2
|
/**
|
|
3
3
|
* useFollow — Hook for follow state management.
|
|
4
4
|
*
|
|
@@ -31,6 +31,7 @@ export declare const useFollow: (userId?: string | string[]) => {
|
|
|
31
31
|
setFollowStatusForUser?: undefined;
|
|
32
32
|
fetchStatusForUser?: undefined;
|
|
33
33
|
fetchAllStatuses?: undefined;
|
|
34
|
+
followAllUsers?: undefined;
|
|
34
35
|
clearErrorForUser?: undefined;
|
|
35
36
|
isAnyLoading?: undefined;
|
|
36
37
|
hasAnyError?: undefined;
|
|
@@ -46,6 +47,7 @@ export declare const useFollow: (userId?: string | string[]) => {
|
|
|
46
47
|
setFollowStatusForUser: (targetUserId: string, following: boolean) => void;
|
|
47
48
|
fetchStatusForUser: (targetUserId: string) => Promise<void>;
|
|
48
49
|
fetchAllStatuses: () => Promise<void>;
|
|
50
|
+
followAllUsers: () => Promise<BulkFollowResult>;
|
|
49
51
|
clearErrorForUser: (targetUserId: string) => void;
|
|
50
52
|
isAnyLoading: boolean;
|
|
51
53
|
hasAnyError: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFollow.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useFollow.ts"],"names":[],"mappings":"AAGA,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"useFollow.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useFollow.ts"],"names":[],"mappings":"AAGA,OAAO,EAAwB,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG5F;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS,GAAI,SAAS,MAAM,GAAG,MAAM,EAAE;;;;;iCA+DF,OAAO;;;;;;;8BAqBV,MAAM;+BAKL,MAAM;;;;;;;;;;;;;;qBA5DN,OAAO;mBAAa,OAAO;eAAS,MAAM,GAAG,IAAI;;wCA6ElC,MAAM;2CAMT,MAAM,aAAa,OAAO;uCAIxB,MAAM;;0BAYrB,OAAO,CAAC,gBAAgB,CAAC;sCAKjB,MAAM;;;;;;;;;;;;;;;;;;CAwC5D,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,MAAM,EAAE,aAAa,WAAW;;;;;;iCAoBzB,OAAO;;CAiBxD,CAAC;AAGF,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM;;;;;8BAiBD,MAAM;+BAIL,MAAM;CAYrD,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BulkFollowResult } from '@oxyhq/core';
|
|
1
2
|
export type SingleFollowResult = {
|
|
2
3
|
isFollowing: boolean;
|
|
3
4
|
isLoading: boolean;
|
|
@@ -23,6 +24,7 @@ export type MultiFollowResult = {
|
|
|
23
24
|
setFollowStatusForUser: (userId: string, following: boolean) => void;
|
|
24
25
|
fetchStatusForUser: (userId: string) => Promise<void>;
|
|
25
26
|
fetchAllStatuses: () => Promise<void>;
|
|
27
|
+
followAllUsers: () => Promise<BulkFollowResult>;
|
|
26
28
|
clearErrorForUser: (userId: string) => void;
|
|
27
29
|
isAnyLoading: boolean;
|
|
28
30
|
hasAnyError: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFollow.types.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useFollow.types.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,YAAY,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,eAAe,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,cAAc,EAAE,MAAM,GAAG,IAAI,CAA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CAAC;IAC5C,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,kBAAkB,GAAG,iBAAiB,CAAC"}
|
|
@@ -1,36 +1,40 @@
|
|
|
1
|
+
interface ProfileLocation {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
coordinates?: {
|
|
6
|
+
lat: number;
|
|
7
|
+
lon: number;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
interface ProfileLinkMetadata {
|
|
11
|
+
url: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
image?: string;
|
|
15
|
+
id: string;
|
|
16
|
+
}
|
|
1
17
|
export interface ProfileUpdateData {
|
|
2
|
-
|
|
18
|
+
firstName?: string;
|
|
3
19
|
lastName?: string;
|
|
4
20
|
username?: string;
|
|
5
21
|
email?: string;
|
|
6
22
|
bio?: string;
|
|
7
23
|
location?: string;
|
|
8
|
-
locations?:
|
|
9
|
-
id: string;
|
|
10
|
-
name: string;
|
|
11
|
-
label?: string;
|
|
12
|
-
coordinates?: {
|
|
13
|
-
lat: number;
|
|
14
|
-
lon: number;
|
|
15
|
-
};
|
|
16
|
-
}>;
|
|
24
|
+
locations?: ProfileLocation[];
|
|
17
25
|
links?: string[];
|
|
18
|
-
linksMetadata?:
|
|
19
|
-
url: string;
|
|
20
|
-
title?: string;
|
|
21
|
-
description?: string;
|
|
22
|
-
image?: string;
|
|
23
|
-
id: string;
|
|
24
|
-
}>;
|
|
26
|
+
linksMetadata?: ProfileLinkMetadata[];
|
|
25
27
|
avatar?: string;
|
|
26
28
|
}
|
|
29
|
+
type ProfileFieldValue = string | ProfileLocation[] | ProfileLinkMetadata[];
|
|
27
30
|
/**
|
|
28
31
|
* Hook for managing profile editing operations
|
|
29
32
|
* Provides functions to update profile fields and handle saving
|
|
30
33
|
*/
|
|
31
34
|
export declare const useProfileEditing: () => {
|
|
32
35
|
saveProfile: (updates: ProfileUpdateData) => Promise<boolean>;
|
|
33
|
-
updateField: (field: string, value:
|
|
36
|
+
updateField: (field: string, value: ProfileFieldValue) => Promise<boolean>;
|
|
34
37
|
isSaving: boolean;
|
|
35
38
|
};
|
|
39
|
+
export {};
|
|
36
40
|
//# sourceMappingURL=useProfileEditing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProfileEditing.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useProfileEditing.ts"],"names":[],"mappings":"AAKA,
|
|
1
|
+
{"version":3,"file":"useProfileEditing.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useProfileEditing.ts"],"names":[],"mappings":"AAKA,UAAU,eAAe;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9C;AAED,UAAU,mBAAmB;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,eAAe,EAAE,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,aAAa,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,KAAK,iBAAiB,GAAG,MAAM,GAAG,eAAe,EAAE,GAAG,mBAAmB,EAAE,CAAC;AAU5E;;;GAGG;AACH,eAAO,MAAM,iBAAiB;2BAMsB,iBAAiB;yBAqDnB,MAAM,SAAS,iBAAiB;;CAyCjF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditProfileFieldScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/EditProfileFieldScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAczE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAU3D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACtB,aAAa,GACb,UAAU,GACV,OAAO,GACP,KAAK,GACL,OAAO,GACP,SAAS,GACT,UAAU,GACV,UAAU,GACV,WAAW,GACX,OAAO,CAAC;AAmBd,UAAU,2BAA4B,SAAQ,eAAe;IACzD,6BAA6B;IAC7B,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAChC;;
|
|
1
|
+
{"version":3,"file":"EditProfileFieldScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/EditProfileFieldScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAczE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAU3D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACtB,aAAa,GACb,UAAU,GACV,OAAO,GACP,KAAK,GACL,OAAO,GACP,SAAS,GACT,UAAU,GACV,UAAU,GACV,WAAW,GACX,OAAO,CAAC;AAmBd,UAAU,2BAA4B,SAAQ,eAAe;IACzD,6BAA6B;IAC7B,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAChC;;AA+nBD,wBAAkD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SavesCollectionsScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/SavesCollectionsScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAQnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;;
|
|
1
|
+
{"version":3,"file":"SavesCollectionsScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/SavesCollectionsScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAQnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;;AAmN3D,wBAAkD"}
|
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
import type { User } from '@oxyhq/core';
|
|
2
|
-
type LegacyUserIdentity = Partial<Omit<User, 'id' | 'publicKey' | 'username'>> & {
|
|
3
|
-
id?: string;
|
|
4
|
-
_id: string;
|
|
5
|
-
publicKey: string;
|
|
6
|
-
username: string;
|
|
7
|
-
};
|
|
8
|
-
type AuthStoreUserInput = User | LegacyUserIdentity;
|
|
9
2
|
export interface AuthState {
|
|
10
3
|
user: User | null;
|
|
11
4
|
isAuthenticated: boolean;
|
|
12
5
|
isLoading: boolean;
|
|
13
6
|
error: string | null;
|
|
14
7
|
lastUserFetch: number | null;
|
|
15
|
-
loginSuccess: (user:
|
|
8
|
+
loginSuccess: (user: User) => void;
|
|
16
9
|
loginFailure: (error: string) => void;
|
|
17
10
|
logout: () => void;
|
|
18
11
|
fetchUser: (oxyServices: {
|
|
19
12
|
getCurrentUser: () => Promise<User>;
|
|
20
13
|
}, forceRefresh?: boolean) => Promise<void>;
|
|
21
|
-
setUser: (user:
|
|
14
|
+
setUser: (user: User) => void;
|
|
22
15
|
}
|
|
23
16
|
export declare const useAuthStore: import("zustand").UseBoundStore<import("zustand").StoreApi<AuthState>>;
|
|
24
|
-
export {};
|
|
25
17
|
//# sourceMappingURL=authStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authStore.d.ts","sourceRoot":"","sources":["../../../../../src/ui/stores/authStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAIxC,
|
|
1
|
+
{"version":3,"file":"authStore.d.ts","sourceRoot":"","sources":["../../../../../src/ui/stores/authStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAIxC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,SAAS,EAAE,CAAC,WAAW,EAAE;QAAE,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,EAAE,YAAY,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3G,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CAC/B;AAED,eAAO,MAAM,YAAY,wEA0CtB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OxyServices } from '@oxyhq/core';
|
|
1
|
+
import type { OxyServices, BulkFollowResult } from '@oxyhq/core';
|
|
2
2
|
interface FollowState {
|
|
3
3
|
followingUsers: Record<string, boolean>;
|
|
4
4
|
loadingUsers: Record<string, boolean>;
|
|
@@ -12,6 +12,7 @@ interface FollowState {
|
|
|
12
12
|
resetFollowState: () => void;
|
|
13
13
|
fetchFollowStatus: (userId: string, oxyServices: OxyServices) => Promise<void>;
|
|
14
14
|
toggleFollowUser: (userId: string, oxyServices: OxyServices, isCurrentlyFollowing: boolean) => Promise<void>;
|
|
15
|
+
followManyUsers: (userIds: string[], oxyServices: OxyServices) => Promise<BulkFollowResult>;
|
|
15
16
|
setFollowerCount: (userId: string, count: number) => void;
|
|
16
17
|
setFollowingCount: (userId: string, count: number) => void;
|
|
17
18
|
updateCountsFromFollowAction: (targetUserId: string, action: 'follow' | 'unfollow', counts: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"followStore.d.ts","sourceRoot":"","sources":["../../../../../src/ui/stores/followStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"followStore.d.ts","sourceRoot":"","sources":["../../../../../src/ui/stores/followStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEjE,UAAU,WAAW;IACnB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;IAEtC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAExC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,kBAAkB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;IACnE,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/E,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,oBAAoB,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7G,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,WAAW,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAE5F,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,4BAA4B,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAG,UAAU,EAAE,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,EAAE,aAAa,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACtK,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9E;AAED,eAAO,MAAM,cAAc,0EAuMxB,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ReactNode, RefObject } from 'react';
|
|
2
2
|
import type { QueryClient } from '@tanstack/react-query';
|
|
3
3
|
import type { RouteName } from '../navigation/routes';
|
|
4
|
-
export type { RouteName };
|
|
5
4
|
export interface StepController {
|
|
6
5
|
canGoBack: () => boolean;
|
|
7
6
|
goBack: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../../../src/ui/types/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../../../src/ui/types/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAItD,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,MAAM,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAE5B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACxE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,eAAe,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAG9C,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAGlC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACrD,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAGjE,aAAa,CAAC,EAAE,SAAS,CAAC;IAG1B,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAGnD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IAMtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC7B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { OxyServices, User } from '@oxyhq/core';
|
|
2
|
+
import type { UserProfileUpdate } from '@oxyhq/contracts';
|
|
2
3
|
import type { QueryClient } from '@tanstack/react-query';
|
|
3
4
|
/**
|
|
4
5
|
* Refreshes avatar in accountStore with cache-busted URL to force image reload.
|
|
@@ -19,5 +20,5 @@ export declare function refreshAvatarInStore(sessionId: string, avatarFileId: st
|
|
|
19
20
|
* @param syncSession - Optional function to sync session/refresh token when auth errors occur
|
|
20
21
|
* @returns Promise that resolves with updated user data
|
|
21
22
|
*/
|
|
22
|
-
export declare function updateProfileWithAvatar(updates:
|
|
23
|
+
export declare function updateProfileWithAvatar(updates: UserProfileUpdate, oxyServices: OxyServices, activeSessionId: string | null, queryClient: QueryClient, syncSession?: () => Promise<User>): Promise<User>;
|
|
23
24
|
//# sourceMappingURL=avatarUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatarUtils.d.ts","sourceRoot":"","sources":["../../../../../src/ui/utils/avatarUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"avatarUtils.d.ts","sourceRoot":"","sources":["../../../../../src/ui/utils/avatarUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGzD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,WAAW,GACvB,IAAI,CAON;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,iBAAiB,EAC1B,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,MAAM,GAAG,IAAI,EAC9B,WAAW,EAAE,WAAW,EACxB,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAChC,OAAO,CAAC,IAAI,CAAC,CA2Bf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxyhq/services",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.3.0",
|
|
4
4
|
"description": "OxyHQ Expo/React Native SDK — UI components, screens, and native features",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -107,6 +107,7 @@
|
|
|
107
107
|
},
|
|
108
108
|
"dependencies": {
|
|
109
109
|
"@lottiefiles/dotlottie-react": "^0.13.5",
|
|
110
|
+
"@oxyhq/contracts": "^0.1.1",
|
|
110
111
|
"@react-native-async-storage/async-storage": "2.2.0",
|
|
111
112
|
"@types/react": "*",
|
|
112
113
|
"copyfiles": "^2.4.1",
|
|
@@ -160,7 +161,7 @@
|
|
|
160
161
|
"peerDependencies": {
|
|
161
162
|
"@expo/vector-icons": "^15.0.3",
|
|
162
163
|
"@oxyhq/bloom": ">=0.5.0",
|
|
163
|
-
"@oxyhq/core": "^3.
|
|
164
|
+
"@oxyhq/core": "^3.5.0",
|
|
164
165
|
"@react-native-community/netinfo": "^11.4.1",
|
|
165
166
|
"@tanstack/query-async-storage-persister": "^5.100",
|
|
166
167
|
"@tanstack/query-sync-storage-persister": "^5.100",
|
package/src/index.ts
CHANGED
|
@@ -193,6 +193,7 @@ export { OxyAuthPrompt } from './ui/components/OxyAuthPrompt';
|
|
|
193
193
|
export type { OxyAuthPromptProps } from './ui/components/OxyAuthPrompt';
|
|
194
194
|
export { default as OxyLogo } from './ui/components/OxyLogo';
|
|
195
195
|
export { default as FollowButton } from './ui/components/FollowButton';
|
|
196
|
+
export type { FollowButtonProps, SingleFollowButtonProps, MultiFollowButtonProps } from './ui/components/FollowButton';
|
|
196
197
|
export { LogoIcon } from './ui/components/logo/LogoIcon';
|
|
197
198
|
export { LogoText } from './ui/components/logo/LogoText';
|
|
198
199
|
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
} from 'react-native';
|
|
10
10
|
import { useTheme } from '@oxyhq/bloom/theme';
|
|
11
11
|
import { useOxy } from '../context/OxyContext';
|
|
12
|
+
import { getAccountDisplayName } from '@oxyhq/core';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* ActingAsBanner - Shows a subtle banner when the user is acting as a managed account.
|
|
@@ -33,10 +34,7 @@ const ActingAsBanner: React.FC = () => {
|
|
|
33
34
|
return null;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
const displayName =
|
|
37
|
-
typeof activeAccount.name === 'object'
|
|
38
|
-
? activeAccount.name.full || activeAccount.name.first || activeAccount.username
|
|
39
|
-
: activeAccount.name || activeAccount.username;
|
|
37
|
+
const displayName = getAccountDisplayName(activeAccount);
|
|
40
38
|
|
|
41
39
|
const handlePress = () => {
|
|
42
40
|
showBottomSheet?.('ManageAccount');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useEffect, useCallback, memo } from 'react';
|
|
1
|
+
import React, { useEffect, useCallback, useMemo, useState, memo } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
TouchableOpacity,
|
|
4
4
|
Text,
|
|
@@ -10,23 +10,51 @@ import {
|
|
|
10
10
|
} from 'react-native';
|
|
11
11
|
import { useOxy } from '../context/OxyContext';
|
|
12
12
|
import { toast } from '@oxyhq/bloom';
|
|
13
|
-
import { useFollowForButton } from '../hooks/useFollow';
|
|
13
|
+
import { useFollow, useFollowForButton } from '../hooks/useFollow';
|
|
14
14
|
import { useTheme } from '@oxyhq/bloom/theme';
|
|
15
|
-
import type { OxyServices } from '@oxyhq/core';
|
|
15
|
+
import type { OxyServices, BulkFollowResult } from '@oxyhq/core';
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const DEFAULT_FOLLOW_ALL_LABEL = 'Follow all';
|
|
18
|
+
const DEFAULT_FOLLOWED_ALL_LABEL = 'Following';
|
|
19
|
+
|
|
20
|
+
/** Props shared by both single- and multi-user follow modes. */
|
|
21
|
+
interface FollowButtonBaseProps {
|
|
20
22
|
size?: 'small' | 'medium' | 'large';
|
|
21
|
-
onFollowChange?: (isFollowing: boolean) => void;
|
|
22
23
|
style?: StyleProp<ViewStyle>;
|
|
23
24
|
textStyle?: StyleProp<TextStyle>;
|
|
24
25
|
disabled?: boolean;
|
|
25
26
|
showLoadingState?: boolean;
|
|
26
27
|
preventParentActions?: boolean;
|
|
27
28
|
theme?: 'light' | 'dark';
|
|
29
|
+
onFollowChange?: (isFollowing: boolean) => void;
|
|
28
30
|
}
|
|
29
31
|
|
|
32
|
+
/** Single-user mode — follows/unfollows one user (existing behavior). */
|
|
33
|
+
export interface SingleFollowButtonProps extends FollowButtonBaseProps {
|
|
34
|
+
userId: string;
|
|
35
|
+
initiallyFollowing?: boolean;
|
|
36
|
+
userIds?: never;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Multi-user mode — follows MANY users in one "Follow all" action (follow-only). */
|
|
40
|
+
export interface MultiFollowButtonProps extends FollowButtonBaseProps {
|
|
41
|
+
userIds: string[];
|
|
42
|
+
initiallyAllFollowing?: boolean;
|
|
43
|
+
followAllLabel?: string;
|
|
44
|
+
followedAllLabel?: string;
|
|
45
|
+
onBulkFollow?: (result: BulkFollowResult) => void;
|
|
46
|
+
userId?: never;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* FollowButton accepts EITHER single-user mode (`userId`) or multi-user mode
|
|
51
|
+
* (`userIds`), never both. Existing `{ userId, ... }` callers remain valid.
|
|
52
|
+
*/
|
|
53
|
+
export type FollowButtonProps = SingleFollowButtonProps | MultiFollowButtonProps;
|
|
54
|
+
|
|
55
|
+
const isMultiMode = (props: FollowButtonProps): props is MultiFollowButtonProps =>
|
|
56
|
+
'userIds' in props && Array.isArray(props.userIds);
|
|
57
|
+
|
|
30
58
|
const FollowButtonInner = memo(function FollowButtonInner({
|
|
31
59
|
userId,
|
|
32
60
|
oxyServices,
|
|
@@ -38,7 +66,7 @@ const FollowButtonInner = memo(function FollowButtonInner({
|
|
|
38
66
|
disabled = false,
|
|
39
67
|
showLoadingState = true,
|
|
40
68
|
preventParentActions = true,
|
|
41
|
-
}:
|
|
69
|
+
}: SingleFollowButtonProps & { oxyServices: OxyServices }) {
|
|
42
70
|
const { colors } = useTheme();
|
|
43
71
|
|
|
44
72
|
const {
|
|
@@ -107,13 +135,129 @@ const FollowButtonInner = memo(function FollowButtonInner({
|
|
|
107
135
|
);
|
|
108
136
|
});
|
|
109
137
|
|
|
138
|
+
const FollowButtonMultiInner = memo(function FollowButtonMultiInner({
|
|
139
|
+
userIds,
|
|
140
|
+
initiallyAllFollowing = false,
|
|
141
|
+
size = 'medium',
|
|
142
|
+
followAllLabel = DEFAULT_FOLLOW_ALL_LABEL,
|
|
143
|
+
followedAllLabel = DEFAULT_FOLLOWED_ALL_LABEL,
|
|
144
|
+
onFollowChange,
|
|
145
|
+
onBulkFollow,
|
|
146
|
+
style,
|
|
147
|
+
textStyle,
|
|
148
|
+
disabled = false,
|
|
149
|
+
showLoadingState = true,
|
|
150
|
+
preventParentActions = true,
|
|
151
|
+
}: MultiFollowButtonProps) {
|
|
152
|
+
const { colors } = useTheme();
|
|
153
|
+
const follow = useFollow(userIds);
|
|
154
|
+
const followAllUsers = 'followAllUsers' in follow ? follow.followAllUsers : undefined;
|
|
155
|
+
const isAnyLoading = 'isAnyLoading' in follow ? follow.isAnyLoading : false;
|
|
156
|
+
|
|
157
|
+
const [allFollowing, setAllFollowing] = useState(initiallyAllFollowing);
|
|
158
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
159
|
+
|
|
160
|
+
const isLoading = isSubmitting || isAnyLoading;
|
|
161
|
+
|
|
162
|
+
const handlePress = useCallback(async (event?: { preventDefault?: () => void; stopPropagation?: () => void }) => {
|
|
163
|
+
if (preventParentActions && event?.preventDefault) {
|
|
164
|
+
event.preventDefault();
|
|
165
|
+
event.stopPropagation?.();
|
|
166
|
+
}
|
|
167
|
+
if (disabled || isLoading || allFollowing || !followAllUsers) return;
|
|
168
|
+
|
|
169
|
+
setIsSubmitting(true);
|
|
170
|
+
try {
|
|
171
|
+
const result = await followAllUsers();
|
|
172
|
+
const allAlreadyFollowing = result.followedCount === 0
|
|
173
|
+
&& result.results.length > 0
|
|
174
|
+
&& result.results.every((entry) => entry.alreadyFollowing);
|
|
175
|
+
const anyFollowed = result.followedCount > 0
|
|
176
|
+
|| result.results.some((entry) => entry.success || entry.alreadyFollowing);
|
|
177
|
+
|
|
178
|
+
if (allAlreadyFollowing || anyFollowed) {
|
|
179
|
+
setAllFollowing(true);
|
|
180
|
+
onFollowChange?.(true);
|
|
181
|
+
}
|
|
182
|
+
onBulkFollow?.(result);
|
|
183
|
+
} catch (err: unknown) {
|
|
184
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
185
|
+
toast.error(error.message || 'Failed to update follow status');
|
|
186
|
+
} finally {
|
|
187
|
+
setIsSubmitting(false);
|
|
188
|
+
}
|
|
189
|
+
}, [disabled, isLoading, allFollowing, followAllUsers, onFollowChange, onBulkFollow, preventParentActions]);
|
|
190
|
+
|
|
191
|
+
const baseButtonStyle = getBaseButtonStyle(size, style);
|
|
192
|
+
const baseTextStyle = getBaseTextStyle(size, textStyle);
|
|
193
|
+
|
|
194
|
+
return (
|
|
195
|
+
<TouchableOpacity
|
|
196
|
+
className={allFollowing
|
|
197
|
+
? 'bg-background border-border'
|
|
198
|
+
: 'bg-primary border-primary'
|
|
199
|
+
}
|
|
200
|
+
style={baseButtonStyle}
|
|
201
|
+
onPress={handlePress}
|
|
202
|
+
disabled={disabled || isLoading || allFollowing}
|
|
203
|
+
activeOpacity={0.8}
|
|
204
|
+
>
|
|
205
|
+
{showLoadingState && isLoading ? (
|
|
206
|
+
<ActivityIndicator
|
|
207
|
+
size="small"
|
|
208
|
+
color={allFollowing ? colors.text : colors.negativeForeground}
|
|
209
|
+
/>
|
|
210
|
+
) : (
|
|
211
|
+
<Text
|
|
212
|
+
className={allFollowing ? 'text-foreground' : 'text-primary-foreground'}
|
|
213
|
+
style={baseTextStyle}
|
|
214
|
+
>
|
|
215
|
+
{allFollowing ? followedAllLabel : followAllLabel}
|
|
216
|
+
</Text>
|
|
217
|
+
)}
|
|
218
|
+
</TouchableOpacity>
|
|
219
|
+
);
|
|
220
|
+
});
|
|
221
|
+
|
|
110
222
|
const FollowButton: React.FC<FollowButtonProps> = (props) => {
|
|
111
223
|
const { oxyServices, canUsePrivateApi, user: currentUser } = useOxy();
|
|
112
224
|
|
|
113
225
|
const currentUserId = currentUser?.id ? String(currentUser.id).trim() : '';
|
|
114
|
-
const targetUserId = props.userId ? String(props.userId).trim() : '';
|
|
115
226
|
|
|
116
|
-
|
|
227
|
+
const rawUserIds = isMultiMode(props) ? props.userIds : null;
|
|
228
|
+
|
|
229
|
+
// Multi-user mode: dedupe, trim, drop the current user, and bail if empty.
|
|
230
|
+
const multiUserIds = useMemo(() => {
|
|
231
|
+
if (!rawUserIds) return [];
|
|
232
|
+
const seen = new Set<string>();
|
|
233
|
+
const cleaned: string[] = [];
|
|
234
|
+
for (const raw of rawUserIds) {
|
|
235
|
+
const id = raw ? String(raw).trim() : '';
|
|
236
|
+
if (!id || id === currentUserId || seen.has(id)) continue;
|
|
237
|
+
seen.add(id);
|
|
238
|
+
cleaned.push(id);
|
|
239
|
+
}
|
|
240
|
+
return cleaned;
|
|
241
|
+
}, [rawUserIds, currentUserId]);
|
|
242
|
+
|
|
243
|
+
if (!canUsePrivateApi) {
|
|
244
|
+
return null;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
if (isMultiMode(props)) {
|
|
248
|
+
if (multiUserIds.length === 0) {
|
|
249
|
+
return null;
|
|
250
|
+
}
|
|
251
|
+
return (
|
|
252
|
+
<FollowButtonMultiInner
|
|
253
|
+
{...props}
|
|
254
|
+
userIds={multiUserIds}
|
|
255
|
+
/>
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
const targetUserId = props.userId ? String(props.userId).trim() : '';
|
|
260
|
+
if (!targetUserId || (currentUserId && currentUserId === targetUserId)) {
|
|
117
261
|
return null;
|
|
118
262
|
}
|
|
119
263
|
|