@arcblock/ux 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/ActionButton/index.d.ts +1 -1
- package/lib/ActionButton/index.js +1 -1
- package/lib/Address/compact-text.d.ts +1 -1
- package/lib/Address/compact-text.js +5 -5
- package/lib/Address/did-address.js +1 -1
- package/lib/Address/index.js +5 -5
- package/lib/Address/responsive-did-address.js +14 -14
- package/lib/Alert/index.d.ts +1 -1
- package/lib/Alert/index.js +1 -1
- package/lib/Avatar/index.d.ts +1 -1
- package/lib/Avatar/index.js +1 -1
- package/lib/Badge/index.js +1 -1
- package/lib/BlockletContext/index.d.ts +1 -1
- package/lib/BlockletNFT/index.js +1 -1
- package/lib/BlockletV2/blocklet.d.ts +1 -1
- package/lib/BlockletV2/blocklet.js +1 -1
- package/lib/BlockletV2/components/icon-text.d.ts +1 -1
- package/lib/BlockletV2/components/icon-text.js +13 -13
- package/lib/BlockletV2/components/tooltip-icon.js +22 -20
- package/lib/Button/wrap.js +1 -1
- package/lib/Center/index.js +3 -3
- package/lib/ClickToCopy/copy-button.js +3 -3
- package/lib/CloseButton/index.js +1 -1
- package/lib/ContactForm/index.js +22 -21
- package/lib/DID/index.js +45 -44
- package/lib/DIDConnect/app-info-item.js +1 -1
- package/lib/DIDConnect/auth-apps/index.js +48 -48
- package/lib/DIDConnect/did-connect-container.js +22 -22
- package/lib/DIDConnect/did-connect-footer.js +1 -1
- package/lib/DIDConnect/landing-page.js +27 -27
- package/lib/DIDConnect/request-storage-access-api-dialog.js +39 -40
- package/lib/Datatable/CustomToolbar.d.ts +3 -1
- package/lib/Datatable/CustomToolbar.js +1 -1
- package/lib/Datatable/index.js +2 -2
- package/lib/Dialog/confirm.d.ts +1 -1
- package/lib/Dialog/confirm.js +12 -12
- package/lib/Earth/index.js +1 -1
- package/lib/Footer/index.d.ts +1 -1
- package/lib/Footer/index.js +5 -5
- package/lib/Header/addon-button.d.ts +1 -1
- package/lib/Header/addon-button.js +11 -6
- package/lib/Header/header.js +1 -1
- package/lib/Header/responsive-header.d.ts +1 -1
- package/lib/Header/responsive-header.js +33 -34
- package/lib/Icon/index.js +12 -12
- package/lib/InfoRow/index.d.ts +1 -1
- package/lib/InfoRow/index.js +0 -1
- package/lib/Layout/dashboard/external-link.d.ts +1 -1
- package/lib/Layout/dashboard/external-link.js +1 -1
- package/lib/Layout/dashboard/full-page.js +8 -8
- package/lib/Layout/dashboard/index.js +1 -1
- package/lib/Layout/dashboard/sidebar.js +1 -1
- package/lib/Layout/dashboard-legacy/header.js +10 -10
- package/lib/Layout/dashboard-legacy/index.js +16 -16
- package/lib/Layout/dashboard-legacy/sidebar.d.ts +1 -1
- package/lib/Layout/dashboard-legacy/sidebar.js +19 -12
- package/lib/Layout/index.js +2 -2
- package/lib/LoadingMask/index.d.ts +1 -1
- package/lib/LoadingMask/index.js +4 -4
- package/lib/Locale/context.js +24 -24
- package/lib/Locale/selector.d.ts +1 -1
- package/lib/Locale/selector.js +1 -1
- package/lib/Logo/index.js +3 -3
- package/lib/NFTDisplay/aspect-ratio-container.d.ts +1 -1
- package/lib/NFTDisplay/index.js +5 -2
- package/lib/NFTDisplay/render-svg.js +3 -3
- package/lib/NavMenu/nav-menu.js +29 -26
- package/lib/NavMenu/products.js +1 -1
- package/lib/PageScroller/index.js +43 -43
- package/lib/PhoneInput/country-select.js +23 -23
- package/lib/PhoneInput/index.js +11 -11
- package/lib/PoweredByArcBlock/index.js +10 -6
- package/lib/QRCode/index.js +5 -5
- package/lib/RelativeTime/index.js +16 -16
- package/lib/Result/result.js +5 -5
- package/lib/Screenshot/index.d.ts +1 -1
- package/lib/Screenshot/index.js +1 -1
- package/lib/SessionUser/components/did-space.d.ts +1 -1
- package/lib/SessionUser/components/session-user-item.js +10 -10
- package/lib/SharedBridge/index.js +6 -6
- package/lib/Spinner/index.js +1 -1
- package/lib/SplitButton/index.d.ts +1 -1
- package/lib/SplitButton/index.js +1 -1
- package/lib/Success/index.js +1 -1
- package/lib/Tabs/index.js +15 -8
- package/lib/Tag/index.d.ts +1 -1
- package/lib/Tag/index.js +1 -1
- package/lib/TextCollapse/index.js +1 -1
- package/lib/Theme/theme-provider.js +58 -53
- package/lib/Theme/theme.js +1 -0
- package/lib/Typography/index.js +13 -13
- package/lib/UserCard/Cards/basic-info.d.ts +1 -1
- package/lib/UserCard/Cards/basic-info.js +1 -1
- package/lib/UserCard/Cards/index.d.ts +1 -1
- package/lib/UserCard/Cards/index.js +1 -1
- package/lib/UserCard/Container/card.js +6 -6
- package/lib/UserCard/Container/dialog.js +1 -1
- package/lib/UserCard/Content/basic.js +2 -2
- package/lib/UserCard/Content/minimal.d.ts +1 -1
- package/lib/UserCard/Content/minimal.js +1 -1
- package/lib/UserCard/Content/tooltip-avatar.js +17 -17
- package/lib/VerificationCode/index.js +1 -1
- package/lib/WalletOSIcon/index.d.ts +2 -2
- package/lib/WalletOSIcon/index.js +7 -2
- package/lib/WebWalletSWKeeper/index.d.ts +3 -1
- package/lib/WebWalletSWKeeper/index.js +4 -1
- package/lib/withTheme/index.d.ts +3 -2
- package/lib/withTheme/index.js +16 -16
- package/package.json +7 -7
- package/src/ActionButton/index.jsx +1 -1
- package/src/Address/compact-text.jsx +1 -1
- package/src/Address/did-address.tsx +1 -1
- package/src/Address/index.tsx +1 -1
- package/src/Address/responsive-did-address.tsx +3 -3
- package/src/Alert/index.jsx +1 -1
- package/src/Avatar/index.jsx +1 -1
- package/src/Badge/index.jsx +1 -1
- package/src/BlockletContext/index.tsx +1 -1
- package/src/BlockletNFT/index.jsx +1 -1
- package/src/BlockletV2/blocklet.tsx +1 -1
- package/src/BlockletV2/components/icon-text.tsx +4 -4
- package/src/BlockletV2/components/tooltip-icon.tsx +5 -3
- package/src/Button/wrap.jsx +1 -1
- package/src/Center/index.tsx +1 -1
- package/src/ClickToCopy/copy-button.tsx +1 -1
- package/src/CloseButton/index.tsx +1 -1
- package/src/ContactForm/index.tsx +9 -2
- package/src/DID/index.tsx +5 -4
- package/src/DIDConnect/app-info-item.tsx +1 -1
- package/src/DIDConnect/auth-apps/index.tsx +8 -8
- package/src/DIDConnect/did-connect-container.tsx +2 -2
- package/src/DIDConnect/did-connect-footer.tsx +1 -1
- package/src/DIDConnect/landing-page.tsx +6 -6
- package/src/DIDConnect/request-storage-access-api-dialog.tsx +1 -2
- package/src/Datatable/CustomToolbar.jsx +1 -1
- package/src/Datatable/index.jsx +2 -2
- package/src/Dialog/confirm.jsx +1 -1
- package/src/Earth/index.tsx +1 -1
- package/src/Footer/index.tsx +5 -2
- package/src/Header/addon-button.tsx +7 -2
- package/src/Header/header.tsx +1 -1
- package/src/Header/responsive-header.tsx +1 -2
- package/src/Icon/index.tsx +1 -1
- package/src/InfoRow/index.tsx +1 -2
- package/src/Layout/dashboard/external-link.tsx +1 -1
- package/src/Layout/dashboard/full-page.tsx +1 -1
- package/src/Layout/dashboard/index.tsx +1 -1
- package/src/Layout/dashboard/sidebar.tsx +5 -2
- package/src/Layout/dashboard-legacy/header.tsx +5 -5
- package/src/Layout/dashboard-legacy/index.tsx +3 -3
- package/src/Layout/dashboard-legacy/sidebar.tsx +10 -2
- package/src/Layout/index.tsx +2 -2
- package/src/LoadingMask/index.tsx +5 -5
- package/src/Locale/context.tsx +3 -3
- package/src/Locale/selector.tsx +1 -1
- package/src/Logo/index.tsx +1 -1
- package/src/NFTDisplay/aspect-ratio-container.tsx +1 -1
- package/src/NFTDisplay/index.tsx +2 -1
- package/src/NFTDisplay/render-svg.tsx +1 -1
- package/src/NavMenu/nav-menu.tsx +8 -5
- package/src/NavMenu/products.tsx +3 -1
- package/src/PageScroller/index.tsx +4 -4
- package/src/PhoneInput/country-select.tsx +3 -3
- package/src/PhoneInput/index.tsx +1 -1
- package/src/PoweredByArcBlock/index.tsx +5 -1
- package/src/QRCode/index.tsx +1 -1
- package/src/RelativeTime/index.tsx +3 -3
- package/src/Result/result.tsx +1 -1
- package/src/Screenshot/index.tsx +2 -2
- package/src/SessionUser/components/did-space.tsx +1 -1
- package/src/SessionUser/components/session-user-item.tsx +1 -1
- package/src/SharedBridge/index.tsx +2 -2
- package/src/Spinner/index.tsx +1 -1
- package/src/SplitButton/index.tsx +1 -1
- package/src/Success/index.tsx +1 -1
- package/src/Tabs/index.tsx +10 -3
- package/src/Tag/index.jsx +1 -1
- package/src/TextCollapse/index.tsx +1 -1
- package/src/Theme/theme-provider.tsx +11 -6
- package/src/Theme/theme.ts +5 -0
- package/src/Typography/index.tsx +1 -1
- package/src/UserCard/Cards/basic-info.tsx +1 -1
- package/src/UserCard/Cards/index.tsx +1 -1
- package/src/UserCard/Container/card.tsx +2 -2
- package/src/UserCard/Container/dialog.tsx +1 -1
- package/src/UserCard/Content/basic.tsx +2 -2
- package/src/UserCard/Content/minimal.tsx +1 -1
- package/src/UserCard/Content/tooltip-avatar.tsx +4 -4
- package/src/VerificationCode/index.tsx +1 -1
- package/src/WalletOSIcon/index.tsx +7 -2
- package/src/WebWalletSWKeeper/index.tsx +6 -1
- package/src/withTheme/index.tsx +7 -3
- package/vite.config.mjs +4 -1
- package/lib/ActionButton/ActionButton.stories.d.ts +0 -18
- package/lib/ActivityIndicator/ActivityIndicator.stories.d.ts +0 -8
- package/lib/Address/Address.stories.d.ts +0 -16
- package/lib/Alert/Alert.stories.d.ts +0 -28
- package/lib/AnimationWaiter/AnimationWaiter.stories.d.ts +0 -21
- package/lib/Avatar/Avatar.stories.d.ts +0 -11
- package/lib/Badge/Badge.stories.d.ts +0 -13
- package/lib/Blocklet/Blocklet.stories.d.ts +0 -17
- package/lib/BlockletNFT/BlockletNFT.stories.d.ts +0 -17
- package/lib/BlockletV2/Blocklet.stories.d.ts +0 -18
- package/lib/Button/Button.stories.d.ts +0 -19
- package/lib/Center/Center.stories.d.ts +0 -18
- package/lib/ClickToCopy/ClickToCopy.stories.d.ts +0 -16
- package/lib/CodeBlock/CodeBlock.stories.d.ts +0 -20
- package/lib/Colors/Colors.stories.d.ts +0 -34
- package/lib/Config/Config.stories.d.ts +0 -14
- package/lib/ContactForm/ContactForm.stories.d.ts +0 -23
- package/lib/CookieConsent/CookieConsent.stories.d.ts +0 -18
- package/lib/CountDown/CountDown.stories.d.ts +0 -14
- package/lib/DID/DID.stories.d.ts +0 -15
- package/lib/Datatable/Datatable.stories.d.ts +0 -32
- package/lib/Dialog/Dialog.stories.d.ts +0 -20
- package/lib/DidLogo/Logo.stories.d.ts +0 -8
- package/lib/Earth/Earth.stories.d.ts +0 -18
- package/lib/Empty/Empty.stories.d.ts +0 -17
- package/lib/ErrorBoundary/ErrorBoundary.stories.d.ts +0 -12
- package/lib/Footer/Footer.stories.d.ts +0 -12
- package/lib/Header/Header.stories.d.ts +0 -21
- package/lib/Icon/Icon.stories.d.ts +0 -23
- package/lib/Img/Img.stories.d.ts +0 -13
- package/lib/InfoRow/InfoRow.stories.d.ts +0 -14
- package/lib/Layout/Layout.stories.d.ts +0 -23
- package/lib/Locale/LocaleSelector.stories.d.ts +0 -22
- package/lib/Logo/Logo.stories.d.ts +0 -22
- package/lib/Metric/Metric.stories.d.ts +0 -14
- package/lib/NFTDisplay/NFTDisplay.stories.d.ts +0 -15
- package/lib/NavMenu/NavMenu.stories.d.ts +0 -17
- package/lib/PageScroller/story/PageScroller.stories.d.ts +0 -13
- package/lib/PhoneInput/PhoneInput.stories.d.ts +0 -12
- package/lib/PricingTable/PricingTable.stories.d.ts +0 -8
- package/lib/QRCode/QRCode.stories.d.ts +0 -13
- package/lib/RelativeTime/RelativeTime.stories.d.ts +0 -20
- package/lib/Result/Result.stories.d.ts +0 -21
- package/lib/Screenshot/Screenshot.stories.d.ts +0 -13
- package/lib/SessionManager/SessionManager.stories.d.ts +0 -9
- package/lib/Sparkline/Sparkline.stories.d.ts +0 -12
- package/lib/Spinner/Spinner.stories.d.ts +0 -18
- package/lib/SplitButton/SplitButton.stories.d.ts +0 -15
- package/lib/Switch/Switch.stories.d.ts +0 -13
- package/lib/Tabs/Tabs.stories.d.ts +0 -14
- package/lib/Tag/Tag.stories.d.ts +0 -13
- package/lib/TextCollapse/TextCollapse.stories.d.ts +0 -28
- package/lib/Theme/Theme.stories.d.ts +0 -10
- package/lib/Toast/Toast.stories.d.ts +0 -15
- package/lib/UserCard/UserCard.stories.d.ts +0 -18
- package/lib/Util/WebWalletOpener.stories.d.ts +0 -5
- package/lib/Video/Video.stories.d.ts +0 -6
- package/lib/Wallet/Action.stories.d.ts +0 -8
- package/lib/Wallet/Download.stories.d.ts +0 -9
- package/lib/Wallet/OpenInWallet.stories.d.ts +0 -5
@@ -1,4 +1,4 @@
|
|
1
|
-
import { jsx as i, jsxs as
|
1
|
+
import { jsx as i, jsxs as M, Fragment as F } from "react/jsx-runtime";
|
2
2
|
import { Tooltip as O, Box as f } from "@mui/material";
|
3
3
|
import { useEffect as R, useMemo as $ } from "react";
|
4
4
|
import r from "dayjs";
|
@@ -62,11 +62,11 @@ function w({
|
|
62
62
|
relativeRange: L,
|
63
63
|
format: C
|
64
64
|
}) {
|
65
|
-
const u = (/* @__PURE__ */ new Date()).getTimezoneOffset(), U = u > 0 ? "-" : "+",
|
65
|
+
const u = (/* @__PURE__ */ new Date()).getTimezoneOffset(), U = u > 0 ? "-" : "+", v = Math.abs(u) / 60, c = u === 0, x = z((g) => g.isUtc), T = z((g) => g.setIsUtc);
|
66
66
|
if (R(() => {
|
67
67
|
T(c);
|
68
68
|
}, [c]), !t)
|
69
|
-
return { innerContent: "-", popContent: "-", isUtc: x, setIsUtc: T, sign: U, hoursOffset:
|
69
|
+
return { innerContent: "-", popContent: "-", isUtc: x, setIsUtc: T, sign: U, hoursOffset: v };
|
70
70
|
const d = e === "zh" ? "zh-cn" : "en-us";
|
71
71
|
let n = r(t).locale(d);
|
72
72
|
o === "utc" && (n = r(t).utc().locale(d)), s && (n = n.tz(s));
|
@@ -81,12 +81,12 @@ function w({
|
|
81
81
|
Math.abs(g) > L && (l = p);
|
82
82
|
}
|
83
83
|
l || (l = n.fromNow(m));
|
84
|
-
let
|
85
|
-
return o === "absolute" && (
|
84
|
+
let y = l, b = p;
|
85
|
+
return o === "absolute" && (y = p, b = l), o === "utc" && (x ? (y = D(t, { locale: d, tz: s, isUtc: !0, format: C }), b = D(t, { locale: d, tz: s, isUtc: !0, format: C })) : (y = p, b = l)), { innerContent: y, popContent: b, isUtc: x, setIsUtc: T, sign: U, hoursOffset: v, relativeString: l, absoluteString: p };
|
86
86
|
}
|
87
87
|
function A({
|
88
88
|
locale: t,
|
89
|
-
isUtc: e,
|
89
|
+
isUtc: e = !1,
|
90
90
|
setIsUtc: m,
|
91
91
|
useShortTimezone: a = !0
|
92
92
|
}) {
|
@@ -120,13 +120,13 @@ function et({
|
|
120
120
|
from: a = "",
|
121
121
|
to: h = "",
|
122
122
|
type: o = "relative",
|
123
|
-
tz: s,
|
124
|
-
relativeRange: L,
|
123
|
+
tz: s = void 0,
|
124
|
+
relativeRange: L = void 0,
|
125
125
|
enableTooltip: C = !0,
|
126
|
-
useShortTimezone:
|
126
|
+
useShortTimezone: I = !1,
|
127
127
|
disableTimezone: u = !1,
|
128
128
|
placement: U = "top-end",
|
129
|
-
format:
|
129
|
+
format: v = "lll",
|
130
130
|
...c
|
131
131
|
}) {
|
132
132
|
const { innerContent: x, popContent: T, isUtc: d, setIsUtc: n, relativeString: p } = w({
|
@@ -138,9 +138,9 @@ function et({
|
|
138
138
|
type: o === "all" ? "utc" : o,
|
139
139
|
tz: s,
|
140
140
|
relativeRange: L,
|
141
|
-
format:
|
141
|
+
format: v
|
142
142
|
});
|
143
|
-
return o === "all" ? /* @__PURE__ */ i(O, { title: void 0, placement: U, enterTouchDelay: 0, children: /* @__PURE__ */
|
143
|
+
return o === "all" ? /* @__PURE__ */ i(O, { title: void 0, placement: U, enterTouchDelay: 0, children: /* @__PURE__ */ M(
|
144
144
|
f,
|
145
145
|
{
|
146
146
|
...c,
|
@@ -156,13 +156,13 @@ function et({
|
|
156
156
|
/* @__PURE__ */ i(f, { component: "span", ...c, sx: {}, children: x }),
|
157
157
|
/* @__PURE__ */ i(f, { component: "span", sx: { color: "inherit" }, children: "·" }),
|
158
158
|
/* @__PURE__ */ i(f, { component: "span", sx: { color: "text.secondary" }, children: p }),
|
159
|
-
!u && /* @__PURE__ */
|
159
|
+
!u && /* @__PURE__ */ M(F, { children: [
|
160
160
|
/* @__PURE__ */ i(f, { component: "span", sx: { color: "inherit" }, children: "·" }),
|
161
|
-
/* @__PURE__ */ i(A, { locale: e, isUtc: d, setIsUtc: n, useShortTimezone:
|
161
|
+
/* @__PURE__ */ i(A, { locale: e, isUtc: d, setIsUtc: n, useShortTimezone: I })
|
162
162
|
] })
|
163
163
|
]
|
164
164
|
}
|
165
|
-
) }) : /* @__PURE__ */ i(O, { title: C ? T : void 0, placement: U, enterTouchDelay: 0, children: /* @__PURE__ */
|
165
|
+
) }) : /* @__PURE__ */ i(O, { title: C ? T : void 0, placement: U, enterTouchDelay: 0, children: /* @__PURE__ */ M(
|
166
166
|
f,
|
167
167
|
{
|
168
168
|
sx: {
|
@@ -172,7 +172,7 @@ function et({
|
|
172
172
|
},
|
173
173
|
children: [
|
174
174
|
/* @__PURE__ */ i(f, { component: "span", ...c, children: x }),
|
175
|
-
o === "utc" && !u && /* @__PURE__ */ i(A, { locale: e, isUtc: d, setIsUtc: n, useShortTimezone:
|
175
|
+
o === "utc" && !u && /* @__PURE__ */ i(A, { locale: e, isUtc: d, setIsUtc: n, useShortTimezone: I })
|
176
176
|
]
|
177
177
|
}
|
178
178
|
) });
|
package/lib/Result/result.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { jsxs as
|
1
|
+
import { jsxs as f, jsx as e } from "react/jsx-runtime";
|
2
2
|
import { Box as n } from "@mui/material";
|
3
|
-
import { styled as
|
4
|
-
function g({ icon: r, title: t = "", description: o = "", extra: i, ...
|
5
|
-
return /* @__PURE__ */
|
3
|
+
import { styled as c } from "../Theme/index.js";
|
4
|
+
function g({ icon: r = null, title: t = "", description: o = "", extra: i = null, ...l }) {
|
5
|
+
return /* @__PURE__ */ f(s, { ...l, children: [
|
6
6
|
r,
|
7
7
|
typeof t == "string" ? /* @__PURE__ */ e(
|
8
8
|
n,
|
@@ -40,7 +40,7 @@ function g({ icon: r, title: t = "", description: o = "", extra: i, ...f }) {
|
|
40
40
|
)
|
41
41
|
] });
|
42
42
|
}
|
43
|
-
const s =
|
43
|
+
const s = c("div")`
|
44
44
|
box-sizing: border-box;
|
45
45
|
display: flex;
|
46
46
|
flex-direction: column;
|
package/lib/Screenshot/index.js
CHANGED
@@ -2,6 +2,6 @@ import { BoxProps } from '@mui/material';
|
|
2
2
|
import { Locale, Session } from '../../type';
|
3
3
|
export interface DidSpaceProps extends BoxProps {
|
4
4
|
session: Session;
|
5
|
-
locale
|
5
|
+
locale?: Locale;
|
6
6
|
}
|
7
7
|
export default function DidSpace({ session, locale, ...rest }: DidSpaceProps): import("react/jsx-runtime").JSX.Element;
|
@@ -1,21 +1,21 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { useTheme as u, Box as e, Tooltip as x, Typography as h, IconButton as
|
3
|
-
import { Icon as
|
4
|
-
import
|
1
|
+
import { jsxs as t, jsx as l } from "react/jsx-runtime";
|
2
|
+
import { useTheme as u, Box as e, Tooltip as x, Typography as h, IconButton as v } from "@mui/material";
|
3
|
+
import { Icon as y } from "@iconify/react";
|
4
|
+
import m from "@iconify-icons/material-symbols/lens";
|
5
5
|
import w from "../../WalletOSIcon/index.js";
|
6
6
|
import S from "../../Avatar/index.js";
|
7
7
|
import { DID as g } from "../../DID/index.js";
|
8
8
|
import { getSourceProvider as z } from "../libs/utils.js";
|
9
9
|
function R({
|
10
|
-
ref: p,
|
10
|
+
ref: p = void 0,
|
11
11
|
sessionItem: r,
|
12
12
|
statusContent: c = null,
|
13
13
|
active: n = !1,
|
14
14
|
...a
|
15
15
|
}) {
|
16
|
-
var i,
|
16
|
+
var i, d;
|
17
17
|
const { palette: o } = u(), f = z(r == null ? void 0 : r.user) === "wallet";
|
18
|
-
return /* @__PURE__ */
|
18
|
+
return /* @__PURE__ */ t(
|
19
19
|
e,
|
20
20
|
{
|
21
21
|
...a,
|
@@ -30,7 +30,7 @@ function R({
|
|
30
30
|
...a == null ? void 0 : a.sx
|
31
31
|
},
|
32
32
|
children: [
|
33
|
-
/* @__PURE__ */
|
33
|
+
/* @__PURE__ */ t(
|
34
34
|
e,
|
35
35
|
{
|
36
36
|
sx: {
|
@@ -50,7 +50,7 @@ function R({
|
|
50
50
|
color: o.text.secondary,
|
51
51
|
loading: r.__isDefault,
|
52
52
|
provider: (i = r == null ? void 0 : r.extra) == null ? void 0 : i.provider,
|
53
|
-
walletOS: (
|
53
|
+
walletOS: (d = r == null ? void 0 : r.extra) == null ? void 0 : d.walletOS
|
54
54
|
}
|
55
55
|
),
|
56
56
|
f ? /* @__PURE__ */ l(g, { did: r.userDid, copyable: !1, size: 14, responsive: !1, compact: !0, sx: { lineHeight: 1 } }) : r.user.email && /* @__PURE__ */ l(
|
@@ -77,7 +77,7 @@ function R({
|
|
77
77
|
]
|
78
78
|
}
|
79
79
|
),
|
80
|
-
c || n && /* @__PURE__ */ l(
|
80
|
+
c || n && /* @__PURE__ */ l(v, { size: "small", disableRipple: !0, children: /* @__PURE__ */ l(y, { icon: m, fontSize: 6, color: o.success.main }) })
|
81
81
|
]
|
82
82
|
}
|
83
83
|
);
|
@@ -5,13 +5,13 @@ import { withQuery as b } from "ufo";
|
|
5
5
|
import { useReactive as x, useMemoizedFn as y } from "ahooks";
|
6
6
|
import E from "lodash/noop";
|
7
7
|
import { mergeSx as R } from "../Util/style.js";
|
8
|
-
import { callIframe as i, getCallbackAction as
|
8
|
+
import { callIframe as i, getCallbackAction as d } from "../Util/iframe.js";
|
9
9
|
function B({
|
10
|
-
ref:
|
10
|
+
ref: c = void 0,
|
11
11
|
src: o,
|
12
12
|
onClick: s,
|
13
13
|
onLoad: u = E,
|
14
|
-
sx: m,
|
14
|
+
sx: m = {},
|
15
15
|
...f
|
16
16
|
}) {
|
17
17
|
const r = w(null), n = `shared-bridge_${S()}`, t = x({
|
@@ -37,14 +37,14 @@ function B({
|
|
37
37
|
A(() => {
|
38
38
|
async function e(h) {
|
39
39
|
const { data: a } = h;
|
40
|
-
if (a.action ===
|
40
|
+
if (a.action === d(n, "requestStorageAccess")) {
|
41
41
|
if (t.open = !1, !a.value) {
|
42
42
|
s(a);
|
43
43
|
return;
|
44
44
|
}
|
45
45
|
const { value: p } = await i(r.current, "getVisitorId");
|
46
46
|
s({ ...a, visitorId: p });
|
47
|
-
} else a.action ===
|
47
|
+
} else a.action === d(n, "preRequestStorageAccess") && (t.open = !0);
|
48
48
|
}
|
49
49
|
return window.addEventListener("message", e), () => {
|
50
50
|
window.removeEventListener("message", e);
|
@@ -57,7 +57,7 @@ function B({
|
|
57
57
|
t.hasInited === void 0 && (t.hasInited = !1);
|
58
58
|
}, 1e3), u();
|
59
59
|
});
|
60
|
-
return L(
|
60
|
+
return L(c, () => ({
|
61
61
|
callIframe(e) {
|
62
62
|
return i(r.current, e);
|
63
63
|
}
|
package/lib/Spinner/index.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
2
2
|
import { CircularProgress as t } from "@mui/material";
|
3
3
|
import { withDeprecated as a } from "../Util/deprecate.js";
|
4
|
-
function n(r) {
|
4
|
+
function n({ ...r }) {
|
5
5
|
const e = { ...r };
|
6
6
|
return e.size && Array.isArray(r.size) && ([e.size] = r.size), /* @__PURE__ */ i(t, { ...e });
|
7
7
|
}
|
@@ -6,7 +6,7 @@ export interface SplitButtonProps extends Omit<ButtonGroupProps, 'children'> {
|
|
6
6
|
onClick?: () => void;
|
7
7
|
menuButtonProps?: ButtonProps;
|
8
8
|
}
|
9
|
-
declare function SplitButton(props: SplitButtonProps): import("react/jsx-runtime").JSX.Element;
|
9
|
+
declare function SplitButton({ ...props }: SplitButtonProps): import("react/jsx-runtime").JSX.Element;
|
10
10
|
declare namespace SplitButton {
|
11
11
|
var Item: import("@mui/material").ExtendButtonBase<import("@mui/material").MenuItemTypeMap<{}, "li">>;
|
12
12
|
}
|
package/lib/SplitButton/index.js
CHANGED
@@ -4,7 +4,7 @@ import { ExpandMore as L } from "@mui/icons-material";
|
|
4
4
|
import { ButtonGroup as S, Popper as w, MenuItem as p, Button as c, Paper as z, ClickAwayListener as j, MenuList as G } from "@mui/material";
|
5
5
|
import R from "lodash/noop";
|
6
6
|
import { styled as d } from "../Theme/index.js";
|
7
|
-
function v(o) {
|
7
|
+
function v({ ...o }) {
|
8
8
|
const {
|
9
9
|
size: m = "medium",
|
10
10
|
color: r = "primary",
|
package/lib/Success/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { jsxs as l, jsx as i } from "react/jsx-runtime";
|
2
2
|
import { useTheme as p, Box as e } from "@mui/material";
|
3
|
-
function x({ size: s = 64, backgroundColor: r, borderWidth: t = 4 }) {
|
3
|
+
function x({ size: s = 64, backgroundColor: r = void 0, borderWidth: t = 4 }) {
|
4
4
|
const { palette: c } = p(), o = s - t * 2, a = r || c.background.default;
|
5
5
|
return /* @__PURE__ */ l(
|
6
6
|
e,
|
package/lib/Tabs/index.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
2
2
|
import { Tabs as u, Tab as c } from "@mui/material";
|
3
3
|
import { styled as p } from "../Theme/index.js";
|
4
|
-
const
|
5
|
-
tabs: `${
|
6
|
-
tab: `${
|
4
|
+
const d = "index", s = {
|
5
|
+
tabs: `${d}-tabs`,
|
6
|
+
tab: `${d}-tab`
|
7
7
|
}, m = p(u)(({ theme: e }) => ({
|
8
8
|
[`& .${s.tabs}`]: {},
|
9
9
|
[`& .${s.tab}`]: {
|
@@ -13,7 +13,7 @@ const b = "index", s = {
|
|
13
13
|
}
|
14
14
|
}
|
15
15
|
}));
|
16
|
-
function
|
16
|
+
function v({ tabs: e, current: t, onChange: r, iconPosition: n = void 0, ...o }) {
|
17
17
|
return /* @__PURE__ */ l(
|
18
18
|
u,
|
19
19
|
{
|
@@ -77,7 +77,7 @@ function f({ tabs: e, current: t, onChange: r, iconPosition: n, ...o }) {
|
|
77
77
|
}
|
78
78
|
);
|
79
79
|
}
|
80
|
-
function
|
80
|
+
function f({ tabs: e, current: t, onChange: r, iconPosition: n = void 0, ...o }) {
|
81
81
|
return /* @__PURE__ */ l(
|
82
82
|
u,
|
83
83
|
{
|
@@ -146,14 +146,21 @@ function v({ tabs: e, current: t, onChange: r, iconPosition: n, ...o }) {
|
|
146
146
|
}
|
147
147
|
);
|
148
148
|
}
|
149
|
-
function T({
|
150
|
-
|
149
|
+
function T({
|
150
|
+
tabs: e,
|
151
|
+
current: t,
|
152
|
+
onChange: r,
|
153
|
+
variant: n = void 0,
|
154
|
+
iconPosition: o = void 0,
|
155
|
+
...a
|
156
|
+
}) {
|
157
|
+
return n === "card" ? /* @__PURE__ */ l(v, { ...a, tabs: e, current: t, onChange: r, iconPosition: o }) : n === "line" ? /* @__PURE__ */ l(f, { ...a, tabs: e, current: t, onChange: r, iconPosition: o }) : /* @__PURE__ */ l(
|
151
158
|
m,
|
152
159
|
{
|
153
160
|
scrollButtons: "auto",
|
154
161
|
variant: "scrollable",
|
155
162
|
value: t,
|
156
|
-
onChange: (i,
|
163
|
+
onChange: (i, b) => r(b),
|
157
164
|
indicatorColor: "primary",
|
158
165
|
...a,
|
159
166
|
className: [s.tabs, a.className || ""].join(" "),
|
package/lib/Tag/index.d.ts
CHANGED
@@ -25,7 +25,7 @@ export type TagProps = TypographyProps & TagOwnProps;
|
|
25
25
|
* @param {TagProps} props
|
26
26
|
* @return {import('react').ReactNode}
|
27
27
|
*/
|
28
|
-
declare function Tag(rawProps:
|
28
|
+
declare function Tag({ ...rawProps }: TagProps): import('react').ReactNode;
|
29
29
|
declare namespace Tag {
|
30
30
|
namespace propTypes {
|
31
31
|
let children: PropTypes.Validator<any>;
|
package/lib/Tag/index.js
CHANGED
@@ -27,7 +27,7 @@ const i = {
|
|
27
27
|
backgroundColor: "#222"
|
28
28
|
}
|
29
29
|
};
|
30
|
-
function a(m) {
|
30
|
+
function a({ ...m }) {
|
31
31
|
const o = Object.assign({}, m);
|
32
32
|
n(o.type) && (o.type = "primary"), n(o.content) && (o.content = ""), n(o.style) && (o.style = {}), n(o.className) && (o.className = "");
|
33
33
|
const p = x(o, a, ["style"]), { type: t, content: l, children: y, style: f, className: g, ...d } = p, { palette: s } = b(), c = Object.assign({}, i[t] || i.primary, f);
|
@@ -1,34 +1,34 @@
|
|
1
1
|
import { jsx as i, jsxs as R } from "react/jsx-runtime";
|
2
2
|
import { createContext as _, use as B, useState as L, useRef as j, useMemo as h, useCallback as C, useEffect as k } from "react";
|
3
|
-
import { useTheme as
|
4
|
-
import
|
5
|
-
import { BLOCKLET_THEME_PREFER_KEY as
|
3
|
+
import { useTheme as y, StyledEngineProvider as D, ThemeProvider as K, CssBaseline as U, GlobalStyles as V } from "@mui/material";
|
4
|
+
import v from "lodash/set";
|
5
|
+
import { BLOCKLET_THEME_PREFER_KEY as b, isValidThemeMode as W, getDefaultThemePrefer as w } from "@blocklet/theme";
|
6
6
|
import { useLocationState as q } from "../hooks/use-location-state.js";
|
7
7
|
import { createTheme as g, lazyCreateDefaultTheme as z, isUxTheme as A, isTheme as F } from "./theme.js";
|
8
|
-
const G = g(),
|
8
|
+
const G = g(), $ = _({});
|
9
9
|
function H() {
|
10
|
-
return B(
|
10
|
+
return B($);
|
11
11
|
}
|
12
|
-
const
|
13
|
-
function I({ className:
|
14
|
-
const e =
|
12
|
+
const x = (l) => l ? l === "system" ? w({ theme: { prefer: "system" } }) : l : w();
|
13
|
+
function I({ className: l = void 0 }) {
|
14
|
+
const e = y();
|
15
15
|
if (e.palette.mode === "dark") {
|
16
|
-
const s = "transparent",
|
16
|
+
const s = "transparent", n = e.palette.grey[300], o = (l || "").trim().split(/\s+/).filter(Boolean).map((c) => c.startsWith(".") ? c : `.${c}`).join(" "), r = o ? `${o}::-webkit-scrollbar, ${o} *::-webkit-scrollbar` : "*::-webkit-scrollbar", a = o ? `${o}::-webkit-scrollbar-track, ${o} *::-webkit-scrollbar-track` : "*::-webkit-scrollbar-track", m = o ? `${o}::-webkit-scrollbar-thumb, ${o} *::-webkit-scrollbar-thumb` : "*::-webkit-scrollbar-thumb", d = o ? `${o}, ${o} *` : "*";
|
17
17
|
return /* @__PURE__ */ i(
|
18
18
|
V,
|
19
19
|
{
|
20
20
|
styles: {
|
21
21
|
// Chrome, Safari, Edge
|
22
22
|
"@supports selector(::-webkit-scrollbar)": {
|
23
|
-
[
|
23
|
+
[r]: {
|
24
24
|
width: "12px",
|
25
25
|
height: "12px"
|
26
26
|
},
|
27
27
|
[a]: {
|
28
28
|
background: s
|
29
29
|
},
|
30
|
-
[
|
31
|
-
background:
|
30
|
+
[m]: {
|
31
|
+
background: n,
|
32
32
|
borderRadius: "6px",
|
33
33
|
border: "2px solid",
|
34
34
|
borderColor: s,
|
@@ -41,9 +41,9 @@ function I({ className: c }) {
|
|
41
41
|
},
|
42
42
|
// Firefox
|
43
43
|
"@supports not selector(::-webkit-scrollbar)": {
|
44
|
-
[
|
44
|
+
[d]: {
|
45
45
|
scrollbarWidth: "auto",
|
46
|
-
scrollbarColor: `${
|
46
|
+
scrollbarColor: `${n} ${s}`
|
47
47
|
}
|
48
48
|
}
|
49
49
|
}
|
@@ -53,77 +53,82 @@ function I({ className: c }) {
|
|
53
53
|
return null;
|
54
54
|
}
|
55
55
|
function E({
|
56
|
-
children:
|
56
|
+
children: l = null,
|
57
57
|
theme: e = G,
|
58
58
|
injectFirst: s = !0,
|
59
|
-
darkSchemeClass:
|
59
|
+
darkSchemeClass: n = ""
|
60
60
|
}) {
|
61
|
-
const
|
61
|
+
const o = h(() => typeof e == "function" || F(e) ? e : g(e), [e]);
|
62
62
|
return (
|
63
63
|
// injectFirst 会影响 makeStyles 自定义样式和 mui styles 覆盖问题
|
64
|
-
/* @__PURE__ */ i(D, { injectFirst: s, children: /* @__PURE__ */ R(K, { theme:
|
64
|
+
/* @__PURE__ */ i(D, { injectFirst: s, children: /* @__PURE__ */ R(K, { theme: o, children: [
|
65
65
|
/* @__PURE__ */ i(U, {}),
|
66
|
-
/* @__PURE__ */ i(I, { className:
|
67
|
-
|
66
|
+
/* @__PURE__ */ i(I, { className: n }),
|
67
|
+
l
|
68
68
|
] }) })
|
69
69
|
);
|
70
70
|
}
|
71
71
|
function N({
|
72
|
-
children:
|
73
|
-
theme: e,
|
74
|
-
prefer: s,
|
75
|
-
disableBlockletTheme:
|
76
|
-
...
|
72
|
+
children: l = null,
|
73
|
+
theme: e = void 0,
|
74
|
+
prefer: s = void 0,
|
75
|
+
disableBlockletTheme: n = !1,
|
76
|
+
...o
|
77
77
|
}) {
|
78
|
-
const [
|
78
|
+
const [r, a] = L(() => x(s)), m = y(), d = q(), c = j(null), p = h(() => {
|
79
79
|
let t = {};
|
80
|
-
const
|
80
|
+
const u = z(r);
|
81
81
|
if (e)
|
82
82
|
if (typeof e == "function") {
|
83
|
-
const M =
|
84
|
-
A(
|
83
|
+
const M = u();
|
84
|
+
A(m) ? t = { ...e(m, { mode: r }) } : t = { ...e(M, { mode: r }) };
|
85
85
|
} else
|
86
86
|
t = { ...e };
|
87
|
-
return
|
88
|
-
}, [
|
89
|
-
const t =
|
90
|
-
a(t), sessionStorage.removeItem(
|
91
|
-
}, [
|
87
|
+
return v(t, "palette.mode", r), v(t, "mode", r), t;
|
88
|
+
}, [r, e, m]), f = h(() => g({ ...p, disableBlockletTheme: n }), [p, n]), T = C(() => {
|
89
|
+
const t = r === "light" ? "dark" : "light";
|
90
|
+
a(t), sessionStorage.removeItem(b), localStorage.setItem(b, t);
|
91
|
+
}, [r, a]), S = C(
|
92
92
|
(t) => {
|
93
|
-
|
93
|
+
r !== t && (a(t), sessionStorage.removeItem(b), localStorage.setItem(b, t));
|
94
94
|
},
|
95
|
-
[
|
95
|
+
[r, a]
|
96
96
|
), P = h(
|
97
97
|
() => ({
|
98
|
-
mode:
|
98
|
+
mode: r,
|
99
99
|
toggleMode: T,
|
100
100
|
changeMode: S,
|
101
101
|
prefer: s
|
102
102
|
}),
|
103
|
-
[
|
103
|
+
[r, s, T, S]
|
104
104
|
);
|
105
105
|
return k(() => {
|
106
|
-
a(
|
107
|
-
}, [s, a,
|
108
|
-
const t = new URLSearchParams(
|
109
|
-
W(t) && sessionStorage.setItem(
|
110
|
-
}, [
|
111
|
-
|
106
|
+
a(x(s));
|
107
|
+
}, [s, a, d.search]), k(() => {
|
108
|
+
const t = new URLSearchParams(d.search).get("theme");
|
109
|
+
W(t) && sessionStorage.setItem(b, t);
|
110
|
+
}, [d.search]), k(() => {
|
111
|
+
c.current || (c.current = document.querySelector('meta[name="theme-color"]'));
|
112
112
|
const t = f.palette.background.default;
|
113
|
-
if (
|
114
|
-
|
113
|
+
if (c.current)
|
114
|
+
c.current.setAttribute("content", t);
|
115
115
|
else {
|
116
|
-
const
|
117
|
-
|
116
|
+
const u = document.createElement("meta");
|
117
|
+
u.name = "theme-color", u.content = t, document.head.appendChild(u), c.current = u;
|
118
118
|
}
|
119
|
-
}, [f.palette.background.default]), /* @__PURE__ */ i(
|
119
|
+
}, [f.palette.background.default]), /* @__PURE__ */ i($, { value: P, children: /* @__PURE__ */ i(E, { theme: f, ...o, children: l }) });
|
120
120
|
}
|
121
|
-
function te({
|
122
|
-
|
123
|
-
|
121
|
+
function te({
|
122
|
+
children: l = null,
|
123
|
+
prefer: e = void 0,
|
124
|
+
enableColorScheme: s = !1,
|
125
|
+
...n
|
126
|
+
}) {
|
127
|
+
const { toggleMode: o } = H();
|
128
|
+
return s || e || !o ? /* @__PURE__ */ i(N, { prefer: e, ...n, children: l }) : /* @__PURE__ */ i(E, { ...n, children: l });
|
124
129
|
}
|
125
130
|
export {
|
126
|
-
|
131
|
+
$ as ColorSchemeContext,
|
127
132
|
te as default,
|
128
133
|
H as useColorScheme
|
129
134
|
};
|
package/lib/Theme/theme.js
CHANGED
package/lib/Typography/index.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { jsxs as g, jsx as a } from "react/jsx-runtime";
|
2
|
-
import { Box as x, Typography as
|
3
|
-
import { useReactive as
|
4
|
-
import
|
2
|
+
import { Box as x, Typography as u, Skeleton as y } from "@mui/material";
|
3
|
+
import { useReactive as v, useSize as c, useCreation as C } from "ahooks";
|
4
|
+
import b from "lodash/noop";
|
5
5
|
import { useRef as m, useEffect as w } from "react";
|
6
6
|
let p = -1;
|
7
7
|
function T() {
|
@@ -18,27 +18,27 @@ function M({
|
|
18
18
|
children: t = null,
|
19
19
|
minFontSize: f = 12,
|
20
20
|
/* 设置为 auto 时字体会自动收缩,直到达到浏览器最小字体限制 */
|
21
|
-
fontSize: n,
|
21
|
+
fontSize: n = void 0,
|
22
22
|
sx: s,
|
23
|
-
onShrink: i =
|
23
|
+
onShrink: i = b,
|
24
24
|
...r
|
25
25
|
}) {
|
26
|
-
const
|
26
|
+
const d = m(null), z = m(null), e = v({
|
27
27
|
// @ts-expect-error
|
28
28
|
fontSize: n,
|
29
29
|
loading: !0
|
30
|
-
}), o = c(
|
30
|
+
}), o = c(d.current), l = c(z.current);
|
31
31
|
return w(() => {
|
32
32
|
if (e.loading)
|
33
33
|
if (n === "auto") {
|
34
34
|
if (o && !e.initialSize) {
|
35
|
-
const S = getComputedStyle(
|
35
|
+
const S = getComputedStyle(d.current).fontSize;
|
36
36
|
e.initialSize = Number(S.replace("px", "")), e.fontSize = e.initialSize;
|
37
37
|
}
|
38
38
|
p < 0 && (p = T()), e.fontSize <= p ? (e.loading = !1, i == null || i({ fontSize: e.fontSize, initialSize: e.initialSize })) : l && o && (l.width < o.width && e.fontSize > f ? e.fontSize-- : (e.loading = !1, i == null || i({ fontSize: e.fontSize, initialSize: e.initialSize })));
|
39
39
|
} else
|
40
40
|
e.loading = !1;
|
41
|
-
}, [n, o == null ? void 0 : o.width, l == null ? void 0 : l.width]),
|
41
|
+
}, [n, o == null ? void 0 : o.width, l == null ? void 0 : l.width]), C(() => n === "auto" ? e.loading : !1, [n, e.loading]) ? /* @__PURE__ */ g(
|
42
42
|
x,
|
43
43
|
{
|
44
44
|
ref: z,
|
@@ -46,11 +46,11 @@ function M({
|
|
46
46
|
flex: 1
|
47
47
|
},
|
48
48
|
children: [
|
49
|
-
/* @__PURE__ */ a(
|
49
|
+
/* @__PURE__ */ a(u, { ...r, sx: s, noWrap: !0, children: /* @__PURE__ */ a(y, { variant: "text", sx: { fontSize: "1rem" } }) }),
|
50
50
|
/* @__PURE__ */ a(
|
51
|
-
|
51
|
+
u,
|
52
52
|
{
|
53
|
-
ref:
|
53
|
+
ref: d,
|
54
54
|
...r,
|
55
55
|
sx: {
|
56
56
|
...s,
|
@@ -66,7 +66,7 @@ function M({
|
|
66
66
|
]
|
67
67
|
}
|
68
68
|
) : /* @__PURE__ */ a(
|
69
|
-
|
69
|
+
u,
|
70
70
|
{
|
71
71
|
...r,
|
72
72
|
sx: {
|
@@ -5,5 +5,5 @@ interface BasicCardProps extends Omit<UserCardProps, 'user'> {
|
|
5
5
|
shouldShowHoverCard: boolean;
|
6
6
|
renderCardContent?: () => React.ReactNode | null;
|
7
7
|
}
|
8
|
-
declare function BasicCard(props: BasicCardProps): import("react/jsx-runtime").JSX.Element;
|
8
|
+
declare function BasicCard({ ...props }: BasicCardProps): import("react/jsx-runtime").JSX.Element;
|
9
9
|
export default BasicCard;
|