@contentful/field-editor-rich-text 2.0.0-next.0 → 2.0.0-next.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.
@@ -2,7 +2,7 @@ import { Path } from 'slate';
2
2
  import { BLOCKS, INLINES } from '@contentful/rich-text-types';
3
3
  import { CustomElement } from '../types';
4
4
  import { Link } from '@contentful/field-editor-reference/dist/types';
5
- import { SPEditor } from '@udecode/plate-core';
5
+ import { PlateEditor } from '@udecode/plate-core';
6
6
  export declare const LINK_TYPES: INLINES[];
7
7
  export declare function isBlockSelected(editor: any, type: string): boolean;
8
8
  export declare function isVoid(editor: any, element: any): boolean;
@@ -29,7 +29,15 @@ export declare function insertLink(editor: any, options: InsertLinkOptions): voi
29
29
  export declare function isLinkActive(editor: any): boolean;
30
30
  export declare function unwrapLink(editor: any): void;
31
31
  export declare function wrapLink(editor: any, { text, url, target, type, path }: InsertLinkOptions): void;
32
- export declare function getAncestorPathFromSelection(editor: SPEditor): Path | undefined;
33
- export declare function shouldUnwrapBlockquote(editor: SPEditor, type: BLOCKS): boolean;
34
- export declare function unwrapFromRoot(editor: SPEditor): void;
32
+ export declare function getAncestorPathFromSelection(editor: PlateEditor): Path | undefined;
33
+ export declare function shouldUnwrapBlockquote(editor: PlateEditor, type: BLOCKS): boolean;
34
+ export declare function unwrapFromRoot(editor: PlateEditor): void;
35
+ export declare const isAtEndOfTextSelection: (editor: PlateEditor) => boolean;
36
+ export declare function currentSelectionStartsTableCell(editor: PlateEditor): boolean;
37
+ /**
38
+ * This traversal strategy is unfortunately necessary because Slate doesn't
39
+ * expose something like Node.next(editor).
40
+ */
41
+ export declare function getNextNode(editor: PlateEditor): CustomElement | null;
42
+ export declare function currentSelectionPrecedesTableCell(editor: PlateEditor): boolean;
35
43
  export {};
@@ -0,0 +1 @@
1
+ export declare const HAS_BEFORE_INPUT_SUPPORT: boolean;
@@ -0,0 +1,2 @@
1
+ import { PlatePlugin } from '@udecode/plate-core';
2
+ export declare function createDragAndDropPlugin(): PlatePlugin;
@@ -1,6 +1,6 @@
1
1
  import { KeyboardEvent } from 'react';
2
2
  import { BLOCKS } from '@contentful/rich-text-types';
3
- import { PlatePlugin, SPEditor } from '@udecode/plate-core';
3
+ import { PlatePlugin, PlateEditor } from '@udecode/plate-core';
4
4
  import { CustomSlatePluginOptions } from 'types';
5
5
  import { FieldExtensionSDK } from '@contentful/app-sdk';
6
6
  export { EmbeddedEntityBlockToolbarIcon as ToolbarIcon } from './ToolbarIcon';
@@ -8,4 +8,4 @@ export declare const createEmbeddedEntryBlockPlugin: (sdk: FieldExtensionSDK) =>
8
8
  export declare const createEmbeddedAssetBlockPlugin: (sdk: FieldExtensionSDK) => PlatePlugin;
9
9
  export declare const withEmbeddedEntryBlockOptions: CustomSlatePluginOptions;
10
10
  export declare const withEmbeddedAssetBlockOptions: CustomSlatePluginOptions;
11
- export declare function getWithEmbeddedEntityEvents(nodeType: BLOCKS.EMBEDDED_ENTRY | BLOCKS.EMBEDDED_ASSET, sdk: FieldExtensionSDK): (editor: SPEditor) => (event: KeyboardEvent) => void;
11
+ export declare function getWithEmbeddedEntityEvents(nodeType: BLOCKS.EMBEDDED_ENTRY | BLOCKS.EMBEDDED_ASSET, sdk: FieldExtensionSDK): (editor: PlateEditor) => (event: KeyboardEvent) => void;
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import * as Slate from 'slate-react';
3
3
  import { BLOCKS } from '@contentful/rich-text-types';
4
- import { PlatePlugin, SPEditor } from '@udecode/plate-core';
4
+ import { PlatePlugin, PlateEditor } from '@udecode/plate-core';
5
5
  import { CustomSlatePluginOptions } from '../../types';
6
- export declare function withHeadingEvents(editor: SPEditor): (event: React.KeyboardEvent) => void;
6
+ export declare function withHeadingEvents(editor: PlateEditor): (event: React.KeyboardEvent) => void;
7
7
  interface ToolbarHeadingButtonProps {
8
8
  isDisabled?: boolean;
9
9
  }
@@ -1,11 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import * as Slate from 'slate-react';
3
- import { PlatePlugin, SPEditor } from '@udecode/plate-core';
3
+ import { PlatePlugin, PlateEditor } from '@udecode/plate-core';
4
4
  import { CustomSlatePluginOptions } from '../../types';
5
5
  interface ToolbarHrButtonProps {
6
6
  isDisabled?: boolean;
7
7
  }
8
- export declare function withHrEvents(editor: SPEditor): (event: React.KeyboardEvent) => void;
8
+ export declare function withHrEvents(editor: PlateEditor): (event: React.KeyboardEvent) => void;
9
9
  export declare function ToolbarHrButton(props: ToolbarHrButtonProps): JSX.Element | null;
10
10
  export declare function Hr(props: Slate.RenderLeafProps): JSX.Element;
