@prismicio/editor-fields 0.4.50-alpha.xru-test-extension.0 → 0.4.50

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.
@@ -0,0 +1,6 @@
1
+ export declare const frameworkLabels: {
2
+ readonly next: "Next.js";
3
+ readonly nuxt: "Nuxt";
4
+ readonly sveltekit: "SvelteKit";
5
+ readonly other: "Other";
6
+ };
@@ -1,22 +1,10 @@
1
1
  /// <reference types="react" />
2
- import type { OnboardingCardVariant, OnboardingTrackingFn } from "./types";
2
+ import type { OnboardingState, OnboardingTracking } from "../service";
3
3
  interface OnboardingGuideProps {
4
- /**
5
- * Whether the whole guide (including 'Get started' button) should be visible
6
- *
7
- * Example usage: we hide it on small screens in SM
8
- * @default true
9
- */
10
- isOnboardingVisible?: boolean;
11
- /**
12
- * A/B test onboarding card visibility experiment variant
13
- * @default "default"
14
- */
15
- variant?: OnboardingCardVariant;
16
- /** Link to the video tutorials */
17
- tutorialLink?: string;
18
- /** Function to track onboarding events */
19
- trackingFn: OnboardingTrackingFn;
4
+ onboardingState: OnboardingState;
5
+ tracking: OnboardingTracking;
6
+ onToggleStep: (stepId: string) => Promise<string[]>;
7
+ onToggleGuide: () => Promise<void>;
20
8
  }
21
- export declare function OnboardingGuide(props: OnboardingGuideProps): JSX.Element;
9
+ export declare function OnboardingGuide(props: OnboardingGuideProps): JSX.Element | null;
22
10
  export {};
@@ -1,8 +1,11 @@
1
1
  /// <reference types="react" />
2
- import type { OnboardingCardVariant } from "../types";
2
+ import type { OnboardingStep, OnboardingTracking } from "../../service";
3
3
  interface OnboardingCardProps {
4
- variant: OnboardingCardVariant;
4
+ steps: OnboardingStep[];
5
+ completedSteps: string[];
5
6
  tutorialLink?: string;
7
+ tracking: OnboardingTracking;
8
+ onToggleStep: (step: OnboardingStep) => Promise<void>;
6
9
  onClose?: () => void;
7
10
  }
8
11
  export declare function OnboardingCard(props: OnboardingCardProps): JSX.Element;
@@ -1,7 +1,10 @@
1
1
  /// <reference types="react" />
2
- import type { OnboardingCardVariant } from "../types";
2
+ import type { OnboardingStep, OnboardingTracking } from "../../service";
3
3
  interface OnboardingProgressStepperProps {
4
- variant: OnboardingCardVariant;
4
+ steps: OnboardingStep[];
5
+ completedSteps: string[];
6
+ onToggleStep: (step: OnboardingStep) => Promise<void>;
7
+ tracking: OnboardingTracking;
5
8
  }
6
9
  export declare function OnboardingProgressStepper(props: OnboardingProgressStepperProps): JSX.Element | null;
7
10
  export {};
@@ -1,11 +1,11 @@
1
1
  /// <reference types="react" />
2
- import type { OnboardingStep } from "../types";
2
+ import type { OnboardingStep } from "../../service";
3
3
  interface OnboardingStepDialogProps {
4
4
  isOpen: boolean;
5
5
  step: OnboardingStep;
6
6
  stepIndex: number;
7
7
  isStepComplete: boolean;
8
- onActionClick: () => void;
8
+ onActionClick: () => Promise<void>;
9
9
  onClose: () => void;
10
10
  }
11
11
  export declare function OnboardingStepDialog(props: OnboardingStepDialogProps): JSX.Element;
@@ -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 const onboardingSteps: OnboardingStep[];
3
- export declare const onboardingExperimentSteps: OnboardingStep[];
1
+ import type { OnboardingFramework, OnboardingStep } from "../service/onboarding";
2
+ export declare function getOnboardingContent(framework?: OnboardingFramework, starter?: string | null): {
3
+ steps: OnboardingStep[];
4
+ defaultCompletedStepIds: string[];
5
+ tutorialLink: string | undefined;
6
+ };
@@ -1,4 +1,5 @@
1
1
  export * from "./customType";
2
2
  export * from "./document";
3
+ export * from "./onboarding";
3
4
  export * from "./repository";
4
5
  export * from "./user";
