@eeacms/volto-eea-website-policy 1.0.0 → 1.0.2
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/.project.eslintrc.js +3 -1
- package/CHANGELOG.md +20 -1
- package/package.json +1 -1
- package/src/components/Blocks/icons/image-narrow.svg +5 -0
- package/src/components/Blocks/schema.js +51 -0
- package/src/customizations/volto/components/manage/Toolbar/Toolbar.jsx +11 -2
- package/src/index.js +7 -0
package/.project.eslintrc.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const path = require('path');
|
|
3
3
|
|
|
4
|
-
const projectRootPath = fs.
|
|
4
|
+
const projectRootPath = fs.existsSync('./project')
|
|
5
|
+
? fs.realpathSync('./project')
|
|
6
|
+
: fs.realpathSync('./../../../');
|
|
5
7
|
const packageJson = require(path.join(projectRootPath, 'package.json'));
|
|
6
8
|
const jsConfig = require(path.join(projectRootPath, 'jsconfig.json')).compilerOptions;
|
|
7
9
|
|
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,23 @@ 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.0.
|
|
7
|
+
### [1.0.2](https://github.com/eea/volto-eea-website-policy/compare/1.0.1...1.0.2) - 16 November 2022
|
|
8
|
+
|
|
9
|
+
#### :nail_care: Enhancements
|
|
10
|
+
|
|
11
|
+
- change(policy): use image-fit for container option and enabled styling schema enhancer for group block [David Ichim - [`8132bae`](https://github.com/eea/volto-eea-website-policy/commit/8132baea590042390f56d26c1acf4f26b0ac33a7)]
|
|
12
|
+
- change(policy): added styling schema as a block enhancer useful for several packages [David Ichim - [`1cc294f`](https://github.com/eea/volto-eea-website-policy/commit/1cc294f0512db3cbd06e9951ab9d4893e0899444)]
|
|
13
|
+
|
|
14
|
+
#### :hammer_and_wrench: Others
|
|
15
|
+
|
|
16
|
+
- test(estlint): Fix .project.eslintrc.js [Alin Voinea - [`e6b49b6`](https://github.com/eea/volto-eea-website-policy/commit/e6b49b678e2917915332203fe34e8f6cc4f96372)]
|
|
17
|
+
### [1.0.1](https://github.com/eea/volto-eea-website-policy/compare/1.0.0...1.0.1) - 28 October 2022
|
|
18
|
+
|
|
19
|
+
#### :nail_care: Enhancements
|
|
20
|
+
|
|
21
|
+
- refactor(customizations): Upgrade Toolbar customization to volto 16 alpha 45 [Alin Voinea - [`08b14d6`](https://github.com/eea/volto-eea-website-policy/commit/08b14d64958316f434f79dc4b3308164a3f1df38)]
|
|
22
|
+
|
|
23
|
+
## [1.0.0](https://github.com/eea/volto-eea-website-policy/compare/0.4.2...1.0.0) - 28 October 2022
|
|
8
24
|
|
|
9
25
|
#### :nail_care: Enhancements
|
|
10
26
|
|
|
@@ -24,6 +40,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
24
40
|
|
|
25
41
|
#### :hammer_and_wrench: Others
|
|
26
42
|
|
|
43
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`d153f54`](https://github.com/eea/volto-eea-website-policy/commit/d153f54e55e918fa4746e05488c734624eaf14a9)]
|
|
27
44
|
### [0.4.0](https://github.com/eea/volto-eea-website-policy/compare/0.3.3...0.4.0) - 19 September 2022
|
|
28
45
|
|
|
29
46
|
#### :hammer_and_wrench: Others
|
|
@@ -99,6 +116,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
99
116
|
- format index.js [Andrei Grigore - [`db4481a`](https://github.com/eea/volto-eea-website-policy/commit/db4481aeeba59a769272659f33278c902fc69bec)]
|
|
100
117
|
- Update index.js [Alexandru Ghica - [`dc09886`](https://github.com/eea/volto-eea-website-policy/commit/dc0988640a76a9914381b120f58bb61a9ab1eb39)]
|
|
101
118
|
- Added externalRoutes [Alexandru Ghica - [`b68135b`](https://github.com/eea/volto-eea-website-policy/commit/b68135b013fafa93a41ea602ea2fad30879abe0f)]
|
|
119
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`575cca6`](https://github.com/eea/volto-eea-website-policy/commit/575cca674602ca2e1c2a41300c47ba594ff49aa0)]
|
|
102
120
|
### [0.1.1](https://github.com/eea/volto-eea-website-policy/compare/0.1.0...0.1.1) - 4 March 2022
|
|
103
121
|
|
|
104
122
|
#### :hammer_and_wrench: Others
|
|
@@ -111,4 +129,5 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
111
129
|
|
|
112
130
|
#### :hammer_and_wrench: Others
|
|
113
131
|
|
|
132
|
+
- yarn bootstrap [Alin Voinea - [`9b4d197`](https://github.com/eea/volto-eea-website-policy/commit/9b4d197cbc7992566cb36524d190078d5ad21a44)]
|
|
114
133
|
- Initial commit [Alin Voinea - [`3800692`](https://github.com/eea/volto-eea-website-policy/commit/3800692f7a4de6460815bd6061facacb986cbef0)]
|
package/package.json
CHANGED
|
@@ -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>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { cloneDeep } from 'lodash';
|
|
2
|
+
import imageNarrowSVG from '@eeacms/volto-eea-website-policy/components/Blocks/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
|
+
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
|
+
};
|
|
@@ -38,6 +38,7 @@ import folderSVG from '@plone/volto/icons/folder.svg';
|
|
|
38
38
|
import addSVG from '@plone/volto/icons/add-document.svg';
|
|
39
39
|
import moreSVG from '@plone/volto/icons/more.svg';
|
|
40
40
|
import userSVG from '@plone/volto/icons/user.svg';
|
|
41
|
+
import backSVG from '@plone/volto/icons/back.svg';
|
|
41
42
|
import clearSVG from '@plone/volto/icons/clear.svg';
|
|
42
43
|
|
|
43
44
|
const messages = defineMessages({
|
|
@@ -272,6 +273,14 @@ class Toolbar extends Component {
|
|
|
272
273
|
showMenu: !state.showMenu,
|
|
273
274
|
menuStyle: { bottom: 0 },
|
|
274
275
|
}));
|
|
276
|
+
} else if (selector === 'more') {
|
|
277
|
+
this.setState((state) => ({
|
|
278
|
+
showMenu: !state.showMenu,
|
|
279
|
+
menuStyle: {
|
|
280
|
+
overflow: 'visible',
|
|
281
|
+
top: 0,
|
|
282
|
+
},
|
|
283
|
+
}));
|
|
275
284
|
} else {
|
|
276
285
|
this.setState((state) => ({
|
|
277
286
|
showMenu: !state.showMenu,
|
|
@@ -467,8 +476,8 @@ class Toolbar extends Component {
|
|
|
467
476
|
)}
|
|
468
477
|
>
|
|
469
478
|
<Icon
|
|
470
|
-
name={
|
|
471
|
-
className="
|
|
479
|
+
name={backSVG}
|
|
480
|
+
className="circled"
|
|
472
481
|
size="30px"
|
|
473
482
|
title={this.props.intl.formatMessage(messages.back)}
|
|
474
483
|
/>
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { runtimeConfig } from '@plone/volto/runtime_config';
|
|
2
2
|
import installCallout from '@plone/volto-slate/editor/plugins/Callout';
|
|
3
3
|
import installContextNavigationBlock from '@eeacms/volto-eea-website-policy/components/Blocks/ContextNavigation';
|
|
4
|
+
import { addStylingFieldsetSchemaEnhancer } from '@eeacms/volto-eea-website-policy/components/Blocks/schema';
|
|
4
5
|
|
|
5
6
|
const applyConfig = (config) => {
|
|
6
7
|
// if (process.env.NODE_ENV === 'production') {
|
|
@@ -87,9 +88,15 @@ const applyConfig = (config) => {
|
|
|
87
88
|
config.blocks.blocksConfig.callToActionBlock.mostUsed = true;
|
|
88
89
|
}
|
|
89
90
|
|
|
91
|
+
// Group
|
|
92
|
+
if (config.blocks.blocksConfig.group) {
|
|
93
|
+
config.blocks.blocksConfig.group.schemaEnhancer = addStylingFieldsetSchemaEnhancer;
|
|
94
|
+
}
|
|
95
|
+
|
|
90
96
|
// Columns
|
|
91
97
|
if (config.blocks.blocksConfig.columnsBlock) {
|
|
92
98
|
config.blocks.blocksConfig.columnsBlock.mostUsed = true;
|
|
99
|
+
config.blocks.blocksConfig.columnsBlock.schemaEnhancer = addStylingFieldsetSchemaEnhancer;
|
|
93
100
|
}
|
|
94
101
|
|
|
95
102
|
// Accordion
|