@primestyleai/tryon 5.8.34 → 5.8.36
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/react/index.js +1237 -483
- package/dist/react/recommendForProduct.d.ts +11 -2
- package/dist/react/styles.d.ts +1 -1
- package/dist/react/views/AccessorySizeView.d.ts +53 -0
- package/dist/react/views/FaceSizeView.d.ts +25 -0
- package/dist/react/views/FootSizeView.d.ts +25 -0
- package/dist/react/views/HeadSizeView.d.ts +25 -0
- package/dist/react/views/MySizingProfilesView.d.ts +13 -15
- package/dist/react/views/PhotoStepMobile.d.ts +2 -1
- package/dist/storefront/primestyle-tryon.js +1237 -483
- package/package.json +1 -1
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
productImage: string;
|
|
31
|
+
productTitle: string;
|
|
32
|
+
formRef: React.MutableRefObject<Record<string, string>>;
|
|
33
|
+
sizingUnit: string;
|
|
34
|
+
setSizingUnit: (u: string) => void;
|
|
35
|
+
setSizingMethod: (m: "exact" | "quick" | null) => void;
|
|
36
|
+
setSizingLoading: (v: boolean) => void;
|
|
37
|
+
setView: (v: ViewState) => void;
|
|
38
|
+
submitSizing: (mode: "exact" | "quick") => void;
|
|
39
|
+
onSnapSubmit: (data: {
|
|
40
|
+
photoFile: File;
|
|
41
|
+
photoBase64: string;
|
|
42
|
+
height: number;
|
|
43
|
+
weight: number;
|
|
44
|
+
heightUnit: string;
|
|
45
|
+
weightUnit: string;
|
|
46
|
+
gender: string;
|
|
47
|
+
age?: number;
|
|
48
|
+
}) => void;
|
|
49
|
+
onBack: () => void;
|
|
50
|
+
t: TranslateFn;
|
|
51
|
+
}
|
|
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;
|
|
53
|
+
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,26 @@
|
|
|
1
1
|
import type { TranslateFn } from "../../i18n";
|
|
2
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
|
-
*/
|
|
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
9
|
onSaveProfileMeasurements: (id: string, measurements: import("../types").ProfileMeasurements) => void;
|
|
23
|
-
onDeleteProfile
|
|
10
|
+
onDeleteProfile?: (id: string) => void;
|
|
11
|
+
/** Called when user clicks delete — parent owns the confirmation modal */
|
|
12
|
+
onRequestDelete: (id: string) => void;
|
|
24
13
|
onClose: () => void;
|
|
25
14
|
t: TranslateFn;
|
|
15
|
+
/** Called by PrimeStyleTryonInner's back button handler to check if there's
|
|
16
|
+
an internal sub-step to go back to before closing the profiles view. */
|
|
17
|
+
onRegisterBackInterceptor?: (canGoBack: () => boolean, goBack: () => void) => void;
|
|
26
18
|
}
|
|
27
|
-
|
|
19
|
+
/** Custom delete confirmation modal — replaces browser window.confirm() */
|
|
20
|
+
export declare function DeleteConfirmModal({ onConfirm, onCancel, t, }: {
|
|
21
|
+
onConfirm: () => void;
|
|
22
|
+
onCancel: () => void;
|
|
23
|
+
t: TranslateFn;
|
|
24
|
+
}): 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;
|
|
28
26
|
export {};
|
|
@@ -6,7 +6,8 @@ interface PhotoStepMobileProps {
|
|
|
6
6
|
onAnalyze: () => void;
|
|
7
7
|
onSwitchToManual: () => void;
|
|
8
8
|
error: string;
|
|
9
|
+
photoVariant?: "full-body" | "close-up";
|
|
9
10
|
t: TranslateFn;
|
|
10
11
|
}
|
|
11
|
-
export declare function PhotoStepMobile({ photoPreview, handlePhotoSelect, handleRemovePhoto, onAnalyze, onSwitchToManual, error, t, }: PhotoStepMobileProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function PhotoStepMobile({ photoPreview, handlePhotoSelect, handleRemovePhoto, onAnalyze, onSwitchToManual, error, photoVariant, t, }: PhotoStepMobileProps): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export {};
|