@abtnode/blocklet-services 1.16.10-beta-9dc61102 → 1.16.10-beta-cceee857

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.
@@ -2,8 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const jsx_runtime_1 = require("react/jsx-runtime");
4
4
  const components_1 = require("@react-email/components");
5
+ const chain_1 = require("../libs/chain");
5
6
  function Article({ data, }) {
6
- const host = new URL(data.url).host;
7
+ const host = (0, chain_1.getUrlHost)(data.url);
7
8
  return ((0, jsx_runtime_1.jsxs)("a", Object.assign({ href: data.url, target: "_blank", style: { textDecoration: 'none', color: 'initial', margin: '1em 0' } }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ style: { color: '#a5a5a5', fontSize: '0.8em' } }, { children: host })), (0, jsx_runtime_1.jsx)(components_1.Text, Object.assign({ style: { margin: 0, color: '#4598fa' } }, { children: data.title })), data.description && (0, jsx_runtime_1.jsx)(components_1.Text, Object.assign({ style: { margin: 0 } }, { children: data.description })), data.image && ((0, jsx_runtime_1.jsx)(components_1.Img, { src: data.image, style: { width: '100%', height: '150px', objectFit: 'contain', objectPosition: 'left' } }))] })));
8
9
  }
9
10
  exports.default = Article;
@@ -5,7 +5,7 @@ const components_1 = require("@react-email/components");
5
5
  const chain_1 = require("../libs/chain");
6
6
  function Asset({ locale, data, }) {
7
7
  const title = { zh: '接收', en: 'Received' }[locale] || 'Received';
8
- const chainHost = data.chainHost || (0, chain_1.getChainHost)(data.chainId);
8
+ const chainHost = (0, chain_1.getUrlHost)(data.chainHost) || (0, chain_1.getChainHost)(data.chainId);
9
9
  const url = `https://${chainHost}/explorer/assets/${data.did}`;
10
10
  return ((0, jsx_runtime_1.jsxs)("a", Object.assign({ href: url, target: "_blank", style: Object.assign(Object.assign({}, assetStyle), { margin: '1em 0', textDecoration: 'none', color: 'initial', display: 'block' }) }, { children: [(0, jsx_runtime_1.jsxs)(components_1.Row, Object.assign({ style: titleStyle }, { children: [(0, jsx_runtime_1.jsx)(components_1.Column, { children: title }), (0, jsx_runtime_1.jsx)(components_1.Column, Object.assign({ align: "right", style: summaryStyle }, { children: "+1 Asset" }))] })), (0, jsx_runtime_1.jsx)(components_1.Text, Object.assign({ style: remarkStyle }, { children: data.did }))] })));
11
11
  }
