@primestyleai/tryon 3.4.0 → 3.4.2

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.
@@ -246,6 +246,8 @@ function PrimeStyleTryonInner({
246
246
  useEffect(() => {
247
247
  if (view === "processing") {
248
248
  progressRef.current = 0;
249
+ if (progressBarRef.current) progressBarRef.current.style.width = "0%";
250
+ if (progressTextRef.current) progressTextRef.current.textContent = "0%";
249
251
  const statuses = [
250
252
  { at: 0, text: "Preparing your image..." },
251
253
  { at: 15, text: "Analyzing body proportions..." },
@@ -256,6 +258,7 @@ function PrimeStyleTryonInner({
256
258
  ];
257
259
  const interval = setInterval(() => {
258
260
  const p = progressRef.current;
261
+ if (p >= 100) return;
259
262
  const increment = p < 30 ? 1.2 : p < 60 ? 0.8 : p < 80 ? 0.4 : p < 95 ? 0.15 : 0;
260
263
  progressRef.current = Math.min(p + increment, 95);
261
264
  const val = Math.round(progressRef.current);
@@ -447,7 +450,6 @@ function PrimeStyleTryonInner({
447
450
  const qHeight = heightUnit === "ft" ? ftInToCm(parseFloat(formRef.current.heightFeet || "0"), parseFloat(formRef.current.heightInches || "0")) : parseFloat(formRef.current.height || "0");
448
451
  const qWeight = weightUnit === "lbs" ? lbsToKg(parseFloat(formRef.current.weight || "0")) : parseFloat(formRef.current.weight || "0");
449
452
  if (!qHeight || qHeight < 100 || !qWeight || qWeight < 30) {
450
- console.warn("[PrimeStyle] Skipping sizing — invalid height/weight:", { qHeight, qWeight });
451
453
  setSizingLoading(false);
452
454
  return;
453
455
  }
@@ -467,16 +469,8 @@ function PrimeStyleTryonInner({
467
469
  const data = await res.json();
468
470
  setSizingResult(data);
469
471
  } else {
470
- const errBody = await res.text().catch(() => "");
471
- console.error("[PrimeStyle] Sizing API error:", res.status, errBody);
472
- try {
473
- const parsed = JSON.parse(errBody);
474
- if (parsed.issues) console.error("[PrimeStyle] Validation issues:", JSON.stringify(parsed.issues, null, 2));
475
- } catch {
476
- }
477
472
  }
478
- } catch (err) {
479
- console.warn("[PrimeStyle] Sizing request failed:", err);
473
+ } catch {
480
474
  } finally {
481
475
  setSizingLoading(false);
482
476
  }
@@ -985,7 +979,7 @@ function PrimeStyleTryonInner({
985
979
  /* @__PURE__ */ jsx("div", { className: "ps-tryon-scan-overlay" })
986
980
  ] }),
987
981
  /* @__PURE__ */ jsxs("div", { className: "ps-tryon-progress-section", children: [
988
- /* @__PURE__ */ jsx("div", { className: "ps-tryon-progress-bar-wrap", children: /* @__PURE__ */ jsx("div", { ref: progressBarRef, className: "ps-tryon-progress-bar-fill", style: { width: "0%" } }) }),
982
+ /* @__PURE__ */ jsx("div", { className: "ps-tryon-progress-bar-wrap", children: /* @__PURE__ */ jsx("div", { ref: progressBarRef, className: "ps-tryon-progress-bar-fill" }) }),
989
983
  /* @__PURE__ */ jsx("span", { ref: progressTextRef, className: "ps-tryon-progress-pct", children: "0%" })
990
984
  ] }),
991
985
  /* @__PURE__ */ jsx("div", { ref: progressStatusRef, className: cx("ps-tryon-processing-text", cn.processingText), children: "Preparing your image..." }),
@@ -1499,7 +1493,7 @@ const STYLES = `
1499
1493
  }
1500
1494
  .ps-tryon-progress-bar-fill {
1501
1495
  height: 100%; background: linear-gradient(90deg, #bb945c, #d6ba7d);
1502
- border-radius: 3px; transition: width 0.3s ease;
1496
+ border-radius: 3px; transition: width 0.3s ease; width: 0%;
1503
1497
  }
1504
1498
  .ps-tryon-progress-pct {
1505
1499
  font-size: 13px; font-weight: 700; color: #bb945c; min-width: 36px; text-align: right;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primestyleai/tryon",
3
- "version": "3.4.0",
3
+ "version": "3.4.2",
4
4
  "description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
5
5
  "type": "module",
6
6
  "main": "dist/primestyle-tryon.js",