@prismicio/editor-fields 0.4.71 → 0.4.73

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 (43) hide show
  1. package/dist/EditorConfig.d.ts +2 -10
  2. package/dist/core/APIExplorer/APIExplorer.d.ts +4 -1
  3. package/dist/core/APIExplorer/components/APIExplorerContext.d.ts +34 -2
  4. package/dist/core/APIExplorer/components/Request/components/RequestRefFieldset.d.ts +5 -0
  5. package/dist/core/APIExplorer/components/Request/components/RequestTypeFieldset.d.ts +12 -3
  6. package/dist/core/APIExplorer/components/Request/components/index.d.ts +1 -0
  7. package/dist/core/APIExplorer/components/Request/createRequest.d.ts +1 -0
  8. package/dist/core/APIExplorer/components/Request/index.d.ts +1 -0
  9. package/dist/core/APIExplorer/hooks/useCopy.d.ts +4 -0
  10. package/dist/core/APIExplorer/hooks/useRepositoryCustomTypes.d.ts +6 -0
  11. package/dist/core/APIExplorer/hooks/useRequestRepository.d.ts +1 -0
  12. package/dist/core/MediaLibrary/hooks/mediaLibraryData.d.ts +31 -31
  13. package/dist/core/MediaLibrary/hooks/tagData.d.ts +3 -3
  14. package/dist/core/MediaLibrary/hooks/useMediaLibraryUpload.d.ts +3 -3
  15. package/dist/core/MediaLibrary/hooks/useSelectedMedia.d.ts +3 -3
  16. package/dist/core/UnsplashLibrary/unsplashData.d.ts +18 -18
  17. package/dist/core/service/customType.d.ts +1 -1
  18. package/dist/core/service/document.d.ts +35 -35
  19. package/dist/core/service/documentSearch.d.ts +5 -5
  20. package/dist/core/service/repository.d.ts +18 -18
  21. package/dist/core/service/role.d.ts +10 -10
  22. package/dist/fields/ImageField/useImageField.d.ts +3 -3
  23. package/dist/fields/ImageField/useImageFieldImageUpload.d.ts +3 -3
  24. package/dist/fields/LinkField/Documents/documentsData.d.ts +2 -2
  25. package/dist/fields/LinkField/LinkField.d.ts +1 -1
  26. package/dist/fields/RichTextField/extensions/Image/useImageView.d.ts +3 -3
  27. package/dist/index.cjs.js +47 -47
  28. package/dist/index.es.js +29520 -29372
  29. package/dist/slices/utils.d.ts +5 -5
  30. package/package.json +4 -4
  31. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/TableHandlesPlugin.d.ts +0 -8
  32. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/events.d.ts +0 -19
  33. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/index.d.ts +0 -1
  34. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/utils.d.ts +0 -23
  35. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/index.d.ts +0 -1
  36. package/dist/fields/RichTextField/extensions/Table/TableControlsWrapper.d.ts +0 -3
  37. package/dist/fields/RichTextField/extensions/Table/plugins/TableHandles/TableHandlesPluginDef.d.ts +0 -8
  38. package/dist/fields/RichTextField/extensions/Table/plugins/TableHandles/TableHandlesPluginView.d.ts +0 -34
  39. package/dist/fields/RichTextField/extensions/Table/plugins/TableHandles/TableHandlesPluginViewClass.d.ts +0 -34
  40. /package/dist/fields/RichTextField/extensions/Table/plugins/{TableHandles → tableHandles}/index.d.ts +0 -0
  41. /package/dist/fields/RichTextField/extensions/Table/plugins/{TableHandles/TableHandlesPlugin.d.ts → tableHandles/tableHandlesPlugin.d.ts} +0 -0
  42. /package/dist/fields/RichTextField/extensions/Table/{TableCell/plugins/TableHandles/TableHandlesPluginView.d.ts → plugins/tableHandles/tableHandlesPluginView.d.ts} +0 -0
  43. /package/dist/fields/RichTextField/extensions/Table/plugins/{TableHandles → tableHandles}/utils.d.ts +0 -0
@@ -291,7 +291,7 @@ export declare function maybeResetSliceWidget(args: MaybeResetSliceWidgetArgs):
291
291
  label?: string | null | undefined;
292
292
  direction?: string | null | undefined;
