@mirrormedia/lilith-draft-editor 2.0.0 → 2.1.0
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/@types/draft-js/buttons/annotation.d.ts +2 -0
- package/@types/draft-js/buttons/audio.d.ts +9 -0
- package/@types/draft-js/buttons/background-color.d.ts +2 -0
- package/@types/draft-js/buttons/background-image.d.ts +35 -0
- package/@types/draft-js/buttons/background-video.d.ts +35 -0
- package/@types/draft-js/buttons/color-box.d.ts +29 -0
- package/@types/draft-js/buttons/divider.d.ts +2 -0
- package/@types/draft-js/buttons/embedded-code.d.ts +2 -0
- package/@types/draft-js/buttons/enlarge.d.ts +2 -0
- package/@types/draft-js/buttons/font-color.d.ts +2 -0
- package/@types/draft-js/buttons/image.d.ts +9 -0
- package/@types/draft-js/buttons/info-box.d.ts +27 -0
- package/@types/draft-js/buttons/link.d.ts +2 -0
- package/@types/draft-js/buttons/media.d.ts +2 -0
- package/@types/draft-js/buttons/related-post.d.ts +13 -0
- package/@types/draft-js/buttons/selector/align-selector.d.ts +15 -0
- package/@types/draft-js/buttons/selector/audio-selector.d.ts +21 -0
- package/@types/draft-js/buttons/selector/image-selector.d.ts +34 -0
- package/@types/draft-js/buttons/selector/pagination.d.ts +7 -0
- package/@types/draft-js/buttons/selector/post-selector.d.ts +22 -0
- package/@types/draft-js/buttons/selector/search-box.d.ts +6 -0
- package/@types/draft-js/buttons/selector/video-selector.d.ts +24 -0
- package/@types/draft-js/buttons/side-index.d.ts +25 -0
- package/@types/draft-js/buttons/slideshow.d.ts +9 -0
- package/@types/draft-js/buttons/table.d.ts +2 -0
- package/@types/draft-js/buttons/text-align.d.ts +4 -0
- package/@types/draft-js/buttons/video.d.ts +9 -0
- package/@types/draft-js/buttons/youtube.d.ts +23 -0
- package/@types/draft-js/const.d.ts +1 -0
- package/@types/draft-js/draft-converter/api-data-instance.d.ts +11 -0
- package/@types/draft-js/draft-converter/atomic-block-processor.d.ts +17 -0
- package/@types/draft-js/draft-converter/entities.d.ts +74 -0
- package/@types/draft-js/draft-converter/index.d.ts +8 -0
- package/@types/draft-js/draft-converter/inline-styles-processor.d.ts +1 -0
- package/@types/draft-js/modifier.d.ts +6 -0
- package/@types/draft-js/util.d.ts +1 -0
- package/@types/index.d.ts +4 -0
- package/@types/website/mirrormedia/block-renderer/background-image-block.d.ts +17 -0
- package/@types/website/mirrormedia/block-renderer/background-video-block.d.ts +17 -0
- package/@types/website/mirrormedia/block-renderer/color-box-block.d.ts +17 -0
- package/@types/website/mirrormedia/block-renderer/embedded-code-block.d.ts +5 -0
- package/@types/website/mirrormedia/block-renderer/image-block.d.ts +15 -0
- package/@types/website/mirrormedia/block-renderer/info-box-block.d.ts +17 -0
- package/@types/website/mirrormedia/block-renderer/side-index-block.d.ts +15 -0
- package/@types/website/mirrormedia/block-renderer/slideshow-block.d.ts +16 -0
- package/@types/website/mirrormedia/block-renderer/table-block.d.ts +16 -0
- package/@types/website/mirrormedia/block-renderer-fn.d.ts +4 -0
- package/@types/website/mirrormedia/draft-editor.d.ts +75 -0
- package/@types/website/mirrormedia/entity-decorator.d.ts +3 -0
- package/@types/website/mirrormedia/index.d.ts +5 -0
- package/@types/website/mirrormedia/selector/align-selector.d.ts +15 -0
- package/@types/website/mirrormedia/selector/audio-selector.d.ts +20 -0
- package/@types/website/mirrormedia/selector/image-selector.d.ts +44 -0
- package/@types/website/mirrormedia/selector/pagination.d.ts +7 -0
- package/@types/website/mirrormedia/selector/post-selector.d.ts +21 -0
- package/@types/website/mirrormedia/selector/search-box.d.ts +6 -0
- package/@types/website/mirrormedia/selector/video-selector.d.ts +23 -0
- package/@types/website/mirrormedia/shared-style/index.d.ts +3 -0
- package/@types/website/mirrormedia/theme/index.d.ts +19 -0
- package/@types/website/readr/block-renderer/background-image-block.d.ts +29 -0
- package/@types/website/readr/block-renderer/background-video-block.d.ts +29 -0
- package/@types/website/readr/block-renderer/color-box-block.d.ts +17 -0
- package/@types/website/readr/block-renderer/image-block.d.ts +15 -0
- package/@types/website/readr/block-renderer/info-box-block.d.ts +17 -0
- package/@types/website/readr/block-renderer/side-index-block.d.ts +15 -0
- package/@types/website/readr/block-renderer/table-block.d.ts +16 -0
- package/@types/website/readr/block-renderer-fn.d.ts +4 -0
- package/@types/website/readr/draft-editor.d.ts +74 -0
- package/@types/website/readr/entity-decorator.d.ts +3 -0
- package/@types/website/readr/index.d.ts +5 -0
- package/@types/website/readr/selector/align-selector.d.ts +15 -0
- package/@types/website/readr/selector/audio-selector.d.ts +18 -0
- package/@types/website/readr/selector/image-selector.d.ts +36 -0
- package/@types/website/readr/selector/pagination.d.ts +7 -0
- package/@types/website/readr/selector/post-selector.d.ts +20 -0
- package/@types/website/readr/selector/search-box.d.ts +6 -0
- package/@types/website/readr/selector/video-selector.d.ts +23 -0
- package/@types/website/readr/theme/index.d.ts +30 -0
- package/README.md +1 -1
- package/package.json +13 -11
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ContentBlock, ContentState } from 'draft-js';
|
|
3
|
+
import { RenderBasicEditor } from '../../../draft-js/buttons/info-box';
|
|
4
|
+
declare type InfoBoxBlockProps = {
|
|
5
|
+
block: ContentBlock;
|
|
6
|
+
blockProps: {
|
|
7
|
+
onEditStart: () => void;
|
|
8
|
+
onEditFinish: ({ entityKey, entityData, }: {
|
|
9
|
+
entityKey?: string;
|
|
10
|
+
entityData?: Record<string, unknown>;
|
|
11
|
+
}) => void;
|
|
12
|
+
renderBasicEditor: RenderBasicEditor;
|
|
13
|
+
};
|
|
14
|
+
contentState: ContentState;
|
|
15
|
+
};
|
|
16
|
+
export declare function InfoBoxEditorBlock(props: InfoBoxBlockProps): JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ContentBlock, ContentState } from 'draft-js';
|
|
3
|
+
declare type SideIndexBlockProps = {
|
|
4
|
+
block: ContentBlock;
|
|
5
|
+
blockProps: {
|
|
6
|
+
onEditStart: () => void;
|
|
7
|
+
onEditFinish: ({ entityKey, entityData, }: {
|
|
8
|
+
entityKey?: string;
|
|
9
|
+
entityData?: Record<string, unknown>;
|
|
10
|
+
}) => void;
|
|
11
|
+
};
|
|
12
|
+
contentState: ContentState;
|
|
13
|
+
};
|
|
14
|
+
export declare function SideIndexEditorBlock(props: SideIndexBlockProps): JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ContentBlock, ContentState } from 'draft-js';
|
|
3
|
+
declare type SlideshowBlockProps = {
|
|
4
|
+
block: ContentBlock;
|
|
5
|
+
blockProps: {
|
|
6
|
+
onEditStart: () => void;
|
|
7
|
+
onEditFinish: ({ entityKey, entityData, }: {
|
|
8
|
+
entityKey?: string;
|
|
9
|
+
entityData?: Record<string, unknown>;
|
|
10
|
+
}) => void;
|
|
11
|
+
};
|
|
12
|
+
contentState: ContentState;
|
|
13
|
+
};
|
|
14
|
+
export declare function SlideshowEditBlock(props: SlideshowBlockProps): JSX.Element;
|
|
15
|
+
export declare function SlideshowEditBlockV2(props: SlideshowBlockProps): JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ContentBlock, ContentState } from 'draft-js';
|
|
3
|
+
declare type TableBlockProps = {
|
|
4
|
+
block: ContentBlock;
|
|
5
|
+
blockProps: {
|
|
6
|
+
onEditStart: () => void;
|
|
7
|
+
onEditFinish: ({ entityKey, entityData, }: {
|
|
8
|
+
entityKey?: string;
|
|
9
|
+
entityData?: Record<string, unknown>;
|
|
10
|
+
}) => void;
|
|
11
|
+
getMainEditorReadOnly: () => boolean;
|
|
12
|
+
};
|
|
13
|
+
contentState: ContentState;
|
|
14
|
+
};
|
|
15
|
+
export declare const TableEditorBlock: (props: TableBlockProps) => JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EditorState } from 'draft-js';
|
|
3
|
+
export declare const buttonNames: {
|
|
4
|
+
bold: string;
|
|
5
|
+
italic: string;
|
|
6
|
+
underline: string;
|
|
7
|
+
code: string;
|
|
8
|
+
h2: string;
|
|
9
|
+
h3: string;
|
|
10
|
+
h4: string;
|
|
11
|
+
blockquote: string;
|
|
12
|
+
ul: string;
|
|
13
|
+
ol: string;
|
|
14
|
+
codeBlock: string;
|
|
15
|
+
annotation: string;
|
|
16
|
+
divider: string;
|
|
17
|
+
embed: string;
|
|
18
|
+
fontColor: string;
|
|
19
|
+
image: string;
|
|
20
|
+
infoBox: string;
|
|
21
|
+
link: string;
|
|
22
|
+
slideshow: string;
|
|
23
|
+
table: string;
|
|
24
|
+
textAlign: string;
|
|
25
|
+
colorBox: string;
|
|
26
|
+
backgroundColor: string;
|
|
27
|
+
backgroundImage: string;
|
|
28
|
+
backgroundVideo: string;
|
|
29
|
+
relatedPost: string;
|
|
30
|
+
sideIndex: string;
|
|
31
|
+
video: string;
|
|
32
|
+
audio: string;
|
|
33
|
+
youtube: string;
|
|
34
|
+
};
|
|
35
|
+
declare type RichTextEditorProps = {
|
|
36
|
+
onChange: (editorState: EditorState) => void;
|
|
37
|
+
editorState: EditorState;
|
|
38
|
+
disabledButtons: string[];
|
|
39
|
+
};
|
|
40
|
+
declare type State = {
|
|
41
|
+
isEnlarged?: boolean;
|
|
42
|
+
readOnly: boolean;
|
|
43
|
+
};
|
|
44
|
+
declare class RichTextEditor extends React.Component<RichTextEditorProps, State> {
|
|
45
|
+
customStyleMap: {
|
|
46
|
+
CODE: {
|
|
47
|
+
backgroundColor: string;
|
|
48
|
+
fontFamily: string;
|
|
49
|
+
fontSize: number;
|
|
50
|
+
padding: number;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
constructor(props: any);
|
|
54
|
+
onChange: (editorState: any) => void;
|
|
55
|
+
handleKeyCommand: (command: any, editorState: any) => boolean;
|
|
56
|
+
handleReturn: (event: any) => "handled" | "not-handled";
|
|
57
|
+
mapKeyToEditorCommand: (e: any) => Draft.Model.Constants.DraftEditorCommand | null | undefined;
|
|
58
|
+
toggleBlockType: (blockType: any) => void;
|
|
59
|
+
toggleInlineStyle: (inlineStyle: any) => void;
|
|
60
|
+
getEntityType: (editorState: any) => string;
|
|
61
|
+
getCustomStyle: (style: any) => any;
|
|
62
|
+
toggleEnlarge: () => void;
|
|
63
|
+
customStyleFn: (style: any) => any;
|
|
64
|
+
blockStyleFn(block: any): string;
|
|
65
|
+
blockRendererFn: (block: any) => {
|
|
66
|
+
component: (props: any) => any;
|
|
67
|
+
editable: boolean;
|
|
68
|
+
} | null;
|
|
69
|
+
render(): JSX.Element;
|
|
70
|
+
}
|
|
71
|
+
declare const DraftEditor: {
|
|
72
|
+
RichTextEditor: typeof RichTextEditor;
|
|
73
|
+
decorators: Draft.Model.Decorators.CompositeDraftDecorator;
|
|
74
|
+
};
|
|
75
|
+
export default DraftEditor;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type Option = {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
isDisabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare type AlignSelectorOnChangeFn = (param: string) => void;
|
|
8
|
+
declare type Options = Option[];
|
|
9
|
+
export declare function AlignSelector(props: {
|
|
10
|
+
align: string;
|
|
11
|
+
options: Options;
|
|
12
|
+
onChange: AlignSelectorOnChangeFn;
|
|
13
|
+
onOpen?: () => void;
|
|
14
|
+
}): JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ImageEntity } from './image-selector';
|
|
3
|
+
declare type ID = string;
|
|
4
|
+
export declare type AudioEntity = {
|
|
5
|
+
id: ID;
|
|
6
|
+
name?: string;
|
|
7
|
+
audioSrc?: string;
|
|
8
|
+
file?: {
|
|
9
|
+
url: string;
|
|
10
|
+
};
|
|
11
|
+
heroImage?: ImageEntity;
|
|
12
|
+
};
|
|
13
|
+
export declare type AudioEntityWithMeta = {
|
|
14
|
+
audio: AudioEntity;
|
|
15
|
+
};
|
|
16
|
+
declare type AudioSelectorOnChangeFn = (params: AudioEntityWithMeta[]) => void;
|
|
17
|
+
export declare function AudioSelector(props: {
|
|
18
|
+
onChange: AudioSelectorOnChangeFn;
|
|
19
|
+
}): JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type ID = string;
|
|
3
|
+
export declare type ImageEntityImageFile = {
|
|
4
|
+
url: string;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
};
|
|
8
|
+
export declare type ImageEntityResized = {
|
|
9
|
+
original: string;
|
|
10
|
+
w480: string;
|
|
11
|
+
w800: string;
|
|
12
|
+
w1200: string;
|
|
13
|
+
w1600: string;
|
|
14
|
+
w2400: string;
|
|
15
|
+
};
|
|
16
|
+
export declare type ImageEntity = {
|
|
17
|
+
id: ID;
|
|
18
|
+
name?: string;
|
|
19
|
+
imageFile: {
|
|
20
|
+
url: string;
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
};
|
|
24
|
+
resized: ImageEntityResized;
|
|
25
|
+
resizedWebp: ImageEntityResized;
|
|
26
|
+
};
|
|
27
|
+
export declare type ImageEntityWithMeta = {
|
|
28
|
+
image: ImageEntity;
|
|
29
|
+
desc?: string;
|
|
30
|
+
url?: string;
|
|
31
|
+
};
|
|
32
|
+
export declare type ImageSelectorOnChangeFn = (params: ImageEntityWithMeta[], align?: string, delay?: number) => void;
|
|
33
|
+
export declare function ImageSelector(props: {
|
|
34
|
+
enableMultiSelect?: boolean;
|
|
35
|
+
enableCaption?: boolean;
|
|
36
|
+
enableUrl?: boolean;
|
|
37
|
+
enableAlignment?: boolean;
|
|
38
|
+
enableDelay?: boolean;
|
|
39
|
+
onChange: ImageSelectorOnChangeFn;
|
|
40
|
+
initialSelected?: ImageEntityWithMeta[];
|
|
41
|
+
initialAlign?: string;
|
|
42
|
+
initialDelay?: number;
|
|
43
|
+
}): JSX.Element;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ImageEntity } from './image-selector';
|
|
3
|
+
declare type ID = string;
|
|
4
|
+
export declare type PostEntity = {
|
|
5
|
+
id: ID;
|
|
6
|
+
title: string;
|
|
7
|
+
slug: string;
|
|
8
|
+
heroImage: ImageEntity;
|
|
9
|
+
og_image: ImageEntity;
|
|
10
|
+
};
|
|
11
|
+
export declare type PostEntityWithMeta = {
|
|
12
|
+
post: PostEntity;
|
|
13
|
+
};
|
|
14
|
+
declare type PostSelectorOnChangeFn = (params: PostEntityWithMeta[]) => void;
|
|
15
|
+
export declare function PostSelector(props: {
|
|
16
|
+
onChange: PostSelectorOnChangeFn;
|
|
17
|
+
enableMultiSelect?: boolean;
|
|
18
|
+
minSelectCount?: number;
|
|
19
|
+
maxSelectCount?: number;
|
|
20
|
+
}): JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ImageEntity } from './image-selector';
|
|
3
|
+
declare type ID = string;
|
|
4
|
+
export declare type VideoEntity = {
|
|
5
|
+
id: ID;
|
|
6
|
+
name?: string;
|
|
7
|
+
videoSrc: string;
|
|
8
|
+
youtubeUrl?: string;
|
|
9
|
+
file: {
|
|
10
|
+
filename?: string;
|
|
11
|
+
filesize: number;
|
|
12
|
+
url: string;
|
|
13
|
+
};
|
|
14
|
+
heroImage: ImageEntity;
|
|
15
|
+
};
|
|
16
|
+
export declare type VideoEntityWithMeta = {
|
|
17
|
+
video: VideoEntity;
|
|
18
|
+
};
|
|
19
|
+
declare type VideoSelectorOnChangeFn = (params: VideoEntityWithMeta[]) => void;
|
|
20
|
+
export declare function VideoSelector(props: {
|
|
21
|
+
onChange: VideoSelectorOnChangeFn;
|
|
22
|
+
}): JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const mediaSize: {
|
|
2
|
+
xs: number;
|
|
3
|
+
sm: number;
|
|
4
|
+
md: number;
|
|
5
|
+
lg: number;
|
|
6
|
+
xl: number;
|
|
7
|
+
xxl: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const theme: {
|
|
10
|
+
breakpoint: {
|
|
11
|
+
xs: string;
|
|
12
|
+
sm: string;
|
|
13
|
+
md: string;
|
|
14
|
+
lg: string;
|
|
15
|
+
xl: string;
|
|
16
|
+
xxl: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export default theme;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ContentBlock, ContentState } from 'draft-js';
|
|
3
|
+
import { RenderBasicEditor } from '../../../draft-js/buttons/background-image';
|
|
4
|
+
declare type BGImageBlockProps = {
|
|
5
|
+
block: ContentBlock;
|
|
6
|
+
blockProps: {
|
|
7
|
+
onEditStart: () => void;
|
|
8
|
+
onEditFinish: ({ entityKey, entityData, }: {
|
|
9
|
+
entityKey?: string;
|
|
10
|
+
entityData?: Record<string, unknown>;
|
|
11
|
+
}) => void;
|
|
12
|
+
};
|
|
13
|
+
contentState: ContentState;
|
|
14
|
+
};
|
|
15
|
+
export declare function BGImageBlock(props: BGImageBlockProps): JSX.Element;
|
|
16
|
+
declare type BGImageEditorBlockProps = {
|
|
17
|
+
block: ContentBlock;
|
|
18
|
+
blockProps: {
|
|
19
|
+
onEditStart: () => void;
|
|
20
|
+
onEditFinish: ({ entityKey, entityData, }: {
|
|
21
|
+
entityKey?: string;
|
|
22
|
+
entityData?: Record<string, unknown>;
|
|
23
|
+
}) => void;
|
|
24
|
+
renderBasicEditor: RenderBasicEditor;
|
|
25
|
+
};
|
|
26
|
+
contentState: ContentState;
|
|
27
|
+
};
|
|
28
|
+
export declare function BGImageEditorBlock(props: BGImageEditorBlockProps): JSX.Element;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ContentBlock, ContentState } from 'draft-js';
|
|
3
|
+
import { RenderBasicEditor } from '../../../draft-js/buttons/background-video';
|
|
4
|
+
declare type BGVideoBlockProps = {
|
|
5
|
+
block: ContentBlock;
|
|
6
|
+
blockProps: {
|
|
7
|
+
onEditStart: () => void;
|
|
8
|
+
onEditFinish: ({ entityKey, entityData, }: {
|
|
9
|
+
entityKey?: string;
|
|
10
|
+
entityData?: Record<string, unknown>;
|
|
11
|
+
}) => void;
|
|
12
|
+
};
|
|
13
|
+
contentState: ContentState;
|
|
14
|
+
};
|
|
15
|
+
export declare function BGVideoBlock(props: BGVideoBlockProps): JSX.Element;
|
|
16
|
+
declare type BGVideoEditorBlockProps = {
|
|
17
|
+
block: ContentBlock;
|
|
18
|
+
blockProps: {
|
|
19
|
+
onEditStart: () => void;
|
|
20
|
+
onEditFinish: ({ entityKey, entityData, }: {
|
|
21
|
+
entityKey?: string;
|
|
22
|
+
entityData?: Record<string, unknown>;
|
|
23
|
+
}) => void;
|
|
24
|
+
renderBasicEditor: RenderBasicEditor;
|
|
25
|
+
};
|
|
26
|
+
contentState: ContentState;
|
|
27
|
+
};
|
|
28
|
+
export declare function BGVideoEditorBlock(props: BGVideoEditorBlockProps): JSX.Element;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ContentBlock, ContentState } from 'draft-js';
|
|
3
|
+
import { RenderBasicEditor } from '../../../draft-js/buttons/color-box';
|
|
4
|
+
declare type ColorBoxBlockProps = {
|
|
5
|
+
block: ContentBlock;
|
|
6
|
+
blockProps: {
|
|
7
|
+
onEditStart: () => void;
|
|
8
|
+
onEditFinish: ({ entityKey, entityData, }: {
|
|
9
|
+
entityKey?: string;
|
|
10
|
+
entityData?: Record<string, unknown>;
|
|
11
|
+
}) => void;
|
|
12
|
+
renderBasicEditor: RenderBasicEditor;
|
|
13
|
+
};
|
|
14
|
+
contentState: ContentState;
|
|
15
|
+
};
|
|
16
|
+
export declare function ColorBoxEditorBlock(props: ColorBoxBlockProps): JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ContentBlock, ContentState } from 'draft-js';
|
|
3
|
+
declare type ImageBlockProps = {
|
|
4
|
+
block: ContentBlock;
|
|
5
|
+
blockProps: {
|
|
6
|
+
onEditStart: () => void;
|
|
7
|
+
onEditFinish: ({ entityKey, entityData, }: {
|
|
8
|
+
entityKey?: string;
|
|
9
|
+
entityData?: Record<string, unknown>;
|
|
10
|
+
}) => void;
|
|
11
|
+
};
|
|
12
|
+
contentState: ContentState;
|
|
13
|
+
};
|
|
14
|
+
export declare function ImageEditorBlock(props: ImageBlockProps): JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ContentBlock, ContentState } from 'draft-js';
|
|
3
|
+
import { RenderBasicEditor } from '../../../draft-js/buttons/info-box';
|
|
4
|
+
declare type InfoBoxBlockProps = {
|
|
5
|
+
block: ContentBlock;
|
|
6
|
+
blockProps: {
|
|
7
|
+
onEditStart: () => void;
|
|
8
|
+
onEditFinish: ({ entityKey, entityData, }: {
|
|
9
|
+
entityKey?: string;
|
|
10
|
+
entityData?: Record<string, unknown>;
|
|
11
|
+
}) => void;
|
|
12
|
+
renderBasicEditor: RenderBasicEditor;
|
|
13
|
+
};
|
|
14
|
+
contentState: ContentState;
|
|
15
|
+
};
|
|
16
|
+
export declare function InfoBoxEditorBlock(props: InfoBoxBlockProps): JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ContentBlock, ContentState } from 'draft-js';
|
|
3
|
+
declare type SideIndexBlockProps = {
|
|
4
|
+
block: ContentBlock;
|
|
5
|
+
blockProps: {
|
|
6
|
+
onEditStart: () => void;
|
|
7
|
+
onEditFinish: ({ entityKey, entityData, }: {
|
|
8
|
+
entityKey?: string;
|
|
9
|
+
entityData?: Record<string, unknown>;
|
|
10
|
+
}) => void;
|
|
11
|
+
};
|
|
12
|
+
contentState: ContentState;
|
|
13
|
+
};
|
|
14
|
+
export declare function SideIndexEditorBlock(props: SideIndexBlockProps): JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ContentBlock, ContentState } from 'draft-js';
|
|
3
|
+
declare type TableBlockProps = {
|
|
4
|
+
block: ContentBlock;
|
|
5
|
+
blockProps: {
|
|
6
|
+
onEditStart: () => void;
|
|
7
|
+
onEditFinish: ({ entityKey, entityData, }: {
|
|
8
|
+
entityKey?: string;
|
|
9
|
+
entityData?: Record<string, unknown>;
|
|
10
|
+
}) => void;
|
|
11
|
+
getMainEditorReadOnly: () => boolean;
|
|
12
|
+
};
|
|
13
|
+
contentState: ContentState;
|
|
14
|
+
};
|
|
15
|
+
export declare const TableEditorBlock: (props: TableBlockProps) => JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EditorState } from 'draft-js';
|
|
3
|
+
export declare const buttonNames: {
|
|
4
|
+
bold: string;
|
|
5
|
+
italic: string;
|
|
6
|
+
underline: string;
|
|
7
|
+
code: string;
|
|
8
|
+
h2: string;
|
|
9
|
+
h3: string;
|
|
10
|
+
h4: string;
|
|
11
|
+
blockquote: string;
|
|
12
|
+
ul: string;
|
|
13
|
+
ol: string;
|
|
14
|
+
codeBlock: string;
|
|
15
|
+
annotation: string;
|
|
16
|
+
divider: string;
|
|
17
|
+
embed: string;
|
|
18
|
+
fontColor: string;
|
|
19
|
+
image: string;
|
|
20
|
+
infoBox: string;
|
|
21
|
+
link: string;
|
|
22
|
+
slideshow: string;
|
|
23
|
+
table: string;
|
|
24
|
+
textAlign: string;
|
|
25
|
+
colorBox: string;
|
|
26
|
+
backgroundColor: string;
|
|
27
|
+
backgroundImage: string;
|
|
28
|
+
backgroundVideo: string;
|
|
29
|
+
relatedPost: string;
|
|
30
|
+
sideIndex: string;
|
|
31
|
+
video: string;
|
|
32
|
+
audio: string;
|
|
33
|
+
};
|
|
34
|
+
declare type RichTextEditorProps = {
|
|
35
|
+
onChange: (editorState: EditorState) => void;
|
|
36
|
+
editorState: EditorState;
|
|
37
|
+
disabledButtons: string[];
|
|
38
|
+
};
|
|
39
|
+
declare type State = {
|
|
40
|
+
isEnlarged?: boolean;
|
|
41
|
+
readOnly: boolean;
|
|
42
|
+
};
|
|
43
|
+
declare class RichTextEditor extends React.Component<RichTextEditorProps, State> {
|
|
44
|
+
customStyleMap: {
|
|
45
|
+
CODE: {
|
|
46
|
+
backgroundColor: string;
|
|
47
|
+
fontFamily: string;
|
|
48
|
+
fontSize: number;
|
|
49
|
+
padding: number;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
constructor(props: any);
|
|
53
|
+
onChange: (editorState: any) => void;
|
|
54
|
+
handleKeyCommand: (command: any, editorState: any) => boolean;
|
|
55
|
+
handleReturn: (event: any) => "handled" | "not-handled";
|
|
56
|
+
mapKeyToEditorCommand: (e: any) => Draft.Model.Constants.DraftEditorCommand | null | undefined;
|
|
57
|
+
toggleBlockType: (blockType: any) => void;
|
|
58
|
+
toggleInlineStyle: (inlineStyle: any) => void;
|
|
59
|
+
getEntityType: (editorState: any) => string;
|
|
60
|
+
getCustomStyle: (style: any) => any;
|
|
61
|
+
toggleEnlarge: () => void;
|
|
62
|
+
customStyleFn: (style: any) => any;
|
|
63
|
+
blockStyleFn(block: any): string;
|
|
64
|
+
blockRendererFn: (block: any) => {
|
|
65
|
+
component: (props: any) => any;
|
|
66
|
+
editable: boolean;
|
|
67
|
+
} | null;
|
|
68
|
+
render(): JSX.Element;
|
|
69
|
+
}
|
|
70
|
+
declare const DraftEditor: {
|
|
71
|
+
RichTextEditor: typeof RichTextEditor;
|
|
72
|
+
decorators: Draft.Model.Decorators.CompositeDraftDecorator;
|
|
73
|
+
};
|
|
74
|
+
export default DraftEditor;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type Option = {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
isDisabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare type AlignSelectorOnChangeFn = (param: string) => void;
|
|
8
|
+
declare type Options = Option[];
|
|
9
|
+
export declare function AlignSelector(props: {
|
|
10
|
+
align: string;
|
|
11
|
+
options: Options;
|
|
12
|
+
onChange: AlignSelectorOnChangeFn;
|
|
13
|
+
onOpen?: () => void;
|
|
14
|
+
}): JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type ID = string;
|
|
3
|
+
export declare type AudioEntity = {
|
|
4
|
+
id: ID;
|
|
5
|
+
name?: string;
|
|
6
|
+
url?: string;
|
|
7
|
+
file?: {
|
|
8
|
+
url: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare type AudioEntityWithMeta = {
|
|
12
|
+
audio: AudioEntity;
|
|
13
|
+
};
|
|
14
|
+
declare type AudioSelectorOnChangeFn = (params: AudioEntityWithMeta[]) => void;
|
|
15
|
+
export declare function AudioSelector(props: {
|
|
16
|
+
onChange: AudioSelectorOnChangeFn;
|
|
17
|
+
}): JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type ID = string;
|
|
3
|
+
export declare type ImageEntityImageFile = {
|
|
4
|
+
url: string;
|
|
5
|
+
};
|
|
6
|
+
export declare type ImageEntityResized = {
|
|
7
|
+
original: string;
|
|
8
|
+
w480: string;
|
|
9
|
+
w800: string;
|
|
10
|
+
w1200: string;
|
|
11
|
+
w1600: string;
|
|
12
|
+
w2400: string;
|
|
13
|
+
};
|
|
14
|
+
export declare type ImageEntity = {
|
|
15
|
+
id: ID;
|
|
16
|
+
name?: string;
|
|
17
|
+
imageFile: ImageEntityImageFile;
|
|
18
|
+
resized: ImageEntityResized;
|
|
19
|
+
};
|
|
20
|
+
export declare type ImageEntityWithMeta = {
|
|
21
|
+
image: ImageEntity;
|
|
22
|
+
desc?: string;
|
|
23
|
+
url?: string;
|
|
24
|
+
};
|
|
25
|
+
export declare type ImageSelectorOnChangeFn = (params: ImageEntityWithMeta[], align?: string, delay?: number) => void;
|
|
26
|
+
export declare function ImageSelector(props: {
|
|
27
|
+
enableMultiSelect?: boolean;
|
|
28
|
+
enableCaption?: boolean;
|
|
29
|
+
enableUrl?: boolean;
|
|
30
|
+
enableAlignment?: boolean;
|
|
31
|
+
enableDelay?: boolean;
|
|
32
|
+
onChange: ImageSelectorOnChangeFn;
|
|
33
|
+
initialSelected?: ImageEntityWithMeta[];
|
|
34
|
+
initialAlign?: string;
|
|
35
|
+
}): JSX.Element;
|
|
36
|
+
export {};
|