@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,29 +1,111 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { BLOCKS, INLINES } from '@contentful/rich-text-types';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
document: {
|
|
4
|
+
nodes: {
|
|
5
|
+
types: {
|
|
6
|
+
type: import("@contentful/rich-text-types").TopLevelBlockEnum;
|
|
7
|
+
}[];
|
|
5
8
|
}[];
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
};
|
|
10
|
+
blocks: {
|
|
11
|
+
blockquote: {
|
|
12
|
+
nodes: {
|
|
13
|
+
match: {
|
|
14
|
+
type: BLOCKS;
|
|
15
|
+
}[][];
|
|
16
|
+
min: number;
|
|
17
|
+
}[];
|
|
18
|
+
normalize: (editor: any, error: any) => any;
|
|
19
|
+
};
|
|
20
|
+
paragraph: {
|
|
21
|
+
nodes: {
|
|
22
|
+
match: ({
|
|
23
|
+
type: INLINES;
|
|
24
|
+
} | {
|
|
25
|
+
object: string;
|
|
26
|
+
})[];
|
|
27
|
+
}[];
|
|
28
|
+
};
|
|
29
|
+
"heading-1": {
|
|
30
|
+
nodes: {
|
|
31
|
+
match: ({
|
|
32
|
+
type: INLINES;
|
|
33
|
+
} | {
|
|
34
|
+
object: string;
|
|
35
|
+
})[];
|
|
36
|
+
}[];
|
|
37
|
+
};
|
|
38
|
+
"heading-2": {
|
|
39
|
+
nodes: {
|
|
40
|
+
match: ({
|
|
41
|
+
type: INLINES;
|
|
42
|
+
} | {
|
|
43
|
+
object: string;
|
|
44
|
+
})[];
|
|
45
|
+
}[];
|
|
46
|
+
};
|
|
47
|
+
"heading-3": {
|
|
48
|
+
nodes: {
|
|
49
|
+
match: ({
|
|
50
|
+
type: INLINES;
|
|
51
|
+
} | {
|
|
52
|
+
object: string;
|
|
53
|
+
})[];
|
|
54
|
+
}[];
|
|
55
|
+
};
|
|
56
|
+
"heading-4": {
|
|
57
|
+
nodes: {
|
|
58
|
+
match: ({
|
|
59
|
+
type: INLINES;
|
|
60
|
+
} | {
|
|
61
|
+
object: string;
|
|
62
|
+
})[];
|
|
63
|
+
}[];
|
|
64
|
+
};
|
|
65
|
+
"heading-5": {
|
|
66
|
+
nodes: {
|
|
67
|
+
match: ({
|
|
68
|
+
type: INLINES;
|
|
69
|
+
} | {
|
|
70
|
+
object: string;
|
|
71
|
+
})[];
|
|
72
|
+
}[];
|
|
73
|
+
};
|
|
74
|
+
"heading-6": {
|
|
75
|
+
nodes: {
|
|
76
|
+
match: ({
|
|
77
|
+
type: INLINES;
|
|
78
|
+
} | {
|
|
79
|
+
object: string;
|
|
80
|
+
})[];
|
|
81
|
+
}[];
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
inlines: {
|
|
9
85
|
hyperlink: {
|
|
10
86
|
nodes: {
|
|
11
|
-
|
|
87
|
+
match: {
|
|
88
|
+
object: string;
|
|
89
|
+
}[];
|
|
12
90
|
}[];
|
|
13
91
|
};
|
|
14
92
|
"entry-hyperlink": {
|
|
15
93
|
nodes: {
|
|
16
|
-
|
|
94
|
+
match: {
|
|
95
|
+
object: string;
|
|
96
|
+
}[];
|
|
17
97
|
}[];
|
|
18
98
|
};
|
|
19
99
|
"asset-hyperlink": {
|
|
20
100
|
nodes: {
|
|
21
|
-
|
|
101
|
+
match: {
|
|
102
|
+
object: string;
|
|
103
|
+
}[];
|
|
22
104
|
}[];
|
|
23
105
|
};
|
|
24
106
|
"embedded-entry-inline": {
|
|
25
107
|
isVoid: boolean;
|
|
26
108
|
};
|
|
27
109
|
};
|
|
28
|
-
}
|
|
110
|
+
};
|
|
29
111
|
export default _default;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export namespace LINK_TYPES {
|
|
2
|
+
export const URI: string;
|
|
3
|
+
export const ENTRY: string;
|
|
4
|
+
export const ASSET: string;
|
|
5
|
+
}
|
|
6
|
+
export class HyperlinkDialog extends React.Component<any, any, any> {
|
|
7
|
+
static propTypes: {
|
|
8
|
+
sdk: PropTypes.Validator<object>;
|
|
9
|
+
labels: PropTypes.Requireable<PropTypes.InferProps<{
|
|
10
|
+
title: PropTypes.Requireable<string>;
|
|
11
|
+
confirm: PropTypes.Requireable<string>;
|
|
12
|
+
}>>;
|
|
13
|
+
value: PropTypes.Requireable<PropTypes.InferProps<{
|
|
14
|
+
text: PropTypes.Requireable<string>;
|
|
15
|
+
uri: PropTypes.Requireable<string>;
|
|
16
|
+
target: PropTypes.Requireable<object>;
|
|
17
|
+
type: PropTypes.Requireable<string>;
|
|
18
|
+
}>>;
|
|
19
|
+
entitySelectorConfigs: PropTypes.Requireable<object>;
|
|
20
|
+
allowedHyperlinkTypes: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
21
|
+
hideText: PropTypes.Requireable<boolean>;
|
|
22
|
+
onClose: PropTypes.Validator<(...args: any[]) => any>;
|
|
23
|
+
};
|
|
24
|
+
static defaultProps: {
|
|
25
|
+
labels: {
|
|
26
|
+
title: string;
|
|
27
|
+
confirm: string;
|
|
28
|
+
};
|
|
29
|
+
value: {};
|
|
30
|
+
hideText: boolean;
|
|
31
|
+
entitySelectorConfigs: {};
|
|
32
|
+
allowedHyperlinkTypes: string[];
|
|
33
|
+
};
|
|
34
|
+
constructor(props: any);
|
|
35
|
+
setTargetEntity(type: any, entity: any): void;
|
|
36
|
+
getValue(): {
|
|
37
|
+
type: any;
|
|
38
|
+
};
|
|
39
|
+
isLinkComplete(): any;
|
|
40
|
+
handleSubmit: (event: any) => void;
|
|
41
|
+
selectEntry: () => Promise<void>;
|
|
42
|
+
selectAsset: () => Promise<void>;
|
|
43
|
+
renderFields(): JSX.Element;
|
|
44
|
+
renderEntityField(): JSX.Element;
|
|
45
|
+
renderEntitySelector(type: any): JSX.Element;
|
|
46
|
+
}
|
|
47
|
+
export function openHyperlinkDialog(dialogs: any, { value, showTextInput, allowedHyperlinkTypes, entitySelectorConfigs }: {
|
|
48
|
+
value: any;
|
|
49
|
+
showTextInput: any;
|
|
50
|
+
allowedHyperlinkTypes: any;
|
|
51
|
+
entitySelectorConfigs: any;
|
|
52
|
+
}): any;
|
|
53
|
+
import React from "react";
|
|
54
|
+
import PropTypes from "prop-types";
|