@primestyleai/tryon 5.8.18 → 5.8.20

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.
@@ -9288,6 +9288,7 @@ function BasicsStepMobile({
9288
9288
  fastPathLabel,
9289
9289
  activeProfileName,
9290
9290
  onStartFresh,
9291
+ hidePhotoOptions = false,
9291
9292
  error,
9292
9293
  t
9293
9294
  }) {
@@ -9448,20 +9449,22 @@ function BasicsStepMobile({
9448
9449
  ] })
9449
9450
  ] })
9450
9451
  ] }),
9451
- /* @__PURE__ */ jsx("div", { className: "ps-bpm-or", children: /* @__PURE__ */ jsx("span", { children: t("or") }) }),
9452
- /* @__PURE__ */ jsxs(
9453
- "button",
9454
- {
9455
- type: "button",
9456
- className: "ps-bpm-upload-link",
9457
- onClick: onUploadPhoto,
9458
- children: [
9459
- /* @__PURE__ */ jsx(CameraSmallIcon, {}),
9460
- /* @__PURE__ */ jsx("span", { children: t("Upload a photo for AI sizing") }),
9461
- /* @__PURE__ */ jsx(ChevronRight, {})
9462
- ]
9463
- }
9464
- ),
9452
+ !hidePhotoOptions && /* @__PURE__ */ jsxs(Fragment, { children: [
9453
+ /* @__PURE__ */ jsx("div", { className: "ps-bpm-or", children: /* @__PURE__ */ jsx("span", { children: t("or") }) }),
9454
+ /* @__PURE__ */ jsxs(
9455
+ "button",
9456
+ {
9457
+ type: "button",
9458
+ className: "ps-bpm-upload-link",
9459
+ onClick: onUploadPhoto,
9460
+ children: [
9461
+ /* @__PURE__ */ jsx(CameraSmallIcon, {}),
9462
+ /* @__PURE__ */ jsx("span", { children: t("Upload a photo for AI sizing") }),
9463
+ /* @__PURE__ */ jsx(ChevronRight, {})
9464
+ ]
9465
+ }
9466
+ )
9467
+ ] }),
9465
9468
  error && /* @__PURE__ */ jsx("p", { className: "ps-bpm-error", children: error }),
9466
9469
  /* @__PURE__ */ jsx("div", { className: "ps-bpm-spacer" }),
