@microcosmmoney/portal-react 3.2.2 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
- import { type MicrocosmMenuGroup, type MicrocosmMenuItem } from '../menu-config';
2
+ import { type MicrocosmMenuGroup, type MicrocosmMenuItem, type MenuLocale } from '../menu-config';
3
3
  export interface MicrocosmMenuSectionProps {
4
4
  basePath?: string;
5
5
  currentPath?: string;
6
+ locale?: MenuLocale;
6
7
  onNavigate?: (path: string) => void;
7
8
  onItemClick?: (item: MicrocosmMenuItem, resolvedPath: string) => void;
8
9
  groups?: MicrocosmMenuGroup[];
@@ -13,4 +14,4 @@ export interface MicrocosmMenuSectionProps {
13
14
  renderItem?: (item: MicrocosmMenuItem, resolvedPath: string, isActive: boolean) => React.ReactNode;
14
15
  renderSectionHeader?: (group: MicrocosmMenuGroup) => React.ReactNode;
15
16
  }
16
- export declare function MicrocosmMenuSection({ basePath, currentPath, onNavigate, onItemClick, groups, className, filterItems, extraItems, extraItemsPosition, renderItem, renderSectionHeader, }: MicrocosmMenuSectionProps): import("react/jsx-runtime").JSX.Element;
17
+ export declare function MicrocosmMenuSection({ basePath, currentPath, locale, onNavigate, onItemClick, groups, className, filterItems, extraItems, extraItemsPosition, renderItem, renderSectionHeader, }: MicrocosmMenuSectionProps): import("react/jsx-runtime").JSX.Element;
@@ -15,7 +15,7 @@ function isActive(itemPath, currentPath) {
15
15
  return currentPath === '/';
16
16
  return currentPath.startsWith(itemPath);
17
17
  }
18
- function MicrocosmMenuSection({ basePath, currentPath, onNavigate, onItemClick, groups = menu_config_1.microcosmMenuGroups, className = '', filterItems, extraItems, extraItemsPosition = 'bottom', renderItem, renderSectionHeader, }) {
18
+ function MicrocosmMenuSection({ basePath, currentPath, locale, onNavigate, onItemClick, groups = menu_config_1.microcosmMenuGroups, className = '', filterItems, extraItems, extraItemsPosition = 'bottom', renderItem, renderSectionHeader, }) {
19
19
  const renderMenuItem = (item) => {
20
20
  const resolved = (0, menu_config_1.resolveMenuPath)(item.path, basePath);
21
21
  const active = isActive(resolved, currentPath);
@@ -25,7 +25,7 @@ function MicrocosmMenuSection({ basePath, currentPath, onNavigate, onItemClick,
25
25
  return ((0, jsx_runtime_1.jsxs)("button", { onClick: () => {
26
26
  onItemClick?.(item, resolved);
27
27
  onNavigate?.(resolved);
28
- }, title: item.description, style: {
28
+ }, title: (0, menu_config_1.getMenuDescription)(item, locale), style: {
29
29
  display: 'flex',
30
30
  alignItems: 'center',
31
31
  gap: '8px',
@@ -50,7 +50,7 @@ function MicrocosmMenuSection({ basePath, currentPath, onNavigate, onItemClick,
50
50
  e.currentTarget.style.background = 'transparent';
51
51
  e.currentTarget.style.color = 'rgba(255,255,255,0.7)';
52
52
  }
53
- }, children: [(0, jsx_runtime_1.jsx)(item.icon, { size: 16 }), (0, jsx_runtime_1.jsx)("span", { style: { flex: 1 }, children: item.title }), item.badge && ((0, jsx_runtime_1.jsx)("span", { style: {
53
+ }, children: [(0, jsx_runtime_1.jsx)(item.icon, { size: 16 }), (0, jsx_runtime_1.jsx)("span", { style: { flex: 1 }, children: (0, menu_config_1.getMenuTitle)(item, locale) }), item.badge && ((0, jsx_runtime_1.jsx)("span", { style: {
54
54
  fontSize: '10px',
55
55
  padding: '1px 6px',
56
56
  borderRadius: '9999px',
@@ -74,6 +74,6 @@ function MicrocosmMenuSection({ basePath, currentPath, onNavigate, onItemClick,
74
74
  letterSpacing: '0.05em',
75
75
  opacity: 0.5,
76
76
  fontFamily: 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace',
77
- }, children: [(0, jsx_runtime_1.jsx)(group.icon, { size: 14 }), (0, jsx_runtime_1.jsx)("span", { children: group.title })] })), items.map(renderMenuItem)] }, group.key));
77
+ }, children: [(0, jsx_runtime_1.jsx)(group.icon, { size: 14 }), (0, jsx_runtime_1.jsx)("span", { children: (0, menu_config_1.getMenuTitle)(group, locale) })] })), items.map(renderMenuItem)] }, group.key));
78
78
  }), extraItemsPosition === 'bottom' && extraElements] }));
