@contentful/field-editor-rich-text 2.3.20 → 3.0.1

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.
@@ -13,7 +13,7 @@ export declare function isNodeTypeSelected(editor: RichTextEditor, nodeType: BLO
13
13
  export declare function moveToTheNextLine(editor: RichTextEditor): void;
14
14
  export declare function moveToTheNextChar(editor: RichTextEditor): void;
15
15
  export declare function insertEmptyParagraph(editor: RichTextEditor, options?: any): void;
16
- export declare function getElementFromCurrentSelection(editor: RichTextEditor): (import("slate").BaseEditor | CustomElement<unknown> | import("../types").CustomText | Path)[];
16
+ export declare function getElementFromCurrentSelection(editor: RichTextEditor): (Node | Path)[];
17
17
  export declare function isList(editor?: RichTextEditor): boolean;
18
18
  export declare function getTableSize(table: CustomElement): Record<'numRows' | 'numColumns', number> | null;
19
19
  interface InsertLinkOptions {
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react';
2
- import { BLOCKS } from '@contentful/rich-text-types';
3
2
  import * as Slate from 'slate-react';
4
3
  export declare const HeadingComponents: {
5
4
  "heading-1": React.MemoExoticComponent<(props: Slate.RenderElementProps) => JSX.Element>;
@@ -16,5 +16,5 @@ export declare const setEditorContent: (editor: Editor, nodes?: Node[] | undefin
16
16
  * Converts a Contentful rich text document to the corresponding slate editor
17
17
  * value
18
18
  */
19
- export declare const documentToEditorValue: (doc: any) => Descendant[];
20
- export declare const normalizeEditorValue: (value: Descendant[], options?: Pick<CreatePlateEditorOptions<RichTextEditor>, "plugins" | "disableCorePlugins" | "components" | "overrideByKey" | "normalizeInitialValue"> | undefined) => Descendant[] & any[];
19
+ export declare const documentToEditorValue: (doc: any) => import("types").TextOrCustomElement[];
20
+ export declare const normalizeEditorValue: (value: Descendant[], options?: Omit<CreatePlateEditorOptions<RichTextEditor>, "id" | "editor"> | 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 "element" | "editor" | "text" | "focus" | "anchor" | "cursor" | "fragment" | "selection">(tagName: S, attributes?: Object | undefined, ...children: any[]) => ReturnType<({
6
+ export declare const jsx: <S extends "element" | "editor" | "selection" | "text" | "anchor" | "focus" | "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.3.20",
3
+ "version": "3.0.1",
4
4
  "source": "./src/index.tsx",
5
5
  "main": "./dist/index.js",
6
6
  "module": "dist/field-editor-rich-text.esm.js",
@@ -29,7 +29,7 @@
29
29
  "@contentful/f36-components": "^4.0.33",
30
30
  "@contentful/f36-icons": "^4.1.1",
31
31
  "@contentful/f36-tokens": "^4.0.0",
32
- "@contentful/field-editor-reference": "^4.6.10",
32
+ "@contentful/field-editor-reference": "^5.1.0",
33
33
  "@contentful/field-editor-shared": "^1.1.3",
34
34
  "@contentful/rich-text-plain-text-renderer": "^15.12.1",
35
35
  "@contentful/rich-text-types": "^15.12.1",
@@ -72,5 +72,5 @@
72
72
  "@udecode/plate-test-utils": "^3.2.0",
73
73
  "react": ">=16.14.0"
74
74
  },
75
- "gitHead": "9d29a7aab8f073b98f29bde56c41f2615c2be51e"
75
+ "gitHead": "dd40564d18b331c7325878f9ede41a1bf8f814a6"
76
76
  }
@@ -1,8 +0,0 @@
1
- import { Entry, Asset } from '@contentful/app-sdk';
2
- interface FetchedEntityProps {
3
- type: 'Entry' | 'Asset';
4
- id: string;
5
- onEntityFetchComplete?: VoidFunction;
6
- }
7
- export declare function useFetchedEntity({ type, id, onEntityFetchComplete }: FetchedEntityProps): Entry<Record<string, any>> | Asset | "failed" | undefined;
8
- export {};
@@ -1,6 +0,0 @@
1
- /**
2
- * A userland implementation of useEvent RFC
3
- *
4
- * See: https://github.com/reactjs/rfcs/pull/220
5
- */
6
- export declare const useStableCallback: <T extends (...args: any[]) => any>(callback: T) => (...args: any[]) => any;