@contentful/field-editor-rich-text 2.0.0-next.40 → 2.0.0-next.41

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.
@@ -0,0 +1,6 @@
1
+ import { TextOrCustomElement } from '../types';
2
+ /**
3
+ * Ensures all nodes have a child leaf text element. This should be handled by
4
+ * Slate but its behavior has proven to be buggy and unpredictable.
5
+ */
6
+ export declare function sanitizeIncomingSlateDoc(nodes?: TextOrCustomElement[]): TextOrCustomElement[];
@@ -13,8 +13,8 @@ import { RichTextEditor } from 'types';
13
13
  export declare const hasContent: (doc?: Document | undefined) => boolean;
14
14
  export declare const setEditorContent: (editor: Editor, nodes?: Node[] | undefined) => void;
15
15
  /**
16
- * Converts a contenful rich text document to the corresponding slate editor
16
+ * Converts a Contentful rich text document to the corresponding slate editor
17
17
  * value
18
18
  */
19
- export declare const documentToEditorValue: (doc: any) => any;
19
+ export declare const documentToEditorValue: (doc: any) => Descendant[];
20
20
  export declare const normalizeEditorValue: (value: Descendant[], options?: Pick<CreatePlateEditorOptions<RichTextEditor>, "plugins" | "disableCorePlugins" | "components" | "overrideByKey"> | undefined) => Descendant[] & any[];
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Add items as needed. Don't forget to adjust hyperscript.d.ts
5
5
  */
6
- export declare const jsx: <S extends "selection" | "text" | "element" | "editor" | "focus" | "anchor" | "cursor" | "fragment">(tagName: S, attributes?: Object | undefined, ...children: any[]) => ReturnType<({
6
+ export declare const jsx: <S extends "editor" | "text" | "selection" | "element" | "focus" | "anchor" | "cursor" | "fragment">(tagName: S, attributes?: Object | undefined, ...children: any[]) => ReturnType<({
7
7
  anchor: typeof import("slate-hyperscript/dist/creators").createAnchor;
8
8
  cursor: typeof import("slate-hyperscript/dist/creators").createCursor;
9
9
  editor: (tagName: string, attributes: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/field-editor-rich-text",
3
- "version": "2.0.0-next.40",
3
+ "version": "2.0.0-next.41",
4
4
  "publishConfig": {
5
5
  "tag": "next"
6
6
  },