@abtnode/ux 1.16.17-beta-a8cf4b25 → 1.16.17-beta-8903a652

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/locales/en.js CHANGED
@@ -231,6 +231,7 @@ module.exports = {
231
231
  port: 'Port',
232
232
  pre: 'Previous',
233
233
  preferences: 'Preferences',
234
+ preview: 'Preview',
234
235
  protected: 'Protected',
235
236
  protocol: 'Protocol',
236
237
  publish: 'Publish',
@@ -1430,9 +1431,14 @@ module.exports = {
1430
1431
  hide: 'Hide navigation',
1431
1432
  show: 'Show navigation',
1432
1433
  del: 'Delete navigation',
1434
+ new: 'New',
1433
1435
  noAddSub: "Uninstalled component can't add sub navigation",
1434
1436
  noEdit: "Uninstalled component can't edit",
1435
- noDel: 'Not allowed delete built-in navigation'
1437
+ noDel: 'Not allowed delete built-in navigation',
1438
+ reset: 'Reset',
1439
+ restConfirmTitle: 'Do you want to clear all custom navigation?',
1440
+ restConfirmDesc: "After clearing, the navigation will be restored to Blocklet's original default configuration.",
1441
+ resetSuccessful: 'Reset successful'
1436
1442
  }
1437
1443
  },
