@contentful/field-editor-rich-text 2.0.0-next.4 → 2.0.0-next.42

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 (92) hide show
  1. package/README.md +4 -0
  2. package/dist/ContentfulEditorProvider.d.ts +6 -5
  3. package/dist/RichTextEditor.d.ts +1 -1
  4. package/dist/field-editor-rich-text.cjs.development.js +2693 -1147
  5. package/dist/field-editor-rich-text.cjs.development.js.map +1 -1
  6. package/dist/field-editor-rich-text.cjs.production.min.js +1 -1
  7. package/dist/field-editor-rich-text.cjs.production.min.js.map +1 -1
  8. package/dist/field-editor-rich-text.esm.js +2767 -1221
  9. package/dist/field-editor-rich-text.esm.js.map +1 -1
  10. package/dist/helpers/editor.d.ts +16 -17
  11. package/dist/helpers/environment.d.ts +1 -0
  12. package/dist/helpers/extractNodes.d.ts +2 -3
  13. package/dist/helpers/{sanitizeSlateDoc.d.ts → sanitizeIncomingSlateDoc.d.ts} +2 -1
  14. package/dist/helpers/transformers.d.ts +6 -6
  15. package/dist/plugins/Break/createResetNodePlugin.d.ts +2 -0
  16. package/dist/plugins/Break/index.d.ts +2 -0
  17. package/dist/plugins/EmbeddedEntityBlock/LinkedEntityBlock.d.ts +3 -1
  18. package/dist/plugins/EmbeddedEntityBlock/ToolbarIcon.d.ts +1 -3
  19. package/dist/plugins/EmbeddedEntityBlock/Util.d.ts +2 -1
  20. package/dist/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.d.ts +1 -0
  21. package/dist/plugins/EmbeddedEntityInline/index.d.ts +2 -2
  22. package/dist/plugins/Hr/index.d.ts +2 -3
  23. package/dist/plugins/Hyperlink/HyperlinkModal.d.ts +5 -4
  24. package/dist/plugins/Hyperlink/components/EntityHyperlink.d.ts +9 -0
  25. package/dist/plugins/Hyperlink/components/ToolbarHyperlinkButton.d.ts +5 -0
  26. package/dist/plugins/Hyperlink/components/UrlHyperlink.d.ts +9 -0
  27. package/dist/plugins/Hyperlink/components/styles.d.ts +4 -0
  28. package/dist/plugins/Hyperlink/createHyperlinkPlugin.d.ts +3 -0
  29. package/dist/plugins/Hyperlink/index.d.ts +2 -8
  30. package/dist/plugins/Hyperlink/useEntityInfo.d.ts +16 -0
  31. package/dist/plugins/Hyperlink/utils.d.ts +4 -2
  32. package/dist/plugins/List/insertListBreak.d.ts +2 -0
  33. package/dist/plugins/List/insertListFragment.d.ts +3 -0
  34. package/dist/plugins/List/onKeyDownList.d.ts +7 -0
  35. package/dist/plugins/List/transforms/deleteBackwardList.d.ts +2 -0
  36. package/dist/plugins/List/transforms/insertListItem.d.ts +5 -0
  37. package/dist/plugins/List/transforms/moveListItemDown.d.ts +11 -0
  38. package/dist/plugins/List/transforms/moveListItems.d.ts +10 -0
  39. package/dist/plugins/List/transforms/toggleList.d.ts +4 -0
  40. package/dist/plugins/List/transforms/unwrapList.d.ts +5 -0
  41. package/dist/plugins/List/utils.d.ts +9 -5
  42. package/dist/plugins/List/withList.d.ts +2 -1
  43. package/dist/plugins/Marks/Bold.d.ts +7 -5
  44. package/dist/plugins/Marks/Code.d.ts +7 -5
  45. package/dist/plugins/Marks/Italic.d.ts +7 -5
  46. package/dist/plugins/Marks/Underline.d.ts +7 -5
  47. package/dist/plugins/Marks/components/MarkToolbarButton.d.ts +13 -0
  48. package/dist/plugins/Marks/helpers.d.ts +4 -0
  49. package/dist/plugins/Normalizer/types.d.ts +4 -3
  50. package/dist/plugins/Normalizer/utils.d.ts +2 -2
  51. package/dist/plugins/Normalizer/withNormalizer.d.ts +2 -2
  52. package/dist/plugins/PasteHTML/createPasteHTMLPlugin.d.ts +6 -0
  53. package/dist/plugins/Quote/shouldResetQuote.d.ts +8 -0
  54. package/dist/plugins/Quote/toggleQuote.d.ts +5 -2
  55. package/dist/plugins/Quote/withQuote.d.ts +3 -0
  56. package/dist/plugins/SlashCommands/SlashCommandsPalette.d.ts +5 -0
  57. package/dist/plugins/SlashCommands/createSlashCommandsPlugin.d.ts +2 -0
  58. package/dist/plugins/SlashCommands/helpers.d.ts +6 -0
  59. package/dist/plugins/SlashCommands/index.d.ts +2 -0
  60. package/dist/plugins/Table/actions/addColumn.d.ts +3 -3
  61. package/dist/plugins/Table/actions/addRow.d.ts +3 -3
  62. package/dist/plugins/Table/actions/setHeader.d.ts +2 -2
  63. package/dist/plugins/Table/createTablePlugin.d.ts +1 -2
  64. package/dist/plugins/Table/helpers.d.ts +8 -7
  65. package/dist/plugins/Table/insertTableFragment.d.ts +3 -0
  66. package/dist/plugins/Table/onKeyDownTable.d.ts +3 -0
  67. package/dist/plugins/Table/tableTracking.d.ts +4 -0
  68. package/dist/plugins/Text/createTextPlugin.d.ts +2 -0
  69. package/dist/plugins/Text/index.d.ts +1 -2
  70. package/dist/plugins/Tracking/createTrackingPlugin.d.ts +11 -0
  71. package/dist/plugins/Tracking/index.d.ts +1 -0
  72. package/dist/plugins/Tracking/utils.d.ts +2 -0
  73. package/dist/plugins/TrailingParagraph/index.d.ts +2 -1
  74. package/dist/plugins/Voids/transformVoid.d.ts +2 -2
  75. package/dist/plugins/index.d.ts +2 -2
  76. package/dist/plugins/links-tracking.d.ts +6 -0
  77. package/dist/plugins/shared/FetchingWrappedAssetCard.d.ts +1 -0
  78. package/dist/plugins/shared/FetchingWrappedEntryCard.d.ts +3 -2
  79. package/dist/prepareDocument.d.ts +20 -0
  80. package/dist/test-utils/assertOutput.d.ts +2 -2
  81. package/dist/test-utils/createEditor.d.ts +5 -6
  82. package/dist/test-utils/jsx.d.ts +1 -1
  83. package/dist/test-utils/mockPlugin.d.ts +1 -1
  84. package/dist/test-utils/setEmptyDataAttribute.d.ts +2 -2
  85. package/dist/types.d.ts +11 -3
  86. package/dist/useOnValueChanged.d.ts +8 -0
  87. package/package.json +16 -15
  88. package/dist/TrackingProvider.d.ts +0 -11
  89. package/dist/plugins/Hyperlink/EntryAssetTooltip.d.ts +0 -9
  90. package/dist/plugins/Hyperlink/truncate.d.ts +0 -1
  91. package/dist/plugins/List/getListInsertFragment.d.ts +0 -6
  92. package/dist/plugins/Table/addTableTrackingEvents.d.ts +0 -3
