@abtnode/ux 1.16.29-beta-1fedbcdd → 1.16.29-beta-8671c2cf

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.
@@ -0,0 +1,35 @@
1
+ import { Box } from '@mui/material';
2
+ import DID from '@arcblock/ux/lib/DID';
3
+ import PropTypes from 'prop-types';
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
+ export default function BlockletOwnerInfo({
6
+ owner,
7
+ locale
8
+ }) {
9
+ return /*#__PURE__*/_jsxs(Box, {
10
+ sx: {
11
+ display: 'flex',
12
+ alignItems: 'center',
13
+ gap: 1
14
+ },
15
+ children: [owner.fullName, owner.did ? /*#__PURE__*/_jsx(DID, {
16
+ sx: {
17
+ lineHeight: 'initial',
18
+ '&::before': {
19
+ content: '"("'
20
+ },
21
+ '&::after': {
22
+ content: '")"'
23
+ }
24
+ },
25
+ did: owner.did,
26
+ compact: true,
27
+ size: 14,
28
+ locale: locale
29
+ }) : null]
30
+ });
31
+ }
32
+ BlockletOwnerInfo.propTypes = {
33
+ owner: PropTypes.object.isRequired,
34
+ locale: PropTypes.string.isRequired
35
+ };
@@ -6,13 +6,15 @@ import { Badge, Box } from '@mui/material';
6
6
  import InfoRow from '@arcblock/ux/lib/InfoRow';
7
7
  import Dialog from '@arcblock/ux/lib/Dialog';
8
8
  import { getDisplayName, hasStartEngine } from '@blocklet/meta/lib/util';
9
+ import { formatPerson } from '@blocklet/meta/lib/fix';
9
10
  import { useDeletingBlockletContext } from '../../contexts/deleting-blocklets';
10
11
  import Tag from '../../tag';
11
- import { formatPerson, formatToDatetime } from '../../util';
12
+ import { formatToDatetime } from '../../util';
12
13
  import DidAddress from '../../did-address';
13
14
  import BlockletSource from '../blocklet-source';
14
15
  import BlockletStatus from '../status';
15
16
  import BlockletVersion from '../version';
17
+ import BlockletOwnerInfo from './blocklet-owner-info';
16
18
  import { jsx as _jsx } from "react/jsx-runtime";
17
19
  const isResource = component => !component?.meta?.group;
