@primestyleai/tryon 5.8.36 → 5.8.38
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/primestyle-tryon.js +4 -0
- package/dist/react/index.js +858 -433
- package/dist/react/styles.d.ts +1 -1
- package/dist/react/views/AccessorySizeView.d.ts +3 -1
- package/dist/react/views/CreateProfileWizard.d.ts +19 -1
- package/dist/react/views/FaceSizeView.d.ts +2 -1
- package/dist/react/views/FootSizeView.d.ts +2 -1
- package/dist/react/views/HeadSizeView.d.ts +2 -1
- package/dist/react/views/MySizingProfilesView.d.ts +22 -3
- package/dist/react/views/PhotoStepMobile.d.ts +3 -1
- package/dist/react/views/ProfileMeasurementsView.d.ts +6 -12
- package/dist/react/views/SizeResultView.d.ts +3 -1
- package/dist/storefront/primestyle-tryon.js +858 -433
- package/dist/types.d.ts +4 -0
- package/package.json +1 -1
|
@@ -27,6 +27,8 @@ interface Props {
|
|
|
27
27
|
}];
|
|
28
28
|
/** "close-up" swaps the photo step copy to face/head photo guidance */
|
|
29
29
|
photoVariant?: "full-body" | "close-up";
|
|
30
|
+
/** When true, hides the photo upload CTA entirely — manual entry only */
|
|
31
|
+
disablePhotoUpload?: boolean;
|
|
30
32
|
productImage: string;
|
|
31
33
|
productTitle: string;
|
|
32
34
|
formRef: React.MutableRefObject<Record<string, string>>;
|
|
@@ -49,5 +51,5 @@ interface Props {
|
|
|
49
51
|
onBack: () => void;
|
|
50
52
|
t: TranslateFn;
|
|
51
53
|
}
|
|
52
|
-
export declare function AccessorySizeView({ title, fields, unitOptions, photoVariant, productImage, productTitle, formRef, sizingUnit, setSizingUnit, setSizingMethod, setSizingLoading, setView, submitSizing, onSnapSubmit, onBack, t, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
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;
|
|
53
55
|
export {};
|
|
@@ -36,7 +36,25 @@ 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;
|
|
42
|
+
/** Called during image path to estimate body measurements from photo + height/weight.
|
|
43
|
+
* Returns estimates that get saved to the profile. Wizard shows a calculating
|
|
44
|
+
* animation while this runs. */
|
|
45
|
+
onEstimate?: (data: {
|
|
46
|
+
photoBase64: string;
|
|
47
|
+
height: number;
|
|
48
|
+
weight: number;
|
|
49
|
+
heightUnit: "cm" | "in";
|
|
50
|
+
weightUnit: "kg" | "lbs";
|
|
51
|
+
gender: "male" | "female";
|
|
52
|
+
age?: number;
|
|
53
|
+
}) => Promise<{
|
|
54
|
+
estimates: Record<string, number>;
|
|
55
|
+
unit: string;
|
|
56
|
+
} | null>;
|
|
39
57
|
t: TranslateFn;
|
|
40
58
|
}
|
|
41
|
-
export declare function CreateProfileWizard({ onSave, onCancel, t }: CreateProfileWizardProps): import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
export declare function CreateProfileWizard({ onSave, onCancel, onPhotoPreview, onEstimate, t }: CreateProfileWizardProps): import("react/jsx-runtime").JSX.Element;
|
|
42
60
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TranslateFn } from "../../i18n";
|
|
2
|
-
import type { ViewState } from "../types";
|
|
2
|
+
import type { ViewState, SizeGuide } from "../types";
|
|
3
3
|
export declare function FaceSizeView(props: {
|
|
4
4
|
productImage: string;
|
|
5
5
|
productTitle: string;
|
|
@@ -21,5 +21,6 @@ export declare function FaceSizeView(props: {
|
|
|
21
21
|
age?: number;
|
|
22
22
|
}) => void;
|
|
23
23
|
onBack: () => void;
|
|
24
|
+
sizeGuide?: SizeGuide | null;
|
|
24
25
|
t: TranslateFn;
|
|
25
26
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TranslateFn } from "../../i18n";
|
|
2
|
-
import type { ViewState } from "../types";
|
|
2
|
+
import type { ViewState, SizeGuide } from "../types";
|
|
3
3
|
export declare function FootSizeView(props: {
|
|
4
4
|
productImage: string;
|
|
5
5
|
productTitle: string;
|
|
@@ -21,5 +21,6 @@ export declare function FootSizeView(props: {
|
|
|
21
21
|
age?: number;
|
|
22
22
|
}) => void;
|
|
23
23
|
onBack: () => void;
|
|
24
|
+
sizeGuide?: SizeGuide | null;
|
|
24
25
|
t: TranslateFn;
|
|
25
26
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TranslateFn } from "../../i18n";
|
|
2
|
-
import type { ViewState } from "../types";
|
|
2
|
+
import type { ViewState, SizeGuide } from "../types";
|
|
3
3
|
export declare function HeadSizeView(props: {
|
|
4
4
|
productImage: string;
|
|
5
5
|
productTitle: string;
|
|
@@ -21,5 +21,6 @@ export declare function HeadSizeView(props: {
|
|
|
21
21
|
age?: number;
|
|
22
22
|
}) => void;
|
|
23
23
|
onBack: () => void;
|
|
24
|
+
sizeGuide?: SizeGuide | null;
|
|
24
25
|
t: TranslateFn;
|
|
25
26
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +1,35 @@
|
|
|
1
1
|
import type { TranslateFn } from "../../i18n";
|
|
2
|
-
import type { Profile } from "../types";
|
|
2
|
+
import type { Profile, ProfileMeasurements } from "../types";
|
|
3
3
|
interface MySizingProfilesViewProps {
|
|
4
4
|
profiles: Profile[];
|
|
5
5
|
activeProfileId: string | null;
|
|
6
6
|
onSelectProfile: (id: string) => void;
|
|
7
7
|
onEditProfile: (p: Profile) => void;
|
|
8
8
|
onSaveNewProfile: (data: Omit<Profile, "id" | "createdAt">) => void;
|
|
9
|
-
onSaveProfileMeasurements: (id: string, measurements:
|
|
9
|
+
onSaveProfileMeasurements: (id: string, measurements: ProfileMeasurements, unit?: "cm" | "in") => void;
|
|
10
|
+
onSaveBraSize?: (id: string, bandSize: string, cupSize: string) => void;
|
|
10
11
|
onDeleteProfile?: (id: string) => void;
|
|
11
12
|
/** Called when user clicks delete — parent owns the confirmation modal */
|
|
12
13
|
onRequestDelete: (id: string) => void;
|
|
13
14
|
onClose: () => void;
|
|
15
|
+
/** Forwarded to CreateProfileWizard — called when a photo is selected or removed */
|
|
16
|
+
onPhotoPreview?: (base64: string | null) => void;
|
|
17
|
+
/** Forwarded to CreateProfileWizard — called during image path to estimate measurements */
|
|
18
|
+
onEstimateFromPhoto?: (data: {
|
|
19
|
+
photoBase64: string;
|
|
20
|
+
height: number;
|
|
21
|
+
weight: number;
|
|
22
|
+
heightUnit: "cm" | "in";
|
|
23
|
+
weightUnit: "kg" | "lbs";
|
|
24
|
+
gender: "male" | "female";
|
|
25
|
+
age?: number;
|
|
26
|
+
}) => Promise<{
|
|
27
|
+
estimates: Record<string, number>;
|
|
28
|
+
unit: string;
|
|
29
|
+
} | null>;
|
|
30
|
+
/** Set of profile IDs currently running background estimation — drives the
|
|
31
|
+
* "calculating..." spinner in the profile detail view. */
|
|
32
|
+
estimatingProfileIds?: Set<string>;
|
|
14
33
|
t: TranslateFn;
|
|
15
34
|
/** Called by PrimeStyleTryonInner's back button handler to check if there's
|
|
16
35
|
an internal sub-step to go back to before closing the profiles view. */
|
|
@@ -22,5 +41,5 @@ export declare function DeleteConfirmModal({ onConfirm, onCancel, t, }: {
|
|
|
22
41
|
onCancel: () => void;
|
|
23
42
|
t: TranslateFn;
|
|
24
43
|
}): import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
export declare function MySizingProfilesView({ profiles, activeProfileId, onSelectProfile, onEditProfile, onSaveNewProfile, onSaveProfileMeasurements, onRequestDelete, onClose, t, onRegisterBackInterceptor, }: MySizingProfilesViewProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export declare function MySizingProfilesView({ profiles, activeProfileId, onSelectProfile, onEditProfile, onSaveNewProfile, onSaveProfileMeasurements, onSaveBraSize, onRequestDelete, onClose, onPhotoPreview, onEstimateFromPhoto, estimatingProfileIds, t, onRegisterBackInterceptor, }: MySizingProfilesViewProps): import("react/jsx-runtime").JSX.Element;
|
|
26
45
|
export {};
|
|
@@ -7,7 +7,9 @@ interface PhotoStepMobileProps {
|
|
|
7
7
|
onSwitchToManual: () => void;
|
|
8
8
|
error: string;
|
|
9
9
|
photoVariant?: "full-body" | "close-up";
|
|
10
|
+
photoStepHeight?: string;
|
|
11
|
+
onPhotoStepHeightChange?: (v: string) => void;
|
|
10
12
|
t: TranslateFn;
|
|
11
13
|
}
|
|
12
|
-
export declare function PhotoStepMobile({ photoPreview, handlePhotoSelect, handleRemovePhoto, onAnalyze, onSwitchToManual, error, photoVariant, 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;
|
|
13
15
|
export {};
|
|
@@ -1,24 +1,18 @@
|
|
|
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;
|
|
12
|
+
/** True while background estimation is computing measurements —
|
|
13
|
+
* renders a spinner for empty fields instead of the "—" placeholder. */
|
|
14
|
+
isEstimating?: boolean;
|
|
21
15
|
t: TranslateFn;
|
|
22
16
|
}
|
|
23
|
-
export declare function ProfileMeasurementsView({ profile, isActive, onSelect, onSaveMeasurements, onDelete, onBack, onSave, t, }: ProfileMeasurementsViewProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function ProfileMeasurementsView({ profile, isActive, onSelect, onSaveMeasurements, onDelete, onBack, onSave, onSaveBraSize, isEstimating, t, }: ProfileMeasurementsViewProps): import("react/jsx-runtime").JSX.Element;
|
|
24
18
|
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;
|