1438
1444
  storage: {
package/es/locales/zh.js CHANGED
@@ -236,6 +236,7 @@ module.exports = {
236
236
  port: '端口',
237
237
  pre: '上一步',
238
238
  preferences: '偏好',
239
+ preview: '预览',
239
240
  protected: '受保护',
240
241
  protocol: '协议',
241
242
  publish: '发布',
@@ -1407,8 +1408,8 @@ module.exports = {
1407
1408
  }
1408
1409
  },
1409
1410
  navigation: {
1410
- navigation: '导航',
1411
1411
  actionFailed: '操作失败',
1412
+ navigation: '导航',
1412
1413
  form: {
1413
1414
  title: '标题',
1414
1415
  titlePlaceholder: '请输入导航标题',
@@ -1435,9 +1436,14 @@ module.exports = {
1435
1436
  hide: '隐藏导航',
1436
1437
  show: '显示导航',
1437
1438
  del: '删除导航',
1439
+ new: '新建',
1438
1440
  noAddSub: '未安装组件无法添加子导航',
1439
1441
  noEdit: '未安装组件的导航无法编辑',
1440
- noDel: '内置的导航无法删除'
1442
+ noDel: '内置的导航无法删除',
1443
+ reset: '重置',
1444
+ restConfirmTitle: '是否清空所有自定义导航?',
1445
+ restConfirmDesc: '清空后,导航会恢复到 Blocklet 原有默认的配置.',
1446
+ resetSuccessful: '重置成功'
1441
1447
  }
1442
1448
  },
1443
1449
  storage: {
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import styled from '@emotion/styled';
4
4
  import AddIcon from '@mui/icons-material/Add';
5
5
  import Box from '@mui/material/Box';
6
+ import Toast from '@arcblock/ux/lib/Toast';
6
7
  import { LocaleContext } from '@arcblock/ux/lib/Locale/context';
7
8
  import Button from '@arcblock/ux/lib/Button';
8
9
  import SplitButton from '@arcblock/ux/lib/SplitButton';
@@ -10,7 +11,7 @@ import Spinner from '@mui/material/CircularProgress';
10
11
  import EditIcon from '@arcblock/icons/lib/EditIcon';
11
12
  import LockIcon from '@arcblock/icons/lib/LockIcon';
12
13
  import ExternalIssuerIcon from '@arcblock/icons/lib/ExternalIssuerIcon';
13
- import Toast from '@arcblock/ux/lib/Toast';
14
+ import useMediaQuery from '@mui/material/useMediaQuery';
14
15
  import { useNodeContext } from '../../contexts/node';
15
16
  import { useTeamContext } from '../../contexts/team';
16
17
  import { sleep, isProtectedRole, BlockletAdminRoles } from '../../util';
@@ -52,6 +53,7 @@ export default function PassportList({
52
53
  const [showTrustedFactories, setShowTrustedFactories] = useState(false);
53
54
  const [search, setSearch] = useState('');
54
55
  const [loading, setLoading] = useState(false);
56
+ const isMobile = useMediaQuery(x => x.breakpoints.down('md'));
55
57
  const toggleShowIssue = async e => {
56
58
  e.stopPropagation();
57
59
  if (loading) {
@@ -176,6 +178,10 @@ export default function PassportList({
176
178
  className: "list",
177
179
  children: filteredRoles.map(role => /*#__PURE__*/_jsxs(Box, {
178
180
  "data-cy": `passport-${role.name}`,
181
+ sx: {
182
+ display: 'flex',
183
+ justifyContent: 'space-between'
184
+ },
179
185
  className: "item",
180
186
  display: "flex",
181
187
  alignItems: "center",
@@ -205,7 +211,7 @@ export default function PassportList({
205
211
  className: "title",
206
212
  children: role.title
207
213
  })]
208
- }), /*#__PURE__*/_jsx(Box, {
214
+ }), !isMobile && /*#__PURE__*/_jsx(Box, {
209
215
  className: "description",
210
216
  children: role.description
211
217
  }), /*#__PURE__*/_jsx(Permission, {
@@ -21,6 +21,7 @@ var _Popover = _interopRequireDefault(require("@mui/material/Popover"));
21
21
  var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
22
22
  var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
23
23
  var _useTheme = _interopRequireDefault(require("@mui/material/styles/useTheme"));
24
+ var _useMediaQuery = _interopRequireDefault(require("@mui/material/useMediaQuery"));
24
25
  var _base = require("@abtnode/util/lib/base32");
25
26
  var _urlEvaluation = require("@abtnode/util/lib/url-evaluation");
26
27
  var _LockIcon = _interopRequireDefault(require("@arcblock/icons/lib/LockIcon"));
@@ -28,9 +29,9 @@ var _Empty = _interopRequireDefault(require("@arcblock/ux/lib/Empty"));
28
29
  var _context = require("@arcblock/ux/lib/Locale/context");
29
30
  var _util = require("@blocklet/meta/lib/util");
30
31
  var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
31
- var _didAddress = _interopRequireDefault(require("../../did-address"));
32
32
  var _blocklet = require("../../contexts/blocklet");
33
33
  var _node = require("../../contexts/node");
34
+ var _didAddress = _interopRequireDefault(require("../../did-address"));
34
35
  var _permission = require("../../permission");
35
36
  var _util2 = require("../../util");
36
37
  var _addCert = _interopRequireDefault(require("../add-cert"));
@@ -41,10 +42,13 @@ var _types = require("../types");
41
42
  var _util3 = require("../util");
42
43
  var _jsxRuntime = require("react/jsx-runtime");
43
44
  var _templateObject;
45
+ const _excluded = ["domain", "children"];
44
46
  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); }
45
47
  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; }
46
48
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
47
49
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
50
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
51
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
48
52
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
49
53
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
50
54
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -81,9 +85,8 @@ function DomainList(_ref) {
81
85
  const {
82
86
  t
83
87
  } = (0, _context.useLocaleContext)();
84
- const [domainInfoAnchorEl, setDomainInfoAnchorEl] = (0, _react.useState)(null);
85
88
  const [showAllDomains, setShowAllDomains] = (0, _react.useState)(false);
86
- const theme = (0, _useTheme.default)();
89
+ const isMobile = (0, _useMediaQuery.default)(x => x.breakpoints.down('md'));
87
90
  const hasMutatePermission = (0, _react.useMemo)(() => {
88
91
  let res = hasPermission;
89
92
  if ((0, _util3.isServerless)(blocklet)) {
@@ -91,12 +94,6 @@ function DomainList(_ref) {
91
94
  }
92
95
  return res;
93
96
  }, [hasPermission, inService, blocklet]);
94
- const handlePopoverOpen = event => {
95
- setDomainInfoAnchorEl(event.currentTarget);
96
- };
97
- const handlePopoverClose = () => {
98
- setDomainInfoAnchorEl(null);
99
- };
100
97
  const {
101
98
  site
102
99
  } = blocklet;
@@ -161,157 +158,100 @@ function DomainList(_ref) {
161
158
  severity: "warning",
162
159
  children: t('blocklet.router.noRunning')
163
160
  })
164
- }), (showAllDomains ? domains : displayDomains).map((domain, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
165
- display: "flex",
166
- alignItems: "center",
167
- justifyContent: "space-between",
168
- mt: index ? 0 : 1,
169
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
170
- display: "flex",
171
- alignItems: "center",
172
- justifyContent: "flex-start",
173
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_domainStatus.default, {
174
- domain: domain,
175
- filters: ['domain']
176
- }, "".concat(domain.value, "-domain")), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
177
- sx: {
178
- ml: 2,
179
- mr: 0.5
180
- },
181
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(DomainLink, {
182
- domain: domain,
183
- target: "_blank",
184
- children: domain.value
185
- })
186
- }), domain.type === 'nft-domain' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
187
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Diamond.default, {
188
- onMouseEnter: handlePopoverOpen,
189
- onMouseLeave: handlePopoverClose,
190
- style: {
191
- cursor: 'pointer',
192
- fill: theme.palette.primary.main
193
- }
194
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Popover.default, {
195
- id: "mouse-over-popover",
196
- style: {
197
- pointerEvents: 'none'
198
- },
199
- open: Boolean(domainInfoAnchorEl),
200
- anchorEl: domainInfoAnchorEl,
201
- anchorOrigin: {
202
- vertical: 'bottom',
203
- horizontal: 'left'
204
- },
205
- transformOrigin: {
206
- vertical: 'top',
207
- horizontal: 'left'
208
- },
209
- onClose: handlePopoverClose,
210
- disableRestoreFocus: true,
211
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Card.default, {
212
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CardContent.default, {
213
- style: {
214
- display: 'flex',
215
- flexDirection: 'column'
216
- },
217
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Typography.default, {
218
- component: "div",
219
- style: {
220
- display: 'flex',
221
- alignItems: 'center'
222
- },
223
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Diamond.default, {
224
- style: {
225
- fill: theme.palette.primary.main
226
- }
227
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
228
- component: "span",
229
- style: {
230
- marginLeft: '8px',
231
- fontSize: '18px',
232
- fontWeight: 'bolder'
233
- },
234
- children: t('router.domainAlias.nftDomain')
235
- })]
236
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Typography.default, {
237
- component: "div",
238
- style: {
239
- display: 'flex',
240
- marginTop: '12px'
241
- },
242
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
243
- component: "span",
244
- style: {
245
- width: '80px',
246
- marginRight: '8px'
247
- },
248
- children: t('common.domain')
249
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
250
- component: "span",
251
- children: domain.value
252
- })]
253
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Typography.default, {
254
- component: "div",
255
- style: {
256
- display: 'flex'
257
- },
258
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
259
- component: "span",
260
- style: {
261
- width: '80px',
262
- marginRight: '8px'
263
- },
264
- children: "NFT"
265
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_didAddress.default, {
266
- did: domain.nftDid
267
- })]
268
- })]
161
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
162
+ sx: {
163
+ display: 'flex',
164
+ flexDirection: 'column',
165
+ gap: 1
166
+ },
167
+ children: (showAllDomains ? domains : displayDomains).map(domain => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
168
+ children: [isMobile && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
169
+ display: "flex",
170
+ flexDirection: "column",
171
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
172
+ display: "flex",
173
+ alignItems: "center",
174
+ justifyContent: "flex-start",
175
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(DomainLink, {
176
+ domain: domain,
177
+ target: "_blank",
178
+ children: domain.value
179
+ })
180
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
181
+ display: "flex",
182
+ alignItems: "center",
183
+ justifyContent: "space-between",
184
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
185
+ sx: {
186
+ display: 'flex',
187
+ alignItems: 'center',
188
+ justifyContent: 'flex-start',
189
+ gap: 1
190
+ },
191
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_domainStatus.default, {
192
+ domain: domain,
193
+ filters: ['domain']
194
+ }, "".concat(domain.value, "-domain")), /*#__PURE__*/(0, _jsxRuntime.jsx)(InnerAddDomain, {
195
+ domain: domain,
196
+ blocklet: blocklet,
197
+ hasMutatePermission: hasMutatePermission
198
+ })]
199
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
200
+ sx: {
201
+ button: {
202
+ padding: 0
203
+ }
204
+ },
205
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(InnerAction, {
206
+ hasMutatePermission: hasMutatePermission,
207
+ site: site,
208
+ domain: domain,
209
+ blocklet: blocklet
210
+ })
211
+ })]
212
+ })]
213
+ }, domain.value), !isMobile && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
214
+ display: "flex",
215
+ alignItems: "center",
216
+ justifyContent: "space-between",
217
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
218
+ display: "flex",
219
+ alignItems: "center",
220
+ justifyContent: "flex-start",
221
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_domainStatus.default, {
222
+ domain: domain,
223
+ filters: ['domain']
224
+ }, "".concat(domain.value, "-domain")), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
225
+ sx: {
226
+ ml: 2,
227
+ mr: 0.5
228
+ },
229
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(DomainLink, {
230
+ domain: domain,
231
+ target: "_blank",
232
+ children: domain.value
269
233
  })
