@blocklet/ui-react 2.9.91 → 2.10.1
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/build.config.ts +1 -6
- package/lib/@types/index.d.ts +1 -0
- package/lib/@types/index.js +0 -1
- package/lib/BlockletStudio/index.js +50 -50
- package/lib/ComponentInstaller/index.js +122 -202
- package/lib/ComponentInstaller/installer-item.js +116 -138
- package/lib/ComponentInstaller/locales.js +5 -10
- package/lib/ComponentInstaller/use-component-installed.js +37 -41
- package/lib/ComponentManager/components/add-component.js +58 -67
- package/lib/ComponentManager/components/check-component.js +2 -9
- package/lib/ComponentManager/components/publish-component.js +50 -59
- package/lib/ComponentManager/components/resource-dialog.js +42 -39
- package/lib/ComponentManager/index.js +3 -27
- package/lib/ComponentManager/libs/locales.js +2 -8
- package/lib/Dashboard/index.js +74 -99
- package/lib/Footer/brand.js +21 -43
- package/lib/Footer/copyright.js +15 -24
- package/lib/Footer/index.js +47 -71
- package/lib/Footer/internal-footer.js +72 -100
- package/lib/Footer/layout/plain.js +26 -45
- package/lib/Footer/layout/row.js +12 -29
- package/lib/Footer/layout/standard.js +34 -64
- package/lib/Footer/links.js +74 -104
- package/lib/Footer/social-media.js +35 -42
- package/lib/Header/index.js +69 -117
- package/lib/Icon/index.js +18 -53
- package/{es/UserCenter/components/notification.d.ts → lib/UserCenter/components/config-profile.d.ts} +1 -1
- package/lib/UserCenter/components/config-profile.js +67 -0
- package/lib/UserCenter/components/notification.js +203 -186
- package/lib/UserCenter/components/passport.js +70 -79
- package/lib/UserCenter/components/privacy.js +86 -88
- package/lib/UserCenter/components/settings.js +74 -84
- package/lib/UserCenter/components/storage/connect-to.js +56 -75
- package/lib/UserCenter/components/storage/connected.js +16 -37
- package/lib/UserCenter/components/storage/delete.js +42 -51
- package/lib/UserCenter/components/storage/disconnect.js +15 -29
- package/lib/UserCenter/components/storage/index.js +20 -54
- package/lib/UserCenter/components/storage/item.js +94 -122
- package/lib/UserCenter/components/storage/preview-nft.js +77 -85
- package/lib/UserCenter/components/third-party-login/index.js +49 -61
- package/lib/UserCenter/components/third-party-login/third-party-item.js +159 -176
- package/lib/UserCenter/components/user-center.js +276 -287
- package/lib/UserCenter/components/user-info/index.js +3 -27
- package/lib/UserCenter/components/user-info/user-basic-info.js +134 -129
- package/lib/UserCenter/components/user-info/user-info-item.js +43 -37
- package/lib/UserCenter/components/user-info/user-info.js +41 -74
- package/lib/UserCenter/components/webhook-item.js +184 -177
- package/lib/UserCenter/index.js +1 -13
- package/lib/UserCenter/libs/api.js +4 -16
- package/lib/UserCenter/libs/locales.d.ts +10 -0
- package/lib/UserCenter/libs/locales.js +12 -8
- package/lib/UserCenter/libs/utils.js +7 -17
- package/lib/UserSessions/components/user-session-info.js +88 -85
- package/lib/UserSessions/components/user-sessions.js +177 -213
- package/lib/UserSessions/index.js +1 -13
- package/lib/UserSessions/libs/locales.js +2 -8
- package/lib/UserSessions/libs/utils.js +4 -11
- package/lib/blocklets.js +59 -63
- package/lib/common/header-addons.js +44 -60
- package/lib/common/link-blocker.js +9 -18
- package/lib/common/overridable-theme-provider.js +10 -23
- package/lib/common/wallet-hidden-topbar.js +7 -14
- package/lib/contexts/config-user-space.js +38 -46
- package/lib/hooks/use-mobile.js +5 -13
- package/lib/index.js +10 -100
- package/lib/libs/client.js +2 -8
- package/lib/libs/spaces.js +6 -13
- package/lib/types.js +39 -41
- package/lib/utils.js +25 -44
- package/package.json +8 -38
- package/src/@types/index.ts +1 -0
- package/src/Footer/brand.jsx +6 -1
- package/src/UserCenter/components/config-profile.tsx +70 -0
- package/src/UserCenter/components/notification.tsx +63 -47
- package/src/UserCenter/components/settings.tsx +6 -0
- package/src/UserCenter/libs/locales.ts +10 -0
- package/es/@types/index.d.ts +0 -101
- package/es/@types/index.js +0 -0
- package/es/@types/shims.d.ts +0 -16
- package/es/BlockletStudio/index.d.ts +0 -28
- package/es/BlockletStudio/index.js +0 -114
- package/es/ComponentInstaller/index.d.ts +0 -37
- package/es/ComponentInstaller/index.js +0 -200
- package/es/ComponentInstaller/installer-item.d.ts +0 -21
- package/es/ComponentInstaller/installer-item.js +0 -139
- package/es/ComponentInstaller/locales.d.ts +0 -28
- package/es/ComponentInstaller/locales.js +0 -22
- package/es/ComponentInstaller/use-component-installed.d.ts +0 -12
- package/es/ComponentInstaller/use-component-installed.js +0 -88
- package/es/ComponentManager/components/add-component.d.ts +0 -16
- package/es/ComponentManager/components/add-component.js +0 -114
- package/es/ComponentManager/components/check-component.d.ts +0 -2
- package/es/ComponentManager/components/check-component.js +0 -2
- package/es/ComponentManager/components/publish-component.d.ts +0 -10
- package/es/ComponentManager/components/publish-component.js +0 -76
- package/es/ComponentManager/components/resource-dialog.d.ts +0 -14
- package/es/ComponentManager/components/resource-dialog.js +0 -74
- package/es/ComponentManager/index.d.ts +0 -3
- package/es/ComponentManager/index.js +0 -3
- package/es/ComponentManager/libs/locales.d.ts +0 -14
- package/es/ComponentManager/libs/locales.js +0 -14
- package/es/Dashboard/index.d.ts +0 -40
- package/es/Dashboard/index.js +0 -118
- package/es/Footer/brand.d.ts +0 -22
- package/es/Footer/brand.js +0 -73
- package/es/Footer/copyright.d.ts +0 -18
- package/es/Footer/copyright.js +0 -25
- package/es/Footer/index.d.ts +0 -6
- package/es/Footer/index.js +0 -82
- package/es/Footer/internal-footer.d.ts +0 -29
- package/es/Footer/internal-footer.js +0 -117
- package/es/Footer/layout/plain.d.ts +0 -15
- package/es/Footer/layout/plain.js +0 -39
- package/es/Footer/layout/row.d.ts +0 -18
- package/es/Footer/layout/row.js +0 -41
- package/es/Footer/layout/standard.d.ts +0 -15
- package/es/Footer/layout/standard.js +0 -53
- package/es/Footer/links.d.ts +0 -22
- package/es/Footer/links.js +0 -207
- package/es/Footer/social-media.d.ts +0 -14
- package/es/Footer/social-media.js +0 -60
- package/es/Header/index.d.ts +0 -10
- package/es/Header/index.js +0 -155
- package/es/Icon/index.d.ts +0 -23
- package/es/Icon/index.js +0 -55
- package/es/UserCenter/assets/banner.png +0 -0
- package/es/UserCenter/components/notification.js +0 -248
- package/es/UserCenter/components/passport.d.ts +0 -6
- package/es/UserCenter/components/passport.js +0 -88
- package/es/UserCenter/components/privacy.d.ts +0 -11
- package/es/UserCenter/components/privacy.js +0 -99
- package/es/UserCenter/components/settings.d.ts +0 -9
- package/es/UserCenter/components/settings.js +0 -89
- package/es/UserCenter/components/storage/connect-to.d.ts +0 -7
- package/es/UserCenter/components/storage/connect-to.js +0 -108
- package/es/UserCenter/components/storage/connected.d.ts +0 -7
- package/es/UserCenter/components/storage/connected.js +0 -24
- package/es/UserCenter/components/storage/delete.d.ts +0 -7
- package/es/UserCenter/components/storage/delete.js +0 -62
- package/es/UserCenter/components/storage/disconnect.d.ts +0 -3
- package/es/UserCenter/components/storage/disconnect.js +0 -23
- package/es/UserCenter/components/storage/icons/empty-spaces-nft.svg +0 -58
- package/es/UserCenter/components/storage/icons/long-arrow.svg +0 -5
- package/es/UserCenter/components/storage/icons/space-connected.svg +0 -3
- package/es/UserCenter/components/storage/icons/space-disconnect.svg +0 -3
- package/es/UserCenter/components/storage/index.d.ts +0 -3
- package/es/UserCenter/components/storage/index.js +0 -27
- package/es/UserCenter/components/storage/item.d.ts +0 -9
- package/es/UserCenter/components/storage/item.js +0 -158
- package/es/UserCenter/components/storage/preview-nft.d.ts +0 -6
- package/es/UserCenter/components/storage/preview-nft.js +0 -80
- package/es/UserCenter/components/third-party-login/index.d.ts +0 -5
- package/es/UserCenter/components/third-party-login/index.js +0 -110
- package/es/UserCenter/components/third-party-login/third-party-item.d.ts +0 -13
- package/es/UserCenter/components/third-party-login/third-party-item.js +0 -224
- package/es/UserCenter/components/user-center.d.ts +0 -15
- package/es/UserCenter/components/user-center.js +0 -414
- package/es/UserCenter/components/user-info/index.d.ts +0 -3
- package/es/UserCenter/components/user-info/index.js +0 -3
- package/es/UserCenter/components/user-info/user-basic-info.d.ts +0 -11
- package/es/UserCenter/components/user-info/user-basic-info.js +0 -151
- package/es/UserCenter/components/user-info/user-info-item.d.ts +0 -11
- package/es/UserCenter/components/user-info/user-info-item.js +0 -47
- package/es/UserCenter/components/user-info/user-info.d.ts +0 -6
- package/es/UserCenter/components/user-info/user-info.js +0 -66
- package/es/UserCenter/components/webhook-item.d.ts +0 -3
- package/es/UserCenter/components/webhook-item.js +0 -243
- package/es/UserCenter/index.d.ts +0 -1
- package/es/UserCenter/index.js +0 -1
- package/es/UserCenter/libs/api.d.ts +0 -3
- package/es/UserCenter/libs/api.js +0 -4
- package/es/UserCenter/libs/locales.d.ts +0 -162
- package/es/UserCenter/libs/locales.js +0 -162
- package/es/UserCenter/libs/utils.d.ts +0 -4
- package/es/UserCenter/libs/utils.js +0 -14
- package/es/UserSessions/components/user-session-info.d.ts +0 -6
- package/es/UserSessions/components/user-session-info.js +0 -92
- package/es/UserSessions/components/user-sessions.d.ts +0 -9
- package/es/UserSessions/components/user-sessions.js +0 -265
- package/es/UserSessions/index.d.ts +0 -1
- package/es/UserSessions/index.js +0 -1
- package/es/UserSessions/libs/locales.d.ts +0 -58
- package/es/UserSessions/libs/locales.js +0 -58
- package/es/UserSessions/libs/utils.d.ts +0 -2
- package/es/UserSessions/libs/utils.js +0 -73
- package/es/blocklets.d.ts +0 -16
- package/es/blocklets.js +0 -178
- package/es/common/header-addons.d.ts +0 -21
- package/es/common/header-addons.js +0 -83
- package/es/common/link-blocker.d.ts +0 -7
- package/es/common/link-blocker.js +0 -18
- package/es/common/overridable-theme-provider.d.ts +0 -18
- package/es/common/overridable-theme-provider.js +0 -15
- package/es/common/wallet-hidden-topbar.d.ts +0 -1
- package/es/common/wallet-hidden-topbar.js +0 -14
- package/es/contexts/config-user-space.d.ts +0 -26
- package/es/contexts/config-user-space.js +0 -53
- package/es/hooks/use-mobile.d.ts +0 -4
- package/es/hooks/use-mobile.js +0 -5
- package/es/index.d.ts +0 -10
- package/es/index.js +0 -10
- package/es/libs/client.d.ts +0 -2
- package/es/libs/client.js +0 -2
- package/es/libs/spaces.d.ts +0 -2
- package/es/libs/spaces.js +0 -13
- package/es/types.d.ts +0 -2
- package/es/types.js +0 -43
- package/es/utils.d.ts +0 -8
- package/es/utils.js +0 -78
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
|
-
import Box from "@mui/material/Box";
|
|
4
|
-
import Container from "@mui/material/Container";
|
|
5
|
-
import { styled } from "@arcblock/ux/lib/Theme";
|
|
6
|
-
import Row from "./row.js";
|
|
7
|
-
function StandardLayout({ elements, data, ...rest }) {
|
|
8
|
-
return /* @__PURE__ */ jsx(Root, { ...rest, children: /* @__PURE__ */ jsxs(Container, { children: [
|
|
9
|
-
/* @__PURE__ */ jsxs(
|
|
10
|
-
Box,
|
|
11
|
-
{
|
|
12
|
-
sx: {
|
|
13
|
-
display: "flex",
|
|
14
|
-
flexDirection: { xs: "column", md: "row" },
|
|
15
|
-
justifyContent: "space-between",
|
|
16
|
-
alignItems: { xs: "center", md: "space-between" },
|
|
17
|
-
gap: 2,
|
|
18
|
-
pb: 3
|
|
19
|
-
},
|
|
20
|
-
children: [
|
|
21
|
-
/* @__PURE__ */ jsx(Box, { children: elements.brand }),
|
|
22
|
-
/* @__PURE__ */ jsx(Box, { lineHeight: 1, children: elements.socialMedia })
|
|
23
|
-
]
|
|
24
|
-
}
|
|
25
|
-
),
|
|
26
|
-
!!data.navigation?.length && /* @__PURE__ */ jsx(Box, { sx: { mb: 6, pt: 3, borderTop: 1, borderColor: "grey.200" }, children: elements.navigation }),
|
|
27
|
-
/* @__PURE__ */ jsxs(Row, { sx: { pt: 3, borderTop: 1, borderColor: "grey.200" }, autoCenter: true, children: [
|
|
28
|
-
elements.copyright,
|
|
29
|
-
elements.links
|
|
30
|
-
] })
|
|
31
|
-
] }) });
|
|
32
|
-
}
|
|
33
|
-
StandardLayout.propTypes = {
|
|
34
|
-
elements: PropTypes.shape({
|
|
35
|
-
brand: PropTypes.element,
|
|
36
|
-
navigation: PropTypes.element,
|
|
37
|
-
socialMedia: PropTypes.element,
|
|
38
|
-
copyright: PropTypes.element,
|
|
39
|
-
links: PropTypes.element
|
|
40
|
-
}).isRequired,
|
|
41
|
-
data: PropTypes.object.isRequired
|
|
42
|
-
};
|
|
43
|
-
const Root = styled("div")`
|
|
44
|
-
padding: 32px 0 24px 0;
|
|
45
|
-
.footer-brand-name,
|
|
46
|
-
.footer-brand-desc {
|
|
47
|
-
display: none;
|
|
48
|
-
}
|
|
49
|
-
&& .footer-brand-logo {
|
|
50
|
-
margin-right: 0;
|
|
51
|
-
}
|
|
52
|
-
`;
|
|
53
|
-
export default StandardLayout;
|
package/es/Footer/links.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* footer 中的 links (支持分组, 最多支持 2 级)
|
|
3
|
-
* TODO: dark/light theme
|
|
4
|
-
*/
|
|
5
|
-
declare function Links({ links, flowLayout, ...rest }: {
|
|
6
|
-
[x: string]: any;
|
|
7
|
-
links: any;
|
|
8
|
-
flowLayout: any;
|
|
9
|
-
}): import("react").JSX.Element | null;
|
|
10
|
-
declare namespace Links {
|
|
11
|
-
namespace propTypes {
|
|
12
|
-
let links: any;
|
|
13
|
-
let flowLayout: any;
|
|
14
|
-
}
|
|
15
|
-
namespace defaultProps {
|
|
16
|
-
let links_1: never[];
|
|
17
|
-
export { links_1 as links };
|
|
18
|
-
let flowLayout_1: boolean;
|
|
19
|
-
export { flowLayout_1 as flowLayout };
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
export default Links;
|
package/es/Footer/links.js
DELETED
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import PropTypes from "prop-types";
|
|
4
|
-
import { styled } from "@arcblock/ux/lib/Theme";
|
|
5
|
-
import clsx from "clsx";
|
|
6
|
-
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
|
7
|
-
import Icon from "../Icon/index.js";
|
|
8
|
-
export default function Links({ links, flowLayout, ...rest }) {
|
|
9
|
-
const [activeIndex, setActiveIndex] = useState(-1);
|
|
10
|
-
if (!links?.length) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
const isGroupMode = links.some((item) => item.items?.length);
|
|
14
|
-
const renderItem = ({ label, link, icon, render, props }) => {
|
|
15
|
-
let result = label;
|
|
16
|
-
if (render) {
|
|
17
|
-
result = render({ label, link, props });
|
|
18
|
-
} else if (link) {
|
|
19
|
-
result = /* @__PURE__ */ jsx("a", { href: link, "aria-label": `Footer link for ${label}`, ...props, children: label });
|
|
20
|
-
}
|
|
21
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22
|
-
icon && /* @__PURE__ */ jsx(Icon, { icon, size: 20, sx: { mr: 0.5 } }),
|
|
23
|
-
result
|
|
24
|
-
] });
|
|
25
|
-
};
|
|
26
|
-
return /* @__PURE__ */ jsx(
|
|
27
|
-
Root,
|
|
28
|
-
{
|
|
29
|
-
...rest,
|
|
30
|
-
className: clsx(rest.className, {
|
|
31
|
-
"footer-links--grouped": isGroupMode,
|
|
32
|
-
"footer-links--flow": flowLayout
|
|
33
|
-
}),
|
|
34
|
-
children: /* @__PURE__ */ jsxs("div", { className: "footer-links-inner", children: [
|
|
35
|
-
flowLayout && links.map((item, i) => /* @__PURE__ */ jsx("span", { className: "footer-links-item", children: renderItem(item) }, i)),
|
|
36
|
-
!flowLayout && links.map((item, i) => {
|
|
37
|
-
const { items } = item;
|
|
38
|
-
const isActive = i === activeIndex;
|
|
39
|
-
return /* @__PURE__ */ jsxs(
|
|
40
|
-
"div",
|
|
41
|
-
{
|
|
42
|
-
className: clsx("footer-links-group", {
|
|
43
|
-
"footer-links-group--active": isActive
|
|
44
|
-
}),
|
|
45
|
-
onClick: () => setActiveIndex(activeIndex === i ? -1 : i),
|
|
46
|
-
children: [
|
|
47
|
-
/* @__PURE__ */ jsxs("span", { className: "footer-links-item", children: [
|
|
48
|
-
renderItem(item),
|
|
49
|
-
!!items?.length && /* @__PURE__ */ jsx("span", { className: "footer-links-group-expand-icon", children: /* @__PURE__ */ jsx(
|
|
50
|
-
ExpandMoreIcon,
|
|
51
|
-
{
|
|
52
|
-
style: {
|
|
53
|
-
transform: `rotate(${isActive ? 180 : 0}deg)`
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
) })
|
|
57
|
-
] }),
|
|
58
|
-
!!items?.length && /* @__PURE__ */ jsx("div", { className: "footer-links-sub", children: items.map((child, j) => /* @__PURE__ */ jsx("span", { className: "footer-links-item", children: renderItem(child) }, j)) })
|
|
59
|
-
]
|
|
60
|
-
},
|
|
61
|
-
i
|
|
62
|
-
);
|
|
63
|
-
})
|
|
64
|
-
] })
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
Links.propTypes = {
|
|
69
|
-
links: PropTypes.arrayOf(
|
|
70
|
-
PropTypes.shape({
|
|
71
|
-
label: PropTypes.string,
|
|
72
|
-
link: PropTypes.string,
|
|
73
|
-
render: PropTypes.func,
|
|
74
|
-
props: PropTypes.object
|
|
75
|
-
})
|
|
76
|
-
),
|
|
77
|
-
// 流动布局, 简单的从左到右排列
|
|
78
|
-
flowLayout: PropTypes.bool
|
|
79
|
-
};
|
|
80
|
-
Links.defaultProps = {
|
|
81
|
-
links: [],
|
|
82
|
-
flowLayout: false
|
|
83
|
-
};
|
|
84
|
-
const Root = styled("div")`
|
|
85
|
-
overflow: hidden;
|
|
86
|
-
color: ${(props) => props.theme.palette.grey[600]};
|
|
87
|
-
.footer-links-inner {
|
|
88
|
-
display: flex;
|
|
89
|
-
justify-content: space-between;
|
|
90
|
-
margin: 0 -8px;
|
|
91
|
-
}
|
|
92
|
-
.footer-links-group,
|
|
93
|
-
.footer-links-sub {
|
|
94
|
-
display: flex;
|
|
95
|
-
flex-direction: column;
|
|
96
|
-
}
|
|
97
|
-
.footer-links-sub .footer-links-item {
|
|
98
|
-
color: ${(props) => props.theme.palette.grey[900]};
|
|
99
|
-
}
|
|
100
|
-
.footer-links-group-expand-icon {
|
|
101
|
-
display: none;
|
|
102
|
-
position: absolute;
|
|
103
|
-
right: 16px;
|
|
104
|
-
top: 50%;
|
|
105
|
-
transform: translate(0, -50%);
|
|
106
|
-
line-height: 1;
|
|
107
|
-
svg {
|
|
108
|
-
width: auto;
|
|
109
|
-
height: 0.75em;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
.footer-links-item {
|
|
113
|
-
display: inline-flex;
|
|
114
|
-
align-items: center;
|
|
115
|
-
position: relative;
|
|
116
|
-
padding: 4px 8px;
|
|
117
|
-
font-size: 14px;
|
|
118
|
-
}
|
|
119
|
-
&.footer-links--grouped {
|
|
120
|
-
.footer-links-group {
|
|
121
|
-
> .footer-links-item {
|
|
122
|
-
font-weight: bold;
|
|
123
|
-
}
|
|
124
|
-
.footer-links-sub {
|
|
125
|
-
margin-top: 8px;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
a {
|
|
130
|
-
display: inline-block;
|
|
131
|
-
max-width: 150px;
|
|
132
|
-
color: inherit;
|
|
133
|
-
text-decoration: none;
|
|
134
|
-
&:hover {
|
|
135
|
-
text-decoration: underline;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
&.footer-links--flow {
|
|
140
|
-
display: inline-flex;
|
|
141
|
-
.footer-links-inner {
|
|
142
|
-
justify-content: center;
|
|
143
|
-
flex-wrap: wrap;
|
|
144
|
-
margin: 0 -8px;
|
|
145
|
-
.footer-links-item {
|
|
146
|
-
padding: 0 8px;
|
|
147
|
-
}
|
|
148
|
-
.footer-links-item + .footer-links-item::before {
|
|
149
|
-
content: '';
|
|
150
|
-
position: absolute;
|
|
151
|
-
left: 0;
|
|
152
|
-
top: 50%;
|
|
153
|
-
transform: translate(0, -50%);
|
|
154
|
-
height: 1em;
|
|
155
|
-
border-left: 1px solid ${(props) => props.theme.palette.grey[400]};
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
${(props) => props.theme.breakpoints.down("md")} {
|
|
161
|
-
.footer-links-inner {
|
|
162
|
-
flex-direction: column;
|
|
163
|
-
margin: 0;
|
|
164
|
-
}
|
|
165
|
-
.footer-links-sub {
|
|
166
|
-
display: none;
|
|
167
|
-
}
|
|
168
|
-
.footer-links-group {
|
|
169
|
-
position: relative;
|
|
170
|
-
padding: 12px 0;
|
|
171
|
-
.footer-links-item .footer-links-group-expand-icon {
|
|
172
|
-
display: inline-block;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
.footer-links-group + .footer-links-group {
|
|
176
|
-
border-top: 1px solid ${(props) => props.theme.palette.grey[200]};
|
|
177
|
-
}
|
|
178
|
-
.footer-links-group--active {
|
|
179
|
-
.footer-links-sub {
|
|
180
|
-
display: flex;
|
|
181
|
-
flex-direction: row;
|
|
182
|
-
flex-wrap: wrap;
|
|
183
|
-
.footer-links-item {
|
|
184
|
-
flex: 0 0 50%;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
.footer-links-item {
|
|
189
|
-
padding-left: 0;
|
|
190
|
-
padding-right: 0;
|
|
191
|
-
font-size: 13px;
|
|
192
|
-
}
|
|
193
|
-
&.footer-links--grouped {
|
|
194
|
-
.footer-links-group {
|
|
195
|
-
> .footer-links-item {
|
|
196
|
-
font-size: 14px;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
&.footer-links--flow {
|
|
202
|
-
.footer-links-inner {
|
|
203
|
-
flex-direction: row;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
`;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
declare function SocialMedia({ items, ...rest }: {
|
|
2
|
-
[x: string]: any;
|
|
3
|
-
items: any;
|
|
4
|
-
}): import("react").JSX.Element | null;
|
|
5
|
-
declare namespace SocialMedia {
|
|
6
|
-
namespace propTypes {
|
|
7
|
-
let items: any;
|
|
8
|
-
}
|
|
9
|
-
namespace defaultProps {
|
|
10
|
-
let items_1: null;
|
|
11
|
-
export { items_1 as items };
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export default SocialMedia;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
|
-
import { useTheme, styled } from "@arcblock/ux/lib/Theme";
|
|
4
|
-
import Icon from "../Icon/index.js";
|
|
5
|
-
export default function SocialMedia({ items, ...rest }) {
|
|
6
|
-
const theme = useTheme();
|
|
7
|
-
if (!items?.length) {
|
|
8
|
-
return null;
|
|
9
|
-
}
|
|
10
|
-
return /* @__PURE__ */ jsx(Root, { ...rest, children: items.map((item, i) => {
|
|
11
|
-
return /* @__PURE__ */ jsx(
|
|
12
|
-
"a",
|
|
13
|
-
{
|
|
14
|
-
href: item.link,
|
|
15
|
-
target: "_blank",
|
|
16
|
-
"aria-label": `Social media icon${item.title ? ` for ${item.title}` : ""}`,
|
|
17
|
-
rel: "noreferrer",
|
|
18
|
-
children: /* @__PURE__ */ jsx(
|
|
19
|
-
Icon,
|
|
20
|
-
{
|
|
21
|
-
icon: item.icon || item.title,
|
|
22
|
-
sx: { bgcolor: theme.palette.grey[600], color: "#fff" },
|
|
23
|
-
size: 24,
|
|
24
|
-
component: "span"
|
|
25
|
-
}
|
|
26
|
-
)
|
|
27
|
-
},
|
|
28
|
-
i
|
|
29
|
-
);
|
|
30
|
-
}) });
|
|
31
|
-
}
|
|
32
|
-
SocialMedia.propTypes = {
|
|
33
|
-
items: PropTypes.arrayOf(
|
|
34
|
-
PropTypes.shape({
|
|
35
|
-
// icon 对应 Icon#icon prop, 支持 iconify name 和 url 2 种形式:
|
|
36
|
-
icon: PropTypes.string,
|
|
37
|
-
link: PropTypes.string
|
|
38
|
-
})
|
|
39
|
-
)
|
|
40
|
-
};
|
|
41
|
-
SocialMedia.defaultProps = {
|
|
42
|
-
items: null
|
|
43
|
-
};
|
|
44
|
-
const Root = styled("div")`
|
|
45
|
-
display: inline-flex;
|
|
46
|
-
flex-wrap: wrap;
|
|
47
|
-
align-items: center;
|
|
48
|
-
justify-content: center;
|
|
49
|
-
gap: 20px;
|
|
50
|
-
a {
|
|
51
|
-
color: ${(props) => props.theme.palette.grey[400]};
|
|
52
|
-
text-decoration: none;
|
|
53
|
-
&:hover {
|
|
54
|
-
color: ${(props) => props.theme.palette.primary.light};
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
${(props) => props.theme.breakpoints.down("md")} {
|
|
58
|
-
gap: 12px;
|
|
59
|
-
}
|
|
60
|
-
`;
|
package/es/Header/index.d.ts
DELETED
package/es/Header/index.js
DELETED
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from "react";
|
|
3
|
-
import PropTypes from "prop-types";
|
|
4
|
-
import { withErrorBoundary } from "react-error-boundary";
|
|
5
|
-
import { ErrorFallback } from "@arcblock/ux/lib/ErrorBoundary";
|
|
6
|
-
import { styled } from "@arcblock/ux/lib/Theme";
|
|
7
|
-
import { ResponsiveHeader } from "@arcblock/ux/lib/Header";
|
|
8
|
-
import NavMenu from "@arcblock/ux/lib/NavMenu";
|
|
9
|
-
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
10
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
11
|
-
import omit from "lodash/omit";
|
|
12
|
-
import Icon from "../Icon/index.js";
|
|
13
|
-
import OverridableThemeProvider from "../common/overridable-theme-provider.js";
|
|
14
|
-
import { BlockletMetaProps, SessionManagerProps } from "../types.js";
|
|
15
|
-
import { mapRecursive, flatRecursive, matchPaths } from "../utils.js";
|
|
16
|
-
import { publicPath, formatBlockletInfo, getLocalizedNavigation } from "../blocklets.js";
|
|
17
|
-
import HeaderAddons from "../common/header-addons.js";
|
|
18
|
-
import { useWalletHiddenTopbar } from "../common/wallet-hidden-topbar.js";
|
|
19
|
-
const parseNavigation = (navigation) => {
|
|
20
|
-
if (!navigation?.length) {
|
|
21
|
-
return { navItems: [], activeId: null };
|
|
22
|
-
}
|
|
23
|
-
let counter = 1;
|
|
24
|
-
const parseItem = (item) => {
|
|
25
|
-
const icon = item.icon ? /* @__PURE__ */ jsx(Icon, { icon: item.icon }) : null;
|
|
26
|
-
if (item.items) {
|
|
27
|
-
return {
|
|
28
|
-
id: `${counter++}`,
|
|
29
|
-
label: item.title,
|
|
30
|
-
icon,
|
|
31
|
-
children: item.items
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
let props = {};
|
|
35
|
-
if (item.link?.startsWith("http://") || item.link?.startsWith("https://")) {
|
|
36
|
-
props = {
|
|
37
|
-
target: "_blank",
|
|
38
|
-
rel: "noreferrer"
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
return {
|
|
42
|
-
id: `${counter++}`,
|
|
43
|
-
label: /* @__PURE__ */ jsx("a", { href: item.link, ...props, children: item.title }),
|
|
44
|
-
icon,
|
|
45
|
-
link: item.link
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
const navItems = mapRecursive(navigation, parseItem, "items");
|
|
49
|
-
const flattened = flatRecursive(navItems);
|
|
50
|
-
const matchedIndex = matchPaths(flattened.map((item) => item.link));
|
|
51
|
-
return { navItems, activeId: matchedIndex >= 0 ? flattened[matchedIndex].id : null };
|
|
52
|
-
};
|
|
53
|
-
function Header({ meta, addons, sessionManagerProps, homeLink, theme: themeOverrides, hideNavMenu, ...rest }) {
|
|
54
|
-
useWalletHiddenTopbar();
|
|
55
|
-
const { locale } = useLocaleContext() || {};
|
|
56
|
-
const formattedBlocklet = useMemo(() => {
|
|
57
|
-
const blocklet = Object.assign({}, window.blocklet, meta);
|
|
58
|
-
try {
|
|
59
|
-
return formatBlockletInfo(blocklet);
|
|
60
|
-
} catch (e) {
|
|
61
|
-
console.error("Failed to format blocklet info", e, blocklet);
|
|
62
|
-
return blocklet;
|
|
63
|
-
}
|
|
64
|
-
}, [meta]);
|
|
65
|
-
if (!formattedBlocklet.appName) {
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
const { appLogo, appLogoRect, theme } = formattedBlocklet;
|
|
69
|
-
const navigation = getLocalizedNavigation(formattedBlocklet?.navigation?.header, locale);
|
|
70
|
-
const parsedNavigation = parseNavigation(navigation);
|
|
71
|
-
const { navItems, activeId } = parsedNavigation;
|
|
72
|
-
const _addons = typeof addons === "function" ? (builtInAddons) => addons(builtInAddons, { navigation: parsedNavigation }) : addons;
|
|
73
|
-
const headerAddons = /* @__PURE__ */ jsx(HeaderAddons, { formattedBlocklet, addons: _addons, sessionManagerProps });
|
|
74
|
-
return /* @__PURE__ */ jsx(OverridableThemeProvider, { theme: themeOverrides, children: /* @__PURE__ */ jsx(
|
|
75
|
-
StyledUxHeader,
|
|
76
|
-
{
|
|
77
|
-
homeLink,
|
|
78
|
-
logo: /* @__PURE__ */ jsx("img", { src: appLogoRect || appLogo, alt: "logo" }),
|
|
79
|
-
addons: headerAddons,
|
|
80
|
-
...omit(rest, ["bordered"]),
|
|
81
|
-
$bordered: rest?.bordered,
|
|
82
|
-
$bgcolor: theme?.background?.header,
|
|
83
|
-
children: hideNavMenu || !navItems?.length ? null : ({ isMobile }) => /* @__PURE__ */ jsx(
|
|
84
|
-
NavMenu,
|
|
85
|
-
{
|
|
86
|
-
mode: isMobile ? "inline" : "horizontal",
|
|
87
|
-
activeId,
|
|
88
|
-
items: navItems,
|
|
89
|
-
className: "header-nav",
|
|
90
|
-
bgColor: "transparent",
|
|
91
|
-
textColor: "#777"
|
|
92
|
-
}
|
|
93
|
-
)
|
|
94
|
-
}
|
|
95
|
-
) });
|
|
96
|
-
}
|
|
97
|
-
Header.propTypes = {
|
|
98
|
-
meta: BlockletMetaProps,
|
|
99
|
-
// 需要考虑 定制的 addons 与内置的 连接钱包/选择语言 addons 共存的情况
|
|
100
|
-
// - PropTypes.func: 可以把自定义 addons 插在 session-manager 或 locale-selector (如果存在的话) 前/中/后
|
|
101
|
-
// - PropTypes.node: 将 addons 原样传给 UX Header 组件
|
|
102
|
-
addons: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
|
103
|
-
sessionManagerProps: SessionManagerProps,
|
|
104
|
-
homeLink: PropTypes.string,
|
|
105
|
-
// 允许覆盖 header 内置的 theme
|
|
106
|
-
theme: PropTypes.object,
|
|
107
|
-
hideNavMenu: PropTypes.bool
|
|
108
|
-
};
|
|
109
|
-
Header.defaultProps = {
|
|
110
|
-
meta: {},
|
|
111
|
-
addons: null,
|
|
112
|
-
sessionManagerProps: {
|
|
113
|
-
showRole: true
|
|
114
|
-
},
|
|
115
|
-
homeLink: publicPath,
|
|
116
|
-
theme: null,
|
|
117
|
-
hideNavMenu: false
|
|
118
|
-
};
|
|
119
|
-
const StyledUxHeader = styled(ResponsiveHeader)`
|
|
120
|
-
${({ $bgcolor }) => `background-color: ${$bgcolor || "#fff"};`}
|
|
121
|
-
font-family: Inter, Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif,
|
|
122
|
-
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
123
|
-
.header-logo {
|
|
124
|
-
min-width: 44px;
|
|
125
|
-
}
|
|
126
|
-
${({ $bordered }) => $bordered ? `border-bottom: 1px solid ${colors.strokeSep};` : ""}
|
|
127
|
-
${(props) => props.theme.breakpoints.down("md")} {
|
|
128
|
-
.header-logo {
|
|
129
|
-
min-width: 32px;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
.header-nav {
|
|
133
|
-
.navmenu-sub .navmenu-item {
|
|
134
|
-
min-width: 80px;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
.header-nav.navmenu--horizontal {
|
|
138
|
-
.navmenu-root > .navmenu-sub,
|
|
139
|
-
.navmenu-root > .navmenu-item {
|
|
140
|
-
padding: 16px 4px;
|
|
141
|
-
|
|
142
|
-
.navmenu-sub-container {
|
|
143
|
-
padding-top: 0;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
.navmenu-item-icon > .MuiAvatar-root,
|
|
147
|
-
.navmenu-sub-icon > .MuiAvatar-root {
|
|
148
|
-
width: 20px;
|
|
149
|
-
height: 20px;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
`;
|
|
153
|
-
export default withErrorBoundary(Header, {
|
|
154
|
-
FallbackComponent: ErrorFallback
|
|
155
|
-
});
|
package/es/Icon/index.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Icon 组件, 基于 mui Avatar 组件扩展对 iconify 的支持
|
|
3
|
-
*/
|
|
4
|
-
declare function Icon({ icon, size, sx, ...rest }: {
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
icon: any;
|
|
7
|
-
size: any;
|
|
8
|
-
sx: any;
|
|
9
|
-
}): import("react").JSX.Element | null;
|
|
10
|
-
declare namespace Icon {
|
|
11
|
-
namespace propTypes {
|
|
12
|
-
let icon: any;
|
|
13
|
-
let size: any;
|
|
14
|
-
let sx: any;
|
|
15
|
-
}
|
|
16
|
-
namespace defaultProps {
|
|
17
|
-
let size_1: null;
|
|
18
|
-
export { size_1 as size };
|
|
19
|
-
let sx_1: null;
|
|
20
|
-
export { sx_1 as sx };
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
export default Icon;
|
package/es/Icon/index.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import "iconify-icon";
|
|
3
|
-
import PropTypes from "prop-types";
|
|
4
|
-
import Avatar from "@mui/material/Avatar";
|
|
5
|
-
import { isUrl, isIconifyString } from "../utils.js";
|
|
6
|
-
export default function Icon({ icon, size, sx, ...rest }) {
|
|
7
|
-
const _sx = [...Array.isArray(sx) ? sx : [sx]];
|
|
8
|
-
if (size) {
|
|
9
|
-
_sx.push({ width: size, height: size });
|
|
10
|
-
}
|
|
11
|
-
if (!rest.variant) {
|
|
12
|
-
_sx.push({
|
|
13
|
-
"&.MuiAvatar-root": {
|
|
14
|
-
color: "inherit",
|
|
15
|
-
fontWeight: "bold",
|
|
16
|
-
backgroundColor: "transparent",
|
|
17
|
-
borderRadius: 0
|
|
18
|
-
},
|
|
19
|
-
// 无 icon 背景时, svg icon 尺寸与窗口尺寸一致
|
|
20
|
-
"&.MuiAvatar-root svg": {
|
|
21
|
-
width: "100%",
|
|
22
|
-
height: "100%"
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
if (isUrl(icon)) {
|
|
27
|
-
return /* @__PURE__ */ jsx(Avatar, { as: "span", ...rest, src: icon, sx: _sx });
|
|
28
|
-
}
|
|
29
|
-
if (isIconifyString(icon)) {
|
|
30
|
-
const height = size ? 0.6 * size + 4 : 0;
|
|
31
|
-
return /* @__PURE__ */ jsx(Avatar, { as: "span", ...rest, sx: _sx, children: /* @__PURE__ */ jsx("iconify-icon", { icon, height: height || void 0 }) });
|
|
32
|
-
}
|
|
33
|
-
if (icon && typeof icon === "string") {
|
|
34
|
-
_sx.push({
|
|
35
|
-
"&.MuiAvatar-root": {
|
|
36
|
-
display: "inline-flex",
|
|
37
|
-
...size && { fontSize: size - 2 }
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
return /* @__PURE__ */ jsx(Avatar, { as: "span", ...rest, sx: _sx, children: Array.from(icon)[0] });
|
|
41
|
-
}
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
Icon.propTypes = {
|
|
45
|
-
// icon 支持 2 种形式:
|
|
46
|
-
// 1. iconify icon name: <prefix>:<name>
|
|
47
|
-
// 2. url
|
|
48
|
-
icon: PropTypes.string.isRequired,
|
|
49
|
-
size: PropTypes.number,
|
|
50
|
-
sx: PropTypes.oneOfType([PropTypes.array, PropTypes.func, PropTypes.object])
|
|
51
|
-
};
|
|
52
|
-
Icon.defaultProps = {
|
|
53
|
-
size: null,
|
|
54
|
-
sx: null
|
|
55
|
-
};
|
|
Binary file
|