@contentful/field-editor-rich-text 2.0.0-next.5 → 2.0.0-next.9

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 (27) hide show
  1. package/dist/TrackingProvider.d.ts +1 -1
  2. package/dist/field-editor-rich-text.cjs.development.js +1112 -764
  3. package/dist/field-editor-rich-text.cjs.development.js.map +1 -1
  4. package/dist/field-editor-rich-text.cjs.production.min.js +1 -1
  5. package/dist/field-editor-rich-text.cjs.production.min.js.map +1 -1
  6. package/dist/field-editor-rich-text.esm.js +1115 -767
  7. package/dist/field-editor-rich-text.esm.js.map +1 -1
  8. package/dist/helpers/editor.d.ts +1 -0
  9. package/dist/helpers/environment.d.ts +1 -0
  10. package/dist/plugins/EmbeddedEntityBlock/LinkedEntityBlock.d.ts +3 -1
  11. package/dist/plugins/EmbeddedEntityBlock/index.d.ts +3 -2
  12. package/dist/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.d.ts +1 -0
  13. package/dist/plugins/EmbeddedEntityInline/index.d.ts +3 -1
  14. package/dist/plugins/Hyperlink/index.d.ts +2 -1
  15. package/dist/plugins/List/insertListBreak.d.ts +2 -0
  16. package/dist/plugins/List/insertListFragment.d.ts +2 -0
  17. package/dist/plugins/List/transforms/insertListItem.d.ts +5 -0
  18. package/dist/plugins/Text/createTextPlugin.d.ts +2 -0
  19. package/dist/plugins/Text/index.d.ts +1 -2
  20. package/dist/plugins/links-tracking.d.ts +7 -0
  21. package/dist/plugins/shared/FetchingWrappedAssetCard.d.ts +1 -0
  22. package/dist/plugins/shared/FetchingWrappedEntryCard.d.ts +3 -2
  23. package/dist/test-utils/assertOutput.d.ts +1 -0
  24. package/dist/test-utils/jsx.d.ts +1 -1
  25. package/dist/test-utils/mockPlugin.d.ts +1 -1
  26. package/package.json +11 -11
  27. package/dist/plugins/List/getListInsertFragment.d.ts +0 -6
@@ -39,4 +39,5 @@ export declare function getNextNode(editor: PlateEditor): CustomElement | null;
39
39
  export declare function currentSelectionPrecedesTableCell(editor: PlateEditor): boolean;
40
40
  export declare const INLINE_TYPES: string[];
41
41
  export declare const isInlineOrText: (node: Node) => boolean;
42
+ export declare const focus: (editor: PlateEditor) => void;
42
43
  export {};
@@ -1 +1,2 @@
1
1
  export declare const HAS_BEFORE_INPUT_SUPPORT: boolean;
2
+ export declare const IS_SAFARI: boolean;
@@ -7,6 +7,8 @@ declare type LinkedEntityBlockProps = CustomRenderElementProps<{
7
7
  type: 'Link';
8
8
  };
9
9
  };
10
- }>;
10
+ }> & {
11
+ onEntityFetchComplete: VoidFunction;
12
+ };
11
13
  export declare function LinkedEntityBlock(props: LinkedEntityBlockProps): JSX.Element;
12
14
  export {};
@@ -1,5 +1,6 @@
1
1
  import { FieldExtensionSDK } from '@contentful/app-sdk';
2
+ import { TrackingProvider } from 'TrackingProvider';
2
3
  import { RichTextPlugin } from '../../types';
3
4
  export { EmbeddedEntityBlockToolbarIcon as ToolbarIcon } from './ToolbarIcon';
4
- export declare const createEmbeddedEntryBlockPlugin: (sdk: FieldExtensionSDK) => RichTextPlugin;
5
- export declare const createEmbeddedAssetBlockPlugin: (sdk: FieldExtensionSDK) => RichTextPlugin;
5
+ export declare const createEmbeddedEntryBlockPlugin: (sdk: FieldExtensionSDK, tracking: TrackingProvider) => RichTextPlugin;
6
+ export declare const createEmbeddedAssetBlockPlugin: (sdk: FieldExtensionSDK, tracking: TrackingProvider) => RichTextPlugin;
@@ -7,6 +7,7 @@ interface FetchingWrappedInlineEntryCardProps {
7
7
  isDisabled: boolean;
8
8
  onEdit: (event: React.MouseEvent<Element, MouseEvent>) => void;
9
9
  onRemove: (event: React.MouseEvent<Element, MouseEvent>) => void;
10
+ onEntityFetchComplete?: VoidFunction;
10
11
  }
11
12
  export declare function FetchingWrappedInlineEntryCard(props: FetchingWrappedInlineEntryCardProps): JSX.Element;
