@primestyleai/tryon 5.8.35 → 5.8.37

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,55 @@
1
+ import type { TranslateFn } from "../../i18n";
2
+ import type { ViewState } from "../types";
3
+ export interface AccessoryField {
4
+ key: string;
5
+ label: string;
6
+ placeholder: {
7
+ cm: string;
8
+ in: string;
9
+ };
10
+ hint?: string;
11
+ min?: number;
12
+ max?: number;
13
+ step?: number;
14
+ /** If provided, this image replaces the product image when the field is focused */
15
+ guideImage?: string;
16
+ }
17
+ interface Props {
18
+ title: string;
19
+ fields: AccessoryField[];
20
+ /** Unit options: first = metric-ish (cm/mm), second = imperial (in) */
21
+ unitOptions?: [{
22
+ label: string;
23
+ value: string;
24
+ }, {
25
+ label: string;
26
+ value: string;
27
+ }];
28
+ /** "close-up" swaps the photo step copy to face/head photo guidance */
29
+ photoVariant?: "full-body" | "close-up";
30
+ /** When true, hides the photo upload CTA entirely — manual entry only */
31
+ disablePhotoUpload?: boolean;
32
+ productImage: string;
33
+ productTitle: string;
34
+ formRef: React.MutableRefObject<Record<string, string>>;
35
+ sizingUnit: string;
36
+ setSizingUnit: (u: string) => void;
37
+ setSizingMethod: (m: "exact" | "quick" | null) => void;
38
+ setSizingLoading: (v: boolean) => void;
39
+ setView: (v: ViewState) => void;
40
+ submitSizing: (mode: "exact" | "quick") => void;
41
+ onSnapSubmit: (data: {
42
+ photoFile: File;
43
+ photoBase64: string;
44
+ height: number;
45
+ weight: number;
46
+ heightUnit: string;
47
+ weightUnit: string;
48
+ gender: string;
49
+ age?: number;
50
+ }) => void;
51
+ onBack: () => void;
52
+ t: TranslateFn;
53
+ }
54
+ export declare function AccessorySizeView({ title, fields, unitOptions, photoVariant, disablePhotoUpload, productImage, productTitle, formRef, sizingUnit, setSizingUnit, setSizingMethod, setSizingLoading, setView, submitSizing, onSnapSubmit, onBack, t, }: Props): import("react/jsx-runtime").JSX.Element;
55
+ export {};
@@ -36,7 +36,10 @@ import type { Profile } from "../types";
36
36
  interface CreateProfileWizardProps {
37
37
  onSave: (data: Omit<Profile, "id" | "createdAt">) => void;
38
38
  onCancel: () => void;
39
+ /** Called when a photo is selected (passes base64) or removed (passes null).
40
+ * Host can use this to mirror the photo in the product-image left panel. */
41
+ onPhotoPreview?: (base64: string | null) => void;
39
42
  t: TranslateFn;
40
43
  }
41
- export declare function CreateProfileWizard({ onSave, onCancel, t }: CreateProfileWizardProps): import("react/jsx-runtime").JSX.Element;
44
+ export declare function CreateProfileWizard({ onSave, onCancel, onPhotoPreview, t }: CreateProfileWizardProps): import("react/jsx-runtime").JSX.Element;
42
45
  export {};
