@prismicio/editor-fields 0.4.5 → 0.4.6
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.
- package/dist/EditorConfig.d.ts +23 -15
- package/dist/fields/EmbedField/EmbedField.d.ts +0 -4
- package/dist/fields/EmbedField/EmbedFooter.d.ts +8 -0
- package/dist/fields/GeoPointField/GeoPointField.d.ts +13 -0
- package/dist/fields/GeoPointField/geoPointFieldUtils.d.ts +6 -0
- package/dist/fields/GeoPointField/index.d.ts +1 -0
- package/dist/fields/ImageField/CropperDialog/CropperDialog.d.ts +0 -1
- package/dist/fields/ImageField/EmptyCardContent.d.ts +8 -0
- package/dist/fields/ImageField/ImageAltControl.d.ts +8 -0
- package/dist/fields/ImageField/ImageFieldCard.d.ts +16 -0
- package/dist/fields/ImageField/MediaPicker/MediaLibrary/mediaLibraryData.d.ts +8 -8
- package/dist/fields/ImageField/MediaPicker/externalImage.d.ts +2 -1
- package/dist/fields/LinkField/Documents/DocumentsModal.d.ts +2 -0
- package/dist/fields/LinkField/Documents/documentsData.d.ts +20 -20
- package/dist/fields/LinkField/Documents/filterData.d.ts +2 -0
- package/dist/fields/LinkField/LinkFieldActions.d.ts +2 -0
- package/dist/fields/LinkField/useLinkField.d.ts +8 -5
- package/dist/fields/RichTextField/BubbleMenu/BubbleMenu.d.ts +7 -0
- package/dist/fields/RichTextField/BubbleMenu/ExtraItems.d.ts +8 -0
- package/dist/fields/RichTextField/BubbleMenu/LinkItems.d.ts +6 -0
- package/dist/fields/RichTextField/BubbleMenu/MarkItems.d.ts +8 -0
- package/dist/fields/RichTextField/BubbleMenu/NodeItems.d.ts +8 -0
- package/dist/fields/RichTextField/BubbleMenu/index.d.ts +1 -0
- package/dist/fields/RichTextField/RichTextField.d.ts +1 -2
- package/dist/fields/RichTextField/coreExtensions/ListItem.d.ts +4 -4
- package/dist/fields/RichTextField/extensions/Bold/Bold.d.ts +3 -0
- package/dist/fields/RichTextField/extensions/BulletList/BulletList.d.ts +3 -0
- package/dist/fields/RichTextField/extensions/CodeBlock/CodeBlock.d.ts +3 -0
- package/dist/fields/RichTextField/extensions/Heading/Heading.d.ts +21 -0
- package/dist/fields/RichTextField/extensions/Image/ImageExtension.d.ts +10 -0
- package/dist/fields/RichTextField/extensions/Image/ImageView.d.ts +13 -0
- package/dist/fields/RichTextField/extensions/Italic/Italic.d.ts +3 -0
- package/dist/fields/RichTextField/extensions/Link/Link.d.ts +44 -0
- package/dist/fields/RichTextField/extensions/Link.d.ts +1 -43
- package/dist/fields/RichTextField/extensions/OrderedList/OrderedList.d.ts +3 -0
- package/dist/fields/RichTextField/extensions/Paragraph/Paragraph.d.ts +3 -0
- package/dist/fields/RichTextField/extensions/extensions.d.ts +16 -0
- package/dist/fields/RichTextField/extensions/index.d.ts +1 -14
- package/dist/fields/RichTextField/models/EditorExtension.d.ts +3 -1
- package/dist/fields/RichTextField/models/MenuItems.d.ts +5 -4
- package/dist/fields/RichTextField/models/RichTextConfig.d.ts +22 -6
- package/dist/fields/RichTextField/useEditor.d.ts +4 -0
- package/dist/fields/utils.d.ts +3 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +19195 -18048
- package/dist/index.umd.js +32 -32
- package/dist/zones/RepeatableZoneEditor.d.ts +3 -4
- package/package.json +5 -6
package/dist/EditorConfig.d.ts
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
unsplash: {
|
|
6
|
-
url: string;
|
|
7
|
-
};
|
|
8
|
-
assets?: {
|
|
9
|
-
url: string;
|
|
10
|
-
repository: string;
|
|
11
|
-
};
|
|
12
|
-
documents?: {
|
|
13
|
-
url: string;
|
|
14
|
-
};
|
|
1
|
+
export declare type EditorConfig = {
|
|
2
|
+
embedsUrl: string;
|
|
3
|
+
unsplashUrl: string;
|
|
15
4
|
env: Env;
|
|
5
|
+
} & OptionalConfigs;
|
|
6
|
+
declare type OptionalConfigs = SearchDocuments & MediaLibrary;
|
|
7
|
+
declare type MediaLibrary = {
|
|
8
|
+
mediaLibrary?: never;
|
|
9
|
+
} | {
|
|
10
|
+
mediaLibrary: true;
|
|
11
|
+
assetsUrl: string;
|
|
12
|
+
repository: string;
|
|
13
|
+
};
|
|
14
|
+
declare type SearchDocuments = {
|
|
15
|
+
searchDocuments?: never;
|
|
16
|
+
} | {
|
|
17
|
+
searchDocuments: true;
|
|
18
|
+
coreApiUrl: string;
|
|
19
|
+
customTypesApiUrl: string;
|
|
20
|
+
repository: string;
|
|
16
21
|
status: "published" | "release" | "archived" | "unclassified";
|
|
17
|
-
}
|
|
22
|
+
};
|
|
18
23
|
export declare type Env = "dev" | "stage" | "prod";
|
|
19
24
|
export declare const EditorConfigContext: import("react").Context<EditorConfig | undefined>;
|
|
20
25
|
export declare function useEditorConfig(): EditorConfig;
|
|
26
|
+
export declare function throwConfigError(configKey: string): never;
|
|
27
|
+
export declare function suppressConfigErrors(): void;
|
|
28
|
+
export {};
|
|
@@ -8,8 +8,4 @@ interface Props {
|
|
|
8
8
|
onContentChange: (content?: EmbedContent) => void;
|
|
9
9
|
}
|
|
10
10
|
export declare function EmbedField(props: Props): JSX.Element;
|
|
11
|
-
interface FooterProps extends Pick<Props, "content" | "onContentChange"> {
|
|
12
|
-
debouncedUrl: string;
|
|
13
|
-
}
|
|
14
|
-
export declare function Footer(props: FooterProps): JSX.Element;
|
|
15
11
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EmbedContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
interface FooterProps {
|
|
3
|
+
debouncedUrl: string;
|
|
4
|
+
content?: EmbedContent;
|
|
5
|
+
onContentChange: (content?: EmbedContent) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function Footer(props: FooterProps): JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { GeoPointContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import type { GeoPoint } from "@prismicio/types-internal/lib/customtypes";
|
|
3
|
+
interface GeoPointFieldProps extends useGeoPointFieldProps {
|
|
4
|
+
field: GeoPoint;
|
|
5
|
+
id: string;
|
|
6
|
+
readOnly: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function GeoPointField(props: GeoPointFieldProps): JSX.Element;
|
|
9
|
+
interface useGeoPointFieldProps {
|
|
10
|
+
content: GeoPointContent | undefined;
|
|
11
|
+
onContentChange: (content?: GeoPointContent) => void;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { GeoPointContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
declare type Coordinates = GeoPointContent["position"];
|
|
3
|
+
export declare function parseGoogleMapsUrl(url: string): Coordinates | undefined;
|
|
4
|
+
export declare function coordinatesToString(coordinates?: Coordinates): string;
|
|
5
|
+
export declare function parseString(str: string): Coordinates | undefined;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GeoPointField } from "./GeoPointField";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ImageContentView } from "@prismicio/types-internal/lib/content";
|
|
2
|
-
import * as React from "react";
|
|
3
2
|
import type { getImageLabel, Thumbnail } from "../imageFieldUtils";
|
|
4
3
|
import { type CroppedImage } from "./croppedImage";
|
|
5
4
|
export declare type CroppedImages = Record<string, CroppedImage>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ExternalImage } from "./MediaPicker/externalImage";
|
|
2
|
+
interface EmptyCardContentProps {
|
|
3
|
+
isUpdating: boolean;
|
|
4
|
+
readOnly: boolean;
|
|
5
|
+
onMediaSelected: (media: ExternalImage) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function EmptyCardContent(props: EmptyCardContentProps): JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ImageContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import type { ExternalImage } from "./MediaPicker/externalImage";
|
|
4
|
+
interface ImageFieldCardProps {
|
|
5
|
+
content: ImageContent | undefined;
|
|
6
|
+
onContentChange: (content: ImageContent | undefined) => void;
|
|
7
|
+
fieldLabel: string;
|
|
8
|
+
readOnly: boolean;
|
|
9
|
+
imageLabel: string[];
|
|
10
|
+
setPage?: (page: number) => void;
|
|
11
|
+
onMediaSelected: (media: ExternalImage) => void;
|
|
12
|
+
cropper?: ReactNode;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare function ImageFieldCard(props: ImageFieldCardProps): JSX.Element;
|
|
16
|
+
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
|
-
id: string;
|
|
13
12
|
url: string;
|
|
13
|
+
id: 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
|
-
id: string;
|
|
22
21
|
url: string;
|
|
22
|
+
id: 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
|
-
id: string;
|
|
44
43
|
url: string;
|
|
44
|
+
id: 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
|
-
id: string;
|
|
53
52
|
url: string;
|
|
53
|
+
id: 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
|
-
id: string;
|
|
65
64
|
url: string;
|
|
65
|
+
id: 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
|
-
id: string;
|
|
78
77
|
url: string;
|
|
78
|
+
id: 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
|
-
id: string;
|
|
93
92
|
url: string;
|
|
93
|
+
id: 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
|
-
id: string;
|
|
107
106
|
url: string;
|
|
107
|
+
id: string;
|
|
108
108
|
kind: string;
|
|
109
109
|
extension: string;
|
|
110
110
|
filename: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ImageContent } from "@prismicio/types-internal/lib/content";
|
|
1
|
+
import type { ImageContent, ImageContentView } from "@prismicio/types-internal/lib/content";
|
|
2
2
|
import type { Image, ImageConstraint } from "@prismicio/types-internal/lib/customtypes";
|
|
3
3
|
export interface ExternalImage {
|
|
4
4
|
id: string;
|
|
@@ -7,6 +7,7 @@ export interface ExternalImage {
|
|
|
7
7
|
height: number;
|
|
8
8
|
}
|
|
9
9
|
export declare function replaceImage(thumbnailName: string, field: Image, content: ImageContent | undefined, extImage: ExternalImage): ImageContent;
|
|
10
|
+
export declare function createContentView(extImage: ExternalImage, constraints?: ImageConstraint): ImageContentView;
|
|
10
11
|
export declare function fitImage(extImage: {
|
|
11
12
|
width: number;
|
|
12
13
|
height: number;
|
|
@@ -2,6 +2,8 @@ interface DocumentsModalProps {
|
|
|
2
2
|
open: boolean;
|
|
3
3
|
onOpenChange: (open: boolean) => void;
|
|
4
4
|
onSelectDocument: (documentID: string) => void;
|
|
5
|
+
fixedCustomTypes?: Set<string>;
|
|
6
|
+
fixedTags?: Set<string>;
|
|
5
7
|
}
|
|
6
8
|
export declare function DocumentsModal(props: DocumentsModalProps): JSX.Element;
|
|
7
9
|
export {};
|
|
@@ -5,8 +5,8 @@ export declare function useDocuments(params: {
|
|
|
5
5
|
typesFilter: string[];
|
|
6
6
|
}): {
|
|
7
7
|
documents: {
|
|
8
|
-
id: string;
|
|
9
8
|
title: string;
|
|
9
|
+
id: 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
|
-
tags: string[];
|
|
22
21
|
version_id: string;
|
|
22
|
+
tags: string[];
|
|
23
23
|
custom_type_label: string;
|
|
24
24
|
preview_summary?: string | undefined;
|
|
25
25
|
preview_image?: string | undefined;
|
|
@@ -28,8 +28,8 @@ export declare function useDocuments(params: {
|
|
|
28
28
|
onHasReachedBottom: () => void;
|
|
29
29
|
response: {
|
|
30
30
|
results: {
|
|
31
|
-
id: string;
|
|
32
31
|
title: string;
|
|
32
|
+
id: string;
|
|
33
33
|
custom_type_id: string;
|
|
34
34
|
versions: (({
|
|
35
35
|
status: "unclassified";
|
|
@@ -41,8 +41,8 @@ export declare function useDocuments(params: {
|
|
|
41
41
|
} | {
|
|
42
42
|
status: "archived";
|
|
43
43
|
}) & {
|
|
44
|
-
tags: string[];
|
|
45
44
|
version_id: string;
|
|
45
|
+
tags: string[];
|
|
46
46
|
custom_type_label: string;
|
|
47
47
|
preview_summary?: string | undefined;
|
|
48
48
|
preview_image?: string | undefined;
|
|
@@ -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
|
-
tags: string[];
|
|
94
93
|
version_id: string;
|
|
94
|
+
tags: string[];
|
|
95
95
|
custom_type_label: string;
|
|
96
96
|
preview_summary?: string | undefined;
|
|
97
97
|
preview_image?: string | undefined;
|
|
98
98
|
}, {
|
|
99
|
-
tags: string[];
|
|
100
99
|
version_id: string;
|
|
100
|
+
tags: 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
|
-
id: string;
|
|
107
106
|
title: string;
|
|
107
|
+
id: 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
|
-
tags: string[];
|
|
120
119
|
version_id: string;
|
|
120
|
+
tags: string[];
|
|
121
121
|
custom_type_label: string;
|
|
122
122
|
preview_summary?: string | undefined;
|
|
123
123
|
preview_image?: string | undefined;
|
|
124
124
|
})[];
|
|
125
125
|
}, {
|
|
126
|
-
id: string;
|
|
127
126
|
title: string;
|
|
127
|
+
id: 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
|
-
tags: string[];
|
|
140
139
|
version_id: string;
|
|
140
|
+
tags: 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
|
-
tags: string[];
|
|
188
187
|
version_id: string;
|
|
188
|
+
tags: string[];
|
|
189
189
|
custom_type_label: string;
|
|
190
190
|
preview_summary?: string | undefined;
|
|
191
191
|
preview_image?: string | undefined;
|
|
192
192
|
}, {
|
|
193
|
-
tags: string[];
|
|
194
193
|
version_id: string;
|
|
194
|
+
tags: 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
|
-
id: string;
|
|
201
200
|
title: string;
|
|
201
|
+
id: 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
|
-
tags: string[];
|
|
214
213
|
version_id: string;
|
|
214
|
+
tags: string[];
|
|
215
215
|
custom_type_label: string;
|
|
216
216
|
preview_summary?: string | undefined;
|
|
217
217
|
preview_image?: string | undefined;
|
|
218
218
|
})[];
|
|
219
219
|
}, {
|
|
220
|
-
id: string;
|
|
221
220
|
title: string;
|
|
221
|
+
id: string;
|
|
222
222
|
custom_type_id: string;
|
|
223
223
|
versions: (({
|
|
224
224
|
status: "unclassified";
|
|
@@ -230,8 +230,8 @@ declare const documentsSearchAPISchemaOkType: import("zod").ZodObject<{
|
|
|
230
230
|
} | {
|
|
231
231
|
status: "archived";
|
|
232
232
|
}) & {
|
|
233
|
-
tags: string[];
|
|
234
233
|
version_id: string;
|
|
234
|
+
tags: string[];
|
|
235
235
|
custom_type_label: string;
|
|
236
236
|
preview_summary?: string | undefined;
|
|
237
237
|
preview_image?: string | undefined;
|
|
@@ -239,8 +239,8 @@ declare const documentsSearchAPISchemaOkType: import("zod").ZodObject<{
|
|
|
239
239
|
}>, "many">;
|
|
240
240
|
}, "strip", import("zod").ZodTypeAny, {
|
|
241
241
|
results: {
|
|
242
|
-
id: string;
|
|
243
242
|
title: string;
|
|
243
|
+
id: string;
|
|
244
244
|
custom_type_id: string;
|
|
245
245
|
versions: (({
|
|
246
246
|
status: "unclassified";
|
|
@@ -252,8 +252,8 @@ declare const documentsSearchAPISchemaOkType: import("zod").ZodObject<{
|
|
|
252
252
|
} | {
|
|
253
253
|
status: "archived";
|
|
254
254
|
}) & {
|
|
255
|
-
tags: string[];
|
|
256
255
|
version_id: string;
|
|
256
|
+
tags: string[];
|
|
257
257
|
custom_type_label: string;
|
|
258
258
|
preview_summary?: string | undefined;
|
|
259
259
|
preview_image?: string | undefined;
|
|
@@ -263,8 +263,8 @@ declare const documentsSearchAPISchemaOkType: import("zod").ZodObject<{
|
|
|
263
263
|
cursor?: string | undefined;
|
|
264
264
|
}, {
|
|
265
265
|
results: {
|
|
266
|
-
id: string;
|
|
267
266
|
title: string;
|
|
267
|
+
id: string;
|
|
268
268
|
custom_type_id: string;
|
|
269
269
|
versions: (({
|
|
270
270
|
status: "unclassified";
|
|
@@ -276,8 +276,8 @@ declare const documentsSearchAPISchemaOkType: import("zod").ZodObject<{
|
|
|
276
276
|
} | {
|
|
277
277
|
status: "archived";
|
|
278
278
|
}) & {
|
|
279
|
-
tags: string[];
|
|
280
279
|
version_id: string;
|
|
280
|
+
tags: string[];
|
|
281
281
|
custom_type_label: string;
|
|
282
282
|
preview_summary?: string | undefined;
|
|
283
283
|
preview_image?: string | undefined;
|
|
@@ -5,6 +5,8 @@ interface Props {
|
|
|
5
5
|
selectedType?: FieldSelectTypes;
|
|
6
6
|
selectEnabled: boolean;
|
|
7
7
|
onValueChange: (newValue: FieldSelectTypes) => void;
|
|
8
|
+
openInNewTab?: boolean;
|
|
9
|
+
setOpenInNewTab?: (open: boolean) => void;
|
|
8
10
|
}
|
|
9
11
|
export declare function LinkFieldActions(props: Props): JSX.Element;
|
|
10
12
|
export {};
|
|
@@ -4,11 +4,12 @@ import type { Link } from "@prismicio/types-internal/lib/customtypes";
|
|
|
4
4
|
import { TypeOf } from "zod";
|
|
5
5
|
import { Env } from "../../EditorConfig";
|
|
6
6
|
import type { FieldSelectTypes } from "./LinkFieldActions";
|
|
7
|
-
|
|
7
|
+
interface useLinkFieldParams {
|
|
8
8
|
field: Link;
|
|
9
9
|
content: LinkContent | undefined;
|
|
10
10
|
onContentChange: (content: LinkContent | undefined) => void;
|
|
11
|
-
}
|
|
11
|
+
}
|
|
12
|
+
export declare function useLinkField(params: useLinkFieldParams): {
|
|
12
13
|
contentType: "ImageLink" | "FileLink" | "DocumentLink" | "ExternalLink" | undefined;
|
|
13
14
|
selectType: "document" | "media" | "web" | undefined;
|
|
14
15
|
isUnsupportedField: boolean | undefined;
|
|
@@ -20,18 +21,20 @@ export declare function useLinkField(params: {
|
|
|
20
21
|
onDocumentSelected: (documentId: string) => void;
|
|
21
22
|
onError: () => void;
|
|
22
23
|
errorBoundaryRef: import("react").RefObject<ErrorBoundary>;
|
|
24
|
+
isTargetNewTab: boolean;
|
|
25
|
+
updateWebLinkTarget: (newTab: boolean) => void;
|
|
23
26
|
};
|
|
24
27
|
export declare function useDocumentTitle(id: string): string;
|
|
25
28
|
declare const documentMeta: import("zod").ZodObject<{
|
|
26
29
|
id: import("zod").ZodString;
|
|
27
30
|
title: import("zod").ZodString;
|
|
28
31
|
}, "strip", import("zod").ZodTypeAny, {
|
|
29
|
-
id: string;
|
|
30
32
|
title: string;
|
|
31
|
-
}, {
|
|
32
33
|
id: string;
|
|
34
|
+
}, {
|
|
33
35
|
title: string;
|
|
36
|
+
id: string;
|
|
34
37
|
}>;
|
|
35
38
|
export declare type DocumentMeta = TypeOf<typeof documentMeta>;
|
|
36
|
-
export declare function getDocumentTitleRequest(baseUrl: string
|
|
39
|
+
export declare function getDocumentTitleRequest(baseUrl: string, env: Env, id: string): Promise<DocumentMeta>;
|
|
37
40
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/core";
|
|
2
|
+
import type { MenuItem } from "../models/MenuItems";
|
|
3
|
+
interface ExtraItemsProps {
|
|
4
|
+
items: MenuItem[];
|
|
5
|
+
editor: Editor;
|
|
6
|
+
}
|
|
7
|
+
export declare function ExtraItems(props: ExtraItemsProps): JSX.Element | null;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BubbleMenu } from "./BubbleMenu";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { RichTextContent } from "@prismicio/types-internal/lib/content";
|
|
2
2
|
import type { RichText } from "@prismicio/types-internal/lib/customtypes";
|
|
3
|
-
import { type FC } from "react";
|
|
4
3
|
interface RichTextFieldProps {
|
|
5
4
|
content: RichTextContent | undefined;
|
|
6
5
|
field: RichText;
|
|
@@ -8,5 +7,5 @@ interface RichTextFieldProps {
|
|
|
8
7
|
onContentChange: (content: RichTextContent | undefined) => void;
|
|
9
8
|
readOnly: boolean;
|
|
10
9
|
}
|
|
11
|
-
export declare
|
|
10
|
+
export declare function RichTextField(props: RichTextFieldProps): JSX.Element;
|
|
12
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" | "
|
|
7
|
+
type: "em" | "embed" | "strong" | "image" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "paragraph" | "preformatted" | "hyperlink" | "rtl" | "list-item" | "o-list-item";
|
|
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: "
|
|
16
|
+
type: "em" | "embed" | "label" | "strong" | "image" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "paragraph" | "preformatted" | "hyperlink" | "rtl" | "list-item" | "o-list-item";
|
|
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" | "
|
|
24
|
+
type: "em" | "embed" | "strong" | "image" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "paragraph" | "preformatted" | "hyperlink" | "rtl" | "list-item" | "o-list-item";
|
|
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: "
|
|
33
|
+
type: "em" | "embed" | "label" | "strong" | "image" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "paragraph" | "preformatted" | "hyperlink" | "rtl" | "list-item" | "o-list-item";
|
|
34
34
|
})[] | undefined;
|
|
35
35
|
};
|
|
36
36
|
} & {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RichTextNodeType } from "@prismicio/types-internal/lib/customtypes";
|
|
2
|
+
import { type Level as TTLevel } from "@tiptap/extension-heading";
|
|
3
|
+
import { type ReadonlyNonEmptyArray } from "fp-ts/ReadonlyNonEmptyArray";
|
|
4
|
+
import type { Node as ProsemirrorNode } from "prosemirror-model";
|
|
5
|
+
import { HeadingTextExtension } from "../../models";
|
|
6
|
+
export declare type Level = TTLevel;
|
|
7
|
+
interface HeadingName {
|
|
8
|
+
fullName: RichTextNodeType;
|
|
9
|
+
level: Level;
|
|
10
|
+
}
|
|
11
|
+
export declare const HeadingName: {
|
|
12
|
+
byLevel(level: Level): RichTextNodeType;
|
|
13
|
+
default(level: Level): HeadingName;
|
|
14
|
+
fromPrismic(headingName: string, levels?: ReadonlyNonEmptyArray<Level>): HeadingName | undefined;
|
|
15
|
+
fromProsemirror(nodeAttributes: ProsemirrorNode["attrs"], levels: ReadonlyNonEmptyArray<Level>): HeadingName | undefined;
|
|
16
|
+
};
|
|
17
|
+
declare const _default: {
|
|
18
|
+
name: string;
|
|
19
|
+
build: (nodeTypes?: Set<RichTextNodeType>) => HeadingTextExtension | undefined;
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ImageContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import type { Node as ProseMirrorNode } from "@tiptap/pm/model";
|
|
3
|
+
import { NodeViewProps } from "@tiptap/react";
|
|
4
|
+
interface ImageNode extends ProseMirrorNode {
|
|
5
|
+
attrs: {
|
|
6
|
+
content: ImageContent | undefined;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export interface ImageViewProps extends NodeViewProps {
|
|
10
|
+
node: ImageNode;
|
|
11
|
+
}
|
|
12
|
+
export declare function ImageView(props: ImageViewProps): JSX.Element;
|
|
13
|
+
export {};
|