@primestyleai/tryon 5.10.116 → 5.10.118

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;
@@ -18048,6 +18048,21 @@ const STYLES$1 = `
18048
18048
  color: var(--ps-error-color); font-size: 0.73vw; margin: 0;
18049
18049
  }
18050
18050
 
18051
+ /* Photo step → manual measurements escape hatch (desktop only — mobile
18052
+ uses MobileBottomTabs). Subtle inline link, sits just above the
18053
+ back/analyze nav row. */
18054
+ .ps-bp-photo-manual-switch {
18055
+ text-align: center; padding: 0.5vw 0 0.3vw;
18056
+ font-size: 0.78vw; color: var(--ps-text-muted);
18057
+ }
18058
+ .ps-bp-photo-manual-link {
18059
+ background: none; border: none; padding: 0;
18060
+ color: var(--ps-accent); font-weight: 600; cursor: pointer;
18061
+ font-size: inherit; font-family: inherit; text-decoration: underline;
18062
+ text-underline-offset: 2px;
18063
+ }
18064
+ .ps-bp-photo-manual-link:hover { color: var(--ps-accent-hover); }
18065
+
18051
18066
  /* Navigation — back left, next right */
18052
18067
  .ps-bp-nav {
18053
18068
  display: flex; align-items: center; margin-top: auto;
@@ -20715,6 +20730,7 @@ function SizeResultView({
20715
20730
  userHeightCm,
20716
20731
  pendingCustomSizes: pendingCustomSizesProp,
20717
20732
  onPendingCustomSizeChange,
20733
+ tryOnAvailable = true,
20718
20734
  t: t2
20719
20735
  }) {
20720
20736
  const resultUnitRaw = (sizingResult?.unit || sizingUnit || "").toString().toLowerCase();
@@ -21008,7 +21024,7 @@ function SizeResultView({
21008
21024
  const isMobile = useIsMobile();
21009
21025
  const isAccessory = measurementType === "face" || measurementType === "head";
21010
21026
  sizingResult?.found === false;
21011
- const vtoExcluded = measurementType === "foot";
21027
+ const vtoExcluded = measurementType === "foot" || !tryOnAvailable;
21012
21028
  const mismatchNotice = sizingResult?.mismatchDetected ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: {
21013
21029
  margin: isMobile ? "8px 0 0" : "0.4vw 0 0",
21014
21030
  padding: isMobile ? "10px 12px" : "0.6vw 0.85vw",
@@ -25223,7 +25239,7 @@ function BodyProfileView({
25223
25239
  t: t2
25224
25240
  }) {
25225
25241
  const steps = isWomen ? FEMALE_STEPS : MALE_STEPS;
25226
- const [step, setStep] = reactExports.useState("basics");
25242
+ const [step, setStep] = reactExports.useState("photo");
25227
25243
  step === "photo" ? 0 : steps.indexOf(step);
25228
25244
  const isMobile = useIsMobile();
25229
25245
  const imperial = isImperial(sizingCountry);
@@ -26339,23 +26355,38 @@ function BodyProfileView({
26339
26355
  }
26340
26356
  )
26341
26357
  ] })
26342
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-nav", children: [
26343
- /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { className: "ps-bp-back-btn", onClick: handleBackStep, type: "button", children: [
26344
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-back-arrow", children: "←" }),
26358
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
26359
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-manual-switch", children: [
26360
+ t2("Prefer not to upload a photo?"),
26345
26361
  " ",
26346
- t2("Back")
26362
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
26363
+ "button",
26364
+ {
26365
+ type: "button",
26366
+ className: "ps-bp-photo-manual-link",
26367
+ onClick: () => setStep("basics"),
26368
+ children: t2("Enter measurements manually")
26369
+ }
26370
+ )
26347
26371
  ] }),
26348
- /* @__PURE__ */ jsxRuntimeExports.jsx(
26349
- "button",
26350
- {
26351
- className: `ps-bp-next-btn${analyzeDisabled ? " ps-bp-btn-disabled" : ""}`,
26352
- onClick: handleNext,
26353
- disabled: analyzeDisabled,
26354
- type: "button",
26355
- title: analyzeDisabled ? analyzeMissing.join(" · ") : void 0,
26356
- children: analyzeLabel
26357
- }
26358
- )
26372
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-nav", children: [
26373
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { className: "ps-bp-back-btn", onClick: handleBackStep, type: "button", children: [
26374
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-back-arrow", children: "←" }),
26375
+ " ",
26376
+ t2("Back")
26377
+ ] }),
26378
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
26379
+ "button",
26380
+ {
26381
+ className: `ps-bp-next-btn${analyzeDisabled ? " ps-bp-btn-disabled" : ""}`,
26382
+ onClick: handleNext,
26383
+ disabled: analyzeDisabled,
26384
+ type: "button",
26385
+ title: analyzeDisabled ? analyzeMissing.join(" · ") : void 0,
26386
+ children: analyzeLabel
26387
+ }
26388
+ )
26389
+ ] })
26359
26390
  ] })
26360
26391
  ] });
26361
26392
  }
@@ -27719,6 +27750,7 @@ function PrimeStyleTryonInner({
27719
27750
  const [sizingMethod, setSizingMethod] = reactExports.useState(null);
27720
27751
  const [sizingResult, setSizingResult] = reactExports.useState(null);
27721
27752
  const [sizingLoading, setSizingLoading] = reactExports.useState(false);
27753
+ const [usedAiPhotoSizing, setUsedAiPhotoSizing] = reactExports.useState(false);
27722
27754
  reactExports.useEffect(() => {
27723
27755
  if (!sizingResult?.recommendedSize) return;
27724
27756
  console.log("[ps-sdk:reset] new sizingResult — clearing all section overrides", {
@@ -28123,6 +28155,7 @@ function PrimeStyleTryonInner({
28123
28155
  setSizingLoading(false);
28124
28156
  setEstimatedValues(null);
28125
28157
  setEstimationLoading(false);
28158
+ setUsedAiPhotoSizing(false);
28126
28159
  setProfileSaved(false);
28127
28160
  formRef.current = {};
28128
28161
  setFormGender("male");
@@ -29327,6 +29360,7 @@ function PrimeStyleTryonInner({
29327
29360
  formRef.current.gender = data.gender;
29328
29361
  if (data.bandSize) formRef.current.bandSize = data.bandSize;
29329
29362
  if (data.cupSize) formRef.current.cupSize = data.cupSize;
29363
+ setUsedAiPhotoSizing(!!data.bodyImage);
29330
29364
  handleQuickEstimate(
29331
29365
  data.height,
29332
29366
  data.weight,
@@ -29341,7 +29375,10 @@ function PrimeStyleTryonInner({
29341
29375
  data.bodyImage
29342
29376
  );
29343
29377
  },
29344
- onSnapSubmit: handleSnapSubmit,
29378
+ onSnapSubmit: (data) => {
29379
+ setUsedAiPhotoSizing(true);
29380
+ handleSnapSubmit(data);
29381
+ },
29345
29382
  onBack: handleClose,
29346
29383
  t: t2
29347
29384
  },
@@ -29395,6 +29432,7 @@ function PrimeStyleTryonInner({
29395
29432
  handleTryOnSubmit,
29396
29433
  tryOnProcessing,
29397
29434
  tryOnStartedAt,
29435
+ tryOnAvailable: usedAiPhotoSizing,
29398
29436
  bodyLandmarks,
29399
29437
  faceLandmarks,
29400
29438
  measurementType: detectMeasurementType(productTitle),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primestyleai/tryon",
3
- "version": "5.10.116",
3
+ "version": "5.10.118",
4
4
  "description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
5
5
  "type": "module",
6
6
  "main": "dist/primestyle-tryon.js",