@abtnode/ux 1.16.17-beta-952ef53d → 1.16.17-beta-a8cf4b25
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/actions.js +1 -2
- package/es/blocklet/component/add.js +1 -1
- package/es/blocklet/component/domain-list.js +2 -2
- package/es/lost-passport.js +39 -37
- package/lib/blocklet/actions.js +1 -2
- package/lib/blocklet/component/add.js +1 -1
- package/lib/blocklet/component/domain-list.js +1 -1
- package/lib/lost-passport.js +39 -36
- package/package.json +17 -17
package/es/blocklet/actions.js
CHANGED
|
@@ -23,7 +23,6 @@ import Button from '@arcblock/ux/lib/Button';
|
|
|
23
23
|
import { getAppMissingConfigs, isDeletableBlocklet, hasRunnableComponent, getDisplayName, isInProgress } from '@blocklet/meta/lib/util';
|
|
24
24
|
import { LocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
25
25
|
import { BLOCKLET_CONTROLLER_STATUS, BLOCKLET_MODES, SUSPENDED_REASON } from '@blocklet/constant';
|
|
26
|
-
import { APP_STRUCT_VERSION } from '@abtnode/constant';
|
|
27
26
|
import Toast from '@arcblock/ux/lib/Toast';
|
|
28
27
|
import { sleep, formatError, isDownloading } from '../util';
|
|
29
28
|
import { getServerUrl } from './util';
|
|
@@ -271,7 +270,7 @@ export default function BlockletActions({
|
|
|
271
270
|
}
|
|
272
271
|
}
|
|
273
272
|
};
|
|
274
|
-
const removeAction = !inService && isDeletableBlocklet(blocklet)
|
|
273
|
+
const removeAction = !inService && isDeletableBlocklet(blocklet) ? {
|
|
275
274
|
action: 'remove',
|
|
276
275
|
icon: Icons.Remove,
|
|
277
276
|
name: t('common.remove'),
|
|
@@ -579,7 +579,7 @@ export default function AddComponent({
|
|
|
579
579
|
} else {
|
|
580
580
|
doc = {
|
|
581
581
|
...doc,
|
|
582
|
-
pathPrefix: hasRootPath ? `/${urlPathFriendly(name)}` : '/',
|
|
582
|
+
pathPrefix: hasRootPath ? `/${urlPathFriendly(title) || urlPathFriendly(name)}` : '/',
|
|
583
583
|
title: title || '',
|
|
584
584
|
componentName: '',
|
|
585
585
|
hasEnvironmentsStep: component.current.meta?.environments?.length > 0
|
|
@@ -20,7 +20,7 @@ import { isDidDomain } from '@abtnode/util/lib/url-evaluation';
|
|
|
20
20
|
import LockIcon from '@arcblock/icons/lib/LockIcon';
|
|
21
21
|
import Empty from '@arcblock/ux/lib/Empty';
|
|
22
22
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
23
|
-
import { isInProgress } from '@blocklet/meta/lib/util';
|
|
23
|
+
import { isInProgress, isAccessible } from '@blocklet/meta/lib/util';
|
|
24
24
|
import Spinner from '@mui/material/CircularProgress';
|
|
25
25
|
import DidAddress from '../../did-address';
|
|
26
26
|
import { useBlockletContext } from '../../contexts/blocklet';
|
|
@@ -133,7 +133,7 @@ function DomainList({
|
|
|
133
133
|
}), t('common.add')]
|
|
134
134
|
})
|
|
135
135
|
})]
|
|
136
|
-
}), blocklet.status
|
|
136
|
+
}), isAccessible(blocklet.status) === false && /*#__PURE__*/_jsx(Box, {
|
|
137
137
|
mt: 1.5,
|
|
138
138
|
mb: 1.5,
|
|
139
139
|
children: /*#__PURE__*/_jsx(Alert, {
|
package/es/lost-passport.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* eslint-disable react/no-unstable-nested-components */
|
|
2
|
-
|
|
3
|
-
import { useState, useContext } from 'react';
|
|
2
|
+
import { useContext } from 'react';
|
|
4
3
|
import styled from '@emotion/styled';
|
|
5
4
|
import { useNavigate, Link } from 'react-router-dom';
|
|
6
5
|
import Typography from '@mui/material/Typography';
|
|
@@ -19,6 +18,7 @@ import { LocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
|
19
18
|
import useBrowser from '@arcblock/react-hooks/lib/useBrowser';
|
|
20
19
|
import DidConnect from '@arcblock/did-connect/lib/Connect';
|
|
21
20
|
import { WELLKNOWN_SERVICE_PATH_PREFIX } from '@abtnode/constant';
|
|
21
|
+
import { useReactive } from 'ahooks';
|
|
22
22
|
import CardSelector from './card-selector';
|
|
23
23
|
import DidAddress from './did-address';
|
|
24
24
|
import wrapLocale from './wrap-locale';
|
|
@@ -73,18 +73,21 @@ function LostPassport({
|
|
|
73
73
|
api,
|
|
74
74
|
session
|
|
75
75
|
} = useContext(SessionContext);
|
|
76
|
+
const pageState = useReactive({
|
|
77
|
+
user: null,
|
|
78
|
+
passport: null,
|
|
79
|
+
success: false,
|
|
80
|
+
activeStep: 0
|
|
81
|
+
});
|
|
82
|
+
const {
|
|
83
|
+
setPassportId,
|
|
84
|
+
clearPassportId
|
|
85
|
+
} = usePassportId();
|
|
76
86
|
const {
|
|
77
87
|
t,
|
|
78
88
|
locale
|
|
79
89
|
} = useContext(LocaleContext);
|
|
80
|
-
const [user, setUser] = useState(false);
|
|
81
|
-
const [passport, setPassport] = useState(false);
|
|
82
|
-
const [success, setSuccess] = useState(false);
|
|
83
90
|
const navigate = useNavigate();
|
|
84
|
-
const [activeStep, setActiveStep] = useState(0);
|
|
85
|
-
const {
|
|
86
|
-
setPassportId
|
|
87
|
-
} = usePassportId();
|
|
88
91
|
const {
|
|
89
92
|
wallet: isWalletWebview
|
|
90
93
|
} = useBrowser();
|
|
@@ -94,10 +97,10 @@ function LostPassport({
|
|
|
94
97
|
searchParams
|
|
95
98
|
} = new URL(window.location.href);
|
|
96
99
|
const onNext = () => {
|
|
97
|
-
|
|
100
|
+
pageState.activeStep++;
|
|
98
101
|
};
|
|
99
102
|
const onGetUser = result => {
|
|
100
|
-
|
|
103
|
+
pageState.user = result.user;
|
|
101
104
|
};
|
|
102
105
|
const onSelectPassport = () => {
|
|
103
106
|
onNext();
|
|
@@ -106,7 +109,7 @@ function LostPassport({
|
|
|
106
109
|
if (result?.passportId) {
|
|
107
110
|
setPassportId(result.passportId);
|
|
108
111
|
}
|
|
109
|
-
|
|
112
|
+
pageState.success = true;
|
|
110
113
|
onNext();
|
|
111
114
|
};
|
|
112
115
|
const onUsePassport = () => {
|
|
@@ -123,28 +126,27 @@ function LostPassport({
|
|
|
123
126
|
}
|
|
124
127
|
const redirect = searchParams.get('redirect');
|
|
125
128
|
if (redirect) {
|
|
126
|
-
|
|
127
|
-
replace: true
|
|
128
|
-
});
|
|
129
|
+
window.location.replace(redirect);
|
|
129
130
|
return;
|
|
130
131
|
}
|
|
131
132
|
if ((window.env?.apiPrefix || '').startsWith(WELLKNOWN_SERVICE_PATH_PREFIX)) {
|
|
132
|
-
navigate(`${WELLKNOWN_SERVICE_PATH_PREFIX}/
|
|
133
|
+
navigate(`${WELLKNOWN_SERVICE_PATH_PREFIX}/connect`, {
|
|
133
134
|
replace: true
|
|
134
135
|
});
|
|
135
136
|
return;
|
|
136
137
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
|
|
139
|
+
// HACK: 因为默认页面不会处理 passportId 的逻辑,所以需要清除存储的信息
|
|
140
|
+
clearPassportId();
|
|
141
|
+
window.location.replace('/');
|
|
140
142
|
};
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
+
const handleChangePassport = event => {
|
|
144
|
+
pageState.passport = event.target.value;
|
|
143
145
|
};
|
|
144
146
|
const steps = [{
|
|
145
147
|
label: t('lostPassport.selectPassport'),
|
|
146
148
|
content: () => {
|
|
147
|
-
if (!user) {
|
|
149
|
+
if (!pageState.user) {
|
|
148
150
|
return /*#__PURE__*/_jsx(DidConnect, {
|
|
149
151
|
popup: true,
|
|
150
152
|
open: true,
|
|
@@ -174,7 +176,7 @@ function LostPassport({
|
|
|
174
176
|
alignItems: "center",
|
|
175
177
|
className: "user-info",
|
|
176
178
|
children: [/*#__PURE__*/_jsx(Avatar, {
|
|
177
|
-
src: user.avatar,
|
|
179
|
+
src: pageState.user.avatar,
|
|
178
180
|
style: {
|
|
179
181
|
width: 48,
|
|
180
182
|
height: 48,
|
|
@@ -184,12 +186,12 @@ function LostPassport({
|
|
|
184
186
|
}), /*#__PURE__*/_jsxs(Box, {
|
|
185
187
|
children: [/*#__PURE__*/_jsx(Box, {
|
|
186
188
|
className: "name",
|
|
187
|
-
children: user.fullName
|
|
189
|
+
children: pageState.user.fullName
|
|
188
190
|
}), /*#__PURE__*/_jsx(Box, {
|
|
189
191
|
className: "did",
|
|
190
192
|
mt: 1,
|
|
191
193
|
children: /*#__PURE__*/_jsx(DidAddress, {
|
|
192
|
-
did: user.did
|
|
194
|
+
did: pageState.user.did
|
|
193
195
|
})
|
|
194
196
|
})]
|
|
195
197
|
})]
|
|
@@ -198,24 +200,24 @@ function LostPassport({
|
|
|
198
200
|
width: 230,
|
|
199
201
|
height: 306,
|
|
200
202
|
cardSpace: 24,
|
|
201
|
-
list: user.passportTypes.map(x => {
|
|
203
|
+
list: pageState.user.passportTypes.map(x => {
|
|
202
204
|
return {
|
|
203
205
|
src: createPassportSvg({
|
|
204
206
|
title: x.title,
|
|
205
207
|
issuer: x.issuer.name,
|
|
206
208
|
issuerDid: x.issuer.id,
|
|
207
|
-
ownerDid: user.did,
|
|
208
|
-
ownerName: user.fullName,
|
|
209
|
-
ownerAvatarUrl: user.avatar,
|
|
209
|
+
ownerDid: pageState.user.did,
|
|
210
|
+
ownerName: pageState.user.fullName,
|
|
211
|
+
ownerAvatarUrl: pageState.user.avatar,
|
|
210
212
|
preferredColor: passportColor || 'auto'
|
|
211
213
|
}),
|
|
212
214
|
name: x.title,
|
|
213
215
|
id: x.id
|
|
214
216
|
};
|
|
215
217
|
}),
|
|
216
|
-
onSelect: index =>
|
|
218
|
+
onSelect: index => handleChangePassport({
|
|
217
219
|
target: {
|
|
218
|
-
value: user.passportTypes[index].name
|
|
220
|
+
value: pageState.user.passportTypes[index].name
|
|
219
221
|
}
|
|
220
222
|
}),
|
|
221
223
|
defaultIndex: 0
|
|
@@ -226,7 +228,7 @@ function LostPassport({
|
|
|
226
228
|
variant: "contained",
|
|
227
229
|
color: "primary",
|
|
228
230
|
onClick: () => onSelectPassport(),
|
|
229
|
-
disabled: !passport,
|
|
231
|
+
disabled: !pageState.passport,
|
|
230
232
|
children: t('common.next')
|
|
231
233
|
})
|
|
232
234
|
})]
|
|
@@ -236,8 +238,8 @@ function LostPassport({
|
|
|
236
238
|
label: t('lostPassport.receivePassport'),
|
|
237
239
|
content: () => {
|
|
238
240
|
const extraParams = {
|
|
239
|
-
receiverDid: user.did,
|
|
240
|
-
passportName: passport,
|
|
241
|
+
receiverDid: pageState.user.did,
|
|
242
|
+
passportName: pageState.passport,
|
|
241
243
|
teamDid: window?.blocklet?.did || ''
|
|
242
244
|
};
|
|
243
245
|
return /*#__PURE__*/_jsx(DidConnect, {
|
|
@@ -294,7 +296,7 @@ function LostPassport({
|
|
|
294
296
|
children: [/*#__PURE__*/_jsx(Stepper, {
|
|
295
297
|
className: "stepper-progress",
|
|
296
298
|
alternativeLabel: true,
|
|
297
|
-
activeStep: activeStep,
|
|
299
|
+
activeStep: pageState.activeStep,
|
|
298
300
|
children: steps.map(({
|
|
299
301
|
label
|
|
300
302
|
}) => /*#__PURE__*/_jsx(Step, {
|
|
@@ -305,8 +307,8 @@ function LostPassport({
|
|
|
305
307
|
}, label))
|
|
306
308
|
}), /*#__PURE__*/_jsx("div", {
|
|
307
309
|
className: "stepper-content",
|
|
308
|
-
children: steps[activeStep].content()
|
|
309
|
-
}), !success && /*#__PURE__*/_jsx(Box, {
|
|
310
|
+
children: steps[pageState.activeStep].content()
|
|
311
|
+
}), !pageState.success && /*#__PURE__*/_jsx(Box, {
|
|
310
312
|
textAlign: "center",
|
|
311
313
|
fontSize: 12,
|
|
312
314
|
children: /*#__PURE__*/_jsx(Link, {
|
package/lib/blocklet/actions.js
CHANGED
|
@@ -27,7 +27,6 @@ var _Button = _interopRequireDefault(require("@arcblock/ux/lib/Button"));
|
|
|
27
27
|
var _util = require("@blocklet/meta/lib/util");
|
|
28
28
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
29
29
|
var _constant = require("@blocklet/constant");
|
|
30
|
-
var _constant2 = require("@abtnode/constant");
|
|
31
30
|
var _Toast = _interopRequireDefault(require("@arcblock/ux/lib/Toast"));
|
|
32
31
|
var _util2 = require("../util");
|
|
33
32
|
var _util3 = require("./util");
|
|
@@ -291,7 +290,7 @@ function BlockletActions(_ref) {
|
|
|
291
290
|
}
|
|
292
291
|
}
|
|
293
292
|
};
|
|
294
|
-
const removeAction = !inService && (0, _util.isDeletableBlocklet)(blocklet)
|
|
293
|
+
const removeAction = !inService && (0, _util.isDeletableBlocklet)(blocklet) ? {
|
|
295
294
|
action: 'remove',
|
|
296
295
|
icon: _icons.default.Remove,
|
|
297
296
|
name: t('common.remove'),
|
|
@@ -587,7 +587,7 @@ function AddComponent(_ref2) {
|
|
|
587
587
|
} else {
|
|
588
588
|
var _component$current$me, _component$current$me2;
|
|
589
589
|
doc = _objectSpread(_objectSpread({}, doc), {}, {
|
|
590
|
-
pathPrefix: hasRootPath ? "/".concat((0, _urlPathFriendly.default)(name)) : '/',
|
|
590
|
+
pathPrefix: hasRootPath ? "/".concat((0, _urlPathFriendly.default)(title) || (0, _urlPathFriendly.default)(name)) : '/',
|
|
591
591
|
title: title || '',
|
|
592
592
|
componentName: '',
|
|
593
593
|
hasEnvironmentsStep: ((_component$current$me = component.current.meta) === null || _component$current$me === void 0 ? void 0 : (_component$current$me2 = _component$current$me.environments) === null || _component$current$me2 === void 0 ? void 0 : _component$current$me2.length) > 0
|
|
@@ -154,7 +154,7 @@ function DomainList(_ref) {
|
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
156
|
})]
|
|
157
|
-
}), blocklet.status
|
|
157
|
+
}), (0, _util.isAccessible)(blocklet.status) === false && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
158
158
|
mt: 1.5,
|
|
159
159
|
mb: 1.5,
|
|
160
160
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.default, {
|
package/lib/lost-passport.js
CHANGED
|
@@ -23,6 +23,7 @@ var _context = require("@arcblock/ux/lib/Locale/context");
|
|
|
23
23
|
var _useBrowser = _interopRequireDefault(require("@arcblock/react-hooks/lib/useBrowser"));
|
|
24
24
|
var _Connect = _interopRequireDefault(require("@arcblock/did-connect/lib/Connect"));
|
|
25
25
|
var _constant = require("@abtnode/constant");
|
|
26
|
+
var _ahooks = require("ahooks");
|
|
26
27
|
var _cardSelector = _interopRequireDefault(require("./card-selector"));
|
|
27
28
|
var _didAddress = _interopRequireDefault(require("./did-address"));
|
|
28
29
|
var _wrapLocale = _interopRequireDefault(require("./wrap-locale"));
|
|
@@ -32,7 +33,7 @@ var _templateObject;
|
|
|
32
33
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
34
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
34
35
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } /* eslint-disable react/no-unstable-nested-components */
|
|
36
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } /* eslint-disable react/no-unstable-nested-components */
|
|
36
37
|
const isFromWallet = () => {
|
|
37
38
|
const {
|
|
38
39
|
searchParams
|
|
@@ -83,18 +84,21 @@ function LostPassport(_ref2) {
|
|
|
83
84
|
api,
|
|
84
85
|
session
|
|
85
86
|
} = (0, _react.useContext)(SessionContext);
|
|
87
|
+
const pageState = (0, _ahooks.useReactive)({
|
|
88
|
+
user: null,
|
|
89
|
+
passport: null,
|
|
90
|
+
success: false,
|
|
91
|
+
activeStep: 0
|
|
92
|
+
});
|
|
93
|
+
const {
|
|
94
|
+
setPassportId,
|
|
95
|
+
clearPassportId
|
|
96
|
+
} = (0, _usePassportId.default)();
|
|
86
97
|
const {
|
|
87
98
|
t,
|
|
88
99
|
locale
|
|
89
100
|
} = (0, _react.useContext)(_context.LocaleContext);
|
|
90
|
-
const [user, setUser] = (0, _react.useState)(false);
|
|
91
|
-
const [passport, setPassport] = (0, _react.useState)(false);
|
|
92
|
-
const [success, setSuccess] = (0, _react.useState)(false);
|
|
93
101
|
const navigate = (0, _reactRouterDom.useNavigate)();
|
|
94
|
-
const [activeStep, setActiveStep] = (0, _react.useState)(0);
|
|
95
|
-
const {
|
|
96
|
-
setPassportId
|
|
97
|
-
} = (0, _usePassportId.default)();
|
|
98
102
|
const {
|
|
99
103
|
wallet: isWalletWebview
|
|
100
104
|
} = (0, _useBrowser.default)();
|
|
@@ -104,10 +108,10 @@ function LostPassport(_ref2) {
|
|
|
104
108
|
searchParams
|
|
105
109
|
} = new URL(window.location.href);
|
|
106
110
|
const onNext = () => {
|
|
107
|
-
|
|
111
|
+
pageState.activeStep++;
|
|
108
112
|
};
|
|
109
113
|
const onGetUser = result => {
|
|
110
|
-
|
|
114
|
+
pageState.user = result.user;
|
|
111
115
|
};
|
|
112
116
|
const onSelectPassport = () => {
|
|
113
117
|
onNext();
|
|
@@ -116,7 +120,7 @@ function LostPassport(_ref2) {
|
|
|
116
120
|
if (result !== null && result !== void 0 && result.passportId) {
|
|
117
121
|
setPassportId(result.passportId);
|
|
118
122
|
}
|
|
119
|
-
|
|
123
|
+
pageState.success = true;
|
|
120
124
|
onNext();
|
|
121
125
|
};
|
|
122
126
|
const onUsePassport = () => {
|
|
@@ -134,28 +138,27 @@ function LostPassport(_ref2) {
|
|
|
134
138
|
}
|
|
135
139
|
const redirect = searchParams.get('redirect');
|
|
136
140
|
if (redirect) {
|
|
137
|
-
|
|
138
|
-
replace: true
|
|
139
|
-
});
|
|
141
|
+
window.location.replace(redirect);
|
|
140
142
|
return;
|
|
141
143
|
}
|
|
142
144
|
if ((((_window$env = window.env) === null || _window$env === void 0 ? void 0 : _window$env.apiPrefix) || '').startsWith(_constant.WELLKNOWN_SERVICE_PATH_PREFIX)) {
|
|
143
|
-
navigate("".concat(_constant.WELLKNOWN_SERVICE_PATH_PREFIX, "/
|
|
145
|
+
navigate("".concat(_constant.WELLKNOWN_SERVICE_PATH_PREFIX, "/connect"), {
|
|
144
146
|
replace: true
|
|
145
147
|
});
|
|
146
148
|
return;
|
|
147
149
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
150
|
+
|
|
151
|
+
// HACK: 因为默认页面不会处理 passportId 的逻辑,所以需要清除存储的信息
|
|
152
|
+
clearPassportId();
|
|
153
|
+
window.location.replace('/');
|
|
151
154
|
};
|
|
152
|
-
const
|
|
153
|
-
|
|
155
|
+
const handleChangePassport = event => {
|
|
156
|
+
pageState.passport = event.target.value;
|
|
154
157
|
};
|
|
155
158
|
const steps = [{
|
|
156
159
|
label: t('lostPassport.selectPassport'),
|
|
157
160
|
content: () => {
|
|
158
|
-
if (!user) {
|
|
161
|
+
if (!pageState.user) {
|
|
159
162
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Connect.default, {
|
|
160
163
|
popup: true,
|
|
161
164
|
open: true,
|
|
@@ -185,7 +188,7 @@ function LostPassport(_ref2) {
|
|
|
185
188
|
alignItems: "center",
|
|
186
189
|
className: "user-info",
|
|
187
190
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.default, {
|
|
188
|
-
src: user.avatar,
|
|
191
|
+
src: pageState.user.avatar,
|
|
189
192
|
style: {
|
|
190
193
|
width: 48,
|
|
191
194
|
height: 48,
|
|
@@ -195,12 +198,12 @@ function LostPassport(_ref2) {
|
|
|
195
198
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
196
199
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
197
200
|
className: "name",
|
|
198
|
-
children: user.fullName
|
|
201
|
+
children: pageState.user.fullName
|
|
199
202
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
200
203
|
className: "did",
|
|
201
204
|
mt: 1,
|
|
202
205
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_didAddress.default, {
|
|
203
|
-
did: user.did
|
|
206
|
+
did: pageState.user.did
|
|
204
207
|
})
|
|
205
208
|
})]
|
|
206
209
|
})]
|
|
@@ -209,24 +212,24 @@ function LostPassport(_ref2) {
|
|
|
209
212
|
width: 230,
|
|
210
213
|
height: 306,
|
|
211
214
|
cardSpace: 24,
|
|
212
|
-
list: user.passportTypes.map(x => {
|
|
215
|
+
list: pageState.user.passportTypes.map(x => {
|
|
213
216
|
return {
|
|
214
217
|
src: createPassportSvg({
|
|
215
218
|
title: x.title,
|
|
216
219
|
issuer: x.issuer.name,
|
|
217
220
|
issuerDid: x.issuer.id,
|
|
218
|
-
ownerDid: user.did,
|
|
219
|
-
ownerName: user.fullName,
|
|
220
|
-
ownerAvatarUrl: user.avatar,
|
|
221
|
+
ownerDid: pageState.user.did,
|
|
222
|
+
ownerName: pageState.user.fullName,
|
|
223
|
+
ownerAvatarUrl: pageState.user.avatar,
|
|
221
224
|
preferredColor: passportColor || 'auto'
|
|
222
225
|
}),
|
|
223
226
|
name: x.title,
|
|
224
227
|
id: x.id
|
|
225
228
|
};
|
|
226
229
|
}),
|
|
227
|
-
onSelect: index =>
|
|
230
|
+
onSelect: index => handleChangePassport({
|
|
228
231
|
target: {
|
|
229
|
-
value: user.passportTypes[index].name
|
|
232
|
+
value: pageState.user.passportTypes[index].name
|
|
230
233
|
}
|
|
231
234
|
}),
|
|
232
235
|
defaultIndex: 0
|
|
@@ -237,7 +240,7 @@ function LostPassport(_ref2) {
|
|
|
237
240
|
variant: "contained",
|
|
238
241
|
color: "primary",
|
|
239
242
|
onClick: () => onSelectPassport(),
|
|
240
|
-
disabled: !passport,
|
|
243
|
+
disabled: !pageState.passport,
|
|
241
244
|
children: t('common.next')
|
|
242
245
|
})
|
|
243
246
|
})]
|
|
@@ -248,8 +251,8 @@ function LostPassport(_ref2) {
|
|
|
248
251
|
content: () => {
|
|
249
252
|
var _window, _window$blocklet;
|
|
250
253
|
const extraParams = {
|
|
251
|
-
receiverDid: user.did,
|
|
252
|
-
passportName: passport,
|
|
254
|
+
receiverDid: pageState.user.did,
|
|
255
|
+
passportName: pageState.passport,
|
|
253
256
|
teamDid: ((_window = window) === null || _window === void 0 ? void 0 : (_window$blocklet = _window.blocklet) === null || _window$blocklet === void 0 ? void 0 : _window$blocklet.did) || ''
|
|
254
257
|
};
|
|
255
258
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Connect.default, {
|
|
@@ -306,7 +309,7 @@ function LostPassport(_ref2) {
|
|
|
306
309
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Stepper.default, {
|
|
307
310
|
className: "stepper-progress",
|
|
308
311
|
alternativeLabel: true,
|
|
309
|
-
activeStep: activeStep,
|
|
312
|
+
activeStep: pageState.activeStep,
|
|
310
313
|
children: steps.map(_ref3 => {
|
|
311
314
|
let {
|
|
312
315
|
label
|
|
@@ -320,8 +323,8 @@ function LostPassport(_ref2) {
|
|
|
320
323
|
})
|
|
321
324
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
322
325
|
className: "stepper-content",
|
|
323
|
-
children: steps[activeStep].content()
|
|
324
|
-
}), !success && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
326
|
+
children: steps[pageState.activeStep].content()
|
|
327
|
+
}), !pageState.success && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
325
328
|
textAlign: "center",
|
|
326
329
|
fontSize: 12,
|
|
327
330
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.Link, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/ux",
|
|
3
|
-
"version": "1.16.17-beta-
|
|
3
|
+
"version": "1.16.17-beta-a8cf4b25",
|
|
4
4
|
"description": "UX components shared across abtnode packages",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -27,23 +27,23 @@
|
|
|
27
27
|
"author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
|
|
28
28
|
"license": "Apache-2.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@abtnode/auth": "1.16.17-beta-
|
|
31
|
-
"@abtnode/constant": "1.16.17-beta-
|
|
32
|
-
"@abtnode/util": "1.16.17-beta-
|
|
30
|
+
"@abtnode/auth": "1.16.17-beta-a8cf4b25",
|
|
31
|
+
"@abtnode/constant": "1.16.17-beta-a8cf4b25",
|
|
32
|
+
"@abtnode/util": "1.16.17-beta-a8cf4b25",
|
|
33
33
|
"@ahooksjs/use-url-state": "^3.5.1",
|
|
34
|
-
"@arcblock/did": "^1.18.
|
|
35
|
-
"@arcblock/did-connect": "^2.8.
|
|
34
|
+
"@arcblock/did": "^1.18.93",
|
|
35
|
+
"@arcblock/did-connect": "^2.8.4",
|
|
36
36
|
"@arcblock/did-motif": "^1.1.13",
|
|
37
|
-
"@arcblock/icons": "^2.8.
|
|
38
|
-
"@arcblock/nft-display": "2.8.
|
|
39
|
-
"@arcblock/react-hooks": "^2.8.
|
|
40
|
-
"@arcblock/terminal": "^2.8.
|
|
41
|
-
"@arcblock/ux": "^2.8.
|
|
42
|
-
"@blocklet/constant": "1.16.17-beta-
|
|
37
|
+
"@arcblock/icons": "^2.8.4",
|
|
38
|
+
"@arcblock/nft-display": "2.8.4",
|
|
39
|
+
"@arcblock/react-hooks": "^2.8.4",
|
|
40
|
+
"@arcblock/terminal": "^2.8.4",
|
|
41
|
+
"@arcblock/ux": "^2.8.4",
|
|
42
|
+
"@blocklet/constant": "1.16.17-beta-a8cf4b25",
|
|
43
43
|
"@blocklet/launcher-layout": "2.2.22",
|
|
44
|
-
"@blocklet/list": "^0.12.
|
|
45
|
-
"@blocklet/meta": "1.16.17-beta-
|
|
46
|
-
"@blocklet/ui-react": "^2.8.
|
|
44
|
+
"@blocklet/list": "^0.12.46",
|
|
45
|
+
"@blocklet/meta": "1.16.17-beta-a8cf4b25",
|
|
46
|
+
"@blocklet/ui-react": "^2.8.4",
|
|
47
47
|
"@blocklet/uploader": "^0.0.32",
|
|
48
48
|
"@emotion/react": "^11.10.4",
|
|
49
49
|
"@emotion/styled": "^11.10.4",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@mui/material": "^5.14.10",
|
|
55
55
|
"@mui/styles": "^5.14.10",
|
|
56
56
|
"@mui/x-date-pickers": "^6.14.0",
|
|
57
|
-
"@ocap/client": "1.18.
|
|
57
|
+
"@ocap/client": "1.18.93",
|
|
58
58
|
"@uiw/react-markdown-preview": "4.0.6",
|
|
59
59
|
"ahooks": "^3.7.1",
|
|
60
60
|
"axios": "^0.27.2",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"babel-plugin-inline-react-svg": "^1.1.2",
|
|
101
101
|
"glob": "^10.3.3"
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "df8486ab9a180f0f3fc812821440a995d65bc63d",
|
|
104
104
|
"exports": {
|
|
105
105
|
".": {
|
|
106
106
|
"import": "./es/index.js",
|