@primestyleai/tryon 5.8.45 → 5.8.46
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
CHANGED
|
@@ -238,7 +238,8 @@ function computeMeasurements(lm, imageWidth, imageHeight) {
|
|
|
238
238
|
return pxDist * pxToMm;
|
|
239
239
|
};
|
|
240
240
|
const pd = mmBetween(lm.leftIrisCenter, lm.rightIrisCenter);
|
|
241
|
-
const
|
|
241
|
+
const innerEyeGap = mmBetween(lm.leftInnerEye, lm.rightInnerEye);
|
|
242
|
+
const bridgeWidth = innerEyeGap / 1.6;
|
|
242
243
|
const faceWidth = mmBetween(lm.leftTragus, lm.rightTragus);
|
|
243
244
|
const templeLengthLeft = mmBetween(lm.leftTragus, lm.leftOuterEye);
|
|
244
245
|
const templeLengthRight = mmBetween(lm.rightTragus, lm.rightOuterEye);
|
|
@@ -7950,10 +7951,12 @@ const fitLabelFn = (fit, t) => fit === "good" ? t("perfect fit") : fit === "too-
|
|
|
7950
7951
|
const lengthFitLabelFn = (fit, t) => fit === "good" ? t("perfect fit") : fit === "too-tight" ? t("too short") : fit === "tight" ? t("short") : fit === "a-bit-tight" ? t("a bit short") : fit === "too-loose" ? t("too long") : fit === "loose" ? t("long") : t("a bit long");
|
|
7951
7952
|
function convertNum(n, from, to) {
|
|
7952
7953
|
if (from === to || !n || isNaN(n)) return n;
|
|
7954
|
+
if (from === "mm" || to === "mm") return n;
|
|
7953
7955
|
return from === "cm" ? Math.round(n / 2.54 * 10) / 10 : Math.round(n * 2.54 * 10) / 10;
|
|
7954
7956
|
}
|
|
7955
7957
|
function convertLabel(label, from, to) {
|
|
7956
7958
|
if (from === to) return label;
|
|
7959
|
+
if (from === "mm" || to === "mm") return label;
|
|
7957
7960
|
const conv = (n) => convertNum(n, from, to);
|
|
7958
7961
|
const rangeMatch = label.match(/^(\d+\.?\d*)\s*[-–]\s*(\d+\.?\d*)$/);
|
|
7959
7962
|
if (rangeMatch) return `${conv(parseFloat(rangeMatch[1]))}-${conv(parseFloat(rangeMatch[2]))}`;
|
|
@@ -7994,7 +7997,8 @@ function SectionDetailView({
|
|
|
7994
7997
|
}) {
|
|
7995
7998
|
const recSize = sectionResult?.recommendedSize || "";
|
|
7996
7999
|
const [selectedSize, setSelectedSize] = useState(null);
|
|
7997
|
-
const
|
|
8000
|
+
const unitLblLower = unitLbl.toLowerCase();
|
|
8001
|
+
const displayUnitId = unitLblLower.includes("mm") ? "mm" : unitLblLower.includes("cm") ? "cm" : "in";
|
|
7998
8002
|
const fromUnit = chartUnit || displayUnitId;
|
|
7999
8003
|
const dNum = (n) => convertNum(n, fromUnit, displayUnitId);
|
|
8000
8004
|
const dLabel = (s) => convertLabel(s, fromUnit, displayUnitId);
|
|
@@ -8632,8 +8636,9 @@ function SizeResultView({
|
|
|
8632
8636
|
userHeightCm,
|
|
8633
8637
|
t
|
|
8634
8638
|
}) {
|
|
8635
|
-
const
|
|
8636
|
-
const
|
|
8639
|
+
const resultUnitRaw = (sizingResult?.unit || sizingUnit || "").toString().toLowerCase();
|
|
8640
|
+
const resultUnit = resultUnitRaw === "mm" ? "mm" : resultUnitRaw === "cm" ? "cm" : "in";
|
|
8641
|
+
const unitLbl = resultUnit === "mm" ? t("mm") : sizingUnit === "cm" ? t("cm") : t("in");
|
|
8637
8642
|
const [editVals, setEditVals] = useState({});
|
|
8638
8643
|
const pRange = pRangeFn;
|
|
8639
8644
|
const cellVal = useCallback((row, colIdx, header) => {
|
|
@@ -9700,7 +9700,8 @@ function computeMeasurements(lm, imageWidth, imageHeight) {
|
|
|
9700
9700
|
return pxDist * pxToMm;
|
|
9701
9701
|
};
|
|
9702
9702
|
const pd2 = mmBetween(lm.leftIrisCenter, lm.rightIrisCenter);
|
|
9703
|
-
const
|
|
9703
|
+
const innerEyeGap = mmBetween(lm.leftInnerEye, lm.rightInnerEye);
|
|
9704
|
+
const bridgeWidth = innerEyeGap / 1.6;
|
|
9704
9705
|
const faceWidth = mmBetween(lm.leftTragus, lm.rightTragus);
|
|
9705
9706
|
const templeLengthLeft = mmBetween(lm.leftTragus, lm.leftOuterEye);
|
|
9706
9707
|
const templeLengthRight = mmBetween(lm.rightTragus, lm.rightOuterEye);
|
|
@@ -17374,10 +17375,12 @@ const fitLabelFn = (fit, t2) => fit === "good" ? t2("perfect fit") : fit === "to
|
|
|
17374
17375
|
const lengthFitLabelFn = (fit, t2) => fit === "good" ? t2("perfect fit") : fit === "too-tight" ? t2("too short") : fit === "tight" ? t2("short") : fit === "a-bit-tight" ? t2("a bit short") : fit === "too-loose" ? t2("too long") : fit === "loose" ? t2("long") : t2("a bit long");
|
|
17375
17376
|
function convertNum(n2, from, to) {
|
|
17376
17377
|
if (from === to || !n2 || isNaN(n2)) return n2;
|
|
17378
|
+
if (from === "mm" || to === "mm") return n2;
|
|
17377
17379
|
return from === "cm" ? Math.round(n2 / 2.54 * 10) / 10 : Math.round(n2 * 2.54 * 10) / 10;
|
|
17378
17380
|
}
|
|
17379
17381
|
function convertLabel(label, from, to) {
|
|
17380
17382
|
if (from === to) return label;
|
|
17383
|
+
if (from === "mm" || to === "mm") return label;
|
|
17381
17384
|
const conv = (n2) => convertNum(n2, from, to);
|
|
17382
17385
|
const rangeMatch = label.match(/^(\d+\.?\d*)\s*[-–]\s*(\d+\.?\d*)$/);
|
|
17383
17386
|
if (rangeMatch) return `${conv(parseFloat(rangeMatch[1]))}-${conv(parseFloat(rangeMatch[2]))}`;
|
|
@@ -17418,7 +17421,8 @@ function SectionDetailView({
|
|
|
17418
17421
|
}) {
|
|
17419
17422
|
const recSize = sectionResult?.recommendedSize || "";
|
|
17420
17423
|
const [selectedSize, setSelectedSize] = reactExports.useState(null);
|
|
17421
|
-
const
|
|
17424
|
+
const unitLblLower = unitLbl.toLowerCase();
|
|
17425
|
+
const displayUnitId = unitLblLower.includes("mm") ? "mm" : unitLblLower.includes("cm") ? "cm" : "in";
|
|
17422
17426
|
const fromUnit = chartUnit || displayUnitId;
|
|
17423
17427
|
const dNum = (n2) => convertNum(n2, fromUnit, displayUnitId);
|
|
17424
17428
|
const dLabel = (s) => convertLabel(s, fromUnit, displayUnitId);
|
|
@@ -18056,8 +18060,9 @@ function SizeResultView({
|
|
|
18056
18060
|
userHeightCm,
|
|
18057
18061
|
t: t2
|
|
18058
18062
|
}) {
|
|
18059
|
-
const
|
|
18060
|
-
const
|
|
18063
|
+
const resultUnitRaw = (sizingResult?.unit || sizingUnit || "").toString().toLowerCase();
|
|
18064
|
+
const resultUnit = resultUnitRaw === "mm" ? "mm" : resultUnitRaw === "cm" ? "cm" : "in";
|
|
18065
|
+
const unitLbl = resultUnit === "mm" ? t2("mm") : sizingUnit === "cm" ? t2("cm") : t2("in");
|
|
18061
18066
|
const [editVals, setEditVals] = reactExports.useState({});
|
|
18062
18067
|
const pRange = pRangeFn;
|
|
18063
18068
|
const cellVal = reactExports.useCallback((row, colIdx, header) => {
|