@arcblock/did-connect-react 3.4.13 → 3.4.15
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/Connect/components/login-item/connect-choose-list.js +111 -111
- package/lib/Connect/components/login-item/connect-provider-list.js +180 -180
- package/lib/Connect/components/login-item/mobile-login-item.js +56 -56
- package/lib/Connect/components/login-item/passkey-login-item.js +27 -29
- package/lib/Connect/components/login-item/web-login-item.js +31 -29
- package/lib/Connect/connect.js +202 -197
- package/lib/Connect/contexts/state.js +19 -17
- package/lib/Connect/hooks/provider-list.js +33 -33
- package/lib/Connect/plugins/email/list-item.js +14 -14
- package/lib/Connect/plugins/email/placeholder.js +77 -76
- package/lib/package.json.js +1 -1
- package/package.json +8 -8
- package/src/Connect/components/login-item/connect-choose-list.jsx +14 -3
- package/src/Connect/components/login-item/connect-provider-list.jsx +14 -3
- package/src/Connect/components/login-item/mobile-login-item.jsx +5 -2
- package/src/Connect/components/login-item/passkey-login-item.jsx +7 -5
- package/src/Connect/components/login-item/web-login-item.jsx +4 -2
- package/src/Connect/connect.jsx +21 -3
- package/src/Connect/contexts/state.jsx +3 -2
- package/src/Connect/hooks/provider-list.js +6 -3
- package/src/Connect/plugins/email/list-item.jsx +1 -0
- package/src/Connect/plugins/email/placeholder.jsx +7 -0
package/lib/Connect/connect.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { jsx as t, jsxs as b, Fragment as
|
|
2
|
-
import { use as
|
|
1
|
+
import { jsx as t, jsxs as b, Fragment as Ge } from "react/jsx-runtime";
|
|
2
|
+
import { use as Ye, useRef as ae, useState as Ke, useEffect as le } from "react";
|
|
3
3
|
import e from "prop-types";
|
|
4
|
-
import { Box as i, Skeleton as
|
|
5
|
-
import { useUpdate as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { DID_CONNECT_MEDIUM_WIDTH as
|
|
10
|
-
import
|
|
11
|
-
import { DIDConnectFooter as
|
|
12
|
-
import { useTheme as
|
|
13
|
-
import
|
|
4
|
+
import { Box as i, Skeleton as Qe, Divider as Xe } from "@mui/material";
|
|
5
|
+
import { useUpdate as Je, useMemoizedFn as S, useSize as Ze, useCreation as d, useMount as ue, useDebounceFn as $e, usePrevious as et, useUpdateEffect as tt } from "ahooks";
|
|
6
|
+
import w from "lodash/noop";
|
|
7
|
+
import ot from "lodash/isUndefined";
|
|
8
|
+
import rt from "@arcblock/ux/lib/CloseButton";
|
|
9
|
+
import { WALLET_LOGIN_METHOD as nt, LAST_USED_LOGIN_METHOD as st, DID_CONNECT_MEDIUM_WIDTH as F, LOGIN_PROVIDER_NAME as it, DID_CONNECT_SMALL_WIDTH as ct, OAUTH_PROVIDER as j, LOGIN_PROVIDER as at } from "@arcblock/ux/lib/Util/constant";
|
|
10
|
+
import lt from "@arcblock/ux/lib/QRCode";
|
|
11
|
+
import { DIDConnectFooter as ut } from "@arcblock/ux/lib/DIDConnect";
|
|
12
|
+
import { useTheme as dt } from "@arcblock/ux/lib/Theme";
|
|
13
|
+
import ft from "@arcblock/ux/lib/DIDConnect/provider-icon";
|
|
14
14
|
import "@fontsource/lexend/400.css";
|
|
15
15
|
import "@fontsource/lexend/600.css";
|
|
16
|
-
import { SessionContext as
|
|
17
|
-
import { StateProvider as
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import { useOAuth as
|
|
22
|
-
import
|
|
23
|
-
import { usePasskey as
|
|
24
|
-
import { CHECK_STATUS_INTERVAL as
|
|
16
|
+
import { SessionContext as mt } from "../Session/context.js";
|
|
17
|
+
import { StateProvider as pt, useStateContext as ht } from "./contexts/state.js";
|
|
18
|
+
import gt from "./components/login-item/connect-provider-list.js";
|
|
19
|
+
import bt from "./components/auto-height.js";
|
|
20
|
+
import xt from "./hooks/token.js";
|
|
21
|
+
import { useOAuth as Ct } from "../OAuth/context.js";
|
|
22
|
+
import St from "./components/connect-status.js";
|
|
23
|
+
import { usePasskey as wt } from "../Passkey/context.js";
|
|
24
|
+
import { CHECK_STATUS_INTERVAL as yt, API_DID_PREFIX as kt, BUSY_STATUS as I, DEFAULT_TIMEOUT as It } from "../constant.js";
|
|
25
25
|
import "../utils.js";
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
26
|
+
import _t from "./components/did-connect-title.js";
|
|
27
|
+
import Tt from "./components/download-tips.js";
|
|
28
|
+
import Dt from "./hooks/provider-list.js";
|
|
29
|
+
import Ot from "./hooks/auth-url.js";
|
|
30
30
|
import { getWalletDid as vt } from "../User/use-did.js";
|
|
31
31
|
import Pt from "./fallback-connect.js";
|
|
32
|
-
import { getWebWalletUrl as
|
|
32
|
+
import { getWebWalletUrl as Rt } from "@arcblock/ux/lib/Util/wallet";
|
|
33
33
|
function de({
|
|
34
34
|
hideCloseButton: y = !1,
|
|
35
|
-
mode:
|
|
36
|
-
action:
|
|
37
|
-
baseUrl:
|
|
38
|
-
checkFn:
|
|
39
|
-
checkInterval:
|
|
40
|
-
checkTimeout:
|
|
41
|
-
prefix:
|
|
35
|
+
mode: h = "dialog",
|
|
36
|
+
action: _,
|
|
37
|
+
baseUrl: x = "",
|
|
38
|
+
checkFn: T,
|
|
39
|
+
checkInterval: D = yt,
|
|
40
|
+
checkTimeout: O = It * 1e3,
|
|
41
|
+
prefix: v = kt,
|
|
42
42
|
tokenKey: B = "_t_",
|
|
43
43
|
locale: q = "en",
|
|
44
44
|
encKey: fe = "_ek_",
|
|
@@ -47,45 +47,48 @@ function de({
|
|
|
47
47
|
saveConnect: pe = !0,
|
|
48
48
|
useSocket: he = !0,
|
|
49
49
|
allowWallet: V = !0,
|
|
50
|
-
provider:
|
|
51
|
-
messages:
|
|
52
|
-
passkeyBehavior:
|
|
53
|
-
webWalletUrl:
|
|
50
|
+
provider: ge = "",
|
|
51
|
+
messages: f = {},
|
|
52
|
+
passkeyBehavior: G = "none",
|
|
53
|
+
webWalletUrl: be = Rt(),
|
|
54
54
|
enabledConnectTypes: xe = ["web", "mobile", ...Object.keys(j)],
|
|
55
|
-
extraContent:
|
|
56
|
-
disableSwitchApp:
|
|
55
|
+
extraContent: Y = null,
|
|
56
|
+
disableSwitchApp: P = !1,
|
|
57
57
|
magicToken: K = void 0,
|
|
58
58
|
customItems: Ce = [],
|
|
59
|
-
onClose:
|
|
60
|
-
onError: Q =
|
|
61
|
-
onSuccess:
|
|
62
|
-
onRecreateSession:
|
|
63
|
-
setColor:
|
|
59
|
+
onClose: R = w,
|
|
60
|
+
onError: Q = w,
|
|
61
|
+
onSuccess: A = w,
|
|
62
|
+
onRecreateSession: Se = w,
|
|
63
|
+
setColor: we = w
|
|
64
64
|
}) {
|
|
65
|
-
const
|
|
66
|
-
t:
|
|
67
|
-
staticState:
|
|
68
|
-
connectState:
|
|
69
|
-
extraParams:
|
|
70
|
-
currentAppInfo:
|
|
71
|
-
currentAppColor:
|
|
65
|
+
const W = dt(), X = Je(), ye = Ye(mt), ke = vt(ye?.session?.user), {
|
|
66
|
+
t: J,
|
|
67
|
+
staticState: Ie,
|
|
68
|
+
connectState: n,
|
|
69
|
+
extraParams: _e,
|
|
70
|
+
currentAppInfo: Te,
|
|
71
|
+
currentAppColor: E,
|
|
72
72
|
// 插件相关
|
|
73
|
-
selectedPlugin:
|
|
74
|
-
blocklet:
|
|
75
|
-
masterBlocklet:
|
|
76
|
-
showWalletOptions:
|
|
77
|
-
setShowWalletOptions:
|
|
78
|
-
lastLoginMethod:
|
|
79
|
-
} =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
73
|
+
selectedPlugin: c,
|
|
74
|
+
blocklet: Z,
|
|
75
|
+
masterBlocklet: De,
|
|
76
|
+
showWalletOptions: m,
|
|
77
|
+
setShowWalletOptions: Oe,
|
|
78
|
+
lastLoginMethod: ve
|
|
79
|
+
} = ht(), Pe = S((...g) => {
|
|
80
|
+
const u = n.walletMethod || nt.SCAN;
|
|
81
|
+
return localStorage.setItem(st, u), A(...g);
|
|
82
|
+
}), { state: o, generate: $, cancelWhenScanned: Re } = xt({
|
|
83
|
+
action: _,
|
|
84
|
+
baseUrl: x,
|
|
85
|
+
checkFn: T,
|
|
86
|
+
checkInterval: D,
|
|
87
|
+
checkTimeout: O,
|
|
88
|
+
extraParams: _e,
|
|
89
|
+
prefix: v,
|
|
87
90
|
onError: Q,
|
|
88
|
-
onSuccess:
|
|
91
|
+
onSuccess: Pe,
|
|
89
92
|
locale: q,
|
|
90
93
|
tokenKey: B,
|
|
91
94
|
encKey: fe,
|
|
@@ -93,117 +96,119 @@ function de({
|
|
|
93
96
|
forceConnected: H === !0 ? ke || !0 : H,
|
|
94
97
|
saveConnect: pe,
|
|
95
98
|
useSocket: he,
|
|
96
|
-
provider:
|
|
97
|
-
}),
|
|
99
|
+
provider: ge
|
|
100
|
+
}), L = ae(!1), ee = ae(null), C = Ze(ee), te = d(() => C ? C.width < F - 50 : !0, [C, C?.width]), [oe, Ae] = Ke(!1);
|
|
98
101
|
ue(() => {
|
|
99
|
-
|
|
102
|
+
Ae(C?.width < F - 50);
|
|
100
103
|
});
|
|
101
|
-
const { oauthState:
|
|
104
|
+
const { oauthState: a, setBaseUrl: We } = Ct(), { passkeyState: l, setTargetAppPid: Ee } = wt();
|
|
102
105
|
ue(() => {
|
|
103
|
-
|
|
106
|
+
We(x), Ee(Z?.appPid), o.reset(), a.reset(), l.reset();
|
|
104
107
|
}), le(() => {
|
|
105
|
-
|
|
106
|
-
}, [
|
|
107
|
-
const
|
|
108
|
-
confirm:
|
|
109
|
-
success:
|
|
110
|
-
error:
|
|
108
|
+
we(E);
|
|
109
|
+
}, [E]);
|
|
110
|
+
const Le = d(() => ({
|
|
111
|
+
confirm: f.confirm,
|
|
112
|
+
success: f.success,
|
|
113
|
+
error: c?.state?.error || o.error || l.error || a.error || ""
|
|
111
114
|
}), [
|
|
112
|
-
|
|
113
|
-
|
|
115
|
+
f.confirm,
|
|
116
|
+
f.success,
|
|
114
117
|
o.error,
|
|
115
|
-
|
|
118
|
+
a.error,
|
|
116
119
|
l.error,
|
|
117
|
-
|
|
118
|
-
]),
|
|
119
|
-
|
|
120
|
-
}),
|
|
121
|
-
|
|
122
|
-
}),
|
|
123
|
-
|
|
124
|
-
}),
|
|
120
|
+
c?.state?.error
|
|
121
|
+
]), k = d(() => I.includes(l.status) || I.includes(a.status) || I.includes(o.status) || I.includes(c?.state?.computedStatus), [o.status, a.status, l.status, c?.state?.computedStatus]), re = S(() => {
|
|
122
|
+
n.chooseMethod = "wallet", n.walletMethod = "", Se();
|
|
123
|
+
}), ne = S(async () => {
|
|
124
|
+
re(), a.reset(), l.reset(), await $(!1);
|
|
125
|
+
}), Me = S(() => {
|
|
126
|
+
n?.retryConnect();
|
|
127
|
+
}), ze = S(() => {
|
|
128
|
+
re(), a.reset(), l.reset(), c?.state?.reset(), Ie.current.cancelCount++, Re();
|
|
129
|
+
}), { run: Ne } = $e(
|
|
125
130
|
() => {
|
|
126
|
-
|
|
131
|
+
L.current || o.status === "timeout" && (L.current = !0, o.reset(), ne(), L.current = !1);
|
|
127
132
|
},
|
|
128
133
|
{ leading: !0, trailing: !1 }
|
|
129
134
|
);
|
|
130
|
-
le(
|
|
131
|
-
const
|
|
135
|
+
le(Ne, [o.status]);
|
|
136
|
+
const Ue = d(() => it[n.chooseMethod] || "DID Wallet", [n.chooseMethod]), { providerList: Fe, hideQRCode: p, hideChooseList: r, loadingProviderList: je } = Dt({
|
|
132
137
|
action: o.action,
|
|
133
|
-
sourceAppPid:
|
|
138
|
+
sourceAppPid: n?.sourceAppPid,
|
|
134
139
|
allowWallet: V,
|
|
135
|
-
passkeyBehavior:
|
|
136
|
-
mode:
|
|
137
|
-
blocklet:
|
|
138
|
-
isSmallView:
|
|
139
|
-
lastLoginMethod:
|
|
140
|
-
}),
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}, [
|
|
144
|
-
const
|
|
145
|
-
const
|
|
146
|
-
return parseInt(
|
|
147
|
-
},
|
|
148
|
-
|
|
140
|
+
passkeyBehavior: G,
|
|
141
|
+
mode: h,
|
|
142
|
+
blocklet: n?.sourceAppPid ? De : Z,
|
|
143
|
+
isSmallView: te,
|
|
144
|
+
lastLoginMethod: ve
|
|
145
|
+
}), Be = et(n?.sourceAppPid);
|
|
146
|
+
tt(() => {
|
|
147
|
+
ot(Be) || $();
|
|
148
|
+
}, [n?.sourceAppPid]);
|
|
149
|
+
const s = (g) => {
|
|
150
|
+
const u = W.spacing(g);
|
|
151
|
+
return parseInt(u, 10);
|
|
152
|
+
}, qe = d(() => y ? null : /* @__PURE__ */ t(
|
|
153
|
+
rt,
|
|
149
154
|
{
|
|
150
|
-
onClose:
|
|
155
|
+
onClose: R,
|
|
151
156
|
sx: {
|
|
152
157
|
position: "absolute",
|
|
153
158
|
right: 14,
|
|
154
159
|
top: 14
|
|
155
160
|
}
|
|
156
161
|
}
|
|
157
|
-
), [y,
|
|
162
|
+
), [y, R]), He = /* @__PURE__ */ t(
|
|
158
163
|
i,
|
|
159
164
|
{
|
|
160
165
|
sx: {
|
|
161
166
|
flex: 1,
|
|
162
|
-
display:
|
|
167
|
+
display: k ? "flex" : "none",
|
|
163
168
|
alignItems: "center",
|
|
164
169
|
justifyContent: "center"
|
|
165
170
|
},
|
|
166
171
|
children: /* @__PURE__ */ t(i, { children: /* @__PURE__ */ t(
|
|
167
|
-
|
|
172
|
+
St,
|
|
168
173
|
{
|
|
169
|
-
status:
|
|
174
|
+
status: c?.state?.computedStatus || a.status || l.status || o.status,
|
|
170
175
|
nextWorkflow: o.nextWorkflow,
|
|
171
176
|
mfaCode: o.mfaCode,
|
|
172
|
-
onCancel:
|
|
173
|
-
onRetry:
|
|
174
|
-
onClose:
|
|
175
|
-
messages:
|
|
177
|
+
onCancel: ze,
|
|
178
|
+
onRetry: Me,
|
|
179
|
+
onClose: R,
|
|
180
|
+
messages: Le,
|
|
176
181
|
locale: q,
|
|
177
182
|
className: "did-connect__auth-status auth-status",
|
|
178
|
-
loadingIcon:
|
|
179
|
-
chooseMethod:
|
|
180
|
-
hideRetry:
|
|
183
|
+
loadingIcon: n.chooseMethod ? /* @__PURE__ */ t(ft, { provider: n.chooseMethod, sx: { color: "text.primary" } }) : null,
|
|
184
|
+
chooseMethod: Ue,
|
|
185
|
+
hideRetry: n.chooseMethod === "email",
|
|
181
186
|
hideBack: !!K
|
|
182
187
|
}
|
|
183
188
|
) })
|
|
184
189
|
}
|
|
185
|
-
),
|
|
186
|
-
const
|
|
187
|
-
let
|
|
188
|
-
return
|
|
190
|
+
), se = Ot({ disableSwitchApp: P, tokenState: o }), M = d(() => {
|
|
191
|
+
const g = W.mode === "dark" ? W.palette.grey[600] : "white";
|
|
192
|
+
let u = r ? 240 - s(3) * 2 : 196 - s(2) * 2, U = r ? 3 : 2;
|
|
193
|
+
return m && (U = 1, u += s(U) * 2), /* @__PURE__ */ t(
|
|
189
194
|
i,
|
|
190
195
|
{
|
|
191
196
|
className: "did-connect__qrcode",
|
|
192
197
|
sx: {
|
|
193
198
|
p: U,
|
|
194
|
-
width: (r ? 240 : 196) +
|
|
195
|
-
height: (r ? 240 : 196) +
|
|
199
|
+
width: (r ? 240 : 196) + s(1) * 2,
|
|
200
|
+
height: (r ? 240 : 196) + s(1) * 2
|
|
196
201
|
},
|
|
197
202
|
children: o.url ? /* @__PURE__ */ t(
|
|
198
|
-
|
|
203
|
+
lt,
|
|
199
204
|
{
|
|
200
|
-
data:
|
|
201
|
-
size:
|
|
205
|
+
data: se,
|
|
206
|
+
size: u,
|
|
202
207
|
sx: {
|
|
203
|
-
width:
|
|
204
|
-
height:
|
|
208
|
+
width: u + s(1) * 2,
|
|
209
|
+
height: u + s(1) * 2,
|
|
205
210
|
flex: 1,
|
|
206
|
-
backgroundColor:
|
|
211
|
+
backgroundColor: g,
|
|
207
212
|
p: 1,
|
|
208
213
|
fontSize: 0,
|
|
209
214
|
textAlign: "center",
|
|
@@ -214,21 +219,21 @@ function de({
|
|
|
214
219
|
},
|
|
215
220
|
config: {
|
|
216
221
|
backgroundOptions: {
|
|
217
|
-
color:
|
|
222
|
+
color: g
|
|
218
223
|
}
|
|
219
224
|
}
|
|
220
225
|
}
|
|
221
226
|
) : /* @__PURE__ */ t(
|
|
222
|
-
|
|
227
|
+
Qe,
|
|
223
228
|
{
|
|
224
229
|
animation: "wave",
|
|
225
230
|
variant: "rectangular",
|
|
226
231
|
sx: {
|
|
227
232
|
position: "absolute",
|
|
228
|
-
left:
|
|
229
|
-
right:
|
|
230
|
-
top:
|
|
231
|
-
bottom:
|
|
233
|
+
left: s(2) + 1,
|
|
234
|
+
right: s(2) + 1,
|
|
235
|
+
top: s(2) + 1,
|
|
236
|
+
bottom: s(2) + 1,
|
|
232
237
|
borderRadius: 1,
|
|
233
238
|
zIndex: 1,
|
|
234
239
|
width: "auto",
|
|
@@ -238,7 +243,7 @@ function de({
|
|
|
238
243
|
)
|
|
239
244
|
}
|
|
240
245
|
);
|
|
241
|
-
}, [
|
|
246
|
+
}, [se, r, m]), Ve = d(() => r ? "column-reverse" : !p && oe ? "column" : "row", [r, oe, p]), ie = d(() => M ? /* @__PURE__ */ t(
|
|
242
247
|
i,
|
|
243
248
|
{
|
|
244
249
|
sx: {
|
|
@@ -255,7 +260,7 @@ function de({
|
|
|
255
260
|
sx: {
|
|
256
261
|
fontSize: 0,
|
|
257
262
|
position: "relative",
|
|
258
|
-
...
|
|
263
|
+
...m ? {
|
|
259
264
|
mt: r ? 4 : 2.5,
|
|
260
265
|
mb: 0
|
|
261
266
|
} : {
|
|
@@ -264,7 +269,7 @@ function de({
|
|
|
264
269
|
}
|
|
265
270
|
},
|
|
266
271
|
children: [
|
|
267
|
-
|
|
272
|
+
M,
|
|
268
273
|
/* @__PURE__ */ b(
|
|
269
274
|
i,
|
|
270
275
|
{
|
|
@@ -274,7 +279,7 @@ function de({
|
|
|
274
279
|
fontSize: 12,
|
|
275
280
|
zIndex: 1,
|
|
276
281
|
whiteSpace: "nowrap",
|
|
277
|
-
...
|
|
282
|
+
...m ? {
|
|
278
283
|
top: r ? -8 : -4,
|
|
279
284
|
transform: "translateY(-100%)"
|
|
280
285
|
} : {
|
|
@@ -286,11 +291,11 @@ function de({
|
|
|
286
291
|
textAlign: "center"
|
|
287
292
|
},
|
|
288
293
|
children: [
|
|
289
|
-
|
|
294
|
+
J("scanWithWallet1"),
|
|
290
295
|
" ",
|
|
291
|
-
/* @__PURE__ */ t(
|
|
296
|
+
/* @__PURE__ */ t(Tt, {}),
|
|
292
297
|
" ",
|
|
293
|
-
|
|
298
|
+
J("scanWithWallet2")
|
|
294
299
|
]
|
|
295
300
|
}
|
|
296
301
|
)
|
|
@@ -298,25 +303,25 @@ function de({
|
|
|
298
303
|
}
|
|
299
304
|
)
|
|
300
305
|
}
|
|
301
|
-
) : null, [
|
|
306
|
+
) : null, [M, r, m]), z = /* @__PURE__ */ b(
|
|
302
307
|
i,
|
|
303
308
|
{
|
|
304
309
|
className: "did-connect__body",
|
|
305
310
|
sx: {
|
|
306
311
|
display: "flex",
|
|
307
|
-
flexDirection:
|
|
312
|
+
flexDirection: Ve,
|
|
308
313
|
justifyContent: "center",
|
|
309
314
|
alignItems: "stretch",
|
|
310
315
|
flex: 1,
|
|
311
|
-
gap: !
|
|
316
|
+
gap: !p && te ? 0 : 1.5,
|
|
312
317
|
overflow: "visible",
|
|
313
318
|
px: r ? 2 : 0
|
|
314
319
|
},
|
|
315
320
|
children: [
|
|
316
|
-
!
|
|
317
|
-
|
|
321
|
+
!k && !p ? /* @__PURE__ */ b(Ge, { children: [
|
|
322
|
+
ie,
|
|
318
323
|
r ? null : /* @__PURE__ */ t(i, { children: /* @__PURE__ */ t(
|
|
319
|
-
|
|
324
|
+
Xe,
|
|
320
325
|
{
|
|
321
326
|
orientation: "vertical",
|
|
322
327
|
sx: {
|
|
@@ -338,34 +343,34 @@ function de({
|
|
|
338
343
|
flex: 1
|
|
339
344
|
},
|
|
340
345
|
children: [
|
|
341
|
-
|
|
346
|
+
He,
|
|
342
347
|
/* @__PURE__ */ t(
|
|
343
|
-
|
|
348
|
+
gt,
|
|
344
349
|
{
|
|
345
350
|
slotProps: {
|
|
346
351
|
root: {
|
|
347
|
-
sx: [
|
|
352
|
+
sx: [k ? { display: "none" } : {}]
|
|
348
353
|
}
|
|
349
354
|
},
|
|
350
355
|
allowWallet: V,
|
|
351
|
-
size:
|
|
356
|
+
size: p && h !== "dialog" ? "normal" : "small",
|
|
352
357
|
tokenState: o,
|
|
353
|
-
hideQRCode:
|
|
354
|
-
messages:
|
|
358
|
+
hideQRCode: p,
|
|
359
|
+
messages: f,
|
|
355
360
|
tokenKey: B,
|
|
356
|
-
onSuccess:
|
|
357
|
-
passkeyBehavior:
|
|
358
|
-
webWalletUrl:
|
|
359
|
-
extraContent:
|
|
361
|
+
onSuccess: A,
|
|
362
|
+
passkeyBehavior: G,
|
|
363
|
+
webWalletUrl: be,
|
|
364
|
+
extraContent: Y,
|
|
360
365
|
enabledConnectTypes: xe,
|
|
361
366
|
onReset: ne,
|
|
362
|
-
disableSwitchApp:
|
|
363
|
-
forceUpdate:
|
|
367
|
+
disableSwitchApp: P,
|
|
368
|
+
forceUpdate: X,
|
|
364
369
|
magicToken: K,
|
|
365
|
-
baseUrl:
|
|
370
|
+
baseUrl: x,
|
|
366
371
|
customItems: Ce,
|
|
367
|
-
providerList:
|
|
368
|
-
qrcode:
|
|
372
|
+
providerList: Fe,
|
|
373
|
+
qrcode: ie
|
|
369
374
|
}
|
|
370
375
|
)
|
|
371
376
|
]
|
|
@@ -374,18 +379,18 @@ function de({
|
|
|
374
379
|
]
|
|
375
380
|
}
|
|
376
381
|
);
|
|
377
|
-
let
|
|
378
|
-
|
|
379
|
-
fallback:
|
|
380
|
-
forceUpdate:
|
|
381
|
-
onSuccess:
|
|
382
|
+
let N = z;
|
|
383
|
+
c ? N = c.renderPlaceholder({
|
|
384
|
+
fallback: z,
|
|
385
|
+
forceUpdate: X,
|
|
386
|
+
onSuccess: A,
|
|
382
387
|
onError: Q
|
|
383
|
-
}) :
|
|
384
|
-
const
|
|
385
|
-
return
|
|
388
|
+
}) : N = z;
|
|
389
|
+
const ce = p || k ? ct : F;
|
|
390
|
+
return je ? /* @__PURE__ */ t(Pt, {}) : /* @__PURE__ */ b(
|
|
386
391
|
i,
|
|
387
392
|
{
|
|
388
|
-
ref:
|
|
393
|
+
ref: ee,
|
|
389
394
|
className: "did-connect__root",
|
|
390
395
|
sx: {
|
|
391
396
|
backgroundColor: "background.default",
|
|
@@ -396,7 +401,7 @@ function de({
|
|
|
396
401
|
maxWidth: "100%",
|
|
397
402
|
width: (
|
|
398
403
|
// eslint-disable-next-line no-nested-ternary
|
|
399
|
-
|
|
404
|
+
h === "drawer" ? "100%" : m ? ce - 20 : ce
|
|
400
405
|
),
|
|
401
406
|
transition: "width 0.2s ease-in-out",
|
|
402
407
|
margin: "auto",
|
|
@@ -407,19 +412,19 @@ function de({
|
|
|
407
412
|
children: [
|
|
408
413
|
/* @__PURE__ */ t(i, { "data-did-auth-url": o.url, sx: { display: "none" } }),
|
|
409
414
|
/* @__PURE__ */ t(
|
|
410
|
-
|
|
415
|
+
_t,
|
|
411
416
|
{
|
|
412
|
-
title:
|
|
413
|
-
description:
|
|
414
|
-
extraContent:
|
|
415
|
-
disableSwitchApp:
|
|
416
|
-
showWalletOptions:
|
|
417
|
-
onBack: () =>
|
|
417
|
+
title: f.title,
|
|
418
|
+
description: f.scan,
|
|
419
|
+
extraContent: Y,
|
|
420
|
+
disableSwitchApp: P,
|
|
421
|
+
showWalletOptions: m,
|
|
422
|
+
onBack: () => Oe(!1)
|
|
418
423
|
}
|
|
419
424
|
),
|
|
420
|
-
/* @__PURE__ */ t(
|
|
421
|
-
/* @__PURE__ */ t(
|
|
422
|
-
|
|
425
|
+
/* @__PURE__ */ t(bt, { initHeight: 72, children: N }),
|
|
426
|
+
/* @__PURE__ */ t(ut, { currentAppInfo: Te, currentAppColor: E }),
|
|
427
|
+
qe
|
|
423
428
|
]
|
|
424
429
|
}
|
|
425
430
|
);
|
|
@@ -446,7 +451,7 @@ de.propTypes = {
|
|
|
446
451
|
enabledConnectTypes: e.arrayOf(e.oneOf(["web", "mobile", ...Object.keys(j)])),
|
|
447
452
|
webWalletUrl: e.string,
|
|
448
453
|
allowWallet: e.bool,
|
|
449
|
-
provider: e.oneOf([
|
|
454
|
+
provider: e.oneOf([at.WALLET, ...Object.keys(j), ""]),
|
|
450
455
|
hideCloseButton: e.bool,
|
|
451
456
|
disableSwitchApp: e.bool,
|
|
452
457
|
onClose: e.func,
|
|
@@ -457,18 +462,18 @@ de.propTypes = {
|
|
|
457
462
|
magicToken: e.string,
|
|
458
463
|
customItems: e.arrayOf(e.node)
|
|
459
464
|
};
|
|
460
|
-
function
|
|
461
|
-
const { checkFn:
|
|
462
|
-
if (typeof
|
|
465
|
+
function At({ testOnlyBorderColor: y = void 0, ...h }) {
|
|
466
|
+
const { checkFn: _, extraParams: x = {}, blocklet: T, masterBlocklet: D, action: O, locale: v = "en" } = h;
|
|
467
|
+
if (typeof _ != "function")
|
|
463
468
|
throw new Error("Cannot initialize did connect component without a fetchFn");
|
|
464
469
|
return /* @__PURE__ */ t(
|
|
465
|
-
|
|
470
|
+
pt,
|
|
466
471
|
{
|
|
467
|
-
blocklet:
|
|
468
|
-
masterBlocklet:
|
|
469
|
-
action:
|
|
470
|
-
locale:
|
|
471
|
-
extraParams:
|
|
472
|
+
blocklet: T,
|
|
473
|
+
masterBlocklet: D,
|
|
474
|
+
action: O,
|
|
475
|
+
locale: v,
|
|
476
|
+
extraParams: x,
|
|
472
477
|
testOnlyBorderColor: y,
|
|
473
478
|
sx: {
|
|
474
479
|
position: "relative",
|
|
@@ -482,11 +487,11 @@ function Dt({ testOnlyBorderColor: y = void 0, ...p }) {
|
|
|
482
487
|
boxSizing: "border-box"
|
|
483
488
|
}
|
|
484
489
|
},
|
|
485
|
-
children: /* @__PURE__ */ t(de, { ...
|
|
490
|
+
children: /* @__PURE__ */ t(de, { ...h })
|
|
486
491
|
}
|
|
487
492
|
);
|
|
488
493
|
}
|
|
489
|
-
|
|
494
|
+
At.propTypes = {
|
|
490
495
|
checkFn: e.func.isRequired,
|
|
491
496
|
extraParams: e.object,
|
|
492
497
|
blocklet: e.object.isRequired,
|
|
@@ -496,5 +501,5 @@ Dt.propTypes = {
|
|
|
496
501
|
testOnlyBorderColor: e.string
|
|
497
502
|
};
|
|
498
503
|
export {
|
|
499
|
-
|
|
504
|
+
At as default
|
|
500
505
|
};
|