@arcblock/ux 3.2.19 → 3.3.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/lib/DIDConnect/did-connect-container.js +39 -37
- package/lib/DIDConnect/did-connect-footer.js +26 -26
- package/lib/DIDConnect/with-container.js +81 -76
- package/lib/Util/constant.d.ts +1 -0
- package/lib/Util/constant.js +10 -9
- package/lib/package.json.js +1 -1
- package/package.json +10 -10
- package/src/DIDConnect/did-connect-container.tsx +24 -22
- package/src/DIDConnect/did-connect-footer.tsx +15 -10
- package/src/DIDConnect/with-container.tsx +66 -54
- package/src/Util/constant.ts +1 -0
|
@@ -8,7 +8,7 @@ import { getDIDMotifInfo as Z } from "@arcblock/did-motif";
|
|
|
8
8
|
import oo from "lodash/noop";
|
|
9
9
|
import "../Theme/theme.js";
|
|
10
10
|
import "../Theme/theme-provider.js";
|
|
11
|
-
import { mergeSx as
|
|
11
|
+
import { mergeSx as d } from "../Util/style.js";
|
|
12
12
|
import { isEthereumDid as ro, getDIDColor as eo, hexToRgba as c } from "../Util/index.js";
|
|
13
13
|
import b from "./did-connect-footer.js";
|
|
14
14
|
const S = N(({ ref: t, ...x }) => /* @__PURE__ */ O(
|
|
@@ -45,15 +45,15 @@ function ko({
|
|
|
45
45
|
wait: B
|
|
46
46
|
}), C = (o, r) => {
|
|
47
47
|
["backdropClick", "escapeKeyDown"].includes(r) || A();
|
|
48
|
-
}, D = I || t || w,
|
|
48
|
+
}, D = I || t || w, z = h ? Q : V, M = Y.hex.hsl(e), [v, R, l] = M, p = [0, 30, 60, 30, 0, 30, 60, 30], P = Math.max(...p), j = Math.min(...p);
|
|
49
49
|
let g = !1;
|
|
50
|
-
(
|
|
50
|
+
(l * (100 + P) / 100 > 100 || l * (100 + j) / 100 < 0) && (g = !0);
|
|
51
51
|
const E = `linear-gradient(45deg, ${p.map((o) => {
|
|
52
|
-
let r =
|
|
53
|
-
return g ? n = 0.5 * (100 + o) / 100 : r =
|
|
52
|
+
let r = l * (100 + o) / 100, n = 0.6;
|
|
53
|
+
return g ? n = 0.5 * (100 + o) / 100 : r = l * (100 + o) / 100, `hsla(${v}, ${R}%, ${r}%, ${n})`;
|
|
54
54
|
}).join(", ")})`, G = `linear-gradient(45deg, ${p.map((o) => {
|
|
55
|
-
let r =
|
|
56
|
-
return g ? n = 0.3 * (100 + o) / 100 : r =
|
|
55
|
+
let r = l * (100 + o) / 100, n = 0.2;
|
|
56
|
+
return g ? n = 0.3 * (100 + o) / 100 : r = l * (100 + o) / 100, `hsla(${v}, ${R}%, ${r}%, ${n})`;
|
|
57
57
|
}).join(", ")})`, $ = t ? {
|
|
58
58
|
overflow: "visible",
|
|
59
59
|
"&::before, &::after": {
|
|
@@ -90,7 +90,7 @@ function ko({
|
|
|
90
90
|
s,
|
|
91
91
|
{
|
|
92
92
|
className: "did-connect__container-page",
|
|
93
|
-
sx:
|
|
93
|
+
sx: d(
|
|
94
94
|
{
|
|
95
95
|
borderRadius: 1,
|
|
96
96
|
position: "relative",
|
|
@@ -114,13 +114,13 @@ function ko({
|
|
|
114
114
|
},
|
|
115
115
|
children: [
|
|
116
116
|
f,
|
|
117
|
-
/* @__PURE__ */ a(b, { currentAppColor: e, sx:
|
|
117
|
+
/* @__PURE__ */ a(b, { currentAppColor: e, sx: d({ mx: 0 }, i?.footer?.sx) })
|
|
118
118
|
]
|
|
119
119
|
}
|
|
120
120
|
)
|
|
121
121
|
}
|
|
122
122
|
) : u === "drawer" ? /* @__PURE__ */ m(
|
|
123
|
-
|
|
123
|
+
z,
|
|
124
124
|
{
|
|
125
125
|
className: "did-connect__container-drawer",
|
|
126
126
|
disableSwipeToOpen: !0,
|
|
@@ -131,35 +131,37 @@ function ko({
|
|
|
131
131
|
slots: {
|
|
132
132
|
backdrop: S
|
|
133
133
|
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
"
|
|
150
|
-
|
|
134
|
+
slotProps: {
|
|
135
|
+
paper: {
|
|
136
|
+
sx: d(
|
|
137
|
+
{
|
|
138
|
+
backgroundColor: "background.default",
|
|
139
|
+
borderRadius: 3,
|
|
140
|
+
// 保持跟 DID Wallet 一致
|
|
141
|
+
borderBottomLeftRadius: 0,
|
|
142
|
+
borderBottomRightRadius: 0,
|
|
143
|
+
p: "2px",
|
|
144
|
+
".did-connect__root": {
|
|
145
|
+
backgroundColor: "transparent"
|
|
146
|
+
},
|
|
147
|
+
overflow: "hidden",
|
|
148
|
+
animation: t ? "glowBreathe 7s linear infinite" : "none",
|
|
149
|
+
"@keyframes glowBreathe": {
|
|
150
|
+
"0%, 100%": {
|
|
151
|
+
boxShadow: `
|
|
151
152
|
inset 0 0 7px ${c(e, 0.3)},
|
|
152
153
|
inset 0 0 12px ${c(e, 0.3)}`
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
},
|
|
155
|
+
"50%": {
|
|
156
|
+
boxShadow: `
|
|
156
157
|
inset 0 0 18px ${c(e, 0.7)},
|
|
157
158
|
inset 0 0 24px ${c(e, 0.5)}`
|
|
159
|
+
}
|
|
158
160
|
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
},
|
|
162
|
+
i?.containerDrawer?.sx
|
|
163
|
+
)
|
|
164
|
+
}
|
|
163
165
|
},
|
|
164
166
|
children: [
|
|
165
167
|
h ? null : /* @__PURE__ */ a(
|
|
@@ -199,7 +201,7 @@ function ko({
|
|
|
199
201
|
},
|
|
200
202
|
children: [
|
|
201
203
|
D ? f : null,
|
|
202
|
-
/* @__PURE__ */ a(b, { currentAppColor: e, sx:
|
|
204
|
+
/* @__PURE__ */ a(b, { currentAppColor: e, sx: d({ mx: 0 }, i?.footer?.sx) })
|
|
203
205
|
]
|
|
204
206
|
}
|
|
205
207
|
)
|
|
@@ -216,7 +218,7 @@ function ko({
|
|
|
216
218
|
className: "did-connect__container-dialog",
|
|
217
219
|
onClose: C,
|
|
218
220
|
PaperProps: {
|
|
219
|
-
sx:
|
|
221
|
+
sx: d(
|
|
220
222
|
{
|
|
221
223
|
// 避免样式被 server 中的定义覆盖
|
|
222
224
|
"&.MuiPaper-rounded": {
|
|
@@ -243,7 +245,7 @@ function ko({
|
|
|
243
245
|
},
|
|
244
246
|
children: [
|
|
245
247
|
D ? f : null,
|
|
246
|
-
/* @__PURE__ */ a(b, { currentAppColor: e, sx:
|
|
248
|
+
/* @__PURE__ */ a(b, { currentAppColor: e, sx: d({ mx: 0 }, i?.footer?.sx) })
|
|
247
249
|
]
|
|
248
250
|
}
|
|
249
251
|
)
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Box as
|
|
3
|
-
import { useSize as m, useCreation as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { hexToRgba as
|
|
10
|
-
import { mergeSx as
|
|
1
|
+
import { jsxs as p, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Box as a } from "@mui/material";
|
|
3
|
+
import { useSize as m, useCreation as c } from "ahooks";
|
|
4
|
+
import { useRef as d } from "react";
|
|
5
|
+
import b from "@arcblock/react-hooks/lib/useBrowser";
|
|
6
|
+
import h from "./powered-by.js";
|
|
7
|
+
import x from "./app-info-item.js";
|
|
8
|
+
import g from "./app-icon.js";
|
|
9
|
+
import { hexToRgba as u, getDIDColor as w } from "../Util/index.js";
|
|
10
|
+
import { mergeSx as C } from "../Util/style.js";
|
|
11
11
|
import { DID_CONNECT_MEDIUM_WIDTH as I } from "../Util/constant.js";
|
|
12
12
|
function N({
|
|
13
13
|
currentAppInfo: r = globalThis.blocklet,
|
|
14
|
-
currentAppColor:
|
|
15
|
-
sx:
|
|
14
|
+
currentAppColor: i = globalThis.blocklet?.appPid ? w(globalThis.blocklet?.appPid) : "#fff",
|
|
15
|
+
sx: l = {}
|
|
16
16
|
}) {
|
|
17
|
-
const
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
|
|
17
|
+
const e = globalThis?.blocklet, f = b(), n = d(null), o = m(n), s = c(() => o ? o.width < I - 50 : !0, [o, o?.width]);
|
|
18
|
+
return /* @__PURE__ */ p(
|
|
19
|
+
a,
|
|
20
20
|
{
|
|
21
|
-
ref:
|
|
22
|
-
sx:
|
|
21
|
+
ref: n,
|
|
22
|
+
sx: C(
|
|
23
23
|
{
|
|
24
24
|
display: "flex",
|
|
25
|
-
justifyContent: "space-between",
|
|
25
|
+
justifyContent: e?.settings?.didConnect?.showAppInfo === !1 ? "center" : "space-between",
|
|
26
26
|
alignItems: "center",
|
|
27
27
|
gap: 1,
|
|
28
28
|
fontSize: 12,
|
|
29
|
-
backgroundColor:
|
|
29
|
+
backgroundColor: e?.settings?.didConnect?.showDidColor === !1 ? "grey.50" : u(i, 0.08),
|
|
30
30
|
// 需要保持跟 .did-connect__root 的规则一样
|
|
31
|
-
mx:
|
|
31
|
+
mx: s ? -2 : -3,
|
|
32
32
|
// eslint-disable-next-line no-nested-ternary
|
|
33
|
-
px:
|
|
33
|
+
px: s ? f.arcSphere ? 1 : 2 : 3,
|
|
34
34
|
py: 1.5,
|
|
35
35
|
// HACK: 极限条件下,footer 会溢出,使用隐藏的滚动条来处理这种情况(屏幕宽度小于 360 时会出现)
|
|
36
36
|
overflow: "auto",
|
|
@@ -43,22 +43,22 @@ function N({
|
|
|
43
43
|
"scrollbar-width": "none"
|
|
44
44
|
// 隐藏滚动条 (Firefox)
|
|
45
45
|
},
|
|
46
|
-
|
|
46
|
+
l
|
|
47
47
|
),
|
|
48
48
|
className: "did-connect__footer",
|
|
49
49
|
children: [
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
|
|
50
|
+
e?.settings?.didConnect?.showAppInfo === !1 ? null : /* @__PURE__ */ t(
|
|
51
|
+
x,
|
|
52
52
|
{
|
|
53
53
|
appInfo: r,
|
|
54
|
-
appLogo: /* @__PURE__ */
|
|
54
|
+
appLogo: /* @__PURE__ */ t(g, { appInfo: r, size: 24, sx: { flexShrink: 0 } }),
|
|
55
55
|
sx: {
|
|
56
56
|
flex: 1,
|
|
57
57
|
overflow: "hidden"
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
),
|
|
61
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ t(h, { sx: { maxWidth: "100%", justifyContent: "end" } })
|
|
62
62
|
]
|
|
63
63
|
}
|
|
64
64
|
);
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { Backdrop as
|
|
4
|
-
import { useDebounce as
|
|
5
|
-
import { useBrowser as
|
|
6
|
-
import
|
|
1
|
+
import { jsx as e, jsxs as F } from "react/jsx-runtime";
|
|
2
|
+
import { memo as E, createElement as H, useState as I, useRef as K } from "react";
|
|
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
|
+
import { useDebounce as Z, useMemoizedFn as v } from "ahooks";
|
|
5
|
+
import { useBrowser as oo } from "@arcblock/react-hooks";
|
|
6
|
+
import eo from "color-convert";
|
|
7
7
|
import "../Theme/theme.js";
|
|
8
8
|
import "../Theme/theme-provider.js";
|
|
9
|
-
import { mergeSx as
|
|
10
|
-
import { hexToRgba as
|
|
11
|
-
const
|
|
12
|
-
|
|
9
|
+
import { mergeSx as ro } from "../Util/style.js";
|
|
10
|
+
import { hexToRgba as c } from "../Util/index.js";
|
|
11
|
+
const D = E(({ ref: s, ...m }) => /* @__PURE__ */ H(
|
|
12
|
+
Q,
|
|
13
13
|
{
|
|
14
14
|
open: !0,
|
|
15
|
-
ref:
|
|
15
|
+
ref: s,
|
|
16
16
|
style: {
|
|
17
17
|
backgroundColor: "rgba(0, 0, 0, 0.6)",
|
|
18
18
|
backdropFilter: "blur(3px)",
|
|
@@ -22,33 +22,33 @@ const P = F(({ ref: i, ...m }) => /* @__PURE__ */ E(
|
|
|
22
22
|
key: "background"
|
|
23
23
|
}
|
|
24
24
|
));
|
|
25
|
-
function xo(
|
|
25
|
+
function xo(s) {
|
|
26
26
|
function m({
|
|
27
27
|
popup: y = !1,
|
|
28
|
-
open:
|
|
28
|
+
open: P = !1,
|
|
29
29
|
hideCloseButton: h = !1,
|
|
30
|
-
...
|
|
30
|
+
...r
|
|
31
31
|
}) {
|
|
32
|
-
const [
|
|
33
|
-
let
|
|
34
|
-
y && (
|
|
35
|
-
const _ =
|
|
32
|
+
const [a, g] = I("#fff"), f = K(null), B = oo(), L = U("(max-width:640px)");
|
|
33
|
+
let n = "page";
|
|
34
|
+
y && (n = "dialog", L && B.mobile.any && (n = "drawer"));
|
|
35
|
+
const _ = V(), p = P, z = _?.transitions?.duration?.leavingScreen || 500, M = Z(p, {
|
|
36
36
|
wait: z
|
|
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
|
-
}), k = (o,
|
|
41
|
-
["backdropClick", "escapeKeyDown"].includes(
|
|
42
|
-
}, C = M || p, T = h ?
|
|
43
|
-
let
|
|
44
|
-
(
|
|
40
|
+
}), k = (o, t) => {
|
|
41
|
+
["backdropClick", "escapeKeyDown"].includes(t) || (w(), r?.onClose());
|
|
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
|
+
let x = !1;
|
|
44
|
+
(i * (100 + j) / 100 > 100 || i * (100 + O) / 100 < 0) && (x = !0);
|
|
45
45
|
const W = `linear-gradient(45deg, ${u.map((o) => {
|
|
46
|
-
let
|
|
47
|
-
return
|
|
46
|
+
let t = i * (100 + o) / 100, l = 0.6;
|
|
47
|
+
return x ? l = 0.5 * (100 + o) / 100 : t = i * (100 + o) / 100, `hsla(${S}, ${$}%, ${t}%, ${l})`;
|
|
48
48
|
}).join(", ")})`, G = `linear-gradient(45deg, ${u.map((o) => {
|
|
49
|
-
let
|
|
50
|
-
return
|
|
51
|
-
}).join(", ")})`,
|
|
49
|
+
let t = i * (100 + o) / 100, l = 0.2;
|
|
50
|
+
return x ? l = 0.3 * (100 + o) / 100 : t = i * (100 + o) / 100, `hsla(${S}, ${$}%, ${t}%, ${l})`;
|
|
51
|
+
}).join(", ")})`, R = r.blocklet?.settings?.didConnect?.showDidColor === !1 ? {} : {
|
|
52
52
|
overflow: "visible",
|
|
53
53
|
"&::before, &::after": {
|
|
54
54
|
content: '""',
|
|
@@ -79,76 +79,81 @@ function xo(i) {
|
|
|
79
79
|
backgroundPosition: "0 0"
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
},
|
|
83
|
-
|
|
82
|
+
}, N = r.blocklet?.settings?.didConnect?.showDidColor === !1 ? {} : {
|
|
83
|
+
animation: "glowBreathe 7s linear infinite",
|
|
84
|
+
".did-connect__root": {
|
|
85
|
+
backgroundColor: "transparent"
|
|
86
|
+
},
|
|
87
|
+
overflow: "hidden",
|
|
88
|
+
"@keyframes glowBreathe": {
|
|
89
|
+
"0%, 100%": {
|
|
90
|
+
boxShadow: `
|
|
91
|
+
inset 0 0 7px ${c(a, 0.3)},
|
|
92
|
+
inset 0 0 12px ${c(a, 0.3)}`
|
|
93
|
+
},
|
|
94
|
+
"50%": {
|
|
95
|
+
boxShadow: `
|
|
96
|
+
inset 0 0 18px ${c(a, 0.7)},
|
|
97
|
+
inset 0 0 24px ${c(a, 0.5)}`
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}, b = v(() => {
|
|
101
|
+
w(), r?.onClose?.();
|
|
84
102
|
});
|
|
85
|
-
return
|
|
86
|
-
|
|
103
|
+
return n === "page" ? /* @__PURE__ */ e(
|
|
104
|
+
d,
|
|
87
105
|
{
|
|
88
106
|
className: "did-connect__container-page",
|
|
89
|
-
sx:
|
|
107
|
+
sx: ro(R, {
|
|
90
108
|
borderRadius: 1,
|
|
91
109
|
position: "relative",
|
|
92
110
|
zIndex: 1
|
|
93
111
|
}),
|
|
94
112
|
children: /* @__PURE__ */ e(
|
|
95
|
-
|
|
113
|
+
d,
|
|
96
114
|
{
|
|
97
115
|
sx: {
|
|
98
|
-
border: `1px solid ${
|
|
116
|
+
border: `1px solid ${c(a, 0.1)}`,
|
|
99
117
|
m: "-1px",
|
|
100
118
|
position: "relative",
|
|
101
119
|
borderRadius: "12px",
|
|
102
120
|
zIndex: 2,
|
|
103
121
|
overflow: "hidden"
|
|
104
122
|
},
|
|
105
|
-
children: /* @__PURE__ */ e(
|
|
123
|
+
children: /* @__PURE__ */ e(s, { ...r, onClose: b, setColor: g, hideCloseButton: !0, mode: n })
|
|
106
124
|
}
|
|
107
125
|
)
|
|
108
126
|
}
|
|
109
|
-
) :
|
|
127
|
+
) : n === "drawer" ? /* @__PURE__ */ F(
|
|
110
128
|
T,
|
|
111
129
|
{
|
|
112
130
|
className: "did-connect__container-drawer",
|
|
113
131
|
disableSwipeToOpen: !0,
|
|
114
132
|
open: p,
|
|
115
133
|
anchor: "bottom",
|
|
116
|
-
drawerDragger:
|
|
134
|
+
drawerDragger: f.current,
|
|
117
135
|
onClose: k,
|
|
118
136
|
slots: {
|
|
119
|
-
backdrop:
|
|
137
|
+
backdrop: D
|
|
120
138
|
},
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
},
|
|
132
|
-
overflow: "hidden",
|
|
133
|
-
"@keyframes glowBreathe": {
|
|
134
|
-
"0%, 100%": {
|
|
135
|
-
boxShadow: `
|
|
136
|
-
inset 0 0 7px ${d(t, 0.3)},
|
|
137
|
-
inset 0 0 12px ${d(t, 0.3)}`
|
|
138
|
-
},
|
|
139
|
-
"50%": {
|
|
140
|
-
boxShadow: `
|
|
141
|
-
inset 0 0 18px ${d(t, 0.7)},
|
|
142
|
-
inset 0 0 24px ${d(t, 0.5)}`
|
|
143
|
-
}
|
|
139
|
+
slotProps: {
|
|
140
|
+
paper: {
|
|
141
|
+
sx: {
|
|
142
|
+
backgroundColor: "background.default",
|
|
143
|
+
borderRadius: 3,
|
|
144
|
+
// 保持跟 DID Wallet 一致
|
|
145
|
+
borderBottomLeftRadius: 0,
|
|
146
|
+
borderBottomRightRadius: 0,
|
|
147
|
+
p: "2px",
|
|
148
|
+
...N
|
|
144
149
|
}
|
|
145
150
|
}
|
|
146
151
|
},
|
|
147
152
|
children: [
|
|
148
153
|
h ? null : /* @__PURE__ */ e(
|
|
149
|
-
|
|
154
|
+
d,
|
|
150
155
|
{
|
|
151
|
-
ref:
|
|
156
|
+
ref: f,
|
|
152
157
|
sx: {
|
|
153
158
|
px: 1,
|
|
154
159
|
pt: 2,
|
|
@@ -158,7 +163,7 @@ function xo(i) {
|
|
|
158
163
|
zIndex: 2
|
|
159
164
|
},
|
|
160
165
|
children: /* @__PURE__ */ e(
|
|
161
|
-
|
|
166
|
+
d,
|
|
162
167
|
{
|
|
163
168
|
sx: {
|
|
164
169
|
width: "48px",
|
|
@@ -171,7 +176,7 @@ function xo(i) {
|
|
|
171
176
|
}
|
|
172
177
|
),
|
|
173
178
|
/* @__PURE__ */ e(
|
|
174
|
-
|
|
179
|
+
d,
|
|
175
180
|
{
|
|
176
181
|
sx: {
|
|
177
182
|
touchAction: "none",
|
|
@@ -179,17 +184,17 @@ function xo(i) {
|
|
|
179
184
|
width: 500,
|
|
180
185
|
height: "auto"
|
|
181
186
|
},
|
|
182
|
-
children: C ? /* @__PURE__ */ e(
|
|
187
|
+
children: C ? /* @__PURE__ */ e(s, { ...r, onClose: b, setColor: g, hideCloseButton: !0, mode: n }) : null
|
|
183
188
|
}
|
|
184
189
|
)
|
|
185
190
|
]
|
|
186
191
|
}
|
|
187
192
|
) : /* @__PURE__ */ e(
|
|
188
|
-
|
|
193
|
+
X,
|
|
189
194
|
{
|
|
190
195
|
open: p,
|
|
191
196
|
slots: {
|
|
192
|
-
backdrop:
|
|
197
|
+
backdrop: D
|
|
193
198
|
},
|
|
194
199
|
className: "did-connect__container-dialog",
|
|
195
200
|
onClose: k,
|
|
@@ -200,11 +205,11 @@ function xo(i) {
|
|
|
200
205
|
borderRadius: "12px !important"
|
|
201
206
|
},
|
|
202
207
|
position: "relative",
|
|
203
|
-
...
|
|
208
|
+
...R
|
|
204
209
|
}
|
|
205
210
|
},
|
|
206
211
|
children: /* @__PURE__ */ e(
|
|
207
|
-
|
|
212
|
+
Y,
|
|
208
213
|
{
|
|
209
214
|
sx: {
|
|
210
215
|
maxWidth: "calc(100vw - 18px)",
|
|
@@ -216,13 +221,13 @@ function xo(i) {
|
|
|
216
221
|
zIndex: 1
|
|
217
222
|
},
|
|
218
223
|
children: C ? /* @__PURE__ */ e(
|
|
219
|
-
|
|
224
|
+
s,
|
|
220
225
|
{
|
|
221
|
-
...
|
|
222
|
-
onClose:
|
|
223
|
-
setColor:
|
|
226
|
+
...r,
|
|
227
|
+
onClose: b,
|
|
228
|
+
setColor: g,
|
|
224
229
|
hideCloseButton: h,
|
|
225
|
-
mode:
|
|
230
|
+
mode: n
|
|
226
231
|
}
|
|
227
232
|
) : null
|
|
228
233
|
}
|
package/lib/Util/constant.d.ts
CHANGED
package/lib/Util/constant.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e = 300, T = 1800, t = "/.well-known/service", o = "login_token", _ = "refresh_token", I = "/.well-known/service", A = "/api/did", n = `${t}/admin/overview`, s = `${t}/user`, O = `${t}/user/did-spaces`, R = `${t}/admin/navigation`, i = "did:abt:", D = {
|
|
2
2
|
VALID: "valid",
|
|
3
3
|
REVOKED: "revoked"
|
|
4
4
|
}, E = {
|
|
@@ -20,29 +20,30 @@ const T = 300, e = 1800, t = "/.well-known/service", o = "login_token", _ = "ref
|
|
|
20
20
|
[E.WALLET]: "DID Wallet",
|
|
21
21
|
[E.NFT]: "NFT",
|
|
22
22
|
[E.PASSKEY]: "Passkey",
|
|
23
|
-
[E.TWITTER]: "X (Twitter)"
|
|
24
|
-
|
|
23
|
+
[E.TWITTER]: "X (Twitter)",
|
|
24
|
+
federated: "Federated"
|
|
25
|
+
}, a = {
|
|
25
26
|
email: "Email",
|
|
26
27
|
auth0: "Auth0",
|
|
27
28
|
apple: "Apple",
|
|
28
29
|
github: "Github",
|
|
29
30
|
google: "Google",
|
|
30
31
|
twitter: "X (Twitter)"
|
|
31
|
-
},
|
|
32
|
+
}, l = 360, c = 576;
|
|
32
33
|
export {
|
|
33
34
|
A as API_DID_PREFIX,
|
|
34
35
|
t as BLOCKLET_SERVICE_PATH_PREFIX,
|
|
35
36
|
n as DASHBOARD_URL,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
e as DEFAULT_TIMEOUT,
|
|
38
|
+
T as DEFAULT_WINDOW_TIMEOUT,
|
|
39
|
+
c as DID_CONNECT_MEDIUM_WIDTH,
|
|
40
|
+
l as DID_CONNECT_SMALL_WIDTH,
|
|
40
41
|
i as DID_PREFIX,
|
|
41
42
|
O as DID_SPACE_URL,
|
|
42
43
|
E as LOGIN_PROVIDER,
|
|
43
44
|
L as LOGIN_PROVIDER_NAME,
|
|
44
45
|
R as NAVIGATION_URL,
|
|
45
|
-
|
|
46
|
+
a as OAUTH_PROVIDER,
|
|
46
47
|
D as PASSPORT_STATUS,
|
|
47
48
|
s as PROFILE_URL,
|
|
48
49
|
_ as REFRESH_TOKEN_STORAGE_KEY,
|
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
|
+
"version": "3.3.1",
|
|
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": "39aec3e1aef080ae289918120dc12629940a75b4",
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@arcblock/bridge": "3.
|
|
74
|
-
"@arcblock/did": "^1.27.
|
|
73
|
+
"@arcblock/bridge": "3.3.1",
|
|
74
|
+
"@arcblock/did": "^1.27.16",
|
|
75
75
|
"@arcblock/did-motif": "^1.1.14",
|
|
76
|
-
"@arcblock/icons": "3.
|
|
77
|
-
"@arcblock/nft-display": "3.
|
|
78
|
-
"@arcblock/react-hooks": "3.
|
|
79
|
-
"@blocklet/js-sdk": "^1.17.
|
|
80
|
-
"@blocklet/theme": "3.
|
|
76
|
+
"@arcblock/icons": "3.3.1",
|
|
77
|
+
"@arcblock/nft-display": "3.3.1",
|
|
78
|
+
"@arcblock/react-hooks": "3.3.1",
|
|
79
|
+
"@blocklet/js-sdk": "^1.17.6",
|
|
80
|
+
"@blocklet/theme": "3.3.1",
|
|
81
81
|
"@fontsource/roboto": "~5.1.1",
|
|
82
82
|
"@fontsource/ubuntu-mono": "^5.2.6",
|
|
83
83
|
"@iconify-icons/logos": "^1.2.36",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"@iconify-icons/mdi": "^1.2.48",
|
|
86
86
|
"@iconify-icons/tabler": "^1.2.95",
|
|
87
87
|
"@iconify/react": "^5.2.1",
|
|
88
|
-
"@ocap/mcrypto": "^1.27.
|
|
88
|
+
"@ocap/mcrypto": "^1.27.16",
|
|
89
89
|
"@solana/qr-code-styling": "^1.6.0",
|
|
90
90
|
"@types/dompurify": "^3.2.0",
|
|
91
91
|
"@types/mui-datatables": "^4.3.12",
|
|
@@ -216,34 +216,36 @@ export default function DIDConnectContainer({
|
|
|
216
216
|
slots={{
|
|
217
217
|
backdrop: BackdropWrap,
|
|
218
218
|
}}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
'
|
|
234
|
-
|
|
219
|
+
slotProps={{
|
|
220
|
+
paper: {
|
|
221
|
+
sx: mergeSx(
|
|
222
|
+
{
|
|
223
|
+
backgroundColor: 'background.default',
|
|
224
|
+
borderRadius: 3, // 保持跟 DID Wallet 一致
|
|
225
|
+
borderBottomLeftRadius: 0,
|
|
226
|
+
borderBottomRightRadius: 0,
|
|
227
|
+
p: '2px',
|
|
228
|
+
'.did-connect__root': {
|
|
229
|
+
backgroundColor: 'transparent',
|
|
230
|
+
},
|
|
231
|
+
overflow: 'hidden',
|
|
232
|
+
animation: open ? 'glowBreathe 7s linear infinite' : 'none',
|
|
233
|
+
'@keyframes glowBreathe': {
|
|
234
|
+
'0%, 100%': {
|
|
235
|
+
boxShadow: `
|
|
235
236
|
inset 0 0 7px ${hexToRgba(color, 0.3)},
|
|
236
237
|
inset 0 0 12px ${hexToRgba(color, 0.3)}`,
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
},
|
|
239
|
+
'50%': {
|
|
240
|
+
boxShadow: `
|
|
240
241
|
inset 0 0 18px ${hexToRgba(color, 0.7)},
|
|
241
242
|
inset 0 0 24px ${hexToRgba(color, 0.5)}`,
|
|
243
|
+
},
|
|
242
244
|
},
|
|
243
245
|
},
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
246
|
+
slotProps?.containerDrawer?.sx
|
|
247
|
+
),
|
|
248
|
+
},
|
|
247
249
|
}}>
|
|
248
250
|
{hideCloseButton ? null : (
|
|
249
251
|
<Box
|
|
@@ -19,6 +19,8 @@ export default function DIDConnectFooter({
|
|
|
19
19
|
currentAppColor?: string;
|
|
20
20
|
sx?: SxProps;
|
|
21
21
|
}) {
|
|
22
|
+
// 使用当前应用的配置,不用跟随主站变化
|
|
23
|
+
const blocklet = globalThis?.blocklet;
|
|
22
24
|
const browser = useBrowser();
|
|
23
25
|
const rootRef = useRef<HTMLDivElement>(null);
|
|
24
26
|
const size = useSize(rootRef);
|
|
@@ -35,11 +37,12 @@ export default function DIDConnectFooter({
|
|
|
35
37
|
sx={mergeSx(
|
|
36
38
|
{
|
|
37
39
|
display: 'flex',
|
|
38
|
-
justifyContent: 'space-between',
|
|
40
|
+
justifyContent: blocklet?.settings?.didConnect?.showAppInfo === false ? 'center' : 'space-between',
|
|
39
41
|
alignItems: 'center',
|
|
40
42
|
gap: 1,
|
|
41
43
|
fontSize: 12,
|
|
42
|
-
backgroundColor:
|
|
44
|
+
backgroundColor:
|
|
45
|
+
blocklet?.settings?.didConnect?.showDidColor === false ? 'grey.50' : hexToRgba(currentAppColor, 0.08),
|
|
43
46
|
// 需要保持跟 .did-connect__root 的规则一样
|
|
44
47
|
mx: isSmallView ? -2 : -3,
|
|
45
48
|
// eslint-disable-next-line no-nested-ternary
|
|
@@ -56,14 +59,16 @@ export default function DIDConnectFooter({
|
|
|
56
59
|
sx
|
|
57
60
|
)}
|
|
58
61
|
className="did-connect__footer">
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
{blocklet?.settings?.didConnect?.showAppInfo === false ? null : (
|
|
63
|
+
<AppInfoItem
|
|
64
|
+
appInfo={currentAppInfo}
|
|
65
|
+
appLogo={<AppIcon appInfo={currentAppInfo} size={24} sx={{ flexShrink: 0 }} />}
|
|
66
|
+
sx={{
|
|
67
|
+
flex: 1,
|
|
68
|
+
overflow: 'hidden',
|
|
69
|
+
}}
|
|
70
|
+
/>
|
|
71
|
+
)}
|
|
67
72
|
|
|
68
73
|
<PoweredBy sx={{ maxWidth: '100%', justifyContent: 'end' }} />
|
|
69
74
|
</Box>
|
|
@@ -123,39 +123,64 @@ export default function withContainer(Component: React.ComponentType<any>) {
|
|
|
123
123
|
|
|
124
124
|
const backgroundGlow = `linear-gradient(45deg, ${colorListGlow.join(', ')})`;
|
|
125
125
|
|
|
126
|
-
const glowStyle =
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
126
|
+
const glowStyle =
|
|
127
|
+
rest.blocklet?.settings?.didConnect?.showDidColor === false
|
|
128
|
+
? {}
|
|
129
|
+
: {
|
|
130
|
+
overflow: 'visible',
|
|
131
|
+
'&::before, &::after': {
|
|
132
|
+
content: '""',
|
|
133
|
+
position: 'absolute',
|
|
134
|
+
top: '-3px',
|
|
135
|
+
right: '-3px',
|
|
136
|
+
bottom: '-3px',
|
|
137
|
+
left: '-3px',
|
|
138
|
+
background,
|
|
139
|
+
backgroundSize: '300% 300%',
|
|
140
|
+
backgroundRepeat: 'no-repeat',
|
|
141
|
+
animation: 'glowRotate 10s linear infinite',
|
|
142
|
+
borderRadius: '14px !important',
|
|
143
|
+
zIndex: 0,
|
|
144
|
+
},
|
|
145
|
+
'&::after': {
|
|
146
|
+
background: backgroundGlow,
|
|
147
|
+
filter: 'blur(15px)',
|
|
148
|
+
},
|
|
146
149
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
150
|
+
'@keyframes glowRotate': {
|
|
151
|
+
'0%': {
|
|
152
|
+
backgroundPosition: '0 0',
|
|
153
|
+
},
|
|
154
|
+
'50%': {
|
|
155
|
+
backgroundPosition: '100% 0',
|
|
156
|
+
},
|
|
157
|
+
'100%': {
|
|
158
|
+
backgroundPosition: '0 0',
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
const glowBorderStyle =
|
|
163
|
+
rest.blocklet?.settings?.didConnect?.showDidColor === false
|
|
164
|
+
? {}
|
|
165
|
+
: {
|
|
166
|
+
animation: 'glowBreathe 7s linear infinite',
|
|
167
|
+
'.did-connect__root': {
|
|
168
|
+
backgroundColor: 'transparent',
|
|
169
|
+
},
|
|
170
|
+
overflow: 'hidden',
|
|
171
|
+
'@keyframes glowBreathe': {
|
|
172
|
+
'0%, 100%': {
|
|
173
|
+
boxShadow: `
|
|
174
|
+
inset 0 0 7px ${hexToRgba(color, 0.3)},
|
|
175
|
+
inset 0 0 12px ${hexToRgba(color, 0.3)}`,
|
|
176
|
+
},
|
|
177
|
+
'50%': {
|
|
178
|
+
boxShadow: `
|
|
179
|
+
inset 0 0 18px ${hexToRgba(color, 0.7)},
|
|
180
|
+
inset 0 0 24px ${hexToRgba(color, 0.5)}`,
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
};
|
|
159
184
|
|
|
160
185
|
const wrapOnClose = useMemoizedFn(() => {
|
|
161
186
|
removeMagicToken();
|
|
@@ -199,28 +224,15 @@ export default function withContainer(Component: React.ComponentType<any>) {
|
|
|
199
224
|
slots={{
|
|
200
225
|
backdrop: BackdropWrap,
|
|
201
226
|
}}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
},
|
|
212
|
-
overflow: 'hidden',
|
|
213
|
-
'@keyframes glowBreathe': {
|
|
214
|
-
'0%, 100%': {
|
|
215
|
-
boxShadow: `
|
|
216
|
-
inset 0 0 7px ${hexToRgba(color, 0.3)},
|
|
217
|
-
inset 0 0 12px ${hexToRgba(color, 0.3)}`,
|
|
218
|
-
},
|
|
219
|
-
'50%': {
|
|
220
|
-
boxShadow: `
|
|
221
|
-
inset 0 0 18px ${hexToRgba(color, 0.7)},
|
|
222
|
-
inset 0 0 24px ${hexToRgba(color, 0.5)}`,
|
|
223
|
-
},
|
|
227
|
+
slotProps={{
|
|
228
|
+
paper: {
|
|
229
|
+
sx: {
|
|
230
|
+
backgroundColor: 'background.default',
|
|
231
|
+
borderRadius: 3, // 保持跟 DID Wallet 一致
|
|
232
|
+
borderBottomLeftRadius: 0,
|
|
233
|
+
borderBottomRightRadius: 0,
|
|
234
|
+
p: '2px',
|
|
235
|
+
...glowBorderStyle,
|
|
224
236
|
},
|
|
225
237
|
},
|
|
226
238
|
}}>
|
package/src/Util/constant.ts
CHANGED
|
@@ -41,6 +41,7 @@ export const LOGIN_PROVIDER_NAME = {
|
|
|
41
41
|
[LOGIN_PROVIDER.NFT]: 'NFT',
|
|
42
42
|
[LOGIN_PROVIDER.PASSKEY]: 'Passkey',
|
|
43
43
|
[LOGIN_PROVIDER.TWITTER]: 'X (Twitter)',
|
|
44
|
+
federated: 'Federated',
|
|
44
45
|
};
|
|
45
46
|
|
|
46
47
|
// HACK: 目前这里的键值不能使用 [LOGIN_PROVIDER.AUTH0] 形式,否则会影响 ts 的 keyof typeof OAUTH_PROVIDER 来获取键值作为类型的判断
|