@eeacms/volto-hero-block 2.1.0 → 3.0.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,16 @@ 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
|
+
### [3.0.0](https://github.com/eea/volto-hero-block/compare/2.1.0...3.0.0) - 22 December 2022
|
|
8
|
+
|
|
9
|
+
#### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
- feat(copyright): Add image copyright info - refs #158210 [Alin Voinea - [`f0f2b09`](https://github.com/eea/volto-hero-block/commit/f0f2b09633baddcd6f11ccf52bf9e40652dcbfad)]
|
|
12
|
+
|
|
13
|
+
#### :hammer_and_wrench: Others
|
|
14
|
+
|
|
15
|
+
- Cosmetics [Alin Voinea - [`9dac70c`](https://github.com/eea/volto-hero-block/commit/9dac70c0a3bea8e188ede9123f4f99de8e0f6987)]
|
|
16
|
+
- test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`2d4005f`](https://github.com/eea/volto-hero-block/commit/2d4005f0f31b121e1b7d2e94414f3dff92ec1a16)]
|
|
7
17
|
### [2.1.0](https://github.com/eea/volto-hero-block/compare/2.0.0...2.1.0) - 12 December 2022
|
|
8
18
|
|
|
9
19
|
#### :bug: Bug Fixes
|
package/package.json
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
|
|
4
|
+
Copyright.propTypes = {
|
|
5
|
+
copyrightPosition: PropTypes.oneOf(['left', 'right']),
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
function Copyright({ children, ...rest }) {
|
|
9
|
+
return (
|
|
10
|
+
<div className={`eea copyright ${rest.copyrightPosition}`}>
|
|
11
|
+
<div className={'wrapper'}>{children}</div>
|
|
12
|
+
</div>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
Copyright.Icon = ({ children, ...rest }) => (
|
|
17
|
+
<span {...rest} className={'icon-wrapper'}>
|
|
18
|
+
{children}
|
|
19
|
+
</span>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
Copyright.Text = ({ children, ...rest }) => (
|
|
23
|
+
<span {...rest} className={'icon-content'}>
|
|
24
|
+
{children}
|
|
25
|
+
</span>
|
|
26
|
+
);
|
|
27
|
+
export default Copyright;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cx from 'classnames';
|
|
3
3
|
import { connect } from 'react-redux';
|
|
4
|
+
import { Icon } from 'semantic-ui-react';
|
|
4
5
|
import config from '@plone/volto/registry';
|
|
5
6
|
import {
|
|
6
7
|
BlockDataForm,
|
|
@@ -16,6 +17,7 @@ import {
|
|
|
16
17
|
|
|
17
18
|
import { createSlateHeader } from '@eeacms/volto-hero-block/helpers';
|
|
18
19
|
|
|
20
|
+
import Copyright from './Copyright';
|
|
19
21
|
import Hero from './Hero';
|
|
20
22
|
import getSchema from './schema';
|
|
21
23
|
|
|
@@ -45,7 +47,7 @@ const Edit = (props) => {
|
|
|
45
47
|
onChangeBlock,
|
|
46
48
|
onSelectBlock,
|
|
47
49
|
} = props;
|
|
48
|
-
const { text } = data;
|
|
50
|
+
const { text, copyright, copyrightIcon, copyrightPosition } = data;
|
|
49
51
|
const schema = React.useMemo(() => getSchema(props), [props]);
|
|
50
52
|
|
|
51
53
|
const withBlockProperties = React.useCallback(
|
|
@@ -89,6 +91,16 @@ const Edit = (props) => {
|
|
|
89
91
|
<Hero.Meta {...data}>
|
|
90
92
|
<Metadata {...data} />
|
|
91
93
|
</Hero.Meta>
|
|
94
|
+
{copyright ? (
|
|
95
|
+
<Copyright copyrightPosition={copyrightPosition}>
|
|
96
|
+
<Copyright.Icon>
|
|
97
|
+
<Icon className={copyrightIcon} />
|
|
98
|
+
</Copyright.Icon>
|
|
99
|
+
<Copyright.Text>{copyright}</Copyright.Text>
|
|
100
|
+
</Copyright>
|
|
101
|
+
) : (
|
|
102
|
+
''
|
|
103
|
+
)}
|
|
92
104
|
</Hero>
|
|
93
105
|
|
|
94
106
|
<SidebarPortal selected={selected}>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cx from 'classnames';
|
|
3
|
+
import { Icon } from 'semantic-ui-react';
|
|
3
4
|
import { UniversalLink } from '@plone/volto/components';
|
|
4
5
|
import Hero from './Hero';
|
|
6
|
+
import Copyright from './Copyright';
|
|
5
7
|
import { serializeText } from '@eeacms/volto-hero-block/helpers';
|
|
6
8
|
|
|
7
9
|
const Metadata = ({ buttonLabel, buttonLink, inverted, styles }) => {
|
|
@@ -21,13 +23,23 @@ const Metadata = ({ buttonLabel, buttonLink, inverted, styles }) => {
|
|
|
21
23
|
|
|
22
24
|
const View = (props) => {
|
|
23
25
|
const { data = {} } = props;
|
|
24
|
-
const { text } = data;
|
|
26
|
+
const { text, copyright, copyrightIcon, copyrightPosition } = data;
|
|
25
27
|
return (
|
|
26
28
|
<Hero {...data}>
|
|
27
29
|
<Hero.Text {...data}>{serializeText(text)}</Hero.Text>
|
|
28
30
|
<Hero.Meta {...data}>
|
|
29
31
|
<Metadata {...data} />
|
|
30
32
|
</Hero.Meta>
|
|
33
|
+
{copyright ? (
|
|
34
|
+
<Copyright copyrightPosition={copyrightPosition}>
|
|
35
|
+
<Copyright.Icon>
|
|
36
|
+
<Icon className={copyrightIcon} />
|
|
37
|
+
</Copyright.Icon>
|
|
38
|
+
<Copyright.Text>{copyright}</Copyright.Text>
|
|
39
|
+
</Copyright>
|
|
40
|
+
) : (
|
|
41
|
+
''
|
|
42
|
+
)}
|
|
31
43
|
</Hero>
|
|
32
44
|
);
|
|
33
45
|
};
|
|
@@ -19,6 +19,11 @@ export default () => {
|
|
|
19
19
|
'image',
|
|
20
20
|
],
|
|
21
21
|
},
|
|
22
|
+
{
|
|
23
|
+
id: 'copyright',
|
|
24
|
+
title: 'Copyright',
|
|
25
|
+
fields: ['copyright', 'copyrightIcon', 'copyrightPosition'],
|
|
26
|
+
},
|
|
22
27
|
],
|
|
23
28
|
properties: {
|
|
24
29
|
fullWidth: {
|
|
@@ -63,6 +68,19 @@ export default () => {
|
|
|
63
68
|
title: 'Image',
|
|
64
69
|
widget: 'attachedimage',
|
|
65
70
|
},
|
|
71
|
+
copyright: {
|
|
72
|
+
title: 'Text',
|
|
73
|
+
},
|
|
74
|
+
copyrightIcon: {
|
|
75
|
+
title: 'Icon',
|
|
76
|
+
default: 'ri-copyright-line',
|
|
77
|
+
},
|
|
78
|
+
copyrightPosition: {
|
|
79
|
+
title: 'Align',
|
|
80
|
+
widget: 'align',
|
|
81
|
+
actions: ['left', 'right'],
|
|
82
|
+
defaultValue: 'left',
|
|
83
|
+
},
|
|
66
84
|
},
|
|
67
85
|
required: [],
|
|
68
86
|
};
|