@primestyleai/tryon 4.1.0 → 4.1.2
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 +8 -1
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -873,6 +873,8 @@ function PrimeStyleTryonInner({
|
|
|
873
873
|
if (sizeGuide.sections) payload.sizeGuide = { ...sizeGuide, sections: sizeGuide.sections };
|
|
874
874
|
}
|
|
875
875
|
payload.sizingUnit = sizingUnit;
|
|
876
|
+
console.log("[PS-SDK] sizeGuide state:", JSON.stringify({ found: sizeGuide?.found, hasHeaders: !!sizeGuide?.headers, hasRows: !!sizeGuide?.rows, headers: sizeGuide?.headers, rowCount: sizeGuide?.rows?.length }));
|
|
877
|
+
console.log("[PS-SDK] payload.sizeGuide:", payload.sizeGuide ? "present" : "MISSING");
|
|
876
878
|
if (sizingMethod === "exact") {
|
|
877
879
|
const m = { gender: formRef.current.gender || "male", sizingUnit };
|
|
878
880
|
const numericKeys = /* @__PURE__ */ new Set();
|
|
@@ -1511,7 +1513,12 @@ function PrimeStyleTryonInner({
|
|
|
1511
1513
|
const [editing, setEditing] = useState(false);
|
|
1512
1514
|
const [editVals, setEditVals] = useState({});
|
|
1513
1515
|
const [compareSize, setCompareSize] = useState("");
|
|
1514
|
-
const cleanChart = (s) =>
|
|
1516
|
+
const cleanChart = (s) => {
|
|
1517
|
+
const nums = s.replace(/[^\d.\-–]/g, " ").trim().split(/[\s\-–]+/).filter(Boolean).map((n) => parseFloat(n)).filter((n) => !isNaN(n));
|
|
1518
|
+
if (nums.length === 0) return s;
|
|
1519
|
+
if (nums.length === 1) return `${nums[0]}`;
|
|
1520
|
+
return `${nums[0]}–${nums[1]}`;
|
|
1521
|
+
};
|
|
1515
1522
|
const recSize = useMemo(() => {
|
|
1516
1523
|
if (sizingResult?.recommendedSize) return sizingResult.recommendedSize;
|
|
1517
1524
|
if (sizeGuide?.rows && sizeGuide.headers) {
|