@abtnode/ux 1.16.51 → 1.16.52-beta-20250909-073849-4e392ab1

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/locales/ar.js CHANGED
@@ -1941,7 +1941,9 @@ export default {
1941
1941
  following: 'التالي',
1942
1942
  emptyFollowing: 'لا تتابع أي مستخدمين حتى الآن.',
1943
1943
  emptyFollowers: 'لا متابعين بعد',
1944
- title: 'متابعة ومتابعون'
1944
+ title: 'متابعة ومتابعون',
1945
+ invitees: 'المدعوون',
1946
+ emptyInvitees: 'لم تدعُ أحدًا بعد.'
1945
1947
  }
1946
1948
  },
1947
1949
  launcher: {
package/lib/locales/de.js CHANGED
@@ -1941,7 +1941,9 @@ export default {
1941
1941
  following: 'Folgend',
1942
1942
  emptyFollowing: 'Du folgst noch keinen Nutzern.',
1943
1943
  emptyFollowers: 'Noch keine Follower',
1944
- title: 'Abonnieren & Abonnenten'
1944
+ title: 'Abonnieren & Abonnenten',
1945
+ invitees: 'Eingeladene',
1946
+ emptyInvitees: 'Du hast noch niemanden eingeladen.'
1945
1947
  }
1946
1948
  },
1947
1949
  launcher: {
package/lib/locales/en.js CHANGED
@@ -1957,7 +1957,9 @@ export default {
1957
1957
  followers: 'Followers',
1958
1958
  following: 'Following',
1959
1959
  emptyFollowing: 'No users you are following yet.',
1960
- emptyFollowers: 'No followers yet.'
1960
+ emptyFollowers: 'No followers yet.',
1961
+ emptyInvitees: 'You have not invited anyone yet.',
1962
+ invitees: 'Invitees'
1961
1963
  }
1962
1964
  },
1963
1965
  launcher: {
package/lib/locales/es.js CHANGED
@@ -1941,7 +1941,9 @@ export default {
1941
1941
  following: 'Siguiendo',
1942
1942
  emptyFollowing: 'Aún no sigues a ningún usuario.',
1943
1943
  emptyFollowers: 'Aún no hay seguidores.',
1944
- title: 'Seguidos y Seguidores'
1944
+ title: 'Seguidos y Seguidores',
1945
+ invitees: 'Invitados',
1946
+ emptyInvitees: 'Aún no has invitado a nadie.'
1945
1947
  }
1946
1948
  },
1947
1949
  launcher: {
package/lib/locales/fr.js CHANGED
@@ -1941,7 +1941,9 @@ export default {
1941
1941
  following: 'Suivant',
1942
1942
  emptyFollowing: 'Vous ne suivez encore aucun utilisateur.',
1943
1943
  emptyFollowers: 'Pas encore de followers',
1944
- title: 'Abonnements & Abonnés'
1944
+ title: 'Abonnements & Abonnés',
1945
+ invitees: 'Invités',
1946
+ emptyInvitees: "Vous n'avez invité personne pour le moment."
1945
1947
  }
1946
1948
  },
1947
1949
  launcher: {
package/lib/locales/hi.js CHANGED
@@ -1941,7 +1941,9 @@ export default {
1941
1941
  following: 'निम्नलिखित',
1942
1942
  emptyFollowing: 'आप अभी तक किसी भी उपयोगकर्ता का अनुसरण नहीं कर रहे हैं।',
1943
1943
  emptyFollowers: 'अभी कोई फॉलोअर्स नहीं',
1944
- title: 'अनुसरण और अनुयायी'
1944
+ title: 'अनुसरण और अनुयायी',
1945
+ invitees: 'आ आमंत्रित',
1946
+ emptyInvitees: 'आपने अभी तक किसी को आमंत्रित नहीं किया है।'
1945
1947
  }
1946
1948
  },
1947
1949
  launcher: {
Binary file
package/lib/locales/id.js CHANGED
@@ -1941,7 +1941,9 @@ export default {
1941
1941
  following: 'Berikut',
1942
1942
  emptyFollowing: 'Belum ada pengguna yang Anda ikuti.',
1943
1943
  emptyFollowers: 'Belum ada pengikut.',
1944
- title: 'Mengikuti & Pengikut'
1944
+ title: 'Mengikuti & Pengikut',
1945
+ invitees: 'Undangan',
1946
+ emptyInvitees: 'Anda belum mengundang siapa pun.'
1945
1947
  }
1946
1948
  },
