@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.
- package/CHANGELOG.md +410 -0
- package/README.md +9 -20
- package/dist/ContentfulEditorProvider.d.ts +8 -0
- package/dist/RichTextEditor.d.ts +19 -70
- package/dist/RichTextEditor.styles.d.ts +7 -0
- package/dist/SdkProvider.d.ts +7 -0
- package/dist/Toolbar/EmbedEntityWidget.d.ts +6 -0
- package/dist/Toolbar/StickyToolbarWrapper.d.ts +6 -11
- package/dist/Toolbar/index.d.ts +6 -28
- package/dist/TrackingProvider.d.ts +11 -0
- package/dist/constants/Schema.d.ts +93 -11
- package/dist/dialogs/HypelinkDialog/HyperlinkDialog.d.ts +54 -0
- package/dist/dialogs/openRichTextDialog.d.ts +2 -0
- package/dist/dialogs/renderRichTextDialog.d.ts +3 -0
- package/dist/field-editor-rich-text.cjs.development.js +4690 -4354
- package/dist/field-editor-rich-text.cjs.development.js.map +1 -1
- package/dist/field-editor-rich-text.cjs.production.min.js +1 -1
- package/dist/field-editor-rich-text.cjs.production.min.js.map +1 -1
- package/dist/field-editor-rich-text.esm.js +4674 -4338
- package/dist/field-editor-rich-text.esm.js.map +1 -1
- package/dist/helpers/deserializer.d.ts +3 -0
- package/dist/helpers/editor.d.ts +35 -0
- package/dist/helpers/formatDateAndTime.d.ts +15 -0
- package/dist/helpers/getLinkedContentTypeIdsForNodeType.d.ts +26 -2
- package/dist/helpers/newEntitySelectorConfigFromRichTextField.d.ts +5 -1
- package/dist/helpers/sanitizeSlateDoc.d.ts +18 -0
- package/dist/helpers/truncate.d.ts +1 -0
- package/dist/helpers/validations.d.ts +10 -0
- package/dist/index.d.ts +2 -2
- package/dist/plugins/Bold/index.d.ts +12 -64
- package/dist/plugins/Code/index.d.ts +12 -64
- package/dist/plugins/CommandPalette/CommandPanel/InViewport/InViewport.d.ts +37 -0
- package/dist/plugins/EmbeddedEntity/index.d.ts +10 -0
- package/dist/plugins/EmbeddedEntityBlock/LinkedEntityBlock.d.ts +13 -0
- package/dist/plugins/EmbeddedEntityBlock/ToolbarIcon.d.ts +12 -10
- package/dist/plugins/EmbeddedEntityBlock/Util.d.ts +2 -23
- package/dist/plugins/EmbeddedEntityBlock/index.d.ts +11 -27
- package/dist/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.d.ts +12 -0
- package/dist/plugins/EmbeddedEntityInline/Util.d.ts +16 -0
- package/dist/plugins/EmbeddedEntityInline/index.d.ts +12 -0
- package/dist/plugins/Heading/index.d.ts +20 -50
- package/dist/plugins/Hr/index.d.ts +13 -61
- package/dist/plugins/Hyperlink/EntryAssetTooltip.d.ts +10 -0
- package/dist/plugins/Hyperlink/HyperlinkModal.d.ts +17 -0
- package/dist/plugins/Hyperlink/index.d.ts +12 -9
- package/dist/plugins/InsertBeforeFirstVoidBlock/index.d.ts +2 -3
- package/dist/plugins/Italic/index.d.ts +12 -64
- package/dist/plugins/List/index.d.ts +15 -114
- package/dist/plugins/NewLine/index.d.ts +2 -0
- package/dist/plugins/Paragraph/index.d.ts +7 -5
- package/dist/plugins/Paste/index.d.ts +2 -7
- package/dist/plugins/Paste/sanitizers/helpers.d.ts +7 -0
- package/dist/plugins/Paste/sanitizers/index.d.ts +3 -0
- package/dist/plugins/Paste/sanitizers/removeComments.d.ts +2 -0
- package/dist/plugins/Paste/sanitizers/sanitizeEntityBlocks.d.ts +6 -0
- package/dist/plugins/Paste/sanitizers/sanitizeTables.d.ts +2 -0
- package/dist/plugins/Quote/index.d.ts +13 -59
- package/dist/plugins/Table/TableActions.d.ts +5 -0
- package/dist/plugins/Table/actions/addColumn.d.ts +4 -0
- package/dist/plugins/Table/actions/addRow.d.ts +3 -0
- package/dist/plugins/Table/actions/index.d.ts +3 -0
- package/dist/plugins/Table/actions/setHeader.d.ts +2 -0
- package/dist/plugins/Table/helpers.d.ts +4 -0
- package/dist/plugins/Table/index.d.ts +186 -0
- package/dist/plugins/TrailingParagraph/index.d.ts +1 -0
- package/dist/plugins/Underline/index.d.ts +12 -0
- package/dist/plugins/shared/EntityStatusIcon.d.ts +8 -0
- package/dist/plugins/shared/FetchingWrappedAssetCard.d.ts +23 -0
- package/dist/plugins/shared/FetchingWrappedEntryCard.d.ts +13 -0
- package/dist/plugins/shared/ToolbarButton.d.ts +15 -0
- package/dist/types.d.ts +25 -0
- package/package.json +44 -31
- package/LICENSE +0 -21
- package/dist/RichTextEditor.spec.d.ts +0 -1
- package/dist/Toolbar/Toolbar.spec.d.ts +0 -1
- package/dist/helpers/browserSupport.d.ts +0 -1
- package/dist/plugins/CommandPalette/CommandMark.d.ts +0 -13
- package/dist/plugins/CommandPalette/CommandPalette.d.ts +0 -14
- package/dist/plugins/CommandPalette/CommandPaletteService.d.ts +0 -12
- package/dist/plugins/CommandPalette/CommandPanel/CommandPanelMenu.d.ts +0 -48
- package/dist/plugins/CommandPalette/CommandPanel/index.d.ts +0 -51
- package/dist/plugins/CommandPalette/Util.d.ts +0 -5
- package/dist/plugins/CommandPalette/index.d.ts +0 -7
- package/dist/plugins/EmbeddedEntityBlock/EmbeddedEntityBlock.d.ts +0 -29
- package/dist/plugins/EmbeddedEntryInline/EmbeddedEntryInline.d.ts +0 -29
- package/dist/plugins/EmbeddedEntryInline/ToolbarIcon.d.ts +0 -11
- package/dist/plugins/EmbeddedEntryInline/Utils.d.ts +0 -4
- package/dist/plugins/EmbeddedEntryInline/index.d.ts +0 -13
- package/dist/plugins/EntryEmbedDropdown/index.d.ts +0 -15
- package/dist/plugins/Heading/Heading1.d.ts +0 -2
- package/dist/plugins/Heading/Heading2.d.ts +0 -2
- package/dist/plugins/Heading/Heading3.d.ts +0 -2
- package/dist/plugins/Heading/Heading4.d.ts +0 -2
- package/dist/plugins/Heading/Heading5.d.ts +0 -2
- package/dist/plugins/Heading/Heading6.d.ts +0 -2
- package/dist/plugins/Heading/HeadingDropdown.d.ts +0 -29
- package/dist/plugins/Heading/Paragraph.d.ts +0 -2
- package/dist/plugins/Hyperlink/Hyperlink.d.ts +0 -25
- package/dist/plugins/Hyperlink/ToolbarIcon.d.ts +0 -8
- package/dist/plugins/Hyperlink/Util.d.ts +0 -43
- package/dist/plugins/Hyperlink/styles.d.ts +0 -7
- package/dist/plugins/InsertBeforeFirstVoidBlock/Util.d.ts +0 -14
- package/dist/plugins/List/EditListWrapper.d.ts +0 -2
- package/dist/plugins/List/ToolbarDecorator.d.ts +0 -62
- package/dist/plugins/NewLinePlugin/index.d.ts +0 -3
- package/dist/plugins/Paste/Paste.d.ts +0 -1
- package/dist/plugins/Paste/Paste.spec.d.ts +0 -1
- package/dist/plugins/Paste/index.spec.d.ts +0 -1
- package/dist/plugins/PasteHtml/PasteHtml.spec.d.ts +0 -1
- package/dist/plugins/PasteHtml/Serializer.d.ts +0 -1
- package/dist/plugins/PasteHtml/index.d.ts +0 -3
- package/dist/plugins/PasteText/PasteText.spec.d.ts +0 -1
- package/dist/plugins/PasteText/index.d.ts +0 -3
- package/dist/plugins/Quote/QuotePlugin.d.ts +0 -10
- package/dist/plugins/Quote/Util.d.ts +0 -2
- package/dist/plugins/Underlined/index.d.ts +0 -64
- package/dist/plugins/index.d.ts +0 -1
- package/dist/plugins/shared/BlockSelectDecorator.d.ts +0 -63
- package/dist/plugins/shared/BlockToggleDecorator.d.ts +0 -65
- package/dist/plugins/shared/MarkDecorator.d.ts +0 -12
- package/dist/plugins/shared/MarkPlugin.d.ts +0 -9
- package/dist/plugins/shared/MarkToggleDecorator.d.ts +0 -62
- package/dist/plugins/shared/NodeDecorator.d.ts +0 -15
- package/dist/plugins/shared/PasteTestHelpers.d.ts +0 -35
- package/dist/plugins/shared/PluginApi.d.ts +0 -26
- package/dist/plugins/shared/PropTypes.d.ts +0 -15
- package/dist/plugins/shared/ToolbarDropdownListItem.d.ts +0 -15
- package/dist/plugins/shared/ToolbarIcon.d.ts +0 -16
- package/dist/plugins/shared/UtilHave.d.ts +0 -24
- package/dist/setupTests.d.ts +0 -1
- package/dist/validations/index.d.ts +0 -9
- package/dist/validations/validations.spec.d.ts +0 -1
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
declare function _default({ type, title, icon }: {
|
|
2
|
-
type: any;
|
|
3
|
-
title: any;
|
|
4
|
-
icon: any;
|
|
5
|
-
}): (Mark: any) => {
|
|
6
|
-
new (props: Readonly<any>): {
|
|
7
|
-
handleToggle: (e: any) => void;
|
|
8
|
-
render(): JSX.Element;
|
|
9
|
-
context: any;
|
|
10
|
-
setState<K extends string | number | symbol>(state: any, callback?: (() => void) | undefined): void;
|
|
11
|
-
forceUpdate(callback?: (() => void) | undefined): void;
|
|
12
|
-
readonly props: Readonly<any> & Readonly<{
|
|
13
|
-
children?: React.ReactNode;
|
|
14
|
-
}>;
|
|
15
|
-
state: Readonly<any>;
|
|
16
|
-
refs: {
|
|
17
|
-
[key: string]: React.ReactInstance;
|
|
18
|
-
};
|
|
19
|
-
componentDidMount?(): void;
|
|
20
|
-
shouldComponentUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): boolean;
|
|
21
|
-
componentWillUnmount?(): void;
|
|
22
|
-
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
23
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>): any;
|
|
24
|
-
componentDidUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>, snapshot?: any): void;
|
|
25
|
-
componentWillMount?(): void;
|
|
26
|
-
UNSAFE_componentWillMount?(): void;
|
|
27
|
-
componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
|
|
28
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
|
|
29
|
-
componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
|
|
30
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
|
|
31
|
-
};
|
|
32
|
-
new (props: any, context?: any): {
|
|
33
|
-
handleToggle: (e: any) => void;
|
|
34
|
-
render(): JSX.Element;
|
|
35
|
-
context: any;
|
|
36
|
-
setState<K extends string | number | symbol>(state: any, callback?: (() => void) | undefined): void;
|
|
37
|
-
forceUpdate(callback?: (() => void) | undefined): void;
|
|
38
|
-
readonly props: Readonly<any> & Readonly<{
|
|
39
|
-
children?: React.ReactNode;
|
|
40
|
-
}>;
|
|
41
|
-
state: Readonly<any>;
|
|
42
|
-
refs: {
|
|
43
|
-
[key: string]: React.ReactInstance;
|
|
44
|
-
};
|
|
45
|
-
componentDidMount?(): void;
|
|
46
|
-
shouldComponentUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): boolean;
|
|
47
|
-
componentWillUnmount?(): void;
|
|
48
|
-
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
49
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>): any;
|
|
50
|
-
componentDidUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>, snapshot?: any): void;
|
|
51
|
-
componentWillMount?(): void;
|
|
52
|
-
UNSAFE_componentWillMount?(): void;
|
|
53
|
-
componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
|
|
54
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
|
|
55
|
-
componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
|
|
56
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
|
|
57
|
-
};
|
|
58
|
-
propTypes: any;
|
|
59
|
-
contextType?: React.Context<any> | undefined;
|
|
60
|
-
};
|
|
61
|
-
export default _default;
|
|
62
|
-
import * as React from "react";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export default function _default(Tag: any, tagProps?: {}): {
|
|
2
|
-
({ attributes, children, node }: {
|
|
3
|
-
attributes: any;
|
|
4
|
-
children: any;
|
|
5
|
-
node: any;
|
|
6
|
-
}): JSX.Element;
|
|
7
|
-
displayName: string;
|
|
8
|
-
propTypes: {
|
|
9
|
-
attributes: import("prop-types").Validator<object>;
|
|
10
|
-
children: import("prop-types").Validator<string | number | boolean | {} | import("prop-types").ReactElementLike | import("prop-types").ReactNodeArray>;
|
|
11
|
-
node: import("prop-types").Validator<import("prop-types").InferProps<{
|
|
12
|
-
type: import("prop-types").Validator<string>;
|
|
13
|
-
}>>;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export function document(props: any, ...nodes: any[]): any;
|
|
2
|
-
export function block(type: any, props: any, ...nodes: any[]): any;
|
|
3
|
-
export function inline(type: any, props: any, ...nodes: any[]): any;
|
|
4
|
-
export function text(props: any, ...leaves: any[]): any;
|
|
5
|
-
export function leaf(text?: string, ...marks: any[]): {
|
|
6
|
-
object: string;
|
|
7
|
-
text: string;
|
|
8
|
-
marks: any[];
|
|
9
|
-
};
|
|
10
|
-
export function mark(type: any): {
|
|
11
|
-
type: any;
|
|
12
|
-
object: string;
|
|
13
|
-
data: {};
|
|
14
|
-
};
|
|
15
|
-
export function emptyText(): any;
|
|
16
|
-
export function emptyParagraph(): {
|
|
17
|
-
type: BLOCKS;
|
|
18
|
-
object: string;
|
|
19
|
-
data: {};
|
|
20
|
-
nodes: any[];
|
|
21
|
-
};
|
|
22
|
-
export function createPasteEvent(type: any, value: any): {
|
|
23
|
-
dataTransfer: FakeDataTransfer;
|
|
24
|
-
};
|
|
25
|
-
export function createPasteHtmlEvent(html: any): {
|
|
26
|
-
dataTransfer: FakeDataTransfer;
|
|
27
|
-
};
|
|
28
|
-
import { BLOCKS } from "@contentful/rich-text-types";
|
|
29
|
-
declare class FakeDataTransfer {
|
|
30
|
-
items: any[];
|
|
31
|
-
types: any[];
|
|
32
|
-
getData(key: any): any;
|
|
33
|
-
setData(key: any, value: any): void;
|
|
34
|
-
}
|
|
35
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* All known origins for Rich Text actions
|
|
3
|
-
* @type {object}
|
|
4
|
-
*/
|
|
5
|
-
export const actionOrigin: object;
|
|
6
|
-
export function createRichTextAPI({ widgetAPI, onAction, customRenderers }: any): {
|
|
7
|
-
widgetAPI: {
|
|
8
|
-
object: any;
|
|
9
|
-
};
|
|
10
|
-
logViewportAction: {
|
|
11
|
-
function: any;
|
|
12
|
-
};
|
|
13
|
-
createActionLogger: {
|
|
14
|
-
function: any;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Describes the prop types a Rich Text editor plugin can expect.
|
|
19
|
-
* @type {object}
|
|
20
|
-
*/
|
|
21
|
-
export const EDITOR_PLUGIN_PROP_TYPES: object;
|
|
22
|
-
/**
|
|
23
|
-
* Describes the prop types a Rich Text toolbar plugin can expect.
|
|
24
|
-
* @type {object}
|
|
25
|
-
*/
|
|
26
|
-
export const TOOLBAR_PLUGIN_PROP_TYPES: object;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export namespace MarkPropTypes {
|
|
2
|
-
export const attributes: PropTypes.Validator<object>;
|
|
3
|
-
export const children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
4
|
-
export const mark: PropTypes.Validator<string>;
|
|
5
|
-
}
|
|
6
|
-
export namespace NodePropTypes {
|
|
7
|
-
const attributes_1: PropTypes.Validator<object>;
|
|
8
|
-
export { attributes_1 as attributes };
|
|
9
|
-
const children_1: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
10
|
-
export { children_1 as children };
|
|
11
|
-
export const node: PropTypes.Validator<PropTypes.InferProps<{
|
|
12
|
-
type: PropTypes.Validator<string>;
|
|
13
|
-
}>>;
|
|
14
|
-
}
|
|
15
|
-
import PropTypes from "prop-types";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export default class ToolbarDropdownListItem extends React.Component<any, any, any> {
|
|
2
|
-
static propTypes: {
|
|
3
|
-
isActive: PropTypes.Validator<boolean>;
|
|
4
|
-
onToggle: PropTypes.Validator<(...args: any[]) => any>;
|
|
5
|
-
title: PropTypes.Validator<string>;
|
|
6
|
-
type: PropTypes.Requireable<string>;
|
|
7
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
8
|
-
};
|
|
9
|
-
constructor(props: Readonly<any>);
|
|
10
|
-
constructor(props: any, context?: any);
|
|
11
|
-
handleMouseDown: (event: any) => void;
|
|
12
|
-
render(): JSX.Element;
|
|
13
|
-
}
|
|
14
|
-
import React from "react";
|
|
15
|
-
import PropTypes from "prop-types";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export default class ToolbarIcon extends React.Component<any, any, any> {
|
|
2
|
-
static propTypes: {
|
|
3
|
-
isActive: PropTypes.Validator<boolean>;
|
|
4
|
-
disabled: PropTypes.Validator<boolean>;
|
|
5
|
-
onToggle: PropTypes.Validator<(...args: any[]) => any>;
|
|
6
|
-
icon: PropTypes.Validator<string>;
|
|
7
|
-
title: PropTypes.Validator<string>;
|
|
8
|
-
type: PropTypes.Requireable<string>;
|
|
9
|
-
};
|
|
10
|
-
constructor(props: Readonly<any>);
|
|
11
|
-
constructor(props: any, context?: any);
|
|
12
|
-
handleMouseDown: (event: any) => void;
|
|
13
|
-
render(): JSX.Element;
|
|
14
|
-
}
|
|
15
|
-
import React from "react";
|
|
16
|
-
import PropTypes from "prop-types";
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export function haveAnyInlines({ value }: {
|
|
2
|
-
value: any;
|
|
3
|
-
}): boolean;
|
|
4
|
-
/**
|
|
5
|
-
* Checks if all inline nodes in the selectin have a certain type.
|
|
6
|
-
* Returns false if there are no inline nodes in the selection.
|
|
7
|
-
*
|
|
8
|
-
* @param {slate.Editor} editor
|
|
9
|
-
* @param {string} type
|
|
10
|
-
* @returns {boolean}
|
|
11
|
-
*/
|
|
12
|
-
export function haveEveryInlineOfType({ value }: any, type: string): boolean;
|
|
13
|
-
export function haveMarks({ value }: {
|
|
14
|
-
value: any;
|
|
15
|
-
}, type: any): any;
|
|
16
|
-
export function haveBlocks({ value }: {
|
|
17
|
-
value: any;
|
|
18
|
-
}, type: any): any;
|
|
19
|
-
export function haveInlines({ value }: {
|
|
20
|
-
value: any;
|
|
21
|
-
}, type: any): any;
|
|
22
|
-
export function haveTextInSomeBlocks({ value }: {
|
|
23
|
-
value: any;
|
|
24
|
-
}): any;
|
package/dist/setupTests.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export namespace VALIDATIONS {
|
|
2
|
-
export const ENABLED_MARKS: string;
|
|
3
|
-
export const ENABLED_NODE_TYPES: string;
|
|
4
|
-
}
|
|
5
|
-
export const VALIDATABLE_NODE_TYPES: (BLOCKS.PARAGRAPH | BLOCKS.HEADING_1 | BLOCKS.HEADING_2 | BLOCKS.HEADING_3 | BLOCKS.HEADING_4 | BLOCKS.HEADING_5 | BLOCKS.HEADING_6 | BLOCKS.OL_LIST | BLOCKS.UL_LIST | BLOCKS.HR | BLOCKS.QUOTE | BLOCKS.EMBEDDED_ENTRY | BLOCKS.EMBEDDED_ASSET | INLINES)[];
|
|
6
|
-
export function isNodeTypeEnabled(field: any, nodeType: string): boolean;
|
|
7
|
-
export function isMarkEnabled(field: any, mark: string): boolean;
|
|
8
|
-
import { BLOCKS } from "@contentful/rich-text-types";
|
|
9
|
-
import { INLINES } from "@contentful/rich-text-types";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|