@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
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
isMobile
|
|
4
|
-
size:
|
|
5
|
-
isMyself:
|
|
6
|
-
status:
|
|
7
|
-
onChange:
|
|
8
|
-
timezone
|
|
9
|
-
}): import(
|
|
1
|
+
import { UserMetadata } from '../../../@types';
|
|
2
|
+
export default function UserStatus({ isMobile, size, isMyself, status, onChange, timezone, }: {
|
|
3
|
+
isMobile?: boolean;
|
|
4
|
+
size: number;
|
|
5
|
+
isMyself: boolean;
|
|
6
|
+
status: UserMetadata['status'];
|
|
7
|
+
onChange: (v: UserMetadata['status']) => void;
|
|
8
|
+
timezone?: string;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as E, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { Tooltip as H, Box as z, Badge as B } from "@mui/material";
|
|
3
3
|
import U from "@emotion/styled";
|
|
4
|
-
import { lazy as
|
|
4
|
+
import { lazy as d, useState as C, useEffect as q, useCallback as A, useMemo as F, Suspense as L } from "react";
|
|
5
5
|
import { useMemoizedFn as T, useInterval as Q, useUnmount as G, useCreation as J } from "ahooks";
|
|
6
6
|
import { useLocaleContext as K } from "@arcblock/ux/lib/Locale/context";
|
|
7
7
|
import { translate as P } from "@arcblock/ux/lib/Locale/util";
|
|
@@ -10,7 +10,7 @@ import { StatusEnum as t, DurationEnum as c } from "../../../@types/index.js";
|
|
|
10
10
|
import X from "../status-dialog/index.js";
|
|
11
11
|
import { translations as Y } from "../../libs/locales.js";
|
|
12
12
|
import { isNotClear as $, isWithinTimeRange as Z, getTimeRemaining as _ } from "./utils.js";
|
|
13
|
-
const ee =
|
|
13
|
+
const ee = d(() => import("@arcblock/icons/lib/Meeting")), oe = d(() => import("@arcblock/icons/lib/Community")), ne = d(() => import("@arcblock/icons/lib/Holiday")), te = d(() => import("@arcblock/icons/lib/OffSick")), ie = d(() => import("@arcblock/icons/lib/WorkingRemotely")), I = {
|
|
14
14
|
[t.Meeting]: ee,
|
|
15
15
|
[t.Community]: oe,
|
|
16
16
|
[t.Holiday]: ne,
|
|
@@ -38,15 +38,15 @@ const ee = m(() => import("@arcblock/icons/lib/Meeting")), oe = m(() => import("
|
|
|
38
38
|
durationName: "userStatus.duration.ThisWeek"
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
-
function
|
|
42
|
-
isMobile: o,
|
|
41
|
+
function ye({
|
|
42
|
+
isMobile: o = void 0,
|
|
43
43
|
size: R,
|
|
44
44
|
isMyself: g,
|
|
45
45
|
status: e,
|
|
46
46
|
onChange: s,
|
|
47
|
-
timezone: W
|
|
47
|
+
timezone: W = void 0
|
|
48
48
|
}) {
|
|
49
|
-
const { locale:
|
|
49
|
+
const { locale: m } = K(), u = T((n, i = {}) => P(Y, n, m, "en", i)), [b, p] = C(void 0), f = T(() => {
|
|
50
50
|
p(void 0);
|
|
51
51
|
});
|
|
52
52
|
q(() => {
|
|
@@ -84,22 +84,22 @@ function ke({
|
|
|
84
84
|
children: n
|
|
85
85
|
};
|
|
86
86
|
});
|
|
87
|
-
}, [u, x,
|
|
87
|
+
}, [u, x, m]), D = (n) => {
|
|
88
88
|
g && S(n.currentTarget);
|
|
89
|
-
},
|
|
89
|
+
}, v = () => {
|
|
90
90
|
S(null);
|
|
91
91
|
}, j = (n) => {
|
|
92
|
-
g && (s(n),
|
|
93
|
-
},
|
|
92
|
+
g && (s(n), v());
|
|
93
|
+
}, y = I[e == null ? void 0 : e.value], M = F(() => {
|
|
94
94
|
var i;
|
|
95
95
|
const n = h.find((r) => r.id === (e == null ? void 0 : e.value));
|
|
96
96
|
if (n) {
|
|
97
|
-
const r =
|
|
97
|
+
const r = m === "zh" ? "zh-cn" : "en-us";
|
|
98
98
|
let a;
|
|
99
99
|
return $(e) || (a = (i = e == null ? void 0 : e.dateRange) == null ? void 0 : i.map((w) => V(w, { locale: r }))), a && a.length > 0 ? `${n.name}: ${a.join("~")}` : n.name;
|
|
100
100
|
}
|
|
101
101
|
return null;
|
|
102
|
-
}, [e, h,
|
|
102
|
+
}, [e, h, m]), k = !!O;
|
|
103
103
|
return /* @__PURE__ */ E(ae, { size: R, isMobile: o, children: [
|
|
104
104
|
/* @__PURE__ */ l(H, { title: M, children: /* @__PURE__ */ l(
|
|
105
105
|
z,
|
|
@@ -111,17 +111,17 @@ function ke({
|
|
|
111
111
|
alignItems: "center",
|
|
112
112
|
justifyContent: "center"
|
|
113
113
|
},
|
|
114
|
-
children:
|
|
114
|
+
children: y ? /* @__PURE__ */ l(L, { fallback: null, children: /* @__PURE__ */ l(y, { style: { width: 16, height: 16 } }) }) : /* @__PURE__ */ l(B, { color: "success", variant: "dot" })
|
|
115
115
|
}
|
|
116
116
|
) }),
|
|
117
|
-
|
|
117
|
+
k && /* @__PURE__ */ l(
|
|
118
118
|
X,
|
|
119
119
|
{
|
|
120
120
|
selected: e,
|
|
121
121
|
data: h,
|
|
122
|
-
open:
|
|
122
|
+
open: k,
|
|
123
123
|
onSelect: j,
|
|
124
|
-
onClose:
|
|
124
|
+
onClose: v,
|
|
125
125
|
timezone: W
|
|
126
126
|
}
|
|
127
127
|
)
|
|
@@ -151,5 +151,5 @@ const ae = U("div")`
|
|
|
151
151
|
}
|
|
152
152
|
`;
|
|
153
153
|
export {
|
|
154
|
-
|
|
154
|
+
ye as default
|
|
155
155
|
};
|
|
@@ -1,33 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
declare const
|
|
1
|
+
import { UserMetadata } from '../../../@types';
|
|
2
|
+
export declare const currentTimezone: string;
|
|
3
|
+
export declare const getTimezones: () => {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}[];
|
|
7
|
+
export declare const isValidUrl: (url: string) => boolean;
|
|
8
|
+
/**
|
|
9
|
+
* 根据 duration 类型,计算出date range
|
|
10
|
+
* @param status
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export declare const getStatusDuration: (status: UserMetadata["status"]) => Date[];
|
|
14
|
+
/**
|
|
15
|
+
* 根据状态的 duration,判断是否在时间范围内
|
|
16
|
+
* @param status
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
export declare const isWithinTimeRange: (dateRange: [Date, Date]) => boolean;
|
|
20
|
+
/**
|
|
21
|
+
* 判断状态持续时间是否为不可清除
|
|
22
|
+
* @param status
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
export declare const isNotClear: (status: UserMetadata["status"]) => boolean;
|
|
26
|
+
/**
|
|
27
|
+
* 获取当前时间距离结束时间还有多久
|
|
28
|
+
*/
|
|
29
|
+
export declare const getTimeRemaining: (date: Date) => number;
|
|
30
|
+
export declare const defaultButtonStyle: {
|
|
3
31
|
color: string;
|
|
4
32
|
borderColor: string;
|
|
5
33
|
backgroundColor: string;
|
|
6
|
-
|
|
34
|
+
'&:hover': {
|
|
7
35
|
borderColor: string;
|
|
8
36
|
backgroundColor: string;
|
|
9
37
|
};
|
|
10
38
|
py: number;
|
|
11
39
|
borderRadius: number;
|
|
12
40
|
};
|
|
13
|
-
declare
|
|
14
|
-
declare function v(r: any): number;
|
|
15
|
-
declare function I(): {
|
|
16
|
-
label: string;
|
|
17
|
-
value: string;
|
|
18
|
-
}[];
|
|
19
|
-
declare function Z(r: any): boolean;
|
|
20
|
-
declare function N(r: any): boolean;
|
|
21
|
-
declare function E(r: any): boolean;
|
|
22
|
-
declare const B: {
|
|
41
|
+
export declare const primaryButtonStyle: {
|
|
23
42
|
color: string;
|
|
24
43
|
borderColor: string;
|
|
25
44
|
backgroundColor: string;
|
|
26
|
-
|
|
45
|
+
'&:hover': {
|
|
27
46
|
borderColor: string;
|
|
28
47
|
backgroundColor: string;
|
|
29
48
|
};
|
|
30
49
|
py: number;
|
|
31
50
|
borderRadius: number;
|
|
32
51
|
};
|
|
33
|
-
export { M as currentTimezone, w as defaultButtonStyle, _ as getStatusDuration, v as getTimeRemaining, I as getTimezones, Z as isNotClear, N as isValidUrl, E as isWithinTimeRange, B as primaryButtonStyle };
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
onTest?: ((...args: any[]) => void) | undefined;
|
|
4
|
-
onDelete?: ((...args: any[]) => void) | undefined;
|
|
5
|
-
onSave?: ((...args: any[]) => void) | undefined;
|
|
6
|
-
onCancel?: ((...args: any[]) => void) | undefined;
|
|
7
|
-
type?: string | undefined;
|
|
8
|
-
url?: string | undefined;
|
|
9
|
-
edit?: boolean | undefined;
|
|
10
|
-
}): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
|
|
1
|
+
import { WebhookItemProps } from '../../@types';
|
|
2
|
+
export default function WebhookItem({ onTest, onDelete, onSave, onCancel, type, url, edit, }: WebhookItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { t as UserCenter };
|
|
1
|
+
export { default as UserCenter } from './components/user-center';
|