1947
1949
  launcher: {
package/lib/locales/ja.js CHANGED
@@ -1941,7 +1941,9 @@ export default {
1941
1941
  following: 'フォロー中',
1942
1942
  emptyFollowing: 'まだフォローしているユーザーはいません。',
1943
1943
  emptyFollowers: 'まだフォロワーがいません。',
1944
- title: 'フォロー中 & フォロワー'
1944
+ title: 'フォロー中 & フォロワー',
1945
+ invitees: '招待客',
1946
+ emptyInvitees: 'まだ誰も招待していません。'
1945
1947
  }
1946
1948
  },
1947
1949
  launcher: {
package/lib/locales/ko.js CHANGED
@@ -1941,7 +1941,9 @@ export default {
1941
1941
  following: '팔로잉',
1942
1942
  emptyFollowing: '아직 팔로우하는 사용자가 없습니다.',
1943
1943
  emptyFollowers: '아직 팔로워가 없습니다.',
1944
- title: '팔로잉 & 팔로워'
1944
+ title: '팔로잉 & 팔로워',
1945
+ invitees: '초대 대상',
1946
+ emptyInvitees: '아직 아무도 초대하지 않았습니다.'
1945
1947
  }
1946
1948
  },
1947
1949
  launcher: {
package/lib/locales/pt.js CHANGED
@@ -1941,7 +1941,9 @@ export default {
1941
1941
  following: 'Seguindo',
1942
1942
  emptyFollowing: 'Ainda não está seguindo nenhum usuário.',
1943
1943
  emptyFollowers: 'Ainda não há seguidores.',
1944
- title: 'Seguindo e Seguidores'
1944
+ title: 'Seguindo e Seguidores',
1945
+ invitees: 'Convidados',
1946
+ emptyInvitees: 'Você ainda não convidou ninguém.'
1945
1947
  }
1946
1948
  },
1947
1949
  launcher: {
package/lib/locales/ru.js CHANGED
@@ -1941,7 +1941,9 @@ export default {
1941
1941
  following: 'Следующее',
1942
1942
  emptyFollowing: 'Вы пока не подписаны ни на одного пользователя.',
1943
1943
  emptyFollowers: 'Пока нет подписчиков',
1944
- title: 'Подписки и подписчики'
1944
+ title: 'Подписки и подписчики',
1945
+ invitees: 'Приглашенные',
1946
+ emptyInvitees: 'Вы ещё никого не пригласили.'
1945
1947
  }
1946
1948
  },
1947
1949
  launcher: {
package/lib/locales/th.js CHANGED
@@ -1941,7 +1941,9 @@ export default {
1941
1941
  following: 'กำลังติดตาม',
1942
1942
  emptyFollowing: 'ยังไม่มีผู้ใช้ที่คุณกำลังติดตาม',
1943
1943
  emptyFollowers: 'ยังไม่มีผู้ติดตาม',
1944
- title: 'กำลังติดตาม & ผู้ติดตาม'
1944
+ title: 'กำลังติดตาม & ผู้ติดตาม',
1945
+ invitees: 'ผู้ได้รับเชิญ',
1946
+ emptyInvitees: 'คุณยังไม่ได้เชิญใครเลย'
1945
1947
  }
1946
1948
  },
1947
1949
  launcher: {
package/lib/locales/vi.js CHANGED
@@ -1941,7 +1941,9 @@ export default {
1941
1941
  following: 'Tiếp theo',
1942
1942
  emptyFollowing: 'Bạn chưa theo dõi người dùng nào.',
1943
1943
  emptyFollowers: 'Chưa có người theo dõi.',
1944
- title: 'Đang theo dõi & Người theo dõi'
1944
+ title: 'Đang theo dõi & Người theo dõi',
1945
+ invitees: 'Người được mời',
1946
+ emptyInvitees: 'Bạn chưa mời ai cả.'
1945
1947
  }
1946
1948
  },
