@primestyleai/tryon 4.1.0 → 4.1.1
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 +6 -1
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -1511,7 +1511,12 @@ function PrimeStyleTryonInner({
|
|
|
1511
1511
|
const [editing, setEditing] = useState(false);
|
|
1512
1512
|
const [editVals, setEditVals] = useState({});
|
|
1513
1513
|
const [compareSize, setCompareSize] = useState("");
|
|
1514
|
-
const cleanChart = (s) =>
|
|
1514
|
+
const cleanChart = (s) => {
|
|
1515
|
+
const nums = s.replace(/[^\d.\-–]/g, " ").trim().split(/[\s\-–]+/).filter(Boolean).map((n) => parseFloat(n)).filter((n) => !isNaN(n));
|
|
1516
|
+
if (nums.length === 0) return s;
|
|
1517
|
+
if (nums.length === 1) return `${nums[0]}`;
|
|
1518
|
+
return `${nums[0]}–${nums[1]}`;
|
|
1519
|
+
};
|
|
1515
1520
|
const recSize = useMemo(() => {
|
|
1516
1521
|
if (sizingResult?.recommendedSize) return sizingResult.recommendedSize;
|
|
1517
1522
|
if (sizeGuide?.rows && sizeGuide.headers) {
|