@prismicio/editor-fields 0.4.6 → 0.4.7

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 (34) hide show
  1. package/dist/fields/BooleanField.d.ts +4 -5
  2. package/dist/fields/ColorField/ColorField.d.ts +3 -3
  3. package/dist/fields/DateField.d.ts +3 -3
  4. package/dist/fields/ImageField/{EmptyCardContent.d.ts → Components/EmptyCardContent.d.ts} +1 -1
  5. package/dist/fields/ImageField/{ImageFieldCard.d.ts → Components/ImageFieldCard.d.ts} +9 -2
  6. package/dist/fields/ImageField/CropperDialog/CropperDialog.d.ts +2 -8
  7. package/dist/fields/ImageField/CropperDialog/croppedImage.d.ts +19 -1
  8. package/dist/fields/ImageField/ImageField.d.ts +1 -2
  9. package/dist/fields/ImageField/MediaPicker/MediaLibrary/mediaLibraryData.d.ts +8 -8
  10. package/dist/fields/ImageField/imageFieldUtils.d.ts +6 -0
  11. package/dist/fields/ImageField/useImageField.d.ts +101 -0
  12. package/dist/fields/LinkField/Documents/documentsData.d.ts +23 -23
  13. package/dist/fields/LinkField/useLinkField.d.ts +3 -3
  14. package/dist/fields/RichTextField/RichTextField.d.ts +4 -4
  15. package/dist/fields/RichTextField/coreExtensions/ListItem.d.ts +4 -4
  16. package/dist/fields/RichTextField/extensions/Image/useImageView.d.ts +23 -0
  17. package/dist/fields/RichTextField/models/RichTextConfig.d.ts +2 -2
  18. package/dist/fields/SelectField.d.ts +3 -4
  19. package/dist/fields/TimestampField.d.ts +3 -3
  20. package/dist/index.es.js +8145 -8104
  21. package/package.json +3 -3
  22. package/dist/fields/GeoPointField.d.ts +0 -11
  23. package/dist/fields/RichTextField/BubbleMenu.d.ts +0 -8
  24. package/dist/fields/RichTextField/extensions/Bold.d.ts +0 -3
  25. package/dist/fields/RichTextField/extensions/BulletList.d.ts +0 -3
  26. package/dist/fields/RichTextField/extensions/CodeBlock.d.ts +0 -3
  27. package/dist/fields/RichTextField/extensions/Embed/index.d.ts +0 -10
  28. package/dist/fields/RichTextField/extensions/Heading.d.ts +0 -21
  29. package/dist/fields/RichTextField/extensions/Italic.d.ts +0 -3
  30. package/dist/fields/RichTextField/extensions/Link/Link.d.ts +0 -44
  31. package/dist/fields/RichTextField/extensions/OrderedList.d.ts +0 -3
  32. package/dist/fields/RichTextField/extensions/Paragraph.d.ts +0 -3
  33. package/dist/index.umd.js +0 -145
  34. /package/dist/fields/ImageField/{ImageAltControl.d.ts → Components/ImageAltControl.d.ts} +0 -0
@@ -1,12 +1,11 @@
1
1
  import type { BooleanContent } from "@prismicio/types-internal/lib/content";
2
2
  import type { BooleanField as BooleanT } from "@prismicio/types-internal/lib/customtypes";
3
- import type { FC } from "react";
4
- declare type BooleanFieldProps = Readonly<{
3
+ interface Props {
5
4
  content: BooleanContent | undefined;
6
5
  field: BooleanT;
7
6
  id: string;
8
- onContentChange: (content: BooleanContent) => void;
9
7
  readOnly: boolean;
10
- }>;
11
- export declare const BooleanField: FC<BooleanFieldProps>;
8
+ onContentChange: (content: BooleanContent) => void;
9
+ }
10
+ export declare function BooleanField(props: Props): JSX.Element;
12
11
  export {};
@@ -1,10 +1,10 @@
1
1
  import type { ColorContent } from "@prismicio/types-internal/lib/content";
2
2
  import type { Color as ColorT } from "@prismicio/types-internal/lib/customtypes";
3
- declare type Props = Readonly<{
3
+ interface Props {
4
4
  id: string;
5
5
  field: ColorT;
6
6
  content?: ColorContent;
7
7
  onContentChange: (content?: ColorContent) => void;
8
- }>;
9
- export declare const ColorField: ({ id, field, content, onContentChange }: Props) => JSX.Element;
8
+ }
9
+ export declare function ColorField(props: Props): JSX.Element;
10
10
  export {};