9467
9470
  /* @__PURE__ */ jsxs("div", { className: "ps-bpm-bottom", children: [
@@ -9475,7 +9478,7 @@ function BasicsStepMobile({
9475
9478
  children: fastPathLabel || t("Next")
9476
9479
  }
9477
9480
  ),
9478
- /* @__PURE__ */ jsx(
9481
+ !hidePhotoOptions && /* @__PURE__ */ jsx(
9479
9482
  MobileBottomTabs,
9480
9483
  {
9481
9484
  mode: "manual",
@@ -10184,8 +10187,11 @@ function BodyProfileView({
10184
10187
  setAge,
10185
10188
  switchToMetric,
10186
10189
  switchToImperial,
10187
- onUploadPhoto: () => setStep("photo"),
10188
- onSwitchToScan: () => setStep("photo"),
10190
+ onUploadPhoto: hasActiveProfileWithMeasurements ? () => {
10191
+ } : () => setStep("photo"),
10192
+ onSwitchToScan: hasActiveProfileWithMeasurements ? () => {
10193
+ } : () => setStep("photo"),
10194
+ hidePhotoOptions: hasActiveProfileWithMeasurements,
10189
10195
  onNext: hasActiveProfileWithMeasurements && onUseActiveProfile ? onUseActiveProfile : handleNext,
10190
10196
  canProceed: true,
10191
10197
  fastPathLabel: hasActiveProfileWithMeasurements ? t("Find My Best Fit") : void 0,
@@ -10240,7 +10246,7 @@ function BodyProfileView({
10240
10246
  ] })
10241
10247
  ] })
10242
10248
  ] }),
10243
- /* @__PURE__ */ jsxs("button", { className: "ps-bp-photo-cta", onClick: () => setStep("photo"), type: "button", children: [
10249
+ !hasActiveProfileWithMeasurements && /* @__PURE__ */ jsxs("button", { className: "ps-bp-photo-cta", onClick: () => setStep("photo"), type: "button", children: [
10244
10250
  /* @__PURE__ */ jsx(CameraUploadIcon, {}),
10245
10251
  /* @__PURE__ */ jsx("span", { children: t("Or upload a photo for AI sizing") }),
10246
10252
  /* @__PURE__ */ jsx("span", { className: "ps-bp-photo-cta-arrow", children: "→" })
@@ -10751,7 +10757,9 @@ function PrimeStyleTryonInner({
10751
10757
  const handleUseActiveProfile = useCallback(() => {
10752
10758
  const p = profiles.find((x) => x.id === activeProfileId);
10753
10759
  if (!p) return;
10754
- const hasIdentity = (p.height ?? 0) > 0 && (p.weight ?? 0) > 0;
10760
+ const profileHeight = p.height ?? p.heightCm ?? 0;
10761
+ const profileWeight = p.weight ?? p.weightKg ?? 0;
10762
+ const hasIdentity = profileHeight > 0 && profileWeight > 0;
10755
10763
  if (!hasIdentity) return;
10756
10764
  setSizingResult(null);
10757
10765
  setSizingLoading(true);
@@ -11617,7 +11625,10 @@ function PrimeStyleTryonInner({
11617
11625
  setSizingUnit,
11618
11626
  hasActiveProfileWithMeasurements: (() => {
11619
11627
  const p = profiles.find((x) => x.id === activeProfileId);
11620
- return !!(p && (p.height ?? 0) > 0 && (p.weight ?? 0) > 0);
11628
+ if (!p) return false;
11629
+ const ph = p.height ?? p.heightCm ?? 0;
11630
+ const pw = p.weight ?? p.weightKg ?? 0;
11631
+ return ph > 0 && pw > 0;
11621
11632
  })(),
11622
11633
  onUseActiveProfile: handleUseActiveProfile,
11623
11634
  activeProfileName: (() => {
@@ -30,8 +30,14 @@ interface BasicsStepMobileProps {
30
30
  activeProfileName?: string | null;
31
31
  /** Deselect the active profile so the user can run a fresh AI sizing flow. */
32
32
  onStartFresh?: () => void;
33
+ /** When true, hide the "Upload a photo for AI sizing" link AND swap the
34
+ * bottom Manual/Scan tab bar for nothing. Used when an active profile is
35
+ * selected — there's no point letting the user accidentally trip into the
36
+ * photo upload step when their saved profile already has everything we
37
+ * need to call /sizing/recommend. */
38
+ hidePhotoOptions?: boolean;
33
39
  error: string;
34
40
  t: TranslateFn;
35
41
  }
36
- export declare function BasicsStepMobile({ hUnit, wUnit, isImperialMode, height, setHeight, heightFeet, setHeightFeet, heightInches, setHeightInches, weight, setWeight, age, setAge, switchToMetric, switchToImperial, onUploadPhoto, onSwitchToScan, onNext, canProceed, fastPathLabel, activeProfileName, onStartFresh, error, t, }: BasicsStepMobileProps): import("react/jsx-runtime").JSX.Element;
42
+ export declare function BasicsStepMobile({ hUnit, wUnit, isImperialMode, height, setHeight, heightFeet, setHeightFeet, heightInches, setHeightInches, weight, setWeight, age, setAge, switchToMetric, switchToImperial, onUploadPhoto, onSwitchToScan, onNext, canProceed, fastPathLabel, activeProfileName, onStartFresh, hidePhotoOptions, error, t, }: BasicsStepMobileProps): import("react/jsx-runtime").JSX.Element;
37
43
  export {};
@@ -18712,6 +18712,7 @@ function BasicsStepMobile({
18712
18712
  fastPathLabel,
18713
18713
  activeProfileName,
18714
18714
  onStartFresh,
18715
+ hidePhotoOptions = false,
18715
18716
  error,
18716
18717
  t: t2
18717
18718
  }) {
@@ -18872,20 +18873,22 @@ function BasicsStepMobile({
18872
18873
  ] })
18873
18874
  ] })
18874
18875
  ] }),
18875
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-bpm-or", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("or") }) }),
18876
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
18877
- "button",
18878
- {
18879
- type: "button",
18880
- className: "ps-bpm-upload-link",
18881
- onClick: onUploadPhoto,
18882
- children: [
18883
- /* @__PURE__ */ jsxRuntimeExports.jsx(CameraSmallIcon, {}),
18884
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("Upload a photo for AI sizing") }),
18885
- /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, {})
18886
- ]
18887
- }
18888
- ),
18876
+ !hidePhotoOptions && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
18877
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-bpm-or", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("or") }) }),
18878
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
18879
+ "button",
18880
+ {
18881
+ type: "button",
18882
+ className: "ps-bpm-upload-link",
18883
+ onClick: onUploadPhoto,
18884
+ children: [
18885
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CameraSmallIcon, {}),
18886
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("Upload a photo for AI sizing") }),
18887
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, {})
18888
+ ]
18889
+ }
18890
+ )
18891
+ ] }),
18889
18892
  error && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "ps-bpm-error", children: error }),
