@plone/volto 16.0.0-alpha.6 → 16.0.0-alpha.7

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
@@ -1,5 +1,15 @@
1
1
  # Change Log
2
2
 
3
+ ## 16.0.0-alpha.7 (2022-06-01)
4
+
5
+ ### Bugfix
6
+
7
+ - fix schema when content contains lock informations. @giuliaghisini
8
+
9
+ ### Internal
10
+
11
+ - Missing change from the last breaking change (Remove the style wrapper around the `<Block />` component in Edit mode, moved to the main edit wrapper). Now, really move it to the main edit wrapper @sneridagh
12
+
3
13
  ## 16.0.0-alpha.6 (2022-05-31)
4
14
 
5
15
  ### Breaking
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  }
10
10
  ],
11
11
  "license": "MIT",
12
- "version": "16.0.0-alpha.6",
12
+ "version": "16.0.0-alpha.7",
13
13
  "repository": {
14
14
  "type": "git",
15
15
  "url": "git@github.com:plone/volto.git"
@@ -1,6 +1,9 @@
1
1
  import React from 'react';
2
2
  import { Icon } from '@plone/volto/components';
3
- import { blockHasValue } from '@plone/volto/helpers';
3
+ import {
4
+ blockHasValue,
5
+ buildStyleClassNamesFromData,
6
+ } from '@plone/volto/helpers';
4
7
  import dragSVG from '@plone/volto/icons/drag.svg';
5
8
  import { Button } from 'semantic-ui-react';
6
9
  import includes from 'lodash/includes';
@@ -31,6 +34,8 @@ const EditBlockWrapper = (props) => {
31
34
  ? data.required
32
35
  : includes(config.blocks.requiredBlocks, type);
33
36
 
37
+ const styles = buildStyleClassNamesFromData(data.styles);
38
+
34
39
  return (
35
40
  <div
36
41
  ref={draginfo.innerRef}
@@ -38,9 +43,8 @@ const EditBlockWrapper = (props) => {
38
43
  // Right now, we can have the alignment information in the styles property or in the
39
44
  // block data root, we inject the classname here for having control over the whole
40
45
  // Block Edit wrapper
41
- className={cx(`block-editor-${data['@type']}`, {
46
+ className={cx(`block-editor-${data['@type']}`, styles, {
42
47
  [data.align]: data.align,
43
- [data.styles?.align]: data.styles?.align,
44
48
  })}
45
49
  >
46
50
  <div style={{ position: 'relative' }}>
@@ -39,7 +39,8 @@ const DefaultView = (props) => {
39
39
  );
40
40
 
41
41
  React.useEffect(() => {
42
- !hasBlocksData(content) &&
42
+ content?.['@type'] &&
43
+ !hasBlocksData(content) &&
43
44
  dispatch(getSchema(content['@type'], location.pathname));
44
45
  // eslint-disable-next-line react-hooks/exhaustive-deps
45
46
  }, []);
@@ -52,7 +53,7 @@ const DefaultView = (props) => {
52
53
  <Container id="page-document">
53
54
  {fieldsets?.map((fs) => {
54
55
  return (
55
- <>
56
+ <div className="fieldset" key={fs.id}>
56
57
  {fs.id !== 'default' && <h2>{fs.title}</h2>}
57
58
  {fs.fields?.map((f, key) => {
58
59
  let field = {
@@ -76,7 +77,7 @@ const DefaultView = (props) => {
76
77
  <Widget key={key} value={content[f]} />
77
78
  );
78
79
  })}
79
- </>
80
+ </div>
80
81
  );
81
82
  })}
82
83
  </Container>