@contentful/field-editor-rich-text 1.0.0-alpha.3 → 2.0.0-next.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.
Files changed (132) hide show
  1. package/CHANGELOG.md +410 -0
  2. package/README.md +9 -20
  3. package/dist/ContentfulEditorProvider.d.ts +8 -0
  4. package/dist/RichTextEditor.d.ts +19 -70
  5. package/dist/RichTextEditor.styles.d.ts +7 -0
  6. package/dist/SdkProvider.d.ts +7 -0
  7. package/dist/Toolbar/EmbedEntityWidget.d.ts +6 -0
  8. package/dist/Toolbar/StickyToolbarWrapper.d.ts +6 -11
  9. package/dist/Toolbar/index.d.ts +6 -28
  10. package/dist/TrackingProvider.d.ts +11 -0
  11. package/dist/constants/Schema.d.ts +93 -11
  12. package/dist/dialogs/HypelinkDialog/HyperlinkDialog.d.ts +54 -0
  13. package/dist/dialogs/openRichTextDialog.d.ts +2 -0
  14. package/dist/dialogs/renderRichTextDialog.d.ts +3 -0
  15. package/dist/field-editor-rich-text.cjs.development.js +4690 -4354
  16. package/dist/field-editor-rich-text.cjs.development.js.map +1 -1
  17. package/dist/field-editor-rich-text.cjs.production.min.js +1 -1
  18. package/dist/field-editor-rich-text.cjs.production.min.js.map +1 -1
  19. package/dist/field-editor-rich-text.esm.js +4674 -4338
  20. package/dist/field-editor-rich-text.esm.js.map +1 -1
  21. package/dist/helpers/deserializer.d.ts +3 -0
  22. package/dist/helpers/editor.d.ts +35 -0
  23. package/dist/helpers/formatDateAndTime.d.ts +15 -0
  24. package/dist/helpers/getLinkedContentTypeIdsForNodeType.d.ts +26 -2
  25. package/dist/helpers/newEntitySelectorConfigFromRichTextField.d.ts +5 -1
  26. package/dist/helpers/sanitizeSlateDoc.d.ts +18 -0
  27. package/dist/helpers/truncate.d.ts +1 -0
  28. package/dist/helpers/validations.d.ts +10 -0
  29. package/dist/index.d.ts +2 -2
  30. package/dist/plugins/Bold/index.d.ts +12 -64
  31. package/dist/plugins/Code/index.d.ts +12 -64
  32. package/dist/plugins/CommandPalette/CommandPanel/InViewport/InViewport.d.ts +37 -0
  33. package/dist/plugins/EmbeddedEntity/index.d.ts +10 -0
  34. package/dist/plugins/EmbeddedEntityBlock/LinkedEntityBlock.d.ts +13 -0
  35. package/dist/plugins/EmbeddedEntityBlock/ToolbarIcon.d.ts +12 -10
  36. package/dist/plugins/EmbeddedEntityBlock/Util.d.ts +2 -23
  37. package/dist/plugins/EmbeddedEntityBlock/index.d.ts +11 -27
  38. package/dist/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.d.ts +12 -0
  39. package/dist/plugins/EmbeddedEntityInline/Util.d.ts +16 -0
  40. package/dist/plugins/EmbeddedEntityInline/index.d.ts +12 -0
  41. package/dist/plugins/Heading/index.d.ts +20 -50
  42. package/dist/plugins/Hr/index.d.ts +13 -61
  43. package/dist/plugins/Hyperlink/EntryAssetTooltip.d.ts +10 -0
  44. package/dist/plugins/Hyperlink/HyperlinkModal.d.ts +17 -0
  45. package/dist/plugins/Hyperlink/index.d.ts +12 -9
  46. package/dist/plugins/InsertBeforeFirstVoidBlock/index.d.ts +2 -3
  47. package/dist/plugins/Italic/index.d.ts +12 -64
  48. package/dist/plugins/List/index.d.ts +15 -114
  49. package/dist/plugins/NewLine/index.d.ts +2 -0
  50. package/dist/plugins/Paragraph/index.d.ts +7 -5
  51. package/dist/plugins/Paste/index.d.ts +2 -7
  52. package/dist/plugins/Paste/sanitizers/helpers.d.ts +7 -0
  53. package/dist/plugins/Paste/sanitizers/index.d.ts +3 -0
  54. package/dist/plugins/Paste/sanitizers/removeComments.d.ts +2 -0
  55. package/dist/plugins/Paste/sanitizers/sanitizeEntityBlocks.d.ts +6 -0
  56. package/dist/plugins/Paste/sanitizers/sanitizeTables.d.ts +2 -0
  57. package/dist/plugins/Quote/index.d.ts +13 -59
  58. package/dist/plugins/Table/TableActions.d.ts +5 -0
  59. package/dist/plugins/Table/actions/addColumn.d.ts +4 -0
  60. package/dist/plugins/Table/actions/addRow.d.ts +3 -0
  61. package/dist/plugins/Table/actions/index.d.ts +3 -0
  62. package/dist/plugins/Table/actions/setHeader.d.ts +2 -0
  63. package/dist/plugins/Table/helpers.d.ts +4 -0
  64. package/dist/plugins/Table/index.d.ts +186 -0
  65. package/dist/plugins/TrailingParagraph/index.d.ts +1 -0
  66. package/dist/plugins/Underline/index.d.ts +12 -0
  67. package/dist/plugins/shared/EntityStatusIcon.d.ts +8 -0
  68. package/dist/plugins/shared/FetchingWrappedAssetCard.d.ts +23 -0
  69. package/dist/plugins/shared/FetchingWrappedEntryCard.d.ts +13 -0
  70. package/dist/plugins/shared/ToolbarButton.d.ts +15 -0
  71. package/dist/types.d.ts +25 -0
  72. package/package.json +44 -31
  73. package/LICENSE +0 -21
  74. package/dist/RichTextEditor.spec.d.ts +0 -1
  75. package/dist/Toolbar/Toolbar.spec.d.ts +0 -1
  76. package/dist/helpers/browserSupport.d.ts +0 -1
  77. package/dist/plugins/CommandPalette/CommandMark.d.ts +0 -13
  78. package/dist/plugins/CommandPalette/CommandPalette.d.ts +0 -14
  79. package/dist/plugins/CommandPalette/CommandPaletteService.d.ts +0 -12
  80. package/dist/plugins/CommandPalette/CommandPanel/CommandPanelMenu.d.ts +0 -48
  81. package/dist/plugins/CommandPalette/CommandPanel/index.d.ts +0 -51
  82. package/dist/plugins/CommandPalette/Util.d.ts +0 -5
  83. package/dist/plugins/CommandPalette/index.d.ts +0 -7
  84. package/dist/plugins/EmbeddedEntityBlock/EmbeddedEntityBlock.d.ts +0 -29
  85. package/dist/plugins/EmbeddedEntryInline/EmbeddedEntryInline.d.ts +0 -29
  86. package/dist/plugins/EmbeddedEntryInline/ToolbarIcon.d.ts +0 -11
  87. package/dist/plugins/EmbeddedEntryInline/Utils.d.ts +0 -4
  88. package/dist/plugins/EmbeddedEntryInline/index.d.ts +0 -13
  89. package/dist/plugins/EntryEmbedDropdown/index.d.ts +0 -15
  90. package/dist/plugins/Heading/Heading1.d.ts +0 -2
  91. package/dist/plugins/Heading/Heading2.d.ts +0 -2
  92. package/dist/plugins/Heading/Heading3.d.ts +0 -2
  93. package/dist/plugins/Heading/Heading4.d.ts +0 -2
  94. package/dist/plugins/Heading/Heading5.d.ts +0 -2
  95. package/dist/plugins/Heading/Heading6.d.ts +0 -2
  96. package/dist/plugins/Heading/HeadingDropdown.d.ts +0 -29
  97. package/dist/plugins/Heading/Paragraph.d.ts +0 -2
  98. package/dist/plugins/Hyperlink/Hyperlink.d.ts +0 -25
  99. package/dist/plugins/Hyperlink/ToolbarIcon.d.ts +0 -8
  100. package/dist/plugins/Hyperlink/Util.d.ts +0 -43
  101. package/dist/plugins/Hyperlink/styles.d.ts +0 -7
  102. package/dist/plugins/InsertBeforeFirstVoidBlock/Util.d.ts +0 -14
  103. package/dist/plugins/List/EditListWrapper.d.ts +0 -2
  104. package/dist/plugins/List/ToolbarDecorator.d.ts +0 -62
  105. package/dist/plugins/NewLinePlugin/index.d.ts +0 -3
  106. package/dist/plugins/Paste/Paste.d.ts +0 -1
  107. package/dist/plugins/Paste/Paste.spec.d.ts +0 -1
  108. package/dist/plugins/Paste/index.spec.d.ts +0 -1
  109. package/dist/plugins/PasteHtml/PasteHtml.spec.d.ts +0 -1
  110. package/dist/plugins/PasteHtml/Serializer.d.ts +0 -1
  111. package/dist/plugins/PasteHtml/index.d.ts +0 -3
  112. package/dist/plugins/PasteText/PasteText.spec.d.ts +0 -1
  113. package/dist/plugins/PasteText/index.d.ts +0 -3
  114. package/dist/plugins/Quote/QuotePlugin.d.ts +0 -10
  115. package/dist/plugins/Quote/Util.d.ts +0 -2
  116. package/dist/plugins/Underlined/index.d.ts +0 -64
  117. package/dist/plugins/index.d.ts +0 -1
  118. package/dist/plugins/shared/BlockSelectDecorator.d.ts +0 -63
  119. package/dist/plugins/shared/BlockToggleDecorator.d.ts +0 -65
  120. package/dist/plugins/shared/MarkDecorator.d.ts +0 -12
  121. package/dist/plugins/shared/MarkPlugin.d.ts +0 -9
  122. package/dist/plugins/shared/MarkToggleDecorator.d.ts +0 -62
  123. package/dist/plugins/shared/NodeDecorator.d.ts +0 -15
  124. package/dist/plugins/shared/PasteTestHelpers.d.ts +0 -35
  125. package/dist/plugins/shared/PluginApi.d.ts +0 -26
  126. package/dist/plugins/shared/PropTypes.d.ts +0 -15
  127. package/dist/plugins/shared/ToolbarDropdownListItem.d.ts +0 -15
  128. package/dist/plugins/shared/ToolbarIcon.d.ts +0 -16
  129. package/dist/plugins/shared/UtilHave.d.ts +0 -24
  130. package/dist/setupTests.d.ts +0 -1
  131. package/dist/validations/index.d.ts +0 -9
  132. package/dist/validations/validations.spec.d.ts +0 -1