@@ -1,11 +1,11 @@
1
1
  import type { DateContent } from "@prismicio/types-internal/lib/content";
2
2
  import type { Date as DateT } from "@prismicio/types-internal/lib/customtypes";
3
- declare type Props = Readonly<{
3
+ interface Props {
4
4
  id: string;
5
5
  readOnly: boolean;
6
6
  field: DateT;
7
7
  content?: DateContent;
8
8
  onContentChange: (content?: DateContent) => void;
9
- }>;
10
- export declare const DateField: ({ id, readOnly, field, content, onContentChange }: Props) => JSX.Element;
9
+ }
10
+ export declare function DateField(props: Props): JSX.Element;
11
11
  export {};
@@ -1,4 +1,4 @@
1
- import type { ExternalImage } from "./MediaPicker/externalImage";
1
+ import type { ExternalImage } from "../MediaPicker/externalImage";
2
2
  interface EmptyCardContentProps {
3
3
  isUpdating: boolean;
4
4
  readOnly: boolean;
@@ -1,6 +1,8 @@
1
1
  import type { ImageContent } from "@prismicio/types-internal/lib/content";
2
2
  import type { ReactNode } from "react";
3
- import type { ExternalImage } from "./MediaPicker/externalImage";
3
+ import { CroppedImages } from "../CropperDialog";
4
+ import type { CropperImage } from "../imageFieldUtils";
5
+ import type { ExternalImage } from "../MediaPicker/externalImage";
4
6
  interface ImageFieldCardProps {
5
7
  content: ImageContent | undefined;
6
8
  onContentChange: (content: ImageContent | undefined) => void;
@@ -9,7 +11,12 @@ interface ImageFieldCardProps {
9
11
  imageLabel: string[];
10
12
  setPage?: (page: number) => void;
11
13
  onMediaSelected: (media: ExternalImage) => void;
12
- cropper?: ReactNode;
14
+ initialImages: CropperImage[];
15
+ initialOption?: number;
16
+ onCropperDialogClose: (result: {
17
+ croppedImages: CroppedImages;
18
+ option: number;
19
+ }) => void;
13
20
  children: ReactNode;
14
21
  }
15
22
  export declare function ImageFieldCard(props: ImageFieldCardProps): JSX.Element;
@@ -1,15 +1,9 @@
1
- import type { ImageContentView } from "@prismicio/types-internal/lib/content";
2
- import type { getImageLabel, Thumbnail } from "../imageFieldUtils";
1
+ import type { CropperImage } from "../imageFieldUtils";
3
2
  import { type CroppedImage } from "./croppedImage";
4
3
  export declare type CroppedImages = Record<string, CroppedImage>;
5
- interface Image {
6
- thumbnail: Thumbnail;
7
- contentView?: ImageContentView;
8
- labels: ReturnType<typeof getImageLabel>;
9
- }
10
4
  interface Props {
11
5
  trigger: React.ReactNode;
12
- initialImages: Image[];
6
+ initialImages: CropperImage[];
13
7
  initialOption: number;
14
8
  onClose: (result: {
15
9
  croppedImages: CroppedImages;
@@ -13,7 +13,25 @@ export declare type CroppedImage = Point & Size & {
13
13
  zoom: number;
14
14
  };
15
15
  export declare const updateImage: ({ field, content, thumbnail, croppedImage }: {
16
- field: Image;
16
+ field?: ({
17
+ type: "Image";
18
+ } & {
19
+ fieldset?: string | null | undefined;
20
+ config?: {
21
+ label?: string | null | undefined;
22
+ placeholder?: string | undefined;
23
+ constraint?: {
24
+ width?: number | null | undefined;
25
+ height?: number | null | undefined;
26
+ } | undefined;
27
+ thumbnails?: readonly ({
28
+ name: string;
29
+ } & {
30
+ width?: number | null | undefined;
31
+ height?: number | null | undefined;
32
+ })[] | undefined;
33
+ } | undefined;
34
+ }) | undefined;
17
35
  content: ImageContent;
18
36
  thumbnail: string;
19
37
  croppedImage: CroppedImage;
@@ -1,6 +1,5 @@
1
1
  import type { ImageContent } from "@prismicio/types-internal/lib/content";
2
2
  import type { Image } from "@prismicio/types-internal/lib/customtypes";
3
- import { type FC } from "react";
4
3
  interface ImageFieldProps {
5
4
  content: ImageContent | undefined;
6
5
  field: Image;
@@ -8,5 +7,5 @@ interface ImageFieldProps {
8
7
  onContentChange: (content: ImageContent | undefined) => void;
9
8
  readOnly: boolean;
10
9
  }
11
- export declare const ImageField: FC<ImageFieldProps>;
10
+ export declare function ImageField(props: ImageFieldProps): JSX.Element;
12
11
  export {};
@@ -9,8 +9,8 @@ export declare const mediaLibraryImageOkType: import("zod").ZodObject<{
9
9
  last_modified: import("zod").ZodNumber;
10
10
  url: import("zod").ZodString;
11
11
  }, "strip", import("zod").ZodTypeAny, {
12
- url: string;
13
12
  id: string;
13
+ url: string;
14
14
  kind: string;
15
15
  extension: string;
16
16
  filename: string;
@@ -18,8 +18,8 @@ export declare const mediaLibraryImageOkType: import("zod").ZodObject<{
18
18
  width?: number | undefined;
19
19
  height?: number | undefined;
20
20
  }, {
21
- url: string;
22
21
  id: string;
22
+ url: string;
23
23
  kind: string;
24
24
  extension: string;
25
25
  filename: string;
@@ -40,8 +40,8 @@ export declare const mediaLibrarySearchAPISchemaOkType: import("zod").ZodObject<
40
40
  last_modified: import("zod").ZodNumber;
41
41
  url: import("zod").ZodString;
42
42
  }, "strip", import("zod").ZodTypeAny, {
43
- url: string;
44
43
  id: string;
44
+ url: string;
45
45
  kind: string;
46
46
  extension: string;
47
47
  filename: string;
@@ -49,8 +49,8 @@ export declare const mediaLibrarySearchAPISchemaOkType: import("zod").ZodObject<
49
49
  width?: number | undefined;
50
50
  height?: number | undefined;
51
51
  }, {
52
- url: string;
53
52
  id: string;
53
+ url: string;
54
54
  kind: string;
55
55
  extension: string;
56
56
  filename: string;
@@ -61,8 +61,8 @@ export declare const mediaLibrarySearchAPISchemaOkType: import("zod").ZodObject<
61
61
  }, "strip", import("zod").ZodTypeAny, {
62
62
  total: number;
63
63
  items: {
64
- url: string;
65
64
  id: string;
65
+ url: string;
66
66
  kind: string;
67
67
  extension: string;
68
68
  filename: string;
@@ -74,8 +74,8 @@ export declare const mediaLibrarySearchAPISchemaOkType: import("zod").ZodObject<
74
74
  }, {
75
75
  total: number;
76
76
  items: {
77
- url: string;
78
77
  id: string;
78
+ url: string;
79
79
  kind: string;
80
80
  extension: string;
81
81
  filename: string;
@@ -89,8 +89,8 @@ export declare type MediaLibrarySearchApi = TypeOf<typeof mediaLibrarySearchAPIS
89
89
  export declare type MediaLibraryImage = TypeOf<typeof mediaLibraryImageOkType>;
90
90
  export declare function useMediaLibrarySearch(): {
91
91
  media: {
92
- url: string;
93
92
  id: string;
93
+ url: string;
94
94
  kind: string;
95
95
  extension: string;
96
96
  filename: string;
@@ -103,8 +103,8 @@ export declare function useMediaLibrarySearch(): {
103
103
  response: {
104
104
  total: number;
105
105
  items: {
106
- url: string;
107
106
  id: string;
107
+ url: string;
108
108
  kind: string;
109
109
  extension: string;
110
110
  filename: string;
@@ -4,6 +4,11 @@ export declare type Thumbnail = Readonly<ImageConstraint & {
4
4
  name: string;
5
5
  }>;
6
6
  export declare const MAIN_THUMBNAIL_NAME = "__MAIN_THUMBNAIL__";
7
+ export interface CropperImage {
8
+ thumbnail: Thumbnail;
9
+ contentView?: ImageContentView;
10
+ labels: ReturnType<typeof getImageLabel>;
11
+ }
7
12
  export declare function getImageLabel(thumbnail: Thumbnail, content: ImageContent | undefined, contentView: ImageContentView | undefined): readonly [thumbnailName: string | undefined, size: string | undefined];
8
13
  export declare function getImageThumbnails(field: Image): readonly Thumbnail[];
9
14
  export declare function getImageContentViews(field: Image, content: ImageContent): readonly [ImageContentView, ...(ImageContentView | undefined)[]];
@@ -20,3 +25,4 @@ export declare function buildImageUrl(originUrl: string, rect: {
20
25
  }, outputWidth: number, outputHeight: number, hasConstraints: boolean): string;
21
26
  export declare function getPreviewImage(fromUrl: string): string;
22
27
  export declare function getSearchTileImage(fromUrl: string): string;
28
+ export declare function getCarouselItemSource(view: ImageContentView | undefined): string | undefined;
@@ -0,0 +1,101 @@
1
+ import type { ImageContent } from "@prismicio/types-internal/lib/content";
2
+ import type { Image } from "@prismicio/types-internal/lib/customtypes";
3
+ import type { CroppedImages } from "./CropperDialog";
4
+ import { type ExternalImage } from "./MediaPicker/externalImage";
5
+ interface useImageFieldProps {
6
+ content: ImageContent | undefined;
7
+ field: Image;
8
+ onContentChange: (content: ImageContent | undefined) => void;
9
+ }
10
+ export declare function useImageField(props: useImageFieldProps): {
11
+ onCropperDialogClose: ({ option, croppedImages }: {
12
+ option: number;
13
+ croppedImages: CroppedImages;
14
+ }) => void;
15
+ onPageChange: (page: number) => void;
16
+ onMediaSelected: (media: ExternalImage) => void;
17
+ isUpdating: boolean;
18
+ page: number;
19
+ setPage: import("react").Dispatch<import("react").SetStateAction<number>>;
20
+ thumbnail: Readonly<{
21
+ width?: number | null | undefined;
22
+ height?: number | null | undefined;
23
+ } & {
24
+ name: string;
25
+ }> | undefined;
26
+ allThumbnails: readonly Readonly<{
27
+ width?: number | null | undefined;
28
+ height?: number | null | undefined;
29
+ } & {
30
+ name: string;
31
+ }>[];
32
+ allContentViews: readonly [{
33
+ origin: {
34
+ id: string;
35
+ url: string;
36
+ width: number;
37
+ height: number;
38
+ };
39
+ width: number;
40
+ height: number;
41
+ edit: {
42
+ zoom: number;
43
+ crop: {
44
+ x: number;
45
+ y: number;
46
+ };
47
+ background: string;
48
+ };
49
+ } & {
50
+ url?: string | undefined;
51
+ credits?: string | null | undefined;
52
+ alt?: string | null | undefined;
53
+ provider?: string | null | undefined;
54
+ }, ...(({
55
+ origin: {
56
+ id: string;
57
+ url: string;
58
+ width: number;
59
+ height: number;
60
+ };
61
+ width: number;
62
+ height: number;
63
+ edit: {
64
+ zoom: number;
65
+ crop: {
66
+ x: number;
67
+ y: number;
68
+ };
69
+ background: string;
70
+ };
71
+ } & {
72
+ url?: string | undefined;
73
+ credits?: string | null | undefined;
74
+ alt?: string | null | undefined;
75
+ provider?: string | null | undefined;
76
+ }) | undefined)[]] | undefined;
77
+ contentView: ({
78
+ origin: {
79
+ id: string;
80
+ url: string;
81
+ width: number;
82
+ height: number;
83
+ };
84
+ width: number;
85
+ height: number;
86
+ edit: {
87
+ zoom: number;
88
+ crop: {
89
+ x: number;
90
+ y: number;
91
+ };
92
+ background: string;
93
+ };
94
+ } & {
95
+ url?: string | undefined;
96
+ credits?: string | null | undefined;
97
+ alt?: string | null | undefined;
98
+ provider?: string | null | undefined;
99
+ }) | undefined;
100
+ };
101
+ export {};
@@ -5,8 +5,8 @@ export declare function useDocuments(params: {
5
5
  typesFilter: string[];
6
6
  }): {
7
7
  documents: {
8
- title: string;
9
8
  id: string;
9
+ title: string;
10
10
  custom_type_id: string;
11
11
  versions: (({
12
12
  status: "unclassified";
@@ -18,8 +18,8 @@ export declare function useDocuments(params: {
18
18
  } | {
19
19
  status: "archived";
20
20
  }) & {
21
- version_id: string;
22
21
  tags: string[];
22
+ version_id: string;
23
23
  custom_type_label: string;
24
24
  preview_summary?: string | undefined;
25
25
  preview_image?: string | undefined;
@@ -27,9 +27,10 @@ export declare function useDocuments(params: {
27
27
  }[];
28
28
  onHasReachedBottom: () => void;
29
29
  response: {
30
+ total: number;
30
31
  results: {
31
- title: string;
32
32
  id: string;
33
+ title: string;
33
34
  custom_type_id: string;
34
35
  versions: (({
35
36
  status: "unclassified";
@@ -41,14 +42,13 @@ export declare function useDocuments(params: {
41
42
  } | {
42
43
  status: "archived";
43
44
  }) & {
44
- version_id: string;
45
45
  tags: string[];
46
+ version_id: string;
46
47
  custom_type_label: string;
47
48
  preview_summary?: string | undefined;
48
49
  preview_image?: string | undefined;
49
50
  })[];
50
51
  }[];
51
- total: number;
52
52
  cursor?: string | undefined;
53
53
  };
54
54
  };
@@ -90,21 +90,21 @@ declare const documentsSearchOkType: import("zod").ZodObject<{
90
90
  preview_summary: import("zod").ZodOptional<import("zod").ZodString>;
91
91
  preview_image: import("zod").ZodOptional<import("zod").ZodString>;
92
92
  }, "strip", import("zod").ZodTypeAny, {
93
- version_id: string;
94
93
  tags: string[];
94
+ version_id: string;
95
95
  custom_type_label: string;
96
96
  preview_summary?: string | undefined;
97
97
  preview_image?: string | undefined;
98
98
  }, {
99
- version_id: string;
100
99
  tags: string[];
100
+ version_id: string;
101
101
  custom_type_label: string;
102
102
  preview_summary?: string | undefined;
103
103
  preview_image?: string | undefined;
104
104
  }>>, "many">;
105
105
  }, "strip", import("zod").ZodTypeAny, {
106
- title: string;
107
106
  id: string;
107
+ title: string;
108
108
  custom_type_id: string;
109
109
  versions: (({
110
110
  status: "unclassified";
@@ -116,15 +116,15 @@ declare const documentsSearchOkType: import("zod").ZodObject<{
116
116
  } | {
117
117
  status: "archived";
118
118
  }) & {
119
- version_id: string;
120
119
  tags: string[];
120
+ version_id: string;
121
121
  custom_type_label: string;
122
122
  preview_summary?: string | undefined;
123
123
  preview_image?: string | undefined;
124
124
  })[];
125
125
  }, {
126
- title: string;
127
126
  id: string;
127
+ title: string;
128
128
  custom_type_id: string;
129
129
  versions: (({
130
130
  status: "unclassified";
@@ -136,8 +136,8 @@ declare const documentsSearchOkType: import("zod").ZodObject<{
136
136
  } | {
137
137
  status: "archived";
138
138
  }) & {
139
- version_id: string;
140
139
  tags: string[];
140
+ version_id: string;
141
141
  custom_type_label: string;
142
142
  preview_summary?: string | undefined;
143
143
  preview_image?: string | undefined;
@@ -184,21 +184,21 @@ declare const documentsSearchAPISchemaOkType: import("zod").ZodObject<{
184
184
  preview_summary: import("zod").ZodOptional<import("zod").ZodString>;
185
185
  preview_image: import("zod").ZodOptional<import("zod").ZodString>;
186
186
  }, "strip", import("zod").ZodTypeAny, {
187
- version_id: string;
188
187
  tags: string[];
188
+ version_id: string;
189
189
  custom_type_label: string;
190
190
  preview_summary?: string | undefined;
191
191
  preview_image?: string | undefined;
192
192
  }, {
193
- version_id: string;
194
193
  tags: string[];
194
+ version_id: string;
195
195
  custom_type_label: string;
196
196
  preview_summary?: string | undefined;
197
197
  preview_image?: string | undefined;
198
198
  }>>, "many">;
199
199
  }, "strip", import("zod").ZodTypeAny, {
200
- title: string;
201
200
  id: string;
201
+ title: string;
202
202
  custom_type_id: string;
203
203
  versions: (({
204
204
  status: "unclassified";
@@ -210,15 +210,15 @@ declare const documentsSearchAPISchemaOkType: import("zod").ZodObject<{
210
210
  } | {
211
211
  status: "archived";
212
212
  }) & {
213
- version_id: string;
214
213
  tags: string[];
214
+ version_id: string;
215
215
  custom_type_label: string;
216
216
  preview_summary?: string | undefined;
217
217
  preview_image?: string | undefined;
218
218
  })[];
219
219
  }, {
220
- title: string;
221
220
  id: string;
221
+ title: string;
222
222
  custom_type_id: string;
223
223
  versions: (({
224
224
  status: "unclassified";
@@ -230,17 +230,18 @@ declare const documentsSearchAPISchemaOkType: import("zod").ZodObject<{
230
230
  } | {
231
231
  status: "archived";
232
232
  }) & {
233
- version_id: string;
234
233
  tags: string[];
234
+ version_id: string;
235
235
  custom_type_label: string;
236
236
  preview_summary?: string | undefined;
237
237
  preview_image?: string | undefined;
238
238
  })[];
239
239
  }>, "many">;
240
240
  }, "strip", import("zod").ZodTypeAny, {
241
+ total: number;
241
242
  results: {
242
- title: string;
243
243
  id: string;
244
+ title: string;
244
245
  custom_type_id: string;
245
246
  versions: (({
246
247
  status: "unclassified";
@@ -252,19 +253,19 @@ declare const documentsSearchAPISchemaOkType: import("zod").ZodObject<{
252
253
  } | {
253
254
  status: "archived";
254
255
  }) & {
255
- version_id: string;
256
256
  tags: string[];
257
+ version_id: string;
257
258
  custom_type_label: string;
258
259
  preview_summary?: string | undefined;
259
260
  preview_image?: string | undefined;
260
261
  })[];
261
262
  }[];
262
- total: number;
263
263
  cursor?: string | undefined;
264
264
  }, {
265
+ total: number;
265
266
  results: {
266
- title: string;
267
267
  id: string;
268
+ title: string;
268
269
  custom_type_id: string;
269
270
  versions: (({
270
271
  status: "unclassified";
@@ -276,14 +277,13 @@ declare const documentsSearchAPISchemaOkType: import("zod").ZodObject<{
276
277
  } | {
277
278
  status: "archived";
278
279
  }) & {
279
- version_id: string;
280
280
  tags: string[];
281
+ version_id: string;
281
282
  custom_type_label: string;
282
283
  preview_summary?: string | undefined;
283
284
  preview_image?: string | undefined;
284
285
  })[];
285
286
  }[];
286
- total: number;
287
287
  cursor?: string | undefined;
288
288
  }>;
289
289
  export declare type DocumentSearchApi = TypeOf<typeof documentsSearchAPISchemaOkType>;
@@ -11,7 +11,7 @@ interface useLinkFieldParams {
11
11
  }
12
12
  export declare function useLinkField(params: useLinkFieldParams): {
13
13
  contentType: "ImageLink" | "FileLink" | "DocumentLink" | "ExternalLink" | undefined;
14
- selectType: "document" | "media" | "web" | undefined;
14
+ selectType: "media" | "web" | "document" | undefined;
15
15
  isUnsupportedField: boolean | undefined;
16
16
  fieldValue: string;
17
17
  onValueChange: (value: string) => void;
@@ -29,11 +29,11 @@ declare const documentMeta: import("zod").ZodObject<{
29
29
  id: import("zod").ZodString;
30
30
  title: import("zod").ZodString;
31
31
  }, "strip", import("zod").ZodTypeAny, {
32
- title: string;
33
32
  id: string;
34
- }, {
35
33
  title: string;
34
+ }, {
36
35
  id: string;
36
+ title: string;
37
37
  }>;
38
38
  export declare type DocumentMeta = TypeOf<typeof documentMeta>;
39
39
  export declare function getDocumentTitleRequest(baseUrl: string, env: Env, id: string): Promise<DocumentMeta>;
@@ -1,11 +1,11 @@
1
1
  import type { RichTextContent } from "@prismicio/types-internal/lib/content";
2
2
  import type { RichText } from "@prismicio/types-internal/lib/customtypes";
3
- interface RichTextFieldProps {
3
+ interface Props {
4
+ id: string;
4
5
  content: RichTextContent | undefined;
5
6
  field: RichText;
6
- id: string;
7
- onContentChange: (content: RichTextContent | undefined) => void;
8
7
  readOnly: boolean;
8
+ onContentChange: (content: RichTextContent | undefined) => void;
9
9
  }
10
- export declare function RichTextField(props: RichTextFieldProps): JSX.Element;
10
+ export declare function RichTextField(props: Props): JSX.Element;
11
11
  export {};
@@ -4,7 +4,7 @@ declare const _default: {
4
4
  component: import("@tiptap/core").Node<import("@tiptap/extension-list-item").ListItemOptions, any>;
5
5
  converter: {
6
6
  fromPrismic(schema: Schema<any, any>): (list: {
7
- type: "em" | "embed" | "strong" | "image" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "paragraph" | "preformatted" | "hyperlink" | "rtl" | "list-item" | "o-list-item";
7
+ type: "em" | "embed" | "strong" | "image" | "paragraph" | "list-item" | "o-list-item" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "preformatted" | "hyperlink" | "rtl";
8
8
  content: {
9
9
  text: string;
10
10
  } & {
@@ -13,7 +13,7 @@ declare const _default: {
13
13
  } & {
14
14
  start: number;
15
15
  end: number;
16
- type: "em" | "embed" | "label" | "strong" | "image" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "paragraph" | "preformatted" | "hyperlink" | "rtl" | "list-item" | "o-list-item";
16
+ type: "label" | "em" | "embed" | "strong" | "image" | "paragraph" | "list-item" | "o-list-item" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "preformatted" | "hyperlink" | "rtl";
17
17
  })[] | undefined;
18
18
  };
19
19
  } & {
@@ -21,7 +21,7 @@ declare const _default: {
21
21
  direction?: string | undefined;
22
22
  }) => ProsemirrorNode | undefined;
23
23
  toPrismic(node: ProsemirrorNode, nodeType: "list-item" | "o-list-item"): readonly ({
24
- type: "em" | "embed" | "strong" | "image" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "paragraph" | "preformatted" | "hyperlink" | "rtl" | "list-item" | "o-list-item";
24
+ type: "em" | "embed" | "strong" | "image" | "paragraph" | "list-item" | "o-list-item" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "preformatted" | "hyperlink" | "rtl";
25
25
  content: {
26
26
  text: string;
27
27
  } & {
@@ -30,7 +30,7 @@ declare const _default: {
30
30
  } & {
31
31
  start: number;
32
32
  end: number;
33
- type: "em" | "embed" | "label" | "strong" | "image" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "paragraph" | "preformatted" | "hyperlink" | "rtl" | "list-item" | "o-list-item";
33
+ type: "label" | "em" | "embed" | "strong" | "image" | "paragraph" | "list-item" | "o-list-item" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "preformatted" | "hyperlink" | "rtl";
34
34
  })[] | undefined;
35
35
  };
36
36
  } & {
@@ -0,0 +1,23 @@
1
+ import type { ImageContent } from "@prismicio/types-internal/lib/content";
2
+ import type { CroppedImages } from "../../../ImageField/CropperDialog";
3
+ import { ExternalImage } from "../../../ImageField/MediaPicker/externalImage";
4
+ import type { ImageViewProps } from "./ImageView";
5
+ interface useImageViewProps {
6
+ content: ImageContent | undefined;
7
+ thumbnail: {
8
+ width: number | undefined;
9
+ height: number | undefined;
10
+ name: string;
11
+ };
12
+ imageViewProps: ImageViewProps;
13
+ }
14
+ export declare function useImageView(props: useImageViewProps): {
15
+ onContentChange: (content?: ImageContent) => void;
16
+ onMediaSelected: (media: ExternalImage) => void;
17
+ onCropperDialogClose: ({ croppedImages }: {
18
+ croppedImages: CroppedImages;
19
+ }) => void;
20
+ isUpdating: boolean;
21
+ updateContent: (content?: ImageContent) => void;
22
+ };
23
+ export {};
@@ -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" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "paragraph" | "preformatted" | "hyperlink" | "rtl" | "list-item" | "o-list-item";
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
  } & {
@@ -16,7 +16,7 @@ export declare function composeExtensions(config?: RichTextConfig): {
16
16
  } & {
17
17
  start: number;
18
18
  end: number;
19
- type: "em" | "embed" | "label" | "strong" | "image" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "paragraph" | "preformatted" | "hyperlink" | "rtl" | "list-item" | "o-list-item";
19
+ type: "label" | "em" | "embed" | "strong" | "image" | "paragraph" | "list-item" | "o-list-item" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "preformatted" | "hyperlink" | "rtl";
20
20
  })[] | undefined;
21
21
  };
22
22
  } & {