@arcblock/did-connect-react 3.3.0 → 3.3.2
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/did-connect-title.js +5 -4
- package/lib/Connect/components/login-item/connect-choose-list.js +86 -86
- package/lib/Connect/components/login-item/connect-provider-list.js +98 -94
- package/lib/Connect/components/login-item/login-method-item.js +22 -21
- package/lib/Connect/components/login-item/mobile-login-item.js +47 -47
- package/lib/Connect/components/login-item/web-login-item.js +40 -40
- package/lib/Connect/index.js +59 -59
- package/lib/Connect/plugins/email/list-item.js +10 -10
- package/lib/Passkey/context.js +64 -63
- package/lib/package.json.js +1 -1
- package/package.json +5 -5
- package/src/Connect/components/did-connect-title.jsx +1 -0
- package/src/Connect/components/login-item/connect-choose-list.jsx +5 -5
- package/src/Connect/components/login-item/connect-provider-list.jsx +11 -7
- package/src/Connect/components/login-item/login-method-item.jsx +4 -3
- package/src/Connect/components/login-item/mobile-login-item.jsx +5 -5
- package/src/Connect/components/login-item/web-login-item.jsx +6 -6
- package/src/Connect/index.jsx +2 -2
- package/src/Connect/plugins/email/list-item.jsx +2 -2
- package/src/Passkey/context.jsx +3 -0
package/lib/package.json.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/did-connect-react",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.2",
|
|
4
4
|
"description": "Client side library to work with DID Connect by ArcBlock.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"url": "https://github.com/ArcBlock/ux/issues"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@arcblock/bridge": "3.3.
|
|
35
|
+
"@arcblock/bridge": "3.3.2",
|
|
36
36
|
"@arcblock/did": "^1.27.16",
|
|
37
|
-
"@arcblock/icons": "3.3.
|
|
38
|
-
"@arcblock/react-hooks": "3.3.
|
|
37
|
+
"@arcblock/icons": "3.3.2",
|
|
38
|
+
"@arcblock/react-hooks": "3.3.2",
|
|
39
39
|
"@arcblock/ws": "^1.27.16",
|
|
40
40
|
"@blocklet/constant": "^1.17.6",
|
|
41
41
|
"@fontsource/lexend": "^5.2.9",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
82
82
|
"jest": "^29.7.0"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "0a3aee5692710315a10f418105054a7241301020"
|
|
85
85
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import { Box } from '@mui/material';
|
|
3
|
-
import { LOGIN_PROVIDER, LOGIN_PROVIDER_NAME } from '@arcblock/ux/lib/Util/constant';
|
|
3
|
+
import { LOGIN_PROVIDER, LOGIN_PROVIDER_ICON_SIZE, LOGIN_PROVIDER_NAME } from '@arcblock/ux/lib/Util/constant';
|
|
4
4
|
import { getWebWalletUrl } from '@arcblock/ux/lib/Util/wallet';
|
|
5
5
|
import noop from 'lodash/noop';
|
|
6
6
|
import { useMemoizedFn } from 'ahooks';
|
|
@@ -229,8 +229,8 @@ export default function ConnectChooseList({
|
|
|
229
229
|
provider={item.provider}
|
|
230
230
|
sx={{
|
|
231
231
|
transform: 'scale(0.95)',
|
|
232
|
-
width:
|
|
233
|
-
height:
|
|
232
|
+
width: LOGIN_PROVIDER_ICON_SIZE,
|
|
233
|
+
height: LOGIN_PROVIDER_ICON_SIZE,
|
|
234
234
|
color: 'text.primary',
|
|
235
235
|
}}
|
|
236
236
|
/>
|
|
@@ -266,9 +266,9 @@ export default function ConnectChooseList({
|
|
|
266
266
|
slotProps={{
|
|
267
267
|
icon: {
|
|
268
268
|
sx: {
|
|
269
|
-
fontSize:
|
|
269
|
+
fontSize: LOGIN_PROVIDER_ICON_SIZE,
|
|
270
270
|
'& svg': {
|
|
271
|
-
fontSize:
|
|
271
|
+
fontSize: LOGIN_PROVIDER_ICON_SIZE,
|
|
272
272
|
width: '1em',
|
|
273
273
|
height: '1em',
|
|
274
274
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import { Box } from '@mui/material';
|
|
3
|
-
import { LOGIN_PROVIDER, LOGIN_PROVIDER_NAME } from '@arcblock/ux/lib/Util/constant';
|
|
3
|
+
import { LOGIN_PROVIDER, LOGIN_PROVIDER_NAME, LOGIN_PROVIDER_ICON_SIZE } from '@arcblock/ux/lib/Util/constant';
|
|
4
4
|
import { checkSameProtocol, getWebWalletUrl } from '@arcblock/ux/lib/Util/wallet';
|
|
5
5
|
import noop from 'lodash/noop';
|
|
6
6
|
import { useMemoizedFn } from 'ahooks';
|
|
@@ -237,9 +237,9 @@ export default function ConnectProviderList({
|
|
|
237
237
|
slotProps={{
|
|
238
238
|
icon: {
|
|
239
239
|
sx: {
|
|
240
|
-
fontSize:
|
|
240
|
+
fontSize: LOGIN_PROVIDER_ICON_SIZE,
|
|
241
241
|
'& svg': {
|
|
242
|
-
fontSize:
|
|
242
|
+
fontSize: LOGIN_PROVIDER_ICON_SIZE,
|
|
243
243
|
width: '1em',
|
|
244
244
|
height: '1em',
|
|
245
245
|
},
|
|
@@ -272,8 +272,8 @@ export default function ConnectProviderList({
|
|
|
272
272
|
provider={item.provider}
|
|
273
273
|
sx={{
|
|
274
274
|
transform: 'scale(0.95)',
|
|
275
|
-
width:
|
|
276
|
-
height:
|
|
275
|
+
width: LOGIN_PROVIDER_ICON_SIZE,
|
|
276
|
+
height: LOGIN_PROVIDER_ICON_SIZE,
|
|
277
277
|
color: 'text.primary',
|
|
278
278
|
}}
|
|
279
279
|
/>
|
|
@@ -284,7 +284,7 @@ export default function ConnectProviderList({
|
|
|
284
284
|
handleLoginOAuth(item);
|
|
285
285
|
};
|
|
286
286
|
}}
|
|
287
|
-
sx={[size === 'small' ? { p: 1 } : { p: 2 }]}
|
|
287
|
+
sx={[size === 'small' ? { p: 1.2 } : { p: 2 }]}
|
|
288
288
|
/>
|
|
289
289
|
);
|
|
290
290
|
}
|
|
@@ -313,10 +313,14 @@ export default function ConnectProviderList({
|
|
|
313
313
|
sx={{
|
|
314
314
|
display: 'grid',
|
|
315
315
|
gridTemplateColumns: 'repeat(12, 1fr)' /* 灵活的12列基础网格 */,
|
|
316
|
-
gap: 1.
|
|
316
|
+
gap: 1.5,
|
|
317
317
|
'.arc-login-item:nth-child(-n+3)': {
|
|
318
318
|
gridColumn: 'span 12',
|
|
319
319
|
},
|
|
320
|
+
// 当登录项大于等于 5 时,第三个登录项增加一个 marginBottom,用于分割独占一行的和一行多个的登录项
|
|
321
|
+
'.arc-login-item:nth-child(3):nth-last-child(n+3)': {
|
|
322
|
+
mb: 1,
|
|
323
|
+
},
|
|
320
324
|
'.arc-login-item:nth-child(4):last-child': {
|
|
321
325
|
gridColumn: 'span 12',
|
|
322
326
|
},
|
|
@@ -3,6 +3,7 @@ import { Icon } from '@iconify/react';
|
|
|
3
3
|
import { isValidElement } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { mergeSx } from '@arcblock/ux/lib/Util/style';
|
|
6
|
+
import { LOGIN_PROVIDER_ICON_SIZE } from '@arcblock/ux/lib/Util/constant';
|
|
6
7
|
import ArrowRightAltRoundedIcon from '@iconify-icons/material-symbols/arrow-right-alt-rounded';
|
|
7
8
|
|
|
8
9
|
export default function LoginMethodItem({
|
|
@@ -26,7 +27,7 @@ export default function LoginMethodItem({
|
|
|
26
27
|
alignItems: 'center',
|
|
27
28
|
gap: 1,
|
|
28
29
|
cursor: 'pointer',
|
|
29
|
-
p: 1,
|
|
30
|
+
p: 1.2,
|
|
30
31
|
borderRadius: 1,
|
|
31
32
|
backgroundColor: 'grey.50',
|
|
32
33
|
textDecoration: 'none',
|
|
@@ -69,8 +70,8 @@ export default function LoginMethodItem({
|
|
|
69
70
|
icon={icon}
|
|
70
71
|
sx={{
|
|
71
72
|
transform: `scale(${iconScale})`,
|
|
72
|
-
width:
|
|
73
|
-
height:
|
|
73
|
+
width: LOGIN_PROVIDER_ICON_SIZE,
|
|
74
|
+
height: LOGIN_PROVIDER_ICON_SIZE,
|
|
74
75
|
}}
|
|
75
76
|
/>
|
|
76
77
|
)}
|
|
@@ -7,7 +7,7 @@ import noop from 'lodash/noop';
|
|
|
7
7
|
import { useImperativeHandle } from 'react';
|
|
8
8
|
import { mergeSx } from '@arcblock/ux/lib/Util/style';
|
|
9
9
|
import ProviderIcon from '@arcblock/ux/lib/DIDConnect/provider-icon';
|
|
10
|
-
import { LOGIN_PROVIDER } from '@arcblock/ux/lib/Util/constant';
|
|
10
|
+
import { LOGIN_PROVIDER, LOGIN_PROVIDER_ICON_SIZE } from '@arcblock/ux/lib/Util/constant';
|
|
11
11
|
|
|
12
12
|
import { useStateContext } from '../../contexts/state';
|
|
13
13
|
import LoginMethodItem from './login-method-item';
|
|
@@ -145,7 +145,7 @@ export default function MobileLoginItem({
|
|
|
145
145
|
currentState.loading || !tokenState.url ? (
|
|
146
146
|
<CircularProgress
|
|
147
147
|
color="primary"
|
|
148
|
-
size={
|
|
148
|
+
size={LOGIN_PROVIDER_ICON_SIZE}
|
|
149
149
|
sx={{
|
|
150
150
|
'& svg': {
|
|
151
151
|
transform: 'scale(0.75)',
|
|
@@ -154,10 +154,10 @@ export default function MobileLoginItem({
|
|
|
154
154
|
/>
|
|
155
155
|
) : (
|
|
156
156
|
<ProviderIcon
|
|
157
|
-
width="24px"
|
|
158
|
-
height="24px"
|
|
159
157
|
provider={LOGIN_PROVIDER.DID_WALLET}
|
|
160
|
-
|
|
158
|
+
sx={{
|
|
159
|
+
width: LOGIN_PROVIDER_ICON_SIZE,
|
|
160
|
+
height: LOGIN_PROVIDER_ICON_SIZE,
|
|
161
161
|
transform: 'scale(0.9)',
|
|
162
162
|
}}
|
|
163
163
|
/>
|
|
@@ -7,7 +7,7 @@ import noop from 'lodash/noop';
|
|
|
7
7
|
import omit from 'lodash/omit';
|
|
8
8
|
import { useImperativeHandle } from 'react';
|
|
9
9
|
import ProviderIcon from '@arcblock/ux/lib/DIDConnect/provider-icon';
|
|
10
|
-
import { LOGIN_PROVIDER } from '@arcblock/ux/lib/Util/constant';
|
|
10
|
+
import { LOGIN_PROVIDER, LOGIN_PROVIDER_ICON_SIZE } from '@arcblock/ux/lib/Util/constant';
|
|
11
11
|
|
|
12
12
|
import LoginMethodItem from './login-method-item';
|
|
13
13
|
import { useStateContext } from '../../contexts/state';
|
|
@@ -116,7 +116,7 @@ export default function WebLoginItem({
|
|
|
116
116
|
currentState.loading || !tokenState.url ? (
|
|
117
117
|
<CircularProgress
|
|
118
118
|
color="primary"
|
|
119
|
-
size={
|
|
119
|
+
size={LOGIN_PROVIDER_ICON_SIZE}
|
|
120
120
|
sx={{
|
|
121
121
|
'& svg': {
|
|
122
122
|
transform: 'scale(0.75)',
|
|
@@ -125,12 +125,12 @@ export default function WebLoginItem({
|
|
|
125
125
|
/>
|
|
126
126
|
) : (
|
|
127
127
|
<ProviderIcon
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
style={{
|
|
128
|
+
sx={{
|
|
129
|
+
width: LOGIN_PROVIDER_ICON_SIZE,
|
|
130
|
+
height: LOGIN_PROVIDER_ICON_SIZE,
|
|
132
131
|
transform: 'scale(0.9)',
|
|
133
132
|
}}
|
|
133
|
+
provider={LOGIN_PROVIDER.DID_WALLET}
|
|
134
134
|
/>
|
|
135
135
|
)
|
|
136
136
|
}
|
package/src/Connect/index.jsx
CHANGED
|
@@ -482,9 +482,9 @@ function Connect({
|
|
|
482
482
|
mode === 'drawer' ? '100%' : hideQRCode || showStatus ? DID_CONNECT_SMALL_WIDTH : DID_CONNECT_MEDIUM_WIDTH,
|
|
483
483
|
transition: 'width 0.2s ease-in-out',
|
|
484
484
|
margin: 'auto',
|
|
485
|
-
p:
|
|
485
|
+
p: 3,
|
|
486
486
|
pb: 0,
|
|
487
|
-
gap: 2,
|
|
487
|
+
gap: 2.5,
|
|
488
488
|
}}>
|
|
489
489
|
<Box data-did-auth-url={state.url} sx={{ display: 'none' }} />
|
|
490
490
|
<DIDConnectTitle
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import { useMemoizedFn } from 'ahooks';
|
|
3
|
-
import
|
|
3
|
+
import mailFilledIcon from '@iconify-icons/tabler/mail-filled';
|
|
4
4
|
import { LOGIN_PROVIDER, LOGIN_PROVIDER_NAME } from '@arcblock/ux/lib/Util/constant';
|
|
5
5
|
import { GA_LAST_LOGIN_METHOD } from '@arcblock/ux/lib/withTracker/constant';
|
|
6
6
|
|
|
@@ -22,7 +22,7 @@ export default function EmailListItem({ ...rest }) {
|
|
|
22
22
|
<LoginMethodItem
|
|
23
23
|
{...rest}
|
|
24
24
|
title={LOGIN_PROVIDER_NAME[LOGIN_PROVIDER.EMAIL]}
|
|
25
|
-
icon={
|
|
25
|
+
icon={mailFilledIcon}
|
|
26
26
|
onClick={handleConnect}
|
|
27
27
|
/>
|
|
28
28
|
);
|
package/src/Passkey/context.jsx
CHANGED
|
@@ -204,6 +204,7 @@ function PasskeyProvider({
|
|
|
204
204
|
return result;
|
|
205
205
|
} catch (err) {
|
|
206
206
|
// Check if this is a WebAuthn specific error
|
|
207
|
+
console.error('passkey.create.error', err);
|
|
207
208
|
if (err.name) {
|
|
208
209
|
throw new Error(getWebAuthnErrorMessage(err, t('createPasskeyFailed'), t));
|
|
209
210
|
}
|
|
@@ -232,6 +233,7 @@ function PasskeyProvider({
|
|
|
232
233
|
return result;
|
|
233
234
|
} catch (err) {
|
|
234
235
|
// Check if this is a WebAuthn specific error
|
|
236
|
+
console.error('passkey.auth.error', err);
|
|
235
237
|
if (err.name) {
|
|
236
238
|
throw new Error(getWebAuthnErrorMessage(err, t('verifyPasskeyFailed'), t));
|
|
237
239
|
}
|
|
@@ -333,6 +335,7 @@ function PasskeyProvider({
|
|
|
333
335
|
return result;
|
|
334
336
|
} catch (err) {
|
|
335
337
|
// Use the WebAuthn specific error handler if the error has a name property (WebAuthn errors do)
|
|
338
|
+
console.error('passkey.login.error', err);
|
|
336
339
|
const errMsg = getWebAuthnErrorMessage(err, t('verifyPasskeyFailed'), t);
|
|
337
340
|
state.baseUrl = backupBaseUrl;
|
|
338
341
|
throw new Error(errMsg);
|