@primestyleai/tryon 5.10.15 → 5.10.17
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 +611 -605
- package/dist/react/index.js.map +1 -1
- package/dist/storefront/primestyle-tryon.js +13 -8
- package/package.json +1 -1
|
@@ -17754,7 +17754,7 @@ function MeasurementOverlay({ lines, fitRows, show, imgWidth, imgHeight }) {
|
|
|
17754
17754
|
const delay = i * 0.35;
|
|
17755
17755
|
const curvePath = `M ${x1} ${cy} Q ${midX} ${cy + curveDepth} ${x2} ${cy}`;
|
|
17756
17756
|
const lineLen = width * 1.05;
|
|
17757
|
-
const labelText = fitRow ? fitRow.fit === "good" ? "
|
|
17757
|
+
const labelText = fitRow ? fitRow.fit === "good" ? "✓ Fit" : fitRow.isLength ? fitRow.fit.includes("short") || fitRow.fit.includes("tight") ? "Short" : "Long" : fitRow.fit.includes("tight") ? "Tight" : "Loose" : label;
|
|
17758
17758
|
const labelFont = Math.round(14 * scale);
|
|
17759
17759
|
const labelWidthEst = labelText.length * labelFont * 0.62;
|
|
17760
17760
|
const rightSpace = W2 - x2 - 12 * scale;
|
|
@@ -18194,13 +18194,8 @@ function SectionDetailView({
|
|
|
18194
18194
|
return "";
|
|
18195
18195
|
};
|
|
18196
18196
|
const fitBadgeLabel = (fit, isLen) => {
|
|
18197
|
-
if (fit === "good") return t2("
|
|
18198
|
-
if (
|
|
18199
|
-
return fit === "a-bit-tight" || fit === "a-bit-short" ? t2("A BIT SHORT") : fit.includes("too") ? t2("TOO SHORT") : t2("SHORT");
|
|
18200
|
-
}
|
|
18201
|
-
if (isLen && (fit.includes("long") || fit === "loose" || fit === "too-loose" || fit === "a-bit-loose")) {
|
|
18202
|
-
return fit === "a-bit-loose" || fit === "a-bit-long" ? t2("A BIT LONG") : fit.includes("too") ? t2("TOO LONG") : t2("LONG");
|
|
18203
|
-
}
|
|
18197
|
+
if (isLen && fit === "good") return t2("EDITORIAL LENGTH");
|
|
18198
|
+
if (fit === "good") return t2("PERFECT TENSION");
|
|
18204
18199
|
if (fit === "a-bit-tight") return t2("SLIGHTLY TIGHT");
|
|
18205
18200
|
if (fit === "a-bit-loose") return t2("SLIGHT EASE");
|
|
18206
18201
|
if (fit.includes("tight")) return t2("TIGHT");
|
|
@@ -24152,6 +24147,16 @@ function PrimeStyleTryonInner({
|
|
|
24152
24147
|
const minVisible = new Promise((r2) => setTimeout(r2, 4500));
|
|
24153
24148
|
try {
|
|
24154
24149
|
const faceResult = await detectFaceMeasurements(objUrl);
|
|
24150
|
+
if (!faceResult) {
|
|
24151
|
+
console.warn("[ps-sdk] face detection returned no result — likely a full-body photo for a face/head product");
|
|
24152
|
+
await minVisible;
|
|
24153
|
+
const msg = measurementType === "head" ? t2("We couldn't detect your head clearly. Please upload a close-up photo that shows your full head and ears.") : t2("We couldn't detect your face clearly. Please upload a close-up selfie that shows both eyes.");
|
|
24154
|
+
setErrorMessage(msg);
|
|
24155
|
+
setView("error");
|
|
24156
|
+
onError?.({ message: msg, code: "FACE_DETECTION_FAILED" });
|
|
24157
|
+
setSizingLoading(false);
|
|
24158
|
+
return;
|
|
24159
|
+
}
|
|
24155
24160
|
if (faceResult) setFaceLandmarks(faceResult.landmarks);
|
|
24156
24161
|
const facePayload = {
|
|
24157
24162
|
product: { title: productTitle, productId: effectiveProductId },
|