18890
18893
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-bpm-spacer" }),
18891
18894
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bpm-bottom", children: [
@@ -18899,7 +18902,7 @@ function BasicsStepMobile({
18899
18902
  children: fastPathLabel || t2("Next")
18900
18903
  }
18901
18904
  ),
18902
- /* @__PURE__ */ jsxRuntimeExports.jsx(
18905
+ !hidePhotoOptions && /* @__PURE__ */ jsxRuntimeExports.jsx(
18903
18906
  MobileBottomTabs,
18904
18907
  {
18905
18908
  mode: "manual",
@@ -19608,8 +19611,11 @@ function BodyProfileView({
19608
19611
  setAge,
19609
19612
  switchToMetric,
19610
19613
  switchToImperial,
19611
- onUploadPhoto: () => setStep("photo"),
19612
- onSwitchToScan: () => setStep("photo"),
19614
+ onUploadPhoto: hasActiveProfileWithMeasurements ? () => {
19615
+ } : () => setStep("photo"),
19616
+ onSwitchToScan: hasActiveProfileWithMeasurements ? () => {
19617
+ } : () => setStep("photo"),
19618
+ hidePhotoOptions: hasActiveProfileWithMeasurements,
19613
19619
  onNext: hasActiveProfileWithMeasurements && onUseActiveProfile ? onUseActiveProfile : handleNext,
19614
19620
  canProceed: true,
19615
19621
  fastPathLabel: hasActiveProfileWithMeasurements ? t2("Find My Best Fit") : void 0,
@@ -19664,7 +19670,7 @@ function BodyProfileView({
19664
19670
  ] })
19665
19671
  ] })
19666
19672
  ] }),
19667
- /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { className: "ps-bp-photo-cta", onClick: () => setStep("photo"), type: "button", children: [
19673
+ !hasActiveProfileWithMeasurements && /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { className: "ps-bp-photo-cta", onClick: () => setStep("photo"), type: "button", children: [
19668
19674
  /* @__PURE__ */ jsxRuntimeExports.jsx(CameraUploadIcon, {}),
19669
19675
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("Or upload a photo for AI sizing") }),
19670
19676
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-photo-cta-arrow", children: "→" })
@@ -20175,7 +20181,9 @@ function PrimeStyleTryonInner({
20175
20181
  const handleUseActiveProfile = reactExports.useCallback(() => {
20176
20182
  const p2 = profiles.find((x2) => x2.id === activeProfileId);
20177
20183
  if (!p2) return;
20178
- const hasIdentity = (p2.height ?? 0) > 0 && (p2.weight ?? 0) > 0;
20184
+ const profileHeight = p2.height ?? p2.heightCm ?? 0;
20185
+ const profileWeight = p2.weight ?? p2.weightKg ?? 0;
20186
+ const hasIdentity = profileHeight > 0 && profileWeight > 0;
20179
20187
  if (!hasIdentity) return;
20180
20188
  setSizingResult(null);
20181
20189
  setSizingLoading(true);
@@ -21041,7 +21049,10 @@ function PrimeStyleTryonInner({
21041
21049
  setSizingUnit,
21042
21050
  hasActiveProfileWithMeasurements: (() => {
21043
21051
  const p2 = profiles.find((x2) => x2.id === activeProfileId);
21044
- return !!(p2 && (p2.height ?? 0) > 0 && (p2.weight ?? 0) > 0);
21052
+ if (!p2) return false;
21053
+ const ph2 = p2.height ?? p2.heightCm ?? 0;
21054
+ const pw = p2.weight ?? p2.weightKg ?? 0;
21055
+ return ph2 > 0 && pw > 0;
21045
21056
  })(),
21046
21057
  onUseActiveProfile: handleUseActiveProfile,
21047
21058
  activeProfileName: (() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primestyleai/tryon",
3
- "version": "5.8.18",
3
+ "version": "5.8.20",
4
4
  "description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
5
5
  "type": "module",
6
6
  "main": "dist/primestyle-tryon.js",