@arcblock/ux 2.5.39 → 2.5.40
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.
@@ -105,7 +105,7 @@ const getSourceProvider = user => {
|
|
105
105
|
};
|
106
106
|
|
107
107
|
function SessionManager(_ref) {
|
108
|
-
var _session$user, _session$user$avatar, _session$user3, _session$user4;
|
108
|
+
var _session$user, _session$user$avatar, _session$user3, _session$user4, _session$user5;
|
109
109
|
|
110
110
|
let {
|
111
111
|
session,
|
@@ -228,7 +228,9 @@ function SessionManager(_ref) {
|
|
228
228
|
args[_key] = arguments[_key];
|
229
229
|
}
|
230
230
|
|
231
|
-
logoutOAuth(
|
231
|
+
logoutOAuth({
|
232
|
+
session
|
233
|
+
}, ...args).then(() => {
|
232
234
|
onLogout(...args);
|
233
235
|
}).catch(err => {
|
234
236
|
console.error(err);
|
@@ -355,9 +357,21 @@ function SessionManager(_ref) {
|
|
355
357
|
size: "small"
|
356
358
|
})
|
357
359
|
})]
|
358
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
359
|
-
|
360
|
-
children: walletDid
|
360
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
361
|
+
className: "session-manager-id-list",
|
362
|
+
children: [walletDid && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
363
|
+
className: "session-manager-id-item",
|
364
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Address.default, {
|
365
|
+
responsive: false,
|
366
|
+
children: walletDid
|
367
|
+
})
|
368
|
+
}), (session === null || session === void 0 ? void 0 : (_session$user5 = session.user) === null || _session$user5 === void 0 ? void 0 : _session$user5.email) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
369
|
+
className: "session-manager-id-item",
|
370
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Address.default, {
|
371
|
+
responsive: false,
|
372
|
+
children: session.user.email
|
373
|
+
})
|
374
|
+
})]
|
361
375
|
})]
|
362
376
|
}), Array.isArray(menu) && menu.map((menuItem, index) => {
|
363
377
|
const {
|
@@ -508,7 +522,7 @@ SessionManager.defaultProps = {
|
|
508
522
|
dark: false,
|
509
523
|
size: 24
|
510
524
|
};
|
511
|
-
const StyledPopper = (0, _Theme.styled)(_material.Popper)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n z-index: ", ";\n .MuiList-root {\n width: 280px;\n }\n .session-manager-user {\n font-size: 12px;\n flex-direction: column;\n align-items: flex-start;\n padding: 24px 24px 10px;\n }\n .session-manager-user-name {\n font-size: 20px;\n color: ", ";\n font-weight: bold;\n margin-bottom: 10px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n .session-manager-menu-item {\n padding: 18.5px 24px;\n color: #777;\n font-size: 16px;\n &:hover {\n background-color: #fbfbfb;\n }\n }\n .session-manager-menu-icon {\n color: #999;\n margin-right: 16px;\n }\n"])), _ref3 => {
|
525
|
+
const StyledPopper = (0, _Theme.styled)(_material.Popper)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n z-index: ", ";\n .MuiList-root {\n width: 280px;\n }\n .session-manager-user {\n font-size: 12px;\n flex-direction: column;\n align-items: flex-start;\n padding: 24px 24px 10px;\n }\n .session-manager-user-name {\n font-size: 20px;\n color: ", ";\n font-weight: bold;\n margin-bottom: 10px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n .session-manager-id-item {\n position: relative;\n padding-left: 8px;\n /* HACK: \u5F53\u524D\u5143\u7D20\u65E2\u662F\u7B2C\u4E00\u4E2A\uFF0C\u4E5F\u662F\u6700\u540E\u4E00\u4E2A\uFF0C\u5373\u53EA\u6709\u4E00\u4E2A\u540C\u7EA7\u5143\u7D20 */\n &:last-child:first-child {\n padding-left: 0;\n &:before,\n &:after {\n content: unset;\n }\n }\n &:before {\n position: absolute;\n content: '';\n left: 0px;\n top: 50%;\n width: 6px;\n height: 1px;\n background-color: #aeaeae;\n }\n &:not(:last-child):after {\n position: absolute;\n content: '';\n left: 0px;\n top: 50%;\n height: 100%;\n width: 1px;\n background-color: #aeaeae;\n }\n }\n .session-manager-menu-item {\n padding: 18.5px 24px;\n color: #777;\n font-size: 16px;\n &:hover {\n background-color: #fbfbfb;\n }\n }\n .session-manager-menu-icon {\n color: #999;\n margin-right: 16px;\n }\n"])), _ref3 => {
|
512
526
|
let {
|
513
527
|
theme
|
514
528
|
} = _ref3;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@arcblock/ux",
|
3
|
-
"version": "2.5.
|
3
|
+
"version": "2.5.40",
|
4
4
|
"description": "Common used react components for arcblock products",
|
5
5
|
"keywords": [
|
6
6
|
"react",
|
@@ -45,11 +45,11 @@
|
|
45
45
|
"peerDependencies": {
|
46
46
|
"react": ">=18.1.0"
|
47
47
|
},
|
48
|
-
"gitHead": "
|
48
|
+
"gitHead": "c3a5391f9516b4193ce5699c9302be745159371a",
|
49
49
|
"dependencies": {
|
50
50
|
"@arcblock/did-motif": "^1.1.10",
|
51
|
-
"@arcblock/icons": "^2.5.
|
52
|
-
"@arcblock/react-hooks": "^2.5.
|
51
|
+
"@arcblock/icons": "^2.5.40",
|
52
|
+
"@arcblock/react-hooks": "^2.5.40",
|
53
53
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
54
54
|
"@emotion/react": "^11.10.4",
|
55
55
|
"@emotion/styled": "^11.10.4",
|
@@ -143,7 +143,7 @@ function SessionManager({
|
|
143
143
|
}
|
144
144
|
function _onLogout() {
|
145
145
|
session.logout((...args) => {
|
146
|
-
logoutOAuth(session, ...args)
|
146
|
+
logoutOAuth({ session }, ...args)
|
147
147
|
.then(() => {
|
148
148
|
onLogout(...args);
|
149
149
|
})
|
@@ -255,7 +255,18 @@ function SessionManager({
|
|
255
255
|
/>
|
256
256
|
)}
|
257
257
|
</div>
|
258
|
-
<
|
258
|
+
<div className="session-manager-id-list">
|
259
|
+
{walletDid && (
|
260
|
+
<div className="session-manager-id-item">
|
261
|
+
<DidAddress responsive={false}>{walletDid}</DidAddress>
|
262
|
+
</div>
|
263
|
+
)}
|
264
|
+
{session?.user?.email && (
|
265
|
+
<div className="session-manager-id-item">
|
266
|
+
<DidAddress responsive={false}>{session.user.email}</DidAddress>
|
267
|
+
</div>
|
268
|
+
)}
|
269
|
+
</div>
|
259
270
|
</div>
|
260
271
|
{Array.isArray(menu) &&
|
261
272
|
menu.map((menuItem, index) => {
|
@@ -442,6 +453,36 @@ const StyledPopper = styled(Popper)`
|
|
442
453
|
align-items: center;
|
443
454
|
justify-content: space-between;
|
444
455
|
}
|
456
|
+
.session-manager-id-item {
|
457
|
+
position: relative;
|
458
|
+
padding-left: 8px;
|
459
|
+
/* HACK: 当前元素既是第一个,也是最后一个,即只有一个同级元素 */
|
460
|
+
&:last-child:first-child {
|
461
|
+
padding-left: 0;
|
462
|
+
&:before,
|
463
|
+
&:after {
|
464
|
+
content: unset;
|
465
|
+
}
|
466
|
+
}
|
467
|
+
&:before {
|
468
|
+
position: absolute;
|
469
|
+
content: '';
|
470
|
+
left: 0px;
|
471
|
+
top: 50%;
|
472
|
+
width: 6px;
|
473
|
+
height: 1px;
|
474
|
+
background-color: #aeaeae;
|
475
|
+
}
|
476
|
+
&:not(:last-child):after {
|
477
|
+
position: absolute;
|
478
|
+
content: '';
|
479
|
+
left: 0px;
|
480
|
+
top: 50%;
|
481
|
+
height: 100%;
|
482
|
+
width: 1px;
|
483
|
+
background-color: #aeaeae;
|
484
|
+
}
|
485
|
+
}
|
445
486
|
.session-manager-menu-item {
|
446
487
|
padding: 18.5px 24px;
|
447
488
|
color: #777;
|