@blocklet/ui-react 3.0.6 → 3.0.7
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 +15 -15
- package/lib/BlockletStudio/index.js +66 -66
- package/lib/ComponentManager/components/add-component.d.ts +6 -6
- package/lib/ComponentManager/components/add-component.js +29 -29
- package/lib/ComponentManager/components/publish-component.d.ts +3 -3
- package/lib/ComponentManager/components/publish-component.js +19 -19
- package/lib/ComponentManager/components/resource-dialog.d.ts +1 -1
- package/lib/ComponentManager/components/resource-dialog.js +1 -1
- package/lib/Footer/internal-footer.d.ts +3 -1
- package/lib/Footer/internal-footer.js +1 -1
- package/lib/Footer/layout/standard.d.ts +1 -1
- package/lib/Footer/layout/standard.js +1 -1
- package/lib/Footer/links.d.ts +1 -1
- package/lib/Footer/links.js +3 -3
- package/lib/Header/index.d.ts +2 -2
- package/lib/Header/index.js +17 -17
- package/lib/Icon/index.d.ts +2 -2
- package/lib/Icon/index.js +6 -6
- package/lib/Notifications/Snackbar.d.ts +1 -1
- package/lib/Notifications/Snackbar.js +1 -1
- package/lib/Notifications/hooks/use-title.d.ts +2 -2
- package/lib/Notifications/hooks/use-title.js +9 -9
- package/lib/UserCenter/components/editable-field.d.ts +6 -6
- package/lib/UserCenter/components/editable-field.js +12 -12
- package/lib/UserCenter/components/notification.js +5 -5
- package/lib/UserCenter/components/status-dialog/date-picker.d.ts +5 -5
- package/lib/UserCenter/components/status-dialog/date-picker.js +17 -10
- package/lib/UserCenter/components/status-dialog/index.d.ts +1 -1
- package/lib/UserCenter/components/status-dialog/index.js +8 -1
- package/lib/UserCenter/components/status-selector/index.d.ts +2 -2
- package/lib/UserCenter/components/status-selector/index.js +5 -5
- package/lib/UserCenter/components/status-selector/menu-item.d.ts +4 -4
- package/lib/UserCenter/components/status-selector/menu-item.js +11 -6
- package/lib/UserCenter/components/third-party-login/index.js +23 -29
- package/lib/UserCenter/components/user-info/user-info-item.d.ts +1 -1
- package/lib/UserCenter/components/user-info/user-info-item.js +1 -1
- package/lib/UserCenter/components/user-info/user-status.d.ts +4 -4
- package/lib/UserCenter/components/user-info/user-status.js +17 -17
- package/package.json +7 -5
- 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
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
export {
|
|
2
|
-
declare function
|
|
1
|
+
export { z as default };
|
|
2
|
+
declare function z({ open: d, setOpen: s, onOpened: i, componentDid: e, tenantScope: r, resourcesParams: h, mode: w, title: E, logo: v, description: R, introduction: L, note: y, componentsTitle: D, resourcesTitle: S, onUploaded: b, onReleased: j, onConnected: x, components: B, resources: P, style: U, zIndex: _, dependentComponentsMode: k, ...C }: {
|
|
3
3
|
[x: string]: any;
|
|
4
4
|
open: any;
|
|
5
5
|
setOpen: any;
|
|
6
|
-
onOpened
|
|
6
|
+
onOpened?: undefined;
|
|
7
7
|
componentDid: any;
|
|
8
|
-
tenantScope
|
|
8
|
+
tenantScope?: undefined;
|
|
9
9
|
resourcesParams?: {} | undefined;
|
|
10
10
|
mode?: string | undefined;
|
|
11
|
-
title
|
|
12
|
-
logo
|
|
13
|
-
description
|
|
14
|
-
introduction
|
|
15
|
-
note
|
|
16
|
-
componentsTitle
|
|
17
|
-
resourcesTitle
|
|
18
|
-
onUploaded
|
|
19
|
-
onReleased
|
|
20
|
-
onConnected
|
|
11
|
+
title?: undefined;
|
|
12
|
+
logo?: undefined;
|
|
13
|
+
description?: undefined;
|
|
14
|
+
introduction?: undefined;
|
|
15
|
+
note?: undefined;
|
|
16
|
+
componentsTitle?: undefined;
|
|
17
|
+
resourcesTitle?: undefined;
|
|
18
|
+
onUploaded?: undefined;
|
|
19
|
+
onReleased?: undefined;
|
|
20
|
+
onConnected?: undefined;
|
|
21
21
|
components?: any[] | undefined;
|
|
22
22
|
resources?: {} | undefined;
|
|
23
23
|
style?: {} | undefined;
|
|
24
24
|
zIndex?: number | undefined;
|
|
25
|
-
dependentComponentsMode
|
|
25
|
+
dependentComponentsMode?: undefined;
|
|
26
26
|
}): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | null;
|
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { BLOCKLET_SERVICE_PATH_PREFIX as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { joinURL as
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
return Object.keys(s).forEach((
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
}),
|
|
1
|
+
import { jsx as I } from "react/jsx-runtime";
|
|
2
|
+
import { BLOCKLET_SERVICE_PATH_PREFIX as T } from "@arcblock/ux/lib/Util/constant";
|
|
3
|
+
import { useState as V, useRef as p, useEffect as A } from "react";
|
|
4
|
+
import { joinURL as H } from "ufo";
|
|
5
|
+
function J(d, s) {
|
|
6
|
+
const i = new URL(d);
|
|
7
|
+
return Object.keys(s).forEach((e) => {
|
|
8
|
+
const r = s[e];
|
|
9
|
+
r !== void 0 && i.searchParams.set(e, typeof r == "string" ? r : JSON.stringify(r));
|
|
10
|
+
}), i.pathname + i.search;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
open:
|
|
12
|
+
function z({
|
|
13
|
+
open: d,
|
|
14
14
|
setOpen: s,
|
|
15
|
-
onOpened:
|
|
16
|
-
componentDid:
|
|
17
|
-
tenantScope:
|
|
15
|
+
onOpened: i = void 0,
|
|
16
|
+
componentDid: e,
|
|
17
|
+
tenantScope: r = void 0,
|
|
18
18
|
resourcesParams: h = {},
|
|
19
19
|
mode: w = "dialog",
|
|
20
|
-
title: E,
|
|
21
|
-
logo:
|
|
22
|
-
description:
|
|
23
|
-
introduction:
|
|
24
|
-
note:
|
|
25
|
-
componentsTitle:
|
|
26
|
-
resourcesTitle:
|
|
27
|
-
onUploaded:
|
|
28
|
-
onReleased:
|
|
29
|
-
onConnected:
|
|
30
|
-
components:
|
|
31
|
-
resources:
|
|
32
|
-
style:
|
|
33
|
-
zIndex:
|
|
34
|
-
dependentComponentsMode:
|
|
35
|
-
...
|
|
20
|
+
title: E = void 0,
|
|
21
|
+
logo: v = void 0,
|
|
22
|
+
description: R = void 0,
|
|
23
|
+
introduction: L = void 0,
|
|
24
|
+
note: y = void 0,
|
|
25
|
+
componentsTitle: D = void 0,
|
|
26
|
+
resourcesTitle: S = void 0,
|
|
27
|
+
onUploaded: b = void 0,
|
|
28
|
+
onReleased: j = void 0,
|
|
29
|
+
onConnected: x = void 0,
|
|
30
|
+
components: B = [],
|
|
31
|
+
resources: P = {},
|
|
32
|
+
style: U = {},
|
|
33
|
+
zIndex: _ = 9999,
|
|
34
|
+
dependentComponentsMode: k = void 0,
|
|
35
|
+
...C
|
|
36
36
|
}) {
|
|
37
|
-
const [
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
if (
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
const
|
|
37
|
+
const [a, n] = V(!1), c = p("");
|
|
38
|
+
c.current = e;
|
|
39
|
+
const t = p({});
|
|
40
|
+
if (t.current["resourceDialog.close"] = () => {
|
|
41
|
+
n(!1), s(!1);
|
|
42
|
+
}, t.current["resourceDialog.loaded"] = () => {
|
|
43
|
+
n(!0), i == null || i();
|
|
44
|
+
}, t.current["studioDialog.uploaded"] = b, t.current["studioDialog.connected"] = x, t.current["studioDialog.released"] = j, A(() => {
|
|
45
|
+
const u = (o) => {
|
|
46
46
|
var f, m, g;
|
|
47
|
-
if (((f =
|
|
47
|
+
if (((f = o == null ? void 0 : o.data) == null ? void 0 : f.componentDid) !== c.current)
|
|
48
48
|
return;
|
|
49
|
-
const
|
|
50
|
-
typeof
|
|
49
|
+
const l = t.current[(m = o == null ? void 0 : o.data) == null ? void 0 : m.event];
|
|
50
|
+
typeof l == "function" && l((g = o == null ? void 0 : o.data) == null ? void 0 : g.data);
|
|
51
51
|
};
|
|
52
|
-
return window.addEventListener("message",
|
|
53
|
-
window.removeEventListener("message",
|
|
52
|
+
return window.addEventListener("message", u), () => {
|
|
53
|
+
window.removeEventListener("message", u);
|
|
54
54
|
};
|
|
55
|
-
}, []), !
|
|
55
|
+
}, []), !d)
|
|
56
56
|
return null;
|
|
57
|
-
const
|
|
58
|
-
|
|
57
|
+
const F = J(
|
|
58
|
+
H(window.location.origin, T, "/embed/resources", e, "/publish"),
|
|
59
59
|
{
|
|
60
60
|
title: E,
|
|
61
|
-
logo:
|
|
62
|
-
description:
|
|
63
|
-
introduction:
|
|
64
|
-
note:
|
|
65
|
-
tenantScope:
|
|
61
|
+
logo: v,
|
|
62
|
+
description: R,
|
|
63
|
+
introduction: L,
|
|
64
|
+
note: y,
|
|
65
|
+
tenantScope: r,
|
|
66
66
|
mode: w,
|
|
67
67
|
resourcesParams: h,
|
|
68
|
-
resources:
|
|
69
|
-
components:
|
|
70
|
-
resourcesTitle:
|
|
71
|
-
componentsTitle:
|
|
72
|
-
dependentComponentsMode:
|
|
68
|
+
resources: P,
|
|
69
|
+
components: B,
|
|
70
|
+
resourcesTitle: S,
|
|
71
|
+
componentsTitle: D,
|
|
72
|
+
dependentComponentsMode: k
|
|
73
73
|
}
|
|
74
74
|
);
|
|
75
|
-
return /* @__PURE__ */
|
|
75
|
+
return /* @__PURE__ */ I(
|
|
76
76
|
"iframe",
|
|
77
77
|
{
|
|
78
|
-
src:
|
|
78
|
+
src: F,
|
|
79
79
|
title: "Blocklet Studio",
|
|
80
80
|
style: {
|
|
81
81
|
position: "fixed",
|
|
@@ -83,18 +83,18 @@ function G({
|
|
|
83
83
|
left: 0,
|
|
84
84
|
width: "100vw",
|
|
85
85
|
height: "100vh",
|
|
86
|
-
zIndex:
|
|
86
|
+
zIndex: _,
|
|
87
87
|
border: 0,
|
|
88
88
|
padding: 0,
|
|
89
89
|
margin: 0,
|
|
90
|
-
pointerEvents:
|
|
91
|
-
opacity:
|
|
92
|
-
...
|
|
90
|
+
pointerEvents: a ? "auto" : "none",
|
|
91
|
+
opacity: a ? 1 : 0,
|
|
92
|
+
...U
|
|
93
93
|
},
|
|
94
|
-
...
|
|
94
|
+
...C
|
|
95
95
|
}
|
|
96
96
|
);
|
|
97
97
|
}
|
|
98
98
|
export {
|
|
99
|
-
|
|
99
|
+
z as default
|
|
100
100
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export { $ as default };
|
|
2
|
-
declare function $({ componentDid: a, resourceType: w, resourceDid: p, grantedRoles: L, autoClose: R, selectedMeta: D, storeUrl: E, onComplete: n, onClose: t, render:
|
|
2
|
+
declare function $({ componentDid: a, resourceType: w, resourceDid: p, grantedRoles: L, autoClose: R, selectedMeta: D, storeUrl: E, onComplete: n, onClose: t, render: d }: {
|
|
3
3
|
componentDid: any;
|
|
4
|
-
resourceType
|
|
5
|
-
resourceDid
|
|
4
|
+
resourceType?: undefined;
|
|
5
|
+
resourceDid?: undefined;
|
|
6
6
|
grantedRoles?: string[] | undefined;
|
|
7
7
|
autoClose?: boolean | undefined;
|
|
8
|
-
selectedMeta
|
|
9
|
-
storeUrl
|
|
8
|
+
selectedMeta?: undefined;
|
|
9
|
+
storeUrl?: undefined;
|
|
10
10
|
onComplete: any;
|
|
11
11
|
onClose: any;
|
|
12
|
-
render
|
|
12
|
+
render?: undefined;
|
|
13
13
|
}): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { use as
|
|
3
|
-
import
|
|
4
|
-
import { useLocaleContext as
|
|
5
|
-
import { BLOCKLET_SERVICE_PATH_PREFIX as
|
|
6
|
-
import { useMemoizedFn as r, useReactive as
|
|
7
|
-
import { translate as
|
|
8
|
-
import { withQuery as
|
|
9
|
-
import { SessionContext as
|
|
1
|
+
import { jsxs as y, Fragment as B, jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import { use as C, useRef as F, useEffect as I } from "react";
|
|
3
|
+
import S from "@arcblock/ux/lib/Button";
|
|
4
|
+
import { useLocaleContext as j } from "@arcblock/ux/lib/Locale/context";
|
|
5
|
+
import { BLOCKLET_SERVICE_PATH_PREFIX as P } from "@arcblock/ux/lib/Util/constant";
|
|
6
|
+
import { useMemoizedFn as r, useReactive as T } from "ahooks";
|
|
7
|
+
import { translate as U } from "@arcblock/ux/lib/Locale/util";
|
|
8
|
+
import { withQuery as _, joinURL as A } from "ufo";
|
|
9
|
+
import { SessionContext as M } from "@arcblock/did-connect/lib/Session";
|
|
10
10
|
import h from "@arcblock/ux/lib/Toast";
|
|
11
|
-
import
|
|
12
|
-
import { translations as
|
|
11
|
+
import O from "./resource-dialog.js";
|
|
12
|
+
import { translations as z } from "../libs/locales.js";
|
|
13
13
|
function $({
|
|
14
14
|
componentDid: a,
|
|
15
|
-
resourceType: w,
|
|
16
|
-
resourceDid: p,
|
|
15
|
+
resourceType: w = void 0,
|
|
16
|
+
resourceDid: p = void 0,
|
|
17
17
|
grantedRoles: L = ["admin", "owner"],
|
|
18
18
|
autoClose: R = !0,
|
|
19
|
-
selectedMeta: D,
|
|
20
|
-
storeUrl: E,
|
|
19
|
+
selectedMeta: D = void 0,
|
|
20
|
+
storeUrl: E = void 0,
|
|
21
21
|
onComplete: n,
|
|
22
22
|
onClose: t,
|
|
23
|
-
render:
|
|
23
|
+
render: d = void 0
|
|
24
24
|
}) {
|
|
25
|
-
const { session:
|
|
25
|
+
const { session: m } = C(M), { locale: x } = j(), i = r((o, s = {}) => U(z, o, x, "en", s)), l = F(null), e = T({
|
|
26
26
|
loading: !1,
|
|
27
27
|
showDialog: !1
|
|
28
|
-
}), b = A(
|
|
28
|
+
}), b = _(A(P, "embed/resources", a, "add"), {
|
|
29
29
|
resourceDid: p,
|
|
30
30
|
resourceType: w,
|
|
31
31
|
mode: "dialog",
|
|
@@ -33,33 +33,33 @@ function $({
|
|
|
33
33
|
showResourcesSwitch: "false",
|
|
34
34
|
enableRunBackground: "false",
|
|
35
35
|
showCategory: "false"
|
|
36
|
-
}),
|
|
36
|
+
}), v = r(() => {
|
|
37
37
|
e.showDialog = !1, t == null || t();
|
|
38
38
|
}), c = r(() => {
|
|
39
39
|
e.showDialog = !1, n == null || n();
|
|
40
40
|
}), f = r(() => {
|
|
41
41
|
var o;
|
|
42
|
-
if (!
|
|
42
|
+
if (!m.user) {
|
|
43
43
|
h.warning(i("needLogin"));
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
|
-
if (!L.includes((o =
|
|
46
|
+
if (!L.includes((o = m.user) == null ? void 0 : o.role)) {
|
|
47
47
|
h.warning(i("noPermission"));
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
50
|
e.loading = !0, e.showDialog = !0;
|
|
51
|
-
}),
|
|
51
|
+
}), k = r(() => {
|
|
52
52
|
var o;
|
|
53
53
|
e.loading = !1, l.current && ((o = l.current) == null || o.selectBlocklet(D));
|
|
54
54
|
}), u = r((o) => {
|
|
55
55
|
var s;
|
|
56
56
|
((s = o == null ? void 0 : o.data) == null ? void 0 : s.event) === "component.installed" && o.data.componentDid === a && (R || o.data.manual) && c();
|
|
57
57
|
});
|
|
58
|
-
return
|
|
58
|
+
return I(() => {
|
|
59
59
|
e.showDialog ? window.addEventListener("message", u) : window.removeEventListener("message", u);
|
|
60
|
-
}, [e.showDialog]), /* @__PURE__ */ B
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
}, [e.showDialog]), /* @__PURE__ */ y(B, { children: [
|
|
61
|
+
d ? d({ onClick: f, loading: e.loading }) : /* @__PURE__ */ g(
|
|
62
|
+
S,
|
|
63
63
|
{
|
|
64
64
|
variant: "outlined",
|
|
65
65
|
color: "secondary",
|
|
@@ -73,7 +73,7 @@ function $({
|
|
|
73
73
|
"button"
|
|
74
74
|
),
|
|
75
75
|
e.showDialog && /* @__PURE__ */ g(
|
|
76
|
-
|
|
76
|
+
O,
|
|
77
77
|
{
|
|
78
78
|
ref: l,
|
|
79
79
|
src: b,
|
|
@@ -81,9 +81,9 @@ function $({
|
|
|
81
81
|
open: !0,
|
|
82
82
|
componentDid: a,
|
|
83
83
|
loading: e.loading,
|
|
84
|
-
onClose:
|
|
84
|
+
onClose: v,
|
|
85
85
|
onComplete: c,
|
|
86
|
-
onLoad:
|
|
86
|
+
onLoad: k
|
|
87
87
|
}
|
|
88
88
|
)
|
|
89
89
|
] });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { H as default };
|
|
2
|
-
declare function H({ componentDid: s, grantedRoles:
|
|
2
|
+
declare function H({ componentDid: s, grantedRoles: i, onClose: n, render: a }: {
|
|
3
3
|
componentDid: any;
|
|
4
|
-
grantedRoles
|
|
4
|
+
grantedRoles?: undefined;
|
|
5
5
|
onClose: any;
|
|
6
|
-
render
|
|
6
|
+
render?: undefined;
|
|
7
7
|
}): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
|
|
@@ -2,33 +2,33 @@ import { jsxs as x, Fragment as b, jsx as u } from "react/jsx-runtime";
|
|
|
2
2
|
import { use as w } from "react";
|
|
3
3
|
import L from "@arcblock/ux/lib/Button";
|
|
4
4
|
import { useLocaleContext as C } from "@arcblock/ux/lib/Locale/context";
|
|
5
|
-
import { BLOCKLET_SERVICE_PATH_PREFIX as
|
|
6
|
-
import { useMemoizedFn as
|
|
7
|
-
import { translate as
|
|
8
|
-
import { SessionContext as
|
|
5
|
+
import { BLOCKLET_SERVICE_PATH_PREFIX as v } from "@arcblock/ux/lib/Util/constant";
|
|
6
|
+
import { useMemoizedFn as t, useReactive as D } from "ahooks";
|
|
7
|
+
import { translate as E } from "@arcblock/ux/lib/Locale/util";
|
|
8
|
+
import { SessionContext as P } from "@arcblock/did-connect/lib/Session";
|
|
9
9
|
import c from "@arcblock/ux/lib/Toast";
|
|
10
|
-
import
|
|
11
|
-
import { translations as
|
|
10
|
+
import F from "./resource-dialog.js";
|
|
11
|
+
import { translations as S } from "../libs/locales.js";
|
|
12
12
|
function H({
|
|
13
13
|
componentDid: s,
|
|
14
|
-
grantedRoles:
|
|
15
|
-
onClose:
|
|
16
|
-
render: a
|
|
14
|
+
grantedRoles: i = void 0,
|
|
15
|
+
onClose: n,
|
|
16
|
+
render: a = void 0
|
|
17
17
|
}) {
|
|
18
|
-
const { session: l } = w(
|
|
18
|
+
const { session: l } = w(P), { locale: f } = C(), e = t((r, h = {}) => E(S, r, f, "en", h)), o = D({
|
|
19
19
|
showDialog: !1,
|
|
20
20
|
loading: !1
|
|
21
|
-
}),
|
|
22
|
-
o.showDialog = !1,
|
|
23
|
-
}), g =
|
|
21
|
+
}), d = `${v}/embed/resources/${s}/publish?mode=dialog`, p = t(() => {
|
|
22
|
+
o.showDialog = !1, n == null || n();
|
|
23
|
+
}), g = t(() => {
|
|
24
24
|
o.loading = !1;
|
|
25
|
-
}), m =
|
|
26
|
-
var
|
|
25
|
+
}), m = t(() => {
|
|
26
|
+
var r;
|
|
27
27
|
if (!l.user) {
|
|
28
28
|
c.warning(e("needLogin"));
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
if (
|
|
31
|
+
if (i && i.length > 0 && !(i != null && i.includes((r = l.user) == null ? void 0 : r.role))) {
|
|
32
32
|
c.warning(e("noPermission"));
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
@@ -50,11 +50,11 @@ function H({
|
|
|
50
50
|
"button"
|
|
51
51
|
),
|
|
52
52
|
o.showDialog && /* @__PURE__ */ u(
|
|
53
|
-
|
|
53
|
+
F,
|
|
54
54
|
{
|
|
55
|
-
src:
|
|
55
|
+
src: d,
|
|
56
56
|
open: !0,
|
|
57
|
-
onClose:
|
|
57
|
+
onClose: p,
|
|
58
58
|
onLoad: g,
|
|
59
59
|
componentDid: s,
|
|
60
60
|
loading: o.loading
|
|
@@ -4,7 +4,7 @@ declare const I: import('react').ForwardRefExoticComponent<{
|
|
|
4
4
|
open?: boolean | undefined;
|
|
5
5
|
componentDid: any;
|
|
6
6
|
loading?: boolean | undefined;
|
|
7
|
-
storeUrl
|
|
7
|
+
storeUrl?: string | undefined;
|
|
8
8
|
onClose?: (() => void) | undefined;
|
|
9
9
|
onComplete?: (() => void) | undefined;
|
|
10
10
|
onLoad?: (() => void) | undefined;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { default as n } from 'prop-types';
|
|
2
2
|
export { _ as default };
|
|
3
|
-
declare function _(a
|
|
3
|
+
declare function _({ ...a }: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
}): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
|
|
4
6
|
declare namespace _ {
|
|
5
7
|
namespace propTypes {
|
|
6
8
|
let brand: n.Requireable<n.InferProps<{
|
|
@@ -4,7 +4,7 @@ declare function g({ elements: e, data: s, className: p, ...c }: {
|
|
|
4
4
|
[x: string]: any;
|
|
5
5
|
elements: any;
|
|
6
6
|
data: any;
|
|
7
|
-
className
|
|
7
|
+
className?: string | undefined;
|
|
8
8
|
}): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
|
|
9
9
|
declare namespace g {
|
|
10
10
|
namespace propTypes {
|
|
@@ -4,7 +4,7 @@ import x from "clsx";
|
|
|
4
4
|
import { Container as t, Box as r } from "@mui/material";
|
|
5
5
|
import { styled as f } from "@arcblock/ux/lib/Theme";
|
|
6
6
|
import h from "./row.js";
|
|
7
|
-
function g({ elements: e, data: s, className: p, ...c }) {
|
|
7
|
+
function g({ elements: e, data: s, className: p = "", ...c }) {
|
|
8
8
|
var l;
|
|
9
9
|
const d = !!((l = s.navigation) != null && l.length);
|
|
10
10
|
let a = null;
|
package/lib/Footer/links.d.ts
CHANGED
package/lib/Footer/links.js
CHANGED
|
@@ -77,7 +77,7 @@ function F({ links: e = [], flowLayout: d = !1, columns: u, ...k }) {
|
|
|
77
77
|
);
|
|
78
78
|
}) : null, [e, d, x, g]);
|
|
79
79
|
return e != null && e.length ? /* @__PURE__ */ n(
|
|
80
|
-
|
|
80
|
+
R,
|
|
81
81
|
{
|
|
82
82
|
...k,
|
|
83
83
|
className: c(k.className, {
|
|
@@ -101,9 +101,9 @@ F.propTypes = {
|
|
|
101
101
|
// 流动布局, 简单的从左到右排列
|
|
102
102
|
flowLayout: l.bool,
|
|
103
103
|
// 列布局
|
|
104
|
-
columns: l.number
|
|
104
|
+
columns: l.number.isRequired
|
|
105
105
|
};
|
|
106
|
-
const
|
|
106
|
+
const R = z("div")`
|
|
107
107
|
overflow: hidden;
|
|
108
108
|
color: ${({ theme: e }) => e.palette.text.secondary};
|
|
109
109
|
.footer-links-inner {
|
package/lib/Header/index.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ export { No as default };
|
|
|
2
2
|
declare const No: import('react').ComponentType<{
|
|
3
3
|
[x: string]: any;
|
|
4
4
|
meta?: {} | undefined;
|
|
5
|
-
addons
|
|
5
|
+
addons?: undefined;
|
|
6
6
|
sessionManagerProps?: {
|
|
7
7
|
showRole: boolean;
|
|
8
8
|
} | undefined;
|
|
9
9
|
homeLink?: any;
|
|
10
|
-
theme
|
|
10
|
+
theme?: undefined;
|
|
11
11
|
hideNavMenu?: boolean | undefined;
|
|
12
12
|
showDomainWarningDialog?: boolean | undefined;
|
|
13
13
|
}>;
|
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
|
@@ -2,6 +2,6 @@ export { M as default };
|
|
|
2
2
|
declare function M({ icon: r, size: t, sx: i, ...a }: {
|
|
3
3
|
[x: string]: any;
|
|
4
4
|
icon: any;
|
|
5
|
-
size
|
|
6
|
-
sx
|
|
5
|
+
size?: undefined;
|
|
6
|
+
sx?: {} | undefined;
|
|
7
7
|
}): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | null;
|