@plone/volto 17.15.3 → 17.15.5
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
|
@@ -17,6 +17,18 @@ myst:
|
|
|
17
17
|
|
|
18
18
|
<!-- towncrier release notes start -->
|
|
19
19
|
|
|
20
|
+
## 17.15.5 (2024-03-07)
|
|
21
|
+
|
|
22
|
+
### Bugfix
|
|
23
|
+
|
|
24
|
+
- Fix other occurrences of mutable (referenced) objects when assigning the default inner `blocksConfig` object for the `grid` block, pass by value instead. sneridagh [#5859](https://github.com/plone/volto/issues/5859)
|
|
25
|
+
|
|
26
|
+
## 17.15.4 (2024-03-06)
|
|
27
|
+
|
|
28
|
+
### Bugfix
|
|
29
|
+
|
|
30
|
+
- Fix the introduction of a mutable (referenced) object when assigning the default inner `blocksConfig` object for the `grid` block, pass by value instead. sneridagh [#5850](https://github.com/plone/volto/issues/5850)
|
|
31
|
+
|
|
20
32
|
## 17.15.3 (2024-03-04)
|
|
21
33
|
|
|
22
34
|
### Bugfix
|
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Fix other occurrences of mutable (referenced) objects when assigning the default inner `blocksConfig` object for the `grid` block, pass by value instead. sneridagh
|
|
@@ -3,6 +3,7 @@ import redraft from 'redraft';
|
|
|
3
3
|
import TextBlockView from './TextBlockView';
|
|
4
4
|
import TextBlockEdit from './TextBlockEdit';
|
|
5
5
|
import TextBlockSchema from './TextBlockSchema';
|
|
6
|
+
import { cloneDeep } from 'lodash';
|
|
6
7
|
|
|
7
8
|
import {
|
|
8
9
|
goDown,
|
|
@@ -164,7 +165,9 @@ export default function applyConfig(config) {
|
|
|
164
165
|
// This is required in order to initialize the inner blocksConfig
|
|
165
166
|
// for the grid block, since the slate block lives in an add-on
|
|
166
167
|
// it should be responsible to fill itself into the grid configuration
|
|
167
|
-
|
|
168
|
+
// The cloneDeep is mandatory in order to not mess with pass by reference problems
|
|
169
|
+
config.blocks.blocksConfig.gridBlock.blocksConfig.slate =
|
|
170
|
+
cloneDeep(slateBlockConfig);
|
|
168
171
|
}
|
|
169
172
|
|
|
170
173
|
return config;
|
package/src/config/Blocks.jsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineMessages } from 'react-intl';
|
|
2
|
+
import { cloneDeep } from 'lodash';
|
|
2
3
|
|
|
3
4
|
import ViewTitleBlock from '@plone/volto/components/manage/Blocks/Title/View';
|
|
4
5
|
import ViewDescriptionBlock from '@plone/volto/components/manage/Blocks/Description/View';
|
|
@@ -519,15 +520,11 @@ const blocksConfig = {
|
|
|
519
520
|
// for the grid block, since we need to modify how the inner teaser
|
|
520
521
|
// block behave in it (= no schemaEnhancer fields for teasers inside a grid)
|
|
521
522
|
// Afterwards, it can be further customized in add-ons using the same technique.
|
|
522
|
-
blocksConfig.gridBlock.blocksConfig =
|
|
523
|
-
blocksConfig.gridBlock.blocksConfig.teaser =
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
blocksConfig.gridBlock.blocksConfig.image = {
|
|
528
|
-
...blocksConfig.image,
|
|
529
|
-
schemaEnhancer: gridImageDisableSizeAndPositionHandlersSchema,
|
|
530
|
-
};
|
|
523
|
+
blocksConfig.gridBlock.blocksConfig = cloneDeep(blocksConfig);
|
|
524
|
+
blocksConfig.gridBlock.blocksConfig.teaser.schemaEnhancer =
|
|
525
|
+
gridTeaserDisableStylingSchema;
|
|
526
|
+
blocksConfig.gridBlock.blocksConfig.image.schemaEnhancer =
|
|
527
|
+
gridImageDisableSizeAndPositionHandlersSchema;
|
|
531
528
|
|
|
532
529
|
const requiredBlocks = ['title'];
|
|
533
530
|
|
package/types/config/Blocks.d.ts
CHANGED
|
@@ -8,51 +8,9 @@ export namespace blocksConfig {
|
|
|
8
8
|
namespace blocksConfig {
|
|
9
9
|
namespace teaser {
|
|
10
10
|
export { gridTeaserDisableStylingSchema as schemaEnhancer };
|
|
11
|
-
export let id: string;
|
|
12
|
-
export let title: string;
|
|
13
|
-
export { imagesSVG as icon };
|
|
14
|
-
export let group: string;
|
|
15
|
-
export { TeaserViewBlock as view };
|
|
16
|
-
export { TeaserEditBlock as edit };
|
|
17
|
-
export let restricted: boolean;
|
|
18
|
-
export let mostUsed: boolean;
|
|
19
|
-
export let sidebarTab: number;
|
|
20
|
-
export { TeaserSchema as blockSchema };
|
|
21
|
-
export { TeaserBlockDataAdapter as dataAdapter };
|
|
22
|
-
export let variations: {
|
|
23
|
-
id: string;
|
|
24
|
-
isDefault: boolean;
|
|
25
|
-
title: string;
|
|
26
|
-
template: {
|
|
27
|
-
(props: any): JSX.Element;
|
|
28
|
-
propTypes: {
|
|
29
|
-
data: import("prop-types").Validator<{
|
|
30
|
-
[x: string]: any;
|
|
31
|
-
}>;
|
|
32
|
-
isEditMode: import("prop-types").Requireable<boolean>;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
}[];
|
|
36
11
|
}
|
|
37
12
|
namespace image {
|
|
38
13
|
export { gridImageDisableSizeAndPositionHandlersSchema as schemaEnhancer };
|
|
39
|
-
let id_1: string;
|
|
40
|
-
export { id_1 as id };
|
|
41
|
-
let title_1: string;
|
|
42
|
-
export { title_1 as title };
|
|
43
|
-
export { cameraSVG as icon };
|
|
44
|
-
let group_1: string;
|
|
45
|
-
export { group_1 as group };
|
|
46
|
-
export { ViewImageBlock as view };
|
|
47
|
-
export { EditImageBlock as edit };
|
|
48
|
-
export { ImageSettingsSchema as schema };
|
|
49
|
-
let restricted_1: boolean;
|
|
50
|
-
export { restricted_1 as restricted };
|
|
51
|
-
let mostUsed_1: boolean;
|
|
52
|
-
export { mostUsed_1 as mostUsed };
|
|
53
|
-
let sidebarTab_1: number;
|
|
54
|
-
export { sidebarTab_1 as sidebarTab };
|
|
55
|
-
export { getImageBlockSizes as getSizes };
|
|
56
14
|
}
|
|
57
15
|
}
|
|
58
16
|
}
|
|
@@ -60,12 +18,4 @@ export namespace blocksConfig {
|
|
|
60
18
|
export const initialBlocks: {};
|
|
61
19
|
export const initialBlocksFocus: {};
|
|
62
20
|
import { gridTeaserDisableStylingSchema } from '@plone/volto/components/manage/Blocks/Teaser/schema';
|
|
63
|
-
import TeaserViewBlock from '@plone/volto/components/manage/Blocks/Teaser/View';
|
|
64
|
-
import TeaserEditBlock from '@plone/volto/components/manage/Blocks/Teaser/Edit';
|
|
65
|
-
import { TeaserSchema } from '@plone/volto/components/manage/Blocks/Teaser/schema';
|
|
66
|
-
import { TeaserBlockDataAdapter } from '@plone/volto/components/manage/Blocks/Teaser/adapter';
|
|
67
21
|
import { gridImageDisableSizeAndPositionHandlersSchema } from '@plone/volto/components/manage/Blocks/Image/schema';
|
|
68
|
-
import ViewImageBlock from '@plone/volto/components/manage/Blocks/Image/View';
|
|
69
|
-
import EditImageBlock from '@plone/volto/components/manage/Blocks/Image/Edit';
|
|
70
|
-
import ImageSettingsSchema from '@plone/volto/components/manage/Blocks/Image/LayoutSchema';
|
|
71
|
-
import { getImageBlockSizes } from '@plone/volto/components/manage/Blocks/Image/utils';
|