@prismicio/editor-fields 0.4.11 → 0.4.14

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 (59) hide show
  1. package/dist/DocumentEditor.d.ts +4 -7
  2. package/dist/EditorConfig.d.ts +15 -5
  3. package/dist/GroupEditor.d.ts +1 -1
  4. package/dist/Selection.d.ts +25 -3
  5. package/dist/UID.d.ts +5 -0
  6. package/dist/constants/images.d.ts +8 -0
  7. package/dist/fields/EmbedField/EmbedFooter.d.ts +2 -2
  8. package/dist/fields/GeoPointField/geoPointFieldUtils.d.ts +1 -1
  9. package/dist/fields/ImageField/Components/EmptyCardContent.d.ts +2 -2
  10. package/dist/fields/ImageField/Components/ImageFieldCard.d.ts +4 -4
  11. package/dist/fields/ImageField/CropperDialog/CropperDialog.d.ts +1 -1
  12. package/dist/fields/ImageField/CropperDialog/croppedImage.d.ts +2 -2
  13. package/dist/fields/ImageField/MediaPicker/MediaLibrary/MediaLibrary.d.ts +3 -2
  14. package/dist/fields/ImageField/MediaPicker/MediaLibrary/mediaLibraryData.d.ts +28 -6
  15. package/dist/fields/ImageField/MediaPicker/MediaPicker.d.ts +5 -4
  16. package/dist/fields/ImageField/MediaPicker/UnsplashLibrary/unsplashData.d.ts +14 -3
  17. package/dist/fields/ImageField/MediaPicker/externalImage.d.ts +3 -2
  18. package/dist/fields/ImageField/MediaPicker/mediaPickerData.d.ts +3 -3
  19. package/dist/fields/ImageField/imageFieldUtils.d.ts +1 -1
  20. package/dist/fields/ImageField/useImageField.d.ts +2 -2
  21. package/dist/fields/LinkField/Documents/DocumentsModal.d.ts +6 -0
  22. package/dist/fields/LinkField/Documents/Filters.d.ts +1 -1
  23. package/dist/fields/LinkField/Documents/documentsData.d.ts +10 -0
  24. package/dist/fields/LinkField/Documents/useFilters.d.ts +5 -3
  25. package/dist/fields/LinkField/LinkFieldActions.d.ts +1 -1
  26. package/dist/fields/LinkField/index.d.ts +1 -0
  27. package/dist/fields/LinkField/useLinkField.d.ts +48 -4
  28. package/dist/fields/NumberField.d.ts +1 -1
  29. package/dist/fields/RichTextField/BubbleMenu/BubbleMenu.d.ts +1 -1
  30. package/dist/fields/RichTextField/BubbleMenu/Link/LinkPopover.d.ts +1 -0
  31. package/dist/fields/RichTextField/BubbleMenu/Link/SetMediaLinkModal.d.ts +8 -0
  32. package/dist/fields/RichTextField/coreExtensions/ListItem.d.ts +2 -2
  33. package/dist/fields/RichTextField/coreExtensions/Placeholder.d.ts +1 -1
  34. package/dist/fields/RichTextField/coreExtensions/index.d.ts +3 -2
  35. package/dist/fields/RichTextField/extensions/Embed/EmbedView.d.ts +1 -1
  36. package/dist/fields/RichTextField/extensions/Embed/useEmbedView.d.ts +20 -1
  37. package/dist/fields/RichTextField/extensions/Heading/Heading.d.ts +3 -4
  38. package/dist/fields/RichTextField/extensions/Image/ImageView.d.ts +1 -1
  39. package/dist/fields/RichTextField/extensions/Image/useImageView.d.ts +2 -2
  40. package/dist/fields/RichTextField/extensions/Link/Link.d.ts +7 -1
  41. package/dist/fields/RichTextField/extensions/Link/LinkModel.d.ts +3 -3
  42. package/dist/fields/RichTextField/models/EditorExtension.d.ts +13 -15
  43. package/dist/fields/RichTextField/models/MenuItems.d.ts +2 -2
  44. package/dist/fields/RichTextField/models/RichTextConfig.d.ts +1 -1
  45. package/dist/fields/RichTextField/useEditor.d.ts +6 -1
  46. package/dist/fields/UIDField/UIDField.d.ts +3 -3
  47. package/dist/fields/utils.d.ts +2 -2
  48. package/dist/index.d.ts +3 -1
  49. package/dist/index.es.js +35429 -34974
  50. package/dist/slices/CompositeSliceEditor.d.ts +4 -4
  51. package/dist/slices/LegacySliceEditor.d.ts +4 -4
  52. package/dist/slices/SharedSliceEditor.d.ts +4 -2
  53. package/dist/slices/defaults.d.ts +23 -0
  54. package/dist/slices/utils.d.ts +34 -0
  55. package/dist/zones/NonRepeatableZoneEditor.d.ts +4 -5
  56. package/dist/zones/SliceZoneEditor.d.ts +0 -1
  57. package/dist/zones/StaticZone.d.ts +2 -2
  58. package/package.json +6 -6
  59. package/dist/fields/UIDField/uidUtils.d.ts +0 -1
