@gravity-ui/page-constructor 1.20.2 → 1.20.3
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.20.3](https://github.com/gravity-ui/page-constructor/compare/v1.20.2...v1.20.3) (2023-03-02)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* add uniqueness to children key prop ([#192](https://github.com/gravity-ui/page-constructor/issues/192)) ([8cbb720](https://github.com/gravity-ui/page-constructor/commit/8cbb720a4e60ccab8a3440141b3e4f5998c26a9b))
|
|
9
|
+
|
|
3
10
|
## [1.20.2](https://github.com/gravity-ui/page-constructor/compare/v1.20.1...v1.20.2) (2023-03-01)
|
|
4
11
|
|
|
5
12
|
|
package/build/cjs/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js
CHANGED
|
@@ -20,7 +20,7 @@ const ConstructorBlocks = ({ items, shouldRenderBlock }) => {
|
|
|
20
20
|
let itemElement;
|
|
21
21
|
const key = (0, utils_1.getBlockKey)(item, index);
|
|
22
22
|
const blockId = parentId ? `${parentId}_${key}` : key;
|
|
23
|
-
if (shouldRenderBlock && !shouldRenderBlock(item,
|
|
23
|
+
if (shouldRenderBlock && !shouldRenderBlock(item, blockId)) {
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
26
26
|
if ('loadable' in item && item.loadable) {
|
|
@@ -29,14 +29,14 @@ const ConstructorBlocks = ({ items, shouldRenderBlock }) => {
|
|
|
29
29
|
if (!config) {
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
32
|
-
itemElement = (react_1.default.createElement(ConstructorLoadable_1.ConstructorLoadable, { block: item, key:
|
|
32
|
+
itemElement = (react_1.default.createElement(ConstructorLoadable_1.ConstructorLoadable, { block: item, key: blockId, blockKey: blockId, config: config, serviceId: serviceId, params: params }));
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
35
35
|
if ('children' in item && item.children) {
|
|
36
36
|
children = item.children.map(renderer.bind(null, blockId));
|
|
37
37
|
}
|
|
38
38
|
itemElement = (react_1.default.createElement(blockIdContext_1.BlockIdContext.Provider, { value: blockId },
|
|
39
|
-
react_1.default.createElement(ConstructorItem_1.ConstructorItem, { data: item, key:
|
|
39
|
+
react_1.default.createElement(ConstructorItem_1.ConstructorItem, { data: item, key: blockId }, children)));
|
|
40
40
|
}
|
|
41
41
|
return blockTypes.includes(item.type) ? (react_1.default.createElement(ConstructorBlock_1.ConstructorBlock, { data: item, key: key, Component: itemElement })) : (itemElement);
|
|
42
42
|
};
|
package/build/esm/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js
CHANGED
|
@@ -16,7 +16,7 @@ export const ConstructorBlocks = ({ items, shouldRenderBlock }) => {
|
|
|
16
16
|
let itemElement;
|
|
17
17
|
const key = getBlockKey(item, index);
|
|
18
18
|
const blockId = parentId ? `${parentId}_${key}` : key;
|
|
19
|
-
if (shouldRenderBlock && !shouldRenderBlock(item,
|
|
19
|
+
if (shouldRenderBlock && !shouldRenderBlock(item, blockId)) {
|
|
20
20
|
return null;
|
|
21
21
|
}
|
|
22
22
|
if ('loadable' in item && item.loadable) {
|
|
@@ -25,14 +25,14 @@ export const ConstructorBlocks = ({ items, shouldRenderBlock }) => {
|
|
|
25
25
|
if (!config) {
|
|
26
26
|
return null;
|
|
27
27
|
}
|
|
28
|
-
itemElement = (React.createElement(ConstructorLoadable, { block: item, key:
|
|
28
|
+
itemElement = (React.createElement(ConstructorLoadable, { block: item, key: blockId, blockKey: blockId, config: config, serviceId: serviceId, params: params }));
|
|
29
29
|
}
|
|
30
30
|
else {
|
|
31
31
|
if ('children' in item && item.children) {
|
|
32
32
|
children = item.children.map(renderer.bind(null, blockId));
|
|
33
33
|
}
|
|
34
34
|
itemElement = (React.createElement(BlockIdContext.Provider, { value: blockId },
|
|
35
|
-
React.createElement(ConstructorItem, { data: item, key:
|
|
35
|
+
React.createElement(ConstructorItem, { data: item, key: blockId }, children)));
|
|
36
36
|
}
|
|
37
37
|
return blockTypes.includes(item.type) ? (React.createElement(ConstructorBlock, { data: item, key: key, Component: itemElement })) : (itemElement);
|
|
38
38
|
};
|