@prismicio/editor-fields 0.4.57 → 0.4.58-alpha.repeatable-link-base.1

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.
Files changed (39) hide show
  1. package/dist/EditorConfig.d.ts +2 -0
  2. package/dist/FieldContext.d.ts +5 -0
  3. package/dist/core/MediaLibrary/hooks/mediaLibraryData.d.ts +75 -75
  4. package/dist/core/MediaLibrary/hooks/tagData.d.ts +3 -3
  5. package/dist/core/MediaLibrary/hooks/useSelectedMedia.d.ts +7 -7
  6. package/dist/core/repeatable.d.ts +3 -0
  7. package/dist/core/service/customType.d.ts +38 -0
  8. package/dist/core/service/document.d.ts +1674 -422
  9. package/dist/core/service/documentSearch.d.ts +415 -0
  10. package/dist/core/service/index.d.ts +2 -0
  11. package/dist/core/service/repository.d.ts +158 -21
  12. package/dist/core/service/role.d.ts +141 -0
  13. package/dist/core/service/teamSpace.d.ts +48 -0
  14. package/dist/core/service/user.d.ts +11 -5
  15. package/dist/fields/ImageField/useImageField.d.ts +1 -1
  16. package/dist/fields/IntegrationField/integrationData.d.ts +5 -5
  17. package/dist/fields/LinkField/Documents/DocumentCard.d.ts +1 -1
  18. package/dist/fields/LinkField/Documents/documentsData.d.ts +73 -44
  19. package/dist/fields/LinkField/LinkField.d.ts +4 -3
  20. package/dist/fields/LinkField/LinkOrRepeatableLinkField.d.ts +12 -0
  21. package/dist/fields/LinkField/RepeatableLinkField/RepeatableLinkField.d.ts +11 -0
  22. package/dist/fields/LinkField/RepeatableLinkField/RepeatableLinkFieldActions.d.ts +11 -0
  23. package/dist/fields/LinkField/RepeatableLinkField/index.d.ts +1 -0
  24. package/dist/fields/LinkField/RepeatableLinkField/useRepeatableLinkField.d.ts +84 -0
  25. package/dist/fields/LinkField/index.d.ts +1 -0
  26. package/dist/fields/LinkField/useLinkField.d.ts +5 -2
  27. package/dist/fields/RichTextField/coreExtensions/ListItem.d.ts +6 -6
  28. package/dist/fields/RichTextField/extensions/Embed/EmbedView.d.ts +1 -1
  29. package/dist/fields/RichTextField/extensions/Image/ImageLinkControl.d.ts +0 -9
  30. package/dist/fields/RichTextField/extensions/Image/ImageView.d.ts +1 -1
  31. package/dist/fields/RichTextField/extensions/Image/useImageView.d.ts +1 -1
  32. package/dist/fields/RichTextField/extensions/Link/LinkModel.d.ts +2 -2
  33. package/dist/fields/RichTextField/extensions/extensions.d.ts +1 -1
  34. package/dist/index.cjs.js +37 -39
  35. package/dist/index.d.ts +8 -8
  36. package/dist/index.es.js +25739 -22410
  37. package/dist/slices/utils.d.ts +101 -27
  38. package/package.json +25 -24
  39. package/dist/fields/LinkField/RepeatableLinkField.d.ts +0 -12
