@eeacms/volto-hero-block 5.3.0 → 5.3.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,14 @@ 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
+ ### [5.3.1](https://github.com/eea/volto-hero-block/compare/5.3.0...5.3.1) - 22 May 2023
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - put return statement [Dobricean Ioan Dorian - [`8eff5fd`](https://github.com/eea/volto-hero-block/commit/8eff5fdf977fcbb8cc952d3f45b577b02ca59cb9)]
12
+ - change name and refactor to be more efficent [Dobricean Ioan Dorian - [`ff24145`](https://github.com/eea/volto-hero-block/commit/ff2414542833998ef282376de3fbda8698287849)]
13
+ - stop-image-disappear over and over [Dobricean Ioan Dorian - [`c5b6f54`](https://github.com/eea/volto-hero-block/commit/c5b6f545ac422d95b8d802349aa4cf27af820829)]
14
+ - Add Sonarqube tag using industry-frontend addons list [EEA Jenkins - [`3d38dd0`](https://github.com/eea/volto-hero-block/commit/3d38dd09a36525bda448f67a6d218bc7690a4cc3)]
7
15
  ### [5.3.0](https://github.com/eea/volto-hero-block/compare/5.2.0...5.3.0) - 27 March 2023
8
16
 
9
17
  #### :rocket: New Features
@@ -42,9 +50,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
42
50
  - fix onScreen hook error #16 from eea/fix-onscreen-hook [ichim-david - [`9123541`](https://github.com/eea/volto-hero-block/commit/91235413f423d7e6c4788d70b687b3ed5d4884b4)]
43
51
  - no need for comments [andreiggr - [`a14f9c3`](https://github.com/eea/volto-hero-block/commit/a14f9c3bdddfa22e6b4bbc8318f0ca5bdc9c2d38)]
44
52
  - fix hook [andreiggr - [`f7fae73`](https://github.com/eea/volto-hero-block/commit/f7fae73007f79af2f06da1d9b72a53ad86fef4ac)]
53
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`6b78fc0`](https://github.com/eea/volto-hero-block/commit/6b78fc044a933ab9b4b4694901aa26628ef0a836)]
45
54
  - eslint [andreiggr - [`68451b7`](https://github.com/eea/volto-hero-block/commit/68451b725420015fbd5b695e97b8742988d49913)]
46
55
  - lazy load huge img on first 10px [andreiggr - [`67dc7d3`](https://github.com/eea/volto-hero-block/commit/67dc7d3475188d692e053032c2639dd1a585c029)]
47
56
  - lazy load huge bgimage wip [andreiggr - [`86e45ec`](https://github.com/eea/volto-hero-block/commit/86e45ece842f1cd7452920dffa3a9b4aea945f56)]
57
+ - Add Sonarqube tag using ims-frontend addons list [EEA Jenkins - [`87cbb38`](https://github.com/eea/volto-hero-block/commit/87cbb383290a168f85703573670e17f4e1ed7747)]
48
58
  ## [4.0.0](https://github.com/eea/volto-hero-block/compare/3.0.1...4.0.0) - 7 February 2023
49
59
 
50
60
  #### :nail_care: Enhancements
@@ -70,6 +80,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
70
80
 
71
81
  #### :hammer_and_wrench: Others
72
82
 
83
+ - Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`ab85c7b`](https://github.com/eea/volto-hero-block/commit/ab85c7bd5bd1e3aec95e02f9b4d026b1203d5739)]
73
84
  ## [3.0.0](https://github.com/eea/volto-hero-block/compare/2.1.0...3.0.0) - 22 December 2022
74
85
 
75
86
  #### :rocket: New Features
@@ -78,8 +89,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
78
89
 
79
90
  #### :hammer_and_wrench: Others
80
91
 
92
+ - Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`f06f58c`](https://github.com/eea/volto-hero-block/commit/f06f58c7cd4cfc15a03208e9c7a4e31fe2eba2f6)]
93
+ - Add Sonarqube tag using climate-energy-frontend addons list [EEA Jenkins - [`20e5bcb`](https://github.com/eea/volto-hero-block/commit/20e5bcb3c4dd538595741928319c3204c5d18f8c)]
81
94
  - Cosmetics [Alin Voinea - [`9dac70c`](https://github.com/eea/volto-hero-block/commit/9dac70c0a3bea8e188ede9123f4f99de8e0f6987)]
82
95
  - test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`2d4005f`](https://github.com/eea/volto-hero-block/commit/2d4005f0f31b121e1b7d2e94414f3dff92ec1a16)]
96
+ - Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`2931fcc`](https://github.com/eea/volto-hero-block/commit/2931fccbee5f8e117e5ae9095ba57e63e465ddb3)]
83
97
  ### [2.1.0](https://github.com/eea/volto-hero-block/compare/2.0.0...2.1.0) - 12 December 2022
84
98
 
85
99
  #### :bug: Bug Fixes
@@ -88,6 +102,12 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
88
102
 
89
103
  #### :hammer_and_wrench: Others
90
104
 
105
+ - Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`93be4f9`](https://github.com/eea/volto-hero-block/commit/93be4f96fb72cacfc25f9b058cb379d80060ee13)]
106
+ - yarn 3 [Alin Voinea - [`8e2dccd`](https://github.com/eea/volto-hero-block/commit/8e2dccd47cbef3c0871407baa376ce61c540c754)]
107
+ - Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`6bc3af3`](https://github.com/eea/volto-hero-block/commit/6bc3af35b4edf07971d1b0ce1648965e8d6e3bc0)]
108
+ - Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`d7dbbd2`](https://github.com/eea/volto-hero-block/commit/d7dbbd21277dd76bf59d91a4dc8e022b2a6ff99c)]
109
+ - Add Sonarqube tag using demo-kitkat-frontend addons list [EEA Jenkins - [`3c1f0d6`](https://github.com/eea/volto-hero-block/commit/3c1f0d6e7f8e5318aee3413ec3687d8492376f9d)]
110
+ - Add Sonarqube tag using forests-frontend addons list [EEA Jenkins - [`843017a`](https://github.com/eea/volto-hero-block/commit/843017aa7dbea71cc7888663496e352d287440b4)]
91
111
  ## [2.0.0](https://github.com/eea/volto-hero-block/compare/1.0.0...2.0.0) - 16 November 2022
92
112
 
93
113
  #### :nail_care: Enhancements
@@ -97,6 +117,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
97
117
  #### :hammer_and_wrench: Others
98
118
 
99
119
  - test(estlint): Fix .project.eslintrc.js [Alin Voinea - [`b8f0971`](https://github.com/eea/volto-hero-block/commit/b8f0971b21a5334d40c1b8f5103cea61d9ffe6f1)]
120
+ - Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`581dedf`](https://github.com/eea/volto-hero-block/commit/581dedf07410ef2ca09e6ddaa05fbf176400adbb)]
100
121
  ## [1.0.0](https://github.com/eea/volto-hero-block/compare/0.2.0...1.0.0) - 28 October 2022
101
122
 
102
123
  #### :nail_care: Enhancements
@@ -108,6 +129,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
108
129
  - Remove cypress.json [Alin Voinea - [`593bdf2`](https://github.com/eea/volto-hero-block/commit/593bdf207ca4fd3f2393117b6f64a44727881ad0)]
109
130
  - test(cypress): Upgrade to Cypress 10 / Razzle 4 [Alin Voinea - [`edd48a5`](https://github.com/eea/volto-hero-block/commit/edd48a5c13824bce5e03e46790f1890656b340d8)]
110
131
  - Cleanup [Alin Voinea - [`9d72ee7`](https://github.com/eea/volto-hero-block/commit/9d72ee7a06d1c6fed46586d30bb85eae39e670bf)]
132
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`95986d0`](https://github.com/eea/volto-hero-block/commit/95986d0b8fd5c3cbb9e6da9059f71e066a8e171b)]
111
133
  ### [0.2.0](https://github.com/eea/volto-hero-block/compare/0.1.4...0.2.0) - 6 July 2022
112
134
 
113
135
  #### :bug: Bug Fixes
@@ -146,6 +168,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
146
168
  - Update slate footnote support [Miu Razvan - [`c1522b4`](https://github.com/eea/volto-hero-block/commit/c1522b4164dbe6de01771d211d7e0bf3009f44d4)]
147
169
  - Use justify content for text and button as well [Miu Razvan - [`08599cc`](https://github.com/eea/volto-hero-block/commit/08599cc45546d9b349128c4f8ce9c01318385811)]
148
170
  - Add dependencies [Miu Razvan - [`30e2881`](https://github.com/eea/volto-hero-block/commit/30e2881a2a97a899e7f4cc614a0405c300ac6fee)]
171
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`b415422`](https://github.com/eea/volto-hero-block/commit/b41542285edd29440a324b101a4dbae9334830bf)]
149
172
  ### 0.1.0 - 10 June 2022
150
173
 
151
174
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-hero-block",
3
- "version": "5.3.0",
3
+ "version": "5.3.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",
@@ -3,7 +3,7 @@ import cx from 'classnames';
3
3
  import PropTypes from 'prop-types';
4
4
  import { isInternalURL } from '@plone/volto/helpers/Url/Url';
5
5
  import { isImageGif } from '@eeacms/volto-hero-block/helpers';
6
- import { useOnScreen } from '@eeacms/volto-hero-block/hooks';
6
+ import { useFirstVisited } from '@eeacms/volto-hero-block/hooks';
7
7
 
8
8
  Hero.propTypes = {
9
9
  image: PropTypes.string,
@@ -33,7 +33,7 @@ function Hero({
33
33
  styles || {};
34
34
 
35
35
  const bgImgRef = React.useRef();
36
- const onScreen = useOnScreen(bgImgRef);
36
+ const onScreen = useFirstVisited(bgImgRef);
37
37
  return (
38
38
  <div
39
39
  className={cx(
@@ -84,6 +84,18 @@ export default () => {
84
84
  },
85
85
  copyrightIcon: {
86
86
  title: 'Icon',
87
+ description: (
88
+ <>
89
+ Ex. ri-copyright-line. See{' '}
90
+ <a
91
+ target="_blank"
92
+ rel="noopener noreferrer"
93
+ href="https://remixicon.com/"
94
+ >
95
+ Remix Icon set
96
+ </a>
97
+ </>
98
+ ),
87
99
  default: 'ri-copyright-line',
88
100
  },
89
101
  copyrightPosition: {
package/src/hooks.js CHANGED
@@ -1,13 +1,13 @@
1
1
  /* eslint-disable react-hooks/exhaustive-deps */
2
2
  import React from 'react';
3
3
 
4
- function useOnScreen(ref, rootMargin = '0px') {
5
- const [isIntersecting, setIntersecting] = React.useState(false);
6
-
4
+ function useFirstVisited(ref, rootMargin = '0px') {
5
+ const [intersected, setIntersected] = React.useState(false);
7
6
  React.useEffect(() => {
7
+ if (intersected) return;
8
8
  const observer = new IntersectionObserver(
9
9
  ([entry]) => {
10
- setIntersecting(entry.isIntersecting);
10
+ setIntersected(intersected === false ? entry.isIntersecting : true);
11
11
  },
12
12
  {
13
13
  rootMargin,
@@ -24,8 +24,8 @@ function useOnScreen(ref, rootMargin = '0px') {
24
24
  }
25
25
  observer.disconnect();
26
26
  };
27
- }, [ref, rootMargin]);
28
- return isIntersecting;
27
+ }, [ref, rootMargin, intersected]);
28
+ return intersected;
29
29
  }
30
30
 
31
- export { useOnScreen };
31
+ export { useFirstVisited };