@@ -7,7 +7,7 @@ function Token({ locale, data, }) {
7
7
  const showAddress = data.address.slice(0, 4) + '...' + data.address.slice(-4);
8
8
  const from = { zh: '来自', en: 'from' }[locale] || 'from';
9
9
  const title = { zh: '接收', en: 'Received' }[locale] || 'Received';
10
- const chainHost = data.chainHost || (0, chain_1.getChainHost)(data.chainId);
10
+ const chainHost = (0, chain_1.getUrlHost)(data.chainHost) || (0, chain_1.getChainHost)(data.chainId);
11
11
  const url = `https://${chainHost}/explorer/tokens/${data.address}/tx`;
12
12
  return ((0, jsx_runtime_1.jsxs)("a", Object.assign({ href: url, target: "_blank", style: Object.assign(Object.assign({}, assetStyle), { margin: '1em 0', textDecoration: 'none', color: 'initial', display: 'block' }) }, { children: [(0, jsx_runtime_1.jsxs)(components_1.Row, Object.assign({ style: titleStyle }, { children: [(0, jsx_runtime_1.jsx)(components_1.Column, { children: title }), (0, jsx_runtime_1.jsxs)(components_1.Column, Object.assign({ align: "right", style: summaryStyle }, { children: ["+", data.amount, " ", data.symbol] }))] })), (0, jsx_runtime_1.jsxs)(components_1.Text, Object.assign({ style: remarkStyle }, { children: [from, " ", showAddress] }))] })));
13
13
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getChainHost = void 0;
3
+ exports.getUrlHost = exports.getChainHost = void 0;
4
4
  function getChainHost(chainId) {
5
5
  const defaultHost = 'explorer.arcblockio.cn';
6
6
  if (!chainId)
@@ -13,3 +13,12 @@ function getChainHost(chainId) {
13
13
  return chainHost;
14
14
  }
15
15
  exports.getChainHost = getChainHost;
16
+ function getUrlHost(url) {
17
+ try {
18
+ return new URL(url).host;
19
+ }
20
+ catch (_a) {
21
+ return url;
22
+ }
23
+ }
24
+ exports.getUrlHost = getUrlHost;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.10-beta-9dc61102",
6
+ "version": "1.16.10-beta-cceee857",
7
7
  "description": "Provide unified services for every blocklet",
8
8
  "main": "api/index.js",
9
9
  "files": [
@@ -33,17 +33,17 @@
33
33
  "author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
34
34
  "license": "Apache-2.0",
35
35
  "dependencies": {
36
- "@abtnode/auth": "1.16.10-beta-9dc61102",
37
- "@abtnode/client": "1.16.10-beta-9dc61102",
38
- "@abtnode/connect-storage": "1.16.10-beta-9dc61102",
39
- "@abtnode/constant": "1.16.10-beta-9dc61102",
40
- "@abtnode/core": "1.16.10-beta-9dc61102",
41
- "@abtnode/cron": "1.16.10-beta-9dc61102",
42
- "@abtnode/logger": "1.16.10-beta-9dc61102",
43
- "@abtnode/models": "1.16.10-beta-9dc61102",
44
- "@abtnode/router-adapter": "1.16.10-beta-9dc61102",
45
- "@abtnode/router-templates": "1.16.10-beta-9dc61102",
46
- "@abtnode/util": "1.16.10-beta-9dc61102",
36
+ "@abtnode/auth": "1.16.10-beta-cceee857",
37
+ "@abtnode/client": "1.16.10-beta-cceee857",
38
+ "@abtnode/connect-storage": "1.16.10-beta-cceee857",
39
+ "@abtnode/constant": "1.16.10-beta-cceee857",
40
+ "@abtnode/core": "1.16.10-beta-cceee857",
41
+ "@abtnode/cron": "1.16.10-beta-cceee857",
42
+ "@abtnode/logger": "1.16.10-beta-cceee857",
43
+ "@abtnode/models": "1.16.10-beta-cceee857",
44
+ "@abtnode/router-adapter": "1.16.10-beta-cceee857",
45
+ "@abtnode/router-templates": "1.16.10-beta-cceee857",
46
+ "@abtnode/util": "1.16.10-beta-cceee857",
47
47
  "@arcblock/did": "^1.18.80",
48
48
  "@arcblock/did-auth": "1.18.80",
49
49
  "@arcblock/did-ext": "^1.18.80",
@@ -51,11 +51,11 @@
51
51
  "@arcblock/jwt": "1.18.80",
52
52
  "@arcblock/validator": "^1.18.80",
53
53
  "@arcblock/ws": "1.18.80",
54
- "@blocklet/constant": "1.16.10-beta-9dc61102",
54
+ "@blocklet/constant": "1.16.10-beta-cceee857",
55
55
  "@blocklet/form-builder": "^0.1.11",
56
56
  "@blocklet/form-collector": "^0.1.6",
57
- "@blocklet/meta": "1.16.10-beta-9dc61102",
58
- "@blocklet/sdk": "1.16.10-beta-9dc61102",
57
+ "@blocklet/meta": "1.16.10-beta-cceee857",
58
+ "@blocklet/sdk": "1.16.10-beta-cceee857",
59
59
  "@did-connect/authenticator": "^2.1.59",
60
60
  "@did-connect/relay-adapter-express": "^2.1.59",
61
61
  "@did-connect/storage-nedb": "^2.1.59",
@@ -94,7 +94,7 @@
94
94
  "@nedb/core": "^2.1.2"
95
95
  },
96
96
  "devDependencies": {
97
- "@abtnode/ux": "1.16.10-beta-9dc61102",
97
+ "@abtnode/ux": "1.16.10-beta-cceee857",
98
98
  "@arcblock/did-connect": "^2.5.42",
99
99
  "@arcblock/icons": "^2.5.42",
100
100
  "@arcblock/ux": "^2.5.42",
@@ -162,5 +162,5 @@
162
162
  "url": "https://github.com/ArcBlock/blocklet-server/issues",
163
163
  "email": "shijun@arcblock.io"
164
164
  },
165
- "gitHead": "23942434de21a7638a81994f12655968f2a9a79c"
165
+ "gitHead": "821e24df918ee50a05c64e0da6757926d42a948d"
166
166
  }