@primestyleai/tryon 5.10.140 → 5.10.142

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.
@@ -19263,8 +19263,8 @@ function MobileScanningView({
19263
19263
  const img = e.currentTarget;
19264
19264
  setDims({ w: img.naturalWidth || img.offsetWidth, h: img.naturalHeight || img.offsetHeight });
19265
19265
  };
19266
- const TOTAL_MS = 6e3;
19267
- const LAST_HOLD_MS = 1e3;
19266
+ const TOTAL_MS = 2e3;
19267
+ const LAST_HOLD_MS = 400;
19268
19268
  const startRef = reactExports.useRef(Date.now());
19269
19269
  const [stageIdx, setStageIdx] = reactExports.useState(0);
19270
19270
  reactExports.useEffect(() => {
@@ -19894,7 +19894,7 @@ function MeasurementOverlay({ lines, fitRows, show, imgWidth, imgHeight }) {
19894
19894
  const curvePath = `M ${x1} ${cy} Q ${midX} ${cy + curveDepth} ${x2} ${cy}`;
19895
19895
  const lineLen = width * 1.05;
19896
19896
  const labelText = fitRow ? fitRow.fit === "good" ? "✓ Fit" : fitRow.isLength ? fitRow.fit.includes("short") || fitRow.fit.includes("tight") ? "Short" : "Long" : fitRow.fit.includes("tight") ? "Tight" : "Loose" : label;
19897
- const labelFont = Math.round(14 * scale);
19897
+ const labelFont = Math.max(14, Math.round(22 * scale));
19898
19898
  const labelWidthEst = labelText.length * labelFont * 0.62;
19899
19899
  const rightSpace = W2 - x2 - 12 * scale;
19900
19900
  const flipLeft = rightSpace < labelWidthEst;
@@ -28510,8 +28510,8 @@ function PrimeStyleTryonInner({
28510
28510
  const profileWeight = p2.weight ?? p2.weightKg ?? 0;
28511
28511
  const hasIdentity = profileHeight > 0 && profileWeight > 0;
28512
28512
  if (!hasIdentity) return;
28513
- setConfirmProfile(p2);
28514
- }, [profiles, activeProfileId]);
28513
+ void runRecommendWithProfile(p2);
28514
+ }, [profiles, activeProfileId, runRecommendWithProfile]);
28515
28515
  const proceedFromConfirmProfile = reactExports.useCallback(() => {
28516
28516
  if (!confirmProfile) return;
28517
28517
  const p2 = confirmProfile;
@@ -29114,7 +29114,7 @@ function PrimeStyleTryonInner({
29114
29114
  const jointCount = lmObj ? Object.keys(lmObj).filter((k2) => k2 !== "imageWidth" && k2 !== "imageHeight" && lmObj[k2]).length : 0;
29115
29115
  console.log(`[ps-sdk:debug] payload → bodyLandmarks=${!!lmObj}(${jointCount} joints)`);
29116
29116
  }
29117
- const minVisible = new Promise((r2) => setTimeout(r2, 6e3));
29117
+ const minVisible = new Promise((r2) => setTimeout(r2, 2e3));
29118
29118
  try {
29119
29119
  const tReq = Date.now();
29120
29120
  const payloadBytes = JSON.stringify(payload).length;
@@ -29349,18 +29349,18 @@ function PrimeStyleTryonInner({
29349
29349
  }
29350
29350
  }, [selectedFile, productImage, productTitle, sizingResult, onProcessing, onError, handleVtoUpdate]);
29351
29351
  reactExports.useEffect(() => {
29352
- if (!sizingResult) {
29352
+ if (view !== "size-result") {
29353
29353
  autoTryOnFiredRef.current = false;
29354
29354
  return;
29355
29355
  }
29356
- if (sizingResult.found === false) return;
29357
29356
  if (noFitFoundRef.current) return;
29358
29357
  if (autoTryOnFiredRef.current) return;
29359
29358
  if (tryOnProcessing || resultImageUrl) return;
29360
- if (!selectedFile && !selectedFileRef.current) return;
29359
+ const file = selectedFile || selectedFileRef.current;
29360
+ if (!file) return;
29361
29361
  autoTryOnFiredRef.current = true;
29362
29362
  handleTryOnSubmit();
29363
- }, [sizingResult, tryOnProcessing, resultImageUrl, selectedFile, handleTryOnSubmit]);
29363
+ }, [view, selectedFile, tryOnProcessing, resultImageUrl, handleTryOnSubmit]);
29364
29364
  const handleDownload = reactExports.useCallback(() => {
29365
29365
  if (!resultImageUrl) return;
29366
29366
  if (resultImageUrl.startsWith("data:")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primestyleai/tryon",
3
- "version": "5.10.140",
3
+ "version": "5.10.142",
4
4
  "description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
5
5
  "type": "module",
6
6
  "main": "dist/primestyle-tryon.js",