@@ -1,15 +1,16 @@
1
- import { PlateEditor } from '@udecode/plate-core';
2
1
  import { Node, NodeEntry } from 'slate';
3
- export declare function insertTableAndFocusFirstCell(editor: PlateEditor): void;
4
- export declare function isTableActive(editor: PlateEditor): boolean;
5
- export declare function isTableHeaderEnabled(editor: PlateEditor): boolean;
6
- export declare function replaceEmptyParagraphWithTable(editor: PlateEditor): void;
2
+ import { RichTextEditor, TextOrCustomElement } from '../../types';
3
+ export declare function insertTableAndFocusFirstCell(editor: RichTextEditor): void;
4
+ export declare function isTableActive(editor: RichTextEditor): boolean;
5
+ export declare function isTableHeaderEnabled(editor: RichTextEditor): boolean;
6
+ export declare function replaceEmptyParagraphWithTable(editor: RichTextEditor): void;
7
7
  /**
8
8
  * Returns the number of cells in a given row vs the table width
9
9
  *
10
10
  * Note: We should only get different table rows cell counts in between
11
11
  * normalization cycles.
12
12
  */
13
- export declare const getNoOfMissingTableCellsInRow: (editor: PlateEditor, [, rowPath]: NodeEntry<Node>) => number;
13
+ export declare const getNoOfMissingTableCellsInRow: (editor: RichTextEditor, [, rowPath]: NodeEntry<Node>) => number;
14
14
  export declare const createEmptyTableCells: (count: number) => Node[];
