@thefittingroom/shop-ui 1.2.0 → 1.2.2
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 +17 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js +3 -3
- package/dist/esm/tfr.d.ts +1 -0
- package/package.json +2 -2
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* thefittingroom v1.
|
|
2
|
+
* thefittingroom v1.2.2 (2024-06-20T18:02:26.202Z)
|
|
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.1.
|
|
50
|
+
* thefittingroom v1.1.8 (2024-06-20T17:59:34.232Z)
|
|
51
51
|
* Copyright 2022-present, TheFittingRoom, Inc. All rights reserved.
|
|
52
52
|
*/
|
|
53
53
|
|
|
@@ -22999,7 +22999,7 @@ class TfrShop {
|
|
|
22999
22999
|
const asset = await this.getColorwaySizeAssetFromSku(sku);
|
|
23000
23000
|
if (!asset)
|
|
23001
23001
|
throw new Error('No colorway size asset found for sku');
|
|
23002
|
-
const styleCategory = await this.
|
|
23002
|
+
const styleCategory = await this.getStyle(asset.style_id);
|
|
23003
23003
|
if (!styleCategory)
|
|
23004
23004
|
throw new Error('Style category not found for style id');
|
|
23005
23005
|
const taxonomy = await this.getGetTaxonomy(styleCategory.style_garment_category_id);
|
|
@@ -23028,7 +23028,7 @@ class TfrShop {
|
|
|
23028
23028
|
return getFirebaseError(error);
|
|
23029
23029
|
}
|
|
23030
23030
|
}
|
|
23031
|
-
async
|
|
23031
|
+
async getStyle(styleId) {
|
|
23032
23032
|
try {
|
|
23033
23033
|
const doc = await this.firebase.getDoc('styles', String(styleId));
|
|
23034
23034
|
return doc;
|
|
@@ -36703,9 +36703,15 @@ class TfrSizeRec {
|
|
|
36703
36703
|
return sizes;
|
|
36704
36704
|
}
|
|
36705
36705
|
catch (error) {
|
|
36706
|
-
|
|
36707
|
-
|
|
36708
|
-
|
|
36706
|
+
try {
|
|
36707
|
+
const sizes = await this.getRecommendedSizes(String(this.sku));
|
|
36708
|
+
return sizes;
|
|
36709
|
+
}
|
|
36710
|
+
catch (error) {
|
|
36711
|
+
console.error(error);
|
|
36712
|
+
this.sizeRecComponent.setError();
|
|
36713
|
+
return null;
|
|
36714
|
+
}
|
|
36709
36715
|
}
|
|
36710
36716
|
}
|
|
36711
36717
|
async getRecommendedSizes(styleId) {
|
|
@@ -36759,6 +36765,10 @@ class FittingRoom {
|
|
|
36759
36765
|
get sku() {
|
|
36760
36766
|
return this.tfrSizeRec.sku;
|
|
36761
36767
|
}
|
|
36768
|
+
async checkIfPublished(styleId) {
|
|
36769
|
+
const style = await this.tfrShop.getStyle(styleId);
|
|
36770
|
+
return style.is_published;
|
|
36771
|
+
}
|
|
36762
36772
|
setSku(sku) {
|
|
36763
36773
|
this.tfrSizeRec.setSku(sku);
|
|
36764
36774
|
if (this.isLoggedIn)
|