@primestyleai/tryon 5.10.102 → 5.10.104
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/PrimeStyleTryonInner.d.ts +1 -1
- package/dist/react/index.js +4919 -4940
- package/dist/react/index.js.map +1 -1
- package/dist/react/styles.d.ts +1 -1
- package/dist/react/types.d.ts +15 -0
- package/dist/react/utils/pickBestGarmentImage.d.ts +1 -0
- package/dist/react/views/ProductPhotoCarouselCard.d.ts +12 -0
- package/dist/react/views/SizeResultView.d.ts +5 -19
- package/dist/react/views/TryOnGenerationBadge.d.ts +5 -0
- package/dist/sizing/fit-compute.d.ts +8 -3
- package/dist/storefront/primestyle-tryon.js +651 -752
- package/dist/types.d.ts +5 -0
- package/package.json +1 -1
package/dist/react/types.d.ts
CHANGED
|
@@ -139,6 +139,21 @@ export type ViewState = "idle" | "welcome" | "body-profile" | "estimation-review
|
|
|
139
139
|
export type DrawerType = "profiles" | "history" | null;
|
|
140
140
|
export interface PrimeStyleTryonProps {
|
|
141
141
|
productImage: string;
|
|
142
|
+
/** Optional gallery of product photos for the active color/variant.
|
|
143
|
+
*
|
|
144
|
+
* - Shown as an auto-cycling carousel on the single-garment
|
|
145
|
+
* SizeResultView while the try-on image is being generated.
|
|
146
|
+
* - At try-on time the SDK runs MediaPipe BlazePose on every entry in
|
|
147
|
+
* parallel and forwards the highest-scoring "model wearing the
|
|
148
|
+
* garment" shot to Gemini as image 2. Flat-lays / close-up details
|
|
149
|
+
* score ~0 and are skipped. The first image still shows in the UI
|
|
150
|
+
* unchanged. */
|
|
151
|
+
productImages?: string[];
|
|
152
|
+
/** Optional explicit override — if you already know which image in the
|
|
153
|
+
* gallery is the model-wearing-the-garment shot, pass it here and the
|
|
154
|
+
* SDK skips the MediaPipe-based auto-pick. Falls through to auto-pick
|
|
155
|
+
* (or to `productImage`) when omitted. */
|
|
156
|
+
garmentReferenceImage?: string;
|
|
142
157
|
productTitle?: string;
|
|
143
158
|
/** Stable product identifier — used to cache size recommendations per (profile, product) */
|
|
144
159
|
productId?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function pickBestGarmentImage(images: string[] | null | undefined): Promise<string | null>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TranslateFn } from "../../i18n";
|
|
2
|
+
/**
|
|
3
|
+
* Photo strip — shows PER_SLIDE images per row with even spacing, advances
|
|
4
|
+
* to the next group every CYCLE_MS, dot indicators below. Lives at the
|
|
5
|
+
* bottom of the single-garment right panel to entertain users while the
|
|
6
|
+
* try-on is generating.
|
|
7
|
+
*/
|
|
8
|
+
export declare function ProductPhotoCarouselCard({ photos, productTitle, t, }: {
|
|
9
|
+
photos: string[];
|
|
10
|
+
productTitle?: string;
|
|
11
|
+
t: TranslateFn;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import type { TranslateFn } from "../../i18n";
|
|
2
|
-
import type { FitAreaInfo } from "../../types";
|
|
3
2
|
import type { ViewState, SizeGuide, SizingResult } from "../types";
|
|
4
3
|
import type { BodyLandmarks } from "../../pose-detect";
|
|
5
|
-
export declare function SizeResultView({ sizingLoading, sizingResult, sizeGuide, resultImageUrl, productImage, productTitle, productMaterial, productDescription, sizingUnit, setView, handleDownload,
|
|
4
|
+
export declare function SizeResultView({ sizingLoading, sizingResult, sizeGuide, resultImageUrl, productImage, productImages, productTitle, productMaterial, productDescription, sizingUnit, setView, handleDownload, selectedFile, previewUrl, handleFileSelect, handleRemovePreview, handleTryOnSubmit, tryOnProcessing, tryOnStartedAt, bodyLandmarks, faceLandmarks, measurementType, estimationDone, activeSection, setActiveSection, onResetTryOn, onClose, userHeightCm, pendingCustomSizes: pendingCustomSizesProp, onPendingCustomSizeChange, t, }: {
|
|
6
5
|
estimationDone?: boolean;
|
|
7
6
|
sizingLoading: boolean;
|
|
8
7
|
sizingResult: SizingResult | null;
|
|
9
8
|
sizeGuide: SizeGuide | null;
|
|
10
9
|
resultImageUrl: string | null;
|
|
11
10
|
productImage: string;
|
|
11
|
+
/** Optional gallery of photos for the active color/variant — drives the
|
|
12
|
+
* auto-cycling carousel card on the single-garment desktop layout while
|
|
13
|
+
* try-on is processing. */
|
|
14
|
+
productImages?: string[];
|
|
12
15
|
productTitle: string;
|
|
13
16
|
/** Garment material/fabric — feeds the "Garment Spotlight" card on
|
|
14
17
|
* the engaging try-on processing UI. */
|
|
@@ -19,10 +22,6 @@ export declare function SizeResultView({ sizingLoading, sizingResult, sizeGuide,
|
|
|
19
22
|
sizingUnit: string;
|
|
20
23
|
setView: (v: ViewState) => void;
|
|
21
24
|
handleDownload: () => void;
|
|
22
|
-
onRetryWithFit: (fitInfo: FitAreaInfo[], selectedSizeOverride?: string) => void;
|
|
23
|
-
retryLoading: boolean;
|
|
24
|
-
/** Wall-clock ms when the in-flight retry started — drives elapsed counter. */
|
|
25
|
-
retryStartedAt?: number | null;
|
|
26
25
|
selectedFile: File | null;
|
|
27
26
|
previewUrl: string | null;
|
|
28
27
|
handleFileSelect: (file: File) => void;
|
|
@@ -71,18 +70,5 @@ export declare function SizeResultView({ sizingLoading, sizingResult, sizeGuide,
|
|
|
71
70
|
fit: string;
|
|
72
71
|
}>;
|
|
73
72
|
}) => void;
|
|
74
|
-
/** Forwarded down to SectionDetailView — enables post-try-on regen mode. */
|
|
75
|
-
onRegenerateTryOn?: (override: {
|
|
76
|
-
sectionName: string;
|
|
77
|
-
selectedSize: string;
|
|
78
|
-
selectedLength?: string;
|
|
79
|
-
displayLabel: string;
|
|
80
|
-
matchDetails?: Array<{
|
|
81
|
-
measurement: string;
|
|
82
|
-
userValue: string;
|
|
83
|
-
chartRange: string;
|
|
84
|
-
fit: string;
|
|
85
|
-
}>;
|
|
86
|
-
}) => void;
|
|
87
73
|
t: TranslateFn;
|
|
88
74
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { FitAreaInfo } from "../types";
|
|
2
2
|
import type { MeasurementLines } from "../pose-detect";
|
|
3
3
|
export type GranularFit = "good" | "tight" | "loose" | "a-bit-tight" | "a-bit-loose" | "too-tight" | "too-loose";
|
|
4
|
-
/** Compute granular fit label for a single measurement
|
|
5
|
-
|
|
4
|
+
/** Compute granular fit label for a single measurement.
|
|
5
|
+
* Anything within < 1 unit-inch (1 in / 2.54 cm / 25.4 mm) of the chart
|
|
6
|
+
* range counts as "perfect fit" — a 0.2 in delta on the inseam is below
|
|
7
|
+
* visual perception and should not pop a "render visibly tight" prompt
|
|
8
|
+
* directive on the try-on render. */
|
|
9
|
+
export declare function computeFit(userValue: number, chartRange: string, unit?: "in" | "cm" | "mm"): GranularFit;
|
|
6
10
|
/**
|
|
7
11
|
* Build FitAreaInfo[] from matchDetails + optional pose coordinates.
|
|
8
12
|
* This is what gets sent to the backend so Gemini knows how to render each body region.
|
|
@@ -12,7 +16,8 @@ export declare function buildFitInfo(matchDetails: Array<{
|
|
|
12
16
|
userValue: string;
|
|
13
17
|
chartRange: string;
|
|
14
18
|
fit: string;
|
|
15
|
-
|
|
19
|
+
section?: string;
|
|
20
|
+
}>, poseLines?: MeasurementLines | null, unit?: "in" | "cm" | "mm"): FitAreaInfo[];
|
|
16
21
|
/**
|
|
17
22
|
* Build silhouette-prompt context forwarded to the backend try-on Gemini
|
|
18
23
|
* call. Returns the three text-form inputs that the doc example fed to
|