@primestyleai/tryon 5.10.185 → 5.10.186

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.
@@ -45,6 +45,9 @@ interface BodyProfileViewProps {
45
45
  weightUnit: string;
46
46
  gender: string;
47
47
  age?: number;
48
+ bandSize?: string;
49
+ cupSize?: string;
50
+ braSizeRegion?: string;
48
51
  braSize?: {
49
52
  band: number;
50
53
  cup: string;
@@ -29617,6 +29617,9 @@ function BodyProfileView({
29617
29617
  }
29618
29618
  } : {},
29619
29619
  ...showGenderSpecificDetails && bandSize && cupSize ? {
29620
+ bandSize,
29621
+ cupSize,
29622
+ braSizeRegion,
29620
29623
  braSize: {
29621
29624
  band: parseFloat(bandSize),
29622
29625
  cup: cupSize,
@@ -32322,6 +32325,17 @@ function positiveNumber(value) {
32322
32325
  const n2 = typeof value === "number" ? value : parseFloat(String(value ?? ""));
32323
32326
  return Number.isFinite(n2) && n2 > 0 ? n2 : void 0;
32324
32327
  }
32328
+ function snapBraFields(data) {
32329
+ if (data.gender !== "female") return {};
32330
+ const band = data.bandSize ?? data.braSize?.band;
32331
+ const cup = data.cupSize ?? data.braSize?.cup;
32332
+ const region = data.braSizeRegion ?? data.braRegion ?? data.braSize?.region;
32333
+ return {
32334
+ ...band != null && String(band).trim() ? { bandSize: String(band) } : {},
32335
+ ...cup && String(cup).trim() ? { cupSize: String(cup) } : {},
32336
+ ...region && String(region).trim() ? { braSizeRegion: String(region) } : {}
32337
+ };
32338
+ }
32325
32339
  function validChestProfile(value) {
32326
32340
  return value === "narrow" || value === "average" || value === "broad" ? value : void 0;
32327
32341
  }
@@ -33140,6 +33154,14 @@ function PrimeStyleTryonInner({
33140
33154
  setEstimationDone(true);
33141
33155
  return;
33142
33156
  }
33157
+ if (targetId && formData.gender === "female" && (formData.bandSize || formData.cupSize || formData.braSizeRegion)) {
33158
+ updateProfile(targetId, {
33159
+ ...formData.bandSize ? { bandSize: formData.bandSize } : {},
33160
+ ...formData.cupSize ? { cupSize: formData.cupSize } : {},
33161
+ ...formData.braSizeRegion ? { braSizeRegion: formData.braSizeRegion } : {}
33162
+ });
33163
+ setProfiles(lsGet("profiles", []));
33164
+ }
33143
33165
  if (options?.skipBodyEstimate) {
33144
33166
  console.log("[ps-sdk:persist] skipping body estimates — face/head flow (no body context)");
33145
33167
  } else if (targetId && recommendation?.estimates) {
@@ -33187,7 +33209,14 @@ function PrimeStyleTryonInner({
33187
33209
  heightUnit: p2.heightUnit || "cm",
33188
33210
  weightUnit: p2.weightUnit || "kg",
33189
33211
  gender: p2.gender,
33190
- age: p2.age
33212
+ age: p2.age,
33213
+ ...snapBraFields({
33214
+ gender: p2.gender,
33215
+ bandSize: p2.bandSize,
33216
+ cupSize: p2.cupSize,
33217
+ braSizeRegion: p2.braSizeRegion,
33218
+ braRegion: p2.braRegion
33219
+ })
33191
33220
  });
33192
33221
  } catch {
33193
33222
  }
@@ -33643,7 +33672,13 @@ function PrimeStyleTryonInner({
33643
33672
  age: src.age != null ? Number(src.age) : void 0,
33644
33673
  chestProfile: src.chestProfile,
33645
33674
  midsectionProfile: src.midsectionProfile,
33646
- hipProfile: src.hipProfile
33675
+ hipProfile: src.hipProfile,
33676
+ ...snapBraFields({
33677
+ gender: src.gender,
33678
+ bandSize: formRef.current.bandSize,
33679
+ cupSize: formRef.current.cupSize,
33680
+ braSizeRegion: formRef.current.braSizeRegion
33681
+ })
33647
33682
  },
33648
33683
  data
33649
33684
  );
@@ -33775,6 +33810,10 @@ function PrimeStyleTryonInner({
33775
33810
  formRef.current.weightUnit = data.weightUnit;
33776
33811
  formRef.current.gender = data.gender;
33777
33812
  if (data.age != null) formRef.current.age = String(data.age);
33813
+ const braFields = snapBraFields(data);
33814
+ if (braFields.bandSize) formRef.current.bandSize = braFields.bandSize;
33815
+ if (braFields.cupSize) formRef.current.cupSize = braFields.cupSize;
33816
+ if (braFields.braSizeRegion) formRef.current.braSizeRegion = braFields.braSizeRegion;
33778
33817
  if (data.extraMeasurements) {
33779
33818
  for (const [key2, value] of Object.entries(data.extraMeasurements)) {
33780
33819
  formRef.current[key2] = String(value);
@@ -33851,7 +33890,8 @@ function PrimeStyleTryonInner({
33851
33890
  heightUnit: data.heightUnit,
33852
33891
  weightUnit: data.weightUnit,
33853
33892
  age: data.age,
33854
- bodyImage: data.photoBase64
33893
+ bodyImage: data.photoBase64,
33894
+ ...braFields
33855
33895
  },
33856
33896
  recData,
33857
33897
  { skipBodyEstimate: true }
@@ -33985,7 +34025,8 @@ function PrimeStyleTryonInner({
33985
34025
  heightUnit: data.heightUnit,
33986
34026
  weightUnit: data.weightUnit,
33987
34027
  age: data.age,
33988
- bodyImage: data.photoBase64
34028
+ bodyImage: data.photoBase64,
34029
+ ...braFields
33989
34030
  },
33990
34031
  recData
33991
34032
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primestyleai/tryon",
3
- "version": "5.10.185",
3
+ "version": "5.10.186",
4
4
  "description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
5
5
  "type": "module",
6
6
  "main": "dist/primestyle-tryon.js",