@primestyleai/tryon 5.10.142 → 5.10.144

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,20 +19263,13 @@ 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 = 2e3;
19267
- const LAST_HOLD_MS = 400;
19268
- const startRef = reactExports.useRef(Date.now());
19266
+ const STAGE_DWELL_MS = 1800;
19269
19267
  const [stageIdx, setStageIdx] = reactExports.useState(0);
19270
19268
  reactExports.useEffect(() => {
19271
- const stepMs = (TOTAL_MS - LAST_HOLD_MS) / Math.max(1, stages.length - 1);
19272
- const id2 = setInterval(() => {
19273
- const elapsed = Date.now() - startRef.current;
19274
- const idx = Math.min(stages.length - 1, Math.floor(elapsed / stepMs));
19275
- setStageIdx((prev) => prev === idx ? prev : idx);
19276
- if (idx >= stages.length - 1) clearInterval(id2);
19277
- }, 100);
19278
- return () => clearInterval(id2);
19279
- }, [stages.length]);
19269
+ if (stageIdx >= stages.length - 1) return;
19270
+ const id2 = setTimeout(() => setStageIdx((i) => Math.min(stages.length - 1, i + 1)), STAGE_DWELL_MS);
19271
+ return () => clearTimeout(id2);
19272
+ }, [stageIdx, stages.length]);
19280
19273
  reactExports.useEffect(() => {
19281
19274
  if (isPhotoMode && bodyLandmarks && stageIdx === 0) {
19282
19275
  setStageIdx(1);
@@ -29114,7 +29107,7 @@ function PrimeStyleTryonInner({
29114
29107
  const jointCount = lmObj ? Object.keys(lmObj).filter((k2) => k2 !== "imageWidth" && k2 !== "imageHeight" && lmObj[k2]).length : 0;
29115
29108
  console.log(`[ps-sdk:debug] payload → bodyLandmarks=${!!lmObj}(${jointCount} joints)`);
29116
29109
  }
29117
- const minVisible = new Promise((r2) => setTimeout(r2, 2e3));
29110
+ const minVisible = new Promise((r2) => setTimeout(r2, 6e3));
29118
29111
  try {
29119
29112
  const tReq = Date.now();
29120
29113
  const payloadBytes = JSON.stringify(payload).length;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primestyleai/tryon",
3
- "version": "5.10.142",
3
+ "version": "5.10.144",
4
4
  "description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
5
5
  "type": "module",
6
6
  "main": "dist/primestyle-tryon.js",