@eeacms/volto-eea-website-theme 1.14.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 +33 -3
- package/package.json +1 -1
- package/src/components/manage/Blocks/LayoutSettings/LayoutSettingsEdit.jsx +32 -0
- package/src/components/manage/Blocks/LayoutSettings/LayoutSettingsView.jsx +15 -0
- package/src/components/manage/Blocks/LayoutSettings/edit.less +4 -0
- package/src/components/manage/Blocks/LayoutSettings/index.js +24 -0
- package/src/components/manage/Blocks/LayoutSettings/schema.js +31 -0
- package/src/components/theme/DraftBackground/DraftBackground.jsx +29 -9
- package/src/customizations/volto/components/theme/Header/Header.jsx +1 -0
- package/src/helpers/index.js +1 -0
- package/src/helpers/schema-utils.js +67 -0
- package/src/icons/image-narrow.svg +5 -0
- package/src/index.js +55 -0
package/CHANGELOG.md
CHANGED
@@ -4,6 +4,28 @@ 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)]
|
7
29
|
### [1.14.0](https://github.com/eea/volto-eea-website-theme/compare/1.13.0...1.14.0) - 10 April 2023
|
8
30
|
|
9
31
|
#### :rocket: New Features
|
@@ -20,9 +42,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
20
42
|
|
21
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)]
|
22
44
|
|
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
45
|
### [1.13.0](https://github.com/eea/volto-eea-website-theme/compare/1.12.0...1.13.0) - 27 March 2023
|
27
46
|
|
28
47
|
#### :rocket: New Features
|
@@ -135,6 +154,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
135
154
|
|
136
155
|
#### :hammer_and_wrench: Others
|
137
156
|
|
157
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`6c5e2f8`](https://github.com/eea/volto-eea-website-theme/commit/6c5e2f80456e2061d9e9c15fd0a0b91b9ac70568)]
|
138
158
|
### [1.9.1](https://github.com/eea/volto-eea-website-theme/compare/1.9.0...1.9.1) - 28 February 2023
|
139
159
|
|
140
160
|
#### :bug: Bug Fixes
|
@@ -281,6 +301,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
281
301
|
|
282
302
|
- For some reasons types is a string [Alin Voinea - [`3769a09`](https://github.com/eea/volto-eea-website-theme/commit/3769a0981181d5b633f3498daebbe96be8b4b833)]
|
283
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)]
|
284
305
|
### [1.5.0](https://github.com/eea/volto-eea-website-theme/compare/1.4.2...1.5.0) - 9 January 2023
|
285
306
|
|
286
307
|
#### :hammer_and_wrench: Others
|
@@ -314,6 +335,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
314
335
|
|
315
336
|
- Release 1.4.0 [Alin Voinea - [`bd42a0d`](https://github.com/eea/volto-eea-website-theme/commit/bd42a0d26e928cac5d99933194755da3db06b341)]
|
316
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)]
|
317
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)]
|
318
340
|
### [1.3.2](https://github.com/eea/volto-eea-website-theme/compare/1.3.1...1.3.2) - 16 December 2022
|
319
341
|
|
@@ -323,6 +345,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
323
345
|
|
324
346
|
#### :hammer_and_wrench: Others
|
325
347
|
|
348
|
+
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`a43c658`](https://github.com/eea/volto-eea-website-theme/commit/a43c658a7920c8df95e763b9a637f38ce77eba2c)]
|
326
349
|
- Better razzle.config [Tiberiu Ichim - [`81dbf48`](https://github.com/eea/volto-eea-website-theme/commit/81dbf48815fb27facb4f82c9b764540fdf188b2e)]
|
327
350
|
- Better razzle.config [Tiberiu Ichim - [`7bc9da2`](https://github.com/eea/volto-eea-website-theme/commit/7bc9da2cd837ab62a95cd29979cdd9b0055b7d67)]
|
328
351
|
### [1.3.1](https://github.com/eea/volto-eea-website-theme/compare/1.3.0...1.3.1) - 28 November 2022
|
@@ -331,6 +354,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
331
354
|
|
332
355
|
- feat(Footer): Bring back footer contacts extra actions - refs #151856 [Alin Voinea - [`6c19413`](https://github.com/eea/volto-eea-website-theme/commit/6c194139420c9fd847692d180db1c1593e2483de)]
|
333
356
|
|
357
|
+
#### :hammer_and_wrench: Others
|
358
|
+
|
359
|
+
- yarn 3 [Alin Voinea - [`ea7a709`](https://github.com/eea/volto-eea-website-theme/commit/ea7a7094945312776e9b6f44e371178603e92139)]
|
334
360
|
### [1.3.0](https://github.com/eea/volto-eea-website-theme/compare/1.2.0...1.3.0) - 22 November 2022
|
335
361
|
|
336
362
|
#### :rocket: New Features
|
@@ -371,6 +397,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
371
397
|
- Add subsite class to body [Tiberiu Ichim - [`74d700f`](https://github.com/eea/volto-eea-website-theme/commit/74d700fbfd6249a8604762a7e4e49cce857db0f3)]
|
372
398
|
- Add subsite info to header [Tiberiu Ichim - [`47daf8b`](https://github.com/eea/volto-eea-website-theme/commit/47daf8bb6374a1222040626b19d4154df7ba1b83)]
|
373
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)]
|
374
401
|
### [1.1.0](https://github.com/eea/volto-eea-website-theme/compare/1.0.0...1.1.0) - 28 October 2022
|
375
402
|
|
376
403
|
#### :nail_care: Enhancements
|
@@ -418,6 +445,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
418
445
|
|
419
446
|
#### :hammer_and_wrench: Others
|
420
447
|
|
448
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`33b56ac`](https://github.com/eea/volto-eea-website-theme/commit/33b56acb13fbaf0c5b79e8fc6e13c4b699c79c90)]
|
421
449
|
### [0.7.3](https://github.com/eea/volto-eea-website-theme/compare/0.7.2...0.7.3) - 22 September 2022
|
422
450
|
|
423
451
|
#### :hammer_and_wrench: Others
|
@@ -685,6 +713,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
685
713
|
- Header refactor, add custom logo #5 [ichim-david - [`4950235`](https://github.com/eea/volto-eea-website-theme/commit/49502358105437cfeac3b144e6d301cb59aa2346)]
|
686
714
|
- Update footer.config with new publication card component [ichim-david - [`2e38e9a`](https://github.com/eea/volto-eea-website-theme/commit/2e38e9a417f835009d60c80d4eb4b30229f55e45)]
|
687
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)]
|
688
717
|
- use breadcrumbs from eea-design-system [nileshgulia1 - [`db2f9e9`](https://github.com/eea/volto-eea-website-theme/commit/db2f9e9a4327420a3cce9a9903cd88549b129eab)]
|
689
718
|
- Update theme.config [ichim-david - [`8eca4f4`](https://github.com/eea/volto-eea-website-theme/commit/8eca4f40397a4aeca6d39029c92db78968d37064)]
|
690
719
|
- Added keyContent component to theme.config [ichim-david - [`d86f202`](https://github.com/eea/volto-eea-website-theme/commit/d86f202d0274d839487a88b51cae9a0e899beb23)]
|
@@ -726,4 +755,5 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
726
755
|
|
727
756
|
#### :hammer_and_wrench: Others
|
728
757
|
|
758
|
+
- yarn bootstrap [Alin Voinea - [`6995e9e`](https://github.com/eea/volto-eea-website-theme/commit/6995e9e091f21fdbbdffa8a44fc0e2c626f6d46a)]
|
729
759
|
- Initial commit [Alin Voinea - [`6a9c03a`](https://github.com/eea/volto-eea-website-theme/commit/6a9c03a7cebe71ca87e82cf58c42904063e9d8d3)]
|
package/package.json
CHANGED
@@ -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,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
|
+
};
|
@@ -11,19 +11,39 @@ import { flattenToAppURL } from '@plone/volto/helpers';
|
|
11
11
|
* @returns
|
12
12
|
*/
|
13
13
|
|
14
|
-
const
|
15
|
-
return
|
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} /> : '';
|
@@ -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}
|
package/src/helpers/index.js
CHANGED
@@ -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';
|
@@ -204,6 +206,59 @@ const applyConfig = (config) => {
|
|
204
206
|
},
|
205
207
|
];
|
206
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
|
+
|
207
262
|
// Custom blocks: Title
|
208
263
|
return [installCustomTitle].reduce((acc, apply) => apply(acc), config);
|
209
264
|
};
|