@eeacms/volto-hero-block 5.5.0 → 6.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,41 @@ 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
+ ### [6.0.0](https://github.com/eea/volto-hero-block/compare/5.5.0...6.0.0) - 4 April 2024
8
+
9
+ #### :boom: Breaking Change
10
+
11
+ - breaking(hero): Use BlocksForm instead of SlateEditor to render more slates block #44 from eea/multiline-bug [ichim-david - [`57953c5`](https://github.com/eea/volto-hero-block/commit/57953c5f27a1831fbb3ff581900b1b8d1b20cb1e)]
12
+ - breaking(tests): Updated Hero.test.jsx.snap snapshots after removal of inner div wrapper [David Ichim - [`7cf73ef`](https://github.com/eea/volto-hero-block/commit/7cf73ef3c4cd0b01dc238a1f6a51a1866dd56aa0)]
13
+
14
+ #### :nail_care: Enhancements
15
+
16
+ - change(hero): Use EditBlockWrapper from Volto core [David Ichim - [`360d2d7`](https://github.com/eea/volto-hero-block/commit/360d2d7e0f0240dd089839cc2ec62a691bcf41e2)]
17
+
18
+ #### :hammer_and_wrench: Others
19
+
20
+ - Fix onClick event in Hero block to select the block in Edit mode [David Ichim - [`1f38992`](https://github.com/eea/volto-hero-block/commit/1f389922d05a5a04cf11d023229aca156873f4b9)]
21
+ - Add ts-jest package to package.json [David Ichim - [`7c82b62`](https://github.com/eea/volto-hero-block/commit/7c82b626985bfdabcf10db6da159c13fa86b27e2)]
22
+ - bump package version to a major 6.0.0 to indicate breaking changes [David Ichim - [`472b675`](https://github.com/eea/volto-hero-block/commit/472b675fcc037c5ac31ceed52f60aa13998fa896)]
23
+ - fix crash of page after removal of a slate block and saving edit page [David Ichim - [`a917cdc`](https://github.com/eea/volto-hero-block/commit/a917cdccec827594b10ceced3c1588cac2308b43)]
24
+ - fix intial value slate [dobri1408 - [`c70bb80`](https://github.com/eea/volto-hero-block/commit/c70bb80a8c60a710cba02d7afbe069ad1b2e4fa2)]
25
+ - Update Jest configuration to avoid ts error and removed onClick from Hero block view component [David Ichim - [`448dbb4`](https://github.com/eea/volto-hero-block/commit/448dbb4882b0fa3d0a128a7a5241b3fa8148d955)]
26
+ - switch to block sidebar when clicking on the hero block in edit [David Ichim - [`1797077`](https://github.com/eea/volto-hero-block/commit/1797077bcbe9001e24c382d4e534b150683acb9c)]
27
+ - fix eslint [dobri1408 - [`7b0a66c`](https://github.com/eea/volto-hero-block/commit/7b0a66cfb0157787b69ae9c80326b9d9e7a06227)]
28
+ - fix eslint [dobri1408 - [`163af98`](https://github.com/eea/volto-hero-block/commit/163af98415a702361c044531e8f13e8e034972ef)]
29
+ - fix eslint comments [dobri1408 - [`0fff8b0`](https://github.com/eea/volto-hero-block/commit/0fff8b07f4375cf8809fe3575ea6bf913aec0c0c)]
30
+ - fix eslint [dobri1408 - [`d560dcb`](https://github.com/eea/volto-hero-block/commit/d560dcb580755767d43d7848f182b420552c1894)]
31
+ - improve the quality [dobri1408 - [`d6bf215`](https://github.com/eea/volto-hero-block/commit/d6bf21563f6e1e423f1c730f5e5409cfc724c240)]
32
+ - Update Edit.jsx [dobri1408 - [`2c31ecd`](https://github.com/eea/volto-hero-block/commit/2c31ecd5fd896e5f0a43f4a689dbb60a36c39431)]
33
+ - fix cypress test [dobri1408 - [`c24f627`](https://github.com/eea/volto-hero-block/commit/c24f627de259623cf27cdcde703667d4e510ce8b)]
34
+ - fix unit tests [dobri1408 - [`ad6e98f`](https://github.com/eea/volto-hero-block/commit/ad6e98fe433f815a692139d5a06f669c485422ad)]
35
+ - fix unit tests [dobri1408 - [`7c007a6`](https://github.com/eea/volto-hero-block/commit/7c007a63c4a14a9230a4e59a3877e9494a241656)]
36
+ - trigger tests [dobri1408 - [`0f51440`](https://github.com/eea/volto-hero-block/commit/0f514401ccd93e90053009427735acc9d8ef4ef7)]
37
+ - mock react-router-dom [dobri1408 - [`f6a33ab`](https://github.com/eea/volto-hero-block/commit/f6a33ab4142fe25f890d186f09162d3c6ea8c68d)]
38
+ - fix eslint [dobri1408 - [`89483de`](https://github.com/eea/volto-hero-block/commit/89483dee93c172e14b8a89e71bd112a27d3d5a90)]
39
+ - fi problems with the bacward compatibility [dobri1408 - [`5915149`](https://github.com/eea/volto-hero-block/commit/59151498b7601f2e1de959916cee504b702c9cb1)]
40
+ - use blockform and renderblocks [dobri1408 - [`61994d0`](https://github.com/eea/volto-hero-block/commit/61994d0044e212e89dbec1ac25f13a56b42f8f82)]
41
+ - fix multiline hero bug [dobri1408 - [`25b26d5`](https://github.com/eea/volto-hero-block/commit/25b26d562121b59ff5120ea8caefaab014885889)]
7
42
  ### [5.5.0](https://github.com/eea/volto-hero-block/compare/5.4.6...5.5.0) - 19 February 2024
8
43
 
9
44
  #### :house: Internal changes
package/README.md CHANGED
@@ -26,6 +26,16 @@ Enhanced Hero Block [Volto](https://github.com/plone/volto) add-on
26
26
 
27
27
  This version requires: `@plone/volto >= 16.0.0.alpha.46` (schemaEnhancer / addStyling).
28
28
 
29
+ ### Upgrading to 6.x
30
+
31
+ Starting with version `6.0.0` we have the following breaking changes from version `5.x.x`:
32
+
33
+ 1. Removed inner `div` that was used to add `quoted-wrapper` class.
34
+ This `class` is now added on the main `div` alongside the other `block` options.
35
+ 2. Block is using `BlocksForm` to add more than one `Slate` blocks.
36
+ This is useful in case you have to add some sub titles or extra paragraphs inside the `Hero block`. The default `Slate` tag is still `h2` but you can change it using the rich text options toolbar.
37
+
38
+
29
39
  ## Getting started
30
40
 
31
41
  ### Try volto-hero-block with Docker
@@ -1,4 +1,4 @@
1
- require('dotenv').config({ path: __dirname + '/.env' })
1
+ require('dotenv').config({ path: __dirname + '/.env' });
2
2
 
3
3
  module.exports = {
4
4
  testMatch: ['**/src/addons/**/?(*.)+(spec|test).[jt]s?(x)'],
@@ -28,6 +28,7 @@ module.exports = {
28
28
  ],
29
29
  transform: {
30
30
  '^.+\\.js(x)?$': 'babel-jest',
31
+ '^.+\\.ts(x)?$': 'ts-jest',
31
32
  '^.+\\.(png)$': 'jest-file',
32
33
  '^.+\\.(jpg)$': 'jest-file',
33
34
  '^.+\\.(svg)$': './node_modules/@plone/volto/jest-svgsystem-transform.js',
@@ -45,4 +46,4 @@ module.exports = {
45
46
  '<rootDir>/node_modules/@eeacms/volto-hero-block/jest.setup.js',
46
47
  ],
47
48
  }),
48
- }
49
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-hero-block",
3
- "version": "5.5.0",
3
+ "version": "6.0.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",
@@ -29,6 +29,7 @@
29
29
  "babel-plugin-transform-class-properties": "^6.24.1",
30
30
  "dotenv": "^16.3.2",
31
31
  "husky": "^8.0.3",
32
+ "ts-jest": "^26.4.2",
32
33
  "lint-staged": "^14.0.1",
33
34
  "md5": "^2.3.0"
34
35
  },
@@ -1,23 +1,22 @@
1
- import React from 'react';
1
+ import React, { useState } from 'react';
2
2
  import cx from 'classnames';
3
3
  import isFunction from 'lodash/isFunction';
4
4
  import { Icon } from 'semantic-ui-react';
5
5
  import config from '@plone/volto/registry';
6
+ import { BlocksForm } from '@plone/volto/components';
7
+ import EditBlockWrapper from '@plone/volto/components/manage/Blocks/Block/EditBlockWrapper';
8
+ import { v4 as uuid } from 'uuid';
9
+ import '@eeacms/volto-hero-block/components/Blocks/Hero/edit.css';
10
+
11
+ import { isEmpty } from 'lodash';
6
12
  import {
7
13
  BlockDataForm,
8
14
  SidebarPortal,
9
15
  UniversalLink,
10
16
  } from '@plone/volto/components';
11
17
  import { BodyClass } from '@plone/volto/helpers';
12
- import SlateEditor from '@plone/volto-slate/editor/SlateEditor';
13
- import {
14
- handleKey,
15
- handleKeyDetached,
16
- } from '@plone/volto-slate/blocks/Text/keyboard';
17
- import {
18
- createSlateHeader,
19
- getFieldURL,
20
- } from '@eeacms/volto-hero-block/helpers';
18
+
19
+ import { getFieldURL } from '@eeacms/volto-hero-block/helpers';
21
20
  import { HeroBlockSchema } from './schema';
22
21
  import Copyright from './Copyright';
23
22
  import Hero from './Hero';
@@ -39,23 +38,21 @@ const Metadata = ({ buttonLabel, inverted, styles, ...props }) => {
39
38
  };
40
39
 
41
40
  export default function Edit(props) {
42
- const { slate } = config.settings;
41
+ const id = uuid();
42
+ const [selectedBlock, setSelectedBlock] = useState(id);
43
43
  const {
44
44
  data = {},
45
45
  block = null,
46
- selected = false,
47
- index,
46
+ selected,
48
47
  properties,
49
48
  onChangeBlock,
50
- onSelectBlock,
49
+ onChangeField,
50
+ pathname,
51
+ metadata = null,
52
+ setSidebarTab,
51
53
  } = props;
52
- const {
53
- text,
54
- copyright,
55
- copyrightIcon,
56
- copyrightPosition,
57
- isMultiline,
58
- } = data;
54
+ const { copyright, copyrightIcon, copyrightPosition } = data;
55
+
59
56
  const copyrightPrefix = config.blocks.blocksConfig.hero.copyrightPrefix || '';
60
57
  const schema = React.useMemo(() => {
61
58
  if (isFunction(HeroBlockSchema)) {
@@ -64,80 +61,120 @@ export default function Edit(props) {
64
61
  return HeroBlockSchema;
65
62
  }, [props]);
66
63
 
67
- const withBlockProperties = React.useCallback(
68
- (editor) => {
69
- editor.getBlockProps = () => props;
70
- return editor;
71
- },
72
- [props],
73
- );
64
+ const blockState = {};
65
+ const data_blocks = data?.data?.blocks;
74
66
 
75
- const handleFocus = React.useCallback(() => {
76
- if (!selected) {
77
- onSelectBlock(block);
78
- }
79
- }, [onSelectBlock, selected, block]);
67
+ if (data?.text || isEmpty(data_blocks)) {
68
+ let dataWithoutText = { ...data };
69
+ if (dataWithoutText) delete dataWithoutText.text;
80
70
 
81
- const extensions = React.useMemo(() => {
82
- if (isMultiline) {
83
- return slate.textblockExtensions.filter(
84
- (f) => f.name !== 'withSplitBlocksOnBreak',
85
- );
86
- } else {
87
- return slate.textblockExtensions;
88
- }
89
- }, [slate.textblockExtensions, isMultiline]);
90
-
91
- const value = createSlateHeader(text);
71
+ onChangeBlock(block, {
72
+ ...dataWithoutText,
73
+ data: data?.text
74
+ ? {
75
+ blocks: {
76
+ [id]: {
77
+ '@type': 'slate',
78
+ value: data.text,
79
+ plaintext: data.text?.[0].children?.[0].text,
80
+ },
81
+ },
82
+ blocks_layout: { items: [id] },
83
+ }
84
+ : {
85
+ blocks: {
86
+ [id]: {
87
+ '@type': 'slate',
88
+ value: [{ type: 'h2', children: [{ text: '' }] }],
89
+ plaintext: '',
90
+ },
91
+ },
92
+ blocks_layout: { items: [id] },
93
+ },
94
+ });
95
+ }
92
96
 
93
97
  return (
94
98
  <>
95
99
  <BodyClass className="with-hero-block" />
96
- <Hero {...data}>
97
- <Hero.Text {...data}>
98
- <SlateEditor
99
- key={isMultiline}
100
- detached={!isMultiline}
101
- index={index}
102
- properties={properties}
103
- extensions={extensions}
104
- renderExtensions={[withBlockProperties]}
105
- value={value}
106
- onChange={(text) => {
107
- onChangeBlock(block, {
108
- ...data,
109
- text,
110
- });
111
- }}
112
- block={block}
113
- onFocus={handleFocus}
114
- onKeyDown={isMultiline ? handleKeyDetached : handleKey}
115
- selected={selected}
116
- placeholder="Add text..."
117
- slateSettings={slate}
118
- />
119
- </Hero.Text>
120
- <Hero.Meta {...data}>
121
- <Metadata {...data} />
122
- </Hero.Meta>
123
- {copyright ? (
124
- <Copyright copyrightPosition={copyrightPosition}>
125
- <Copyright.Prefix>{copyrightPrefix}</Copyright.Prefix>
126
- <Copyright.Icon>
127
- <Icon className={copyrightIcon} />
128
- </Copyright.Icon>
129
- <Copyright.Text>{copyright}</Copyright.Text>
130
- </Copyright>
131
- ) : (
132
- ''
133
- )}
134
- </Hero>
135
-
100
+ <div
101
+ className="hero-edit-wrapper"
102
+ role="presentation"
103
+ onClick={(e) => {
104
+ const className = e.target.getAttribute('class');
105
+ if (className && className.includes('hero')) {
106
+ setSelectedBlock(id);
107
+ setSidebarTab(1);
108
+ }
109
+ }}
110
+ >
111
+ <Hero {...data}>
112
+ <Hero.Text {...data}>
113
+ <BlocksForm
114
+ metadata={properties || metadata}
115
+ properties={data.data || {}}
116
+ manage={false}
117
+ allowedBlocks={'slate'}
118
+ selectedBlock={selectedBlock}
119
+ title={data.placeholder}
120
+ onSelectBlock={(s, e) => {
121
+ setSelectedBlock(s);
122
+ }}
123
+ onChangeFormData={(newFormData) => {
124
+ onChangeBlock(block, {
125
+ ...data,
126
+ data: newFormData,
127
+ });
128
+ }}
129
+ onChangeField={(id, value) => {
130
+ if (['blocks', 'blocks_layout'].indexOf(id) > -1) {
131
+ blockState[id] = value;
132
+ onChangeBlock(block, {
133
+ ...data,
134
+ data: {
135
+ ...data.data,
136
+ ...blockState,
137
+ },
138
+ });
139
+ } else {
140
+ onChangeField(id, value);
141
+ }
142
+ }}
143
+ pathname={pathname}
144
+ >
145
+ {({ draginfo }, editBlock, blockProps) => (
146
+ <EditBlockWrapper
147
+ draginfo={draginfo}
148
+ blockProps={blockProps}
149
+ disabled={data.disableInnerButtons}
150
+ >
151
+ {editBlock}
152
+ </EditBlockWrapper>
153
+ )}
154
+ </BlocksForm>
155
+ </Hero.Text>
156
+ <Hero.Meta {...data}>
157
+ <Metadata {...data} />
158
+ </Hero.Meta>
159
+ {copyright ? (
160
+ <Copyright copyrightPosition={copyrightPosition}>
161
+ <Copyright.Prefix>{copyrightPrefix}</Copyright.Prefix>
162
+ <Copyright.Icon>
163
+ <Icon className={copyrightIcon} />
164
+ </Copyright.Icon>
165
+ <Copyright.Text>{copyright}</Copyright.Text>
166
+ </Copyright>
167
+ ) : (
168
+ ''
169
+ )}
170
+ </Hero>
171
+ </div>
136
172
  <SidebarPortal selected={selected}>
137
173
  <BlockDataForm
138
174
  block={block}
139
175
  schema={schema}
140
176
  title={schema.title}
177
+ onChangeBlock={props.onChangeBlock}
141
178
  onChangeField={(id, value) => {
142
179
  onChangeBlock(block, {
143
180
  ...data,
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { render, fireEvent } from '@testing-library/react';
2
+ import { render } from '@testing-library/react';
3
3
  import { Provider } from 'react-redux';
4
4
  import configureStore from 'redux-mock-store';
5
5
  import Edit from './Edit';
@@ -7,25 +7,33 @@ import config from '@plone/volto/registry';
7
7
  import '@testing-library/jest-dom/extend-expect';
8
8
 
9
9
  const mockStore = configureStore([]);
10
-
11
- jest.mock('@plone/volto-slate/editor/SlateEditor', () => {
10
+ const observe = jest.fn();
11
+ const unobserve = jest.fn();
12
+ jest.mock('@plone/volto/components', () => {
12
13
  return {
13
14
  __esModule: true,
14
- default: ({ placeholder, children, onChange, onFocus }) => (
15
- <div
16
- onChange={(target) => onChange(target)}
17
- onFocus={() => onFocus()}
18
- id="test"
19
- >
15
+ BlocksForm: ({ placeholder, children, onChange, onFocus }) => (
16
+ <div id="test">
20
17
  <div>{placeholder}</div>
21
18
  {children}
22
19
  </div>
23
20
  ),
21
+ SidebarPortal: ({ children }) => <div>{children}</div>,
22
+ BlockDataForm: () => <div></div>,
23
+ UniversalLink: () => <div></div>,
24
+ RenderBlocks: () => <div></div>,
24
25
  };
25
26
  });
27
+ jest.mock('react-router-dom', () => ({
28
+ useLocation: jest.fn().mockReturnValue({
29
+ pathname: '/test-jest',
30
+ search: '',
31
+ hash: '',
32
+ state: null,
33
+ key: 'test-jest',
34
+ }),
35
+ }));
26
36
 
27
- const observe = jest.fn();
28
- const unobserve = jest.fn();
29
37
  window.IntersectionObserver = jest.fn((callback) => ({
30
38
  observe,
31
39
  unobserve,
@@ -60,7 +68,7 @@ describe('Edit component', () => {
60
68
  it('renders without crashing', () => {
61
69
  const { container } = render(
62
70
  <Provider store={store}>
63
- <Edit />
71
+ <Edit onChangeBlock={() => {}} onSelectBlock={() => {}} />
64
72
  </Provider>,
65
73
  );
66
74
  expect(container).toBeTruthy();
@@ -82,35 +90,13 @@ describe('Edit component', () => {
82
90
 
83
91
  const { container } = render(
84
92
  <Provider store={store}>
85
- <Edit data={data} />
93
+ <Edit data={data} onChangeBlock={() => {}} />
86
94
  </Provider>,
87
95
  );
88
96
 
89
97
  expect(container.querySelector('#test')).toBeInTheDocument();
90
98
  });
91
99
 
92
- it('calls onFocus when SlateEditor is focused', () => {
93
- config.blocks = {
94
- blocksConfig: {
95
- hero: {
96
- copyrightPrefix: 'Test Prefix',
97
- schema: () => ({
98
- title: 'Hero',
99
- }),
100
- },
101
- },
102
- };
103
- const onSelectBlock = jest.fn();
104
- const { getByText } = render(
105
- <Provider store={store}>
106
- <Edit onSelectBlock={onSelectBlock} />
107
- </Provider>,
108
- );
109
-
110
- fireEvent.focus(getByText('Add text...'));
111
- expect(onSelectBlock).toHaveBeenCalled();
112
- });
113
-
114
100
  it('renders without copyrightPrefix', () => {
115
101
  config.blocks = {
116
102
  blocksConfig: {
@@ -124,7 +110,7 @@ describe('Edit component', () => {
124
110
  const onSelectBlock = jest.fn();
125
111
  render(
126
112
  <Provider store={store}>
127
- <Edit onSelectBlock={onSelectBlock} />
113
+ <Edit onSelectBlock={onSelectBlock} onChangeBlock={() => {}} />
128
114
  </Provider>,
129
115
  );
130
116
  });
@@ -35,6 +35,7 @@ function Hero({
35
35
 
36
36
  const bgImgRef = React.useRef();
37
37
  const onScreen = useFirstVisited(bgImgRef);
38
+
38
39
  return (
39
40
  <div
40
41
  className={cx(
@@ -101,9 +102,10 @@ Hero.Text = ({ children, quoted, styles }) => {
101
102
  'hero-block-text',
102
103
  `color-fg-${textVariant}`,
103
104
  `text-${textAlign}`,
105
+ quoted ? 'quoted-wrapper' : '',
104
106
  )}
105
107
  >
106
- <div className={quoted ? 'quoted-wrapper' : ''}>{children}</div>
108
+ {children}
107
109
  </div>
108
110
  );
109
111
  };
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
  import cx from 'classnames';
3
3
  import { Icon } from 'semantic-ui-react';
4
- import { UniversalLink } from '@plone/volto/components';
4
+ import { UniversalLink, RenderBlocks } from '@plone/volto/components';
5
5
  import { BodyClass } from '@plone/volto/helpers';
6
+ import { useLocation } from 'react-router-dom';
6
7
  import Hero from './Hero';
7
8
  import Copyright from './Copyright';
8
9
  import { serializeText, getFieldURL } from '@eeacms/volto-hero-block/helpers';
@@ -25,14 +26,27 @@ const Metadata = ({ buttonLabel, inverted, styles, ...props }) => {
25
26
  };
26
27
 
27
28
  const View = (props) => {
29
+ const location = useLocation();
28
30
  const { data = {} } = props;
29
31
  const { text, copyright, copyrightIcon, copyrightPosition } = data;
32
+
33
+ const metadata = props.metadata || props.properties;
30
34
  const copyrightPrefix = config.blocks.blocksConfig.hero.copyrightPrefix || '';
31
35
  return (
32
36
  <React.Fragment>
33
37
  <BodyClass className="with-hero-block" />
34
38
  <Hero {...data}>
35
- <Hero.Text {...data}>{serializeText(text)}</Hero.Text>
39
+ <Hero.Text {...data}>
40
+ {data?.data ? (
41
+ <RenderBlocks
42
+ location={location}
43
+ metadata={metadata}
44
+ content={data?.data || {}}
45
+ />
46
+ ) : (
47
+ serializeText(text)
48
+ )}
49
+ </Hero.Text>
36
50
  <Hero.Meta {...data}>
37
51
  <Metadata {...data} />
38
52
  </Hero.Meta>
@@ -9,7 +9,30 @@ window.IntersectionObserver = jest.fn((callback) => ({
9
9
  observe,
10
10
  unobserve,
11
11
  }));
12
-
12
+ jest.mock('@plone/volto/components', () => {
13
+ return {
14
+ __esModule: true,
15
+ BlocksForm: ({ placeholder, children, onChange, onFocus }) => (
16
+ <div id="test">
17
+ <div>{placeholder}</div>
18
+ {children}
19
+ </div>
20
+ ),
21
+ SidebarPortal: ({ children }) => <div>{children}</div>,
22
+ BlockDataForm: () => <div></div>,
23
+ UniversalLink: () => <div></div>,
24
+ RenderBlocks: () => <div></div>,
25
+ };
26
+ });
27
+ jest.mock('react-router-dom', () => ({
28
+ useLocation: jest.fn().mockReturnValue({
29
+ pathname: '/test-jest',
30
+ search: '',
31
+ hash: '',
32
+ state: null,
33
+ key: 'test-jest',
34
+ }),
35
+ }));
13
36
  describe('View Component', () => {
14
37
  it('renders view component', () => {
15
38
  config.blocks = {
@@ -0,0 +1,5 @@
1
+ .hero-block .block-add-button,
2
+ .hero-block .drag.handle.wrapper,
3
+ .hero-block .block-editor-slate:first-of-type .delete-button {
4
+ display: none !important;
5
+ }
@@ -22,7 +22,7 @@ const intl = createIntl(
22
22
  cache,
23
23
  );
24
24
 
25
- export default (config) => {
25
+ const applyConfig = (config) => {
26
26
  config.blocks.blocksConfig.hero = {
27
27
  id: 'hero',
28
28
  title: 'Hero',
@@ -50,3 +50,5 @@ export default (config) => {
50
50
 
51
51
  return config;
52
52
  };
53
+
54
+ export default applyConfig;
@@ -26,7 +26,6 @@ export const HeroBlockSchema = () => {
26
26
  'quoted',
27
27
  'spaced',
28
28
  'inverted',
29
- 'isMultiline',
30
29
  'buttonLabel',
31
30
  'buttonLink',
32
31
  'overlay',
@@ -65,11 +64,6 @@ export const HeroBlockSchema = () => {
65
64
  type: 'boolean',
66
65
  defaultValue: true,
67
66
  },
68
- isMultiline: {
69
- title: 'Multiline',
70
- type: 'boolean',
71
- defaultValue: false,
72
- },
73
67
  buttonLabel: {
74
68
  title: 'Button label',
75
69
  widget: 'textarea',