@primestyleai/tryon 5.10.187 → 5.10.189

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.
@@ -111,6 +111,8 @@ export interface ProfileCompletionDraft {
111
111
  braSizeRegion?: string;
112
112
  photoBase64?: string;
113
113
  photoUrl?: string;
114
+ measurements?: ProfileMeasurements;
115
+ measurementsUnit?: "cm" | "in";
114
116
  customMeasurements?: Record<string, number>;
115
117
  }
116
118
  export interface HistoryEntry {
@@ -145,6 +147,8 @@ export interface HistoryEntry {
145
147
  sections?: Record<string, NormalizedSection>;
146
148
  sectionImages?: Record<string, string>;
147
149
  } | null;
150
+ /** Snapshot of the inputs/estimates needed to complete a fit profile from a restored result. */
151
+ profileCompletionDraft?: ProfileCompletionDraft;
148
152
  /** True when the user's model photo for this entry is stored as a Blob in
149
153
  * IndexedDB (key = entry.id). Restored as a File on history click so the
150
154
  * user does not need to re-upload before clicking Try On. Photos live in
@@ -165,6 +169,16 @@ export interface HistoryEntry {
165
169
  isOverride: boolean;
166
170
  }>;
167
171
  }
172
+ export interface PrimeStyleAddToBagPayload {
173
+ productId?: string;
174
+ productTitle?: string;
175
+ productUrl?: string;
176
+ recommendedSize?: string;
177
+ sizingResult?: SizingResultType | null;
178
+ resultImageUrl?: string | null;
179
+ historyEntryId?: string;
180
+ selectedSizes?: HistoryEntry["selectedSizes"];
181
+ }
168
182
  export interface SizeGuide {
169
183
  found: boolean;
170
184
  title?: string;
@@ -201,6 +215,9 @@ export interface PrimeStyleTryonProps {
201
215
  * SDK skips the MediaPipe-based auto-pick. Falls through to auto-pick
202
216
  * (or to `productImage`) when omitted. */
203
217
  garmentReferenceImage?: string;
218
+ /** Optional clean product/detail image. When omitted, the backend picker
219
+ * selects one from productImages and sends it as Gemini's extra design reference. */
220
+ garmentDetailImage?: string;
204
221
  productTitle?: string;
205
222
  /** Absolute product page URL, used by restored history results to continue shopping. */
206
223
  productUrl?: string;
@@ -259,6 +276,12 @@ export interface PrimeStyleTryonProps {
259
276
  message: string;
260
277
  code?: string;
261
278
  }) => void;
279
+ /** Called when the shopper clicks Add to Bag on the SDK result screen. */
280
+ onAddToBag?: (payload: PrimeStyleAddToBagPayload) => void | Promise<void>;
281
+ /** Optional result-screen CTA label overrides. */
282
+ addToBagLabel?: string;
283
+ continueShoppingLabel?: string;
284
+ backToProductPageLabel?: string;
262
285
  /** Size guide data — pass as-is, any format (JSON object, array, HTML). Structured formats are parsed instantly client-side; unrecognised formats fall back to AI. */
263
286
  sizeGuideData?: unknown;
264
287
  }
@@ -8,6 +8,8 @@ export interface UsePrimeStyleSizeState {
8
8
  loading: boolean;
9
9
  /** True if the user has no profile yet — host should show its existing "Find Your Size" CTA */
10
10
  noProfile: boolean;
11
+ /** True when the recommendation is tied to a signed-in PrimeStyle profile */
12
+ authenticatedProfile: boolean;
11
13
  /** The full result if you need confidence/sections/etc. */
12
14
  result: RecommendForProductResult | null;
13
15
  /** Manually re-run the recommendation (e.g. after the user edits their profile) */
@@ -5,6 +5,8 @@ export declare const LS_PREFIX = "primestyle_";
5
5
  export declare const PS_STORAGE_CHANGE_EVENT = "ps:storage-change";
6
6
  export declare function lsGet<T>(key: string, fallback: T): T;
7
7
  export declare function lsSet(key: string, value: unknown): void;
8
+ export declare function lsRemove(key: string): void;
9
+ export declare function clearProfileLocalStorage(): void;
8
10
  export declare function getProfiles(): Profile[];
9
11
  export declare function saveProfiles(profiles: Profile[]): void;
10
12
  export declare function getActiveProfileId(): string | null;
@@ -9,6 +9,8 @@ interface BodyProfileViewProps {
9
9
  initialStep?: "photo" | "basics";
10
10
  /** Use the default upload screen with only height/weight questions. */
11
11
  simplePhotoOnly?: boolean;
12
+ /** Compact desktop treatment for accessory flows that only need height/weight. */
13
+ simpleAccessoryLayout?: boolean;
12
14
  simpleQuestionMode?: "heightWeight" | "shoeReference";
13
15
  formRef: React.MutableRefObject<Record<string, string>>;
14
16
  sizingCountry: string;
@@ -53,6 +55,9 @@ interface BodyProfileViewProps {
53
55
  cup: string;
54
56
  region: string;
55
57
  };
58
+ chestProfile?: ChestProfile;
59
+ midsectionProfile?: MidsectionProfile;
60
+ hipProfile?: HipProfile;
56
61
  extraMeasurements?: Record<string, string | number>;
57
62
  }) => void;
