@kitconcept/volto-light-theme 6.0.0-alpha.3 → 6.0.0-alpha.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.draft CHANGED
@@ -1,13 +1,11 @@
1
- ## 6.0.0-alpha.3 (2024-12-05)
1
+ ## 6.0.0-alpha.5 (2024-12-09)
2
2
 
3
- ### Feature
3
+ ### Bugfix
4
4
 
5
- - New look and feel specs for footer logos. @sneridagh
6
- Added two slots: `preFooter` and `postFooter`. [#437](https://github.com/kitconcept/volto-light-theme/pull/437)
5
+ - Added guard in case blocks are corrupted or malformed. @sneridagh [#442](https://github.com/kitconcept/volto-light-theme/pull/442)
7
6
 
8
- ### Bugfix
7
+ ### Internal
9
8
 
10
- - Fixed edge case when you delete the image content type from the site. @sneridagh [#437](https://github.com/kitconcept/volto-light-theme/pull/437)
11
- - Fixed layout shift jumps on RAC Popovers. @sneridagh [#440](https://github.com/kitconcept/volto-light-theme/pull/440)
9
+ - Updated to latest 18.2.2 @sneridagh [#443](https://github.com/kitconcept/volto-light-theme/pull/443)
12
10
 
13
11
 
package/CHANGELOG.md CHANGED
@@ -8,6 +8,22 @@
8
8
 
9
9
  <!-- towncrier release notes start -->
10
10
 
11
+ ## 6.0.0-alpha.5 (2024-12-09)
12
+
13
+ ### Bugfix
14
+
15
+ - Added guard in case blocks are corrupted or malformed. @sneridagh [#442](https://github.com/kitconcept/volto-light-theme/pull/442)
16
+
17
+ ### Internal
18
+
19
+ - Updated to latest 18.2.2 @sneridagh [#443](https://github.com/kitconcept/volto-light-theme/pull/443)
20
+
21
+ ## 6.0.0-alpha.4 (2024-12-08)
22
+
23
+ ### Bugfix
24
+
25
+ - Fix initialBlocks config, do not override the whole thing. @sneridagh [#441](https://github.com/kitconcept/volto-light-theme/pull/441)
26
+
11
27
  ## 6.0.0-alpha.3 (2024-12-05)
12
28
 
13
29
  ### Feature
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitconcept/volto-light-theme",
3
- "version": "6.0.0-alpha.3",
3
+ "version": "6.0.0-alpha.5",
4
4
  "description": "Volto Light Theme by kitconcept",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/types/index.d.ts",
@@ -63,13 +63,11 @@ declare module '@plone/types' {
63
63
 
64
64
  export default function install(config: ConfigType) {
65
65
  // Initial block for event content type
66
- config.blocks.initialBlocks = {
67
- Event: [
68
- { '@type': 'title' },
69
- { '@type': 'eventMetadata', fixed: true, required: true },
70
- { '@type': 'slate' },
71
- ],
72
- };
66
+ config.blocks.initialBlocks.Event = [
67
+ { '@type': 'title' },
68
+ { '@type': 'eventMetadata', fixed: true, required: true },
69
+ { '@type': 'slate' },
70
+ ];
73
71
 
74
72
  // Palettes
75
73
  config.blocks.themes = [
@@ -21,7 +21,8 @@ import {
21
21
  findStyleByName,
22
22
  } from '@plone/volto/helpers/Blocks/Blocks';
23
23
  import { defineMessages, useIntl } from 'react-intl';
24
- import { map } from 'lodash';
24
+ import map from 'lodash/map';
25
+ import isEmpty from 'lodash/isEmpty';
25
26
  import StyleWrapper from '@plone/volto/components/manage/Blocks/Block/StyleWrapper';
26
27
  import config from '@plone/volto/registry';
27
28
  import ViewDefaultBlock from '@plone/volto/components/manage/Blocks/Block/DefaultView';
@@ -45,6 +46,11 @@ export function groupByBGColor(blocks, blocks_layout, colorDefinitions) {
45
46
  let currentArr = [];
46
47
  let currentBGColor;
47
48
 
49
+ // Guard in case the block layout is empty or corrupted for some reason
50
+ if (blocks_layout.items.length === 0 || isEmpty(blocks)) {
51
+ return [];
52
+ }
53
+
48
54
  blocks_layout.items.forEach((blockId) => {
49
55
  let currentBlockColor = blocks[blockId]?.theme || 'default';
50
56
  if (currentBlockColor !== currentBGColor) {