@prismicio/editor-fields 0.4.4 → 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 +26 -13
- 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/MediaLibrary.d.ts +0 -5
- package/dist/fields/ImageField/MediaPicker/MediaLibrary/mediaLibraryData.d.ts +9 -15
- package/dist/fields/ImageField/MediaPicker/externalImage.d.ts +2 -1
- package/dist/fields/ImageField/MediaPicker/mediaPickerData.d.ts +1 -5
- package/dist/fields/LinkField/Documents/DocumentsModal.d.ts +9 -0
- package/dist/fields/LinkField/Documents/documentsData.d.ts +291 -0
- 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 +27 -4
- 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/Embed/EmbedExtension.d.ts +10 -0
- package/dist/fields/RichTextField/extensions/Embed/EmbedView.d.ts +13 -3
- package/dist/fields/RichTextField/extensions/Embed/useEmbedView.d.ts +12 -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 +20226 -18385
- package/dist/index.umd.js +40 -39
- package/dist/zones/RepeatableZoneEditor.d.ts +3 -4
- package/package.json +5 -6
package/dist/EditorConfig.d.ts
CHANGED
|
@@ -1,15 +1,28 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
1
|
+
export declare type EditorConfig = {
|
|
2
|
+
embedsUrl: string;
|
|
3
|
+
unsplashUrl: string;
|
|
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;
|
|
21
|
+
status: "published" | "release" | "archived" | "unclassified";
|
|
22
|
+
};
|
|
23
|
+
export declare type Env = "dev" | "stage" | "prod";
|
|
14
24
|
export declare const EditorConfigContext: import("react").Context<EditorConfig | undefined>;
|
|
15
25
|
export declare function useEditorConfig(): EditorConfig;
|
|
26
|
+
export declare function throwConfigError(configKey: string): never;
|
|
27
|
+
export declare function suppressConfigErrors(): void;
|
|
28
|
+
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 {};
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import type { ExternalImage } from "../externalImage";
|
|
2
2
|
import type { UploadFile } from "../mediaPickerData";
|
|
3
3
|
interface MediaLibraryProps {
|
|
4
|
-
assets: {
|
|
5
|
-
url: string;
|
|
6
|
-
dev: boolean;
|
|
7
|
-
repository: string;
|
|
8
|
-
};
|
|
9
4
|
uploadingFiles: UploadFile[];
|
|
10
5
|
onFilesSelected: (uploadingFiles: File[]) => void;
|
|
11
6
|
onSuccessFiles: () => void;
|
|
@@ -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;
|
|
@@ -87,15 +87,10 @@ export declare const mediaLibrarySearchAPISchemaOkType: import("zod").ZodObject<
|
|
|
87
87
|
}>;
|
|
88
88
|
export declare type MediaLibrarySearchApi = TypeOf<typeof mediaLibrarySearchAPISchemaOkType>;
|
|
89
89
|
export declare type MediaLibraryImage = TypeOf<typeof mediaLibraryImageOkType>;
|
|
90
|
-
|
|
91
|
-
url: string;
|
|
92
|
-
repository: string;
|
|
93
|
-
dev: boolean;
|
|
94
|
-
}
|
|
95
|
-
export declare function useMediaLibrarySearch(props: MediaLibrarySearchProps): {
|
|
90
|
+
export declare function useMediaLibrarySearch(): {
|
|
96
91
|
media: {
|
|
97
|
-
id: string;
|
|
98
92
|
url: string;
|
|
93
|
+
id: string;
|
|
99
94
|
kind: string;
|
|
100
95
|
extension: string;
|
|
101
96
|
filename: string;
|
|
@@ -108,8 +103,8 @@ export declare function useMediaLibrarySearch(props: MediaLibrarySearchProps): {
|
|
|
108
103
|
response: {
|
|
109
104
|
total: number;
|
|
110
105
|
items: {
|
|
111
|
-
id: string;
|
|
112
106
|
url: string;
|
|
107
|
+
id: string;
|
|
113
108
|
kind: string;
|
|
114
109
|
extension: string;
|
|
115
110
|
filename: string;
|
|
@@ -121,4 +116,3 @@ export declare function useMediaLibrarySearch(props: MediaLibrarySearchProps): {
|
|
|
121
116
|
};
|
|
122
117
|
updateMedia: (newFiles: MediaLibraryImage[]) => void;
|
|
123
118
|
};
|
|
124
|
-
export {};
|
|
@@ -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;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { EditorConfig } from "../../../EditorConfig";
|
|
2
1
|
import { MediaLibraryImage } from "./MediaLibrary/mediaLibraryData";
|
|
3
2
|
export declare type UploadFile = UploadFileLoading | UploadFileSuccess;
|
|
4
3
|
interface UploadFileLoading {
|
|
@@ -13,10 +12,7 @@ export interface UploadFileSuccess {
|
|
|
13
12
|
status: "success";
|
|
14
13
|
response: MediaLibraryImage;
|
|
15
14
|
}
|
|
16
|
-
|
|
17
|
-
config: EditorConfig;
|
|
18
|
-
}
|
|
19
|
-
export declare function useMediaLibraryUpload(props: useMediaLibraryUploadProps): {
|
|
15
|
+
export declare function useMediaLibraryUpload(): {
|
|
20
16
|
onFilesSelected: (selectedFiles: File[]) => void;
|
|
21
17
|
uploadingFiles: UploadFile[];
|
|
22
18
|
onSuccessFiles: () => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface DocumentsModalProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
onOpenChange: (open: boolean) => void;
|
|
4
|
+
onSelectDocument: (documentID: string) => void;
|
|
5
|
+
fixedCustomTypes?: Set<string>;
|
|
6
|
+
fixedTags?: Set<string>;
|
|
7
|
+
}
|
|
8
|
+
export declare function DocumentsModal(props: DocumentsModalProps): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { TypeOf } from "zod";
|
|
2
|
+
export declare function useDocuments(params: {
|
|
3
|
+
searchTerm: string;
|
|
4
|
+
tagsFilter: string[];
|
|
5
|
+
typesFilter: string[];
|
|
6
|
+
}): {
|
|
7
|
+
documents: {
|
|
8
|
+
title: string;
|
|
9
|
+
id: string;
|
|
10
|
+
custom_type_id: string;
|
|
11
|
+
versions: (({
|
|
12
|
+
status: "unclassified";
|
|
13
|
+
} | {
|
|
14
|
+
status: "published";
|
|
15
|
+
} | {
|
|
16
|
+
status: "release";
|
|
17
|
+
release_id: string;
|
|
18
|
+
} | {
|
|
19
|
+
status: "archived";
|
|
20
|
+
}) & {
|
|
21
|
+
version_id: string;
|
|
22
|
+
tags: string[];
|
|
23
|
+
custom_type_label: string;
|
|
24
|
+
preview_summary?: string | undefined;
|
|
25
|
+
preview_image?: string | undefined;
|
|
26
|
+
})[];
|
|
27
|
+
}[];
|
|
28
|
+
onHasReachedBottom: () => void;
|
|
29
|
+
response: {
|
|
30
|
+
results: {
|
|
31
|
+
title: string;
|
|
32
|
+
id: string;
|
|
33
|
+
custom_type_id: string;
|
|
34
|
+
versions: (({
|
|
35
|
+
status: "unclassified";
|
|
36
|
+
} | {
|
|
37
|
+
status: "published";
|
|
38
|
+
} | {
|
|
39
|
+
status: "release";
|
|
40
|
+
release_id: string;
|
|
41
|
+
} | {
|
|
42
|
+
status: "archived";
|
|
43
|
+
}) & {
|
|
44
|
+
version_id: string;
|
|
45
|
+
tags: string[];
|
|
46
|
+
custom_type_label: string;
|
|
47
|
+
preview_summary?: string | undefined;
|
|
48
|
+
preview_image?: string | undefined;
|
|
49
|
+
})[];
|
|
50
|
+
}[];
|
|
51
|
+
total: number;
|
|
52
|
+
cursor?: string | undefined;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
declare const documentsSearchOkType: import("zod").ZodObject<{
|
|
56
|
+
id: import("zod").ZodString;
|
|
57
|
+
custom_type_id: import("zod").ZodString;
|
|
58
|
+
title: import("zod").ZodString;
|
|
59
|
+
versions: import("zod").ZodArray<import("zod").ZodIntersection<import("zod").ZodDiscriminatedUnion<"status", [import("zod").ZodObject<{
|
|
60
|
+
status: import("zod").ZodLiteral<"unclassified">;
|
|
61
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
62
|
+
status: "unclassified";
|
|
63
|
+
}, {
|
|
64
|
+
status: "unclassified";
|
|
65
|
+
}>, import("zod").ZodObject<{
|
|
66
|
+
status: import("zod").ZodLiteral<"published">;
|
|
67
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
68
|
+
status: "published";
|
|
69
|
+
}, {
|
|
70
|
+
status: "published";
|
|
71
|
+
}>, import("zod").ZodObject<{
|
|
72
|
+
status: import("zod").ZodLiteral<"release">;
|
|
73
|
+
release_id: import("zod").ZodString;
|
|
74
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
75
|
+
status: "release";
|
|
76
|
+
release_id: string;
|
|
77
|
+
}, {
|
|
78
|
+
status: "release";
|
|
79
|
+
release_id: string;
|
|
80
|
+
}>, import("zod").ZodObject<{
|
|
81
|
+
status: import("zod").ZodLiteral<"archived">;
|
|
82
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
83
|
+
status: "archived";
|
|
84
|
+
}, {
|
|
85
|
+
status: "archived";
|
|
86
|
+
}>]>, import("zod").ZodObject<{
|
|
87
|
+
version_id: import("zod").ZodString;
|
|
88
|
+
tags: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
89
|
+
custom_type_label: import("zod").ZodString;
|
|
90
|
+
preview_summary: import("zod").ZodOptional<import("zod").ZodString>;
|
|
91
|
+
preview_image: import("zod").ZodOptional<import("zod").ZodString>;
|
|
92
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
93
|
+
version_id: string;
|
|
94
|
+
tags: string[];
|
|
95
|
+
custom_type_label: string;
|
|
96
|
+
preview_summary?: string | undefined;
|
|
97
|
+
preview_image?: string | undefined;
|
|
98
|
+
}, {
|
|
99
|
+
version_id: string;
|
|
100
|
+
tags: string[];
|
|
101
|
+
custom_type_label: string;
|
|
102
|
+
preview_summary?: string | undefined;
|
|
103
|
+
preview_image?: string | undefined;
|
|
104
|
+
}>>, "many">;
|
|
105
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
106
|
+
title: string;
|
|
107
|
+
id: string;
|
|
108
|
+
custom_type_id: string;
|
|
109
|
+
versions: (({
|
|
110
|
+
status: "unclassified";
|
|
111
|
+
} | {
|
|
112
|
+
status: "published";
|
|
113
|
+
} | {
|
|
114
|
+
status: "release";
|
|
115
|
+
release_id: string;
|
|
116
|
+
} | {
|
|
117
|
+
status: "archived";
|
|
118
|
+
}) & {
|
|
119
|
+
version_id: string;
|
|
120
|
+
tags: string[];
|
|
121
|
+
custom_type_label: string;
|
|
122
|
+
preview_summary?: string | undefined;
|
|
123
|
+
preview_image?: string | undefined;
|
|
124
|
+
})[];
|
|
125
|
+
}, {
|
|
126
|
+
title: string;
|
|
127
|
+
id: string;
|
|
128
|
+
custom_type_id: string;
|
|
129
|
+
versions: (({
|
|
130
|
+
status: "unclassified";
|
|
131
|
+
} | {
|
|
132
|
+
status: "published";
|
|
133
|
+
} | {
|
|
134
|
+
status: "release";
|
|
135
|
+
release_id: string;
|
|
136
|
+
} | {
|
|
137
|
+
status: "archived";
|
|
138
|
+
}) & {
|
|
139
|
+
version_id: string;
|
|
140
|
+
tags: string[];
|
|
141
|
+
custom_type_label: string;
|
|
142
|
+
preview_summary?: string | undefined;
|
|
143
|
+
preview_image?: string | undefined;
|
|
144
|
+
})[];
|
|
145
|
+
}>;
|
|
146
|
+
declare const documentsSearchAPISchemaOkType: import("zod").ZodObject<{
|
|
147
|
+
total: import("zod").ZodNumber;
|
|
148
|
+
cursor: import("zod").ZodOptional<import("zod").ZodString>;
|
|
149
|
+
results: import("zod").ZodArray<import("zod").ZodObject<{
|
|
150
|
+
id: import("zod").ZodString;
|
|
151
|
+
custom_type_id: import("zod").ZodString;
|
|
152
|
+
title: import("zod").ZodString;
|
|
153
|
+
versions: import("zod").ZodArray<import("zod").ZodIntersection<import("zod").ZodDiscriminatedUnion<"status", [import("zod").ZodObject<{
|
|
154
|
+
status: import("zod").ZodLiteral<"unclassified">;
|
|
155
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
156
|
+
status: "unclassified";
|
|
157
|
+
}, {
|
|
158
|
+
status: "unclassified";
|
|
159
|
+
}>, import("zod").ZodObject<{
|
|
160
|
+
status: import("zod").ZodLiteral<"published">;
|
|
161
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
162
|
+
status: "published";
|
|
163
|
+
}, {
|
|
164
|
+
status: "published";
|
|
165
|
+
}>, import("zod").ZodObject<{
|
|
166
|
+
status: import("zod").ZodLiteral<"release">;
|
|
167
|
+
release_id: import("zod").ZodString;
|
|
168
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
169
|
+
status: "release";
|
|
170
|
+
release_id: string;
|
|
171
|
+
}, {
|
|
172
|
+
status: "release";
|
|
173
|
+
release_id: string;
|
|
174
|
+
}>, import("zod").ZodObject<{
|
|
175
|
+
status: import("zod").ZodLiteral<"archived">;
|
|
176
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
177
|
+
status: "archived";
|
|
178
|
+
}, {
|
|
179
|
+
status: "archived";
|
|
180
|
+
}>]>, import("zod").ZodObject<{
|
|
181
|
+
version_id: import("zod").ZodString;
|
|
182
|
+
tags: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
183
|
+
custom_type_label: import("zod").ZodString;
|
|
184
|
+
preview_summary: import("zod").ZodOptional<import("zod").ZodString>;
|
|
185
|
+
preview_image: import("zod").ZodOptional<import("zod").ZodString>;
|
|
186
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
187
|
+
version_id: string;
|
|
188
|
+
tags: string[];
|
|
189
|
+
custom_type_label: string;
|
|
190
|
+
preview_summary?: string | undefined;
|
|
191
|
+
preview_image?: string | undefined;
|
|
192
|
+
}, {
|
|
193
|
+
version_id: string;
|
|
194
|
+
tags: string[];
|
|
195
|
+
custom_type_label: string;
|
|
196
|
+
preview_summary?: string | undefined;
|
|
197
|
+
preview_image?: string | undefined;
|
|
198
|
+
}>>, "many">;
|
|
199
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
200
|
+
title: string;
|
|
201
|
+
id: string;
|
|
202
|
+
custom_type_id: string;
|
|
203
|
+
versions: (({
|
|
204
|
+
status: "unclassified";
|
|
205
|
+
} | {
|
|
206
|
+
status: "published";
|
|
207
|
+
} | {
|
|
208
|
+
status: "release";
|
|
209
|
+
release_id: string;
|
|
210
|
+
} | {
|
|
211
|
+
status: "archived";
|
|
212
|
+
}) & {
|
|
213
|
+
version_id: string;
|
|
214
|
+
tags: string[];
|
|
215
|
+
custom_type_label: string;
|
|
216
|
+
preview_summary?: string | undefined;
|
|
217
|
+
preview_image?: string | undefined;
|
|
218
|
+
})[];
|
|
219
|
+
}, {
|
|
220
|
+
title: string;
|
|
221
|
+
id: string;
|
|
222
|
+
custom_type_id: string;
|
|
223
|
+
versions: (({
|
|
224
|
+
status: "unclassified";
|
|
225
|
+
} | {
|
|
226
|
+
status: "published";
|
|
227
|
+
} | {
|
|
228
|
+
status: "release";
|
|
229
|
+
release_id: string;
|
|
230
|
+
} | {
|
|
231
|
+
status: "archived";
|
|
232
|
+
}) & {
|
|
233
|
+
version_id: string;
|
|
234
|
+
tags: string[];
|
|
235
|
+
custom_type_label: string;
|
|
236
|
+
preview_summary?: string | undefined;
|
|
237
|
+
preview_image?: string | undefined;
|
|
238
|
+
})[];
|
|
239
|
+
}>, "many">;
|
|
240
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
241
|
+
results: {
|
|
242
|
+
title: string;
|
|
243
|
+
id: string;
|
|
244
|
+
custom_type_id: string;
|
|
245
|
+
versions: (({
|
|
246
|
+
status: "unclassified";
|
|
247
|
+
} | {
|
|
248
|
+
status: "published";
|
|
249
|
+
} | {
|
|
250
|
+
status: "release";
|
|
251
|
+
release_id: string;
|
|
252
|
+
} | {
|
|
253
|
+
status: "archived";
|
|
254
|
+
}) & {
|
|
255
|
+
version_id: string;
|
|
256
|
+
tags: string[];
|
|
257
|
+
custom_type_label: string;
|
|
258
|
+
preview_summary?: string | undefined;
|
|
259
|
+
preview_image?: string | undefined;
|
|
260
|
+
})[];
|
|
261
|
+
}[];
|
|
262
|
+
total: number;
|
|
263
|
+
cursor?: string | undefined;
|
|
264
|
+
}, {
|
|
265
|
+
results: {
|
|
266
|
+
title: string;
|
|
267
|
+
id: string;
|
|
268
|
+
custom_type_id: string;
|
|
269
|
+
versions: (({
|
|
270
|
+
status: "unclassified";
|
|
271
|
+
} | {
|
|
272
|
+
status: "published";
|
|
273
|
+
} | {
|
|
274
|
+
status: "release";
|
|
275
|
+
release_id: string;
|
|
276
|
+
} | {
|
|
277
|
+
status: "archived";
|
|
278
|
+
}) & {
|
|
279
|
+
version_id: string;
|
|
280
|
+
tags: string[];
|
|
281
|
+
custom_type_label: string;
|
|
282
|
+
preview_summary?: string | undefined;
|
|
283
|
+
preview_image?: string | undefined;
|
|
284
|
+
})[];
|
|
285
|
+
}[];
|
|
286
|
+
total: number;
|
|
287
|
+
cursor?: string | undefined;
|
|
288
|
+
}>;
|
|
289
|
+
export declare type DocumentSearchApi = TypeOf<typeof documentsSearchAPISchemaOkType>;
|
|
290
|
+
export declare type Document = TypeOf<typeof documentsSearchOkType>;
|
|
291
|
+
export {};
|
|
@@ -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 {};
|
|
@@ -1,17 +1,40 @@
|
|
|
1
|
+
import type { ErrorBoundary } from "@prismicio/editor-ui";
|
|
1
2
|
import type { LinkContent } from "@prismicio/types-internal/lib/content";
|
|
2
3
|
import type { Link } from "@prismicio/types-internal/lib/customtypes";
|
|
4
|
+
import { TypeOf } from "zod";
|
|
5
|
+
import { Env } from "../../EditorConfig";
|
|
3
6
|
import type { FieldSelectTypes } from "./LinkFieldActions";
|
|
4
|
-
|
|
7
|
+
interface useLinkFieldParams {
|
|
5
8
|
field: Link;
|
|
6
9
|
content: LinkContent | undefined;
|
|
7
10
|
onContentChange: (content: LinkContent | undefined) => void;
|
|
8
|
-
}
|
|
9
|
-
|
|
11
|
+
}
|
|
12
|
+
export declare function useLinkField(params: useLinkFieldParams): {
|
|
13
|
+
contentType: "ImageLink" | "FileLink" | "DocumentLink" | "ExternalLink" | undefined;
|
|
10
14
|
selectType: "document" | "media" | "web" | undefined;
|
|
11
|
-
isUnsupportedField: boolean;
|
|
15
|
+
isUnsupportedField: boolean | undefined;
|
|
12
16
|
fieldValue: string;
|
|
13
17
|
onValueChange: (value: string) => void;
|
|
14
18
|
onTypeChange: (newValue: FieldSelectTypes) => void;
|
|
15
19
|
placeholder: string;
|
|
16
20
|
isTypeSelectEnabled: boolean;
|
|
21
|
+
onDocumentSelected: (documentId: string) => void;
|
|
22
|
+
onError: () => void;
|
|
23
|
+
errorBoundaryRef: import("react").RefObject<ErrorBoundary>;
|
|
24
|
+
isTargetNewTab: boolean;
|
|
25
|
+
updateWebLinkTarget: (newTab: boolean) => void;
|
|
17
26
|
};
|
|
27
|
+
export declare function useDocumentTitle(id: string): string;
|
|
28
|
+
declare const documentMeta: import("zod").ZodObject<{
|
|
29
|
+
id: import("zod").ZodString;
|
|
30
|
+
title: import("zod").ZodString;
|
|
31
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
32
|
+
title: string;
|
|
33
|
+
id: string;
|
|
34
|
+
}, {
|
|
35
|
+
title: string;
|
|
36
|
+
id: string;
|
|
37
|
+
}>;
|
|
38
|
+
export declare type DocumentMeta = TypeOf<typeof documentMeta>;
|
|
39
|
+
export declare function getDocumentTitleRequest(baseUrl: string, env: Env, id: string): Promise<DocumentMeta>;
|
|
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";
|