@primestyleai/tryon 5.10.132 → 5.10.134

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.
@@ -25472,6 +25472,7 @@ function BodyProfileView({
25472
25472
  setPhotoStatus("");
25473
25473
  }
25474
25474
  }, [t2, ageConfirmed]);
25475
+ const seededProfileIdRef = reactExports.useRef(null);
25475
25476
  const handleRemovePhoto = reactExports.useCallback(() => {
25476
25477
  if (photoPreview && !photoFromProfile) URL.revokeObjectURL(photoPreview);
25477
25478
  setPhotoFile(null);
@@ -25480,14 +25481,33 @@ function BodyProfileView({
25480
25481
  setPhotoFromProfile(false);
25481
25482
  if (fileInputRef.current) fileInputRef.current.value = "";
25482
25483
  }, [photoPreview, photoFromProfile]);
25484
+ const handleClearFromProfile = reactExports.useCallback(() => {
25485
+ handleRemovePhoto();
25486
+ setHeight("");
25487
+ setHeightFeet("");
25488
+ setHeightInches("");
25489
+ setWeight("");
25490
+ setAge("");
25491
+ setBandSize(null);
25492
+ setCupSize(null);
25493
+ }, [handleRemovePhoto]);
25483
25494
  reactExports.useEffect(() => {
25484
25495
  const profilePhoto = activeProfile?.photoBase64;
25485
- if (!profilePhoto || photoBase64 || photoPreview) return;
25496
+ const profileId = activeProfile?.id ?? null;
25497
+ if (!profilePhoto || !profileId) return;
25498
+ if (seededProfileIdRef.current === profileId) return;
25499
+ seededProfileIdRef.current = profileId;
25486
25500
  setPhotoBase64(profilePhoto);
25487
25501
  setPhotoPreview(profilePhoto);
25488
25502
  setPhotoFromProfile(true);
25489
25503
  setAgeConfirmed(true);
25490
- }, [activeProfile, photoBase64, photoPreview]);
25504
+ }, [activeProfile]);
25505
+ reactExports.useEffect(() => {
25506
+ const profileAgeNow = activeProfile?.age;
25507
+ if (profileAgeNow != null && profileAgeNow > 0 && !age) {
25508
+ setAge(String(Math.round(profileAgeNow)));
25509
+ }
25510
+ }, [activeProfile, age]);
25491
25511
  const validateBasics = reactExports.useCallback(() => {
25492
25512
  if (hUnit === "in") {
25493
25513
  const ft = parseFloat(heightFeet);
@@ -26288,11 +26308,11 @@ function BodyProfileView({
26288
26308
  /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: `ps-bp-system-btn${isImperialMode ? " ps-bp-system-active" : ""}`, onClick: photoSwitchToImperial, type: "button", children: t2("Imperial") })
26289
26309
  ] }),
26290
26310
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { marginTop: "auto", marginBottom: "auto" }, children: [
26291
- photoFromProfile && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-loaded-pill", role: "status", children: [
26311
+ photoFromProfile && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { display: "flex", justifyContent: "center", marginBottom: "0.7vw" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-loaded-pill", role: "status", children: [
26292
26312
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-loaded-pill-dot", "aria-hidden": "true", children: "✓" }),
26293
26313
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-loaded-pill-text", children: t2("Loaded from profile") }),
26294
- /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", className: "ps-bp-loaded-pill-clear", onClick: handleRemovePhoto, children: t2("Clear") })
26295
- ] }),
26314
+ /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", className: "ps-bp-loaded-pill-clear", onClick: handleClearFromProfile, children: t2("Clear") })
26315
+ ] }) }),
26296
26316
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-inline-fields", children: [
26297
26317
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-inline-row", children: [
26298
26318
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-inline-label", children: t2("HEIGHT") }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primestyleai/tryon",
3
- "version": "5.10.132",
3
+ "version": "5.10.134",
4
4
  "description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
5
5
  "type": "module",
6
6
  "main": "dist/primestyle-tryon.js",