@eeacms/volto-eea-website-theme 1.13.0 → 1.14.1

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,44 @@ 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.14.1](https://github.com/eea/volto-eea-website-theme/compare/1.14.0...1.14.1) - 22 May 2023
8
+
9
+ #### :rocket: New Features
10
+
11
+ - 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)]
12
+
13
+ #### :bug: Bug Fixes
14
+
15
+ - fix(DRAFT): Draft background appears on public pages - refs #251511 [dobri1408 - [`8505705`](https://github.com/eea/volto-eea-website-theme/commit/8505705fd194487bf70322518931e33d98602a01)]
16
+
17
+ #### :nail_care: Enhancements
18
+
19
+ - change(blocks): moved most used block config within eea-website-theme [David Ichim - [`dc61722`](https://github.com/eea/volto-eea-website-theme/commit/dc61722a83d84a1f3c8ac198d231ccbe910bac65)]
20
+ - 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)]
21
+ - 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)]
22
+
23
+ #### :hammer_and_wrench: Others
24
+
25
+ - added missing schema-utils.js file [David Ichim - [`ff1c052`](https://github.com/eea/volto-eea-website-theme/commit/ff1c052e2c04a078ca0c69bf971cf33277f1d1d4)]
26
+ - remove console [Dobricean Ioan Dorian - [`82003cb`](https://github.com/eea/volto-eea-website-theme/commit/82003cb3e439ce203472335ec8bc600a5ee7548d)]
27
+ - header multilingual [Dobricean Ioan Dorian - [`3eecd19`](https://github.com/eea/volto-eea-website-theme/commit/3eecd1939fad60716100df5d980060b29792678b)]
28
+ - multilingual prop [Dobricean Ioan Dorian - [`6945c76`](https://github.com/eea/volto-eea-website-theme/commit/6945c76a9b48e98b3a90ad4f9c5db8fa762b6a6a)]
29
+ ### [1.14.0](https://github.com/eea/volto-eea-website-theme/compare/1.13.0...1.14.0) - 10 April 2023
30
+
31
+ #### :rocket: New Features
32
+
33
+ - feat(copyright): Add description with link to remix icon set #129 from eea/icon-description [ichim-david - [`73d905b`](https://github.com/eea/volto-eea-website-theme/commit/73d905b17a0d9979c91e51eda869805bd106b2f1)]
34
+ - feat(copyright): Add description with link to remix icon set [kreafox - [`fa025cc`](https://github.com/eea/volto-eea-website-theme/commit/fa025ccbd52f22be1294ec47c53b9b2ec70c5524)]
35
+
36
+ #### :bug: Bug Fixes
37
+
38
+ - fix(DRAFT): Consider parent on items with no review_state - refs #249741 [dobri1408 - [`042a3e3`](https://github.com/eea/volto-eea-website-theme/commit/042a3e3e08c31ef9eaf4e56ebf292010022ffbf1)]
39
+ - fix(columnsBlock): Available column background colors [Alin Voinea - [`f2f87ac`](https://github.com/eea/volto-eea-website-theme/commit/f2f87acec5ffed9e4b8eaa4c6977383ed54ca63e)]
40
+
41
+ #### :nail_care: Enhancements
42
+
43
+ - change(icons): set link for remix icon set to our docusaurus [David Ichim - [`df81a4f`](https://github.com/eea/volto-eea-website-theme/commit/df81a4f5f5954c7da228e1e5b2b409af9d82518d)]
44
+
7
45
  ### [1.13.0](https://github.com/eea/volto-eea-website-theme/compare/1.12.0...1.13.0) - 27 March 2023
8
46
 
9
47
  #### :rocket: New Features
@@ -116,6 +154,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
116
154
 
117
155
  #### :hammer_and_wrench: Others
118
156
 
157
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`6c5e2f8`](https://github.com/eea/volto-eea-website-theme/commit/6c5e2f80456e2061d9e9c15fd0a0b91b9ac70568)]
119
158
  ### [1.9.1](https://github.com/eea/volto-eea-website-theme/compare/1.9.0...1.9.1) - 28 February 2023
120
159
 
121
160
  #### :bug: Bug Fixes
@@ -262,6 +301,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
262
301
 
263
302
  - For some reasons types is a string [Alin Voinea - [`3769a09`](https://github.com/eea/volto-eea-website-theme/commit/3769a0981181d5b633f3498daebbe96be8b4b833)]
264
303
  - Fix(redirect): o.filter - refs #157627 [Alin Voinea - [`deb23da`](https://github.com/eea/volto-eea-website-theme/commit/deb23da846444cc96539697fd798429ae0abe89e)]
304
+ - Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`f1fffc5`](https://github.com/eea/volto-eea-website-theme/commit/f1fffc5db96725440863d545580b4e76cce4b796)]
265
305
  ### [1.5.0](https://github.com/eea/volto-eea-website-theme/compare/1.4.2...1.5.0) - 9 January 2023
266
306
 
267
307
  #### :hammer_and_wrench: Others
@@ -295,6 +335,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
295
335
 
296
336
  - Release 1.4.0 [Alin Voinea - [`bd42a0d`](https://github.com/eea/volto-eea-website-theme/commit/bd42a0d26e928cac5d99933194755da3db06b341)]
297
337
  - bump version to use as volto-eea-design-system [David Ichim - [`f4be047`](https://github.com/eea/volto-eea-website-theme/commit/f4be047328b46399b03b612d378b18aaf82e7dc1)]
338
+ - Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`9b7cfef`](https://github.com/eea/volto-eea-website-theme/commit/9b7cfefb4d34fc1c948015e491feb370f9795bd8)]
298
339
  - test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`df252a9`](https://github.com/eea/volto-eea-website-theme/commit/df252a9bfed0bb86cadf53c59dd1603b1e2cd822)]
299
340
  ### [1.3.2](https://github.com/eea/volto-eea-website-theme/compare/1.3.1...1.3.2) - 16 December 2022
300
341
 
@@ -304,6 +345,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
304
345
 
305
346
  #### :hammer_and_wrench: Others
306
347
 
348
+ - Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`a43c658`](https://github.com/eea/volto-eea-website-theme/commit/a43c658a7920c8df95e763b9a637f38ce77eba2c)]
307
349
  - Better razzle.config [Tiberiu Ichim - [`81dbf48`](https://github.com/eea/volto-eea-website-theme/commit/81dbf48815fb27facb4f82c9b764540fdf188b2e)]
308
350
  - Better razzle.config [Tiberiu Ichim - [`7bc9da2`](https://github.com/eea/volto-eea-website-theme/commit/7bc9da2cd837ab62a95cd29979cdd9b0055b7d67)]
309
351
  ### [1.3.1](https://github.com/eea/volto-eea-website-theme/compare/1.3.0...1.3.1) - 28 November 2022
@@ -312,6 +354,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
312
354
 
313
355
  - feat(Footer): Bring back footer contacts extra actions - refs #151856 [Alin Voinea - [`6c19413`](https://github.com/eea/volto-eea-website-theme/commit/6c194139420c9fd847692d180db1c1593e2483de)]
314
356
 
357
+ #### :hammer_and_wrench: Others
358
+
359
+ - yarn 3 [Alin Voinea - [`ea7a709`](https://github.com/eea/volto-eea-website-theme/commit/ea7a7094945312776e9b6f44e371178603e92139)]
315
360
  ### [1.3.0](https://github.com/eea/volto-eea-website-theme/compare/1.2.0...1.3.0) - 22 November 2022
316
361
 
317
362
  #### :rocket: New Features
@@ -352,6 +397,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
352
397
  - Add subsite class to body [Tiberiu Ichim - [`74d700f`](https://github.com/eea/volto-eea-website-theme/commit/74d700fbfd6249a8604762a7e4e49cce857db0f3)]
353
398
  - Add subsite info to header [Tiberiu Ichim - [`47daf8b`](https://github.com/eea/volto-eea-website-theme/commit/47daf8bb6374a1222040626b19d4154df7ba1b83)]
354
399
  - fix eslint [Miu Razvan - [`eb8d0a7`](https://github.com/eea/volto-eea-website-theme/commit/eb8d0a790bc70c0aae256c6ff35f63c4885f338e)]
400
+ - Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`cc578a4`](https://github.com/eea/volto-eea-website-theme/commit/cc578a413b205a8e61e091fab3a88f94cedefc89)]
355
401
  ### [1.1.0](https://github.com/eea/volto-eea-website-theme/compare/1.0.0...1.1.0) - 28 October 2022
356
402
 
357
403
  #### :nail_care: Enhancements
@@ -399,6 +445,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
399
445
 
400
446
  #### :hammer_and_wrench: Others
401
447
 
448
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`33b56ac`](https://github.com/eea/volto-eea-website-theme/commit/33b56acb13fbaf0c5b79e8fc6e13c4b699c79c90)]
402
449
  ### [0.7.3](https://github.com/eea/volto-eea-website-theme/compare/0.7.2...0.7.3) - 22 September 2022
403
450
 
404
451
  #### :hammer_and_wrench: Others
@@ -666,6 +713,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
666
713
  - Header refactor, add custom logo #5 [ichim-david - [`4950235`](https://github.com/eea/volto-eea-website-theme/commit/49502358105437cfeac3b144e6d301cb59aa2346)]
667
714
  - Update footer.config with new publication card component [ichim-david - [`2e38e9a`](https://github.com/eea/volto-eea-website-theme/commit/2e38e9a417f835009d60c80d4eb4b30229f55e45)]
668
715
  - feature(breadcrumbs): implement eea-design-system breadcrumb as Volto component #32 #7 [ichim-david - [`181af41`](https://github.com/eea/volto-eea-website-theme/commit/181af4125ce2b9ddac56dab4723cb11c26633221)]
716
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`da8ceb6`](https://github.com/eea/volto-eea-website-theme/commit/da8ceb68ea68bfbc9504e48ccd4d68277f11ab9a)]
669
717
  - use breadcrumbs from eea-design-system [nileshgulia1 - [`db2f9e9`](https://github.com/eea/volto-eea-website-theme/commit/db2f9e9a4327420a3cce9a9903cd88549b129eab)]
670
718
  - Update theme.config [ichim-david - [`8eca4f4`](https://github.com/eea/volto-eea-website-theme/commit/8eca4f40397a4aeca6d39029c92db78968d37064)]
671
719
  - Added keyContent component to theme.config [ichim-david - [`d86f202`](https://github.com/eea/volto-eea-website-theme/commit/d86f202d0274d839487a88b51cae9a0e899beb23)]
@@ -707,4 +755,5 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
707
755
 
708
756
  #### :hammer_and_wrench: Others
709
757
 
758
+ - yarn bootstrap [Alin Voinea - [`6995e9e`](https://github.com/eea/volto-eea-website-theme/commit/6995e9e091f21fdbbdffa8a44fc0e2c626f6d46a)]
710
759
  - Initial commit [Alin Voinea - [`6a9c03a`](https://github.com/eea/volto-eea-website-theme/commit/6a9c03a7cebe71ca87e82cf58c42904063e9d8d3)]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-website-theme",
3
- "version": "1.13.0",
3
+ "version": "1.14.1",
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,32 @@
1
+ import React from 'react';
2
+ import { EditSchema } from './schema';
3
+ import { BlockDataForm, SidebarPortal } from '@plone/volto/components';
4
+ import LayoutSettingsView from './LayoutSettingsView';
5
+ import './edit.less';
6
+
7
+ const LayoutSettingsEdit = (props) => {
8
+ const schema = EditSchema();
9
+ return (
10
+ <>
11
+ <h3>Page layout settings</h3>
12
+ <LayoutSettingsView {...props} />
13
+ <SidebarPortal selected={props.selected}>
14
+ {props.selected && (
15
+ <BlockDataForm
16
+ title={schema.title}
17
+ schema={schema}
18
+ formData={props.data}
19
+ onChangeField={(id, value) => {
20
+ props.onChangeBlock(props.block, {
21
+ ...props.data,
22
+ [id]: value,
23
+ });
24
+ }}
25
+ />
26
+ )}
27
+ </SidebarPortal>
28
+ </>
29
+ );
30
+ };
31
+
32
+ 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,4 @@
1
+ #page-edit .block-editor-layoutSettings,
2
+ #page-add .block-editor-layoutSettings {
3
+ display: none;
4
+ }
@@ -0,0 +1,24 @@
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: ({ properties }) => {
16
+ return !!properties['@type'];
17
+ },
18
+ mostUsed: true,
19
+ blockHasOwnFocusManagement: true,
20
+ sidebarTab: 1,
21
+ };
22
+
23
+ return config;
24
+ };
@@ -0,0 +1,31 @@
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'],
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
+ },
30
+ };
31
+ };
@@ -76,6 +76,18 @@ export default {
76
76
  },
77
77
  copyrightIcon: {
78
78
  title: 'Icon',
79
+ description: (
80
+ <>
81
+ Ex. ri-copyright-line. See{' '}
82
+ <a
83
+ target="_blank"
84
+ rel="noopener noreferrer"
85
+ href="https://eea.github.io/volto-eea-design-system/docs/webdev/Guidelines/iconography/#icon-set"
86
+ >
87
+ Remix Icon set
88
+ </a>
89
+ </>
90
+ ),
79
91
  default: 'ri-copyright-line',
80
92
  },
81
93
  copyrightPosition: {
@@ -4,43 +4,49 @@ import './draft.css';
4
4
  import { BodyClass } from '@plone/volto/helpers';
5
5
  import { withRouter } from 'react-router-dom';
6
6
  import { compose } from 'redux';
7
- import { runtimeConfig } from '@plone/volto/runtime_config';
8
7
  import { flattenToAppURL } from '@plone/volto/helpers';
9
8
 
10
- const removeTrailingSlash = (str) => {
11
- return str.replace(/\/+$/, '');
12
- };
13
-
14
9
  /**
15
- * The review_state and id don't change everytime the page is changed and because of that the draft background
16
- * will apear on pages that shouldn't have it. The RAZZLE_DISABLE_DRAFT_WATERMARK varible from ENV file should have two possible values:
17
- * "Hide-No-Workflow" and "Hide-All". If the variable is not present, it should follow the current logic(show the draft image everywhere),
18
- * if the value is "Hide-No-Workflow", then the draft image is not shown on pages like login or controlpanel and if the value is "Hide-All", then
19
- * the draft image is not visible at all.
20
- * For example, if the current page is /datatable (that has the draft background) and then we go to Content Types page,
21
- * the review_state and id will be the same as the ones from /datatable, so the draft background will still be present. By checking
22
- * if the pathname from (from withRouter) is different than the one from state.content.data and based on the varible from ENV,
23
- * we decide if the draft backgound can be present or not.
24
10
  * @param {Object} props
25
11
  * @returns
26
12
  */
13
+
14
+ const removeTrailingSlash = (str) => {
15
+ return str.replace(/\/+$/, '');
16
+ };
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
+ };
27
44
  const DraftBackground = (props) => {
28
- const draftClass = `wf-state-${props.review_state}`;
29
- const razzleDraft =
30
- runtimeConfig['RAZZLE_DISABLE_DRAFT_WATERMARK'] || 'default';
31
- const isReviewableStateComponent =
32
- props.review_state &&
33
- props.contentId === removeTrailingSlash(props.pathname);
34
-
35
- const draftOptions = {
36
- 'Hide-All': 'wf-state-published',
37
- 'Hide-No-Workflow': isReviewableStateComponent
38
- ? draftClass
39
- : 'wf-state-published',
40
- default: draftClass,
41
- };
42
-
43
- return <BodyClass className={draftOptions[razzleDraft]} />;
45
+ let draftClass = 'wf-state-is-draft';
46
+ if (checkIfPublished(props)) {
47
+ draftClass = '';
48
+ }
49
+ return draftClass ? <BodyClass className={draftClass} /> : '';
44
50
  };
45
51
 
46
52
  export default compose(
@@ -1,3 +1,3 @@
1
- .view-viewview:not(.wf-state-published) .content-area {
1
+ .view-viewview.wf-state-is-draft {
2
2
  background-image: url('draft.png') !important;
3
3
  }
@@ -112,6 +112,18 @@ export function ImageSchema({ formData, intl }) {
112
112
  },
113
113
  copyrightIcon: {
114
114
  title: 'Icon',
115
+ description: (
116
+ <>
117
+ Ex. ri-copyright-line. See{' '}
118
+ <a
119
+ target="_blank"
120
+ rel="noopener noreferrer"
121
+ href="https://eea.github.io/volto-eea-design-system/docs/webdev/Guidelines/iconography/#icon-set"
122
+ >
123
+ Remix Icon set
124
+ </a>
125
+ </>
126
+ ),
115
127
  default: 'ri-copyright-line',
116
128
  },
117
129
  copyrightPosition: {
@@ -91,6 +91,18 @@ export function LeadImageSchema({ formData, intl }) {
91
91
  },
92
92
  copyrightIcon: {
93
93
  title: 'Icon',
94
+ description: (
95
+ <>
96
+ Ex. ri-copyright-line. See{' '}
97
+ <a
98
+ target="_blank"
99
+ rel="noopener noreferrer"
100
+ href="https://eea.github.io/volto-eea-design-system/docs/webdev/Guidelines/iconography/#icon-set"
101
+ >
102
+ Remix Icon set
103
+ </a>
104
+ </>
105
+ ),
94
106
  default: 'ri-copyright-line',
95
107
  },
96
108
  copyrightPosition: {
@@ -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';
@@ -74,6 +76,11 @@ const applyConfig = (config) => {
74
76
  }
75
77
  }
76
78
 
79
+ // Apply columns block customization
80
+ if (config.blocks.blocksConfig.columnsBlock) {
81
+ config.blocks.blocksConfig.columnsBlock.available_colors = eea.colors;
82
+ }
83
+
77
84
  // Description block custom CSS
78
85
  config.blocks.blocksConfig.description.className =
79
86
  'documentDescription eea callout';
@@ -199,6 +206,59 @@ const applyConfig = (config) => {
199
206
  },
200
207
  ];
201
208
 
209
+ // Grid/Teaser block (kitconcept)
210
+ if (config.blocks.blocksConfig.__grid) {
211
+ config.blocks.blocksConfig.__grid.restricted = true;
212
+ }
213
+ if (config.blocks.blocksConfig.imagesGrid) {
214
+ config.blocks.blocksConfig.imagesGrid.restricted = true;
215
+ }
216
+ if (config.blocks.blocksConfig.teaser) {
217
+ config.blocks.blocksConfig.teaser.restricted = true;
218
+ }
219
+
220
+ // layout settings
221
+ config = [installLayoutSettingsBlock].reduce(
222
+ (acc, apply) => apply(acc),
223
+ config,
224
+ );
225
+
226
+ // Group
227
+ if (config.blocks.blocksConfig.group) {
228
+ config.blocks.blocksConfig.group.schemaEnhancer = addStylingFieldsetSchemaEnhancer;
229
+ }
230
+
231
+ // Columns
232
+ if (config.blocks.blocksConfig.columnsBlock) {
233
+ config.blocks.blocksConfig.columnsBlock.mostUsed = true;
234
+ config.blocks.blocksConfig.columnsBlock.schemaEnhancer = addStylingFieldsetSchemaEnhancer;
235
+ }
236
+
237
+ // Listing
238
+ if (config.blocks.blocksConfig.listing) {
239
+ config.blocks.blocksConfig.listing.title = 'Listing (Content)';
240
+ config.blocks.blocksConfig.listing.schemaEnhancer = addStylingFieldsetSchemaEnhancer;
241
+ }
242
+
243
+ // Block chooser
244
+ config.blocks.blocksConfig.image.mostUsed = false;
245
+ config.blocks.blocksConfig.video.mostUsed = false;
246
+
247
+ // Divider
248
+ if (config.blocks.blocksConfig.dividerBlock) {
249
+ config.blocks.blocksConfig.dividerBlock.mostUsed = true;
250
+ }
251
+
252
+ // Call to Action
253
+ if (config.blocks.blocksConfig.callToActionBlock) {
254
+ config.blocks.blocksConfig.callToActionBlock.mostUsed = true;
255
+ }
256
+
257
+ // Accordion
258
+ if (config.blocks.blocksConfig.accordion) {
259
+ config.blocks.blocksConfig.accordion.mostUsed = true;
260
+ }
261
+
202
262
  // Custom blocks: Title
203
263
  return [installCustomTitle].reduce((acc, apply) => apply(acc), config);
204
264
  };