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