@primestyleai/tryon 5.10.117 → 5.10.119

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.
@@ -1,7 +1,7 @@
1
1
  import type { TranslateFn } from "../../i18n";
2
2
  import type { ViewState, SizeGuide, SizingResult } from "../types";
3
3
  import type { BodyLandmarks } from "../../pose-detect";
4
- export declare function SizeResultView({ sizingLoading, sizingResult, sizeGuide, resultImageUrl, productImage, productImages, productTitle, productMaterial, productDescription, sizingUnit, setView, handleDownload, selectedFile, previewUrl, handleFileSelect, handleRemovePreview, handleTryOnSubmit, tryOnProcessing, tryOnStartedAt, bodyLandmarks, faceLandmarks, measurementType, estimationDone, activeSection, setActiveSection, onResetTryOn, onClose, userHeightCm, pendingCustomSizes: pendingCustomSizesProp, onPendingCustomSizeChange, t, }: {
4
+ export declare function SizeResultView({ sizingLoading, sizingResult, sizeGuide, resultImageUrl, productImage, productImages, productTitle, productMaterial, productDescription, sizingUnit, setView, handleDownload, selectedFile, previewUrl, handleFileSelect, handleRemovePreview, handleTryOnSubmit, tryOnProcessing, tryOnStartedAt, bodyLandmarks, faceLandmarks, measurementType, estimationDone, activeSection, setActiveSection, onResetTryOn, onClose, userHeightCm, pendingCustomSizes: pendingCustomSizesProp, onPendingCustomSizeChange, tryOnAvailable, t, }: {
5
5
  estimationDone?: boolean;
6
6
  sizingLoading: boolean;
7
7
  sizingResult: SizingResult | null;
@@ -70,5 +70,9 @@ export declare function SizeResultView({ sizingLoading, sizingResult, sizeGuide,
70
70
  fit: string;
71
71
  }>;
72
72
  }) => void;
73
+ /** When false, the size-result view drops every Try-On affordance and
74
+ * shows "Continue Shopping" instead. Set to false when sizing came in
75
+ * via the manual measurements path (no photo collected upstream). */
76
+ tryOnAvailable?: boolean;
73
77
  t: TranslateFn;
74
78
  }): import("react/jsx-runtime").JSX.Element;
@@ -11371,8 +11371,14 @@ const STYLES$1 = `
11371
11371
  .ps-tryon-sr-card-v2-value {
11372
11372
  font-size: 2.2vw; font-weight: 200; color: var(--ps-text-primary);
11373
11373
  line-height: 1; letter-spacing: -0.02em;
11374
+ overflow-wrap: anywhere;
11374
11375
  }
11375
11376
  .ps-tryon-sr-card-v2.ps-full .ps-tryon-sr-card-v2-value { font-size: 1.8vw; }
11377
+ /* Long combined labels ("MISSY 12 / Standard", "PLUS 16W / Extra Length")
11378
+ overflow the card at 2vw. Drop to ~1.3vw whenever the label is more
11379
+ than ~12 chars so the whole thing fits on one line. */
11380
+ .ps-tryon-sr-card-v2-value.ps-long { font-size: 1.4vw; }
11381
+ .ps-tryon-sr-card-v2.ps-full .ps-tryon-sr-card-v2-value.ps-long { font-size: 1.2vw; }
11376
11382
  .ps-tryon-sr-card-v2-value-suffix {
11377
11383
  font-size: 0.75vw; font-weight: 500; color: var(--ps-text-secondary);
11378
11384
  letter-spacing: 0; margin-left: 0.25vw; white-space: nowrap;
@@ -20276,7 +20282,7 @@ function SectionDetailView({
20276
20282
  }, children: [
20277
20283
  /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "ps-msd-card-size", children: [
20278
20284
  displaySizeLabel,
20279
- !selectedCountry && finalDisplayLength ? ` / ${finalDisplayLength}` : ""
20285
+ !selectedCountry && finalDisplayLength && !displaySizeLabel.includes(" / ") ? ` / ${finalDisplayLength}` : ""
20280
20286
  ] }),
20281
20287
  finalDisplayLength && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-msd-card-size-meta", children: finalDisplayLength }),
20282
20288
  selectedCountry && isRecommended && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "ps-msd-card-size-meta", style: { fontSize: "11px", opacity: 0.7 }, children: [
@@ -20730,6 +20736,7 @@ function SizeResultView({
20730
20736
  userHeightCm,
20731
20737
  pendingCustomSizes: pendingCustomSizesProp,
20732
20738
  onPendingCustomSizeChange,
20739
+ tryOnAvailable = true,
20733
20740
  t: t2
20734
20741
  }) {
20735
20742
  const resultUnitRaw = (sizingResult?.unit || sizingUnit || "").toString().toLowerCase();
@@ -21023,7 +21030,7 @@ function SizeResultView({
21023
21030
  const isMobile = useIsMobile();
21024
21031
  const isAccessory = measurementType === "face" || measurementType === "head";
21025
21032
  sizingResult?.found === false;
21026
- const vtoExcluded = measurementType === "foot";
21033
+ const vtoExcluded = measurementType === "foot" || !tryOnAvailable;
21027
21034
  const mismatchNotice = sizingResult?.mismatchDetected ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: {
21028
21035
  margin: isMobile ? "8px 0 0" : "0.4vw 0 0",
21029
21036
  padding: isMobile ? "10px 12px" : "0.6vw 0.85vw",
@@ -21550,7 +21557,11 @@ function SizeResultView({
21550
21557
  type: "button",
21551
21558
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-sr-card-v2-text", children: [
21552
21559
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-tryon-sr-card-v2-label", children: sectionName }),
21553
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-tryon-sr-card-v2-value", children: pendingCustomSizes[sectionName]?.displayLabel || singleResult.recommendedSize || "—" }),
21560
+ (() => {
21561
+ const labelText = pendingCustomSizes[sectionName]?.displayLabel || singleResult.recommendedSize || "—";
21562
+ const isLong = labelText.length > 12;
21563
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `ps-tryon-sr-card-v2-value${isLong ? " ps-long" : ""}`, children: labelText });
21564
+ })(),
21554
21565
  /* @__PURE__ */ jsxRuntimeExports.jsx(
21555
21566
  "span",
21556
21567
  {
@@ -27749,6 +27760,7 @@ function PrimeStyleTryonInner({
27749
27760
  const [sizingMethod, setSizingMethod] = reactExports.useState(null);
27750
27761
  const [sizingResult, setSizingResult] = reactExports.useState(null);
27751
27762
  const [sizingLoading, setSizingLoading] = reactExports.useState(false);
27763
+ const [usedAiPhotoSizing, setUsedAiPhotoSizing] = reactExports.useState(false);
27752
27764
  reactExports.useEffect(() => {
27753
27765
  if (!sizingResult?.recommendedSize) return;
27754
27766
  console.log("[ps-sdk:reset] new sizingResult — clearing all section overrides", {
@@ -28153,6 +28165,7 @@ function PrimeStyleTryonInner({
28153
28165
  setSizingLoading(false);
28154
28166
  setEstimatedValues(null);
28155
28167
  setEstimationLoading(false);
28168
+ setUsedAiPhotoSizing(false);
28156
28169
  setProfileSaved(false);
28157
28170
  formRef.current = {};
28158
28171
  setFormGender("male");
@@ -29357,6 +29370,7 @@ function PrimeStyleTryonInner({
29357
29370
  formRef.current.gender = data.gender;
29358
29371
  if (data.bandSize) formRef.current.bandSize = data.bandSize;
29359
29372
  if (data.cupSize) formRef.current.cupSize = data.cupSize;
29373
+ setUsedAiPhotoSizing(!!data.bodyImage);
29360
29374
  handleQuickEstimate(
29361
29375
  data.height,
29362
29376
  data.weight,
@@ -29371,7 +29385,10 @@ function PrimeStyleTryonInner({
29371
29385
  data.bodyImage
29372
29386
  );
29373
29387
  },
29374
- onSnapSubmit: handleSnapSubmit,
29388
+ onSnapSubmit: (data) => {
29389
+ setUsedAiPhotoSizing(true);
29390
+ handleSnapSubmit(data);
29391
+ },
29375
29392
  onBack: handleClose,
29376
29393
  t: t2
29377
29394
  },
@@ -29425,6 +29442,7 @@ function PrimeStyleTryonInner({
29425
29442
  handleTryOnSubmit,
29426
29443
  tryOnProcessing,
29427
29444
  tryOnStartedAt,
29445
+ tryOnAvailable: usedAiPhotoSizing,
29428
29446
  bodyLandmarks,
29429
29447
  faceLandmarks,
29430
29448
  measurementType: detectMeasurementType(productTitle),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primestyleai/tryon",
3
- "version": "5.10.117",
3
+ "version": "5.10.119",
4
4
  "description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
5
5
  "type": "module",
6
6
  "main": "dist/primestyle-tryon.js",