@prismicio/editor-fields 0.4.64 → 0.4.65

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 (62) hide show
  1. package/dist/EditorConfig.d.ts +12 -3
  2. package/dist/core/APIExplorer/APIExplorer.d.ts +2 -0
  3. package/dist/core/APIExplorer/components/APIExplorerContext.d.ts +54 -0
  4. package/dist/core/APIExplorer/components/APIExplorerRequest.d.ts +2 -0
  5. package/dist/core/APIExplorer/components/APIExplorerResponse.d.ts +2 -0
  6. package/dist/core/APIExplorer/components/Request/GetByTypeRequest.d.ts +1 -0
  7. package/dist/core/APIExplorer/components/Request/GetByUIDRequest.d.ts +1 -0
  8. package/dist/core/APIExplorer/components/Request/GetRepositoryRequest.d.ts +1 -0
  9. package/dist/core/APIExplorer/components/Request/GetRequest.d.ts +1 -0
  10. package/dist/core/APIExplorer/components/Request/GetSingleRequest.d.ts +1 -0
  11. package/dist/core/APIExplorer/components/Request/components/RequestFormInput.d.ts +4 -0
  12. package/dist/core/APIExplorer/components/Request/components/RequestFormInputBase.d.ts +6 -0
  13. package/dist/core/APIExplorer/components/Request/components/RequestFormSelect.d.ts +4 -0
  14. package/dist/core/APIExplorer/components/Request/components/RequestPaginationFieldset.d.ts +5 -0
  15. package/dist/core/APIExplorer/components/Request/components/RequestTypeFieldset.d.ts +7 -0
  16. package/dist/core/APIExplorer/components/Request/components/index.d.ts +3 -0
  17. package/dist/core/APIExplorer/components/Request/createRequest.d.ts +17 -0
  18. package/dist/core/APIExplorer/components/Request/index.d.ts +1 -0
  19. package/dist/core/APIExplorer/components/Request/types.d.ts +14 -0
  20. package/dist/core/APIExplorer/index.d.ts +1 -0
  21. package/dist/core/MediaLibrary/hooks/mediaLibraryData.d.ts +49 -49
  22. package/dist/core/MediaLibrary/hooks/tagData.d.ts +3 -3
  23. package/dist/core/MediaLibrary/hooks/useMediaLibraryUpload.d.ts +5 -5
  24. package/dist/core/MediaLibrary/hooks/useSelectedMedia.d.ts +5 -5
  25. package/dist/core/service/aiSeoMetadata.d.ts +2 -6
  26. package/dist/core/service/document.d.ts +89 -67
  27. package/dist/core/service/documentSearch.d.ts +10 -10
  28. package/dist/core/service/repository.d.ts +29 -21
  29. package/dist/core/service/role.d.ts +289 -46
  30. package/dist/core/service/user.d.ts +11 -7
  31. package/dist/fields/ImageField/useImageField.d.ts +5 -5
  32. package/dist/fields/ImageField/useImageFieldImageUpload.d.ts +5 -5
  33. package/dist/fields/LinkField/Documents/documentsData.d.ts +4 -4
  34. package/dist/fields/RichTextField/RichTextField.d.ts +7 -0
  35. package/dist/fields/RichTextField/extensions/Image/useImageView.d.ts +5 -5
  36. package/dist/fields/RichTextField/extensions/Table/Table.d.ts +4 -4
  37. package/dist/fields/RichTextField/extensions/Table/TableCell/TableCell.d.ts +10 -0
  38. package/dist/fields/RichTextField/extensions/Table/TableCell/TableHeaderCell.d.ts +10 -0
  39. package/dist/fields/RichTextField/extensions/Table/TableCell/index.d.ts +2 -0
  40. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/TableHandlesPlugin.d.ts +8 -0
  41. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/TableHandlesPluginView.d.ts +34 -0
  42. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/events.d.ts +19 -0
  43. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/index.d.ts +1 -0
  44. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/utils.d.ts +23 -0
  45. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/index.d.ts +1 -0
  46. package/dist/fields/RichTextField/extensions/Table/TableCell/types.d.ts +14 -0
  47. package/dist/fields/RichTextField/extensions/Table/TableCell/utils.d.ts +16 -0
  48. package/dist/fields/RichTextField/extensions/Table/TableRow.d.ts +9 -0
  49. package/dist/fields/RichTextField/extensions/Table/TableView.d.ts +20 -0
  50. package/dist/fields/RichTextField/extensions/Table/menus/TableColumnMenu.d.ts +11 -0
  51. package/dist/fields/RichTextField/extensions/Table/menus/TableFloatingMenus.d.ts +7 -0
  52. package/dist/fields/RichTextField/extensions/Table/menus/TableRowMenu.d.ts +10 -0
  53. package/dist/fields/RichTextField/extensions/Table/menus/TriggerAnchor.d.ts +11 -0
  54. package/dist/fields/RichTextField/extensions/Table/menus/index.d.ts +2 -0
  55. package/dist/fields/RichTextField/extensions/Table/menus/utils.d.ts +13 -0
  56. package/dist/fields/RichTextField/extensions/Table/utils.d.ts +14 -0
  57. package/dist/index.cjs.js +92 -83
  58. package/dist/index.d.ts +1 -0
  59. package/dist/index.es.js +39062 -41762
  60. package/dist/slices/utils.d.ts +4 -2
  61. package/package.json +7 -6
  62. package/dist/fields/RichTextField/extensions/Table/TableControlsWrapper.d.ts +0 -3
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { type AuthStrategy } from "../../EditorConfig";
3
- declare const repositoryRole: z.ZodUnion<[z.ZodEnum<["Owner", "Administrator", "Writer", "Manager", "Readonly"]>, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodEnum<["Owner", "Administrator", "Writer", "Manager", "Readonly"]>>>]>;
3
+ declare const repositoryRole: z.ZodUnion<[z.ZodEnum<["SuperUser", "Owner", "Administrator", "Writer", "Manager", "Readonly"]>, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodEnum<["SuperUser", "Owner", "Administrator", "Writer", "Manager", "Readonly"]>>>]>;
4
4
  export declare const roleMap: {
5
5
  readonly SuperUser: "SuperUser";
6
6
  readonly Owner: "Owner";
@@ -12,6 +12,7 @@ export declare const roleMap: {
12
12
  export type Role = (typeof roleMap)[keyof typeof roleMap];
13
13
  export type RepositoryRole = z.TypeOf<typeof repositoryRole>;
14
14
  export declare const profileResponse: z.ZodObject<{
15
+ userId: z.ZodString;
15
16
  shortId: z.ZodString;
16
17
  intercomHash: z.ZodString;
17
18
  email: z.ZodString;
@@ -21,18 +22,19 @@ export declare const profileResponse: z.ZodObject<{
21
22
  repositories: z.ZodArray<z.ZodObject<{
22
23
  domain: z.ZodString;
23
24
  name: z.ZodOptional<z.ZodString>;
24
- role: z.ZodUnion<[z.ZodEnum<["Owner", "Administrator", "Writer", "Manager", "Readonly"]>, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodEnum<["Owner", "Administrator", "Writer", "Manager", "Readonly"]>>>]>;
25
+ role: z.ZodUnion<[z.ZodEnum<["SuperUser", "Owner", "Administrator", "Writer", "Manager", "Readonly"]>, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodEnum<["SuperUser", "Owner", "Administrator", "Writer", "Manager", "Readonly"]>>>]>;
25
26
  }, "strip", z.ZodTypeAny, {
26
27
  domain: string;
27
- role: "Manager" | "Writer" | "Readonly" | "Owner" | "Administrator" | Record<string, "Manager" | "Writer" | "Readonly" | "Owner" | "Administrator" | undefined>;
28
+ role: "SuperUser" | "Owner" | "Administrator" | "Manager" | "Writer" | "Readonly" | Record<string, "SuperUser" | "Owner" | "Administrator" | "Manager" | "Writer" | "Readonly" | undefined>;
28
29
  name?: string | undefined;
29
30
  }, {
30
31
  domain: string;
31
- role: "Manager" | "Writer" | "Readonly" | "Owner" | "Administrator" | Record<string, "Manager" | "Writer" | "Readonly" | "Owner" | "Administrator" | undefined>;
32
+ role: "SuperUser" | "Owner" | "Administrator" | "Manager" | "Writer" | "Readonly" | Record<string, "SuperUser" | "Owner" | "Administrator" | "Manager" | "Writer" | "Readonly" | undefined>;
32
33
  name?: string | undefined;
33
34
  }>, "many">;
34
35
  }, "strip", z.ZodTypeAny, {
35
36
  email: string;
37
+ userId: string;
36
38
  shortId: string;
37
39
  intercomHash: string;
38
40
  firstName: string;
@@ -40,11 +42,12 @@ export declare const profileResponse: z.ZodObject<{
40
42
  superPower: boolean;
41
43
  repositories: {
42
44
  domain: string;
43
- role: "Manager" | "Writer" | "Readonly" | "Owner" | "Administrator" | Record<string, "Manager" | "Writer" | "Readonly" | "Owner" | "Administrator" | undefined>;
45
+ role: "SuperUser" | "Owner" | "Administrator" | "Manager" | "Writer" | "Readonly" | Record<string, "SuperUser" | "Owner" | "Administrator" | "Manager" | "Writer" | "Readonly" | undefined>;
44
46
  name?: string | undefined;
45
47
  }[];
46
48
  }, {
47
49
  email: string;
50
+ userId: string;
48
51
  shortId: string;
49
52
  intercomHash: string;
50
53
  firstName: string;
@@ -52,7 +55,7 @@ export declare const profileResponse: z.ZodObject<{
52
55
  superPower: boolean;
53
56
  repositories: {
54
57
  domain: string;
55
- role: "Manager" | "Writer" | "Readonly" | "Owner" | "Administrator" | Record<string, "Manager" | "Writer" | "Readonly" | "Owner" | "Administrator" | undefined>;
58
+ role: "SuperUser" | "Owner" | "Administrator" | "Manager" | "Writer" | "Readonly" | Record<string, "SuperUser" | "Owner" | "Administrator" | "Manager" | "Writer" | "Readonly" | undefined>;
56
59
  name?: string | undefined;
57
60
  }[];
58
61
  }>;
@@ -60,6 +63,7 @@ export type Profile = z.infer<typeof profileResponse>;
60
63
  export declare function getProfile(userServiceBaseUrl: URL, authStrategy: AuthStrategy): Promise<Profile>;
61
64
  export declare function useProfile(): {
62
65
  email: string;
66
+ userId: string;
63
67
  shortId: string;
64
68
  intercomHash: string;
65
69
  firstName: string;
@@ -67,7 +71,7 @@ export declare function useProfile(): {
67
71
  superPower: boolean;
68
72
  repositories: {
69
73
  domain: string;
70
- role: "Manager" | "Writer" | "Readonly" | "Owner" | "Administrator" | Record<string, "Manager" | "Writer" | "Readonly" | "Owner" | "Administrator" | undefined>;
74
+ role: "SuperUser" | "Owner" | "Administrator" | "Manager" | "Writer" | "Readonly" | Record<string, "SuperUser" | "Owner" | "Administrator" | "Manager" | "Writer" | "Readonly" | undefined>;
71
75
  name?: string | undefined;
72
76
  }[];
73
77
  };
@@ -88,18 +88,18 @@ export declare function useImageField(props: useImageFieldProps): {
88
88
  }) | undefined;
89
89
  onClear: () => void;
90
90
  uploadImage: import("@tanstack/react-query/build/legacy/types").UseMutateFunction<{
91
+ id: string;
92
+ url: string;
93
+ kind: string;
94
+ size: number;
91
95
  tags: {
92
- name: string;
93
96
  id: string;
97
+ name: string;
94
98
  created_at: number;
95
99
  last_modified: number;
96
100
  count: number;
97
101
  uploader_id?: string | undefined;
98
102
  }[];
99
- id: string;
100
- url: string;
101
- kind: string;
102
- size: number;
103
103
  last_modified: number;
104
104
  filename: string;
105
105
  width?: number | undefined;
@@ -4,18 +4,18 @@ interface UseImageFieldImageUploadArgs {
4
4
  }
5
5
  export declare function useImageFieldImageUpload(args: UseImageFieldImageUploadArgs): {
6
6
  uploadImage: import("@tanstack/react-query/build/legacy/types").UseMutateFunction<{
7
+ id: string;
8
+ url: string;
9
+ kind: string;
10
+ size: number;
7
11
  tags: {
8
- name: string;
9
12
  id: string;
13
+ name: string;
10
14
  created_at: number;
11
15
  last_modified: number;
12
16
  count: number;
13
17
  uploader_id?: string | undefined;
14
18
  }[];
15
- id: string;
16
- url: string;
17
- kind: string;
18
- size: number;
19
19
  last_modified: number;
20
20
  filename: string;
21
21
  width?: number | undefined;
@@ -16,8 +16,8 @@ export declare function useDocuments(params: {
16
16
  } | {
17
17
  status: "archived";
18
18
  }) & {
19
- tags: string[];
20
19
  version_id: string;
20
+ tags: string[];
21
21
  last_modified_date: Date;
22
22
  custom_type_label: string;
23
23
  author: {
@@ -40,8 +40,8 @@ export declare function useDocuments(params: {
40
40
  } | {
41
41
  status: "archived";
42
42
  }) & {
43
- tags: string[];
44
43
  version_id: string;
44
+ tags: string[];
45
45
  last_modified_date: Date;
46
46
  preview_image?: string | undefined;
47
47
  uid?: string | undefined;
@@ -72,8 +72,8 @@ export declare function useDocuments(params: {
72
72
  } | {
73
73
  status: "archived";
74
74
  }) & {
75
- tags: string[];
76
75
  version_id: string;
76
+ tags: string[];
77
77
  last_modified_date: Date;
78
78
  custom_type_label: string;
79
79
  author: {
@@ -96,8 +96,8 @@ export declare function useDocuments(params: {
96
96
  } | {
97
97
  status: "archived";
98
98
  }) & {
99
- tags: string[];
100
99
  version_id: string;
100
+ tags: string[];
101
101
  last_modified_date: Date;
102
102
  preview_image?: string | undefined;
103
103
  uid?: string | undefined;
@@ -7,6 +7,13 @@ interface Props<TContent extends ExtendedRichTextContent> {
7
7
  field: RichText;
8
8
  readOnly: boolean;
9
9
  onContentChange: (content: TContent | undefined) => void;
10
+ padding?: "normal" | "zero";
11
+ scroll?: "hidden" | "x-auto";
12
+ /** Checks `editor.isEmpty` before calling `onContentChange`.
13
+ * - When `true`, the current structure of the document will be returned, even if it has no content.
14
+ * - When `false`, `undefined` will be returned.
15
+ * @default false */
16
+ shouldReturnEmptyContent?: boolean;
10
17
  }
11
18
  export declare function RichTextField<TContent extends ExtendedRichTextContent>(props: Props<TContent>): JSX.Element;
12
19
  export {};
@@ -20,18 +20,18 @@ export declare function useImageView(props: useImageViewProps): {
20
20
  updateContent: (content?: ImageBlockData) => void;
21
21
  onClear: () => void;
22
22
  uploadImage: import("@tanstack/react-query/build/legacy/types").UseMutateFunction<{
23
+ id: string;
24
+ url: string;
25
+ kind: string;
26
+ size: number;
23
27
  tags: {
24
- name: string;
25
28
  id: string;
29
+ name: string;
26
30
  created_at: number;
27
31
  last_modified: number;
28
32
  count: number;
29
33
  uploader_id?: string | undefined;
30
34
  }[];
31
- id: string;
32
- url: string;
33
- kind: string;
34
- size: number;
35
35
  last_modified: number;
36
36
  filename: string;
37
37
  width?: number | undefined;
@@ -5,15 +5,15 @@ declare module "@tiptap/core" {
5
5
  /**
6
6
  * Add a row at the end of the table
7
7
  * @returns True if the command was successful, otherwise false
8
- * @example editor.commands.addRowEnd()
8
+ * @example editor.commands.addRowToEnd()
9
9
  */
10
- addRowEnd: () => ReturnType;
10
+ addRowToEnd: () => ReturnType;
11
11
  /**
12
12
  * Add a column at the end of the table
13
13
  * @returns True if the command was successful, otherwise false
14
- * @example editor.commands.addColumnEnd()
14
+ * @example editor.commands.addColumnToEnd()
15
15
  */
16
- addColumnEnd: () => ReturnType;
16
+ addColumnToEnd: () => ReturnType;
17
17
  };
18
18
  }
19
19
  }
@@ -0,0 +1,10 @@
1
+ import { TableContent } from "@prismicio/types-internal/lib/content";
2
+ import { Node as ProseMirrorNode, type Schema } from "@tiptap/pm/model";
3
+ type TableRowBlock = TableContent["content"][number];
4
+ type TableCellOrHeaderBlock = TableRowBlock["content"][number];
5
+ export declare const TableCell: import("@tiptap/core").Node<import("@tiptap/extension-table-cell").TableCellOptions, any>;
6
+ export declare const tableCellConverter: {
7
+ fromPrismic(schema: Schema): (cell: TableCellOrHeaderBlock) => ProseMirrorNode;
8
+ toPrismic(node: ProseMirrorNode): TableCellOrHeaderBlock;
9
+ };
10
+ export {};
@@ -0,0 +1,10 @@
1
+ import { TableContent } from "@prismicio/types-internal/lib/content";
2
+ import type { Node as ProseMirrorNode, Schema } from "@tiptap/pm/model";
3
+ type TableRowBlock = TableContent["content"][number];
4
+ type TableCellOrHeaderBlock = TableRowBlock["content"][number];
5
+ export declare const TableHeader: import("@tiptap/core").Node<import("@tiptap/extension-table-header").TableHeaderOptions, any>;
6
+ export declare const tableHeaderCellConverter: {
7
+ fromPrismic(schema: Schema): (header: TableCellOrHeaderBlock) => ProseMirrorNode;
8
+ toPrismic(node: ProseMirrorNode): TableCellOrHeaderBlock;
9
+ };
10
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from "./TableCell";
2
+ export * from "./TableHeaderCell";
@@ -0,0 +1,8 @@
1
+ import type { Editor } from "@tiptap/core";
2
+ import { Plugin } from "@tiptap/pm/state";
3
+ import { DecorationSet } from "@tiptap/pm/view";
4
+ /** Plugin responsible for showing and hiding the row and column handles. */
5
+ export declare function TableHandlesPlugin(this: {
6
+ editor: Editor;
7
+ name: string;
8
+ }): Plugin<DecorationSet>;
@@ -0,0 +1,34 @@
1
+ import { type PluginView } from "@tiptap/pm/state";
2
+ import type { EditorView } from "@tiptap/pm/view";
3
+ /**
4
+ * This plugin centralizes the logic for showing and hiding the row and column
5
+ * handle buttons (the ones that on click open a floating menu).
6
+ *
7
+ * Ideally, hiding and showing the handles would be handled using only CSS,
8
+ * but identifying the topmost cell in a column is not trivial, as the grouping
9
+ * of cells in a column is not clearly defined in the DOM (only by colgroup),
10
+ * and CSS cannot dynamically select it depending on the hovered cell.
11
+ *
12
+ * Another option was to dynamically generate hardcoded selectors, given that
13
+ * we know the number of rows and cells, but inline styles can only contain
14
+ * property declarations, not pseudo-classes like :hover.
15
+ *
16
+ * That leaves us with handling it solely in JavaScript, which is what this
17
+ * plugin does.
18
+ */
19
+ export declare class TableHandlesPluginView implements PluginView {
20
+ private readonly view;
21
+ private abortController;
22
+ private currentRowHandle;
23
+ private currentColumnHandle;
24
+ constructor(view: EditorView);
25
+ update(view: EditorView): void;
26
+ destroy(): void;
27
+ private attachEventListeners;
28
+ private showCurrentHandles;
29
+ private hidePreviousHandles;
30
+ private getRowHandle;
31
+ private getColumnHandle;
32
+ private displayHandle;
33
+ private hideHandle;
34
+ }
@@ -0,0 +1,19 @@
1
+ import type { Editor } from "@tiptap/core";
2
+ export type TableHandleEventDetail = {
3
+ type: "row" | "column";
4
+ referenceElement: HTMLElement;
5
+ };
6
+ export type TableHandleEventType = {
7
+ name: "handleClick";
8
+ detail: TableHandleEventDetail;
9
+ };
10
+ export declare class TableHandleEvent extends CustomEvent<TableHandleEventType["detail"]> {
11
+ constructor({ name, detail }: TableHandleEventType);
12
+ static dispatch<TEvent extends TableHandleEventType>(name: TEvent["name"], args: {
13
+ editor: Editor;
14
+ } & TEvent["detail"]): void;
15
+ static listen<TEvent extends TableHandleEventType>(name: TEvent["name"], args: {
16
+ editor: Editor;
17
+ callback: (detail: TEvent["detail"]) => void;
18
+ }): () => void;
19
+ }
@@ -0,0 +1 @@
1
+ export { TableHandlesPlugin } from "./TableHandlesPlugin";
@@ -0,0 +1,23 @@
1
+ import { type Editor } from "@tiptap/core";
2
+ import type { Node as ProseMirrorNode } from "@tiptap/pm/model";
3
+ import type { Selection } from "@tiptap/pm/state";
4
+ interface NodePos {
5
+ pos: number;
6
+ start: number;
7
+ node: ProseMirrorNode | null | undefined;
8
+ }
9
+ export declare function getCellsInColumn(columnIndex: number | number[]): (selection: Selection) => NodePos[] | null;
10
+ export declare function getCellsInRow(rowIndex: number | number[]): (selection: Selection) => NodePos[] | null;
11
+ /** Finds the table handle element for the given type and element. */
12
+ export declare function findTableHandleElement(args: {
13
+ type: "row" | "column";
14
+ element: Element;
15
+ }): Element;
16
+ /** Creates a table handle element for the given type. */
17
+ export declare function createTableHandleElement(args: {
18
+ type: "row" | "column";
19
+ editor: Editor;
20
+ rowIndex: number;
21
+ columnIndex: number;
22
+ }): HTMLButtonElement;
23
+ export {};
@@ -0,0 +1 @@
1
+ export { TableHandlesPlugin } from "./TableHandles";
@@ -0,0 +1,14 @@
1
+ import { z } from "zod";
2
+ export declare const tableCellAttrs: z.ZodObject<{
3
+ colspan: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
4
+ rowspan: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
5
+ colwidth: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ colspan?: number | null | undefined;
8
+ rowspan?: number | null | undefined;
9
+ colwidth?: number[] | null | undefined;
10
+ }, {
11
+ colspan?: number | null | undefined;
12
+ rowspan?: number | null | undefined;
13
+ colwidth?: number[] | null | undefined;
14
+ }>;
@@ -0,0 +1,16 @@
1
+ import type { Block } from "@prismicio/types-internal/lib/content";
2
+ import type { Node as ProseMirrorNode, Schema } from "@tiptap/pm/model";
3
+ export declare function mapTableCellToParagraph(schema: Schema, block: Block): ProseMirrorNode | undefined;
4
+ interface CreateButtonElementArgs {
5
+ title: string;
6
+ className: string;
7
+ tabIndex?: number;
8
+ disabled?: boolean;
9
+ onMouseDown?: (event: MouseEvent, currentTarget: HTMLButtonElement) => void;
10
+ onClick: (event: MouseEvent, currentTarget: HTMLButtonElement) => void;
11
+ [key: `data-${string}`]: string | number | boolean;
12
+ [key: `aria-${string}`]: string | number | boolean;
13
+ }
14
+ export declare function createButtonElement(args: CreateButtonElementArgs): HTMLButtonElement;
15
+ export declare function renderHtmlFromString(html: string): ChildNode | null;
16
+ export {};
@@ -0,0 +1,9 @@
1
+ import { TableContent } from "@prismicio/types-internal/lib/content";
2
+ import type { Node as ProseMirrorNode, Schema } from "@tiptap/pm/model";
3
+ type TableRowBlock = TableContent["content"][number];
4
+ export declare const TableRow: import("@tiptap/core").Node<import("@tiptap/extension-table-row").TableRowOptions, any>;
5
+ export declare const tableRowConverter: {
6
+ fromPrismic(schema: Schema): (row: TableRowBlock) => ProseMirrorNode;
7
+ toPrismic(node: ProseMirrorNode): TableRowBlock;
8
+ };
9
+ export {};
@@ -0,0 +1,20 @@
1
+ import type { TableOptions as TTTableOptions } from "@tiptap/extension-table";
2
+ import type { Node as ProseMirrorNode } from "@tiptap/pm/model";
3
+ import { TableView as TTTableView } from "@tiptap/pm/tables";
4
+ import type { NodeView, ViewMutationRecord } from "@tiptap/pm/view";
5
+ import { Editor } from "@tiptap/react";
6
+ export interface TableOptions extends TTTableOptions {
7
+ defaultCellMinWidth: number;
8
+ }
9
+ /**
10
+ * Renders a custom table, with a container for the table and the add
11
+ * row/column buttons, while keeping the default table view for the
12
+ * table content.
13
+ */
14
+ export declare class TableView extends TTTableView implements NodeView {
15
+ constructor(args: {
16
+ node: ProseMirrorNode;
17
+ editor: Editor;
18
+ }, options: TableOptions);
19
+ ignoreMutation(mutation: ViewMutationRecord): boolean;
20
+ }
@@ -0,0 +1,11 @@
1
+ import type { Editor } from "@tiptap/core";
2
+ import { type CSSProperties } from "react";
3
+ interface TableColumnMenuProps {
4
+ editor: Editor;
5
+ style?: CSSProperties;
6
+ open?: boolean;
7
+ onOpenChange?: (open: boolean) => void;
8
+ triggerElement: HTMLElement | undefined;
9
+ }
10
+ export declare function TableColumnMenu(props: TableColumnMenuProps): JSX.Element;
11
+ export {};
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import type { Editor } from "@tiptap/core";
3
+ interface TableHandlesMenusProps {
4
+ editor: Editor;
5
+ }
6
+ export declare function TableFloatingMenus(props: TableHandlesMenusProps): JSX.Element;
7
+ export {};
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import type { Editor } from "@tiptap/core";
3
+ interface TableRowMenuProps {
4
+ editor: Editor;
5
+ open?: boolean;
6
+ onOpenChange?: (open: boolean) => void;
7
+ triggerElement: HTMLElement | undefined;
8
+ }
9
+ export declare function TableRowMenu(props: TableRowMenuProps): JSX.Element;
10
+ export {};
@@ -0,0 +1,11 @@
1
+ import { type HTMLAttributes } from "react";
2
+ interface TriggerProps extends HTMLAttributes<HTMLDivElement> {
3
+ anchorElement: HTMLElement | undefined;
4
+ }
5
+ /**
6
+ * This component serves as a dummy trigger for radix dialog to be able to open.
7
+ * It won't be visible, and it's only purpose is to sync the props that are
8
+ * passed to it by radix with the real trigger via the anchorRef prop.
9
+ */
10
+ export declare const TriggerAnchor: (props: TriggerProps & import("react").RefAttributes<HTMLElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
11
+ export {};
@@ -0,0 +1,2 @@
1
+ export { TableFloatingMenus } from "./TableFloatingMenus";
2
+ export { TableRowMenu } from "./TableRowMenu";
@@ -0,0 +1,13 @@
1
+ import type { Editor } from "@tiptap/core";
2
+ /**
3
+ * Row utilities
4
+ */
5
+ export declare const isFirstRow: (editor: Editor) => boolean;
6
+ export declare const isHeaderRowToggled: (editor: Editor) => boolean;
7
+ export declare const isSingleRow: (editor: Editor) => boolean;
8
+ /**
9
+ * Column utilities
10
+ */
11
+ export declare const isFirstColumn: (editor: Editor) => boolean;
12
+ export declare const isHeaderColumnToggled: (editor: Editor) => boolean;
13
+ export declare const isSingleColumn: (editor: Editor) => boolean;
@@ -0,0 +1,14 @@
1
+ import { Editor } from "@tiptap/core";
2
+ import type { Schema } from "@tiptap/pm/model";
3
+ import type { Selection } from "@tiptap/pm/state";
4
+ export declare function getNodeFromSchema(schema: Schema, name: string): import("prosemirror-model").NodeType;
5
+ export declare function findTable(selection: Selection): {
6
+ pos: number;
7
+ start: number;
8
+ depth: number;
9
+ node: import("prosemirror-model").Node;
10
+ } | undefined;
11
+ export declare function getTableColumnCount(editor: Editor): number;
12
+ export declare function getTableRowCount(editor: Editor): number;
13
+ export declare function isTableColumnLimitReached(editor: Editor): boolean;
14
+ export declare function isTableRowLimitReached(editor: Editor): boolean;