234
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(InnerAddDomain, {
235
+ domain: domain,
236
+ blocklet: blocklet,
237
+ hasMutatePermission: hasMutatePermission
238
+ })]
239
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
240
+ sx: {
241
+ button: {
242
+ padding: 0
243
+ }
244
+ },
245
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(InnerAction, {
246
+ hasMutatePermission: hasMutatePermission,
247
+ site: site,
248
+ domain: domain,
249
+ blocklet: blocklet
270
250
  })
271
251
  })]
272
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_domainStatus.default, {
273
- domain: domain,
274
- filters: ['http']
275
- }, "".concat(domain.value, "-http")), hasMutatePermission && /*#__PURE__*/(0, _jsxRuntime.jsx)(_addCert.default, {
276
- domain: domain.value,
277
- domainStatus: domain.domainStatus,
278
- did: blocklet.meta.did,
279
- children: _ref3 => {
280
- let {
281
- open
282
- } = _ref3;
283
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
284
- size: "small",
285
- onClick: e => open(e),
286
- children: t('router.cert.genLetsEncryptCert.title')
287
- });
288
- }
289
- })]
290
- }), hasMutatePermission && !domain.isProtected ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_domainActions.default, {
291
- site: site,
292
- domain: domain,
293
- blocklet: blocklet
294
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
295
- title: t('blocklet.router.domainLockTooltip'),
296
- placement: "top",
297
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
298
- disabled: true,
299
- size: "large",
300
- style: {
301
- pointerEvents: 'auto',
302
- // padding replace to margin, fix the tooltip position
303
- paddingTop: 0,
304
- paddingBottom: 0,
305
- margin: '12px 0'
306
- },
307
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_LockIcon.default, {
308
- style: {
309
- fill: theme.palette.text.disabled
310
- }
311
- })
312
- })
313
- })]
314
- }, domain.value)), hiddenDomains.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
252
+ }, domain.value)]
253
+ }))
254
+ }), hiddenDomains.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
315
255
  style: {
316
256
  marginLeft: '20px',
317
257
  marginTop: '12px'
@@ -338,11 +278,12 @@ DomainList.defaultProps = {
338
278
  hasPermission: false,
339
279
  loadingRuntimeInfo: false
340
280
  };
341
- function DomainLink(_ref4) {
281
+ function DomainLink(_ref3) {
342
282
  let {
343
- domain,
344
- children
345
- } = _ref4;
283
+ domain,
284
+ children
285
+ } = _ref3,
286
+ rest = _objectWithoutProperties(_ref3, _excluded);
346
287
  const {
347
288
  t
348
289
  } = (0, _context.useLocaleContext)();
@@ -351,7 +292,7 @@ function DomainLink(_ref4) {
351
292
  accessibility
352
293
  } = domain;
353
294
  if (!accessibility || accessibility.loading) {
354
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(LinkDiv, {
295
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(LinkDiv, _objectSpread(_objectSpread({}, rest), {}, {
355
296
  children: [children, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
356
297
  title: t('blocklet.router.checkUrlAccessible'),
357
298
  placement: "top-end",
@@ -362,10 +303,10 @@ function DomainLink(_ref4) {
362
303
  })
363
304
  })
364
305
  })]
365
- });
306
+ }));
366
307
  }
