@oxy.so/services 14.6.0 → 14.7.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/assets/assets/fonts/icons/OxyServicesIonicons.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/icons/OxyServicesMaterialCommunityIcons.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/icons/manifest.json +5 -4
- package/lib/commonjs/assets/fonts/icons/OxyServicesIonicons.ttf +0 -0
- package/lib/commonjs/assets/fonts/icons/OxyServicesMaterialCommunityIcons.ttf +0 -0
- package/lib/commonjs/assets/fonts/icons/manifest.json +5 -4
- package/lib/commonjs/ui/hooks/useProfileEditing.js +11 -0
- package/lib/commonjs/ui/hooks/useProfileEditing.js.map +1 -1
- package/lib/commonjs/ui/icons/subsetGlyphMaps.js +1 -0
- package/lib/commonjs/ui/icons/subsetGlyphMaps.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +47 -0
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileScreen.js +8 -0
- package/lib/commonjs/ui/screens/EditProfileScreen.js.map +1 -1
- package/lib/module/assets/assets/fonts/icons/OxyServicesIonicons.ttf +0 -0
- package/lib/module/assets/assets/fonts/icons/OxyServicesMaterialCommunityIcons.ttf +0 -0
- package/lib/module/assets/assets/fonts/icons/manifest.json +5 -4
- package/lib/module/assets/fonts/icons/OxyServicesIonicons.ttf +0 -0
- package/lib/module/assets/fonts/icons/OxyServicesMaterialCommunityIcons.ttf +0 -0
- package/lib/module/assets/fonts/icons/manifest.json +5 -4
- package/lib/module/ui/hooks/useProfileEditing.js +11 -0
- package/lib/module/ui/hooks/useProfileEditing.js.map +1 -1
- package/lib/module/ui/icons/subsetGlyphMaps.js +1 -0
- package/lib/module/ui/icons/subsetGlyphMaps.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +48 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileScreen.js +8 -0
- package/lib/module/ui/screens/EditProfileScreen.js.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts +2 -0
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useProfileEditing.d.ts +2 -0
- package/lib/typescript/commonjs/ui/hooks/useProfileEditing.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/icons/MaterialCommunityIcons.d.ts +1 -1
- package/lib/typescript/commonjs/ui/icons/MaterialCommunityIcons.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/icons/subsetGlyphMaps.d.ts +1 -0
- package/lib/typescript/commonjs/ui/icons/subsetGlyphMaps.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/identityCrypto.d.ts +0 -1
- package/lib/typescript/commonjs/ui/utils/identityCrypto.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +2 -0
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useProfileEditing.d.ts +2 -0
- package/lib/typescript/module/ui/hooks/useProfileEditing.d.ts.map +1 -1
- package/lib/typescript/module/ui/icons/MaterialCommunityIcons.d.ts +1 -1
- package/lib/typescript/module/ui/icons/MaterialCommunityIcons.d.ts.map +1 -1
- package/lib/typescript/module/ui/icons/subsetGlyphMaps.d.ts +1 -0
- package/lib/typescript/module/ui/icons/subsetGlyphMaps.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/EditProfileScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/identityCrypto.d.ts +0 -1
- package/lib/typescript/module/ui/utils/identityCrypto.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/assets/fonts/icons/OxyServicesIonicons.ttf +0 -0
- package/src/assets/fonts/icons/OxyServicesMaterialCommunityIcons.ttf +0 -0
- package/src/assets/fonts/icons/manifest.json +5 -4
- package/src/ui/hooks/useProfileEditing.ts +14 -1
- package/src/ui/icons/subsetGlyphMaps.ts +1 -0
- package/src/ui/screens/EditProfileFieldScreen.tsx +71 -2
- package/src/ui/screens/EditProfileScreen.tsx +11 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxy.so/services",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.7.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",
|
|
@@ -178,12 +178,12 @@
|
|
|
178
178
|
"dependencies": {
|
|
179
179
|
"@oxy.so/contracts": "^6.11.0",
|
|
180
180
|
"color": "^5.0.3",
|
|
181
|
-
"@peable.to/sdk": "^
|
|
181
|
+
"@peable.to/sdk": "^4.0.0"
|
|
182
182
|
},
|
|
183
183
|
"devDependencies": {
|
|
184
184
|
"@expo/app-integrity": "~58.0.2",
|
|
185
185
|
"@expo/vector-icons": "^15.1.1",
|
|
186
|
-
"@oxy.so/core": "7.
|
|
186
|
+
"@oxy.so/core": "7.28.0",
|
|
187
187
|
"@react-native-async-storage/async-storage": "^3.1.1",
|
|
188
188
|
"@react-native-community/netinfo": "^12.0.1",
|
|
189
189
|
"@react-native/babel-preset": "^0.88.1",
|
|
Binary file
|
|
Binary file
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"fontFamily": "OxyServicesIonicons",
|
|
7
7
|
"file": "src/assets/fonts/icons/OxyServicesIonicons.ttf",
|
|
8
8
|
"bytes": 42552,
|
|
9
|
-
"sha256": "
|
|
9
|
+
"sha256": "e96171a1057f9bdd8c84f4bda471bba65eefee63b00aefd88a04f06b12fbb84d",
|
|
10
10
|
"names": [
|
|
11
11
|
"add",
|
|
12
12
|
"add-circle-outline",
|
|
@@ -152,8 +152,8 @@
|
|
|
152
152
|
"materialCommunityIcons": {
|
|
153
153
|
"fontFamily": "OxyServicesMaterialCommunityIcons",
|
|
154
154
|
"file": "src/assets/fonts/icons/OxyServicesMaterialCommunityIcons.ttf",
|
|
155
|
-
"bytes":
|
|
156
|
-
"sha256": "
|
|
155
|
+
"bytes": 29268,
|
|
156
|
+
"sha256": "51b5f47ec2eaf09a7ef0d8f4400350c854805698fb139afa0e9f31f29479165e",
|
|
157
157
|
"names": [
|
|
158
158
|
"account",
|
|
159
159
|
"account-circle",
|
|
@@ -165,6 +165,7 @@
|
|
|
165
165
|
"account-plus",
|
|
166
166
|
"account-search",
|
|
167
167
|
"account-switch",
|
|
168
|
+
"account-voice",
|
|
168
169
|
"alert",
|
|
169
170
|
"alert-circle",
|
|
170
171
|
"alert-circle-outline",
|
|
@@ -353,5 +354,5 @@
|
|
|
353
354
|
}
|
|
354
355
|
},
|
|
355
356
|
"glyphMapsFile": "src/ui/icons/subsetGlyphMaps.ts",
|
|
356
|
-
"glyphMapsSha256": "
|
|
357
|
+
"glyphMapsSha256": "8aef398b9836d5501ff4cdc2f0b13b36e9f42fa5a118833312d6a8847f6b61ff"
|
|
357
358
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
2
|
import { useUpdateProfile } from './mutations/useAccountMutations';
|
|
3
3
|
import { useAuthStore } from '../stores/authStore';
|
|
4
|
-
import type { UserProfileUpdate } from '@oxy.so/contracts';
|
|
4
|
+
import type { Pronouns, UserProfileUpdate } from '@oxy.so/contracts';
|
|
5
|
+
import { PRONOUNS } from '@oxy.so/contracts/client';
|
|
5
6
|
|
|
6
7
|
interface ProfileLocation {
|
|
7
8
|
id: string;
|
|
@@ -32,10 +33,15 @@ export interface ProfileUpdateData {
|
|
|
32
33
|
address?: string;
|
|
33
34
|
birthday?: string;
|
|
34
35
|
dateOfBirth?: string;
|
|
36
|
+
pronouns?: Pronouns;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
type ProfileFieldValue = string | ProfileLocation[] | ProfileLinkMetadata[];
|
|
38
40
|
|
|
41
|
+
function isPronouns(value: string): value is Pronouns {
|
|
42
|
+
return (PRONOUNS as readonly string[]).includes(value);
|
|
43
|
+
}
|
|
44
|
+
|
|
39
45
|
function isProfileLocationArray(value: ProfileFieldValue): value is ProfileLocation[] {
|
|
40
46
|
return (
|
|
41
47
|
Array.isArray(value) &&
|
|
@@ -102,6 +108,9 @@ export const useProfileEditing = () => {
|
|
|
102
108
|
// field.
|
|
103
109
|
updateData.dateOfBirth = updates.dateOfBirth === '' ? null : updates.dateOfBirth;
|
|
104
110
|
}
|
|
111
|
+
if (updates.pronouns !== undefined) {
|
|
112
|
+
updateData.pronouns = updates.pronouns;
|
|
113
|
+
}
|
|
105
114
|
|
|
106
115
|
// Handle name field
|
|
107
116
|
if (updates.firstName !== undefined || updates.lastName !== undefined) {
|
|
@@ -162,6 +171,10 @@ export const useProfileEditing = () => {
|
|
|
162
171
|
if (typeof value !== 'string') return false;
|
|
163
172
|
updates.birthday = value;
|
|
164
173
|
break;
|
|
174
|
+
case 'pronouns':
|
|
175
|
+
if (typeof value !== 'string' || !isPronouns(value)) return false;
|
|
176
|
+
updates.pronouns = value;
|
|
177
|
+
break;
|
|
165
178
|
case 'dateOfBirth':
|
|
166
179
|
// '' clears it (the picker's "no complete date selected"
|
|
167
180
|
// state) — `updateUserProfile`'s `dateOfBirth` block treats
|
|
@@ -9,7 +9,21 @@ import { PhoneInput, COUNTRIES, findCountry } from '@oxy.so/bloom/phone-input';
|
|
|
9
9
|
import { Textarea } from '@oxy.so/bloom/textarea';
|
|
10
10
|
import { DatePicker } from '@oxy.so/bloom/date-picker';
|
|
11
11
|
import { Field } from '@oxy.so/bloom/field';
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
Select,
|
|
14
|
+
SelectContent,
|
|
15
|
+
SelectIcon,
|
|
16
|
+
SelectItem,
|
|
17
|
+
SelectItemIndicator,
|
|
18
|
+
SelectItemText,
|
|
19
|
+
SelectTrigger,
|
|
20
|
+
SelectValue,
|
|
21
|
+
} from '@oxy.so/bloom/select';
|
|
22
|
+
import {
|
|
23
|
+
PRONOUNS,
|
|
24
|
+
USERNAME_MAX_LENGTH,
|
|
25
|
+
stripDisallowedUsernameCharacters,
|
|
26
|
+
} from '@oxy.so/contracts/client';
|
|
13
27
|
import { useUsernameAvailability } from '../hooks/useUsernameAvailability';
|
|
14
28
|
import { GroupedSection, GroupedSectionItem } from '@oxy.so/bloom/grouped-section';
|
|
15
29
|
import type { User } from '@oxy.so/core';
|
|
@@ -43,7 +57,8 @@ export type ProfileFieldType =
|
|
|
43
57
|
| 'birthday'
|
|
44
58
|
| 'location'
|
|
45
59
|
| 'locations'
|
|
46
|
-
| 'links'
|
|
60
|
+
| 'links'
|
|
61
|
+
| 'pronouns';
|
|
47
62
|
|
|
48
63
|
/**
|
|
49
64
|
* Field configuration for each field type
|
|
@@ -157,6 +172,9 @@ function buildInitialProfileState(
|
|
|
157
172
|
case 'address':
|
|
158
173
|
fieldValues.address = String(userData.address || '');
|
|
159
174
|
break;
|
|
175
|
+
case 'pronouns':
|
|
176
|
+
fieldValues.pronouns = userData.pronouns ?? 'unspecified';
|
|
177
|
+
break;
|
|
160
178
|
case 'username':
|
|
161
179
|
case 'bio':
|
|
162
180
|
case 'phone':
|
|
@@ -230,6 +248,16 @@ const EditProfileFieldScreen: React.FC<EditProfileFieldScreenProps> = ({
|
|
|
230
248
|
const invalidNameMessage =
|
|
231
249
|
t(`editProfile.items.displayName.${accountNameInvalidKey(kind)}`) ||
|
|
232
250
|
accountNameInvalidMessage(kind);
|
|
251
|
+
// The closed pronoun list, labelled for the picker in the active language.
|
|
252
|
+
const pronounItems = useMemo(
|
|
253
|
+
() =>
|
|
254
|
+
PRONOUNS.map((value) => ({
|
|
255
|
+
value,
|
|
256
|
+
label: t(`editProfile.items.pronouns.options.${value}`) || value,
|
|
257
|
+
})),
|
|
258
|
+
[t],
|
|
259
|
+
);
|
|
260
|
+
|
|
233
261
|
// Get field configuration based on fieldType
|
|
234
262
|
const fieldConfig = useMemo((): FieldConfig => {
|
|
235
263
|
switch (fieldType) {
|
|
@@ -299,6 +327,18 @@ const EditProfileFieldScreen: React.FC<EditProfileFieldScreenProps> = ({
|
|
|
299
327
|
},
|
|
300
328
|
],
|
|
301
329
|
};
|
|
330
|
+
case 'pronouns':
|
|
331
|
+
return {
|
|
332
|
+
title: t('editProfile.items.pronouns.title') || 'Pronouns',
|
|
333
|
+
subtitle: t('editProfile.items.pronouns.subtitle') || 'How people should refer to you',
|
|
334
|
+
fields: [
|
|
335
|
+
{
|
|
336
|
+
key: 'pronouns',
|
|
337
|
+
label: t('editProfile.items.pronouns.label') || 'Pronouns',
|
|
338
|
+
placeholder: '',
|
|
339
|
+
},
|
|
340
|
+
],
|
|
341
|
+
};
|
|
302
342
|
case 'phone':
|
|
303
343
|
return {
|
|
304
344
|
title: t('editProfile.items.phone.title') || 'Phone Number',
|
|
@@ -529,6 +569,35 @@ const EditProfileFieldScreen: React.FC<EditProfileFieldScreenProps> = ({
|
|
|
529
569
|
: undefined
|
|
530
570
|
: undefined);
|
|
531
571
|
|
|
572
|
+
if (field.key === 'pronouns') {
|
|
573
|
+
const chosen = fieldValues.pronouns || 'unspecified';
|
|
574
|
+
return (
|
|
575
|
+
<Field key={field.key} label={field.label} disabled={isSaving}>
|
|
576
|
+
<Select
|
|
577
|
+
value={chosen}
|
|
578
|
+
disabled={isSaving}
|
|
579
|
+
onValueChange={(value) => handleFieldChange('pronouns', value)}
|
|
580
|
+
>
|
|
581
|
+
<SelectTrigger>
|
|
582
|
+
<SelectValue>
|
|
583
|
+
{() => pronounItems.find((item) => item.value === chosen)?.label ?? chosen}
|
|
584
|
+
</SelectValue>
|
|
585
|
+
<SelectIcon />
|
|
586
|
+
</SelectTrigger>
|
|
587
|
+
<SelectContent
|
|
588
|
+
label={field.label}
|
|
589
|
+
items={pronounItems}
|
|
590
|
+
renderItem={(item) => (
|
|
591
|
+
<SelectItem value={item.value} label={item.label}>
|
|
592
|
+
<SelectItemIndicator />
|
|
593
|
+
<SelectItemText>{item.label}</SelectItemText>
|
|
594
|
+
</SelectItem>
|
|
595
|
+
)}
|
|
596
|
+
/>
|
|
597
|
+
</Select>
|
|
598
|
+
</Field>
|
|
599
|
+
);
|
|
600
|
+
}
|
|
532
601
|
if (field.key === 'phone') {
|
|
533
602
|
return (
|
|
534
603
|
<PhoneInput
|
|
@@ -114,6 +114,17 @@ const EditProfileScreen: React.FC<BaseScreenProps> = ({ navigate }) => {
|
|
|
114
114
|
description={user?.bio || notSet}
|
|
115
115
|
onPress={() => goToField('bio')}
|
|
116
116
|
/>
|
|
117
|
+
{/* Pronouns name a person; an organization, channel, bot or project has none. */}
|
|
118
|
+
{user?.kind === 'personal' && (
|
|
119
|
+
<GroupedSectionItem
|
|
120
|
+
icon={<SettingsIcon name="account-voice" color={bloomTheme.colors.info} />}
|
|
121
|
+
title={t('editProfile.items.pronouns.title') || 'Pronouns'}
|
|
122
|
+
description={
|
|
123
|
+
t(`editProfile.items.pronouns.options.${user.pronouns ?? 'unspecified'}`) || notSet
|
|
124
|
+
}
|
|
125
|
+
onPress={() => goToField('pronouns')}
|
|
126
|
+
/>
|
|
127
|
+
)}
|
|
117
128
|
<GroupedSectionItem
|
|
118
129
|
icon={<SettingsIcon name="map-marker" color={bloomTheme.colors.info} />}
|
|
119
130
|
title={t('editProfile.items.address.title') || 'Address'}
|