15
- export declare const isNotEmpty: (editor: PlateEditor, [, path]: NodeEntry<Node>) => boolean;
15
+ export declare const isNotEmpty: (editor: RichTextEditor, [, path]: NodeEntry<Node>) => boolean;
16
+ export declare const isTable: (node: TextOrCustomElement) => boolean;
@@ -0,0 +1,3 @@
1
+ import { Node } from 'slate';
2
+ import { RichTextEditor } from '../../types';
3
+ export declare const insertTableFragment: (editor: RichTextEditor) => (fragments: Node[]) => void;
@@ -0,0 +1,3 @@
1
+ import { HotkeyPlugin, KeyboardHandler } from '@udecode/plate-core';
2
+ import { RichTextEditor } from '../../types';
3
+ export declare const onKeyDownTable: KeyboardHandler<RichTextEditor, HotkeyPlugin>;
@@ -0,0 +1,4 @@
1
+ import { RichTextEditor } from '../../types';
2
+ import type { NodeTransformer } from '../Normalizer';
3
+ export declare function addTableTrackingEvents(editor: RichTextEditor): void;
4
+ export declare const withInvalidCellChildrenTracking: (transformer: NodeTransformer) => NodeTransformer;
@@ -0,0 +1,2 @@
1
+ import { RichTextPlugin } from '../../types';
2
+ export declare function createTextPlugin(): RichTextPlugin;
@@ -1,2 +1 @@
1
- import { RichTextPlugin } from '../../types';
2
- export declare function createTextPlugin(): RichTextPlugin;
1
+ export * from './createTextPlugin';
@@ -0,0 +1,11 @@
1
+ import { RichTextPlugin } from '../../types';
2
+ export declare type RichTextTrackingActionName = 'edit' | 'insert' | 'remove' | 'mark' | 'unmark' | 'insertTable' | 'insertTableRow' | 'insertTableColumn' | 'removeTable' | 'removeTableRow' | 'removeTableColumn' | 'paste' | 'invalidTablePaste' | 'cancelCreateHyperlinkDialog' | 'cancelEditHyperlinkDialog' | 'linkRendered' | 'openCreateHyperlinkDialog' | 'openEditHyperlinkDialog' | 'unlinkHyperlinks' | 'openCreateEmbedDialog' | 'cancelCreateEmbedDialog';
3
+ export declare type RichTextTrackingActionHandler = (name: RichTextTrackingActionName, data: Record<string, unknown>) => unknown;
4
+ export interface TrackingPluginActions {
5
+ onViewportAction: (actionName: RichTextTrackingActionName, data?: Record<string, unknown>) => ReturnType<RichTextTrackingActionHandler>;
6
+ onShortcutAction: (actionName: RichTextTrackingActionName, data?: Record<string, unknown>) => ReturnType<RichTextTrackingActionHandler>;
7
+ onToolbarAction: (actionName: RichTextTrackingActionName, data?: Record<string, unknown>) => ReturnType<RichTextTrackingActionHandler>;
8
+ onCommandPaletteAction: (actionName: RichTextTrackingActionName, data?: Record<string, unknown>) => ReturnType<RichTextTrackingActionHandler>;
9
+ }
10
+ export declare function getPastingSource(data: DataTransfer): "Google Docs" | "Google Spreadsheets" | "Microsoft Excel" | "Microsoft Word" | "Microsoft Word Online" | "Apple Notes" | "Slack" | "Unknown";
11
+ export declare const createTrackingPlugin: (onAction: RichTextTrackingActionHandler) => RichTextPlugin;
@@ -0,0 +1 @@
1
+ export * from './createTrackingPlugin';
@@ -0,0 +1,2 @@
1
+ import { RichTextEditor } from '../../types';
2
+ export declare function getCharacterCount(editor: RichTextEditor): number;
@@ -1 +1,2 @@
1
- export declare const createTrailingParagraphPlugin: () => import("@udecode/plate-core").PlatePlugin<{}, import("@udecode/plate-trailing-block").TrailingBlockPlugin>;
1
+ import { RichTextPlugin } from '../../types';
2
+ export declare const createTrailingParagraphPlugin: () => RichTextPlugin;
@@ -1,6 +1,6 @@
1
- import { PlateEditor } from '@udecode/plate-core';
2
1
  import { NodeEntry } from 'slate';
