Created
November 9, 2017 22:06
-
-
Save nikgraf/a814e755d23437b9d9d7f2c8078afb54 to your computer and use it in GitHub Desktop.
draft-js-plugins 2.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Editor, { composeDecorators } from 'draft-js-plugins-editor'; | |
import createImagePlugin from 'draft-js-image-plugin'; | |
import createAlignmentPlugin from 'draft-js-alignment-plugin'; | |
import createFocusPlugin from 'draft-js-focus-plugin'; | |
import createBlockDndPlugin from 'draft-js-drag-n-drop-plugin'; | |
const focusPlugin = createFocusPlugin(); | |
const blockDndPlugin = createBlockDndPlugin(); | |
const alignmentPlugin = createAlignmentPlugin(); | |
const decorator = composeDecorators( | |
alignmentPlugin.decorator, | |
focusPlugin.decorator, | |
blockDndPlugin.decorator | |
); | |
const imagePlugin = createImagePlugin({ decorator }); | |
const plugins = [ | |
blockDndPlugin, | |
focusPlugin, | |
alignmentPlugin, | |
resizeablePlugin, | |
imagePlugin | |
]; | |
const { AlignmentTool } = alignmentPlugin; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment