@blocklet/ui-react 3.0.6 → 3.0.8
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/@types/index.d.ts +204 -3
- package/lib/BlockletStudio/index.d.ts +27 -26
- package/lib/BlockletStudio/index.js +66 -66
- package/lib/ComponentInstaller/index.d.ts +15 -15
- package/lib/ComponentInstaller/installer-item.d.ts +10 -10
- package/lib/ComponentInstaller/locales.d.ts +2 -2
- package/lib/ComponentInstaller/use-component-installed.d.ts +2 -2
- package/lib/ComponentManager/components/add-component.d.ts +16 -13
- package/lib/ComponentManager/components/add-component.js +29 -29
- package/lib/ComponentManager/components/check-component.d.ts +2 -2
- package/lib/ComponentManager/components/publish-component.d.ts +10 -7
- package/lib/ComponentManager/components/publish-component.js +19 -19
- package/lib/ComponentManager/components/resource-dialog.d.ts +13 -11
- package/lib/ComponentManager/components/resource-dialog.js +1 -1
- package/lib/ComponentManager/index.d.ts +3 -4
- package/lib/ComponentManager/libs/locales.d.ts +14 -19
- package/lib/Dashboard/index.d.ts +16 -13
- package/lib/Footer/brand.d.ts +8 -8
- package/lib/Footer/copyright.d.ts +7 -7
- package/lib/Footer/index.d.ts +2 -2
- package/lib/Footer/internal-footer.d.ts +26 -21
- package/lib/Footer/internal-footer.js +1 -1
- package/lib/Footer/layout/plain.d.ts +15 -12
- package/lib/Footer/layout/row.d.ts +7 -7
- package/lib/Footer/layout/standard.d.ts +17 -14
- package/lib/Footer/layout/standard.js +1 -1
- package/lib/Footer/links.d.ts +15 -12
- package/lib/Footer/links.js +3 -3
- package/lib/Footer/social-media.d.ts +8 -8
- package/lib/Header/index.d.ts +23 -13
- package/lib/Header/index.js +17 -17
- package/lib/Icon/index.d.ts +9 -7
- package/lib/Icon/index.js +6 -6
- package/lib/Notifications/Snackbar.d.ts +16 -8
- package/lib/Notifications/Snackbar.js +1 -1
- package/lib/Notifications/hooks/use-title.d.ts +48 -9
- package/lib/Notifications/hooks/use-title.js +9 -9
- package/lib/Notifications/hooks/use-width.d.ts +2 -2
- package/lib/Notifications/utils.d.ts +69 -9
- package/lib/UserCenter/components/config-inviter.d.ts +4 -4
- package/lib/UserCenter/components/config-profile.d.ts +5 -5
- package/lib/UserCenter/components/danger-zone.d.ts +1 -2
- package/lib/UserCenter/components/editable-field.d.ts +34 -30
- package/lib/UserCenter/components/editable-field.js +12 -12
- package/lib/UserCenter/components/nft.d.ts +4 -4
- package/lib/UserCenter/components/notification.d.ts +5 -5
- package/lib/UserCenter/components/notification.js +5 -5
- package/lib/UserCenter/components/passport.d.ts +5 -5
- package/lib/UserCenter/components/privacy.d.ts +11 -5
- package/lib/UserCenter/components/settings.d.ts +10 -8
- package/lib/UserCenter/components/status-dialog/date-picker.d.ts +10 -9
- package/lib/UserCenter/components/status-dialog/date-picker.js +17 -10
- package/lib/UserCenter/components/status-dialog/index.d.ts +12 -9
- package/lib/UserCenter/components/status-dialog/index.js +8 -1
- package/lib/UserCenter/components/status-selector/duration-menu.d.ts +7 -7
- package/lib/UserCenter/components/status-selector/index.d.ts +9 -8
- package/lib/UserCenter/components/status-selector/index.js +5 -5
- package/lib/UserCenter/components/status-selector/menu-item.d.ts +24 -9
- package/lib/UserCenter/components/status-selector/menu-item.js +11 -6
- package/lib/UserCenter/components/storage/action.d.ts +9 -7
- package/lib/UserCenter/components/storage/connected.d.ts +5 -4
- package/lib/UserCenter/components/storage/delete.d.ts +6 -5
- package/lib/UserCenter/components/storage/disconnect.d.ts +2 -2
- package/lib/UserCenter/components/storage/index.d.ts +2 -2
- package/lib/UserCenter/components/storage/preview-nft.d.ts +5 -5
- package/lib/UserCenter/components/third-party-login/index.d.ts +4 -4
- package/lib/UserCenter/components/third-party-login/index.js +23 -29
- package/lib/UserCenter/components/third-party-login/third-party-item.d.ts +13 -4
- package/lib/UserCenter/components/user-center.d.ts +16 -15
- package/lib/UserCenter/components/user-info/address.d.ts +16 -7
- package/lib/UserCenter/components/user-info/index.d.ts +4 -5
- package/lib/UserCenter/components/user-info/link-preview-input.d.ts +5 -6
- package/lib/UserCenter/components/user-info/metadata.d.ts +10 -7
- package/lib/UserCenter/components/user-info/switch-role.d.ts +7 -6
- package/lib/UserCenter/components/user-info/timezone-select.d.ts +8 -7
- package/lib/UserCenter/components/user-info/user-basic-info.d.ts +13 -12
- package/lib/UserCenter/components/user-info/user-info-item.d.ts +11 -6
- package/lib/UserCenter/components/user-info/user-info-item.js +1 -1
- package/lib/UserCenter/components/user-info/user-info.d.ts +6 -6
- package/lib/UserCenter/components/user-info/user-status.d.ts +9 -9
- package/lib/UserCenter/components/user-info/user-status.js +17 -17
- package/lib/UserCenter/components/user-info/utils.d.ts +33 -15
- package/lib/UserCenter/components/webhook-item.d.ts +2 -10
- package/lib/UserCenter/index.d.ts +1 -2
- package/lib/UserCenter/libs/locales.d.ts +345 -513
- package/lib/UserCenter/libs/utils.d.ts +4 -3
- package/lib/UserSessions/components/user-session-info.d.ts +5 -5
- package/lib/UserSessions/components/user-sessions.d.ts +20 -8
- package/lib/UserSessions/index.d.ts +1 -2
- package/lib/UserSessions/libs/locales.d.ts +60 -88
- package/lib/UserSessions/libs/utils.d.ts +2 -3
- package/lib/blocklets.d.ts +9 -10
- package/lib/common/domain-warning.d.ts +7 -7
- package/lib/common/header-addons.d.ts +9 -9
- package/lib/common/link-blocker.d.ts +6 -3
- package/lib/common/notification-addon.d.ts +6 -6
- package/lib/common/overridable-theme-provider.d.ts +10 -7
- package/lib/common/wallet-hidden-topbar.d.ts +1 -2
- package/lib/common/ws.d.ts +3 -4
- package/lib/contexts/config-user-space.d.ts +27 -7
- package/lib/hooks/use-mobile.d.ts +3 -3
- package/lib/index.d.ts +10 -12
- package/lib/libs/client.d.ts +2 -3
- package/lib/libs/constant.d.ts +1 -2
- package/lib/libs/spaces.d.ts +2 -3
- package/lib/libs/with-hide-when-embed.d.ts +2 -3
- package/lib/types.d.ts +31 -32
- package/lib/utils.d.ts +10 -11
- package/package.json +8 -6
- package/src/BlockletStudio/index.tsx +13 -13
- package/src/ComponentManager/components/add-component.tsx +6 -6
- package/src/ComponentManager/components/publish-component.tsx +2 -2
- package/src/ComponentManager/components/resource-dialog.tsx +1 -1
- package/src/Footer/internal-footer.jsx +1 -1
- package/src/Footer/layout/standard.jsx +1 -1
- package/src/Footer/links.jsx +1 -1
- package/src/Header/index.tsx +2 -2
- package/src/Icon/index.tsx +2 -2
- package/src/Notifications/Snackbar.tsx +2 -2
- package/src/Notifications/hooks/use-title.tsx +1 -1
- package/src/UserCenter/components/editable-field.tsx +6 -6
- package/src/UserCenter/components/notification.tsx +2 -2
- package/src/UserCenter/components/status-dialog/date-picker.tsx +8 -1
- package/src/UserCenter/components/status-dialog/index.tsx +8 -1
- package/src/UserCenter/components/status-selector/index.tsx +1 -1
- package/src/UserCenter/components/status-selector/menu-item.tsx +6 -1
- package/src/UserCenter/components/third-party-login/index.tsx +0 -2
- package/src/UserCenter/components/user-center.tsx +1 -1
- package/src/UserCenter/components/user-info/link-preview-input.tsx +2 -2
- package/src/UserCenter/components/user-info/user-info-item.tsx +1 -1
- package/src/UserCenter/components/user-info/user-info.tsx +1 -1
- package/src/UserCenter/components/user-info/user-status.tsx +2 -2
- package/lib/UserCenter/components/storage/icons/empty-spaces-nft.svg.d.ts +0 -3
package/lib/Header/index.js
CHANGED
|
@@ -30,7 +30,7 @@ const X = {
|
|
|
30
30
|
return { navItems: [], activeId: null };
|
|
31
31
|
let t = 1;
|
|
32
32
|
const m = U(e, (o) => {
|
|
33
|
-
var
|
|
33
|
+
var d, f;
|
|
34
34
|
const n = o.icon ? /* @__PURE__ */ l(S, { icon: o.icon }) : null;
|
|
35
35
|
if (o.items)
|
|
36
36
|
return {
|
|
@@ -39,49 +39,49 @@ const X = {
|
|
|
39
39
|
icon: n,
|
|
40
40
|
children: o.items
|
|
41
41
|
};
|
|
42
|
-
let
|
|
43
|
-
return ((
|
|
42
|
+
let a = {};
|
|
43
|
+
return ((d = o.link) != null && d.startsWith("http") || (f = o.link) != null && f.startsWith("//")) && (a = {
|
|
44
44
|
target: "_blank",
|
|
45
45
|
rel: "noreferrer"
|
|
46
46
|
}), {
|
|
47
47
|
id: `${t++}`,
|
|
48
|
-
label: /* @__PURE__ */ l("a", { href: o.link, ...
|
|
48
|
+
label: /* @__PURE__ */ l("a", { href: o.link, ...a, children: o.title }),
|
|
49
49
|
icon: n,
|
|
50
50
|
description: o.description,
|
|
51
51
|
link: o.link
|
|
52
52
|
};
|
|
53
|
-
}, "items"),
|
|
54
|
-
return { navItems: m, activeId: p >= 0 ?
|
|
53
|
+
}, "items"), i = K(m), p = O(i.map((o) => o.link));
|
|
54
|
+
return { navItems: m, activeId: p >= 0 ? i[p].id : null };
|
|
55
55
|
};
|
|
56
56
|
function Z({
|
|
57
57
|
meta: e = {},
|
|
58
|
-
addons: t,
|
|
58
|
+
addons: t = void 0,
|
|
59
59
|
sessionManagerProps: b = {
|
|
60
60
|
showRole: !0
|
|
61
61
|
},
|
|
62
62
|
homeLink: m = G,
|
|
63
|
-
theme:
|
|
63
|
+
theme: i = void 0,
|
|
64
64
|
hideNavMenu: p = !1,
|
|
65
65
|
showDomainWarningDialog: o = !0,
|
|
66
66
|
...n
|
|
67
67
|
}) {
|
|
68
68
|
var v, x;
|
|
69
69
|
Q();
|
|
70
|
-
const
|
|
70
|
+
const a = _(), { locale: d } = z() || {}, f = H((r, h = {}) => A(X, r, d, "en", h)), c = w(() => {
|
|
71
71
|
const r = Object.assign({}, window.blocklet, e);
|
|
72
72
|
try {
|
|
73
73
|
return q(r);
|
|
74
74
|
} catch (h) {
|
|
75
75
|
return console.error("Failed to format blocklet info", h, r), r;
|
|
76
76
|
}
|
|
77
|
-
}, [e]), u = w(() => E(
|
|
77
|
+
}, [e]), u = w(() => E(a, i), [a, i]), I = M({
|
|
78
78
|
meta: e,
|
|
79
|
-
theme:
|
|
79
|
+
theme: i
|
|
80
80
|
});
|
|
81
|
-
if (!
|
|
81
|
+
if (!c.appName)
|
|
82
82
|
return null;
|
|
83
|
-
const $ = D((v =
|
|
84
|
-
return B(k) &&
|
|
83
|
+
const $ = D((v = c == null ? void 0 : c.navigation) == null ? void 0 : v.header, d), g = Y($), { navItems: s, activeId: N } = g, k = parseInt((x = window.blocklet) == null ? void 0 : x.USE_ARCBLOCK_THEME, 10);
|
|
84
|
+
return B(k) && s.splice(k, 0, {
|
|
85
85
|
label: f("products"),
|
|
86
86
|
// eslint-disable-next-line react/no-unstable-nested-components
|
|
87
87
|
children: ({ isOpen: r }) => /* @__PURE__ */ l(R, { isOpen: r })
|
|
@@ -95,7 +95,7 @@ function Z({
|
|
|
95
95
|
/* @__PURE__ */ l(
|
|
96
96
|
J,
|
|
97
97
|
{
|
|
98
|
-
formattedBlocklet:
|
|
98
|
+
formattedBlocklet: c,
|
|
99
99
|
addons: typeof t == "function" ? (r) => t(r, { navigation: g }) : t,
|
|
100
100
|
sessionManagerProps: b,
|
|
101
101
|
showDomainWarningDialog: o
|
|
@@ -106,14 +106,14 @@ function Z({
|
|
|
106
106
|
$bordered: n == null ? void 0 : n.bordered,
|
|
107
107
|
$bgcolor: u.palette.background.default,
|
|
108
108
|
className: j("blocklet__header", n.className),
|
|
109
|
-
children: p || !(
|
|
109
|
+
children: p || !(s != null && s.length) ? null : ({ isMobile: r }) => (
|
|
110
110
|
// @ts-ignore
|
|
111
111
|
/* @__PURE__ */ l(
|
|
112
112
|
P,
|
|
113
113
|
{
|
|
114
114
|
mode: r ? "inline" : "horizontal",
|
|
115
115
|
activeId: N,
|
|
116
|
-
items:
|
|
116
|
+
items: s,
|
|
117
117
|
className: "header-nav",
|
|
118
118
|
bgColor: "transparent",
|
|
119
119
|
textColor: u.palette.grey[500],
|
package/lib/Icon/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { AvatarProps, BoxProps } from '@mui/material';
|
|
2
|
+
/**
|
|
3
|
+
* Icon 组件, 基于 mui Avatar 组件扩展对 iconify 的支持
|
|
4
|
+
*/
|
|
5
|
+
export default function Icon({ icon, size, sx, ...rest }: {
|
|
6
|
+
icon: string;
|
|
7
|
+
size?: number;
|
|
8
|
+
sx?: BoxProps['sx'];
|
|
9
|
+
} & AvatarProps): import("react/jsx-runtime").JSX.Element | null;
|
package/lib/Icon/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import "iconify-icon";
|
|
3
3
|
import { useState as c } from "react";
|
|
4
|
-
import { useAsyncEffect as
|
|
4
|
+
import { useAsyncEffect as d } from "ahooks";
|
|
5
5
|
import { Avatar as e } from "@mui/material";
|
|
6
|
-
import { loadIcon as
|
|
6
|
+
import { loadIcon as m, Icon as h } from "@iconify/react";
|
|
7
7
|
import { isUrl as g } from "../utils.js";
|
|
8
8
|
function M({
|
|
9
9
|
icon: r,
|
|
10
|
-
size: t,
|
|
11
|
-
sx: i,
|
|
10
|
+
size: t = void 0,
|
|
11
|
+
sx: i = {},
|
|
12
12
|
...a
|
|
13
13
|
}) {
|
|
14
14
|
const o = [...Array.isArray(i) ? i : [i]];
|
|
15
15
|
t && o.push({ width: t, height: t });
|
|
16
16
|
const [p, f] = c(!1), [l, s] = c(!0);
|
|
17
|
-
if (
|
|
17
|
+
if (d(async () => {
|
|
18
18
|
s(!0);
|
|
19
19
|
try {
|
|
20
|
-
await
|
|
20
|
+
await m(r), f(!0);
|
|
21
21
|
} catch {
|
|
22
22
|
f(!1);
|
|
23
23
|
}
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
interface NotificationComponentProps {
|
|
2
|
+
viewAllUrl: string;
|
|
3
|
+
keyId: number;
|
|
4
|
+
notification?: {
|
|
5
|
+
severity?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
activity?: any;
|
|
9
|
+
actorInfo?: any;
|
|
10
|
+
};
|
|
11
|
+
content?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export default function NotificationComponent({ ref, keyId: key, notification, viewAllUrl, content, }: NotificationComponentProps & {
|
|
14
|
+
ref?: React.Ref<unknown>;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -1,9 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Activity types enum for type safety
|
|
3
|
+
* @readonly
|
|
4
|
+
* @enum {string}
|
|
5
|
+
*/
|
|
6
|
+
declare const ACTIVITY_TYPES: {
|
|
7
|
+
readonly COMMENT: "comment";
|
|
8
|
+
readonly LIKE: "like";
|
|
9
|
+
readonly FOLLOW: "follow";
|
|
10
|
+
readonly TIPS: "tips";
|
|
11
|
+
readonly MENTION: "mention";
|
|
12
|
+
readonly ASSIGN: "assign";
|
|
13
|
+
};
|
|
14
|
+
type ActivityTypeValues = (typeof ACTIVITY_TYPES)[keyof typeof ACTIVITY_TYPES];
|
|
15
|
+
interface UserData {
|
|
16
|
+
did: string;
|
|
17
|
+
fullName: string;
|
|
18
|
+
}
|
|
19
|
+
interface ActivityTarget {
|
|
20
|
+
type: string;
|
|
21
|
+
name: string;
|
|
22
|
+
}
|
|
23
|
+
interface Activity {
|
|
24
|
+
type: ActivityTypeValues;
|
|
25
|
+
target: ActivityTarget;
|
|
26
|
+
}
|
|
27
|
+
interface ExtraParams {
|
|
28
|
+
linkColor?: string;
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}
|
|
31
|
+
interface ActivityTitleProps {
|
|
32
|
+
activity: Activity;
|
|
33
|
+
users: UserData[];
|
|
34
|
+
actors: string[];
|
|
35
|
+
extra?: ExtraParams;
|
|
36
|
+
mountPoint?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A hook that returns a formatted activity title with linked usernames
|
|
40
|
+
* @param {Object} params - The parameters object
|
|
41
|
+
* @param {keyof typeof ACTIVITY_TYPES} params.type - The activity type
|
|
42
|
+
* @param {Object} params.target - The target object
|
|
43
|
+
* @param {Array<{did: string, fullName: string}>} params.users - Array of user objects
|
|
44
|
+
* @param {Object} params.extra - Extra parameters
|
|
45
|
+
* @returns {React.ReactNode} Formatted title with linked usernames
|
|
46
|
+
*/
|
|
47
|
+
export default function useActivityTitle({ activity, users, actors, extra, mountPoint }: ActivityTitleProps): import("react/jsx-runtime").JSX.Element | null;
|
|
48
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as s, jsxs as o, Fragment as i } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import F from "react";
|
|
3
3
|
import { useCreation as f, useMemoizedFn as U } from "ahooks";
|
|
4
4
|
import { useTheme as C, Link as E } from "@mui/material";
|
|
5
|
-
import { WELLKNOWN_SERVICE_PATH_PREFIX as
|
|
6
|
-
import { joinURL as R, withQuery as
|
|
5
|
+
import { WELLKNOWN_SERVICE_PATH_PREFIX as M } from "@abtnode/constant";
|
|
6
|
+
import { joinURL as R, withQuery as S } from "ufo";
|
|
7
7
|
import D from "lodash/isEmpty";
|
|
8
8
|
import { getActivityLink as I } from "../utils.js";
|
|
9
9
|
const P = {
|
|
@@ -31,8 +31,8 @@ const P = {
|
|
|
31
31
|
] }),
|
|
32
32
|
assign: () => /* @__PURE__ */ s(i, { children: "assigned you a task" })
|
|
33
33
|
};
|
|
34
|
-
function a({ user: r, color: l }) {
|
|
35
|
-
const { palette: d } = C(), h =
|
|
34
|
+
function a({ user: r, color: l = void 0 }) {
|
|
35
|
+
const { palette: d } = C(), h = S(R(M, "user"), { did: r.did }), m = l || d.text.primary;
|
|
36
36
|
return /* @__PURE__ */ s(
|
|
37
37
|
E,
|
|
38
38
|
{
|
|
@@ -73,9 +73,9 @@ function H({ activity: r, users: l, actors: d, extra: h = {}, mountPoint: m = ""
|
|
|
73
73
|
] });
|
|
74
74
|
const _ = n.length > 3, N = _ ? n.slice(0, 2) : e;
|
|
75
75
|
return /* @__PURE__ */ o(i, { children: [
|
|
76
|
-
N.map((T,
|
|
76
|
+
N.map((T, w) => /* @__PURE__ */ o(F.Fragment, { children: [
|
|
77
77
|
/* @__PURE__ */ s(a, { user: T, color: c }),
|
|
78
|
-
|
|
78
|
+
w < N.length - 1 ? ", " : ""
|
|
79
79
|
] }, T.did)),
|
|
80
80
|
_ ? `, and ${n.length - 2} others` : /* @__PURE__ */ o(i, { children: [
|
|
81
81
|
", and ",
|
|
@@ -85,7 +85,7 @@ function H({ activity: r, users: l, actors: d, extra: h = {}, mountPoint: m = ""
|
|
|
85
85
|
}), A = U(() => {
|
|
86
86
|
const e = u ? P[u] : null;
|
|
87
87
|
return e ? e(y, l.length) : null;
|
|
88
|
-
}),
|
|
88
|
+
}), v = f(() => {
|
|
89
89
|
const e = L(), t = A();
|
|
90
90
|
return !e || !t ? null : /* @__PURE__ */ o(i, { children: [
|
|
91
91
|
e,
|
|
@@ -98,7 +98,7 @@ function H({ activity: r, users: l, actors: d, extra: h = {}, mountPoint: m = ""
|
|
|
98
98
|
return e != null && e.targetLink ? R(m, e.targetLink) : null;
|
|
99
99
|
}, [r, m]);
|
|
100
100
|
return !u || D(g) ? null : /* @__PURE__ */ o(i, { children: [
|
|
101
|
-
|
|
101
|
+
v,
|
|
102
102
|
" ",
|
|
103
103
|
x && /* @__PURE__ */ s(
|
|
104
104
|
E,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare function useWidth(): string;
|
|
2
|
+
export default useWidth;
|
|
@@ -1,10 +1,70 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* 通知对象的活动目标接口
|
|
3
|
+
*/
|
|
4
|
+
interface ActivityTarget {
|
|
5
|
+
type?: string;
|
|
6
|
+
id?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 通知对象的活动元数据接口
|
|
10
|
+
*/
|
|
11
|
+
interface ActivityMeta {
|
|
12
|
+
id?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 活动对象接口
|
|
16
|
+
*/
|
|
17
|
+
interface Activity {
|
|
18
|
+
type?: string;
|
|
19
|
+
actor?: string;
|
|
20
|
+
target?: ActivityTarget;
|
|
21
|
+
meta?: ActivityMeta;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 通知对象接口
|
|
25
|
+
*/
|
|
26
|
+
interface Notification {
|
|
27
|
+
activity?: Activity;
|
|
28
|
+
actorInfo?: any;
|
|
29
|
+
severity?: string;
|
|
30
|
+
title?: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
items?: Notification[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 合并相邻的通知数据
|
|
36
|
+
* 合并条件:
|
|
37
|
+
* 1. 数据必须是相邻的
|
|
38
|
+
* 2. activity.type 必须相同且不为 null 或 undefined
|
|
39
|
+
* 3. 如果存在target对象,activity.target.type和activity.target.id都必须相同
|
|
40
|
+
* 4. 如果相邻数据的 activity.type 相同但没有 activity.target 对象,则需要合并
|
|
41
|
+
*
|
|
42
|
+
* @param {Notification[]} notifications - 需要处理的通知数据
|
|
43
|
+
* @returns {Notification[]} - 合并后的通知数组
|
|
44
|
+
*/
|
|
45
|
+
export declare const mergeAdjacentNotifications: (notifications: Notification[]) => Notification[];
|
|
46
|
+
/**
|
|
47
|
+
* 判断通知是否包含activity
|
|
48
|
+
* @param {Notification} notification - 通知对象
|
|
49
|
+
* @returns {boolean} - 是否包含activity
|
|
50
|
+
*/
|
|
51
|
+
export declare const isIncludeActivity: (notification: Notification) => boolean;
|
|
52
|
+
/**
|
|
53
|
+
* 是否可以自动已读
|
|
54
|
+
*/
|
|
55
|
+
export declare const canAutoRead: (notification: Notification | null | undefined) => boolean;
|
|
56
|
+
/**
|
|
57
|
+
* 获取 activity 的链接
|
|
58
|
+
* 链接的来源有两种
|
|
59
|
+
* 1. activity.meta.id
|
|
60
|
+
* 2. activity.target.id
|
|
61
|
+
* @param {Activity} activity - 活动对象
|
|
62
|
+
* @returns {Object | null} - 活动的链接
|
|
63
|
+
*/
|
|
64
|
+
export declare const getActivityLink: (activity: Activity | null | undefined) => {
|
|
65
|
+
metaLink?: string | null;
|
|
66
|
+
targetLink?: string | null;
|
|
5
67
|
} | null;
|
|
6
|
-
declare
|
|
7
|
-
declare
|
|
8
|
-
|
|
9
|
-
declare function S(s: any, t: any, r?: boolean): Promise<string>;
|
|
10
|
-
export { D as canAutoRead, R as getActivityLink, z as isIncludeActivity, M as mergeAdjacentNotifications, _ as sanitize, S as toClickableSpan };
|
|
68
|
+
export declare const toClickableSpan: (str: string, locale: string, isHighLight?: boolean) => Promise<string>;
|
|
69
|
+
export declare const sanitize: (innerHtml: string) => string;
|
|
70
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
user:
|
|
4
|
-
}): import(
|
|
1
|
+
import { User } from '../../@types';
|
|
2
|
+
export default function ConfigInviter({ user }: {
|
|
3
|
+
user: User;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element | "-";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
user:
|
|
4
|
-
onSave:
|
|
5
|
-
}): import(
|
|
1
|
+
import { User } from '../../@types';
|
|
2
|
+
export default function ConfigProfile({ user, onSave }: {
|
|
3
|
+
user: User;
|
|
4
|
+
onSave: (type: 'profile') => void;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
declare function H(): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
|
|
1
|
+
export default function DangerZone(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,43 +1,46 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TooltipProps } from '@mui/material';
|
|
3
|
+
interface EditableFieldProps {
|
|
4
|
+
value: string;
|
|
5
|
+
onChange?: (value: string) => void;
|
|
6
|
+
onValueValidate?: (value: string) => void;
|
|
7
|
+
editable?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
component?: 'input' | 'textarea';
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
rows?: number;
|
|
12
|
+
maxLength?: number;
|
|
13
|
+
icon?: React.ReactNode;
|
|
14
|
+
label?: string | React.ReactNode;
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
tooltip?: TooltipProps['title'];
|
|
17
|
+
inline?: boolean;
|
|
18
|
+
style?: React.CSSProperties;
|
|
19
|
+
verified?: boolean;
|
|
20
|
+
errorMsg?: string;
|
|
21
|
+
canEdit?: boolean;
|
|
22
|
+
hidePreview?: boolean;
|
|
23
|
+
renderValue?: (value: string) => React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
/** only for sx */
|
|
26
|
+
export declare const commonInputStyle: {
|
|
27
|
+
'.MuiOutlinedInput-root': {
|
|
28
|
+
'&:hover': {
|
|
5
29
|
fieldset: {
|
|
6
30
|
borderColor: string;
|
|
7
31
|
};
|
|
8
32
|
};
|
|
9
|
-
|
|
33
|
+
'&.Mui-focused': {
|
|
10
34
|
fieldset: {
|
|
11
35
|
borderColor: string;
|
|
12
36
|
};
|
|
13
37
|
};
|
|
14
38
|
};
|
|
15
39
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
onChange?: (() => void) | undefined;
|
|
19
|
-
onValueValidate?: (() => void) | undefined;
|
|
20
|
-
errorMsg?: string | undefined;
|
|
21
|
-
editable?: boolean | undefined;
|
|
22
|
-
component?: string | undefined;
|
|
23
|
-
placeholder?: string | undefined;
|
|
24
|
-
rows?: number | undefined;
|
|
25
|
-
maxLength: any;
|
|
26
|
-
icon: any;
|
|
27
|
-
label?: string | undefined;
|
|
28
|
-
children: any;
|
|
29
|
-
tooltip: any;
|
|
30
|
-
inline?: boolean | undefined;
|
|
31
|
-
style?: {} | undefined;
|
|
32
|
-
verified?: boolean | undefined;
|
|
33
|
-
canEdit?: boolean | undefined;
|
|
34
|
-
renderValue: any;
|
|
35
|
-
disabled?: boolean | undefined;
|
|
36
|
-
hidePreview?: boolean | undefined;
|
|
37
|
-
}): L.ReactElement<unknown, string | L.JSXElementConstructor<any>> | null;
|
|
38
|
-
declare const F: {
|
|
40
|
+
/** only for sx */
|
|
41
|
+
export declare const inputFieldStyle: {
|
|
39
42
|
width: string;
|
|
40
|
-
|
|
43
|
+
'& .MuiFormHelperText-root': {
|
|
41
44
|
position: string;
|
|
42
45
|
bottom: number;
|
|
43
46
|
left: number;
|
|
@@ -47,4 +50,5 @@ declare const F: {
|
|
|
47
50
|
borderColor: string;
|
|
48
51
|
};
|
|
49
52
|
};
|
|
50
|
-
|
|
53
|
+
declare function EditableField({ value, onChange, onValueValidate, errorMsg, editable, component, placeholder, rows, maxLength, icon, label, children, tooltip, inline, style, verified, canEdit, renderValue, disabled, hidePreview, }: EditableFieldProps): import("react/jsx-runtime").JSX.Element | null;
|
|
54
|
+
export default EditableField;
|
|
@@ -42,17 +42,17 @@ function re({
|
|
|
42
42
|
editable: h = !1,
|
|
43
43
|
component: x = "input",
|
|
44
44
|
placeholder: a = "",
|
|
45
|
-
rows:
|
|
46
|
-
maxLength: r,
|
|
47
|
-
icon:
|
|
48
|
-
label:
|
|
49
|
-
children: p,
|
|
50
|
-
tooltip: I,
|
|
45
|
+
rows: v = 2,
|
|
46
|
+
maxLength: r = void 0,
|
|
47
|
+
icon: g = void 0,
|
|
48
|
+
label: w = "",
|
|
49
|
+
children: p = void 0,
|
|
50
|
+
tooltip: I = void 0,
|
|
51
51
|
inline: P = !0,
|
|
52
52
|
style: X = {},
|
|
53
53
|
verified: Y = !1,
|
|
54
54
|
canEdit: k = !0,
|
|
55
|
-
renderValue:
|
|
55
|
+
renderValue: b = void 0,
|
|
56
56
|
disabled: y = !1,
|
|
57
57
|
hidePreview: z = !1
|
|
58
58
|
}) {
|
|
@@ -103,7 +103,7 @@ function re({
|
|
|
103
103
|
slotProps: {
|
|
104
104
|
input: {
|
|
105
105
|
multiline: !0,
|
|
106
|
-
minRows:
|
|
106
|
+
minRows: v,
|
|
107
107
|
placeholder: a
|
|
108
108
|
}
|
|
109
109
|
}
|
|
@@ -128,9 +128,9 @@ function re({
|
|
|
128
128
|
}
|
|
129
129
|
) : null
|
|
130
130
|
] });
|
|
131
|
-
}, [t, m, x, a,
|
|
131
|
+
}, [t, m, x, a, v, p]);
|
|
132
132
|
return !k && h ? null : h ? /* @__PURE__ */ s(d, { sx: { width: "100%" }, style: X, children: [
|
|
133
|
-
|
|
133
|
+
w && /* @__PURE__ */ n(u, { variant: "subtitle1", gutterBottom: !0, sx: { mb: 0.5, fontSize: "12px", color: "text.primary" }, children: w }),
|
|
134
134
|
H
|
|
135
135
|
] }) : t && !z ? /* @__PURE__ */ n(
|
|
136
136
|
J,
|
|
@@ -183,7 +183,7 @@ function re({
|
|
|
183
183
|
alignItems: "center",
|
|
184
184
|
gap: 1,
|
|
185
185
|
children: [
|
|
186
|
-
|
|
186
|
+
g ? L.cloneElement(g, {
|
|
187
187
|
style: {
|
|
188
188
|
filter: O ? "brightness(0) saturate(100%) invert(1)" : "none"
|
|
189
189
|
}
|
|
@@ -199,7 +199,7 @@ function re({
|
|
|
199
199
|
component: "div",
|
|
200
200
|
onMouseEnter: j,
|
|
201
201
|
onMouseLeave: D,
|
|
202
|
-
children:
|
|
202
|
+
children: b ? b(t) : t
|
|
203
203
|
}
|
|
204
204
|
),
|
|
205
205
|
Y && /* @__PURE__ */ n(q, { color: "success", style: { fontSize: 16, width: 16, marginLeft: 4, flexShrink: 0 } })
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
user:
|
|
4
|
-
}): import(
|
|
1
|
+
import { User } from '../../@types';
|
|
2
|
+
export default function Nft({ user }: {
|
|
3
|
+
user: User;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
user:
|
|
4
|
-
isMobile:
|
|
5
|
-
}): import(
|
|
1
|
+
import { User } from '../../@types';
|
|
2
|
+
export default function Notification({ user, isMobile }: {
|
|
3
|
+
user: User;
|
|
4
|
+
isMobile: boolean;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -15,8 +15,8 @@ import D from "./webhook-item.js";
|
|
|
15
15
|
import { formatAxiosError as I } from "../libs/utils.js";
|
|
16
16
|
import { client as y } from "../../libs/client.js";
|
|
17
17
|
function g({
|
|
18
|
-
title: a,
|
|
19
|
-
description: s,
|
|
18
|
+
title: a = void 0,
|
|
19
|
+
description: s = void 0,
|
|
20
20
|
value: m,
|
|
21
21
|
onChange: i,
|
|
22
22
|
isMobile: n
|
|
@@ -58,7 +58,7 @@ function g({
|
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
60
|
function ne({ user: a, isMobile: s }) {
|
|
61
|
-
var
|
|
61
|
+
var v, b;
|
|
62
62
|
const { locale: m } = _(), i = c((e, o = {}) => U(q, e, m, "en", o)), n = B({
|
|
63
63
|
showAdd: !1
|
|
64
64
|
}), t = E(
|
|
@@ -76,10 +76,10 @@ function ne({ user: a, isMobile: s }) {
|
|
|
76
76
|
push: !0,
|
|
77
77
|
...((e = t == null ? void 0 : t.data) == null ? void 0 : e.notifications) || {}
|
|
78
78
|
};
|
|
79
|
-
}, [(
|
|
79
|
+
}, [(v = t == null ? void 0 : t.data) == null ? void 0 : v.notifications]), p = C(() => {
|
|
80
80
|
var e;
|
|
81
81
|
return ((e = t == null ? void 0 : t.data) == null ? void 0 : e.webhooks) || [];
|
|
82
|
-
}, [(
|
|
82
|
+
}, [(b = t == null ? void 0 : t.data) == null ? void 0 : b.webhooks]), u = c(async (e) => {
|
|
83
83
|
try {
|
|
84
84
|
await y.user.saveUserNotificationConfig(e), f.success(i("saveSuccess")), t.run();
|
|
85
85
|
} catch (o) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
user:
|
|
5
|
-
}): import(
|
|
1
|
+
import { BoxProps } from '@mui/material';
|
|
2
|
+
import { User } from '../../@types';
|
|
3
|
+
export default function Passport({ user, ...rest }: {
|
|
4
|
+
user: User;
|
|
5
|
+
} & BoxProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
type PrivacyConfig = {
|
|
2
|
+
key: string;
|
|
3
|
+
name: string;
|
|
4
|
+
value: boolean;
|
|
5
|
+
isPrivate?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export default function Privacy({ configList, onSave, }: {
|
|
8
|
+
configList: PrivacyConfig[];
|
|
9
|
+
onSave: (type: 'privacy') => void;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|