@azzas/azzas-tracker-web 2.0.0-preview.6 → 2.0.0-preview.8
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 +31 -23
- package/dist/mod.cjs.map +1 -1
- package/dist/mod.d.cts +47 -19
- package/dist/mod.d.ts +47 -19
- package/dist/mod.global.js +31 -23
- package/dist/mod.global.js.map +1 -1
- package/dist/mod.js +31 -23
- package/dist/mod.js.map +1 -1
- package/dist/mod.vtex.global.js +19 -12
- package/package.json +1 -1
package/dist/mod.cjs
CHANGED
|
@@ -1358,9 +1358,6 @@ var legacyGetters = {
|
|
|
1358
1358
|
// src/params/adapters/meta/index.ts
|
|
1359
1359
|
var metaAdapters = {
|
|
1360
1360
|
user_info: getUserInfo,
|
|
1361
|
-
// brand: (context: MetaBrandContext) => {
|
|
1362
|
-
// return context.meta.brand || null;
|
|
1363
|
-
// },
|
|
1364
1361
|
content_type: (context) => {
|
|
1365
1362
|
return context.meta.content_type || null;
|
|
1366
1363
|
},
|
|
@@ -1422,24 +1419,7 @@ var metaAdapters = {
|
|
|
1422
1419
|
}
|
|
1423
1420
|
};
|
|
1424
1421
|
|
|
1425
|
-
// src/
|
|
1426
|
-
var getItemCategory3 = (item) => {
|
|
1427
|
-
var _a;
|
|
1428
|
-
const value = item == null ? void 0 : item.category;
|
|
1429
|
-
if (!value) return "Cole\xE7\xE3o";
|
|
1430
|
-
const text = Array.isArray(value) ? value.join(" ") : String(value);
|
|
1431
|
-
const match = (_a = text.match(/outlet|bazar|sale/i)) == null ? void 0 : _a[0].toLowerCase();
|
|
1432
|
-
return match != null ? match : "Cole\xE7\xE3o";
|
|
1433
|
-
};
|
|
1434
|
-
var getItemCategory22 = (item) => {
|
|
1435
|
-
var _a, _b, _c, _d;
|
|
1436
|
-
const AVOID_CATEGORIES = /^(outlet|bazar|sale)$/i;
|
|
1437
|
-
const categories = (_b = (_a = item.category) == null ? void 0 : _a.split(">")) != null ? _b : [];
|
|
1438
|
-
const last = (_c = categories[categories.length - 1]) != null ? _c : "";
|
|
1439
|
-
const validHierarchy = last.split("/").filter((c) => c && !AVOID_CATEGORIES.test(c));
|
|
1440
|
-
const deepest = (_d = validHierarchy[validHierarchy.length - 1]) != null ? _d : "";
|
|
1441
|
-
return capitalize(deepest);
|
|
1442
|
-
};
|
|
1422
|
+
// src/core/farm.ts
|
|
1443
1423
|
var BRAND_CODES2 = {
|
|
1444
1424
|
farm: "farmrio",
|
|
1445
1425
|
"farm etc": "farmetc",
|
|
@@ -1472,6 +1452,25 @@ function normalizeBrand2(input) {
|
|
|
1472
1452
|
return uniqueSortedCodes.length > 0 ? uniqueSortedCodes.join("_") : null;
|
|
1473
1453
|
}
|
|
1474
1454
|
|
|
1455
|
+
// src/params/adapters/deco/utils.ts
|
|
1456
|
+
var getItemCategory3 = (item) => {
|
|
1457
|
+
var _a;
|
|
1458
|
+
const value = item == null ? void 0 : item.category;
|
|
1459
|
+
if (!value) return "Cole\xE7\xE3o";
|
|
1460
|
+
const text = Array.isArray(value) ? value.join(" ") : String(value);
|
|
1461
|
+
const match = (_a = text.match(/outlet|bazar|sale/i)) == null ? void 0 : _a[0].toLowerCase();
|
|
1462
|
+
return match != null ? match : "Cole\xE7\xE3o";
|
|
1463
|
+
};
|
|
1464
|
+
var getItemCategory22 = (item) => {
|
|
1465
|
+
var _a, _b, _c, _d;
|
|
1466
|
+
const AVOID_CATEGORIES = /^(outlet|bazar|sale)$/i;
|
|
1467
|
+
const categories = (_b = (_a = item.category) == null ? void 0 : _a.split(">")) != null ? _b : [];
|
|
1468
|
+
const last = (_c = categories[categories.length - 1]) != null ? _c : "";
|
|
1469
|
+
const validHierarchy = last.split("/").filter((c) => c && !AVOID_CATEGORIES.test(c));
|
|
1470
|
+
const deepest = (_d = validHierarchy[validHierarchy.length - 1]) != null ? _d : "";
|
|
1471
|
+
return capitalize(deepest);
|
|
1472
|
+
};
|
|
1473
|
+
|
|
1475
1474
|
// src/params/adapters/deco/index.ts
|
|
1476
1475
|
var IN_STOCK_SCHEMA = "https://schema.org/InStock";
|
|
1477
1476
|
var LIST_PRICE_SCHEMA = "https://schema.org/ListPrice";
|
|
@@ -1515,6 +1514,7 @@ var decoAdapter = {
|
|
|
1515
1514
|
},
|
|
1516
1515
|
brand: (context, config2) => {
|
|
1517
1516
|
if (config2 == null ? void 0 : config2.brand) return config2.brand;
|
|
1517
|
+
if (context == null ? void 0 : context.brand) return context.brand;
|
|
1518
1518
|
if (context == null ? void 0 : context.products) {
|
|
1519
1519
|
return normalizeBrand2(context.products.map((p) => {
|
|
1520
1520
|
var _a;
|
|
@@ -1641,6 +1641,7 @@ var HeadlessPdpZone = {
|
|
|
1641
1641
|
},
|
|
1642
1642
|
brand: (context, config2) => {
|
|
1643
1643
|
if (config2 == null ? void 0 : config2.brand) return config2.brand;
|
|
1644
|
+
if (context == null ? void 0 : context.brand) return context.brand;
|
|
1644
1645
|
if (context == null ? void 0 : context.products) {
|
|
1645
1646
|
return context.products.map((p) => p.brand).join().trim();
|
|
1646
1647
|
}
|
|
@@ -1699,6 +1700,7 @@ var HeadlessPdcZone = {
|
|
|
1699
1700
|
},
|
|
1700
1701
|
brand: (context, config2) => {
|
|
1701
1702
|
if (config2 == null ? void 0 : config2.brand) return config2.brand;
|
|
1703
|
+
if (context == null ? void 0 : context.brand) return context.brand;
|
|
1702
1704
|
if (context == null ? void 0 : context.products) {
|
|
1703
1705
|
return context.products.map((p) => p.brand.name).join().trim();
|
|
1704
1706
|
}
|
|
@@ -1795,9 +1797,14 @@ var pickupAdapter = {
|
|
|
1795
1797
|
}
|
|
1796
1798
|
return null;
|
|
1797
1799
|
},
|
|
1800
|
+
brand: (context, config2) => {
|
|
1801
|
+
if (config2 == null ? void 0 : config2.brand) return config2.brand;
|
|
1802
|
+
if (context == null ? void 0 : context.brand) return context.brand;
|
|
1803
|
+
return null;
|
|
1804
|
+
},
|
|
1798
1805
|
zipcode: (context) => {
|
|
1799
1806
|
var _a;
|
|
1800
|
-
return (_a = context.zipcode) != null ? _a : null;
|
|
1807
|
+
return (_a = context.meta.zipcode) != null ? _a : null;
|
|
1801
1808
|
}
|
|
1802
1809
|
};
|
|
1803
1810
|
|
|
@@ -1866,6 +1873,7 @@ var orderFormAdapter = {
|
|
|
1866
1873
|
brand: (context, config2) => {
|
|
1867
1874
|
var _a;
|
|
1868
1875
|
if (config2 == null ? void 0 : config2.brand) return config2.brand;
|
|
1876
|
+
if (context == null ? void 0 : context.brand) return context.brand;
|
|
1869
1877
|
if (!((_a = context == null ? void 0 : context.orderForm) == null ? void 0 : _a.items)) return null;
|
|
1870
1878
|
const brands = getOrderFormItems(context.orderForm).map((item) => item.additionalInfo.brandName);
|
|
1871
1879
|
return normalizeBrand2(brands);
|
|
@@ -1914,7 +1922,7 @@ var orderFormAdapter = {
|
|
|
1914
1922
|
},
|
|
1915
1923
|
zipcode: (context) => {
|
|
1916
1924
|
var _a;
|
|
1917
|
-
return (_a = context.zipcode) != null ? _a : null;
|
|
1925
|
+
return (_a = context.meta.zipcode) != null ? _a : null;
|
|
1918
1926
|
},
|
|
1919
1927
|
flag_pickup: (context) => {
|
|
1920
1928
|
var _a;
|