2
+ import { RichTextEditor } from '../../types';
3
3
  /**
4
4
  * Re-creates a void node with valid children.
5
5
  */
6
- export declare const transformVoid: (editor: PlateEditor, [node, path]: NodeEntry<import("slate").Node>) => void;
6
+ export declare const transformVoid: (editor: RichTextEditor, [node, path]: NodeEntry<import("slate").Node>) => void;
@@ -1,6 +1,6 @@
1
1
  import { FieldExtensionSDK } from '@contentful/app-sdk';
2
2
  import { PlateProps } from '@udecode/plate-core';
3
- import { TrackingProvider } from '../TrackingProvider';
4
3
  import { RichTextPlugin } from '../types';
5
- export declare const getPlugins: (sdk: FieldExtensionSDK, tracking: TrackingProvider) => RichTextPlugin[];
4
+ import { RichTextTrackingActionHandler } from './Tracking';
5
+ export declare const getPlugins: (sdk: FieldExtensionSDK, onAction: RichTextTrackingActionHandler) => RichTextPlugin[];
6
6
  export declare const disableCorePlugins: PlateProps['disableCorePlugins'];
@@ -0,0 +1,6 @@
1
+ import React, { ComponentProps } from 'react';
2
+ declare type WithEntityFetchProps = {
3
+ onEntityFetchComplete: VoidFunction;
4
+ } & JSX.IntrinsicAttributes;
5
+ export declare function withLinkTracking(Component: React.ComponentType<WithEntityFetchProps>): (props: ComponentProps<typeof Component>) => JSX.Element;
6
+ export {};
@@ -8,6 +8,7 @@ interface FetchingWrappedAssetCardProps {
8
8
  onEdit?: () => void;
9
9
  onRemove?: () => unknown;
10
10
  sdk: FieldExtensionSDK;
11
+ onEntityFetchComplete?: VoidFunction;
11
12
  }