@@ -0,0 +1,25 @@
1
+ import type { TranslateFn } from "../../i18n";
2
+ import type { ViewState } from "../types";
3
+ export declare function FaceSizeView(props: {
4
+ productImage: string;
5
+ productTitle: string;
6
+ formRef: React.MutableRefObject<Record<string, string>>;
7
+ sizingUnit: string;
8
+ setSizingUnit: (u: string) => void;
9
+ setSizingMethod: (m: "exact" | "quick" | null) => void;
10
+ setSizingLoading: (v: boolean) => void;
11
+ setView: (v: ViewState) => void;
12
+ submitSizing: (mode: "exact" | "quick") => void;
13
+ onSnapSubmit: (data: {
14
+ photoFile: File;
15
+ photoBase64: string;
16
+ height: number;
17
+ weight: number;
18
+ heightUnit: string;
19
+ weightUnit: string;
20
+ gender: string;
21
+ age?: number;
22
+ }) => void;
23
+ onBack: () => void;
24
+ t: TranslateFn;
25
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,25 @@
1
+ import type { TranslateFn } from "../../i18n";
2
+ import type { ViewState } from "../types";
3
+ export declare function FootSizeView(props: {
4
+ productImage: string;
5
+ productTitle: string;
6
+ formRef: React.MutableRefObject<Record<string, string>>;
7
+ sizingUnit: string;
8
+ setSizingUnit: (u: string) => void;
9
+ setSizingMethod: (m: "exact" | "quick" | null) => void;
10
+ setSizingLoading: (v: boolean) => void;
11
+ setView: (v: ViewState) => void;
12
+ submitSizing: (mode: "exact" | "quick") => void;
13
+ onSnapSubmit: (data: {
14
+ photoFile: File;
15
+ photoBase64: string;
16
+ height: number;
17
+ weight: number;
18
+ heightUnit: string;
19
+ weightUnit: string;
20
+ gender: string;
21
+ age?: number;
22
+ }) => void;
23
+ onBack: () => void;
24
+ t: TranslateFn;
25
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,25 @@
1
+ import type { TranslateFn } from "../../i18n";
2
+ import type { ViewState } from "../types";
3
+ export declare function HeadSizeView(props: {
4
+ productImage: string;
5
+ productTitle: string;
6
+ formRef: React.MutableRefObject<Record<string, string>>;
7
+ sizingUnit: string;
8
+ setSizingUnit: (u: string) => void;
9
+ setSizingMethod: (m: "exact" | "quick" | null) => void;
10
+ setSizingLoading: (v: boolean) => void;
11
+ setView: (v: ViewState) => void;
12
+ submitSizing: (mode: "exact" | "quick") => void;
13
+ onSnapSubmit: (data: {
14
+ photoFile: File;
15
+ photoBase64: string;
16
+ height: number;
17
+ weight: number;
18
+ heightUnit: string;
19
+ weightUnit: string;
20
+ gender: string;
21
+ age?: number;
22
+ }) => void;
23
+ onBack: () => void;
24
+ t: TranslateFn;
25
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,28 +1,29 @@
1
1
  import type { TranslateFn } from "../../i18n";
2
- import type { Profile } from "../types";
3
- /**
4
- * Replaces the old DrawerPanel "My Profiles" view. Shows a grid of profile
5
- * cards with avatar/name/height/weight/select+edit, a "Create New Profile"
6
- * empty card, and a list of recently calculated sizes (the sizeHistory[]
7
- * entries from across all profiles).
8
- *
9
- * Layout matches the reference: ATELIER-style minimal cards with status
10
- * pills, big black call-to-action buttons.
11
- */
2
+ import type { Profile, ProfileMeasurements } from "../types";
12
3
  interface MySizingProfilesViewProps {
13
4
  profiles: Profile[];
14
5
  activeProfileId: string | null;
15
6
  onSelectProfile: (id: string) => void;
16
7
  onEditProfile: (p: Profile) => void;
17
- /** Save a new profile (called from the inline ProfileEditView form). Parent
18
- should add it to the profiles list and run estimateFullMeasurements in
19
- the background to populate measurements. */
20
8
  onSaveNewProfile: (data: Omit<Profile, "id" | "createdAt">) => void;
21
- /** Persist a partial measurement update onto an existing profile */
22
- onSaveProfileMeasurements: (id: string, measurements: import("../types").ProfileMeasurements) => void;
23
- onDeleteProfile: (id: string) => void;
9
+ onSaveProfileMeasurements: (id: string, measurements: ProfileMeasurements, unit?: "cm" | "in") => void;
10
+ onSaveBraSize?: (id: string, bandSize: string, cupSize: string) => void;
11
+ onDeleteProfile?: (id: string) => void;
12
+ /** Called when user clicks delete — parent owns the confirmation modal */
13
+ onRequestDelete: (id: string) => void;
24
14
  onClose: () => void;
15
+ /** Forwarded to CreateProfileWizard — called when a photo is selected or removed */
16
+ onPhotoPreview?: (base64: string | null) => void;
25
17
  t: TranslateFn;
18
+ /** Called by PrimeStyleTryonInner's back button handler to check if there's
19
+ an internal sub-step to go back to before closing the profiles view. */
20
+ onRegisterBackInterceptor?: (canGoBack: () => boolean, goBack: () => void) => void;
26
21
  }
27
- export declare function MySizingProfilesView({ profiles, activeProfileId, onSelectProfile, onEditProfile, onSaveNewProfile, onSaveProfileMeasurements, onDeleteProfile, onClose, t, }: MySizingProfilesViewProps): import("react/jsx-runtime").JSX.Element;
22
+ /** Custom delete confirmation modal replaces browser window.confirm() */
23
+ export declare function DeleteConfirmModal({ onConfirm, onCancel, t, }: {
24
+ onConfirm: () => void;
25
+ onCancel: () => void;
26
+ t: TranslateFn;
27
+ }): import("react/jsx-runtime").JSX.Element;
28
+ export declare function MySizingProfilesView({ profiles, activeProfileId, onSelectProfile, onEditProfile, onSaveNewProfile, onSaveProfileMeasurements, onSaveBraSize, onRequestDelete, onClose, onPhotoPreview, t, onRegisterBackInterceptor, }: MySizingProfilesViewProps): import("react/jsx-runtime").JSX.Element;
28
29
  export {};
@@ -6,7 +6,10 @@ interface PhotoStepMobileProps {
6
6
  onAnalyze: () => void;
7
7
  onSwitchToManual: () => void;
8
8
  error: string;
9
+ photoVariant?: "full-body" | "close-up";
10
+ photoStepHeight?: string;
11
+ onPhotoStepHeightChange?: (v: string) => void;
9
12
  t: TranslateFn;
10
13
  }
11
- export declare function PhotoStepMobile({ photoPreview, handlePhotoSelect, handleRemovePhoto, onAnalyze, onSwitchToManual, error, t, }: PhotoStepMobileProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function PhotoStepMobile({ photoPreview, handlePhotoSelect, handleRemovePhoto, onAnalyze, onSwitchToManual, error, photoVariant, photoStepHeight, onPhotoStepHeightChange, t, }: PhotoStepMobileProps): import("react/jsx-runtime").JSX.Element;
12
15
  export {};
@@ -1,24 +1,15 @@
1
1
  import type { TranslateFn } from "../../i18n";
2
2
  import type { Profile, ProfileMeasurements } from "../types";
3
- /**
4
- * Profile detail view — minimal Gemini-icon redesign.
5
- *
6
- * Layout: a left column with the profile name eyebrow + a Gemini
7
- * monoline body silhouette diagram (acts as the visual reference for
8
- * what each measurement maps to on the body), and a right column with
9
- * the basics (height/weight/age) + the body measurement list. Every
10
- * label is paired with a small Gemini-generated line-art icon — same
11
- * monoline aesthetic as the rest of the SDK assets.
12
- */
13
3
  interface ProfileMeasurementsViewProps {
14
4
  profile: Profile;
15
5
  isActive: boolean;
16
6
  onSelect: () => void;
17
- onSaveMeasurements: (measurements: ProfileMeasurements) => void;
7
+ onSaveMeasurements: (measurements: ProfileMeasurements, unit?: "cm" | "in") => void;
18
8
  onDelete: () => void;
19
9
  onBack: () => void;
20
10
  onSave: () => void;
11
+ onSaveBraSize?: (bandSize: string, cupSize: string) => void;
21
12
  t: TranslateFn;
22
13
  }
23
- export declare function ProfileMeasurementsView({ profile, isActive, onSelect, onSaveMeasurements, onDelete, onBack, onSave, t, }: ProfileMeasurementsViewProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function ProfileMeasurementsView({ profile, isActive, onSelect, onSaveMeasurements, onDelete, onBack, onSave, onSaveBraSize, t, }: ProfileMeasurementsViewProps): import("react/jsx-runtime").JSX.Element;
24
15
  export {};
@@ -2,7 +2,7 @@ import type { TranslateFn } from "../../i18n";
2
2
  import type { FitAreaInfo } from "../../types";
3
3
  import type { ViewState, SizeGuide, SizingResult } from "../types";
4
4
  import type { BodyLandmarks } from "../../pose-detect";
5
- export declare function SizeResultView({ sizingLoading, sizingResult, sizeGuide, resultImageUrl, productImage, productTitle, sizingUnit, setView, handleDownload, onRetryWithFit, retryLoading, selectedFile, previewUrl, handleFileSelect, handleRemovePreview, handleTryOnSubmit, tryOnProcessing, bodyLandmarks, estimationDone, activeSection, setActiveSection, onResetTryOn, onClose, t, }: {
5
+ export declare function SizeResultView({ sizingLoading, sizingResult, sizeGuide, resultImageUrl, productImage, productTitle, sizingUnit, setView, handleDownload, onRetryWithFit, retryLoading, selectedFile, previewUrl, handleFileSelect, handleRemovePreview, handleTryOnSubmit, tryOnProcessing, bodyLandmarks, estimationDone, activeSection, setActiveSection, onResetTryOn, onClose, userHeightCm, t, }: {
6
6
  estimationDone?: boolean;
7
7
  sizingLoading: boolean;
8
8
  sizingResult: SizingResult | null;
@@ -28,5 +28,7 @@ export declare function SizeResultView({ sizingLoading, sizingResult, sizeGuide,
28
28
  onResetTryOn?: () => void;
29
29
  /** Close the SDK modal entirely (Continue Shopping action). */
30
30
  onClose?: () => void;
31
+ /** Active profile's height in cm — used to populate the height row in the fit table. */
32
+ userHeightCm?: number;
31
33
  t: TranslateFn;
32
34
  }): import("react/jsx-runtime").JSX.Element;