@primestyleai/tryon 5.5.24 → 5.5.26
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 +20 -12
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -5397,14 +5397,13 @@ function SectionDetailView({
|
|
|
5397
5397
|
return { area: m.measurement, userNum, chartLabel: cleanNumFn(chartLabel), fit, isLength: false };
|
|
5398
5398
|
});
|
|
5399
5399
|
}, [sectionResult, lengthEntry, userMeasurements, displaySize, recSize, chartRangeFor, selectedLength, recLength]);
|
|
5400
|
-
const displayLength = selectedLength || recLength;
|
|
5401
5400
|
const goodCount = fitRows.filter(
|
|
5402
5401
|
(r) => r.fit === "good" || r.fit === "a-bit-tight" || r.fit === "a-bit-loose"
|
|
5403
5402
|
).length;
|
|
5404
5403
|
const matchPercent = fitRows.length > 0 ? Math.round(goodCount / fitRows.length * 100) : 0;
|
|
5405
5404
|
const secAny = sectionResult;
|
|
5406
|
-
const
|
|
5407
|
-
const
|
|
5405
|
+
const backendSize = secAny?.size || recSize;
|
|
5406
|
+
const backendLength = secAny?.length || recLength;
|
|
5408
5407
|
const backendAvailableSizes = secAny?.availableSizes || [];
|
|
5409
5408
|
const backendAvailableLengths = secAny?.availableLengths || [];
|
|
5410
5409
|
const finalDisplayLength = selectedLength || backendLength;
|
|
@@ -5463,9 +5462,9 @@ function SectionDetailView({
|
|
|
5463
5462
|
] }),
|
|
5464
5463
|
productImage && /* @__PURE__ */ jsx("div", { className: "ps-msd-image", children: /* @__PURE__ */ jsx("img", { src: productImage, alt: productTitle || "", className: "ps-msd-image-img" }) }),
|
|
5465
5464
|
/* @__PURE__ */ jsxs("div", { className: "ps-msd-card", children: [
|
|
5466
|
-
/* @__PURE__ */ jsx("span", { className: "ps-msd-card-eyebrow", children: t("RECOMMENDED SIZE") }),
|
|
5465
|
+
/* @__PURE__ */ jsx("span", { className: "ps-msd-card-eyebrow", children: displaySize === backendSize ? t("RECOMMENDED SIZE") : t("TRYING SIZE") }),
|
|
5467
5466
|
/* @__PURE__ */ jsxs("div", { className: "ps-msd-card-size-row", children: [
|
|
5468
|
-
/* @__PURE__ */ jsx("span", { className: "ps-msd-card-size", children:
|
|
5467
|
+
/* @__PURE__ */ jsx("span", { className: "ps-msd-card-size", children: displaySize }),
|
|
5469
5468
|
finalDisplayLength && /* @__PURE__ */ jsx("span", { className: "ps-msd-card-size-meta", children: finalDisplayLength })
|
|
5470
5469
|
] }),
|
|
5471
5470
|
/* @__PURE__ */ jsx("div", { className: "ps-msd-card-divider" }),
|
|
@@ -5506,7 +5505,7 @@ function SectionDetailView({
|
|
|
5506
5505
|
/* @__PURE__ */ jsxs("span", { className: "ps-msd-cell-label", children: [
|
|
5507
5506
|
t("SIZE"),
|
|
5508
5507
|
" ",
|
|
5509
|
-
|
|
5508
|
+
displaySize
|
|
5510
5509
|
] }),
|
|
5511
5510
|
/* @__PURE__ */ jsx("span", { className: "ps-msd-cell-value", children: row.chartLabel })
|
|
5512
5511
|
] })
|
|
@@ -5554,7 +5553,7 @@ function SectionDetailView({
|
|
|
5554
5553
|
t("*Our sizing engine recommends"),
|
|
5555
5554
|
" ",
|
|
5556
5555
|
backendSize,
|
|
5557
|
-
|
|
5556
|
+
backendLength ? ` (${backendLength})` : "",
|
|
5558
5557
|
" ",
|
|
5559
5558
|
t("based on your measurements and the garment's tailoring chart.")
|
|
5560
5559
|
] })
|
|
@@ -5564,7 +5563,7 @@ function SectionDetailView({
|
|
|
5564
5563
|
/* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
|
|
5565
5564
|
/* @__PURE__ */ jsx("span", { style: { fontSize: "0.75vw", fontWeight: 700, color: "var(--ps-accent)", textTransform: "uppercase", letterSpacing: "0.12em" }, children: isRecommended ? t("Recommended Size") : t("Not Recommended") }),
|
|
5566
5565
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "baseline", gap: "0.5vw", marginTop: "0.3vw", marginBottom: "0.4vw" }, children: [
|
|
5567
|
-
/* @__PURE__ */ jsx("span", { style: { fontSize: "3.5vw", fontWeight: 300, color: "var(--ps-text-primary)", lineHeight: 1, letterSpacing: "-0.02em" }, children:
|
|
5566
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: "3.5vw", fontWeight: 300, color: "var(--ps-text-primary)", lineHeight: 1, letterSpacing: "-0.02em" }, children: displaySize }),
|
|
5568
5567
|
finalDisplayLength && /* @__PURE__ */ jsx("span", { style: { fontSize: "1.4vw", fontWeight: 400, color: "var(--ps-text-secondary)" }, children: finalDisplayLength })
|
|
5569
5568
|
] }),
|
|
5570
5569
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "0.4vw", marginBottom: "1.2vw" }, children: [
|
|
@@ -5792,6 +5791,15 @@ function SizeResultView({
|
|
|
5792
5791
|
const [poseLines, setPoseLines] = useState(null);
|
|
5793
5792
|
const [poseReady, setPoseReady] = useState(false);
|
|
5794
5793
|
const [imgDims, setImgDims] = useState({ w: 800, h: 1200 });
|
|
5794
|
+
const [analyzingDone, setAnalyzingDone] = useState(false);
|
|
5795
|
+
useEffect(() => {
|
|
5796
|
+
if (!bodyLandmarks) {
|
|
5797
|
+
setAnalyzingDone(false);
|
|
5798
|
+
return;
|
|
5799
|
+
}
|
|
5800
|
+
const id = setTimeout(() => setAnalyzingDone(true), 1800);
|
|
5801
|
+
return () => clearTimeout(id);
|
|
5802
|
+
}, [bodyLandmarks]);
|
|
5795
5803
|
const handleImgLoad = useCallback((e) => {
|
|
5796
5804
|
const el = e.currentTarget;
|
|
5797
5805
|
if (el.naturalWidth && el.naturalHeight) {
|
|
@@ -5961,12 +5969,12 @@ function SizeResultView({
|
|
|
5961
5969
|
/* @__PURE__ */ jsx("span", { children: t("Detecting body pose") })
|
|
5962
5970
|
] }),
|
|
5963
5971
|
!sizingDone && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5964
|
-
/* @__PURE__ */ jsxs("div", { className: `ps-tryon-snap-step${bodyLandmarks ? " ps-active" : ""}`, children: [
|
|
5965
|
-
/* @__PURE__ */ jsx("div", { className: "ps-tryon-snap-step-icon", children: bodyLandmarks ? /* @__PURE__ */ jsx("div", { className: "ps-tryon-size-loading-spinner", style: { width: "1vw", height: "1vw", borderWidth: "1.5px" } }) : /* @__PURE__ */ jsx("span", { className: "ps-tryon-snap-
|
|
5972
|
+
/* @__PURE__ */ jsxs("div", { className: `ps-tryon-snap-step${analyzingDone ? " ps-done" : bodyLandmarks ? " ps-active" : ""}`, children: [
|
|
5973
|
+
/* @__PURE__ */ jsx("div", { className: "ps-tryon-snap-step-icon", children: !bodyLandmarks ? /* @__PURE__ */ jsx("span", { className: "ps-tryon-snap-num", children: "2" }) : !analyzingDone ? /* @__PURE__ */ jsx("div", { className: "ps-tryon-size-loading-spinner", style: { width: "1vw", height: "1vw", borderWidth: "1.5px" } }) : /* @__PURE__ */ jsx("span", { className: "ps-tryon-snap-check", children: "✓" }) }),
|
|
5966
5974
|
/* @__PURE__ */ jsx("span", { children: t("Analyzing your size") })
|
|
5967
5975
|
] }),
|
|
5968
|
-
/* @__PURE__ */ jsxs("div", { className: `ps-tryon-snap-step`, children: [
|
|
5969
|
-
/* @__PURE__ */ jsx("div", { className: "ps-tryon-snap-step-icon", children: /* @__PURE__ */ jsx("span", { className: "ps-tryon-snap-num", children: "3" }) }),
|
|
5976
|
+
/* @__PURE__ */ jsxs("div", { className: `ps-tryon-snap-step${analyzingDone ? " ps-active" : ""}`, children: [
|
|
5977
|
+
/* @__PURE__ */ jsx("div", { className: "ps-tryon-snap-step-icon", children: !analyzingDone ? /* @__PURE__ */ jsx("span", { className: "ps-tryon-snap-num", children: "3" }) : /* @__PURE__ */ jsx("div", { className: "ps-tryon-size-loading-spinner", style: { width: "1vw", height: "1vw", borderWidth: "1.5px" } }) }),
|
|
5970
5978
|
/* @__PURE__ */ jsx("span", { children: t("Finding best fit for you") })
|
|
5971
5979
|
] })
|
|
5972
5980
|
] }),
|