@abtnode/ux 1.16.14-beta-a898bfcb → 1.16.14-beta-d802cd3c

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.
@@ -7,17 +7,18 @@ exports.default = void 0;
7
7
  var _react = require("react");
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _styled = _interopRequireDefault(require("@emotion/styled"));
10
- var _createPassportSvg = _interopRequireDefault(require("@abtnode/auth/lib/util/create-passport-svg"));
11
10
  var _context = require("@arcblock/ux/lib/Locale/context");
12
11
  var _Dialog = _interopRequireDefault(require("@arcblock/ux/lib/Dialog"));
13
12
  var _iconsMaterial = require("@mui/icons-material");
14
13
  var _jsxRuntime = require("react/jsx-runtime");
15
14
  var _templateObject;
15
+ /* eslint-disable jsx-a11y/alt-text */
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
17
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
18
18
  function InvitationPassport(_ref) {
19
19
  let {
20
20
  invitation,
21
+ createPassportSvg,
21
22
  passportColor
22
23
  } = _ref;
23
24
  const [open, setOpen] = (0, _react.useState)(false);
@@ -29,13 +30,14 @@ function InvitationPassport(_ref) {
29
30
  return roleRaw.toUpperCase();
30
31
  }, [invitation.role.title, invitation.role.name]);