79
79
  }
@@ -21,63 +21,74 @@ function getMenuDescription(item, locale) {
21
21
  }
22
22
  exports.dashboardMenu = {
23
23
  title: 'Overview',
24
+ titles: { zh: '概览', ja: '概要', ko: '개요' },
24
25
  key: 'overview',
25
26
  icon: lucide_react_1.LayoutDashboard,
26
27
  items: [
27
28
  {
28
29
  title: 'Dashboard',
30
+ titles: { zh: '仪表盘', ja: 'ダッシュボード', ko: '대시보드' },
29
31
  key: 'dashboard',
30
32
  path: '/user-system/dashboard',
31
33
  icon: lucide_react_1.LayoutDashboard,
32
34
  description: 'Account overview and statistics',
35
+ descriptions: { zh: '账户总览与统计', ja: 'アカウント概要と統計', ko: '계정 개요 및 통계' },
33
36
  },
34
37
  ],
35
38
  };
36
39
  exports.blockchainMenu = {
37
40
  title: 'Blockchain',
41
+ titles: { zh: '区块链', ja: 'ブロックチェーン', ko: '블록체인' },
38
42
  key: 'blockchain',
39
43
  icon: lucide_react_1.Coins,
40
44
  items: [
41
45
  {
42
46
  title: 'Mining',
47
+ titles: { zh: '挖矿', ja: 'マイニング', ko: '마이닝' },
43
48
  key: 'mining',
44
49
  path: '/mcc/mining',
45
50
  icon: lucide_react_1.Pickaxe,
46
51
  description: 'Mine MCC with stablecoin',
52
+ descriptions: { zh: '用稳定币挖矿 MCC', ja: 'ステーブルコインでMCCをマイニング', ko: '스테이블코인으로 MCC 채굴' },
47
53
  },
48
54
  {
49
55
  title: 'Wallet',
56
+ titles: { zh: '钱包', ja: 'ウォレット', ko: '지갑' },
50
57
  key: 'wallet',
51
58
  path: '/mcc/wallet',
52
59
  icon: lucide_react_1.Wallet,
53
60
  description: 'MCC asset overview',
61
+ descriptions: { zh: 'MCC 资产总览', ja: 'MCC資産概要', ko: 'MCC 자산 개요' },
54
62
  },
55
63
  {
56
64
  title: 'MCD Credits',
65
+ titles: { zh: 'MCD 积分', ja: 'MCDクレジット', ko: 'MCD 크레딧' },
57
66
  key: 'mcd',
58
67
  path: '/mcc/mcd',
59
68
  icon: lucide_react_1.Ticket,
60
69
  description: 'MCD balance and records',
70
+ descriptions: { zh: 'MCD 余额与记录', ja: 'MCD残高と履歴', ko: 'MCD 잔액 및 기록' },
61
71
  },
62
72
  ],
63
73
  };
