@eeacms/volto-hero-block 5.1.0 → 5.2.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,11 +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.1.0](https://github.com/eea/volto-hero-block/compare/5.0.0...5.1.0) - 24 March 2023
7
+ ### [5.2.0](https://github.com/eea/volto-hero-block/compare/5.1.0...5.2.0) - 24 March 2023
8
8
 
9
- #### :rocket: New Features
9
+ #### :hammer_and_wrench: Others
10
10
 
11
- - feat: add 'with-hero-block' class to body [Miu Razvan - [`12e60a3`](https://github.com/eea/volto-hero-block/commit/12e60a352e60f647346fa00ba3aa8f54f2b8623c)]
11
+ - Release 5.2.0 [Alin Voinea - [`b0dfa0c`](https://github.com/eea/volto-hero-block/commit/b0dfa0c46f5f697d9e2419522ce04ead9353272d)]
12
+ - update [Miu Razvan - [`2a9e854`](https://github.com/eea/volto-hero-block/commit/2a9e8540853cd49e7461ac4de9fef2109874dcdd)]
13
+ - import schema from blocksConfig [Miu Razvan - [`196a003`](https://github.com/eea/volto-hero-block/commit/196a003957676b562987ef6509cf2b73ea2e77d2)]
14
+ ### [5.1.0](https://github.com/eea/volto-hero-block/compare/5.0.0...5.1.0) - 24 March 2023
12
15
 
13
16
  #### :hammer_and_wrench: Others
14
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-hero-block",
3
- "version": "5.1.0",
3
+ "version": "5.2.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",
@@ -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 isFunction from 'lodash/isFunction';
4
5
  import { Icon } from 'semantic-ui-react';
5
6
  import config from '@plone/volto/registry';
6
7
  import {
@@ -20,7 +21,6 @@ import { createSlateHeader } from '@eeacms/volto-hero-block/helpers';
20
21
 
21
22
  import Copyright from './Copyright';
22
23
  import Hero from './Hero';
23
- import getSchema from './schema';
24
24
 
25
25
  const Metadata = ({ buttonLabel, buttonLink, inverted, styles }) => {
26
26
  const { buttonVariant } = styles || {};
@@ -49,7 +49,13 @@ const Edit = (props) => {
49
49
  onSelectBlock,
50
50
  } = props;
51
51
  const { text, copyright, copyrightIcon, copyrightPosition } = data;
52
- const schema = React.useMemo(() => getSchema(props), [props]);
52
+ const schema = React.useMemo(() => {
53
+ const blockSchema = config.blocks.blocksConfig.hero.schema;
54
+ if (isFunction(blockSchema)) {
55
+ return blockSchema(props);
56
+ }
57
+ return blockSchema;
58
+ }, [props]);
53
59
 
54
60
  const withBlockProperties = React.useCallback(
55
61
  (editor) => {
@@ -1,7 +1,7 @@
1
1
  import codeSVG from '@plone/volto/icons/code.svg';
2
2
  import HeroEdit from './Edit';
3
3
  import HeroView from './View';
4
- import { stylingSchema } from './schema';
4
+ import schema, { stylingSchema } from './schema';
5
5
 
6
6
  export default (config) => {
7
7
  config.blocks.blocksConfig.hero = {
@@ -20,6 +20,7 @@ export default (config) => {
20
20
  addPermission: [],
21
21
  view: [],
22
22
  },
23
+ schema,
23
24
  };
24
25
 
25
26
  config.settings.blocksWithFootnotesSupport = {