@contentful/field-editor-rich-text 3.27.3 → 3.27.10

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.
Files changed (73) hide show
  1. package/dist/cjs/plugins/Table/createTablePlugin.js +1 -1
  2. package/dist/cjs/test-utils/assertOutput.js +2 -2
  3. package/dist/cjs/test-utils/{createEditor.js → createTestEditor.js} +1 -1
  4. package/dist/cjs/test-utils/index.js +1 -1
  5. package/dist/esm/plugins/Table/createTablePlugin.js +1 -1
  6. package/dist/esm/test-utils/assertOutput.js +1 -1
  7. package/dist/esm/test-utils/{createEditor.js → createTestEditor.js} +1 -1
  8. package/dist/esm/test-utils/index.js +1 -1
  9. package/dist/types/RichTextEditor.d.ts +3 -2
  10. package/dist/types/Toolbar/components/ButtonRedo.d.ts +2 -1
  11. package/dist/types/Toolbar/components/ButtonUndo.d.ts +2 -1
  12. package/dist/types/Toolbar/components/EmbedEntityWidget.d.ts +2 -1
  13. package/dist/types/Toolbar/components/EmbeddedEntityDropdownButton.d.ts +1 -1
  14. package/dist/types/Toolbar/components/StickyToolbarWrapper.d.ts +2 -2
  15. package/dist/types/Toolbar/index.d.ts +2 -1
  16. package/dist/types/dialogs/HypelinkDialog/HyperlinkDialog.d.ts +4 -4
  17. package/dist/types/dialogs/renderRichTextDialog.d.ts +2 -1
  18. package/dist/types/helpers/editor.d.ts +1 -1
  19. package/dist/types/internal/hooks.d.ts +12 -9
  20. package/dist/types/internal/misc.d.ts +22 -20
  21. package/dist/types/internal/queries.d.ts +2 -2
  22. package/dist/types/internal/transforms.d.ts +1 -1
  23. package/dist/types/internal/types/editor.d.ts +2 -1
  24. package/dist/types/plugins/CommandPalette/components/CommandList.d.ts +2 -1
  25. package/dist/types/plugins/CommandPalette/components/CommandPrompt.d.ts +2 -1
  26. package/dist/types/plugins/EmbeddedEntityBlock/LinkedEntityBlock.d.ts +2 -1
  27. package/dist/types/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.d.ts +1 -1
  28. package/dist/types/plugins/EmbeddedEntityInline/LinkedEntityInline.d.ts +2 -1
  29. package/dist/types/plugins/EmbeddedResourceBlock/LinkedResourceBlock.d.ts +2 -1
  30. package/dist/types/plugins/EmbeddedResourceInline/FetchingWrappedResourceInlineCard.d.ts +1 -1
  31. package/dist/types/plugins/EmbeddedResourceInline/LinkedResourceInline.d.ts +2 -1
  32. package/dist/types/plugins/Heading/components/Heading.d.ts +6 -6
  33. package/dist/types/plugins/Heading/components/ToolbarHeadingButton.d.ts +2 -1
  34. package/dist/types/plugins/Hr/index.d.ts +2 -2
  35. package/dist/types/plugins/Hyperlink/HyperlinkModal.d.ts +2 -1
  36. package/dist/types/plugins/Hyperlink/components/EntityHyperlink.d.ts +2 -1
  37. package/dist/types/plugins/Hyperlink/components/LinkPopover.d.ts +1 -1
  38. package/dist/types/plugins/Hyperlink/components/ResourceHyperlink.d.ts +2 -1
  39. package/dist/types/plugins/Hyperlink/components/ToolbarHyperlinkButton.d.ts +2 -1
  40. package/dist/types/plugins/Hyperlink/components/UrlHyperlink.d.ts +2 -1
  41. package/dist/types/plugins/List/components/List.d.ts +3 -2
  42. package/dist/types/plugins/List/components/ListItem.d.ts +2 -1
  43. package/dist/types/plugins/List/components/ToolbarListButton.d.ts +2 -1
  44. package/dist/types/plugins/Marks/Bold.d.ts +3 -2
  45. package/dist/types/plugins/Marks/Code.d.ts +4 -3
  46. package/dist/types/plugins/Marks/Italic.d.ts +3 -2
  47. package/dist/types/plugins/Marks/Strikethrough.d.ts +4 -3
  48. package/dist/types/plugins/Marks/Subscript.d.ts +4 -3
  49. package/dist/types/plugins/Marks/Superscript.d.ts +4 -3
  50. package/dist/types/plugins/Marks/Underline.d.ts +3 -2
  51. package/dist/types/plugins/Marks/components/MarkToolbarButton.d.ts +1 -1
  52. package/dist/types/plugins/Paragraph/Paragraph.d.ts +2 -1
  53. package/dist/types/plugins/Quote/components/Quote.d.ts +2 -1
  54. package/dist/types/plugins/Quote/components/ToolbarQuoteButton.d.ts +2 -1
  55. package/dist/types/plugins/Table/components/Cell.d.ts +2 -1
  56. package/dist/types/plugins/Table/components/HeaderCell.d.ts +2 -1
  57. package/dist/types/plugins/Table/components/Row.d.ts +2 -1
  58. package/dist/types/plugins/Table/components/Table.d.ts +2 -1
  59. package/dist/types/plugins/Table/components/TableActions.d.ts +2 -1
  60. package/dist/types/plugins/Table/components/ToolbarButton.d.ts +2 -1
  61. package/dist/types/plugins/shared/EmbeddedBlockToolbarIcon.d.ts +2 -1
  62. package/dist/types/plugins/shared/EmbeddedInlineToolbarIcon.d.ts +2 -1
  63. package/dist/types/plugins/shared/FetchingWrappedAssetCard.d.ts +2 -1
  64. package/dist/types/plugins/shared/FetchingWrappedEntryCard.d.ts +2 -1
  65. package/dist/types/plugins/shared/FetchingWrappedResourceCard.d.ts +2 -1
  66. package/dist/types/plugins/shared/LinkedBlockWrapper.d.ts +1 -1
  67. package/dist/types/plugins/shared/LinkedInlineWrapper.d.ts +1 -1
  68. package/dist/types/plugins/shared/ResourceNewBadge.d.ts +2 -1
  69. package/dist/types/plugins/shared/ToolbarButton.d.ts +2 -1
  70. package/dist/types/test-utils/createTestEditor.d.ts +13 -0
  71. package/dist/types/test-utils/index.d.ts +1 -1
  72. package/package.json +21 -21
  73. package/dist/types/test-utils/createEditor.d.ts +0 -36
