@primestyleai/tryon 1.3.0 → 1.4.0

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.
@@ -132,8 +132,8 @@ class SseClient {
132
132
  this.reconnectAttempts = 0;
133
133
  }
134
134
  }
135
- const MAX_DIMENSION = 1024;
136
- const JPEG_QUALITY = 0.85;
135
+ const MAX_DIMENSION = 768;
136
+ const JPEG_QUALITY = 0.7;
137
137
  function compressImage(file) {
138
138
  return new Promise((resolve, reject) => {
139
139
  const reader = new FileReader();
@@ -1,5 +1,5 @@
1
- import { A as ApiClient, S as SseClient, i as isValidImageFile, c as compressImage } from "./image-utils-DtJVYQIA.js";
2
- import { P } from "./image-utils-DtJVYQIA.js";
1
+ import { A as ApiClient, S as SseClient, i as isValidImageFile, c as compressImage } from "./image-utils-BnXx8V47.js";
2
+ import { P } from "./image-utils-BnXx8V47.js";
3
3
  function detectProductImage() {
4
4
  const ogImage = document.querySelector(
5
5
  'meta[property="og:image"]'
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
3
3
  import { useState, useRef, useEffect, useCallback } from "react";
4
- import { A as ApiClient, S as SseClient, i as isValidImageFile, c as compressImage, P as PrimeStyleError } from "../image-utils-DtJVYQIA.js";
4
+ import { A as ApiClient, S as SseClient, i as isValidImageFile, c as compressImage, P as PrimeStyleError } from "../image-utils-BnXx8V47.js";
5
5
  function cx(base, override) {
6
6
  return override ? `${base} ${override}` : base;
7
7
  }
@@ -141,7 +141,7 @@ function PrimeStyleTryon({
141
141
  }, [apiUrl]);
142
142
  useEffect(() => {
143
143
  if (view === "processing") {
144
- setCountdown(20);
144
+ setCountdown(25);
145
145
  const interval = setInterval(() => {
146
146
  setCountdown((prev) => {
147
147
  if (prev <= 1) {
@@ -486,7 +486,7 @@ function PrimeStyleTryon({
486
486
  }
487
487
  ) }),
488
488
  view === "processing" && /* @__PURE__ */ jsxs("div", { className: "ps-tryon-processing", children: [
489
- /* @__PURE__ */ jsxs("div", { className: "ps-tryon-countdown-ring", children: [
489
+ countdown > 0 ? /* @__PURE__ */ jsxs("div", { className: "ps-tryon-countdown-ring", children: [
490
490
  /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 120 120", children: [
491
491
  /* @__PURE__ */ jsx(
492
492
  "circle",
@@ -505,13 +505,13 @@ function PrimeStyleTryon({
505
505
  cy: "60",
506
506
  r: "52",
507
507
  style: {
508
- strokeDashoffset: `${countdown / 20 * 326.73}`
508
+ strokeDashoffset: `${countdown / 25 * 326.73}`
509
509
  }
510
510
  }
511
511
  )
512
512
  ] }),
513
513
  /* @__PURE__ */ jsx("span", { className: "ps-tryon-countdown-number", children: countdown })
514
- ] }),
514
+ ] }) : /* @__PURE__ */ jsx("div", { className: "ps-tryon-done-pulse", children: /* @__PURE__ */ jsx("div", { className: cx("ps-tryon-spinner", cn.spinner) }) }),
515
515
  /* @__PURE__ */ jsx(
516
516
  "p",
517
517
  {
@@ -519,7 +519,7 @@ function PrimeStyleTryon({
519
519
  "ps-tryon-processing-text",
520
520
  cn.processingText
521
521
  ),
522
- children: "Generating your try-on..."
522
+ children: countdown > 0 ? "Generating your try-on..." : "Almost there..."
523
523
  }
524
524
  ),
525
525
  /* @__PURE__ */ jsx(
@@ -529,7 +529,7 @@ function PrimeStyleTryon({
529
529
  "ps-tryon-processing-sub",
530
530
  cn.processingSubText
531
531
  ),
532
- children: countdown > 0 ? "This usually takes 15-20 seconds" : "Almost there..."
532
+ children: countdown > 0 ? "This usually takes 15-25 seconds" : "Finishing up your look"
533
533
  }
534
534
  )
535
535
  ] }),
@@ -828,6 +828,15 @@ function PrimeStyleTryon({
828
828
  font-variant-numeric: tabular-nums;
829
829
  }
830
830
 
831
+ .ps-tryon-done-pulse {
832
+ animation: ps-fade-scale-in 0.4s ease both;
833
+ margin-bottom: 4px;
834
+ }
835
+ @keyframes ps-fade-scale-in {
836
+ from { opacity: 0; transform: scale(0.8); }
837
+ to { opacity: 1; transform: scale(1); }
838
+ }
839
+
831
840
  .ps-tryon-processing-text { font-size: 14px; color: #fff; margin: 0 0 4px; }
832
841
  .ps-tryon-processing-sub { font-size: 12px; color: #999; margin: 0; }
833
842
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primestyleai/tryon",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
5
5
  "type": "module",
6
6
  "main": "dist/primestyle-tryon.js",