31
32
  const display = (0, _react.useMemo)(() => {
32
- return (0, _createPassportSvg.default)({
33
+ return createPassportSvg({
33
34
  title: roleName,
34
35
  issuer: invitation.info.name,
35
36
  issuerDid: invitation.info.appDid,
36
37
  ownerName: 'Your Name',
37
38
  // can't get avatar, cause user is not login
38
39
  // ownerAvatarUrl: user.avatar,
40
+ ownerDid: invitation.info.appDid,
39
41
  isDataUrl: true,
40
42
  preferredColor: invitation.info.passportColor || passportColor
41
43
  });
@@ -48,33 +50,16 @@ function InvitationPassport(_ref) {
48
50
  setOpen(false);
49
51
  }, []);
50
52
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
51
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(Root, {
52
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
53
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Root, {
54
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
53
55
  className: "invite-passport__card",
54
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
55
- src: display,
56
+ onClick: onViewPermission,
57
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("object", {
58
+ data: display,
56
59
  alt: "passport",
57
60
  className: "invite-passport__cover"
58
61
  })
59
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
60
- className: "invite-passport__content",
61
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
62
- className: "invite-passport__title",
63
- children: roleName
64
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
65
- className: "invite-passport__description",
66
- title: invitation.role.description,
67
- children: invitation.role.description
68
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
69
- style: {
70
- flex: 1
71
- }
72
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
73
- className: "invite-passport__view-permission",
74
- onClick: onViewPermission,
75
- children: t('invite.viewPermission')
76
- })]
77
- })]
62
+ })
78
63
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.default, {
79
64
  open: open,
80
65
  title: t('invite.viewPermission'),
@@ -115,12 +100,13 @@ function InvitationPassport(_ref) {
115
100
  }
116
101
  InvitationPassport.propTypes = {
117
102
  invitation: _propTypes.default.object.isRequired,
103
+ createPassportSvg: _propTypes.default.func.isRequired,
118
104
  passportColor: _propTypes.default.string
119
105
  };
120
106
  InvitationPassport.defaultProps = {
121
107
  passportColor: 'auto'
122
108
  };
123
- const Root = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n max-width: 350px;\n margin: 30px auto;\n .invite-passport__card {\n margin-right: 12px;\n width: 100px;\n height: 100px;\n flex-shrink: 0;\n .invite-passport__cover {\n width: 100%;\n height: 100%;\n }\n }\n .invite-passport__content {\n flex: 1;\n display: flex;\n flex-direction: column;\n }\n .invite-passport__title {\n font-weight: 700;\n font-size: 16px;\n }\n .invite-passport__description {\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n height: 3em;\n color: #999;\n font-size: 14px;\n }\n .invite-passport__view-permission {\n cursor: pointer;\n font-size: 14px;\n font-weight: 600;\n line-height: 18px;\n color: ", ";\n }\n"])), _ref2 => {
109
+ const Root = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n max-width: 350px;\n margin: 30px auto;\n .invite-passport__card {\n margin: 0 auto;\n width: 228px;\n height: 258px;\n flex-shrink: 0;\n .invite-passport__cover {\n width: 100%;\n height: 100%;\n }\n }\n .invite-passport__content {\n flex: 1;\n display: flex;\n flex-direction: column;\n }\n .invite-passport__title {\n font-weight: 700;\n font-size: 16px;\n }\n .invite-passport__description {\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n height: 3em;\n color: #999;\n font-size: 14px;\n }\n .invite-passport__view-permission {\n cursor: pointer;\n font-size: 14px;\n font-weight: 600;\n line-height: 18px;\n color: ", ";\n }\n"])), _ref2 => {
124
110
  let {
125
111
  theme
126
112
  } = _ref2;
@@ -24,6 +24,7 @@ function Invitation(_ref) {
24
24
  let {
25
25
  getDataFn,
26
26
  passportColor,
27
+ createPassportSvg,
27
28
  onLoginSuccess,
28
29
  checkFn,
29
30
  onReceive
@@ -53,6 +54,7 @@ function Invitation(_ref) {
53
54
  invitation: state.data
54
55
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_invitationPassport.default, {
55
56
  invitation: state.data,
57
+ createPassportSvg: createPassportSvg,
56
58
  passportColor: passportColor
57
59
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Section2, {
58
60
  invitation: state.data,
@@ -66,6 +68,7 @@ function Invitation(_ref) {
66
68
  Invitation.propTypes = {
67
69
  getDataFn: _propTypes.default.func.isRequired,
68
70
  checkFn: _propTypes.default.func.isRequired,
71
+ createPassportSvg: _propTypes.default.func.isRequired,
69
72
  onLoginSuccess: _propTypes.default.func,
70
73
  onReceive: _propTypes.default.func,
71
74
  passportColor: _propTypes.default.string
package/lib/locales/en.js CHANGED
@@ -91,6 +91,7 @@ module.exports = {
91
91
  alreadyExist: 'already exists',
92
92
  approve: 'Approve',
93
93
  approved: 'approved',
94
+ appUrl: 'APP Url',
94
95
  auditLogs: 'Audit Trail',
95
96
  author: 'Author',
96
97
  avatar: 'Avatar',
@@ -122,6 +123,7 @@ module.exports = {
122
123
  continue: 'Continue',
123
124
  continueWith: 'Continue With',
124
125
  copiedTip: 'Copied',
126
+ copyAndClose: 'Copy & Close',
125
127
  copyTip: 'Click To Copy',
126
128
  coreStorage: 'Core Storage',
127
129
  cpu: 'CPU',
@@ -189,6 +191,7 @@ module.exports = {
189
191
  lastPublishedAt: 'Published At',
190
192
  launcher: 'Launcher Information',
191
193
  leavePageTip: 'Are you sure to leave the page?',
194
+ link: 'Link',
192
195
  loading: 'loading',
193
196
  log: 'View Logs',
194
197
  logStorage: 'Log Storage',
@@ -1247,7 +1250,6 @@ module.exports = {
1247
1250
  launchFailed: 'Failed to launch the app, please try again',
1248
1251
  installedButStopped: 'The app is installed successfully, but cannot be started. You can start it manually after resolving blocking issues',
1249
1252
  installedButError: 'The app is successfully installed, but failed to start',
1250
- upgradeFailed: 'Upgrade Failed',
1251
1253
  restoreFailed: 'Failed to restore app, please try again'
1252
1254
  },
1253
1255
  steps: {
@@ -1454,7 +1456,8 @@ module.exports = {
1454
1456
  clientIdDescribe: "Auth0's clientId is required"
1455
1457
  },
1456
1458
  comingSoon: 'More login methods are under construction',
1457
- moreLogin: 'More Login'
1459
+ moreLogin: 'More Login',
1460
+ federated: 'Federated Login'
1458
1461
  },
1459
1462
  expiration: {
1460
1463
  tips: {
@@ -1480,5 +1483,49 @@ module.exports = {
1480
1483
  logSize: 'Log Size',
1481
1484
  bandwidth: 'Bandwidth'
1482
1485
  }
1486
+ },
1487
+ federated: {
1488
+ inviteJoinFederatedLogin: 'Invite to join federated login',
1489
+ inviteJoinFederatedLoginDescription: 'Copy the following address and fill it in the application where you need to join to apply for federated login.',
1490
+ federatedLogin: 'Federated login',
1491
+ joinFederatedLogin: 'Join federated login',
1492
+ joinFederatedLoginDescription: 'Please enter the federated login address provided by Master Blocklet to join the federated login',
1493
+ federatedJoinAppUrl: 'Federated login join appUrl',
1494
+ federatedJoinAppUrlRequired: 'Please input federated login join appUrl',
1495
+ failedToGetFederatedLoginAppUrl: 'Failed to get federated login join appUrl',
1496
+ federatedJoinAppUrlInvalid: 'Federated login appUrl is invalid',
1497
+ siteDetail: 'Site detail',
1498
+ approveToJoinLogin: 'Approve to join federated login',
1499
+ approve: 'Enable login',
1500
+ revoke: 'Disable login',
1501
+ enableFederatedLogin: 'Enable federated login',
1502
+ disableFederatedLogin: 'Disable federated login',
1503
+ enableFederatedLoginDescription: 'After enable federated login, this site will be auto login',
1504
+ disableFederatedLoginDescription: 'After disable federated login, this site will not be auto login',
1505
+ enableFederatedAutoLogin: 'Enable automatic login',
1506
+ enableFederatedAutoLoginDescription: 'After enable automatic login, if there is currently a unified login status, the site will automatically log in the identity of the federated login',
1507
+ disableFederatedAutoLogin: 'Disable automatic login',
1508
+ disableFederatedAutoLoginDescription: 'After the automatic login is turned off, the site will not automatically log in the user information of the unified login, and you can still choose to manually click to log in with the identity of the federated login',
1509
+ info: {
1510
+ appId: 'APP DID',
1511
+ appPid: 'Permanent ID',
1512
+ migratedFrom: 'Also Known As',
1513
+ appName: 'Blocklet name',
1514
+ appDescription: 'Blocklet description',
1515
+ appUrl: 'Blocklet url',
1516
+ appLogo: 'Blocklet logo',
1517
+ did: 'Blocklet DID',
1518
+ serverId: 'Blocklet Server ID',
1519
+ serverVersion: 'Blocklet Server version',
1520
+ version: 'Blocklet version',
1521
+ appliedAt: 'Apply at',
1522
+ status: 'Status'
1523
+ },
1524
+ status: {
1525
+ pending: 'Pending',
1526
+ approved: 'Approved',
1527
+ rejected: 'Rejected',
1528
+ revoked: 'Revoked'
1529
+ }
1483
1530
  }
1484
1531
  };
package/lib/locales/zh.js CHANGED
@@ -94,6 +94,7 @@ module.exports = {
94
94
  alreadyExist: '已经存在',
95
95
  approve: '同意',
96
96
  approved: 'Approved',
97
+ appUrl: 'APP 链接',
97
98
  auditLogs: '审计记录',
98
99
  author: '作者',
99
100
  avatar: '头像',
@@ -125,6 +126,7 @@ module.exports = {
125
126
  continue: '继续',
126
127
  continueWith: '确认继续',
127
128
  copiedTip: '已复制',
129
+ copyAndClose: '复制并关闭',
128
130
  copyTip: '点击复制',
129
131
  coreStorage: '核心存储',
130
132
  cpu: 'CPU',
@@ -194,6 +196,7 @@ module.exports = {
194
196
  lastPublishedAt: '发布时间',
195
197
  launcher: '启动器信息',
196
198
  leavePageTip: '是否确定离开当前页面?',
199
+ link: '链接',
197
200
  loading: '加载中',
198
201
  log: '查看日志',
199
202
  logStorage: '日志存储',
@@ -1252,7 +1255,6 @@ module.exports = {
1252
1255
  launchFailed: '启动应用失败,请重试',
1253
1256
  installedButStopped: '应用安装成功,但是无法启动,解决启动问题之后后可手动启动',
1254
1257
  installedButError: '应用已经安装,但是运行出错了',
1255
- upgradeFailed: '更新失败',
1256
1258
  restoreFailed: '还原应用失败,请重试'
1257
1259
  },
1258
1260
  steps: {
@@ -1457,7 +1459,8 @@ module.exports = {
1457
1459
  clientIdDescribe: '请输入 Auth0 的 ClientID'
1458
1460
  },
1459
1461
  comingSoon: '更多登录方式正在建设中',
1460
- moreLogin: '更多登录方式'
1462
+ moreLogin: '更多登录方式',
1463
+ federated: '统一登录'
1461
1464
  },
1462
1465
  expiration: {
1463
1466
  tips: {
@@ -1483,5 +1486,49 @@ module.exports = {
1483
1486
  logSize: '日志大小',
1484
1487
  bandwidth: '带宽消耗'
1485
1488
  }
1489
+ },
1490
+ federated: {
1491
+ inviteJoinFederatedLogin: '邀请加入统一登录',
1492
+ inviteJoinFederatedLoginDescription: '复制以下地址到需要加入的应用中填入,申请加入统一登录',
1493
+ federatedLogin: '统一登录',
1494
+ joinFederatedLogin: '加入统一登录',
1495
+ joinFederatedLoginDescription: '请输入 Master Blocklet 提供的统一登录地址以加入统一登录',
1496
+ federatedJoinAppUrl: '统一登录地址',
1497
+ federatedJoinAppUrlRequired: '请输入统一登录地址',
1498
+ failedToGetFederatedLoginAppUrl: '获取统一登录地址失败',
1499
+ federatedJoinAppUrlInvalid: '统一登录地址不可用',
1500
+ siteDetail: '站点详情',
1501
+ approveToJoinLogin: '审核加入统一登录',
1502
+ approve: '恢复登录',
1503
+ revoke: '禁止登录',
1504
+ enableFederatedLogin: '启用统一登录',
1505
+ disableFederatedLogin: '禁用统一登录',
1506
+ enableFederatedLoginDescription: '启用统一登录后,该站点将自动登录',
1507
+ disableFederatedLoginDescription: '禁用统一登录后,该站点将无法自动登录',
1508
+ enableFederatedAutoLogin: '开启自动登录',
1509
+ enableFederatedAutoLoginDescription: '开启自动登录后,如果当前存在统一登录的状态,则该站点将自动登录统一登录的身份',
1510
+ disableFederatedAutoLogin: '关闭自动登录',
1511
+ disableFederatedAutoLoginDescription: '关闭自动登录后,该站点将不会自动登录统一登录的用户信息,您仍可选择手动点击登录统一登录的身份',
1512
+ info: {
1513
+ appId: '应用 DID',
1514
+ appPid: '永久 DID',
1515
+ migratedFrom: '曾用 DID',
1516
+ appName: '应用名称',
1517
+ appDescription: '应用描述',
1518
+ appUrl: '应用地址',
1519
+ appLogo: '应用图标',
1520
+ did: '应用 DID',
1521
+ serverId: 'Blocklet Server ID',
1522
+ serverVersion: 'Blocklet Server 版本',
1523
+ version: '应用版本',
1524
+ appliedAt: '申请时间',
1525
+ status: '状态'
1526
+ },
1527
+ status: {
1528
+ pending: '待审核',
1529
+ approved: '已通过',
1530
+ rejected: '已拒绝',
1531
+ revoked: '已撤销'
1532
+ }
1486
1533
  }
1487
1534
  };
@@ -16,7 +16,7 @@ var _clock = _interopRequireDefault(require("./clock"));
16
16
  var _node = require("../contexts/node");
17
17
  var _jsxRuntime = require("react/jsx-runtime");
18
18
  var _templateObject, _templateObject2;
19
- const _excluded = ["name", "logId", "types", "initialData", "prepend", "postpend"],
19
+ const _excluded = ["name", "logId", "types", "defaultTypeIndex", "initialData", "prepend", "postpend", "onTypeChange"],
20
20
  _excluded2 = ["logFile"];
21
21
  /**
22
22
  * 按 level/destination 分类的一组 terminal
@@ -35,9 +35,11 @@ function LogTerminalGroup(_ref) {
35
35
  name,
36
36
  logId,
37
37
  types,
38
+ defaultTypeIndex,
38
39
  initialData,
39
40
  prepend,
40
- postpend
41
+ postpend,
42
+ onTypeChange
41
43
  } = _ref,
42
44
  rest = _objectWithoutProperties(_ref, _excluded);
43
45
  const {
@@ -53,7 +55,7 @@ function LogTerminalGroup(_ref) {
53
55
  stderr: 'stderr'
54
56
  };
55
57
  const isMobile = (0, _useMediaQuery.default)(theme => theme.breakpoints.down('md'));
56
- const [currentType, setCurrentType] = (0, _react.useState)(types[0]);
58
+ const [currentType, setCurrentType] = (0, _react.useState)(types[defaultTypeIndex || 0]);
57
59
  const [logFiles, setLogFiles] = (0, _react.useState)();
58
60
  const terminalRefs = (0, _react.useRef)({});
59
61
 
@@ -94,7 +96,10 @@ function LogTerminalGroup(_ref) {
94
96
  variant: 'contained'
95
97
  } : {};
96
98
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, _objectSpread(_objectSpread({}, props), {}, {
97
- onClick: () => setCurrentType(type),
99
+ onClick: () => {
100
+ setCurrentType(type);
101
+ onTypeChange(type);
102
+ },
98
103
  children: logTypeLabels[type]
99
104
  }), type);
100
105
  })
@@ -126,16 +131,20 @@ LogTerminalGroup.propTypes = {
126
131
  logId: _propTypes.default.string.isRequired,
127
132
  // 日志类型, info/error 或 stdin/stdout/access
128
133
  types: _propTypes.default.arrayOf(_propTypes.default.string),
134
+ defaultTypeIndex: _propTypes.default.number,
129
135
  // 写入 terminal 的初始数据
130
136
  initialData: _propTypes.default.arrayOf(_propTypes.default.string),
131
137
  prepend: _propTypes.default.node,
132
- postpend: _propTypes.default.node
138
+ postpend: _propTypes.default.node,
139
+ onTypeChange: _propTypes.default.func
133
140
  };
134
141
  LogTerminalGroup.defaultProps = {
135
142
  types: ['error', 'info', 'access', 'stdout', 'stderr'],
143
+ defaultTypeIndex: 0,
136
144
  initialData: [],
137
145
  prepend: null,
138
- postpend: null
146
+ postpend: null,
147
+ onTypeChange: () => {}
139
148
  };
140
149
  const LogTerminalGroupRoot = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n height: 100%;\n .log-terminal-group-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding-bottom: 16px;\n }\n\n .log-terminal-group-head-start {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n gap: 16px;\n ", " {\n flex-direction: column;\n align-items: start;\n }\n }\n\n .log-terminal-group-head-end {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n gap: 16px;\n ", " {\n flex-direction: column;\n align-items: start;\n }\n }\n .log-terminal-group-terminals {\n flex: 1;\n position: relative;\n overflow: hidden;\n > * {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n }\n }\n"])), props => props.theme.breakpoints.down('md'), props => props.theme.breakpoints.down('md'));
141
150
  const LogTerminal = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
@@ -215,6 +215,7 @@ function LostPassport(_ref2) {
215
215
  title: x.title,
216
216
  issuer: x.issuer.name,
217
217
  issuerDid: x.issuer.id,
218
+ ownerDid: user.did,
218
219
  ownerName: user.fullName,
219
220
  ownerAvatarUrl: user.avatar,
220
221
  isDataUrl: true,
@@ -7,7 +7,7 @@ exports.default = PassportInput;
7
7
  var _propTypes = _interopRequireDefault(require("prop-types"));
8
8
  var _Box = _interopRequireDefault(require("@mui/material/Box"));
9
9
  var _createPassportSvg = _interopRequireDefault(require("@abtnode/auth/lib/util/create-passport-svg"));
10
- var _passportColor = require("@abtnode/auth/lib/util/passport-color");
10
+ var _nftDisplay = require("@arcblock/nft-display");
11
11
  var _util = require("@blocklet/meta/lib/util");
12
12
  var _colorInput = _interopRequireDefault(require("./color-input"));
13
13
  var _commonPropTypes = _interopRequireDefault(require("./common-prop-types"));
@@ -32,7 +32,7 @@ function PassportInput(_ref) {
32
32
  const {
33
33
  blocklet
34
34
  } = componentProps;
35
- const color = value === 'auto' ? (0, _passportColor.getPassportColorFromDid)(blocklet.appDid) : value;
35
+ const color = value === 'auto' ? (0, _nftDisplay.getPassportColorFromDid)(blocklet.appDid) : value;
36
36
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
37
37
  display: "flex",
38
38
  alignItems: "center",
@@ -47,6 +47,7 @@ function PassportInput(_ref) {
47
47
  issuer: (0, _util.getDisplayName)(blocklet),
48
48
  issuerDid: blocklet.appDid,
49
49
  ownerName: 'Your Name',
50
+ ownerDid: blocklet.appDid,
50
51
  isDataUrl: true,
51
52
  preferredColor: value || 'auto'
52
53
  })
@@ -115,7 +115,8 @@ SimpleInfo.propTypes = {
115
115
  };
116
116
  function MemberList(_ref2) {
117
117
  let {
118
- type
118
+ type,
119
+ createPassportSvg
119
120
  } = _ref2;
120
121
  const {
121
122
  appIdList = []
@@ -480,6 +481,9 @@ function MemberList(_ref2) {
480
481
  className: "table-toolbar-left",
481
482
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormControlLabel.default, {
482
483
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox.default, {
484
+ sx: {
485
+ display: 'flex !important'
486
+ },
483
487
  disabled: loading,
484
488
  color: "primary",
485
489
  checked: search.hideBlocked,
@@ -506,6 +510,7 @@ function MemberList(_ref2) {
506
510
  }), memberDialog && /*#__PURE__*/(0, _jsxRuntime.jsx)(_member.default, {
507
511
  onCancel: () => setMemberDialog(null),
508
512
  userDid: memberDialog.did,
513
+ createPassportSvg: createPassportSvg,
509
514
  initTab: memberDialog.initTab
510
515
  }), showInviteMember && /*#__PURE__*/(0, _jsxRuntime.jsx)(_inviteMember.default, {
511
516
  teamDid: teamDid,
@@ -528,7 +533,8 @@ function MemberList(_ref2) {
528
533
  })]
529
534
  });
530
535
  }
531
- 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-text {\n margin-left: 10px;\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 label span:first-child {\n display: flex;\n }\n }\n"])), props => props.theme.breakpoints.values.md);
536
+ 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-text {\n margin-left: 10px;\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);
532
537
  MemberList.propTypes = {
533
- type: _propTypes.default.oneOf(['server', 'blocklet']).isRequired
538
+ type: _propTypes.default.oneOf(['server', 'blocklet']).isRequired,
539
+ createPassportSvg: _propTypes.default.func.isRequired
534
540
  };
@@ -91,7 +91,8 @@ function Member(_ref3) {
91
91
  let {
92
92
  userDid,
93
93
  onCancel,
94
- initTab
94
+ initTab,
95
+ createPassportSvg
95
96
  } = _ref3;
96
97
  const {
97
98
  api,
@@ -245,6 +246,7 @@ function Member(_ref3) {
245
246
  user: pageState.user,
246
247
  teamDid: teamDid,
247
248
  roles: roles,
249
+ createPassportSvg: createPassportSvg,
248
250
  onCreate: () => {
249
251
  getData(teamDid, userDid).then(() => {
250
252
  // oauth 账户邀请后,不会产生待领取的邀请链接
@@ -381,6 +383,7 @@ function Member(_ref3) {
381
383
  Member.propTypes = {
382
384
  userDid: _propTypes.default.string.isRequired,
383
385
  onCancel: _propTypes.default.func.isRequired,
386
+ createPassportSvg: _propTypes.default.func.isRequired,
384
387
  initTab: _propTypes.default.string
385
388
  };
386
389
  Member.defaultProps = {
@@ -21,7 +21,6 @@ var _RevokeIcon = _interopRequireDefault(require("@arcblock/icons/lib/RevokeIcon
21
21
  var _ExternalIssuerIcon = _interopRequireDefault(require("@arcblock/icons/lib/ExternalIssuerIcon"));
22
22
  var _Empty = _interopRequireDefault(require("@arcblock/ux/lib/Empty"));
23
23
  var _constant = require("@abtnode/constant");
24
- var _createPassportSvg = _interopRequireDefault(require("@abtnode/auth/lib/util/create-passport-svg"));
25
24
  var _node = require("../../contexts/node");
26
25
  var _session = require("../../contexts/session");
27
26
  var _team = require("../../contexts/team");
@@ -75,7 +74,8 @@ function Passports(_ref2) {
75
74
  var _blocklet$settings;
76
75
  let {
77
76
  user,
78
- onCreate
77
+ onCreate,
78
+ createPassportSvg
79
79
  } = _ref2;
80
80
  const {
81
81
  t
@@ -230,15 +230,16 @@ function Passports(_ref2) {
230
230
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
231
231
  // eslint-disable-next-line react/no-danger
232
232
  dangerouslySetInnerHTML: {
233
- __html: (0, _createPassportSvg.default)({
233
+ __html: createPassportSvg({
234
234
  title: x.title || x.name,
235
235
  issuer: x.issuer && x.issuer.name,
236
236
  issuerDid: x.issuer && x.issuer.id,
237
237
  ownerName: user.fullName,
238
+ ownerDid: user.did,
238
239
  ownerAvatarUrl: user.avatar,
239
240
  revoked: x.revoked,
240
241
  preferredColor: passportColor,
241
- width: '120px'
242
+ width: '150px'
242
243
  })
243
244
  }
244
245
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -303,7 +304,7 @@ function Passports(_ref2) {
303
304
  })
304
305
  })]
305
306
  })
306
- })), !filteredPassports.length && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Empty.default, {
307
+ }, x.id)), !filteredPassports.length && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Empty.default, {
307
308
  children: t('common.empty')
308
309
  })]
309
310
  }), showIssueDialog && /*#__PURE__*/(0, _jsxRuntime.jsx)(_issuePassport.default, {
@@ -331,6 +332,7 @@ function Passports(_ref2) {
331
332
  }
332
333
  Passports.propTypes = {
333
334
  user: _propTypes.default.object.isRequired,
335
+ createPassportSvg: _propTypes.default.func.isRequired,
334
336
  onCreate: _propTypes.default.func
335
337
  };
336
338
  Passports.defaultProps = {
@@ -14,7 +14,7 @@ var _context = require("@arcblock/ux/lib/Locale/context");
14
14
  var _Button = _interopRequireDefault(require("@arcblock/ux/lib/Button"));
15
15
  var _createPassportSvg = _interopRequireDefault(require("@abtnode/auth/lib/util/create-passport-svg"));
16
16
  var _util = require("@blocklet/meta/lib/util");
17
- var _passportColor = require("@abtnode/auth/lib/util/passport-color");
17
+ var _nftDisplay = require("@arcblock/nft-display");
18
18
  var _constant = require("@blocklet/constant");
19
19
  var _Toast = _interopRequireDefault(require("@arcblock/ux/lib/Toast"));
20
20
  var _node = require("../../contexts/node");
@@ -44,7 +44,7 @@ function PassportColor(_ref) {
44
44
  } = (0, _context.useLocaleContext)();
45
45
  const [loading, setLoading] = (0, _react.useState)(false);
46
46
  const curColor = (blocklet.environments.find(x => x.key === 'BLOCKLET_PASSPORT_COLOR') || {}).value || 'auto';
47
- const defaultColor = curColor === 'auto' ? (0, _passportColor.getPassportColorFromDid)(blocklet.appDid) : curColor;
47
+ const defaultColor = curColor === 'auto' ? (0, _nftDisplay.getPassportColorFromDid)(blocklet.appDid) : curColor;
48
48
  const [color, setColor] = (0, _react.useState)(defaultColor);
49
49
  const onSubmit = async () => {
50
50
  const params = [{
@@ -107,6 +107,7 @@ function PassportColor(_ref) {
107
107
  issuer: (0, _util.getDisplayName)(blocklet),
108
108
  issuerDid: blocklet.appDid,
109
109
  ownerName: 'Your Name',
110
+ ownerDid: blocklet.appDid,
110
111
  isDataUrl: true,
111
112
  preferredColor: color
112
113
  })
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = PassportList;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
8
9
  var _styled = _interopRequireDefault(require("@emotion/styled"));
9
10
  var _Add = _interopRequireDefault(require("@mui/icons-material/Add"));
10
11
  var _Box = _interopRequireDefault(require("@mui/material/Box"));
@@ -15,7 +16,6 @@ var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularPr
15
16
  var _EditIcon = _interopRequireDefault(require("@arcblock/icons/lib/EditIcon"));
16
17
  var _LockIcon = _interopRequireDefault(require("@arcblock/icons/lib/LockIcon"));
17
18
  var _ExternalIssuerIcon = _interopRequireDefault(require("@arcblock/icons/lib/ExternalIssuerIcon"));
18
- var _createPassportSvg = _interopRequireDefault(require("@abtnode/auth/lib/util/create-passport-svg"));
19
19
  var _Toast = _interopRequireDefault(require("@arcblock/ux/lib/Toast"));
20
20
  var _node = require("../../contexts/node");
21
21
  var _team = require("../../contexts/team");
@@ -34,7 +34,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
34
34
  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
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; }
36
36
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
37
- function PassportList() {
37
+ function PassportList(_ref) {
38
+ let {
39
+ createPassportSvg
40
+ } = _ref;
38
41
  const {
39
42
  t
40
43
  } = (0, _react.useContext)(_context.LocaleContext);
@@ -187,19 +190,23 @@ function PassportList() {
187
190
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
188
191
  display: "flex",
189
192
  alignItems: "center",
190
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
193
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
191
194
  style: {
192
- width: 120
193
- },
194
- alt: "",
195
- src: (0, _createPassportSvg.default)({
196
- title: role.title,
197
- issuer: teamName,
198
- issuerDid: teamIssuerDid,
199
- ownerName: 'Your Name',
200
- isDataUrl: true,
201
- preferredColor: passportColor
202
- })
195
+ width: 150
196
+ }
197
+ // eslint-disable-next-line react/no-danger
198
+ ,
199
+ dangerouslySetInnerHTML: {
200
+ __html: createPassportSvg({
201
+ title: role.title,
202
+ issuer: teamName,
203
+ issuerDid: teamIssuerDid,
204
+ ownerName: 'Your Name',
205
+ ownerDid: teamIssuerDid,
206
+ preferredColor: passportColor,
207
+ width: '150px'
208
+ })
209
+ }
203
210
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
204
211
  ml: 3,
205
212
  className: "title",
@@ -248,5 +255,7 @@ function PassportList() {
248
255
  });
249
256
  }
250
257
  const Div = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .list {\n .item {\n padding: 12px;\n margin: 12px -12px;\n cursor: pointer;\n transition: box-shadow 0.4s;\n &:hover {\n box-shadow: 0 0 10px 4px rgba(0, 0, 0, 0.1);\n }\n }\n\n .title {\n font-weight: 400;\n font-size: 18px;\n width: 80px;\n line-height: 21px;\n color: #222222;\n }\n\n .description {\n flex: 1;\n margin-left: 64px;\n color: #999999;\n }\n\n .action {\n color: #bfbfbf;\n fill: #bfbfbf;\n }\n }\n"])));
251
- PassportList.propTypes = {};
258
+ PassportList.propTypes = {
259
+ createPassportSvg: _propTypes.default.func.isRequired
260
+ };
252
261
  PassportList.defaultProps = {};
@@ -139,7 +139,6 @@ function TrustedFactories(_ref) {
139
139
  size: 16,
140
140
  showDidLogo: false
141
141
  }), !!x.remark && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
142
- pl: 3.5,
143
142
  fontSize: 12,
144
143
  maxWidth: "300px",
145
144
  children: x.remark