58
63
  /** True if the user has an active profile with stored measurements —
@@ -73,5 +78,5 @@ interface BodyProfileViewProps {
73
78
  onBack: () => void;
74
79
  t: TranslateFn;
75
80
  }
76
- export declare function BodyProfileView({ productImage, productTitle, isWomen, basicOnly, initialStep, simplePhotoOnly, simpleQuestionMode, formRef, sizingCountry, heightUnit, setHeightUnit, weightUnit, setWeightUnit, sizingUnit, setSizingUnit, apiUrl, apiKey, onComplete, onSnapSubmit, hasActiveProfileWithMeasurements, onUseActiveProfile, activeProfileName, onStartFresh, activeProfile, onBack, t, }: BodyProfileViewProps): import("react/jsx-runtime").JSX.Element;
81
+ export declare function BodyProfileView({ productImage, productTitle, isWomen, basicOnly, initialStep, simplePhotoOnly, simpleAccessoryLayout, simpleQuestionMode, formRef, sizingCountry, heightUnit, setHeightUnit, weightUnit, setWeightUnit, sizingUnit, setSizingUnit, apiUrl, apiKey, onComplete, onSnapSubmit, hasActiveProfileWithMeasurements, onUseActiveProfile, activeProfileName, onStartFresh, activeProfile, onBack, t, }: BodyProfileViewProps): import("react/jsx-runtime").JSX.Element;
77
82
  export {};
@@ -38,6 +38,8 @@ interface CreateProfileWizardProps {
38
38
  onCancel: () => void;
39
39
  initialMode?: "manual" | "image";
40
40
  initialDraft?: ProfileCompletionDraft | null;
41
+ /** Direct profile-save path launched from a size result. Keeps the shell back button and skips wizard chrome. */
42
+ directAnalysisFlow?: boolean;
41
43
  /** Backend URL + API key — required for the pre-upload age check call. */
42
44
  apiUrl?: string;
43
45
  apiKey?: string;
@@ -61,5 +63,5 @@ interface CreateProfileWizardProps {
61
63
  } | null>;
62
64
  t: TranslateFn;
63
65
  }
64
- export declare function CreateProfileWizard({ onSave, onCancel, initialMode, initialDraft, apiUrl, apiKey, onPhotoPreview, onEstimate, t }: CreateProfileWizardProps): import("react/jsx-runtime").JSX.Element;
66
+ export declare function CreateProfileWizard({ onSave, onCancel, initialMode, initialDraft, directAnalysisFlow, apiUrl, apiKey, onPhotoPreview, onEstimate, t }: CreateProfileWizardProps): import("react/jsx-runtime").JSX.Element;
65
67
  export {};
