@primestyleai/tryon 5.10.47 → 5.10.49

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.
@@ -25619,7 +25619,16 @@ function PrimeStyleTryonInner({
25619
25619
  }
25620
25620
  }, [selectedFile, productImage, productTitle, sizingResult, onProcessing, onError, handleVtoUpdate]);
25621
25621
  const handleRetryWithFit = reactExports.useCallback(async (fitInfo, selectedSizeOverride) => {
25622
- if (!selectedFile || !apiRef.current || !sseRef.current) return;
25622
+ const file = selectedFile || selectedFileRef.current;
25623
+ if (!file || !apiRef.current || !sseRef.current) {
25624
+ console.warn("[ps-sdk:retry] skipping — no file/api/sse", {
25625
+ hasFile: !!file,
25626
+ hasApi: !!apiRef.current,
25627
+ hasSse: !!sseRef.current
25628
+ });
25629
+ return;
25630
+ }
25631
+ console.log("[ps-sdk:retry] starting", { fitInfoCount: fitInfo.length, selectedSizeOverride, fitInfo });
25623
25632
  setRetryLoading(true);
25624
25633
  const vtoCategory = measurementTypeToVtoCategory(detectMeasurementType(productTitle));
25625
25634
  const isApparel = vtoCategory === "apparel";
@@ -25648,7 +25657,7 @@ function PrimeStyleTryonInner({
25648
25657
  clearInterval(pollingRef.current);
25649
25658
  pollingRef.current = null;
25650
25659
  }
25651
- const modelImage = await compressImage(selectedFile);
25660
+ const modelImage = await compressImage(file);
25652
25661
  const outboundFitInfo = isApparel ? fitInfo : void 0;
25653
25662
  const response = await apiRef.current.submitTryOn(
25654
25663
  modelImage,
@@ -25727,12 +25736,17 @@ function PrimeStyleTryonInner({
25727
25736
  }
25728
25737
  }, [selectedFile, productImage, productTitle]);
25729
25738
  const handleRegenerateTryOn = reactExports.useCallback((override) => {
25739
+ console.log("[ps-sdk:regen] fired", { override, hasFile: !!selectedFile, hasRefFile: !!selectedFileRef.current });
25730
25740
  setPendingCustomSize(override);
25731
25741
  const md2 = override.matchDetails || [];
25732
- if (!md2.length) return;
25742
+ if (!md2.length) {
25743
+ console.warn("[ps-sdk:regen] no matchDetails in override — cannot rebuild fitInfo");
25744
+ return;
25745
+ }
25733
25746
  const fitInfo = buildFitInfo(md2, modelPoseRef.current);
25747
+ console.log("[ps-sdk:regen] fitInfo built", { fitInfo, label: override.displayLabel });
25734
25748
  handleRetryWithFit(fitInfo, override.displayLabel);
25735
- }, [handleRetryWithFit]);
25749
+ }, [handleRetryWithFit, selectedFile]);
25736
25750
  const handleDownload = reactExports.useCallback(() => {
25737
25751
  if (!resultImageUrl) return;
25738
25752
  if (resultImageUrl.startsWith("data:")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primestyleai/tryon",
3
- "version": "5.10.47",
3
+ "version": "5.10.49",
4
4
  "description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
5
5
  "type": "module",
6
6
  "main": "dist/primestyle-tryon.js",