@thefittingroom/shop-ui 1.4.1 → 1.4.3
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.
- package/dist/esm/index.js +12 -10
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js +3 -3
- package/dist/esm/types/index.d.ts +1 -1
- package/package.json +2 -2
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* thefittingroom v1.4.
|
|
2
|
+
* thefittingroom v1.4.3 (2024-07-24T23:20:32.238Z)
|
|
3
3
|
* Copyright 2022-present, TheFittingRoom, Inc. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
function loadImageRecursive(imageURL, imageURLs) {
|
|
@@ -47,7 +47,7 @@ const InitImageSlider = (sliderID, onChange) => {
|
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
/*!
|
|
50
|
-
* thefittingroom v1.
|
|
50
|
+
* thefittingroom v1.4.1 (2024-07-24T23:18:17.347Z)
|
|
51
51
|
* Copyright 2022-present, TheFittingRoom, Inc. All rights reserved.
|
|
52
52
|
*/
|
|
53
53
|
|
|
@@ -25457,8 +25457,8 @@ class TfrShop {
|
|
|
25457
25457
|
if (!taxonomy)
|
|
25458
25458
|
throw new Error('Taxonomy not found for style garment category id');
|
|
25459
25459
|
const filteredLocations = !filledLocations.length
|
|
25460
|
-
? taxonomy.
|
|
25461
|
-
: taxonomy.
|
|
25460
|
+
? taxonomy.measurement_locations.female
|
|
25461
|
+
: taxonomy.measurement_locations.female.filter((location) => filledLocations.includes(location));
|
|
25462
25462
|
return filteredLocations.map((location) => {
|
|
25463
25463
|
return this.measurementLocations.has(location) ? this.measurementLocations.get(location) : location;
|
|
25464
25464
|
});
|
|
@@ -25474,8 +25474,8 @@ class TfrShop {
|
|
|
25474
25474
|
if (!taxonomy)
|
|
25475
25475
|
throw new Error('Taxonomy not found for style garment category id');
|
|
25476
25476
|
const filteredLocations = !filledLocations.length
|
|
25477
|
-
? taxonomy.
|
|
25478
|
-
: taxonomy.
|
|
25477
|
+
? taxonomy.measurement_locations.female
|
|
25478
|
+
: taxonomy.measurement_locations.female.filter((location) => filledLocations.includes(location));
|
|
25479
25479
|
return filteredLocations.map((location) => {
|
|
25480
25480
|
return this.measurementLocations.has(location) ? this.measurementLocations.get(location) : location;
|
|
25481
25481
|
});
|
|
@@ -25520,6 +25520,9 @@ class TfrShop {
|
|
|
25520
25520
|
return getFirebaseError(error);
|
|
25521
25521
|
}
|
|
25522
25522
|
}
|
|
25523
|
+
getMeasurementLocationName(location) {
|
|
25524
|
+
return this.measurementLocations.has(location) ? this.measurementLocations.get(location) : location;
|
|
25525
|
+
}
|
|
25523
25526
|
async getGetTaxonomy(styleId) {
|
|
25524
25527
|
try {
|
|
25525
25528
|
const doc = await this.firebase.getDoc('style_garment_categories', String(styleId));
|
|
@@ -25537,7 +25540,7 @@ class TfrShop {
|
|
|
25537
25540
|
}
|
|
25538
25541
|
async fetchMeasurementLocations() {
|
|
25539
25542
|
try {
|
|
25540
|
-
const docs = await this.firebase.getDocs('
|
|
25543
|
+
const docs = await this.firebase.getDocs('measurement_locations', []);
|
|
25541
25544
|
return docs.docs.map((doc) => doc.data());
|
|
25542
25545
|
}
|
|
25543
25546
|
catch (error) {
|
|
@@ -26909,7 +26912,7 @@ class TfrSizeRec {
|
|
|
26909
26912
|
return {
|
|
26910
26913
|
fit: index.FitNames[locationFit.fit],
|
|
26911
26914
|
isPerfect: this.perfectFits.includes(locationFit.fit),
|
|
26912
|
-
location:
|
|
26915
|
+
location: this.tfrShop.getMeasurementLocationName(locationFit.measurement_location),
|
|
26913
26916
|
};
|
|
26914
26917
|
}),
|
|
26915
26918
|
};
|
|
@@ -27144,8 +27147,7 @@ class FittingRoom {
|
|
|
27144
27147
|
async setGarmentLocations() {
|
|
27145
27148
|
var _a, _b;
|
|
27146
27149
|
const style = await this.getStyle(this.sku);
|
|
27147
|
-
const filledLocations = ((_b = (_a = style === null || style === void 0 ? void 0 : style.sizes) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.garment_measurements.map((measurement) => measurement.
|
|
27148
|
-
[];
|
|
27150
|
+
const filledLocations = ((_b = (_a = style === null || style === void 0 ? void 0 : style.sizes) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.garment_measurements.map((measurement) => measurement.measurement_location)) || [];
|
|
27149
27151
|
this.tfrSizeRec.setGarmentLocations(filledLocations);
|
|
27150
27152
|
}
|
|
27151
27153
|
async getStyle(brandStyleIdOrSku) {
|