@eeacms/volto-eea-website-theme 1.14.0 → 1.15.0

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
@@ -4,6 +4,51 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ ### [1.15.0](https://github.com/eea/volto-eea-website-theme/compare/1.14.1...1.15.0) - 2 June 2023
8
+
9
+ #### :rocket: New Features
10
+
11
+ - feat: can disable all actions from footer - refs #253198 [Teodor Voicu - [`ab52ee8`](https://github.com/eea/volto-eea-website-theme/commit/ab52ee818d4343add1ac641b1a7a2e1c76ce0946)]
12
+ - feat(blocks): add body class option in layout settings block #138 from eea/layout-body-class [ichim-david - [`4409d1c`](https://github.com/eea/volto-eea-website-theme/commit/4409d1c7416ad143eafe578d55c2c9ef70433879)]
13
+ - feat(blocks): add homepage class in layout settings block [kreafox - [`979ed1e`](https://github.com/eea/volto-eea-website-theme/commit/979ed1eae9253735ad20c4558c021a1a0ec267d6)]
14
+ - feat(blocks): add body class option in layout settings block [kreafox - [`d401bd6`](https://github.com/eea/volto-eea-website-theme/commit/d401bd6651481c9e5a1fe626724d80bf7d3babed)]
15
+
16
+ #### :nail_care: Enhancements
17
+
18
+ - change(title): use portal type_title instead @type refs151851 [nileshgulia1 - [`aa38e44`](https://github.com/eea/volto-eea-website-theme/commit/aa38e4444f12cab2f80647774b3e4933053fade6)]
19
+ - change(layout-block): removed css that hid the layout settings [David Ichim - [`1e26a94`](https://github.com/eea/volto-eea-website-theme/commit/1e26a94a01fcbc44f6e07c6fa60e5e43f9545788)]
20
+ - change(layout): removed most used from layout block [David Ichim - [`31c901d`](https://github.com/eea/volto-eea-website-theme/commit/31c901d75d509d011269dee4224e0bec6b12bfe4)]
21
+ - change(blocks): remove restriction in layout settings block [kreafox - [`c3b01f6`](https://github.com/eea/volto-eea-website-theme/commit/c3b01f60b84ccc8b4ae6446a2b607615a3546ceb)]
22
+
23
+ #### :house: Internal changes
24
+
25
+
26
+ #### :hammer_and_wrench: Others
27
+
28
+ - other: group restricted blocks in an array [Miu Razvan - [`b79680d`](https://github.com/eea/volto-eea-website-theme/commit/b79680dd4162a0ee316489d15c76eab274888f74)]
29
+ - Bump to 1.15.0 [kreafox - [`48aa9d8`](https://github.com/eea/volto-eea-website-theme/commit/48aa9d8e8dd45bd1ca0a1a63b579ed3db77e7463)]
30
+ ### [1.14.1](https://github.com/eea/volto-eea-website-theme/compare/1.14.0...1.14.1) - 22 May 2023
31
+
32
+ #### :rocket: New Features
33
+
34
+ - feat(header): Make header aware of lang #151573 #133 from eea/multilingual-header [ichim-david - [`43156bf`](https://github.com/eea/volto-eea-website-theme/commit/43156bf949a424e94577461bebf7c1ed5090525e)]
35
+
36
+ #### :bug: Bug Fixes
37
+
38
+ - fix(DRAFT): Draft background appears on public pages - refs #251511 [dobri1408 - [`8505705`](https://github.com/eea/volto-eea-website-theme/commit/8505705fd194487bf70322518931e33d98602a01)]
39
+
40
+ #### :nail_care: Enhancements
41
+
42
+ - change(blocks): moved most used block config within eea-website-theme [David Ichim - [`dc61722`](https://github.com/eea/volto-eea-website-theme/commit/dc61722a83d84a1f3c8ac198d231ccbe910bac65)]
43
+ - change(blocks): moved layout settings block from volto-eea-policy #136 from eea/252559-policy-refactoring [ichim-david - [`02d29e0`](https://github.com/eea/volto-eea-website-theme/commit/02d29e0cb25327bdb83c1f4555adcc22844f89c6)]
44
+ - change(blocks): moved layout settings block from volto-eea-policy to volto-eea-website-theme [David Ichim - [`4ef6f14`](https://github.com/eea/volto-eea-website-theme/commit/4ef6f1490472bbf2e8ee0174124a3248f16cd7f6)]
45
+
46
+ #### :hammer_and_wrench: Others
47
+
48
+ - added missing schema-utils.js file [David Ichim - [`ff1c052`](https://github.com/eea/volto-eea-website-theme/commit/ff1c052e2c04a078ca0c69bf971cf33277f1d1d4)]
49
+ - remove console [Dobricean Ioan Dorian - [`82003cb`](https://github.com/eea/volto-eea-website-theme/commit/82003cb3e439ce203472335ec8bc600a5ee7548d)]
50
+ - header multilingual [Dobricean Ioan Dorian - [`3eecd19`](https://github.com/eea/volto-eea-website-theme/commit/3eecd1939fad60716100df5d980060b29792678b)]
51
+ - multilingual prop [Dobricean Ioan Dorian - [`6945c76`](https://github.com/eea/volto-eea-website-theme/commit/6945c76a9b48e98b3a90ad4f9c5db8fa762b6a6a)]
7
52
  ### [1.14.0](https://github.com/eea/volto-eea-website-theme/compare/1.13.0...1.14.0) - 10 April 2023
8
53
 
9
54
  #### :rocket: New Features
@@ -20,9 +65,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
20
65
 
21
66
  - change(icons): set link for remix icon set to our docusaurus [David Ichim - [`df81a4f`](https://github.com/eea/volto-eea-website-theme/commit/df81a4f5f5954c7da228e1e5b2b409af9d82518d)]
22
67
 
23
- #### :hammer_and_wrench: Others
24
-
25
- - Release 1.14.0 [Alin Voinea - [`88e08e6`](https://github.com/eea/volto-eea-website-theme/commit/88e08e6b15ba536e7f7c06131f594a157a91daa7)]
26
68
  ### [1.13.0](https://github.com/eea/volto-eea-website-theme/compare/1.12.0...1.13.0) - 27 March 2023
27
69
 
28
70
  #### :rocket: New Features
@@ -331,6 +373,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
331
373
 
332
374
  - feat(Footer): Bring back footer contacts extra actions - refs #151856 [Alin Voinea - [`6c19413`](https://github.com/eea/volto-eea-website-theme/commit/6c194139420c9fd847692d180db1c1593e2483de)]
333
375
 
376
+ #### :hammer_and_wrench: Others
377
+
334
378
  ### [1.3.0](https://github.com/eea/volto-eea-website-theme/compare/1.2.0...1.3.0) - 22 November 2022
335
379
 
336
380
  #### :rocket: New Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-website-theme",
3
- "version": "1.14.0",
3
+ "version": "1.15.0",
4
4
  "description": "@eeacms/volto-eea-website-theme: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ import { EditSchema } from './schema';
3
+ import { BlockDataForm, SidebarPortal } from '@plone/volto/components';
4
+ import LayoutSettingsView from './LayoutSettingsView';
5
+
6
+ const LayoutSettingsEdit = (props) => {
7
+ const schema = EditSchema();
8
+ return (
9
+ <>
10
+ <h3>Page layout settings</h3>
11
+ <LayoutSettingsView {...props} />
12
+ <SidebarPortal selected={props.selected}>
13
+ {props.selected && (
14
+ <BlockDataForm
15
+ title={schema.title}
16
+ schema={schema}
17
+ formData={props.data}
18
+ onChangeField={(id, value) => {
19
+ props.onChangeBlock(props.block, {
20
+ ...props.data,
21
+ [id]: value,
22
+ });
23
+ }}
24
+ />
25
+ )}
26
+ </SidebarPortal>
27
+ </>
28
+ );
29
+ };
30
+
31
+ export default LayoutSettingsEdit;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { BodyClass } from '@plone/volto/helpers';
3
+ import { getVoltoStyles } from '@eeacms/volto-eea-website-theme/helpers/schema-utils';
4
+ import cx from 'classnames';
5
+
6
+ const LayoutSettingsView = (props) => {
7
+ const classNames = getVoltoStyles(props.data);
8
+ return <BodyClass className={cx(classNames)} />;
9
+ };
10
+
11
+ function propsAreEqual(prevProps, nextProps) {
12
+ return prevProps.data === nextProps.data;
13
+ }
14
+
15
+ export default React.memo(LayoutSettingsView, propsAreEqual);
@@ -0,0 +1,22 @@
1
+ import codeSVG from '@plone/volto/icons/code.svg';
2
+ import LayoutSettingsView from './LayoutSettingsView';
3
+ import LayoutSettingsEdit from './LayoutSettingsEdit';
4
+ import BlockSettingsSchema from '@plone/volto/components/manage/Blocks/Block/Schema';
5
+
6
+ export default (config) => {
7
+ config.blocks.blocksConfig.layoutSettings = {
8
+ id: 'layoutSettings',
9
+ title: 'Layout settings',
10
+ icon: codeSVG,
11
+ group: 'common',
12
+ view: LayoutSettingsView,
13
+ edit: LayoutSettingsEdit,
14
+ schema: BlockSettingsSchema,
15
+ restricted: false,
16
+ mostUsed: false,
17
+ blockHasOwnFocusManagement: true,
18
+ sidebarTab: 1,
19
+ };
20
+
21
+ return config;
22
+ };
@@ -0,0 +1,38 @@
1
+ import imageNarrowSVG from '@eeacms/volto-eea-website-theme/icons/image-narrow.svg';
2
+ import imageFitSVG from '@plone/volto/icons/image-fit.svg';
3
+ import imageWideSVG from '@plone/volto/icons/image-wide.svg';
4
+
5
+ export const ALIGN_INFO_MAP = {
6
+ narrow_view: [imageNarrowSVG, 'Narrow width'],
7
+ container_view: [imageFitSVG, 'Container width'],
8
+ wide_view: [imageWideSVG, 'Wide width'],
9
+ };
10
+
11
+ export const EditSchema = () => {
12
+ return {
13
+ title: 'Page layout settings',
14
+ fieldsets: [
15
+ {
16
+ id: 'default',
17
+ title: 'Default',
18
+ fields: ['layout_size', 'body_class'],
19
+ },
20
+ ],
21
+ required: [],
22
+ properties: {
23
+ layout_size: {
24
+ widget: 'style_align',
25
+ title: 'Layout size',
26
+ actions: Object.keys(ALIGN_INFO_MAP),
27
+ actionsInfoMap: ALIGN_INFO_MAP,
28
+ },
29
+ body_class: {
30
+ title: 'Body class',
31
+ choices: [
32
+ ['homepage', 'Homepage'],
33
+ ['homepage-inverse', 'Homepage inverse'],
34
+ ],
35
+ },
36
+ },
37
+ };
38
+ };
@@ -3,11 +3,9 @@ import { compose } from 'redux';
3
3
  import { connect } from 'react-redux';
4
4
  import { withRouter } from 'react-router';
5
5
  import { defineMessages, injectIntl } from 'react-intl';
6
- import { startCase } from 'lodash';
7
- import qs from 'querystring';
6
+ import startCase from 'lodash/startCase';
8
7
  import { Icon } from 'semantic-ui-react';
9
8
  import Popup from '@eeacms/volto-eea-design-system/ui/Popup/Popup';
10
- import { flattenToAppURL } from '@plone/volto/helpers';
11
9
  import config from '@plone/volto/registry';
12
10
  import Banner from '@eeacms/volto-eea-design-system/ui/Banner/Banner';
13
11
  import {
@@ -62,7 +60,7 @@ const Title = ({ config = {}, properties }) => {
62
60
  };
63
61
 
64
62
  const View = (props) => {
65
- const { banner = {}, intl, location, types = [] } = props;
63
+ const { banner = {}, intl } = props;
66
64
  const metadata = props.metadata || props.properties;
67
65
  const popupRef = useRef(null);
68
66
  const {
@@ -81,11 +79,6 @@ const View = (props) => {
81
79
  const copyrightPrefix =
82
80
  config.blocks.blocksConfig.title.copyrightPrefix || '';
83
81
 
84
- // Set query parameters
85
- const parameters = useMemo(
86
- () => qs.parse(location.search.replace('?', '')) || {},
87
- [location],
88
- );
89
82
  // Set dates
90
83
  const getDate = useCallback(
91
84
  (hidden, key) => {
@@ -109,18 +102,7 @@ const View = (props) => {
109
102
  // Set image source
110
103
  const image = getImageSource(metadata['image']);
111
104
  // Get type
112
- const type = useMemo(() => {
113
- return (
114
- types?.filter?.(
115
- (type) =>
116
- flattenToAppURL(type['@id']) ===
117
- `/@types/${metadata['@type'] || parameters.type}`,
118
- )[0]?.title ||
119
- friendlyId(metadata['@type']) ||
120
- metadata['@type'] ||
121
- parameters.type
122
- );
123
- }, [types, metadata, parameters]);
105
+ const type = metadata.type_title || friendlyId(metadata['@type']);
124
106
 
125
107
  return (
126
108
  <Banner {...props} image={image}>
@@ -11,19 +11,39 @@ import { flattenToAppURL } from '@plone/volto/helpers';
11
11
  * @returns
12
12
  */
13
13
 
14
- const checkIfNullOrUndefined = (value) => {
15
- return value === undefined || value === null;
14
+ const removeTrailingSlash = (str) => {
15
+ return str.replace(/\/+$/, '');
16
16
  };
17
17
 
18
+ const checkIfPublished = (props) => {
19
+ //case 0: the state is not for the current content-type eg: Go to /contents from a page
20
+ if (props.contentId !== removeTrailingSlash(props.pathname)) return true;
21
+
22
+ //case 1 : review_state published
23
+ if (props?.review_state === 'published') return true;
24
+
25
+ //case 2: review_state null, but parent is published eg:Image in published folder
26
+ if (
27
+ !props?.review_state &&
28
+ props?.content?.parent?.review_state === 'published'
29
+ )
30
+ return true;
31
+
32
+ //case 3: review_state null, but there is no parent eg: PloneSite
33
+ if (
34
+ !props?.review_state &&
35
+ Object.keys(props?.content?.parent || {}).length === 0
36
+ )
37
+ return true;
38
+
39
+ //case 4: review_state null, and review state of parent is null, eg: Image in PloneSite
40
+ if (!props?.review_state && !props?.content?.parent?.review_state)
41
+ return true;
42
+ return false;
43
+ };
18
44
  const DraftBackground = (props) => {
19
45
  let draftClass = 'wf-state-is-draft';
20
- if (
21
- (checkIfNullOrUndefined(props?.review_state) &&
22
- props?.content?.parent?.review_state === 'published') ||
23
- props?.review_state === 'published' ||
24
- (checkIfNullOrUndefined(props?.review_state) &&
25
- Object.keys(props?.content?.parent || {}).length === 0)
26
- ) {
46
+ if (checkIfPublished(props)) {
27
47
  draftClass = '';
28
48
  }
29
49
  return draftClass ? <BodyClass className={draftClass} /> : '';
@@ -8,6 +8,7 @@ import { useSelector, shallowEqual } from 'react-redux';
8
8
  import { flattenToAppURL } from '@plone/volto/helpers';
9
9
  import EEAFooter from '@eeacms/volto-eea-design-system/ui/Footer/Footer';
10
10
  import config from '@plone/volto/registry';
11
+ import isArray from 'lodash/isArray';
11
12
 
12
13
  const Footer = () => {
13
14
  const { eea } = config.settings;
@@ -28,7 +29,7 @@ const Footer = () => {
28
29
  shallowEqual,
29
30
  );
30
31
  // ZMI > portal_actions > footer_actions
31
- const actions = footerActions.length
32
+ const actions = isArray(footerActions)
32
33
  ? footerActions.map((action) => ({
33
34
  title: action.title,
34
35
  link: flattenToAppURL(action.url),
@@ -36,7 +37,7 @@ const Footer = () => {
36
37
  : eea.footerOpts.actions;
37
38
 
38
39
  // ZMI > portal_actions > copyright_actions
39
- const copyright = copyrightActions.length
40
+ const copyright = isArray(copyrightActions)
40
41
  ? copyrightActions.map((action) => ({
41
42
  title: action.title,
42
43
  site: action.title,
@@ -45,7 +46,7 @@ const Footer = () => {
45
46
  : eea.footerOpts.copyright;
46
47
 
47
48
  // ZMI > portal_actions > social_actions
48
- const social = socialActions.length
49
+ const social = isArray(socialActions)
49
50
  ? socialActions.map((action) => ({
50
51
  name: action.id,
51
52
  icon: action.icon,
@@ -54,7 +55,7 @@ const Footer = () => {
54
55
  : eea.footerOpts.social;
55
56
 
56
57
  // ZMI > portal_actions > contact_actions
57
- const contacts = contactActions.length
58
+ const contacts = isArray(contactActions)
58
59
  ? contactActions.map((action, idx) => ({
59
60
  text: action.title,
60
61
  icon: action.icon,
@@ -200,6 +200,7 @@ const EEAHeader = ({ pathname, token, items, history, subsite }) => {
200
200
  </Header.TopHeader>
201
201
  <Header.Main
202
202
  pathname={pathname}
203
+ isMultilingual={config.settings.isMultilingual}
203
204
  headerSearchBox={headerSearchBox}
204
205
  inverted={isHomePageInverse ? true : false}
205
206
  transparency={isHomePageInverse ? true : false}
@@ -1,6 +1,7 @@
1
1
  import superagent from 'superagent';
2
2
  import config from '@plone/volto/registry';
3
3
  import { addHeadersFactory } from '@plone/volto/helpers/Proxy/Proxy';
4
+ // import { addStylingFieldsetSchemaEnhancer } from '@eeacms/volto-eea-website-theme/src/helpers/schema-utils';
4
5
 
5
6
  /**
6
7
  * Get a resource image/file with authenticated (if token exist) API headers
@@ -0,0 +1,67 @@
1
+ import { cloneDeep } from 'lodash';
2
+ import imageNarrowSVG from '@eeacms/volto-eea-website-theme/icons/image-narrow.svg';
3
+ import imageFitSVG from '@plone/volto/icons/image-fit.svg';
4
+ import imageWideSVG from '@plone/volto/icons/image-wide.svg';
5
+ import imageFullSVG from '@plone/volto/icons/image-full.svg';
6
+
7
+ export const ALIGN_INFO_MAP = {
8
+ narrow_width: [imageNarrowSVG, 'Narrow width'],
9
+ container_width: [imageFitSVG, 'Container width'],
10
+ wide_width: [imageWideSVG, 'Wide width'],
11
+ full: [imageFullSVG, 'Full width'],
12
+ };
13
+
14
+ export const addStylingFieldsetSchemaEnhancer = ({ schema }) => {
15
+ const applied = schema?.properties?.styles;
16
+
17
+ if (!applied) {
18
+ const resSchema = cloneDeep(schema);
19
+
20
+ resSchema.fieldsets.push({
21
+ id: 'styling',
22
+ fields: ['styles'],
23
+ title: 'Styling',
24
+ });
25
+ resSchema.properties.styles = {
26
+ widget: 'object',
27
+ title: 'Styling',
28
+ schema: {
29
+ fieldsets: [
30
+ {
31
+ id: 'default',
32
+ title: 'Default',
33
+ fields: ['size'],
34
+ },
35
+ ],
36
+ properties: {
37
+ size: {
38
+ widget: 'style_align',
39
+ title: 'Section size',
40
+ actions: Object.keys(ALIGN_INFO_MAP),
41
+ actionsInfoMap: ALIGN_INFO_MAP,
42
+ },
43
+ },
44
+ required: [],
45
+ },
46
+ };
47
+ return resSchema;
48
+ }
49
+
50
+ return schema;
51
+ };
52
+ export const getVoltoStyles = (props) => {
53
+ // return an object with same key and value for cx class setting
54
+ const styles = props ? props : {};
55
+ const output = {};
56
+ for (const [key, value] of Object.entries(styles)) {
57
+ if (key === '@type') {
58
+ continue;
59
+ }
60
+ if (styles[key] === true) {
61
+ output[key] = key;
62
+ } else {
63
+ output[value] = value;
64
+ }
65
+ }
66
+ return output;
67
+ };
@@ -0,0 +1,5 @@
1
+ <svg width="36" height="36" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M10 13L11.9333 11V25L10 23H26L24.0667 25V11L26 13H10ZM26 11V18V21.5V23.5V25H10V11H26Z" fill="black"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7 31H29V29H7V31Z"/>
4
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7 7H29V5H7V7Z"/>
5
+ </svg>
package/src/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import * as eea from './config';
2
2
  import InpageNavigation from '@eeacms/volto-eea-design-system/ui/InpageNavigation/InpageNavigation';
3
3
  import installCustomTitle from '@eeacms/volto-eea-website-theme/components/manage/Blocks/Title';
4
+ import installLayoutSettingsBlock from '@eeacms/volto-eea-website-theme/components/manage/Blocks/LayoutSettings';
5
+ import { addStylingFieldsetSchemaEnhancer } from '@eeacms/volto-eea-website-theme/helpers/schema-utils';
4
6
  import CustomCSS from '@eeacms/volto-eea-website-theme/components/theme/CustomCSS/CustomCSS';
5
7
  import NotFound from '@eeacms/volto-eea-website-theme/components/theme/NotFound/NotFound';
6
8
  import DraftBackground from '@eeacms/volto-eea-website-theme/components/theme/DraftBackground/DraftBackground';
@@ -14,6 +16,12 @@ import voltoCustomMiddleware from './middleware/voltoCustom';
14
16
  import okMiddleware from './middleware/ok';
15
17
  import installSlate from './slate';
16
18
 
19
+ const restrictedBlocks = [
20
+ '__grid', // Grid/Teaser block (kitconcept)
21
+ 'imagesGrid',
22
+ 'teaser',
23
+ ];
24
+
17
25
  const applyConfig = (config) => {
18
26
  // EEA specific settings
19
27
  config.settings.eea = {
@@ -32,6 +40,13 @@ const applyConfig = (config) => {
32
40
  // Disable tags on View
33
41
  config.settings.showTags = false;
34
42
 
43
+ // Disable some blocks
44
+ restrictedBlocks.forEach((block) => {
45
+ if (config.blocks.blocksConfig[block]) {
46
+ config.blocks.blocksConfig[block].restricted = true;
47
+ }
48
+ });
49
+
35
50
  // Enable Title block
36
51
  config.blocks.blocksConfig.title.restricted = false;
37
52
 
@@ -204,6 +219,48 @@ const applyConfig = (config) => {
204
219
  },
205
220
  ];
206
221
 
222
+ // layout settings
223
+ config = [installLayoutSettingsBlock].reduce(
224
+ (acc, apply) => apply(acc),
225
+ config,
226
+ );
227
+
228
+ // Group
229
+ if (config.blocks.blocksConfig.group) {
230
+ config.blocks.blocksConfig.group.schemaEnhancer = addStylingFieldsetSchemaEnhancer;
231
+ }
232
+
233
+ // Columns
234
+ if (config.blocks.blocksConfig.columnsBlock) {
235
+ config.blocks.blocksConfig.columnsBlock.mostUsed = true;
236
+ config.blocks.blocksConfig.columnsBlock.schemaEnhancer = addStylingFieldsetSchemaEnhancer;
237
+ }
238
+
239
+ // Listing
240
+ if (config.blocks.blocksConfig.listing) {
241
+ config.blocks.blocksConfig.listing.title = 'Listing (Content)';
242
+ config.blocks.blocksConfig.listing.schemaEnhancer = addStylingFieldsetSchemaEnhancer;
243
+ }
244
+
245
+ // Block chooser
246
+ config.blocks.blocksConfig.image.mostUsed = false;
247
+ config.blocks.blocksConfig.video.mostUsed = false;
248
+
249
+ // Divider
250
+ if (config.blocks.blocksConfig.dividerBlock) {
251
+ config.blocks.blocksConfig.dividerBlock.mostUsed = true;
252
+ }
253
+
254
+ // Call to Action
255
+ if (config.blocks.blocksConfig.callToActionBlock) {
256
+ config.blocks.blocksConfig.callToActionBlock.mostUsed = true;
257
+ }
258
+
259
+ // Accordion
260
+ if (config.blocks.blocksConfig.accordion) {
261
+ config.blocks.blocksConfig.accordion.mostUsed = true;
262
+ }
263
+
207
264
  // Custom blocks: Title
208
265
  return [installCustomTitle].reduce((acc, apply) => apply(acc), config);
209
266
  };