vviinn-widgets 2.29.0 → 2.30.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/cjs/{index-ea4811ba.js → index-7ff2ab5f.js} +65 -20
- package/dist/cjs/{package-2bbc82df.js → package-6a69244e.js} +1 -1
- package/dist/cjs/vviinn-carousel_3.cjs.entry.js +18 -2
- package/dist/cjs/vviinn-vpr-button.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-vps-widget.cjs.entry.js +12 -2
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +17 -1
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +11 -1
- package/dist/collection/tracking/index.js +36 -20
- package/dist/collection/tracking/models.js +3 -1
- package/dist/collection/tracking/result.js +26 -0
- package/dist/esm/{index-95fa66d2.js → index-53105ad4.js} +63 -21
- package/dist/esm/{package-fbba5beb.js → package-59929481.js} +1 -1
- package/dist/esm/vviinn-carousel_3.entry.js +18 -2
- package/dist/esm/vviinn-vpr-button.entry.js +1 -1
- package/dist/esm/vviinn-vps-button.entry.js +1 -1
- package/dist/esm/vviinn-vps-widget.entry.js +12 -2
- package/dist/types/components/vviinn-vpr-widget/vviinn-vpr-vidget.d.ts +1 -0
- package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +1 -0
- package/dist/types/recommendation/events.d.ts +1 -0
- package/dist/types/tracking/index.d.ts +6 -3
- package/dist/types/tracking/models.d.ts +4 -2
- package/dist/types/tracking/result.d.ts +8 -0
- package/dist/vviinn-widgets/p-393575bb.entry.js +1 -0
- package/dist/vviinn-widgets/{p-0fd3fc41.entry.js → p-9eef4285.entry.js} +1 -1
- package/dist/vviinn-widgets/p-ad6d6ca9.entry.js +1 -0
- package/dist/vviinn-widgets/p-b83ecd17.entry.js +1 -0
- package/dist/vviinn-widgets/{p-ffa567ee.js → p-da7273ce.js} +1 -1
- package/dist/vviinn-widgets/p-ffb037db.js +1 -0
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +1 -1
- package/www/build/p-06a4b0c1.js +161 -0
- package/www/build/p-393575bb.entry.js +1 -0
- package/www/build/{p-0fd3fc41.entry.js → p-9eef4285.entry.js} +1 -1
- package/www/build/p-ad6d6ca9.entry.js +1 -0
- package/www/build/p-b83ecd17.entry.js +1 -0
- package/www/build/{p-ffa567ee.js → p-da7273ce.js} +1 -1
- package/www/build/p-e0153ae2.css +6 -0
- package/www/build/p-ffb037db.js +1 -0
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +1 -1
- package/dist/vviinn-widgets/p-7069450a.entry.js +0 -1
- package/dist/vviinn-widgets/p-835af647.js +0 -1
- package/dist/vviinn-widgets/p-b1a1366c.entry.js +0 -1
- package/dist/vviinn-widgets/p-f7e7e96b.entry.js +0 -1
- package/www/assets/web_component_shadow_parts.png +0 -0
- package/www/build/p-7069450a.entry.js +0 -1
- package/www/build/p-835af647.js +0 -1
- package/www/build/p-a67898be.css +0 -1
- package/www/build/p-b1a1366c.entry.js +0 -1
- package/www/build/p-da7e00d1.js +0 -1
- package/www/build/p-f7e7e96b.entry.js +0 -1
|
@@ -3815,6 +3815,8 @@ const ADD_TO_BASKET_EVENT_TYPE = "add_to_basket_event";
|
|
|
3815
3815
|
const FILTER_EVENT_TYPE = "filter_event";
|
|
3816
3816
|
const SEARCH_EVENT_TYPE = "search_event";
|
|
3817
3817
|
const WIDGET_EVENT_TYPE = "widget_event";
|
|
3818
|
+
const RESULT_LOAD_EVENT_TYPE = "result_load_event";
|
|
3819
|
+
const RESULT_VIEW_EVENT_TYPE = "result_view_event";
|
|
3818
3820
|
|
|
3819
3821
|
const filterEvent = {
|
|
3820
3822
|
widget: "VPS",
|
|
@@ -3884,45 +3886,83 @@ const vpsWidget = {
|
|
|
3884
3886
|
typ: WIDGET_EVENT_TYPE,
|
|
3885
3887
|
};
|
|
3886
3888
|
|
|
3887
|
-
const
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
const
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
const
|
|
3896
|
-
|
|
3897
|
-
|
|
3889
|
+
const vprResultLoad = {
|
|
3890
|
+
widget: "VPR",
|
|
3891
|
+
typ: RESULT_LOAD_EVENT_TYPE,
|
|
3892
|
+
};
|
|
3893
|
+
const vprResultView = {
|
|
3894
|
+
widget: "VPR",
|
|
3895
|
+
typ: RESULT_VIEW_EVENT_TYPE,
|
|
3896
|
+
};
|
|
3897
|
+
const vpcResultLoad = {
|
|
3898
|
+
widget: "VPC",
|
|
3899
|
+
typ: RESULT_LOAD_EVENT_TYPE,
|
|
3900
|
+
};
|
|
3901
|
+
const vpcResultView = {
|
|
3902
|
+
widget: "VPC",
|
|
3903
|
+
typ: RESULT_VIEW_EVENT_TYPE,
|
|
3904
|
+
};
|
|
3905
|
+
const vpsResultLoad = {
|
|
3906
|
+
widget: "VPS",
|
|
3907
|
+
typ: RESULT_LOAD_EVENT_TYPE,
|
|
3908
|
+
};
|
|
3909
|
+
const vpsResultView = {
|
|
3910
|
+
widget: "VPS",
|
|
3911
|
+
typ: RESULT_VIEW_EVENT_TYPE,
|
|
3912
|
+
};
|
|
3913
|
+
|
|
3898
3914
|
const createProductVprEventByType = (type) => {
|
|
3899
3915
|
switch (type) {
|
|
3900
3916
|
case "load":
|
|
3901
|
-
return
|
|
3917
|
+
return createTrackingEvent(vprProductLoad);
|
|
3902
3918
|
case "view":
|
|
3903
|
-
return
|
|
3919
|
+
return createTrackingEvent(vprProductView);
|
|
3904
3920
|
case "click":
|
|
3905
|
-
return
|
|
3921
|
+
return createTrackingEvent(vprProductClick);
|
|
3906
3922
|
}
|
|
3907
3923
|
};
|
|
3908
3924
|
const createProductVpcEventByType = (type) => {
|
|
3909
3925
|
switch (type) {
|
|
3910
3926
|
case "load":
|
|
3911
|
-
return
|
|
3927
|
+
return createTrackingEvent(vpcProductLoad);
|
|
3912
3928
|
case "view":
|
|
3913
|
-
return
|
|
3929
|
+
return createTrackingEvent(vpcProductView);
|
|
3914
3930
|
case "click":
|
|
3915
|
-
return
|
|
3931
|
+
return createTrackingEvent(vpcProductClick);
|
|
3916
3932
|
}
|
|
3917
3933
|
};
|
|
3918
3934
|
const createProductVpsEventByType = (type) => {
|
|
3919
3935
|
switch (type) {
|
|
3920
3936
|
case "load":
|
|
3921
|
-
return
|
|
3937
|
+
return createTrackingEvent(vpsProductLoad);
|
|
3922
3938
|
case "view":
|
|
3923
|
-
return
|
|
3939
|
+
return createTrackingEvent(vpsProductView);
|
|
3924
3940
|
case "click":
|
|
3925
|
-
return
|
|
3941
|
+
return createTrackingEvent(vpsProductClick);
|
|
3942
|
+
}
|
|
3943
|
+
};
|
|
3944
|
+
const createResultVprEventByType = (type) => {
|
|
3945
|
+
switch (type) {
|
|
3946
|
+
case "load":
|
|
3947
|
+
return createTrackingEvent(vprResultLoad);
|
|
3948
|
+
case "view":
|
|
3949
|
+
return createTrackingEvent(vprResultView);
|
|
3950
|
+
}
|
|
3951
|
+
};
|
|
3952
|
+
const createResultVpcEventByType = (type) => {
|
|
3953
|
+
switch (type) {
|
|
3954
|
+
case "load":
|
|
3955
|
+
return createTrackingEvent(vpcResultLoad);
|
|
3956
|
+
case "view":
|
|
3957
|
+
return createTrackingEvent(vpcResultView);
|
|
3958
|
+
}
|
|
3959
|
+
};
|
|
3960
|
+
const createResultVpsEventByType = (type) => {
|
|
3961
|
+
switch (type) {
|
|
3962
|
+
case "load":
|
|
3963
|
+
return createTrackingEvent(vpsResultLoad);
|
|
3964
|
+
case "view":
|
|
3965
|
+
return createTrackingEvent(vpsResultView);
|
|
3926
3966
|
}
|
|
3927
3967
|
};
|
|
3928
3968
|
const createWidgetVprEvent = createTrackingEvent(vprWidget);
|
|
@@ -3930,6 +3970,8 @@ const createWidgetVpsEvent = createTrackingEvent(vpsWidget);
|
|
|
3930
3970
|
const createWidgetVpcEvent = createTrackingEvent(vpcWidget);
|
|
3931
3971
|
const createSearchEvent = createTrackingEvent(searchEvent);
|
|
3932
3972
|
const createFilterEvent = createTrackingEvent(filterEvent);
|
|
3973
|
+
const createAddToBasketVprEvent = createTrackingEvent(vprAddToBasket);
|
|
3974
|
+
const createAddToBasketVpcEvent = createTrackingEvent(vpcAddToBasket);
|
|
3933
3975
|
|
|
3934
3976
|
exports.createAddToBasketVpcEvent = createAddToBasketVpcEvent;
|
|
3935
3977
|
exports.createAddToBasketVprEvent = createAddToBasketVprEvent;
|
|
@@ -3937,6 +3979,9 @@ exports.createFilterEvent = createFilterEvent;
|
|
|
3937
3979
|
exports.createProductVpcEventByType = createProductVpcEventByType;
|
|
3938
3980
|
exports.createProductVprEventByType = createProductVprEventByType;
|
|
3939
3981
|
exports.createProductVpsEventByType = createProductVpsEventByType;
|
|
3982
|
+
exports.createResultVpcEventByType = createResultVpcEventByType;
|
|
3983
|
+
exports.createResultVprEventByType = createResultVprEventByType;
|
|
3984
|
+
exports.createResultVpsEventByType = createResultVpsEventByType;
|
|
3940
3985
|
exports.createSearchEvent = createSearchEvent;
|
|
3941
3986
|
exports.createTrackingApi = createTrackingApi;
|
|
3942
3987
|
exports.createWidgetVpcEvent = createWidgetVpcEvent;
|
|
@@ -7,8 +7,8 @@ const imageSearch_store = require('./imageSearch.store-dc4e98b3.js');
|
|
|
7
7
|
const index$1 = require('./index-fcf59d51.js');
|
|
8
8
|
const i18next = require('./i18next-74ff3413.js');
|
|
9
9
|
const customizedSlots = require('./customized-slots-0a8d663c.js');
|
|
10
|
-
const _package = require('./package-
|
|
11
|
-
const index$2 = require('./index-
|
|
10
|
+
const _package = require('./package-6a69244e.js');
|
|
11
|
+
const index$2 = require('./index-7ff2ab5f.js');
|
|
12
12
|
|
|
13
13
|
const vviinnCarouselCss = ":host{--vviinn-progressbar-width:0;--vviinn-carousel-item-width:150px;--vviinn-carousel-columns-internal:var(--vviinn-carousel-columns, 4);--vviinn-carousel-image-width-system:140px}.body{display:flex;position:relative;width:var(--vviinn-carousel-content-width);flex-direction:column}.content-wrapper *{box-sizing:border-box}.content-wrapper{overflow-y:hidden;overflow-x:auto;flex-grow:1}.bullets{margin-top:16px;display:flex;flex-direction:row;grid-gap:24px;justify-content:center}.bullet{width:10px;height:10px;background:#e0e0e0;border-radius:50%;cursor:pointer}.bullet.active{background:#161616}.content:not(.show-scrollbar),.content.grid{scrollbar-color:#fff0 #fff0}.content:not(.show-scrollbar)::-webkit-scrollbar,.content.grid::-webkit-scrollbar{opacity:0}.content{display:flex;flex-direction:row;grid-gap:8px;overflow-y:hidden;overflow-x:auto;flex-grow:1;padding-bottom:16px}.content.left>*{scroll-snap-align:start}.content.right>*{scroll-snap-align:end}:host(.continuity) button{border-radius:2px}:host(.grid) button{border-radius:50%}button{align-items:center;background-color:white;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);cursor:pointer;display:grid;height:40px;justify-items:center;position:absolute;top:calc(50% - 20px);width:40px;z-index:1;padding:0;margin:0}button{fill:#525252}button:disabled{display:none}button.prev svg{transform:rotate(180deg);margin-left:-5px}.prev{left:0}.next{right:0}.items-group{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--vviinn-carousel-columns-internal), 1fr);min-width:100%}vviinn-product-card::part(price-container){text-align:center}:host(.classic) vviinn-product-card::part(title),:host(.classic) vviinn-product-card::part(brand),:host(.classic) vviinn-product-card::part(type){text-align:center}@media (max-width: 480px){:host(.modern) button{display:none}.items-group{grid-template-columns:repeat(2, 1fr)}}";
|
|
14
14
|
|
|
@@ -1365,6 +1365,7 @@ const VviinnVprWidget = class {
|
|
|
1365
1365
|
if (!this.resultViewed) {
|
|
1366
1366
|
this.resultViewed = true;
|
|
1367
1367
|
this.vviinnResultView.emit(this.getBasicEventData());
|
|
1368
|
+
this.trackResultEvent("view");
|
|
1368
1369
|
}
|
|
1369
1370
|
const productViewEvent = this.getProductTrackEvent(detail, "view");
|
|
1370
1371
|
if (!productViewEvent)
|
|
@@ -1419,6 +1420,20 @@ const VviinnVprWidget = class {
|
|
|
1419
1420
|
}
|
|
1420
1421
|
this.trackingApi.trackEvent(widgetEvent).then(this.setTrackingDeactivated);
|
|
1421
1422
|
}
|
|
1423
|
+
trackResultEvent(type) {
|
|
1424
|
+
if (this.trackingDeactivated)
|
|
1425
|
+
return;
|
|
1426
|
+
const _a = this.getBasicEventData(), rest = __rest(_a, ["campaignTypeId", "widgetType"]);
|
|
1427
|
+
let resultEvent;
|
|
1428
|
+
const eventBody = Object.assign({ session_id: this.uiSessionId }, rest);
|
|
1429
|
+
if (this.campaignType === "VCS") {
|
|
1430
|
+
resultEvent = index$2.createResultVpcEventByType(type)(eventBody);
|
|
1431
|
+
}
|
|
1432
|
+
else if (this.campaignType === "VPR") {
|
|
1433
|
+
resultEvent = index$2.createResultVprEventByType(type)(eventBody);
|
|
1434
|
+
}
|
|
1435
|
+
this.trackingApi.trackEvent(resultEvent).then(this.setTrackingDeactivated);
|
|
1436
|
+
}
|
|
1422
1437
|
getProductTrackEvent(detail, eventType) {
|
|
1423
1438
|
if (this.trackingDeactivated)
|
|
1424
1439
|
return null;
|
|
@@ -1452,6 +1467,7 @@ const VviinnVprWidget = class {
|
|
|
1452
1467
|
handleRecommendationsSuccess(data) {
|
|
1453
1468
|
var _a;
|
|
1454
1469
|
this.vviinnResultLoad.emit(this.getBasicEventData());
|
|
1470
|
+
this.trackResultEvent("load");
|
|
1455
1471
|
this.recommendations = (_a = data === null || data === void 0 ? void 0 : data.extended) !== null && _a !== void 0 ? _a : data;
|
|
1456
1472
|
imageSearch_store.imageSearchState.results = this.recommendations;
|
|
1457
1473
|
this.productIds = this.recommendations.map((r) => r.productId);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-5619b5ec.js');
|
|
6
|
-
const _package = require('./package-
|
|
6
|
+
const _package = require('./package-6a69244e.js');
|
|
7
7
|
const index$1 = require('./index-fcf59d51.js');
|
|
8
8
|
|
|
9
9
|
const vviinnVprButtonCss = ":host{display:block}";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-5619b5ec.js');
|
|
6
|
-
const _package = require('./package-
|
|
6
|
+
const _package = require('./package-6a69244e.js');
|
|
7
7
|
const index$1 = require('./index-fcf59d51.js');
|
|
8
8
|
const customizedSlots = require('./customized-slots-0a8d663c.js');
|
|
9
9
|
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-5619b5ec.js');
|
|
6
6
|
const imageSearch_store = require('./imageSearch.store-dc4e98b3.js');
|
|
7
7
|
const i18next = require('./i18next-74ff3413.js');
|
|
8
|
-
const _package = require('./package-
|
|
8
|
+
const _package = require('./package-6a69244e.js');
|
|
9
9
|
const customizedSlots = require('./customized-slots-0a8d663c.js');
|
|
10
|
-
const index$1 = require('./index-
|
|
10
|
+
const index$1 = require('./index-7ff2ab5f.js');
|
|
11
11
|
|
|
12
12
|
const resources = {
|
|
13
13
|
"de-DE": {
|
|
@@ -178,6 +178,7 @@ const VviinnVpsWidget = class {
|
|
|
178
178
|
}
|
|
179
179
|
else {
|
|
180
180
|
document.body.style.overflow = this.overflow;
|
|
181
|
+
this.initResultEvents();
|
|
181
182
|
}
|
|
182
183
|
}
|
|
183
184
|
buttonPressedWatcher(pressed) {
|
|
@@ -197,6 +198,7 @@ const VviinnVpsWidget = class {
|
|
|
197
198
|
if (!this.resultViewed) {
|
|
198
199
|
this.resultViewed = true;
|
|
199
200
|
this.vviinnResultView.emit(this.getBasicEventData());
|
|
201
|
+
this.trackResultEvent("view");
|
|
200
202
|
}
|
|
201
203
|
const productViewEvent = this.getProductTrackEvent(detail, "view");
|
|
202
204
|
this.trackingApi
|
|
@@ -288,6 +290,13 @@ const VviinnVpsWidget = class {
|
|
|
288
290
|
const productEvent = index$1.createProductVpsEventByType(eventType)(eventBody);
|
|
289
291
|
return productEvent;
|
|
290
292
|
}
|
|
293
|
+
trackResultEvent(type) {
|
|
294
|
+
if (this.trackingDeactivated)
|
|
295
|
+
return;
|
|
296
|
+
const _a = this.getBasicEventData(), rest = __rest(_a, ["campaignTypeId", "widgetType"]);
|
|
297
|
+
let resultEvent = index$1.createResultVpsEventByType(type)(Object.assign({ session_id: this.uiSessionId }, rest));
|
|
298
|
+
this.trackingApi.trackEvent(resultEvent).then(this.setTrackingDeactivated);
|
|
299
|
+
}
|
|
291
300
|
trackInitialSearch(source) {
|
|
292
301
|
if (this.trackingDeactivated)
|
|
293
302
|
return;
|
|
@@ -309,6 +318,7 @@ const VviinnVpsWidget = class {
|
|
|
309
318
|
return null;
|
|
310
319
|
if (!this.resultLoaded) {
|
|
311
320
|
this.vviinnResultLoad.emit(this.getBasicEventData());
|
|
321
|
+
this.trackResultEvent("load");
|
|
312
322
|
this.resultLoaded = true;
|
|
313
323
|
}
|
|
314
324
|
return imageSearch_store.imageSearchState.results.map((p, i) => {
|
|
@@ -25,7 +25,7 @@ import { getRecommendationsService } from "../../campaign/CampaignService";
|
|
|
25
25
|
import { imageSearchState } from "../../store/imageSearch.store";
|
|
26
26
|
import { SlotSkeleton } from "../customized-slots";
|
|
27
27
|
import { createTrackingApi } from "../../openApi";
|
|
28
|
-
import { createWidgetVprEvent, createWidgetVpcEvent, createProductVpcEventByType, createProductVprEventByType, createAddToBasketVpcEvent, createAddToBasketVprEvent, } from "../../tracking";
|
|
28
|
+
import { createWidgetVprEvent, createWidgetVpcEvent, createProductVpcEventByType, createProductVprEventByType, createAddToBasketVpcEvent, createAddToBasketVprEvent, createResultVpcEventByType, createResultVprEventByType, } from "../../tracking";
|
|
29
29
|
import { checkEmpryString } from "../../utils/option/option";
|
|
30
30
|
import { parseExcluded } from "../../utils/collections/collectionsUtils";
|
|
31
31
|
import { resources } from "../../locale/resources-vpr";
|
|
@@ -183,6 +183,7 @@ export class VviinnVprWidget {
|
|
|
183
183
|
if (!this.resultViewed) {
|
|
184
184
|
this.resultViewed = true;
|
|
185
185
|
this.vviinnResultView.emit(this.getBasicEventData());
|
|
186
|
+
this.trackResultEvent("view");
|
|
186
187
|
}
|
|
187
188
|
const productViewEvent = this.getProductTrackEvent(detail, "view");
|
|
188
189
|
if (!productViewEvent)
|
|
@@ -237,6 +238,20 @@ export class VviinnVprWidget {
|
|
|
237
238
|
}
|
|
238
239
|
this.trackingApi.trackEvent(widgetEvent).then(this.setTrackingDeactivated);
|
|
239
240
|
}
|
|
241
|
+
trackResultEvent(type) {
|
|
242
|
+
if (this.trackingDeactivated)
|
|
243
|
+
return;
|
|
244
|
+
const _a = this.getBasicEventData(), { campaignTypeId, widgetType } = _a, rest = __rest(_a, ["campaignTypeId", "widgetType"]);
|
|
245
|
+
let resultEvent;
|
|
246
|
+
const eventBody = Object.assign({ session_id: this.uiSessionId }, rest);
|
|
247
|
+
if (this.campaignType === "VCS") {
|
|
248
|
+
resultEvent = createResultVpcEventByType(type)(eventBody);
|
|
249
|
+
}
|
|
250
|
+
else if (this.campaignType === "VPR") {
|
|
251
|
+
resultEvent = createResultVprEventByType(type)(eventBody);
|
|
252
|
+
}
|
|
253
|
+
this.trackingApi.trackEvent(resultEvent).then(this.setTrackingDeactivated);
|
|
254
|
+
}
|
|
240
255
|
getProductTrackEvent(detail, eventType) {
|
|
241
256
|
if (this.trackingDeactivated)
|
|
242
257
|
return null;
|
|
@@ -270,6 +285,7 @@ export class VviinnVprWidget {
|
|
|
270
285
|
handleRecommendationsSuccess(data) {
|
|
271
286
|
var _a;
|
|
272
287
|
this.vviinnResultLoad.emit(this.getBasicEventData());
|
|
288
|
+
this.trackResultEvent("load");
|
|
273
289
|
this.recommendations = (_a = data === null || data === void 0 ? void 0 : data.extended) !== null && _a !== void 0 ? _a : data;
|
|
274
290
|
imageSearchState.results = this.recommendations;
|
|
275
291
|
this.productIds = this.recommendations.map((r) => r.productId);
|
|
@@ -21,7 +21,7 @@ import { imageSearchState } from "../../store/imageSearch.store";
|
|
|
21
21
|
import { state } from "../../store/store";
|
|
22
22
|
import { slotChangeListener } from "../customized-slots";
|
|
23
23
|
import { createTrackingApi } from "../../openApi";
|
|
24
|
-
import { createWidgetVpsEvent, createFilterEvent, createSearchEvent, createProductVpsEventByType, } from "../../tracking";
|
|
24
|
+
import { createWidgetVpsEvent, createFilterEvent, createSearchEvent, createProductVpsEventByType, createResultVpsEventByType, } from "../../tracking";
|
|
25
25
|
import { SlotSkeleton } from "../customized-slots";
|
|
26
26
|
import { campaignTypeNames } from "../../campaign/Campaign";
|
|
27
27
|
import { parseExcluded } from "../../utils/collections/collectionsUtils";
|
|
@@ -145,6 +145,7 @@ export class VviinnVpsWidget {
|
|
|
145
145
|
}
|
|
146
146
|
else {
|
|
147
147
|
document.body.style.overflow = this.overflow;
|
|
148
|
+
this.initResultEvents();
|
|
148
149
|
}
|
|
149
150
|
}
|
|
150
151
|
buttonPressedWatcher(pressed) {
|
|
@@ -164,6 +165,7 @@ export class VviinnVpsWidget {
|
|
|
164
165
|
if (!this.resultViewed) {
|
|
165
166
|
this.resultViewed = true;
|
|
166
167
|
this.vviinnResultView.emit(this.getBasicEventData());
|
|
168
|
+
this.trackResultEvent("view");
|
|
167
169
|
}
|
|
168
170
|
const productViewEvent = this.getProductTrackEvent(detail, "view");
|
|
169
171
|
this.trackingApi
|
|
@@ -255,6 +257,13 @@ export class VviinnVpsWidget {
|
|
|
255
257
|
const productEvent = createProductVpsEventByType(eventType)(eventBody);
|
|
256
258
|
return productEvent;
|
|
257
259
|
}
|
|
260
|
+
trackResultEvent(type) {
|
|
261
|
+
if (this.trackingDeactivated)
|
|
262
|
+
return;
|
|
263
|
+
const _a = this.getBasicEventData(), { campaignTypeId, widgetType } = _a, rest = __rest(_a, ["campaignTypeId", "widgetType"]);
|
|
264
|
+
let resultEvent = createResultVpsEventByType(type)(Object.assign({ session_id: this.uiSessionId }, rest));
|
|
265
|
+
this.trackingApi.trackEvent(resultEvent).then(this.setTrackingDeactivated);
|
|
266
|
+
}
|
|
258
267
|
trackInitialSearch(source) {
|
|
259
268
|
if (this.trackingDeactivated)
|
|
260
269
|
return;
|
|
@@ -276,6 +285,7 @@ export class VviinnVpsWidget {
|
|
|
276
285
|
return null;
|
|
277
286
|
if (!this.resultLoaded) {
|
|
278
287
|
this.vviinnResultLoad.emit(this.getBasicEventData());
|
|
288
|
+
this.trackResultEvent("load");
|
|
279
289
|
this.resultLoaded = true;
|
|
280
290
|
}
|
|
281
291
|
return imageSearchState.results.map((p, i) => {
|
|
@@ -3,45 +3,59 @@ import { filterEvent } from "./filter";
|
|
|
3
3
|
import { vprProductLoad, vpcProductLoad, vprProductClick, vpcProductClick, vprProductView, vpcProductView, vprAddToBasket, vpcAddToBasket, vpsProductClick, vpsProductView, vpsProductLoad, } from "./product";
|
|
4
4
|
import { searchEvent } from "./search";
|
|
5
5
|
import { vpcWidget, vprWidget, vpsWidget } from "./widget";
|
|
6
|
-
|
|
7
|
-
const createProductViewVprEvent = createTrackingEvent(vprProductView);
|
|
8
|
-
const createProductClickVprEvent = createTrackingEvent(vprProductClick);
|
|
9
|
-
const createProductLoadVpcEvent = createTrackingEvent(vpcProductLoad);
|
|
10
|
-
const createProductViewVpcEvent = createTrackingEvent(vpcProductView);
|
|
11
|
-
const createProductClickVpcEvent = createTrackingEvent(vpcProductClick);
|
|
12
|
-
const createProductLoadVpsEvent = createTrackingEvent(vpsProductLoad);
|
|
13
|
-
const createProductViewVpsEvent = createTrackingEvent(vpsProductView);
|
|
14
|
-
const createProductClickVpsEvent = createTrackingEvent(vpsProductClick);
|
|
15
|
-
export const createAddToBasketVprEvent = createTrackingEvent(vprAddToBasket);
|
|
16
|
-
export const createAddToBasketVpcEvent = createTrackingEvent(vpcAddToBasket);
|
|
6
|
+
import { vprResultLoad, vpcResultLoad, vpsResultLoad, vprResultView, vpcResultView, vpsResultView, } from "./result";
|
|
17
7
|
export const createProductVprEventByType = (type) => {
|
|
18
8
|
switch (type) {
|
|
19
9
|
case "load":
|
|
20
|
-
return
|
|
10
|
+
return createTrackingEvent(vprProductLoad);
|
|
21
11
|
case "view":
|
|
22
|
-
return
|
|
12
|
+
return createTrackingEvent(vprProductView);
|
|
23
13
|
case "click":
|
|
24
|
-
return
|
|
14
|
+
return createTrackingEvent(vprProductClick);
|
|
25
15
|
}
|
|
26
16
|
};
|
|
27
17
|
export const createProductVpcEventByType = (type) => {
|
|
28
18
|
switch (type) {
|
|
29
19
|
case "load":
|
|
30
|
-
return
|
|
20
|
+
return createTrackingEvent(vpcProductLoad);
|
|
31
21
|
case "view":
|
|
32
|
-
return
|
|
22
|
+
return createTrackingEvent(vpcProductView);
|
|
33
23
|
case "click":
|
|
34
|
-
return
|
|
24
|
+
return createTrackingEvent(vpcProductClick);
|
|
35
25
|
}
|
|
36
26
|
};
|
|
37
27
|
export const createProductVpsEventByType = (type) => {
|
|
38
28
|
switch (type) {
|
|
39
29
|
case "load":
|
|
40
|
-
return
|
|
30
|
+
return createTrackingEvent(vpsProductLoad);
|
|
41
31
|
case "view":
|
|
42
|
-
return
|
|
32
|
+
return createTrackingEvent(vpsProductView);
|
|
43
33
|
case "click":
|
|
44
|
-
return
|
|
34
|
+
return createTrackingEvent(vpsProductClick);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
export const createResultVprEventByType = (type) => {
|
|
38
|
+
switch (type) {
|
|
39
|
+
case "load":
|
|
40
|
+
return createTrackingEvent(vprResultLoad);
|
|
41
|
+
case "view":
|
|
42
|
+
return createTrackingEvent(vprResultView);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
export const createResultVpcEventByType = (type) => {
|
|
46
|
+
switch (type) {
|
|
47
|
+
case "load":
|
|
48
|
+
return createTrackingEvent(vpcResultLoad);
|
|
49
|
+
case "view":
|
|
50
|
+
return createTrackingEvent(vpcResultView);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
export const createResultVpsEventByType = (type) => {
|
|
54
|
+
switch (type) {
|
|
55
|
+
case "load":
|
|
56
|
+
return createTrackingEvent(vpsResultLoad);
|
|
57
|
+
case "view":
|
|
58
|
+
return createTrackingEvent(vpsResultView);
|
|
45
59
|
}
|
|
46
60
|
};
|
|
47
61
|
export const createWidgetVprEvent = createTrackingEvent(vprWidget);
|
|
@@ -49,3 +63,5 @@ export const createWidgetVpsEvent = createTrackingEvent(vpsWidget);
|
|
|
49
63
|
export const createWidgetVpcEvent = createTrackingEvent(vpcWidget);
|
|
50
64
|
export const createSearchEvent = createTrackingEvent(searchEvent);
|
|
51
65
|
export const createFilterEvent = createTrackingEvent(filterEvent);
|
|
66
|
+
export const createAddToBasketVprEvent = createTrackingEvent(vprAddToBasket);
|
|
67
|
+
export const createAddToBasketVpcEvent = createTrackingEvent(vpcAddToBasket);
|
|
@@ -5,4 +5,6 @@ const ADD_TO_BASKET_EVENT_TYPE = "add_to_basket_event";
|
|
|
5
5
|
const FILTER_EVENT_TYPE = "filter_event";
|
|
6
6
|
const SEARCH_EVENT_TYPE = "search_event";
|
|
7
7
|
const WIDGET_EVENT_TYPE = "widget_event";
|
|
8
|
-
|
|
8
|
+
const RESULT_LOAD_EVENT_TYPE = "result_load_event";
|
|
9
|
+
const RESULT_VIEW_EVENT_TYPE = "result_view_event";
|
|
10
|
+
export { PRODUCT_LOAD_EVENT_TYPE, PRODUCT_VIEW_EVENT_TYPE, PRODUCT_CLICK_EVENT_TYPE, ADD_TO_BASKET_EVENT_TYPE, FILTER_EVENT_TYPE, SEARCH_EVENT_TYPE, WIDGET_EVENT_TYPE, RESULT_LOAD_EVENT_TYPE, RESULT_VIEW_EVENT_TYPE, };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { RESULT_LOAD_EVENT_TYPE, RESULT_VIEW_EVENT_TYPE, } from "./models";
|
|
2
|
+
const vprResultLoad = {
|
|
3
|
+
widget: "VPR",
|
|
4
|
+
typ: RESULT_LOAD_EVENT_TYPE,
|
|
5
|
+
};
|
|
6
|
+
const vprResultView = {
|
|
7
|
+
widget: "VPR",
|
|
8
|
+
typ: RESULT_VIEW_EVENT_TYPE,
|
|
9
|
+
};
|
|
10
|
+
const vpcResultLoad = {
|
|
11
|
+
widget: "VPC",
|
|
12
|
+
typ: RESULT_LOAD_EVENT_TYPE,
|
|
13
|
+
};
|
|
14
|
+
const vpcResultView = {
|
|
15
|
+
widget: "VPC",
|
|
16
|
+
typ: RESULT_VIEW_EVENT_TYPE,
|
|
17
|
+
};
|
|
18
|
+
const vpsResultLoad = {
|
|
19
|
+
widget: "VPS",
|
|
20
|
+
typ: RESULT_LOAD_EVENT_TYPE,
|
|
21
|
+
};
|
|
22
|
+
const vpsResultView = {
|
|
23
|
+
widget: "VPS",
|
|
24
|
+
typ: RESULT_VIEW_EVENT_TYPE,
|
|
25
|
+
};
|
|
26
|
+
export { vprResultLoad, vprResultView, vpcResultLoad, vpcResultView, vpsResultLoad, vpsResultView, };
|
|
@@ -3813,6 +3813,8 @@ const ADD_TO_BASKET_EVENT_TYPE = "add_to_basket_event";
|
|
|
3813
3813
|
const FILTER_EVENT_TYPE = "filter_event";
|
|
3814
3814
|
const SEARCH_EVENT_TYPE = "search_event";
|
|
3815
3815
|
const WIDGET_EVENT_TYPE = "widget_event";
|
|
3816
|
+
const RESULT_LOAD_EVENT_TYPE = "result_load_event";
|
|
3817
|
+
const RESULT_VIEW_EVENT_TYPE = "result_view_event";
|
|
3816
3818
|
|
|
3817
3819
|
const filterEvent = {
|
|
3818
3820
|
widget: "VPS",
|
|
@@ -3882,45 +3884,83 @@ const vpsWidget = {
|
|
|
3882
3884
|
typ: WIDGET_EVENT_TYPE,
|
|
3883
3885
|
};
|
|
3884
3886
|
|
|
3885
|
-
const
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
const
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
const
|
|
3894
|
-
|
|
3895
|
-
|
|
3887
|
+
const vprResultLoad = {
|
|
3888
|
+
widget: "VPR",
|
|
3889
|
+
typ: RESULT_LOAD_EVENT_TYPE,
|
|
3890
|
+
};
|
|
3891
|
+
const vprResultView = {
|
|
3892
|
+
widget: "VPR",
|
|
3893
|
+
typ: RESULT_VIEW_EVENT_TYPE,
|
|
3894
|
+
};
|
|
3895
|
+
const vpcResultLoad = {
|
|
3896
|
+
widget: "VPC",
|
|
3897
|
+
typ: RESULT_LOAD_EVENT_TYPE,
|
|
3898
|
+
};
|
|
3899
|
+
const vpcResultView = {
|
|
3900
|
+
widget: "VPC",
|
|
3901
|
+
typ: RESULT_VIEW_EVENT_TYPE,
|
|
3902
|
+
};
|
|
3903
|
+
const vpsResultLoad = {
|
|
3904
|
+
widget: "VPS",
|
|
3905
|
+
typ: RESULT_LOAD_EVENT_TYPE,
|
|
3906
|
+
};
|
|
3907
|
+
const vpsResultView = {
|
|
3908
|
+
widget: "VPS",
|
|
3909
|
+
typ: RESULT_VIEW_EVENT_TYPE,
|
|
3910
|
+
};
|
|
3911
|
+
|
|
3896
3912
|
const createProductVprEventByType = (type) => {
|
|
3897
3913
|
switch (type) {
|
|
3898
3914
|
case "load":
|
|
3899
|
-
return
|
|
3915
|
+
return createTrackingEvent(vprProductLoad);
|
|
3900
3916
|
case "view":
|
|
3901
|
-
return
|
|
3917
|
+
return createTrackingEvent(vprProductView);
|
|
3902
3918
|
case "click":
|
|
3903
|
-
return
|
|
3919
|
+
return createTrackingEvent(vprProductClick);
|
|
3904
3920
|
}
|
|
3905
3921
|
};
|
|
3906
3922
|
const createProductVpcEventByType = (type) => {
|
|
3907
3923
|
switch (type) {
|
|
3908
3924
|
case "load":
|
|
3909
|
-
return
|
|
3925
|
+
return createTrackingEvent(vpcProductLoad);
|
|
3910
3926
|
case "view":
|
|
3911
|
-
return
|
|
3927
|
+
return createTrackingEvent(vpcProductView);
|
|
3912
3928
|
case "click":
|
|
3913
|
-
return
|
|
3929
|
+
return createTrackingEvent(vpcProductClick);
|
|
3914
3930
|
}
|
|
3915
3931
|
};
|
|
3916
3932
|
const createProductVpsEventByType = (type) => {
|
|
3917
3933
|
switch (type) {
|
|
3918
3934
|
case "load":
|
|
3919
|
-
return
|
|
3935
|
+
return createTrackingEvent(vpsProductLoad);
|
|
3920
3936
|
case "view":
|
|
3921
|
-
return
|
|
3937
|
+
return createTrackingEvent(vpsProductView);
|
|
3922
3938
|
case "click":
|
|
3923
|
-
return
|
|
3939
|
+
return createTrackingEvent(vpsProductClick);
|
|
3940
|
+
}
|
|
3941
|
+
};
|
|
3942
|
+
const createResultVprEventByType = (type) => {
|
|
3943
|
+
switch (type) {
|
|
3944
|
+
case "load":
|
|
3945
|
+
return createTrackingEvent(vprResultLoad);
|
|
3946
|
+
case "view":
|
|
3947
|
+
return createTrackingEvent(vprResultView);
|
|
3948
|
+
}
|
|
3949
|
+
};
|
|
3950
|
+
const createResultVpcEventByType = (type) => {
|
|
3951
|
+
switch (type) {
|
|
3952
|
+
case "load":
|
|
3953
|
+
return createTrackingEvent(vpcResultLoad);
|
|
3954
|
+
case "view":
|
|
3955
|
+
return createTrackingEvent(vpcResultView);
|
|
3956
|
+
}
|
|
3957
|
+
};
|
|
3958
|
+
const createResultVpsEventByType = (type) => {
|
|
3959
|
+
switch (type) {
|
|
3960
|
+
case "load":
|
|
3961
|
+
return createTrackingEvent(vpsResultLoad);
|
|
3962
|
+
case "view":
|
|
3963
|
+
return createTrackingEvent(vpsResultView);
|
|
3924
3964
|
}
|
|
3925
3965
|
};
|
|
3926
3966
|
const createWidgetVprEvent = createTrackingEvent(vprWidget);
|
|
@@ -3928,5 +3968,7 @@ const createWidgetVpsEvent = createTrackingEvent(vpsWidget);
|
|
|
3928
3968
|
const createWidgetVpcEvent = createTrackingEvent(vpcWidget);
|
|
3929
3969
|
const createSearchEvent = createTrackingEvent(searchEvent);
|
|
3930
3970
|
const createFilterEvent = createTrackingEvent(filterEvent);
|
|
3971
|
+
const createAddToBasketVprEvent = createTrackingEvent(vprAddToBasket);
|
|
3972
|
+
const createAddToBasketVpcEvent = createTrackingEvent(vpcAddToBasket);
|
|
3931
3973
|
|
|
3932
|
-
export { createAddToBasketVpcEvent as a, createAddToBasketVprEvent as b, createTrackingApi as c, createWidgetVpcEvent as d, createWidgetVprEvent as e,
|
|
3974
|
+
export { createAddToBasketVpcEvent as a, createAddToBasketVprEvent as b, createTrackingApi as c, createWidgetVpcEvent as d, createWidgetVprEvent as e, createResultVpcEventByType as f, createResultVprEventByType as g, createProductVpcEventByType as h, createProductVprEventByType as i, createSearchEvent as j, createFilterEvent as k, createWidgetVpsEvent as l, createProductVpsEventByType as m, createResultVpsEventByType as n, v4 as v };
|
|
@@ -3,8 +3,8 @@ import { _ as _Array, O as Option, S as Semigroup, a as _function, h as has, t a
|
|
|
3
3
|
import { C as ChevronIcon } from './index-d1215e03.js';
|
|
4
4
|
import { i as instance } from './i18next-387f2b0a.js';
|
|
5
5
|
import { s as slotChangeListener, c as campaignTypeNames, f as fromString, a as fold, S as SlotSkeleton } from './customized-slots-136b5f71.js';
|
|
6
|
-
import { v as version } from './package-
|
|
7
|
-
import { v as v4, c as createTrackingApi, a as createAddToBasketVpcEvent, b as createAddToBasketVprEvent, d as createWidgetVpcEvent, e as createWidgetVprEvent, f as
|
|
6
|
+
import { v as version } from './package-59929481.js';
|
|
7
|
+
import { v as v4, c as createTrackingApi, a as createAddToBasketVpcEvent, b as createAddToBasketVprEvent, d as createWidgetVpcEvent, e as createWidgetVprEvent, f as createResultVpcEventByType, g as createResultVprEventByType, h as createProductVpcEventByType, i as createProductVprEventByType } from './index-53105ad4.js';
|
|
8
8
|
|
|
9
9
|
const vviinnCarouselCss = ":host{--vviinn-progressbar-width:0;--vviinn-carousel-item-width:150px;--vviinn-carousel-columns-internal:var(--vviinn-carousel-columns, 4);--vviinn-carousel-image-width-system:140px}.body{display:flex;position:relative;width:var(--vviinn-carousel-content-width);flex-direction:column}.content-wrapper *{box-sizing:border-box}.content-wrapper{overflow-y:hidden;overflow-x:auto;flex-grow:1}.bullets{margin-top:16px;display:flex;flex-direction:row;grid-gap:24px;justify-content:center}.bullet{width:10px;height:10px;background:#e0e0e0;border-radius:50%;cursor:pointer}.bullet.active{background:#161616}.content:not(.show-scrollbar),.content.grid{scrollbar-color:#fff0 #fff0}.content:not(.show-scrollbar)::-webkit-scrollbar,.content.grid::-webkit-scrollbar{opacity:0}.content{display:flex;flex-direction:row;grid-gap:8px;overflow-y:hidden;overflow-x:auto;flex-grow:1;padding-bottom:16px}.content.left>*{scroll-snap-align:start}.content.right>*{scroll-snap-align:end}:host(.continuity) button{border-radius:2px}:host(.grid) button{border-radius:50%}button{align-items:center;background-color:white;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);cursor:pointer;display:grid;height:40px;justify-items:center;position:absolute;top:calc(50% - 20px);width:40px;z-index:1;padding:0;margin:0}button{fill:#525252}button:disabled{display:none}button.prev svg{transform:rotate(180deg);margin-left:-5px}.prev{left:0}.next{right:0}.items-group{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--vviinn-carousel-columns-internal), 1fr);min-width:100%}vviinn-product-card::part(price-container){text-align:center}:host(.classic) vviinn-product-card::part(title),:host(.classic) vviinn-product-card::part(brand),:host(.classic) vviinn-product-card::part(type){text-align:center}@media (max-width: 480px){:host(.modern) button{display:none}.items-group{grid-template-columns:repeat(2, 1fr)}}";
|
|
10
10
|
|
|
@@ -1361,6 +1361,7 @@ const VviinnVprWidget = class {
|
|
|
1361
1361
|
if (!this.resultViewed) {
|
|
1362
1362
|
this.resultViewed = true;
|
|
1363
1363
|
this.vviinnResultView.emit(this.getBasicEventData());
|
|
1364
|
+
this.trackResultEvent("view");
|
|
1364
1365
|
}
|
|
1365
1366
|
const productViewEvent = this.getProductTrackEvent(detail, "view");
|
|
1366
1367
|
if (!productViewEvent)
|
|
@@ -1415,6 +1416,20 @@ const VviinnVprWidget = class {
|
|
|
1415
1416
|
}
|
|
1416
1417
|
this.trackingApi.trackEvent(widgetEvent).then(this.setTrackingDeactivated);
|
|
1417
1418
|
}
|
|
1419
|
+
trackResultEvent(type) {
|
|
1420
|
+
if (this.trackingDeactivated)
|
|
1421
|
+
return;
|
|
1422
|
+
const _a = this.getBasicEventData(), rest = __rest(_a, ["campaignTypeId", "widgetType"]);
|
|
1423
|
+
let resultEvent;
|
|
1424
|
+
const eventBody = Object.assign({ session_id: this.uiSessionId }, rest);
|
|
1425
|
+
if (this.campaignType === "VCS") {
|
|
1426
|
+
resultEvent = createResultVpcEventByType(type)(eventBody);
|
|
1427
|
+
}
|
|
1428
|
+
else if (this.campaignType === "VPR") {
|
|
1429
|
+
resultEvent = createResultVprEventByType(type)(eventBody);
|
|
1430
|
+
}
|
|
1431
|
+
this.trackingApi.trackEvent(resultEvent).then(this.setTrackingDeactivated);
|
|
1432
|
+
}
|
|
1418
1433
|
getProductTrackEvent(detail, eventType) {
|
|
1419
1434
|
if (this.trackingDeactivated)
|
|
1420
1435
|
return null;
|
|
@@ -1448,6 +1463,7 @@ const VviinnVprWidget = class {
|
|
|
1448
1463
|
handleRecommendationsSuccess(data) {
|
|
1449
1464
|
var _a;
|
|
1450
1465
|
this.vviinnResultLoad.emit(this.getBasicEventData());
|
|
1466
|
+
this.trackResultEvent("load");
|
|
1451
1467
|
this.recommendations = (_a = data === null || data === void 0 ? void 0 : data.extended) !== null && _a !== void 0 ? _a : data;
|
|
1452
1468
|
imageSearchState.results = this.recommendations;
|
|
1453
1469
|
this.productIds = this.recommendations.map((r) => r.productId);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-1f3eaf12.js';
|
|
2
|
-
import { v as version } from './package-
|
|
2
|
+
import { v as version } from './package-59929481.js';
|
|
3
3
|
import { V as VisualSearchIcon } from './index-d1215e03.js';
|
|
4
4
|
|
|
5
5
|
const vviinnVprButtonCss = ":host{display:block}";
|