@azzas/azzas-tracker-web 2.0.2-preview.0 → 2.0.2-preview.1
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/mod.cjs +11 -10
- package/dist/mod.cjs.map +1 -1
- package/dist/mod.global.js +11 -10
- package/dist/mod.global.js.map +1 -1
- package/dist/mod.js +11 -10
- package/dist/mod.js.map +1 -1
- package/dist/mod.vtex.global.js +18 -11
- package/package.json +1 -1
package/dist/mod.vtex.global.js
CHANGED
|
@@ -2732,19 +2732,26 @@ var AzzasTracker = function() {
|
|
|
2732
2732
|
return null;
|
|
2733
2733
|
},
|
|
2734
2734
|
available_grid: function(context) {
|
|
2735
|
+
var _context_products;
|
|
2735
2736
|
if (context === null || context === void 0 ? void 0 : context.available_grid) return context.available_grid;
|
|
2736
|
-
if (context === null || context === void 0 ? void 0 : context.products)
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2737
|
+
if (!(context === null || context === void 0 ? void 0 : (_context_products = context.products) === null || _context_products === void 0 ? void 0 : _context_products.length)) return null;
|
|
2738
|
+
var sizes = context.products.flatMap(function(p) {
|
|
2739
|
+
var _ref, _ref1;
|
|
2740
|
+
var _p_similarItems, _skuVariants_allVariantProducts;
|
|
2741
|
+
var _ref2 = (_ref = p === null || p === void 0 ? void 0 : p.isVariantOf) !== null && _ref !== void 0 ? _ref : {}, productGroupID = _ref2.productGroupID, skuVariants = _ref2.skuVariants;
|
|
2742
|
+
var currentColor = p === null || p === void 0 ? void 0 : (_p_similarItems = p.similarItems) === null || _p_similarItems === void 0 ? void 0 : _p_similarItems.find(function(i) {
|
|
2743
|
+
return (i === null || i === void 0 ? void 0 : i.productId) === productGroupID;
|
|
2743
2744
|
});
|
|
2744
|
-
var
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2745
|
+
var variantIDs = skuVariants === null || skuVariants === void 0 ? void 0 : (_skuVariants_allVariantProducts = skuVariants.allVariantProducts) === null || _skuVariants_allVariantProducts === void 0 ? void 0 : _skuVariants_allVariantProducts.map(function(v) {
|
|
2746
|
+
return v === null || v === void 0 ? void 0 : v.productID;
|
|
2747
|
+
});
|
|
2748
|
+
return ((_ref1 = currentColor === null || currentColor === void 0 ? void 0 : currentColor.sizes) !== null && _ref1 !== void 0 ? _ref1 : []).flatMap(function(entry) {
|
|
2749
|
+
return (entry === null || entry === void 0 ? void 0 : entry.isAvailable) && (entry === null || entry === void 0 ? void 0 : entry.size) && (!(variantIDs === null || variantIDs === void 0 ? void 0 : variantIDs.length) || variantIDs.includes(entry.skuId)) ? [
|
|
2750
|
+
entry.size
|
|
2751
|
+
] : [];
|
|
2752
|
+
});
|
|
2753
|
+
});
|
|
2754
|
+
return sortSizes(sizes).join(",").trim() || null;
|
|
2748
2755
|
}
|
|
2749
2756
|
});
|
|
2750
2757
|
// src/params/adapters/headless/utils.ts
|