@@ -0,0 +1,79 @@
1
+ /// <reference types="react" />
2
+ import { z } from "zod";
3
+ import { type AuthStrategy } from "../../EditorConfig";
4
+ export interface OnboardingStep {
5
+ id: string;
6
+ title: string;
7
+ description: string;
8
+ content?: JSX.Element;
9
+ videoUrl?: string;
10
+ defaultCompleted?: boolean;
11
+ }
12
+ export declare const onboardingStateSchema: z.ZodObject<{
13
+ completedSteps: z.ZodArray<z.ZodString, "many">;
14
+ isDismissed: z.ZodBoolean;
15
+ context: z.ZodObject<{
16
+ framework: z.ZodDefault<z.ZodOptional<z.ZodEffects<z.ZodEnum<["next", "nuxt", "sveltekit", "other"]>, "next" | "nuxt" | "sveltekit" | "other", unknown>>>;
17
+ starterId: z.ZodNullable<z.ZodString>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ framework: "next" | "nuxt" | "sveltekit" | "other";
20
+ starterId: string | null;
21
+ }, {
22
+ starterId: string | null;
23
+ framework?: unknown;
24
+ }>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ completedSteps: string[];
27
+ isDismissed: boolean;
28
+ context: {
29
+ framework: "next" | "nuxt" | "sveltekit" | "other";
30
+ starterId: string | null;
31
+ };
32
+ }, {
33
+ completedSteps: string[];
34
+ isDismissed: boolean;
35
+ context: {
36
+ starterId: string | null;
37
+ framework?: unknown;
38
+ };
39
+ }>;
40
+ export type OnboardingState = z.infer<typeof onboardingStateSchema>;
41
+ export type OnboardingFramework = OnboardingState["context"]["framework"];
42
+ export declare const onboardingToggleStepResultSchema: z.ZodObject<{
43
+ completedSteps: z.ZodArray<z.ZodString, "many">;
44
+ }, "strip", z.ZodTypeAny, {
45
+ completedSteps: string[];
46
+ }, {
47
+ completedSteps: string[];
48
+ }>;
49
+ export type OnboardingToggleStepResult = z.infer<typeof onboardingToggleStepResultSchema>;
50
+ export declare const onboardingToggleResultSchema: z.ZodObject<{
51
+ isDismissed: z.ZodBoolean;
52
+ }, "strip", z.ZodTypeAny, {
53
+ isDismissed: boolean;
54
+ }, {
55
+ isDismissed: boolean;
56
+ }>;
57
+ export type OnboardingToggleResult = z.infer<typeof onboardingToggleResultSchema>;
58
+ export declare function getOnboarding(baseUrl: URL, repository: string, authStrategy: AuthStrategy): Promise<OnboardingState>;
59
+ export declare function toggleOnboardingStep(stepId: string, baseUrl: URL, repository: string, authStrategy: AuthStrategy): Promise<OnboardingToggleStepResult>;
60
+ export declare function toggleOnboarding(baseUrl: URL, repository: string, authStrategy: AuthStrategy): Promise<OnboardingToggleResult>;
61
+ export type OnboardingTrackSource = "PageBuilder" | "SliceMachine";
62
+ export type OnboardingTrackEvent = {
63
+ event: "shared-onboarding:step-completed";
64
+ stepId: string;
65
+ stepTitle: string;
66
+ source: OnboardingTrackSource;
67
+ } | {
68
+ event: "shared-onboarding:step-opened";
69
+ stepId: string;
70
+ stepTitle: string;
71
+ source: OnboardingTrackSource;
72
+ } | {
73
+ event: "shared-onboarding:completed";
74
+ source: OnboardingTrackSource;
75
+ };
76
+ export interface OnboardingTracking {
77
+ track: (args: OnboardingTrackEvent) => void | Promise<void>;
78
+ source: OnboardingTrackSource;
79
+ }
@@ -28,7 +28,7 @@ declare const repositoryQuotas: z.ZodObject<{
28
28
  slicemachineEnabled: boolean;
29
29
  }>;
30
30
  export type RepositoryQuotas = z.TypeOf<typeof repositoryQuotas>;
31
- declare const repositoryFramework: z.ZodEffects<z.ZodEnum<["next", "nuxt", "sveltekit", "other"]>, "next" | "nuxt" | "sveltekit" | "other", unknown>;
31
+ export declare const repositoryFramework: z.ZodEffects<z.ZodEnum<["next", "nuxt", "sveltekit", "other"]>, "next" | "nuxt" | "sveltekit" | "other", unknown>;
32
32
  export type RepositoryFramework = z.TypeOf<typeof repositoryFramework>;
33
33
  declare const repositorySchema: z.ZodEffects<z.ZodObject<{
34
34
  simulator_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -91,6 +91,7 @@ declare const repositorySchema: z.ZodEffects<z.ZodObject<{
91
91
  major: number;
92
92
  minor: number;
93
93
  }>;
94
+ uploadedAvatar: z.ZodOptional<z.ZodString>;
94
95
  }, "strip", z.ZodTypeAny, {
95
96
  authors: {
96
97
  id: string;
@@ -114,6 +115,7 @@ declare const repositorySchema: z.ZodEffects<z.ZodObject<{
114
115
  };
115
116
  simulator_url?: string | null | undefined;
116
117
  starterId?: string | undefined;
118
+ uploadedAvatar?: string | undefined;
117
119
  }, {
118
120
  languages: {
119
121
  id: string;
@@ -137,6 +139,7 @@ declare const repositorySchema: z.ZodEffects<z.ZodObject<{
137
139
  } | undefined;
138
140
  framework?: unknown;
139
141
  starterId?: string | undefined;
142
+ uploadedAvatar?: string | undefined;
140
143
  }>, {
141
144
  framework: "next" | "nuxt" | "sveltekit" | "other";
142
145
  simulatorUrl: string | undefined;
@@ -161,6 +164,7 @@ declare const repositorySchema: z.ZodEffects<z.ZodObject<{
161
164
  minor: number;
162
165
  };
163
166
  starterId?: string | undefined;
167
+ uploadedAvatar?: string | undefined;
164
168
  }, {
165
169
  languages: {
166
170
  id: string;
@@ -184,6 +188,7 @@ declare const repositorySchema: z.ZodEffects<z.ZodObject<{
184
188
  } | undefined;
185
189
  framework?: unknown;
186
190
  starterId?: string | undefined;
191
+ uploadedAvatar?: string | undefined;
187
192
  }>;
188
193
  export type Repository = z.TypeOf<typeof repositorySchema>;
189
194
  export declare function getRepository(baseUrl: URL, authStrategy: AuthStrategy): Promise<Repository>;