@blocklet/ui-react 2.10.1 → 2.10.3
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/BlockletStudio/index.d.ts +0 -1
- package/lib/ComponentManager/components/resource-dialog.d.ts +6 -7
- package/lib/UserCenter/components/config-profile.d.ts +0 -1
- package/lib/UserCenter/components/notification.d.ts +0 -1
- package/lib/UserCenter/components/notification.js +1 -1
- package/lib/UserCenter/components/passport.d.ts +0 -1
- package/lib/UserCenter/components/privacy.d.ts +0 -1
- package/lib/UserCenter/components/storage/connect-to.d.ts +0 -1
- package/lib/UserCenter/components/storage/connected.d.ts +0 -1
- package/lib/UserCenter/components/storage/delete.d.ts +0 -1
- package/lib/UserCenter/components/storage/disconnect.d.ts +0 -1
- package/lib/UserCenter/components/storage/index.d.ts +0 -1
- package/lib/UserCenter/components/storage/item.d.ts +0 -1
- package/lib/UserCenter/components/storage/preview-nft.d.ts +0 -1
- package/lib/UserCenter/components/third-party-login/index.d.ts +0 -1
- package/lib/UserCenter/components/third-party-login/third-party-item.d.ts +0 -1
- package/lib/UserCenter/components/user-center.d.ts +0 -1
- package/lib/UserCenter/components/user-center.js +8 -1
- package/lib/UserCenter/components/user-info/user-basic-info.d.ts +0 -1
- package/lib/UserCenter/components/user-info/user-info-item.d.ts +0 -1
- package/lib/UserCenter/components/user-info/user-info.d.ts +0 -1
- package/lib/UserCenter/components/webhook-item.d.ts +0 -1
- package/lib/UserCenter/libs/utils.d.ts +1 -1
- package/lib/UserSessions/components/user-session-info.d.ts +0 -1
- package/lib/UserSessions/components/user-sessions.d.ts +0 -1
- package/lib/UserSessions/components/user-sessions.js +7 -4
- package/lib/contexts/config-user-space.d.ts +0 -1
- package/package.json +4 -4
- package/src/UserCenter/components/notification.tsx +1 -1
- package/src/UserCenter/components/user-center.tsx +8 -1
- package/src/UserSessions/components/user-sessions.tsx +9 -6
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
declare const _default: import("react").ForwardRefExoticComponent<{
|
|
3
2
|
src: string;
|
|
4
3
|
componentDid: string;
|
|
5
|
-
open?: boolean
|
|
6
|
-
loading?: boolean
|
|
7
|
-
storeUrl?: string
|
|
8
|
-
onLoad?: (
|
|
9
|
-
onClose?: (
|
|
10
|
-
onComplete?: (
|
|
4
|
+
open?: boolean;
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
storeUrl?: string;
|
|
7
|
+
onLoad?: () => void;
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
onComplete?: () => void;
|
|
11
10
|
} & import("react").RefAttributes<{
|
|
12
11
|
selectBlocklet: (blockletMeta: any) => void;
|
|
13
12
|
}>>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { BoxProps } from '@mui/material';
|
|
3
2
|
export default function UserCenter({ children, notLoginContent, currentTab, contentProps, disableAutoRedirect, autoPopupSetting, hideFooter, headerProps, footerProps, userDid, stickySidebar, }: {
|
|
4
3
|
readonly children: any;
|
|
@@ -370,7 +370,14 @@ export default function UserCenter({
|
|
|
370
370
|
] });
|
|
371
371
|
}, [userState, userCenterTabs, isMyself, currentActiveTab, privacyState, currentTab, stickySidebar]);
|
|
372
372
|
if (!disableAutoRedirect && !currentTab && formattedBlocklet?.navigation?.userCenter?.length > 0) {
|
|
373
|
-
|
|
373
|
+
const firstUserCenterUrl = formattedBlocklet?.navigation?.userCenter[0]?.link;
|
|
374
|
+
if (firstUserCenterUrl) {
|
|
375
|
+
window.location.replace(
|
|
376
|
+
withQuery(firstUserCenterUrl, {
|
|
377
|
+
did: isMyself ? void 0 : currentDid
|
|
378
|
+
})
|
|
379
|
+
);
|
|
380
|
+
}
|
|
374
381
|
return null;
|
|
375
382
|
}
|
|
376
383
|
return /* @__PURE__ */ jsxs(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { AxiosError } from 'axios';
|
|
2
2
|
import { CreatePassportProps } from '../../@types';
|
|
3
3
|
export declare const formatAxiosError: (err: AxiosError) => string;
|
|
4
|
-
export declare const createPassportSvg: (props: CreatePassportProps) =>
|
|
4
|
+
export declare const createPassportSvg: (props: CreatePassportProps) => string;
|
|
@@ -65,10 +65,13 @@ export default function UserSessions({
|
|
|
65
65
|
return pageState.data || [];
|
|
66
66
|
}, [pageState.data]);
|
|
67
67
|
const ipRegionMap = useCreation(() => {
|
|
68
|
-
return safeData.reduce(
|
|
69
|
-
acc
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
return safeData.reduce(
|
|
69
|
+
(acc, x) => {
|
|
70
|
+
acc[x.lastLoginIp] = x.ipRegion;
|
|
71
|
+
return acc;
|
|
72
|
+
},
|
|
73
|
+
{}
|
|
74
|
+
);
|
|
72
75
|
}, [safeData]);
|
|
73
76
|
const logout = useMemoizedFn(({ visitorId }) => {
|
|
74
77
|
confirmApi.open({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/ui-react",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.3",
|
|
4
4
|
"description": "Some useful front-end web components that can be used in Blocklets.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"url": "https://github.com/ArcBlock/ux/issues"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@arcblock/bridge": "^2.10.
|
|
36
|
-
"@arcblock/react-hooks": "^2.10.
|
|
35
|
+
"@arcblock/bridge": "^2.10.3",
|
|
36
|
+
"@arcblock/react-hooks": "^2.10.3",
|
|
37
37
|
"@iconify-icons/logos": "^1.2.36",
|
|
38
38
|
"@iconify-icons/material-symbols": "^1.2.58",
|
|
39
39
|
"@iconify/react": "^4.1.1",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"jest": "^28.1.3",
|
|
79
79
|
"unbuild": "^2.0.0"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "bd12e5b7417376a7a2be74354a070f04a997efac"
|
|
82
82
|
}
|
|
@@ -78,7 +78,7 @@ export default function Notification({ user }: { user: User }) {
|
|
|
78
78
|
wallet: true,
|
|
79
79
|
email: true,
|
|
80
80
|
phone: false,
|
|
81
|
-
push:
|
|
81
|
+
push: true,
|
|
82
82
|
...(notificationConfigState?.data?.notifications || {}),
|
|
83
83
|
};
|
|
84
84
|
}, [notificationConfigState?.data?.notifications]);
|
|
@@ -402,7 +402,14 @@ export default function UserCenter({
|
|
|
402
402
|
}, [userState, userCenterTabs, isMyself, currentActiveTab, privacyState, currentTab, stickySidebar]);
|
|
403
403
|
|
|
404
404
|
if (!disableAutoRedirect && !currentTab && formattedBlocklet?.navigation?.userCenter?.length > 0) {
|
|
405
|
-
|
|
405
|
+
const firstUserCenterUrl = formattedBlocklet?.navigation?.userCenter[0]?.link;
|
|
406
|
+
if (firstUserCenterUrl) {
|
|
407
|
+
window.location.replace(
|
|
408
|
+
withQuery(firstUserCenterUrl, {
|
|
409
|
+
did: isMyself ? undefined : currentDid,
|
|
410
|
+
})
|
|
411
|
+
);
|
|
412
|
+
}
|
|
406
413
|
return null;
|
|
407
414
|
}
|
|
408
415
|
|
|
@@ -82,10 +82,13 @@ export default function UserSessions({
|
|
|
82
82
|
}, [pageState.data]);
|
|
83
83
|
|
|
84
84
|
const ipRegionMap = useCreation(() => {
|
|
85
|
-
return safeData.reduce(
|
|
86
|
-
acc
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
return safeData.reduce(
|
|
86
|
+
(acc, x) => {
|
|
87
|
+
acc[x.lastLoginIp] = x.ipRegion;
|
|
88
|
+
return acc;
|
|
89
|
+
},
|
|
90
|
+
{} as { [key: string]: string | undefined }
|
|
91
|
+
);
|
|
89
92
|
}, [safeData]);
|
|
90
93
|
|
|
91
94
|
const logout = useMemoizedFn(({ visitorId }) => {
|
|
@@ -273,8 +276,8 @@ export default function UserSessions({
|
|
|
273
276
|
{x.status === 'expired'
|
|
274
277
|
? t('remove')
|
|
275
278
|
: currentVisitorId === x.visitorId
|
|
276
|
-
|
|
277
|
-
|
|
279
|
+
? t('currentSession')
|
|
280
|
+
: t('logout')}
|
|
278
281
|
</Button>
|
|
279
282
|
</Box>
|
|
280
283
|
);
|