@abtnode/ux 1.16.13-beta-55b3e93d → 1.16.13-beta-423a40b1

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/lib/locales/zh.js CHANGED
@@ -237,6 +237,8 @@ module.exports = {
237
237
  redirectPermanently: '永久重定向',
238
238
  redirectTemporary: '临时重定向',
239
239
  redirectUrl: '重定向 URL',
240
+ rewriteUrl: '重写到 URL',
241
+ rewrite: '重写',
240
242
  reject: '拒绝',
241
243
  reload: '优雅重启',
242
244
  remark: '备注',
@@ -270,6 +272,7 @@ module.exports = {
270
272
  backup: '备份',
271
273
  store: '商店',
272
274
  succeeded: '成功',
275
+ subscription: '订阅',
273
276
  support: '服务支持',
274
277
  team: '团队',
275
278
  the: '此',
@@ -441,7 +444,12 @@ module.exports = {
441
444
  appSkChangeTip: '你正在修改应用私钥',
442
445
  walletTypeTitle: '修改钱包类型',
443
446
  appSkTitle: '修改应用私钥',
444
- sharedToAllComponents: '将共享给所有组件'
447
+ sharedToAllComponents: '将共享给所有组件',
448
+ session: {
449
+ ttl: '登录会话有效期(如果用户 {day} 天内在此站点没有任何活动,将被要求重新登录)',
450
+ day: '{day} 天',
451
+ days: '{day} 天'
452
+ }
445
453
  },
446
454
  overview: {
447
455
  source: '来源',
@@ -515,7 +523,6 @@ module.exports = {
515
523
  purchase: '需要支付',
516
524
  tip: {
517
525
  stopBlocklet: '请先停止运行应用',
518
- notDynamic: '只有动态添加的组件才能被删除',
519
526
  requiredBy: '{name} 需要该组件'
520
527
  },
521
528
  choose: '选择',
@@ -804,7 +811,8 @@ module.exports = {
804
811
  domainRequired: '节点域名不能为空',
805
812
  invalidUrl: '请填写正确的 URL',
806
813
  pathPrefixRequired: 'URL 前缀是必填的',
807
- redirectUrlRequired: '重定向 URL 是必填的'
814
+ redirectUrlRequired: '重定向 URL 是必填的',
815
+ rewriteUrlRequired: '重写到 URL 是必填的'
808
816
  },
809
817
  domain: {
810
818
  validate: {
@@ -820,7 +828,10 @@ module.exports = {
820
828
  redirect: '重定向到哪里?',
821
829
  port: '负责处理请求的服务监听在哪个端口?',
822
830
  portTip: '保持默认值就好,如果你想把请求转发到非默认端口,可以根据需要修改',
823
- type: '服务类型'
831
+ type: '服务类型',
832
+ component: '选择组件',
833
+ pageGroup: '路由分组',
834
+ pageGroupTip: '该组件具备渲染这里列出的任何一组页面,留空表示渲染所有页面'
824
835
  },
825
836
  update: {
826
837
  title: '更新站点域名',
@@ -1427,6 +1438,7 @@ module.exports = {
1427
1438
  }
1428
1439
  },
1429
1440
  oauth: {
1441
+ commonSettings: '通用设置',
1430
1442
  save: '保存',
1431
1443
  saveSuccess: '保存成功',
1432
1444
  saveFailed: '保存失败',
@@ -1441,6 +1453,14 @@ module.exports = {
1441
1453
  clientId: 'ClientID',
1442
1454
  clientIdDescribe: '请输入 Auth0 的 ClientID'
1443
1455
  },
1444
- comingSoon: '更多登录方式正在建设中'
1456
+ comingSoon: '更多登录方式正在建设中',
1457
+ moreLogin: '更多登录方式'
1458
+ },
1459
+ expiration: {
1460
+ tips: {
1461
+ success: '订阅将在{validity}后到期',
1462
+ warning: '订阅将在{validity}后到期',
1463
+ error: '订阅已过期'
1464
+ }
1445
1465
  }
1446
1466
  };
package/lib/util/index.js CHANGED
@@ -34,7 +34,7 @@ exports.getBlockletUrls = getBlockletUrls;
34
34
  exports.getExplorerLink = getExplorerLink;
35
35
  exports.getPathPrefix = exports.getIssuePassportLink = exports.getInviteLink = void 0;
36
36
  exports.getRelativeTime = getRelativeTime;
37
- exports.getTransferAppLink = exports.getStoreList = exports.getRenewBlockletURL = void 0;
37
+ exports.getTransferAppLink = exports.getSubscriptionURL = exports.getStoreList = exports.getRenewBlockletURL = void 0;
38
38
  exports.getWebWalletUrl = getWebWalletUrl;
39
39
  exports.isNewStoreUrl = exports.isInstalling = exports.isDownloading = exports.isChrome = exports.isCertificateMatch = exports.isBlockletDev = void 0;
40
40
  exports.isProtectedRole = isProtectedRole;
@@ -191,6 +191,9 @@ function getExplorerLink(chainHost, did, type) {
191
191
  try {
192
192
  const chainUrl = new URL(chainHost);
193
193
  switch (type) {
194
+ case 'asset':
195
+ chainUrl.pathname = "/explorer/assets/".concat(did);
196
+ break;
194
197
  case 'account':
195
198
  chainUrl.pathname = "/explorer/accounts/".concat(did);
196
199
  break;
@@ -608,8 +611,7 @@ async function getAsset(chainHost, address) {
608
611
  }
609
612
  return state;
610
613
  }
611
- async function getAssetExpiration(chainHost, address) {
612
- const asset = await getAsset(chainHost, address);
614
+ function getAssetExpiration(asset) {
613
615
  return (0, _last.default)((0, _get.default)(asset, 'data.value.expirationDate', []));
614
616
  }
615
617
  function getRelativeTime(datetime) {
@@ -714,12 +716,20 @@ exports.sortDomains = sortDomains;
714
716
  const formatMountPoint = value => (0, _normalizePathPrefix.default)((0, _urlPathFriendly.default)(value));
715
717
  exports.formatMountPoint = formatMountPoint;
716
718
  const getRenewBlockletURL = _ref7 => {
717
- var _nftState$data, _nftState$data$value;
718
719
  let {
719
- nftState,
720
- nftId,
720
+ launcherUrl = '',
721
+ nftId = '',
721
722
  locale = 'en'
722
723
  } = _ref7;
723
- return (0, _urlJoin.default)(nftState === null || nftState === void 0 ? void 0 : (_nftState$data = nftState.data) === null || _nftState$data === void 0 ? void 0 : (_nftState$data$value = _nftState$data.value) === null || _nftState$data$value === void 0 ? void 0 : _nftState$data$value.launcherUrl, "/instances/".concat(nftId, "/renewal?locale=").concat(locale, "&return-url=").concat(encodeURIComponent(window.location.href)));
724
+ return (0, _urlJoin.default)(launcherUrl, "/instances/".concat(nftId, "/renewal?locale=").concat(locale, "&return-url=").concat(encodeURIComponent(window.location.href)));
725
+ };
726
+ exports.getRenewBlockletURL = getRenewBlockletURL;
727
+ const getSubscriptionURL = _ref8 => {
728
+ let {
729
+ launcherUrl = '',
730
+ nftId = '',
731
+ locale = 'en'
732
+ } = _ref8;
733
+ return (0, _urlJoin.default)(launcherUrl, "/instances/".concat(nftId, "/subscription?locale=").concat(locale, "&return-url=").concat(encodeURIComponent(window.location.href)));
724
734
  };
725
- exports.getRenewBlockletURL = getRenewBlockletURL;
735
+ exports.getSubscriptionURL = getSubscriptionURL;
@@ -9,6 +9,7 @@ exports.getDIDSpaceUrlFromEndpoint = getDIDSpaceUrlFromEndpoint;
9
9
  exports.getSpaceBackupEndpoint = getSpaceBackupEndpoint;
10
10
  exports.getSpaceGatewayFromEndpoint = getSpaceGatewayFromEndpoint;
11
11
  exports.getSpaceNameByEndpoint = getSpaceNameByEndpoint;
12
+ exports.getSpaceNftDisplayUrlFromEndpoint = getSpaceNftDisplayUrlFromEndpoint;
12
13
  exports.hasPermissionByEndpoint = hasPermissionByEndpoint;
13
14
  exports.isValidSpaceGatewayUrl = isValidSpaceGatewayUrl;
14
15
  var _isUrl = _interopRequireDefault(require("is-url"));
@@ -149,4 +150,16 @@ async function getSpaceNameByEndpoint(endpoint) {
149
150
  console.error(error);
150
151
  return '';
151
152
  }
153
+ }
154
+ /**
155
+ * @description
156
+ * @export
157
+ * @param {string} endpoint
158
+ * @return {string}
159
+ */
160
+ function getSpaceNftDisplayUrlFromEndpoint(endpoint) {
161
+ const prefix = endpoint.replace(/\/api\/space\/.+/, '');
162
+ const strArray = endpoint.replace(/\/$/, '').split('/');
163
+ const spaceDid = strArray.at(-4);
164
+ return joinUrl(prefix, "/api/space/nft/display?spaceDid=".concat(spaceDid));
152
165
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abtnode/ux",
3
- "version": "1.16.13-beta-55b3e93d",
3
+ "version": "1.16.13-beta-423a40b1",
4
4
  "description": "UX components shared across abtnode packages",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -23,22 +23,22 @@
23
23
  "author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
- "@abtnode/auth": "1.16.13-beta-55b3e93d",
27
- "@abtnode/constant": "1.16.13-beta-55b3e93d",
28
- "@abtnode/util": "1.16.13-beta-55b3e93d",
26
+ "@abtnode/auth": "1.16.13-beta-423a40b1",
27
+ "@abtnode/constant": "1.16.13-beta-423a40b1",
28
+ "@abtnode/util": "1.16.13-beta-423a40b1",
29
29
  "@ahooksjs/use-url-state": "^3.5.1",
30
30
  "@arcblock/did": "^1.18.84",
31
- "@arcblock/did-connect": "^2.5.50",
32
- "@arcblock/did-motif": "^1.1.10",
33
- "@arcblock/icons": "^2.5.50",
34
- "@arcblock/react-hooks": "^2.5.50",
35
- "@arcblock/terminal": "^2.5.50",
36
- "@arcblock/ux": "^2.5.50",
37
- "@blocklet/constant": "1.16.13-beta-55b3e93d",
38
- "@blocklet/launcher-layout": "2.1.18",
39
- "@blocklet/list": "^0.12.1",
40
- "@blocklet/meta": "1.16.13-beta-55b3e93d",
41
- "@blocklet/ui-react": "^2.5.50",
31
+ "@arcblock/did-connect": "^2.5.52",
32
+ "@arcblock/did-motif": "^1.1.11",
33
+ "@arcblock/icons": "^2.5.52",
34
+ "@arcblock/react-hooks": "^2.5.52",
35
+ "@arcblock/terminal": "^2.5.52",
36
+ "@arcblock/ux": "^2.5.52",
37
+ "@blocklet/constant": "1.16.13-beta-423a40b1",
38
+ "@blocklet/launcher-layout": "2.1.21",
39
+ "@blocklet/list": "^0.12.3",
40
+ "@blocklet/meta": "1.16.13-beta-423a40b1",
41
+ "@blocklet/ui-react": "^2.5.52",
42
42
  "@emotion/react": "^11.10.4",
43
43
  "@emotion/styled": "^11.10.4",
44
44
  "@iconify/react": "^4.0.0",
@@ -77,6 +77,7 @@
77
77
  "react-error-boundary": "^3.1.4",
78
78
  "react-hook-form": "^7.39.3",
79
79
  "react-iframe": "^1.8.5",
80
+ "react-placeholder": "^4.1.0",
80
81
  "react-router-dom": "^6.4.2",
81
82
  "react-sortable-tree": "^2.8.0",
82
83
  "react-sortable-tree-theme-material-ui": "^1.0.16",
@@ -93,5 +94,5 @@
93
94
  "@babel/preset-react": "^7.18.6",
94
95
  "babel-plugin-inline-react-svg": "^1.1.2"
95
96
  },
96
- "gitHead": "1c734de99ff70fad99e9cc3fb55834e0bb6f5bfd"
97
+ "gitHead": "1aee04f45042bd4784ca72f9f8b93918980be4d4"
97
98
  }
@@ -1,54 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _propTypes = _interopRequireDefault(require("prop-types"));
8
- var _RelativeTime = _interopRequireDefault(require("@arcblock/ux/lib/RelativeTime"));
9
- var _context = require("@arcblock/ux/lib/Locale/context");
10
- var _Button = _interopRequireDefault(require("@mui/material/Button"));
11
- var _Link = _interopRequireDefault(require("@mui/material/Link"));
12
- var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
13
- var _blocklet = require("../../contexts/blocklet");
14
- var _util = require("../../util");
15
- var _jsxRuntime = require("react/jsx-runtime");
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
- function Expiration(_ref) {
18
- let {
19
- controller
20
- } = _ref;
21
- const {
22
- t,
23
- locale
24
- } = (0, _context.useLocaleContext)();
25
- const {
26
- nftState
27
- } = (0, _blocklet.useBlockletContext)();
28
- if (!nftState) {
29
- return '-';
30
- }
31
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Typography.default, {
32
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_RelativeTime.default, {
33
- value: nftState === null || nftState === void 0 ? void 0 : nftState.expirationDate,
34
- locale: locale
35
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
36
- style: {
37
- marginLeft: '5px'
38
- },
39
- variant: "contained",
40
- component: _Link.default,
41
- href: (0, _util.getRenewBlockletURL)({
42
- nftState,
43
- nftId: controller.nftId,
44
- locale
45
- }),
46
- children: t('common.renew')
47
- })]
48
- });
49
- }
50
- Expiration.propTypes = {
51
- controller: _propTypes.default.object.isRequired
52
- };
53
- var _default = Expiration;
54
- exports.default = _default;