@@ -31,7 +31,7 @@ const createTablePlugin = ()=>(0, _platetable.createTablePlugin)({
31
31
  withOverrides: (editor, plugin)=>{
32
32
  const { normalizeNode } = editor;
33
33
  editor = (0, _platetable.withDeleteTable)(editor);
34
- editor = (0, _platetable.withGetFragmentTable)(editor);
34
+ editor = (0, _platetable.withGetFragmentTable)(editor, plugin);
35
35
  editor = (0, _platetable.withInsertFragmentTable)(editor, plugin);
36
36
  editor = (0, _withInsertFragmentTableOverride.withInsertFragmentTableOverride)(editor);
37
37
  editor = (0, _platetable.withInsertTextTable)(editor, plugin);
@@ -9,10 +9,10 @@ Object.defineProperty(exports, "assertOutput", {
9
9
  }
10
10
  });
11
11
  const _internal = require("../internal");
12
- const _createEditor = require("./createEditor");
12
+ const _createTestEditor = require("./createTestEditor");
13
13
  const _setEmptyDataAttribute = require("./setEmptyDataAttribute");
14
14
  const assertOutput = (options)=>{
15
- const editor = options.editor ?? (0, _createEditor.createTestEditor)({
15
+ const editor = options.editor ?? (0, _createTestEditor.createTestEditor)({
16
16
  input: options.input
17
17
  }).editor;
18
18
  (0, _internal.normalize)(editor);
@@ -25,7 +25,7 @@ const createTestEditor = (options)=>{
25
25
  normalizeInitialValue: false
26
26
  });
27
27
  return {
28
- editor,
28
+ editor: editor,
29
29
  normalize: ()=>(0, _internal.normalize)(editor)
30
30
  };
31
31
  };
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  _export_star(require("./jsx"), exports);
6
- _export_star(require("./createEditor"), exports);
6
+ _export_star(require("./createTestEditor"), exports);
7
7
  _export_star(require("./mockPlugin"), exports);
8
8
  _export_star(require("./assertOutput"), exports);
9
9
  function _export_star(from, to) {
@@ -21,7 +21,7 @@ export const createTablePlugin = ()=>createDefaultTablePlugin({
21
21
  withOverrides: (editor, plugin)=>{
22
22
  const { normalizeNode } = editor;
23
23
  editor = withDeleteTable(editor);
24
- editor = withGetFragmentTable(editor);
24
+ editor = withGetFragmentTable(editor, plugin);
25
25
  editor = withInsertFragmentTable(editor, plugin);
26
26
  editor = withInsertFragmentTableOverride(editor);
27
27
  editor = withInsertTextTable(editor, plugin);
@@ -1,5 +1,5 @@
1
1
  import { normalize } from '../internal';
2
- import { createTestEditor } from './createEditor';
2
+ import { createTestEditor } from './createTestEditor';
3
3
  import { setEmptyDataAttribute } from './setEmptyDataAttribute';
4
4
  export const assertOutput = (options)=>{
5
5
  const editor = options.editor ?? createTestEditor({
@@ -15,7 +15,7 @@ export const createTestEditor = (options)=>{
15
15
  normalizeInitialValue: false
16
16
  });
17
17
  return {
18
- editor,
18
+ editor: editor,
19
19
  normalize: ()=>normalize(editor)
20
20
  };
21
21
  };
@@ -1,4 +1,4 @@
1
1
  export * from './jsx';
2
- export * from './createEditor';
2
+ export * from './createTestEditor';
3
3
  export * from './mockPlugin';
4
4
  export * from './assertOutput';
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import { FieldAppSDK } from '@contentful/app-sdk';
2
3
  import * as Contentful from '@contentful/rich-text-types';
3
4
  import { RichTextTrackingActionHandler } from './plugins/Tracking';
@@ -29,6 +30,6 @@ type ConnectedRichTextProps = {
29
30
  isToolbarHidden?: boolean;
30
31
  actionsDisabled?: boolean;
31
32
  };
32
- export declare const ConnectedRichTextEditor: (props: ConnectedRichTextProps) => JSX.Element;
33
- declare const RichTextEditor: (props: RichTextProps) => JSX.Element;
33
+ export declare const ConnectedRichTextEditor: (props: ConnectedRichTextProps) => React.JSX.Element;
34
+ declare const RichTextEditor: (props: RichTextProps) => React.JSX.Element;
34
35
  export default RichTextEditor;
@@ -1 +1,2 @@
1
- export declare const ButtonRedo: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const ButtonRedo: () => React.JSX.Element;
@@ -1 +1,2 @@
1
- export declare const ButtonUndo: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const ButtonUndo: () => React.JSX.Element;
@@ -1,5 +1,6 @@
1
+ import React from 'react';
1
2
  export interface EmbedEntityWidgetProps {
2
3
  isDisabled?: boolean;
3
4
  canInsertBlocks?: boolean;
4
5
  }
5
- export declare const EmbedEntityWidget: ({ isDisabled, canInsertBlocks }: EmbedEntityWidgetProps) => JSX.Element | null;
6
+ export declare const EmbedEntityWidget: ({ isDisabled, canInsertBlocks }: EmbedEntityWidgetProps) => React.JSX.Element | null;
@@ -6,4 +6,4 @@ export interface EmbeddedEntityDropdownButtonProps {
6
6
  onClose: () => void;
7
7
  onToggle: () => void;
8
8
  }
9
- export declare function EmbeddedEntityDropdownButton({ children, isDisabled, isOpen, onClose, onToggle, }: EmbeddedEntityDropdownButtonProps): JSX.Element;
9
+ export declare function EmbeddedEntityDropdownButton({ children, isDisabled, isOpen, onClose, onToggle, }: EmbeddedEntityDropdownButtonProps): React.JSX.Element;
@@ -1,7 +1,7 @@
1
- import { ReactNode } from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  type StickyToolbarProps = {
3
3
  isDisabled?: boolean;
4
4
  children: ReactNode;
5
5
  };
6
- declare const StickyToolbarWrapper: ({ isDisabled, children }: StickyToolbarProps) => JSX.Element;
6
+ declare const StickyToolbarWrapper: ({ isDisabled, children }: StickyToolbarProps) => React.JSX.Element;
7
7
  export default StickyToolbarWrapper;
@@ -1,5 +1,6 @@
1
+ import * as React from 'react';
1
2
  type ToolbarProps = {
2
3
  isDisabled?: boolean;
3
4
  };
4
- declare const Toolbar: ({ isDisabled }: ToolbarProps) => JSX.Element;
5
+ declare const Toolbar: ({ isDisabled }: ToolbarProps) => React.JSX.Element;
5
6
  export default Toolbar;
@@ -48,10 +48,10 @@ export class HyperlinkDialog extends React.Component<any, any, any> {
48
48
  handleSubmit: (event: any) => void;
49
49
  selectEntry: () => Promise<void>;
50
50
  selectAsset: () => Promise<void>;
51
- render(): JSX.Element;
52
- renderFields(): JSX.Element;
53
- renderEntityField(): JSX.Element;
54
- renderEntitySelector(type: any): JSX.Element;
51
+ render(): React.JSX.Element;
52
+ renderFields(): React.JSX.Element;
53
+ renderEntityField(): React.JSX.Element;
54
+ renderEntitySelector(type: any): React.JSX.Element;
55
55
  }
56
56
  export function openHyperlinkDialog(dialogs: any, { value, showTextInput, allowedHyperlinkTypes, entitySelectorConfigs }: {
57
57
  value: any;
@@ -1,2 +1,3 @@
1
+ import * as React from 'react';
1
2
  import { DialogAppSDK } from '@contentful/app-sdk';
2
- export declare const renderRichTextDialog: (sdk: DialogAppSDK) => JSX.Element;
3
+ export declare const renderRichTextDialog: (sdk: DialogAppSDK) => React.JSX.Element;
@@ -12,7 +12,7 @@ export declare function isNodeTypeSelected(editor: PlateEditor | null, nodeType:
12
12
  export declare function moveToTheNextLine(editor: PlateEditor): void;
13
13
  export declare function moveToTheNextChar(editor: PlateEditor): void;
14
14
  export declare function insertEmptyParagraph(editor: PlateEditor, options?: any): void;
15
- export declare function getElementFromCurrentSelection(editor: PlateEditor): (import("slate").Path | import("@udecode/slate").ENode<import("@udecode/slate").Value>)[];
15
+ export declare function getElementFromCurrentSelection(editor: PlateEditor): (import("slate").Path | Node)[];
16
16
  export declare function isList(editor?: PlateEditor): boolean;
17
17
  export declare function getTableSize(table: Element): Record<'numRows' | 'numColumns', number> | null;
18
18
  interface InsertLinkOptions {
@@ -1,25 +1,28 @@
1
+ /// <reference types="react" />
1
2
  import * as p from '@udecode/plate-common';
2
3
  import { PlateEditor } from './types';
3
4
  export declare const useReadOnly: () => boolean;
4
5
  export declare const usePlateEditorRef: (id?: string) => PlateEditor;
5
6
  export declare const usePlateEditorState: (id?: string) => PlateEditor;
6
7
  export declare const usePlateSelectors: (id?: string) => {
7
- id: (options?: string | import("jotai-x").UseAtomOptions | undefined) => string;
8
8
  editor: (options?: string | import("jotai-x").UseAtomOptions | undefined) => p.PlateEditor<p.Value>;
9
- rawPlugins: (options?: string | import("jotai-x").UseAtomOptions | undefined) => p.PlatePlugin<p.AnyObject, p.Value, p.PlateEditor<p.Value>>[];
9
+ id: (options?: string | import("jotai-x").UseAtomOptions | undefined) => string;
10
10
  plugins: (options?: string | import("jotai-x").UseAtomOptions | undefined) => p.WithPlatePlugin<p.AnyObject, p.Value, p.PlateEditor<p.Value>>[];
11
+ rawPlugins: (options?: string | import("jotai-x").UseAtomOptions | undefined) => p.PlatePlugin<p.AnyObject, p.Value, p.PlateEditor<p.Value>>[];
11
12
  value: (options?: string | import("jotai-x").UseAtomOptions | undefined) => p.Value;
13
+ decorate: (options?: string | import("jotai-x").UseAtomOptions | undefined) => ((entry: p.TNodeEntry) => import("slate").BaseRange[]) | null;
14
+ editorRef: (options?: string | import("jotai-x").UseAtomOptions | undefined) => import("react").ForwardedRef<p.PlateEditor<p.Value>>;
12
15
  isMounted: (options?: string | import("jotai-x").UseAtomOptions | undefined) => boolean | null;
13
- readOnly: (options?: string | import("jotai-x").UseAtomOptions | undefined) => boolean | null;
14
- primary: (options?: string | import("jotai-x").UseAtomOptions | undefined) => boolean | null;
15
- versionEditor: (options?: string | import("jotai-x").UseAtomOptions | undefined) => number | null;
16
- versionSelection: (options?: string | import("jotai-x").UseAtomOptions | undefined) => number | null;
17
- versionDecorate: (options?: string | import("jotai-x").UseAtomOptions | undefined) => number | null;
18
16
  onChange: (options?: string | import("jotai-x").UseAtomOptions | undefined) => ((value: p.Value) => void) | null;
19
- editorRef: (options?: string | import("jotai-x").UseAtomOptions | undefined) => React__default.ForwardedRef<p.PlateEditor<p.Value>>;
20
- decorate: (options?: string | import("jotai-x").UseAtomOptions | undefined) => ((entry: p.TNodeEntry) => import("slate").BaseRange[]) | null;
17
+ onSelectionChange: (options?: string | import("jotai-x").UseAtomOptions | undefined) => ((selection: import("slate").BaseSelection) => void) | null;
18
+ onValueChange: (options?: string | import("jotai-x").UseAtomOptions | undefined) => ((value: p.Value) => void) | null;
19
+ primary: (options?: string | import("jotai-x").UseAtomOptions | undefined) => boolean | null;
20
+ readOnly: (options?: string | import("jotai-x").UseAtomOptions | undefined) => boolean | null;
21
21
  renderElement: (options?: string | import("jotai-x").UseAtomOptions | undefined) => p.RenderElementFn | null;
22
22
  renderLeaf: (options?: string | import("jotai-x").UseAtomOptions | undefined) => p.RenderLeafFn | null;
23
+ versionDecorate: (options?: string | import("jotai-x").UseAtomOptions | undefined) => number | null;
24
+ versionEditor: (options?: string | import("jotai-x").UseAtomOptions | undefined) => number | null;
25
+ versionSelection: (options?: string | import("jotai-x").UseAtomOptions | undefined) => number | null;
23
26
  trackedEditor: (options?: string | import("jotai-x").UseAtomOptions | undefined) => {
24
27
  editor: any;
25
28
  version: number | null;
@@ -5,30 +5,32 @@ import type { Value, PlateEditor, Location, PlatePlugin } from './types';
5
5
  export type CreatePlateEditorOptions = Omit<p.CreatePlateEditorOptions<Value, PlateEditor>, 'plugins'> & {
6
6
  plugins?: PlatePlugin[];
7
7
  };
8
- export declare const createPlateEditor: (options?: CreatePlateEditorOptions) => PlateEditor & Omit<s.BaseEditor, "children" | "operations" | "marks" | "apply" | "getDirtyPaths" | "getFragment" | "markableVoid" | "normalizeNode" | "insertFragment" | "insertNode" | "isInline" | "isVoid" | "id"> & {
9
- id: any;
10
- children: Value;
11
- operations: p.TOperation<p.TDescendant>[];
12
- marks: Record<string, any> | null;
13
- isInline: <N extends p.TElement>(element: N) => boolean;
14
- isVoid: <N_1 extends p.TElement>(element: N_1) => boolean;
15
- markableVoid: <N_2 extends p.TElement>(element: N_2) => boolean;
16
- normalizeNode: <N_3 extends p.TNode>(entry: p.TNodeEntry<N_3>) => void;
17
- apply: <N_4 extends p.TDescendant>(operation: p.TOperation<N_4>) => void;
18
- getFragment: <N_5 extends p.TDescendant>() => N_5[];
19
- insertFragment: <N_6 extends p.TDescendant>(fragment: N_6[]) => void;
20
- insertNode: <N_7 extends p.TDescendant>(node: N_7) => void;
21
- getDirtyPaths: <N_8 extends p.TDescendant>(operation: p.TOperation<N_8>) => s.Path[];
22
- } & p.UnknownObject & Pick<import("slate-history").HistoryEditor, "history" | "undo" | "redo"> & Pick<import("slate-react").ReactEditor, "insertData" | "insertFragmentData" | "insertTextData" | "setFragmentData" | "hasRange" | "hasTarget" | "hasEditableTarget" | "hasSelectableTarget" | "isTargetInsideNonReadonlyVoid"> & p.PlateEditorMethods<Value> & {
8
+ export declare const createPlateEditor: (options?: CreatePlateEditorOptions) => PlateEditor & {
9
+ blockFactory: (node?: Partial<p.TElement> | undefined, path?: s.Path | undefined) => p.TElement;
10
+ childrenFactory: () => Value;
11
+ currentKeyboardEvent: import("react").KeyboardEvent<Element> | null;
12
+ isFallback: boolean;
23
13
  key: any;
24
14
  plugins: p.WithPlatePlugin<{}, Value, p.PlateEditor<Value>>[];
25
15
  pluginsByKey: Record<string, p.WithPlatePlugin<{}, Value, p.PlateEditor<Value>>>;
26
16
  prevSelection: s.BaseRange | null;
27
- blockFactory: (node?: Partial<p.TElement> | undefined, path?: s.Path | undefined) => p.TElement;
28
- childrenFactory: () => Value;
29
- isFallback: boolean;
30
- currentKeyboardEvent: import("react").KeyboardEvent<Element> | null;
31
- };
17
+ } & p.PlateEditorMethods<Value> & Omit<s.BaseEditor, "children" | "operations" | "marks" | "apply" | "getDirtyPaths" | "getFragment" | "markableVoid" | "normalizeNode" | "insertFragment" | "insertNode" | "isInline" | "isVoid" | "id"> & {
18
+ apply: <N extends p.TDescendant>(operation: p.TOperation<N>) => void;
19
+ children: Value;
20
+ getDirtyPaths: <N_1 extends p.TDescendant>(operation: p.TOperation<N_1>) => s.Path[];
21
+ getFragment: <N_2 extends p.TDescendant>() => N_2[];
22
+ id: any;
23
+ insertFragment: <N_3 extends p.TDescendant>(fragment: N_3[]) => void;
24
+ insertNode: <N_4 extends p.TDescendant>(node: N_4) => void;
25
+ isInline: <N_5 extends p.TElement>(element: N_5) => boolean;
26
+ isVoid: <N_6 extends p.TElement>(element: N_6) => boolean;
27
+ markableVoid: <N_7 extends p.TElement>(element: N_7) => boolean;
28
+ marks: Record<string, any> | null;
29
+ normalizeNode: <N_8 extends p.TNode>(entry: p.TNodeEntry<N_8>, options?: {
30
+ operation?: p.TOperation<p.TDescendant> | undefined;
31
+ } | undefined) => void;
32
+ operations: p.TOperation<p.TDescendant>[];
33
+ } & p.UnknownObject & Pick<import("slate-history").HistoryEditor, "history" | "redo" | "undo" | "writeHistory"> & Pick<import("slate-react").ReactEditor, "hasEditableTarget" | "hasRange" | "hasSelectableTarget" | "hasTarget" | "insertData" | "insertFragmentData" | "insertTextData" | "isTargetInsideNonReadonlyVoid" | "setFragmentData">;
32
34
  /**
33
35
  * The only reason for this helper to exist is to run the initial normalization
34
36
  * before mounting the Plate editor component which in turn avoids the false
@@ -18,13 +18,13 @@ export declare const isSelectionAtBlockStart: (editor: PlateEditor, options?: p.
18
18
  export declare const getBlockAbove: (editor: PlateEditor, options?: p.GetAboveNodeOptions<p.Value>) => p.TNodeEntry<p.TElement | p.TEditor<p.Value>> | undefined;
19
19
  export declare const getNodeEntry: (editor: PlateEditor, at: Location, options?: s.EditorNodeOptions) => p.TNodeEntry<p.ENode<Value>> | undefined;
20
20
  export declare const getNodeEntries: (editor: PlateEditor, options?: p.GetNodeEntriesOptions) => Generator<p.TNodeEntry<p.ENode<p.Value>>, void, undefined>;
21
- export declare const getNodeChildren: (root: Ancestor, path: s.Path, options?: s.NodeChildrenOptions | undefined) => Generator<p.TNodeEntry<Text | Element | p.TDescendant>, void, undefined>;
21
+ export declare const getNodeChildren: (root: Ancestor, path: s.Path, options?: s.NodeChildrenOptions | undefined) => Generator<p.TNodeEntry<p.TDescendant | Text | Element>, void, undefined>;
22
22
  export declare const getParentNode: (editor: PlateEditor, at: Location, options?: s.EditorParentOptions) => NodeEntry | undefined;
23
23
  export declare const someNode: (editor: PlateEditor, options: p.FindNodeOptions) => boolean;
24
24
  export declare const getChildren: (entry: NodeEntry) => NodeEntry[];
25
25
  export declare const isFirstChild: (path: s.Path) => boolean;
26
26
  export declare const getDescendantNodeByPath: (root: Node, path: s.Path) => Node;
27
- export declare const getNodeDescendants: (root: PlateEditor | Node, options?: s.NodeDescendantsOptions) => Generator<p.TNodeEntry<p.TText | Element | p.TElement>, void, undefined>;
27
+ export declare const getNodeDescendants: (root: PlateEditor | Node, options?: s.NodeDescendantsOptions) => Generator<p.TNodeEntry<p.TElement | p.TText | Element>, void, undefined>;
28
28
  export declare const isRangeCollapsed: (range?: BaseRange) => boolean;
29
29
  export declare const isRangeAcrossBlocks: (editor: p.TEditor<p.Value>, options?: (Omit<p.GetAboveNodeOptions<p.Value>, 'at'> & {
30
30
  at?: s.BaseRange | null | undefined;
@@ -24,7 +24,7 @@ export declare const unwrapNodes: (editor: PlateEditor, options?: p.UnwrapNodesO
24
24
  export declare const wrapNodes: (editor: PlateEditor, element: Element, options?: p.WrapNodesOptions<Value>) => void;
25
25
  export declare const toggleNodeType: (editor: PlateEditor, options: ToggleNodeTypeOptions, editorOptions?: Omit<EditorNodesOptions, 'match'>) => void;
26
26
  export declare const removeMark: (editor: PlateEditor, type: string, at: BaseRange) => void;
27
- export declare const unhangRange: (editor: PlateEditor, range?: Path | BasePoint | BaseRange | Span | null | undefined, options?: p.UnhangRangeOptions | undefined) => s.Path | s.BasePoint | s.BaseRange | s.Span | null | undefined;
27
+ export declare const unhangRange: (editor: PlateEditor, range?: Path | BasePoint | BaseRange | Span | null | undefined, options?: p.UnhangRangeOptions | undefined) => s.Path | s.BaseRange | s.BasePoint | s.Span | null | undefined;
28
28
  export declare const toggleMark: (editor: PlateEditor, options: p.ToggleMarkOptions) => void;
29
29
  export declare const addMark: (editor: PlateEditor, type: string, value?: unknown) => void;
30
30
  export declare const insertText: (editor: PlateEditor, text: string, options?: TextInsertTextOptions) => void;
@@ -24,9 +24,10 @@ export interface Element extends p.TElement {
24
24
  children: (Text | Element)[];
25
25
  }
26
26
  export type Value = Element[];
27
- export type ReactEditor = p.TReactEditor<Value>;
27
+ export type ReactEditor = p.PlateEditor<Value>;
28
28
  export interface PlateEditor extends p.PlateEditor<Value> {
29
29
  tracking: TrackingPluginActions;
30
+ f: any;
30
31
  undo: {
31
32
  (): void;
32
33
  (source: 'toolbar' | 'shortcut'): void;
@@ -1,7 +1,8 @@
1
+ import * as React from 'react';
1
2
  import { PlateEditor } from '../../../internal/types';
2
3
  export interface CommandListProps {
3
4
  query: string;
4
5
  editor: PlateEditor;
5
6
  textContainer?: HTMLSpanElement;
6
7
  }
7
- export declare const CommandList: ({ query, editor, textContainer }: CommandListProps) => JSX.Element | null;
8
+ export declare const CommandList: ({ query, editor, textContainer }: CommandListProps) => React.JSX.Element | null;
@@ -1,4 +1,5 @@
1
+ import * as React from 'react';
1
2
  import { PlateEditor, RenderLeafProps } from '../../../internal/types';
2
3
  export declare const CommandPrompt: (props: RenderLeafProps & {
3
4
  editor: PlateEditor;
4
- }) => JSX.Element;
5
+ }) => React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import { EntityLink } from '@contentful/field-editor-reference';
2
3
  import { Element, RenderElementProps } from '../../internal/types';
3
4
  type LinkedEntityBlockProps = {
@@ -9,5 +10,5 @@ type LinkedEntityBlockProps = {
9
10
  attributes: Pick<RenderElementProps, 'attributes'>;
10
11
  children: Pick<RenderElementProps, 'children'>;
11
12
  };
12
- export declare function LinkedEntityBlock(props: LinkedEntityBlockProps): JSX.Element;
13
+ export declare function LinkedEntityBlock(props: LinkedEntityBlockProps): React.JSX.Element;
13
14
  export {};
@@ -9,5 +9,5 @@ interface FetchingWrappedInlineEntryCardProps {
9
9
  onRemove: (event: React.MouseEvent<Element, MouseEvent>) => void;
10
10
  onEntityFetchComplete?: VoidFunction;
11
11
  }
12
- export declare function FetchingWrappedInlineEntryCard(props: FetchingWrappedInlineEntryCardProps): JSX.Element;
12
+ export declare function FetchingWrappedInlineEntryCard(props: FetchingWrappedInlineEntryCardProps): React.JSX.Element;
13
13
  export {};
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import { EntryLink } from '@contentful/field-editor-reference';
2
3
  import { Element, RenderElementProps } from '../../internal/types';
3
4
  type LinkedEntityInlineProps = {
@@ -9,5 +10,5 @@ type LinkedEntityInlineProps = {
9
10
  attributes: Pick<RenderElementProps, 'attributes'>;
10
11
  children: Pick<RenderElementProps, 'children'>;
11
12
  };
12
- export declare function LinkedEntityInline(props: LinkedEntityInlineProps): JSX.Element;
13
+ export declare function LinkedEntityInline(props: LinkedEntityInlineProps): React.JSX.Element;
13
14
  export {};
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { Element, RenderElementProps } from '../../internal';
2
3
  export type LinkedResourceBlockProps = {
3
4
  element: Element & {
@@ -14,4 +15,4 @@ export type LinkedResourceBlockProps = {
14
15
  attributes: Pick<RenderElementProps, 'attributes'>;
15
16
  children: Pick<RenderElementProps, 'children'>;
16
17
  };
17
- export declare function LinkedResourceBlock(props: LinkedResourceBlockProps): JSX.Element;
18
+ export declare function LinkedResourceBlock(props: LinkedResourceBlockProps): React.JSX.Element;
@@ -9,5 +9,5 @@ interface FetchingWrappedResourceInlineCardProps {
9
9
  onRemove: (event: React.MouseEvent<Element, MouseEvent>) => void;
10
10
  onEntityFetchComplete?: VoidFunction;
11
11
  }
12
- export declare function FetchingWrappedResourceInlineCard(props: FetchingWrappedResourceInlineCardProps): JSX.Element;
12
+ export declare function FetchingWrappedResourceInlineCard(props: FetchingWrappedResourceInlineCardProps): React.JSX.Element;
13
13
  export {};
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { ResourceLink } from '@contentful/field-editor-reference';
2
3
  import { Element, RenderElementProps } from '../../internal';
3
4
  export type LinkedResourceInlineProps = {
@@ -9,4 +10,4 @@ export type LinkedResourceInlineProps = {
9
10
  attributes: Pick<RenderElementProps, 'attributes'>;
10
11
  children: Pick<RenderElementProps, 'children'>;
11
12
  };
12
- export declare function LinkedResourceInline(props: LinkedResourceInlineProps): JSX.Element;
13
+ export declare function LinkedResourceInline(props: LinkedResourceInlineProps): React.JSX.Element;
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import * as Slate from 'slate-react';
3
3
  export declare const HeadingComponents: {
4
- "heading-1": React.MemoExoticComponent<(props: Slate.RenderElementProps) => JSX.Element>;
5
- "heading-2": React.MemoExoticComponent<(props: Slate.RenderElementProps) => JSX.Element>;
6
- "heading-3": React.MemoExoticComponent<(props: Slate.RenderElementProps) => JSX.Element>;
7
- "heading-4": React.MemoExoticComponent<(props: Slate.RenderElementProps) => JSX.Element>;
8
- "heading-5": React.MemoExoticComponent<(props: Slate.RenderElementProps) => JSX.Element>;
9
- "heading-6": React.MemoExoticComponent<(props: Slate.RenderElementProps) => JSX.Element>;
4
+ "heading-1": React.MemoExoticComponent<(props: Slate.RenderElementProps) => React.JSX.Element>;
5
+ "heading-2": React.MemoExoticComponent<(props: Slate.RenderElementProps) => React.JSX.Element>;
6
+ "heading-3": React.MemoExoticComponent<(props: Slate.RenderElementProps) => React.JSX.Element>;
7
+ "heading-4": React.MemoExoticComponent<(props: Slate.RenderElementProps) => React.JSX.Element>;
8
+ "heading-5": React.MemoExoticComponent<(props: Slate.RenderElementProps) => React.JSX.Element>;
9
+ "heading-6": React.MemoExoticComponent<(props: Slate.RenderElementProps) => React.JSX.Element>;
10
10
  };
@@ -1,4 +1,5 @@
1
+ import * as React from 'react';
1
2
  export interface ToolbarHeadingButtonProps {
2
3
  isDisabled?: boolean;
3
4
  }
4
- export declare function ToolbarHeadingButton(props: ToolbarHeadingButtonProps): JSX.Element | null;
5
+ export declare function ToolbarHeadingButton(props: ToolbarHeadingButtonProps): React.JSX.Element | null;
@@ -5,7 +5,7 @@ interface ToolbarHrButtonProps {
5
5
  isDisabled?: boolean;
6
6
  }
7
7
  export declare function withHrEvents(editor: PlateEditor): (event: React.KeyboardEvent) => void;
8
- export declare function ToolbarHrButton(props: ToolbarHrButtonProps): JSX.Element | null;
9
- export declare function Hr(props: Slate.RenderLeafProps): JSX.Element;
8
+ export declare function ToolbarHrButton(props: ToolbarHrButtonProps): React.JSX.Element | null;
9
+ export declare function Hr(props: Slate.RenderLeafProps): React.JSX.Element;
10
10
  export declare const createHrPlugin: () => PlatePlugin;
11
11
  export {};
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import { Link } from '@contentful/field-editor-reference';
2
3
  import { FieldAppSDK } from '@contentful/field-editor-shared';
3
4
  import { ResourceLink } from '@contentful/rich-text-types';
@@ -12,6 +13,6 @@ interface HyperlinkModalProps {
12
13
  sdk: FieldAppSDK;
13
14
  readonly: boolean;
14
15
  }
15
- export declare function HyperlinkModal(props: HyperlinkModalProps): JSX.Element;
16
+ export declare function HyperlinkModal(props: HyperlinkModalProps): React.JSX.Element;
16
17
  export declare function addOrEditLink(editor: PlateEditor, sdk: FieldAppSDK, logAction: TrackingPluginActions['onToolbarAction'] | TrackingPluginActions['onShortcutAction'] | TrackingPluginActions['onViewportAction'], targetPath?: Path): Promise<void>;
17
18
  export {};
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import { Link } from '@contentful/app-sdk';
2
3
  import { Element, RenderElementProps } from '../../../internal/types';
3
4
  export type HyperlinkElementProps = {
@@ -17,4 +18,4 @@ export type HyperlinkElementProps = {
17
18
  children: Pick<RenderElementProps, 'children'>;
18
19
  onEntityFetchComplete: VoidFunction;
19
20
  };
20
- export declare function EntityHyperlink(props: HyperlinkElementProps): JSX.Element | null;
21
+ export declare function EntityHyperlink(props: HyperlinkElementProps): React.JSX.Element | null;
@@ -8,5 +8,5 @@ type LinkPopoverProps = {
8
8
  handleCopyLink?: () => void;
9
9
  isEditorFocused: boolean;
10
10
  };
11
- export declare const LinkPopover: ({ isLinkFocused, popoverText, handleEditLink, handleRemoveLink, children, handleCopyLink, isEditorFocused, }: LinkPopoverProps) => JSX.Element;
11
+ export declare const LinkPopover: ({ isLinkFocused, popoverText, handleEditLink, handleRemoveLink, children, handleCopyLink, isEditorFocused, }: LinkPopoverProps) => React.JSX.Element;
12
12
  export {};
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import { Link } from '@contentful/app-sdk';
2
3
  import { Element, RenderElementProps } from '../../../internal/types';
3
4
  export type ResourceHyperlinkProps = {
@@ -16,4 +17,4 @@ export type ResourceHyperlinkProps = {
16
17
  attributes: Pick<RenderElementProps, 'attributes'>;
17
18
  children: Pick<RenderElementProps, 'children'>;
18
19
  };
19
- export declare function ResourceHyperlink(props: ResourceHyperlinkProps): JSX.Element | null;
20
+ export declare function ResourceHyperlink(props: ResourceHyperlinkProps): React.JSX.Element | null;
@@ -1,5 +1,6 @@
1
+ import * as React from 'react';
1
2
  interface ToolbarHyperlinkButtonProps {
2
3
  isDisabled: boolean | undefined;
3
4
  }
4
- export declare function ToolbarHyperlinkButton(props: ToolbarHyperlinkButtonProps): JSX.Element | null;
5
+ export declare function ToolbarHyperlinkButton(props: ToolbarHyperlinkButtonProps): React.JSX.Element | null;
5
6
  export {};
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import { Link } from '@contentful/app-sdk';
2
3
  import { Element, RenderElementProps } from '../../../internal/types';
3
4
  type UrlHyperlinkProps = {
@@ -17,5 +18,5 @@ type UrlHyperlinkProps = {
17
18
  onEntityFetchComplete?: VoidFunction;
18
19
  children: Pick<RenderElementProps, 'children'>;
19
20
  };
20
- export declare function UrlHyperlink(props: UrlHyperlinkProps): JSX.Element;
21
+ export declare function UrlHyperlink(props: UrlHyperlinkProps): React.JSX.Element;
21
22
  export {};
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import * as Slate from 'slate-react';
2
- export declare const ListUL: (props: Slate.RenderElementProps) => JSX.Element;
3
- export declare const ListOL: (props: Slate.RenderElementProps) => JSX.Element;
3
+ export declare const ListUL: (props: Slate.RenderElementProps) => React.JSX.Element;
4
+ export declare const ListOL: (props: Slate.RenderElementProps) => React.JSX.Element;
@@ -1,2 +1,3 @@
1
+ import * as React from 'react';
1
2
  import * as Slate from 'slate-react';
2
- export declare function ListItem(props: Slate.RenderElementProps): JSX.Element;
3
+ export declare function ListItem(props: Slate.RenderElementProps): React.JSX.Element;
@@ -1,4 +1,5 @@
1
+ import * as React from 'react';
1
2
  export interface ToolbarListButtonProps {
2
3
  isDisabled?: boolean;
3
4
  }
4
- export declare function ToolbarListButton(props: ToolbarListButtonProps): JSX.Element | null;
5
+ export declare function ToolbarListButton(props: ToolbarListButtonProps): React.JSX.Element | null;
@@ -1,10 +1,11 @@
1
+ import * as React from 'react';
1
2
  import { MARKS } from '@contentful/rich-text-types';
2
3
  import { PlatePlugin, RenderLeafProps } from '../../internal/types';
3
4
  export declare const ToolbarBoldButton: {
4
5
  ({ isDisabled }: {
5
6
  isDisabled?: boolean | undefined;
6
- }): JSX.Element | null;
7
+ }): React.JSX.Element | null;
7
8
  displayName: MARKS;
8
9
  };
9
- export declare function Bold(props: RenderLeafProps): JSX.Element;
10
+ export declare function Bold(props: RenderLeafProps): React.JSX.Element;
10
11
  export declare const createBoldPlugin: () => PlatePlugin;
@@ -1,16 +1,17 @@
1
+ import * as React from 'react';
1
2
  import { MARKS } from '@contentful/rich-text-types';
2
3
  import { PlatePlugin, RenderLeafProps } from '../../internal/types';
3
4
  export declare const ToolbarCodeButton: {
4
5
  ({ isDisabled }: {
5
6
  isDisabled?: boolean | undefined;
6
- }): JSX.Element | null;
7
+ }): React.JSX.Element | null;
7
8
  displayName: MARKS;
8
9
  };
9
10
  export declare const ToolbarDropdownCodeButton: {
10
11
  ({ isDisabled }: {
11
12
  isDisabled?: boolean | undefined;
12
- }): JSX.Element | null;
13
+ }): React.JSX.Element | null;
13
14
  displayName: MARKS;
14
15
  };
15
- export declare function Code(props: RenderLeafProps): JSX.Element;
16
+ export declare function Code(props: RenderLeafProps): React.JSX.Element;
16
17
  export declare const createCodePlugin: () => PlatePlugin;
@@ -1,10 +1,11 @@
1
+ import * as React from 'react';
1
2
  import { MARKS } from '@contentful/rich-text-types';
2
3
  import { PlatePlugin, RenderLeafProps } from '../../internal/types';
3
4
  export declare const ToolbarItalicButton: {
4
5
  ({ isDisabled }: {
5
6
  isDisabled?: boolean | undefined;
6
- }): JSX.Element | null;
7
+ }): React.JSX.Element | null;
7
8
  displayName: MARKS;
8
9
  };
9
- export declare function Italic(props: RenderLeafProps): JSX.Element;
10
+ export declare function Italic(props: RenderLeafProps): React.JSX.Element;
10
11
  export declare const createItalicPlugin: () => PlatePlugin;
@@ -1,16 +1,17 @@
1
+ import * as React from 'react';
1
2
  import { MARKS } from '@contentful/rich-text-types';
2
3
  import { PlatePlugin, RenderLeafProps } from '../../internal/types';
3
4
  export declare const ToolbarDropdownStrikethroughButton: {
4
5
  ({ isDisabled }: {
5
6
  isDisabled?: boolean | undefined;
6
- }): JSX.Element | null;
7
+ }): React.JSX.Element | null;
7
8
  displayName: MARKS;
8
9
  };
9
10
  export declare const ToolbarStrikethroughButton: {
10
11
  ({ isDisabled }: {
11
12
  isDisabled?: boolean | undefined;
12
- }): JSX.Element | null;
13
+ }): React.JSX.Element | null;
13
14
  displayName: MARKS;
14
15
  };
15
- export declare function Strikethrough(props: RenderLeafProps): JSX.Element;
16
+ export declare function Strikethrough(props: RenderLeafProps): React.JSX.Element;
16
17
  export declare const createStrikethroughPlugin: () => PlatePlugin;
@@ -1,16 +1,17 @@
1
+ import * as React from 'react';
1
2
  import { MARKS } from '@contentful/rich-text-types';
2
3
  import { PlatePlugin, RenderLeafProps } from '../../internal/types';
3
4
  export declare const ToolbarSubscriptButton: {
4
5
  ({ isDisabled }: {
5
6
  isDisabled?: boolean | undefined;
6
- }): JSX.Element | null;
7
+ }): React.JSX.Element | null;
7
8
  displayName: MARKS;
8
9
  };
9
10
  export declare const ToolbarDropdownSubscriptButton: {
10
11
  ({ isDisabled }: {
11
12
  isDisabled?: boolean | undefined;
12
- }): JSX.Element | null;
13
+ }): React.JSX.Element | null;
13
14
  displayName: MARKS;
14
15
  };
15
- export declare function Subscript(props: RenderLeafProps): JSX.Element;
16
+ export declare function Subscript(props: RenderLeafProps): React.JSX.Element;
16
17
  export declare const createSubscriptPlugin: () => PlatePlugin;
@@ -1,16 +1,17 @@
1
+ import * as React from 'react';
1
2
  import { MARKS } from '@contentful/rich-text-types';
2
3
  import { PlatePlugin, RenderLeafProps } from '../../internal/types';
3
4
  export declare const ToolbarSuperscriptButton: {
4
5
  ({ isDisabled }: {
5
6
  isDisabled?: boolean | undefined;
6
- }): JSX.Element | null;
7
+ }): React.JSX.Element | null;
7
8
  displayName: MARKS;
8
9
  };
9
10
  export declare const ToolbarDropdownSuperscriptButton: {
10
11
  ({ isDisabled }: {
11
12
  isDisabled?: boolean | undefined;
12
- }): JSX.Element | null;
13
+ }): React.JSX.Element | null;
13
14
  displayName: MARKS;
14
15
  };
15
- export declare function Superscript(props: RenderLeafProps): JSX.Element;
16
+ export declare function Superscript(props: RenderLeafProps): React.JSX.Element;
16
17
  export declare const createSuperscriptPlugin: () => PlatePlugin;
@@ -1,10 +1,11 @@
1
+ import * as React from 'react';
1
2
  import { MARKS } from '@contentful/rich-text-types';
2
3
  import { PlatePlugin, RenderLeafProps } from '../../internal/types';
3
4
  export declare const ToolbarUnderlineButton: {
4
5
  ({ isDisabled }: {
5
6
  isDisabled?: boolean | undefined;
6
- }): JSX.Element | null;
7
+ }): React.JSX.Element | null;
7
8
  displayName: MARKS;
8
9
  };
9
- export declare function Underline(props: RenderLeafProps): JSX.Element;
10
+ export declare function Underline(props: RenderLeafProps): React.JSX.Element;
10
11
  export declare const createUnderlinePlugin: () => PlatePlugin;
@@ -8,6 +8,6 @@ export interface MarkOptions {
8
8
  export declare const createMarkToolbarButton: ({ mark, title, icon }: MarkOptions) => {
9
9
  ({ isDisabled }: {
10
10
  isDisabled?: boolean | undefined;
11
- }): JSX.Element | null;
11
+ }): React.JSX.Element | null;
12
12
  displayName: MARKS;
13
13
  };
@@ -1,2 +1,3 @@
1
+ import * as React from 'react';
1
2
  import { RenderElementProps } from '../../internal/types';
2
- export declare function Paragraph(props: RenderElementProps): JSX.Element;
3
+ export declare function Paragraph(props: RenderElementProps): React.JSX.Element;
@@ -1,2 +1,3 @@
1
+ import * as React from 'react';
1
2
  import { RenderElementProps } from '../../../internal/types';
2
- export declare function Quote(props: RenderElementProps): JSX.Element;
3
+ export declare function Quote(props: RenderElementProps): React.JSX.Element;
@@ -1,4 +1,5 @@
1
+ import * as React from 'react';
1
2
  export interface ToolbarQuoteButtonProps {
2
3
  isDisabled?: boolean;
3
4
  }
4
- export declare function ToolbarQuoteButton(props: ToolbarQuoteButtonProps): JSX.Element | null;
5
+ export declare function ToolbarQuoteButton(props: ToolbarQuoteButtonProps): React.JSX.Element | null;
@@ -1,2 +1,3 @@
1
+ import * as React from 'react';
1
2
  import { RenderElementProps } from '../../../internal/types';
2
- export declare const Cell: (props: RenderElementProps) => JSX.Element;
3
+ export declare const Cell: (props: RenderElementProps) => React.JSX.Element;
@@ -1,2 +1,3 @@
1
+ import * as React from 'react';
1
2
  import { RenderElementProps } from '../../../internal/types';
2
- export declare const HeaderCell: (props: RenderElementProps) => JSX.Element;
3
+ export declare const HeaderCell: (props: RenderElementProps) => React.JSX.Element;
@@ -1,2 +1,3 @@
1
+ import * as React from 'react';
1
2
  import * as Slate from 'slate-react';
2
- export declare const Row: (props: Slate.RenderElementProps) => JSX.Element;
3
+ export declare const Row: (props: Slate.RenderElementProps) => React.JSX.Element;
@@ -1,2 +1,3 @@
1
+ import * as React from 'react';
1
2
  import * as Slate from 'slate-react';
2
- export declare const Table: (props: Slate.RenderElementProps) => JSX.Element;
3
+ export declare const Table: (props: Slate.RenderElementProps) => React.JSX.Element;
@@ -1,4 +1,5 @@
1
+ import * as React from 'react';
1
2
  export declare const styles: {
2
3
  topRight: string;
3
4
  };
4
- export declare const TableActions: () => JSX.Element | null;
5
+ export declare const TableActions: () => React.JSX.Element | null;
@@ -1,4 +1,5 @@
1
+ import * as React from 'react';
1
2
  export interface ToolbarTableButtonProps {
2
3
  isDisabled: boolean | undefined;
3
4
  }
4
- export declare function ToolbarTableButton(props: ToolbarTableButtonProps): JSX.Element | null;
5
+ export declare function ToolbarTableButton(props: ToolbarTableButtonProps): React.JSX.Element | null;
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  export declare const styles: {
2
3
  icon: string;
3
4
  };
@@ -6,5 +7,5 @@ interface EmbeddedBlockToolbarIconProps {
6
7
  nodeType: string;
7
8
  onClose: () => void;
8
9
  }
9
- export declare function EmbeddedBlockToolbarIcon({ isDisabled, nodeType, onClose, }: EmbeddedBlockToolbarIconProps): JSX.Element;
10
+ export declare function EmbeddedBlockToolbarIcon({ isDisabled, nodeType, onClose, }: EmbeddedBlockToolbarIconProps): React.JSX.Element;
10
11
  export {};
@@ -1,7 +1,8 @@
1
+ import * as React from 'react';
1
2
  interface EmbeddedInlineToolbarIconProps {
2
3
  onClose: () => void;
3
4
  nodeType: string;
4
5
  isDisabled: boolean;
5
6
  }
6
- export declare function EmbeddedInlineToolbarIcon({ onClose, nodeType, isDisabled, }: EmbeddedInlineToolbarIconProps): JSX.Element;
7
+ export declare function EmbeddedInlineToolbarIcon({ onClose, nodeType, isDisabled, }: EmbeddedInlineToolbarIconProps): React.JSX.Element;
7
8
  export {};
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import { FieldAppSDK } from '@contentful/app-sdk';
2
3
  interface FetchingWrappedAssetCardProps {
3
4
  assetId: string;
@@ -9,5 +10,5 @@ interface FetchingWrappedAssetCardProps {
9
10
  sdk: FieldAppSDK;
10
11
  onEntityFetchComplete?: VoidFunction;
11
12
  }
12
- export declare function FetchingWrappedAssetCard(props: FetchingWrappedAssetCardProps): JSX.Element;
13
+ export declare function FetchingWrappedAssetCard(props: FetchingWrappedAssetCardProps): React.JSX.Element;
13
14
  export {};
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import { FieldAppSDK } from '@contentful/app-sdk';
2
3
  interface FetchingWrappedEntryCardProps {
3
4
  entryId: string;
@@ -9,5 +10,5 @@ interface FetchingWrappedEntryCardProps {
9
10
  onEdit?: VoidFunction;
10
11
  onRemove?: VoidFunction;
11
12
  }
12
- export declare const FetchingWrappedEntryCard: (props: FetchingWrappedEntryCardProps) => JSX.Element;
13
+ export declare const FetchingWrappedEntryCard: (props: FetchingWrappedEntryCardProps) => React.JSX.Element;
13
14
  export {};
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import { FieldAppSDK } from '@contentful/app-sdk';
2
3
  import { ResourceLink } from '@contentful/rich-text-types';
3
4
  interface FetchingWrappedResourceCardProps {
@@ -9,5 +10,5 @@ interface FetchingWrappedResourceCardProps {
9
10
  onEdit?: VoidFunction;
10
11
  onRemove?: VoidFunction;
11
12
  }
12
- export declare const FetchingWrappedResourceCard: (props: FetchingWrappedResourceCardProps) => JSX.Element;
13
+ export declare const FetchingWrappedResourceCard: (props: FetchingWrappedResourceCardProps) => React.JSX.Element;
13
14
  export {};
@@ -6,5 +6,5 @@ type LinkedBlockWrapperProps = React.PropsWithChildren<{
6
6
  card: JSX.Element;
7
7
  link: ResourceLink<'Contentful:Entry'> | EntityLink;
8
8
  }>;
9
- export declare function LinkedBlockWrapper({ attributes, card, children, link }: LinkedBlockWrapperProps): JSX.Element;
9
+ export declare function LinkedBlockWrapper({ attributes, card, children, link }: LinkedBlockWrapperProps): React.JSX.Element;
10
10
  export {};
@@ -6,5 +6,5 @@ type LinkedInlineWrapperProps = React.PropsWithChildren<{
6
6
  card: JSX.Element;
7
7
  link: ResourceLink<'Contentful:Entry'> | EntryLink;
8
8
  }>;
9
- export declare function LinkedInlineWrapper({ attributes, card, children, link, }: LinkedInlineWrapperProps): JSX.Element;
9
+ export declare function LinkedInlineWrapper({ attributes, card, children, link, }: LinkedInlineWrapperProps): React.JSX.Element;
10
10
  export {};
@@ -1 +1,2 @@
1
- export declare const ResourceNewBadge: () => JSX.Element;
1
+ import * as React from 'react';
2
+ export declare const ResourceNewBadge: () => React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  interface ToolbarButtonProps {
2
3
  onClick: () => void;
3
4
  isActive?: boolean;
@@ -7,5 +8,5 @@ interface ToolbarButtonProps {
7
8
  className?: string;
8
9
  testId?: string;
9
10
  }
10
- export declare function ToolbarButton(props: ToolbarButtonProps): JSX.Element;
11
+ export declare function ToolbarButton(props: ToolbarButtonProps): React.JSX.Element;
11
12
  export {};
@@ -0,0 +1,13 @@
1
+ import { FieldAppSDK } from '@contentful/app-sdk';
2
+ import { PlateEditor } from '../internal';
3
+ import { PlatePlugin } from '../internal/types';
4
+ import { RichTextTrackingActionHandler } from '../plugins/Tracking';
5
+ export declare const createTestEditor: (options: {
6
+ input?: any;
7
+ sdk?: FieldAppSDK;
8
+ trackingHandler?: RichTextTrackingActionHandler;
9
+ plugins?: PlatePlugin[];
10
+ }) => {
11
+ editor: PlateEditor;
12
+ normalize: () => void;
13
+ };
@@ -1,4 +1,4 @@
1
1
  export * from './jsx';
2
- export * from './createEditor';
2
+ export * from './createTestEditor';
3
3
  export * from './mockPlugin';
4
4
  export * from './assertOutput';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/field-editor-rich-text",
3
- "version": "3.27.3",
3
+ "version": "3.27.10",
4
4
  "source": "./src/index.tsx",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -40,27 +40,27 @@
40
40
  "dependencies": {
41
41
  "@contentful/app-sdk": "^4.29.0",
42
42
  "@contentful/contentful-slatejs-adapter": "^15.16.5",
43
- "@contentful/f36-components": "^4.67.0",
44
- "@contentful/f36-icons": "^4.28.2",
43
+ "@contentful/f36-components": "^4.70.0",
44
+ "@contentful/f36-icons": "^4.29.0",
45
45
  "@contentful/f36-tokens": "^4.0.5",
46
46
  "@contentful/f36-utils": "^4.24.3",
47
- "@contentful/field-editor-reference": "^5.30.6",
48
- "@contentful/field-editor-shared": "^1.6.1",
47
+ "@contentful/field-editor-reference": "^5.30.12",
48
+ "@contentful/field-editor-shared": "^1.7.0",
49
49
  "@contentful/rich-text-plain-text-renderer": "^16.0.4",
50
50
  "@contentful/rich-text-types": "16.7.0",
51
51
  "@popperjs/core": "^2.11.5",
52
- "@udecode/plate-basic-marks": "30.1.2",
53
- "@udecode/plate-break": "30.1.2",
54
- "@udecode/plate-common": "30.1.2",
55
- "@udecode/plate-core": "30.1.2",
56
- "@udecode/plate-list": "30.1.2",
57
- "@udecode/plate-paragraph": "30.1.2",
58
- "@udecode/plate-reset-node": "30.1.2",
59
- "@udecode/plate-select": "30.1.2",
60
- "@udecode/plate-serializer-docx": "30.1.2",
61
- "@udecode/plate-serializer-html": "30.1.2",
62
- "@udecode/plate-table": "30.1.2",
63
- "@udecode/plate-trailing-block": "30.1.2",
52
+ "@udecode/plate-basic-marks": "36.0.0",
53
+ "@udecode/plate-break": "36.0.0",
54
+ "@udecode/plate-common": "36.5.9",
55
+ "@udecode/plate-core": "36.5.9",
56
+ "@udecode/plate-list": "36.0.0",
57
+ "@udecode/plate-paragraph": "36.0.0",
58
+ "@udecode/plate-reset-node": "36.0.0",
59
+ "@udecode/plate-select": "36.0.0",
60
+ "@udecode/plate-serializer-docx": "36.0.10",
61
+ "@udecode/plate-serializer-html": "36.0.0",
62
+ "@udecode/plate-table": "36.5.9",
63
+ "@udecode/plate-trailing-block": "36.0.0",
64
64
  "constate": "^3.3.2",
65
65
  "fast-deep-equal": "^3.1.3",
66
66
  "is-hotkey": "^0.2.0",
@@ -76,15 +76,15 @@
76
76
  "react-dom": ">=16.14.0"
77
77
  },
78
78
  "devDependencies": {
79
- "@contentful/field-editor-test-utils": "^1.5.1",
79
+ "@contentful/field-editor-test-utils": "^1.5.2",
80
80
  "@contentful/rich-text-react-renderer": "^15.16.4",
81
81
  "@types/is-hotkey": "^0.1.6",
82
82
  "@udecode/plate-test-utils": "^3.2.0",
83
- "prism-react-renderer": "2.0.5",
84
- "react": ">=16.14.0"
83
+ "prism-react-renderer": "2.4.0",
84
+ "react": "18.3.1"
85
85
  },
86
86
  "publishConfig": {
87
87
  "registry": "https://npm.pkg.github.com/"
88
88
  },
89
- "gitHead": "ce8ab2158a732d3c419b9e82f06ce17115b7d131"
89
+ "gitHead": "d734036ff89da141dbb91ade0342fb7f82cfe167"
90
90
  }
@@ -1,36 +0,0 @@
1
- /// <reference types="react" />
2
- import { FieldAppSDK } from '@contentful/app-sdk';
3
- import { PlatePlugin } from '../internal/types';
4
- import { RichTextTrackingActionHandler } from '../plugins/Tracking';
5
- export declare const createTestEditor: (options: {
6
- input?: any;
7
- sdk?: FieldAppSDK;
8
- trackingHandler?: RichTextTrackingActionHandler;
9
- plugins?: PlatePlugin[];
10
- }) => {
11
- editor: import("../internal").PlateEditor & Omit<import("slate").BaseEditor, "children" | "operations" | "marks" | "apply" | "getDirtyPaths" | "getFragment" | "markableVoid" | "normalizeNode" | "insertFragment" | "insertNode" | "isInline" | "isVoid" | "id"> & {
12
- id: any;
13
- children: import("../internal").Value;
14
- operations: import("@udecode/slate").TOperation<import("@udecode/slate").TDescendant>[];
15
- marks: Record<string, any> | null;
16
- isInline: <N extends import("@udecode/slate").TElement>(element: N) => boolean;
17
- isVoid: <N_1 extends import("@udecode/slate").TElement>(element: N_1) => boolean;
18
- markableVoid: <N_2 extends import("@udecode/slate").TElement>(element: N_2) => boolean;
19
- normalizeNode: <N_3 extends import("@udecode/slate").TNode>(entry: import("@udecode/slate").TNodeEntry<N_3>) => void;
20
- apply: <N_4 extends import("@udecode/slate").TDescendant>(operation: import("@udecode/slate").TOperation<N_4>) => void;
21
- getFragment: <N_5 extends import("@udecode/slate").TDescendant>() => N_5[];
22
- insertFragment: <N_6 extends import("@udecode/slate").TDescendant>(fragment: N_6[]) => void;
23
- insertNode: <N_7 extends import("@udecode/slate").TDescendant>(node: N_7) => void;
24
- getDirtyPaths: <N_8 extends import("@udecode/slate").TDescendant>(operation: import("@udecode/slate").TOperation<N_8>) => import("slate").Path[];
25
- } & import("@udecode/utils").UnknownObject & Pick<import("slate-history").HistoryEditor, "history" | "undo" | "redo"> & Pick<import("slate-react").ReactEditor, "insertData" | "insertFragmentData" | "insertTextData" | "setFragmentData" | "hasRange" | "hasTarget" | "hasEditableTarget" | "hasSelectableTarget" | "isTargetInsideNonReadonlyVoid"> & import("@udecode/plate-core").PlateEditorMethods<import("../internal").Value> & {
26
- key: any;
27
- plugins: import("@udecode/plate-core").WithPlatePlugin<{}, import("../internal").Value, import("@udecode/plate-core").PlateEditor<import("../internal").Value>>[];
28
- pluginsByKey: Record<string, import("@udecode/plate-core").WithPlatePlugin<{}, import("../internal").Value, import("@udecode/plate-core").PlateEditor<import("../internal").Value>>>;
29
- prevSelection: import("slate").BaseRange | null;
30
- blockFactory: (node?: Partial<import("@udecode/slate").TElement> | undefined, path?: import("slate").Path | undefined) => import("@udecode/slate").TElement;
31
- childrenFactory: () => import("../internal").Value;
32
- isFallback: boolean;
33
- currentKeyboardEvent: import("react").KeyboardEvent<Element> | null;
34
- };
35
- normalize: () => void;
36
- };