@primestyleai/tryon 5.8.56 → 5.8.57

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.
@@ -8238,10 +8238,17 @@ function SectionDetailView({
8238
8238
  }
8239
8239
  const range = rMax - rMin;
8240
8240
  const threshold = range > 0 ? range * 0.5 : rMin * 0.05 || 3;
8241
+ const measLower = m.measurement.toLowerCase();
8242
+ const isDirectional = /length|inseam|sleeve|hem|rise/.test(measLower);
8241
8243
  let fit;
8242
8244
  const tol = Math.max((rMax || rMin) * 0.03, 0.5);
8243
- if (userNum >= rMin - tol && userNum <= rMax + tol) fit = "good";
8244
- else if (userNum < rMin) {
8245
+ if (userNum >= rMin - tol && userNum <= rMax + tol) {
8246
+ fit = "good";
8247
+ } else if (isDirectional) {
8248
+ const diff = userNum > rMax ? userNum - rMax : rMin - userNum;
8249
+ const bucket = diff > threshold * 2 ? "too-" : diff > threshold ? "" : "a-bit-";
8250
+ fit = bucket + (userNum > rMax ? "short" : "long");
8251
+ } else if (userNum < rMin) {
8245
8252
  const diff = rMin - userNum;
8246
8253
  fit = diff > threshold * 2 ? "too-loose" : diff > threshold ? "loose" : "a-bit-loose";
8247
8254
  } else {
@@ -17662,10 +17662,17 @@ function SectionDetailView({
17662
17662
  }
17663
17663
  const range = rMax - rMin;
17664
17664
  const threshold = range > 0 ? range * 0.5 : rMin * 0.05 || 3;
17665
+ const measLower = m2.measurement.toLowerCase();
17666
+ const isDirectional = /length|inseam|sleeve|hem|rise/.test(measLower);
17665
17667
  let fit;
17666
17668
  const tol = Math.max((rMax || rMin) * 0.03, 0.5);
17667
- if (userNum >= rMin - tol && userNum <= rMax + tol) fit = "good";
17668
- else if (userNum < rMin) {
17669
+ if (userNum >= rMin - tol && userNum <= rMax + tol) {
17670
+ fit = "good";
17671
+ } else if (isDirectional) {
17672
+ const diff = userNum > rMax ? userNum - rMax : rMin - userNum;
17673
+ const bucket = diff > threshold * 2 ? "too-" : diff > threshold ? "" : "a-bit-";
17674
+ fit = bucket + (userNum > rMax ? "short" : "long");
17675
+ } else if (userNum < rMin) {
17669
17676
  const diff = rMin - userNum;
17670
17677
  fit = diff > threshold * 2 ? "too-loose" : diff > threshold ? "loose" : "a-bit-loose";
17671
17678
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primestyleai/tryon",
3
- "version": "5.8.56",
3
+ "version": "5.8.57",
4
4
  "description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
5
5
  "type": "module",
6
6
  "main": "dist/primestyle-tryon.js",