@prismicio/editor-fields 0.4.49-alpha.feat-onboarding-guide.6 → 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/types.d.ts +12 -19
- package/dist/core/service/onboarding.d.ts +60 -2
- package/dist/index.cjs.js +34 -34
- package/dist/index.es.js +10394 -10321
- package/package.json +1 -1
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;
|
|
@@ -11,44 +11,37 @@ export interface OnboardingStep {
|
|
|
11
11
|
videoUrl?: string;
|
|
12
12
|
defaultCompleted?: boolean;
|
|
13
13
|
}
|
|
14
|
-
export type OnboardingState = {
|
|
15
|
-
completedSteps: OnboardingStepId[];
|
|
16
|
-
isDismissed: boolean;
|
|
17
|
-
context?: {
|
|
18
|
-
framework: OnboardingFramework;
|
|
19
|
-
starterId?: string;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
14
|
declare const onboardingFrameworks: readonly ["next", "nuxt", "sveltekit", "other"];
|
|
23
15
|
export type OnboardingFramework = typeof onboardingFrameworks[number];
|
|
24
16
|
export declare const onboardingStateSchema: z.ZodObject<{
|
|
25
17
|
completedSteps: z.ZodArray<z.ZodEnum<["createProject", "createPageType", "codePage", "createSlice", "reviewAndPush", "createContent", "renderPage"]>, "many">;
|
|
26
18
|
isDismissed: z.ZodBoolean;
|
|
27
|
-
context: z.
|
|
19
|
+
context: z.ZodObject<{
|
|
28
20
|
framework: z.ZodEnum<["next", "nuxt", "sveltekit", "other"]>;
|
|
29
|
-
starterId: z.
|
|
21
|
+
starterId: z.ZodNullable<z.ZodString>;
|
|
30
22
|
}, "strip", z.ZodTypeAny, {
|
|
31
23
|
framework: "next" | "nuxt" | "sveltekit" | "other";
|
|
32
|
-
starterId
|
|
24
|
+
starterId: string | null;
|
|
33
25
|
}, {
|
|
34
26
|
framework: "next" | "nuxt" | "sveltekit" | "other";
|
|
35
|
-
starterId
|
|
36
|
-
}
|
|
27
|
+
starterId: string | null;
|
|
28
|
+
}>;
|
|
37
29
|
}, "strip", z.ZodTypeAny, {
|
|
38
30
|
completedSteps: ("createProject" | "createPageType" | "codePage" | "createSlice" | "reviewAndPush" | "createContent" | "renderPage")[];
|
|
39
31
|
isDismissed: boolean;
|
|
40
|
-
context
|
|
32
|
+
context: {
|
|
41
33
|
framework: "next" | "nuxt" | "sveltekit" | "other";
|
|
42
|
-
starterId
|
|
43
|
-
}
|
|
34
|
+
starterId: string | null;
|
|
35
|
+
};
|
|
44
36
|
}, {
|
|
45
37
|
completedSteps: ("createProject" | "createPageType" | "codePage" | "createSlice" | "reviewAndPush" | "createContent" | "renderPage")[];
|
|
46
38
|
isDismissed: boolean;
|
|
47
|
-
context
|
|
39
|
+
context: {
|
|
48
40
|
framework: "next" | "nuxt" | "sveltekit" | "other";
|
|
49
|
-
starterId
|
|
50
|
-
}
|
|
41
|
+
starterId: string | null;
|
|
42
|
+
};
|
|
51
43
|
}>;
|
|
44
|
+
export type OnboardingState = z.infer<typeof onboardingStateSchema>;
|
|
52
45
|
export type OnboardingTrackSource = "PageBuilder" | "SliceMachine";
|
|
53
46
|
export type OnboardingTrackEvent = {
|
|
54
47
|
event: "onboarding:step-completed";
|
|
@@ -1,10 +1,23 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type AuthStrategy } from "../../EditorConfig";
|
|
1
3
|
import { type OnboardingStepId, type OnboardingTracking } from "../OnboardingGuide/types";
|
|
2
4
|
export declare function useOnboarding(): {
|
|
3
5
|
steps: import("../OnboardingGuide/types").OnboardingStep[];
|
|
4
6
|
context: {
|
|
5
7
|
framework: "next" | "nuxt" | "sveltekit" | "other";
|
|
6
|
-
starterId
|
|
7
|
-
}
|
|
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
|
+
};
|
|
8
21
|
completedSteps: ("createProject" | "createPageType" | "codePage" | "createSlice" | "reviewAndPush" | "createContent" | "renderPage")[];
|
|
9
22
|
completedStepsCount: number;
|
|
10
23
|
isOnboardingCompleted: boolean;
|
|
@@ -12,3 +25,48 @@ export declare function useOnboarding(): {
|
|
|
12
25
|
};
|
|
13
26
|
export declare function useToggleStep(): (stepId: OnboardingStepId, tracking: OnboardingTracking) => Promise<void>;
|
|
14
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 {};
|