@prismicio/editor-fields 0.4.2 → 0.4.4
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 +1 -0
- package/dist/NestableWidgetSwitch.d.ts +3 -4
- package/dist/SectionEditor.d.ts +3 -4
- package/dist/fields/EmbedField/EmbedField.d.ts +3 -3
- package/dist/fields/GeoPointField.d.ts +11 -0
- package/dist/fields/ImageField/{CroppedDialog/index.d.ts → CropperDialog/CropperDialog.d.ts} +1 -1
- package/dist/fields/ImageField/{CroppedDialog → CropperDialog}/croppedImage.d.ts +1 -1
- package/dist/fields/ImageField/CropperDialog/index.d.ts +1 -0
- package/dist/fields/ImageField/ImageField.d.ts +12 -0
- package/dist/fields/ImageField/MediaPicker/MediaLibrary/MediaLibrary.d.ts +13 -2
- package/dist/fields/ImageField/MediaPicker/MediaLibrary/mediaLibraryData.d.ts +62 -38
- package/dist/fields/ImageField/MediaPicker/MediaPicker.d.ts +2 -2
- package/dist/fields/ImageField/MediaPicker/mediaPickerData.d.ts +26 -0
- package/dist/fields/ImageField/index.d.ts +1 -12
- package/dist/fields/KeyTextField.d.ts +3 -4
- package/dist/fields/LinkField/LinkField.d.ts +11 -0
- package/dist/fields/LinkField/LinkFieldActions.d.ts +5 -2
- package/dist/fields/LinkField/index.d.ts +2 -12
- package/dist/fields/LinkField/useLinkField.d.ts +17 -0
- package/dist/fields/RichTextField/RichTextField.d.ts +2 -2
- package/dist/fields/RichTextField/coreExtensions/ListItem.d.ts +4 -4
- package/dist/fields/RichTextField/coreExtensions/Placeholder.d.ts +7 -2
- package/dist/fields/RichTextField/globalExtensions/TextDirection.d.ts +3 -3
- package/dist/fields/externalLinks.d.ts +2 -0
- package/dist/index.es.js +19754 -19081
- package/dist/index.umd.js +39 -43
- package/dist/slices/SharedSliceEditor.d.ts +3 -4
- package/dist/zones/SliceZoneEditor.d.ts +3 -4
- package/dist/zones/StaticZoneEditor.d.ts +3 -4
- package/package.json +24 -21
- package/dist/fields/ImageField/MediaPicker/MediaLibrary.d.ts +0 -1
- package/dist/fields/ImageField/MediaPicker/UnsplashLibrary.d.ts +0 -6
- package/dist/fields/ImageField/MediaPicker/unsplashData.d.ts +0 -115
- /package/dist/fields/ImageField/{imageField.d.ts → imageFieldUtils.d.ts} +0 -0
package/dist/EditorConfig.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface EditorConfig {
|
|
|
9
9
|
url: string;
|
|
10
10
|
repository: string;
|
|
11
11
|
};
|
|
12
|
+
env: "dev" | "stage" | "prod";
|
|
12
13
|
}
|
|
13
14
|
export declare const EditorConfigContext: import("react").Context<EditorConfig | undefined>;
|
|
14
15
|
export declare function useEditorConfig(): EditorConfig;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { NestableContent } from "@prismicio/types-internal/lib/content";
|
|
2
2
|
import type { NestableWidget } from "@prismicio/types-internal/lib/customtypes";
|
|
3
|
-
|
|
4
|
-
declare type NestableWidgetSwitchProps = Readonly<{
|
|
3
|
+
interface Props {
|
|
5
4
|
content: NestableContent | undefined;
|
|
6
5
|
id: string;
|
|
7
6
|
nestableWidget: NestableWidget;
|
|
8
7
|
onContentChange: (content: NestableContent | undefined) => void;
|
|
9
8
|
readOnly: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare
|
|
9
|
+
}
|
|
10
|
+
export declare function NestableWidgetSwitch(props: Props): JSX.Element | null;
|
|
12
11
|
export {};
|
package/dist/SectionEditor.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { type Document } from "@prismicio/types-internal/lib/content";
|
|
2
2
|
import type { StaticSection } from "@prismicio/types-internal/lib/customtypes";
|
|
3
|
-
import { type FC } from "react";
|
|
4
3
|
import type { Selection } from "./Selection";
|
|
5
|
-
|
|
4
|
+
interface Props {
|
|
6
5
|
id: string;
|
|
7
6
|
readOnly: boolean;
|
|
8
7
|
selection?: Selection;
|
|
9
8
|
section: StaticSection;
|
|
10
9
|
content: Document;
|
|
11
10
|
onContentChange: (content: Document) => void;
|
|
12
|
-
}
|
|
13
|
-
export declare
|
|
11
|
+
}
|
|
12
|
+
export declare function SectionEditor(props: Props): JSX.Element;
|
|
14
13
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { EmbedContent } from "@prismicio/types-internal/lib/content";
|
|
2
2
|
import type { Embed as EmbedT } from "@prismicio/types-internal/lib/customtypes";
|
|
3
|
-
|
|
3
|
+
interface Props {
|
|
4
4
|
id: string;
|
|
5
5
|
readOnly: boolean;
|
|
6
6
|
field: EmbedT;
|
|
7
7
|
content?: EmbedContent;
|
|
8
8
|
onContentChange: (content?: EmbedContent) => void;
|
|
9
|
-
}
|
|
10
|
-
export declare
|
|
9
|
+
}
|
|
10
|
+
export declare function EmbedField(props: Props): JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { GeoPointContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import type { GeoPoint } from "@prismicio/types-internal/lib/customtypes";
|
|
3
|
+
interface GeoPointFieldProps {
|
|
4
|
+
content: GeoPointContent | undefined;
|
|
5
|
+
field: GeoPoint;
|
|
6
|
+
id: string;
|
|
7
|
+
onContentChange: (content?: GeoPointContent) => void;
|
|
8
|
+
readOnly: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function GeoPointField(props: GeoPointFieldProps): JSX.Element;
|
|
11
|
+
export {};
|
package/dist/fields/ImageField/{CroppedDialog/index.d.ts → CropperDialog/CropperDialog.d.ts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ImageContentView } from "@prismicio/types-internal/lib/content";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import type { getImageLabel, Thumbnail } from "../
|
|
3
|
+
import type { getImageLabel, Thumbnail } from "../imageFieldUtils";
|
|
4
4
|
import { type CroppedImage } from "./croppedImage";
|
|
5
5
|
export declare type CroppedImages = Record<string, CroppedImage>;
|
|
6
6
|
interface Image {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ImageContent, ImageContentView } from "@prismicio/types-internal/lib/content";
|
|
2
2
|
import type { Image } from "@prismicio/types-internal/lib/customtypes";
|
|
3
|
-
import { type Thumbnail } from "../
|
|
3
|
+
import { type Thumbnail } from "../imageFieldUtils";
|
|
4
4
|
export interface Point {
|
|
5
5
|
x: number;
|
|
6
6
|
y: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type CroppedImages, CropperDialog } from "./CropperDialog";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ImageContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import type { Image } from "@prismicio/types-internal/lib/customtypes";
|
|
3
|
+
import { type FC } from "react";
|
|
4
|
+
interface ImageFieldProps {
|
|
5
|
+
content: ImageContent | undefined;
|
|
6
|
+
field: Image;
|
|
7
|
+
id: string;
|
|
8
|
+
onContentChange: (content: ImageContent | undefined) => void;
|
|
9
|
+
readOnly: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const ImageField: FC<ImageFieldProps>;
|
|
12
|
+
export {};
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import type { ExternalImage } from "../externalImage";
|
|
2
|
-
|
|
2
|
+
import type { UploadFile } from "../mediaPickerData";
|
|
3
|
+
interface MediaLibraryProps {
|
|
4
|
+
assets: {
|
|
5
|
+
url: string;
|
|
6
|
+
dev: boolean;
|
|
7
|
+
repository: string;
|
|
8
|
+
};
|
|
9
|
+
uploadingFiles: UploadFile[];
|
|
10
|
+
onFilesSelected: (uploadingFiles: File[]) => void;
|
|
11
|
+
onSuccessFiles: () => void;
|
|
12
|
+
onFailedFiles: (failedFiles: UploadFile[]) => void;
|
|
13
|
+
onTryAgain: (failedFile: UploadFile) => void;
|
|
3
14
|
onMediaSelected: (media: ExternalImage) => void;
|
|
4
15
|
}
|
|
5
|
-
export declare
|
|
16
|
+
export declare function MediaLibrary(props: MediaLibraryProps): JSX.Element;
|
|
6
17
|
export {};
|
|
@@ -1,100 +1,124 @@
|
|
|
1
1
|
import { TypeOf } from "zod";
|
|
2
|
-
declare const
|
|
2
|
+
export declare const mediaLibraryImageOkType: import("zod").ZodObject<{
|
|
3
3
|
id: import("zod").ZodString;
|
|
4
4
|
kind: import("zod").ZodString;
|
|
5
5
|
extension: import("zod").ZodString;
|
|
6
6
|
filename: import("zod").ZodString;
|
|
7
|
-
width: import("zod").ZodNumber
|
|
8
|
-
height: import("zod").ZodNumber
|
|
7
|
+
width: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
8
|
+
height: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
9
9
|
last_modified: import("zod").ZodNumber;
|
|
10
10
|
url: import("zod").ZodString;
|
|
11
11
|
}, "strip", import("zod").ZodTypeAny, {
|
|
12
12
|
id: string;
|
|
13
|
+
url: string;
|
|
13
14
|
kind: string;
|
|
14
15
|
extension: string;
|
|
15
16
|
filename: string;
|
|
16
|
-
width: number;
|
|
17
|
-
height: number;
|
|
18
17
|
last_modified: number;
|
|
19
|
-
|
|
18
|
+
width?: number | undefined;
|
|
19
|
+
height?: number | undefined;
|
|
20
20
|
}, {
|
|
21
21
|
id: string;
|
|
22
|
+
url: string;
|
|
22
23
|
kind: string;
|
|
23
24
|
extension: string;
|
|
24
25
|
filename: string;
|
|
25
|
-
width: number;
|
|
26
|
-
height: number;
|
|
27
26
|
last_modified: number;
|
|
28
|
-
|
|
27
|
+
width?: number | undefined;
|
|
28
|
+
height?: number | undefined;
|
|
29
29
|
}>;
|
|
30
|
-
export declare const
|
|
30
|
+
export declare const mediaLibrarySearchAPISchemaOkType: import("zod").ZodObject<{
|
|
31
31
|
total: import("zod").ZodNumber;
|
|
32
|
-
cursor: import("zod").ZodString
|
|
32
|
+
cursor: import("zod").ZodOptional<import("zod").ZodString>;
|
|
33
33
|
items: import("zod").ZodArray<import("zod").ZodObject<{
|
|
34
34
|
id: import("zod").ZodString;
|
|
35
35
|
kind: import("zod").ZodString;
|
|
36
36
|
extension: import("zod").ZodString;
|
|
37
37
|
filename: import("zod").ZodString;
|
|
38
|
-
width: import("zod").ZodNumber
|
|
39
|
-
height: import("zod").ZodNumber
|
|
38
|
+
width: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
39
|
+
height: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
40
40
|
last_modified: import("zod").ZodNumber;
|
|
41
41
|
url: import("zod").ZodString;
|
|
42
42
|
}, "strip", import("zod").ZodTypeAny, {
|
|
43
43
|
id: string;
|
|
44
|
+
url: string;
|
|
44
45
|
kind: string;
|
|
45
46
|
extension: string;
|
|
46
47
|
filename: string;
|
|
47
|
-
width: number;
|
|
48
|
-
height: number;
|
|
49
48
|
last_modified: number;
|
|
50
|
-
|
|
49
|
+
width?: number | undefined;
|
|
50
|
+
height?: number | undefined;
|
|
51
51
|
}, {
|
|
52
52
|
id: string;
|
|
53
|
+
url: string;
|
|
53
54
|
kind: string;
|
|
54
55
|
extension: string;
|
|
55
56
|
filename: string;
|
|
56
|
-
width: number;
|
|
57
|
-
height: number;
|
|
58
57
|
last_modified: number;
|
|
59
|
-
|
|
58
|
+
width?: number | undefined;
|
|
59
|
+
height?: number | undefined;
|
|
60
60
|
}>, "many">;
|
|
61
61
|
}, "strip", import("zod").ZodTypeAny, {
|
|
62
62
|
total: number;
|
|
63
|
-
cursor: string;
|
|
64
63
|
items: {
|
|
65
64
|
id: string;
|
|
65
|
+
url: string;
|
|
66
66
|
kind: string;
|
|
67
67
|
extension: string;
|
|
68
68
|
filename: string;
|
|
69
|
-
width: number;
|
|
70
|
-
height: number;
|
|
71
69
|
last_modified: number;
|
|
72
|
-
|
|
70
|
+
width?: number | undefined;
|
|
71
|
+
height?: number | undefined;
|
|
73
72
|
}[];
|
|
73
|
+
cursor?: string | undefined;
|
|
74
74
|
}, {
|
|
75
75
|
total: number;
|
|
76
|
-
cursor: string;
|
|
77
76
|
items: {
|
|
78
77
|
id: string;
|
|
78
|
+
url: string;
|
|
79
79
|
kind: string;
|
|
80
80
|
extension: string;
|
|
81
81
|
filename: string;
|
|
82
|
-
width: number;
|
|
83
|
-
height: number;
|
|
84
82
|
last_modified: number;
|
|
85
|
-
|
|
83
|
+
width?: number | undefined;
|
|
84
|
+
height?: number | undefined;
|
|
86
85
|
}[];
|
|
86
|
+
cursor?: string | undefined;
|
|
87
87
|
}>;
|
|
88
|
-
export declare type MediaLibrarySearchApi = TypeOf<typeof
|
|
89
|
-
export declare type MediaLibraryImage = TypeOf<typeof
|
|
90
|
-
|
|
91
|
-
id: string;
|
|
92
|
-
kind: string;
|
|
93
|
-
extension: string;
|
|
94
|
-
filename: string;
|
|
95
|
-
width: number;
|
|
96
|
-
height: number;
|
|
97
|
-
last_modified: number;
|
|
88
|
+
export declare type MediaLibrarySearchApi = TypeOf<typeof mediaLibrarySearchAPISchemaOkType>;
|
|
89
|
+
export declare type MediaLibraryImage = TypeOf<typeof mediaLibraryImageOkType>;
|
|
90
|
+
interface MediaLibrarySearchProps {
|
|
98
91
|
url: string;
|
|
99
|
-
|
|
92
|
+
repository: string;
|
|
93
|
+
dev: boolean;
|
|
94
|
+
}
|
|
95
|
+
export declare function useMediaLibrarySearch(props: MediaLibrarySearchProps): {
|
|
96
|
+
media: {
|
|
97
|
+
id: string;
|
|
98
|
+
url: string;
|
|
99
|
+
kind: string;
|
|
100
|
+
extension: string;
|
|
101
|
+
filename: string;
|
|
102
|
+
last_modified: number;
|
|
103
|
+
width?: number | undefined;
|
|
104
|
+
height?: number | undefined;
|
|
105
|
+
}[];
|
|
106
|
+
limit: number;
|
|
107
|
+
onHasReachedBottom: () => void;
|
|
108
|
+
response: {
|
|
109
|
+
total: number;
|
|
110
|
+
items: {
|
|
111
|
+
id: string;
|
|
112
|
+
url: string;
|
|
113
|
+
kind: string;
|
|
114
|
+
extension: string;
|
|
115
|
+
filename: string;
|
|
116
|
+
last_modified: number;
|
|
117
|
+
width?: number | undefined;
|
|
118
|
+
height?: number | undefined;
|
|
119
|
+
}[];
|
|
120
|
+
cursor?: string | undefined;
|
|
121
|
+
};
|
|
122
|
+
updateMedia: (newFiles: MediaLibraryImage[]) => void;
|
|
123
|
+
};
|
|
100
124
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
2
|
import type { ExternalImage } from "./externalImage";
|
|
3
3
|
interface MediaPickerProps {
|
|
4
4
|
trigger: ReactNode;
|
|
5
5
|
onMediaSelected: (media: ExternalImage) => void;
|
|
6
6
|
}
|
|
7
|
-
export declare
|
|
7
|
+
export declare function MediaPicker(props: MediaPickerProps): JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { EditorConfig } from "../../../EditorConfig";
|
|
2
|
+
import { MediaLibraryImage } from "./MediaLibrary/mediaLibraryData";
|
|
3
|
+
export declare type UploadFile = UploadFileLoading | UploadFileSuccess;
|
|
4
|
+
interface UploadFileLoading {
|
|
5
|
+
id: string;
|
|
6
|
+
file: File;
|
|
7
|
+
status: "failed" | "loading";
|
|
8
|
+
response?: MediaLibraryImage;
|
|
9
|
+
}
|
|
10
|
+
export interface UploadFileSuccess {
|
|
11
|
+
id: string;
|
|
12
|
+
file: File;
|
|
13
|
+
status: "success";
|
|
14
|
+
response: MediaLibraryImage;
|
|
15
|
+
}
|
|
16
|
+
interface useMediaLibraryUploadProps {
|
|
17
|
+
config: EditorConfig;
|
|
18
|
+
}
|
|
19
|
+
export declare function useMediaLibraryUpload(props: useMediaLibraryUploadProps): {
|
|
20
|
+
onFilesSelected: (selectedFiles: File[]) => void;
|
|
21
|
+
uploadingFiles: UploadFile[];
|
|
22
|
+
onSuccessFiles: () => void;
|
|
23
|
+
onFailedFiles: (failedFiles: UploadFile[]) => void;
|
|
24
|
+
onTryAgain: (failedFile: UploadFile) => void;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { Image } from "@prismicio/types-internal/lib/customtypes";
|
|
3
|
-
import { type FC } from "react";
|
|
4
|
-
interface ImageFieldProps {
|
|
5
|
-
content: ImageContent | undefined;
|
|
6
|
-
field: Image;
|
|
7
|
-
id: string;
|
|
8
|
-
onContentChange: (content: ImageContent | undefined) => void;
|
|
9
|
-
readOnly: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare const ImageField: FC<ImageFieldProps>;
|
|
12
|
-
export {};
|
|
1
|
+
export { ImageField } from "./ImageField";
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { TextContent } from "@prismicio/types-internal/lib/content";
|
|
2
2
|
import type { Text } from "@prismicio/types-internal/lib/customtypes";
|
|
3
|
-
|
|
4
|
-
declare type KeyTextFieldProps = Readonly<{
|
|
3
|
+
interface Props {
|
|
5
4
|
content: TextContent | undefined;
|
|
6
5
|
field: Text;
|
|
7
6
|
id: string;
|
|
8
7
|
onContentChange: (content: TextContent | undefined) => void;
|
|
9
8
|
readOnly: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare
|
|
9
|
+
}
|
|
10
|
+
export declare function KeyTextField(props: Props): JSX.Element;
|
|
12
11
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LinkContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import type { Link } from "@prismicio/types-internal/lib/customtypes";
|
|
3
|
+
interface LinkFieldProps {
|
|
4
|
+
id: string;
|
|
5
|
+
field: Link;
|
|
6
|
+
readOnly: boolean;
|
|
7
|
+
content: LinkContent | undefined;
|
|
8
|
+
onContentChange: (content: LinkContent | undefined) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function LinkField(props: LinkFieldProps): JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
export declare type FieldSelectTypes = "web" | "document" | "media";
|
|
2
2
|
interface Props {
|
|
3
3
|
hasLink: boolean;
|
|
4
4
|
onUnlink: () => void;
|
|
5
|
+
selectedType?: FieldSelectTypes;
|
|
6
|
+
selectEnabled: boolean;
|
|
7
|
+
onValueChange: (newValue: FieldSelectTypes) => void;
|
|
5
8
|
}
|
|
6
|
-
export declare
|
|
9
|
+
export declare function LinkFieldActions(props: Props): JSX.Element;
|
|
7
10
|
export {};
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { FC } from "react";
|
|
4
|
-
declare type LinkFieldProps = Readonly<{
|
|
5
|
-
content: LinkContent | undefined;
|
|
6
|
-
field: Link;
|
|
7
|
-
id: string;
|
|
8
|
-
readOnly: boolean;
|
|
9
|
-
onContentChange: (content: LinkContent | undefined) => void;
|
|
10
|
-
}>;
|
|
11
|
-
export declare const LinkField: FC<LinkFieldProps>;
|
|
12
|
-
export {};
|
|
1
|
+
export { LinkField } from "./LinkField";
|
|
2
|
+
export { LinkFieldActions } from "./LinkFieldActions";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { LinkContent } from "@prismicio/types-internal/lib/content";
|
|
2
|
+
import type { Link } from "@prismicio/types-internal/lib/customtypes";
|
|
3
|
+
import type { FieldSelectTypes } from "./LinkFieldActions";
|
|
4
|
+
export declare function useLinkField(params: {
|
|
5
|
+
field: Link;
|
|
6
|
+
content: LinkContent | undefined;
|
|
7
|
+
onContentChange: (content: LinkContent | undefined) => void;
|
|
8
|
+
}): {
|
|
9
|
+
contentType: "ExternalLink" | "ImageLink" | "FileLink" | "DocumentLink" | undefined;
|
|
10
|
+
selectType: "document" | "media" | "web" | undefined;
|
|
11
|
+
isUnsupportedField: boolean;
|
|
12
|
+
fieldValue: string;
|
|
13
|
+
onValueChange: (value: string) => void;
|
|
14
|
+
onTypeChange: (newValue: FieldSelectTypes) => void;
|
|
15
|
+
placeholder: string;
|
|
16
|
+
isTypeSelectEnabled: boolean;
|
|
17
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { RichTextContent } from "@prismicio/types-internal/lib/content";
|
|
2
2
|
import type { RichText } from "@prismicio/types-internal/lib/customtypes";
|
|
3
3
|
import { type FC } from "react";
|
|
4
|
-
|
|
4
|
+
interface RichTextFieldProps {
|
|
5
5
|
content: RichTextContent | undefined;
|
|
6
6
|
field: RichText;
|
|
7
7
|
id: string;
|
|
8
8
|
onContentChange: (content: RichTextContent | undefined) => void;
|
|
9
9
|
readOnly: boolean;
|
|
10
|
-
}
|
|
10
|
+
}
|
|
11
11
|
export declare const RichTextField: FC<RichTextFieldProps>;
|
|
12
12
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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
|
} & {
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import { type ExtensionPlaceholder } from "../models";
|
|
2
|
-
|
|
1
|
+
import { type ExtensionPlaceholder, NodeExtension } from "../models";
|
|
2
|
+
interface PlaceholderParams {
|
|
3
|
+
placeholderByNodeType: Record<string, ExtensionPlaceholder>;
|
|
4
|
+
unfocusedPlaceholder: string | undefined;
|
|
5
|
+
nodeExtensions: readonly NodeExtension[];
|
|
6
|
+
}
|
|
7
|
+
declare const _default: (params: PlaceholderParams) => import("@tiptap/core").Extension<import("@tiptap/extension-placeholder").PlaceholderOptions, any>;
|
|
3
8
|
export default _default;
|
|
@@ -8,10 +8,10 @@ export declare enum Direction {
|
|
|
8
8
|
interface TextDirectionOptions {
|
|
9
9
|
supportedExtensionNames: readonly string[];
|
|
10
10
|
}
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const attrName = "dir";
|
|
12
12
|
declare module "@tiptap/core" {
|
|
13
13
|
interface Commands<ReturnType> {
|
|
14
|
-
[
|
|
14
|
+
[attrName]: {
|
|
15
15
|
setDirection: (direction: Direction) => ReturnType;
|
|
16
16
|
toggleDirection: (direction: Direction) => ReturnType;
|
|
17
17
|
/**
|
|
@@ -30,7 +30,7 @@ export declare const component: Extension<TextDirectionOptions, any>;
|
|
|
30
30
|
export declare const converter: {
|
|
31
31
|
parseNodeAttrsDirection(attributes: Record<string, unknown>): Direction;
|
|
32
32
|
fromPrismic(textBlock: TextBlock): {
|
|
33
|
-
[
|
|
33
|
+
[attrName]: Direction;
|
|
34
34
|
};
|
|
35
35
|
toPrismic(node: ProsemirrorNode): {
|
|
36
36
|
direction: Direction;
|