293
293
  }) | ({
294
- type: "image" | "embed" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "list-item" | "o-list-item" | "rtl";
294
+ type: "em" | "embed" | "strong" | "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "preformatted" | "hyperlink" | "list-item" | "o-list-item" | "rtl";
295
295
  content: {
296
296
  text: string;
297
297
  } & {
@@ -344,7 +344,7 @@ export declare function maybeResetSliceWidget(args: MaybeResetSliceWidgetArgs):
344
344
  } | {
345
345
  start: number;
346
346
  end: number;
347
- type: "strong" | "em" | "list-item";
347
+ type: "em" | "strong" | "list-item";
348
348
  })[] | undefined;
349
349
  };
350
350
  } & {
@@ -362,7 +362,7 @@ export declare function maybeResetSliceWidget(args: MaybeResetSliceWidgetArgs):
362
362
  content: ({
363
363
  key: string;
364
364
  } & {
365
- type: "tableHeader" | "tableCell";
365
+ type: "tableCell" | "tableHeader";
366
366
  content: {
367
367
  __TYPE__: "StructuredTextContent";
368
368
  value: (({
@@ -456,7 +456,7 @@ export declare function maybeResetSliceWidget(args: MaybeResetSliceWidgetArgs):
456
456
  label?: string | null | undefined;
457
457
  direction?: string | null | undefined;
458
458
  }) | ({
459
- type: "image" | "embed" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "list-item" | "o-list-item" | "rtl";
459
+ type: "em" | "embed" | "strong" | "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "preformatted" | "hyperlink" | "list-item" | "o-list-item" | "rtl";
460
460
  content: {
461
461
  text: string;
462
462
  } & {
@@ -509,7 +509,7 @@ export declare function maybeResetSliceWidget(args: MaybeResetSliceWidgetArgs):
509
509
  } | {
510
510
  start: number;
511
511
  end: number;
512
- type: "strong" | "em" | "list-item";
512
+ type: "em" | "strong" | "list-item";
513
513
  })[] | undefined;
514
514
  };
515
515
  } & {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "dependencies": {
3
3
  "@floating-ui/react-dom-interactions": "0.9.3",
4
4
  "@prismicio/client": "7.15.1",
5
- "@prismicio/editor-support": "0.4.71",
5
+ "@prismicio/editor-support": "0.4.73",
6
6
  "@prismicio/richtext": "2.1.1",
7
7
  "@prismicio/types-internal": "3.8.0",
8
8
  "@tiptap/core": "2.11.5",
@@ -38,7 +38,7 @@
38
38
  "zod": "3.23.8"
39
39
  },
40
40
  "devDependencies": {
41
- "@prismicio/editor-ui": "^0.4.71",
41
+ "@prismicio/editor-ui": "^0.4.73",
42
42
  "@testing-library/react": "15.0.7",
43
43
  "@types/react": "18.0.18",
44
44
  "@types/react-dom": "18.3.0",
@@ -72,7 +72,7 @@
72
72
  "module": "./dist/index.es.js",
73
73
  "name": "@prismicio/editor-fields",
74
74
  "peerDependencies": {
75
- "@prismicio/editor-ui": "^0.4.71",
75
+ "@prismicio/editor-ui": "^0.4.73",
76
76
  "@tanstack/react-query": "5.55.4",
77
77
  "react": "18",
78
78
  "react-dom": "18"
@@ -90,5 +90,5 @@
90
90
  "sideEffects": false,
91
91
  "stableVersion": "0.0.0",
92
92
  "types": "./dist/index.d.ts",
93
- "version": "0.4.71"
93
+ "version": "0.4.73"
94
94
  }
@@ -1,8 +0,0 @@
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>;
@@ -1,19 +0,0 @@
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
- }
@@ -1 +0,0 @@
1
- export { TableHandlesPlugin } from "./TableHandlesPlugin";
@@ -1,23 +0,0 @@
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 {};
@@ -1 +0,0 @@
1
- export { TableHandlesPlugin } from "./TableHandles";
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import { type NodeViewProps } from "@tiptap/react";
3
- export declare function TableControlsWrapper({ editor }: NodeViewProps): JSX.Element;
@@ -1,8 +0,0 @@
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(args: {
6
- editor: Editor;
7
- name: string;
8
- }): Plugin<DecorationSet>;
@@ -1,34 +0,0 @@
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
- }
@@ -1,34 +0,0 @@
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
- }