@artisan-commerce/analytics-rn 0.3.0-canary.163 → 0.3.0-canary.165
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/bundle.mjs +17 -3
- package/package.json +6 -6
package/dist/bundle.mjs
CHANGED
|
@@ -51,7 +51,7 @@ const _State = class {
|
|
|
51
51
|
let State$1 = _State;
|
|
52
52
|
State$1._instance = null;
|
|
53
53
|
|
|
54
|
-
var version = "0.3.0-canary.
|
|
54
|
+
var version = "0.3.0-canary.165";
|
|
55
55
|
var packageJSON = {
|
|
56
56
|
version: version};
|
|
57
57
|
|
|
@@ -791,6 +791,20 @@ const getModifiersNames = (product) => {
|
|
|
791
791
|
const variants = modifiers == null ? void 0 : modifiers.flatMap((question) => question.answers.filter((answer) => answer.amount > 0).map((answer) => answer.name));
|
|
792
792
|
return variants;
|
|
793
793
|
};
|
|
794
|
+
const getProductListName = (categoryName) => {
|
|
795
|
+
if (categoryName == null ? void 0 : categoryName.includes("COUPON"))
|
|
796
|
+
return "coupon_menu";
|
|
797
|
+
if (categoryName == null ? void 0 : categoryName.includes("HOME"))
|
|
798
|
+
return "home_product";
|
|
799
|
+
return "product_menu";
|
|
800
|
+
};
|
|
801
|
+
const getProductAddedFrom = (addedFrom) => {
|
|
802
|
+
if (addedFrom === "up_sell_modal")
|
|
803
|
+
return "upsell_recommendation";
|
|
804
|
+
if (addedFrom == null ? void 0 : addedFrom.includes("add_prod"))
|
|
805
|
+
return "menu";
|
|
806
|
+
return addedFrom != null ? addedFrom : "";
|
|
807
|
+
};
|
|
794
808
|
const toItemProduct = (product, cart, item_category2) => {
|
|
795
809
|
var _a, _b, _c;
|
|
796
810
|
const { categories, addedFrom, additionalInfo } = product;
|
|
@@ -799,7 +813,7 @@ const toItemProduct = (product, cart, item_category2) => {
|
|
|
799
813
|
const { netPrice } = getProductTotals(product);
|
|
800
814
|
const productModifiers = getModifiersNames(product);
|
|
801
815
|
const benefits = (_a = cart == null ? void 0 : cart.benefits) != null ? _a : [];
|
|
802
|
-
const source = addedFrom
|
|
816
|
+
const source = getProductAddedFrom(addedFrom);
|
|
803
817
|
const benefit = benefits == null ? void 0 : benefits.find((benefit2) => {
|
|
804
818
|
var _a2, _b2, _c2, _d;
|
|
805
819
|
return ((_b2 = (_a2 = benefit2 == null ? void 0 : benefit2.reward) == null ? void 0 : _a2.attributes) == null ? void 0 : _b2.new_product_id) || ((_d = (_c2 = benefit2 == null ? void 0 : benefit2.reward) == null ? void 0 : _c2.attributes) == null ? void 0 : _d.item_id) === (additionalInfo == null ? void 0 : additionalInfo.externalId);
|
|
@@ -815,7 +829,7 @@ const toItemProduct = (product, cart, item_category2) => {
|
|
|
815
829
|
quantity: product.amount,
|
|
816
830
|
item_revenue_in_usd: netPrice,
|
|
817
831
|
item_revenue: netPrice,
|
|
818
|
-
item_list_name: (categoryName
|
|
832
|
+
item_list_name: getProductListName(categoryName),
|
|
819
833
|
item_category3: (categoryName == null ? void 0 : categoryName.includes("PRODUCT PROMOTION")) ? "push_in_app" : ""
|
|
820
834
|
};
|
|
821
835
|
if (categoryId)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artisan-commerce/analytics-rn",
|
|
3
3
|
"description": "Artisn commerce analytics react native library",
|
|
4
|
-
"version": "0.3.0-canary.
|
|
4
|
+
"version": "0.3.0-canary.165",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/bundle.mjs",
|
|
7
7
|
"module": "./dist/bundle.mjs",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"snake-case": "^3.0.4"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@artisan-commerce/products": "0.9.0-canary.
|
|
40
|
-
"@artisan-commerce/shopping-cart-core": "0.12.0-canary.
|
|
41
|
-
"@artisan-commerce/state": "0.3.0-canary.
|
|
42
|
-
"@artisan-commerce/types": "0.14.0-canary.
|
|
39
|
+
"@artisan-commerce/products": "0.9.0-canary.111",
|
|
40
|
+
"@artisan-commerce/shopping-cart-core": "0.12.0-canary.149",
|
|
41
|
+
"@artisan-commerce/state": "0.3.0-canary.60",
|
|
42
|
+
"@artisan-commerce/types": "0.14.0-canary.88",
|
|
43
43
|
"@babel/core": "^7.13.15",
|
|
44
44
|
"@babel/preset-env": "^7.10.4",
|
|
45
45
|
"@babel/preset-react": "^7.10.4",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "48e81a107fe2d3843dc3bcad04488f7a66015463"
|
|
88
88
|
}
|