12
13
  export {};
@@ -1,3 +1,5 @@
1
+ import { FieldExtensionSDK } from '@contentful/app-sdk';
2
+ import { TrackingProvider } from 'TrackingProvider';
1
3
  import { RichTextPlugin } from '../../types';
2
4
  interface ToolbarEmbeddedEntityInlineButtonProps {
3
5
  onClose: () => void;
@@ -5,5 +7,5 @@ interface ToolbarEmbeddedEntityInlineButtonProps {
5
7
  isButton?: boolean;
6
8
  }
7
9
  export declare function ToolbarEmbeddedEntityInlineButton(props: ToolbarEmbeddedEntityInlineButtonProps): JSX.Element;
8
- export declare function createEmbeddedEntityInlinePlugin(sdk: any): RichTextPlugin;
10
+ export declare function createEmbeddedEntityInlinePlugin(sdk: FieldExtensionSDK, tracking: TrackingProvider): RichTextPlugin;
9
11
  export {};
@@ -1,8 +1,9 @@
1
1
  import { FieldExtensionSDK } from '@contentful/app-sdk';
2
+ import { TrackingProvider } from 'TrackingProvider';
2
3
  import { RichTextPlugin } from '../../types';
3
4
  interface ToolbarHyperlinkButtonProps {
4
5
  isDisabled: boolean | undefined;
5
6
  }
6
7
  export declare function ToolbarHyperlinkButton(props: ToolbarHyperlinkButtonProps): JSX.Element | null;
7
- export declare const createHyperlinkPlugin: (sdk: FieldExtensionSDK) => RichTextPlugin;
8
+ export declare const createHyperlinkPlugin: (sdk: FieldExtensionSDK, tracking: TrackingProvider) => RichTextPlugin;
8
9
  export {};
@@ -0,0 +1,2 @@
1
+ import { PlateEditor } from '@udecode/plate-core';
2
+ export declare const insertListBreak: (editor: PlateEditor) => () => void;
@@ -0,0 +1,2 @@
1
+ import { PlateEditor, TDescendant } from '@udecode/plate-core';
2
+ export declare const insertListFragment: (editor: PlateEditor) => (fragment: TDescendant[]) => void;
@@ -0,0 +1,5 @@
1
+ import { PlateEditor } from '@udecode/plate-core';
2
+ /**
3
+ * Insert list item if selection is in li>p.
4
+ */
5
+ export declare const insertListItem: (editor: PlateEditor) => boolean;
@@ -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,7 @@
1
+ import React, { ComponentProps } from 'react';
2
+ import { TrackingProvider } from '../TrackingProvider';
3
+ declare type WithEntityFetchProps = {
4
+ onEntityFetchComplete: VoidFunction;
5
+ } & JSX.IntrinsicAttributes;
6
+ export declare function withLinkTracking(tracking: TrackingProvider, Component: React.ComponentType<WithEntityFetchProps>): (props: ComponentProps<typeof Component>) => JSX.Element;
7
+ 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 {};
@@ -4,4 +4,5 @@ export declare const assertOutput: (options: {
4
4
  expected: any;
5
5
  editor?: PlateEditor;
6
6
  log?: boolean;
7
+ skipCursor?: boolean;
7
8
  }) => void;
@@ -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 "selection" | "text" | "element" | "editor" | "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>) => import("@udecode/plate-core").WithRequired<import("@udecode/plate-core").PlatePlugin<{}, {}>, "type" | "editor" | "options" | "inject">;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/field-editor-rich-text",
3
- "version": "2.0.0-next.5",
3
+ "version": "2.0.0-next.9",
4
4
  "publishConfig": {
5
5
  "tag": "next"
6
6
  },
@@ -35,22 +35,22 @@
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": "^9.2.1",
39
+ "@udecode/plate-break": "^9.2.1",
40
+ "@udecode/plate-core": "^9.2.1",
41
+ "@udecode/plate-list": "^9.2.1",
42
+ "@udecode/plate-paragraph": "^9.2.1",
43
+ "@udecode/plate-select": "^9.2.1",
44
+ "@udecode/plate-serializer-docx": "^9.2.1",
45
+ "@udecode/plate-table": "^9.2.1",
46
+ "@udecode/plate-trailing-block": "^9.2.1",
47
47
  "fast-deep-equal": "^3.1.3",
48
48
  "is-hotkey": "^0.2.0",
49
49
  "is-plain-obj": "^3.0.0",
50
50
  "slate": "^0.72.3",
51
51
  "slate-history": "^0.66.0",
52
52
  "slate-hyperscript": "^0.67.0",
53
- "slate-react": "^0.72.1"
53
+ "slate-react": "^0.72.6"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "react": ">=16.14.0",
@@ -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;