@oxy.so/services 12.10.0 → 12.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/lib/commonjs/ui/components/OxyAuthChooser.js +8 -1
  2. package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
  3. package/lib/commonjs/ui/components/accountSettings/AccountCategoriesSection.js +142 -0
  4. package/lib/commonjs/ui/components/accountSettings/AccountCategoriesSection.js.map +1 -0
  5. package/lib/commonjs/ui/components/accountSettings/AccountSettings.js +361 -0
  6. package/lib/commonjs/ui/components/accountSettings/AccountSettings.js.map +1 -0
  7. package/lib/commonjs/ui/context/OxyContext.js +15 -2
  8. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  9. package/lib/commonjs/ui/hooks/useAvatarPicker.js +54 -48
  10. package/lib/commonjs/ui/hooks/useAvatarPicker.js.map +1 -1
  11. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +16 -237
  12. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  13. package/lib/commonjs/ui/screens/ChangeAvatarScreen.js +23 -4
  14. package/lib/commonjs/ui/screens/ChangeAvatarScreen.js.map +1 -1
  15. package/lib/commonjs/ui/screens/ManageAccountScreen.js +11 -3
  16. package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
  17. package/lib/commonjs/ui/screens/index.js +7 -0
  18. package/lib/commonjs/ui/screens/index.js.map +1 -1
  19. package/lib/module/ui/components/OxyAuthChooser.js +8 -1
  20. package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
  21. package/lib/module/ui/components/accountSettings/AccountCategoriesSection.js +134 -0
  22. package/lib/module/ui/components/accountSettings/AccountCategoriesSection.js.map +1 -0
  23. package/lib/module/ui/components/accountSettings/AccountSettings.js +355 -0
  24. package/lib/module/ui/components/accountSettings/AccountSettings.js.map +1 -0
  25. package/lib/module/ui/context/OxyContext.js +15 -2
  26. package/lib/module/ui/context/OxyContext.js.map +1 -1
  27. package/lib/module/ui/hooks/useAvatarPicker.js +53 -48
  28. package/lib/module/ui/hooks/useAvatarPicker.js.map +1 -1
  29. package/lib/module/ui/screens/AccountSettingsScreen.js +16 -235
  30. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  31. package/lib/module/ui/screens/ChangeAvatarScreen.js +23 -4
  32. package/lib/module/ui/screens/ChangeAvatarScreen.js.map +1 -1
  33. package/lib/module/ui/screens/ManageAccountScreen.js +11 -3
  34. package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
  35. package/lib/module/ui/screens/index.js +4 -0
  36. package/lib/module/ui/screens/index.js.map +1 -1
  37. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
  38. package/lib/typescript/commonjs/ui/components/accountSettings/AccountCategoriesSection.d.ts +26 -0
  39. package/lib/typescript/commonjs/ui/components/accountSettings/AccountCategoriesSection.d.ts.map +1 -0
  40. package/lib/typescript/commonjs/ui/components/accountSettings/AccountSettings.d.ts +80 -0
  41. package/lib/typescript/commonjs/ui/components/accountSettings/AccountSettings.d.ts.map +1 -0
  42. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  43. package/lib/typescript/commonjs/ui/hooks/useAvatarPicker.d.ts +22 -1
  44. package/lib/typescript/commonjs/ui/hooks/useAvatarPicker.d.ts.map +1 -1
  45. package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts +4 -5
  46. package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  47. package/lib/typescript/commonjs/ui/screens/ChangeAvatarScreen.d.ts.map +1 -1
  48. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  49. package/lib/typescript/commonjs/ui/screens/index.d.ts +1 -0
  50. package/lib/typescript/commonjs/ui/screens/index.d.ts.map +1 -1
  51. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
  52. package/lib/typescript/module/ui/components/accountSettings/AccountCategoriesSection.d.ts +26 -0
  53. package/lib/typescript/module/ui/components/accountSettings/AccountCategoriesSection.d.ts.map +1 -0
  54. package/lib/typescript/module/ui/components/accountSettings/AccountSettings.d.ts +80 -0
  55. package/lib/typescript/module/ui/components/accountSettings/AccountSettings.d.ts.map +1 -0
  56. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  57. package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts +22 -1
  58. package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts.map +1 -1
  59. package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts +4 -5
  60. package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  61. package/lib/typescript/module/ui/screens/ChangeAvatarScreen.d.ts.map +1 -1
  62. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  63. package/lib/typescript/module/ui/screens/index.d.ts +1 -0
  64. package/lib/typescript/module/ui/screens/index.d.ts.map +1 -1
  65. package/package.json +4 -4
  66. package/src/ui/components/OxyAuthChooser.tsx +9 -1
  67. package/src/ui/components/accountSettings/AccountCategoriesSection.tsx +180 -0
  68. package/src/ui/components/accountSettings/AccountSettings.tsx +421 -0
  69. package/src/ui/components/accountSettings/__tests__/AccountSettings.test.tsx +101 -0
  70. package/src/ui/context/OxyContext.tsx +11 -2
  71. package/src/ui/hooks/useAvatarPicker.ts +65 -69
  72. package/src/ui/screens/AccountSettingsScreen.tsx +13 -277
  73. package/src/ui/screens/ChangeAvatarScreen.tsx +25 -6
  74. package/src/ui/screens/ManageAccountScreen.tsx +26 -17
  75. package/src/ui/screens/index.ts +8 -0
