@abtnode/ux 1.17.2 → 1.17.3-beta-20251117-130331-b2ce7065
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/blocklet/component/add-component/add-component-core.js +7 -1
- package/lib/blocklet/component/index.js +2 -0
- package/lib/blocklet/component/optional-component-cell.js +23 -12
- package/lib/hooks/use-components-by-blocklet-meta-url.js +1 -1
- package/lib/util/index.js +1 -1
- package/package.json +30 -30
|
@@ -94,6 +94,12 @@ const postInstalledMessage = ({
|
|
|
94
94
|
}, '*');
|
|
95
95
|
}, timeout);
|
|
96
96
|
};
|
|
97
|
+
const getRegistryUrlByBundleSource = bundleSource => {
|
|
98
|
+
if (bundleSource?.store) {
|
|
99
|
+
return bundleSource.store;
|
|
100
|
+
}
|
|
101
|
+
return bundleSource?.url || '';
|
|
102
|
+
};
|
|
97
103
|
export default function AddComponentCore({
|
|
98
104
|
onClose = () => {},
|
|
99
105
|
mode = 'normal',
|
|
@@ -707,7 +713,7 @@ export default function AddComponentCore({
|
|
|
707
713
|
chooseParams: {
|
|
708
714
|
blocklets: [selectedMeta || installMeta],
|
|
709
715
|
meta: selectedMeta || installMeta,
|
|
710
|
-
registryUrl: registryUrl || storeUrl || selectedMeta
|
|
716
|
+
registryUrl: registryUrl || storeUrl || getRegistryUrlByBundleSource(selectedMeta?.bundleSource),
|
|
711
717
|
inStore,
|
|
712
718
|
inputUrl
|
|
713
719
|
},
|
|
@@ -356,6 +356,8 @@ export default function BlockletComponent({
|
|
|
356
356
|
})]
|
|
357
357
|
}, `top-blocklet-${blocklet.meta.did}`), blocklet.optionalComponents?.map(component => /*#__PURE__*/_jsx(StyledComponentRow, {
|
|
358
358
|
children: /*#__PURE__*/_jsx(OptionalComponentCell, {
|
|
359
|
+
blocklet: component,
|
|
360
|
+
ancestors: [blocklet],
|
|
359
361
|
setInstallComponentMeta: setInstallComponentMeta,
|
|
360
362
|
...component
|
|
361
363
|
})
|
|
@@ -4,21 +4,25 @@ import { Box, Button } from '@mui/material';
|
|
|
4
4
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
5
5
|
import Tooltip from '@mui/material/Tooltip';
|
|
6
6
|
import { Icon } from '@iconify/react';
|
|
7
|
-
import { useNodeContext } from '../../contexts/node';
|
|
8
7
|
import Line from './line';
|
|
9
8
|
import { StyledComponentRow } from './component-cell';
|
|
9
|
+
import BlockletBundleAvatar from '../bundle-avatar';
|
|
10
|
+
import { useNodeContext } from '../../contexts/node';
|
|
10
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
12
|
export default function OptionalComponentCell({
|
|
13
|
+
blocklet,
|
|
14
|
+
ancestors = [],
|
|
12
15
|
meta,
|
|
13
16
|
dependencies = [],
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
setInstallComponentMeta,
|
|
18
|
+
logoUrl = ''
|
|
16
19
|
}) {
|
|
17
20
|
const node = useNodeContext();
|
|
18
21
|
const {
|
|
19
22
|
t
|
|
20
23
|
} = useLocaleContext();
|
|
21
24
|
const handleOpen = () => {
|
|
25
|
+
meta.bundleSource = blocklet.bundleSource || {};
|
|
22
26
|
setInstallComponentMeta(meta);
|
|
23
27
|
};
|
|
24
28
|
const size = 40;
|
|
@@ -28,15 +32,20 @@ export default function OptionalComponentCell({
|
|
|
28
32
|
className: "cell",
|
|
29
33
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
30
34
|
className: "component-left",
|
|
31
|
-
children: [/*#__PURE__*/_jsx("
|
|
35
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
32
36
|
className: "component-logo",
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
children: logoUrl ? /*#__PURE__*/_jsx("img", {
|
|
38
|
+
src: logoUrl,
|
|
39
|
+
onError: () => `${node.imgPrefix}/blocklet.png`,
|
|
40
|
+
alt: meta.title,
|
|
41
|
+
style: {
|
|
42
|
+
width: size,
|
|
43
|
+
height: size
|
|
44
|
+
}
|
|
45
|
+
}) : /*#__PURE__*/_jsx(BlockletBundleAvatar, {
|
|
46
|
+
blocklet: blocklet,
|
|
47
|
+
ancestors: ancestors
|
|
48
|
+
})
|
|
40
49
|
}), /*#__PURE__*/_jsxs("div", {
|
|
41
50
|
className: "component-header",
|
|
42
51
|
children: [/*#__PURE__*/_jsx("div", {
|
|
@@ -89,8 +98,10 @@ export default function OptionalComponentCell({
|
|
|
89
98
|
}
|
|
90
99
|
OptionalComponentCell.propTypes = {
|
|
91
100
|
meta: PropTypes.object.isRequired,
|
|
92
|
-
|
|
101
|
+
blocklet: PropTypes.object.isRequired,
|
|
102
|
+
ancestors: PropTypes.array,
|
|
93
103
|
setInstallComponentMeta: PropTypes.func.isRequired,
|
|
104
|
+
logoUrl: PropTypes.string,
|
|
94
105
|
dependencies: PropTypes.arrayOf(PropTypes.shape({
|
|
95
106
|
parentDid: PropTypes.string,
|
|
96
107
|
parentName: PropTypes.string,
|
|
@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react';
|
|
|
2
2
|
import { useSearchParams } from 'react-router-dom';
|
|
3
3
|
import { useNodeContext } from '../contexts/node';
|
|
4
4
|
function parseBlockletMetaUrl(meta) {
|
|
5
|
-
return meta &&
|
|
5
|
+
return meta && meta.registryUrl && meta.did ? `${meta.registryUrl}/api/blocklets/${meta?.did}/blocklet.json` : '';
|
|
6
6
|
}
|
|
7
7
|
function useComponentsByBlockletMetaUrl(meta) {
|
|
8
8
|
const {
|
package/lib/util/index.js
CHANGED
|
@@ -527,7 +527,7 @@ export async function getAsset(chainHost, address) {
|
|
|
527
527
|
* })} - 返回判断是否是新的url和解码后的url
|
|
528
528
|
*/
|
|
529
529
|
export const isNewStoreUrl = (url, storeList) => {
|
|
530
|
-
if (typeof url === 'string') {
|
|
530
|
+
if (url && typeof url === 'string') {
|
|
531
531
|
let decoded = decodeURIComponent(url?.trim());
|
|
532
532
|
const regex = /^https?:\/\//;
|
|
533
533
|
if (!regex.test(decoded)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/ux",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.3-beta-20251117-130331-b2ce7065",
|
|
4
4
|
"description": "UX components shared across abtnode packages",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -23,33 +23,33 @@
|
|
|
23
23
|
"author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
|
|
24
24
|
"license": "Apache-2.0",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@abtnode/auth": "1.17.
|
|
27
|
-
"@abtnode/constant": "1.17.
|
|
28
|
-
"@abtnode/docker-utils": "1.17.
|
|
29
|
-
"@abtnode/util": "1.17.
|
|
26
|
+
"@abtnode/auth": "1.17.3-beta-20251117-130331-b2ce7065",
|
|
27
|
+
"@abtnode/constant": "1.17.3-beta-20251117-130331-b2ce7065",
|
|
28
|
+
"@abtnode/docker-utils": "1.17.3-beta-20251117-130331-b2ce7065",
|
|
29
|
+
"@abtnode/util": "1.17.3-beta-20251117-130331-b2ce7065",
|
|
30
30
|
"@ahooksjs/use-url-state": "^3.5.1",
|
|
31
|
-
"@arcblock/did": "^1.27.
|
|
32
|
-
"@arcblock/did-connect-react": "^3.2.
|
|
33
|
-
"@arcblock/did-ext": "^1.27.
|
|
31
|
+
"@arcblock/did": "^1.27.7",
|
|
32
|
+
"@arcblock/did-connect-react": "^3.2.6",
|
|
33
|
+
"@arcblock/did-ext": "^1.27.7",
|
|
34
34
|
"@arcblock/did-motif": "^1.1.14",
|
|
35
|
-
"@arcblock/icons": "^3.2.
|
|
36
|
-
"@arcblock/nft-display": "^3.2.
|
|
37
|
-
"@arcblock/react-hooks": "^3.2.
|
|
38
|
-
"@arcblock/terminal": "^3.2.
|
|
39
|
-
"@arcblock/ux": "^3.2.
|
|
40
|
-
"@arcblock/validator": "^1.27.
|
|
41
|
-
"@blocklet/aigne-hub": "^0.6.
|
|
42
|
-
"@blocklet/constant": "1.17.
|
|
43
|
-
"@blocklet/did-domain-react": "^0.6.
|
|
44
|
-
"@blocklet/did-space-react": "^1.2.
|
|
45
|
-
"@blocklet/error": "^0.3.
|
|
46
|
-
"@blocklet/js-sdk": "1.17.
|
|
47
|
-
"@blocklet/launcher-layout": "^3.2.
|
|
48
|
-
"@blocklet/list": "^0.18.
|
|
49
|
-
"@blocklet/meta": "1.17.
|
|
50
|
-
"@blocklet/theme": "^3.2.
|
|
51
|
-
"@blocklet/ui-react": "^3.2.
|
|
52
|
-
"@blocklet/uploader": "^0.3.
|
|
35
|
+
"@arcblock/icons": "^3.2.6",
|
|
36
|
+
"@arcblock/nft-display": "^3.2.6",
|
|
37
|
+
"@arcblock/react-hooks": "^3.2.6",
|
|
38
|
+
"@arcblock/terminal": "^3.2.6",
|
|
39
|
+
"@arcblock/ux": "^3.2.6",
|
|
40
|
+
"@arcblock/validator": "^1.27.7",
|
|
41
|
+
"@blocklet/aigne-hub": "^0.6.7",
|
|
42
|
+
"@blocklet/constant": "1.17.3-beta-20251117-130331-b2ce7065",
|
|
43
|
+
"@blocklet/did-domain-react": "^0.6.7",
|
|
44
|
+
"@blocklet/did-space-react": "^1.2.4",
|
|
45
|
+
"@blocklet/error": "^0.3.3",
|
|
46
|
+
"@blocklet/js-sdk": "1.17.3-beta-20251117-130331-b2ce7065",
|
|
47
|
+
"@blocklet/launcher-layout": "^3.2.6",
|
|
48
|
+
"@blocklet/list": "^0.18.5",
|
|
49
|
+
"@blocklet/meta": "1.17.3-beta-20251117-130331-b2ce7065",
|
|
50
|
+
"@blocklet/theme": "^3.2.6",
|
|
51
|
+
"@blocklet/ui-react": "^3.2.6",
|
|
52
|
+
"@blocklet/uploader": "^0.3.11",
|
|
53
53
|
"@emotion/react": "^11.14.0",
|
|
54
54
|
"@emotion/styled": "^11.14.1",
|
|
55
55
|
"@iconify-icons/material-symbols": "^1.2.58",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"@mui/material": "^7.2.0",
|
|
62
62
|
"@mui/x-date-pickers": "^8.9.0",
|
|
63
63
|
"@mui/x-tree-view": "^8.9.0",
|
|
64
|
-
"@ocap/client": "^1.27.
|
|
65
|
-
"@ocap/mcrypto": "^1.27.
|
|
66
|
-
"@ocap/util": "^1.27.
|
|
64
|
+
"@ocap/client": "^1.27.7",
|
|
65
|
+
"@ocap/mcrypto": "^1.27.7",
|
|
66
|
+
"@ocap/util": "^1.27.7",
|
|
67
67
|
"@uiw/react-markdown-preview": "^5.1.1",
|
|
68
68
|
"ahooks": "^3.7.8",
|
|
69
69
|
"axios": "^1.7.9",
|
|
@@ -127,5 +127,5 @@
|
|
|
127
127
|
"babel-plugin-inline-react-svg": "^2.0.2",
|
|
128
128
|
"glob": "^10.4.1"
|
|
129
129
|
},
|
|
130
|
-
"gitHead": "
|
|
130
|
+
"gitHead": "4d719e72f7845c5f607d854300a0576dddfaaeff"
|
|
131
131
|
}
|