-
Notifications
You must be signed in to change notification settings - Fork 64
/
index.js
48 lines (43 loc) · 1.29 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import React from 'react';
import ReactDOM from 'react-dom';
import {
INLINE_CONTROL,
BLOCK_CONTROL,
ENTITY_CONTROL,
BR_ICON,
} from './constants/ui';
import indexContentState from './constants/indexContentState';
import PrismDecorator from './components/PrismDecorator';
import EditorWrapper from './components/EditorWrapper';
const editor = (
<EditorWrapper
id="index"
rawContentState={indexContentState}
ariaDescribedBy="demo-editor-index"
placeholder="Write here…"
enableHorizontalRule={true}
enableLineBreak={{
icon: BR_ICON,
}}
stripPastedStyles={false}
decorators={[new PrismDecorator({ defaultLanguage: 'javascript' })]}
entityTypes={[
ENTITY_CONTROL.LINK,
ENTITY_CONTROL.IMAGE,
ENTITY_CONTROL.EMBED,
]}
blockTypes={[
BLOCK_CONTROL.HEADER_TWO,
BLOCK_CONTROL.HEADER_THREE,
BLOCK_CONTROL.BLOCKQUOTE,
BLOCK_CONTROL.CODE,
BLOCK_CONTROL.UNORDERED_LIST_ITEM,
]}
inlineStyles={[
INLINE_CONTROL.BOLD,
INLINE_CONTROL.ITALIC,
INLINE_CONTROL.KEYBOARD,
]}
/>
);
ReactDOM.render(editor, document.querySelector('[data-mount-index]'));