@prismicio/editor-fields 0.4.48 → 0.4.49-alpha.feat-onboarding-guide.0

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.
@@ -9,7 +9,7 @@ export interface Selection {
9
9
  */
10
10
  update: (requestedFrom: SelectionArea, newId: string) => void;
11
11
  }
12
- export type SelectionArea = "sliceTable" | "sliceFieldSet";
12
+ export type SelectionArea = "all" | "sliceTable" | "sliceFieldSet";
13
13
  export declare function getSelectionDOMId(area: SelectionArea, id?: string): string | undefined;
14
14
  export declare const SelectionContext: import("react").Context<Selection>;
15
15
  interface UseSelectionArgs {
@@ -0,0 +1,22 @@
1
+ /// <reference types="react" />
2
+ import type { OnboardingCardVariant, OnboardingTrackingFn } from "./types";
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;
20
+ }
21
+ export declare function OnboardingGuide(props: OnboardingGuideProps): JSX.Element;
22
+ export {};
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import type { OnboardingCardVariant } from "../types";
3
+ interface OnboardingCardProps {
4
+ variant: OnboardingCardVariant;
5
+ tutorialLink?: string;
6
+ onClose?: () => void;
7
+ }
8
+ export declare function OnboardingCard(props: OnboardingCardProps): JSX.Element;
9
+ export {};
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import type { OnboardingCardVariant } from "../types";
3
+ interface OnboardingProgressStepperProps {
4
+ variant: OnboardingCardVariant;
5
+ }
6
+ export declare function OnboardingProgressStepper(props: OnboardingProgressStepperProps): JSX.Element | null;
7
+ export {};
@@ -0,0 +1,20 @@
1
+ import { type ReactNode } from "react";
2
+ import { type OnboardingCardVariant, type OnboardingStep, type OnboardingStepId, type OnboardingTrackingFn } from "../types";
3
+ interface OnboardingContext {
4
+ steps: OnboardingStep[];
5
+ completedStepCount: number;
6
+ toggleStepComplete: (step: OnboardingStep) => void;
7
+ getStepIndex: (step: OnboardingStepId) => number;
8
+ isStepComplete: (step: OnboardingStep) => boolean;
9
+ trackingFn: OnboardingTrackingFn;
10
+ }
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;
19
+ export declare const useOnboardingContext: () => OnboardingContext;
20
+ export {};
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import type { OnboardingStep } from "../types";
3
+ interface OnboardingStepDialogProps {
4
+ isOpen: boolean;
5
+ step: OnboardingStep;
6
+ stepIndex: number;
7
+ isStepComplete: boolean;
8
+ onActionClick: () => void;
9
+ onClose: () => void;
10
+ }
11
+ export declare function OnboardingStepDialog(props: OnboardingStepDialogProps): JSX.Element;
12
+ export {};
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import type { OnboardingCardVariant } from "../types";
3
+ interface OnboardingTutorialProps {
4
+ href: string;
5
+ variant?: OnboardingCardVariant;
6
+ }
7
+ export declare function OnboardingTutorial(props: OnboardingTutorialProps): JSX.Element;
8
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { OnboardingStep } from "./types";
2
+ export declare const onboardingSteps: OnboardingStep[];
3
+ export declare const onboardingExperimentSteps: OnboardingStep[];
@@ -0,0 +1 @@
1
+ export { OnboardingGuide } from "./OnboardingGuide";
@@ -0,0 +1,39 @@
1
+ /// <reference types="react" />
2
+ import { z } from "zod";
3
+ export declare const onboardingStepStatusesSchema: z.ZodObject<{
4
+ createProject: z.ZodLiteral<true>;
5
+ createPageType: z.ZodBoolean;
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;
30
+ export interface OnboardingStep {
31
+ id: OnboardingStepId;
32
+ title: string;
33
+ description: string;
34
+ content?: JSX.Element;
35
+ videoUrl?: string;
36
+ defaultCompleted?: boolean;
37
+ }
38
+ export type OnboardingCardVariant = "default" | "light" | "dark";
39
+ export type OnboardingTrackingFn = (args: Record<string, string>) => void;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { type TextInputProps } from "@prismicio/editor-ui";
3
- export declare const FieldTextInput: import("react").ForwardRefExoticComponent<TextInputProps & import("react").RefAttributes<HTMLInputElement>>;
3
+ export declare const FieldTextInput: (props: TextInputProps & import("react").RefAttributes<HTMLInputElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
4
4
  export declare const fieldInputPadding: {
5
5
  readonly input: {
6
6
  readonly inline: 4;
@@ -1,10 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  interface ImageAltControlProps {
3
- id?: string;
4
3
  readOnly?: boolean;
5
4
  altText: string;
6
- onValueChange: (value: string) => void;
7
5
  selected?: boolean;
6
+ onValueChange: (value: string) => void;
8
7
  }
9
8
  export declare function ImageAltControl(props: ImageAltControlProps): JSX.Element;
10
9
  export {};
@@ -3,9 +3,9 @@ import type { MediaAssetOrExternalImage } from "../../../core/MediaLibrary/hooks
3
3
  interface ImageFieldCardProps {
4
4
  isMediaDialogOpen: boolean;
5
5
  selected?: boolean;
6
+ children: ReactNode;
6
7
  onMediaDialogOpenChange: (open: boolean) => void;
7
8
  onMediaSelected: (media: MediaAssetOrExternalImage) => void;
8
- children: ReactNode;
9
9
  }
10
- export declare function ImageFieldCard(props: ImageFieldCardProps): JSX.Element;
10
+ export declare const ImageFieldCard: (props: ImageFieldCardProps & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
11
11
  export {};
@@ -2,12 +2,11 @@
2
2
  import { type ImageContent, type ImageContentView } from "@prismicio/types-internal/lib/content";
3
3
  import { type CropperImage, type ImageBlockData } from "../../../core/imageUtils";
4
4
  import { type CroppedImages } from "../CropperDialog";
5
- interface NonEmptyCardContentProps<ContentType extends ImageContent | ImageBlockData> {
5
+ interface NonEmptyCardContentProps<Content extends ImageContent | ImageBlockData> {
6
6
  allContentViews: readonly (ImageContentView | undefined)[];
7
- content: ContentType;
7
+ content: Content;
8
8
  contentView: ImageContentView | undefined;
9
9
  fieldLabel: string;
10
- id: string;
11
10
  imageLabel: string[];
12
11
  initialImages: CropperImage[];
13
12
  isUpdating: boolean;
@@ -15,7 +14,7 @@ interface NonEmptyCardContentProps<ContentType extends ImageContent | ImageBlock
15
14
  readOnly: boolean;
16
15
  thumbnailName: string;
17
16
  onClear: () => void;
18
- onContentChange: (content: ContentType | undefined) => void;
17
+ onContentChange: (content: Content | undefined) => void;
19
18
  onCropperDialogClose: (result: {
20
19
  croppedImages: CroppedImages;
21
20
  option: number;
@@ -23,5 +22,5 @@ interface NonEmptyCardContentProps<ContentType extends ImageContent | ImageBlock
23
22
  onPageChange?: (page: number) => void;
24
23
  onMediaDialogOpenChange: (open: boolean) => void;
25
24
  }
26
- export declare function NonEmptyCardContent<ContentType extends ImageContent | ImageBlockData>(props: NonEmptyCardContentProps<ContentType>): JSX.Element;
25
+ export declare function NonEmptyCardContent<Content extends ImageContent | ImageBlockData>(props: NonEmptyCardContentProps<Content>): JSX.Element;
27
26
  export {};
@@ -4,8 +4,7 @@ import type { Image } from "@prismicio/types-internal/lib/customtypes";
4
4
  export interface ImageFieldProps {
5
5
  content: ImageContent | undefined;
6
6
  field: Image;
7
- id: string;
8
- onContentChange: (content: ImageContent | undefined) => void;
9
7
  readOnly: boolean;
8
+ onContentChange: (content: ImageContent | undefined) => void;
10
9
  }
11
10
  export declare function ImageField(props: ImageFieldProps): JSX.Element;
@@ -1,6 +1,5 @@
1
1
  import type { ImageContent } from "@prismicio/types-internal/lib/content";
2
2
  import type { Image } from "@prismicio/types-internal/lib/customtypes";
3
- import { type Thumbnail } from "../../core/imageUtils";
4
3
  import type { MediaAssetOrExternalImage } from "../../core/MediaLibrary/hooks/mediaLibraryData";
5
4
  import type { CroppedImages } from "./CropperDialog";
6
5
  interface useImageFieldProps {
@@ -17,8 +16,8 @@ export declare function useImageField(props: useImageFieldProps): {
17
16
  onMediaSelected: (media: MediaAssetOrExternalImage) => void;
18
17
  isUpdating: boolean;
19
18
  page: number;
20
- thumbnail: Thumbnail | undefined;
21
- allThumbnails: readonly Thumbnail[];
19
+ thumbnail: import("../../core/imageUtils").Thumbnail | undefined;
20
+ allThumbnails: readonly import("../../core/imageUtils").Thumbnail[];
22
21
  allContentViews: readonly [{
23
22
  origin: {
24
23
  id: string;
@@ -1,8 +1,8 @@
1
1
  import { type ExtensionPlaceholder, type NodeExtension } from "../models";
2
- interface PlaceholderParams {
2
+ interface PlaceholderArgs {
3
3
  placeholderByNodeType: Record<string, ExtensionPlaceholder>;
4
4
  unfocusedPlaceholder: string | undefined;
5
5
  nodeExtensions: readonly NodeExtension[];
6
6
  }
7
- declare const _default: (params: PlaceholderParams) => import("@tiptap/core").Extension<import("@tiptap/extension-placeholder").PlaceholderOptions, any>;
7
+ declare const _default: (args: PlaceholderArgs) => import("@tiptap/core").Extension<import("@tiptap/extension-placeholder").PlaceholderOptions, any>;
8
8
  export default _default;
@@ -2,13 +2,15 @@
2
2
  import type { Node as ProseMirrorNode } from "@tiptap/pm/model";
3
3
  import { type NodeViewProps } from "@tiptap/react";
4
4
  import { type ImageBlockData } from "../../../../core/imageUtils";
5
+ export interface ImageViewProps extends NodeViewProps {
6
+ node: ImageNode;
7
+ }
8
+ export declare function ImageView(props: ImageViewProps): JSX.Element;
5
9
  interface ImageNode extends ProseMirrorNode {
6
10
  attrs: {
7
11
  content: ImageBlockData | undefined;
8
12
  };
9
13
  }
10
- export interface ImageViewProps extends NodeViewProps {
11
- node: ImageNode;
12
- }
13
- export declare function ImageView(props: ImageViewProps): JSX.Element;
14
+ export declare const nodeWrapperClassName = "imageViewNodeWrapper";
15
+ export declare function imageViewHeight(isEmpty: boolean): number;
14
16
  export {};
@@ -5,7 +5,7 @@ export type Direction = "ltr" | "rtl";
5
5
  export declare const leftToRight: Direction;
6
6
  export declare const rightToLeft: Direction;
7
7
  interface TextDirectionOptions {
8
- supportedExtensionNames: readonly string[];
8
+ supportedExtensionNames: string[];
9
9
  }
10
10
  export declare const attrName = "dir";
11
11
  declare module "@tiptap/core" {