@eeacms/volto-hero-block 2.0.0 → 2.1.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,15 +4,19 @@ 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
- ### [2.0.0](https://github.com/eea/volto-hero-block/compare/1.0.0...2.0.0) - 15 November 2022
7
+ ### [2.1.0](https://github.com/eea/volto-hero-block/compare/2.0.0...2.1.0) - 12 December 2022
8
8
 
9
- #### :nail_care: Enhancements
9
+ #### :bug: Bug Fixes
10
10
 
11
- - refactor(Styling): Use schemaEnhancer in favor of StyleWrapper [Alin Voinea - [`dacf4db`](https://github.com/eea/volto-hero-block/commit/dacf4db6c59a584639f13c7ce8a3d7bd808ea64c)]
11
+ - fix(gif): Use ES6 with isImageGif utility - refs #158188 [Alin Voinea - [`ad32432`](https://github.com/eea/volto-hero-block/commit/ad32432ee320bb4e43f20e260f2900269adf0401)]
12
+
13
+ #### :hammer_and_wrench: Others
14
+
15
+ ## [2.0.0](https://github.com/eea/volto-hero-block/compare/1.0.0...2.0.0) - 16 November 2022
12
16
 
13
- #### :house: Internal changes
17
+ #### :nail_care: Enhancements
14
18
 
15
- - style(volto-hero-block): set correctly the background color [Miu Razvan - [`9358a17`](https://github.com/eea/volto-hero-block/commit/9358a1777c25664cbfe9c66a6c9054521a11ff24)]
19
+ - refactor(Styling): Use schemaEnhancer in favor of StyleWrapper [Alin Voinea - [`dacf4db`](https://github.com/eea/volto-hero-block/commit/dacf4db6c59a584639f13c7ce8a3d7bd808ea64c)]
16
20
 
17
21
  #### :hammer_and_wrench: Others
18
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-hero-block",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
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",
@@ -23,8 +23,8 @@
23
23
  "@eeacms/volto-object-widget": "*"
24
24
  },
25
25
  "devDependencies": {
26
- "@plone/scripts": "*",
27
26
  "@cypress/code-coverage": "^3.10.0",
27
+ "@plone/scripts": "*",
28
28
  "babel-plugin-transform-class-properties": "^6.24.1",
29
29
  "md5": "^2.3.0"
30
30
  },
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import cx from 'classnames';
3
3
  import PropTypes from 'prop-types';
4
4
  import { isInternalURL } from '@plone/volto/helpers/Url/Url';
5
+ import { isImageGif } from '@eeacms/volto-hero-block/helpers';
5
6
 
6
7
  Hero.propTypes = {
7
8
  image: PropTypes.string,
@@ -63,6 +64,8 @@ function Hero({
63
64
  ? {
64
65
  backgroundImage: isExternal
65
66
  ? `url(${image})`
67
+ : isImageGif(image)
68
+ ? `url(${image}/@@images/image)`
66
69
  : `url(${image}/@@images/image/huge)`,
67
70
  }
68
71
  : {}
package/src/helpers.js CHANGED
@@ -15,3 +15,7 @@ export const createSlateHeader = (text) => {
15
15
  export const serializeText = (text) => {
16
16
  return isArray(text) ? serializeNodes(text) : text;
17
17
  };
18
+
19
+ export const isImageGif = (image) => {
20
+ return image?.endsWith?.('.gif');
21
+ };