@adminide-stack/yantra-mobile 12.0.162-alpha.1 → 12.0.162
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/components/CustomDrawer.js +70 -3
- package/lib/components/CustomDrawer.js.map +1 -1
- package/lib/compute.js +3 -1
- package/lib/config/env-config.js +4 -0
- package/lib/config/env-config.js.map +1 -1
- package/lib/features/credits/credits.js +151 -0
- package/lib/features/credits/credits.js.map +1 -0
- package/lib/features/credits/useLlmCredits.js +87 -0
- package/lib/features/credits/useLlmCredits.js.map +1 -0
- package/lib/features/design/surface/agentWriter.js +39 -0
- package/lib/features/design/surface/agentWriter.js.map +1 -0
- package/lib/features/design/surface/brandKit.js +9 -3
- package/lib/features/design/surface/brandKit.js.map +1 -1
- package/lib/features/design/surface/useBrandKitInUse.js.map +1 -1
- package/lib/features/design/surface/useDesignSurface.js +5 -39
- package/lib/features/design/surface/useDesignSurface.js.map +1 -1
- package/lib/features/webbuilder/WebBuilderExperience.js +64 -23
- package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
- package/lib/features/webbuilder/brandKitMove.js +52 -0
- package/lib/features/webbuilder/brandKitMove.js.map +1 -0
- package/lib/features/webbuilder/codeToolbox.js +129 -0
- package/lib/features/webbuilder/codeToolbox.js.map +1 -0
- package/lib/features/webbuilder/components/CloudSheet.js +1451 -0
- package/lib/features/webbuilder/components/CloudSheet.js.map +1 -0
- package/lib/features/webbuilder/components/CodeActionsSheet.js +125 -0
- package/lib/features/webbuilder/components/CodeActionsSheet.js.map +1 -0
- package/lib/features/webbuilder/components/CodeView.js +10 -3
- package/lib/features/webbuilder/components/CodeView.js.map +1 -1
- package/lib/features/webbuilder/components/Composer.js.map +1 -1
- package/lib/features/webbuilder/components/IntegrationsPanel.js +643 -0
- package/lib/features/webbuilder/components/IntegrationsPanel.js.map +1 -0
- package/lib/features/webbuilder/components/ProjectChat.js +57 -44
- package/lib/features/webbuilder/components/ProjectChat.js.map +1 -1
- package/lib/features/webbuilder/components/SecretsSheet.js +235 -0
- package/lib/features/webbuilder/components/SecretsSheet.js.map +1 -0
- package/lib/features/webbuilder/components/StudioHome.js +38 -1
- package/lib/features/webbuilder/components/StudioHome.js.map +1 -1
- package/lib/features/webbuilder/studioCatalog.js +4 -19
- package/lib/features/webbuilder/studioCatalog.js.map +1 -1
- package/lib/features/webbuilder/web/data/cloud.js +387 -0
- package/lib/features/webbuilder/web/data/cloud.js.map +1 -0
- package/lib/features/webbuilder/web/data/dataApi.js +227 -0
- package/lib/features/webbuilder/web/data/dataApi.js.map +1 -0
- package/lib/features/webbuilder/web/data/database.js +190 -0
- package/lib/features/webbuilder/web/data/database.js.map +1 -0
- package/lib/features/webbuilder/web/data/graphql.js +95 -0
- package/lib/features/webbuilder/web/data/graphql.js.map +1 -0
- package/lib/features/webbuilder/web/design/directions.js +343 -0
- package/lib/features/webbuilder/web/design/directions.js.map +1 -0
- package/lib/features/webbuilder/web/integrations/appToken.js +165 -0
- package/lib/features/webbuilder/web/integrations/appToken.js.map +1 -0
- package/lib/features/webbuilder/web/integrations/catalog.js +238 -0
- package/lib/features/webbuilder/web/integrations/catalog.js.map +1 -0
- package/lib/features/webbuilder/web/integrations/siteBilling.js +67 -0
- package/lib/features/webbuilder/web/integrations/siteBilling.js.map +1 -0
- package/lib/features/webbuilder/web/integrations/siteMail.js +190 -0
- package/lib/features/webbuilder/web/integrations/siteMail.js.map +1 -0
- package/lib/features/webbuilder/web/project/projectSettings.js +11 -0
- package/lib/features/webbuilder/web/project/projectSettings.js.map +1 -0
- package/lib/features/webbuilder/web/project/restorePoint.js +16 -0
- package/lib/features/webbuilder/web/project/restorePoint.js.map +1 -0
- package/lib/features/webbuilder/web/project/serverSettings.js +157 -0
- package/lib/features/webbuilder/web/project/serverSettings.js.map +1 -0
- package/lib/features/webbuilder/web/secrets/secrets.js +162 -0
- package/lib/features/webbuilder/web/secrets/secrets.js.map +1 -0
- package/lib/features/webbuilder/web/secrets/secretsApi.js +302 -0
- package/lib/features/webbuilder/web/secrets/secretsApi.js.map +1 -0
- package/lib/features/webbuilder/web/secrets/secretsStore.js +39 -0
- package/lib/features/webbuilder/web/secrets/secretsStore.js.map +1 -0
- package/lib/features/webbuilder/web/sharing/okResult.js +40 -0
- package/lib/features/webbuilder/web/sharing/okResult.js.map +1 -0
- package/lib/features/webbuilder/web/sharing/roles.js +3 -0
- package/lib/features/webbuilder/web/sharing/roles.js.map +1 -0
- package/lib/features/webbuilder/web/state/storageKeys.js +59 -0
- package/lib/features/webbuilder/web/state/storageKeys.js.map +1 -0
- package/lib/features/webbuilder/web/webServices.js +282 -0
- package/lib/features/webbuilder/web/webServices.js.map +1 -0
- package/lib/features/webbuilder/workflow.js +1 -1
- package/lib/features/webbuilder/workflow.js.map +1 -1
- package/lib/routes.json +3 -1
- package/lib/screens/Account/AccountSheets.js +1049 -0
- package/lib/screens/Account/AccountSheets.js.map +1 -0
- package/lib/screens/Account/WorkspaceSection.js +271 -0
- package/lib/screens/Account/WorkspaceSection.js.map +1 -0
- package/lib/screens/Account/accountRules.js +103 -0
- package/lib/screens/Account/accountRules.js.map +1 -0
- package/lib/screens/Account/index.js +563 -259
- package/lib/screens/Account/index.js.map +1 -1
- package/lib/screens/Account/useAccountPreferences.js +87 -0
- package/lib/screens/Account/useAccountPreferences.js.map +1 -0
- package/lib/screens/WebBuilderNative/index.js +1 -1
- package/lib/screens/WebBuilderNative/index.js.map +1 -1
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js +122 -12
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js.map +1 -1
- package/lib/utils/authUserDisplay.js +1 -9
- package/lib/utils/authUserDisplay.js.map +1 -1
- package/package.json +4 -4
- package/lib/features/webbuilder/brandKitStorage.js +0 -69
- package/lib/features/webbuilder/brandKitStorage.js.map +0 -1
- package/lib/features/webbuilder/components/BrandKitSheet.js +0 -197
- package/lib/features/webbuilder/components/BrandKitSheet.js.map +0 -1
- package/lib/screens/Account/splitDisplayName.js +0 -15
- package/lib/screens/Account/splitDisplayName.js.map +0 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {jsxs,jsx}from'react/jsx-runtime';import {useState,
|
|
1
|
+
import {jsxs,Fragment,jsx}from'react/jsx-runtime';import {useMemo,useState,useCallback,useEffect,useRef}from'react';import {Animated,Easing,BackHandler,Linking,Alert,Pressable,StyleSheet,View,ScrollView,ActivityIndicator,Switch}from'react-native';import {Ionicons}from'@expo/vector-icons';import {Text}from'@admin-layout/gluestack-ui-mobile';import {useNavigation,useRoute,CommonActions}from'@react-navigation/native';import {useSafeAreaInsets,SafeAreaView}from'react-native-safe-area-context';import {useDispatch,useSelector}from'react-redux';import {userSelector,logoutAndRedirect}from'@adminide-stack/user-auth0-client';import {useAccountProfileQuery,useGetExtendedUserAccountQuery,useCountriesQuery,useDeleteUserAccountMutation}from'common/graphql';import {ProfileAvatar}from'../../components/ProfileAvatar.js';import {config}from'../../config/env-config.js';import {ChatModelSheet}from'../../features/chat/ChatModelSheet.js';import {useChatModelId,CHAT_MODELS}from'../../features/chat/chatModelPick.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import {mobileTokens,mobileColors}from'../../theme/mobileTokens.js';import {useAppTheme}from'../../theme/AppThemeProvider.js';import {pickPrimaryDisplayName,pickProfilePhotoUrl}from'../../utils/authUserDisplay.js';import {useHealthSync,healthSyncStore}from'../../features/health/healthSync.js';import {useDevices}from'../../features/devices/devices.js';import {AvatarSheet,NameSheet,UsernameSheet,GenderSheet,DobSheet,EmailSheet,PhoneSheet,PickerSheet}from'./AccountSheets.js';import {maskPhoneNumber,formatPhoneCode,genderLabel,formatDob,languageLabel,RESPONSE_LANGUAGES}from'./accountRules.js';import {useAccountPreferences}from'./useAccountPreferences.js';import {WorkspaceSection}from'./WorkspaceSection.js';var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
2
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
6
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -14,14 +16,197 @@ var __spreadValues = (a, b) => {
|
|
|
14
16
|
}
|
|
15
17
|
return a;
|
|
16
18
|
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
const PAGE_TITLES = {
|
|
21
|
+
home: "Account",
|
|
22
|
+
profile: "Personal information",
|
|
23
|
+
workspace: "Workspace",
|
|
24
|
+
preferences: "Preferences",
|
|
25
|
+
ai: "Artificial intelligence"
|
|
26
|
+
};
|
|
27
|
+
const TILE = {
|
|
28
|
+
brand: mobileTokens.color.primary,
|
|
29
|
+
blue: "#3B82F6",
|
|
30
|
+
indigo: "#6366F1",
|
|
31
|
+
violet: "#8B5CF6",
|
|
32
|
+
teal: "#14B8A6",
|
|
33
|
+
green: "#10B981",
|
|
34
|
+
pink: "#EC4899",
|
|
35
|
+
amber: "#F59E0B",
|
|
36
|
+
slate: "#64748B",
|
|
37
|
+
red: "#EF4444"
|
|
38
|
+
};
|
|
39
|
+
const WORKSPACE_ICONS = {
|
|
40
|
+
Organization: {
|
|
41
|
+
icon: "business",
|
|
42
|
+
tint: TILE.indigo
|
|
43
|
+
},
|
|
44
|
+
Project: {
|
|
45
|
+
icon: "folder",
|
|
46
|
+
tint: TILE.blue
|
|
47
|
+
},
|
|
48
|
+
Environment: {
|
|
49
|
+
icon: "layers",
|
|
50
|
+
tint: TILE.teal
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
function palette(isDark) {
|
|
54
|
+
const colors = mobileColors(isDark);
|
|
55
|
+
return __spreadProps(__spreadValues({}, colors), {
|
|
56
|
+
page: isDark ? "#0b1120" : "#F4F3F0",
|
|
57
|
+
card: isDark ? "#151e2f" : "#FFFFFF",
|
|
58
|
+
separator: isDark ? "rgba(148,163,184,0.16)" : "rgba(15,23,42,0.07)",
|
|
59
|
+
pressed: isDark ? "rgba(148,163,184,0.12)" : "rgba(15,23,42,0.04)",
|
|
60
|
+
chevron: isDark ? "#475569" : "#C7C7CC"
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function Tile({
|
|
64
|
+
icon,
|
|
65
|
+
tint
|
|
66
|
+
}) {
|
|
67
|
+
return /* @__PURE__ */ jsx(View, { style: [styles.tile, {
|
|
68
|
+
backgroundColor: tint
|
|
69
|
+
}], children: /* @__PURE__ */ jsx(Ionicons, { name: icon, size: 16, color: "#fff" }) });
|
|
70
|
+
}
|
|
71
|
+
function SettingsRow({
|
|
72
|
+
label,
|
|
73
|
+
value,
|
|
74
|
+
icon,
|
|
75
|
+
tint,
|
|
76
|
+
onPress,
|
|
77
|
+
disabled,
|
|
78
|
+
destructive,
|
|
79
|
+
last,
|
|
80
|
+
p
|
|
81
|
+
}) {
|
|
82
|
+
return /* @__PURE__ */ jsxs(Pressable, { onPress, disabled: !onPress || disabled, accessibilityRole: onPress ? "button" : void 0, accessibilityLabel: value ? `${label}, ${value}` : label, style: ({
|
|
83
|
+
pressed
|
|
84
|
+
}) => [styles.row, pressed && {
|
|
85
|
+
backgroundColor: p.pressed
|
|
86
|
+
}, disabled && styles.dim], children: [
|
|
87
|
+
icon ? /* @__PURE__ */ jsx(Tile, { icon, tint: tint != null ? tint : TILE.slate }) : null,
|
|
88
|
+
/* @__PURE__ */ jsxs(View, { style: [styles.rowBody, !last && {
|
|
89
|
+
borderBottomColor: p.separator,
|
|
90
|
+
borderBottomWidth: StyleSheet.hairlineWidth
|
|
91
|
+
}], children: [
|
|
92
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles.rowLabel, {
|
|
93
|
+
color: destructive ? TILE.red : p.text
|
|
94
|
+
}], children: label }),
|
|
95
|
+
value ? /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles.rowValue, {
|
|
96
|
+
color: p.textMuted
|
|
97
|
+
}], children: value }) : null,
|
|
98
|
+
onPress && !destructive ? /* @__PURE__ */ jsx(Ionicons, { name: "chevron-forward", size: 17, color: p.chevron }) : null
|
|
99
|
+
] })
|
|
100
|
+
] });
|
|
101
|
+
}
|
|
102
|
+
function makeWorkspaceRow(p) {
|
|
103
|
+
return function WorkspaceRow({
|
|
104
|
+
label,
|
|
105
|
+
value,
|
|
106
|
+
onPress,
|
|
107
|
+
disabled
|
|
108
|
+
}) {
|
|
109
|
+
const tile = WORKSPACE_ICONS[label];
|
|
110
|
+
return /* @__PURE__ */ jsx(SettingsRow, { p, label, value, icon: tile == null ? void 0 : tile.icon, tint: tile == null ? void 0 : tile.tint, onPress, disabled });
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function ToggleRow({
|
|
114
|
+
label,
|
|
115
|
+
description,
|
|
116
|
+
icon,
|
|
117
|
+
tint,
|
|
118
|
+
value,
|
|
119
|
+
onChange,
|
|
120
|
+
disabled,
|
|
121
|
+
last,
|
|
122
|
+
p,
|
|
123
|
+
isDark
|
|
124
|
+
}) {
|
|
125
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.row, children: [
|
|
126
|
+
/* @__PURE__ */ jsx(Tile, { icon, tint }),
|
|
127
|
+
/* @__PURE__ */ jsxs(View, { style: [styles.rowBody, styles.toggleBody, !last && {
|
|
128
|
+
borderBottomColor: p.separator,
|
|
129
|
+
borderBottomWidth: StyleSheet.hairlineWidth
|
|
130
|
+
}], children: [
|
|
131
|
+
/* @__PURE__ */ jsxs(View, { style: styles.toggleText, children: [
|
|
132
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.rowLabel, {
|
|
133
|
+
color: p.text
|
|
134
|
+
}], children: label }),
|
|
135
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.description, {
|
|
136
|
+
color: p.textMuted
|
|
137
|
+
}], children: description })
|
|
138
|
+
] }),
|
|
139
|
+
/* @__PURE__ */ jsx(Switch, { value, onValueChange: onChange, disabled, accessibilityLabel: label, trackColor: {
|
|
140
|
+
false: isDark ? "#334155" : "#E2E8F0",
|
|
141
|
+
true: mobileTokens.color.primary
|
|
142
|
+
}, ios_backgroundColor: isDark ? "#334155" : "#E2E8F0" })
|
|
143
|
+
] })
|
|
144
|
+
] });
|
|
145
|
+
}
|
|
146
|
+
function Group({
|
|
147
|
+
title,
|
|
148
|
+
footer,
|
|
149
|
+
p,
|
|
150
|
+
children
|
|
151
|
+
}) {
|
|
152
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.group, children: [
|
|
153
|
+
title ? /* @__PURE__ */ jsx(Text, { style: [styles.groupTitle, {
|
|
154
|
+
color: p.textMuted
|
|
155
|
+
}], children: title }) : null,
|
|
156
|
+
/* @__PURE__ */ jsx(View, { style: [styles.card, {
|
|
157
|
+
backgroundColor: p.card
|
|
158
|
+
}], children }),
|
|
159
|
+
footer ? /* @__PURE__ */ jsx(Text, { style: [styles.groupFooter, {
|
|
160
|
+
color: p.textMuted
|
|
161
|
+
}], children: footer }) : null
|
|
162
|
+
] });
|
|
163
|
+
}
|
|
164
|
+
function AppearanceRow({
|
|
165
|
+
isDark,
|
|
166
|
+
onChange,
|
|
167
|
+
p
|
|
168
|
+
}) {
|
|
169
|
+
const option = (dark, icon, label) => {
|
|
170
|
+
const active = dark === isDark;
|
|
171
|
+
return /* @__PURE__ */ jsxs(Pressable, { onPress: () => onChange(dark), accessibilityRole: "button", accessibilityLabel: label, accessibilityState: {
|
|
172
|
+
selected: active
|
|
173
|
+
}, style: [styles.segment, active && __spreadValues({
|
|
174
|
+
backgroundColor: p.card
|
|
175
|
+
}, mobileTokens.shadow.card)], children: [
|
|
176
|
+
/* @__PURE__ */ jsx(Ionicons, { name: icon, size: 14, color: active ? mobileTokens.color.primary : p.textMuted }),
|
|
177
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.segmentLabel, {
|
|
178
|
+
color: active ? p.text : p.textMuted
|
|
179
|
+
}], children: label })
|
|
180
|
+
] });
|
|
181
|
+
};
|
|
182
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.row, children: [
|
|
183
|
+
/* @__PURE__ */ jsx(Tile, { icon: "color-palette", tint: TILE.violet }),
|
|
184
|
+
/* @__PURE__ */ jsxs(View, { style: [styles.rowBody, {
|
|
185
|
+
borderBottomColor: p.separator,
|
|
186
|
+
borderBottomWidth: StyleSheet.hairlineWidth
|
|
187
|
+
}], children: [
|
|
188
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.rowLabel, {
|
|
189
|
+
color: p.text
|
|
190
|
+
}], children: "Appearance" }),
|
|
191
|
+
/* @__PURE__ */ jsxs(View, { style: [styles.segments, {
|
|
192
|
+
backgroundColor: p.page
|
|
193
|
+
}], children: [
|
|
194
|
+
option(false, "sunny", "Light"),
|
|
195
|
+
option(true, "moon", "Dark")
|
|
196
|
+
] })
|
|
197
|
+
] })
|
|
198
|
+
] });
|
|
199
|
+
}
|
|
17
200
|
function AccountScreen() {
|
|
18
|
-
var _a, _b;
|
|
201
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
19
202
|
const navigation = useNavigation();
|
|
20
203
|
const route = useRoute();
|
|
21
204
|
const {
|
|
22
|
-
isDark
|
|
205
|
+
isDark,
|
|
206
|
+
setDarkMode
|
|
23
207
|
} = useAppTheme();
|
|
24
208
|
const colors = mobileColors(isDark);
|
|
209
|
+
const p = useMemo(() => palette(isDark), [isDark]);
|
|
25
210
|
const insets = useSafeAreaInsets();
|
|
26
211
|
const dispatch = useDispatch();
|
|
27
212
|
const authUser = useSelector(userSelector);
|
|
@@ -31,27 +216,62 @@ function AccountScreen() {
|
|
|
31
216
|
fetchPolicy: "cache-and-network",
|
|
32
217
|
errorPolicy: "all"
|
|
33
218
|
});
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
}
|
|
219
|
+
const {
|
|
220
|
+
data: accountData
|
|
221
|
+
} = useGetExtendedUserAccountQuery({
|
|
222
|
+
fetchPolicy: "cache-and-network",
|
|
223
|
+
errorPolicy: "all"
|
|
224
|
+
});
|
|
225
|
+
const {
|
|
226
|
+
data: countriesData
|
|
227
|
+
} = useCountriesQuery({
|
|
228
|
+
variables: {
|
|
229
|
+
limit: 300
|
|
230
|
+
},
|
|
231
|
+
fetchPolicy: "cache-first"
|
|
232
|
+
});
|
|
37
233
|
const [deleteUserAccount, {
|
|
38
234
|
loading: deleting
|
|
39
235
|
}] = useDeleteUserAccountMutation();
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
236
|
+
const {
|
|
237
|
+
preferences,
|
|
238
|
+
setPreference,
|
|
239
|
+
canSave
|
|
240
|
+
} = useAccountPreferences();
|
|
241
|
+
const {
|
|
242
|
+
orgName: resolvedOrgName,
|
|
243
|
+
projectId
|
|
244
|
+
} = usePrerequisiteIds();
|
|
245
|
+
const chatModelId = useChatModelId();
|
|
246
|
+
const [editing, setEditing] = useState(null);
|
|
247
|
+
const [page, setPage] = useState("home");
|
|
248
|
+
const close = useCallback(() => setEditing(null), []);
|
|
249
|
+
const WorkspaceRow = useMemo(() => makeWorkspaceRow(p), [p]);
|
|
43
250
|
const orgName = useMemo(() => {
|
|
44
251
|
var _a2, _b2;
|
|
45
252
|
const raw = (_b2 = (_a2 = route == null ? void 0 : route.params) == null ? void 0 : _a2.orgName) != null ? _b2 : "";
|
|
46
253
|
return typeof raw === "string" && raw.trim() ? raw.trim() : null;
|
|
47
254
|
}, [(_a = route == null ? void 0 : route.params) == null ? void 0 : _a.orgName]);
|
|
255
|
+
const account = accountData == null ? void 0 : accountData.getExtendedUserAccount;
|
|
256
|
+
const userId = (_d = (_c = (_b = profileData == null ? void 0 : profileData.accountProfile) == null ? void 0 : _b.user) == null ? void 0 : _c.id) != null ? _d : null;
|
|
48
257
|
const displayName = useMemo(() => pickPrimaryDisplayName(authUser), [authUser]);
|
|
49
|
-
const
|
|
50
|
-
const
|
|
258
|
+
const fullName = [account == null ? void 0 : account.givenName, account == null ? void 0 : account.familyName].filter(Boolean).join(" ") || displayName;
|
|
259
|
+
const email = (_e = account == null ? void 0 : account.email) != null ? _e : "";
|
|
260
|
+
const username = (_f = account == null ? void 0 : account.username) != null ? _f : "";
|
|
261
|
+
const countries = useMemo(() => {
|
|
262
|
+
var _a2, _b2;
|
|
263
|
+
return ((_b2 = (_a2 = countriesData == null ? void 0 : countriesData.countries) == null ? void 0 : _a2.data) != null ? _b2 : []).filter(Boolean);
|
|
264
|
+
}, [countriesData]);
|
|
265
|
+
const numbers = useMemo(() => {
|
|
266
|
+
var _a2;
|
|
267
|
+
return ((_a2 = account == null ? void 0 : account.phoneNumber) != null ? _a2 : []).filter(Boolean);
|
|
268
|
+
}, [account == null ? void 0 : account.phoneNumber]);
|
|
269
|
+
const phoneSummary = numbers.length ? maskPhoneNumber(formatPhoneCode((_g = countries.find((country) => country.id === numbers[0].countryCode)) == null ? void 0 : _g.phoneCode) || numbers[0].countryCode, numbers[0].phoneNumber) + (numbers.length > 1 ? ` +${numbers.length - 1}` : "") : "Add";
|
|
270
|
+
const modelName = (_i = (_h = CHAT_MODELS.find((model) => model.id === chatModelId)) == null ? void 0 : _h.name) != null ? _i : "Select model";
|
|
51
271
|
const photoUrl = useMemo(() => {
|
|
52
272
|
var _a2;
|
|
53
273
|
return pickProfilePhotoUrl((_a2 = profileData == null ? void 0 : profileData.accountProfile) == null ? void 0 : _a2.photos, authUser);
|
|
54
|
-
}, [(
|
|
274
|
+
}, [(_j = profileData == null ? void 0 : profileData.accountProfile) == null ? void 0 : _j.photos, authUser]);
|
|
55
275
|
const busy = deleting;
|
|
56
276
|
const health = useHealthSync();
|
|
57
277
|
const devices = useDevices();
|
|
@@ -70,8 +290,35 @@ function AccountScreen() {
|
|
|
70
290
|
orgName
|
|
71
291
|
} : void 0);
|
|
72
292
|
}, [navigation, orgName]);
|
|
293
|
+
const openBilling = useCallback(() => {
|
|
294
|
+
var _a2;
|
|
295
|
+
(_a2 = navigation == null ? void 0 : navigation.navigate) == null ? void 0 : _a2.call(navigation, "MainStack.Billing", orgName ? {
|
|
296
|
+
orgName
|
|
297
|
+
} : void 0);
|
|
298
|
+
}, [navigation, orgName]);
|
|
299
|
+
const slide = useRef(new Animated.Value(0)).current;
|
|
300
|
+
const scrollRef = useRef(null);
|
|
301
|
+
const go = useCallback((next) => {
|
|
302
|
+
var _a2;
|
|
303
|
+
setPage(next);
|
|
304
|
+
(_a2 = scrollRef.current) == null ? void 0 : _a2.scrollTo({
|
|
305
|
+
y: 0,
|
|
306
|
+
animated: false
|
|
307
|
+
});
|
|
308
|
+
slide.setValue(next === "home" ? -1 : 1);
|
|
309
|
+
Animated.timing(slide, {
|
|
310
|
+
toValue: 0,
|
|
311
|
+
duration: 240,
|
|
312
|
+
easing: Easing.out(Easing.cubic),
|
|
313
|
+
useNativeDriver: true
|
|
314
|
+
}).start();
|
|
315
|
+
}, [slide]);
|
|
73
316
|
const handleBack = useCallback(() => {
|
|
74
317
|
var _a2, _b2;
|
|
318
|
+
if (page !== "home") {
|
|
319
|
+
go("home");
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
75
322
|
if ((_a2 = navigation == null ? void 0 : navigation.canGoBack) == null ? void 0 : _a2.call(navigation)) {
|
|
76
323
|
navigation.goBack();
|
|
77
324
|
return;
|
|
@@ -82,26 +329,18 @@ function AccountScreen() {
|
|
|
82
329
|
orgName
|
|
83
330
|
} : void 0
|
|
84
331
|
}));
|
|
85
|
-
}, [navigation, orgName]);
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
familyName: familyName.trim() || void 0
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
setNameOpen(false);
|
|
101
|
-
} catch (error) {
|
|
102
|
-
Alert.alert("Could not update name", error instanceof Error ? error.message : "Please try again.");
|
|
103
|
-
}
|
|
104
|
-
}, [familyName, givenName, setName]);
|
|
332
|
+
}, [go, navigation, orgName, page]);
|
|
333
|
+
useEffect(() => {
|
|
334
|
+
if (page === "home") return void 0;
|
|
335
|
+
const sub = BackHandler.addEventListener("hardwareBackPress", () => {
|
|
336
|
+
go("home");
|
|
337
|
+
return true;
|
|
338
|
+
});
|
|
339
|
+
return () => sub.remove();
|
|
340
|
+
}, [go, page]);
|
|
341
|
+
const contactSupport = useCallback(() => {
|
|
342
|
+
Linking.openURL(`mailto:${config.SUPPORT_EMAIL}`).catch(() => Alert.alert("Support", `Write to us at ${config.SUPPORT_EMAIL}.`));
|
|
343
|
+
}, []);
|
|
105
344
|
const runDelete = useCallback(async () => {
|
|
106
345
|
try {
|
|
107
346
|
const {
|
|
@@ -135,141 +374,146 @@ function AccountScreen() {
|
|
|
135
374
|
}
|
|
136
375
|
}]);
|
|
137
376
|
}, [busy, runDelete]);
|
|
377
|
+
const avatar = (size) => /* @__PURE__ */ jsx(View, { style: [styles.avatarWrap, {
|
|
378
|
+
width: size,
|
|
379
|
+
height: size,
|
|
380
|
+
borderRadius: size / 2
|
|
381
|
+
}], children: /* @__PURE__ */ jsx(ProfileAvatar, { uri: photoUrl, name: displayName, size }) });
|
|
382
|
+
const home = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
383
|
+
/* @__PURE__ */ jsxs(Pressable, { onPress: () => go("profile"), accessibilityRole: "button", accessibilityLabel: `${fullName}, personal information`, style: ({
|
|
384
|
+
pressed
|
|
385
|
+
}) => [styles.profileCard, {
|
|
386
|
+
backgroundColor: p.card
|
|
387
|
+
}, pressed && styles.pressedCard], children: [
|
|
388
|
+
avatar(64),
|
|
389
|
+
/* @__PURE__ */ jsxs(View, { style: styles.profileText, children: [
|
|
390
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles.profileName, {
|
|
391
|
+
color: p.text
|
|
392
|
+
}], children: fullName }),
|
|
393
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles.profileEmail, {
|
|
394
|
+
color: p.textMuted
|
|
395
|
+
}], children: email || (username ? `@${username}` : "") }),
|
|
396
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.profileLink, {
|
|
397
|
+
color: mobileTokens.color.primary
|
|
398
|
+
}], children: "Personal information, photo" })
|
|
399
|
+
] }),
|
|
400
|
+
/* @__PURE__ */ jsx(Ionicons, { name: "chevron-forward", size: 18, color: p.chevron })
|
|
401
|
+
] }),
|
|
402
|
+
/* @__PURE__ */ jsxs(Group, { p, children: [
|
|
403
|
+
/* @__PURE__ */ jsx(SettingsRow, { p, icon: "briefcase", tint: TILE.indigo, label: "Workspace", value: "Organization, project", onPress: () => go("workspace") }),
|
|
404
|
+
/* @__PURE__ */ jsx(SettingsRow, { p, icon: "options", tint: TILE.brand, label: "Preferences", onPress: () => go("preferences") }),
|
|
405
|
+
/* @__PURE__ */ jsx(SettingsRow, { p, icon: "sparkles", tint: TILE.violet, label: "Artificial intelligence", value: modelName, onPress: () => go("ai"), last: true })
|
|
406
|
+
] }),
|
|
407
|
+
/* @__PURE__ */ jsxs(Group, { p, title: "HEALTH & DEVICES", children: [
|
|
408
|
+
/* @__PURE__ */ jsx(SettingsRow, { p, icon: "heart", tint: TILE.pink, label: "Health", value: health.loaded ? health.sync.connected ? "On" : "Off" : "", onPress: openHealth }),
|
|
409
|
+
/* @__PURE__ */ jsx(SettingsRow, { p, icon: "watch", tint: TILE.teal, label: "Devices", value: devices.loaded ? devices.devices.length ? String(devices.devices.length) : "None" : "", onPress: openDevices, last: true })
|
|
410
|
+
] }),
|
|
411
|
+
/* @__PURE__ */ jsxs(Pressable, { onPress: openBilling, accessibilityRole: "button", accessibilityLabel: "Upgrade plan", style: ({
|
|
412
|
+
pressed
|
|
413
|
+
}) => [styles.promo, pressed && styles.pressedCard], children: [
|
|
414
|
+
/* @__PURE__ */ jsx(View, { style: styles.promoIcon, children: /* @__PURE__ */ jsx(Ionicons, { name: "rocket", size: 20, color: mobileTokens.color.primary }) }),
|
|
415
|
+
/* @__PURE__ */ jsxs(View, { style: styles.promoText, children: [
|
|
416
|
+
/* @__PURE__ */ jsx(Text, { style: styles.promoTitle, children: "Unlock the most powerful search experience" }),
|
|
417
|
+
/* @__PURE__ */ jsx(Text, { style: styles.promoBody, children: "Get the most out of Yantra with Pro." })
|
|
418
|
+
] }),
|
|
419
|
+
/* @__PURE__ */ jsx(View, { style: styles.promoButton, children: /* @__PURE__ */ jsx(Text, { style: styles.promoButtonLabel, children: "Upgrade" }) })
|
|
420
|
+
] }),
|
|
421
|
+
/* @__PURE__ */ jsxs(Group, { p, children: [
|
|
422
|
+
/* @__PURE__ */ jsx(SettingsRow, { p, icon: "help-buoy", tint: TILE.blue, label: "Contact support", onPress: contactSupport }),
|
|
423
|
+
/* @__PURE__ */ jsx(SettingsRow, { p, icon: "trash", tint: TILE.red, label: deleting ? "Deleting\u2026" : "Delete account", onPress: handleDeleteAccount, disabled: busy, destructive: true, last: true })
|
|
424
|
+
] }),
|
|
425
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.footnote, {
|
|
426
|
+
color: p.textMuted
|
|
427
|
+
}], children: "Deleting your account permanently removes it and its data." })
|
|
428
|
+
] });
|
|
429
|
+
const profile = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
430
|
+
/* @__PURE__ */ jsxs(Pressable, { onPress: () => setEditing("avatar"), accessibilityRole: "button", accessibilityLabel: "Change profile photo", style: styles.photoBlock, children: [
|
|
431
|
+
/* @__PURE__ */ jsxs(View, { children: [
|
|
432
|
+
avatar(96),
|
|
433
|
+
/* @__PURE__ */ jsx(View, { style: [styles.cameraBadge, {
|
|
434
|
+
borderColor: p.page
|
|
435
|
+
}], children: /* @__PURE__ */ jsx(Ionicons, { name: "camera", size: 14, color: "#fff" }) })
|
|
436
|
+
] }),
|
|
437
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.photoLink, {
|
|
438
|
+
color: mobileTokens.color.primary
|
|
439
|
+
}], children: "Change photo" })
|
|
440
|
+
] }),
|
|
441
|
+
/* @__PURE__ */ jsxs(Group, { p, title: "PROFILE", children: [
|
|
442
|
+
/* @__PURE__ */ jsx(SettingsRow, { p, icon: "person", tint: TILE.blue, label: "Full name", value: fullName, onPress: () => setEditing("name") }),
|
|
443
|
+
/* @__PURE__ */ jsx(SettingsRow, { p, icon: "at", tint: TILE.indigo, label: "Username", value: username || "-", onPress: () => setEditing("username") }),
|
|
444
|
+
/* @__PURE__ */ jsx(SettingsRow, { p, icon: "male-female", tint: TILE.violet, label: "Gender", value: genderLabel(account == null ? void 0 : account.gender), onPress: () => setEditing("gender") }),
|
|
445
|
+
/* @__PURE__ */ jsx(SettingsRow, { p, icon: "calendar", tint: TILE.amber, label: "Date of birth", value: formatDob(account == null ? void 0 : account.dob), onPress: () => setEditing("dob"), last: true })
|
|
446
|
+
] }),
|
|
447
|
+
/* @__PURE__ */ jsxs(Group, { p, title: "CONTACT", footer: "Each new email or number is confirmed with a 6-digit code before it is saved.", children: [
|
|
448
|
+
/* @__PURE__ */ jsx(SettingsRow, { p, icon: "mail", tint: TILE.brand, label: "Email", value: email || "Add", onPress: () => setEditing("email") }),
|
|
449
|
+
/* @__PURE__ */ jsx(SettingsRow, { p, icon: "call", tint: TILE.green, label: "Phone", value: phoneSummary, onPress: () => setEditing("phone"), last: true })
|
|
450
|
+
] })
|
|
451
|
+
] });
|
|
452
|
+
const workspace = /* @__PURE__ */ jsx(Group, { p, footer: "Your connectors, secrets and system token resolve against this environment. Credentials saved in one environment do not resolve in another.", children: /* @__PURE__ */ jsx(WorkspaceSection, { userId, colors, Row: WorkspaceRow }) });
|
|
453
|
+
const preferencesPage = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
454
|
+
/* @__PURE__ */ jsxs(Group, { p, title: "DISPLAY", children: [
|
|
455
|
+
/* @__PURE__ */ jsx(AppearanceRow, { isDark, onChange: setDarkMode, p }),
|
|
456
|
+
/* @__PURE__ */ jsx(SettingsRow, { p, icon: "language", tint: TILE.blue, label: "Response language", value: languageLabel(preferences.responseLanguage), onPress: canSave ? () => setEditing("language") : void 0, last: true })
|
|
457
|
+
] }),
|
|
458
|
+
/* @__PURE__ */ jsxs(Group, { p, title: "HOME & SEARCH", children: [
|
|
459
|
+
/* @__PURE__ */ jsx(ToggleRow, { p, isDark, icon: "flash", tint: TILE.amber, label: "Autosuggest", description: "Suggestions while you type a query", value: preferences.autosuggest, onChange: (next) => setPreference("autosuggest", next), disabled: !canSave }),
|
|
460
|
+
/* @__PURE__ */ jsx(ToggleRow, { p, isDark, icon: "grid", tint: TILE.teal, label: "Homepage widgets", description: "Personalized widgets on the homepage", value: preferences.homepageWidgets, onChange: (next) => setPreference("homepageWidgets", next), disabled: !canSave, last: true })
|
|
461
|
+
] })
|
|
462
|
+
] });
|
|
463
|
+
const aiPage = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
464
|
+
/* @__PURE__ */ jsx(Group, { p, title: "MODEL", footer: "The model new chats answer with. Medium is the default.", children: /* @__PURE__ */ jsx(SettingsRow, { p, icon: "hardware-chip", tint: TILE.violet, label: "Model", value: modelName, onPress: () => setEditing("model"), last: true }) }),
|
|
465
|
+
/* @__PURE__ */ jsx(Group, { p, title: "PRIVACY", footer: "When on, Yantra may use your searches to improve AI models. Turn it off to exclude your data.", children: /* @__PURE__ */ jsx(ToggleRow, { p, isDark, icon: "shield-checkmark", tint: TILE.green, label: "AI data retention", description: "Help improve AI models", value: preferences.aiDataRetention, onChange: (next) => setPreference("aiDataRetention", next), disabled: !canSave, last: true }) })
|
|
466
|
+
] });
|
|
467
|
+
const pages = {
|
|
468
|
+
home,
|
|
469
|
+
profile,
|
|
470
|
+
workspace,
|
|
471
|
+
preferences: preferencesPage,
|
|
472
|
+
ai: aiPage
|
|
473
|
+
};
|
|
138
474
|
return /* @__PURE__ */ jsxs(SafeAreaView, { edges: ["top", "left", "right"], style: [styles.safe, {
|
|
139
|
-
backgroundColor:
|
|
475
|
+
backgroundColor: p.page
|
|
140
476
|
}], children: [
|
|
141
477
|
/* @__PURE__ */ jsxs(View, { style: [styles.header, {
|
|
142
478
|
paddingTop: insets.top > 0 ? 4 : 10
|
|
143
479
|
}], children: [
|
|
144
|
-
/* @__PURE__ */ jsx(Pressable, { onPress: handleBack, accessibilityRole: "button", accessibilityLabel: "Go back", style: ({
|
|
480
|
+
/* @__PURE__ */ jsx(Pressable, { onPress: handleBack, accessibilityRole: "button", accessibilityLabel: page === "home" ? "Go back" : "Back to account", hitSlop: 8, style: ({
|
|
145
481
|
pressed
|
|
146
482
|
}) => [styles.backCircle, {
|
|
147
|
-
backgroundColor:
|
|
148
|
-
}, pressed && styles.pressed], children: /* @__PURE__ */ jsx(Ionicons, { name: "chevron-back", size: 22, color:
|
|
149
|
-
/* @__PURE__ */ jsx(Text, { style: [styles.headerTitle, {
|
|
150
|
-
color:
|
|
151
|
-
}], children:
|
|
483
|
+
backgroundColor: p.card
|
|
484
|
+
}, pressed && styles.pressed], children: /* @__PURE__ */ jsx(Ionicons, { name: "chevron-back", size: 22, color: p.text }) }),
|
|
485
|
+
/* @__PURE__ */ jsx(Text, { accessibilityRole: "header", numberOfLines: 1, style: [styles.headerTitle, {
|
|
486
|
+
color: p.text
|
|
487
|
+
}], children: PAGE_TITLES[page] }),
|
|
152
488
|
/* @__PURE__ */ jsx(View, { style: styles.headerSpacer })
|
|
153
489
|
] }),
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
backgroundColor: colors.surface
|
|
182
|
-
}], children: [
|
|
183
|
-
/* @__PURE__ */ jsx(Text, { style: [styles.rowLabel, {
|
|
184
|
-
color: colors.text
|
|
185
|
-
}], children: "Email" }),
|
|
186
|
-
/* @__PURE__ */ jsx(Text, { style: [styles.rowValue, {
|
|
187
|
-
color: colors.textMuted
|
|
188
|
-
}], numberOfLines: 1, children: email || "\u2014" })
|
|
189
|
-
] }),
|
|
190
|
-
/* @__PURE__ */ jsx(View, { style: [styles.rowLine, {
|
|
191
|
-
backgroundColor: colors.border
|
|
192
|
-
}] }),
|
|
193
|
-
/* @__PURE__ */ jsxs(View, { style: [styles.row, {
|
|
194
|
-
backgroundColor: colors.surface
|
|
195
|
-
}], children: [
|
|
196
|
-
/* @__PURE__ */ jsx(Text, { style: [styles.rowLabel, {
|
|
197
|
-
color: colors.text
|
|
198
|
-
}], children: "Username" }),
|
|
199
|
-
/* @__PURE__ */ jsx(Text, { style: [styles.rowValue, {
|
|
200
|
-
color: colors.textMuted
|
|
201
|
-
}], numberOfLines: 1, children: username || "\u2014" })
|
|
202
|
-
] })
|
|
203
|
-
] }),
|
|
204
|
-
/* @__PURE__ */ jsxs(View, { style: [styles.card, styles.cardSpaced, {
|
|
205
|
-
backgroundColor: colors.surface
|
|
206
|
-
}], children: [
|
|
207
|
-
/* @__PURE__ */ jsxs(Pressable, { onPress: openHealth, accessibilityRole: "button", accessibilityLabel: "Health", style: ({
|
|
208
|
-
pressed
|
|
209
|
-
}) => [styles.row, {
|
|
210
|
-
backgroundColor: pressed ? colors.surfaceMuted : colors.surface
|
|
211
|
-
}], children: [
|
|
212
|
-
/* @__PURE__ */ jsx(Text, { style: [styles.rowLabel, {
|
|
213
|
-
color: colors.text
|
|
214
|
-
}], children: "Health" }),
|
|
215
|
-
/* @__PURE__ */ jsx(Text, { style: [styles.rowValue, {
|
|
216
|
-
color: colors.textMuted
|
|
217
|
-
}], numberOfLines: 1, children: health.loaded ? health.sync.connected ? "On" : "Off" : "" }),
|
|
218
|
-
/* @__PURE__ */ jsx(Ionicons, { name: "chevron-forward", size: 16, color: isDark ? "#64748b" : "#c4c4c4" })
|
|
219
|
-
] }),
|
|
220
|
-
/* @__PURE__ */ jsx(View, { style: [styles.rowLine, {
|
|
221
|
-
backgroundColor: colors.border
|
|
222
|
-
}] }),
|
|
223
|
-
/* @__PURE__ */ jsxs(Pressable, { onPress: openDevices, accessibilityRole: "button", accessibilityLabel: "Devices", style: ({
|
|
224
|
-
pressed
|
|
225
|
-
}) => [styles.row, {
|
|
226
|
-
backgroundColor: pressed ? colors.surfaceMuted : colors.surface
|
|
227
|
-
}], children: [
|
|
228
|
-
/* @__PURE__ */ jsx(Text, { style: [styles.rowLabel, {
|
|
229
|
-
color: colors.text
|
|
230
|
-
}], children: "Devices" }),
|
|
231
|
-
/* @__PURE__ */ jsx(Text, { style: [styles.rowValue, {
|
|
232
|
-
color: colors.textMuted
|
|
233
|
-
}], numberOfLines: 1, children: devices.loaded ? devices.devices.length ? String(devices.devices.length) : "None" : "" }),
|
|
234
|
-
/* @__PURE__ */ jsx(Ionicons, { name: "chevron-forward", size: 16, color: isDark ? "#64748b" : "#c4c4c4" })
|
|
235
|
-
] })
|
|
236
|
-
] }),
|
|
237
|
-
/* @__PURE__ */ jsx(Pressable, { onPress: handleDeleteAccount, disabled: busy, accessibilityRole: "button", accessibilityLabel: "Delete Account", style: ({
|
|
238
|
-
pressed
|
|
239
|
-
}) => [styles.deleteCard, {
|
|
240
|
-
backgroundColor: pressed && !busy ? colors.surfaceMuted : colors.surface
|
|
241
|
-
}], children: deleting ? /* @__PURE__ */ jsx(ActivityIndicator, { color: "#ef4444" }) : /* @__PURE__ */ jsx(Text, { style: styles.deleteLabel, children: "Delete Account" }) })
|
|
242
|
-
] }),
|
|
243
|
-
/* @__PURE__ */ jsx(Modal, { visible: nameOpen, animationType: "fade", transparent: true, onRequestClose: () => setNameOpen(false), children: /* @__PURE__ */ jsxs(KeyboardAvoidingView, { behavior: Platform.OS === "ios" ? "padding" : void 0, style: styles.modalBackdrop, children: [
|
|
244
|
-
/* @__PURE__ */ jsx(Pressable, { style: styles.modalDismiss, onPress: () => setNameOpen(false) }),
|
|
245
|
-
/* @__PURE__ */ jsxs(View, { style: [styles.modalCard, {
|
|
246
|
-
backgroundColor: colors.surface
|
|
247
|
-
}], children: [
|
|
248
|
-
/* @__PURE__ */ jsx(Text, { style: [styles.modalTitle, {
|
|
249
|
-
color: colors.text
|
|
250
|
-
}], children: "Change full name" }),
|
|
251
|
-
/* @__PURE__ */ jsx(Text, { style: [styles.modalFieldLabel, {
|
|
252
|
-
color: colors.textMuted
|
|
253
|
-
}], children: "First name" }),
|
|
254
|
-
/* @__PURE__ */ jsx(TextInput, { value: givenName, onChangeText: setGivenName, autoCapitalize: "words", style: [styles.input, {
|
|
255
|
-
color: colors.text,
|
|
256
|
-
backgroundColor: colors.surfaceMuted,
|
|
257
|
-
borderColor: colors.border
|
|
258
|
-
}], placeholder: "First name", placeholderTextColor: colors.textMuted }),
|
|
259
|
-
/* @__PURE__ */ jsx(Text, { style: [styles.modalFieldLabel, {
|
|
260
|
-
color: colors.textMuted
|
|
261
|
-
}], children: "Last name" }),
|
|
262
|
-
/* @__PURE__ */ jsx(TextInput, { value: familyName, onChangeText: setFamilyName, autoCapitalize: "words", style: [styles.input, {
|
|
263
|
-
color: colors.text,
|
|
264
|
-
backgroundColor: colors.surfaceMuted,
|
|
265
|
-
borderColor: colors.border
|
|
266
|
-
}], placeholder: "Last name", placeholderTextColor: colors.textMuted }),
|
|
267
|
-
/* @__PURE__ */ jsxs(View, { style: styles.modalActions, children: [
|
|
268
|
-
/* @__PURE__ */ jsx(Pressable, { onPress: () => setNameOpen(false), style: styles.modalBtnGhost, children: /* @__PURE__ */ jsx(Text, { style: styles.modalBtnGhostLabel, children: "Cancel" }) }),
|
|
269
|
-
/* @__PURE__ */ jsx(Pressable, { onPress: () => void saveName(), disabled: savingName, style: styles.modalBtnPrimary, children: savingName ? /* @__PURE__ */ jsx(ActivityIndicator, { color: "#fff" }) : /* @__PURE__ */ jsx(Text, { style: styles.modalBtnPrimaryLabel, children: "Save" }) })
|
|
270
|
-
] })
|
|
271
|
-
] })
|
|
272
|
-
] }) })
|
|
490
|
+
/* @__PURE__ */ jsx(ScrollView, { ref: scrollRef, contentContainerStyle: [styles.scroll, {
|
|
491
|
+
paddingBottom: Math.max(insets.bottom, 16) + 24
|
|
492
|
+
}], keyboardShouldPersistTaps: "handled", children: /* @__PURE__ */ jsx(Animated.View, { style: {
|
|
493
|
+
transform: [{
|
|
494
|
+
translateX: slide.interpolate({
|
|
495
|
+
inputRange: [-1, 0, 1],
|
|
496
|
+
outputRange: [-40, 0, 40]
|
|
497
|
+
})
|
|
498
|
+
}],
|
|
499
|
+
opacity: slide.interpolate({
|
|
500
|
+
inputRange: [-1, 0, 1],
|
|
501
|
+
outputRange: [0, 1, 0]
|
|
502
|
+
})
|
|
503
|
+
}, children: pages[page] }) }),
|
|
504
|
+
/* @__PURE__ */ jsx(AvatarSheet, { visible: editing === "avatar", colors, fallback: /* @__PURE__ */ jsx(ProfileAvatar, { uri: null, name: displayName, size: 112 }), onClose: close }),
|
|
505
|
+
/* @__PURE__ */ jsx(NameSheet, { visible: editing === "name", colors, givenName: (_k = account == null ? void 0 : account.givenName) != null ? _k : "", familyName: (_l = account == null ? void 0 : account.familyName) != null ? _l : "", onClose: close }),
|
|
506
|
+
/* @__PURE__ */ jsx(UsernameSheet, { visible: editing === "username", colors, username, givenName: account == null ? void 0 : account.givenName, familyName: account == null ? void 0 : account.familyName, onClose: close }),
|
|
507
|
+
/* @__PURE__ */ jsx(GenderSheet, { visible: editing === "gender", colors, gender: account == null ? void 0 : account.gender, onClose: close }),
|
|
508
|
+
/* @__PURE__ */ jsx(DobSheet, { visible: editing === "dob", colors, dob: account == null ? void 0 : account.dob, onClose: close }),
|
|
509
|
+
/* @__PURE__ */ jsx(EmailSheet, { visible: editing === "email", colors, email, onClose: close }),
|
|
510
|
+
/* @__PURE__ */ jsx(PhoneSheet, { visible: editing === "phone", colors, numbers, countries, onClose: close }),
|
|
511
|
+
/* @__PURE__ */ jsx(PickerSheet, { visible: editing === "language", title: "Preferred response language", colors, options: RESPONSE_LANGUAGES.map((language) => ({
|
|
512
|
+
value: language.key,
|
|
513
|
+
label: language.label
|
|
514
|
+
})), selected: preferences.responseLanguage, onSelect: (value) => setPreference("responseLanguage", value), onClose: close }),
|
|
515
|
+
/* @__PURE__ */ jsx(ChatModelSheet, { visible: editing === "model", isDark, orgName: orgName || resolvedOrgName, projectId, onClose: close }),
|
|
516
|
+
deleting ? /* @__PURE__ */ jsx(View, { style: styles.blocker, pointerEvents: "auto", children: /* @__PURE__ */ jsx(ActivityIndicator, { color: "#fff" }) }) : null
|
|
273
517
|
] });
|
|
274
518
|
}
|
|
275
519
|
const styles = StyleSheet.create({
|
|
@@ -287,7 +531,6 @@ const styles = StyleSheet.create({
|
|
|
287
531
|
width: 40,
|
|
288
532
|
height: 40,
|
|
289
533
|
borderRadius: 20,
|
|
290
|
-
backgroundColor: "#fff",
|
|
291
534
|
alignItems: "center",
|
|
292
535
|
justifyContent: "center"
|
|
293
536
|
}, mobileTokens.shadow.card),
|
|
@@ -295,8 +538,7 @@ const styles = StyleSheet.create({
|
|
|
295
538
|
flex: 1,
|
|
296
539
|
textAlign: "center",
|
|
297
540
|
fontSize: 17,
|
|
298
|
-
fontWeight: "600"
|
|
299
|
-
color: "#111827"
|
|
541
|
+
fontWeight: "600"
|
|
300
542
|
},
|
|
301
543
|
headerSpacer: {
|
|
302
544
|
width: 40,
|
|
@@ -307,138 +549,200 @@ const styles = StyleSheet.create({
|
|
|
307
549
|
},
|
|
308
550
|
scroll: {
|
|
309
551
|
paddingHorizontal: 16,
|
|
310
|
-
|
|
552
|
+
paddingTop: 8
|
|
311
553
|
},
|
|
312
|
-
|
|
554
|
+
profileCard: __spreadValues({
|
|
555
|
+
flexDirection: "row",
|
|
313
556
|
alignItems: "center",
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
557
|
+
gap: 14,
|
|
558
|
+
padding: 16,
|
|
559
|
+
borderRadius: 20,
|
|
560
|
+
marginBottom: 24
|
|
561
|
+
}, mobileTokens.shadow.card),
|
|
562
|
+
pressedCard: {
|
|
563
|
+
opacity: 0.85
|
|
317
564
|
},
|
|
318
|
-
|
|
319
|
-
width: 88,
|
|
320
|
-
height: 88,
|
|
321
|
-
borderRadius: 44,
|
|
565
|
+
avatarWrap: {
|
|
322
566
|
overflow: "hidden"
|
|
323
567
|
},
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
568
|
+
profileText: {
|
|
569
|
+
flex: 1,
|
|
570
|
+
minWidth: 0,
|
|
571
|
+
gap: 2
|
|
572
|
+
},
|
|
573
|
+
profileName: {
|
|
574
|
+
fontSize: 19,
|
|
575
|
+
fontWeight: "700",
|
|
576
|
+
letterSpacing: -0.3
|
|
577
|
+
},
|
|
578
|
+
profileEmail: {
|
|
579
|
+
fontSize: 14
|
|
580
|
+
},
|
|
581
|
+
profileLink: {
|
|
582
|
+
marginTop: 4,
|
|
583
|
+
fontSize: 13,
|
|
584
|
+
fontWeight: "600"
|
|
585
|
+
},
|
|
586
|
+
group: {
|
|
587
|
+
marginBottom: 24
|
|
588
|
+
},
|
|
589
|
+
groupTitle: {
|
|
590
|
+
fontSize: 12,
|
|
591
|
+
fontWeight: "600",
|
|
592
|
+
letterSpacing: 0.6,
|
|
593
|
+
marginBottom: 8,
|
|
594
|
+
marginLeft: 16
|
|
595
|
+
},
|
|
596
|
+
groupFooter: {
|
|
597
|
+
fontSize: 12,
|
|
598
|
+
lineHeight: 17,
|
|
599
|
+
marginTop: 8,
|
|
600
|
+
marginHorizontal: 16
|
|
328
601
|
},
|
|
329
602
|
card: {
|
|
330
|
-
backgroundColor: "#fff",
|
|
331
603
|
borderRadius: 16,
|
|
332
604
|
overflow: "hidden"
|
|
333
605
|
},
|
|
334
|
-
cardSpaced: {
|
|
335
|
-
marginTop: 16
|
|
336
|
-
},
|
|
337
606
|
row: {
|
|
338
607
|
flexDirection: "row",
|
|
339
608
|
alignItems: "center",
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
gap: 12,
|
|
343
|
-
backgroundColor: "#fff"
|
|
609
|
+
paddingLeft: 14,
|
|
610
|
+
gap: 12
|
|
344
611
|
},
|
|
345
|
-
|
|
346
|
-
|
|
612
|
+
tile: {
|
|
613
|
+
width: 30,
|
|
614
|
+
height: 30,
|
|
615
|
+
borderRadius: 8,
|
|
616
|
+
alignItems: "center",
|
|
617
|
+
justifyContent: "center"
|
|
618
|
+
},
|
|
619
|
+
rowBody: {
|
|
620
|
+
flex: 1,
|
|
621
|
+
minWidth: 0,
|
|
622
|
+
flexDirection: "row",
|
|
623
|
+
alignItems: "center",
|
|
624
|
+
gap: 8,
|
|
625
|
+
minHeight: 52,
|
|
626
|
+
paddingRight: 14,
|
|
627
|
+
paddingVertical: 10
|
|
347
628
|
},
|
|
348
629
|
rowLabel: {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
fontWeight: "400",
|
|
352
|
-
width: 96
|
|
630
|
+
flexShrink: 0,
|
|
631
|
+
fontSize: 16
|
|
353
632
|
},
|
|
354
633
|
rowValue: {
|
|
355
634
|
flex: 1,
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
textAlign: "right"
|
|
359
|
-
},
|
|
360
|
-
rowLine: {
|
|
361
|
-
height: StyleSheet.hairlineWidth,
|
|
362
|
-
backgroundColor: "#ececec",
|
|
363
|
-
marginLeft: 16
|
|
635
|
+
textAlign: "right",
|
|
636
|
+
fontSize: 15
|
|
364
637
|
},
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
backgroundColor: "#fff",
|
|
368
|
-
borderRadius: 16,
|
|
369
|
-
minHeight: 52,
|
|
370
|
-
paddingHorizontal: 16,
|
|
371
|
-
justifyContent: "center"
|
|
372
|
-
},
|
|
373
|
-
deleteLabel: {
|
|
374
|
-
fontSize: 16,
|
|
375
|
-
fontWeight: "500",
|
|
376
|
-
color: "#ef4444"
|
|
638
|
+
toggleBody: {
|
|
639
|
+
gap: 12
|
|
377
640
|
},
|
|
378
|
-
|
|
641
|
+
toggleText: {
|
|
379
642
|
flex: 1,
|
|
380
|
-
|
|
381
|
-
|
|
643
|
+
minWidth: 0,
|
|
644
|
+
gap: 2
|
|
382
645
|
},
|
|
383
|
-
|
|
384
|
-
|
|
646
|
+
description: {
|
|
647
|
+
fontSize: 13,
|
|
648
|
+
lineHeight: 17
|
|
385
649
|
},
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
gap: 8
|
|
650
|
+
segments: {
|
|
651
|
+
marginLeft: "auto",
|
|
652
|
+
flexDirection: "row",
|
|
653
|
+
padding: 3,
|
|
654
|
+
borderRadius: 10,
|
|
655
|
+
gap: 2
|
|
393
656
|
},
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
657
|
+
segment: {
|
|
658
|
+
flexDirection: "row",
|
|
659
|
+
alignItems: "center",
|
|
660
|
+
gap: 5,
|
|
661
|
+
paddingHorizontal: 12,
|
|
662
|
+
paddingVertical: 6,
|
|
663
|
+
borderRadius: 8
|
|
399
664
|
},
|
|
400
|
-
|
|
665
|
+
segmentLabel: {
|
|
401
666
|
fontSize: 13,
|
|
402
|
-
fontWeight: "600"
|
|
403
|
-
color: "#64748b",
|
|
404
|
-
marginTop: 4
|
|
667
|
+
fontWeight: "600"
|
|
405
668
|
},
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
669
|
+
promo: {
|
|
670
|
+
flexDirection: "row",
|
|
671
|
+
alignItems: "center",
|
|
672
|
+
gap: 12,
|
|
673
|
+
padding: 16,
|
|
674
|
+
marginBottom: 24,
|
|
675
|
+
borderRadius: 20,
|
|
676
|
+
backgroundColor: "#1F1B16"
|
|
677
|
+
},
|
|
678
|
+
promoIcon: {
|
|
679
|
+
width: 40,
|
|
680
|
+
height: 40,
|
|
409
681
|
borderRadius: 12,
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
color: "#0f172a",
|
|
414
|
-
backgroundColor: "#f8fafc"
|
|
682
|
+
alignItems: "center",
|
|
683
|
+
justifyContent: "center",
|
|
684
|
+
backgroundColor: "rgba(234,88,12,0.16)"
|
|
415
685
|
},
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
gap:
|
|
420
|
-
|
|
686
|
+
promoText: {
|
|
687
|
+
flex: 1,
|
|
688
|
+
minWidth: 0,
|
|
689
|
+
gap: 2
|
|
690
|
+
},
|
|
691
|
+
promoTitle: {
|
|
692
|
+
color: "#FFFFFF",
|
|
693
|
+
fontSize: 15,
|
|
694
|
+
fontWeight: "700",
|
|
695
|
+
lineHeight: 20
|
|
696
|
+
},
|
|
697
|
+
promoBody: {
|
|
698
|
+
color: "rgba(255,255,255,0.68)",
|
|
699
|
+
fontSize: 13
|
|
421
700
|
},
|
|
422
|
-
|
|
701
|
+
promoButton: {
|
|
702
|
+
backgroundColor: mobileTokens.color.primary,
|
|
703
|
+
borderRadius: 999,
|
|
423
704
|
paddingHorizontal: 14,
|
|
424
|
-
paddingVertical:
|
|
705
|
+
paddingVertical: 8
|
|
425
706
|
},
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
fontWeight: "
|
|
707
|
+
promoButtonLabel: {
|
|
708
|
+
color: "#FFFFFF",
|
|
709
|
+
fontSize: 13,
|
|
710
|
+
fontWeight: "700"
|
|
711
|
+
},
|
|
712
|
+
footnote: {
|
|
713
|
+
marginTop: -16,
|
|
714
|
+
marginHorizontal: 16,
|
|
715
|
+
fontSize: 12,
|
|
716
|
+
lineHeight: 17
|
|
717
|
+
},
|
|
718
|
+
photoBlock: {
|
|
719
|
+
alignItems: "center",
|
|
720
|
+
gap: 10,
|
|
721
|
+
paddingTop: 8,
|
|
722
|
+
paddingBottom: 24
|
|
430
723
|
},
|
|
431
|
-
|
|
724
|
+
cameraBadge: {
|
|
725
|
+
position: "absolute",
|
|
726
|
+
right: 0,
|
|
727
|
+
bottom: 0,
|
|
728
|
+
width: 30,
|
|
729
|
+
height: 30,
|
|
730
|
+
borderRadius: 15,
|
|
731
|
+
borderWidth: 3,
|
|
432
732
|
backgroundColor: mobileTokens.color.primary,
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
},
|
|
439
|
-
modalBtnPrimaryLabel: {
|
|
440
|
-
color: "#fff",
|
|
441
|
-
fontSize: 16,
|
|
733
|
+
alignItems: "center",
|
|
734
|
+
justifyContent: "center"
|
|
735
|
+
},
|
|
736
|
+
photoLink: {
|
|
737
|
+
fontSize: 15,
|
|
442
738
|
fontWeight: "600"
|
|
443
|
-
}
|
|
739
|
+
},
|
|
740
|
+
dim: {
|
|
741
|
+
opacity: 0.5
|
|
742
|
+
},
|
|
743
|
+
blocker: __spreadProps(__spreadValues({}, StyleSheet.absoluteFillObject), {
|
|
744
|
+
backgroundColor: "rgba(15,23,42,0.35)",
|
|
745
|
+
alignItems: "center",
|
|
746
|
+
justifyContent: "center"
|
|
747
|
+
})
|
|
444
748
|
});export{AccountScreen as default};//# sourceMappingURL=index.js.map
|