@eeacms/volto-eea-website-theme 1.11.3 → 1.13.0
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,30 @@ 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.13.0](https://github.com/eea/volto-eea-website-theme/compare/1.12.0...1.13.0) - 27 March 2023
|
8
|
+
|
9
|
+
#### :rocket: New Features
|
10
|
+
|
11
|
+
- feat(Title): Possibility to add arbitrary copyright prefix - refs #250724 [Alin Voinea - [`9249bad`](https://github.com/eea/volto-eea-website-theme/commit/9249bad0a588206cb97c13ffb08a9b4fd4fc548f)]
|
12
|
+
|
13
|
+
#### :hammer_and_wrench: Others
|
14
|
+
|
15
|
+
- Release 1.13.0 [Alin Voinea - [`9e06d22`](https://github.com/eea/volto-eea-website-theme/commit/9e06d2253d08fe9ccec6cadd71b828f1558398f5)]
|
16
|
+
### [1.12.0](https://github.com/eea/volto-eea-website-theme/compare/1.11.3...1.12.0) - 24 March 2023
|
17
|
+
|
18
|
+
#### :nail_care: Enhancements
|
19
|
+
|
20
|
+
- change(banner): modified title of share buttons [David Ichim - [`c6dcbb5`](https://github.com/eea/volto-eea-website-theme/commit/c6dcbb534d26155d82d8a2729c454fbe3e2b312b)]
|
21
|
+
- change(banner): use custom-made Popup for better accessibility [David Ichim - [`955abf1`](https://github.com/eea/volto-eea-website-theme/commit/955abf1c525841577b7cc737871e9640c64a10dc)]
|
22
|
+
- change(banner): removed title parameter from MetadataField [David Ichim - [`aff3b6a`](https://github.com/eea/volto-eea-website-theme/commit/aff3b6a8302be165c6bce5cc20d3da734c81fc87)]
|
23
|
+
|
24
|
+
#### :hammer_and_wrench: Others
|
25
|
+
|
26
|
+
- Release 1.12.0 [Alin Voinea - [`4f77af8`](https://github.com/eea/volto-eea-website-theme/commit/4f77af895d6ba9952fa54b1928bbb9f56543765d)]
|
27
|
+
- (feat):Page Header Banner accessibility #119 from eea/banner-accesibility [ichim-david - [`3102129`](https://github.com/eea/volto-eea-website-theme/commit/3102129fe6e1416c566522d7da90fd1f118726d5)]
|
28
|
+
- delete id [Dobricean Ioan Dorian - [`500727f`](https://github.com/eea/volto-eea-website-theme/commit/500727f87b93dc2c1498c1ed1861d93e464532f4)]
|
29
|
+
- final version [Dobricean Ioan Dorian - [`f26adf4`](https://github.com/eea/volto-eea-website-theme/commit/f26adf4fb584a1f7f31a177852bfbde1a15ebd4f)]
|
30
|
+
- popup accesibility [Dobricean Ioan Dorian - [`14961bd`](https://github.com/eea/volto-eea-website-theme/commit/14961bdf6bdfcd2a83c53f8fbca83671833217f7)]
|
7
31
|
### [1.11.3](https://github.com/eea/volto-eea-website-theme/compare/1.11.2...1.11.3) - 24 March 2023
|
8
32
|
|
9
33
|
#### :rocket: New Features
|
package/package.json
CHANGED
@@ -1,12 +1,14 @@
|
|
1
|
-
import React, { useCallback, useMemo } from 'react';
|
1
|
+
import React, { useCallback, useMemo, useRef } from 'react';
|
2
2
|
import { compose } from 'redux';
|
3
3
|
import { connect } from 'react-redux';
|
4
4
|
import { withRouter } from 'react-router';
|
5
5
|
import { defineMessages, injectIntl } from 'react-intl';
|
6
6
|
import { startCase } from 'lodash';
|
7
7
|
import qs from 'querystring';
|
8
|
-
import {
|
8
|
+
import { Icon } from 'semantic-ui-react';
|
9
|
+
import Popup from '@eeacms/volto-eea-design-system/ui/Popup/Popup';
|
9
10
|
import { flattenToAppURL } from '@plone/volto/helpers';
|
11
|
+
import config from '@plone/volto/registry';
|
10
12
|
import Banner from '@eeacms/volto-eea-design-system/ui/Banner/Banner';
|
11
13
|
import {
|
12
14
|
getImageSource,
|
@@ -33,26 +35,14 @@ const messages = defineMessages({
|
|
33
35
|
id: 'Created',
|
34
36
|
defaultMessage: 'Created',
|
35
37
|
},
|
36
|
-
created_on: {
|
37
|
-
id: 'Created on',
|
38
|
-
defaultMessage: 'Created on',
|
39
|
-
},
|
40
38
|
published: {
|
41
39
|
id: 'Published',
|
42
40
|
defaultMessage: 'Published',
|
43
41
|
},
|
44
|
-
published_on: {
|
45
|
-
id: 'Published on',
|
46
|
-
defaultMessage: 'Published on',
|
47
|
-
},
|
48
42
|
modified: {
|
49
43
|
id: 'Modified',
|
50
44
|
defaultMessage: 'Modified',
|
51
45
|
},
|
52
|
-
modified_on: {
|
53
|
-
id: 'Modified on',
|
54
|
-
defaultMessage: 'Modified on',
|
55
|
-
},
|
56
46
|
});
|
57
47
|
|
58
48
|
const friendlyId = (id) => {
|
@@ -74,6 +64,7 @@ const Title = ({ config = {}, properties }) => {
|
|
74
64
|
const View = (props) => {
|
75
65
|
const { banner = {}, intl, location, types = [] } = props;
|
76
66
|
const metadata = props.metadata || props.properties;
|
67
|
+
const popupRef = useRef(null);
|
77
68
|
const {
|
78
69
|
info = [],
|
79
70
|
hideContentType,
|
@@ -87,6 +78,9 @@ const View = (props) => {
|
|
87
78
|
copyrightPosition,
|
88
79
|
// contentType,
|
89
80
|
} = props.data;
|
81
|
+
const copyrightPrefix =
|
82
|
+
config.blocks.blocksConfig.title.copyrightPrefix || '';
|
83
|
+
|
90
84
|
// Set query parameters
|
91
85
|
const parameters = useMemo(
|
92
86
|
() => qs.parse(location.search.replace('?', '')) || {},
|
@@ -134,44 +128,50 @@ const View = (props) => {
|
|
134
128
|
actions={
|
135
129
|
<>
|
136
130
|
{!hideShareButton && (
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
<
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
131
|
+
<>
|
132
|
+
<Popup
|
133
|
+
className={'share-popup'}
|
134
|
+
trigger={
|
135
|
+
<Banner.Action
|
136
|
+
icon="ri-share-fill"
|
137
|
+
title={intl.formatMessage(messages.share)}
|
138
|
+
className="share"
|
139
|
+
onClick={() => {}}
|
140
|
+
/>
|
141
|
+
}
|
142
|
+
content={
|
143
|
+
<>
|
144
|
+
<p>{intl.formatMessage(messages.share_to)}</p>
|
145
|
+
<div className="actions" ref={popupRef}>
|
146
|
+
<Banner.Action
|
147
|
+
icon="ri-facebook-fill"
|
148
|
+
title={'Share page to Facebook'}
|
149
|
+
titleClass={'hiddenStructure'}
|
150
|
+
onClick={() => {
|
151
|
+
sharePage(metadata['@id'], 'facebook');
|
152
|
+
}}
|
153
|
+
/>
|
154
|
+
<Banner.Action
|
155
|
+
icon="ri-twitter-fill"
|
156
|
+
title={'Share page to Twitter'}
|
157
|
+
titleClass={'hiddenStructure'}
|
158
|
+
onClick={() => {
|
159
|
+
sharePage(metadata['@id'], 'twitter');
|
160
|
+
}}
|
161
|
+
/>
|
162
|
+
<Banner.Action
|
163
|
+
icon="ri-linkedin-fill"
|
164
|
+
title={'Share page to Linkedin'}
|
165
|
+
titleClass={'hiddenStructure'}
|
166
|
+
onClick={() => {
|
167
|
+
sharePage(metadata['@id'], 'linkedin');
|
168
|
+
}}
|
169
|
+
/>
|
170
|
+
</div>
|
171
|
+
</>
|
172
|
+
}
|
173
|
+
/>
|
174
|
+
</>
|
175
175
|
)}
|
176
176
|
{!hideDownloadButton && (
|
177
177
|
<Banner.Action
|
@@ -197,19 +197,16 @@ const View = (props) => {
|
|
197
197
|
type="date"
|
198
198
|
label={intl.formatMessage(messages.created)}
|
199
199
|
value={creationDate}
|
200
|
-
title={`${intl.formatMessage(messages.created_on)} {}`}
|
201
200
|
/>
|
202
201
|
<Banner.MetadataField
|
203
202
|
type="date"
|
204
203
|
label={intl.formatMessage(messages.published)}
|
205
204
|
value={publishingDate}
|
206
|
-
title={`${intl.formatMessage(messages.published_on)} {}`}
|
207
205
|
/>
|
208
206
|
<Banner.MetadataField
|
209
207
|
type="date"
|
210
208
|
label={intl.formatMessage(messages.modified)}
|
211
209
|
value={modificationDate}
|
212
|
-
title={`${intl.formatMessage(messages.modified_on)} {}`}
|
213
210
|
/>
|
214
211
|
{info.map((item, index) => (
|
215
212
|
<Banner.MetadataField
|
@@ -220,6 +217,7 @@ const View = (props) => {
|
|
220
217
|
</Banner.Metadata>
|
221
218
|
{copyright ? (
|
222
219
|
<Copyright copyrightPosition={copyrightPosition}>
|
220
|
+
<Copyright.Prefix>{copyrightPrefix}</Copyright.Prefix>
|
223
221
|
<Copyright.Icon>
|
224
222
|
<Icon className={copyrightIcon} />
|
225
223
|
</Copyright.Icon>
|
package/src/index.js
CHANGED
@@ -78,6 +78,11 @@ const applyConfig = (config) => {
|
|
78
78
|
config.blocks.blocksConfig.description.className =
|
79
79
|
'documentDescription eea callout';
|
80
80
|
|
81
|
+
// Hero block copyright prefix
|
82
|
+
if (config.blocks.blocksConfig.hero) {
|
83
|
+
config.blocks.blocksConfig.hero.copyrightPrefix = 'Image';
|
84
|
+
}
|
85
|
+
|
81
86
|
// Custom TokenWidget
|
82
87
|
if (config.widgets.views) {
|
83
88
|
config.widgets.views.id.subjects = TokenWidget;
|