@@ -0,0 +1,415 @@
1
+ import { type AuthStrategy, type EditorConfig } from "../../EditorConfig";
2
+ import { type DocumentVersion } from "./document";
3
+ import type { Repository } from "./repository";
4
+ interface SearchDocumentsArgs {
5
+ coreApiBaseUrl: URL;
6
+ documentSearchBaseUrl: URL;
7
+ authStrategy: AuthStrategy;
8
+ repository: string;
9
+ searchTerm?: string;
10
+ customTypes?: string[];
11
+ tags?: string[];
12
+ authors?: string[];
13
+ status?: DocumentVersion["status"][];
14
+ locale?: string;
15
+ /**
16
+ * TODO: Remove after all repos have been migrated to storageVerison 7 or above (PBD-1908)
17
+ */
18
+ storageVersion?: Repository["storageVersion"];
19
+ searchDocumentsWithInterestingVersions: boolean;
20
+ track: ((args: {
21
+ numberOfResults: number;
22
+ searchQuery: string;
23
+ numberOfWords: number;
24
+ timeToGetResultsInMs: number;
25
+ }) => void) | undefined;
26
+ signal: AbortSignal;
27
+ }
28
+ export declare function searchDocuments(args: SearchDocumentsArgs): Promise<{
29
+ results: {
30
+ id: string;
31
+ title: string;
32
+ language: {
33
+ isMaster?: boolean | undefined;
34
+ id: string;
35
+ label: string;
36
+ };
37
+ custom_type_id: string;
38
+ group_lang_id: string;
39
+ versions: (({
40
+ status: "unclassified";
41
+ } | {
42
+ status: "published";
43
+ } | {
44
+ status: "release";
45
+ release_id: string;
46
+ } | {
47
+ status: "archived";
48
+ }) & {
49
+ tags: string[];
50
+ author: {
51
+ first_name?: string | undefined;
52
+ last_name?: string | undefined;
53
+ email?: string | undefined;
54
+ uploadedAvatar?: string | undefined;
55
+ };
56
+ version_id: string;
57
+ last_modified_date: Date;
58
+ custom_type_label: string;
59
+ preview_image?: string | undefined;
60
+ uid?: string | undefined;
61
+ preview_summary?: string | undefined;
62
+ })[];
63
+ }[];
64
+ } | {
65
+ results: {
66
+ id: string;
67
+ title: string;
68
+ custom_type_id: string;
69
+ group_lang_id: string;
70
+ locale_id?: string | undefined;
71
+ versions: (({
72
+ status: "unclassified";
73
+ } | {
74
+ status: "published";
75
+ } | {
76
+ status: "release";
77
+ release_id: string;
78
+ } | {
79
+ status: "archived";
80
+ }) & {
81
+ tags: string[];
82
+ version_id: string;
83
+ last_modified_date: Date;
84
+ summary?: string | undefined;
85
+ preview_image?: string | undefined;
86
+ uid?: string | undefined;
87
+ custom_type_id?: string | undefined;
88
+ author_ids?: string[] | undefined;
89
+ })[];
90
+ }[];
91
+ }>;
92
+ interface searchDocumentsQueryOptionsArgs {
93
+ searchTerm?: string;
94
+ customTypes?: string[];
95
+ tags?: string[];
96
+ authors?: string[];
97
+ status?: DocumentVersion["status"][];
98
+ locale?: string;
99
+ /**
100
+ * TODO: Remove after all repos have been migrated to storageVerison 7 or above (PBD-1908)
101
+ */
102
+ storageVersion?: Repository["storageVersion"];
103
+ config: SearchDocumentsConfig;
104
+ track?: (args: {
105
+ numberOfResults: number;
106
+ searchQuery: string;
107
+ numberOfWords: number;
108
+ timeToGetResultsInMs: number;
109
+ }) => void;
110
+ }
111
+ export declare function searchDocumentsQueryOptions(args: searchDocumentsQueryOptionsArgs): import("@tanstack/react-query/build/legacy/types").UseQueryOptions<{
112
+ results: {
113
+ id: string;
114
+ title: string;
115
+ language: {
116
+ isMaster?: boolean | undefined;
117
+ id: string;
118
+ label: string;
119
+ };
120
+ custom_type_id: string;
121
+ group_lang_id: string;
122
+ versions: (({
123
+ status: "unclassified";
124
+ } | {
125
+ status: "published";
126
+ } | {
127
+ status: "release";
128
+ release_id: string;
129
+ } | {
130
+ status: "archived";
131
+ }) & {
132
+ tags: string[];
133
+ author: {
134
+ first_name?: string | undefined;
135
+ last_name?: string | undefined;
136
+ email?: string | undefined;
137
+ uploadedAvatar?: string | undefined;
138
+ };
139
+ version_id: string;
140
+ last_modified_date: Date;
141
+ custom_type_label: string;
142
+ preview_image?: string | undefined;
143
+ uid?: string | undefined;
144
+ preview_summary?: string | undefined;
145
+ })[];
146
+ }[];
147
+ } | {
148
+ results: {
149
+ id: string;
150
+ title: string;
151
+ custom_type_id: string;
152
+ group_lang_id: string;
153
+ locale_id?: string | undefined;
154
+ versions: (({
155
+ status: "unclassified";
156
+ } | {
157
+ status: "published";
158
+ } | {
159
+ status: "release";
160
+ release_id: string;
161
+ } | {
162
+ status: "archived";
163
+ }) & {
164
+ tags: string[];
165
+ version_id: string;
166
+ last_modified_date: Date;
167
+ summary?: string | undefined;
168
+ preview_image?: string | undefined;
169
+ uid?: string | undefined;
170
+ custom_type_id?: string | undefined;
171
+ author_ids?: string[] | undefined;
172
+ })[];
173
+ }[];
174
+ }, Error, {
175
+ results: {
176
+ id: string;
177
+ title: string;
178
+ language: {
179
+ isMaster?: boolean | undefined;
180
+ id: string;
181
+ label: string;
182
+ };
183
+ custom_type_id: string;
184
+ group_lang_id: string;
185
+ versions: (({
186
+ status: "unclassified";
187
+ } | {
188
+ status: "published";
189
+ } | {
190
+ status: "release";
191
+ release_id: string;
192
+ } | {
193
+ status: "archived";
194
+ }) & {
195
+ tags: string[];
196
+ author: {
197
+ first_name?: string | undefined;
198
+ last_name?: string | undefined;
199
+ email?: string | undefined;
200
+ uploadedAvatar?: string | undefined;
201
+ };
202
+ version_id: string;
203
+ last_modified_date: Date;
204
+ custom_type_label: string;
205
+ preview_image?: string | undefined;
206
+ uid?: string | undefined;
207
+ preview_summary?: string | undefined;
208
+ })[];
209
+ }[];
210
+ } | {
211
+ results: {
212
+ id: string;
213
+ title: string;
214
+ custom_type_id: string;
215
+ group_lang_id: string;
216
+ locale_id?: string | undefined;
217
+ versions: (({
218
+ status: "unclassified";
219
+ } | {
220
+ status: "published";
221
+ } | {
222
+ status: "release";
223
+ release_id: string;
224
+ } | {
225
+ status: "archived";
226
+ }) & {
227
+ tags: string[];
228
+ version_id: string;
229
+ last_modified_date: Date;
230
+ summary?: string | undefined;
231
+ preview_image?: string | undefined;
232
+ uid?: string | undefined;
233
+ custom_type_id?: string | undefined;
234
+ author_ids?: string[] | undefined;
235
+ })[];
236
+ }[];
237
+ }, readonly ["searchDocuments", {
238
+ readonly coreApiBaseUrl: URL;
239
+ readonly documentSearchBaseUrl: URL;
240
+ readonly authStrategy: AuthStrategy;
241
+ readonly repository: string;
242
+ readonly searchTerm: string | undefined;
243
+ readonly customTypes: string[] | undefined;
244
+ readonly tags: string[] | undefined;
245
+ readonly authors: string[] | undefined;
246
+ readonly status: ("published" | "release" | "archived" | "unclassified")[] | undefined;
247
+ readonly locale: string | undefined;
248
+ readonly searchDocumentsWithInterestingVersions: boolean;
249
+ readonly track: ((args: {
250
+ numberOfResults: number;
251
+ searchQuery: string;
252
+ numberOfWords: number;
253
+ timeToGetResultsInMs: number;
254
+ }) => void) | undefined;
255
+ readonly storageVersion: {
256
+ major: number;
257
+ minor: number;
258
+ } | undefined;
259
+ }]> & {
260
+ initialData?: import("@tanstack/query-core/build/legacy/hydration-DTVzC0E7").L<{
261
+ results: {
262
+ id: string;
263
+ title: string;
264
+ language: {
265
+ isMaster?: boolean | undefined;
266
+ id: string;
267
+ label: string;
268
+ };
269
+ custom_type_id: string;
270
+ group_lang_id: string;
271
+ versions: (({
272
+ status: "unclassified";
273
+ } | {
274
+ status: "published";
275
+ } | {
276
+ status: "release";
277
+ release_id: string;
278
+ } | {
279
+ status: "archived";
280
+ }) & {
281
+ tags: string[];
282
+ author: {
283
+ first_name?: string | undefined;
284
+ last_name?: string | undefined;
285
+ email?: string | undefined;
286
+ uploadedAvatar?: string | undefined;
287
+ };
288
+ version_id: string;
289
+ last_modified_date: Date;
290
+ custom_type_label: string;
291
+ preview_image?: string | undefined;
292
+ uid?: string | undefined;
293
+ preview_summary?: string | undefined;
294
+ })[];
295
+ }[];
296
+ } | {
297
+ results: {
298
+ id: string;
299
+ title: string;
300
+ custom_type_id: string;
301
+ group_lang_id: string;
302
+ locale_id?: string | undefined;
303
+ versions: (({
304
+ status: "unclassified";
305
+ } | {
306
+ status: "published";
307
+ } | {
308
+ status: "release";
309
+ release_id: string;
310
+ } | {
311
+ status: "archived";
312
+ }) & {
313
+ tags: string[];
314
+ version_id: string;
315
+ last_modified_date: Date;
316
+ summary?: string | undefined;
317
+ preview_image?: string | undefined;
318
+ uid?: string | undefined;
319
+ custom_type_id?: string | undefined;
320
+ author_ids?: string[] | undefined;
321
+ })[];
322
+ }[];
323
+ }> | undefined;
324
+ } & {
325
+ queryKey: import("@tanstack/query-core/build/legacy/hydration-DTVzC0E7").E<readonly ["searchDocuments", {
326
+ readonly coreApiBaseUrl: URL;
327
+ readonly documentSearchBaseUrl: URL;
328
+ readonly authStrategy: AuthStrategy;
329
+ readonly repository: string;
330
+ readonly searchTerm: string | undefined;
331
+ readonly customTypes: string[] | undefined;
332
+ readonly tags: string[] | undefined;
333
+ readonly authors: string[] | undefined;
334
+ readonly status: ("published" | "release" | "archived" | "unclassified")[] | undefined;
335
+ readonly locale: string | undefined;
336
+ readonly searchDocumentsWithInterestingVersions: boolean;
337
+ readonly track: ((args: {
338
+ numberOfResults: number;
339
+ searchQuery: string;
340
+ numberOfWords: number;
341
+ timeToGetResultsInMs: number;
342
+ }) => void) | undefined;
343
+ readonly storageVersion: {
344
+ major: number;
345
+ minor: number;
346
+ } | undefined;
347
+ }], {
348
+ results: {
349
+ id: string;
350
+ title: string;
351
+ language: {
352
+ isMaster?: boolean | undefined;
353
+ id: string;
354
+ label: string;
355
+ };
356
+ custom_type_id: string;
357
+ group_lang_id: string;
358
+ versions: (({
359
+ status: "unclassified";
360
+ } | {
361
+ status: "published";
362
+ } | {
363
+ status: "release";
364
+ release_id: string;
365
+ } | {
366
+ status: "archived";
367
+ }) & {
368
+ tags: string[];
369
+ author: {
370
+ first_name?: string | undefined;
371
+ last_name?: string | undefined;
372
+ email?: string | undefined;
373
+ uploadedAvatar?: string | undefined;
374
+ };
375
+ version_id: string;
376
+ last_modified_date: Date;
377
+ custom_type_label: string;
378
+ preview_image?: string | undefined;
379
+ uid?: string | undefined;
380
+ preview_summary?: string | undefined;
381
+ })[];
382
+ }[];
383
+ } | {
384
+ results: {
385
+ id: string;
386
+ title: string;
387
+ custom_type_id: string;
388
+ group_lang_id: string;
389
+ locale_id?: string | undefined;
390
+ versions: (({
391
+ status: "unclassified";
392
+ } | {
393
+ status: "published";
394
+ } | {
395
+ status: "release";
396
+ release_id: string;
397
+ } | {
398
+ status: "archived";
399
+ }) & {
400
+ tags: string[];
401
+ version_id: string;
402
+ last_modified_date: Date;
403
+ summary?: string | undefined;
404
+ preview_image?: string | undefined;
405
+ uid?: string | undefined;
406
+ custom_type_id?: string | undefined;
407
+ author_ids?: string[] | undefined;
408
+ })[];
409
+ }[];
410
+ }>;
411
+ };
412
+ type SearchDocumentsConfig = Pick<EditorConfig & {
413
+ searchDocuments: true;
414
+ }, "authStrategy" | "coreApiBaseUrl" | "documentSearchBaseUrl" | "repository" | "searchDocuments" | "searchDocumentsWithInterestingVersions">;
415
+ export {};
@@ -1,5 +1,7 @@
1
1
  export * from "./customType";
2
2
  export * from "./document";
3
+ export * from "./documentSearch";
3
4
  export * from "./onboarding";
4
5
  export * from "./repository";
6
+ export * from "./role";
5
7
  export * from "./user";