64
74
  exports.web3OsMenu = {
65
75
  title: 'Web3 OS',
76
+ titles: { zh: 'Web3 操作系统', ja: 'Web3 OS', ko: 'Web3 OS' },
66
77
  key: 'web3os',
67
78
  icon: lucide_react_1.Users,
68
79
  items: [
69
80
  {
70
81
  title: 'Auctions',
71
- titles: { zh: '拍卖', ja: 'Auctions', ko: 'Auctions' },
82
+ titles: { zh: '拍卖', ja: 'オークション', ko: '경매' },
72
83
  key: 'auctions',
73
84
  path: '/mcc/auctions',
74
85
  icon: lucide_react_1.Gift,
75
86
  description: 'Territory auction bidding',
76
- descriptions: { zh: '领地拍卖竞价', ja: '領地オークション', ko: '영토 경매' },
87
+ descriptions: { zh: '领地拍卖竞价', ja: '領地オークション入札', ko: '영토 경매 입찰' },
77
88
  },
78
89
  {
79
90
  title: 'Territories',
80
- titles: { zh: '领地管理', ja: 'Territories', ko: 'Territories' },
91
+ titles: { zh: '领地管理', ja: '領地管理', ko: '영토 관리' },
81
92
  key: 'territory',
82
93
  path: '/user-system/territory',
83
94
  icon: lucide_react_1.Building2,
@@ -86,39 +97,39 @@ exports.web3OsMenu = {
86
97
  },
87
98
  {
88
99
  title: 'NFT Fragments',
89
- titles: { zh: 'NFT 碎片化', ja: 'NFT Fragments', ko: 'NFT Fragments' },
100
+ titles: { zh: 'NFT 碎片化', ja: 'NFTフラグメント', ko: 'NFT 프래그먼트' },
90
101
  key: 'fragments',
91
102
  path: '/mcc/fragments',
92
103
  icon: lucide_react_1.Puzzle,
93
104
  description: 'Fractionalize territory NFTs',
94
- descriptions: { zh: '领地 NFT 碎片化交易', ja: 'NFTフラクション化', ko: 'NFT 분할화' },
105
+ descriptions: { zh: '领地 NFT 碎片化交易', ja: '領地NFTのフラクション化', ko: '영토 NFT 분할화 거래' },
95
106
  },
96
107
  {
97
108
  title: 'Lending',
98
- titles: { zh: '去中心化借贷', ja: 'Lending', ko: 'Lending' },
109
+ titles: { zh: '去中心化借贷', ja: 'レンディング', ko: '대출' },
99
110
  key: 'lending',
100
111
  path: '/mcc/lending',
101
112
  icon: lucide_react_1.Landmark,
102
113
  description: 'Borrow MCC with NFT collateral',
103
- descriptions: { zh: 'NFT 抵押借贷 MCC', ja: 'NFT担保レンディング', ko: 'NFT 담보 대출' },
114
+ descriptions: { zh: 'NFT 抵押借贷 MCC', ja: 'NFT担保でMCCを借入', ko: 'NFT 담보 MCC 대출' },
104
115
  },
105
116
  {
106
117
  title: 'Voting',
107
- titles: { zh: '投票', ja: 'Voting', ko: 'Voting' },
118
+ titles: { zh: '投票', ja: '投票', ko: '투표' },
108
119
  key: 'voting',
109
120
  path: '/mcc/voting',
110
121
  icon: lucide_react_1.Vote,
111
122
  description: 'Community proposal voting',
112
- descriptions: { zh: '社区提案投票', ja: '提案投票', ko: '제안 투표' },
123
+ descriptions: { zh: '社区提案投票', ja: 'コミュニティ提案投票', ko: '커뮤니티 제안 투표' },
113
124
  },
114
125
  {
115
126
  title: 'Organization',
116
- titles: { zh: '组织', ja: 'Organization', ko: 'Organization' },
127
+ titles: { zh: '组织', ja: '組織', ko: '조직' },
117
128
  key: 'organization',
118
129
  path: '/user-system/organization',
119
130
  icon: lucide_react_1.Users,
120
131
  description: 'Organization structure',
121
- descriptions: { zh: '组织架构管理', ja: '組織構造', ko: '조직 구조' },
132
+ descriptions: { zh: '组织架构管理', ja: '組織構造管理', ko: '조직 구조 관리' },
122
133
  },
123
134
  ],
124
135
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microcosmmoney/portal-react",
3
- "version": "3.2.2",
3
+ "version": "3.3.0",
4
4
  "description": "Microcosm Portal UI components for React/Next.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "lucide-react": ">=0.300.0"
19
19
  },
20
20
  "dependencies": {
21
- "@microcosmmoney/auth-core": "file:../auth-core",
21
+ "@microcosmmoney/auth-core": "^2.2.2",
22
22
  "@microcosmmoney/auth-react": "file:../auth-react"
23
23
  },
24
24
  "devDependencies": {