@abtnode/ux 1.16.24 → 1.16.25-beta-fe54d1bc
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/es/blocklet/component/component-cell.js +2 -1
- package/es/blocklet/component/index.js +1 -4
- package/es/hooks/blocklet.js +6 -3
- package/es/locales/ar.js +3 -1
- package/es/locales/de.js +3 -1
- package/es/locales/en.js +3 -1
- package/es/locales/es.js +3 -1
- package/es/locales/fr.js +3 -1
- package/es/locales/hi.js +3 -1
- package/es/locales/i18n.db +0 -0
- package/es/locales/id.js +3 -1
- package/es/locales/ja.js +3 -1
- package/es/locales/ko.js +3 -1
- package/es/locales/pt.js +3 -1
- package/es/locales/ru.js +3 -1
- package/es/locales/th.js +3 -1
- package/es/locales/vi.js +3 -1
- package/es/locales/zh-tw.js +3 -1
- package/es/locales/zh.js +3 -1
- package/es/lost-passport.js +82 -42
- package/es/team/members/index.js +1 -0
- package/lib/blocklet/component/component-cell.js +2 -1
- package/lib/blocklet/component/index.js +1 -4
- package/lib/hooks/blocklet.js +6 -3
- package/lib/locales/ar.js +3 -1
- package/lib/locales/de.js +3 -1
- package/lib/locales/en.js +3 -1
- package/lib/locales/es.js +3 -1
- package/lib/locales/fr.js +3 -1
- package/lib/locales/hi.js +3 -1
- package/lib/locales/i18n.db +0 -0
- package/lib/locales/id.js +3 -1
- package/lib/locales/ja.js +3 -1
- package/lib/locales/ko.js +3 -1
- package/lib/locales/pt.js +3 -1
- package/lib/locales/ru.js +3 -1
- package/lib/locales/th.js +3 -1
- package/lib/locales/vi.js +3 -1
- package/lib/locales/zh-tw.js +3 -1
- package/lib/locales/zh.js +3 -1
- package/lib/lost-passport.js +80 -41
- package/lib/team/members/index.js +1 -1
- package/package.json +17 -18
|
@@ -247,9 +247,10 @@ export default function ComponentCell({
|
|
|
247
247
|
justifyContent: "flex-start",
|
|
248
248
|
alignItems: "center",
|
|
249
249
|
children: [/*#__PURE__*/_jsxs(Box, {
|
|
250
|
+
pl: 2,
|
|
250
251
|
width: {
|
|
251
252
|
xs: 300,
|
|
252
|
-
md:
|
|
253
|
+
md: 400
|
|
253
254
|
},
|
|
254
255
|
display: "flex",
|
|
255
256
|
alignItems: "center",
|
|
@@ -392,10 +392,7 @@ export default function BlockletComponent({
|
|
|
392
392
|
})
|
|
393
393
|
}), !!blocklet.site.rules.length && /*#__PURE__*/_jsx(Box, {
|
|
394
394
|
mt: 0,
|
|
395
|
-
ml:
|
|
396
|
-
xs: '-16px',
|
|
397
|
-
md: '-28px'
|
|
398
|
-
},
|
|
395
|
+
ml: -1.5,
|
|
399
396
|
children: /*#__PURE__*/_jsx(RuleList, {})
|
|
400
397
|
}), !!updateConfirm && /*#__PURE__*/_jsx(Dialog, {
|
|
401
398
|
open: true,
|
package/es/hooks/blocklet.js
CHANGED
|
@@ -46,7 +46,8 @@ export function useBlocklet({
|
|
|
46
46
|
useSubscription,
|
|
47
47
|
getIP,
|
|
48
48
|
useLocaleContext,
|
|
49
|
-
disableSubscription
|
|
49
|
+
disableSubscription,
|
|
50
|
+
getOptionalComponents
|
|
50
51
|
}) {
|
|
51
52
|
const {
|
|
52
53
|
t,
|
|
@@ -76,7 +77,8 @@ export function useBlocklet({
|
|
|
76
77
|
} = await client.getBlocklet({
|
|
77
78
|
input: {
|
|
78
79
|
did,
|
|
79
|
-
attachRuntimeInfo: true
|
|
80
|
+
attachRuntimeInfo: true,
|
|
81
|
+
getOptionalComponents
|
|
80
82
|
}
|
|
81
83
|
});
|
|
82
84
|
await fixBlocklet(data, {
|
|
@@ -128,7 +130,8 @@ export function useBlocklet({
|
|
|
128
130
|
blocklet: data
|
|
129
131
|
} = await client.getBlocklet({
|
|
130
132
|
input: {
|
|
131
|
-
did
|
|
133
|
+
did,
|
|
134
|
+
getOptionalComponents
|
|
132
135
|
}
|
|
133
136
|
});
|
|
134
137
|
if (data) {
|
package/es/locales/ar.js
CHANGED
|
@@ -1444,7 +1444,9 @@ export default {
|
|
|
1444
1444
|
scan: 'استخدم محفظة DID الخاصة بك للمطالبة بالجواز السفر',
|
|
1445
1445
|
confirm: 'قم بتأكيد على محفظتك الرقمية DID',
|
|
1446
1446
|
success: 'تمت إضافة جواز السفر بنجاح في محفظتك',
|
|
1447
|
-
loginWithPassport: 'اتصِل بجواز السفر هذا'
|
|
1447
|
+
loginWithPassport: 'اتصِل بجواز السفر هذا',
|
|
1448
|
+
autoClose: 'سيتم إغلاق الصفحة تلقائيًا في {seconds} ثانية',
|
|
1449
|
+
autoJump: 'سوف يتم الانتقال التلقائي للصفحة في {seconds} ثانية.'
|
|
1448
1450
|
}
|
|
1449
1451
|
},
|
|
1450
1452
|
lostPassport: {
|
package/es/locales/de.js
CHANGED
|
@@ -1444,7 +1444,9 @@ export default {
|
|
|
1444
1444
|
scan: 'Verwenden Sie Ihre DID-Brieftasche, um den Reisepass zu beantragen',
|
|
1445
1445
|
confirm: 'Bestätigen Sie auf Ihrer DID Wallet',
|
|
1446
1446
|
success: 'Der Reisepass wurde erfolgreich zu Ihrer Brieftasche hinzugefügt',
|
|
1447
|
-
loginWithPassport: 'Verbinden Sie sich mit diesem Reisepass'
|
|
1447
|
+
loginWithPassport: 'Verbinden Sie sich mit diesem Reisepass',
|
|
1448
|
+
autoClose: 'Die Seite schließt automatisch in {seconds}s',
|
|
1449
|
+
autoJump: 'Die Seite wird in {seconds}s automatisch weitergeleitet.'
|
|
1448
1450
|
}
|
|
1449
1451
|
},
|
|
1450
1452
|
lostPassport: {
|
package/es/locales/en.js
CHANGED
|
@@ -1436,7 +1436,9 @@ export default {
|
|
|
1436
1436
|
scan: 'Use your DID Wallet to claim the passport',
|
|
1437
1437
|
confirm: 'Confirm on your DID Wallet',
|
|
1438
1438
|
success: 'The passport has been successfully added in your wallet',
|
|
1439
|
-
loginWithPassport: 'Connect with this Passport'
|
|
1439
|
+
loginWithPassport: 'Connect with this Passport',
|
|
1440
|
+
autoClose: 'Page will auto close in {seconds}s',
|
|
1441
|
+
autoJump: 'Page will auto jump in {seconds}s'
|
|
1440
1442
|
}
|
|
1441
1443
|
},
|
|
1442
1444
|
lostPassport: {
|
package/es/locales/es.js
CHANGED
|
@@ -1444,7 +1444,9 @@ export default {
|
|
|
1444
1444
|
scan: 'Utiliza tu Billetera DID para reclamar el pasaporte',
|
|
1445
1445
|
confirm: 'Confirma en tu billetera de DID',
|
|
1446
1446
|
success: 'El pasaporte se ha añadido correctamente a tu billetera',
|
|
1447
|
-
loginWithPassport: 'Conéctate con este Pasaporte'
|
|
1447
|
+
loginWithPassport: 'Conéctate con este Pasaporte',
|
|
1448
|
+
autoClose: 'La página se cerrará automáticamente en {seconds}s',
|
|
1449
|
+
autoJump: 'La página saltará automáticamente en {seconds}s'
|
|
1448
1450
|
}
|
|
1449
1451
|
},
|
|
1450
1452
|
lostPassport: {
|
package/es/locales/fr.js
CHANGED
|
@@ -1444,7 +1444,9 @@ export default {
|
|
|
1444
1444
|
scan: 'Utilisez votre portefeuille DID pour demander le passeport',
|
|
1445
1445
|
confirm: 'Confirmez sur votre portefeuille DID',
|
|
1446
1446
|
success: 'Le passeport a été ajouté avec succès à votre portefeuille',
|
|
1447
|
-
loginWithPassport: 'Connectez-vous avec ce passeport'
|
|
1447
|
+
loginWithPassport: 'Connectez-vous avec ce passeport',
|
|
1448
|
+
autoClose: 'La page se fermera automatiquement dans {seconds}s',
|
|
1449
|
+
autoJump: 'La page sera automatiquement sautée dans {seconds}s.'
|
|
1448
1450
|
}
|
|
1449
1451
|
},
|
|
1450
1452
|
lostPassport: {
|
package/es/locales/hi.js
CHANGED
|
@@ -1444,7 +1444,9 @@ export default {
|
|
|
1444
1444
|
scan: 'अपने डीआईडी वॉलेट का उपयोग करें और पासपोर्ट का दावा करें',
|
|
1445
1445
|
confirm: 'अपने डीआईड़ वॉलेट पर पुष्टि करें',
|
|
1446
1446
|
success: 'आपकी वॉलेट में पासपोर्ट सफलतापूर्वक जोड़ा गया है',
|
|
1447
|
-
loginWithPassport: 'इस पासपोर्ट से जुड़ें'
|
|
1447
|
+
loginWithPassport: 'इस पासपोर्ट से जुड़ें',
|
|
1448
|
+
autoClose: '{seconds}सेकंड में पेज आपूर्ति हो जाएगा',
|
|
1449
|
+
autoJump: 'पृष्ठ {seconds} सेकंड में ऑटोमेटिक जंप करेगा।'
|
|
1448
1450
|
}
|
|
1449
1451
|
},
|
|
1450
1452
|
lostPassport: {
|
package/es/locales/i18n.db
CHANGED
|
Binary file
|
package/es/locales/id.js
CHANGED
|
@@ -1444,7 +1444,9 @@ export default {
|
|
|
1444
1444
|
scan: 'Gunakan Dompet DID Anda untuk mengklaim paspor',
|
|
1445
1445
|
confirm: 'Konfirmasi di Dompet DID Anda',
|
|
1446
1446
|
success: 'Paspor telah berhasil ditambahkan di dompet Anda',
|
|
1447
|
-
loginWithPassport: 'Hubungkan dengan paspor ini'
|
|
1447
|
+
loginWithPassport: 'Hubungkan dengan paspor ini',
|
|
1448
|
+
autoClose: 'Halaman akan ditutup otomatis dalam {seconds}s',
|
|
1449
|
+
autoJump: 'Halaman akan otomatis loncat dalam {seconds}s'
|
|
1448
1450
|
}
|
|
1449
1451
|
},
|
|
1450
1452
|
lostPassport: {
|
package/es/locales/ja.js
CHANGED
|
@@ -1444,7 +1444,9 @@ export default {
|
|
|
1444
1444
|
scan: 'パスポートを請求するためにあなたのDIDウォレットを使用してください',
|
|
1445
1445
|
confirm: 'あなたのDIDウォレットで確認してください',
|
|
1446
1446
|
success: 'パスポートがウォレットに正常に追加されました',
|
|
1447
|
-
loginWithPassport: 'このパスポートで接続してください'
|
|
1447
|
+
loginWithPassport: 'このパスポートで接続してください',
|
|
1448
|
+
autoClose: '{seconds}秒後にページが自動的に閉じます',
|
|
1449
|
+
autoJump: '{seconds}s 後にページが自動的にジャンプします'
|
|
1448
1450
|
}
|
|
1449
1451
|
},
|
|
1450
1452
|
lostPassport: {
|
package/es/locales/ko.js
CHANGED
|
@@ -1444,7 +1444,9 @@ export default {
|
|
|
1444
1444
|
scan: 'DID 지갑을 사용하여 여권을 신청하세요',
|
|
1445
1445
|
confirm: '귀하의 DID 지갑에서 확인하십시오.',
|
|
1446
1446
|
success: '여권이 지갑에 성공적으로 추가되었습니다',
|
|
1447
|
-
loginWithPassport: '이 여권을 통해 연결하세요'
|
|
1447
|
+
loginWithPassport: '이 여권을 통해 연결하세요',
|
|
1448
|
+
autoClose: '{seconds}초 후에 페이지가 자동으로 닫힙니다',
|
|
1449
|
+
autoJump: '페이지는 {seconds}s 후에 자동으로 이동합니다'
|
|
1448
1450
|
}
|
|
1449
1451
|
},
|
|
1450
1452
|
lostPassport: {
|
package/es/locales/pt.js
CHANGED
|
@@ -1444,7 +1444,9 @@ export default {
|
|
|
1444
1444
|
scan: 'Use sua Carteira DID para solicitar o passaporte',
|
|
1445
1445
|
confirm: 'Confirme em sua Carteira DID',
|
|
1446
1446
|
success: 'O passaporte foi adicionado com sucesso em sua carteira',
|
|
1447
|
-
loginWithPassport: 'Conecte-se com este passaporte'
|
|
1447
|
+
loginWithPassport: 'Conecte-se com este passaporte',
|
|
1448
|
+
autoClose: 'A página será fechada automaticamente em {seconds}s',
|
|
1449
|
+
autoJump: 'A página será redirecionada automaticamente em {seconds}s'
|
|
1448
1450
|
}
|
|
1449
1451
|
},
|
|
1450
1452
|
lostPassport: {
|
package/es/locales/ru.js
CHANGED
|
@@ -1444,7 +1444,9 @@ export default {
|
|
|
1444
1444
|
scan: 'Используйте свой кошелек DID, чтобы получить паспорт',
|
|
1445
1445
|
confirm: 'Подтвердите на вашем кошельке DID',
|
|
1446
1446
|
success: 'Паспорт успешно добавлен в ваш кошелек',
|
|
1447
|
-
loginWithPassport: 'Подключитесь с помощью этого паспорта'
|
|
1447
|
+
loginWithPassport: 'Подключитесь с помощью этого паспорта',
|
|
1448
|
+
autoClose: 'Страница закроется автоматически через {seconds} секунд',
|
|
1449
|
+
autoJump: 'Страница автоматически перейдет через {seconds} секунд.'
|
|
1448
1450
|
}
|
|
1449
1451
|
},
|
|
1450
1452
|
lostPassport: {
|
package/es/locales/th.js
CHANGED
|
@@ -1444,7 +1444,9 @@ export default {
|
|
|
1444
1444
|
scan: 'ใช้กระเป๋าเงินดิจิตอลของคุณเพื่อเรียกร้องหนังสือเดินทาง',
|
|
1445
1445
|
confirm: 'ยืนยันในกระเป๋าเงิน DID ของคุณ',
|
|
1446
1446
|
success: 'หนังสือเดินทางถูกเพิ่มเข้าไปในกระเป๋าเงินของคุณเรียบร้อยแล้ว',
|
|
1447
|
-
loginWithPassport: 'เชื่อมต่อกับพาสปอร์ตนี้'
|
|
1447
|
+
loginWithPassport: 'เชื่อมต่อกับพาสปอร์ตนี้',
|
|
1448
|
+
autoClose: 'หน้าจอจะปิดอัตโนมัติในอีก {seconds}s',
|
|
1449
|
+
autoJump: 'หน้าจะกระโดดอัตโนมัติใน {seconds}s'
|
|
1448
1450
|
}
|
|
1449
1451
|
},
|
|
1450
1452
|
lostPassport: {
|
package/es/locales/vi.js
CHANGED
|
@@ -1444,7 +1444,9 @@ export default {
|
|
|
1444
1444
|
scan: 'Sử dụng Ví DID của bạn để yêu cầu hộ chiếu',
|
|
1445
1445
|
confirm: 'Xác nhận trên Ví DID của bạn',
|
|
1446
1446
|
success: 'Hộ chiếu đã được thêm vào ví của bạn thành công',
|
|
1447
|
-
loginWithPassport: 'Kết nối với hộ chiếu này'
|
|
1447
|
+
loginWithPassport: 'Kết nối với hộ chiếu này',
|
|
1448
|
+
autoClose: 'Trang sẽ tự đóng sau {seconds}s',
|
|
1449
|
+
autoJump: 'Trang sẽ tự động chuyển đến trong {seconds}s'
|
|
1448
1450
|
}
|
|
1449
1451
|
},
|
|
1450
1452
|
lostPassport: {
|
package/es/locales/zh-tw.js
CHANGED
|
@@ -1444,7 +1444,9 @@ export default {
|
|
|
1444
1444
|
scan: '使用您的DID錢包來申領護照',
|
|
1445
1445
|
confirm: '在你的 DID 錢包上確認',
|
|
1446
1446
|
success: '護照已成功添加到您的錢包',
|
|
1447
|
-
loginWithPassport: '連接到此護照'
|
|
1447
|
+
loginWithPassport: '連接到此護照',
|
|
1448
|
+
autoClose: '頁面將在 {seconds} 秒後自動關閉',
|
|
1449
|
+
autoJump: '頁面將在 {seconds} 秒後自動轉跳'
|
|
1448
1450
|
}
|
|
1449
1451
|
},
|
|
1450
1452
|
lostPassport: {
|
package/es/locales/zh.js
CHANGED
|
@@ -1451,7 +1451,9 @@ export default {
|
|
|
1451
1451
|
confirm: '在您的 DID 钱包上确认',
|
|
1452
1452
|
success: '通行证已成功添加到您的 DID 钱包',
|
|
1453
1453
|
loginWithPassport: '用此通行证连接',
|
|
1454
|
-
scan: '使用您的DID钱包来申领护照'
|
|
1454
|
+
scan: '使用您的DID钱包来申领护照',
|
|
1455
|
+
autoClose: '页面将在 {seconds} 秒后自动关闭',
|
|
1456
|
+
autoJump: '页面将在 {seconds} 秒后自动跳转'
|
|
1455
1457
|
}
|
|
1456
1458
|
},
|
|
1457
1459
|
lostPassport: {
|
package/es/lost-passport.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable react/no-unstable-nested-components */
|
|
2
|
-
import { useContext } from 'react';
|
|
2
|
+
import { useContext, useRef, useState } from 'react';
|
|
3
3
|
import styled from '@emotion/styled';
|
|
4
|
-
import {
|
|
4
|
+
import { Link } from 'react-router-dom';
|
|
5
5
|
import Typography from '@mui/material/Typography';
|
|
6
6
|
import Container from '@mui/material/Container';
|
|
7
7
|
import CheckCircleIcon from '@mui/icons-material/CheckCircle';
|
|
@@ -16,9 +16,9 @@ import Avatar from '@mui/material/Avatar';
|
|
|
16
16
|
import Button from '@arcblock/ux/lib/Button';
|
|
17
17
|
import { LocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
18
18
|
import useBrowser from '@arcblock/react-hooks/lib/useBrowser';
|
|
19
|
+
import { useCountDown, useReactive } from 'ahooks';
|
|
19
20
|
import DidConnect from '@arcblock/did-connect/lib/Connect';
|
|
20
|
-
import
|
|
21
|
-
import { useReactive } from 'ahooks';
|
|
21
|
+
import isFunction from 'lodash/isFunction';
|
|
22
22
|
import CardSelector from './card-selector';
|
|
23
23
|
import DidAddress from './did-address';
|
|
24
24
|
import wrapLocale from './wrap-locale';
|
|
@@ -29,6 +29,7 @@ const isFromWallet = () => {
|
|
|
29
29
|
const {
|
|
30
30
|
searchParams
|
|
31
31
|
} = new URL(window.location.href);
|
|
32
|
+
// NOTICE: 这个参数由钱包中拼接得来,用于判断是否来源于钱包客户端(可以走不同的处理逻辑)
|
|
32
33
|
return searchParams.get('fromWallet') === '1';
|
|
33
34
|
};
|
|
34
35
|
|
|
@@ -67,7 +68,8 @@ function LostPassport({
|
|
|
67
68
|
SessionContext,
|
|
68
69
|
webWalletUrl,
|
|
69
70
|
createPassportSvg,
|
|
70
|
-
passportColor
|
|
71
|
+
passportColor,
|
|
72
|
+
onLogin
|
|
71
73
|
}) {
|
|
72
74
|
const {
|
|
73
75
|
api,
|
|
@@ -79,6 +81,10 @@ function LostPassport({
|
|
|
79
81
|
success: false,
|
|
80
82
|
activeStep: 0
|
|
81
83
|
});
|
|
84
|
+
const staticState = useRef({
|
|
85
|
+
sessionToken: '',
|
|
86
|
+
refreshToken: ''
|
|
87
|
+
});
|
|
82
88
|
const {
|
|
83
89
|
setPassportId,
|
|
84
90
|
clearPassportId
|
|
@@ -87,10 +93,10 @@ function LostPassport({
|
|
|
87
93
|
t,
|
|
88
94
|
locale
|
|
89
95
|
} = useContext(LocaleContext);
|
|
90
|
-
const navigate = useNavigate();
|
|
91
96
|
const {
|
|
92
97
|
wallet: isWalletWebview
|
|
93
98
|
} = useBrowser();
|
|
99
|
+
const [leftTime, setLeftTime] = useState(0);
|
|
94
100
|
|
|
95
101
|
// eslint-disable-next-line no-undef
|
|
96
102
|
const {
|
|
@@ -105,36 +111,50 @@ function LostPassport({
|
|
|
105
111
|
const onSelectPassport = () => {
|
|
106
112
|
onNext();
|
|
107
113
|
};
|
|
108
|
-
const onReceivePassport = result => {
|
|
114
|
+
const onReceivePassport = (result, decrypt) => {
|
|
109
115
|
if (result?.passportId) {
|
|
110
116
|
setPassportId(result.passportId);
|
|
111
117
|
}
|
|
118
|
+
if (result?.sessionToken) {
|
|
119
|
+
staticState.current.sessionToken = decrypt(result.sessionToken);
|
|
120
|
+
}
|
|
121
|
+
if (result?.refreshToken) {
|
|
122
|
+
staticState.current.refreshToken = decrypt(result.refreshToken);
|
|
123
|
+
}
|
|
112
124
|
pageState.success = true;
|
|
113
125
|
onNext();
|
|
114
126
|
};
|
|
115
|
-
const
|
|
127
|
+
const safeLogout = () => {
|
|
128
|
+
return new Promise(resolve => {
|
|
129
|
+
try {
|
|
130
|
+
session.logout(() => {
|
|
131
|
+
resolve();
|
|
132
|
+
});
|
|
133
|
+
} catch (err) {
|
|
134
|
+
// Do nothing
|
|
135
|
+
resolve();
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
const onUsePassport = async () => {
|
|
116
140
|
if (isWalletWebview && isFromWallet()) {
|
|
117
141
|
import('dsbridge').then(jsBridge => {
|
|
118
142
|
jsBridge.call('arcClosePage');
|
|
119
143
|
});
|
|
120
144
|
return;
|
|
121
145
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
146
|
+
await safeLogout();
|
|
147
|
+
if (isFunction(onLogin)) {
|
|
148
|
+
onLogin({
|
|
149
|
+
sessionToken: staticState.current.sessionToken,
|
|
150
|
+
refreshToken: staticState.current.refreshToken
|
|
151
|
+
});
|
|
126
152
|
}
|
|
127
153
|
const redirect = searchParams.get('redirect');
|
|
128
154
|
if (redirect) {
|
|
129
155
|
window.location.replace(redirect);
|
|
130
156
|
return;
|
|
131
157
|
}
|
|
132
|
-
if ((window.env?.apiPrefix || '').startsWith(WELLKNOWN_SERVICE_PATH_PREFIX)) {
|
|
133
|
-
navigate(`${WELLKNOWN_SERVICE_PATH_PREFIX}/connect`, {
|
|
134
|
-
replace: true
|
|
135
|
-
});
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
158
|
|
|
139
159
|
// HACK: 因为默认页面不会处理 passportId 的逻辑,所以需要清除存储的信息
|
|
140
160
|
clearPassportId();
|
|
@@ -143,6 +163,12 @@ function LostPassport({
|
|
|
143
163
|
const handleChangePassport = event => {
|
|
144
164
|
pageState.passport = event.target.value;
|
|
145
165
|
};
|
|
166
|
+
const [countdown] = useCountDown({
|
|
167
|
+
leftTime,
|
|
168
|
+
onEnd: () => {
|
|
169
|
+
onUsePassport();
|
|
170
|
+
}
|
|
171
|
+
});
|
|
146
172
|
const steps = [{
|
|
147
173
|
label: t('lostPassport.selectPassport'),
|
|
148
174
|
content: () => {
|
|
@@ -264,31 +290,45 @@ function LostPassport({
|
|
|
264
290
|
}
|
|
265
291
|
}, {
|
|
266
292
|
label: t('common.complete'),
|
|
267
|
-
content: () =>
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
293
|
+
content: () => {
|
|
294
|
+
if (leftTime === 0) {
|
|
295
|
+
setLeftTime(3000);
|
|
296
|
+
}
|
|
297
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
298
|
+
textAlign: "center",
|
|
299
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
300
|
+
mb: 3,
|
|
301
|
+
color: "success.main",
|
|
302
|
+
children: /*#__PURE__*/_jsx(CheckCircleIcon, {
|
|
303
|
+
style: {
|
|
304
|
+
fontSize: 60
|
|
305
|
+
}
|
|
306
|
+
})
|
|
307
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
308
|
+
component: "p",
|
|
309
|
+
variant: "body1",
|
|
310
|
+
className: "subheader",
|
|
311
|
+
children: t('issuePassport.dialog.success')
|
|
312
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
313
|
+
component: "p",
|
|
314
|
+
variant: "body2",
|
|
315
|
+
color: "gray",
|
|
316
|
+
children: isWalletWebview && isFromWallet() ? t('issuePassport.dialog.autoClose', {
|
|
317
|
+
seconds: Math.round(countdown / 1000)
|
|
318
|
+
}) : t('issuePassport.dialog.autoJump', {
|
|
319
|
+
seconds: Math.round(countdown / 1000)
|
|
320
|
+
})
|
|
321
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
273
322
|
style: {
|
|
274
|
-
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
style: {
|
|
284
|
-
marginTop: 40
|
|
285
|
-
},
|
|
286
|
-
variant: "contained",
|
|
287
|
-
color: "primary",
|
|
288
|
-
onClick: onUsePassport,
|
|
289
|
-
children: t('issuePassport.dialog.loginWithPassport')
|
|
290
|
-
})]
|
|
291
|
-
})
|
|
323
|
+
marginTop: 40
|
|
324
|
+
},
|
|
325
|
+
variant: "contained",
|
|
326
|
+
color: "primary",
|
|
327
|
+
onClick: onUsePassport,
|
|
328
|
+
children: t('issuePassport.dialog.loginWithPassport')
|
|
329
|
+
})]
|
|
330
|
+
});
|
|
331
|
+
}
|
|
292
332
|
}];
|
|
293
333
|
return /*#__PURE__*/_jsx(Div, {
|
|
294
334
|
children: /*#__PURE__*/_jsxs("div", {
|
package/es/team/members/index.js
CHANGED
|
@@ -264,9 +264,10 @@ function ComponentCell(_ref) {
|
|
|
264
264
|
justifyContent: "flex-start",
|
|
265
265
|
alignItems: "center",
|
|
266
266
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
267
|
+
pl: 2,
|
|
267
268
|
width: {
|
|
268
269
|
xs: 300,
|
|
269
|
-
md:
|
|
270
|
+
md: 400
|
|
270
271
|
},
|
|
271
272
|
display: "flex",
|
|
272
273
|
alignItems: "center",
|
|
@@ -420,10 +420,7 @@ function BlockletComponent(_ref) {
|
|
|
420
420
|
})
|
|
421
421
|
}), !!blocklet.site.rules.length && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
422
422
|
mt: 0,
|
|
423
|
-
ml:
|
|
424
|
-
xs: '-16px',
|
|
425
|
-
md: '-28px'
|
|
426
|
-
},
|
|
423
|
+
ml: -1.5,
|
|
427
424
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ruleList.default, {})
|
|
428
425
|
}), !!updateConfirm && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.default, {
|
|
429
426
|
open: true,
|
package/lib/hooks/blocklet.js
CHANGED
|
@@ -62,7 +62,8 @@ function useBlocklet(_ref) {
|
|
|
62
62
|
useSubscription,
|
|
63
63
|
getIP,
|
|
64
64
|
useLocaleContext,
|
|
65
|
-
disableSubscription
|
|
65
|
+
disableSubscription,
|
|
66
|
+
getOptionalComponents
|
|
66
67
|
} = _ref;
|
|
67
68
|
const {
|
|
68
69
|
t,
|
|
@@ -95,7 +96,8 @@ function useBlocklet(_ref) {
|
|
|
95
96
|
} = await client.getBlocklet({
|
|
96
97
|
input: {
|
|
97
98
|
did,
|
|
98
|
-
attachRuntimeInfo: true
|
|
99
|
+
attachRuntimeInfo: true,
|
|
100
|
+
getOptionalComponents
|
|
99
101
|
}
|
|
100
102
|
});
|
|
101
103
|
await (0, _util2.fixBlocklet)(data, {
|
|
@@ -148,7 +150,8 @@ function useBlocklet(_ref) {
|
|
|
148
150
|
blocklet: data
|
|
149
151
|
} = await client.getBlocklet({
|
|
150
152
|
input: {
|
|
151
|
-
did
|
|
153
|
+
did,
|
|
154
|
+
getOptionalComponents
|
|
152
155
|
}
|
|
153
156
|
});
|
|
154
157
|
if (data) {
|
package/lib/locales/ar.js
CHANGED
|
@@ -1450,7 +1450,9 @@ var _default = exports.default = {
|
|
|
1450
1450
|
scan: 'استخدم محفظة DID الخاصة بك للمطالبة بالجواز السفر',
|
|
1451
1451
|
confirm: 'قم بتأكيد على محفظتك الرقمية DID',
|
|
1452
1452
|
success: 'تمت إضافة جواز السفر بنجاح في محفظتك',
|
|
1453
|
-
loginWithPassport: 'اتصِل بجواز السفر هذا'
|
|
1453
|
+
loginWithPassport: 'اتصِل بجواز السفر هذا',
|
|
1454
|
+
autoClose: 'سيتم إغلاق الصفحة تلقائيًا في {seconds} ثانية',
|
|
1455
|
+
autoJump: 'سوف يتم الانتقال التلقائي للصفحة في {seconds} ثانية.'
|
|
1454
1456
|
}
|
|
1455
1457
|
},
|
|
1456
1458
|
lostPassport: {
|
package/lib/locales/de.js
CHANGED
|
@@ -1450,7 +1450,9 @@ var _default = exports.default = {
|
|
|
1450
1450
|
scan: 'Verwenden Sie Ihre DID-Brieftasche, um den Reisepass zu beantragen',
|
|
1451
1451
|
confirm: 'Bestätigen Sie auf Ihrer DID Wallet',
|
|
1452
1452
|
success: 'Der Reisepass wurde erfolgreich zu Ihrer Brieftasche hinzugefügt',
|
|
1453
|
-
loginWithPassport: 'Verbinden Sie sich mit diesem Reisepass'
|
|
1453
|
+
loginWithPassport: 'Verbinden Sie sich mit diesem Reisepass',
|
|
1454
|
+
autoClose: 'Die Seite schließt automatisch in {seconds}s',
|
|
1455
|
+
autoJump: 'Die Seite wird in {seconds}s automatisch weitergeleitet.'
|
|
1454
1456
|
}
|
|
1455
1457
|
},
|
|
1456
1458
|
lostPassport: {
|
package/lib/locales/en.js
CHANGED
|
@@ -1442,7 +1442,9 @@ var _default = exports.default = {
|
|
|
1442
1442
|
scan: 'Use your DID Wallet to claim the passport',
|
|
1443
1443
|
confirm: 'Confirm on your DID Wallet',
|
|
1444
1444
|
success: 'The passport has been successfully added in your wallet',
|
|
1445
|
-
loginWithPassport: 'Connect with this Passport'
|
|
1445
|
+
loginWithPassport: 'Connect with this Passport',
|
|
1446
|
+
autoClose: 'Page will auto close in {seconds}s',
|
|
1447
|
+
autoJump: 'Page will auto jump in {seconds}s'
|
|
1446
1448
|
}
|
|
1447
1449
|
},
|
|
1448
1450
|
lostPassport: {
|
package/lib/locales/es.js
CHANGED
|
@@ -1450,7 +1450,9 @@ var _default = exports.default = {
|
|
|
1450
1450
|
scan: 'Utiliza tu Billetera DID para reclamar el pasaporte',
|
|
1451
1451
|
confirm: 'Confirma en tu billetera de DID',
|
|
1452
1452
|
success: 'El pasaporte se ha añadido correctamente a tu billetera',
|
|
1453
|
-
loginWithPassport: 'Conéctate con este Pasaporte'
|
|
1453
|
+
loginWithPassport: 'Conéctate con este Pasaporte',
|
|
1454
|
+
autoClose: 'La página se cerrará automáticamente en {seconds}s',
|
|
1455
|
+
autoJump: 'La página saltará automáticamente en {seconds}s'
|
|
1454
1456
|
}
|
|
1455
1457
|
},
|
|
1456
1458
|
lostPassport: {
|
package/lib/locales/fr.js
CHANGED
|
@@ -1450,7 +1450,9 @@ var _default = exports.default = {
|
|
|
1450
1450
|
scan: 'Utilisez votre portefeuille DID pour demander le passeport',
|
|
1451
1451
|
confirm: 'Confirmez sur votre portefeuille DID',
|
|
1452
1452
|
success: 'Le passeport a été ajouté avec succès à votre portefeuille',
|
|
1453
|
-
loginWithPassport: 'Connectez-vous avec ce passeport'
|
|
1453
|
+
loginWithPassport: 'Connectez-vous avec ce passeport',
|
|
1454
|
+
autoClose: 'La page se fermera automatiquement dans {seconds}s',
|
|
1455
|
+
autoJump: 'La page sera automatiquement sautée dans {seconds}s.'
|
|
1454
1456
|
}
|
|
1455
1457
|
},
|
|
1456
1458
|
lostPassport: {
|
package/lib/locales/hi.js
CHANGED
|
@@ -1450,7 +1450,9 @@ var _default = exports.default = {
|
|
|
1450
1450
|
scan: 'अपने डीआईडी वॉलेट का उपयोग करें और पासपोर्ट का दावा करें',
|
|
1451
1451
|
confirm: 'अपने डीआईड़ वॉलेट पर पुष्टि करें',
|
|
1452
1452
|
success: 'आपकी वॉलेट में पासपोर्ट सफलतापूर्वक जोड़ा गया है',
|
|
1453
|
-
loginWithPassport: 'इस पासपोर्ट से जुड़ें'
|
|
1453
|
+
loginWithPassport: 'इस पासपोर्ट से जुड़ें',
|
|
1454
|
+
autoClose: '{seconds}सेकंड में पेज आपूर्ति हो जाएगा',
|
|
1455
|
+
autoJump: 'पृष्ठ {seconds} सेकंड में ऑटोमेटिक जंप करेगा।'
|
|
1454
1456
|
}
|
|
1455
1457
|
},
|
|
1456
1458
|
lostPassport: {
|
package/lib/locales/i18n.db
CHANGED
|
Binary file
|
package/lib/locales/id.js
CHANGED
|
@@ -1450,7 +1450,9 @@ var _default = exports.default = {
|
|
|
1450
1450
|
scan: 'Gunakan Dompet DID Anda untuk mengklaim paspor',
|
|
1451
1451
|
confirm: 'Konfirmasi di Dompet DID Anda',
|
|
1452
1452
|
success: 'Paspor telah berhasil ditambahkan di dompet Anda',
|
|
1453
|
-
loginWithPassport: 'Hubungkan dengan paspor ini'
|
|
1453
|
+
loginWithPassport: 'Hubungkan dengan paspor ini',
|
|
1454
|
+
autoClose: 'Halaman akan ditutup otomatis dalam {seconds}s',
|
|
1455
|
+
autoJump: 'Halaman akan otomatis loncat dalam {seconds}s'
|
|
1454
1456
|
}
|
|
1455
1457
|
},
|
|
1456
1458
|
lostPassport: {
|
package/lib/locales/ja.js
CHANGED
|
@@ -1450,7 +1450,9 @@ var _default = exports.default = {
|
|
|
1450
1450
|
scan: 'パスポートを請求するためにあなたのDIDウォレットを使用してください',
|
|
1451
1451
|
confirm: 'あなたのDIDウォレットで確認してください',
|
|
1452
1452
|
success: 'パスポートがウォレットに正常に追加されました',
|
|
1453
|
-
loginWithPassport: 'このパスポートで接続してください'
|
|
1453
|
+
loginWithPassport: 'このパスポートで接続してください',
|
|
1454
|
+
autoClose: '{seconds}秒後にページが自動的に閉じます',
|
|
1455
|
+
autoJump: '{seconds}s 後にページが自動的にジャンプします'
|
|
1454
1456
|
}
|
|
1455
1457
|
},
|
|
1456
1458
|
lostPassport: {
|
package/lib/locales/ko.js
CHANGED
|
@@ -1450,7 +1450,9 @@ var _default = exports.default = {
|
|
|
1450
1450
|
scan: 'DID 지갑을 사용하여 여권을 신청하세요',
|
|
1451
1451
|
confirm: '귀하의 DID 지갑에서 확인하십시오.',
|
|
1452
1452
|
success: '여권이 지갑에 성공적으로 추가되었습니다',
|
|
1453
|
-
loginWithPassport: '이 여권을 통해 연결하세요'
|
|
1453
|
+
loginWithPassport: '이 여권을 통해 연결하세요',
|
|
1454
|
+
autoClose: '{seconds}초 후에 페이지가 자동으로 닫힙니다',
|
|
1455
|
+
autoJump: '페이지는 {seconds}s 후에 자동으로 이동합니다'
|
|
1454
1456
|
}
|
|
1455
1457
|
},
|
|
1456
1458
|
lostPassport: {
|
package/lib/locales/pt.js
CHANGED
|
@@ -1450,7 +1450,9 @@ var _default = exports.default = {
|
|
|
1450
1450
|
scan: 'Use sua Carteira DID para solicitar o passaporte',
|
|
1451
1451
|
confirm: 'Confirme em sua Carteira DID',
|
|
1452
1452
|
success: 'O passaporte foi adicionado com sucesso em sua carteira',
|
|
1453
|
-
loginWithPassport: 'Conecte-se com este passaporte'
|
|
1453
|
+
loginWithPassport: 'Conecte-se com este passaporte',
|
|
1454
|
+
autoClose: 'A página será fechada automaticamente em {seconds}s',
|
|
1455
|
+
autoJump: 'A página será redirecionada automaticamente em {seconds}s'
|
|
1454
1456
|
}
|
|
1455
1457
|
},
|
|
1456
1458
|
lostPassport: {
|
package/lib/locales/ru.js
CHANGED
|
@@ -1450,7 +1450,9 @@ var _default = exports.default = {
|
|
|
1450
1450
|
scan: 'Используйте свой кошелек DID, чтобы получить паспорт',
|
|
1451
1451
|
confirm: 'Подтвердите на вашем кошельке DID',
|
|
1452
1452
|
success: 'Паспорт успешно добавлен в ваш кошелек',
|
|
1453
|
-
loginWithPassport: 'Подключитесь с помощью этого паспорта'
|
|
1453
|
+
loginWithPassport: 'Подключитесь с помощью этого паспорта',
|
|
1454
|
+
autoClose: 'Страница закроется автоматически через {seconds} секунд',
|
|
1455
|
+
autoJump: 'Страница автоматически перейдет через {seconds} секунд.'
|
|
1454
1456
|
}
|
|
1455
1457
|
},
|
|
1456
1458
|
lostPassport: {
|
package/lib/locales/th.js
CHANGED
|
@@ -1450,7 +1450,9 @@ var _default = exports.default = {
|
|
|
1450
1450
|
scan: 'ใช้กระเป๋าเงินดิจิตอลของคุณเพื่อเรียกร้องหนังสือเดินทาง',
|
|
1451
1451
|
confirm: 'ยืนยันในกระเป๋าเงิน DID ของคุณ',
|
|
1452
1452
|
success: 'หนังสือเดินทางถูกเพิ่มเข้าไปในกระเป๋าเงินของคุณเรียบร้อยแล้ว',
|
|
1453
|
-
loginWithPassport: 'เชื่อมต่อกับพาสปอร์ตนี้'
|
|
1453
|
+
loginWithPassport: 'เชื่อมต่อกับพาสปอร์ตนี้',
|
|
1454
|
+
autoClose: 'หน้าจอจะปิดอัตโนมัติในอีก {seconds}s',
|
|
1455
|
+
autoJump: 'หน้าจะกระโดดอัตโนมัติใน {seconds}s'
|
|
1454
1456
|
}
|
|
1455
1457
|
},
|
|
1456
1458
|
lostPassport: {
|
package/lib/locales/vi.js
CHANGED
|
@@ -1450,7 +1450,9 @@ var _default = exports.default = {
|
|
|
1450
1450
|
scan: 'Sử dụng Ví DID của bạn để yêu cầu hộ chiếu',
|
|
1451
1451
|
confirm: 'Xác nhận trên Ví DID của bạn',
|
|
1452
1452
|
success: 'Hộ chiếu đã được thêm vào ví của bạn thành công',
|
|
1453
|
-
loginWithPassport: 'Kết nối với hộ chiếu này'
|
|
1453
|
+
loginWithPassport: 'Kết nối với hộ chiếu này',
|
|
1454
|
+
autoClose: 'Trang sẽ tự đóng sau {seconds}s',
|
|
1455
|
+
autoJump: 'Trang sẽ tự động chuyển đến trong {seconds}s'
|
|
1454
1456
|
}
|
|
1455
1457
|
},
|
|
1456
1458
|
lostPassport: {
|
package/lib/locales/zh-tw.js
CHANGED
|
@@ -1450,7 +1450,9 @@ var _default = exports.default = {
|
|
|
1450
1450
|
scan: '使用您的DID錢包來申領護照',
|
|
1451
1451
|
confirm: '在你的 DID 錢包上確認',
|
|
1452
1452
|
success: '護照已成功添加到您的錢包',
|
|
1453
|
-
loginWithPassport: '連接到此護照'
|
|
1453
|
+
loginWithPassport: '連接到此護照',
|
|
1454
|
+
autoClose: '頁面將在 {seconds} 秒後自動關閉',
|
|
1455
|
+
autoJump: '頁面將在 {seconds} 秒後自動轉跳'
|
|
1454
1456
|
}
|
|
1455
1457
|
},
|
|
1456
1458
|
lostPassport: {
|
package/lib/locales/zh.js
CHANGED
|
@@ -1457,7 +1457,9 @@ var _default = exports.default = {
|
|
|
1457
1457
|
confirm: '在您的 DID 钱包上确认',
|
|
1458
1458
|
success: '通行证已成功添加到您的 DID 钱包',
|
|
1459
1459
|
loginWithPassport: '用此通行证连接',
|
|
1460
|
-
scan: '使用您的DID钱包来申领护照'
|
|
1460
|
+
scan: '使用您的DID钱包来申领护照',
|
|
1461
|
+
autoClose: '页面将在 {seconds} 秒后自动关闭',
|
|
1462
|
+
autoJump: '页面将在 {seconds} 秒后自动跳转'
|
|
1461
1463
|
}
|
|
1462
1464
|
},
|
|
1463
1465
|
lostPassport: {
|
package/lib/lost-passport.js
CHANGED
|
@@ -21,9 +21,9 @@ var _Avatar = _interopRequireDefault(require("@mui/material/Avatar"));
|
|
|
21
21
|
var _Button = _interopRequireDefault(require("@arcblock/ux/lib/Button"));
|
|
22
22
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
23
23
|
var _useBrowser = _interopRequireDefault(require("@arcblock/react-hooks/lib/useBrowser"));
|
|
24
|
-
var _Connect = _interopRequireDefault(require("@arcblock/did-connect/lib/Connect"));
|
|
25
|
-
var _constant = require("@abtnode/constant");
|
|
26
24
|
var _ahooks = require("ahooks");
|
|
25
|
+
var _Connect = _interopRequireDefault(require("@arcblock/did-connect/lib/Connect"));
|
|
26
|
+
var _isFunction = _interopRequireDefault(require("lodash/isFunction"));
|
|
27
27
|
var _cardSelector = _interopRequireDefault(require("./card-selector"));
|
|
28
28
|
var _didAddress = _interopRequireDefault(require("./did-address"));
|
|
29
29
|
var _wrapLocale = _interopRequireDefault(require("./wrap-locale"));
|
|
@@ -38,6 +38,7 @@ const isFromWallet = () => {
|
|
|
38
38
|
const {
|
|
39
39
|
searchParams
|
|
40
40
|
} = new URL(window.location.href);
|
|
41
|
+
// NOTICE: 这个参数由钱包中拼接得来,用于判断是否来源于钱包客户端(可以走不同的处理逻辑)
|
|
41
42
|
return searchParams.get('fromWallet') === '1';
|
|
42
43
|
};
|
|
43
44
|
|
|
@@ -78,7 +79,8 @@ function LostPassport(_ref2) {
|
|
|
78
79
|
SessionContext,
|
|
79
80
|
webWalletUrl,
|
|
80
81
|
createPassportSvg,
|
|
81
|
-
passportColor
|
|
82
|
+
passportColor,
|
|
83
|
+
onLogin
|
|
82
84
|
} = _ref2;
|
|
83
85
|
const {
|
|
84
86
|
api,
|
|
@@ -90,6 +92,10 @@ function LostPassport(_ref2) {
|
|
|
90
92
|
success: false,
|
|
91
93
|
activeStep: 0
|
|
92
94
|
});
|
|
95
|
+
const staticState = (0, _react.useRef)({
|
|
96
|
+
sessionToken: '',
|
|
97
|
+
refreshToken: ''
|
|
98
|
+
});
|
|
93
99
|
const {
|
|
94
100
|
setPassportId,
|
|
95
101
|
clearPassportId
|
|
@@ -98,10 +104,10 @@ function LostPassport(_ref2) {
|
|
|
98
104
|
t,
|
|
99
105
|
locale
|
|
100
106
|
} = (0, _react.useContext)(_context.LocaleContext);
|
|
101
|
-
const navigate = (0, _reactRouterDom.useNavigate)();
|
|
102
107
|
const {
|
|
103
108
|
wallet: isWalletWebview
|
|
104
109
|
} = (0, _useBrowser.default)();
|
|
110
|
+
const [leftTime, setLeftTime] = (0, _react.useState)(0);
|
|
105
111
|
|
|
106
112
|
// eslint-disable-next-line no-undef
|
|
107
113
|
const {
|
|
@@ -116,37 +122,50 @@ function LostPassport(_ref2) {
|
|
|
116
122
|
const onSelectPassport = () => {
|
|
117
123
|
onNext();
|
|
118
124
|
};
|
|
119
|
-
const onReceivePassport = result => {
|
|
125
|
+
const onReceivePassport = (result, decrypt) => {
|
|
120
126
|
if (result !== null && result !== void 0 && result.passportId) {
|
|
121
127
|
setPassportId(result.passportId);
|
|
122
128
|
}
|
|
129
|
+
if (result !== null && result !== void 0 && result.sessionToken) {
|
|
130
|
+
staticState.current.sessionToken = decrypt(result.sessionToken);
|
|
131
|
+
}
|
|
132
|
+
if (result !== null && result !== void 0 && result.refreshToken) {
|
|
133
|
+
staticState.current.refreshToken = decrypt(result.refreshToken);
|
|
134
|
+
}
|
|
123
135
|
pageState.success = true;
|
|
124
136
|
onNext();
|
|
125
137
|
};
|
|
126
|
-
const
|
|
127
|
-
|
|
138
|
+
const safeLogout = () => {
|
|
139
|
+
return new Promise(resolve => {
|
|
140
|
+
try {
|
|
141
|
+
session.logout(() => {
|
|
142
|
+
resolve();
|
|
143
|
+
});
|
|
144
|
+
} catch (err) {
|
|
145
|
+
// Do nothing
|
|
146
|
+
resolve();
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
const onUsePassport = async () => {
|
|
128
151
|
if (isWalletWebview && isFromWallet()) {
|
|
129
152
|
Promise.resolve().then(() => _interopRequireWildcard(require('dsbridge'))).then(jsBridge => {
|
|
130
153
|
jsBridge.call('arcClosePage');
|
|
131
154
|
});
|
|
132
155
|
return;
|
|
133
156
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
157
|
+
await safeLogout();
|
|
158
|
+
if ((0, _isFunction.default)(onLogin)) {
|
|
159
|
+
onLogin({
|
|
160
|
+
sessionToken: staticState.current.sessionToken,
|
|
161
|
+
refreshToken: staticState.current.refreshToken
|
|
162
|
+
});
|
|
138
163
|
}
|
|
139
164
|
const redirect = searchParams.get('redirect');
|
|
140
165
|
if (redirect) {
|
|
141
166
|
window.location.replace(redirect);
|
|
142
167
|
return;
|
|
143
168
|
}
|
|
144
|
-
if ((((_window$env = window.env) === null || _window$env === void 0 ? void 0 : _window$env.apiPrefix) || '').startsWith(_constant.WELLKNOWN_SERVICE_PATH_PREFIX)) {
|
|
145
|
-
navigate("".concat(_constant.WELLKNOWN_SERVICE_PATH_PREFIX, "/connect"), {
|
|
146
|
-
replace: true
|
|
147
|
-
});
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
169
|
|
|
151
170
|
// HACK: 因为默认页面不会处理 passportId 的逻辑,所以需要清除存储的信息
|
|
152
171
|
clearPassportId();
|
|
@@ -155,6 +174,12 @@ function LostPassport(_ref2) {
|
|
|
155
174
|
const handleChangePassport = event => {
|
|
156
175
|
pageState.passport = event.target.value;
|
|
157
176
|
};
|
|
177
|
+
const [countdown] = (0, _ahooks.useCountDown)({
|
|
178
|
+
leftTime,
|
|
179
|
+
onEnd: () => {
|
|
180
|
+
onUsePassport();
|
|
181
|
+
}
|
|
182
|
+
});
|
|
158
183
|
const steps = [{
|
|
159
184
|
label: t('lostPassport.selectPassport'),
|
|
160
185
|
content: () => {
|
|
@@ -277,31 +302,45 @@ function LostPassport(_ref2) {
|
|
|
277
302
|
}
|
|
278
303
|
}, {
|
|
279
304
|
label: t('common.complete'),
|
|
280
|
-
content: () =>
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
305
|
+
content: () => {
|
|
306
|
+
if (leftTime === 0) {
|
|
307
|
+
setLeftTime(3000);
|
|
308
|
+
}
|
|
309
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
310
|
+
textAlign: "center",
|
|
311
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
312
|
+
mb: 3,
|
|
313
|
+
color: "success.main",
|
|
314
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckCircle.default, {
|
|
315
|
+
style: {
|
|
316
|
+
fontSize: 60
|
|
317
|
+
}
|
|
318
|
+
})
|
|
319
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
320
|
+
component: "p",
|
|
321
|
+
variant: "body1",
|
|
322
|
+
className: "subheader",
|
|
323
|
+
children: t('issuePassport.dialog.success')
|
|
324
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
325
|
+
component: "p",
|
|
326
|
+
variant: "body2",
|
|
327
|
+
color: "gray",
|
|
328
|
+
children: isWalletWebview && isFromWallet() ? t('issuePassport.dialog.autoClose', {
|
|
329
|
+
seconds: Math.round(countdown / 1000)
|
|
330
|
+
}) : t('issuePassport.dialog.autoJump', {
|
|
331
|
+
seconds: Math.round(countdown / 1000)
|
|
332
|
+
})
|
|
333
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
286
334
|
style: {
|
|
287
|
-
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
style: {
|
|
297
|
-
marginTop: 40
|
|
298
|
-
},
|
|
299
|
-
variant: "contained",
|
|
300
|
-
color: "primary",
|
|
301
|
-
onClick: onUsePassport,
|
|
302
|
-
children: t('issuePassport.dialog.loginWithPassport')
|
|
303
|
-
})]
|
|
304
|
-
})
|
|
335
|
+
marginTop: 40
|
|
336
|
+
},
|
|
337
|
+
variant: "contained",
|
|
338
|
+
color: "primary",
|
|
339
|
+
onClick: onUsePassport,
|
|
340
|
+
children: t('issuePassport.dialog.loginWithPassport')
|
|
341
|
+
})]
|
|
342
|
+
});
|
|
343
|
+
}
|
|
305
344
|
}];
|
|
306
345
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Div, {
|
|
307
346
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -560,7 +560,7 @@ function MemberList(_ref2) {
|
|
|
560
560
|
})]
|
|
561
561
|
});
|
|
562
562
|
}
|
|
563
|
-
const Div = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .main {\n .left {\n width: 168px;\n flex-shrink: 0;\n margin-right: 65px;\n .tabs {\n padding-top: 16px;\n .tab {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 8px 16px;\n transition: background 0.4s;\n\n width: 168px;\n height: 36px;\n border-radius: 8px;\n\n cursor: pointer;\n user-select: none;\n\n &:nth-child(n + 2) {\n margin-top: 24px;\n }\n\n &.active {\n background: #f2f2f2;\n }\n\n &:hover {\n background: #f2f2f2;\n }\n\n .text {\n font-weight: 400;\n font-size: 16px;\n line-height: 19px;\n\n color: #222222;\n }\n\n .badge {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 20px;\n height: 20px;\n border-radius: 100%;\n color: #fff;\n background: #666666;\n font-size: 10px;\n font-weight: 400;\n &.is-rect {\n width: auto;\n border-radius: 8px;\n padding: 0 4px;\n }\n }\n }\n }\n @media (max-width: ", "px) {\n display: none;\n }\n }\n .right {\n flex-grow: 1;\n }\n }\n\n .member-block {\n display: flex;\n justify-content: flex-start;\n align-items: center;\n .member-avatar {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .member-meta {\n margin-left: 10px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n }\n .badge-block {\n width: 14px;\n height: 14px;\n position: absolute;\n right: -4px;\n top: -4px;\n background: #ff5757;\n border-radius: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n &::after {\n content: '';\n width: 6px;\n height: 2px;\n background: #fefefe;\n }\n }\n }\n\n .table-toolbar-left {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 7px 0;\n }\n"])), props => props.theme.breakpoints.values.md);
|
|
563
|
+
const Div = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .main {\n .left {\n width: 168px;\n flex-shrink: 0;\n margin-right: 65px;\n .tabs {\n padding-top: 16px;\n .tab {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 8px 16px;\n transition: background 0.4s;\n\n width: 168px;\n height: 36px;\n border-radius: 8px;\n\n cursor: pointer;\n user-select: none;\n\n &:nth-child(n + 2) {\n margin-top: 24px;\n }\n\n &.active {\n background: #f2f2f2;\n }\n\n &:hover {\n background: #f2f2f2;\n }\n\n .text {\n font-weight: 400;\n font-size: 16px;\n line-height: 19px;\n\n color: #222222;\n }\n\n .badge {\n display: flex;\n flex-shrink: 0;\n justify-content: center;\n align-items: center;\n width: 20px;\n height: 20px;\n border-radius: 100%;\n color: #fff;\n background: #666666;\n font-size: 10px;\n font-weight: 400;\n &.is-rect {\n width: auto;\n border-radius: 8px;\n padding: 0 4px;\n }\n }\n }\n }\n @media (max-width: ", "px) {\n display: none;\n }\n }\n .right {\n flex-grow: 1;\n }\n }\n\n .member-block {\n display: flex;\n justify-content: flex-start;\n align-items: center;\n .member-avatar {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .member-meta {\n margin-left: 10px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n }\n .badge-block {\n width: 14px;\n height: 14px;\n position: absolute;\n right: -4px;\n top: -4px;\n background: #ff5757;\n border-radius: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n &::after {\n content: '';\n width: 6px;\n height: 2px;\n background: #fefefe;\n }\n }\n }\n\n .table-toolbar-left {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 7px 0;\n }\n"])), props => props.theme.breakpoints.values.md);
|
|
564
564
|
MemberList.propTypes = {
|
|
565
565
|
type: _propTypes.default.oneOf(['server', 'blocklet']).isRequired,
|
|
566
566
|
createPassportSvg: _propTypes.default.func.isRequired
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/ux",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.25-beta-fe54d1bc",
|
|
4
4
|
"description": "UX components shared across abtnode packages",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
"build:es": "babel --config-file ./babel.config.es.js src --out-dir es --copy-files",
|
|
22
22
|
"autoexports": "node tools/auto-exports.js",
|
|
23
23
|
"watch": "npm run build:es -- -w",
|
|
24
|
-
"turbo:client": "npm run watch",
|
|
25
24
|
"coverage": "npm run test -- --coverage",
|
|
26
25
|
"test": "node tools/jest.js"
|
|
27
26
|
},
|
|
@@ -29,23 +28,23 @@
|
|
|
29
28
|
"author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
|
|
30
29
|
"license": "Apache-2.0",
|
|
31
30
|
"dependencies": {
|
|
32
|
-
"@abtnode/auth": "1.16.
|
|
33
|
-
"@abtnode/constant": "1.16.
|
|
34
|
-
"@abtnode/util": "1.16.
|
|
31
|
+
"@abtnode/auth": "1.16.25-beta-fe54d1bc",
|
|
32
|
+
"@abtnode/constant": "1.16.25-beta-fe54d1bc",
|
|
33
|
+
"@abtnode/util": "1.16.25-beta-fe54d1bc",
|
|
35
34
|
"@ahooksjs/use-url-state": "^3.5.1",
|
|
36
|
-
"@arcblock/did": "^1.18.
|
|
37
|
-
"@arcblock/did-connect": "^2.9.
|
|
35
|
+
"@arcblock/did": "^1.18.113",
|
|
36
|
+
"@arcblock/did-connect": "^2.9.42",
|
|
38
37
|
"@arcblock/did-motif": "^1.1.13",
|
|
39
|
-
"@arcblock/icons": "^2.9.
|
|
40
|
-
"@arcblock/nft-display": "2.9.
|
|
41
|
-
"@arcblock/react-hooks": "^2.9.
|
|
42
|
-
"@arcblock/terminal": "^2.9.
|
|
43
|
-
"@arcblock/ux": "^2.9.
|
|
44
|
-
"@blocklet/constant": "1.16.
|
|
38
|
+
"@arcblock/icons": "^2.9.42",
|
|
39
|
+
"@arcblock/nft-display": "2.9.42",
|
|
40
|
+
"@arcblock/react-hooks": "^2.9.42",
|
|
41
|
+
"@arcblock/terminal": "^2.9.42",
|
|
42
|
+
"@arcblock/ux": "^2.9.42",
|
|
43
|
+
"@blocklet/constant": "1.16.25-beta-fe54d1bc",
|
|
45
44
|
"@blocklet/launcher-layout": "2.2.54",
|
|
46
|
-
"@blocklet/list": "^0.12.
|
|
47
|
-
"@blocklet/meta": "1.16.
|
|
48
|
-
"@blocklet/ui-react": "^2.9.
|
|
45
|
+
"@blocklet/list": "^0.12.74",
|
|
46
|
+
"@blocklet/meta": "1.16.25-beta-fe54d1bc",
|
|
47
|
+
"@blocklet/ui-react": "^2.9.42",
|
|
49
48
|
"@blocklet/uploader": "^0.0.74",
|
|
50
49
|
"@emotion/react": "^11.10.4",
|
|
51
50
|
"@emotion/styled": "^11.10.4",
|
|
@@ -57,7 +56,7 @@
|
|
|
57
56
|
"@mui/styles": "^5.15.11",
|
|
58
57
|
"@mui/x-date-pickers": "^6.19.0",
|
|
59
58
|
"@mui/x-tree-view": "^6.17.0",
|
|
60
|
-
"@ocap/client": "1.18.
|
|
59
|
+
"@ocap/client": "1.18.113",
|
|
61
60
|
"@uiw/react-markdown-preview": "4.0.6",
|
|
62
61
|
"ahooks": "^3.7.8",
|
|
63
62
|
"axios": "^0.27.2",
|
|
@@ -107,7 +106,7 @@
|
|
|
107
106
|
"jest": "^29.7.0",
|
|
108
107
|
"jest-environment-jsdom": "^29.7.0"
|
|
109
108
|
},
|
|
110
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "e9411b6ee3c482554c76fe91796560abeb0e56ad",
|
|
111
110
|
"exports": {
|
|
112
111
|
".": {
|
|
113
112
|
"import": "./es/index.js",
|