@eeacms/volto-eea-website-theme 0.6.8 → 0.6.11

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,8 +4,34 @@ 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.6.11](https://github.com/eea/volto-eea-website-theme/compare/0.6.10...0.6.11)
8
+
9
+ - change(website): removed container from styles that implement content-box [`c513000`](https://github.com/eea/volto-eea-website-theme/commit/c513000ce374f3209f57a3d050c29a0fbff0916c)
10
+ - Optimize Content Box SVG [`ba0d417`](https://github.com/eea/volto-eea-website-theme/commit/ba0d417ad30bfb3994855716d0d387463317d24e)
11
+ - Add preview for Content Box preset styles [`cbed054`](https://github.com/eea/volto-eea-website-theme/commit/cbed05403113cb46bc2ed63dd9c47fc6168ac492)
12
+ - Remove pluggableStyles previewText as if creates confusion [`467320d`](https://github.com/eea/volto-eea-website-theme/commit/467320df0142e8058487df20da01af5d496f2f1b)
13
+
14
+ #### [0.6.10](https://github.com/eea/volto-eea-website-theme/compare/0.6.9...0.6.10)
15
+
16
+ > 16 June 2022
17
+
18
+ - fix(header): add homepage logic only on view and edit [`#42`](https://github.com/eea/volto-eea-website-theme/pull/42)
19
+ - Use window.searchContext.resetSearch for search widget [`#41`](https://github.com/eea/volto-eea-website-theme/pull/41)
20
+ - change(header): add homepage class also on edit page [`0a10847`](https://github.com/eea/volto-eea-website-theme/commit/0a108477a3a15f9d0e2172286837ddfd94e078fa)
21
+ - Use window.searchContext.resetSearch [`c3a968b`](https://github.com/eea/volto-eea-website-theme/commit/c3a968b91646102dad461541a1501b93a653e2c9)
22
+ - fix(header): homepage is now true only on view page [`a0618a7`](https://github.com/eea/volto-eea-website-theme/commit/a0618a74431a280c3ccb95597d7f771385fac2eb)
23
+
24
+ #### [0.6.9](https://github.com/eea/volto-eea-website-theme/compare/0.6.8...0.6.9)
25
+
26
+ > 14 June 2022
27
+
28
+ - Add custom styles: Content Box [`#40`](https://github.com/eea/volto-eea-website-theme/pull/40)
29
+
7
30
  #### [0.6.8](https://github.com/eea/volto-eea-website-theme/compare/0.6.7...0.6.8)
8
31
 
32
+ > 13 June 2022
33
+
34
+ - change(theme): added homepage and homepage inverted pages [`#39`](https://github.com/eea/volto-eea-website-theme/pull/39)
9
35
  - Fix HomepageView typo [`41582a3`](https://github.com/eea/volto-eea-website-theme/commit/41582a39f8e84cd3ef62d9ef302798627e8350f1)
10
36
  - fix import to please jslint [`b4a6555`](https://github.com/eea/volto-eea-website-theme/commit/b4a655548600ef9b9c8ecdd156d0062d4b54d00e)
11
37
  - change(header): added homepage and homepage_inverse views [`6df68d7`](https://github.com/eea/volto-eea-website-theme/commit/6df68d7a592d623af76c1036c38d2c480fc6ce88)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-website-theme",
3
- "version": "0.6.8",
3
+ "version": "0.6.11",
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",
@@ -16,6 +16,11 @@ function HeaderSearchPopUp({ history, onClose, triggerRefs = [] }) {
16
16
 
17
17
  const onSubmit = (event) => {
18
18
  history.push(`/en/advanced-search?q=${text}`);
19
+
20
+ if (window?.searchContext?.resetSearch) {
21
+ window.searchContext.resetSearch({ searchTerm: text });
22
+ }
23
+
19
24
  onClose();
20
25
  event.preventDefault();
21
26
  };
@@ -25,6 +25,7 @@ import eeaFlag from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/
25
25
 
26
26
  import config from '@plone/volto/registry';
27
27
  import { compose } from 'recompose';
28
+ import { BodyClass } from '@plone/volto/helpers';
28
29
 
29
30
  /**
30
31
  * EEA Specific Header component.
@@ -34,8 +35,18 @@ const EEAHeader = ({ pathname, token, items, history }) => {
34
35
  const translations = useSelector(
35
36
  (state) => state.content.data?.['@components']?.translations?.items,
36
37
  );
38
+
39
+ const router_pathname = useSelector((state) => {
40
+ return state.router?.location?.pathname || '';
41
+ });
42
+
37
43
  const isHomePageInverse = useSelector((state) => {
38
- return state.content?.data?.layout === 'homepage_inverse_view';
44
+ const layout = state.content?.data?.layout;
45
+ const has_home_layout = layout === 'homepage_inverse_view';
46
+ return (
47
+ has_home_layout &&
48
+ (pathname === router_pathname || router_pathname.endsWith('/edit'))
49
+ );
39
50
  });
40
51
 
41
52
  const { eea } = config.settings;
@@ -48,9 +59,9 @@ const EEAHeader = ({ pathname, token, items, history }) => {
48
59
 
49
60
  React.useEffect(() => {
50
61
  const { settings } = config;
51
- const base = getBaseUrl(pathname);
52
- if (!hasApiExpander('navigation', base)) {
53
- dispatch(getNavigation(base, settings.navDepth));
62
+ const base_url = getBaseUrl(pathname);
63
+ if (!hasApiExpander('navigation', base_url)) {
64
+ dispatch(getNavigation(base_url, settings.navDepth));
54
65
  }
55
66
  }, [pathname, dispatch]);
56
67
 
@@ -66,6 +77,7 @@ const EEAHeader = ({ pathname, token, items, history }) => {
66
77
 
67
78
  return (
68
79
  <Header menuItems={items}>
80
+ {isHomePageInverse && <BodyClass className="homepage" />}
69
81
  <Header.TopHeader>
70
82
  <Header.TopItem className="official-union">
71
83
  <Image src={eeaFlag} alt="eea flag"></Image>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+ <svg width="90mm" height="90mm" version="1.1" viewBox="0 0 90 90" xmlns="http://www.w3.org/2000/svg">
4
+ <text x="44.72715" y="38.463978" fill="#000000" font-family="sans-serif" font-size="16.933px" letter-spacing="0px" stroke-width=".26458" text-align="center" text-anchor="middle" word-spacing="0px" style="line-height:1.5" xml:space="preserve"><tspan x="44.72715" y="38.463978" text-align="center">Content</tspan><tspan x="44.72715" y="63.863926" text-align="center">Box</tspan></text>
5
+ </svg>
package/src/index.js CHANGED
@@ -6,12 +6,17 @@ import DraftBackground from '@eeacms/volto-eea-website-theme/components/theme/Dr
6
6
  import { TokenWidget } from '@eeacms/volto-eea-website-theme/components/theme/Widgets/TokenWidget';
7
7
  import HomePageView from '@eeacms/volto-eea-website-theme/components/theme/Homepage/HomePageView';
8
8
  import HomePageInverseView from '@eeacms/volto-eea-website-theme/components/theme/Homepage/HomePageInverseView';
9
+ import { Icon } from '@plone/volto/components';
10
+ import contentBoxSVG from './icons/content-box.svg';
9
11
 
10
12
  const applyConfig = (config) => {
13
+ // EEA specific settings
11
14
  config.settings.eea = {
12
15
  ...eea,
13
16
  ...(config.settings.eea || {}),
14
17
  };
18
+
19
+ // Homepage
15
20
  config.views.layoutViews = {
16
21
  homepage_view: HomePageView,
17
22
  homepage_inverse_view: HomePageInverseView,
@@ -51,8 +56,8 @@ const applyConfig = (config) => {
51
56
  },
52
57
  ];
53
58
 
59
+ // Custom CSS voltoCustom.css and Draft Background
54
60
  const appExtras = config.settings.appExtras || [];
55
-
56
61
  config.settings.appExtras = [
57
62
  ...appExtras,
58
63
  {
@@ -65,6 +70,69 @@ const applyConfig = (config) => {
65
70
  },
66
71
  ];
67
72
 
73
+ // Custom block styles
74
+ config.settings.previewText = '';
75
+ config.settings.pluggableStyles = [
76
+ ...(config.settings.pluggableStyles || []),
77
+ {
78
+ id: 'content-box-gray',
79
+ title: 'Default',
80
+ previewComponent: () => (
81
+ <Icon name={contentBoxSVG} size="88px" className="default" />
82
+ ),
83
+ viewComponent: (props) => {
84
+ return (
85
+ <div className="content-box">
86
+ <div className="content-box-inner">{props.children}</div>
87
+ </div>
88
+ );
89
+ },
90
+ },
91
+ {
92
+ id: 'content-box-primary',
93
+ title: 'Primary',
94
+ previewComponent: () => (
95
+ <Icon name={contentBoxSVG} size="88px" className="primary" />
96
+ ),
97
+ viewComponent: (props) => {
98
+ return (
99
+ <div className="content-box primary">
100
+ <div className="content-box-inner">{props.children}</div>
101
+ </div>
102
+ );
103
+ },
104
+ },
105
+ {
106
+ id: 'content-box-secondary',
107
+ title: 'Secondary',
108
+ previewComponent: () => (
109
+ <Icon name={contentBoxSVG} size="88px" className="secondary" />
110
+ ),
111
+ viewComponent: (props) => {
112
+ return (
113
+ <div className="content-box secondary">
114
+ <div className="content-box-inner">{props.children}</div>
115
+ </div>
116
+ );
117
+ },
118
+ },
119
+ {
120
+ id: 'content-box-tertiary',
121
+ title: 'Tertiary',
122
+ previewComponent: () => (
123
+ <Icon name={contentBoxSVG} size="88px" className="tertiary" />
124
+ ),
125
+ viewComponent: (props) => {
126
+ return (
127
+ <div className="content-box tertiary">
128
+ <div className="content-box-inner">{props.children}</div>
129
+ </div>
130
+ );
131
+ },
132
+ },
133
+ ];
134
+
135
+ // Custom blocks
68
136
  return [installCustomTitle].reduce((acc, apply) => apply(acc), config);
69
137
  };
70
138