@abtnode/ux 1.16.16-beta-2e5e3db7 → 1.16.16-beta-ca17cc31

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.
@@ -48,15 +48,21 @@ function AuditLog({
48
48
  if (!log.actor.did) {
49
49
  return null;
50
50
  }
51
+
52
+ // HACK: blocklet 类型会在存储前被强制置为 `''`,所以需要增加空字符串判断
53
+ const isUser = !['blocklet', ''].includes(log.actor.role);
51
54
  return /*#__PURE__*/_jsxs(Box, {
52
55
  className: "log-entry",
53
56
  "data-cy": "log-entry",
54
57
  children: [/*#__PURE__*/_jsx("div", {
55
58
  className: "log-author",
56
- children: /*#__PURE__*/_jsx(DidAvatar, {
59
+ children: isUser ? /*#__PURE__*/_jsx(DidAvatar, {
57
60
  did: log.actor.did,
58
61
  size: 36,
59
62
  shape: "circle"
63
+ }) : /*#__PURE__*/_jsx(DidAvatar, {
64
+ did: log.actor.did,
65
+ size: 36
60
66
  })
61
67
  }), /*#__PURE__*/_jsxs("div", {
62
68
  className: "log-body",
@@ -75,7 +81,7 @@ function AuditLog({
75
81
  },
76
82
  children: scopeFormatter(log.scope)
77
83
  })
78
- }), /*#__PURE__*/_jsxs(Link, {
84
+ }), isUser ? /*#__PURE__*/_jsxs(Link, {
79
85
  to: getUserLink({
80
86
  log,
81
87
  inService,
@@ -83,6 +89,8 @@ function AuditLog({
83
89
  }),
84
90
  target: "_blank",
85
91
  children: [log.actor.fullName, log.actor.role ? `(${log.actor.role})` : '']
92
+ }) : /*#__PURE__*/_jsxs("span", {
93
+ children: [log.actor.fullName, log.actor.role ? `(${log.actor.role})` : '']
86
94
  }), ' ', /*#__PURE__*/_jsx("span", {
87
95
  style: {
88
96
  margin: '0 4px'
@@ -242,6 +250,10 @@ const Div = styled.div`
242
250
  li {
243
251
  list-style-type: disc;
244
252
  }
253
+ code.code-highlight {
254
+ max-height: 300px;
255
+ overflow: auto;
256
+ }
245
257
  }
246
258
 
247
259
  .log-meta {
@@ -7,6 +7,7 @@ import Box from '@mui/material/Box';
7
7
  import Grid from '@mui/material/Grid';
8
8
  import Skeleton from '@mui/material/Skeleton';
9
9
  import styled from '@emotion/styled';
10
+ import { BLOCKLET_CONFIGURABLE_KEY } from '@blocklet/constant';
10
11
  import { useBlockletContext } from '../../../contexts/blocklet';
11
12
  import useAppLogo from '../../../hooks/use-app-logo';
12
13
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -23,13 +24,20 @@ function NavigationPreview({
23
24
  } = useAppLogo({
24
25
  blocklet
25
26
  });
27
+ const owner = blocklet?.environments?.find(x => x.key === BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER)?.value;
28
+ const year = blocklet?.environments?.find(x => x.key === BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR)?.value;
29
+ const copyright = owner || year ? {
30
+ owner,
31
+ year
32
+ } : undefined;
26
33
  const blockletInfo = {
27
34
  appId: blocklet.appDid,
28
35
  appLogo: logoUrl,
29
36
  appName: blocklet.meta.title,
30
37
  enableConnect: true,
31
38
  enableLocale: false,
32
- navigation
39
+ navigation,
40
+ copyright
33
41
  };
34
42
  return /*#__PURE__*/_jsx(LinkBlocker, {
35
43
  children: /*#__PURE__*/_jsxs(Box, {
@@ -67,14 +67,16 @@ function BlockletEnvironment({
67
67
  }
68
68
 
69
69
  // configurable blocklet environment
70
- const customDelete = blocklet.environments.find(x => x.key === 'BLOCKLET_DELETABLE');
70
+ const customDelete = blocklet.environments.find(x => x.key === BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE);
71
71
  const deletable = !customDelete || customDelete.value === 'yes';
72
- const customLanguages = blocklet.environments.find(x => x.key === 'BLOCKLET_APP_LANGUAGES');
73
- const customUrl = blocklet.environments.find(x => x.key === 'BLOCKLET_APP_URL');
74
- const customLogoSquare = blocklet.environments.find(x => x.key === 'BLOCKLET_APP_LOGO_SQUARE');
75
- const customLogoRect = blocklet.environments.find(x => x.key === 'BLOCKLET_APP_LOGO_RECT');
76
- const customLogoFavicon = blocklet.environments.find(x => x.key === 'BLOCKLET_APP_LOGO_FAVICON');
77
- const customLogoDeprecated = blocklet.environments.find(x => x.key === 'BLOCKLET_APP_LOGO');
72
+ const customLanguages = blocklet.environments.find(x => x.key === BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LANGUAGES);
73
+ const customUrl = blocklet.environments.find(x => x.key === BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL);
74
+ const customLogoSquare = blocklet.environments.find(x => x.key === BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE);
75
+ const customLogoRect = blocklet.environments.find(x => x.key === BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT);
76
+ const customLogoFavicon = blocklet.environments.find(x => x.key === BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON);
77
+ const customLogoDeprecated = blocklet.environments.find(x => x.key === BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO);
78
+ const copyrightOwner = blocklet.environments.find(x => x.key === BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER);
79
+ const copyrightYear = blocklet.environments.find(x => x.key === BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR);
78
80
  const configurableEnvs = [{
79
81
  key: BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_NAME,
80
82
  description: t('blocklet.config.name'),
@@ -103,6 +105,14 @@ function BlockletEnvironment({
103
105
  key: BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO,
104
106
  description: t('blocklet.config.logo'),
105
107
  value: customLogoDeprecated ? customLogoDeprecated.value : ''
108
+ }, {
109
+ key: BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER,
110
+ description: t('blocklet.config.copyrightOwner'),
111
+ value: copyrightOwner ? copyrightOwner.value : ''
112
+ }, {
113
+ key: BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR,
114
+ description: t('blocklet.config.copyrightYear'),
115
+ value: copyrightYear ? copyrightYear.value : ''
106
116
  }];
107
117
  if (clusterMode) {
108
118
  const exist = blocklet.configs.find(x => x.key === BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE);
@@ -10,6 +10,8 @@ import { Box, Button, SvgIcon } from '@mui/material';
10
10
  import { Address } from '@arcblock/did-connect';
11
11
  import Dialog from '@arcblock/ux/lib/Dialog';
12
12
  import StarsIcon from '@mui/icons-material/Stars';
13
+ import isUrl from 'is-url';
14
+ import joinUrl from 'url-join';
13
15
  import { useBlockletContext } from '../../contexts/blocklet';
14
16
  import { useNodeContext } from '../../contexts/node';
15
17
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -61,6 +63,9 @@ const FederatedDetailDialog = /*#__PURE__*/forwardRef((props, ref) => {
61
63
  approve
62
64
  }), [open, close, approve]);
63
65
  const infoList = useCreation(() => {
66
+ if (!state.show) {
67
+ return [];
68
+ }
64
69
  state.data.migratedFrom = [state.data.appId, state.data.appPid];
65
70
  const keys = ['appName', 'appLogo', 'appId', 'appPid', 'migratedFrom', 'appDescription', 'appUrl', 'version', 'appliedAt', 'status', 'serverId', 'serverVersion'];
66
71
  if (state.data.isMaster !== false) {
@@ -92,12 +97,27 @@ const FederatedDetailDialog = /*#__PURE__*/forwardRef((props, ref) => {
92
97
  });
93
98
  }
94
99
  if (['appLogo'].includes(key)) {
95
- value = /*#__PURE__*/_jsx("img", {
96
- src: `${state.data.appUrl}/${value}`,
97
- width: "60",
98
- height: "60",
99
- alt: state.data.appName
100
- });
100
+ const logoUrl = isUrl(value) ? value : joinUrl(state.data.appUrl || '', value || '');
101
+ try {
102
+ const logoUrlInstance = new URL(logoUrl);
103
+ logoUrlInstance.searchParams.set('imageFilter', 'resize');
104
+ // HACK: 保持跟其他地方使用的尺寸一致,可以复用同一资源的缓存,减少网络请求
105
+ logoUrlInstance.searchParams.set('w', '80');
106
+ logoUrlInstance.searchParams.set('h', '80');
107
+ value = /*#__PURE__*/_jsx("img", {
108
+ src: logoUrlInstance.href,
109
+ width: "60",
110
+ height: "60",
111
+ alt: state.data.appName
112
+ });
113
+ } catch {
114
+ value = /*#__PURE__*/_jsx("img", {
115
+ src: logoUrl,
116
+ width: "60",
117
+ height: "60",
118
+ alt: state.data.appName
119
+ });
120
+ }
101
121
  }
102
122
  if (key === 'status') {
103
123
  value = value && t(`federated.status.${value}`);
@@ -11,6 +11,7 @@ import { useContext, useRef, useState } from 'react';
11
11
  import { useCreation, useMemoizedFn } from 'ahooks';
12
12
  import Button from '@arcblock/ux/lib/Button';
13
13
  import Toast from '@arcblock/ux/lib/Toast';
14
+ import { BLOCKLET_CONFIGURABLE_KEY } from '@blocklet/constant';
14
15
  import { useBlockletContext } from '../../contexts/blocklet';
15
16
  import { useNodeContext } from '../../contexts/node';
16
17
  import useConfirm from '../../hooks/confirm';
@@ -226,16 +227,13 @@ function FederatedSiteList({
226
227
  };
227
228
  }, []);
228
229
  const showInvite = useMemoizedFn(() => {
229
- const link = blocklet.site?.domainAliases?.[0]?.href;
230
- if (link) {
231
- try {
232
- const url = new URL(link);
233
- federatedInviteDialogRef.current?.open({
234
- link: url.origin
235
- });
236
- } catch {
237
- Toast.error(t('federated.failedToGetFederatedLoginLink'));
238
- }
230
+ const customUrl = blocklet.environments.find(x => x.key === BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL);
231
+ if (customUrl?.value) {
232
+ federatedInviteDialogRef.current?.open({
233
+ link: customUrl.value
234
+ });
235
+ } else {
236
+ Toast.error(t('federated.failedToGetFederatedLoginLink'));
239
237
  }
240
238
  }, [blocklet.site?.domainAliases?.[0]?.href]);
241
239
  const [checked, setChecked] = useState(federatedConfig.autoLogin || false);
package/es/locales/en.js CHANGED
@@ -391,6 +391,8 @@ module.exports = {
391
391
  logoRect: 'Horizontal logo URL or path for the blocklet (optional)',
392
392
  logoFavicon: 'favicon URL or path for the blocklet (optional, default to square logo)',
393
393
  clusterSize: 'Instance count when run this blocklet in cluster mode',
394
+ copyrightOwner: 'Copyright Owner (Display in footer)',
395
+ copyrightYear: 'Copyright Year (Display in footer)',
394
396
  deletable: {
395
397
  name: 'Delete Protection',
396
398
  enable: 'This blocklet can NOT currently be deleted',
package/es/locales/zh.js CHANGED
@@ -395,6 +395,8 @@ module.exports = {
395
395
  logoRect: '横版 Logo 地址或路径 (可选)',
396
396
  logoFavicon: 'favicon 地址或路径 (可选,默认和正方形 Logo 相同)',
397
397
  clusterSize: '以 Cluster 模式启动时的实例数量',
398
+ copyrightOwner: '版权所有者 (展示在页脚中)',
399
+ copyrightYear: '版权年份 (展示在页脚中)',
398
400
  deletable: {
399
401
  name: '删除保护',
400
402
  enable: '此应用当前不可被删除',
@@ -59,15 +59,21 @@ function AuditLog(_ref2) {
59
59
  if (!log.actor.did) {
60
60
  return null;
61
61
  }
62
+
63
+ // HACK: blocklet 类型会在存储前被强制置为 `''`,所以需要增加空字符串判断
64
+ const isUser = !['blocklet', ''].includes(log.actor.role);
62
65
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
63
66
  className: "log-entry",
64
67
  "data-cy": "log-entry",
65
68
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
66
69
  className: "log-author",
67
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.default, {
70
+ children: isUser ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.default, {
68
71
  did: log.actor.did,
69
72
  size: 36,
70
73
  shape: "circle"
74
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.default, {
75
+ did: log.actor.did,
76
+ size: 36
71
77
  })
72
78
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
73
79
  className: "log-body",
@@ -86,7 +92,7 @@ function AuditLog(_ref2) {
86
92
  },
87
93
  children: scopeFormatter(log.scope)
88
94
  })
89
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactRouterDom.Link, {
95
+ }), isUser ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactRouterDom.Link, {
90
96
  to: getUserLink({
91
97
  log,
92
98
  inService,
@@ -94,6 +100,8 @@ function AuditLog(_ref2) {
94
100
  }),
95
101
  target: "_blank",
96
102
  children: [log.actor.fullName, log.actor.role ? "(".concat(log.actor.role, ")") : '']
103
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
104
+ children: [log.actor.fullName, log.actor.role ? "(".concat(log.actor.role, ")") : '']
97
105
  }), ' ', /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
98
106
  style: {
99
107
  margin: '0 4px'
@@ -218,7 +226,7 @@ function WrappedAuditLogs(_ref3) {
218
226
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(AuditLogs, {})
219
227
  });
220
228
  }
221
- const Div = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .log-controls {\n display: flex;\n justify-content: space-between;\n }\n .log-entry {\n display: flex;\n margin: 16px 0;\n\n .log-author {\n margin-right: 8px;\n }\n\n .log-body {\n flex: 1;\n\n a {\n color: ", ";\n }\n\n .log-header {\n }\n\n .log-content {\n p {\n margin-bottom: 4px;\n }\n ul,\n ol {\n padding-left: 2rem;\n }\n li {\n list-style-type: disc;\n }\n }\n\n .log-meta {\n margin-top: 4px;\n\n span {\n font-size: 0.8rem;\n display: inline-block;\n margin-right: 8px;\n padding-right: 8px;\n border-right: 1px solid #ccc;\n\n &:last-of-type {\n border-right: none;\n }\n }\n }\n }\n }\n"])), _ref4 => {
229
+ const Div = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .log-controls {\n display: flex;\n justify-content: space-between;\n }\n .log-entry {\n display: flex;\n margin: 16px 0;\n\n .log-author {\n margin-right: 8px;\n }\n\n .log-body {\n flex: 1;\n\n a {\n color: ", ";\n }\n\n .log-header {\n }\n\n .log-content {\n p {\n margin-bottom: 4px;\n }\n ul,\n ol {\n padding-left: 2rem;\n }\n li {\n list-style-type: disc;\n }\n code.code-highlight {\n max-height: 300px;\n overflow: auto;\n }\n }\n\n .log-meta {\n margin-top: 4px;\n\n span {\n font-size: 0.8rem;\n display: inline-block;\n margin-right: 8px;\n padding-right: 8px;\n border-right: 1px solid #ccc;\n\n &:last-of-type {\n border-right: none;\n }\n }\n }\n }\n }\n"])), _ref4 => {
222
230
  let {
223
231
  theme
224
232
  } = _ref4;
@@ -13,6 +13,7 @@ var _Box = _interopRequireDefault(require("@mui/material/Box"));
13
13
  var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
14
14
  var _Skeleton = _interopRequireDefault(require("@mui/material/Skeleton"));
15
15
  var _styled = _interopRequireDefault(require("@emotion/styled"));
16
+ var _constant = require("@blocklet/constant");
16
17
  var _blocklet = require("../../../contexts/blocklet");
17
18
  var _useAppLogo = _interopRequireDefault(require("../../../hooks/use-app-logo"));
18
19
  var _jsxRuntime = require("react/jsx-runtime");
@@ -20,6 +21,7 @@ var _templateObject;
20
21
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
22
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
22
23
  function NavigationPreview(_ref) {
24
+ var _blocklet$environment, _blocklet$environment2, _blocklet$environment3, _blocklet$environment4;
23
25
  let {
24
26
  className,
25
27
  navigation
@@ -32,13 +34,20 @@ function NavigationPreview(_ref) {
32
34
  } = (0, _useAppLogo.default)({
33
35
  blocklet
34
36
  });
37
+ const owner = blocklet === null || blocklet === void 0 ? void 0 : (_blocklet$environment = blocklet.environments) === null || _blocklet$environment === void 0 ? void 0 : (_blocklet$environment2 = _blocklet$environment.find(x => x.key === _constant.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER)) === null || _blocklet$environment2 === void 0 ? void 0 : _blocklet$environment2.value;
38
+ const year = blocklet === null || blocklet === void 0 ? void 0 : (_blocklet$environment3 = blocklet.environments) === null || _blocklet$environment3 === void 0 ? void 0 : (_blocklet$environment4 = _blocklet$environment3.find(x => x.key === _constant.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR)) === null || _blocklet$environment4 === void 0 ? void 0 : _blocklet$environment4.value;
39
+ const copyright = owner || year ? {
40
+ owner,
41
+ year
42
+ } : undefined;
35
43
  const blockletInfo = {
36
44
  appId: blocklet.appDid,
37
45
  appLogo: logoUrl,
38
46
  appName: blocklet.meta.title,
39
47
  enableConnect: true,
40
48
  enableLocale: false,
41
- navigation
49
+ navigation,
50
+ copyright
42
51
  };
43
52
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_linkBlocker.default, {
44
53
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
@@ -87,14 +87,16 @@ function BlockletEnvironment(_ref) {
87
87
  }
88
88
 
89
89
  // configurable blocklet environment
90
- const customDelete = blocklet.environments.find(x => x.key === 'BLOCKLET_DELETABLE');
90
+ const customDelete = blocklet.environments.find(x => x.key === _constant2.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE);
91
91
  const deletable = !customDelete || customDelete.value === 'yes';
92
- const customLanguages = blocklet.environments.find(x => x.key === 'BLOCKLET_APP_LANGUAGES');
93
- const customUrl = blocklet.environments.find(x => x.key === 'BLOCKLET_APP_URL');
94
- const customLogoSquare = blocklet.environments.find(x => x.key === 'BLOCKLET_APP_LOGO_SQUARE');
95
- const customLogoRect = blocklet.environments.find(x => x.key === 'BLOCKLET_APP_LOGO_RECT');
96
- const customLogoFavicon = blocklet.environments.find(x => x.key === 'BLOCKLET_APP_LOGO_FAVICON');
97
- const customLogoDeprecated = blocklet.environments.find(x => x.key === 'BLOCKLET_APP_LOGO');
92
+ const customLanguages = blocklet.environments.find(x => x.key === _constant2.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LANGUAGES);
93
+ const customUrl = blocklet.environments.find(x => x.key === _constant2.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL);
94
+ const customLogoSquare = blocklet.environments.find(x => x.key === _constant2.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE);
95
+ const customLogoRect = blocklet.environments.find(x => x.key === _constant2.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT);
96
+ const customLogoFavicon = blocklet.environments.find(x => x.key === _constant2.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON);
97
+ const customLogoDeprecated = blocklet.environments.find(x => x.key === _constant2.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO);
98
+ const copyrightOwner = blocklet.environments.find(x => x.key === _constant2.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER);
99
+ const copyrightYear = blocklet.environments.find(x => x.key === _constant2.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR);
98
100
  const configurableEnvs = [{
99
101
  key: _constant2.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_NAME,
100
102
  description: t('blocklet.config.name'),
@@ -123,6 +125,14 @@ function BlockletEnvironment(_ref) {
123
125
  key: _constant2.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO,
124
126
  description: t('blocklet.config.logo'),
125
127
  value: customLogoDeprecated ? customLogoDeprecated.value : ''
128
+ }, {
129
+ key: _constant2.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER,
130
+ description: t('blocklet.config.copyrightOwner'),
131
+ value: copyrightOwner ? copyrightOwner.value : ''
132
+ }, {
133
+ key: _constant2.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR,
134
+ description: t('blocklet.config.copyrightYear'),
135
+ value: copyrightYear ? copyrightYear.value : ''
126
136
  }];
127
137
  if (clusterMode) {
128
138
  const exist = blocklet.configs.find(x => x.key === _constant2.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE);
@@ -16,6 +16,8 @@ var _material = require("@mui/material");
16
16
  var _didConnect = require("@arcblock/did-connect");
17
17
  var _Dialog = _interopRequireDefault(require("@arcblock/ux/lib/Dialog"));
18
18
  var _Stars = _interopRequireDefault(require("@mui/icons-material/Stars"));
19
+ var _isUrl = _interopRequireDefault(require("is-url"));
20
+ var _urlJoin = _interopRequireDefault(require("url-join"));
19
21
  var _blocklet = require("../../contexts/blocklet");
20
22
  var _node = require("../../contexts/node");
21
23
  var _jsxRuntime = require("react/jsx-runtime");
@@ -68,6 +70,9 @@ const FederatedDetailDialog = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =
68
70
  approve
69
71
  }), [open, close, approve]);
70
72
  const infoList = (0, _ahooks.useCreation)(() => {
73
+ if (!state.show) {
74
+ return [];
75
+ }
71
76
  state.data.migratedFrom = [state.data.appId, state.data.appPid];
72
77
  const keys = ['appName', 'appLogo', 'appId', 'appPid', 'migratedFrom', 'appDescription', 'appUrl', 'version', 'appliedAt', 'status', 'serverId', 'serverVersion'];
73
78
  if (state.data.isMaster !== false) {
@@ -99,12 +104,27 @@ const FederatedDetailDialog = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =
99
104
  });
100
105
  }
101
106
  if (['appLogo'].includes(key)) {
102
- value = /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
103
- src: "".concat(state.data.appUrl, "/").concat(value),
104
- width: "60",
105
- height: "60",
106
- alt: state.data.appName
107
- });
107
+ const logoUrl = (0, _isUrl.default)(value) ? value : (0, _urlJoin.default)(state.data.appUrl || '', value || '');
108
+ try {
109
+ const logoUrlInstance = new URL(logoUrl);
110
+ logoUrlInstance.searchParams.set('imageFilter', 'resize');
111
+ // HACK: 保持跟其他地方使用的尺寸一致,可以复用同一资源的缓存,减少网络请求
112
+ logoUrlInstance.searchParams.set('w', '80');
113
+ logoUrlInstance.searchParams.set('h', '80');
114
+ value = /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
115
+ src: logoUrlInstance.href,
116
+ width: "60",
117
+ height: "60",
118
+ alt: state.data.appName
119
+ });
120
+ } catch (_unused) {
121
+ value = /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
122
+ src: logoUrl,
123
+ width: "60",
124
+ height: "60",
125
+ alt: state.data.appName
126
+ });
127
+ }
108
128
  }
109
129
  if (key === 'status') {
110
130
  value = value && t("federated.status.".concat(value));
@@ -16,6 +16,7 @@ var _react = require("react");
16
16
  var _ahooks = require("ahooks");
17
17
  var _Button = _interopRequireDefault(require("@arcblock/ux/lib/Button"));
18
18
  var _Toast = _interopRequireDefault(require("@arcblock/ux/lib/Toast"));
19
+ var _constant = require("@blocklet/constant");
19
20
  var _blocklet = require("../../contexts/blocklet");
20
21
  var _node = require("../../contexts/node");
21
22
  var _confirm = _interopRequireDefault(require("../../hooks/confirm"));
@@ -27,7 +28,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
27
28
  /* eslint-disable react/no-unstable-nested-components */
28
29
 
29
30
  function FederatedSiteList(_ref) {
30
- var _blocklet$settings$fe, _blocklet$settings$fe2, _blocklet$site2, _blocklet$site2$domai, _blocklet$site2$domai2;
31
+ var _blocklet$settings$fe, _blocklet$settings$fe2, _blocklet$site, _blocklet$site$domain, _blocklet$site$domain2;
31
32
  let {
32
33
  mode
33
34
  } = _ref;
@@ -237,20 +238,16 @@ function FederatedSiteList(_ref) {
237
238
  };
238
239
  }, []);
239
240
  const showInvite = (0, _ahooks.useMemoizedFn)(() => {
240
- var _blocklet$site, _blocklet$site$domain, _blocklet$site$domain2;
241
- const link = (_blocklet$site = blocklet.site) === null || _blocklet$site === void 0 ? void 0 : (_blocklet$site$domain = _blocklet$site.domainAliases) === null || _blocklet$site$domain === void 0 ? void 0 : (_blocklet$site$domain2 = _blocklet$site$domain[0]) === null || _blocklet$site$domain2 === void 0 ? void 0 : _blocklet$site$domain2.href;
242
- if (link) {
243
- try {
244
- var _federatedInviteDialo;
245
- const url = new URL(link);
246
- (_federatedInviteDialo = federatedInviteDialogRef.current) === null || _federatedInviteDialo === void 0 ? void 0 : _federatedInviteDialo.open({
247
- link: url.origin
248
- });
249
- } catch (_unused) {
250
- _Toast.default.error(t('federated.failedToGetFederatedLoginLink'));
251
- }
241
+ const customUrl = blocklet.environments.find(x => x.key === _constant.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL);
242
+ if (customUrl !== null && customUrl !== void 0 && customUrl.value) {
243
+ var _federatedInviteDialo;
244
+ (_federatedInviteDialo = federatedInviteDialogRef.current) === null || _federatedInviteDialo === void 0 ? void 0 : _federatedInviteDialo.open({
245
+ link: customUrl.value
246
+ });
247
+ } else {
248
+ _Toast.default.error(t('federated.failedToGetFederatedLoginLink'));
252
249
  }
253
- }, [(_blocklet$site2 = blocklet.site) === null || _blocklet$site2 === void 0 ? void 0 : (_blocklet$site2$domai = _blocklet$site2.domainAliases) === null || _blocklet$site2$domai === void 0 ? void 0 : (_blocklet$site2$domai2 = _blocklet$site2$domai[0]) === null || _blocklet$site2$domai2 === void 0 ? void 0 : _blocklet$site2$domai2.href]);
250
+ }, [(_blocklet$site = blocklet.site) === null || _blocklet$site === void 0 ? void 0 : (_blocklet$site$domain = _blocklet$site.domainAliases) === null || _blocklet$site$domain === void 0 ? void 0 : (_blocklet$site$domain2 = _blocklet$site$domain[0]) === null || _blocklet$site$domain2 === void 0 ? void 0 : _blocklet$site$domain2.href]);
254
251
  const [checked, setChecked] = (0, _react.useState)(federatedConfig.autoLogin || false);
255
252
  const changeAutoLogin = (0, _ahooks.useMemoizedFn)(() => {
256
253
  confirmApi.open({
package/lib/locales/en.js CHANGED
@@ -393,6 +393,8 @@ module.exports = {
393
393
  logoRect: 'Horizontal logo URL or path for the blocklet (optional)',
394
394
  logoFavicon: 'favicon URL or path for the blocklet (optional, default to square logo)',
395
395
  clusterSize: 'Instance count when run this blocklet in cluster mode',
396
+ copyrightOwner: 'Copyright Owner (Display in footer)',
397
+ copyrightYear: 'Copyright Year (Display in footer)',
396
398
  deletable: {
397
399
  name: 'Delete Protection',
398
400
  enable: 'This blocklet can NOT currently be deleted',
package/lib/locales/zh.js CHANGED
@@ -397,6 +397,8 @@ module.exports = {
397
397
  logoRect: '横版 Logo 地址或路径 (可选)',
398
398
  logoFavicon: 'favicon 地址或路径 (可选,默认和正方形 Logo 相同)',
399
399
  clusterSize: '以 Cluster 模式启动时的实例数量',
400
+ copyrightOwner: '版权所有者 (展示在页脚中)',
401
+ copyrightYear: '版权年份 (展示在页脚中)',
400
402
  deletable: {
401
403
  name: '删除保护',
402
404
  enable: '此应用当前不可被删除',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abtnode/ux",
3
- "version": "1.16.16-beta-2e5e3db7",
3
+ "version": "1.16.16-beta-ca17cc31",
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.16-beta-2e5e3db7",
31
- "@abtnode/constant": "1.16.16-beta-2e5e3db7",
32
- "@abtnode/util": "1.16.16-beta-2e5e3db7",
30
+ "@abtnode/auth": "1.16.16-beta-ca17cc31",
31
+ "@abtnode/constant": "1.16.16-beta-ca17cc31",
32
+ "@abtnode/util": "1.16.16-beta-ca17cc31",
33
33
  "@ahooksjs/use-url-state": "^3.5.1",
34
34
  "@arcblock/did": "^1.18.90",
35
- "@arcblock/did-connect": "^2.7.21",
35
+ "@arcblock/did-connect": "^2.7.22",
36
36
  "@arcblock/did-motif": "^1.1.13",
37
- "@arcblock/icons": "^2.7.21",
38
- "@arcblock/nft-display": "2.7.21",
39
- "@arcblock/react-hooks": "^2.7.21",
40
- "@arcblock/terminal": "^2.7.21",
41
- "@arcblock/ux": "^2.7.21",
42
- "@blocklet/constant": "1.16.16-beta-2e5e3db7",
43
- "@blocklet/launcher-layout": "2.2.15",
44
- "@blocklet/list": "^0.12.41",
45
- "@blocklet/meta": "1.16.16-beta-2e5e3db7",
46
- "@blocklet/ui-react": "^2.7.21",
37
+ "@arcblock/icons": "^2.7.22",
38
+ "@arcblock/nft-display": "2.7.22",
39
+ "@arcblock/react-hooks": "^2.7.22",
40
+ "@arcblock/terminal": "^2.7.22",
41
+ "@arcblock/ux": "^2.7.22",
42
+ "@blocklet/constant": "1.16.16-beta-ca17cc31",
43
+ "@blocklet/launcher-layout": "2.2.16",
44
+ "@blocklet/list": "^0.12.42",
45
+ "@blocklet/meta": "1.16.16-beta-ca17cc31",
46
+ "@blocklet/ui-react": "^2.7.22",
47
47
  "@emotion/react": "^11.10.4",
48
48
  "@emotion/styled": "^11.10.4",
49
49
  "@iconify/react": "^4.0.0",
@@ -98,7 +98,7 @@
98
98
  "babel-plugin-inline-react-svg": "^1.1.2",
99
99
  "glob": "^10.3.3"
100
100
  },
101
- "gitHead": "e0e3da338d7d35b994dd49015f4fae8ddf2410e0",
101
+ "gitHead": "34c6aea80b4ed2eb8d1bbd65dc4b5480d30fc011",
102
102
  "exports": {
103
103
  ".": {
104
104
  "import": "./es/index.js",