Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed Jul 2, 2020
1 parent 8d4a2a8 commit 4405c5e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 32 deletions.
16 changes: 0 additions & 16 deletions .eslintrc.json

This file was deleted.

21 changes: 7 additions & 14 deletions src/editor/plugins/Blockquote/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import {BlockButton} from 'volto-slate/editor/components/ui';
import { BlockButton } from 'volto-slate/editor/components/ui';
import quoteIcon from '@plone/volto/icons/quote.svg';

export const BlockQuoteElement = ({ attributes, children, element }) => {
export const BlockquoteElement = ({ attributes, children, element }) => {
// the 'callout' class is defined in file 'blocks.less'
// TODO: move the style out of it into a `blockquote` tag name selector
return (
Expand All @@ -15,20 +15,13 @@ export const BlockQuoteElement = ({ attributes, children, element }) => {
export default function install(config) {
const { slate } = config.settings;

slate.buttons['block-quote'] = (props) => (
<BlockButton format="block-quote" icon={quoteIcon} {...props} />
slate.buttons['blockquote'] = (props) => (
<BlockButton format="blockquote" icon={quoteIcon} {...props} />
);
slate.elements['blockquote'] = BlockquoteElement;

slate.elements = {
...slate.elements,
'block-quote': BlockQuoteElement,
};

slate.toolbarButtons = [...(slate.toolbarButtons || []), 'block-quote'];
slate.expandedToolbarButtons = [
...(slate.expandedToolbarButtons || []),
'block-quote',
];
slate.toolbarButtons.push('blockquote');
slate.expandedToolbarButtons.push('blockquote');

return config;
}
3 changes: 1 addition & 2 deletions src/editor/plugins/Markdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { withShortcuts } from './decorators';
// TODO: this plugin seems to not work well
// (e.g. # and ## characters do not turn the block into a header)
export default function install(config) {
const slate = config.settings.slate || {};
config.settings.slate = slate;
const { slate } = config.settings;

slate.decorators = [...(slate.decorators || []), withShortcuts];

Expand Down

0 comments on commit 4405c5e

Please sign in to comment.