@blocklet/list 0.9.14 → 0.9.17
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.
|
@@ -57,13 +57,13 @@ function Autocomplete() {
|
|
|
57
57
|
return data.dataList || [];
|
|
58
58
|
}, [storeApi]);
|
|
59
59
|
const getBlockletDetail = (0, _react.useCallback)(item => {
|
|
60
|
-
|
|
60
|
+
let blockletDetail = (0, _urlJoin.default)(endpoint, "/blocklets/".concat(item.did));
|
|
61
61
|
|
|
62
62
|
if (serverUrl) {
|
|
63
|
-
blockletDetail.
|
|
63
|
+
blockletDetail = "".concat(blockletDetail, "?server-url=").concat(encodeURIComponent(serverUrl));
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
return blockletDetail
|
|
66
|
+
return blockletDetail;
|
|
67
67
|
}, [endpoint, serverUrl]);
|
|
68
68
|
|
|
69
69
|
const onClickItem = detailUrl => {
|
|
@@ -142,6 +142,7 @@ function ShowAttributes(_ref2) {
|
|
|
142
142
|
} = _ref2;
|
|
143
143
|
// eslint-disable-next-line react/no-danger
|
|
144
144
|
if (item._formatted) return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
145
|
+
"data-cy": "bl-autocomplete-item",
|
|
145
146
|
dangerouslySetInnerHTML: {
|
|
146
147
|
__html: item._formatted[attribute]
|
|
147
148
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/list",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.17",
|
|
4
4
|
"description": "Common ux components of blocklet",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@algolia/autocomplete-js": "^1.7.1",
|
|
44
44
|
"@algolia/autocomplete-theme-classic": "^1.7.1",
|
|
45
|
-
"@arcblock/ux": "^2.4.
|
|
45
|
+
"@arcblock/ux": "^2.4.11",
|
|
46
46
|
"@emotion/react": "^11.10.0",
|
|
47
47
|
"@emotion/styled": "^11.10.0",
|
|
48
48
|
"@mui/icons-material": "^5.8.4",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"eslint": "^8.22.0",
|
|
69
69
|
"prettier": "^2.7.1"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "20b015344d2cf81759795a5442ea9f7ea351bc37"
|
|
72
72
|
}
|
|
@@ -29,11 +29,11 @@ export default function Autocomplete() {
|
|
|
29
29
|
|
|
30
30
|
const getBlockletDetail = useCallback(
|
|
31
31
|
(item) => {
|
|
32
|
-
|
|
32
|
+
let blockletDetail = joinUrl(endpoint, `/blocklets/${item.did}`);
|
|
33
33
|
if (serverUrl) {
|
|
34
|
-
blockletDetail
|
|
34
|
+
blockletDetail = `${blockletDetail}?server-url=${encodeURIComponent(serverUrl)}`;
|
|
35
35
|
}
|
|
36
|
-
return blockletDetail
|
|
36
|
+
return blockletDetail;
|
|
37
37
|
},
|
|
38
38
|
[endpoint, serverUrl]
|
|
39
39
|
);
|
|
@@ -123,7 +123,8 @@ Blocklet.defaultProps = {
|
|
|
123
123
|
|
|
124
124
|
function ShowAttributes({ item, attribute, value }) {
|
|
125
125
|
// eslint-disable-next-line react/no-danger
|
|
126
|
-
if (item._formatted)
|
|
126
|
+
if (item._formatted)
|
|
127
|
+
return <span data-cy="bl-autocomplete-item" dangerouslySetInnerHTML={{ __html: item._formatted[attribute] }} />;
|
|
127
128
|
return value;
|
|
128
129
|
}
|
|
129
130
|
ShowAttributes.propTypes = {
|