vviinn-widgets 2.3.1 → 2.4.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/{app-globals-6b5da080.js → app-globals-d999d944.js} +1 -1
- package/dist/cjs/{highlight-box_22.cjs.entry.js → cropper-handler_27.cjs.entry.js} +486 -92
- package/dist/cjs/{customized-slots-8bc78ad4.js → customized-slots-90e8e849.js} +1 -1
- package/dist/cjs/{index-5b9a60ac.js → index-53400160.js} +1 -1
- package/dist/cjs/{imageSearch.store-042e9f45.js → index-c0d08aca.js} +15288 -11038
- package/dist/cjs/{index-553c2b4f.js → index-e8cf5dc5.js} +1 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{vviinn-carousel_3.cjs.entry.js → vviinn-carousel_2.cjs.entry.js} +50 -206
- package/dist/cjs/vviinn-recommendations-sidebar.cjs.entry.js +2 -2
- package/dist/cjs/vviinn-vpr-button.cjs.entry.js +2 -2
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +3 -3
- package/dist/cjs/vviinn-widgets.cjs.js +3 -3
- package/dist/collection/components/image-search/image-view/image-cropper/image-cropper.js +27 -7
- package/dist/collection/components/image-search/search-filters/search-filters.js +24 -1
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.js +3 -3
- package/dist/collection/components/vviinn-example-images/vviinn-example-images.js +4 -4
- package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.js +18 -1
- package/dist/collection/components/vviinn-product-card/vviinn-product-card.js +57 -12
- package/dist/collection/components/vviinn-vpr-widget/stories/args.js +8 -8
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +46 -10
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-widget.css +5 -0
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +106 -10
- package/dist/collection/network/utils.js +1 -1
- package/dist/collection/openApi/index.js +27 -0
- package/dist/collection/{components/vviinn-vpr-widget/GridMode.js → recommendation/events.js} +0 -0
- package/dist/collection/store/store.js +7 -9
- package/dist/collection/store/tracking.store.js +3 -0
- package/dist/collection/tracking/event.js +3 -0
- package/dist/collection/tracking/filter.js +5 -0
- package/dist/collection/tracking/index.js +13 -0
- package/dist/collection/tracking/models.js +6 -0
- package/dist/collection/tracking/product.js +18 -0
- package/dist/collection/tracking/search.js +5 -0
- package/dist/collection/tracking/widget.js +10 -0
- package/dist/esm/{app-globals-90d99f95.js → app-globals-f91c6f94.js} +1 -1
- package/dist/esm/{highlight-box_22.entry.js → cropper-handler_27.entry.js} +417 -28
- package/dist/esm/{customized-slots-65b2467d.js → customized-slots-7be7f3b8.js} +1 -1
- package/dist/esm/{index-ac2e3b9d.js → index-00c7b7c2.js} +2 -2
- package/dist/esm/{imageSearch.store-f35e14f8.js → index-840ec915.js} +15232 -10993
- package/dist/esm/{index-d7c7df1c.js → index-d7147986.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{vviinn-carousel_3.entry.js → vviinn-carousel_2.entry.js} +42 -197
- package/dist/esm/vviinn-recommendations-sidebar.entry.js +2 -2
- package/dist/esm/vviinn-vpr-button.entry.js +2 -2
- package/dist/esm/vviinn-vps-button.entry.js +3 -3
- package/dist/esm/vviinn-widgets.js +3 -3
- package/dist/types/Image/error.d.ts +1 -0
- package/dist/types/Image/form.d.ts +1 -0
- package/dist/types/Image/fromFile.d.ts +1 -0
- package/dist/types/Image/imageToB64.d.ts +1 -0
- package/dist/types/Image/index.d.ts +1 -0
- package/dist/types/Image/renderPromise.d.ts +1 -0
- package/dist/types/Image/resizeImage.d.ts +1 -0
- package/dist/types/Image/sizing.d.ts +1 -0
- package/dist/types/Image/toFile.d.ts +1 -0
- package/dist/types/analytics/GAnalytics.d.ts +1 -0
- package/dist/types/analytics/GeneralAnalytics.d.ts +1 -0
- package/dist/types/analytics/GtagAnalytics.d.ts +1 -0
- package/dist/types/analytics/ProductAnalytics.d.ts +1 -0
- package/dist/types/campaign/Campaign.d.ts +1 -0
- package/dist/types/campaign/CampaignService.d.ts +1 -0
- package/dist/types/campaign/VCSCampaign.d.ts +1 -0
- package/dist/types/campaign/VCSCampaignResponse.d.ts +1 -0
- package/dist/types/campaign/VCSCampaignService.d.ts +1 -0
- package/dist/types/campaign/VPRCampaignResponse.d.ts +1 -0
- package/dist/types/campaign/VPRCampaignService.d.ts +1 -0
- package/dist/types/components/customized-slots.d.ts +1 -0
- package/dist/types/components/image-search/image-view/highlight-box/highlight-box.d.ts +1 -0
- package/dist/types/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.d.ts +1 -0
- package/dist/types/components/image-search/image-view/image-cropper/image-cropper.d.ts +4 -0
- package/dist/types/components/image-search/search-filters/search-filters.d.ts +4 -0
- package/dist/types/components/vviinn-carousel/vviinn-carousel.d.ts +1 -0
- package/dist/types/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.d.ts +1 -0
- package/dist/types/components/vviinn-error/vviinn-error.d.ts +1 -0
- package/dist/types/components/vviinn-error/vviinn-server-error/vviinn-server-error.d.ts +1 -0
- package/dist/types/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.d.ts +1 -0
- package/dist/types/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.d.ts +1 -0
- package/dist/types/components/vviinn-example-images/vviinn-example-images.d.ts +1 -0
- package/dist/types/components/vviinn-icons/index.d.ts +1 -0
- package/dist/types/components/vviinn-image-selector/vviinn-image-selector.d.ts +1 -0
- package/dist/types/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.d.ts +3 -0
- package/dist/types/components/vviinn-image-view/vviinn-image-view.d.ts +1 -0
- package/dist/types/components/vviinn-modal/vviinn-modal.d.ts +1 -0
- package/dist/types/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-1/vviinn-onboarding-card-1.d.ts +1 -0
- package/dist/types/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-2/vviinn-onboarding-card-2.d.ts +1 -0
- package/dist/types/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-3/vviinn-onboarding-card-3.d.ts +1 -0
- package/dist/types/components/vviinn-onboarding/vviinn-onboarding.d.ts +1 -0
- package/dist/types/components/vviinn-overlay/vviinn-overlay.d.ts +1 -0
- package/dist/types/components/vviinn-overlayed-modal/vviinn-overlayed-modal.d.ts +1 -0
- package/dist/types/components/vviinn-preloader/vviinn-preloader.d.ts +1 -0
- package/dist/types/components/vviinn-privacy-badge/vviinn-privacy-badge.d.ts +1 -0
- package/dist/types/components/vviinn-product-card/render-helpers.d.ts +1 -0
- package/dist/types/components/vviinn-product-card/stories/args.d.ts +1 -0
- package/dist/types/components/vviinn-product-card/stories/decorators.d.ts +1 -0
- package/dist/types/components/vviinn-product-card/stories/vviinn-product-card.stories.d.ts +1 -0
- package/dist/types/components/vviinn-product-card/vviinn-product-card.d.ts +9 -3
- package/dist/types/components/vviinn-slider/arrow.d.ts +1 -0
- package/dist/types/components/vviinn-slider/vviinn-slide/vviinn-slide.d.ts +1 -0
- package/dist/types/components/vviinn-slider/vviinn-slider.d.ts +1 -0
- package/dist/types/components/vviinn-teaser/vviinn-teaser.d.ts +1 -0
- package/dist/types/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.d.ts +1 -0
- package/dist/types/components/vviinn-vpr-button/stories/args.d.ts +1 -0
- package/dist/types/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.d.ts +1 -0
- package/dist/types/components/vviinn-vpr-button/vviinn-vpr-button.d.ts +1 -0
- package/dist/types/components/vviinn-vpr-widget/stories/args.d.ts +1 -0
- package/dist/types/components/vviinn-vpr-widget/stories/decorators.d.ts +1 -0
- package/dist/types/components/vviinn-vpr-widget/stories/vviinn-vpr-widget.stories.d.ts +1 -0
- package/dist/types/components/vviinn-vpr-widget/token-helpers.d.ts +1 -0
- package/dist/types/components/vviinn-vpr-widget/vviinn-vpr-vidget.d.ts +9 -1
- package/dist/types/components/vviinn-vps-button/stories/vviinn-vps-button.stories.d.ts +1 -0
- package/dist/types/components/vviinn-vps-button/vviinn-vps-button.d.ts +1 -0
- package/dist/types/components/vviinn-vps-widget/stories/vviinn-vps-widget.stories.d.ts +1 -0
- package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +13 -1
- package/dist/types/components.d.ts +10 -4
- package/dist/types/cropper/Cropper.d.ts +1 -0
- package/dist/types/cropper/Handler.d.ts +1 -0
- package/dist/types/dom/index.d.ts +1 -0
- package/dist/types/error.d.ts +1 -0
- package/dist/types/file/index.d.ts +1 -0
- package/dist/types/geometry/Clip.d.ts +1 -0
- package/dist/types/geometry/Point.d.ts +1 -0
- package/dist/types/geometry/Rectangle.d.ts +1 -0
- package/dist/types/geometry/RectangleAlt.d.ts +1 -0
- package/dist/types/geometry/Sized.d.ts +1 -0
- package/dist/types/global.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/interfaces/generated.d.ts +1 -0
- package/dist/types/interfaces/recommendation.d.ts +1 -0
- package/dist/types/network/apiClient.d.ts +1 -0
- package/dist/types/network/ion/File.d.ts +1 -0
- package/dist/types/network/ion/Form.d.ts +1 -0
- package/dist/types/network/ion/Link.d.ts +1 -0
- package/dist/types/network/ion/ValueObject.d.ts +1 -0
- package/dist/types/network/request.d.ts +1 -0
- package/dist/types/network/utils.d.ts +1 -0
- package/dist/types/openApi/index.d.ts +6 -0
- package/dist/types/recommendation/events.d.ts +6 -0
- package/dist/types/recommendation/recommendation.d.ts +1 -0
- package/dist/types/searchSession/searchSession.d.ts +1 -0
- package/dist/types/sentry.d.ts +1 -0
- package/dist/types/slider/GridMode.d.ts +1 -0
- package/dist/types/store/file-processing.d.ts +1 -0
- package/dist/types/store/imageSearch.store.d.ts +1 -0
- package/dist/types/store/store.d.ts +8 -6
- package/dist/types/store/tracking.store.d.ts +4 -0
- package/dist/types/stories/image-selector.stories.d.ts +1 -0
- package/dist/types/stories/image-view.stories.d.ts +1 -0
- package/dist/types/stories/modal.stories.d.ts +1 -0
- package/dist/types/stories/onboarding.stories.d.ts +1 -0
- package/dist/types/stories/overlay.stories.d.ts +1 -0
- package/dist/types/stories/overlayedModal.stories.d.ts +1 -0
- package/dist/types/stories/privacy-badge.stories.d.ts +1 -0
- package/dist/types/stories/slider.stories.d.ts +1 -0
- package/dist/types/stories/teaser.stories.d.ts +1 -0
- package/dist/types/stories/vps-widget.stories.d.ts +1 -0
- package/dist/types/stories/vviinn-product.stories.d.ts +1 -0
- package/dist/types/tracking/event.d.ts +4 -0
- package/dist/types/tracking/filter.d.ts +3 -0
- package/dist/types/tracking/index.d.ts +9 -0
- package/dist/types/tracking/models.d.ts +13 -0
- package/dist/types/tracking/product.d.ts +7 -0
- package/dist/types/tracking/search.d.ts +3 -0
- package/dist/types/tracking/widget.d.ts +5 -0
- package/dist/types/utils/collections/collectionsUtils.d.ts +1 -0
- package/dist/types/utils/either.d.ts +1 -0
- package/dist/types/utils/enum/enumUtils.d.ts +1 -0
- package/dist/types/utils/event/Events.d.ts +1 -0
- package/dist/types/utils/number/index.d.ts +1 -0
- package/dist/types/utils/option/option.d.ts +1 -0
- package/dist/types/utils/semigroup/semigroupDiff.d.ts +1 -0
- package/dist/types/utils/token/tokenUtils.d.ts +1 -0
- package/dist/vviinn-widgets/{p-e362fa80.entry.js → p-07d8ba79.entry.js} +1 -1
- package/dist/vviinn-widgets/p-196479f9.js +1 -0
- package/dist/vviinn-widgets/{p-a5b69a48.entry.js → p-2d4cb17f.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-679ea2ce.js → p-7d5af04d.js} +1 -1
- package/dist/vviinn-widgets/{p-4530ca32.entry.js → p-9c7297c8.entry.js} +1 -1
- package/{www/build/p-55491d9b.js → dist/vviinn-widgets/p-a66512b2.js} +1 -1
- package/dist/vviinn-widgets/p-ae524f97.entry.js +1 -0
- package/{www/build/p-e882fbeb.js → dist/vviinn-widgets/p-ce96f232.js} +1 -1
- package/dist/vviinn-widgets/{p-b4b46a70.js → p-dc2da207.js} +1 -1
- package/dist/vviinn-widgets/p-fce4183d.entry.js +1 -0
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +11 -3
- package/www/build/{p-e362fa80.entry.js → p-07d8ba79.entry.js} +1 -1
- package/www/build/p-196479f9.js +1 -0
- package/www/build/{p-a5b69a48.entry.js → p-2d4cb17f.entry.js} +1 -1
- package/www/build/p-32bb0615.js +1 -0
- package/www/build/{p-679ea2ce.js → p-7d5af04d.js} +1 -1
- package/www/build/{p-4530ca32.entry.js → p-9c7297c8.entry.js} +1 -1
- package/{dist/vviinn-widgets/p-55491d9b.js → www/build/p-a66512b2.js} +1 -1
- package/www/build/p-ae524f97.entry.js +1 -0
- package/{dist/vviinn-widgets/p-e882fbeb.js → www/build/p-ce96f232.js} +1 -1
- package/www/build/{p-b4b46a70.js → p-dc2da207.js} +1 -1
- package/www/build/p-fce4183d.entry.js +1 -0
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +1 -107
- package/dist/cjs/Handler-d1a8a86a.js +0 -329
- package/dist/cjs/cropper-handler.cjs.entry.js +0 -27
- package/dist/cjs/vviinn-error.cjs.entry.js +0 -19
- package/dist/cjs/vviinn-preloader.cjs.entry.js +0 -26
- package/dist/cjs/vviinn-vps-widget.cjs.entry.js +0 -97
- package/dist/esm/Handler-639a4cb3.js +0 -308
- package/dist/esm/cropper-handler.entry.js +0 -23
- package/dist/esm/vviinn-error.entry.js +0 -15
- package/dist/esm/vviinn-preloader.entry.js +0 -22
- package/dist/esm/vviinn-vps-widget.entry.js +0 -93
- package/dist/types/components/vviinn-vpr-widget/GridMode.d.ts +0 -1
- package/dist/vviinn-widgets/p-1c141479.entry.js +0 -1
- package/dist/vviinn-widgets/p-320844ea.entry.js +0 -1
- package/dist/vviinn-widgets/p-6239a782.entry.js +0 -1
- package/dist/vviinn-widgets/p-757849fd.entry.js +0 -1
- package/dist/vviinn-widgets/p-80f0d4e0.js +0 -1
- package/dist/vviinn-widgets/p-935b4f49.entry.js +0 -1
- package/dist/vviinn-widgets/p-b0243e84.entry.js +0 -1
- package/dist/vviinn-widgets/p-f582db5c.js +0 -1
- package/www/build/p-1c141479.entry.js +0 -1
- package/www/build/p-320844ea.entry.js +0 -1
- package/www/build/p-4379b1c2.js +0 -1
- package/www/build/p-6239a782.entry.js +0 -1
- package/www/build/p-757849fd.entry.js +0 -1
- package/www/build/p-80f0d4e0.js +0 -1
- package/www/build/p-935b4f49.entry.js +0 -1
- package/www/build/p-b0243e84.entry.js +0 -1
- package/www/build/p-f582db5c.js +0 -1
|
@@ -16,13 +16,13 @@ export class VviinnExampleImages {
|
|
|
16
16
|
h("h3", null, "Mit den Beispielbildern die Suche direkt ausprobieren")),
|
|
17
17
|
h("div", { class: "images" },
|
|
18
18
|
h("slot", { name: "vviinn-example-images-1" },
|
|
19
|
-
h("vviinn-example-image", { width:
|
|
19
|
+
h("vviinn-example-image", { width: 480, height: 640, src: "https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDEtTC5qcGc=" })),
|
|
20
20
|
h("slot", { name: "vviinn-example-images-2" },
|
|
21
|
-
h("vviinn-example-image", { width:
|
|
21
|
+
h("vviinn-example-image", { width: 280, height: 480, src: "https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDItTS5qcGc=" })),
|
|
22
22
|
h("slot", { name: "vviinn-example-images-3" },
|
|
23
|
-
h("vviinn-example-image", { width:
|
|
23
|
+
h("vviinn-example-image", { width: 280, height: 480, src: "https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDMtTS5qcGc=" })),
|
|
24
24
|
h("slot", { name: "vviinn-example-images-4" },
|
|
25
|
-
h("vviinn-example-image", { width:
|
|
25
|
+
h("vviinn-example-image", { width: 480, height: 640, src: "https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDQtTC5qcGc=" })))));
|
|
26
26
|
}
|
|
27
27
|
static get is() { return "vviinn-example-images"; }
|
|
28
28
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Host, h, State, Prop } from "@stencil/core";
|
|
1
|
+
import { Component, Host, h, State, Prop, Event } from "@stencil/core";
|
|
2
2
|
import { pipe } from "fp-ts/lib/function";
|
|
3
3
|
import * as O from "fp-ts/lib/Option";
|
|
4
4
|
import { foldValueObject } from "../../../network/ion/ValueObject";
|
|
@@ -25,6 +25,7 @@ export class VviinnDetectedObject {
|
|
|
25
25
|
imageSearchState.searchArea = O.some(scaledRect);
|
|
26
26
|
}));
|
|
27
27
|
makeRectangularSearchRequest();
|
|
28
|
+
this.detectedObjectClicked.emit();
|
|
28
29
|
}
|
|
29
30
|
isActive() {
|
|
30
31
|
if (!this.detectedObject)
|
|
@@ -80,4 +81,20 @@ export class VviinnDetectedObject {
|
|
|
80
81
|
static get states() { return {
|
|
81
82
|
"position": {}
|
|
82
83
|
}; }
|
|
84
|
+
static get events() { return [{
|
|
85
|
+
"method": "detectedObjectClicked",
|
|
86
|
+
"name": "detectedObjectClicked",
|
|
87
|
+
"bubbles": true,
|
|
88
|
+
"cancelable": true,
|
|
89
|
+
"composed": true,
|
|
90
|
+
"docs": {
|
|
91
|
+
"tags": [],
|
|
92
|
+
"text": ""
|
|
93
|
+
},
|
|
94
|
+
"complexType": {
|
|
95
|
+
"original": "any",
|
|
96
|
+
"resolved": "any",
|
|
97
|
+
"references": {}
|
|
98
|
+
}
|
|
99
|
+
}]; }
|
|
83
100
|
}
|
|
@@ -28,22 +28,31 @@ export class VviinnProductCard {
|
|
|
28
28
|
this.pricePrefix = undefined;
|
|
29
29
|
this.responsive = false;
|
|
30
30
|
this.dimmedBackground = false;
|
|
31
|
+
/** @internal */
|
|
32
|
+
this.index = 0;
|
|
31
33
|
this.imageLoaded = false;
|
|
34
|
+
this.productData = null;
|
|
32
35
|
this.intersectionObserver = new IntersectionObserver(this.intersectionCallback.bind(this), { threshold: 1.0 });
|
|
33
36
|
}
|
|
37
|
+
connectedCallback() {
|
|
38
|
+
this.productData = {
|
|
39
|
+
product: this.productId,
|
|
40
|
+
rank: this.index
|
|
41
|
+
};
|
|
42
|
+
}
|
|
34
43
|
intersectionCallback(data) {
|
|
35
44
|
if (data.some((entry) => entry.isIntersecting)) {
|
|
36
45
|
pipe(getAnalyticsModule, O.map((analytics) => analytics.sendImpression(this.getProduct())));
|
|
37
|
-
this.recommendationView.emit(this.
|
|
46
|
+
this.recommendationView.emit(this.productData);
|
|
38
47
|
this.intersectionObserver.disconnect();
|
|
39
48
|
}
|
|
40
49
|
}
|
|
41
50
|
componentDidLoad() {
|
|
42
|
-
this.recommendationLoad.emit(this.
|
|
51
|
+
this.recommendationLoad.emit(this.productData);
|
|
43
52
|
this.intersectionObserver.observe(this.el);
|
|
44
53
|
const links = this.el.shadowRoot.querySelectorAll("a");
|
|
45
54
|
links.forEach((link) => link.addEventListener("mousedown", (event) => {
|
|
46
|
-
this.recommendationClick.emit(this.
|
|
55
|
+
this.recommendationClick.emit(this.productData);
|
|
47
56
|
if (window.ga) {
|
|
48
57
|
event.preventDefault();
|
|
49
58
|
}
|
|
@@ -355,6 +364,27 @@ export class VviinnProductCard {
|
|
|
355
364
|
"attribute": "dimmed-background",
|
|
356
365
|
"reflect": false,
|
|
357
366
|
"defaultValue": "false"
|
|
367
|
+
},
|
|
368
|
+
"index": {
|
|
369
|
+
"type": "number",
|
|
370
|
+
"mutable": false,
|
|
371
|
+
"complexType": {
|
|
372
|
+
"original": "number",
|
|
373
|
+
"resolved": "number",
|
|
374
|
+
"references": {}
|
|
375
|
+
},
|
|
376
|
+
"required": false,
|
|
377
|
+
"optional": false,
|
|
378
|
+
"docs": {
|
|
379
|
+
"tags": [{
|
|
380
|
+
"text": undefined,
|
|
381
|
+
"name": "internal"
|
|
382
|
+
}],
|
|
383
|
+
"text": ""
|
|
384
|
+
},
|
|
385
|
+
"attribute": "index",
|
|
386
|
+
"reflect": false,
|
|
387
|
+
"defaultValue": "0"
|
|
358
388
|
}
|
|
359
389
|
}; }
|
|
360
390
|
static get states() { return {
|
|
@@ -371,9 +401,14 @@ export class VviinnProductCard {
|
|
|
371
401
|
"text": "Event fires ones when recommendation rendered on page"
|
|
372
402
|
},
|
|
373
403
|
"complexType": {
|
|
374
|
-
"original": "
|
|
375
|
-
"resolved": "string",
|
|
376
|
-
"references": {
|
|
404
|
+
"original": "ProductCardEventData",
|
|
405
|
+
"resolved": "{ product: string; rank: number; }",
|
|
406
|
+
"references": {
|
|
407
|
+
"ProductCardEventData": {
|
|
408
|
+
"location": "import",
|
|
409
|
+
"path": "../../recommendation/events"
|
|
410
|
+
}
|
|
411
|
+
}
|
|
377
412
|
}
|
|
378
413
|
}, {
|
|
379
414
|
"method": "recommendationView",
|
|
@@ -386,9 +421,14 @@ export class VviinnProductCard {
|
|
|
386
421
|
"text": "Event fires ones when recommendation appears on the viewport"
|
|
387
422
|
},
|
|
388
423
|
"complexType": {
|
|
389
|
-
"original": "
|
|
390
|
-
"resolved": "string",
|
|
391
|
-
"references": {
|
|
424
|
+
"original": "ProductCardEventData",
|
|
425
|
+
"resolved": "{ product: string; rank: number; }",
|
|
426
|
+
"references": {
|
|
427
|
+
"ProductCardEventData": {
|
|
428
|
+
"location": "import",
|
|
429
|
+
"path": "../../recommendation/events"
|
|
430
|
+
}
|
|
431
|
+
}
|
|
392
432
|
}
|
|
393
433
|
}, {
|
|
394
434
|
"method": "recommendationClick",
|
|
@@ -401,9 +441,14 @@ export class VviinnProductCard {
|
|
|
401
441
|
"text": "Event fires ones when user click on deeplink"
|
|
402
442
|
},
|
|
403
443
|
"complexType": {
|
|
404
|
-
"original": "
|
|
405
|
-
"resolved": "string",
|
|
406
|
-
"references": {
|
|
444
|
+
"original": "ProductCardEventData",
|
|
445
|
+
"resolved": "{ product: string; rank: number; }",
|
|
446
|
+
"references": {
|
|
447
|
+
"ProductCardEventData": {
|
|
448
|
+
"location": "import",
|
|
449
|
+
"path": "../../recommendation/events"
|
|
450
|
+
}
|
|
451
|
+
}
|
|
407
452
|
}
|
|
408
453
|
}, {
|
|
409
454
|
"method": "productImageLoaded",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const apiPath = {
|
|
2
|
-
name: "
|
|
2
|
+
name: "api-path",
|
|
3
3
|
control: {
|
|
4
4
|
type: "text",
|
|
5
5
|
},
|
|
@@ -8,19 +8,19 @@ export const apiPath = {
|
|
|
8
8
|
},
|
|
9
9
|
};
|
|
10
10
|
const token = {
|
|
11
|
-
name: "
|
|
11
|
+
name: "token",
|
|
12
12
|
control: {
|
|
13
13
|
type: "text",
|
|
14
14
|
},
|
|
15
15
|
};
|
|
16
16
|
const productId = {
|
|
17
|
-
name: "
|
|
17
|
+
name: "product-id",
|
|
18
18
|
control: {
|
|
19
19
|
type: "text",
|
|
20
20
|
},
|
|
21
21
|
};
|
|
22
22
|
const cssUrl = {
|
|
23
|
-
name: "
|
|
23
|
+
name: "css-url",
|
|
24
24
|
description: "Optional for custom CSS. It will overwrite all other settings.",
|
|
25
25
|
control: {
|
|
26
26
|
type: "text",
|
|
@@ -36,7 +36,7 @@ const analyticsId = {
|
|
|
36
36
|
required: false,
|
|
37
37
|
};
|
|
38
38
|
export const campaignType = {
|
|
39
|
-
name: "
|
|
39
|
+
name: "campaign-type",
|
|
40
40
|
control: {
|
|
41
41
|
type: "select",
|
|
42
42
|
labels: {
|
|
@@ -57,7 +57,7 @@ const showTitle = {
|
|
|
57
57
|
required: false,
|
|
58
58
|
};
|
|
59
59
|
const titleName = {
|
|
60
|
-
name: "
|
|
60
|
+
name: "block-title",
|
|
61
61
|
control: {
|
|
62
62
|
type: "text",
|
|
63
63
|
},
|
|
@@ -74,7 +74,7 @@ const titleFontSize = {
|
|
|
74
74
|
required: false,
|
|
75
75
|
};
|
|
76
76
|
const showScrollbars = {
|
|
77
|
-
name: "
|
|
77
|
+
name: "show-scroll",
|
|
78
78
|
description: "Add browser default horizontal scroll bar (in continuity mode) or pagination bullets (in grid mode) to add extra cue for users ",
|
|
79
79
|
control: {
|
|
80
80
|
type: "boolean",
|
|
@@ -82,7 +82,7 @@ const showScrollbars = {
|
|
|
82
82
|
required: false,
|
|
83
83
|
};
|
|
84
84
|
const imageWidth = {
|
|
85
|
-
name: "
|
|
85
|
+
name: "image-width",
|
|
86
86
|
control: {
|
|
87
87
|
type: "number",
|
|
88
88
|
},
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { Component, Host, h, Prop, State, Element, Watch, Event, Listen } from "@stencil/core";
|
|
1
|
+
import { Component, Host, h, Prop, State, Element, Watch, Event, Listen, } from "@stencil/core";
|
|
2
2
|
import { pipe } from "fp-ts/lib/function";
|
|
3
3
|
import * as TE from "fp-ts/lib/TaskEither";
|
|
4
4
|
import * as E from "fp-ts/lib/Either";
|
|
5
5
|
import { createBearAuthedHeader } from "./token-helpers";
|
|
6
|
-
import state from "../../store/store";
|
|
6
|
+
import { state } from "../../store/store";
|
|
7
7
|
import { getRecommendationsService } from "../../campaign/CampaignService";
|
|
8
8
|
import { imageSearchState } from "../../store/imageSearch.store";
|
|
9
9
|
import { Subject } from "rxjs";
|
|
10
|
+
import { v4 as uuidv4 } from "uuid";
|
|
11
|
+
import { createTrackingApi } from "../../openApi";
|
|
12
|
+
import { createProductViewVprEvent, createWidgetVprEvent, } from "../../tracking";
|
|
10
13
|
/**
|
|
11
14
|
* @part product-card - product card itself
|
|
12
15
|
* @part title - title inside product card
|
|
@@ -58,13 +61,35 @@ export class VviinnVprWidget {
|
|
|
58
61
|
state.apiPath = newPath;
|
|
59
62
|
this.getRecommendations();
|
|
60
63
|
}
|
|
61
|
-
|
|
64
|
+
handleImageLoading({ detail }) {
|
|
62
65
|
this.productImageLoadedSubject.next(detail);
|
|
63
66
|
}
|
|
67
|
+
trackRecommendationView({ detail }) {
|
|
68
|
+
const recommendationViewEvent = createProductViewVprEvent(Object.assign({ session_id: this.uiSessionId }, detail));
|
|
69
|
+
this.trackingApi.trackEvent(recommendationViewEvent);
|
|
70
|
+
}
|
|
71
|
+
trackRecommendationClick({ detail }) {
|
|
72
|
+
const recommendationClickEvent = createProductViewVprEvent(Object.assign({ session_id: this.uiSessionId }, detail));
|
|
73
|
+
this.trackingApi.trackEvent(recommendationClickEvent);
|
|
74
|
+
}
|
|
64
75
|
connectedCallback() {
|
|
65
76
|
state.apiPath = this.apiPath;
|
|
66
77
|
state.currencySign = this.currencySign;
|
|
67
78
|
state.locale = this.locale;
|
|
79
|
+
this.uiSessionId = uuidv4();
|
|
80
|
+
this.trackingApi = createTrackingApi(this.apiPath, this.token);
|
|
81
|
+
const widgetOpenEvent = createWidgetVprEvent({
|
|
82
|
+
action: "open",
|
|
83
|
+
session_id: this.uiSessionId,
|
|
84
|
+
});
|
|
85
|
+
this.trackingApi.trackEvent(widgetOpenEvent);
|
|
86
|
+
}
|
|
87
|
+
disconnectedCallback() {
|
|
88
|
+
const widgetCloseEvent = createWidgetVprEvent({
|
|
89
|
+
action: "close",
|
|
90
|
+
session_id: this.uiSessionId,
|
|
91
|
+
});
|
|
92
|
+
this.trackingApi.trackEvent(widgetCloseEvent);
|
|
68
93
|
}
|
|
69
94
|
async componentWillLoad() {
|
|
70
95
|
state.pricePrefix = this.pricePrefix;
|
|
@@ -88,10 +113,9 @@ export class VviinnVprWidget {
|
|
|
88
113
|
this.recommendations = (_a = data === null || data === void 0 ? void 0 : data.extended) !== null && _a !== void 0 ? _a : data;
|
|
89
114
|
imageSearchState.results = this.recommendations;
|
|
90
115
|
this.loaded = true;
|
|
91
|
-
|
|
92
|
-
this.productIds = this.recommendations.map(r => r.productId);
|
|
116
|
+
this.productIds = this.recommendations.map((r) => r.productId);
|
|
93
117
|
this.productImageLoadedSubject.subscribe((id) => {
|
|
94
|
-
this.productIds = this.productIds.filter(x => x !== id);
|
|
118
|
+
this.productIds = this.productIds.filter((x) => x !== id);
|
|
95
119
|
if (this.productIds.length === 0) {
|
|
96
120
|
this.recommendationsLoaded.emit();
|
|
97
121
|
}
|
|
@@ -114,14 +138,14 @@ export class VviinnVprWidget {
|
|
|
114
138
|
h("h2", { part: "recommendations-title" }, this.blockTitle),
|
|
115
139
|
this.useCarousel ? this.renderCarousel() : this.renderResults()));
|
|
116
140
|
}
|
|
117
|
-
renderRecommendation(recommendation) {
|
|
118
|
-
return (h("vviinn-product-card", { part: "product-part", productId: recommendation.productId, productTitle: recommendation.title, deeplink: recommendation.deeplink, image: recommendation.image.thumbnail, brand: recommendation.brand, imageWidth: this.imageWidth, imageRatio: 1, price: recommendation.price.actual, salePrice: recommendation.price.sale, responsive: this.mode === "grid", dimmedBackground: this.useDimmedBackgroundInCard() }));
|
|
141
|
+
renderRecommendation(recommendation, index) {
|
|
142
|
+
return (h("vviinn-product-card", { part: "product-part", productId: recommendation.productId, productTitle: recommendation.title, deeplink: recommendation.deeplink, image: recommendation.image.thumbnail, brand: recommendation.brand, imageWidth: this.imageWidth, imageRatio: 1, price: recommendation.price.actual, salePrice: recommendation.price.sale, responsive: this.mode === "grid", dimmedBackground: this.useDimmedBackgroundInCard(), index: index }));
|
|
119
143
|
}
|
|
120
144
|
useDimmedBackgroundInCard() {
|
|
121
145
|
return this.mode === "continuity" || !this.useCarousel;
|
|
122
146
|
}
|
|
123
147
|
renderResults() {
|
|
124
|
-
return (h("div", { class: "recommendations-grid", part: "recommendations-grid" }, this.recommendations.map((r) => this.renderRecommendation(r))));
|
|
148
|
+
return (h("div", { class: "recommendations-grid", part: "recommendations-grid" }, this.recommendations.map((r, i) => this.renderRecommendation(r, i))));
|
|
125
149
|
}
|
|
126
150
|
renderCarousel() {
|
|
127
151
|
return (h("vviinn-carousel", { mode: this.mode, imageWidth: this.imageWidth, showScroll: this.showScroll, recommendations: this.recommendations }));
|
|
@@ -434,7 +458,19 @@ export class VviinnVprWidget {
|
|
|
434
458
|
}]; }
|
|
435
459
|
static get listeners() { return [{
|
|
436
460
|
"name": "productImageLoaded",
|
|
437
|
-
"method": "
|
|
461
|
+
"method": "handleImageLoading",
|
|
462
|
+
"target": undefined,
|
|
463
|
+
"capture": false,
|
|
464
|
+
"passive": false
|
|
465
|
+
}, {
|
|
466
|
+
"name": "recommendationView",
|
|
467
|
+
"method": "trackRecommendationView",
|
|
468
|
+
"target": undefined,
|
|
469
|
+
"capture": false,
|
|
470
|
+
"passive": false
|
|
471
|
+
}, {
|
|
472
|
+
"name": "recommendationClick",
|
|
473
|
+
"method": "trackRecommendationClick",
|
|
438
474
|
"target": undefined,
|
|
439
475
|
"capture": false,
|
|
440
476
|
"passive": false
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { Component, Host, h, State, Prop, Element, Watch } from "@stencil/core";
|
|
2
|
-
import state from "../../store/store";
|
|
1
|
+
import { Component, Host, h, State, Prop, Element, Watch, Listen, } from "@stencil/core";
|
|
2
|
+
import { state } from "../../store/store";
|
|
3
3
|
import { imageSearchState } from "../../store/imageSearch.store";
|
|
4
4
|
import * as O from "fp-ts/lib/Option";
|
|
5
5
|
import { slotChangeListener } from "../customized-slots";
|
|
6
|
+
import { v4 as uuidv4 } from "uuid";
|
|
7
|
+
import { createTrackingApi } from "../../openApi";
|
|
8
|
+
import { createFilterEvent, createProductViewVpsEvent, createSearchEvent, createWidgetVpsEvent, } from "../../tracking";
|
|
6
9
|
/**
|
|
7
10
|
* @prop --color-primary: color used for action button, slider bullets and selected detected object;
|
|
8
11
|
*
|
|
@@ -28,6 +31,8 @@ import { slotChangeListener } from "../customized-slots";
|
|
|
28
31
|
*/
|
|
29
32
|
export class VviinnVpsWidget {
|
|
30
33
|
constructor() {
|
|
34
|
+
/** @internal */
|
|
35
|
+
this.apiPath = "https://api.vviinn.com";
|
|
31
36
|
/** When true modal window with widget will be shown */
|
|
32
37
|
this.active = false;
|
|
33
38
|
/** Currency sign will shown after price */
|
|
@@ -37,6 +42,7 @@ export class VviinnVpsWidget {
|
|
|
37
42
|
this.slidePosition = 0;
|
|
38
43
|
this.width = 0;
|
|
39
44
|
this.wrongImageFormat = false;
|
|
45
|
+
this.imageSource = null;
|
|
40
46
|
}
|
|
41
47
|
activeWatcher(value) {
|
|
42
48
|
if (value) {
|
|
@@ -47,6 +53,39 @@ export class VviinnVpsWidget {
|
|
|
47
53
|
document.body.style.overflow = this.overflow;
|
|
48
54
|
}
|
|
49
55
|
}
|
|
56
|
+
trackRecommendationView({ detail }) {
|
|
57
|
+
const recommendationViewEvent = createProductViewVpsEvent(Object.assign({ session_id: this.uiSessionId }, detail));
|
|
58
|
+
this.trackingApi.trackEvent(recommendationViewEvent);
|
|
59
|
+
}
|
|
60
|
+
trackRecommendationClick({ detail }) {
|
|
61
|
+
const recommendationClickEvent = createProductViewVpsEvent(Object.assign({ sessionId: this.uiSessionId }, detail));
|
|
62
|
+
this.trackingApi.trackEvent(recommendationClickEvent);
|
|
63
|
+
}
|
|
64
|
+
trachSearchAreaChanges() {
|
|
65
|
+
const searchEvent = createSearchEvent({
|
|
66
|
+
session_id: this.uiSessionId,
|
|
67
|
+
source: this.imageSource,
|
|
68
|
+
search_area: "manual-selection",
|
|
69
|
+
});
|
|
70
|
+
this.trackingApi.trackEvent(searchEvent);
|
|
71
|
+
}
|
|
72
|
+
trackDetectedObject() {
|
|
73
|
+
const searchEvent = createSearchEvent({
|
|
74
|
+
session_id: this.uiSessionId,
|
|
75
|
+
source: this.imageSource,
|
|
76
|
+
search_area: "attention-point",
|
|
77
|
+
});
|
|
78
|
+
this.trackingApi.trackEvent(searchEvent);
|
|
79
|
+
}
|
|
80
|
+
trackFilter({ detail }) {
|
|
81
|
+
const searchEvent = createFilterEvent({
|
|
82
|
+
session_id: this.uiSessionId,
|
|
83
|
+
source: this.imageSource,
|
|
84
|
+
kind: "category",
|
|
85
|
+
action: detail,
|
|
86
|
+
});
|
|
87
|
+
this.trackingApi.trackEvent(searchEvent);
|
|
88
|
+
}
|
|
50
89
|
componentWillLoad() {
|
|
51
90
|
slotChangeListener(this, this.el);
|
|
52
91
|
}
|
|
@@ -55,14 +94,31 @@ export class VviinnVpsWidget {
|
|
|
55
94
|
state.currencySign = this.currencySign;
|
|
56
95
|
state.locale = this.locale;
|
|
57
96
|
imageSearchState.token = this.token;
|
|
97
|
+
this.uiSessionId = uuidv4();
|
|
98
|
+
this.trackingApi = createTrackingApi(this.apiPath, this.token);
|
|
99
|
+
const widgetOpenEvent = createWidgetVpsEvent({
|
|
100
|
+
action: "open",
|
|
101
|
+
session_id: this.uiSessionId,
|
|
102
|
+
});
|
|
103
|
+
this.trackingApi.trackEvent(widgetOpenEvent);
|
|
58
104
|
}
|
|
59
|
-
handleImageSelection() {
|
|
105
|
+
handleImageSelection(source) {
|
|
106
|
+
this.imageSource = source;
|
|
60
107
|
this.slidePosition = 1;
|
|
61
108
|
const root = this.el.shadowRoot.querySelector("vviinn-overlayed-modal");
|
|
62
109
|
const overlay = root.shadowRoot.querySelector("vviinn-overlay");
|
|
63
110
|
const modal = overlay.querySelector("vviinn-modal");
|
|
64
111
|
const modalBody = modal.shadowRoot.querySelector(".body");
|
|
65
112
|
modalBody.scrollTop = 0;
|
|
113
|
+
this.trackInitialSearch();
|
|
114
|
+
}
|
|
115
|
+
trackInitialSearch() {
|
|
116
|
+
const searchEvent = createSearchEvent({
|
|
117
|
+
session_id: this.uiSessionId,
|
|
118
|
+
source: this.imageSource,
|
|
119
|
+
search_area: "full",
|
|
120
|
+
});
|
|
121
|
+
this.trackingApi.trackEvent(searchEvent);
|
|
66
122
|
}
|
|
67
123
|
resetState() {
|
|
68
124
|
this.resetScroll("onboarding-block");
|
|
@@ -90,6 +146,11 @@ export class VviinnVpsWidget {
|
|
|
90
146
|
this.resetState();
|
|
91
147
|
const elementsToReset = ["onboarding-block", "results-block"];
|
|
92
148
|
elementsToReset.forEach((name) => this.resetScroll(name));
|
|
149
|
+
const widgetOpenEvent = createWidgetVpsEvent({
|
|
150
|
+
action: "close",
|
|
151
|
+
session_id: this.uiSessionId,
|
|
152
|
+
});
|
|
153
|
+
this.trackingApi.trackEvent(widgetOpenEvent);
|
|
93
154
|
}
|
|
94
155
|
render() {
|
|
95
156
|
return (h(Host, null,
|
|
@@ -103,7 +164,7 @@ export class VviinnVpsWidget {
|
|
|
103
164
|
h("vviinn-wrong-format", { class: { hidden: !this.wrongImageFormat }, onActionClick: () => (this.wrongImageFormat = false) }),
|
|
104
165
|
h("vviinn-server-error", { class: { hidden: !imageSearchState.serverError }, onActionClick: () => (imageSearchState.serverError = false) }),
|
|
105
166
|
h("vviinn-teaser", { class: { hidden: this.haveErrors() } }),
|
|
106
|
-
h("vviinn-image-selector", { class: { hidden: this.haveErrors() }, onImageSelected: () => this.handleImageSelection(), onImageSelectedError: () => (this.wrongImageFormat = true), part: "select-image_button" },
|
|
167
|
+
h("vviinn-image-selector", { class: { hidden: this.haveErrors() }, onImageSelected: () => this.handleImageSelection("upload"), onImageSelectedError: () => (this.wrongImageFormat = true), part: "select-image_button" },
|
|
107
168
|
h("span", { slot: "upload-button-text", class: "upload-button-content" },
|
|
108
169
|
h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "29", height: "28", fill: "none" },
|
|
109
170
|
h("defs", null),
|
|
@@ -115,22 +176,25 @@ export class VviinnVpsWidget {
|
|
|
115
176
|
h("div", { id: "onboarding-block", class: "start-page_block" },
|
|
116
177
|
h("div", { class: "onboarding-wrapper" },
|
|
117
178
|
h("vviinn-onboarding", null),
|
|
118
|
-
h("vviinn-example-images", { onImageSelected: () => this.handleImageSelection(), onImageSelectedError: () => this.resetScroll("onboarding-block", "smooth") })))),
|
|
179
|
+
h("vviinn-example-images", { onImageSelected: () => this.handleImageSelection("example"), onImageSelectedError: () => this.resetScroll("onboarding-block", "smooth") })))),
|
|
119
180
|
h("vviinn-slide", { class: { "results-page": true, active: this.slidePosition == 1 } },
|
|
120
181
|
h("div", { class: "image-wrapper" },
|
|
121
182
|
h("vviinn-image-view", null),
|
|
122
183
|
h("div", { class: "filters-wrapper" },
|
|
123
184
|
h("div", { class: "filters" }, imageSearchState.filters.map((filter) => (h("search-filters", { filter: filter })))))),
|
|
124
185
|
h("div", { id: "results-block", class: "products-wrapper" },
|
|
125
|
-
h("div", { class: {
|
|
186
|
+
h("div", { class: {
|
|
187
|
+
"nothing-found": true,
|
|
188
|
+
hidden: imageSearchState.results.length > 0,
|
|
189
|
+
} },
|
|
126
190
|
h("vviinn-empty-results", null),
|
|
127
191
|
h("vviinn-onboarding", null)),
|
|
128
192
|
h("div", { class: {
|
|
129
193
|
hidden: imageSearchState.results.length <= 0,
|
|
130
194
|
products: true,
|
|
131
|
-
} }, imageSearchState.results.map((p) => {
|
|
195
|
+
} }, imageSearchState.results.map((p, i) => {
|
|
132
196
|
var _a;
|
|
133
|
-
return (h("vviinn-product-card", { hidden: true, productTitle: p.title, productId: p.productId, brand: p.brand, deeplink: p.deeplink, price: p.price.actual, salePrice: p.price.sale, imageWidth: 160, image: (_a = p.image.thumbnail) !== null && _a !== void 0 ? _a : p.image.original, part: "product-card" }));
|
|
197
|
+
return (h("vviinn-product-card", { hidden: true, productTitle: p.title, productId: p.productId, brand: p.brand, deeplink: p.deeplink, price: p.price.actual, salePrice: p.price.sale, imageWidth: 160, image: (_a = p.image.thumbnail) !== null && _a !== void 0 ? _a : p.image.original, part: "product-card", index: i }));
|
|
134
198
|
}))))))));
|
|
135
199
|
}
|
|
136
200
|
static get is() { return "vviinn-vps-widget"; }
|
|
@@ -163,7 +227,7 @@ export class VviinnVpsWidget {
|
|
|
163
227
|
"type": "string",
|
|
164
228
|
"mutable": false,
|
|
165
229
|
"complexType": {
|
|
166
|
-
"original": "string
|
|
230
|
+
"original": "string",
|
|
167
231
|
"resolved": "string",
|
|
168
232
|
"references": {}
|
|
169
233
|
},
|
|
@@ -177,7 +241,8 @@ export class VviinnVpsWidget {
|
|
|
177
241
|
"text": ""
|
|
178
242
|
},
|
|
179
243
|
"attribute": "api-path",
|
|
180
|
-
"reflect": false
|
|
244
|
+
"reflect": false,
|
|
245
|
+
"defaultValue": "\"https://api.vviinn.com\""
|
|
181
246
|
},
|
|
182
247
|
"active": {
|
|
183
248
|
"type": "boolean",
|
|
@@ -244,4 +309,35 @@ export class VviinnVpsWidget {
|
|
|
244
309
|
"propName": "active",
|
|
245
310
|
"methodName": "activeWatcher"
|
|
246
311
|
}]; }
|
|
312
|
+
static get listeners() { return [{
|
|
313
|
+
"name": "recommendationView",
|
|
314
|
+
"method": "trackRecommendationView",
|
|
315
|
+
"target": undefined,
|
|
316
|
+
"capture": false,
|
|
317
|
+
"passive": false
|
|
318
|
+
}, {
|
|
319
|
+
"name": "recommendationClick",
|
|
320
|
+
"method": "trackRecommendationClick",
|
|
321
|
+
"target": undefined,
|
|
322
|
+
"capture": false,
|
|
323
|
+
"passive": false
|
|
324
|
+
}, {
|
|
325
|
+
"name": "cropperChanged",
|
|
326
|
+
"method": "trachSearchAreaChanges",
|
|
327
|
+
"target": undefined,
|
|
328
|
+
"capture": false,
|
|
329
|
+
"passive": false
|
|
330
|
+
}, {
|
|
331
|
+
"name": "detectedObjectClicked",
|
|
332
|
+
"method": "trackDetectedObject",
|
|
333
|
+
"target": undefined,
|
|
334
|
+
"capture": false,
|
|
335
|
+
"passive": false
|
|
336
|
+
}, {
|
|
337
|
+
"name": "filterSelected",
|
|
338
|
+
"method": "trackFilter",
|
|
339
|
+
"target": undefined,
|
|
340
|
+
"capture": false,
|
|
341
|
+
"passive": false
|
|
342
|
+
}]; }
|
|
247
343
|
}
|
|
@@ -3,7 +3,7 @@ import * as E from "fp-ts/Either";
|
|
|
3
3
|
import { pipe } from "fp-ts/function";
|
|
4
4
|
import * as S from "fp-ts/Semigroup";
|
|
5
5
|
import * as String from "fp-ts/string";
|
|
6
|
-
import state from "../store/store";
|
|
6
|
+
import { state } from "../store/store";
|
|
7
7
|
import { emptyApiPathError } from "../error";
|
|
8
8
|
const stringMonoid = O.getMonoid(String.Monoid);
|
|
9
9
|
export const getApiPath = () => pipe(O.getFirstMonoid().concat(O.fromNullable(state.apiPath), O.fromNullable(`${process.env.API_PATH}`)), E.fromOption(() => emptyApiPathError));
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createConfiguration, DefaultApi, servers, } from "@vviinn/tracking-client-ts";
|
|
2
|
+
const STAGE_SERVER_IDENTIFIER = "stage";
|
|
3
|
+
export const getTrackingServerByApiPath = (apiPath) => isProductionPath(apiPath) ? servers[0] : servers[1];
|
|
4
|
+
export const isProductionPath = (apiPath) => !apiPath.includes(STAGE_SERVER_IDENTIFIER);
|
|
5
|
+
// TODO find way to utilize this function when we will use several openApi clients
|
|
6
|
+
export const createBearerAuth = (token) => {
|
|
7
|
+
const provider = {
|
|
8
|
+
getToken: () => {
|
|
9
|
+
return new Promise((resolve) => resolve(token));
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
const bearerConf = {
|
|
13
|
+
tokenProvider: provider,
|
|
14
|
+
};
|
|
15
|
+
return {
|
|
16
|
+
bearerAuth: bearerConf,
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export const createTrackingApi = (apiPath, token) => {
|
|
20
|
+
const baseServer = getTrackingServerByApiPath(apiPath);
|
|
21
|
+
const authMethods = createBearerAuth(token);
|
|
22
|
+
const configuration = {
|
|
23
|
+
baseServer,
|
|
24
|
+
authMethods,
|
|
25
|
+
};
|
|
26
|
+
return new DefaultApi(createConfiguration(configuration));
|
|
27
|
+
};
|
package/dist/collection/{components/vviinn-vpr-widget/GridMode.js → recommendation/events.js}
RENAMED
|
File without changes
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { createStore } from "@stencil/store";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { trackingStore } from "./tracking.store";
|
|
3
|
+
export const { state, onChange } = createStore(Object.assign({ fallbackStyles: "", pricePrefix: null, currencySign: null, apiPath: null, token: null, locale: "de-DE" }, trackingStore));
|
|
4
|
+
onChange("apiPath", (val) => {
|
|
5
|
+
console.log("apiPathChanged", val);
|
|
6
|
+
});
|
|
7
|
+
onChange("token", (val) => {
|
|
8
|
+
console.log("tokenChanged", val);
|
|
8
9
|
});
|
|
9
|
-
export default store.state;
|
|
10
|
-
export const dispose = store.dispose;
|
|
11
|
-
export const state = store.state;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createTrackingEvent } from "./event";
|
|
2
|
+
import { filterEvent } from "./filter";
|
|
3
|
+
import { vprProductClick, vprProductView, vpsProductClick, vpsProductView, } from "./product";
|
|
4
|
+
import { searchEvent } from "./search";
|
|
5
|
+
import { vprWidget, vpsWidget } from "./widget";
|
|
6
|
+
export const createProductViewVprEvent = createTrackingEvent(vprProductView);
|
|
7
|
+
export const createProductViewVpsEvent = createTrackingEvent(vpsProductView);
|
|
8
|
+
export const createProductClickVprEvent = createTrackingEvent(vprProductClick);
|
|
9
|
+
export const createProductClickVpsEvent = createTrackingEvent(vpsProductClick);
|
|
10
|
+
export const createWidgetVprEvent = createTrackingEvent(vprWidget);
|
|
11
|
+
export const createWidgetVpsEvent = createTrackingEvent(vpsWidget);
|
|
12
|
+
export const createSearchEvent = createTrackingEvent(searchEvent);
|
|
13
|
+
export const createFilterEvent = createTrackingEvent(filterEvent);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const PRODUCT_CLICK_EVENT_TYPE = "product_click_event";
|
|
2
|
+
const PRODUCT_VIEW_EVENT_TYPE = "product_view_event";
|
|
3
|
+
const FILTER_EVENT_EVENT_TYPE = "filter_event";
|
|
4
|
+
const SEARCH_EVENT_EVENT_TYPE = "search_event";
|
|
5
|
+
const WIDGET_EVENT_EVENT_TYPE = "widget_event";
|
|
6
|
+
export { PRODUCT_CLICK_EVENT_TYPE, PRODUCT_VIEW_EVENT_TYPE, FILTER_EVENT_EVENT_TYPE, SEARCH_EVENT_EVENT_TYPE, WIDGET_EVENT_EVENT_TYPE, };
|