367
308
  if (!accessibility.accessible) {
368
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(LinkDiv, {
309
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(LinkDiv, _objectSpread(_objectSpread({}, rest), {}, {
369
310
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
370
311
  title: t('blocklet.router.urlInaccessible'),
371
312
  placement: "top-end",
@@ -373,19 +314,201 @@ function DomainLink(_ref4) {
373
314
  children: children
374
315
  })
375
316
  })
376
- });
317
+ }));
377
318
  }
378
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(LinkDiv, {
319
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(LinkDiv, _objectSpread(_objectSpread({}, rest), {}, {
379
320
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
380
321
  href: href,
381
322
  target: "_blank",
382
323
  rel: "noopener noreferrer",
383
324
  children: children
384
325
  })
385
- });
326
+ }));
386
327
  }
387
328
  DomainLink.propTypes = {
388
329
  domain: _types.DomainType.isRequired,
389
330
  children: _propTypes.default.any.isRequired
390
331
  };
391
- const LinkDiv = _styled.default.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &,\n & > * {\n color: #222;\n font-size: 18px;\n }\n\n .status {\n margin-left: 8px;\n }\n"])));
332
+ const LinkDiv = _styled.default.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &,\n & > * {\n color: #222;\n font-size: 18px;\n word-break: break-all;\n }\n\n .status {\n margin-left: 8px;\n }\n"])));
333
+ function InnerAction(_ref4) {
334
+ let {
335
+ hasMutatePermission,
336
+ site,
337
+ domain,
338
+ blocklet
339
+ } = _ref4;
340
+ const theme = (0, _useTheme.default)();
341
+ const {
342
+ t
343
+ } = (0, _context.useLocaleContext)();
344
+ if (hasMutatePermission && !domain.isProtected) {
345
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_domainActions.default, {
346
+ site: site,
347
+ domain: domain,
348
+ blocklet: blocklet
349
+ });
350
+ }
351
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
352
+ title: t('blocklet.router.domainLockTooltip'),
353
+ placement: "top",
354
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
355
+ disabled: true,
356
+ size: "large",
357
+ style: {
358
+ pointerEvents: 'auto',
359
+ // padding replace to margin, fix the tooltip position
360
+ paddingTop: 0,
361
+ paddingBottom: 0
362
+ },
363
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_LockIcon.default, {
364
+ style: {
365
+ fill: theme.palette.text.disabled
366
+ }
367
+ })
368
+ })
369
+ });
370
+ }
371
+ InnerAction.propTypes = {
372
+ hasMutatePermission: _propTypes.default.bool.isRequired,
373
+ site: _propTypes.default.object.isRequired,
374
+ domain: _types.DomainType.isRequired,
375
+ blocklet: _propTypes.default.object.isRequired
376
+ };
377
+ function InnerAddDomain(_ref5) {
378
+ let {
379
+ domain,
380
+ blocklet,
381
+ hasMutatePermission
382
+ } = _ref5;
383
+ const theme = (0, _useTheme.default)();
384
+ const {
385
+ t
386
+ } = (0, _context.useLocaleContext)();
387
+ const [domainInfoAnchorEl, setDomainInfoAnchorEl] = (0, _react.useState)(null);
388
+ const handlePopoverOpen = event => {
389
+ setDomainInfoAnchorEl(event.currentTarget);
390
+ };
391
+ const handlePopoverClose = () => {
392
+ setDomainInfoAnchorEl(null);
393
+ };
394
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
395
+ sx: {
396
+ display: 'flex',
397
+ justifyContent: 'flex-start',
398
+ alignItems: 'center',
399
+ gap: 1
400
+ },
401
+ children: [domain.type === 'nft-domain' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
402
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Diamond.default, {
403
+ onMouseEnter: handlePopoverOpen,
404
+ onMouseLeave: handlePopoverClose,
405
+ style: {
406
+ cursor: 'pointer',
407
+ fill: theme.palette.primary.main
408
+ }
409
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Popover.default, {
410
+ id: "mouse-over-popover",
411
+ style: {
412
+ pointerEvents: 'none'
413
+ },
414
+ open: Boolean(domainInfoAnchorEl),
415
+ anchorEl: domainInfoAnchorEl,
416
+ anchorOrigin: {
417
+ vertical: 'bottom',
418
+ horizontal: 'left'
419
+ },
420
+ transformOrigin: {
421
+ vertical: 'top',
422
+ horizontal: 'left'
423
+ },
424
+ onClose: handlePopoverClose,
425
+ disableRestoreFocus: true,
426
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Card.default, {
427
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CardContent.default, {
428
+ style: {
429
+ display: 'flex',
430
+ flexDirection: 'column'
431
+ },
432
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Typography.default, {
433
+ component: "div",
434
+ style: {
435
+ display: 'flex',
436
+ alignItems: 'center'
437
+ },
438
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Diamond.default, {
439
+ style: {
440
+ fill: theme.palette.primary.main
441
+ }
442
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
443
+ component: "span",
444
+ style: {
445
+ marginLeft: '8px',
446
+ fontSize: '18px',
447
+ fontWeight: 'bolder'
448
+ },
449
+ children: t('router.domainAlias.nftDomain')
450
+ })]
451
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Typography.default, {
452
+ component: "div",
453
+ style: {
454
+ display: 'flex',
455
+ marginTop: '12px'
456
+ },
457
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
458
+ component: "span",
459
+ style: {
460
+ width: '80px',
461
+ marginRight: '8px'
462
+ },
463
+ children: t('common.domain')
464
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
465
+ component: "span",
466
+ children: domain.value
467
+ })]
468
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Typography.default, {
469
+ component: "div",
470
+ style: {
471
+ display: 'flex'
472
+ },
473
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
474
+ component: "span",
475
+ style: {
476
+ width: '80px',
477
+ marginRight: '8px'
478
+ },
479
+ children: "NFT"
480
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_didAddress.default, {
481
+ did: domain.nftDid
482
+ })]
483
+ })]
484
+ })
485
+ })
486
+ })]
487
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_domainStatus.default, {
488
+ domain: domain,
489
+ filters: ['http']
490
+ }, "".concat(domain.value, "-http")), hasMutatePermission && /*#__PURE__*/(0, _jsxRuntime.jsx)(_addCert.default, {
491
+ domain: domain.value,
492
+ domainStatus: domain.domainStatus,
493
+ did: blocklet.meta.did,
494
+ children: _ref6 => {
495
+ let {
496
+ open
497
+ } = _ref6;
498
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
499
+ sx: {
500
+ padding: 0
501
+ },
502
+ size: "small",
503
+ onClick: e => open(e),
504
+ children: t('router.cert.genLetsEncryptCert.title')
505
+ });
506
+ }
507
+ })]
508
+ });
509
+ }
510
+ InnerAddDomain.propTypes = {
511
+ domain: _types.DomainType.isRequired,
512
+ blocklet: _propTypes.default.object.isRequired,
513
+ hasMutatePermission: _propTypes.default.bool.isRequired
514
+ };
@@ -984,4 +984,4 @@ BlockletComponent.defaultProps = {
984
984
  onUpdate: () => {},
985
985
  getComponentUrl: () => window.location.origin
986
986
  };
987
- const Div = _styled.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .title {\n font-size: 1.2rem;\n font-weight: bold;\n margin-bottom: ", ";\n }\n\n @keyframes showDelay {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n }\n\n .component-item {\n animation: showDelay 0.75s ease 1;\n }\n"])), props => props.theme.spacing(1));
987
+ const Div = _styled.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .title {\n font-size: 1.2rem;\n font-weight: bold;\n }\n\n @keyframes showDelay {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n }\n\n .component-item {\n animation: showDelay 0.75s ease 1;\n }\n"])));