@primestyleai/tryon 5.10.186 → 5.10.187

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.
@@ -109,6 +109,8 @@ export interface ProfileCompletionDraft {
109
109
  bandSize?: string;
110
110
  cupSize?: string;
111
111
  braSizeRegion?: string;
112
+ photoBase64?: string;
113
+ photoUrl?: string;
112
114
  customMeasurements?: Record<string, number>;
113
115
  }
114
116
  export interface HistoryEntry {
@@ -26352,6 +26352,7 @@ function CreateProfileWizard({ onSave, onCancel, initialMode, initialDraft, apiU
26352
26352
  const seededUnit = draftUnit(initialDraft);
26353
26353
  const seededHeight = draftHeightParts(initialDraft, seededUnit);
26354
26354
  const seededGender = initialDraft?.gender === "female" ? "female" : "male";
26355
+ const seededPhotoRef = reactExports.useRef(initialDraft?.photoBase64 || initialDraft?.photoUrl || null);
26355
26356
  const [mode, setMode] = reactExports.useState(initialMode ?? null);
26356
26357
  const [manualStep, setManualStep] = reactExports.useState("identity");
26357
26358
  const [imageStep, setImageStep] = reactExports.useState("name-photo");
@@ -26370,10 +26371,13 @@ function CreateProfileWizard({ onSave, onCancel, initialMode, initialDraft, apiU
26370
26371
  const [weightVal, setWeightVal] = reactExports.useState(draftDisplayNumber(initialDraft?.weight));
26371
26372
  const [ageVal, setAgeVal] = reactExports.useState(draftDisplayNumber(initialDraft?.age));
26372
26373
  const [error, setError] = reactExports.useState("");
26373
- const [photoBase64, setPhotoBase64] = reactExports.useState(null);
26374
+ const [photoBase64, setPhotoBase64] = reactExports.useState(() => seededPhotoRef.current);
26374
26375
  const [photoUploading, setPhotoUploading] = reactExports.useState(false);
26375
26376
  const [photoStatus, setPhotoStatus] = reactExports.useState("");
26376
26377
  const [photoRejection, setPhotoRejection] = reactExports.useState(null);
26378
+ reactExports.useEffect(() => {
26379
+ if (seededPhotoRef.current) onPhotoPreview?.(seededPhotoRef.current);
26380
+ }, []);
26377
26381
  const [scanLandmarks, setScanLandmarks] = reactExports.useState(null);
26378
26382
  const [scanImgDims, setScanImgDims] = reactExports.useState({ w: 800, h: 1200 });
26379
26383
  const [scanStageIdx, setScanStageIdx] = reactExports.useState(0);
@@ -28213,6 +28217,8 @@ function MySizingProfilesView({
28213
28217
  const goBack = () => {
28214
28218
  if (creating) {
28215
28219
  setCreating(false);
28220
+ onProfileDraftConsumed?.();
28221
+ onPhotoPreview?.(null);
28216
28222
  return;
28217
28223
  }
28218
28224
  if (viewingId !== null) {
@@ -28221,7 +28227,7 @@ function MySizingProfilesView({
28221
28227
  }
28222
28228
  };
28223
28229
  onRegisterBackInterceptor(canGoBack, goBack);
28224
- }, [creating, viewingId, onRegisterBackInterceptor]);
28230
+ }, [creating, viewingId, onRegisterBackInterceptor, onProfileDraftConsumed, onPhotoPreview]);
28225
28231
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-msp-root", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-msp-scroll", children: viewingProfile ? /* @__PURE__ */ jsxRuntimeExports.jsx(
28226
28232
  ProfileMeasurementsView,
28227
28233
  {
@@ -32716,6 +32722,8 @@ function PrimeStyleTryonInner({
32716
32722
  const f2 = formRef.current || {};
32717
32723
  const active = profiles.find((p2) => p2.id === activeProfileId) || null;
32718
32724
  const gender = f2.gender === "female" || active?.gender === "female" ? "female" : "male";
32725
+ const profilePhoto = f2.photoBase64 || f2.bodyImage || active?.photoBase64 || active?.photoUrl;
32726
+ const normalizedProfilePhoto = profilePhoto ? normalizeProfilePhotoSource(profilePhoto) : null;
32719
32727
  const customMeasurements = {};
32720
32728
  const wristCircumference = positiveNumber(f2.wristCircumference);
32721
32729
  if (wristCircumference != null) customMeasurements.wristCircumference = wristCircumference;
@@ -32737,6 +32745,7 @@ function PrimeStyleTryonInner({
32737
32745
  bandSize: f2.bandSize || active?.bandSize,
32738
32746
  cupSize: f2.cupSize || active?.cupSize,
32739
32747
  braSizeRegion: f2.braSizeRegion || active?.braSizeRegion || "US",
32748
+ ...normalizedProfilePhoto ? { photoBase64: normalizedProfilePhoto } : {},
32740
32749
  ...Object.keys(customMeasurements).length > 0 ? { customMeasurements } : {}
32741
32750
  };
32742
32751
  lsSet(PROFILE_COMPLETION_DRAFT_KEY, draft);
@@ -33810,6 +33819,8 @@ function PrimeStyleTryonInner({
33810
33819
  formRef.current.weightUnit = data.weightUnit;
33811
33820
  formRef.current.gender = data.gender;
33812
33821
  if (data.age != null) formRef.current.age = String(data.age);
33822
+ formRef.current.bodyImage = data.photoBase64;
33823
+ formRef.current.photoBase64 = data.photoBase64;
33813
33824
  const braFields = snapBraFields(data);
33814
33825
  if (braFields.bandSize) formRef.current.bandSize = braFields.bandSize;
33815
33826
  if (braFields.cupSize) formRef.current.cupSize = braFields.cupSize;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primestyleai/tryon",
3
- "version": "5.10.186",
3
+ "version": "5.10.187",
4
4
  "description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
5
5
  "type": "module",
6
6
  "main": "dist/primestyle-tryon.js",