@oxyhq/services 27.1.2 → 28.0.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 (91) hide show
  1. package/LICENSE +202 -661
  2. package/NOTICE +15 -0
  3. package/README.md +3 -1
  4. package/lib/commonjs/index.js +36 -0
  5. package/lib/commonjs/index.js.map +1 -1
  6. package/lib/commonjs/ui/components/FollowTargetButton.js +22 -11
  7. package/lib/commonjs/ui/components/FollowTargetButton.js.map +1 -1
  8. package/lib/commonjs/ui/components/authChooser/signInProgress.js +5 -0
  9. package/lib/commonjs/ui/components/authChooser/signInProgress.js.map +1 -1
  10. package/lib/commonjs/ui/hooks/useFollowTarget.js +11 -2
  11. package/lib/commonjs/ui/hooks/useFollowTarget.js.map +1 -1
  12. package/lib/commonjs/ui/screens/AccountMembersScreen.js +3 -4
  13. package/lib/commonjs/ui/screens/AccountMembersScreen.js.map +1 -1
  14. package/lib/commonjs/ui/screens/CreateAccountScreen.js +3 -12
  15. package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
  16. package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +6 -5
  17. package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
  18. package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +4 -4
  19. package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
  20. package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +1 -1
  21. package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js +4 -2
  22. package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js.map +1 -1
  23. package/lib/commonjs/ui/stores/followTargetStore.js +39 -0
  24. package/lib/commonjs/ui/stores/followTargetStore.js.map +1 -1
  25. package/lib/module/index.js +11 -2
  26. package/lib/module/index.js.map +1 -1
  27. package/lib/module/ui/components/FollowTargetButton.js +22 -11
  28. package/lib/module/ui/components/FollowTargetButton.js.map +1 -1
  29. package/lib/module/ui/components/authChooser/signInProgress.js +5 -0
  30. package/lib/module/ui/components/authChooser/signInProgress.js.map +1 -1
  31. package/lib/module/ui/hooks/useFollowTarget.js +12 -3
  32. package/lib/module/ui/hooks/useFollowTarget.js.map +1 -1
  33. package/lib/module/ui/screens/AccountMembersScreen.js +4 -5
  34. package/lib/module/ui/screens/AccountMembersScreen.js.map +1 -1
  35. package/lib/module/ui/screens/CreateAccountScreen.js +4 -13
  36. package/lib/module/ui/screens/CreateAccountScreen.js.map +1 -1
  37. package/lib/module/ui/screens/trust/TrustCenterScreen.js +6 -5
  38. package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
  39. package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js +5 -5
  40. package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
  41. package/lib/module/ui/screens/trust/TrustRewardsScreen.js +1 -1
  42. package/lib/module/ui/screens/trust/TrustRulesScreen.js +4 -2
  43. package/lib/module/ui/screens/trust/TrustRulesScreen.js.map +1 -1
  44. package/lib/module/ui/stores/followTargetStore.js +36 -0
  45. package/lib/module/ui/stores/followTargetStore.js.map +1 -1
  46. package/lib/typescript/commonjs/index.d.ts +2 -2
  47. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  48. package/lib/typescript/commonjs/ui/components/FollowTargetButton.d.ts +6 -1
  49. package/lib/typescript/commonjs/ui/components/FollowTargetButton.d.ts.map +1 -1
  50. package/lib/typescript/commonjs/ui/components/authChooser/signInProgress.d.ts.map +1 -1
  51. package/lib/typescript/commonjs/ui/hooks/useFollowTarget.d.ts.map +1 -1
  52. package/lib/typescript/commonjs/ui/screens/AccountMembersScreen.d.ts.map +1 -1
  53. package/lib/typescript/commonjs/ui/screens/CreateAccountScreen.d.ts.map +1 -1
  54. package/lib/typescript/commonjs/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
  55. package/lib/typescript/commonjs/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
  56. package/lib/typescript/commonjs/ui/stores/followTargetStore.d.ts +15 -1
  57. package/lib/typescript/commonjs/ui/stores/followTargetStore.d.ts.map +1 -1
  58. package/lib/typescript/module/index.d.ts +2 -2
  59. package/lib/typescript/module/index.d.ts.map +1 -1
  60. package/lib/typescript/module/ui/components/FollowTargetButton.d.ts +6 -1
  61. package/lib/typescript/module/ui/components/FollowTargetButton.d.ts.map +1 -1
  62. package/lib/typescript/module/ui/components/authChooser/signInProgress.d.ts.map +1 -1
  63. package/lib/typescript/module/ui/hooks/useFollowTarget.d.ts.map +1 -1
  64. package/lib/typescript/module/ui/screens/AccountMembersScreen.d.ts.map +1 -1
  65. package/lib/typescript/module/ui/screens/CreateAccountScreen.d.ts.map +1 -1
  66. package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
  67. package/lib/typescript/module/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
  68. package/lib/typescript/module/ui/stores/followTargetStore.d.ts +15 -1
  69. package/lib/typescript/module/ui/stores/followTargetStore.d.ts.map +1 -1
  70. package/package.json +6 -5
  71. package/src/index.ts +16 -1
  72. package/src/ui/components/FollowTargetButton.tsx +28 -6
  73. package/src/ui/components/__tests__/followTargetButton.test.ts +51 -0
  74. package/src/ui/components/authChooser/signInProgress.ts +4 -0
  75. package/src/ui/hooks/useFollowTarget.ts +12 -4
  76. package/src/ui/screens/AccountMembersScreen.tsx +6 -5
  77. package/src/ui/screens/CreateAccountScreen.tsx +3 -16
  78. package/src/ui/screens/trust/TrustCenterScreen.tsx +7 -7
  79. package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +4 -5
  80. package/src/ui/screens/trust/TrustRewardsScreen.tsx +1 -1
  81. package/src/ui/screens/trust/TrustRulesScreen.tsx +3 -2
  82. package/src/ui/stores/followTargetStore.ts +35 -1
  83. package/lib/commonjs/ui/screens/trust/trustTier.js +0 -23
  84. package/lib/commonjs/ui/screens/trust/trustTier.js.map +0 -1
  85. package/lib/module/ui/screens/trust/trustTier.js +0 -19
  86. package/lib/module/ui/screens/trust/trustTier.js.map +0 -1
  87. package/lib/typescript/commonjs/ui/screens/trust/trustTier.d.ts +0 -9
  88. package/lib/typescript/commonjs/ui/screens/trust/trustTier.d.ts.map +0 -1
  89. package/lib/typescript/module/ui/screens/trust/trustTier.d.ts +0 -9
  90. package/lib/typescript/module/ui/screens/trust/trustTier.d.ts.map +0 -1
  91. package/src/ui/screens/trust/trustTier.ts +0 -20