11
11
  export declare function createHrPlugin(): PlatePlugin;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { FieldExtensionSDK } from '@contentful/field-editor-shared';
3
- import { SPEditor } from '@udecode/plate-core';
3
+ import { PlateEditor } from '@udecode/plate-core';
4
4
  import { ReactEditor } from 'slate-react';
5
5
  import { HistoryEditor } from 'slate-history';
6
6
  import { Link } from '@contentful/field-editor-reference/dist/types';
@@ -13,5 +13,5 @@ interface HyperlinkModalProps {
13
13
  sdk: FieldExtensionSDK;
14
14
  }
15
15
  export declare function HyperlinkModal(props: HyperlinkModalProps): JSX.Element;
16
- export declare function addOrEditLink(editor: ReactEditor & HistoryEditor & SPEditor, sdk: FieldExtensionSDK): Promise<void>;
16
+ export declare function addOrEditLink(editor: ReactEditor & HistoryEditor & PlateEditor, sdk: FieldExtensionSDK): Promise<void>;
17
17
  export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * A copy of Plate's list plugin with a few adjustments
3
+ * to fix pasting text inside lists.
4
+ */
5
+ import { PlateEditor, TDescendant } from '@udecode/plate-core';
6
+ export declare const getListInsertFragment: (editor: PlateEditor) => (fragment: TDescendant[]) => void;
@@ -11,5 +11,5 @@ export declare const UL: (props: Slate.RenderElementProps) => JSX.Element;
11
11
  export declare const OL: (props: Slate.RenderElementProps) => JSX.Element;
12
12
  export declare const LI: (props: Slate.RenderElementProps) => JSX.Element;
13
13
  export declare const withListOptions: CustomSlatePluginOptions;
14
- export declare const createListPlugin: () => import("@udecode/plate-core").PlatePlugin<import("@udecode/plate-core").SPEditor>;
14
+ export declare const createListPlugin: () => import("@udecode/plate-core").PlatePlugin<{}>;
15
15
  export {};
@@ -1,5 +1,5 @@
1
- import { SPEditor } from '@udecode/plate-core';
2
- export declare type SanitizerTuple = [Document, SPEditor];
1
+ import { PlateEditor } from '@udecode/plate-core';
2
+ export declare type SanitizerTuple = [Document, PlateEditor];
3
3
  declare type Predicate = (node: ChildNode) => boolean;
4
4
  export declare const isHTMLElement: (node: ChildNode) => node is HTMLElement;
5
5
  export declare const removeChildNodes: (node: ChildNode, predicate?: Predicate) => void;
@@ -1,11 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import * as Slate from 'slate-react';
3
- import { PlatePlugin, SPEditor } from '@udecode/plate-core';
3
+ import { PlatePlugin, PlateEditor } from '@udecode/plate-core';
4
4
  import { CustomSlatePluginOptions } from 'types';
5
5
  interface ToolbarQuoteButtonProps {
6
6
  isDisabled?: boolean;
7
7
  }
8
- export declare function withQuoteEvents(editor: SPEditor): (event: React.KeyboardEvent) => void;
8
+ export declare function withQuoteEvents(editor: PlateEditor): (event: React.KeyboardEvent) => void;
9
9
  export declare function ToolbarQuoteButton(props: ToolbarQuoteButtonProps): JSX.Element | null;
10
10
  export declare function Quote(props: Slate.RenderLeafProps): JSX.Element;
11
11
  export declare function createQuotePlugin(): PlatePlugin;
@@ -1,4 +1,4 @@
1
- import { SPEditor } from '@udecode/plate-core';
1
+ import { PlateEditor } from '@udecode/plate-core';
2
2
  import { TablePluginOptions } from '@udecode/plate-table';
3
- export declare const addColumnRight: (editor: SPEditor, options: TablePluginOptions) => void;
4
- export declare const addColumnLeft: (editor: SPEditor, options: TablePluginOptions) => void;
3
+ export declare const addColumnRight: (editor: PlateEditor, options: TablePluginOptions) => void;
4
+ export declare const addColumnLeft: (editor: PlateEditor, options: TablePluginOptions) => void;
@@ -1,3 +1,3 @@
1
- import { SPEditor } from '@udecode/plate-core';
2
- export declare const addRowBelow: (editor: SPEditor) => void;
3
- export declare const addRowAbove: (editor: SPEditor) => void;
1
+ import { PlateEditor } from '@udecode/plate-core';
2
+ export declare const addRowBelow: (editor: PlateEditor) => void;
3
+ export declare const addRowAbove: (editor: PlateEditor) => void;
@@ -1,2 +1,2 @@
1
- import { SPEditor } from '@udecode/plate-core';
2
- export declare const setHeader: (editor: SPEditor, enable?: boolean | undefined) => void;
1
+ import { PlateEditor } from '@udecode/plate-core';
2
+ export declare const setHeader: (editor: PlateEditor, enable?: boolean | undefined) => void;
@@ -1,4 +1,4 @@
1
- import { SPEditor } from '@udecode/plate-core';
2
- export declare function insertTableAndFocusFirstCell(editor: SPEditor): void;
3
- export declare function isTableActive(editor: SPEditor): boolean;
4
- export declare function isTableHeaderEnabled(editor: SPEditor): boolean;
1
+ import { PlateEditor } from '@udecode/plate-core';
2
+ export declare function insertTableAndFocusFirstCell(editor: PlateEditor): void;
3
+ export declare function isTableActive(editor: PlateEditor): boolean;
4
+ export declare function isTableHeaderEnabled(editor: PlateEditor): boolean;