1947
1949
  launcher: {
@@ -1941,7 +1941,9 @@ export default {
1941
1941
  following: '正在關注',
1942
1942
  followersOnly: '僅對追蹤者可見',
1943
1943
  emptyFollowing: '還沒有關注任何人',
1944
- emptyFollowers: '還沒有粉絲'
1944
+ emptyFollowers: '還沒有粉絲',
1945
+ invitees: '受邀者',
1946
+ emptyInvitees: '你還沒有邀請任何人。'
1945
1947
  }
1946
1948
  },
1947
1949
  launcher: {
package/lib/locales/zh.js CHANGED
@@ -1957,7 +1957,9 @@ export default {
1957
1957
  followers: '粉丝',
1958
1958
  following: '正在关注',
1959
1959
  emptyFollowing: '还没有关注任何人',
1960
- emptyFollowers: '还没有粉丝'
1960
+ emptyFollowers: '还没有粉丝',
1961
+ emptyInvitees: '您还没有邀请任何人',
1962
+ invitees: '受邀者'
1961
1963
  }
1962
1964
  },
1963
1965
  launcher: {
@@ -256,12 +256,12 @@ export default function MemberList({
256
256
  return true;
257
257
  }
258
258
  const role = session?.user?.role;
259
- const passports = (session?.user?.passports || []).filter(x => x.status === 'valid');
259
+ const passports = session?.user?.passports || [];
260
260
  const roleMatchedPassports = passports.filter(x => x.role === role);
261
261
  if (roleMatchedPassports.length === 0) {
262
262
  return true;
263
263
  }
264
- return roleMatchedPassports.some(x => !x.expirationDate);
264
+ return roleMatchedPassports.every(x => x.expirationDate);
265
265
  }, [session?.user, inService]);
