@prismicio/editor-fields 0.4.49-alpha.feat-onboarding-guide.5 → 0.4.49-alpha.feat-onboarding-guide.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 +7 -1
- package/dist/core/OnboardingGuide/OnboardingGuide.d.ts +14 -19
- package/dist/core/OnboardingGuide/components/OnboardingCard.d.ts +2 -3
- package/dist/core/OnboardingGuide/components/OnboardingProgressStepper.d.ts +2 -2
- package/dist/core/OnboardingGuide/components/OnboardingTutorial.d.ts +0 -2
- package/dist/core/OnboardingGuide/content.d.ts +6 -3
- package/dist/core/OnboardingGuide/index.d.ts +1 -0
- package/dist/core/OnboardingGuide/types.d.ts +54 -29
- package/dist/core/service/index.d.ts +1 -0
- package/dist/core/service/onboarding.d.ts +72 -0
- package/dist/core/service/repository.d.ts +1 -1
- package/dist/index.cjs.js +36 -35
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +16593 -16546
- package/package.json +3 -3
- package/dist/core/OnboardingGuide/components/OnboardingProvider.d.ts +0 -20
package/dist/EditorConfig.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type EditorConfig = {
|
|
|
6
6
|
unsplashApiBaseUrl: URL;
|
|
7
7
|
authStrategy: AuthStrategy;
|
|
8
8
|
} & OptionalConfigs;
|
|
9
|
-
type OptionalConfigs = SearchDocuments & MediaLibrary & UIDField & Analytics & ErrorTracking & IntegrationFields & LayoutConfig;
|
|
9
|
+
type OptionalConfigs = SearchDocuments & MediaLibrary & UIDField & Analytics & ErrorTracking & IntegrationFields & LayoutConfig & RepositoryConfig;
|
|
10
10
|
type MediaLibrary = {
|
|
11
11
|
mediaLibrary?: never;
|
|
12
12
|
} | {
|
|
@@ -52,6 +52,12 @@ interface LayoutConfig {
|
|
|
52
52
|
*/
|
|
53
53
|
scrollOffsetTop?: number;
|
|
54
54
|
}
|
|
55
|
+
type RepositoryConfig = {
|
|
56
|
+
repositoryBaseUrl?: never;
|
|
57
|
+
} | {
|
|
58
|
+
repository: string;
|
|
59
|
+
repositoryBaseUrl: URL;
|
|
60
|
+
};
|
|
55
61
|
interface OnAnalyticsEvent {
|
|
56
62
|
(event: "Media Library Search", args: {
|
|
57
63
|
assetType: MediaAssetType;
|
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type
|
|
3
|
-
import type {
|
|
2
|
+
import { type ConfettiConfig } from "dom-confetti";
|
|
3
|
+
import type { OnboardingTracking } from "./types";
|
|
4
4
|
interface OnboardingGuideProps {
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Whether the whole guide (including 'Get started' button) should be visible
|
|
8
|
-
*
|
|
9
|
-
* Example usage: we hide it on small screens in SM
|
|
10
|
-
* @default true
|
|
11
|
-
*/
|
|
12
|
-
isOnboardingVisible?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* A/B test onboarding card visibility experiment variant
|
|
15
|
-
* @default "default"
|
|
16
|
-
*/
|
|
17
|
-
variant?: OnboardingCardVariant;
|
|
18
|
-
/** Link to the video tutorials */
|
|
19
|
-
tutorialLink?: string;
|
|
20
|
-
/** Function to track onboarding events */
|
|
21
|
-
trackingFn: OnboardingTrackingFn;
|
|
5
|
+
tracking: OnboardingTracking;
|
|
22
6
|
}
|
|
23
7
|
export declare function OnboardingGuide(props: OnboardingGuideProps): JSX.Element;
|
|
8
|
+
export declare function useConfetti(confettiConfig: ConfettiConfig): {
|
|
9
|
+
throwConfetti: () => void;
|
|
10
|
+
confettiCannonRef: import("react").RefObject<HTMLDivElement>;
|
|
11
|
+
confettiContainerRef: import("react").RefObject<HTMLDivElement>;
|
|
12
|
+
};
|
|
13
|
+
export declare function useFadeOut(closeGuide: () => void, startDelay: number, endDelay: number): {
|
|
14
|
+
isFadedOut: boolean;
|
|
15
|
+
isFading: boolean;
|
|
16
|
+
fadeOut: () => void;
|
|
17
|
+
resetFadeOut: () => void;
|
|
18
|
+
};
|
|
24
19
|
export {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { OnboardingTracking } from "../types";
|
|
3
3
|
interface OnboardingCardProps {
|
|
4
|
-
|
|
5
|
-
tutorialLink?: string;
|
|
4
|
+
tracking: OnboardingTracking;
|
|
6
5
|
onClose?: () => void;
|
|
7
6
|
}
|
|
8
7
|
export declare function OnboardingCard(props: OnboardingCardProps): JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { OnboardingTracking } from "../types";
|
|
3
3
|
interface OnboardingProgressStepperProps {
|
|
4
|
-
|
|
4
|
+
tracking: OnboardingTracking;
|
|
5
5
|
}
|
|
6
6
|
export declare function OnboardingProgressStepper(props: OnboardingProgressStepperProps): JSX.Element | null;
|
|
7
7
|
export {};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { OnboardingCardVariant } from "../types";
|
|
3
2
|
interface OnboardingTutorialProps {
|
|
4
3
|
href: string;
|
|
5
|
-
variant?: OnboardingCardVariant;
|
|
6
4
|
}
|
|
7
5
|
export declare function OnboardingTutorial(props: OnboardingTutorialProps): JSX.Element;
|
|
8
6
|
export {};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import type { OnboardingStep } from "./types";
|
|
2
|
-
export declare
|
|
3
|
-
|
|
1
|
+
import type { OnboardingFramework, OnboardingStep } from "./types";
|
|
2
|
+
export declare function getOnboardingContent(framework?: OnboardingFramework): {
|
|
3
|
+
steps: OnboardingStep[];
|
|
4
|
+
defaultCompletedStepIds: ("createProject" | "createPageType" | "codePage" | "createSlice" | "reviewAndPush" | "createContent" | "renderPage")[];
|
|
5
|
+
tutorialLink: string;
|
|
6
|
+
};
|
|
@@ -1,32 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
codePage: z.ZodBoolean;
|
|
7
|
-
createSlice: z.ZodBoolean;
|
|
8
|
-
reviewAndPush: z.ZodBoolean;
|
|
9
|
-
createContent: z.ZodBoolean;
|
|
10
|
-
renderPage: z.ZodBoolean;
|
|
11
|
-
}, "strip", z.ZodTypeAny, {
|
|
12
|
-
createProject: true;
|
|
13
|
-
createPageType: boolean;
|
|
14
|
-
codePage: boolean;
|
|
15
|
-
createSlice: boolean;
|
|
16
|
-
reviewAndPush: boolean;
|
|
17
|
-
createContent: boolean;
|
|
18
|
-
renderPage: boolean;
|
|
19
|
-
}, {
|
|
20
|
-
createProject: true;
|
|
21
|
-
createPageType: boolean;
|
|
22
|
-
codePage: boolean;
|
|
23
|
-
createSlice: boolean;
|
|
24
|
-
reviewAndPush: boolean;
|
|
25
|
-
createContent: boolean;
|
|
26
|
-
renderPage: boolean;
|
|
27
|
-
}>;
|
|
28
|
-
export type OnboardingStepStatuses = z.infer<typeof onboardingStepStatusesSchema>;
|
|
29
|
-
export type OnboardingStepId = keyof OnboardingStepStatuses;
|
|
3
|
+
declare const onboardingStepIds: readonly ["createProject", "createPageType", "codePage", "createSlice", "reviewAndPush", "createContent", "renderPage"];
|
|
4
|
+
export declare const onboardingStepIdSchema: z.ZodEnum<["createProject", "createPageType", "codePage", "createSlice", "reviewAndPush", "createContent", "renderPage"]>;
|
|
5
|
+
export type OnboardingStepId = typeof onboardingStepIds[number];
|
|
30
6
|
export interface OnboardingStep {
|
|
31
7
|
id: OnboardingStepId;
|
|
32
8
|
title: string;
|
|
@@ -35,5 +11,54 @@ export interface OnboardingStep {
|
|
|
35
11
|
videoUrl?: string;
|
|
36
12
|
defaultCompleted?: boolean;
|
|
37
13
|
}
|
|
38
|
-
|
|
39
|
-
export type
|
|
14
|
+
declare const onboardingFrameworks: readonly ["next", "nuxt", "sveltekit", "other"];
|
|
15
|
+
export type OnboardingFramework = typeof onboardingFrameworks[number];
|
|
16
|
+
export declare const onboardingStateSchema: z.ZodObject<{
|
|
17
|
+
completedSteps: z.ZodArray<z.ZodEnum<["createProject", "createPageType", "codePage", "createSlice", "reviewAndPush", "createContent", "renderPage"]>, "many">;
|
|
18
|
+
isDismissed: z.ZodBoolean;
|
|
19
|
+
context: z.ZodObject<{
|
|
20
|
+
framework: z.ZodEnum<["next", "nuxt", "sveltekit", "other"]>;
|
|
21
|
+
starterId: z.ZodNullable<z.ZodString>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
framework: "next" | "nuxt" | "sveltekit" | "other";
|
|
24
|
+
starterId: string | null;
|
|
25
|
+
}, {
|
|
26
|
+
framework: "next" | "nuxt" | "sveltekit" | "other";
|
|
27
|
+
starterId: string | null;
|
|
28
|
+
}>;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
completedSteps: ("createProject" | "createPageType" | "codePage" | "createSlice" | "reviewAndPush" | "createContent" | "renderPage")[];
|
|
31
|
+
isDismissed: boolean;
|
|
32
|
+
context: {
|
|
33
|
+
framework: "next" | "nuxt" | "sveltekit" | "other";
|
|
34
|
+
starterId: string | null;
|
|
35
|
+
};
|
|
36
|
+
}, {
|
|
37
|
+
completedSteps: ("createProject" | "createPageType" | "codePage" | "createSlice" | "reviewAndPush" | "createContent" | "renderPage")[];
|
|
38
|
+
isDismissed: boolean;
|
|
39
|
+
context: {
|
|
40
|
+
framework: "next" | "nuxt" | "sveltekit" | "other";
|
|
41
|
+
starterId: string | null;
|
|
42
|
+
};
|
|
43
|
+
}>;
|
|
44
|
+
export type OnboardingState = z.infer<typeof onboardingStateSchema>;
|
|
45
|
+
export type OnboardingTrackSource = "PageBuilder" | "SliceMachine";
|
|
46
|
+
export type OnboardingTrackEvent = {
|
|
47
|
+
event: "onboarding:step-completed";
|
|
48
|
+
stepId: OnboardingStepId;
|
|
49
|
+
stepTitle: string;
|
|
50
|
+
source: OnboardingTrackSource;
|
|
51
|
+
} | {
|
|
52
|
+
event: "onboarding:step-opened";
|
|
53
|
+
stepId: OnboardingStepId;
|
|
54
|
+
stepTitle: string;
|
|
55
|
+
source: OnboardingTrackSource;
|
|
56
|
+
} | {
|
|
57
|
+
event: "onboarding:completed";
|
|
58
|
+
source: OnboardingTrackSource;
|
|
59
|
+
};
|
|
60
|
+
export interface OnboardingTracking {
|
|
61
|
+
track: (args: OnboardingTrackEvent) => void;
|
|
62
|
+
source: OnboardingTrackSource;
|
|
63
|
+
}
|
|
64
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type AuthStrategy } from "../../EditorConfig";
|
|
3
|
+
import { type OnboardingStepId, type OnboardingTracking } from "../OnboardingGuide/types";
|
|
4
|
+
export declare function useOnboarding(): {
|
|
5
|
+
steps: import("../OnboardingGuide/types").OnboardingStep[];
|
|
6
|
+
context: {
|
|
7
|
+
framework: "next" | "nuxt" | "sveltekit" | "other";
|
|
8
|
+
starterId: string | null;
|
|
9
|
+
};
|
|
10
|
+
completedSteps: ("createProject" | "createPageType" | "codePage" | "createSlice" | "reviewAndPush" | "createContent" | "renderPage")[];
|
|
11
|
+
completedStepsCount: number;
|
|
12
|
+
isOnboardingCompleted: boolean;
|
|
13
|
+
isDismissed: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare function useOnboardingToggleStep(): {
|
|
16
|
+
steps: import("../OnboardingGuide/types").OnboardingStep[];
|
|
17
|
+
context: {
|
|
18
|
+
framework: "next" | "nuxt" | "sveltekit" | "other";
|
|
19
|
+
starterId: string | null;
|
|
20
|
+
};
|
|
21
|
+
completedSteps: ("createProject" | "createPageType" | "codePage" | "createSlice" | "reviewAndPush" | "createContent" | "renderPage")[];
|
|
22
|
+
completedStepsCount: number;
|
|
23
|
+
isOnboardingCompleted: boolean;
|
|
24
|
+
isDismissed: boolean;
|
|
25
|
+
};
|
|
26
|
+
export declare function useToggleStep(): (stepId: OnboardingStepId, tracking: OnboardingTracking) => Promise<void>;
|
|
27
|
+
export declare function useToggleOnboarding(): () => Promise<void>;
|
|
28
|
+
export declare const Onboarding: z.ZodObject<{
|
|
29
|
+
completedSteps: z.ZodArray<z.ZodString, "many">;
|
|
30
|
+
isDismissed: z.ZodBoolean;
|
|
31
|
+
context: z.ZodObject<{
|
|
32
|
+
framework: z.ZodEnum<["next", "nuxt", "sveltekit", "other"]>;
|
|
33
|
+
starterId: z.ZodNullable<z.ZodString>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
framework: "next" | "nuxt" | "sveltekit" | "other";
|
|
36
|
+
starterId: string | null;
|
|
37
|
+
}, {
|
|
38
|
+
framework: "next" | "nuxt" | "sveltekit" | "other";
|
|
39
|
+
starterId: string | null;
|
|
40
|
+
}>;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
completedSteps: string[];
|
|
43
|
+
isDismissed: boolean;
|
|
44
|
+
context: {
|
|
45
|
+
framework: "next" | "nuxt" | "sveltekit" | "other";
|
|
46
|
+
starterId: string | null;
|
|
47
|
+
};
|
|
48
|
+
}, {
|
|
49
|
+
completedSteps: string[];
|
|
50
|
+
isDismissed: boolean;
|
|
51
|
+
context: {
|
|
52
|
+
framework: "next" | "nuxt" | "sveltekit" | "other";
|
|
53
|
+
starterId: string | null;
|
|
54
|
+
};
|
|
55
|
+
}>;
|
|
56
|
+
type Onboarding = z.infer<typeof Onboarding>;
|
|
57
|
+
export declare function getOnboarding(baseUrl: URL, repository: string, authStrategy: AuthStrategy): Promise<Onboarding>;
|
|
58
|
+
export declare const OnboardingToggleStepResult: z.ZodObject<{
|
|
59
|
+
completedSteps: z.ZodArray<z.ZodString, "many">;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
completedSteps: string[];
|
|
62
|
+
}, {
|
|
63
|
+
completedSteps: string[];
|
|
64
|
+
}>;
|
|
65
|
+
export declare const OnboardingToggleResult: z.ZodObject<{
|
|
66
|
+
isDismissed: z.ZodBoolean;
|
|
67
|
+
}, "strip", z.ZodTypeAny, {
|
|
68
|
+
isDismissed: boolean;
|
|
69
|
+
}, {
|
|
70
|
+
isDismissed: boolean;
|
|
71
|
+
}>;
|
|
72
|
+
export {};
|
|
@@ -98,6 +98,7 @@ declare const repositorySchema: z.ZodEffects<z.ZodObject<{
|
|
|
98
98
|
lastname?: string | undefined;
|
|
99
99
|
uploadedAvatar?: string | undefined;
|
|
100
100
|
}[];
|
|
101
|
+
framework: "next" | "nuxt" | "sveltekit" | "other";
|
|
101
102
|
languages: {
|
|
102
103
|
id: string;
|
|
103
104
|
name: string;
|
|
@@ -106,7 +107,6 @@ declare const repositorySchema: z.ZodEffects<z.ZodObject<{
|
|
|
106
107
|
quotas: {
|
|
107
108
|
slicemachineEnabled: boolean;
|
|
108
109
|
};
|
|
109
|
-
framework: "next" | "nuxt" | "sveltekit" | "other";
|
|
110
110
|
storageVersion: {
|
|
111
111
|
major: number;
|
|
112
112
|
minor: number;
|