12
13
  export declare function renderAssetInfo(props: {
13
14
  entityFile: File;
@@ -5,8 +5,9 @@ interface FetchingWrappedEntryCardProps {
5
5
  isSelected: boolean;
6
6
  locale: string;
7
7
  sdk: FieldExtensionSDK;
8
- onEdit?: () => void;
9
- onRemove?: () => void;
8
+ onEntityFetchComplete?: VoidFunction;
9
+ onEdit?: VoidFunction;
10
+ onRemove?: VoidFunction;
10
11
  }
11
12
  export declare function FetchingWrappedEntryCard(props: FetchingWrappedEntryCardProps): JSX.Element;
12
13
  export {};
@@ -0,0 +1,20 @@
1
+ import { Document } from '@contentful/rich-text-types';
2
+ import { CreatePlateEditorOptions } from '@udecode/plate-core';
3
+ import { Descendant, Editor, Node } from 'slate';
4
+ import { RichTextEditor } from 'types';
5
+ /**
6
+ * For legacy reasons, a document may not have any content at all
7
+ * e.g:
8
+ *
9
+ * {nodeType: document, data: {}, content: []}
10
+ *
11
+ * Rendering such document will break the Slate editor
12
+ */
13
+ export declare const hasContent: (doc?: Document | undefined) => boolean;
14
+ export declare const setEditorContent: (editor: Editor, nodes?: Node[] | undefined) => void;
15
+ /**
16
+ * Converts a Contentful rich text document to the corresponding slate editor
17
+ * value
18
+ */
19
+ export declare const documentToEditorValue: (doc: any) => Descendant[];
20
+ export declare const normalizeEditorValue: (value: Descendant[], options?: Pick<CreatePlateEditorOptions<RichTextEditor>, "plugins" | "disableCorePlugins" | "components" | "overrideByKey"> | undefined) => Descendant[] & any[];
@@ -1,7 +1,7 @@
1
- import { PlateEditor } from '@udecode/plate-core';
1
+ import { RichTextEditor } from '../types';
2
2
  export declare const assertOutput: (options: {
3
3
  input?: any;
4
4
  expected: any;
5
- editor?: PlateEditor;
5
+ editor?: RichTextEditor;
6
6
  log?: boolean;
7
7
  }) => void;
@@ -1,14 +1,13 @@
1
1
  import { FieldExtensionSDK } from '@contentful/app-sdk';
2
- import { PlateEditor } from '@udecode/plate-core';
3
- import { TrackingProvider } from '../TrackingProvider';
4
- import { RichTextPlugin } from '../types';
5
- export declare const normalize: (editor: PlateEditor) => void;
2
+ import { RichTextTrackingActionHandler } from '../plugins/Tracking';
3
+ import { RichTextEditor, RichTextPlugin } from '../types';
4
+ export declare const normalize: (editor: RichTextEditor) => void;
6
5
  export declare const createTestEditor: (options: {
7
6
  input?: any;
8
7
  sdk?: FieldExtensionSDK;
9
- tracking?: TrackingProvider;
8
+ trackingHandler?: RichTextTrackingActionHandler;
10
9
  plugins?: RichTextPlugin[];
11
10
  }) => {
12
- editor: PlateEditor<{}>;
11
+ editor: import("@udecode/plate-core").PlateEditor<RichTextEditor>;
13
12
  normalize: () => void;
14
13
  };
@@ -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 "editor" | "selection" | "text" | "element" | "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: {
@@ -1,2 +1,2 @@
1
1
  import { RichTextPlugin } from '../types';
2
- export declare const mockPlugin: (p: Partial<RichTextPlugin>) => import("@udecode/plate-core").WithRequired<import("@udecode/plate-core").PlatePlugin<{}, {}>, "type" | "options" | "inject" | "editor">;
2
+ export declare const mockPlugin: (p: Partial<RichTextPlugin>) => any;
@@ -1,6 +1,6 @@
1
- import { PlateEditor } from '@udecode/plate-core';
1
+ import { RichTextEditor } from '../types';
2
2
  /**
3
3
  * Sets empty node.data attributes. Helpful when testing against
4
4
  * output generated by a 3rd-party library e.g. Plate.
5
5
  */
6
- export declare const setEmptyDataAttribute: (root: PlateEditor) => void;
6
+ export declare const setEmptyDataAttribute: (root: RichTextEditor) => void;
package/dist/types.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { MARKS } from '@contentful/rich-text-types';
2
- import { PlatePlugin } from '@udecode/plate-core';
2
+ import { PlateEditor, PlatePlugin } from '@udecode/plate-core';
3
3
  import { RenderElementProps } from 'slate-react';
4
- import type { SoftBreakRule, ExitBreakRule } from './plugins/Break';
4
+ import type { SoftBreakRule, ExitBreakRule, ResetNodePluginRule } from './plugins/Break';
5
5
  import type { NormalizerRule } from './plugins/Normalizer';
6
+ import { TrackingPluginActions } from './plugins/Tracking';
6
7
  export declare type CustomText = {
7
8
  text: string;
8
9
  [MARKS.BOLD]?: boolean;
@@ -26,7 +27,7 @@ declare module 'slate' {
26
27
  Text: CustomText;
27
28
  }
28
29
  }
29
- export interface RichTextPlugin extends PlatePlugin {
30
+ export interface RichTextPlugin extends PlatePlugin<RichTextEditor> {
30
31
  /**
31
32
  * @see createSoftBreakPlugin
32
33
  */
@@ -35,8 +36,15 @@ export interface RichTextPlugin extends PlatePlugin {
35
36
  * @see createExitBreakPlugin
36
37
  */
37
38
  exitBreak?: ExitBreakRule[];
39
+ /**
40
+ * @see createResetNodePlugin
41
+ */
42
+ resetNode?: ResetNodePluginRule[];
38
43
  /**
39
44
  * @see createNormalizerPlugin
40
45
  */
41
46
  normalizer?: NormalizerRule[];
42
47
  }
48
+ export interface RichTextEditor extends PlateEditor {
49
+ tracking: TrackingPluginActions;
50
+ }
@@ -0,0 +1,8 @@
1
+ import { Document } from '@contentful/rich-text-types';
2
+ export declare type OnValueChangedProps = {
3
+ editorId: string;
4
+ handler?: (value: Document) => unknown;
5
+ skip?: boolean;
6
+ onSkip?: VoidFunction;
7
+ };
8
+ export declare const useOnValueChanged: ({ editorId, handler, skip, onSkip }: OnValueChangedProps) => (value: unknown) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/field-editor-rich-text",
3
- "version": "2.0.0-next.4",
3
+ "version": "2.0.0-next.42",
4
4
  "publishConfig": {
5
5
  "tag": "next"
6
6
  },
@@ -28,29 +28,30 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@contentful/contentful-slatejs-adapter": "^15.11.0",
31
- "@contentful/f36-components": "^4.0.1-beta.2705",
32
- "@contentful/f36-icons": "^4.0.1-beta.2705",
33
- "@contentful/f36-tokens": "^4.0.1-beta.2705",
31
+ "@contentful/f36-components": "^4.0.33",
32
+ "@contentful/f36-icons": "^4.1.1",
33
+ "@contentful/f36-tokens": "^4.0.0",
34
34
  "@contentful/field-editor-reference": "^4.0.7",
35
35
  "@contentful/field-editor-shared": "^1.0.3",
36
36
  "@contentful/rich-text-plain-text-renderer": "^15.11.1",
37
37
  "@contentful/rich-text-types": "^15.11.1",
38
- "@udecode/plate-basic-marks": "^9.0.0",
39
- "@udecode/plate-break": "^9.0.0",
40
- "@udecode/plate-core": "^9.0.0",
41
- "@udecode/plate-list": "^9.0.0",
42
- "@udecode/plate-paragraph": "^9.0.0",
43
- "@udecode/plate-select": "^9.0.0",
44
- "@udecode/plate-serializer-docx": "^9.1.3",
45
- "@udecode/plate-table": "^9.1.1",
46
- "@udecode/plate-trailing-block": "^9.0.0",
38
+ "@udecode/plate-basic-marks": "^10.4.0",
39
+ "@udecode/plate-break": "^10.4.0",
40
+ "@udecode/plate-core": "^10.4.0",
41
+ "@udecode/plate-list": "^10.4.0",
42
+ "@udecode/plate-paragraph": "^10.4.0",
43
+ "@udecode/plate-reset-node": "^10.4.0",
44
+ "@udecode/plate-select": "^10.4.0",
45
+ "@udecode/plate-serializer-docx": "^10.4.0",
46
+ "@udecode/plate-table": "^10.4.0",
47
+ "@udecode/plate-trailing-block": "^10.4.0",
47
48
  "fast-deep-equal": "^3.1.3",
48
49
  "is-hotkey": "^0.2.0",
49
50
  "is-plain-obj": "^3.0.0",
50
- "slate": "^0.72.3",
51
+ "slate": "^0.77.2",
51
52
  "slate-history": "^0.66.0",
52
53
  "slate-hyperscript": "^0.67.0",
53
- "slate-react": "^0.72.1"
54
+ "slate-react": "^0.77.3"
54
55
  },
55
56
  "peerDependencies": {
56
57
  "react": ">=16.14.0",
@@ -1,11 +0,0 @@
1
- import * as React from 'react';
2
- export declare type RichTextTrackingActionName = 'insertTable' | 'insertTableRow' | 'insertTableColumn' | 'removeTable' | 'removeTableRow' | 'removeTableColumn' | 'paste';
3
- export declare type RichTextTrackingActionHandler = (name: RichTextTrackingActionName, data: Record<string, unknown>) => unknown;
4
- interface TrackingProviderProps {
5
- onAction: RichTextTrackingActionHandler;
6
- }
7
- export interface TrackingProvider {
8
- onViewportAction: (actionName: RichTextTrackingActionName, data?: Record<string, unknown>) => ReturnType<TrackingProviderProps['onAction']>;
9
- }
10
- export declare const TrackingProvider: React.FC<TrackingProviderProps>, useTrackingContext: any;
11
- export {};
@@ -1,9 +0,0 @@
1
- import { ContentEntityType as EntityType } from '@contentful/field-editor-reference/dist/types';
2
- import { FieldExtensionSDK } from '@contentful/field-editor-shared';
3
- interface EntryAssetTooltipProps {
4
- id: string;
5
- type: EntityType;
6
- sdk: FieldExtensionSDK;
7
- }
8
- export declare function EntryAssetTooltip({ id, type, sdk }: EntryAssetTooltipProps): JSX.Element;
9
- export {};
@@ -1 +0,0 @@
1
- export declare function truncate(str: string, length: number): string;
@@ -1,6 +0,0 @@
1
- /**
2
- * A copy of Plate's list plugin with a few adjustments
3
- * to support pasting any element
4
- */
5
- import { PlateEditor, TDescendant } from '@udecode/plate-core';
6
- export declare const getListInsertFragment: (editor: PlateEditor) => (fragment: TDescendant[]) => void;
@@ -1,3 +0,0 @@
1
- import { PlateEditor } from '@udecode/plate-core';
2
- import { TrackingProvider } from '../../TrackingProvider';
3
- export declare function addTableTrackingEvents(editor: PlateEditor, { onViewportAction }: TrackingProvider): void;