@arcblock/ux 3.3.3 → 3.3.4
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.
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as e, jsxs as F } from "react/jsx-runtime";
|
|
2
|
-
import { memo as
|
|
2
|
+
import { memo as I, createElement as E, useState as H, useRef as K } from "react";
|
|
3
3
|
import { Backdrop as Q, useMediaQuery as U, useTheme as V, Box as d, Drawer as q, SwipeableDrawer as J, Dialog as X, DialogContent as Y } from "@mui/material";
|
|
4
4
|
import { useDebounce as Z, useMemoizedFn as v } from "ahooks";
|
|
5
5
|
import { useBrowser as oo } from "@arcblock/react-hooks";
|
|
6
6
|
import eo from "color-convert";
|
|
7
7
|
import "../Theme/theme.js";
|
|
8
8
|
import "../Theme/theme-provider.js";
|
|
9
|
-
import { mergeSx as
|
|
9
|
+
import { mergeSx as no } from "../Util/style.js";
|
|
10
10
|
import { hexToRgba as c } from "../Util/index.js";
|
|
11
|
-
const D =
|
|
11
|
+
const D = I(({ ref: s, ...m }) => /* @__PURE__ */ E(
|
|
12
12
|
Q,
|
|
13
13
|
{
|
|
14
14
|
open: !0,
|
|
@@ -27,18 +27,18 @@ function xo(s) {
|
|
|
27
27
|
popup: y = !1,
|
|
28
28
|
open: P = !1,
|
|
29
29
|
hideCloseButton: h = !1,
|
|
30
|
-
...
|
|
30
|
+
...n
|
|
31
31
|
}) {
|
|
32
|
-
const [a, g] =
|
|
33
|
-
let
|
|
34
|
-
y && (
|
|
35
|
-
const
|
|
36
|
-
wait:
|
|
32
|
+
const [a, g] = H("#fff"), f = K(null), B = oo(), L = U("(max-width:640px)");
|
|
33
|
+
let r = "page";
|
|
34
|
+
y && (r = "dialog", L && B.mobile.any && (r = "drawer"));
|
|
35
|
+
const z = V(), p = P, _ = z?.transitions?.duration?.leavingScreen || 500, M = Z(p, {
|
|
36
|
+
wait: _
|
|
37
37
|
}), w = v(() => {
|
|
38
38
|
const o = new URLSearchParams(window.location.search);
|
|
39
39
|
o.get("magicToken") && o.delete("magicToken"), o.toString() && window.history.replaceState({}, "", `${window.location.pathname}?${o.toString()}`);
|
|
40
40
|
}), k = (o, t) => {
|
|
41
|
-
["backdropClick", "escapeKeyDown"].includes(t) || (w(),
|
|
41
|
+
["backdropClick", "escapeKeyDown"].includes(t) || (w(), n?.onClose());
|
|
42
42
|
}, C = M || p, T = h ? q : J, A = eo.hex.hsl(a), [S, $, i] = A, u = [0, 30, 60, 30, 0, 30, 60, 30], j = Math.max(...u), O = Math.min(...u);
|
|
43
43
|
let x = !1;
|
|
44
44
|
(i * (100 + j) / 100 > 100 || i * (100 + O) / 100 < 0) && (x = !0);
|
|
@@ -48,7 +48,7 @@ function xo(s) {
|
|
|
48
48
|
}).join(", ")})`, G = `linear-gradient(45deg, ${u.map((o) => {
|
|
49
49
|
let t = i * (100 + o) / 100, l = 0.2;
|
|
50
50
|
return x ? l = 0.3 * (100 + o) / 100 : t = i * (100 + o) / 100, `hsla(${S}, ${$}%, ${t}%, ${l})`;
|
|
51
|
-
}).join(", ")})`, R =
|
|
51
|
+
}).join(", ")})`, R = n.blocklet?.settings?.didConnect?.showDidColor === !1 ? {} : {
|
|
52
52
|
overflow: "visible",
|
|
53
53
|
"&::before, &::after": {
|
|
54
54
|
content: '""',
|
|
@@ -79,7 +79,7 @@ function xo(s) {
|
|
|
79
79
|
backgroundPosition: "0 0"
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
}, N =
|
|
82
|
+
}, N = n.blocklet?.settings?.didConnect?.showDidColor === !1 ? {} : {
|
|
83
83
|
animation: "glowBreathe 7s linear infinite",
|
|
84
84
|
".did-connect__root": {
|
|
85
85
|
backgroundColor: "transparent"
|
|
@@ -98,13 +98,13 @@ function xo(s) {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
}, b = v(() => {
|
|
101
|
-
w(),
|
|
101
|
+
w(), n?.onClose?.();
|
|
102
102
|
});
|
|
103
|
-
return
|
|
103
|
+
return r === "page" ? /* @__PURE__ */ e(
|
|
104
104
|
d,
|
|
105
105
|
{
|
|
106
106
|
className: "did-connect__container-page",
|
|
107
|
-
sx:
|
|
107
|
+
sx: no(R, {
|
|
108
108
|
borderRadius: 1,
|
|
109
109
|
position: "relative",
|
|
110
110
|
zIndex: 1
|
|
@@ -120,11 +120,11 @@ function xo(s) {
|
|
|
120
120
|
zIndex: 2,
|
|
121
121
|
overflow: "hidden"
|
|
122
122
|
},
|
|
123
|
-
children: /* @__PURE__ */ e(s, { ...
|
|
123
|
+
children: /* @__PURE__ */ e(s, { ...n, onClose: b, setColor: g, hideCloseButton: !0, mode: r })
|
|
124
124
|
}
|
|
125
125
|
)
|
|
126
126
|
}
|
|
127
|
-
) :
|
|
127
|
+
) : r === "drawer" ? /* @__PURE__ */ F(
|
|
128
128
|
T,
|
|
129
129
|
{
|
|
130
130
|
className: "did-connect__container-drawer",
|
|
@@ -136,6 +136,10 @@ function xo(s) {
|
|
|
136
136
|
slots: {
|
|
137
137
|
backdrop: D
|
|
138
138
|
},
|
|
139
|
+
sx: {
|
|
140
|
+
zIndex: "1400 !important"
|
|
141
|
+
// dialog 的默认 z-index 是 1300,在 dialog 中打开验证/登录时会被遮挡,这里强制设置为 1400,确保 Drawer 在最上层
|
|
142
|
+
},
|
|
139
143
|
slotProps: {
|
|
140
144
|
paper: {
|
|
141
145
|
sx: {
|
|
@@ -184,7 +188,7 @@ function xo(s) {
|
|
|
184
188
|
width: 500,
|
|
185
189
|
height: "auto"
|
|
186
190
|
},
|
|
187
|
-
children: C ? /* @__PURE__ */ e(s, { ...
|
|
191
|
+
children: C ? /* @__PURE__ */ e(s, { ...n, onClose: b, setColor: g, hideCloseButton: !0, mode: r }) : null
|
|
188
192
|
}
|
|
189
193
|
)
|
|
190
194
|
]
|
|
@@ -223,11 +227,11 @@ function xo(s) {
|
|
|
223
227
|
children: C ? /* @__PURE__ */ e(
|
|
224
228
|
s,
|
|
225
229
|
{
|
|
226
|
-
...
|
|
230
|
+
...n,
|
|
227
231
|
onClose: b,
|
|
228
232
|
setColor: g,
|
|
229
233
|
hideCloseButton: h,
|
|
230
|
-
mode:
|
|
234
|
+
mode: r
|
|
231
235
|
}
|
|
232
236
|
) : null
|
|
233
237
|
}
|
package/lib/package.json.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/ux",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.4",
|
|
4
4
|
"description": "Common used react components for arcblock products",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -68,16 +68,16 @@
|
|
|
68
68
|
"react": "^19.0.0",
|
|
69
69
|
"react-router-dom": "^6.22.3"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "529197d1b0de7d864446ac88452033fd7f541bd2",
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@arcblock/bridge": "3.3.
|
|
73
|
+
"@arcblock/bridge": "3.3.4",
|
|
74
74
|
"@arcblock/did": "^1.27.16",
|
|
75
75
|
"@arcblock/did-motif": "^1.1.14",
|
|
76
|
-
"@arcblock/icons": "3.3.
|
|
77
|
-
"@arcblock/nft-display": "3.3.
|
|
78
|
-
"@arcblock/react-hooks": "3.3.
|
|
76
|
+
"@arcblock/icons": "3.3.4",
|
|
77
|
+
"@arcblock/nft-display": "3.3.4",
|
|
78
|
+
"@arcblock/react-hooks": "3.3.4",
|
|
79
79
|
"@blocklet/js-sdk": "^1.17.6",
|
|
80
|
-
"@blocklet/theme": "3.3.
|
|
80
|
+
"@blocklet/theme": "3.3.4",
|
|
81
81
|
"@fontsource/roboto": "~5.1.1",
|
|
82
82
|
"@fontsource/ubuntu-mono": "^5.2.6",
|
|
83
83
|
"@iconify-icons/logos": "^1.2.36",
|
|
@@ -224,6 +224,9 @@ export default function withContainer(Component: React.ComponentType<any>) {
|
|
|
224
224
|
slots={{
|
|
225
225
|
backdrop: BackdropWrap,
|
|
226
226
|
}}
|
|
227
|
+
sx={{
|
|
228
|
+
zIndex: '1400 !important', // dialog 的默认 z-index 是 1300,在 dialog 中打开验证/登录时会被遮挡,这里强制设置为 1400,确保 Drawer 在最上层
|
|
229
|
+
}}
|
|
227
230
|
slotProps={{
|
|
228
231
|
paper: {
|
|
229
232
|
sx: {
|