Skip to content

Commit

Permalink
chore(package.json): increase version to 6.2.0
Browse files Browse the repository at this point in the history
feat(EditBlockWrapper.jsx): add support for custom styles and alignment in block editor
  • Loading branch information
razvanMiu committed Apr 4, 2023
1 parent 5738a85 commit 74e7a41
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-columns-block",
"version": "6.1.0",
"version": "6.2.0",
"description": "volto-columns-block: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
11 changes: 9 additions & 2 deletions src/ColumnsBlock/EditBlockWrapper.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import React from 'react';
import { Icon, BlockChooser } from '@plone/volto/components';
import { blockHasValue } from '@plone/volto/helpers';
import {
blockHasValue,
buildStyleClassNamesFromData,
} from '@plone/volto/helpers';
import config from '@plone/volto/registry';
import { Button } from 'semantic-ui-react';
import includes from 'lodash/includes';
Expand Down Expand Up @@ -79,12 +82,16 @@ class EditBlockWrapper extends React.Component {
? data.required
: includes(config.blocks.requiredBlocks, type);

const styles = buildStyleClassNamesFromData(data.styles);

return (
<div ref={this.blockNode}>
<div
ref={draginfo?.innerRef}
{...(selected ? draginfo?.draggableProps : null)}
className={`block-editor-${data['@type']}`}
className={cx(`block-editor-${data['@type']}`, styles, {
[data.align]: data.align,
})}
>
{!selected && (
<div
Expand Down

0 comments on commit 74e7a41

Please sign in to comment.