@@ -15,7 +15,7 @@ import { Button } from '@oxyhq/bloom/button';
15
15
  import { TextField, TextFieldInput } from '@oxyhq/bloom/text-field';
16
16
  import { Divider } from '@oxyhq/bloom/divider';
17
17
  import type { AccountMember, AccountRole } from '@oxyhq/core';
18
- import { getNormalizedUserHandle } from '@oxyhq/core';
18
+ import { accountRoleLabel, getNormalizedUserHandle } from '@oxyhq/core';
19
19
  import type { BaseScreenProps } from '../types/navigation';
20
20
  import { useOxy } from '../context/OxyContext';
21
21
  import { useI18n } from '../hooks/useI18n';
@@ -42,7 +42,7 @@ const isUserNotFound = (error: unknown): boolean => {
42
42
  const AccountMembersScreen: React.FC<BaseScreenProps> = ({ onClose, goBack, accountId }) => {
43
43
  const bloomTheme = useTheme();
44
44
  const colors = bloomTheme.colors;
45
- const { t } = useI18n();
45
+ const { t, locale } = useI18n();
46
46
 
47
47
  useSurfaceHeader({
48
48
  title: t('accounts.members.title') || 'Members',
@@ -53,9 +53,10 @@ const AccountMembersScreen: React.FC<BaseScreenProps> = ({ onClose, goBack, acco
53
53
 
54
54
  const id = typeof accountId === 'string' ? accountId : '';
55
55
 
56
- const roleLabel = useCallback((role: AccountRole): string => {
57
- return t(`accounts.roles.${role}.label`) || role.charAt(0).toUpperCase() + role.slice(1);
58
- }, [t]);
56
+ const roleLabel = useCallback(
57
+ (role: AccountRole): string => accountRoleLabel(locale, role),
58
+ [locale],
59
+ );
59
60
 
60
61
  const accountQuery = useQuery({
61
62
  queryKey: ['accounts', 'detail', id],
@@ -3,7 +3,7 @@ import { useState, useCallback, useRef, useEffect } from 'react';
3
3
  import { View, ActivityIndicator } from 'react-native';
4
4
  import Ionicons from '@expo/vector-icons/Ionicons';
5
5
  import type { AccountCategoryId, AccountKind, CreateAccountInput } from '@oxyhq/core';
6
- import { DISPLAY_NAME_INVALID_MESSAGE, isValidDisplayName, MAX_ACCOUNT_CATEGORIES, MAX_DISPLAY_NAME_LENGTH, SELECTABLE_ACCOUNT_CATEGORY_IDS } from '@oxyhq/core';
6
+ import { accountCategoryLabel, DISPLAY_NAME_INVALID_MESSAGE, isValidDisplayName, MAX_ACCOUNT_CATEGORIES, MAX_DISPLAY_NAME_LENGTH, SELECTABLE_ACCOUNT_CATEGORY_IDS } from '@oxyhq/core';
7
7
  import type { BaseScreenProps } from '../types/navigation';
8
8
  import { useI18n } from '../hooks/useI18n';
9
9
  import { useSurfaceHeader } from '../hooks/useSurfaceHeader';
@@ -83,19 +83,6 @@ const kindDescription = (
83
83
  }
84
84
  };
85
85
 
86
- /**
87
- * The visible label for a category id.
88
- *
89
- * A lookup, deliberately not a `switch` with a `default`: a `default` would let
90
- * an id with no translation render as some OTHER category's label, silently and
91
- * only in the languages that are missing it. Falling back to the raw id is ugly
92
- * and correct — it is visibly wrong, and it names the missing key.
93
- */
94
- const accountCategoryLabel = (
95
- t: (key: string, vars?: Record<string, string | number>) => string,
96
- category: AccountCategoryId,
97
- ): string => t(`accounts.accountCategory.${category}`) || category;
98
-
99
86
  /**
100
87
  * Only the SELECTABLE ids are offered. The full `ACCOUNT_CATEGORY_IDS` still
101
88
  * contains withdrawn ones so that accounts already carrying them keep working —
@@ -116,7 +103,7 @@ const CreateAccountScreen: React.FC<BaseScreenProps> = ({
116
103
  }) => {
117
104
  const bloomTheme = useTheme();
118
105
  const { oxyServices, createAccount, switchToAccount } = useOxy();
119
- const { t } = useI18n();
106
+ const { t, locale } = useI18n();
120
107
 
121
108
  useSurfaceHeader({
122
109
  title: t('accounts.create.title') || 'Create account',
@@ -337,7 +324,7 @@ const CreateAccountScreen: React.FC<BaseScreenProps> = ({
337
324
  {ACCOUNT_CATEGORY_OPTIONS.map((option) => {
338
325
  const position = accountCategories.indexOf(option);
339
326
  const selected = position >= 0;
340
- const label = accountCategoryLabel(t, option);
327
+ const label = accountCategoryLabel(locale, option);
341
328
  return (
342
329
  <SettingsListItem
343
330
  key={option}
@@ -13,7 +13,7 @@ import { Loading } from '@oxyhq/bloom/loading';
13
13
  import { useI18n } from '../../hooks/useI18n';
14
14
  import { useSurfaceHeader } from '../../hooks/useSurfaceHeader';
15
15
  import { useOxy } from '../../context/OxyContext';
16
- import { getTrustTierLabel } from './trustTier';
16
+ import { trustTierLabel } from '@oxyhq/core';
17
17
 
18
18
  const TrustCenterScreen: React.FC<BaseScreenProps> = ({
19
19
  navigate,
@@ -21,7 +21,7 @@ const TrustCenterScreen: React.FC<BaseScreenProps> = ({
21
21
  // Reputation/trust is the ACTIVE account's standing (the org/project/bot
22
22
  // when switched, else the personal user).
23
23
  const { user, oxyServices, isAuthenticated } = useOxy();
24
- const { t } = useI18n();
24
+ const { t, locale } = useI18n();
25
25
  const [reputationTotal, setReputationTotal] = useState<number | null>(null);
26
26
  const [trustTier, setTrustTier] = useState<TrustTier | null>(null);
27
27
  const [transactions, setTransactions] = useState<ReputationTransaction[]>([]);
@@ -53,9 +53,9 @@ const TrustCenterScreen: React.FC<BaseScreenProps> = ({
53
53
  .finally(() => setIsLoading(false));
54
54
  }, [user, oxyServices, t]);
55
55
 
56
- const trustTierLabel = useMemo(
57
- () => (trustTier ? getTrustTierLabel(trustTier, t) : null),
58
- [trustTier, t],
56
+ const resolvedTrustTierLabel = useMemo(
57
+ () => (trustTier ? trustTierLabel(locale, trustTier) : null),
58
+ [trustTier, locale],
59
59
  );
60
60
 
61
61
  const title = t('trust.center.title') || 'Trust Center';
@@ -87,7 +87,7 @@ const TrustCenterScreen: React.FC<BaseScreenProps> = ({
87
87
  <Text className="text-text-tertiary text-base mt-space-2 mb-space-12">
88
88
  {t('trust.center.balance') || 'Reputation Balance'}
89
89
  </Text>
90
- {trustTierLabel ? (
90
+ {resolvedTrustTierLabel ? (
91
91
  <Chip
92
92
  variant="soft"
93
93
  color="primary"
@@ -99,7 +99,7 @@ const TrustCenterScreen: React.FC<BaseScreenProps> = ({
99
99
  />
100
100
  }
101
101
  >
102
- {trustTierLabel}
102
+ {resolvedTrustTierLabel}
103
103
  </Chip>
104
104
  ) : null}
105
105
  <Text
@@ -8,7 +8,7 @@ import {
8
8
  TouchableOpacity,
9
9
  } from 'react-native';
10
10
  import type { ReputationLeaderboardEntry } from '@oxyhq/contracts';
11
- import { getNormalizedUserHandle, logger } from '@oxyhq/core';
11
+ import { getNormalizedUserHandle, logger, trustTierLabel } from '@oxyhq/core';
12
12
  import { useTheme } from '@oxyhq/bloom/theme';
13
13
  import { H6, Text } from '@oxyhq/bloom/typography';
14
14
  import { Chip } from '@oxyhq/bloom/chip';
@@ -19,7 +19,6 @@ import { Avatar } from '@oxyhq/bloom/avatar';
19
19
  import { useI18n } from '../../hooks/useI18n';
20
20
  import { useSurfaceHeader } from '../../hooks/useSurfaceHeader';
21
21
  import { useOxy } from '../../context/OxyContext';
22
- import { getTrustTierLabel } from './trustTier';
23
22
 
24
23
  const AVATAR_SIZE = 40;
25
24
  const EMPTY_ICON_SIZE = 64;
@@ -29,7 +28,7 @@ const PODIUM_RANK = 3;
29
28
 
30
29
  const TrustLeaderboardScreen: React.FC<BaseScreenProps> = ({ navigate }) => {
31
30
  const { oxyServices, user: currentUser } = useOxy();
32
- const { t } = useI18n();
31
+ const { t, locale } = useI18n();
33
32
  const bloomTheme = useTheme();
34
33
 
35
34
  const [leaderboard, setLeaderboard] = useState<ReputationLeaderboardEntry[]>([]);
@@ -106,7 +105,7 @@ const TrustLeaderboardScreen: React.FC<BaseScreenProps> = ({ navigate }) => {
106
105
  </Text>
107
106
  <View style={styles.tierRow} className="mt-space-4">
108
107
  <Chip size="small" variant="soft" color={isPodium ? 'primary' : 'default'}>
109
- {getTrustTierLabel(item.trustTier, t)}
108
+ {trustTierLabel(locale, item.trustTier)}
110
109
  </Chip>
111
110
  </View>
112
111
  </View>
@@ -116,7 +115,7 @@ const TrustLeaderboardScreen: React.FC<BaseScreenProps> = ({ navigate }) => {
116
115
  </TouchableOpacity>
117
116
  );
118
117
  },
119
- [oxyServices, currentUserId, handleEntryPress, t],
118
+ [oxyServices, currentUserId, handleEntryPress, locale],
120
119
  );
121
120
 
122
121
  const keyExtractor = useCallback(
@@ -26,7 +26,7 @@ interface Achievement {
26
26
  }
27
27
 
28
28
  /**
29
- * Per-achievement identity tints. Like the trust-tier palette in `trustTier.ts`,
29
+ * Per-achievement identity tints. Like the trust-tier palette in `trustTierLabels`,
30
30
  * these are data, not theme surfaces — they brand each badge regardless of theme.
31
31
  */
32
32
  const ACHIEVEMENT_TINT = {
@@ -4,6 +4,7 @@ import { View, Text } from 'react-native';
4
4
  import { SettingsListGroup, SettingsListItem } from '@oxyhq/bloom/settings-list';
5
5
  import { Chip } from '@oxyhq/bloom/chip';
6
6
  import { useTheme } from '@oxyhq/bloom/theme';
7
+ import { reputationCategoryLabel } from '@oxyhq/core';
7
8
  import type { ReputationRule, ReputationCategory } from '@oxyhq/contracts';
8
9
  import type { BaseScreenProps } from '../../types/navigation';
9
10
  import { useSurfaceHeader } from '../../hooks/useSurfaceHeader';
@@ -24,7 +25,7 @@ const CATEGORY_ORDER: ReputationCategory[] = [
24
25
 
25
26
  const TrustRulesScreen: React.FC<BaseScreenProps> = () => {
26
27
  const { oxyServices } = useOxy();
27
- const { t } = useI18n();
28
+ const { t, locale } = useI18n();
28
29
 
29
30
  useSurfaceHeader({
30
31
  title: t('trust.rules.title') || 'Trust Rules',
@@ -82,7 +83,7 @@ const TrustRulesScreen: React.FC<BaseScreenProps> = () => {
82
83
  {groupedRules.map(({ category, items }) => (
83
84
  <SettingsListGroup
84
85
  key={category}
85
- title={t(`trust.rules.categories.${category}`) || category}
86
+ title={reputationCategoryLabel(locale, category)}
86
87
  >
87
88
  {items.map((rule) => (
88
89
  <SettingsListItem
@@ -23,7 +23,7 @@
23
23
  */
24
24
 
25
25
  import { create } from 'zustand';
26
- import type { FollowApplicationMode, FollowStatus } from '@oxyhq/contracts';
26
+ import type { FollowApplicationMode, FollowRecord, FollowStatus } from '@oxyhq/contracts';
27
27
 
28
28
  /** The status of one target, or `undefined` when it has never been read. */
29
29
  type StatusMap = Record<string, FollowStatus | undefined>;
@@ -93,6 +93,40 @@ export function isFollowedGlobally(status: FollowStatus): boolean {
93
93
  return status.globalState === 'active' || status.globalState === 'requested';
94
94
  }
95
95
 
96
+ /**
97
+ * Whether a cached status is safe to act on without a round trip.
98
+ *
99
+ * List payloads often carry `globalState` without `relationshipId`. Treating
100
+ * that as authoritative would leave disable/unfollow as no-ops forever.
101
+ */
102
+ export function isCompleteFollowStatus(status: FollowStatus): boolean {
103
+ if (isFollowedGlobally(status)) return Boolean(status.relationshipId);
104
+ return true;
105
+ }
106
+
107
+ /** Convert one list row into the status shape the follow-target store expects. */
108
+ export function followRecordToStatus(record: FollowRecord): FollowStatus {
109
+ return {
110
+ relationshipId: record.relationshipId,
111
+ globalState: record.globalState,
112
+ applicationMode: record.applicationMode,
113
+ effectiveState: record.effectiveState,
114
+ ...(record.expiresAt ? { expiresAt: record.expiresAt } : {}),
115
+ };
116
+ }
117
+
118
+ /**
119
+ * Bulk-convert a follow list page into a status map keyed by target id — the
120
+ * input shape for `useFollowTargetStore.getState().seed(...)`.
121
+ */
122
+ export function followRecordsToStatusMap(records: FollowRecord[]): Record<string, FollowStatus> {
123
+ const entries: Record<string, FollowStatus> = {};
124
+ for (const record of records) {
125
+ entries[record.target.id] = followRecordToStatus(record);
126
+ }
127
+ return entries;
128
+ }
129
+
96
130
  /**
97
131
  * Apply a mode change to a cached status without a round trip.
98
132
  *
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getTrustTierLabel = getTrustTierLabel;
7
- /** Default English labels for each trust tier, used as i18n fallbacks. */
8
- const TRUST_TIER_FALLBACK = {
9
- new: 'New',
10
- trusted: 'Trusted',
11
- high_trust: 'High Trust',
12
- verified: 'Verified',
13
- restricted: 'Restricted'
14
- };
15
-
16
- /**
17
- * Resolve a human-readable label for a trust tier, preferring the localized
18
- * `trust.tiers.<tier>` key and falling back to the canonical English label.
19
- */
20
- function getTrustTierLabel(tier, t) {
21
- return t(`trust.tiers.${tier}`) || TRUST_TIER_FALLBACK[tier];
22
- }
23
- //# sourceMappingURL=trustTier.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["TRUST_TIER_FALLBACK","new","trusted","high_trust","verified","restricted","getTrustTierLabel","tier","t"],"sourceRoot":"../../../../../src","sources":["ui/screens/trust/trustTier.ts"],"mappings":";;;;;;AAIA;AACA,MAAMA,mBAA8C,GAAG;EACnDC,GAAG,EAAE,KAAK;EACVC,OAAO,EAAE,SAAS;EAClBC,UAAU,EAAE,YAAY;EACxBC,QAAQ,EAAE,UAAU;EACpBC,UAAU,EAAE;AAChB,CAAC;;AAED;AACA;AACA;AACA;AACO,SAASC,iBAAiBA,CAACC,IAAe,EAAEC,CAAY,EAAU;EACrE,OAAOA,CAAC,CAAC,eAAeD,IAAI,EAAE,CAAC,IAAIP,mBAAmB,CAACO,IAAI,CAAC;AAChE","ignoreList":[]}
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- /** Default English labels for each trust tier, used as i18n fallbacks. */
4
- const TRUST_TIER_FALLBACK = {
5
- new: 'New',
6
- trusted: 'Trusted',
7
- high_trust: 'High Trust',
8
- verified: 'Verified',
9
- restricted: 'Restricted'
10
- };
11
-
12
- /**
13
- * Resolve a human-readable label for a trust tier, preferring the localized
14
- * `trust.tiers.<tier>` key and falling back to the canonical English label.
15
- */
16
- export function getTrustTierLabel(tier, t) {
17
- return t(`trust.tiers.${tier}`) || TRUST_TIER_FALLBACK[tier];
18
- }
19
- //# sourceMappingURL=trustTier.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["TRUST_TIER_FALLBACK","new","trusted","high_trust","verified","restricted","getTrustTierLabel","tier","t"],"sourceRoot":"../../../../../src","sources":["ui/screens/trust/trustTier.ts"],"mappings":";;AAIA;AACA,MAAMA,mBAA8C,GAAG;EACnDC,GAAG,EAAE,KAAK;EACVC,OAAO,EAAE,SAAS;EAClBC,UAAU,EAAE,YAAY;EACxBC,QAAQ,EAAE,UAAU;EACpBC,UAAU,EAAE;AAChB,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAACC,IAAe,EAAEC,CAAY,EAAU;EACrE,OAAOA,CAAC,CAAC,eAAeD,IAAI,EAAE,CAAC,IAAIP,mBAAmB,CAACO,IAAI,CAAC;AAChE","ignoreList":[]}
@@ -1,9 +0,0 @@
1
- import type { TrustTier } from '@oxyhq/contracts';
2
- type Translate = (key: string, vars?: Record<string, string | number>) => string;
3
- /**
4
- * Resolve a human-readable label for a trust tier, preferring the localized
5
- * `trust.tiers.<tier>` key and falling back to the canonical English label.
6
- */
7
- export declare function getTrustTierLabel(tier: TrustTier, t: Translate): string;
8
- export {};
9
- //# sourceMappingURL=trustTier.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"trustTier.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/screens/trust/trustTier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,KAAK,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;AAWjF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAEvE"}
@@ -1,9 +0,0 @@
1
- import type { TrustTier } from '@oxyhq/contracts';
2
- type Translate = (key: string, vars?: Record<string, string | number>) => string;
3
- /**
4
- * Resolve a human-readable label for a trust tier, preferring the localized
5
- * `trust.tiers.<tier>` key and falling back to the canonical English label.
6
- */
7
- export declare function getTrustTierLabel(tier: TrustTier, t: Translate): string;
8
- export {};
9
- //# sourceMappingURL=trustTier.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"trustTier.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/screens/trust/trustTier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,KAAK,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;AAWjF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAEvE"}
@@ -1,20 +0,0 @@
1
- import type { TrustTier } from '@oxyhq/contracts';
2
-
3
- type Translate = (key: string, vars?: Record<string, string | number>) => string;
4
-
5
- /** Default English labels for each trust tier, used as i18n fallbacks. */
6
- const TRUST_TIER_FALLBACK: Record<TrustTier, string> = {
7
- new: 'New',
8
- trusted: 'Trusted',
9
- high_trust: 'High Trust',
10
- verified: 'Verified',
11
- restricted: 'Restricted',
12
- };
13
-
14
- /**
15
- * Resolve a human-readable label for a trust tier, preferring the localized
16
- * `trust.tiers.<tier>` key and falling back to the canonical English label.
17
- */
18
- export function getTrustTierLabel(tier: TrustTier, t: Translate): string {
19
- return t(`trust.tiers.${tier}`) || TRUST_TIER_FALLBACK[tier];
20
- }