@prismicio/editor-fields 0.4.49-alpha.feat-onboarding-guide.4 → 0.4.49-alpha.feat-onboarding-guide.5
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 +3 -0
- package/dist/SectionEditor.d.ts +2 -2
- package/dist/SliceSelection.d.ts +25 -0
- package/dist/core/EditorErrorBoundary.d.ts +5 -0
- package/dist/core/MediaLibrary/components/MediaLibraryContext.d.ts +1 -0
- package/dist/core/MediaLibrary/components/{MediaLibraryAssetCount.d.ts → Toolbar/AssetCount.d.ts} +1 -1
- package/dist/core/MediaLibrary/components/Toolbar/Toolbar.d.ts +2 -0
- package/dist/core/MediaLibrary/components/Toolbar/filters/AssetTypeFilter.d.ts +2 -0
- package/dist/core/MediaLibrary/components/Toolbar/filters/TagsFilter.d.ts +2 -0
- package/dist/core/MediaLibrary/components/Toolbar/filters/UploaderFilter.d.ts +2 -0
- package/dist/core/MediaLibrary/components/Toolbar/filters/index.d.ts +3 -0
- package/dist/core/MediaLibrary/components/Toolbar/index.d.ts +1 -0
- package/dist/core/MediaLibrary/hooks/mediaLibraryData.d.ts +21 -5
- package/dist/core/MediaLibrary/hooks/uploadersData.d.ts +30 -0
- package/dist/core/MediaLibrary/hooks/useMediaLibraryCacheInvalidation.d.ts +1 -0
- package/dist/core/MediaLibrary/hooks/useSelectedMedia.d.ts +1 -0
- package/dist/core/OnboardingGuide/OnboardingGuide.d.ts +7 -36
- package/dist/core/OnboardingGuide/components/OnboardingCard.d.ts +3 -0
- package/dist/core/OnboardingGuide/components/OnboardingProvider.d.ts +10 -16
- package/dist/core/OnboardingGuide/content.d.ts +1 -2
- package/dist/core/OnboardingGuide/index.d.ts +0 -1
- package/dist/core/OnboardingGuide/types.d.ts +6 -23
- package/dist/core/SelectionManager/SelectionManagerTypes.d.ts +13 -10
- package/dist/core/service/document.d.ts +37 -6
- package/dist/core/service/index.d.ts +1 -0
- package/dist/core/service/repository.d.ts +10 -0
- package/dist/core/service/user.d.ts +56 -0
- package/dist/fields/ImageField/CropperDialog/croppedImage.d.ts +1 -1
- package/dist/index.cjs.js +35 -35
- package/dist/index.d.ts +3 -2
- package/dist/index.es.js +16205 -15911
- package/package.json +4 -5
- package/dist/Selection.d.ts +0 -28
- package/dist/core/MediaLibrary/components/MediaLibraryToolbar.d.ts +0 -2
- package/dist/core/OnboardingGuide/components/OnboardingGuideUI.d.ts +0 -10
package/dist/EditorConfig.d.ts
CHANGED
package/dist/SectionEditor.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type Document } from "@prismicio/types-internal/lib/content";
|
|
3
3
|
import type { StaticSection } from "@prismicio/types-internal/lib/customtypes";
|
|
4
|
-
import type {
|
|
4
|
+
import type { SliceSelection } from "./SliceSelection";
|
|
5
5
|
interface Props {
|
|
6
6
|
id: string;
|
|
7
7
|
readOnly: boolean;
|
|
8
|
-
selection?:
|
|
8
|
+
selection?: SliceSelection;
|
|
9
9
|
section: StaticSection;
|
|
10
10
|
content: Document;
|
|
11
11
|
onContentChange: (content: Document) => void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface SliceSelection {
|
|
3
|
+
/**
|
|
4
|
+
* The keys of the slices that are currently selected.
|
|
5
|
+
*/
|
|
6
|
+
ids: string[];
|
|
7
|
+
isSelected: (id: string) => boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Update the current selection.
|
|
10
|
+
* @param args.requestedFrom Which Area of the app is requesting the change.
|
|
11
|
+
* This is useful to know how/whether to scroll to the matching selection in the other area.
|
|
12
|
+
*/
|
|
13
|
+
update: (args: SliceSelectionUpdateArgs) => void;
|
|
14
|
+
}
|
|
15
|
+
export interface SliceSelectionUpdateArgs {
|
|
16
|
+
id: string;
|
|
17
|
+
requestedFrom: "all" | SliceSelectionArea;
|
|
18
|
+
shiftKey?: boolean;
|
|
19
|
+
metaKey?: boolean;
|
|
20
|
+
ids?: string[];
|
|
21
|
+
}
|
|
22
|
+
export type SliceSelectionArea = "sliceTable" | "sliceFieldSet";
|
|
23
|
+
export declare function getSliceSelectionDOMId(area: SliceSelectionArea, id: string): string;
|
|
24
|
+
export declare const SliceSelectionContext: import("react").Context<SliceSelection>;
|
|
25
|
+
export declare function useSliceSelection(): SliceSelection;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type ErrorBoundaryProps } from "@prismicio/editor-ui";
|
|
3
|
+
type EditorErrorBoundaryProps = Omit<ErrorBoundaryProps, "onReset">;
|
|
4
|
+
export declare function EditorErrorBoundary(props: EditorErrorBoundaryProps): JSX.Element;
|
|
5
|
+
export {};
|
|
@@ -32,6 +32,7 @@ interface MediaLibraryContextValue {
|
|
|
32
32
|
* Possible to change using an `assetType` prop in MediaLibrary
|
|
33
33
|
*/
|
|
34
34
|
initialAssetType: MediaAssetType;
|
|
35
|
+
uploaderId?: string;
|
|
35
36
|
tagIds: string[];
|
|
36
37
|
onFilterChange: (filters: Partial<MediaLibraryFilters>) => void;
|
|
37
38
|
isSearchingMedia: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Toolbar } from "./Toolbar";
|
|
@@ -11,6 +11,7 @@ export declare const mediaAssetType: z.ZodObject<{
|
|
|
11
11
|
last_modified: z.ZodNumber;
|
|
12
12
|
url: z.ZodString;
|
|
13
13
|
alt: z.ZodOptional<z.ZodString>;
|
|
14
|
+
uploader_id: z.ZodOptional<z.ZodString>;
|
|
14
15
|
size: z.ZodNumber;
|
|
15
16
|
notes: z.ZodOptional<z.ZodString>;
|
|
16
17
|
credits: z.ZodOptional<z.ZodString>;
|
|
@@ -71,6 +72,7 @@ export declare const mediaAssetType: z.ZodObject<{
|
|
|
71
72
|
width?: number | undefined;
|
|
72
73
|
height?: number | undefined;
|
|
73
74
|
alt?: string | undefined;
|
|
75
|
+
uploader_id?: string | undefined;
|
|
74
76
|
notes?: string | undefined;
|
|
75
77
|
credits?: string | undefined;
|
|
76
78
|
search_highlight?: {
|
|
@@ -98,6 +100,7 @@ export declare const mediaAssetType: z.ZodObject<{
|
|
|
98
100
|
width?: number | undefined;
|
|
99
101
|
height?: number | undefined;
|
|
100
102
|
alt?: string | undefined;
|
|
103
|
+
uploader_id?: string | undefined;
|
|
101
104
|
notes?: string | undefined;
|
|
102
105
|
credits?: string | undefined;
|
|
103
106
|
search_highlight?: {
|
|
@@ -123,6 +126,7 @@ export declare const mediaSearchResponse: z.ZodObject<{
|
|
|
123
126
|
last_modified: z.ZodNumber;
|
|
124
127
|
url: z.ZodString;
|
|
125
128
|
alt: z.ZodOptional<z.ZodString>;
|
|
129
|
+
uploader_id: z.ZodOptional<z.ZodString>;
|
|
126
130
|
size: z.ZodNumber;
|
|
127
131
|
notes: z.ZodOptional<z.ZodString>;
|
|
128
132
|
credits: z.ZodOptional<z.ZodString>;
|
|
@@ -183,6 +187,7 @@ export declare const mediaSearchResponse: z.ZodObject<{
|
|
|
183
187
|
width?: number | undefined;
|
|
184
188
|
height?: number | undefined;
|
|
185
189
|
alt?: string | undefined;
|
|
190
|
+
uploader_id?: string | undefined;
|
|
186
191
|
notes?: string | undefined;
|
|
187
192
|
credits?: string | undefined;
|
|
188
193
|
search_highlight?: {
|
|
@@ -210,6 +215,7 @@ export declare const mediaSearchResponse: z.ZodObject<{
|
|
|
210
215
|
width?: number | undefined;
|
|
211
216
|
height?: number | undefined;
|
|
212
217
|
alt?: string | undefined;
|
|
218
|
+
uploader_id?: string | undefined;
|
|
213
219
|
notes?: string | undefined;
|
|
214
220
|
credits?: string | undefined;
|
|
215
221
|
search_highlight?: {
|
|
@@ -240,6 +246,7 @@ export declare const mediaSearchResponse: z.ZodObject<{
|
|
|
240
246
|
width?: number | undefined;
|
|
241
247
|
height?: number | undefined;
|
|
242
248
|
alt?: string | undefined;
|
|
249
|
+
uploader_id?: string | undefined;
|
|
243
250
|
notes?: string | undefined;
|
|
244
251
|
credits?: string | undefined;
|
|
245
252
|
search_highlight?: {
|
|
@@ -271,6 +278,7 @@ export declare const mediaSearchResponse: z.ZodObject<{
|
|
|
271
278
|
width?: number | undefined;
|
|
272
279
|
height?: number | undefined;
|
|
273
280
|
alt?: string | undefined;
|
|
281
|
+
uploader_id?: string | undefined;
|
|
274
282
|
notes?: string | undefined;
|
|
275
283
|
credits?: string | undefined;
|
|
276
284
|
search_highlight?: {
|
|
@@ -291,12 +299,13 @@ export interface ExternalImage {
|
|
|
291
299
|
alt?: string;
|
|
292
300
|
}
|
|
293
301
|
export type MediaAssetOrExternalImage = MediaAsset | ExternalImage;
|
|
294
|
-
export declare function searchMedia(baseUrl: URL | undefined, repository: string, authStrategy: AuthStrategy, assetType: MediaAssetType,
|
|
302
|
+
export declare function searchMedia(baseUrl: URL | undefined, repository: string, authStrategy: AuthStrategy, keyword: string, assetType: MediaAssetType, uploaderId: string | undefined, tags: string, page: number, cursor?: string): Promise<{
|
|
295
303
|
time: string;
|
|
296
|
-
assetType: MediaAssetType;
|
|
297
304
|
keyword: string;
|
|
298
|
-
|
|
305
|
+
assetType: MediaAssetType;
|
|
306
|
+
uploaderId: string | undefined;
|
|
299
307
|
tags: string;
|
|
308
|
+
page: number;
|
|
300
309
|
total: number;
|
|
301
310
|
items: {
|
|
302
311
|
tags: {
|
|
@@ -317,6 +326,7 @@ export declare function searchMedia(baseUrl: URL | undefined, repository: string
|
|
|
317
326
|
width?: number | undefined;
|
|
318
327
|
height?: number | undefined;
|
|
319
328
|
alt?: string | undefined;
|
|
329
|
+
uploader_id?: string | undefined;
|
|
320
330
|
notes?: string | undefined;
|
|
321
331
|
credits?: string | undefined;
|
|
322
332
|
search_highlight?: {
|
|
@@ -335,12 +345,14 @@ interface UseMediaLibrarySearchArgs {
|
|
|
335
345
|
export interface MediaLibraryFilters {
|
|
336
346
|
keyword: string;
|
|
337
347
|
assetType: MediaAssetType;
|
|
348
|
+
uploaderId?: string;
|
|
338
349
|
tagIds: string[];
|
|
339
350
|
}
|
|
340
351
|
export declare const defaultMediaLibraryFilters: MediaLibraryFilters;
|
|
341
352
|
export declare function useMediaSearch(args: UseMediaLibrarySearchArgs): {
|
|
342
353
|
keyword: string;
|
|
343
354
|
assetType: MediaAssetType;
|
|
355
|
+
uploaderId: string | undefined;
|
|
344
356
|
tagIds: string[];
|
|
345
357
|
setFilters: (filters: Partial<MediaLibraryFilters>) => void;
|
|
346
358
|
resetFilters: () => void;
|
|
@@ -363,6 +375,7 @@ export declare function useMediaSearch(args: UseMediaLibrarySearchArgs): {
|
|
|
363
375
|
width?: number | undefined;
|
|
364
376
|
height?: number | undefined;
|
|
365
377
|
alt?: string | undefined;
|
|
378
|
+
uploader_id?: string | undefined;
|
|
366
379
|
notes?: string | undefined;
|
|
367
380
|
credits?: string | undefined;
|
|
368
381
|
search_highlight?: {
|
|
@@ -393,7 +406,7 @@ declare function updateMedia(newFiles: {
|
|
|
393
406
|
declare function deleteMedia(mediaIds: string[]): void;
|
|
394
407
|
declare function deleteSearchData(args: MediaLibraryFilters): void;
|
|
395
408
|
type MediaPage = Awaited<ReturnType<typeof searchMedia>>;
|
|
396
|
-
export declare function getMedia(allPages: MediaPage[], assetType: MediaAssetType,
|
|
409
|
+
export declare function getMedia(allPages: MediaPage[], keyword: string, assetType: MediaAssetType, uploaderId: string | undefined, tags: string): {
|
|
397
410
|
tags: {
|
|
398
411
|
id: string;
|
|
399
412
|
name: string;
|
|
@@ -412,6 +425,7 @@ export declare function getMedia(allPages: MediaPage[], assetType: MediaAssetTyp
|
|
|
412
425
|
width?: number | undefined;
|
|
413
426
|
height?: number | undefined;
|
|
414
427
|
alt?: string | undefined;
|
|
428
|
+
uploader_id?: string | undefined;
|
|
415
429
|
notes?: string | undefined;
|
|
416
430
|
credits?: string | undefined;
|
|
417
431
|
search_highlight?: {
|
|
@@ -432,6 +446,7 @@ interface RevalidateFirstPageArgs {
|
|
|
432
446
|
config: EditorConfig;
|
|
433
447
|
keyword?: string;
|
|
434
448
|
assetType?: MediaAssetType;
|
|
449
|
+
uploaderId?: string;
|
|
435
450
|
tagIds?: string[];
|
|
436
451
|
}
|
|
437
452
|
/**
|
|
@@ -453,8 +468,9 @@ export interface SearchMediaArgs {
|
|
|
453
468
|
assetsApiBaseUrl: URL | undefined;
|
|
454
469
|
repository: string;
|
|
455
470
|
authStrategy: AuthStrategy;
|
|
456
|
-
assetType: MediaAssetType;
|
|
457
471
|
keyword: string;
|
|
472
|
+
assetType: MediaAssetType;
|
|
473
|
+
uploaderId?: string;
|
|
458
474
|
tagIds: string[];
|
|
459
475
|
page: number;
|
|
460
476
|
cursor?: string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare function useUploaders(): {
|
|
3
|
+
uploaders: {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
firstName: string;
|
|
7
|
+
lastName: string;
|
|
8
|
+
email: string;
|
|
9
|
+
uploadedAvatar: string | undefined;
|
|
10
|
+
}[];
|
|
11
|
+
uploadersById: Map<string, {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
firstName: string;
|
|
15
|
+
lastName: string;
|
|
16
|
+
email: string;
|
|
17
|
+
uploadedAvatar: string | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
};
|
|
20
|
+
export declare const uploaderSchema: z.ZodObject<{
|
|
21
|
+
id: z.ZodString;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
id: string;
|
|
24
|
+
}, {
|
|
25
|
+
id: string;
|
|
26
|
+
}>;
|
|
27
|
+
export type Uploader = z.TypeOf<typeof uploaderSchema>;
|
|
28
|
+
type UpdateUploadersFunction = (currentItems: Uploader[]) => Uploader[] | undefined;
|
|
29
|
+
export declare function updateUploadersCache(updateFunction: UpdateUploadersFunction): void;
|
|
30
|
+
export {};
|
|
@@ -6,6 +6,7 @@ interface UseMediaLibraryCacheInvalidationArgs {
|
|
|
6
6
|
config: EditorConfig;
|
|
7
7
|
keyword: string;
|
|
8
8
|
assetType: MediaAssetType;
|
|
9
|
+
uploaderId?: string;
|
|
9
10
|
tagIds: string[];
|
|
10
11
|
}
|
|
11
12
|
export declare function useMediaLibraryCacheInvalidation(args: UseMediaLibraryCacheInvalidationArgs): {
|
|
@@ -17,6 +17,7 @@ export declare function useSelectedMedia(): {
|
|
|
17
17
|
width?: number | undefined;
|
|
18
18
|
height?: number | undefined;
|
|
19
19
|
alt?: string | undefined;
|
|
20
|
+
uploader_id?: string | undefined;
|
|
20
21
|
notes?: string | undefined;
|
|
21
22
|
credits?: string | undefined;
|
|
22
23
|
search_highlight?: {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
2
|
+
import { type EditorConfig } from "../../EditorConfig";
|
|
3
|
+
import type { OnboardingCardVariant, OnboardingTrackingFn } from "./types";
|
|
3
4
|
interface OnboardingGuideProps {
|
|
5
|
+
config: EditorConfig;
|
|
4
6
|
/**
|
|
5
7
|
* Whether the whole guide (including 'Get started' button) should be visible
|
|
6
8
|
*
|
|
@@ -13,41 +15,10 @@ interface OnboardingGuideProps {
|
|
|
13
15
|
* @default "default"
|
|
14
16
|
*/
|
|
15
17
|
variant?: OnboardingCardVariant;
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* @default "other"
|
|
21
|
-
*/
|
|
22
|
-
framework?: OnboardingFramework;
|
|
23
|
-
/**
|
|
24
|
-
* Function to track onboarding events
|
|
25
|
-
*
|
|
26
|
-
* - onboarding:step-completed,
|
|
27
|
-
* - onboarding:step-opened,
|
|
28
|
-
* - onboarding:guide-completed
|
|
29
|
-
* */
|
|
30
|
-
track: OnboardingTrackFn;
|
|
31
|
-
/**
|
|
32
|
-
* Fetches the current onboarding state
|
|
33
|
-
*
|
|
34
|
-
* @returns {OnboardingState}
|
|
35
|
-
*/
|
|
36
|
-
fetchState: () => Promise<OnboardingState>;
|
|
37
|
-
/**
|
|
38
|
-
* Updates the onboarding steps progress state
|
|
39
|
-
*
|
|
40
|
-
* @param {OnboardingStepId[]} stepId
|
|
41
|
-
*/
|
|
42
|
-
toggleStep: (stepId: OnboardingStepId) => Promise<OnboardingStepId[]>;
|
|
43
|
-
/**
|
|
44
|
-
* Updates the onboarding guide state to completed
|
|
45
|
-
*
|
|
46
|
-
* @returns {boolean}
|
|
47
|
-
*/
|
|
48
|
-
resolveGuide: () => Promise<{
|
|
49
|
-
isResolved: boolean;
|
|
50
|
-
}>;
|
|
18
|
+
/** Link to the video tutorials */
|
|
19
|
+
tutorialLink?: string;
|
|
20
|
+
/** Function to track onboarding events */
|
|
21
|
+
trackingFn: OnboardingTrackingFn;
|
|
51
22
|
}
|
|
52
23
|
export declare function OnboardingGuide(props: OnboardingGuideProps): JSX.Element;
|
|
53
24
|
export {};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import type { OnboardingCardVariant } from "../types";
|
|
2
3
|
interface OnboardingCardProps {
|
|
4
|
+
variant: OnboardingCardVariant;
|
|
5
|
+
tutorialLink?: string;
|
|
3
6
|
onClose?: () => void;
|
|
4
7
|
}
|
|
5
8
|
export declare function OnboardingCard(props: OnboardingCardProps): JSX.Element;
|
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import { type OnboardingCardVariant, type
|
|
3
|
-
interface OnboardingProviderProps {
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
variant: OnboardingCardVariant;
|
|
6
|
-
framework: OnboardingFramework;
|
|
7
|
-
onComplete?: () => void;
|
|
8
|
-
track: OnboardingTrackFn;
|
|
9
|
-
fetchState: () => Promise<OnboardingState>;
|
|
10
|
-
toggleStep: (stepId: OnboardingStepId) => Promise<OnboardingStepId[]>;
|
|
11
|
-
}
|
|
12
|
-
export declare function OnboardingProvider(props: OnboardingProviderProps): JSX.Element;
|
|
2
|
+
import { type OnboardingCardVariant, type OnboardingStep, type OnboardingStepId, type OnboardingTrackingFn } from "../types";
|
|
13
3
|
interface OnboardingContext {
|
|
14
4
|
steps: OnboardingStep[];
|
|
15
|
-
|
|
16
|
-
variant: OnboardingCardVariant;
|
|
17
|
-
tutorialLink?: string;
|
|
18
|
-
isResolved?: boolean;
|
|
5
|
+
completedStepCount: number;
|
|
19
6
|
toggleStepComplete: (step: OnboardingStep) => void;
|
|
20
7
|
getStepIndex: (step: OnboardingStepId) => number;
|
|
21
8
|
isStepComplete: (step: OnboardingStep) => boolean;
|
|
22
|
-
|
|
9
|
+
trackingFn: OnboardingTrackingFn;
|
|
23
10
|
}
|
|
24
11
|
declare const OnboardingContext: import("react").Context<OnboardingContext | undefined>;
|
|
12
|
+
interface OnboardingProviderProps {
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
variant: OnboardingCardVariant;
|
|
15
|
+
onComplete?: () => void;
|
|
16
|
+
trackingFn: OnboardingTrackingFn;
|
|
17
|
+
}
|
|
18
|
+
export declare function OnboardingProvider(props: OnboardingProviderProps): JSX.Element;
|
|
25
19
|
export declare const useOnboardingContext: () => OnboardingContext;
|
|
26
20
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { OnboardingStep } from "./types";
|
|
2
2
|
export declare const onboardingSteps: OnboardingStep[];
|
|
3
3
|
export declare const onboardingExperimentSteps: OnboardingStep[];
|
|
4
|
-
export declare const tutorialLinks: Record<OnboardingFramework, string>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
declare const onboardingStepStatusesSchema: z.ZodObject<{
|
|
4
|
-
createProject: z.
|
|
3
|
+
export declare const onboardingStepStatusesSchema: z.ZodObject<{
|
|
4
|
+
createProject: z.ZodLiteral<true>;
|
|
5
5
|
createPageType: z.ZodBoolean;
|
|
6
6
|
codePage: z.ZodBoolean;
|
|
7
7
|
createSlice: z.ZodBoolean;
|
|
@@ -9,7 +9,7 @@ declare const onboardingStepStatusesSchema: z.ZodObject<{
|
|
|
9
9
|
createContent: z.ZodBoolean;
|
|
10
10
|
renderPage: z.ZodBoolean;
|
|
11
11
|
}, "strip", z.ZodTypeAny, {
|
|
12
|
-
createProject:
|
|
12
|
+
createProject: true;
|
|
13
13
|
createPageType: boolean;
|
|
14
14
|
codePage: boolean;
|
|
15
15
|
createSlice: boolean;
|
|
@@ -17,7 +17,7 @@ declare const onboardingStepStatusesSchema: z.ZodObject<{
|
|
|
17
17
|
createContent: boolean;
|
|
18
18
|
renderPage: boolean;
|
|
19
19
|
}, {
|
|
20
|
-
createProject:
|
|
20
|
+
createProject: true;
|
|
21
21
|
createPageType: boolean;
|
|
22
22
|
codePage: boolean;
|
|
23
23
|
createSlice: boolean;
|
|
@@ -25,7 +25,7 @@ declare const onboardingStepStatusesSchema: z.ZodObject<{
|
|
|
25
25
|
createContent: boolean;
|
|
26
26
|
renderPage: boolean;
|
|
27
27
|
}>;
|
|
28
|
-
type OnboardingStepStatuses = z.infer<typeof onboardingStepStatusesSchema>;
|
|
28
|
+
export type OnboardingStepStatuses = z.infer<typeof onboardingStepStatusesSchema>;
|
|
29
29
|
export type OnboardingStepId = keyof OnboardingStepStatuses;
|
|
30
30
|
export interface OnboardingStep {
|
|
31
31
|
id: OnboardingStepId;
|
|
@@ -35,22 +35,5 @@ export interface OnboardingStep {
|
|
|
35
35
|
videoUrl?: string;
|
|
36
36
|
defaultCompleted?: boolean;
|
|
37
37
|
}
|
|
38
|
-
export type OnboardingState = {
|
|
39
|
-
completedSteps: OnboardingStepId[];
|
|
40
|
-
isResolved: boolean;
|
|
41
|
-
};
|
|
42
38
|
export type OnboardingCardVariant = "default" | "light" | "dark";
|
|
43
|
-
export type
|
|
44
|
-
export type OnboardingTrackEvent = {
|
|
45
|
-
event: "onboarding:step-completed";
|
|
46
|
-
stepId: OnboardingStepId;
|
|
47
|
-
stepTitle: string;
|
|
48
|
-
} | {
|
|
49
|
-
event: "onboarding:step-opened";
|
|
50
|
-
stepId: OnboardingStepId;
|
|
51
|
-
stepTitle: string;
|
|
52
|
-
} | {
|
|
53
|
-
event: "onboarding:completed";
|
|
54
|
-
};
|
|
55
|
-
export type OnboardingTrackFn = (args: OnboardingTrackEvent) => void;
|
|
56
|
-
export {};
|
|
39
|
+
export type OnboardingTrackingFn = (args: Record<string, string>) => void;
|
|
@@ -57,21 +57,22 @@ export type SelectionManager = {
|
|
|
57
57
|
* Gets the current selection state. This is used when performing any action with the selection.
|
|
58
58
|
* @returns The selection state object.
|
|
59
59
|
*/
|
|
60
|
-
getSelectionState: () =>
|
|
61
|
-
selectedIds: ID[];
|
|
62
|
-
excludedIds: ID[];
|
|
63
|
-
isAllSelected: boolean;
|
|
64
|
-
selectedCount: number;
|
|
65
|
-
};
|
|
60
|
+
getSelectionState: () => SelectionState;
|
|
66
61
|
/**
|
|
67
62
|
* Count of selected items.
|
|
68
63
|
*/
|
|
69
64
|
selectedCount: number;
|
|
70
65
|
totalItemCount: number;
|
|
71
66
|
isSelectAllEnabled: boolean;
|
|
72
|
-
state:
|
|
67
|
+
state: SelectionManagerState;
|
|
73
68
|
};
|
|
74
|
-
|
|
69
|
+
interface SelectionState {
|
|
70
|
+
selectedIds: ID[];
|
|
71
|
+
excludedIds: ID[];
|
|
72
|
+
isAllSelected: boolean;
|
|
73
|
+
selectedCount: number;
|
|
74
|
+
}
|
|
75
|
+
export interface SelectionManagerState {
|
|
75
76
|
/**
|
|
76
77
|
* Set of selected IDs.
|
|
77
78
|
*/
|
|
@@ -86,8 +87,10 @@ export interface CoreSelectionState {
|
|
|
86
87
|
isAllSelected: boolean;
|
|
87
88
|
}
|
|
88
89
|
export interface SelectionManagerProviderProps extends PropsWithChildren {
|
|
90
|
+
initialState?: Partial<SelectionManagerState>;
|
|
89
91
|
initialTotalItemCount?: number;
|
|
90
92
|
isSelectAllEnabled?: boolean;
|
|
91
93
|
}
|
|
92
|
-
export type UseSelectionManager = Omit<SelectionManager, "
|
|
93
|
-
export type SelectionStateListener = (state:
|
|
94
|
+
export type UseSelectionManager = Omit<SelectionManager, "setTotalItemCount" | "totalItemCount" | "state"> & Pick<SelectionManagerState, "isAllSelected">;
|
|
95
|
+
export type SelectionStateListener = (state: SelectionState) => void;
|
|
96
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { QueryClient } from "@tanstack/react-query";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
import type { AuthStrategy } from "../../EditorConfig";
|
|
3
4
|
export declare const languageOkType: z.ZodObject<{
|
|
@@ -248,7 +249,7 @@ export declare const documentMetaOkType: z.ZodObject<{
|
|
|
248
249
|
})[];
|
|
249
250
|
title?: string | null | undefined;
|
|
250
251
|
}>;
|
|
251
|
-
declare const
|
|
252
|
+
declare const getDocumentListSchema: z.ZodObject<{
|
|
252
253
|
total: z.ZodNumber;
|
|
253
254
|
cursor: z.ZodOptional<z.ZodString>;
|
|
254
255
|
results: z.ZodArray<z.ZodObject<{
|
|
@@ -519,12 +520,28 @@ declare const documentsFullTextSearchAPISchemaOkType: z.ZodObject<{
|
|
|
519
520
|
}, z.ZodTypeAny, "passthrough">[];
|
|
520
521
|
}>;
|
|
521
522
|
export type Language = z.TypeOf<typeof languageOkType>;
|
|
522
|
-
export type
|
|
523
|
+
export type GetDocumentListSchema = z.TypeOf<typeof getDocumentListSchema>;
|
|
523
524
|
export type DocumentFullTextSearchApi = z.TypeOf<typeof documentsFullTextSearchAPISchemaOkType>;
|
|
524
525
|
export type DocumentMeta = z.TypeOf<typeof documentMetaOkType>;
|
|
525
526
|
export type DocumentVersion = z.TypeOf<typeof documentVersionOkType>;
|
|
526
527
|
export type DocumentStatus = DocumentVersion["status"];
|
|
527
|
-
export declare function getDocuments(baseUrl: URL, authStrategy: AuthStrategy, queryString: string, limit?: number, cursor?: string): Promise<
|
|
528
|
+
export declare function getDocuments(baseUrl: URL, authStrategy: AuthStrategy, queryString: string, limit?: number, cursor?: string): Promise<GetDocumentListSchema>;
|
|
529
|
+
export interface GetDocumentListArgs {
|
|
530
|
+
baseUrl: URL;
|
|
531
|
+
authStrategy: AuthStrategy;
|
|
532
|
+
signal?: AbortSignal | null | undefined;
|
|
533
|
+
limit?: number;
|
|
534
|
+
cursor?: string;
|
|
535
|
+
status?: string[];
|
|
536
|
+
authors?: string[];
|
|
537
|
+
language?: string;
|
|
538
|
+
group_lang_id?: string;
|
|
539
|
+
document_id?: string[];
|
|
540
|
+
customTypes?: string[];
|
|
541
|
+
tags?: string[];
|
|
542
|
+
term?: string;
|
|
543
|
+
}
|
|
544
|
+
export declare function getDocumentList(args: GetDocumentListArgs): Promise<GetDocumentListSchema>;
|
|
528
545
|
export declare function searchFullTextDocuments(baseUrl: URL, authStrategy: AuthStrategy, queryString: string, options?: Pick<RequestInit, "signal">): Promise<DocumentFullTextSearchApi>;
|
|
529
546
|
export declare function makeSearchFullTextDocumentsQueryString(args: {
|
|
530
547
|
repository: string;
|
|
@@ -539,10 +556,9 @@ export type SearchDocumentParams = {
|
|
|
539
556
|
};
|
|
540
557
|
export declare function createSearchParams<T extends string>(params: {
|
|
541
558
|
name: T;
|
|
542
|
-
values: string[];
|
|
559
|
+
values: (string | undefined)[];
|
|
543
560
|
}[]): [string, string][];
|
|
544
561
|
export declare function getDocumentByDocumentId(baseUrl: URL, authStrategy: AuthStrategy, id: string): Promise<DocumentMeta>;
|
|
545
|
-
export declare function getDocumentsById(baseUrl: URL, authStrategy: AuthStrategy, ids: string[]): Promise<GetsDocumentApi>;
|
|
546
562
|
export declare const documentSchema: z.ZodEffects<z.ZodType<unknown, z.ZodTypeDef, unknown>, {
|
|
547
563
|
[x: string]: import("@prismicio/types-internal/lib/content").GroupContent | {
|
|
548
564
|
type: string;
|
|
@@ -2650,7 +2666,9 @@ export declare const sliceItemContentSchema: z.ZodEffects<z.ZodUnknown, {
|
|
|
2650
2666
|
} & {
|
|
2651
2667
|
date?: string | null | undefined;
|
|
2652
2668
|
}) | ({
|
|
2653
|
-
id: string;
|
|
2669
|
+
id: string; /**
|
|
2670
|
+
* Returns updated document or undefined if document should be removed
|
|
2671
|
+
*/
|
|
2654
2672
|
url: string;
|
|
2655
2673
|
name: string;
|
|
2656
2674
|
kind: string;
|
|
@@ -4035,4 +4053,17 @@ export declare const sliceItemContentSchema: z.ZodEffects<z.ZodUnknown, {
|
|
|
4035
4053
|
__TYPE__: "SeparatorContent";
|
|
4036
4054
|
};
|
|
4037
4055
|
}, unknown>;
|
|
4056
|
+
export declare const documentKeys: {
|
|
4057
|
+
all: () => readonly ["documents"];
|
|
4058
|
+
lists: () => readonly ["documents", "list"];
|
|
4059
|
+
list: (args: GetDocumentListArgs) => readonly ["documents", "list", GetDocumentListArgs];
|
|
4060
|
+
infiniteLists: () => readonly ["documents", "list:infinite"];
|
|
4061
|
+
infiniteList: (args: GetDocumentListArgs) => readonly ["documents", "list:infinite", GetDocumentListArgs];
|
|
4062
|
+
};
|
|
4063
|
+
/**
|
|
4064
|
+
* Returns updated document or undefined if document should be removed
|
|
4065
|
+
*/
|
|
4066
|
+
type UpdateDocumentFunction = (document: DocumentMeta, page: GetDocumentListSchema) => DocumentMeta | undefined;
|
|
4067
|
+
export declare function updateDocumentListData(queryClient: QueryClient, updateFunction: UpdateDocumentFunction): void;
|
|
4068
|
+
export declare function invalidateDocumentListData(queryClient: QueryClient): Promise<void>;
|
|
4038
4069
|
export {};
|