266
266
  const getAccessibleUrl = useCallback(async () => {
267
267
  if (teamDid === nodeInfo.did) {
@@ -1,4 +1,4 @@
1
- import { useState, useRef, useEffect } from 'react';
1
+ import { useState, useRef, useEffect, useMemo } from 'react';
2
2
  import { Box, Button, styled, alpha, Skeleton } from '@mui/material';
3
3
  import { useInfiniteScroll, useInViewport, useRequest, useMemoizedFn } from 'ahooks';
4
4
  import PropTypes from 'prop-types';
@@ -72,7 +72,14 @@ function EmptyState({
72
72
  const {
73
73
  t
74
74
  } = useLocaleContext();
75
- const message = currentTab === 'following' ? t('team.userFollowers.emptyFollowing') : t('team.userFollowers.emptyFollowers');
75
+ const message = useMemo(() => {
76
+ const map = {
77
+ following: t('team.userFollowers.emptyFollowing'),
78
+ followers: t('team.userFollowers.emptyFollowers'),
79
+ invitees: t('team.userFollowers.emptyInvitees')
80
+ };
81
+ return map[currentTab];
82
+ }, [currentTab, t]);
76
83
  return /*#__PURE__*/_jsx(Empty, {
77
84
  children: message
78
85
  });
@@ -85,7 +92,6 @@ function UserList({
85
92
  teamDid,
86
93
  currentTab,
87
94
  column = 2,
88
- onToggleFollow = undefined,
89
95
  refresh = () => {},
90
96
  followed = false,
91
97
  showSocialActions = true
@@ -105,6 +111,11 @@ function UserList({
105
111
  const isMobile = useMobile({
106
112
  key: 'md'
107
113
  });
114
+ const requestFn = {
115
+ following: api.getUserFollowing,
116
+ followers: api.getUserFollowers,
117
+ invitees: api.getUserInvites
118
+ };
108
119
  const {
109
120
  data,
110
121
  loading,
@@ -117,7 +128,11 @@ function UserList({
117
128
  total: 0
118
129
  };
119
130
  const page = d ? Math.ceil(d.list.length / PAGE_SIZE) + 1 : 1;
120
- const fn = currentTab === 'following' ? api.getUserFollowing : api.getUserFollowers;
131
+ const fn = requestFn[currentTab];
132
+ if (!fn) return {
133
+ list: [],
134
+ total: 0
135
+ };
121
136
  const response = await fn({
122
137
  input: {
123
138
  teamDid,
@@ -129,8 +144,9 @@ function UserList({
129
144
  }
130
145
  }
131
146
  });
147
+ const list = currentTab === 'invitees' ? response?.users : response?.data;
132
148
  return {
133
- list: response?.data || [],
149
+ list: list || [],
134
150
  total: response?.paging?.total || 0
135
151
  };
136
152
  }, {
@@ -140,13 +156,11 @@ function UserList({
140
156
  return d.list.length >= d?.total;
141
157
  }
142
158
  });
143
-
144
- // eslint-disable-next-line no-unused-vars
145
- const handleFollow = async item => {
146
- if (!item?.user?.did || !onToggleFollow || typeof onToggleFollow !== 'function') return;
159
+ const onFollowCallback = () => {
147
160
  try {
148
- await onToggleFollow(item.user.did, item.isFollowing);
149
- reload();
161
+ if (currentTab !== 'invitees') {
162
+ reload();
163
+ }
150
164
  refresh();
151
165
  } catch (error) {
152
166
  console.error(error);
@@ -205,17 +219,23 @@ function UserList({
205
219
  gap: 2
206
220
  },
207
221
  children: users.map(item => {
208
- const did = currentTab === 'following' ? item.userDid : item.followerDid;
222
+ const _user = currentTab === 'invitees' ? item : item.user;
223
+ if (!_user) return null;
224
+ let did = currentTab === 'following' ? item.userDid : item.followerDid;
225
+ if (currentTab === 'invitees') {
226
+ did = _user.did;
227
+ }
209
228
  return /*#__PURE__*/_jsx(Box, {
210
229
  className: "user-item",
211
230
  children: /*#__PURE__*/_jsx(UserCard, {
212
- user: item.user,
231
+ user: _user,
213
232
  showDid: true,
214
233
  cardType: CardType.CARD,
215
234
  infoType: InfoType.INFO,
216
235
  session: session,
217
236
  showSocialActions: showSocialActions,
218
- onAvatarClick: handleAvatarClick
237
+ onAvatarClick: handleAvatarClick,
238
+ onFollowClick: onFollowCallback
219
239
  })
220
240
  }, did);
221
241
  })
@@ -238,7 +258,6 @@ function UserList({
238
258
  UserList.propTypes = {
239
259
  ...commonProps,
240
260
  ...userProps,
241
- onToggleFollow: PropTypes.func,
242
261
  followed: PropTypes.bool
243
262
  };
244
263
  function Tabs({
@@ -257,6 +276,10 @@ function Tabs({
257
276
  label: t('team.userFollowers.followers'),
258
277
  value: 'followers',
259
278
  count: data?.followers || 0
279
+ }, {
280
+ label: t('team.userFollowers.invitees'),
281
+ value: 'invitees',
282
+ count: data?.invitees || 0
260
283
  }];
261
284
  return /*#__PURE__*/_jsx(Box, {
262
285
  children: tabs.map(tab => /*#__PURE__*/_jsxs(ButtonTab, {
@@ -281,7 +304,6 @@ export default function UserFollowers({
281
304
  user,
282
305
  teamDid,
283
306
  column = 2,
284
- onToggleFollow = undefined,
285
307
  followed = false,
286
308
  showSocialActions = true
287
309
  }) {
@@ -305,7 +327,8 @@ export default function UserFollowers({
305
327
  });
306
328
  return response?.data?.[user.did] || {
307
329
  following: 0,
308
- followers: 0
330
+ followers: 0,
331
+ invitees: 0
309
332
  };
310
333
  }, {
311
334
  refreshDeps: [user?.did, followed] // 当 followed 发生变化时,需要更新数据
@@ -322,7 +345,6 @@ export default function UserFollowers({
322
345
  }), /*#__PURE__*/_jsx(UserList, {
323
346
  column: column,
324
347
  user: user,
325
- onToggleFollow: onToggleFollow,
326
348
  currentTab: currentTab,
327
349
  teamDid: teamDid,
328
350
  followed: followed,
@@ -334,8 +356,7 @@ export default function UserFollowers({
334
356
  UserFollowers.propTypes = {
335
357
  ...userProps,
336
358
  teamDid: PropTypes.string.isRequired,
337
- followed: PropTypes.bool,
338
- onToggleFollow: PropTypes.func
359
+ followed: PropTypes.bool
339
360
  };
340
361
  const ButtonTab = styled(Button)`
341
362
  &.MuiButtonBase-root {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abtnode/ux",
3
- "version": "1.16.51",
3
+ "version": "1.16.52-beta-20250909-073849-4e392ab1",
4
4
  "description": "UX components shared across abtnode packages",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -25,33 +25,33 @@
25
25
  "author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
26
26
  "license": "Apache-2.0",
27
27
  "dependencies": {
28
- "@abtnode/auth": "1.16.51",
29
- "@abtnode/constant": "1.16.51",
30
- "@abtnode/docker-utils": "1.16.51",
31
- "@abtnode/util": "1.16.51",
28
+ "@abtnode/auth": "1.16.52-beta-20250909-073849-4e392ab1",
29
+ "@abtnode/constant": "1.16.52-beta-20250909-073849-4e392ab1",
30
+ "@abtnode/docker-utils": "1.16.52-beta-20250909-073849-4e392ab1",
31
+ "@abtnode/util": "1.16.52-beta-20250909-073849-4e392ab1",
32
32
  "@ahooksjs/use-url-state": "^3.5.1",
33
33
  "@arcblock/did": "1.24.0",
34
- "@arcblock/did-connect-react": "^3.1.34",
34
+ "@arcblock/did-connect-react": "^3.1.37",
35
35
  "@arcblock/did-ext": "^1.24.8",
36
36
  "@arcblock/did-motif": "^1.1.14",
37
- "@arcblock/icons": "^3.1.34",
38
- "@arcblock/nft-display": "^3.1.34",
39
- "@arcblock/react-hooks": "^3.1.34",
40
- "@arcblock/terminal": "^3.1.34",
41
- "@arcblock/ux": "^3.1.34",
37
+ "@arcblock/icons": "^3.1.37",
38
+ "@arcblock/nft-display": "^3.1.37",
39
+ "@arcblock/react-hooks": "^3.1.37",
40
+ "@arcblock/terminal": "^3.1.37",
41
+ "@arcblock/ux": "^3.1.37",
42
42
  "@arcblock/validator": "1.24.0",
43
43
  "@blocklet/aigne-hub": "^0.3.29",
44
- "@blocklet/constant": "1.16.51",
45
- "@blocklet/did-domain-react": "^0.5.34",
46
- "@blocklet/did-space-react": "^1.1.22",
44
+ "@blocklet/constant": "1.16.52-beta-20250909-073849-4e392ab1",
45
+ "@blocklet/did-domain-react": "^0.5.38",
46
+ "@blocklet/did-space-react": "^1.1.23",
47
47
  "@blocklet/error": "^0.2.5",
48
- "@blocklet/js-sdk": "1.16.51",
49
- "@blocklet/launcher-layout": "^3.1.34",
50
- "@blocklet/list": "^0.17.21",
51
- "@blocklet/meta": "1.16.51",
52
- "@blocklet/theme": "^3.1.34",
53
- "@blocklet/ui-react": "^3.1.34",
54
- "@blocklet/uploader": "^0.2.9",
48
+ "@blocklet/js-sdk": "1.16.52-beta-20250909-073849-4e392ab1",
49
+ "@blocklet/launcher-layout": "^3.1.37",
50
+ "@blocklet/list": "^0.17.23",
51
+ "@blocklet/meta": "1.16.52-beta-20250909-073849-4e392ab1",
52
+ "@blocklet/theme": "^3.1.37",
53
+ "@blocklet/ui-react": "^3.1.37",
54
+ "@blocklet/uploader": "^0.2.10",
55
55
  "@emotion/react": "^11.14.0",
56
56
  "@emotion/styled": "^11.14.1",
57
57
  "@iconify-icons/material-symbols": "^1.2.58",
@@ -128,5 +128,5 @@
128
128
  "jest": "^29.7.0",
129
129
  "jest-environment-jsdom": "^29.7.0"
130
130
  },
131
- "gitHead": "32897dd6a5e92368f1870bba34cbbb38da95da89"
131
+ "gitHead": "3b4b1551b181606f84799ba8b294fb36b483c9c3"
132
132
  }