@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.
@@ -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) => s.replace(/\s*(cm|CM|in|IN|inches|mm|MM)\s*$/i, "").trim();
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primestyleai/tryon",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
5
5
  "type": "module",
6
6
  "main": "dist/primestyle-tryon.js",