@@ -1,61 +1,13 @@
1
- export function HrPlugin(): {
2
- renderNode: (props: any, _editor: any, next: any) => any;
3
- };
4
- declare var _default: {
5
- new (props: Readonly<any>): {
6
- handleSelect: (e: any) => void;
7
- render(): JSX.Element;
8
- context: any;
9
- setState<K extends string | number | symbol>(state: any, callback?: (() => void) | undefined): void;
10
- forceUpdate(callback?: (() => void) | undefined): void;
11
- readonly props: Readonly<any> & Readonly<{
12
- children?: React.ReactNode;
13
- }>;
14
- state: Readonly<any>;
15
- refs: {
16
- [key: string]: React.ReactInstance;
17
- };
18
- componentDidMount?(): void;
19
- shouldComponentUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): boolean;
20
- componentWillUnmount?(): void;
21
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
22
- getSnapshotBeforeUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>): any;
23
- componentDidUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>, snapshot?: any): void;
24
- componentWillMount?(): void;
25
- UNSAFE_componentWillMount?(): void;
26
- componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
27
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
28
- componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
29
- UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
30
- };
31
- new (props: any, context?: any): {
32
- handleSelect: (e: any) => void;
33
- render(): JSX.Element;
34
- context: any;
35
- setState<K extends string | number | symbol>(state: any, callback?: (() => void) | undefined): void;
36
- forceUpdate(callback?: (() => void) | undefined): void;
37
- readonly props: Readonly<any> & Readonly<{
38
- children?: React.ReactNode;
39
- }>;
40
- state: Readonly<any>;
41
- refs: {
42
- [key: string]: React.ReactInstance;
43
- };
44
- componentDidMount?(): void;
45
- shouldComponentUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): boolean;
46
- componentWillUnmount?(): void;
47
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
48
- getSnapshotBeforeUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>): any;
49
- componentDidUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>, snapshot?: any): void;
50
- componentWillMount?(): void;
51
- UNSAFE_componentWillMount?(): void;
52
- componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
53
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
54
- componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
55
- UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
56
- };
57
- propTypes: any;
58
- contextType?: React.Context<any> | undefined;
59
- };
60
- export default _default;
61
- import React from "react";
1
+ import * as React from 'react';
2
+ import * as Slate from 'slate-react';
3
+ import { PlatePlugin, SPEditor } from '@udecode/plate-core';
4
+ import { CustomSlatePluginOptions } from '../../types';
5
+ interface ToolbarHrButtonProps {
6
+ isDisabled?: boolean;
7
+ }
8
+ export declare function withHrEvents(editor: SPEditor): (event: React.KeyboardEvent) => void;
9
+ export declare function ToolbarHrButton(props: ToolbarHrButtonProps): JSX.Element | null;
10
+ export declare function Hr(props: Slate.RenderLeafProps): JSX.Element;
11
+ export declare function createHrPlugin(): PlatePlugin;
12
+ export declare const withHrOptions: CustomSlatePluginOptions;
13
+ export {};
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { ContentEntityType as EntityType } from '@contentful/field-editor-reference/dist/types';
3
+ import { FieldExtensionSDK } from '@contentful/field-editor-shared';
4
+ interface EntryAssetTooltipProps {
5
+ id: string;
6
+ type: EntityType;
7
+ sdk: FieldExtensionSDK;
8
+ }
9
+ export declare function EntryAssetTooltip({ id, type, sdk }: EntryAssetTooltipProps): JSX.Element;
10
+ export {};
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import { FieldExtensionSDK } from '@contentful/field-editor-shared';
3
+ import { SPEditor } from '@udecode/plate-core';
4
+ import { ReactEditor } from 'slate-react';
5
+ import { HistoryEditor } from 'slate-history';
6
+ import { Link } from '@contentful/field-editor-reference/dist/types';
7
+ interface HyperlinkModalProps {
8
+ linkText?: string;
9
+ linkType?: string;
10
+ linkTarget?: string;
11
+ linkEntity?: Link;
12
+ onClose: (value: unknown) => void;
13
+ sdk: FieldExtensionSDK;
14
+ }
15
+ export declare function HyperlinkModal(props: HyperlinkModalProps): JSX.Element;
16
+ export declare function addOrEditLink(editor: ReactEditor & HistoryEditor & SPEditor, sdk: FieldExtensionSDK): Promise<void>;
17
+ export {};
@@ -1,9 +1,12 @@
1
- export default ToolbarIcon;
2
- export function HyperlinkPlugin({ richTextAPI }: {
3
- richTextAPI: any;
4
- }): {
5
- renderNode: (props: any, _editor: any, next: any) => any;
6
- onKeyDown: (event: any, editor: any, next: any) => any;
7
- normalizeNode: (node: any, editor: any, next: any) => (() => void) | undefined;
8
- };
9
- import ToolbarIcon from "./ToolbarIcon";
1
+ import * as React from 'react';
2
+ import { PlatePlugin } from '@udecode/plate-core';
3
+ import { FieldExtensionSDK } from '@contentful/app-sdk';
4
+ import { CustomSlatePluginOptions } from '../../types';
5
+ export declare function createHyperlinkPlugin(sdk: FieldExtensionSDK): PlatePlugin;
6
+ export declare function buildHyperlinkEventHandler(sdk: any): (editor: any) => (event: React.KeyboardEvent) => void;
7
+ interface ToolbarHyperlinkButtonProps {
8
+ isDisabled: boolean | undefined;
9
+ }
10
+ export declare function ToolbarHyperlinkButton(props: ToolbarHyperlinkButtonProps): JSX.Element | null;
11
+ export declare const withHyperlinkOptions: CustomSlatePluginOptions;
12
+ export {};
@@ -1,3 +1,2 @@
1
- export function InsertBeforeFirstVoidBlockPlugin(): {
2
- onKeyDown: (event: any, editor: any, next: any) => any;
3
- };
1
+ import { PlatePlugin } from '@udecode/plate-core';
2
+ export declare function createInsertBeforeFirstVoidBlockPlugin(): PlatePlugin;
@@ -1,64 +1,12 @@
1
- export function ItalicPlugin({ richTextAPI }: {
2
- richTextAPI: any;
3
- }): {
4
- renderMark: (props: any, _editor: any, next: any) => any;
5
- onKeyDown(event: any, editor: any, next: any): any;
6
- };
7
- declare var _default: {
8
- new (props: Readonly<any>): {
9
- handleToggle: (e: any) => void;
10
- render(): JSX.Element;
11
- context: any;
12
- setState<K extends string | number | symbol>(state: any, callback?: (() => void) | undefined): void;
13
- forceUpdate(callback?: (() => void) | undefined): void;
14
- readonly props: Readonly<any> & Readonly<{
15
- children?: React.ReactNode;
16
- }>;
17
- state: Readonly<any>;
18
- refs: {
19
- [key: string]: React.ReactInstance;
20
- };
21
- componentDidMount?(): void;
22
- shouldComponentUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): boolean;
23
- componentWillUnmount?(): void;
24
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
25
- getSnapshotBeforeUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>): any;
26
- componentDidUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>, snapshot?: any): void;
27
- componentWillMount?(): void;
28
- UNSAFE_componentWillMount?(): void;
29
- componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
30
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
31
- componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
32
- UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
33
- };
34
- new (props: any, context?: any): {
35
- handleToggle: (e: any) => void;
36
- render(): JSX.Element;
37
- context: any;
38
- setState<K extends string | number | symbol>(state: any, callback?: (() => void) | undefined): void;
39
- forceUpdate(callback?: (() => void) | undefined): void;
40
- readonly props: Readonly<any> & Readonly<{
41
- children?: React.ReactNode;
42
- }>;
43
- state: Readonly<any>;
44
- refs: {
45
- [key: string]: React.ReactInstance;
46
- };
47
- componentDidMount?(): void;
48
- shouldComponentUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): boolean;
49
- componentWillUnmount?(): void;
50
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
51
- getSnapshotBeforeUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>): any;
52
- componentDidUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>, snapshot?: any): void;
53
- componentWillMount?(): void;
54
- UNSAFE_componentWillMount?(): void;
55
- componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
56
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
57
- componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
58
- UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
59
- };
60
- propTypes: any;
61
- contextType?: React.Context<any> | undefined;
62
- };
63
- export default _default;
64
- import React from "react";
1
+ /// <reference types="react" />
2
+ import * as Slate from 'slate-react';
3
+ import { PlatePlugin } from '@udecode/plate-core';
4
+ import { CustomSlatePluginOptions } from '../../types';
5
+ interface ToolbarItalicButtonProps {
6
+ isDisabled?: boolean;
7
+ }
8
+ export declare function ToolbarItalicButton(props: ToolbarItalicButtonProps): JSX.Element | null;
9
+ export declare function Italic(props: Slate.RenderLeafProps): JSX.Element;
10
+ export declare function createItalicPlugin(): PlatePlugin;
11
+ export declare const withItalicOptions: CustomSlatePluginOptions;
12
+ export {};
@@ -1,114 +1,15 @@
1
- export function ListPlugin(): any;
2
- export const UnorderedList: {
3
- new (props: Readonly<any>): {
4
- handleToggle: (e: any) => void;
5
- render(): JSX.Element;
6
- context: any;
7
- setState<K extends string | number | symbol>(state: any, callback?: (() => void) | undefined): void;
8
- forceUpdate(callback?: (() => void) | undefined): void;
9
- readonly props: Readonly<any> & Readonly<{
10
- children?: React.ReactNode;
11
- }>;
12
- state: Readonly<any>;
13
- refs: {
14
- [key: string]: React.ReactInstance;
15
- };
16
- componentDidMount?(): void;
17
- shouldComponentUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): boolean;
18
- componentWillUnmount?(): void;
19
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
20
- getSnapshotBeforeUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>): any;
21
- componentDidUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>, snapshot?: any): void;
22
- componentWillMount?(): void;
23
- UNSAFE_componentWillMount?(): void;
24
- componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
25
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
26
- componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
27
- UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
28
- };
29
- new (props: any, context?: any): {
30
- handleToggle: (e: any) => void;
31
- render(): JSX.Element;
32
- context: any;
33
- setState<K extends string | number | symbol>(state: any, callback?: (() => void) | undefined): void;
34
- forceUpdate(callback?: (() => void) | undefined): void;
35
- readonly props: Readonly<any> & Readonly<{
36
- children?: React.ReactNode;
37
- }>;
38
- state: Readonly<any>;
39
- refs: {
40
- [key: string]: React.ReactInstance;
41
- };
42
- componentDidMount?(): void;
43
- shouldComponentUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): boolean;
44
- componentWillUnmount?(): void;
45
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
46
- getSnapshotBeforeUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>): any;
47
- componentDidUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>, snapshot?: any): void;
48
- componentWillMount?(): void;
49
- UNSAFE_componentWillMount?(): void;
50
- componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
51
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
52
- componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
53
- UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
54
- };
55
- propTypes: any;
56
- contextType?: React.Context<any> | undefined;
57
- };
58
- export const OrderedList: {
59
- new (props: Readonly<any>): {
60
- handleToggle: (e: any) => void;
61
- render(): JSX.Element;
62
- context: any;
63
- setState<K extends string | number | symbol>(state: any, callback?: (() => void) | undefined): void;
64
- forceUpdate(callback?: (() => void) | undefined): void;
65
- readonly props: Readonly<any> & Readonly<{
66
- children?: React.ReactNode;
67
- }>;
68
- state: Readonly<any>;
69
- refs: {
70
- [key: string]: React.ReactInstance;
71
- };
72
- componentDidMount?(): void;
73
- shouldComponentUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): boolean;
74
- componentWillUnmount?(): void;
75
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
76
- getSnapshotBeforeUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>): any;
77
- componentDidUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>, snapshot?: any): void;
78
- componentWillMount?(): void;
79
- UNSAFE_componentWillMount?(): void;
80
- componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
81
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
82
- componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
83
- UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
84
- };
85
- new (props: any, context?: any): {
86
- handleToggle: (e: any) => void;
87
- render(): JSX.Element;
88
- context: any;
89
- setState<K extends string | number | symbol>(state: any, callback?: (() => void) | undefined): void;
90
- forceUpdate(callback?: (() => void) | undefined): void;
91
- readonly props: Readonly<any> & Readonly<{
92
- children?: React.ReactNode;
93
- }>;
94
- state: Readonly<any>;
95
- refs: {
96
- [key: string]: React.ReactInstance;
97
- };
98
- componentDidMount?(): void;
99
- shouldComponentUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): boolean;
100
- componentWillUnmount?(): void;
101
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
102
- getSnapshotBeforeUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>): any;
103
- componentDidUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>, snapshot?: any): void;
104
- componentWillMount?(): void;
105
- UNSAFE_componentWillMount?(): void;
106
- componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
107
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
108
- componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
109
- UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
110
- };
111
- propTypes: any;
112
- contextType?: React.Context<any> | undefined;
113
- };
114
- import React from "react";
1
+ /// <reference types="react" />
2
+ import * as Slate from 'slate-react';
3
+ import { BLOCKS } from '@contentful/rich-text-types';
4
+ import { CustomSlatePluginOptions } from '../../types';
5
+ interface ToolbarListButtonProps {
6
+ isDisabled?: boolean;
7
+ }
8
+ export declare function ToolbarListButton(props: ToolbarListButtonProps): JSX.Element | null;
9
+ export declare function createList(Tag: any, block: BLOCKS): (props: Slate.RenderElementProps) => JSX.Element;
10
+ export declare const UL: (props: Slate.RenderElementProps) => JSX.Element;
11
+ export declare const OL: (props: Slate.RenderElementProps) => JSX.Element;
12
+ export declare const LI: (props: Slate.RenderElementProps) => JSX.Element;
13
+ export declare const withListOptions: CustomSlatePluginOptions;
14
+ export declare const createListPlugin: () => import("@udecode/plate-core").PlatePlugin<import("@udecode/plate-core").SPEditor>;
15
+ export {};
@@ -0,0 +1,2 @@
1
+ import { PlatePlugin } from '@udecode/plate-core';
2
+ export declare function createNewLinePlugin(): PlatePlugin;
@@ -1,5 +1,7 @@
1
- export function ParagraphPlugin(type?: BLOCKS): {
2
- renderNode: (props: any, _editor: any, next: any) => any;
3
- onKeyDown: (e: any, editor: any, next: any) => any;
4
- };
5
- import { BLOCKS } from "@contentful/rich-text-types";
1
+ /// <reference types="react" />
2
+ import { RenderElementProps } from 'slate-react';
3
+ import { PlatePlugin } from '@udecode/plate-core';
4
+ import { CustomSlatePluginOptions } from '../../types';
5
+ export declare function Paragraph(props: RenderElementProps): JSX.Element;
6
+ export declare function createParagraphPlugin(): PlatePlugin;
7
+ export declare const withParagraphOptions: CustomSlatePluginOptions;
@@ -1,7 +1,2 @@
1
- export function PastePlugin({ richTextAPI: { logShortcutAction } }: {
2
- richTextAPI: {
3
- logShortcutAction: any;
4
- };
5
- }): {
6
- onPaste(_event: any, editor: any, next: any): void;
7
- };
1
+ import { PlatePlugin } from '@udecode/plate-core';
2
+ export declare const createPastePlugin: () => PlatePlugin;
@@ -0,0 +1,7 @@
1
+ import { SPEditor } from '@udecode/plate-core';
2
+ export declare type SanitizerTuple = [Document, SPEditor];
3
+ declare type Predicate = (node: ChildNode) => boolean;
4
+ export declare const isHTMLElement: (node: ChildNode) => node is HTMLElement;
5
+ export declare const removeChildNodes: (node: ChildNode, predicate?: Predicate) => void;
6
+ export declare const removeChildNodesUsingPredicate: (predicate: Predicate) => (nodeList: NodeList) => Node[];
7
+ export {};
@@ -0,0 +1,3 @@
1
+ export { removeComments } from './removeComments';
2
+ export { sanitizeTables } from './sanitizeTables';
3
+ export { sanitizeEntityBlocks } from './sanitizeEntityBlocks';
@@ -0,0 +1,2 @@
1
+ import { SanitizerTuple } from './helpers';
2
+ export declare const removeComments: ([doc, editor]: SanitizerTuple) => SanitizerTuple;
@@ -0,0 +1,6 @@
1
+ import { SanitizerTuple } from './helpers';
2
+ /**
3
+ * Ensures the text selection from entity block elements is
4
+ * not included in the paste buffer.
5
+ */
6
+ export declare const sanitizeEntityBlocks: ([doc, editor]: SanitizerTuple) => SanitizerTuple;
@@ -0,0 +1,2 @@
1
+ import { SanitizerTuple } from './helpers';
2
+ export declare const sanitizeTables: ([doc, editor]: SanitizerTuple) => SanitizerTuple;
@@ -1,59 +1,13 @@
1
- declare var _default: {
2
- new (props: Readonly<any>): {
3
- handleToggle: (e: any) => void;
4
- render(): JSX.Element;
5
- context: any;
6
- setState<K extends string | number | symbol>(state: any, callback?: (() => void) | undefined): void;
7
- forceUpdate(callback?: (() => void) | undefined): void;
8
- readonly props: Readonly<any> & Readonly<{
9
- children?: React.ReactNode;
10
- }>;
11
- state: Readonly<any>;
12
- refs: {
13
- [key: string]: React.ReactInstance;
14
- };
15
- componentDidMount?(): void;
16
- shouldComponentUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): boolean;
17
- componentWillUnmount?(): void;
18
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
19
- getSnapshotBeforeUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>): any;
20
- componentDidUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>, snapshot?: any): void;
21
- componentWillMount?(): void;
22
- UNSAFE_componentWillMount?(): void;
23
- componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
24
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
25
- componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
26
- UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
27
- };
28
- new (props: any, context?: any): {
29
- handleToggle: (e: any) => void;
30
- render(): JSX.Element;
31
- context: any;
32
- setState<K extends string | number | symbol>(state: any, callback?: (() => void) | undefined): void;
33
- forceUpdate(callback?: (() => void) | undefined): void;
34
- readonly props: Readonly<any> & Readonly<{
35
- children?: React.ReactNode;
36
- }>;
37
- state: Readonly<any>;
38
- refs: {
39
- [key: string]: React.ReactInstance;
40
- };
41
- componentDidMount?(): void;
42
- shouldComponentUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): boolean;
43
- componentWillUnmount?(): void;
44
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
45
- getSnapshotBeforeUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>): any;
46
- componentDidUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>, snapshot?: any): void;
47
- componentWillMount?(): void;
48
- UNSAFE_componentWillMount?(): void;
49
- componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
50
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
51
- componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
52
- UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
53
- };
54
- propTypes: any;
55
- contextType?: React.Context<any> | undefined;
56
- };
57
- export default _default;
58
- export { default as QuotePlugin } from "./QuotePlugin";
59
- import React from "react";
1
+ import * as React from 'react';
2
+ import * as Slate from 'slate-react';
3
+ import { PlatePlugin, SPEditor } from '@udecode/plate-core';
4
+ import { CustomSlatePluginOptions } from 'types';
5
+ interface ToolbarQuoteButtonProps {
6
+ isDisabled?: boolean;
7
+ }
8
+ export declare function withQuoteEvents(editor: SPEditor): (event: React.KeyboardEvent) => void;
9
+ export declare function ToolbarQuoteButton(props: ToolbarQuoteButtonProps): JSX.Element | null;
10
+ export declare function Quote(props: Slate.RenderLeafProps): JSX.Element;
11
+ export declare function createQuotePlugin(): PlatePlugin;
12
+ export declare const withQuoteOptions: CustomSlatePluginOptions;
13
+ export {};
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare const styles: {
3
+ topRight: string;
4
+ };
5
+ export declare const TableActions: () => JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { SPEditor } from '@udecode/plate-core';
2
+ import { TablePluginOptions } from '@udecode/plate-table';
3
+ export declare const addColumnRight: (editor: SPEditor, options: TablePluginOptions) => void;
4
+ export declare const addColumnLeft: (editor: SPEditor, options: TablePluginOptions) => void;
@@ -0,0 +1,3 @@
1
+ import { SPEditor } from '@udecode/plate-core';
2
+ export declare const addRowBelow: (editor: SPEditor) => void;
3
+ export declare const addRowAbove: (editor: SPEditor) => void;
@@ -0,0 +1,3 @@
1
+ export * from './addRow';
2
+ export * from './addColumn';
3
+ export * from './setHeader';
@@ -0,0 +1,2 @@
1
+ import { SPEditor } from '@udecode/plate-core';
2
+ export declare const setHeader: (editor: SPEditor, enable?: boolean | undefined) => void;
@@ -0,0 +1,4 @@
1
+ import { SPEditor } from '@udecode/plate-core';
2
+ export declare function insertTableAndFocusFirstCell(editor: SPEditor): void;
3
+ export declare function isTableActive(editor: SPEditor): boolean;
4
+ export declare function isTableHeaderEnabled(editor: SPEditor): boolean;