@prismicio/editor-fields 0.4.5 → 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.
- package/dist/EditorConfig.d.ts +23 -15
- package/dist/fields/BooleanField.d.ts +4 -5
- package/dist/fields/ColorField/ColorField.d.ts +3 -3
- package/dist/fields/DateField.d.ts +3 -3
- package/dist/fields/EmbedField/EmbedField.d.ts +0 -4
- package/dist/fields/EmbedField/EmbedFooter.d.ts +8 -0
- package/dist/fields/{GeoPointField.d.ts → GeoPointField/GeoPointField.d.ts} +5 -3
- package/dist/fields/GeoPointField/geoPointFieldUtils.d.ts +6 -0
- package/dist/fields/GeoPointField/index.d.ts +1 -0
- package/dist/fields/ImageField/Components/EmptyCardContent.d.ts +8 -0
- package/dist/fields/ImageField/Components/ImageAltControl.d.ts +8 -0
- package/dist/fields/ImageField/Components/ImageFieldCard.d.ts +23 -0
- package/dist/fields/ImageField/CropperDialog/CropperDialog.d.ts +2 -9
- package/dist/fields/ImageField/CropperDialog/croppedImage.d.ts +19 -1
- package/dist/fields/ImageField/ImageField.d.ts +1 -2
- package/dist/fields/ImageField/MediaPicker/externalImage.d.ts +2 -1
- package/dist/fields/ImageField/imageFieldUtils.d.ts +6 -0
- package/dist/fields/ImageField/useImageField.d.ts +101 -0
- package/dist/fields/LinkField/Documents/DocumentsModal.d.ts +2 -0
- package/dist/fields/LinkField/Documents/documentsData.d.ts +3 -3
- 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 +7 -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 +4 -5
- package/dist/fields/RichTextField/extensions/{Bold.d.ts → Bold/Bold.d.ts} +1 -1
- package/dist/fields/RichTextField/extensions/{BulletList.d.ts → BulletList/BulletList.d.ts} +1 -1
- package/dist/fields/RichTextField/extensions/{CodeBlock.d.ts → CodeBlock/CodeBlock.d.ts} +1 -1
- package/dist/fields/RichTextField/extensions/{Heading.d.ts → Heading/Heading.d.ts} +1 -1
- 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/Image/useImageView.d.ts +23 -0
- package/dist/fields/RichTextField/extensions/{Italic.d.ts → Italic/Italic.d.ts} +1 -1
- package/dist/fields/RichTextField/extensions/Link.d.ts +1 -43
- package/dist/fields/RichTextField/extensions/{OrderedList.d.ts → OrderedList/OrderedList.d.ts} +1 -1
- package/dist/fields/RichTextField/extensions/{Paragraph.d.ts → Paragraph/Paragraph.d.ts} +1 -1
- 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/SelectField.d.ts +3 -4
- package/dist/fields/TimestampField.d.ts +3 -3
- package/dist/fields/utils.d.ts +3 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +19724 -18536
- package/dist/zones/RepeatableZoneEditor.d.ts +3 -4
- package/package.json +5 -6
- package/dist/fields/RichTextField/BubbleMenu.d.ts +0 -8
- package/dist/fields/RichTextField/extensions/Embed/index.d.ts +0 -10
- package/dist/index.umd.js +0 -145
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 {};
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
9
|
+
}
|
|
10
|
+
export declare function DateField(props: Props): JSX.Element;
|
|
11
11
|
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 {};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { GeoPointContent } from "@prismicio/types-internal/lib/content";
|
|
2
2
|
import type { GeoPoint } from "@prismicio/types-internal/lib/customtypes";
|
|
3
|
-
interface GeoPointFieldProps {
|
|
4
|
-
content: GeoPointContent | undefined;
|
|
3
|
+
interface GeoPointFieldProps extends useGeoPointFieldProps {
|
|
5
4
|
field: GeoPoint;
|
|
6
5
|
id: string;
|
|
7
|
-
onContentChange: (content?: GeoPointContent) => void;
|
|
8
6
|
readOnly: boolean;
|
|
9
7
|
}
|
|
10
8
|
export declare function GeoPointField(props: GeoPointFieldProps): JSX.Element;
|
|
9
|
+
interface useGeoPointFieldProps {
|
|
10
|
+
content: GeoPointContent | undefined;
|
|
11
|
+
onContentChange: (content?: GeoPointContent) => void;
|
|
12
|
+
}
|
|
11
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";
|
|
@@ -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,23 @@
|
|
|
1
|
+
import type { ImageContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import { CroppedImages } from "../CropperDialog";
|
|
4
|
+
import type { CropperImage } from "../imageFieldUtils";
|
|
5
|
+
import type { ExternalImage } from "../MediaPicker/externalImage";
|
|
6
|
+
interface ImageFieldCardProps {
|
|
7
|
+
content: ImageContent | undefined;
|
|
8
|
+
onContentChange: (content: ImageContent | undefined) => void;
|
|
9
|
+
fieldLabel: string;
|
|
10
|
+
readOnly: boolean;
|
|
11
|
+
imageLabel: string[];
|
|
12
|
+
setPage?: (page: number) => void;
|
|
13
|
+
onMediaSelected: (media: ExternalImage) => void;
|
|
14
|
+
initialImages: CropperImage[];
|
|
15
|
+
initialOption?: number;
|
|
16
|
+
onCropperDialogClose: (result: {
|
|
17
|
+
croppedImages: CroppedImages;
|
|
18
|
+
option: number;
|
|
19
|
+
}) => void;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export declare function ImageFieldCard(props: ImageFieldCardProps): JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import type { getImageLabel, Thumbnail } from "../imageFieldUtils";
|
|
1
|
+
import type { CropperImage } from "../imageFieldUtils";
|
|
4
2
|
import { type CroppedImage } from "./croppedImage";
|
|
5
3
|
export declare type CroppedImages = Record<string, CroppedImage>;
|
|
6
|
-
interface Image {
|
|
7
|
-
thumbnail: Thumbnail;
|
|
8
|
-
contentView?: ImageContentView;
|
|
9
|
-
labels: ReturnType<typeof getImageLabel>;
|
|
10
|
-
}
|
|
11
4
|
interface Props {
|
|
12
5
|
trigger: React.ReactNode;
|
|
13
|
-
initialImages:
|
|
6
|
+
initialImages: CropperImage[];
|
|
14
7
|
initialOption: number;
|
|
15
8
|
onClose: (result: {
|
|
16
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
|
|
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
|
|
10
|
+
export declare function ImageField(props: ImageFieldProps): JSX.Element;
|
|
12
11
|
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;
|
|
@@ -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 {};
|
|
@@ -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 {};
|
|
@@ -27,6 +27,7 @@ export declare function useDocuments(params: {
|
|
|
27
27
|
}[];
|
|
28
28
|
onHasReachedBottom: () => void;
|
|
29
29
|
response: {
|
|
30
|
+
total: number;
|
|
30
31
|
results: {
|
|
31
32
|
id: string;
|
|
32
33
|
title: string;
|
|
@@ -48,7 +49,6 @@ export declare function useDocuments(params: {
|
|
|
48
49
|
preview_image?: string | undefined;
|
|
49
50
|
})[];
|
|
50
51
|
}[];
|
|
51
|
-
total: number;
|
|
52
52
|
cursor?: string | undefined;
|
|
53
53
|
};
|
|
54
54
|
};
|
|
@@ -238,6 +238,7 @@ declare const documentsSearchAPISchemaOkType: import("zod").ZodObject<{
|
|
|
238
238
|
})[];
|
|
239
239
|
}>, "many">;
|
|
240
240
|
}, "strip", import("zod").ZodTypeAny, {
|
|
241
|
+
total: number;
|
|
241
242
|
results: {
|
|
242
243
|
id: string;
|
|
243
244
|
title: string;
|
|
@@ -259,9 +260,9 @@ declare const documentsSearchAPISchemaOkType: import("zod").ZodObject<{
|
|
|
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
267
|
id: string;
|
|
267
268
|
title: string;
|
|
@@ -283,7 +284,6 @@ declare const documentsSearchAPISchemaOkType: import("zod").ZodObject<{
|
|
|
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>;
|
|
@@ -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,13 +4,14 @@ 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
|
-
selectType: "
|
|
14
|
+
selectType: "media" | "web" | "document" | undefined;
|
|
14
15
|
isUnsupportedField: boolean | undefined;
|
|
15
16
|
fieldValue: string;
|
|
16
17
|
onValueChange: (value: string) => void;
|
|
@@ -20,6 +21,8 @@ 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<{
|
|
@@ -33,5 +36,5 @@ declare const documentMeta: import("zod").ZodObject<{
|
|
|
33
36
|
title: 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,12 +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
|
-
|
|
4
|
-
|
|
3
|
+
interface Props {
|
|
4
|
+
id: string;
|
|
5
5
|
content: RichTextContent | undefined;
|
|
6
6
|
field: RichText;
|
|
7
|
-
id: string;
|
|
8
|
-
onContentChange: (content: RichTextContent | undefined) => void;
|
|
9
7
|
readOnly: boolean;
|
|
8
|
+
onContentChange: (content: RichTextContent | undefined) => void;
|
|
10
9
|
}
|
|
11
|
-
export declare
|
|
10
|
+
export declare function RichTextField(props: Props): JSX.Element;
|
|
12
11
|
export {};
|
|
@@ -2,7 +2,7 @@ import { RichTextNodeType } from "@prismicio/types-internal/lib/customtypes";
|
|
|
2
2
|
import { type Level as TTLevel } from "@tiptap/extension-heading";
|
|
3
3
|
import { type ReadonlyNonEmptyArray } from "fp-ts/ReadonlyNonEmptyArray";
|
|
4
4
|
import type { Node as ProsemirrorNode } from "prosemirror-model";
|
|
5
|
-
import { HeadingTextExtension } from "
|
|
5
|
+
import { HeadingTextExtension } from "../../models";
|
|
6
6
|
export declare type Level = TTLevel;
|
|
7
7
|
interface HeadingName {
|
|
8
8
|
fullName: RichTextNodeType;
|
|
@@ -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 {};
|
|
@@ -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 {};
|