@@ -61,6 +61,7 @@ const ManageAccountScreen: React.FC<ManageAccountScreenProps> = ({
61
61
  openAvatarPicker,
62
62
  accounts,
63
63
  openAccountDialog,
64
+ accountDialogController,
64
65
  hasIdentity,
65
66
  } = useOxy();
66
67
 
@@ -105,7 +106,12 @@ const ManageAccountScreen: React.FC<ManageAccountScreenProps> = ({
105
106
  }
106
107
  setSigningOut(true);
107
108
  try {
108
- await logout();
109
+ const result = await logout();
110
+ if (result?.status === 'failed') {
111
+ loggerUtil.warn('Sign out failed', { component: 'ManageAccountScreen' }, result.error);
112
+ toast.error(t('common.errors.signOutFailed') || 'Failed to sign out');
113
+ return;
114
+ }
109
115
  toast.success(t('common.actions.signedOut') || 'Signed out');
110
116
  onClose?.();
111
117
  } catch (error) {
@@ -360,22 +366,25 @@ const ManageAccountScreen: React.FC<ManageAccountScreenProps> = ({
360
366
  {/* Accounts (unified account graph) */}
361
367
  {accounts.length > 0 || isAuthenticated ? (
362
368
  <GroupedSection title={t('accountCenter.sections.accounts') || 'Accounts'}>
363
- <GroupedSectionItem
364
- icon={<SettingsIcon name="account-switch" color={bloomTheme.colors.info} />}
365
- title={t('accounts.manage.switch.title') || 'Switch account'}
366
- description={
367
- accounts.length > 0
368
- ? // One account is "1 account", not "1 accounts".
369
- t(
370
- accounts.length === 1
371
- ? 'accounts.manage.switch.countOne'
372
- : 'accounts.manage.switch.count',
373
- { count: accounts.length },
374
- )
375
- : t('accounts.manage.switch.empty') || 'Accounts you own or share'
376
- }
377
- onPress={() => openAccountDialog('accounts')}
378
- />
369
+ {/* No controller means the dialog can never open (identity-bound session). */}
370
+ {accountDialogController ? (
371
+ <GroupedSectionItem
372
+ icon={<SettingsIcon name="account-switch" color={bloomTheme.colors.info} />}
373
+ title={t('accounts.manage.switch.title') || 'Switch account'}
374
+ description={
375
+ accounts.length > 0
376
+ ? // One account is "1 account", not "1 accounts".
377
+ t(
378
+ accounts.length === 1
379
+ ? 'accounts.manage.switch.countOne'
380
+ : 'accounts.manage.switch.count',
381
+ { count: accounts.length },
382
+ )
383
+ : t('accounts.manage.switch.empty') || 'Accounts you own or share'
384
+ }
385
+ onPress={() => openAccountDialog('accounts')}
386
+ />
387
+ ) : null}
379
388
  <GroupedSectionItem
380
389
  icon={<SettingsIcon name="account-plus" color={bloomTheme.colors.primary} />}
381
390
  title={t('accounts.create.title') || 'Create account'}
@@ -18,3 +18,11 @@ export { default as AccountSettingsScreen } from './AccountSettingsScreen';
18
18
 
19
19
  export { default as SupervisionScreen } from './SupervisionScreen';
20
20
  export { default as OxyOneScreen } from './OxyOneScreen';
21
+
22
+ // The body of the `AccountSettings` surface, for an app embedding a managed
23
+ // account's settings in its own page with its own sections around them.
24
+ export {
25
+ AccountSettings,
26
+ type AccountSettingsProps,
27
+ type AccountSettingsArchiveOptions,
28
+ } from '../components/accountSettings/AccountSettings';