18
20
  const getEngineRows = (engine, t) => {
@@ -171,7 +173,10 @@ export default function ComponentInfoDialog({
171
173
  })
172
174
  }, {
173
175
  name: t('common.author'),
174
- value: formatPerson(componentInfo.meta.author)
176
+ value: componentInfo.meta.owner ? /*#__PURE__*/_jsx(BlockletOwnerInfo, {
177
+ owner: componentInfo.meta.owner,
178
+ locale: locale
179
+ }) : formatPerson(componentInfo.meta.author)
175
180
  }, {
176
181
  name: t('common.engine'),
177
182
  value: getEngineRows(componentInfo.engine, t).map(({
@@ -1,5 +1,6 @@
1
1
  import { useState, useEffect } from 'react';
2
2
  import PropTypes from 'prop-types';
3
+ import { formatPerson } from '@blocklet/meta/lib/fix';
3
4
  import Dialog from '@arcblock/ux/lib/Dialog';
4
5
  import Spinner from '@mui/material/CircularProgress';
5
6
  import DialogContentText from '@mui/material/DialogContentText';
@@ -16,9 +17,10 @@ import Alert from '@mui/material/Alert';
16
17
  import { getDisplayName } from '@blocklet/meta/lib/util';
17
18
  import { useNodeContext } from '../contexts/node';
18
19
  import { useSessionContext } from '../contexts/session';
19
- import { formatError, formatPerson } from '../util';
20
+ import { formatError } from '../util';
20
21
  import { getWalletType } from './util';
21
22
  import DidAddress from '../did-address';
23
+ import BlockletOwnerInfo from './component/blocklet-owner-info';
22
24
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
23
25
  export default function InstallFromUrl({
24
26
  defaultUrl,
@@ -37,7 +39,8 @@ export default function InstallFromUrl({
37
39
  const [loading, setLoading] = useState(false);
38
40
  const [error, setError] = useState('');
39
41
  const {
40
- t
42
+ t,
43
+ locale
41
44
  } = useLocaleContext();
42
45
  const initMeta = {
43
46
  dist: {}
@@ -134,7 +137,10 @@ export default function InstallFromUrl({
134
137
  })
135
138
  }, {
136
139
  name: t('common.author'),
137
- value: formatPerson(meta.author)
140
+ value: meta.owner ? /*#__PURE__*/_jsx(BlockletOwnerInfo, {
141
+ owner: meta.owner,
142
+ locale: locale
143
+ }) : formatPerson(meta.author)
138
144
  }, {
139
145
  name: t('blocklet.dist.downloadLink'),
140
146
  value: meta.dist.tarball
@@ -1,5 +1,5 @@
1
1
  const parseResourceRelateComponents = (nowBlockletComponents, blocklet, resourceRelateComponents, disabledSelectComponents) => {
2
- const blockletComponents = [...nowBlockletComponents];
2
+ const blockletComponents = nowBlockletComponents ? [...nowBlockletComponents] : [];
3
3
  const componentMaps = (blocklet?.children || []).reduce((acc, curr) => {
4
4
  acc[curr.meta.did] = true;
5
5
  return acc;
package/lib/util/index.js CHANGED
@@ -226,20 +226,6 @@ export const checkInputByType = (type, value) => {
226
226
  return false;
227
227
  };
228
228
  export const formatUrl = url => humanizeUrl(url.split('?').shift());
229
- export const formatPerson = person => {
230
- if (!person) {
231
- return '-';
232
- }
233
- if (typeof person === 'string') {
234
- return person;
235
- }
236
- const name = person.name || '';
237
- const u = person.url || person.web;
238
- const url = u ? ` (${u})` : '';
239
- const e = person.email || person.mail;
240
- const email = e ? ` <${e}>` : '';
241
- return name + email + url;
242
- };
243
229
  export const shouldCheckDomainStatus = domain => domain &&
244
230
  // eslint-disable-line
245
231
  ![DOMAIN_FOR_IP_SITE, DOMAIN_FOR_IP_SITE_REGEXP, DOMAIN_FOR_DEFAULT_SITE, DOMAIN_FOR_INTERNAL_SITE].includes(domain);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abtnode/ux",
3
- "version": "1.16.29-beta-1fedbcdd",
3
+ "version": "1.16.29-beta-8671c2cf",
4
4
  "description": "UX components shared across abtnode packages",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -25,25 +25,25 @@
25
25
  "author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
26
26
  "license": "Apache-2.0",
27
27
  "dependencies": {
28
- "@abtnode/auth": "1.16.29-beta-1fedbcdd",
29
- "@abtnode/constant": "1.16.29-beta-1fedbcdd",
30
- "@abtnode/util": "1.16.29-beta-1fedbcdd",
28
+ "@abtnode/auth": "1.16.29-beta-8671c2cf",
29
+ "@abtnode/constant": "1.16.29-beta-8671c2cf",
30
+ "@abtnode/util": "1.16.29-beta-8671c2cf",
31
31
  "@ahooksjs/use-url-state": "^3.5.1",
32
32
  "@arcblock/did": "^1.18.126",
33
- "@arcblock/did-connect": "^2.10.7",
33
+ "@arcblock/did-connect": "^2.10.8",
34
34
  "@arcblock/did-motif": "^1.1.13",
35
- "@arcblock/icons": "^2.10.7",
36
- "@arcblock/nft-display": "2.10.7",
37
- "@arcblock/react-hooks": "^2.10.7",
38
- "@arcblock/terminal": "^2.10.7",
39
- "@arcblock/ux": "^2.10.7",
40
- "@blocklet/constant": "1.16.29-beta-1fedbcdd",
41
- "@blocklet/js-sdk": "1.16.29-beta-1fedbcdd",
35
+ "@arcblock/icons": "^2.10.8",
36
+ "@arcblock/nft-display": "2.10.8",
37
+ "@arcblock/react-hooks": "^2.10.8",
38
+ "@arcblock/terminal": "^2.10.8",
39
+ "@arcblock/ux": "^2.10.8",
40
+ "@blocklet/constant": "1.16.29-beta-8671c2cf",
41
+ "@blocklet/js-sdk": "1.16.29-beta-8671c2cf",
42
42
  "@blocklet/launcher-layout": "2.3.33",
43
43
  "@blocklet/list": "^0.13.9",
44
- "@blocklet/meta": "1.16.29-beta-1fedbcdd",
45
- "@blocklet/ui-react": "^2.10.7",
46
- "@blocklet/uploader": "0.1.19",
44
+ "@blocklet/meta": "1.16.29-beta-8671c2cf",
45
+ "@blocklet/ui-react": "^2.10.8",
46
+ "@blocklet/uploader": "0.1.20",
47
47
  "@emotion/react": "^11.10.4",
48
48
  "@emotion/styled": "^11.10.4",
49
49
  "@iconify-icons/logos": "^1.2.36",
@@ -108,5 +108,5 @@
108
108
  "jest": "^29.7.0",
109
109
  "jest-environment-jsdom": "^29.7.0"
110
110
  },
111
- "gitHead": "e66e220d775e821c85b8bd6286342c202ad143f0"
111
+ "gitHead": "67207cc32f2cdf4ab8af39d4083ad61fba9711e2"
112
112
  }