@@ -1,7 +1,7 @@
1
1
  import type { NumberContent } from "@prismicio/types-internal/lib/content";
2
2
  import type { Number as NumberT } from "@prismicio/types-internal/lib/customtypes";
3
3
  import type { FC } from "react";
4
- declare type NumberFieldProps = Readonly<{
4
+ type NumberFieldProps = Readonly<{
5
5
  content: NumberContent | undefined;
6
6
  field: NumberT;
7
7
  id: string;
@@ -3,6 +3,6 @@ interface BubbleMenuProps {
3
3
  editor: Editor;
4
4
  nodeTypes: string[];
5
5
  }
6
- export declare type Modal = "webLink" | "documentLink" | undefined;
6
+ export type Modal = "webLink" | "documentLink" | "mediaLink" | undefined;
7
7
  export declare function BubbleMenu(props: BubbleMenuProps): JSX.Element;
8
8
  export {};
@@ -3,6 +3,7 @@ interface LinkPopoverProps {
3
3
  editor: Editor;
4
4
  onEditWebLink: () => void;
5
5
  onEditDocumentLink: () => void;
6
+ onEditMediaLink: () => void;
6
7
  }
7
8
  export declare function LinkPopover(props: LinkPopoverProps): JSX.Element | null;
8
9
  interface DocumentLinkPopoverProps {
@@ -0,0 +1,8 @@
1
+ import type { Editor } from "@tiptap/core";
2
+ interface SetMediaLinkModalProps {
3
+ open: boolean;
4
+ setOpen: (open: boolean) => void;
5
+ editor: Editor;
6
+ }
7
+ export declare function SetMediaLinkModal(props: SetMediaLinkModalProps): JSX.Element;
8
+ export {};
@@ -3,7 +3,7 @@ declare const _default: {
3
3
  component: import("@tiptap/core").Node<import("@tiptap/extension-list-item").ListItemOptions, any>;
4
4
  converter: {
5
5
  fromPrismic(schema: Schema<any, any>): (list: {
6
- type: "em" | "embed" | "strong" | "image" | "list-item" | "paragraph" | "o-list-item" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "preformatted" | "hyperlink" | "rtl";
6
+ type: "em" | "embed" | "strong" | "image" | "paragraph" | "list-item" | "o-list-item" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "preformatted" | "hyperlink" | "rtl";
7
7
  content: {
8
8
  text: string;
9
9
  } & {
@@ -66,7 +66,7 @@ declare const _default: {
66
66
  direction?: string | undefined;
67
67
  }) => ProsemirrorNode | undefined;
68
68
  toPrismic(node: ProsemirrorNode, nodeType: "list-item" | "o-list-item"): readonly ({
69
- type: "em" | "embed" | "strong" | "image" | "list-item" | "paragraph" | "o-list-item" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "preformatted" | "hyperlink" | "rtl";
69
+ type: "em" | "embed" | "strong" | "image" | "paragraph" | "list-item" | "o-list-item" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "preformatted" | "hyperlink" | "rtl";
70
70
  content: {
71
71
  text: string;
72
72
  } & {
@@ -1,4 +1,4 @@
1
- import { type ExtensionPlaceholder, NodeExtension } from "../models";
1
+ import { type ExtensionPlaceholder, type NodeExtension } from "../models";
2
2
  interface PlaceholderParams {
3
3
  placeholderByNodeType: Record<string, ExtensionPlaceholder>;
4
4
  unfocusedPlaceholder: string | undefined;
@@ -1,9 +1,10 @@
1
1
  import { type RichText } from "@prismicio/types-internal/lib/customtypes";
2
- import type { Node } from "@tiptap/core";
3
2
  import { type NodeExtension } from "../models";
4
3
  import { default as Document } from "./Document";
5
4
  import { default as HardBreak } from "./HardBreak";
6
5
  import { default as ListItem } from "./ListItem";
7
6
  import { default as Text } from "./Text";
8
- export declare function CoreComponents(field: RichText, nodeExtensions: readonly NodeExtension[]): readonly Node[];
7
+ export declare function CoreComponents(field: RichText, nodeExtensions: NodeExtension[]): NonNullable<import("@tiptap/core").Node<any, any> | import("@tiptap/core").Extension<import("@tiptap/extension-placeholder").PlaceholderOptions, any> | import("@tiptap/core").Extension<Readonly<{
8
+ nodeTypes: readonly string[];
9
+ }>, any> | undefined>[];
9
10
  export { Document, HardBreak, ListItem, Text };
@@ -1,6 +1,6 @@
1
1
  import type { EmbedContent } from "@prismicio/types-internal/lib/content";
2
2
  import type { Node as ProseMirrorNode } from "@tiptap/pm/model";
3
- import { NodeViewProps } from "@tiptap/react";
3
+ import { type NodeViewProps } from "@tiptap/react";
4
4
  interface EmbedNode extends ProseMirrorNode {
5
5
  attrs: {
6
6
  content: EmbedContent | undefined;
@@ -1,5 +1,5 @@
1
1
  import type { EmbedContent } from "@prismicio/types-internal/lib/content";
2
- import { KeyboardEvent, RefObject } from "react";
2
+ import { type KeyboardEvent, type RefObject } from "react";
3
3
  import type { EmbedViewProps } from "./EmbedView";
4
4
  export declare function useEmbedView(props: EmbedViewProps, inputRef: RefObject<HTMLInputElement>, containerRef: RefObject<HTMLDivElement>): {
5
5
  inputRef: RefObject<HTMLInputElement>;
@@ -9,4 +9,23 @@ export declare function useEmbedView(props: EmbedViewProps, inputRef: RefObject<
9
9
  urlChanged: (newUrl: string) => void;
10
10
  onContentChange: (content?: EmbedContent) => void;
11
11
  debouncedUrl: string;
12
+ content: ({
13
+ embed_url: string;
14
+ type: string;
15
+ } & {
16
+ version?: string | number | null | undefined;
17
+ title?: string | null | undefined;
18
+ author_name?: string | null | undefined;
19
+ author_url?: string | null | undefined;
20
+ provider_name?: string | null | undefined;
21
+ provider_url?: string | null | undefined;
22
+ cache_age?: string | number | null | undefined;
23
+ thumbnail_url?: string | null | undefined;
24
+ thumbnail_width?: number | null | undefined;
25
+ thumbnail_height?: number | null | undefined;
26
+ html?: string | null | undefined;
27
+ } & {
28
+ __TYPE__: "EmbedContent";
29
+ all: unknown;
30
+ }) | undefined;
12
31
  };
@@ -1,9 +1,8 @@
1
1
  import { RichTextNodeType } from "@prismicio/types-internal/lib/customtypes";
2
2
  import { type Level as TTLevel } from "@tiptap/extension-heading";
3
- import { type ReadonlyNonEmptyArray } from "fp-ts/ReadonlyNonEmptyArray";
4
3
  import type { Node as ProsemirrorNode } from "prosemirror-model";
5
4
  import { HeadingTextExtension } from "../../models";
6
- export declare type Level = TTLevel;
5
+ export type Level = TTLevel;
7
6
  interface HeadingName {
8
7
  fullName: RichTextNodeType;
9
8
  level: Level;
@@ -11,8 +10,8 @@ interface HeadingName {
11
10
  export declare const HeadingName: {
12
11
  byLevel(level: Level): RichTextNodeType;
13
12
  default(level: Level): HeadingName;
14
- fromPrismic(headingName: string, levels?: ReadonlyNonEmptyArray<Level>): HeadingName | undefined;
15
- fromProsemirror(nodeAttributes: ProsemirrorNode["attrs"], levels: ReadonlyNonEmptyArray<Level>): HeadingName | undefined;
13
+ fromPrismic(headingName: string, levels?: Level[]): HeadingName | undefined;
14
+ fromProsemirror(nodeAttributes: ProsemirrorNode["attrs"], levels: Level[]): HeadingName | undefined;
16
15
  };
17
16
  declare const _default: {
18
17
  name: string;
@@ -1,6 +1,6 @@
1
1
  import type { ImageContent } from "@prismicio/types-internal/lib/content";
2
2
  import type { Node as ProseMirrorNode } from "@tiptap/pm/model";
3
- import { NodeViewProps } from "@tiptap/react";
3
+ import { type NodeViewProps } from "@tiptap/react";
4
4
  interface ImageNode extends ProseMirrorNode {
5
5
  attrs: {
6
6
  content: ImageContent | undefined;
@@ -1,6 +1,6 @@
1
1
  import type { ImageContent } from "@prismicio/types-internal/lib/content";
2
2
  import type { CroppedImages } from "../../../ImageField/CropperDialog";
3
- import { ExternalImage } from "../../../ImageField/MediaPicker/externalImage";
3
+ import type { MediaAssetOrExternalImage } from "../../../ImageField/MediaPicker/MediaLibrary/mediaLibraryData";
4
4
  import type { ImageViewProps } from "./ImageView";
5
5
  interface useImageViewProps {
6
6
  content: ImageContent | undefined;
@@ -12,7 +12,7 @@ interface useImageViewProps {
12
12
  imageViewProps: ImageViewProps;
13
13
  }
14
14
  export declare function useImageView(props: useImageViewProps): {
15
- onMediaSelected: (media: ExternalImage) => void;
15
+ onMediaSelected: (media: MediaAssetOrExternalImage) => void;
16
16
  onCropperDialogClose: ({ croppedImages }: {
17
17
  croppedImages: CroppedImages;
18
18
  }) => void;
@@ -1,4 +1,5 @@
1
- import { LinkExtension } from "./LinkModel";
1
+ import type { MediaAssetOrExternalImage } from "../../../ImageField/MediaPicker/MediaLibrary/mediaLibraryData";
2
+ import { type FileLinkData, type ImageLinkData, type LinkElementData, LinkExtension } from "./LinkModel";
2
3
  export interface LinkProtocolOptions {
3
4
  scheme: string;
4
5
  optionalSlashes?: boolean;
@@ -22,8 +23,13 @@ declare module "@tiptap/core" {
22
23
  setDocumentLink: (attributes: {
23
24
  id: string;
24
25
  }) => ReturnType;
26
+ setMediaLink: (attributes: {
27
+ media: MediaAssetOrExternalImage;
28
+ }) => ReturnType;
25
29
  unsetLink: () => ReturnType;
26
30
  };
27
31
  }
28
32
  }
29
33
  export declare const Link: LinkExtension;
34
+ export declare function stringifyMediaLinkData(media: ImageLinkData | FileLinkData): string;
35
+ export declare function parseMediaLinkData(media: string): LinkElementData;
@@ -21,8 +21,8 @@ export interface LinkElement {
21
21
  end: number;
22
22
  data: LinkElementData;
23
23
  }
24
- export declare type LinkElementData = ImageLinkData | FileLinkData | DocumentLinkData | ExternalLinkData;
25
- interface ImageLinkData {
24
+ export type LinkElementData = ImageLinkData | FileLinkData | DocumentLinkData | ExternalLinkData;
25
+ export interface ImageLinkData {
26
26
  __TYPE__: "ImageLink";
27
27
  id: string;
28
28
  url: string;
@@ -33,7 +33,7 @@ interface ImageLinkData {
33
33
  kind: string;
34
34
  date?: string | null | undefined;
35
35
  }
36
- interface FileLinkData {
36
+ export interface FileLinkData {
37
37
  __TYPE__: "FileLink";
38
38
  id: string;
39
39
  url: string;
@@ -1,8 +1,6 @@
1
1
  import type { EmbedBlock, ImageBlock, RichTextContent, TextBlock } from "@prismicio/types-internal/lib/content";
2
2
  import type { RichTextNodeType } from "@prismicio/types-internal/lib/customtypes";
3
3
  import type { Node } from "@tiptap/core";
4
- import type { NonEmptyArray } from "fp-ts/NonEmptyArray";
5
- import type { ReadonlyNonEmptyArray } from "fp-ts/ReadonlyNonEmptyArray";
6
4
  import type { Node as ProsemirrorNode, Schema } from "prosemirror-model";
7
5
  import type { BoldExtension } from "../extensions/Bold/BoldModel";
8
6
  import type { Level } from "../extensions/Heading/Heading";
@@ -18,9 +16,9 @@ export declare enum NodeType {
18
16
  Embed = "embed",
19
17
  Image = "image"
20
18
  }
21
- export declare type Extension = WidgetExtension | DocumentExtension;
22
- export declare type WidgetExtension = MarkExtension | NodeExtension;
23
- export declare type ExtensionPlaceholder = string | ((nodeAttrs: ProsemirrorNode["attrs"]) => string | undefined) | undefined;
19
+ export type Extension = WidgetExtension | DocumentExtension;
20
+ export type WidgetExtension = MarkExtension | NodeExtension;
21
+ export type ExtensionPlaceholder = string | ((nodeAttrs: ProsemirrorNode["attrs"]) => string | undefined) | undefined;
24
22
  export declare class DocumentExtension {
25
23
  readonly name: string;
26
24
  readonly component: (multiLines: boolean) => Node;
@@ -34,10 +32,10 @@ export declare class DocumentExtension {
34
32
  toPrismic(elmt: ProsemirrorNode): RichTextContent | undefined;
35
33
  });
36
34
  }
37
- export declare type MarkExtension = LinkExtension | BoldExtension | ItalicExtension;
38
- export declare type NodeExtension = TextExtension | EmbedExtension | ImageExtension;
35
+ export type MarkExtension = LinkExtension | BoldExtension | ItalicExtension;
36
+ export type NodeExtension = TextExtension | EmbedExtension | ImageExtension;
39
37
  export declare class TextExtension {
40
- readonly richTextNodeTypes: ReadonlyNonEmptyArray<RichTextNodeType>;
38
+ readonly richTextNodeTypes: RichTextNodeType[];
41
39
  readonly name: string;
42
40
  readonly component: Node;
43
41
  readonly converter: {
@@ -48,14 +46,14 @@ export declare class TextExtension {
48
46
  readonly lockedFormat: boolean;
49
47
  extType: ExtensionType.Node;
50
48
  nodeType: NodeType.Text;
51
- constructor(richTextNodeTypes: ReadonlyNonEmptyArray<RichTextNodeType>, name: string, component: Node, converter: {
49
+ constructor(richTextNodeTypes: RichTextNodeType[], name: string, component: Node, converter: {
52
50
  fromPrismic(schema: Schema): (elmt: TextBlock) => ProsemirrorNode | undefined;
53
51
  toPrismic(elmt: ProsemirrorNode): TextBlock | readonly TextBlock[] | undefined;
54
52
  }, placeholder?: ExtensionPlaceholder, lockedFormat?: boolean);
55
53
  }
56
54
  export declare function isTextExtension(extension: WidgetExtension): extension is TextExtension;
57
55
  export declare class EmbedExtension {
58
- readonly richTextNodeTypes: NonEmptyArray<RichTextNodeType>;
56
+ readonly richTextNodeTypes: RichTextNodeType[];
59
57
  readonly name: string;
60
58
  readonly component: Node;
61
59
  readonly converter: {
@@ -64,13 +62,13 @@ export declare class EmbedExtension {
64
62
  };
65
63
  extType: ExtensionType;
66
64
  nodeType: NodeType.Embed;
67
- constructor(richTextNodeTypes: NonEmptyArray<RichTextNodeType>, name: string, component: Node, converter: {
65
+ constructor(richTextNodeTypes: RichTextNodeType[], name: string, component: Node, converter: {
68
66
  fromPrismic(schema: Schema): (elmt: EmbedBlock) => ProsemirrorNode | undefined;
69
67
  toPrismic(elmt: ProsemirrorNode): EmbedBlock | undefined;
70
68
  });
71
69
  }
72
70
  export declare class ImageExtension {
73
- readonly richTextNodeTypes: NonEmptyArray<RichTextNodeType>;
71
+ readonly richTextNodeTypes: RichTextNodeType[];
74
72
  readonly name: string;
75
73
  readonly component: Node;
76
74
  readonly converter: {
@@ -79,20 +77,20 @@ export declare class ImageExtension {
79
77
  };
80
78
  extType: ExtensionType.Node;
81
79
  nodeType: NodeType.Image;
82
- constructor(richTextNodeTypes: NonEmptyArray<RichTextNodeType>, name: string, component: Node, converter: {
80
+ constructor(richTextNodeTypes: RichTextNodeType[], name: string, component: Node, converter: {
83
81
  fromPrismic(schema: Schema): (elmt: ImageBlock) => ProsemirrorNode | undefined;
84
82
  toPrismic(elmt: ProsemirrorNode): ImageBlock | undefined;
85
83
  });
86
84
  }
87
85
  export declare class HeadingTextExtension extends TextExtension {
88
86
  readonly levels: readonly Level[];
89
- constructor(richTextNodeTypes: ReadonlyNonEmptyArray<RichTextNodeType>, Component: Node, levels: readonly Level[], Converter: {
87
+ constructor(richTextNodeTypes: RichTextNodeType[], Component: Node, levels: readonly Level[], Converter: {
90
88
  fromPrismic(schema: Schema): (elmt: TextBlock) => ProsemirrorNode | undefined;
91
89
  toPrismic(elmt: ProsemirrorNode): TextBlock | undefined;
92
90
  }, placeholder?: ExtensionPlaceholder);
93
91
  }
94
92
  export declare class ListExtension extends TextExtension {
95
- constructor(richTextNodeTypes: NonEmptyArray<RichTextNodeType>, name: string, Component: Node, Converter: {
93
+ constructor(richTextNodeTypes: RichTextNodeType[], name: string, Component: Node, Converter: {
96
94
  fromPrismic(schema: Schema): (elmt: TextBlock) => ProsemirrorNode | undefined;
97
95
  toPrismic(elmt: ProsemirrorNode): readonly TextBlock[];
98
96
  });
@@ -1,7 +1,7 @@
1
1
  import type { IconName } from "@prismicio/editor-ui";
2
2
  import { RichTextNodeType } from "@prismicio/types-internal/lib/customtypes";
3
3
  import type { ChainedCommands, Editor, Range } from "@tiptap/core";
4
- export declare type MenuItem = Readonly<{
4
+ export type MenuItem = Readonly<{
5
5
  nodeType: RichTextNodeType;
6
6
  icon: IconName;
7
7
  isActive: (editor: Editor) => boolean;
@@ -13,7 +13,7 @@ export declare type MenuItem = Readonly<{
13
13
  shortText?: undefined;
14
14
  text?: undefined;
15
15
  })>;
16
- declare type RunCommandsOptions = Readonly<{
16
+ type RunCommandsOptions = Readonly<{
17
17
  can?: boolean;
18
18
  deleteRange?: Range;
19
19
  }>;
@@ -7,7 +7,7 @@ export declare function composeExtensions(config?: RichTextConfig): {
7
7
  } | {
8
8
  extensions: WidgetExtension[];
9
9
  defaultTextConverter: (schema: Schema<any, any>) => (block: {
10
- type: "em" | "embed" | "strong" | "image" | "list-item" | "paragraph" | "o-list-item" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "preformatted" | "hyperlink" | "rtl";
10
+ type: "em" | "embed" | "strong" | "image" | "paragraph" | "list-item" | "o-list-item" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "preformatted" | "hyperlink" | "rtl";
11
11
  content: {
12
12
  text: string;
13
13
  } & {
@@ -1,4 +1,9 @@
1
1
  import type { EditorOptions } from "@tiptap/core";
2
2
  import { Editor } from "@tiptap/react";
3
- import { DependencyList } from "react";
3
+ import { type DependencyList } from "react";
4
4
  export declare function useEditor(options?: Partial<EditorOptions>, deps?: DependencyList): Editor | undefined;
5
+ /**
6
+ * setTimeout is required to combat tiptap flushsync issue
7
+ * https://github.com/ueberdosis/tiptap/issues/3764
8
+ */
9
+ export declare function handleEditorFlushSyncError(callback: VoidFunction): number;
@@ -1,10 +1,10 @@
1
1
  import type { UIDContent } from "@prismicio/types-internal/lib/content";
2
2
  import type { UID as UIDType } from "@prismicio/types-internal/lib/customtypes";
3
- declare type Props = Readonly<{
3
+ interface UIDFieldProps {
4
4
  id: string;
5
5
  content?: UIDContent;
6
6
  field: UIDType;
7
7
  onContentChange: (content?: UIDContent) => void;
8
- }>;
9
- export declare const UIDField: ({ id, field, content, onContentChange }: Props) => JSX.Element;
8
+ }
9
+ export declare function UIDField(props: UIDFieldProps): JSX.Element;
10
10
  export {};
@@ -1,6 +1,6 @@
1
1
  import type { BooleanField, GeoPoint, NestableWidget, Separator, UID } from "@prismicio/types-internal/lib/customtypes";
2
- declare type Widgets = NestableWidget | UID;
3
- declare type Field = Exclude<Widgets, Separator | GeoPoint>;
2
+ type Widgets = NestableWidget | UID;
3
+ type Field = Exclude<Widgets, Separator | GeoPoint>;
4
4
  export declare function getFieldLabel(field: Widgets): string;
5
5
  export declare const DEFAULT_PLACEHOLDER = "...";
6
6
  export declare function getFieldPlaceholder(field: Exclude<Field, BooleanField>): string;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  export { DocumentEditor } from "./DocumentEditor";
2
2
  export { type EditorConfig, suppressConfigErrors, throwConfigError } from "./EditorConfig";
3
- export type { Selection } from "./Selection";
3
+ export { getSelectionDOMId, type Selection, type SelectionArea, SelectionContext, useSelection } from "./Selection";
4
+ export { defaultImageContentWidget } from "./slices/defaults";
4
5
  export { SharedSliceEditor } from "./slices/SharedSliceEditor";
6
+ export { UIDContext } from "./UID";