@@ -36,6 +36,8 @@ export interface MultiSectionMobileProps {
36
36
  onTryAgain?: () => void;
37
37
  /** Close the SDK / continue shopping. */
38
38
  onClose?: () => void;
39
+ /** Optional bottom CTA group for history/current product commerce actions. */
40
+ resultActionNode?: ReactNode;
39
41
  /** Optional measurement-line overlay to render on top of the result image
40
42
  * (mediapipe toggle). Only displayed when `showLines` is true. */
41
43
  overlayNode?: ReactNode;
@@ -56,4 +58,4 @@ export interface MultiSectionMobileProps {
56
58
  profileCompletionCta?: ReactNode;
57
59
  t: TranslateFn;
58
60
  }
59
- export declare function MultiSectionMobile({ productImage, productTitle, sizingResult, sizeGuide, sectionEntries, pendingCustomSizes, onSelectSection, onTryOn, tryOnProcessing, tryOnStartedAt, resultImageUrl, tryOnDone, onTryAgain, onClose, overlayNode, showLines, onToggleLines, onOpenImage, onDownload, imageActionBar, feedbackSlot, onImageLoad, profileCompletionCta, t, }: MultiSectionMobileProps): import("react/jsx-runtime").JSX.Element;
61
+ export declare function MultiSectionMobile({ productImage, productTitle, sizingResult, sizeGuide, sectionEntries, pendingCustomSizes, onSelectSection, onTryOn, tryOnProcessing, tryOnStartedAt, resultImageUrl, tryOnDone, onTryAgain, onClose, resultActionNode, overlayNode, showLines, onToggleLines, onOpenImage, onDownload, imageActionBar, feedbackSlot, onImageLoad, profileCompletionCta, t, }: MultiSectionMobileProps): import("react/jsx-runtime").JSX.Element;
@@ -10,9 +10,10 @@ import type { TranslateFn } from "../../i18n";
10
10
  * at its normal width/height — only the right-column content swaps to
11
11
  * the no-chart message + CTAs.
12
12
  */
13
- export declare function NoChartView({ productImage, productTitle, onTryOn, onClose, t, }: {
13
+ export declare function NoChartView({ productImage, productTitle, reason, onTryOn, onClose, t, }: {
14
14
  productImage?: string;
15
15
  productTitle?: string;
16
+ reason?: "no-chart" | "no-match";
16
17
  onTryOn: () => void;
17
18
  onClose: () => void;
18
19
  t: TranslateFn;
@@ -17,9 +17,10 @@ interface PhotoStepMobileProps {
17
17
  photoStatus?: string;
18
18
  photoRejection?: string | null;
19
19
  onClearRejection?: () => void;
20
+ photoHelpSlot?: React.ReactNode;
20
21
  bodyContextSlot?: React.ReactNode;
21
22
  hideTabs?: boolean;
22
23
  t: TranslateFn;
23
24
  }
24
- export declare function PhotoStepMobile({ photoPreview, handlePhotoSelect, handleRemovePhoto, onAnalyze, onSwitchToManual, error, photoVariant, photoStepHeight, onPhotoStepHeightChange, ageConfirmed, onAgeConfirmedChange, primaryLabel, compactAgeGate, photoProcessing, photoStatus, photoRejection, onClearRejection, bodyContextSlot, hideTabs, t, }: PhotoStepMobileProps): import("react/jsx-runtime").JSX.Element;
25
+ export declare function PhotoStepMobile({ photoPreview, handlePhotoSelect, handleRemovePhoto, onAnalyze, onSwitchToManual, error, photoVariant, photoStepHeight, onPhotoStepHeightChange, ageConfirmed, onAgeConfirmedChange, primaryLabel, compactAgeGate, photoProcessing, photoStatus, photoRejection, onClearRejection, photoHelpSlot, bodyContextSlot, hideTabs, t, }: PhotoStepMobileProps): import("react/jsx-runtime").JSX.Element;
25
26
  export {};
@@ -2,7 +2,7 @@ import type { TranslateFn } from "../../i18n";
2
2
  import type { ViewState, SizeGuide, SizingResult } from "../types";
3
3
  import type { BodyLandmarks } from "../../pose-detect";
4
4
  import { type ProductPhotoCarouselItem } from "./ProductPhotoCarouselCard";
5
- export declare function SizeResultView({ sizingLoading, sizingResult, sizeGuide, resultImageUrl, productImage, productImages, productCarouselItems, productTitle, productUrl, productMaterial, productDescription, sizingUnit, setView, handleDownload, onContinueShopping, onTryOnFeedbackSubmit, selectedFile, previewUrl, handleFileSelect, handleRemovePreview, handleTryOnSubmit, tryOnProcessing, tryOnStartedAt, bodyLandmarks, faceLandmarks, measurementType, estimationDone, activeSection, setActiveSection, onResetTryOn, onClose, userHeightCm, pendingCustomSizes: pendingCustomSizesProp, onPendingCustomSizeChange, tryOnAvailable, showProfileCompletionCta, onProfileCompletionCta, portalContainer, t, }: {
5
+ export declare function SizeResultView({ sizingLoading, sizingResult, sizeGuide, resultImageUrl, productImage, productImages, productCarouselItems, productTitle, productUrl, productMaterial, productDescription, sizingUnit, setView, handleDownload, onContinueShopping, isHistoryResult, onBackToProductPage, onAddToBag, addToBagLabel, continueShoppingLabel, backToProductPageLabel, onTryOnFeedbackSubmit, selectedFile, previewUrl, handleFileSelect, handleRemovePreview, handleTryOnSubmit, tryOnProcessing, tryOnStartedAt, bodyLandmarks, faceLandmarks, measurementType, estimationDone, activeSection, setActiveSection, onResetTryOn, onClose, userHeightCm, pendingCustomSizes: pendingCustomSizesProp, onPendingCustomSizeChange, tryOnAvailable, showProfileCompletionCta, onProfileCompletionCta, portalContainer, t, }: {
6
6
  estimationDone?: boolean;
7
7
  sizingLoading: boolean;
8
8
  sizingResult: SizingResult | null;
@@ -27,6 +27,12 @@ export declare function SizeResultView({ sizingLoading, sizingResult, sizeGuide,
27
27
  setView: (v: ViewState) => void;
28
28
  handleDownload: () => void;
29
29
  onContinueShopping?: () => void;
30
+ isHistoryResult?: boolean;
31
+ onBackToProductPage?: () => void;
32
+ onAddToBag?: () => void | Promise<void>;
33
+ addToBagLabel?: string;
34
+ continueShoppingLabel?: string;
35
+ backToProductPageLabel?: string;
30
36
  onTryOnFeedbackSubmit?: (input: {
31
37
  rating?: number;
32
38
  note?: string;