@primestyleai/tryon 5.10.4 → 5.10.6

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.
@@ -11538,7 +11538,10 @@ const STYLES$1 = `
11538
11538
  MobileScanningView — row of ring + bar + percent, same tokens. */
11539
11539
  .ps-tryon-progress-wrap {
11540
11540
  display: flex; align-items: center; gap: 12px;
11541
- width: 100%; max-width: 360px; margin-top: 18px;
11541
+ /* Fixed logical width so neither the ring nor the bar reflow when the
11542
+ sibling stage text changes character count each tick. */
11543
+ width: min(320px, calc(100% - 24px));
11544
+ margin-top: 18px;
11542
11545
  }
11543
11546
  .ps-tryon-progress-wrap .ps-tryon-progress-bar-wrap {
11544
11547
  flex: 1; height: 6px; border-radius: 4px; overflow: hidden;
@@ -17140,13 +17143,11 @@ function MobileScanningView({
17140
17143
  ),
17141
17144
  isPhotoMode && bodyLandmarks && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-msc-pose-wrap", children: /* @__PURE__ */ jsxRuntimeExports.jsx(MobileSkeleton, { landmarks: bodyLandmarks, w: dims.w, h: dims.h }) })
17142
17145
  ] }),
17143
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-msc-stage", children: [
17144
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-msc-stage-slot", children: [
17145
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-msc-stage-title", children: current.title }),
17146
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-msc-stage-desc", children: current.desc })
17147
- ] }, stageIdx),
17148
- tryOnProcessing && /* @__PURE__ */ jsxRuntimeExports.jsx(MscTryOnProgress, { t: t2 })
17149
- ] }),
17146
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-msc-stage", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-msc-stage-slot", children: [
17147
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-msc-stage-title", children: current.title }),
17148
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-msc-stage-desc", children: current.desc })
17149
+ ] }, stageIdx) }),
17150
+ tryOnProcessing && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { display: "flex", justifyContent: "center", padding: "0 16px", width: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MscTryOnProgress, { t: t2 }) }),
17150
17151
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-bpm-spacer" }),
17151
17152
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-bpm-bottom", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
17152
17153
  MobileBottomTabs,
@@ -18250,6 +18251,78 @@ function SectionDetailView({
18250
18251
  backendLength ? ` (${backendLength})` : "",
18251
18252
  " ",
18252
18253
  t2("based on your measurements and the garment's tailoring chart.")
18254
+ ] }),
18255
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", gap: 10, padding: "12px 0 4px", flexShrink: 0 }, children: [
18256
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
18257
+ "button",
18258
+ {
18259
+ type: "button",
18260
+ className: "ps-bp-back-btn",
18261
+ onClick: onBack,
18262
+ style: { fontSize: 13, padding: "10px 6px" },
18263
+ children: [
18264
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-back-arrow", children: "←" }),
18265
+ " ",
18266
+ backLabel || t2("Back")
18267
+ ]
18268
+ }
18269
+ ),
18270
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { flex: 1 } }),
18271
+ onTryOn ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
18272
+ "button",
18273
+ {
18274
+ type: "button",
18275
+ onClick: onTryOn,
18276
+ disabled: tryOnProcessing,
18277
+ style: {
18278
+ flex: 1,
18279
+ padding: "12px 16px",
18280
+ borderRadius: 10,
18281
+ background: "var(--ps-accent)",
18282
+ color: "white",
18283
+ border: "none",
18284
+ fontSize: 14,
18285
+ fontWeight: 700,
18286
+ fontFamily: "inherit",
18287
+ cursor: tryOnProcessing ? "default" : "pointer",
18288
+ opacity: tryOnProcessing ? 0.6 : 1,
18289
+ display: "flex",
18290
+ alignItems: "center",
18291
+ justifyContent: "center",
18292
+ gap: 6
18293
+ },
18294
+ children: [
18295
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CameraIcon$1, { size: 14 }),
18296
+ tryOnProcessing ? t2("Processing...") : t2("Try It On")
18297
+ ]
18298
+ }
18299
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
18300
+ "button",
18301
+ {
18302
+ type: "button",
18303
+ onClick: onBack,
18304
+ style: {
18305
+ flex: 1,
18306
+ padding: "12px 16px",
18307
+ borderRadius: 10,
18308
+ background: "var(--ps-accent)",
18309
+ color: "white",
18310
+ border: "none",
18311
+ fontSize: 14,
18312
+ fontWeight: 700,
18313
+ fontFamily: "inherit",
18314
+ cursor: "pointer",
18315
+ display: "flex",
18316
+ alignItems: "center",
18317
+ justifyContent: "center",
18318
+ gap: 6
18319
+ },
18320
+ children: [
18321
+ continueLabel || t2("Continue"),
18322
+ " →"
18323
+ ]
18324
+ }
18325
+ )
18253
18326
  ] })
18254
18327
  ] }) });
18255
18328
  }
@@ -22534,7 +22607,7 @@ function AccessorySizeView({
22534
22607
  },
22535
22608
  opt.value
22536
22609
  )) }),
22537
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { flex: 1, overflowY: "auto" }, children: [
22610
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { padding: "0 4%" }, children: [
22538
22611
  fields.map((f2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bpm-row", children: [
22539
22612
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bpm-label", children: t2(f2.label).toUpperCase() }),
22540
22613
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bpm-inline-group", children: [
@@ -22554,8 +22627,9 @@ function AccessorySizeView({
22554
22627
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bpm-unit", children: activeUnitLabel.toLowerCase() })
22555
22628
  ] })
22556
22629
  ] }, f2.key)),
22557
- error && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "ps-acc-error", style: { padding: "0 4%" }, children: error })
22630
+ error && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "ps-acc-error", style: { paddingTop: 8 }, children: error })
22558
22631
  ] }),
22632
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { flex: 1, minHeight: 16 } }),
22559
22633
  !disablePhotoUpload && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
22560
22634
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-bpm-or", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("or") }) }),
22561
22635
  /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { type: "button", className: "ps-bpm-upload-link", onClick: () => setStep("photo"), children: [
@@ -22564,7 +22638,6 @@ function AccessorySizeView({
22564
22638
  /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "14", height: "14", children: /* @__PURE__ */ jsxRuntimeExports.jsx("polyline", { points: "9 18 15 12 9 6" }) })
22565
22639
  ] })
22566
22640
  ] }),
22567
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-bpm-spacer" }),
22568
22641
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bpm-bottom", children: [
22569
22642
  /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { type: "button", className: "ps-bpm-next-btn", onClick: handleManualSubmit, children: [
22570
22643
  t2("Find My Size"),
@@ -23138,7 +23211,9 @@ function PrimeStyleTryonInner({
23138
23211
  const [heightUnit, setHeightUnit] = reactExports.useState(imperial ? "in" : "cm");
23139
23212
  const [weightUnit, setWeightUnit] = reactExports.useState(imperial ? "lbs" : "kg");
23140
23213
  reactExports.useEffect(() => {
23141
- if (detectMeasurementType(productTitle) === "foot") setSizingUnit("cm");
23214
+ const mtype = detectMeasurementType(productTitle);
23215
+ if (mtype === "foot" || mtype === "head") setSizingUnit("cm");
23216
+ else if (mtype === "face") setSizingUnit("mm");
23142
23217
  }, [productTitle]);
23143
23218
  const formRef = reactExports.useRef({});
23144
23219
  const [formGender, setFormGender] = reactExports.useState("male");
@@ -23960,7 +24035,12 @@ function PrimeStyleTryonInner({
23960
24035
  setBodyLandmarks(lm);
23961
24036
  return lm;
23962
24037
  }).catch(() => null);
23963
- const landmarks = await landmarksPromise;
24038
+ const LANDMARK_TIMEOUT_MS = 2500;
24039
+ const landmarks = await Promise.race([
24040
+ landmarksPromise,
24041
+ new Promise((resolve) => setTimeout(() => resolve(null), LANDMARK_TIMEOUT_MS))
24042
+ ]);
24043
+ if (!landmarks) console.log("[ps-sdk] landmarks not ready in", LANDMARK_TIMEOUT_MS, "ms — proceeding without them");
23964
24044
  const payload = {
23965
24045
  method: "photo",
23966
24046
  locale: sizingCountry,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primestyleai/tryon",
3
- "version": "5.10.4",
3
+ "version": "5.10.6",
4
4
  "description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
5
5
  "type": "module",
6
6
  "main": "dist/primestyle-tryon.js",