@ikas/storefront 0.0.168-alpha.21 → 0.0.168-alpha.23
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.
|
@@ -31,5 +31,6 @@ export declare class Analytics {
|
|
|
31
31
|
static viewCart(cart: IkasCart | null | undefined): void;
|
|
32
32
|
static viewCategory(categoryPath: string, category: IkasCategory): void;
|
|
33
33
|
static viewSearchResults(searchKeyword: string, productDetails: IkasProductDetail[]): void;
|
|
34
|
+
static viewListing(productDetails: IkasProductDetail[]): void;
|
|
34
35
|
static contactForm(form: IkasContactForm): void;
|
|
35
36
|
}
|
|
@@ -22,6 +22,7 @@ export declare enum IkasEventType {
|
|
|
22
22
|
VIEW_CART = "VIEW_CART",
|
|
23
23
|
VIEW_CATEGORY = "VIEW_CATEGORY",
|
|
24
24
|
VIEW_SEARCH_RESULTS = "VIEW_SEARCH_RESULTS",
|
|
25
|
+
VIEW_LISTING = "VIEW_LISTING",
|
|
25
26
|
CONTACT_FORM = "CONTACT_FORM"
|
|
26
27
|
}
|
|
27
28
|
export declare type IkasEventSubscriber = {
|
package/build/index.es.js
CHANGED
|
@@ -24822,6 +24822,7 @@ var IkasEventType;
|
|
|
24822
24822
|
IkasEventType["VIEW_CART"] = "VIEW_CART";
|
|
24823
24823
|
IkasEventType["VIEW_CATEGORY"] = "VIEW_CATEGORY";
|
|
24824
24824
|
IkasEventType["VIEW_SEARCH_RESULTS"] = "VIEW_SEARCH_RESULTS";
|
|
24825
|
+
IkasEventType["VIEW_LISTING"] = "VIEW_LISTING";
|
|
24825
24826
|
IkasEventType["CONTACT_FORM"] = "CONTACT_FORM";
|
|
24826
24827
|
})(IkasEventType || (IkasEventType = {}));
|
|
24827
24828
|
|
|
@@ -25225,6 +25226,24 @@ var Analytics = /** @class */ (function () {
|
|
|
25225
25226
|
console.error(err);
|
|
25226
25227
|
}
|
|
25227
25228
|
};
|
|
25229
|
+
Analytics.viewListing = function (productDetails) {
|
|
25230
|
+
try {
|
|
25231
|
+
if (Analytics.subscribers.length) {
|
|
25232
|
+
var cloneProductDetails_2 = cloneDeep_1(productDetails).map(function (p) { return new IkasProductDetail(p.product, p.selectedVariantValues); });
|
|
25233
|
+
tryForEach(Analytics.subscribers, function (s) {
|
|
25234
|
+
s.callback({
|
|
25235
|
+
type: IkasEventType.VIEW_LISTING,
|
|
25236
|
+
data: {
|
|
25237
|
+
productDetails: cloneProductDetails_2,
|
|
25238
|
+
},
|
|
25239
|
+
});
|
|
25240
|
+
});
|
|
25241
|
+
}
|
|
25242
|
+
}
|
|
25243
|
+
catch (err) {
|
|
25244
|
+
console.error(err);
|
|
25245
|
+
}
|
|
25246
|
+
};
|
|
25228
25247
|
Analytics.contactForm = function (form) {
|
|
25229
25248
|
try {
|
|
25230
25249
|
FacebookPixel.contactForm();
|
|
@@ -38074,7 +38093,7 @@ var IkasProductList = /** @class */ (function () {
|
|
|
38074
38093
|
this._minPage = this.page;
|
|
38075
38094
|
if (!isInfiteScrollReturn)
|
|
38076
38095
|
this._infiniteScrollPage = null;
|
|
38077
|
-
this.
|
|
38096
|
+
this.handleListingEvent();
|
|
38078
38097
|
return [2 /*return*/, true];
|
|
38079
38098
|
case 12:
|
|
38080
38099
|
err_1 = _a.sent();
|
|
@@ -38270,6 +38289,9 @@ var IkasProductList = /** @class */ (function () {
|
|
|
38270
38289
|
else if (this.isLastViewed) {
|
|
38271
38290
|
this.getInitial();
|
|
38272
38291
|
}
|
|
38292
|
+
else {
|
|
38293
|
+
this.handleListingEvent();
|
|
38294
|
+
}
|
|
38273
38295
|
}
|
|
38274
38296
|
}
|
|
38275
38297
|
Object.defineProperty(IkasProductList.prototype, "sort", {
|
|
@@ -38811,10 +38833,13 @@ var IkasProductList = /** @class */ (function () {
|
|
|
38811
38833
|
}, 1000);
|
|
38812
38834
|
});
|
|
38813
38835
|
};
|
|
38814
|
-
IkasProductList.prototype.
|
|
38836
|
+
IkasProductList.prototype.handleListingEvent = function () {
|
|
38815
38837
|
if (this.searchKeyword && this.data.length) {
|
|
38816
38838
|
Analytics.viewSearchResults(this._searchKeyword, this.data);
|
|
38817
38839
|
}
|
|
38840
|
+
else if (this.data.length && this._type === IkasProductListType.ALL) {
|
|
38841
|
+
Analytics.viewListing(this.data);
|
|
38842
|
+
}
|
|
38818
38843
|
};
|
|
38819
38844
|
return IkasProductList;
|
|
38820
38845
|
}());
|
package/build/index.js
CHANGED
|
@@ -24829,6 +24829,7 @@ var IkasEventType;
|
|
|
24829
24829
|
IkasEventType["VIEW_CART"] = "VIEW_CART";
|
|
24830
24830
|
IkasEventType["VIEW_CATEGORY"] = "VIEW_CATEGORY";
|
|
24831
24831
|
IkasEventType["VIEW_SEARCH_RESULTS"] = "VIEW_SEARCH_RESULTS";
|
|
24832
|
+
IkasEventType["VIEW_LISTING"] = "VIEW_LISTING";
|
|
24832
24833
|
IkasEventType["CONTACT_FORM"] = "CONTACT_FORM";
|
|
24833
24834
|
})(IkasEventType || (IkasEventType = {}));
|
|
24834
24835
|
|
|
@@ -25232,6 +25233,24 @@ var Analytics = /** @class */ (function () {
|
|
|
25232
25233
|
console.error(err);
|
|
25233
25234
|
}
|
|
25234
25235
|
};
|
|
25236
|
+
Analytics.viewListing = function (productDetails) {
|
|
25237
|
+
try {
|
|
25238
|
+
if (Analytics.subscribers.length) {
|
|
25239
|
+
var cloneProductDetails_2 = cloneDeep_1(productDetails).map(function (p) { return new IkasProductDetail(p.product, p.selectedVariantValues); });
|
|
25240
|
+
tryForEach(Analytics.subscribers, function (s) {
|
|
25241
|
+
s.callback({
|
|
25242
|
+
type: IkasEventType.VIEW_LISTING,
|
|
25243
|
+
data: {
|
|
25244
|
+
productDetails: cloneProductDetails_2,
|
|
25245
|
+
},
|
|
25246
|
+
});
|
|
25247
|
+
});
|
|
25248
|
+
}
|
|
25249
|
+
}
|
|
25250
|
+
catch (err) {
|
|
25251
|
+
console.error(err);
|
|
25252
|
+
}
|
|
25253
|
+
};
|
|
25235
25254
|
Analytics.contactForm = function (form) {
|
|
25236
25255
|
try {
|
|
25237
25256
|
FacebookPixel.contactForm();
|
|
@@ -38056,7 +38075,7 @@ var IkasProductList = /** @class */ (function () {
|
|
|
38056
38075
|
this._minPage = this.page;
|
|
38057
38076
|
if (!isInfiteScrollReturn)
|
|
38058
38077
|
this._infiniteScrollPage = null;
|
|
38059
|
-
this.
|
|
38078
|
+
this.handleListingEvent();
|
|
38060
38079
|
return [2 /*return*/, true];
|
|
38061
38080
|
case 12:
|
|
38062
38081
|
err_1 = _a.sent();
|
|
@@ -38252,6 +38271,9 @@ var IkasProductList = /** @class */ (function () {
|
|
|
38252
38271
|
else if (this.isLastViewed) {
|
|
38253
38272
|
this.getInitial();
|
|
38254
38273
|
}
|
|
38274
|
+
else {
|
|
38275
|
+
this.handleListingEvent();
|
|
38276
|
+
}
|
|
38255
38277
|
}
|
|
38256
38278
|
}
|
|
38257
38279
|
Object.defineProperty(IkasProductList.prototype, "sort", {
|
|
@@ -38793,10 +38815,13 @@ var IkasProductList = /** @class */ (function () {
|
|
|
38793
38815
|
}, 1000);
|
|
38794
38816
|
});
|
|
38795
38817
|
};
|
|
38796
|
-
IkasProductList.prototype.
|
|
38818
|
+
IkasProductList.prototype.handleListingEvent = function () {
|
|
38797
38819
|
if (this.searchKeyword && this.data.length) {
|
|
38798
38820
|
Analytics.viewSearchResults(this._searchKeyword, this.data);
|
|
38799
38821
|
}
|
|
38822
|
+
else if (this.data.length && this._type === exports.IkasProductListType.ALL) {
|
|
38823
|
+
Analytics.viewListing(this.data);
|
|
38824
|
+
}
|
|
38800
38825
|
};
|
|
38801
38826
|
return IkasProductList;
|
|
38802
38827
|
}());
|
|
@@ -89,7 +89,7 @@ export declare class IkasProductList {
|
|
|
89
89
|
private getQueryParams;
|
|
90
90
|
private isBrowser;
|
|
91
91
|
private waitForCustomerStoreInit;
|
|
92
|
-
private
|
|
92
|
+
private handleListingEvent;
|
|
93
93
|
private searchDebouncer;
|
|
94
94
|
private searchAnalyticsDebouncer;
|
|
95
95
|
}
|