@eeacms/volto-hero-block 2.1.0 → 3.0.1

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,32 @@ 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.1](https://github.com/eea/volto-hero-block/compare/3.0.0...3.0.1) - 27 January 2023
8
+
9
+ #### :rocket: New Features
10
+
11
+ - feat(hero): added background position styling option [David Ichim - [`8d933f6`](https://github.com/eea/volto-hero-block/commit/8d933f6e03a495b055d81923a37b0affd769c770)]
12
+
13
+ #### :nail_care: Enhancements
14
+
15
+ - change(hero): bg class setting to ensure it's set on the hero-image section [David Ichim - [`ce0305f`](https://github.com/eea/volto-hero-block/commit/ce0305feed18e6ca5f22ee7786db93283944484a)]
16
+
17
+ #### :hammer_and_wrench: Others
18
+
19
+ - Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`ab85c7b`](https://github.com/eea/volto-hero-block/commit/ab85c7bd5bd1e3aec95e02f9b4d026b1203d5739)]
20
+ ## [3.0.0](https://github.com/eea/volto-hero-block/compare/2.1.0...3.0.0) - 22 December 2022
21
+
22
+ #### :rocket: New Features
23
+
24
+ - feat(copyright): Add image copyright info - refs #158210 [Alin Voinea - [`f0f2b09`](https://github.com/eea/volto-hero-block/commit/f0f2b09633baddcd6f11ccf52bf9e40652dcbfad)]
25
+
26
+ #### :hammer_and_wrench: Others
27
+
28
+ - Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`f06f58c`](https://github.com/eea/volto-hero-block/commit/f06f58c7cd4cfc15a03208e9c7a4e31fe2eba2f6)]
29
+ - Add Sonarqube tag using climate-energy-frontend addons list [EEA Jenkins - [`20e5bcb`](https://github.com/eea/volto-hero-block/commit/20e5bcb3c4dd538595741928319c3204c5d18f8c)]
30
+ - Cosmetics [Alin Voinea - [`9dac70c`](https://github.com/eea/volto-hero-block/commit/9dac70c0a3bea8e188ede9123f4f99de8e0f6987)]
31
+ - test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`2d4005f`](https://github.com/eea/volto-hero-block/commit/2d4005f0f31b121e1b7d2e94414f3dff92ec1a16)]
32
+ - Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`2931fcc`](https://github.com/eea/volto-hero-block/commit/2931fccbee5f8e117e5ae9095ba57e63e465ddb3)]
7
33
  ### [2.1.0](https://github.com/eea/volto-hero-block/compare/2.0.0...2.1.0) - 12 December 2022
8
34
 
9
35
  #### :bug: Bug Fixes
@@ -12,6 +38,12 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
12
38
 
13
39
  #### :hammer_and_wrench: Others
14
40
 
41
+ - Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`93be4f9`](https://github.com/eea/volto-hero-block/commit/93be4f96fb72cacfc25f9b058cb379d80060ee13)]
42
+ - yarn 3 [Alin Voinea - [`8e2dccd`](https://github.com/eea/volto-hero-block/commit/8e2dccd47cbef3c0871407baa376ce61c540c754)]
43
+ - Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`6bc3af3`](https://github.com/eea/volto-hero-block/commit/6bc3af35b4edf07971d1b0ce1648965e8d6e3bc0)]
44
+ - Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`d7dbbd2`](https://github.com/eea/volto-hero-block/commit/d7dbbd21277dd76bf59d91a4dc8e022b2a6ff99c)]
45
+ - Add Sonarqube tag using demo-kitkat-frontend addons list [EEA Jenkins - [`3c1f0d6`](https://github.com/eea/volto-hero-block/commit/3c1f0d6e7f8e5318aee3413ec3687d8492376f9d)]
46
+ - Add Sonarqube tag using forests-frontend addons list [EEA Jenkins - [`843017a`](https://github.com/eea/volto-hero-block/commit/843017aa7dbea71cc7888663496e352d287440b4)]
15
47
  ## [2.0.0](https://github.com/eea/volto-hero-block/compare/1.0.0...2.0.0) - 16 November 2022
16
48
 
17
49
  #### :nail_care: Enhancements
@@ -21,6 +53,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
21
53
  #### :hammer_and_wrench: Others
22
54
 
23
55
  - test(estlint): Fix .project.eslintrc.js [Alin Voinea - [`b8f0971`](https://github.com/eea/volto-hero-block/commit/b8f0971b21a5334d40c1b8f5103cea61d9ffe6f1)]
56
+ - Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`581dedf`](https://github.com/eea/volto-hero-block/commit/581dedf07410ef2ca09e6ddaa05fbf176400adbb)]
24
57
  ## [1.0.0](https://github.com/eea/volto-hero-block/compare/0.2.0...1.0.0) - 28 October 2022
25
58
 
26
59
  #### :nail_care: Enhancements
@@ -32,6 +65,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
32
65
  - Remove cypress.json [Alin Voinea - [`593bdf2`](https://github.com/eea/volto-hero-block/commit/593bdf207ca4fd3f2393117b6f64a44727881ad0)]
33
66
  - test(cypress): Upgrade to Cypress 10 / Razzle 4 [Alin Voinea - [`edd48a5`](https://github.com/eea/volto-hero-block/commit/edd48a5c13824bce5e03e46790f1890656b340d8)]
34
67
  - Cleanup [Alin Voinea - [`9d72ee7`](https://github.com/eea/volto-hero-block/commit/9d72ee7a06d1c6fed46586d30bb85eae39e670bf)]
68
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`95986d0`](https://github.com/eea/volto-hero-block/commit/95986d0b8fd5c3cbb9e6da9059f71e066a8e171b)]
35
69
  ### [0.2.0](https://github.com/eea/volto-hero-block/compare/0.1.4...0.2.0) - 6 July 2022
36
70
 
37
71
  #### :bug: Bug Fixes
@@ -70,6 +104,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
70
104
  - Update slate footnote support [Miu Razvan - [`c1522b4`](https://github.com/eea/volto-hero-block/commit/c1522b4164dbe6de01771d211d7e0bf3009f44d4)]
71
105
  - Use justify content for text and button as well [Miu Razvan - [`08599cc`](https://github.com/eea/volto-hero-block/commit/08599cc45546d9b349128c4f8ce9c01318385811)]
72
106
  - Add dependencies [Miu Razvan - [`30e2881`](https://github.com/eea/volto-hero-block/commit/30e2881a2a97a899e7f4cc614a0405c300ac6fee)]
107
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`b415422`](https://github.com/eea/volto-hero-block/commit/b41542285edd29440a324b101a4dbae9334830bf)]
73
108
  ### 0.1.0 - 10 June 2022
74
109
 
75
110
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-hero-block",
3
- "version": "2.1.0",
3
+ "version": "3.0.1",
4
4
  "description": "@eeacms/volto-hero-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -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}>
@@ -58,7 +58,7 @@ function Hero({
58
58
  )}
59
59
  >
60
60
  <div
61
- className={cx('hero-block-image')}
61
+ className={cx('hero-block-image', styles?.bg)}
62
62
  style={
63
63
  image
64
64
  ? {
@@ -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
  };
@@ -1,5 +1,15 @@
1
1
  import { addStyling } from '@plone/volto/helpers';
2
2
 
3
+ import alignTopSVG from '@plone/volto/icons/move-up.svg';
4
+ import alignCenterSVG from '@plone/volto/icons/row.svg';
5
+ import alignBottomSVG from '@plone/volto/icons/move-down.svg';
6
+
7
+ const ALIGN_INFO_MAP = {
8
+ 'has--bg--top': [alignTopSVG, 'Top'],
9
+ 'has--bg--center': [alignCenterSVG, 'Center'],
10
+ 'has--bg--bottom': [alignBottomSVG, 'Bottom'],
11
+ };
12
+
3
13
  export default () => {
4
14
  return {
5
15
  title: 'Hero',
@@ -19,6 +29,11 @@ export default () => {
19
29
  'image',
20
30
  ],
21
31
  },
32
+ {
33
+ id: 'copyright',
34
+ title: 'Copyright',
35
+ fields: ['copyright', 'copyrightIcon', 'copyrightPosition'],
36
+ },
22
37
  ],
23
38
  properties: {
24
39
  fullWidth: {
@@ -63,6 +78,19 @@ export default () => {
63
78
  title: 'Image',
64
79
  widget: 'attachedimage',
65
80
  },
81
+ copyright: {
82
+ title: 'Text',
83
+ },
84
+ copyrightIcon: {
85
+ title: 'Icon',
86
+ default: 'ri-copyright-line',
87
+ },
88
+ copyrightPosition: {
89
+ title: 'Align',
90
+ widget: 'align',
91
+ actions: ['left', 'right'],
92
+ defaultValue: 'left',
93
+ },
66
94
  },
67
95
  required: [],
68
96
  };
@@ -79,6 +107,7 @@ export const stylingSchema = (props) => {
79
107
  title: 'Default',
80
108
  fields: [
81
109
  'backgroundVariant',
110
+ 'bg',
82
111
  'alignContent',
83
112
  'textAlign',
84
113
  'textVariant',
@@ -88,6 +117,13 @@ export const stylingSchema = (props) => {
88
117
  },
89
118
  ],
90
119
  properties: {
120
+ bg: {
121
+ title: 'Background image position',
122
+ widget: 'align',
123
+ actions: Object.keys(ALIGN_INFO_MAP),
124
+ actionsInfoMap: ALIGN_INFO_MAP,
125
+ defaultValue: 'has--bg--center',
126
+ },
91
127
  backgroundVariant: {
92
128
  title: 'Background theme',
93
129
  choices: [