@prismicio/editor-fields 0.4.8 → 0.4.10
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/fields/EmbedField/EmbedFooter.d.ts +1 -0
- package/dist/fields/ImageField/Components/ImageAltControl.d.ts +1 -0
- package/dist/fields/ImageField/Components/ImageFieldCard.d.ts +2 -2
- package/dist/fields/ImageField/useImageField.d.ts +1 -1
- package/dist/fields/LinkField/Documents/Filters.d.ts +28 -0
- package/dist/fields/LinkField/Documents/documentsData.d.ts +12 -244
- package/dist/fields/LinkField/Documents/filterData.d.ts +4 -2
- package/dist/fields/LinkField/Documents/useFilters.d.ts +15 -0
- package/dist/fields/RichTextField/BubbleMenu/BubbleMenu.d.ts +1 -1
- package/dist/fields/RichTextField/BubbleMenu/{LinkItems.d.ts → Link/LinkItems.d.ts} +3 -0
- package/dist/fields/RichTextField/BubbleMenu/Link/LinkPopover.d.ts +7 -0
- package/dist/fields/RichTextField/BubbleMenu/Link/SetLinkModal.d.ts +8 -0
- package/dist/fields/RichTextField/extensions/Image/useImageView.d.ts +1 -1
- package/dist/fields/RichTextField/extensions/useSelected.d.ts +4 -0
- package/dist/index.es.js +17917 -17595
- package/package.json +3 -3
package/dist/EditorConfig.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ declare type SearchDocuments = {
|
|
|
19
19
|
customTypesApiUrl: string;
|
|
20
20
|
repository: string;
|
|
21
21
|
status: "published" | "release" | "archived" | "unclassified";
|
|
22
|
+
localeId?: string;
|
|
22
23
|
};
|
|
23
24
|
export declare type Env = "dev" | "stage" | "prod";
|
|
24
25
|
export declare const EditorConfigContext: import("react").Context<EditorConfig | undefined>;
|
|
@@ -5,11 +5,10 @@ import type { CropperImage } from "../imageFieldUtils";
|
|
|
5
5
|
import type { ExternalImage } from "../MediaPicker/externalImage";
|
|
6
6
|
interface ImageFieldCardProps {
|
|
7
7
|
content: ImageContent | undefined;
|
|
8
|
-
|
|
8
|
+
selected?: boolean;
|
|
9
9
|
fieldLabel: string;
|
|
10
10
|
readOnly: boolean;
|
|
11
11
|
imageLabel: string[];
|
|
12
|
-
setPage?: (page: number) => void;
|
|
13
12
|
onMediaSelected: (media: ExternalImage) => void;
|
|
14
13
|
initialImages: CropperImage[];
|
|
15
14
|
initialOption?: number;
|
|
@@ -17,6 +16,7 @@ interface ImageFieldCardProps {
|
|
|
17
16
|
croppedImages: CroppedImages;
|
|
18
17
|
option: number;
|
|
19
18
|
}) => void;
|
|
19
|
+
onClear: () => void;
|
|
20
20
|
children: ReactNode;
|
|
21
21
|
}
|
|
22
22
|
export declare function ImageFieldCard(props: ImageFieldCardProps): JSX.Element;
|
|
@@ -16,7 +16,6 @@ export declare function useImageField(props: useImageFieldProps): {
|
|
|
16
16
|
onMediaSelected: (media: ExternalImage) => void;
|
|
17
17
|
isUpdating: boolean;
|
|
18
18
|
page: number;
|
|
19
|
-
setPage: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
20
19
|
thumbnail: Readonly<{
|
|
21
20
|
width?: number | null | undefined;
|
|
22
21
|
height?: number | null | undefined;
|
|
@@ -97,5 +96,6 @@ export declare function useImageField(props: useImageFieldProps): {
|
|
|
97
96
|
alt?: string | null | undefined;
|
|
98
97
|
provider?: string | null | undefined;
|
|
99
98
|
}) | undefined;
|
|
99
|
+
onClear: () => void;
|
|
100
100
|
};
|
|
101
101
|
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FilterOption } from "@prismicio/editor-ui";
|
|
2
|
+
interface DocumentsListFiltersProps {
|
|
3
|
+
filteredLocales: Set<FilterOption>;
|
|
4
|
+
setFilteredLocales: (newValue: Set<FilterOption>) => void;
|
|
5
|
+
filteredTags: Set<FilterOption>;
|
|
6
|
+
setFilteredTags: (newValue: Set<FilterOption>) => void;
|
|
7
|
+
filteredCustomTypes: Set<FilterOption>;
|
|
8
|
+
setFilteredCustomTypes: (newValue: Set<FilterOption>) => void;
|
|
9
|
+
fixedCustomTypes?: Set<string>;
|
|
10
|
+
fixedTags?: Set<string>;
|
|
11
|
+
}
|
|
12
|
+
export declare function DocumentsListFilters(props: DocumentsListFiltersProps): JSX.Element;
|
|
13
|
+
interface FilterProps {
|
|
14
|
+
onSelectedValuesChange: (selectedValues: Set<FilterOption>) => void;
|
|
15
|
+
fixedSelectedValues?: Set<FilterOption>;
|
|
16
|
+
selectedValues: Set<FilterOption>;
|
|
17
|
+
label: string;
|
|
18
|
+
icon: "label" | "description" | "public";
|
|
19
|
+
fetchFilters: () => Set<FilterOption>;
|
|
20
|
+
multiple?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function Filter(props: FilterProps): JSX.Element;
|
|
23
|
+
interface LocalesFilterProps {
|
|
24
|
+
selectedValues: Set<FilterOption>;
|
|
25
|
+
onSelectedValuesChange: (selectedValues: Set<FilterOption>) => void;
|
|
26
|
+
}
|
|
27
|
+
export declare function LocalesFilter(props: LocalesFilterProps): JSX.Element;
|
|
28
|
+
export {};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { FilterOption } from "@prismicio/editor-ui";
|
|
2
2
|
export declare function useDocuments(params: {
|
|
3
3
|
searchTerm: string;
|
|
4
|
-
tagsFilter:
|
|
5
|
-
typesFilter:
|
|
4
|
+
tagsFilter: Set<FilterOption>;
|
|
5
|
+
typesFilter: Set<FilterOption>;
|
|
6
|
+
localesFilter: Set<FilterOption>;
|
|
6
7
|
}): {
|
|
7
8
|
documents: {
|
|
8
9
|
id: string;
|
|
9
|
-
title: string;
|
|
10
10
|
custom_type_id: string;
|
|
11
|
+
title: string;
|
|
11
12
|
versions: (({
|
|
12
13
|
status: "unclassified";
|
|
13
14
|
} | {
|
|
@@ -18,20 +19,22 @@ export declare function useDocuments(params: {
|
|
|
18
19
|
} | {
|
|
19
20
|
status: "archived";
|
|
20
21
|
}) & {
|
|
21
|
-
tags: string[];
|
|
22
22
|
version_id: string;
|
|
23
|
+
tags: string[];
|
|
23
24
|
custom_type_label: string;
|
|
24
25
|
preview_summary?: string | undefined;
|
|
25
26
|
preview_image?: string | undefined;
|
|
26
27
|
})[];
|
|
28
|
+
locale: string;
|
|
29
|
+
group_lang_id: string;
|
|
27
30
|
}[];
|
|
28
31
|
onHasReachedBottom: () => void;
|
|
29
32
|
response: {
|
|
30
33
|
total: number;
|
|
31
34
|
results: {
|
|
32
35
|
id: string;
|
|
33
|
-
title: string;
|
|
34
36
|
custom_type_id: string;
|
|
37
|
+
title: string;
|
|
35
38
|
versions: (({
|
|
36
39
|
status: "unclassified";
|
|
37
40
|
} | {
|
|
@@ -42,250 +45,15 @@ export declare function useDocuments(params: {
|
|
|
42
45
|
} | {
|
|
43
46
|
status: "archived";
|
|
44
47
|
}) & {
|
|
45
|
-
tags: string[];
|
|
46
48
|
version_id: string;
|
|
49
|
+
tags: string[];
|
|
47
50
|
custom_type_label: string;
|
|
48
51
|
preview_summary?: string | undefined;
|
|
49
52
|
preview_image?: string | undefined;
|
|
50
53
|
})[];
|
|
54
|
+
locale: string;
|
|
55
|
+
group_lang_id: string;
|
|
51
56
|
}[];
|
|
52
57
|
cursor?: string | undefined;
|
|
53
58
|
};
|
|
54
59
|
};
|
|
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
|
-
tags: string[];
|
|
94
|
-
version_id: string;
|
|
95
|
-
custom_type_label: string;
|
|
96
|
-
preview_summary?: string | undefined;
|
|
97
|
-
preview_image?: string | undefined;
|
|
98
|
-
}, {
|
|
99
|
-
tags: string[];
|
|
100
|
-
version_id: string;
|
|
101
|
-
custom_type_label: string;
|
|
102
|
-
preview_summary?: string | undefined;
|
|
103
|
-
preview_image?: string | undefined;
|
|
104
|
-
}>>, "many">;
|
|
105
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
106
|
-
id: string;
|
|
107
|
-
title: 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
|
-
tags: string[];
|
|
120
|
-
version_id: string;
|
|
121
|
-
custom_type_label: string;
|
|
122
|
-
preview_summary?: string | undefined;
|
|
123
|
-
preview_image?: string | undefined;
|
|
124
|
-
})[];
|
|
125
|
-
}, {
|
|
126
|
-
id: string;
|
|
127
|
-
title: 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
|
-
tags: string[];
|
|
140
|
-
version_id: 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
|
-
tags: string[];
|
|
188
|
-
version_id: string;
|
|
189
|
-
custom_type_label: string;
|
|
190
|
-
preview_summary?: string | undefined;
|
|
191
|
-
preview_image?: string | undefined;
|
|
192
|
-
}, {
|
|
193
|
-
tags: string[];
|
|
194
|
-
version_id: string;
|
|
195
|
-
custom_type_label: string;
|
|
196
|
-
preview_summary?: string | undefined;
|
|
197
|
-
preview_image?: string | undefined;
|
|
198
|
-
}>>, "many">;
|
|
199
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
200
|
-
id: string;
|
|
201
|
-
title: 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
|
-
tags: string[];
|
|
214
|
-
version_id: string;
|
|
215
|
-
custom_type_label: string;
|
|
216
|
-
preview_summary?: string | undefined;
|
|
217
|
-
preview_image?: string | undefined;
|
|
218
|
-
})[];
|
|
219
|
-
}, {
|
|
220
|
-
id: string;
|
|
221
|
-
title: 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
|
-
tags: string[];
|
|
234
|
-
version_id: 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
|
-
total: number;
|
|
242
|
-
results: {
|
|
243
|
-
id: string;
|
|
244
|
-
title: string;
|
|
245
|
-
custom_type_id: string;
|
|
246
|
-
versions: (({
|
|
247
|
-
status: "unclassified";
|
|
248
|
-
} | {
|
|
249
|
-
status: "published";
|
|
250
|
-
} | {
|
|
251
|
-
status: "release";
|
|
252
|
-
release_id: string;
|
|
253
|
-
} | {
|
|
254
|
-
status: "archived";
|
|
255
|
-
}) & {
|
|
256
|
-
tags: string[];
|
|
257
|
-
version_id: string;
|
|
258
|
-
custom_type_label: string;
|
|
259
|
-
preview_summary?: string | undefined;
|
|
260
|
-
preview_image?: string | undefined;
|
|
261
|
-
})[];
|
|
262
|
-
}[];
|
|
263
|
-
cursor?: string | undefined;
|
|
264
|
-
}, {
|
|
265
|
-
total: number;
|
|
266
|
-
results: {
|
|
267
|
-
id: string;
|
|
268
|
-
title: string;
|
|
269
|
-
custom_type_id: string;
|
|
270
|
-
versions: (({
|
|
271
|
-
status: "unclassified";
|
|
272
|
-
} | {
|
|
273
|
-
status: "published";
|
|
274
|
-
} | {
|
|
275
|
-
status: "release";
|
|
276
|
-
release_id: string;
|
|
277
|
-
} | {
|
|
278
|
-
status: "archived";
|
|
279
|
-
}) & {
|
|
280
|
-
tags: string[];
|
|
281
|
-
version_id: string;
|
|
282
|
-
custom_type_label: string;
|
|
283
|
-
preview_summary?: string | undefined;
|
|
284
|
-
preview_image?: string | undefined;
|
|
285
|
-
})[];
|
|
286
|
-
}[];
|
|
287
|
-
cursor?: string | undefined;
|
|
288
|
-
}>;
|
|
289
|
-
export declare type DocumentSearchApi = TypeOf<typeof documentsSearchAPISchemaOkType>;
|
|
290
|
-
export declare type Document = TypeOf<typeof documentsSearchOkType>;
|
|
291
|
-
export {};
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function
|
|
1
|
+
import type { FilterOption } from "@prismicio/editor-ui";
|
|
2
|
+
export declare function useRepositoryLocales(): Set<FilterOption>;
|
|
3
|
+
export declare function useRepositoryTags(): Set<FilterOption>;
|
|
4
|
+
export declare function useRepositoryTypes(): Set<FilterOption>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FilterOption } from "@prismicio/editor-ui";
|
|
2
|
+
export declare function useFilters(fixedCustomTypes?: Set<string>, fixedTags?: Set<string>): {
|
|
3
|
+
searchTerm: string;
|
|
4
|
+
setSearchTerm: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
5
|
+
debouncedSearchTerm: string;
|
|
6
|
+
filteredTags: Set<FilterOption>;
|
|
7
|
+
setFilteredTags: import("react").Dispatch<import("react").SetStateAction<Set<FilterOption>>>;
|
|
8
|
+
filteredCustomTypes: Set<FilterOption>;
|
|
9
|
+
setFilteredCustomTypes: import("react").Dispatch<import("react").SetStateAction<Set<FilterOption>>>;
|
|
10
|
+
filteredLocales: Set<FilterOption>;
|
|
11
|
+
setFilteredLocales: import("react").Dispatch<import("react").SetStateAction<Set<FilterOption>>>;
|
|
12
|
+
typesFilter: Set<FilterOption>;
|
|
13
|
+
tagsFilter: Set<FilterOption>;
|
|
14
|
+
};
|
|
15
|
+
export declare function transformFixedFilters(filters?: Set<string>): Set<FilterOption>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { Editor } from "@tiptap/core";
|
|
2
|
+
import type { MutableRefObject } from "react";
|
|
2
3
|
interface LinkItemsProps {
|
|
3
4
|
editor: Editor;
|
|
5
|
+
setDisplayLinkModal: (open: boolean) => void;
|
|
6
|
+
bubbleMenuContainerRef?: MutableRefObject<null>;
|
|
4
7
|
}
|
|
5
8
|
export declare function LinkItems(props: LinkItemsProps): JSX.Element;
|
|
6
9
|
export {};
|
|
@@ -12,12 +12,12 @@ interface useImageViewProps {
|
|
|
12
12
|
imageViewProps: ImageViewProps;
|
|
13
13
|
}
|
|
14
14
|
export declare function useImageView(props: useImageViewProps): {
|
|
15
|
-
onContentChange: (content?: ImageContent) => void;
|
|
16
15
|
onMediaSelected: (media: ExternalImage) => void;
|
|
17
16
|
onCropperDialogClose: ({ croppedImages }: {
|
|
18
17
|
croppedImages: CroppedImages;
|
|
19
18
|
}) => void;
|
|
20
19
|
isUpdating: boolean;
|
|
21
20
|
updateContent: (content?: ImageContent) => void;
|
|
21
|
+
onClear: () => void;
|
|
22
22
|
};
|
|
23
23
|
export {};
|