@contentful/field-editor-rich-text 3.3.4 → 3.4.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 +10 -0
- package/dist/ContentfulEditorProvider.d.ts +3 -3
- package/dist/field-editor-rich-text.cjs.development.js +785 -466
- 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 +727 -408
- package/dist/field-editor-rich-text.esm.js.map +1 -1
- package/dist/helpers/editor.d.ts +15 -16
- package/dist/helpers/extractNodes.d.ts +2 -3
- package/dist/helpers/sanitizeIncomingSlateDoc.d.ts +1 -1
- package/dist/helpers/transformers.d.ts +6 -7
- package/dist/internal/constants.d.ts +1 -0
- package/dist/internal/hooks.d.ts +1 -0
- package/dist/internal/index.d.ts +4 -0
- package/dist/internal/misc.d.ts +35 -0
- package/dist/internal/queries.d.ts +78 -0
- package/dist/internal/transforms.d.ts +33 -0
- package/dist/internal/types/editor.d.ts +70 -0
- package/dist/internal/types/index.d.ts +2 -0
- package/dist/internal/types/plugins.d.ts +12 -0
- package/dist/plugins/Break/createExitBreakPlugin.d.ts +2 -2
- package/dist/plugins/Break/createResetNodePlugin.d.ts +2 -2
- package/dist/plugins/Break/createSoftBreakPlugin.d.ts +2 -2
- package/dist/plugins/CommandPalette/components/CommandList.d.ts +2 -2
- package/dist/plugins/CommandPalette/components/CommandPrompt.d.ts +4 -2
- package/dist/plugins/CommandPalette/createCommandPalettePlugin.d.ts +2 -2
- package/dist/plugins/CommandPalette/onKeyDown.d.ts +2 -3
- package/dist/plugins/CommandPalette/useCommands.d.ts +2 -2
- package/dist/plugins/DragAndDrop/index.d.ts +2 -2
- package/dist/plugins/EmbeddedEntityBlock/LinkedEntityBlock.d.ts +1 -1
- package/dist/plugins/EmbeddedEntityBlock/Util.d.ts +2 -1
- package/dist/plugins/EmbeddedEntityBlock/index.d.ts +3 -3
- package/dist/plugins/EmbeddedEntityInline/index.d.ts +2 -2
- package/dist/plugins/Heading/createHeadingPlugin.d.ts +2 -2
- package/dist/plugins/Hr/index.d.ts +3 -3
- package/dist/plugins/Hyperlink/HyperlinkModal.d.ts +2 -3
- package/dist/plugins/Hyperlink/components/EntityHyperlink.d.ts +1 -1
- package/dist/plugins/Hyperlink/components/UrlHyperlink.d.ts +1 -1
- package/dist/plugins/Hyperlink/createHyperlinkPlugin.d.ts +2 -2
- package/dist/plugins/Hyperlink/utils.d.ts +3 -3
- package/dist/plugins/List/createListPlugin.d.ts +2 -2
- package/dist/plugins/List/insertListBreak.d.ts +2 -2
- package/dist/plugins/List/insertListFragment.d.ts +2 -3
- package/dist/plugins/List/onKeyDownList.d.ts +3 -3
- package/dist/plugins/List/transforms/deleteBackwardList.d.ts +2 -2
- package/dist/plugins/List/transforms/insertListItem.d.ts +2 -2
- package/dist/plugins/List/transforms/moveListItemDown.d.ts +3 -8
- package/dist/plugins/List/transforms/moveListItems.d.ts +2 -6
- package/dist/plugins/List/transforms/toggleList.d.ts +2 -2
- package/dist/plugins/List/transforms/unwrapList.d.ts +2 -3
- package/dist/plugins/List/utils.d.ts +8 -9
- package/dist/plugins/List/withList.d.ts +2 -4
- package/dist/plugins/Marks/Bold.d.ts +3 -4
- package/dist/plugins/Marks/Code.d.ts +3 -4
- package/dist/plugins/Marks/Italic.d.ts +3 -4
- package/dist/plugins/Marks/Subscript.d.ts +3 -4
- package/dist/plugins/Marks/Superscript.d.ts +3 -4
- package/dist/plugins/Marks/Underline.d.ts +3 -4
- package/dist/plugins/Marks/helpers.d.ts +3 -5
- package/dist/plugins/Marks/index.d.ts +2 -2
- package/dist/plugins/Normalizer/createNormalizerPlugin.d.ts +2 -2
- package/dist/plugins/Normalizer/types.d.ts +3 -5
- package/dist/plugins/Normalizer/utils.d.ts +0 -3
- package/dist/plugins/Normalizer/withNormalizer.d.ts +2 -2
- package/dist/plugins/Paragraph/Paragraph.d.ts +1 -1
- package/dist/plugins/Paragraph/createParagraphPlugin.d.ts +2 -2
- package/dist/plugins/PasteHTML/createPasteHTMLPlugin.d.ts +2 -2
- package/dist/plugins/Quote/components/Quote.d.ts +1 -1
- package/dist/plugins/Quote/createQuotePlugin.d.ts +2 -2
- package/dist/plugins/Quote/shouldResetQuote.d.ts +1 -1
- package/dist/plugins/Quote/toggleQuote.d.ts +2 -3
- package/dist/plugins/Quote/withQuote.d.ts +2 -3
- package/dist/plugins/SelectOnBackspace/createSelectOnBackspacePlugin.d.ts +2 -2
- package/dist/plugins/Table/actions/addColumn.d.ts +7 -4
- package/dist/plugins/Table/actions/addRow.d.ts +3 -3
- package/dist/plugins/Table/actions/setHeader.d.ts +2 -2
- package/dist/plugins/Table/components/Cell.d.ts +2 -2
- package/dist/plugins/Table/components/HeaderCell.d.ts +2 -2
- package/dist/plugins/Table/createTablePlugin.d.ts +2 -2
- package/dist/plugins/Table/helpers.d.ts +8 -9
- package/dist/plugins/Table/insertTableFragment.d.ts +3 -3
- package/dist/plugins/Table/onKeyDownTable.d.ts +2 -3
- package/dist/plugins/Table/tableTracking.d.ts +2 -2
- package/dist/plugins/Text/createTextPlugin.d.ts +2 -2
- package/dist/plugins/Tracking/createTrackingPlugin.d.ts +2 -2
- package/dist/plugins/Tracking/utils.d.ts +2 -2
- package/dist/plugins/TrailingParagraph/index.d.ts +2 -2
- package/dist/plugins/Voids/createVoidsPlugin.d.ts +2 -2
- package/dist/plugins/Voids/transformVoid.d.ts +2 -3
- package/dist/plugins/index.d.ts +2 -2
- package/dist/prepareDocument.d.ts +5 -6
- package/dist/test-utils/assertOutput.d.ts +2 -2
- package/dist/test-utils/createEditor.d.ts +22 -4
- package/dist/test-utils/jsx.d.ts +1 -1
- package/dist/test-utils/mockPlugin.d.ts +2 -2
- package/dist/test-utils/setEmptyDataAttribute.d.ts +2 -2
- package/package.json +18 -17
- package/dist/types.d.ts +0 -52
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-rich-text",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"source": "./src/index.tsx",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "dist/field-editor-rich-text.esm.js",
|
|
@@ -30,29 +30,30 @@
|
|
|
30
30
|
"@contentful/f36-icons": "^4.1.1",
|
|
31
31
|
"@contentful/f36-tokens": "^4.0.0",
|
|
32
32
|
"@contentful/f36-utils": "^4.19.0",
|
|
33
|
-
"@contentful/field-editor-reference": "^5.8.
|
|
33
|
+
"@contentful/field-editor-reference": "^5.8.1",
|
|
34
34
|
"@contentful/field-editor-shared": "^1.1.4",
|
|
35
35
|
"@contentful/rich-text-plain-text-renderer": "^15.12.1",
|
|
36
36
|
"@contentful/rich-text-types": "15.14.1",
|
|
37
37
|
"@popperjs/core": "^2.11.5",
|
|
38
|
-
"@udecode/plate-basic-marks": "
|
|
39
|
-
"@udecode/plate-break": "
|
|
40
|
-
"@udecode/plate-core": "
|
|
41
|
-
"@udecode/plate-list": "
|
|
42
|
-
"@udecode/plate-paragraph": "
|
|
43
|
-
"@udecode/plate-reset-node": "
|
|
44
|
-
"@udecode/plate-select": "
|
|
45
|
-
"@udecode/plate-serializer-docx": "
|
|
46
|
-
"@udecode/plate-
|
|
47
|
-
"@udecode/plate-
|
|
38
|
+
"@udecode/plate-basic-marks": "16.8.0",
|
|
39
|
+
"@udecode/plate-break": "16.8.0",
|
|
40
|
+
"@udecode/plate-core": "16.8.0",
|
|
41
|
+
"@udecode/plate-list": "16.8.0",
|
|
42
|
+
"@udecode/plate-paragraph": "16.8.0",
|
|
43
|
+
"@udecode/plate-reset-node": "16.8.0",
|
|
44
|
+
"@udecode/plate-select": "16.8.0",
|
|
45
|
+
"@udecode/plate-serializer-docx": "16.8.0",
|
|
46
|
+
"@udecode/plate-serializer-html": "16.8.0",
|
|
47
|
+
"@udecode/plate-table": "16.8.0",
|
|
48
|
+
"@udecode/plate-trailing-block": "16.8.0",
|
|
48
49
|
"fast-deep-equal": "^3.1.3",
|
|
49
50
|
"is-hotkey": "^0.2.0",
|
|
50
51
|
"is-plain-obj": "^3.0.0",
|
|
51
52
|
"react-popper": "^2.3.0",
|
|
52
|
-
"slate": "
|
|
53
|
-
"slate-history": "
|
|
54
|
-
"slate-hyperscript": "
|
|
55
|
-
"slate-react": "
|
|
53
|
+
"slate": "0.80.0",
|
|
54
|
+
"slate-history": "0.66.0",
|
|
55
|
+
"slate-hyperscript": "0.67.0",
|
|
56
|
+
"slate-react": "0.80.0"
|
|
56
57
|
},
|
|
57
58
|
"peerDependencies": {
|
|
58
59
|
"react": ">=16.14.0",
|
|
@@ -73,5 +74,5 @@
|
|
|
73
74
|
"@udecode/plate-test-utils": "^3.2.0",
|
|
74
75
|
"react": ">=16.14.0"
|
|
75
76
|
},
|
|
76
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "20d09902b8943916f4e45a712f48284d4373b8e3"
|
|
77
78
|
}
|
package/dist/types.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { MARKS } from '@contentful/rich-text-types';
|
|
2
|
-
import { PlateEditor, PlatePlugin } from '@udecode/plate-core';
|
|
3
|
-
import { RenderElementProps } from 'slate-react';
|
|
4
|
-
import type { SoftBreakRule, ExitBreakRule, ResetNodePluginRule } from './plugins/Break';
|
|
5
|
-
import type { NormalizerRule } from './plugins/Normalizer';
|
|
6
|
-
import { TrackingPluginActions } from './plugins/Tracking';
|
|
7
|
-
export declare type CustomText = {
|
|
8
|
-
text: string;
|
|
9
|
-
[MARKS.BOLD]?: boolean;
|
|
10
|
-
[MARKS.CODE]?: boolean;
|
|
11
|
-
[MARKS.ITALIC]?: boolean;
|
|
12
|
-
[MARKS.UNDERLINE]?: boolean;
|
|
13
|
-
[MARKS.SUPERSCRIPT]?: boolean;
|
|
14
|
-
[MARKS.SUBSCRIPT]?: boolean;
|
|
15
|
-
};
|
|
16
|
-
export declare type TextOrCustomElement = CustomElement | CustomText;
|
|
17
|
-
export declare type CustomElement<T = unknown> = {
|
|
18
|
-
type: string;
|
|
19
|
-
children: TextOrCustomElement[];
|
|
20
|
-
data: T;
|
|
21
|
-
isVoid?: boolean;
|
|
22
|
-
};
|
|
23
|
-
export declare type CustomRenderElementProps<T = any, O = any> = Omit<RenderElementProps, 'element'> & {
|
|
24
|
-
element: CustomElement<T>;
|
|
25
|
-
} & O;
|
|
26
|
-
declare module 'slate' {
|
|
27
|
-
interface CustomTypes {
|
|
28
|
-
Element: CustomElement;
|
|
29
|
-
Text: CustomText;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
export interface RichTextPlugin extends PlatePlugin<RichTextEditor> {
|
|
33
|
-
/**
|
|
34
|
-
* @see createSoftBreakPlugin
|
|
35
|
-
*/
|
|
36
|
-
softBreak?: SoftBreakRule[];
|
|
37
|
-
/**
|
|
38
|
-
* @see createExitBreakPlugin
|
|
39
|
-
*/
|
|
40
|
-
exitBreak?: ExitBreakRule[];
|
|
41
|
-
/**
|
|
42
|
-
* @see createResetNodePlugin
|
|
43
|
-
*/
|
|
44
|
-
resetNode?: ResetNodePluginRule[];
|
|
45
|
-
/**
|
|
46
|
-
* @see createNormalizerPlugin
|
|
47
|
-
*/
|
|
48
|
-
normalizer?: NormalizerRule[];
|
|
49
|
-
}
|
|
50
|
-
export interface RichTextEditor extends PlateEditor {
|
|
51
|
-
tracking: TrackingPluginActions;
|
|
52
|
-
}
|