@eeacms/volto-eea-website-theme 0.7.5 → 0.7.7
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 +16 -2
- package/package.json +3 -2
- package/src/config.js +15 -0
- package/src/customizations/@eeacms/volto-block-style/StyleWrapper/schema.js +20 -0
- package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/HeaderSearchPopUp.js +43 -18
- package/src/index.js +23 -1
- package/theme/theme.config +1 -0
package/CHANGELOG.md
CHANGED
@@ -4,11 +4,25 @@ 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
|
-
### [0.7.
|
7
|
+
### [0.7.7](https://github.com/eea/volto-eea-website-theme/compare/0.7.6...0.7.7) - 19 October 2022
|
8
|
+
|
9
|
+
#### :hammer_and_wrench: Others
|
10
|
+
|
11
|
+
- feature(theme): added context copyright component [g-stamatis - [`ab4079c`](https://github.com/eea/volto-eea-website-theme/commit/ab4079c2be9bc7eff46f84ef83d552431f8e79bc)]
|
12
|
+
- Fix hardcoded search link [kreafox - [`c42d32e`](https://github.com/eea/volto-eea-website-theme/commit/c42d32eee8f1e0974da1526dccb8ac12e92d4bef)]
|
13
|
+
- Better handling of active view [kreafox - [`944ce20`](https://github.com/eea/volto-eea-website-theme/commit/944ce20fa3cc10beb02d05cf1f8261d3988520ac)]
|
14
|
+
### [0.7.6](https://github.com/eea/volto-eea-website-theme/compare/0.7.5...0.7.6) - 5 October 2022
|
15
|
+
|
16
|
+
#### :rocket: New Features
|
17
|
+
|
18
|
+
- feat(StyleWrapper): Re-enable textAlign and fontWeight - refs #148213 [Alin Voinea - [`98aba2a`](https://github.com/eea/volto-eea-website-theme/commit/98aba2a17bc876eedbe0547de12eb99024c5e2f7)]
|
8
19
|
|
9
20
|
#### :bug: Bug Fixes
|
10
21
|
|
11
|
-
- fix(
|
22
|
+
- fix(List): Align slate list ul/ol to EEA Design System - refs #155248 [Alin Voinea - [`e4c3ab0`](https://github.com/eea/volto-eea-website-theme/commit/e4c3ab01850dac871fc274ef800cdb55f84b0118)]
|
23
|
+
- fix(accordion): Remove styled, fluid and set default theme secondary - refs #153783 [Alin Voinea - [`8ebb9ac`](https://github.com/eea/volto-eea-website-theme/commit/8ebb9ac385ab8030a47988d9750b5eba38cbdeb9)]
|
24
|
+
|
25
|
+
### [0.7.5](https://github.com/eea/volto-eea-website-theme/compare/0.7.4...0.7.5) - 27 September 2022
|
12
26
|
|
13
27
|
### [0.7.4](https://github.com/eea/volto-eea-website-theme/compare/0.7.3...0.7.4) - 27 September 2022
|
14
28
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@eeacms/volto-eea-website-theme",
|
3
|
-
"version": "0.7.
|
3
|
+
"version": "0.7.7",
|
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",
|
@@ -27,7 +27,8 @@
|
|
27
27
|
},
|
28
28
|
"devDependencies": {
|
29
29
|
"@cypress/code-coverage": "^3.9.5",
|
30
|
-
"babel-plugin-transform-class-properties": "^6.24.1"
|
30
|
+
"babel-plugin-transform-class-properties": "^6.24.1",
|
31
|
+
"md5": "^2.3.0"
|
31
32
|
},
|
32
33
|
"scripts": {
|
33
34
|
"release": "release-it",
|
package/src/config.js
CHANGED
@@ -248,6 +248,21 @@ export const websiteTitle = 'Site';
|
|
248
248
|
export const organisationName = 'European Environment Agency';
|
249
249
|
export const logoTargetUrl = '/';
|
250
250
|
|
251
|
+
export const headerSearchBox = [
|
252
|
+
{
|
253
|
+
isDefault: true,
|
254
|
+
path: '/en/advanced-search',
|
255
|
+
placeholder: 'Search...',
|
256
|
+
},
|
257
|
+
{
|
258
|
+
path: '/en/datahub',
|
259
|
+
placeholder: 'Search Datahub...',
|
260
|
+
description:
|
261
|
+
'Looking for more information? Try searching the full EEA website content',
|
262
|
+
buttonTitle: 'Go to full site search',
|
263
|
+
},
|
264
|
+
];
|
265
|
+
|
251
266
|
export const colors = [
|
252
267
|
// Primary & shades
|
253
268
|
'#007B6C',
|
@@ -12,12 +12,32 @@ export const StyleSchema = () => {
|
|
12
12
|
title: 'Preset styles',
|
13
13
|
fields: ['style_name'],
|
14
14
|
},
|
15
|
+
{
|
16
|
+
id: 'text',
|
17
|
+
title: 'Text',
|
18
|
+
fields: ['textAlign', 'fontWeight'],
|
19
|
+
},
|
15
20
|
],
|
16
21
|
properties: {
|
17
22
|
style_name: {
|
18
23
|
title: 'Style',
|
19
24
|
widget: 'style_select',
|
20
25
|
},
|
26
|
+
textAlign: {
|
27
|
+
title: 'Text align',
|
28
|
+
widget: 'style_text_align',
|
29
|
+
},
|
30
|
+
fontWeight: {
|
31
|
+
title: 'Font weight',
|
32
|
+
description: 'The weight (or boldness) of the font',
|
33
|
+
choices: [
|
34
|
+
['300', 'Light'],
|
35
|
+
['400', 'Regular'],
|
36
|
+
['500', 'Medium'],
|
37
|
+
['600', 'SemiBold'],
|
38
|
+
['700', 'Bold'],
|
39
|
+
],
|
40
|
+
},
|
21
41
|
},
|
22
42
|
required: [],
|
23
43
|
};
|
@@ -2,14 +2,23 @@ import React from 'react';
|
|
2
2
|
import { Container, Input } from 'semantic-ui-react';
|
3
3
|
import { withRouter } from 'react-router-dom';
|
4
4
|
import { useClickOutside } from '@eeacms/volto-eea-design-system/helpers';
|
5
|
+
import config from '@plone/volto/registry';
|
5
6
|
|
6
7
|
function HeaderSearchPopUp({
|
7
8
|
history,
|
9
|
+
location,
|
8
10
|
onClose,
|
9
11
|
searchInputRef,
|
10
12
|
triggerRefs = [],
|
11
13
|
}) {
|
12
14
|
const nodeRef = React.useRef();
|
15
|
+
const { eea } = config.settings;
|
16
|
+
const defaultView = eea.headerSearchBox.filter((v) => v.isDefault);
|
17
|
+
const localView = eea.headerSearchBox.filter((v) =>
|
18
|
+
location.pathname.includes(v.path),
|
19
|
+
);
|
20
|
+
const activeView = localView.length > 0 ? localView[0] : defaultView[0];
|
21
|
+
|
13
22
|
const [text, setText] = React.useState('');
|
14
23
|
|
15
24
|
useClickOutside({ targetRefs: [nodeRef, ...triggerRefs], callback: onClose });
|
@@ -20,7 +29,7 @@ function HeaderSearchPopUp({
|
|
20
29
|
};
|
21
30
|
|
22
31
|
const onSubmit = (event) => {
|
23
|
-
history.push(
|
32
|
+
history.push(`${activeView.path}?q=${text}`);
|
24
33
|
|
25
34
|
if (window?.searchContext?.resetSearch) {
|
26
35
|
window.searchContext.resetSearch({ searchTerm: text });
|
@@ -31,24 +40,40 @@ function HeaderSearchPopUp({
|
|
31
40
|
};
|
32
41
|
|
33
42
|
return (
|
34
|
-
<
|
35
|
-
<
|
36
|
-
<
|
37
|
-
<
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
43
|
+
<div id="search-box" ref={nodeRef}>
|
44
|
+
<form method="get" onSubmit={onSubmit}>
|
45
|
+
<Container>
|
46
|
+
<div className="wrapper">
|
47
|
+
<Input
|
48
|
+
ref={searchInputRef}
|
49
|
+
className="search"
|
50
|
+
onChange={onChangeText}
|
51
|
+
icon={{
|
52
|
+
className: 'ri-search-line',
|
53
|
+
link: true,
|
54
|
+
onClick: onSubmit,
|
55
|
+
}}
|
56
|
+
placeholder={activeView.placeholder}
|
57
|
+
fluid
|
58
|
+
/>
|
59
|
+
</div>
|
60
|
+
</Container>
|
61
|
+
</form>
|
62
|
+
{(activeView.description || activeView.buttonTitle) && (
|
63
|
+
<div className="advanced-search">
|
64
|
+
<Container>
|
65
|
+
<p>{activeView.description}</p>
|
66
|
+
<a
|
67
|
+
href={defaultView[0].path}
|
68
|
+
className="ui button white inverted"
|
69
|
+
title="Advanced search"
|
70
|
+
>
|
71
|
+
{activeView.buttonTitle}
|
72
|
+
</a>
|
73
|
+
</Container>
|
49
74
|
</div>
|
50
|
-
|
51
|
-
</
|
75
|
+
)}
|
76
|
+
</div>
|
52
77
|
);
|
53
78
|
}
|
54
79
|
|
package/src/index.js
CHANGED
@@ -10,6 +10,7 @@ import { Icon } from '@plone/volto/components';
|
|
10
10
|
import paintSVG from '@plone/volto/icons/paint.svg';
|
11
11
|
import contentBoxSVG from './icons/content-box.svg';
|
12
12
|
import voltoCustomMiddleware from './middleware/voltoCustom';
|
13
|
+
import { List } from 'semantic-ui-react';
|
13
14
|
|
14
15
|
const applyConfig = (config) => {
|
15
16
|
// EEA specific settings
|
@@ -28,6 +29,8 @@ const applyConfig = (config) => {
|
|
28
29
|
// Apply accordion block customization
|
29
30
|
if (config.blocks.blocksConfig.accordion) {
|
30
31
|
config.blocks.blocksConfig.accordion.semanticIcon = 'ri-arrow-down-s-line';
|
32
|
+
config.blocks.blocksConfig.accordion.options = {};
|
33
|
+
config.blocks.blocksConfig.accordion.defaults.theme = 'secondary';
|
31
34
|
}
|
32
35
|
|
33
36
|
// Apply tabs block customization
|
@@ -76,8 +79,27 @@ const applyConfig = (config) => {
|
|
76
79
|
},
|
77
80
|
];
|
78
81
|
|
79
|
-
// Slate StyleMenu configuration
|
80
82
|
if (config.settings.slate) {
|
83
|
+
// Align Slate Lists to EEA Design System
|
84
|
+
config.settings.slate.elements.ul = ({ attributes, children }) => (
|
85
|
+
<List bulleted as="ul" {...attributes}>
|
86
|
+
{children}
|
87
|
+
</List>
|
88
|
+
);
|
89
|
+
|
90
|
+
config.settings.slate.elements.ol = ({ attributes, children }) => (
|
91
|
+
<List ordered as="ol" {...attributes}>
|
92
|
+
{children}
|
93
|
+
</List>
|
94
|
+
);
|
95
|
+
|
96
|
+
config.settings.slate.elements.li = ({ attributes, children }) => (
|
97
|
+
<List.Item as="li" {...attributes}>
|
98
|
+
{children}
|
99
|
+
</List.Item>
|
100
|
+
);
|
101
|
+
|
102
|
+
// Slate StyleMenu configuration
|
81
103
|
config.settings.slate.styleMenu = {
|
82
104
|
...(config.settings.slate.styleMenu || {}),
|
83
105
|
blockStyles: [
|