vviinn-widgets 2.50.2 → 2.50.4
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/{customized-slots-71029d3f.js → customized-slots-39ba4e52.js} +10 -6
- package/dist/cjs/{package-4b356b6b.js → package-20cf59d0.js} +1 -1
- package/dist/cjs/{index-4445cb70.js → resources-d6fbe545.js} +80 -0
- package/dist/cjs/search-filters_17.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-carousel_4.cjs.entry.js +15 -44
- package/dist/cjs/vviinn-vpr-button.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +3 -3
- package/dist/cjs/vviinn-vps-widget.cjs.entry.js +14 -75
- package/dist/collection/components/customized-slots.js +10 -6
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-widget.js +2 -2
- package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +1 -1
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +2 -2
- package/dist/collection/locale/index.js +2 -1
- package/dist/collection/locale/{resources-vps.js → resources.js} +18 -0
- package/dist/collection/locale/types.js +1 -0
- package/dist/esm/{customized-slots-706fbadd.js → customized-slots-f68b50fd.js} +10 -6
- package/dist/esm/{package-58b8bea0.js → package-4c256717.js} +1 -1
- package/dist/esm/{index-76fe67d1.js → resources-78bd133f.js} +80 -1
- package/dist/esm/search-filters_17.entry.js +1 -1
- package/dist/esm/vviinn-carousel_4.entry.js +4 -33
- package/dist/esm/vviinn-vpr-button.entry.js +1 -1
- package/dist/esm/vviinn-vps-button.entry.js +3 -3
- package/dist/esm/vviinn-vps-widget.entry.js +4 -65
- package/dist/types/components/customized-slots.d.ts +1 -1
- package/dist/types/locale/index.d.ts +2 -1
- package/dist/types/locale/types.d.ts +1 -0
- package/dist/vviinn-widgets/p-41b34ee9.entry.js +1 -0
- package/{www/build/p-2a339615.entry.js → dist/vviinn-widgets/p-9a4a5446.entry.js} +1 -1
- package/dist/vviinn-widgets/p-ab6d5efd.entry.js +1 -0
- package/dist/vviinn-widgets/{p-ad8a3a40.entry.js → p-d1aefc76.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-793798be.entry.js → p-d6b5e4c9.entry.js} +1 -1
- package/dist/vviinn-widgets/p-e19f9e89.js +1 -0
- package/dist/vviinn-widgets/p-e37cf59f.js +1 -0
- package/dist/vviinn-widgets/p-e861f87e.js +1 -0
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +1 -1
- package/www/build/p-41b34ee9.entry.js +1 -0
- package/{dist/vviinn-widgets/p-2a339615.entry.js → www/build/p-9a4a5446.entry.js} +1 -1
- package/www/build/p-ab6d5efd.entry.js +1 -0
- package/www/build/{p-ad8a3a40.entry.js → p-d1aefc76.entry.js} +1 -1
- package/www/build/{p-793798be.entry.js → p-d6b5e4c9.entry.js} +1 -1
- package/www/build/p-e19f9e89.js +1 -0
- package/www/build/p-e37cf59f.js +1 -0
- package/www/build/p-e861f87e.js +1 -0
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/dist/collection/locale/resources-vpr.js +0 -28
- package/dist/types/locale/resources-vps.d.ts +0 -2
- package/dist/vviinn-widgets/p-23300e77.entry.js +0 -1
- package/dist/vviinn-widgets/p-464f2996.js +0 -1
- package/dist/vviinn-widgets/p-596032ea.js +0 -1
- package/dist/vviinn-widgets/p-dbcc6488.js +0 -1
- package/dist/vviinn-widgets/p-f7e5b1fa.entry.js +0 -1
- package/www/build/p-23300e77.entry.js +0 -1
- package/www/build/p-464f2996.js +0 -1
- package/www/build/p-596032ea.js +0 -1
- package/www/build/p-dbcc6488.js +0 -1
- package/www/build/p-f7e5b1fa.entry.js +0 -1
- /package/dist/types/locale/{resources-vpr.d.ts → resources.d.ts} +0 -0
|
@@ -15,9 +15,15 @@ function fromString(s) {
|
|
|
15
15
|
return s === "VPR" ? { _tag: "VPR" } : { _tag: "VCS" };
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const vprSlotsNames = [
|
|
19
19
|
"vviinn-recommendations-title",
|
|
20
20
|
"vviinn-recommendations-subtitle",
|
|
21
|
+
"vviinn-basket-button-text",
|
|
22
|
+
"vviinn-basket-button-icon",
|
|
23
|
+
"vviinn-update-button-icon",
|
|
24
|
+
"vviinn-update-button-text",
|
|
25
|
+
];
|
|
26
|
+
const vpsSlotsNames = [
|
|
21
27
|
"vviinn-teaser-text",
|
|
22
28
|
"vviinn-image-upload-button-text",
|
|
23
29
|
"vviinn-image-upload-icon",
|
|
@@ -28,13 +34,11 @@ const defaultSlotsNames = [
|
|
|
28
34
|
"vviinn-text-search-icon",
|
|
29
35
|
"vviinn-privacy-badge-text",
|
|
30
36
|
"vviinn-image-search-modal-title",
|
|
31
|
-
"vviinn-basket-button-text",
|
|
32
|
-
"vviinn-basket-button-icon",
|
|
33
|
-
"vviinn-update-button-icon",
|
|
34
|
-
"vviinn-update-button-text",
|
|
35
37
|
];
|
|
36
38
|
const renderNamedSlot = (name) => index.h("slot", { name: name });
|
|
37
|
-
const SlotSkeleton = () =>
|
|
39
|
+
const SlotSkeleton = (renderType) => {
|
|
40
|
+
return (renderType === "vps" ? vpsSlotsNames : vprSlotsNames).map(renderNamedSlot);
|
|
41
|
+
};
|
|
38
42
|
const getSlots = (element) => Array.from(element.shadowRoot.querySelectorAll("slot"));
|
|
39
43
|
const getNameAttribute = (element) => element.getAttribute("name");
|
|
40
44
|
const getSlotAttribute = (element) => element.getAttribute("slot");
|
|
@@ -3973,6 +3973,85 @@ const createFilterEvent = createTrackingEvent(filterEvent);
|
|
|
3973
3973
|
const createAddToBasketVprEvent = createTrackingEvent(vprAddToBasket);
|
|
3974
3974
|
const createAddToBasketVpcEvent = createTrackingEvent(vpcAddToBasket);
|
|
3975
3975
|
|
|
3976
|
+
const resources = {
|
|
3977
|
+
de: {
|
|
3978
|
+
translation: {
|
|
3979
|
+
noResultText: "Keine Ergebnisse! Versuche es bitte später erneut.",
|
|
3980
|
+
basketButtonText: "In den Warenkorb",
|
|
3981
|
+
setMode: {
|
|
3982
|
+
widgetTitle: "Kaufen Sie ein Set und erhalten Sie Rabatt",
|
|
3983
|
+
widgetSubtitle: "Sparen Sie bis zu 15% beim Kauf von Produkten aus der Liste",
|
|
3984
|
+
basketButtonText: "Als Set kaufen",
|
|
3985
|
+
appliedDiscountText: "gespart",
|
|
3986
|
+
updateButtonText: "Neues Set vorschlagen",
|
|
3987
|
+
},
|
|
3988
|
+
exampleImagesTitle: "Mit den Beispielbildern die Suche direkt ausprobieren",
|
|
3989
|
+
imageUploadButtonText: "Bild hochladen",
|
|
3990
|
+
cameraButtonTextStart: "Kamera starten",
|
|
3991
|
+
cameraButtonTextStop: "Kamera stoppen",
|
|
3992
|
+
privacyBadgeText: "Durch das Hochladen eines Bildes willigst Du in die Verarbeitung durch unseren Partner Vviinn ein. Das Bild wird nach einer Stunde Inaktivität gelöscht.",
|
|
3993
|
+
teaserText: "Finde Produkte auf \n einem Foto",
|
|
3994
|
+
imageSearchModalTitle: "Bildsuche",
|
|
3995
|
+
textSearchPlaceholder: "mit Text suchen",
|
|
3996
|
+
emptyResultsBlock: {
|
|
3997
|
+
title: "Leider nichts gefunden",
|
|
3998
|
+
button: "Neues Bild hochladen",
|
|
3999
|
+
},
|
|
4000
|
+
serverErrorBlock: {
|
|
4001
|
+
title: "Keine Verbindung",
|
|
4002
|
+
button: "Erneut versuchen",
|
|
4003
|
+
},
|
|
4004
|
+
wrongFormatBlock: {
|
|
4005
|
+
title: "Dateityp wird nicht unterstützt",
|
|
4006
|
+
text: "Bitte laden Sie eine .jpg, .png oder .webp Bilddatei hoch.",
|
|
4007
|
+
button: "Neues Bild hochladen",
|
|
4008
|
+
},
|
|
4009
|
+
wrongAspectRatioBlock: {
|
|
4010
|
+
title: "Das Bild ist zu schmal",
|
|
4011
|
+
button: "Neues Bild hochladen",
|
|
4012
|
+
},
|
|
4013
|
+
},
|
|
4014
|
+
},
|
|
4015
|
+
en: {
|
|
4016
|
+
translation: {
|
|
4017
|
+
noResultText: "No results! Please, try again later.",
|
|
4018
|
+
basketButtonText: "Add to Basket",
|
|
4019
|
+
setMode: {
|
|
4020
|
+
widgetTitle: "Buy a set to get discount",
|
|
4021
|
+
widgetSubtitle: "Save up to 15% for buying products from the list",
|
|
4022
|
+
basketButtonText: "Buy as set",
|
|
4023
|
+
appliedDiscountText: "saved",
|
|
4024
|
+
updateButtonText: "Suggest New Set",
|
|
4025
|
+
},
|
|
4026
|
+
exampleImagesTitle: "Try out the search with the example images",
|
|
4027
|
+
imageUploadButtonText: "Upload Photo",
|
|
4028
|
+
cameraButtonTextStart: "Start Camera",
|
|
4029
|
+
cameraButtonTextStop: "Stop Camera",
|
|
4030
|
+
privacyBadgeText: "By uploading a picture you agree to the processing by our partner Vviinn. The image will be deleted after one hour of inactivity.",
|
|
4031
|
+
teaserText: "Find Product by Photo",
|
|
4032
|
+
imageSearchModalTitle: "Visual Search",
|
|
4033
|
+
textSearchPlaceholder: "Search by text",
|
|
4034
|
+
emptyResultsBlock: {
|
|
4035
|
+
title: "Sorry, nothing found",
|
|
4036
|
+
button: "Upload another image",
|
|
4037
|
+
},
|
|
4038
|
+
serverErrorBlock: {
|
|
4039
|
+
title: "Something went wrong",
|
|
4040
|
+
button: "Try again",
|
|
4041
|
+
},
|
|
4042
|
+
wrongFormatBlock: {
|
|
4043
|
+
title: "Wrong file format",
|
|
4044
|
+
text: "Please upload a .jpg, .png or .webp image file.",
|
|
4045
|
+
button: "Upload another file",
|
|
4046
|
+
},
|
|
4047
|
+
wrongAspectRatioBlock: {
|
|
4048
|
+
title: "The image is too narrow",
|
|
4049
|
+
button: "Upload another image",
|
|
4050
|
+
},
|
|
4051
|
+
},
|
|
4052
|
+
},
|
|
4053
|
+
};
|
|
4054
|
+
|
|
3976
4055
|
exports.createAddToBasketVpcEvent = createAddToBasketVpcEvent;
|
|
3977
4056
|
exports.createAddToBasketVprEvent = createAddToBasketVprEvent;
|
|
3978
4057
|
exports.createFilterEvent = createFilterEvent;
|
|
@@ -3987,4 +4066,5 @@ exports.createTrackingApi = createTrackingApi;
|
|
|
3987
4066
|
exports.createWidgetVpcEvent = createWidgetVpcEvent;
|
|
3988
4067
|
exports.createWidgetVprEvent = createWidgetVprEvent;
|
|
3989
4068
|
exports.createWidgetVpsEvent = createWidgetVpsEvent;
|
|
4069
|
+
exports.resources = resources;
|
|
3990
4070
|
exports.v4 = v4;
|
|
@@ -6,7 +6,7 @@ const index = require('./index-5619b5ec.js');
|
|
|
6
6
|
const search_store = require('./search.store-7605f369.js');
|
|
7
7
|
const i18next = require('./i18next-74ff3413.js');
|
|
8
8
|
const PlusIcon = require('./PlusIcon-5e585127.js');
|
|
9
|
-
const customizedSlots = require('./customized-slots-
|
|
9
|
+
const customizedSlots = require('./customized-slots-39ba4e52.js');
|
|
10
10
|
|
|
11
11
|
const ArrowIcon = () => (index.h("svg", { width: "12", height: "20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
12
12
|
index.h("path", { d: "M0 10 10 0l1.4 1.4L2.8 10l8.6 8.6L10 20 0 10Z" })));
|
|
@@ -6,9 +6,9 @@ const index = require('./index-5619b5ec.js');
|
|
|
6
6
|
const search_store = require('./search.store-7605f369.js');
|
|
7
7
|
const i18next = require('./i18next-74ff3413.js');
|
|
8
8
|
const PlusIcon = require('./PlusIcon-5e585127.js');
|
|
9
|
-
const customizedSlots = require('./customized-slots-
|
|
10
|
-
const _package = require('./package-
|
|
11
|
-
const
|
|
9
|
+
const customizedSlots = require('./customized-slots-39ba4e52.js');
|
|
10
|
+
const _package = require('./package-20cf59d0.js');
|
|
11
|
+
const resources = require('./resources-d6fbe545.js');
|
|
12
12
|
|
|
13
13
|
const BasketIcon = () => (index.h("svg", { width: "25", height: "24", viewBox: "0 0 25 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
14
14
|
index.h("path", { d: "M7.5 22C6.95 22 6.47917 21.8042 6.0875 21.4125C5.69583 21.0208 5.5 20.55 5.5 20C5.5 19.45 5.69583 18.9792 6.0875 18.5875C6.47917 18.1958 6.95 18 7.5 18C8.05 18 8.52083 18.1958 8.9125 18.5875C9.30417 18.9792 9.5 19.45 9.5 20C9.5 20.55 9.30417 21.0208 8.9125 21.4125C8.52083 21.8042 8.05 22 7.5 22ZM17.5 22C16.95 22 16.4792 21.8042 16.0875 21.4125C15.6958 21.0208 15.5 20.55 15.5 20C15.5 19.45 15.6958 18.9792 16.0875 18.5875C16.4792 18.1958 16.95 18 17.5 18C18.05 18 18.5208 18.1958 18.9125 18.5875C19.3042 18.9792 19.5 19.45 19.5 20C19.5 20.55 19.3042 21.0208 18.9125 21.4125C18.5208 21.8042 18.05 22 17.5 22ZM6.65 6L9.05 11H16.05L18.8 6H6.65ZM5.7 4H20.45C20.8333 4 21.125 4.17083 21.325 4.5125C21.525 4.85417 21.5333 5.2 21.35 5.55L17.8 11.95C17.6167 12.2833 17.3708 12.5417 17.0625 12.725C16.7542 12.9083 16.4167 13 16.05 13H8.6L7.5 15H18.5C18.7833 15 19.0208 15.0958 19.2125 15.2875C19.4042 15.4792 19.5 15.7167 19.5 16C19.5 16.2833 19.4042 16.5208 19.2125 16.7125C19.0208 16.9042 18.7833 17 18.5 17H7.5C6.75 17 6.18333 16.6708 5.8 16.0125C5.41667 15.3542 5.4 14.7 5.75 14.05L7.1 11.6L3.5 4H2.5C2.21667 4 1.97917 3.90417 1.7875 3.7125C1.59583 3.52083 1.5 3.28333 1.5 3C1.5 2.71667 1.59583 2.47917 1.7875 2.2875C1.97917 2.09583 2.21667 2 2.5 2H4.125C4.30833 2 4.48333 2.05 4.65 2.15C4.81667 2.25 4.94167 2.39167 5.025 2.575L5.7 4Z", fill: "#525252" })));
|
|
@@ -1372,35 +1372,6 @@ const getVCSRecommendations = (productId) => (color) => (excludedFilters) => (ca
|
|
|
1372
1372
|
|
|
1373
1373
|
const getRecommendationsService = (campaignType) => search_store._function.pipe(customizedSlots.fromString(campaignType), customizedSlots.fold(() => getVPRRecommendations, () => getVCSRecommendations));
|
|
1374
1374
|
|
|
1375
|
-
const resources = {
|
|
1376
|
-
de: {
|
|
1377
|
-
translation: {
|
|
1378
|
-
noResultText: "Keine Ergebnisse! Versuche es bitte später erneut.",
|
|
1379
|
-
basketButtonText: "In den Warenkorb",
|
|
1380
|
-
setMode: {
|
|
1381
|
-
widgetTitle: "Kaufen Sie ein Set und erhalten Sie Rabatt",
|
|
1382
|
-
widgetSubtitle: "Sparen Sie bis zu 15% beim Kauf von Produkten aus der Liste",
|
|
1383
|
-
basketButtonText: "Als Set kaufen",
|
|
1384
|
-
appliedDiscountText: "gespart",
|
|
1385
|
-
updateButtonText: "Neues Set vorschlagen",
|
|
1386
|
-
},
|
|
1387
|
-
},
|
|
1388
|
-
},
|
|
1389
|
-
en: {
|
|
1390
|
-
translation: {
|
|
1391
|
-
noResultText: "No results! Please, try again later.",
|
|
1392
|
-
basketButtonText: "Add to Basket",
|
|
1393
|
-
setMode: {
|
|
1394
|
-
widgetTitle: "Buy a set to get discount",
|
|
1395
|
-
widgetSubtitle: "Save up to 15% for buying products from the list",
|
|
1396
|
-
basketButtonText: "Buy as set",
|
|
1397
|
-
appliedDiscountText: "saved",
|
|
1398
|
-
updateButtonText: "Suggest New Set",
|
|
1399
|
-
},
|
|
1400
|
-
},
|
|
1401
|
-
},
|
|
1402
|
-
};
|
|
1403
|
-
|
|
1404
1375
|
const vviinnVprWidgetCss = ":host{display:grid;grid-gap:1rem;width:100%}:host(:not(.loaded)){position:absolute;visibility:hidden}:host(.grid) vviinn-product-card::part(image){border:1px solid #dddddd;width:100%}:host(.set) vviinn-carousel{overflow-x:auto}:host(.set) vviinn-carousel{scrollbar-width:thin}.widget-header{display:flex;flex-wrap:wrap;gap:20px;justify-content:space-between;align-items:center}.widget-header h3{margin-top:8px;margin-bottom:0;font-size:14px;font-weight:400;line-height:20px}.update-button{display:flex;align-items:center;justify-content:center;color:#525252;gap:8px;padding:8px 10px;background:rgb(244, 244, 244);border:none;cursor:pointer}.update-button:hover{background:rgb(234, 234, 234)}.update-button svg{color:#6f6f6f;width:24px;height:24px}h2{margin:0}vviinn-product-card::part(price-container){align-self:flex-start;text-align:left;display:flex}.results{display:grid;grid-gap:1rem}.no-result-text{font-size:20px}.visually-hidden{position:absolute;top:0;left:0;z-index:-1;height:0;width:0}h2{margin:0}:host(.grid) h2{justify-content:center}:host(.grid) vviinn-product-card::part(image){min-width:100%}:host(.grid) vviinn-product-card::part(image-link){width:100%}:host(.grid) vviinn-product-card::part(title),:host(.grid) vviinn-product-card::part(brand),:host(.grid) vviinn-product-card::part(type){text-align:center}:host(.grid) vviinn-product-card::part(price-container){align-self:center}:host(.continuity) vviinn-product-card::part(title),:host(.continuity) vviinn-product-card::part(brand),:host(.continuity) vviinn-product-card::part(type),:host(.continuity) vviinn-product-card::part(deeplink){text-align:left;max-width:unset;align-self:start}";
|
|
1405
1376
|
|
|
1406
1377
|
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
@@ -1534,8 +1505,8 @@ const VviinnVprWidget = class {
|
|
|
1534
1505
|
search_store.state.currencySign = this.currencySign;
|
|
1535
1506
|
search_store.state.locale = this.locale;
|
|
1536
1507
|
this.id = (_a = this.buttonElementId) !== null && _a !== void 0 ? _a : this.el.id;
|
|
1537
|
-
this.uiSessionId =
|
|
1538
|
-
this.trackingApi =
|
|
1508
|
+
this.uiSessionId = resources.v4();
|
|
1509
|
+
this.trackingApi = resources.createTrackingApi(this.apiPath, this.token);
|
|
1539
1510
|
this.getRecommendations();
|
|
1540
1511
|
this.vviinnWidgetLoad.emit(this.getBasicEventData());
|
|
1541
1512
|
this.trackWidgetEvent("load");
|
|
@@ -1547,7 +1518,7 @@ const VviinnVprWidget = class {
|
|
|
1547
1518
|
await i18next.instance.init({
|
|
1548
1519
|
lng: this.locale,
|
|
1549
1520
|
fallbackLng: "en",
|
|
1550
|
-
resources,
|
|
1521
|
+
resources: resources.resources,
|
|
1551
1522
|
});
|
|
1552
1523
|
if (this.excluded) {
|
|
1553
1524
|
this.excluded = search_store.parseExcluded(this.excluded);
|
|
@@ -1611,10 +1582,10 @@ const VviinnVprWidget = class {
|
|
|
1611
1582
|
let addToBasketEvent;
|
|
1612
1583
|
const eventBody = Object.assign({ session_id: this.uiSessionId, rank: productRank, product: productId }, rest);
|
|
1613
1584
|
if (this.campaignType === "VCS") {
|
|
1614
|
-
addToBasketEvent =
|
|
1585
|
+
addToBasketEvent = resources.createAddToBasketVpcEvent(eventBody);
|
|
1615
1586
|
}
|
|
1616
1587
|
else if (this.campaignType === "VPR") {
|
|
1617
|
-
addToBasketEvent =
|
|
1588
|
+
addToBasketEvent = resources.createAddToBasketVprEvent(eventBody);
|
|
1618
1589
|
}
|
|
1619
1590
|
this.trackingApi
|
|
1620
1591
|
.trackEvent(addToBasketEvent)
|
|
@@ -1632,10 +1603,10 @@ const VviinnVprWidget = class {
|
|
|
1632
1603
|
let widgetEvent;
|
|
1633
1604
|
const eventBody = Object.assign({ action, session_id: this.uiSessionId }, rest);
|
|
1634
1605
|
if (this.campaignType === "VCS") {
|
|
1635
|
-
widgetEvent =
|
|
1606
|
+
widgetEvent = resources.createWidgetVpcEvent(eventBody);
|
|
1636
1607
|
}
|
|
1637
1608
|
else if (this.campaignType === "VPR") {
|
|
1638
|
-
widgetEvent =
|
|
1609
|
+
widgetEvent = resources.createWidgetVprEvent(eventBody);
|
|
1639
1610
|
}
|
|
1640
1611
|
this.trackingApi.trackEvent(widgetEvent).then(this.setTrackingDeactivated);
|
|
1641
1612
|
}
|
|
@@ -1646,10 +1617,10 @@ const VviinnVprWidget = class {
|
|
|
1646
1617
|
let resultEvent;
|
|
1647
1618
|
const eventBody = Object.assign({ session_id: this.uiSessionId }, rest);
|
|
1648
1619
|
if (this.campaignType === "VCS") {
|
|
1649
|
-
resultEvent =
|
|
1620
|
+
resultEvent = resources.createResultVpcEventByType(type)(eventBody);
|
|
1650
1621
|
}
|
|
1651
1622
|
else if (this.campaignType === "VPR") {
|
|
1652
|
-
resultEvent =
|
|
1623
|
+
resultEvent = resources.createResultVprEventByType(type)(eventBody);
|
|
1653
1624
|
}
|
|
1654
1625
|
this.trackingApi.trackEvent(resultEvent).then(this.setTrackingDeactivated);
|
|
1655
1626
|
}
|
|
@@ -1660,10 +1631,10 @@ const VviinnVprWidget = class {
|
|
|
1660
1631
|
let productEvent;
|
|
1661
1632
|
const eventBody = Object.assign({ session_id: this.uiSessionId, rank: productRank, product: productId }, rest);
|
|
1662
1633
|
if (campaignTypeId === "VCS") {
|
|
1663
|
-
productEvent =
|
|
1634
|
+
productEvent = resources.createProductVpcEventByType(eventType)(eventBody);
|
|
1664
1635
|
}
|
|
1665
1636
|
else if (campaignTypeId === "VPR") {
|
|
1666
|
-
productEvent =
|
|
1637
|
+
productEvent = resources.createProductVprEventByType(eventType)(eventBody);
|
|
1667
1638
|
}
|
|
1668
1639
|
return productEvent;
|
|
1669
1640
|
}
|
|
@@ -1710,7 +1681,7 @@ const VviinnVprWidget = class {
|
|
|
1710
1681
|
loaded: true,
|
|
1711
1682
|
empty: this.recommendations.length == 0,
|
|
1712
1683
|
[this.mode]: true,
|
|
1713
|
-
}, "aria-hidden": "false" }, index.h(index.Fragment, null, this.renderExternalCSS(),
|
|
1684
|
+
}, "aria-hidden": "false" }, index.h(index.Fragment, null, this.renderExternalCSS(), customizedSlots.SlotSkeleton("vpr"), index.h("style", null, search_store.state.fallbackStyles), index.h("div", { class: "widget-header" }, index.h("div", null, index.h("h2", { part: "recommendations-title" }, index.h("slot", { name: "vviinn-recommendations-title" }, this.isSetMode
|
|
1714
1685
|
? i18next.instance.t("setMode.widgetTitle")
|
|
1715
1686
|
: this.blockTitle)), this.isSetMode && (index.h("h3", { part: "recommendations-subtitle" }, index.h("slot", { name: "vviinn-recommendations-subtitle" }, i18next.instance.t("setMode.widgetSubtitle"))))), this.isSetMode && this.updateButtonLocation !== "onItem" ? (index.h("button", { class: "update-button", part: "update-button-top", onClick: () => (this.updatingAllCards = true) }, index.h("slot", { name: "vviinn-update-button-icon" }, index.h(UpdateIcon, null)), index.h("slot", { name: "vviinn-update-button-text" }, index.h("span", null, i18next.instance.t("setMode.updateButtonText"))))) : null), this.recommendations.length > 0 &&
|
|
1716
1687
|
(this.useCarousel ? this.renderCarousel() : this.renderResults()), this.recommendations.length === 0 && this.hasErrorOnLoad && (index.h("p", { class: "no-result-text" }, this.noResultText.length
|
|
@@ -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-20cf59d0.js');
|
|
7
7
|
const VisualSearchIcon = require('./VisualSearchIcon-1180d079.js');
|
|
8
8
|
|
|
9
9
|
const vviinnVprButtonCss = ":host{display:block}";
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-5619b5ec.js');
|
|
6
|
-
const _package = require('./package-
|
|
7
|
-
const customizedSlots = require('./customized-slots-
|
|
6
|
+
const _package = require('./package-20cf59d0.js');
|
|
7
|
+
const customizedSlots = require('./customized-slots-39ba4e52.js');
|
|
8
8
|
const constants = require('./constants-7684cbfc.js');
|
|
9
9
|
|
|
10
10
|
const CameraIcon = () => (index.h("svg", { width: "22", height: "20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
@@ -68,7 +68,7 @@ const VviinnVpsButton = class {
|
|
|
68
68
|
render() {
|
|
69
69
|
return (index.h(index.Host, { tabindex: "0", role: "button" }, index.h("vviinn-button", { onClick: () => {
|
|
70
70
|
this.handleClick();
|
|
71
|
-
}, addStyle: this.addStyle, part: "vviinn-button" }, index.h("slot", null, index.h(CameraIcon, null))),
|
|
71
|
+
}, addStyle: this.addStyle, part: "vviinn-button" }, index.h("slot", null, index.h(CameraIcon, null))), customizedSlots.SlotSkeleton("vps"), index.h("vviinn-vps-widget", { mode: this.mode, "currency-sign": this.currencySign, token: this.token, locale: this.locale, apiPath: this.apiPath, exportparts: "brand, deeplink, currency, image, image-link, price-amount-sale, price-amount-outdated, price-amount-regular, price-container, price-outdated, price-regular, price-sale, price-prefix, title, product-card, upload-photo_button, show-files_button, start-camera_button", campaignId: this.campaignId, showingInButton: true, buttonPressed: this.buttonPressed, resetVpsButton: this.resetButton.bind(this), buttonElementId: this.el.id, active: this.buttonPressed &&
|
|
72
72
|
(this.mode === "modal" || this.mode === "camera"), excluded: this.excluded, productDetailNewTab: this.productDetailNewTab, imageResolutionWidth: this.imageResolutionWidth, exampleImageSource: this.exampleImageSource, textSearchShow: this.textSearchShow })));
|
|
73
73
|
}
|
|
74
74
|
get el() { return index.getElement(this); }
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-5619b5ec.js');
|
|
6
6
|
const search_store = require('./search.store-7605f369.js');
|
|
7
7
|
const i18next = require('./i18next-74ff3413.js');
|
|
8
|
-
const _package = require('./package-
|
|
9
|
-
const customizedSlots = require('./customized-slots-
|
|
10
|
-
const
|
|
8
|
+
const _package = require('./package-20cf59d0.js');
|
|
9
|
+
const customizedSlots = require('./customized-slots-39ba4e52.js');
|
|
10
|
+
const resources = require('./resources-d6fbe545.js');
|
|
11
11
|
const constants = require('./constants-7684cbfc.js');
|
|
12
12
|
|
|
13
13
|
const CameraActionIcon = () => (index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none" },
|
|
@@ -16,67 +16,6 @@ const CameraActionIcon = () => (index.h("svg", { xmlns: "http://www.w3.org/2000/
|
|
|
16
16
|
const UploadActionIcon = () => (index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none" },
|
|
17
17
|
index.h("path", { d: "M4.5 21C4.1 21 3.75 20.85 3.45 20.55C3.15 20.25 3 19.9 3 19.5V4.5C3 4.1 3.15 3.75 3.45 3.45C3.75 3.15 4.1 3 4.5 3H19.5C19.9 3 20.25 3.15 20.55 3.45C20.85 3.75 21 4.1 21 4.5V19.5C21 19.9 20.85 20.25 20.55 20.55C20.25 20.85 19.9 21 19.5 21H4.5ZM6.65 17.075H17.375C17.525 17.075 17.6333 17.0083 17.7 16.875C17.7667 16.7417 17.7583 16.6083 17.675 16.475L14.75 12.575C14.6667 12.475 14.5667 12.425 14.45 12.425C14.3333 12.425 14.2333 12.475 14.15 12.575L11.15 16.45L9.125 13.675C9.04167 13.575 8.94167 13.525 8.825 13.525C8.70833 13.525 8.60833 13.575 8.525 13.675L6.375 16.475C6.275 16.6083 6.25833 16.7417 6.325 16.875C6.39167 17.0083 6.5 17.075 6.65 17.075Z", fill: "currentColor" })));
|
|
18
18
|
|
|
19
|
-
const resources = {
|
|
20
|
-
de: {
|
|
21
|
-
translation: {
|
|
22
|
-
exampleImagesTitle: "Mit den Beispielbildern die Suche direkt ausprobieren",
|
|
23
|
-
imageUploadButtonText: "Bild hochladen",
|
|
24
|
-
cameraButtonTextStart: "Kamera starten",
|
|
25
|
-
cameraButtonTextStop: "Kamera stoppen",
|
|
26
|
-
privacyBadgeText: "Durch das Hochladen eines Bildes willigst Du in die Verarbeitung durch unseren Partner Vviinn ein. Das Bild wird nach einer Stunde Inaktivität gelöscht.",
|
|
27
|
-
teaserText: "Finde Produkte auf \n einem Foto",
|
|
28
|
-
imageSearchModalTitle: "Bildsuche",
|
|
29
|
-
textSearchPlaceholder: "mit Text suchen",
|
|
30
|
-
emptyResultsBlock: {
|
|
31
|
-
title: "Leider nichts gefunden",
|
|
32
|
-
button: "Neues Bild hochladen",
|
|
33
|
-
},
|
|
34
|
-
serverErrorBlock: {
|
|
35
|
-
title: "Keine Verbindung",
|
|
36
|
-
button: "Erneut versuchen",
|
|
37
|
-
},
|
|
38
|
-
wrongFormatBlock: {
|
|
39
|
-
title: "Dateityp wird nicht unterstützt",
|
|
40
|
-
text: "Bitte laden Sie eine .jpg, .png oder .webp Bilddatei hoch.",
|
|
41
|
-
button: "Neues Bild hochladen",
|
|
42
|
-
},
|
|
43
|
-
wrongAspectRatioBlock: {
|
|
44
|
-
title: "Das Bild ist zu schmal",
|
|
45
|
-
button: "Neues Bild hochladen",
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
en: {
|
|
50
|
-
translation: {
|
|
51
|
-
exampleImagesTitle: "Try out the search with the example images",
|
|
52
|
-
imageUploadButtonText: "Upload Photo",
|
|
53
|
-
cameraButtonTextStart: "Start Camera",
|
|
54
|
-
cameraButtonTextStop: "Stop Camera",
|
|
55
|
-
privacyBadgeText: "By uploading a picture you agree to the processing by our partner Vviinn. The image will be deleted after one hour of inactivity.",
|
|
56
|
-
teaserText: "Find Product by Photo",
|
|
57
|
-
imageSearchModalTitle: "Visual Search",
|
|
58
|
-
textSearchPlaceholder: "Search by text",
|
|
59
|
-
emptyResultsBlock: {
|
|
60
|
-
title: "Sorry, nothing found",
|
|
61
|
-
button: "Upload another image",
|
|
62
|
-
},
|
|
63
|
-
serverErrorBlock: {
|
|
64
|
-
title: "Something went wrong",
|
|
65
|
-
button: "Try again",
|
|
66
|
-
},
|
|
67
|
-
wrongFormatBlock: {
|
|
68
|
-
title: "Wrong file format",
|
|
69
|
-
text: "Please upload a .jpg, .png or .webp image file.",
|
|
70
|
-
button: "Upload another file",
|
|
71
|
-
},
|
|
72
|
-
wrongAspectRatioBlock: {
|
|
73
|
-
title: "The image is too narrow",
|
|
74
|
-
button: "Upload another image",
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
|
|
80
19
|
const videoStreamSettings = {
|
|
81
20
|
facingMode: "environment",
|
|
82
21
|
width: { ideal: 1920 },
|
|
@@ -366,7 +305,7 @@ const VviinnVpsWidget = class {
|
|
|
366
305
|
if (this.trackingDeactivated)
|
|
367
306
|
return;
|
|
368
307
|
const _a = this.getBasicEventData(), rest = __rest(_a, ["campaignTypeId"]);
|
|
369
|
-
const searchEvent =
|
|
308
|
+
const searchEvent = resources.createSearchEvent(Object.assign({ session_id: this.uiSessionId, source: this.imageSource, search_area: "manual-selection" }, rest));
|
|
370
309
|
this.trackingApi.trackEvent(searchEvent).then(this.setTrackingDeactivated);
|
|
371
310
|
}
|
|
372
311
|
trackDetectedObject() {
|
|
@@ -374,7 +313,7 @@ const VviinnVpsWidget = class {
|
|
|
374
313
|
if (this.trackingDeactivated)
|
|
375
314
|
return;
|
|
376
315
|
const _a = this.getBasicEventData(), rest = __rest(_a, ["campaignTypeId"]);
|
|
377
|
-
const searchEvent =
|
|
316
|
+
const searchEvent = resources.createSearchEvent(Object.assign({ session_id: this.uiSessionId, source: this.imageSource, search_area: "attention-point" }, rest));
|
|
378
317
|
this.trackingApi.trackEvent(searchEvent).then(this.setTrackingDeactivated);
|
|
379
318
|
}
|
|
380
319
|
trackFilter({ detail }) {
|
|
@@ -382,7 +321,7 @@ const VviinnVpsWidget = class {
|
|
|
382
321
|
if (this.trackingDeactivated)
|
|
383
322
|
return;
|
|
384
323
|
const _a = this.getBasicEventData(), rest = __rest(_a, ["campaignTypeId"]);
|
|
385
|
-
const searchEvent =
|
|
324
|
+
const searchEvent = resources.createFilterEvent(Object.assign({ session_id: this.uiSessionId, source: this.imageSource, kind: detail.kind, action: detail.action }, rest));
|
|
386
325
|
this.trackingApi.trackEvent(searchEvent).then(this.setTrackingDeactivated);
|
|
387
326
|
}
|
|
388
327
|
async trackTextSearchFinished({ detail }) {
|
|
@@ -402,15 +341,15 @@ const VviinnVpsWidget = class {
|
|
|
402
341
|
search_store.searchState.token = this.token;
|
|
403
342
|
search_store.searchState.campaignId = this.campaignId;
|
|
404
343
|
search_store.searchState.excluded = this.excluded;
|
|
405
|
-
this.uiSessionId =
|
|
406
|
-
this.trackingApi =
|
|
344
|
+
this.uiSessionId = resources.v4();
|
|
345
|
+
this.trackingApi = resources.createTrackingApi(this.apiPath, this.token);
|
|
407
346
|
this.id = this.el.id;
|
|
408
347
|
}
|
|
409
348
|
async componentWillLoad() {
|
|
410
349
|
await i18next.instance.init({
|
|
411
350
|
lng: this.locale,
|
|
412
351
|
fallbackLng: "en",
|
|
413
|
-
resources,
|
|
352
|
+
resources: resources.resources,
|
|
414
353
|
});
|
|
415
354
|
customizedSlots.slotChangeListener(this, this.el);
|
|
416
355
|
this.vviinnWidgetLoad.emit(this.getBasicEventData());
|
|
@@ -421,7 +360,7 @@ const VviinnVpsWidget = class {
|
|
|
421
360
|
return;
|
|
422
361
|
const _a = this.getBasicEventData(), rest = __rest(_a, ["campaignTypeId", "widgetType"]);
|
|
423
362
|
const eventBody = Object.assign({ action, session_id: this.uiSessionId }, rest);
|
|
424
|
-
const widgetEvent =
|
|
363
|
+
const widgetEvent = resources.createWidgetVpsEvent(eventBody);
|
|
425
364
|
this.trackingApi.trackEvent(widgetEvent).then(this.setTrackingDeactivated);
|
|
426
365
|
}
|
|
427
366
|
getProductTrackEvent(detail, eventType) {
|
|
@@ -429,21 +368,21 @@ const VviinnVpsWidget = class {
|
|
|
429
368
|
return null;
|
|
430
369
|
const { productRank, productId, campaignTypeId, widgetType, clickEvent } = detail, rest = __rest(detail, ["productRank", "productId", "campaignTypeId", "widgetType", "clickEvent"]);
|
|
431
370
|
const eventBody = Object.assign({ session_id: this.uiSessionId, rank: productRank, product: productId }, rest);
|
|
432
|
-
const productEvent =
|
|
371
|
+
const productEvent = resources.createProductVpsEventByType(eventType)(eventBody);
|
|
433
372
|
return productEvent;
|
|
434
373
|
}
|
|
435
374
|
trackResultEvent(type) {
|
|
436
375
|
if (this.trackingDeactivated)
|
|
437
376
|
return;
|
|
438
377
|
const _a = this.getBasicEventData(), rest = __rest(_a, ["campaignTypeId", "widgetType"]);
|
|
439
|
-
let resultEvent =
|
|
378
|
+
let resultEvent = resources.createResultVpsEventByType(type)(Object.assign({ session_id: this.uiSessionId }, rest));
|
|
440
379
|
this.trackingApi.trackEvent(resultEvent).then(this.setTrackingDeactivated);
|
|
441
380
|
}
|
|
442
381
|
trackInitialSearch() {
|
|
443
382
|
if (this.trackingDeactivated)
|
|
444
383
|
return;
|
|
445
384
|
const _a = this.getBasicEventData(), rest = __rest(_a, ["campaignTypeId", "widgetType"]);
|
|
446
|
-
const searchEvent =
|
|
385
|
+
const searchEvent = resources.createSearchEvent(Object.assign({ session_id: this.uiSessionId, search_area: "full", source: "upload" }, rest));
|
|
447
386
|
this.trackingApi.trackEvent(searchEvent).then(this.setTrackingDeactivated);
|
|
448
387
|
}
|
|
449
388
|
handleImageSelection() {
|
|
@@ -527,7 +466,7 @@ const VviinnVpsWidget = class {
|
|
|
527
466
|
}
|
|
528
467
|
render() {
|
|
529
468
|
var _a;
|
|
530
|
-
return (index.h(index.Host, { exportparts: "text-search-input" }, !this.showingInButton &&
|
|
469
|
+
return (index.h(index.Host, { exportparts: "text-search-input" }, !this.showingInButton && customizedSlots.SlotSkeleton("vps"), index.h("vviinn-overlayed-modal", { class: { "first-screen": this.isOnboardingSlide() }, isFirstScreen: this.isOnboardingSlide(), active: this.active, resetState: this.resetState.bind(this), onVviinnWidgetClose: () => this.handleModalClose(), buttonElementId: (_a = this.buttonElementId) !== null && _a !== void 0 ? _a : this.id, widgetVersion: _package.version, hideBackButton: (this.mode === "upload" && this.showingInButton) ||
|
|
531
470
|
(!this.cameraEnabled && this.isOnboardingSlide()), exportparts: "secondary-action, title, close-button" }, index.h("vviinn-slider", { showBullets: false, position: this.slidePosition }, index.h("vviinn-slide", { class: {
|
|
532
471
|
"start-page": true,
|
|
533
472
|
"camera-enabled": this.cameraEnabled,
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
const
|
|
2
|
+
const vprSlotsNames = [
|
|
3
3
|
"vviinn-recommendations-title",
|
|
4
4
|
"vviinn-recommendations-subtitle",
|
|
5
|
+
"vviinn-basket-button-text",
|
|
6
|
+
"vviinn-basket-button-icon",
|
|
7
|
+
"vviinn-update-button-icon",
|
|
8
|
+
"vviinn-update-button-text",
|
|
9
|
+
];
|
|
10
|
+
const vpsSlotsNames = [
|
|
5
11
|
"vviinn-teaser-text",
|
|
6
12
|
"vviinn-image-upload-button-text",
|
|
7
13
|
"vviinn-image-upload-icon",
|
|
@@ -12,13 +18,11 @@ const defaultSlotsNames = [
|
|
|
12
18
|
"vviinn-text-search-icon",
|
|
13
19
|
"vviinn-privacy-badge-text",
|
|
14
20
|
"vviinn-image-search-modal-title",
|
|
15
|
-
"vviinn-basket-button-text",
|
|
16
|
-
"vviinn-basket-button-icon",
|
|
17
|
-
"vviinn-update-button-icon",
|
|
18
|
-
"vviinn-update-button-text",
|
|
19
21
|
];
|
|
20
22
|
const renderNamedSlot = (name) => h("slot", { name: name });
|
|
21
|
-
export const SlotSkeleton = () =>
|
|
23
|
+
export const SlotSkeleton = (renderType) => {
|
|
24
|
+
return (renderType === "vps" ? vpsSlotsNames : vprSlotsNames).map(renderNamedSlot);
|
|
25
|
+
};
|
|
22
26
|
const getSlots = (element) => Array.from(element.shadowRoot.querySelectorAll("slot"));
|
|
23
27
|
const getNameAttribute = (element) => element.getAttribute("name");
|
|
24
28
|
const getSlotAttribute = (element) => element.getAttribute("slot");
|
|
@@ -28,7 +28,7 @@ import { createTrackingApi } from "../../openApi";
|
|
|
28
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
|
-
import { resources } from "../../locale
|
|
31
|
+
import { resources } from "../../locale";
|
|
32
32
|
import { UpdateIcon } from "../vviinn-icons";
|
|
33
33
|
/**
|
|
34
34
|
* @part product-card - Product Card itself.
|
|
@@ -343,7 +343,7 @@ export class VviinnVprWidget {
|
|
|
343
343
|
loaded: true,
|
|
344
344
|
empty: this.recommendations.length == 0,
|
|
345
345
|
[this.mode]: true,
|
|
346
|
-
}, "aria-hidden": "false" }, h(Fragment, null, this.renderExternalCSS(),
|
|
346
|
+
}, "aria-hidden": "false" }, h(Fragment, null, this.renderExternalCSS(), SlotSkeleton("vpr"), h("style", null, state.fallbackStyles), h("div", { class: "widget-header" }, h("div", null, h("h2", { part: "recommendations-title" }, h("slot", { name: "vviinn-recommendations-title" }, this.isSetMode
|
|
347
347
|
? i18next.t("setMode.widgetTitle")
|
|
348
348
|
: this.blockTitle)), this.isSetMode && (h("h3", { part: "recommendations-subtitle" }, h("slot", { name: "vviinn-recommendations-subtitle" }, i18next.t("setMode.widgetSubtitle"))))), this.isSetMode && this.updateButtonLocation !== "onItem" ? (h("button", { class: "update-button", part: "update-button-top", onClick: () => (this.updatingAllCards = true) }, h("slot", { name: "vviinn-update-button-icon" }, h(UpdateIcon, null)), h("slot", { name: "vviinn-update-button-text" }, h("span", null, i18next.t("setMode.updateButtonText"))))) : null), this.recommendations.length > 0 &&
|
|
349
349
|
(this.useCarousel ? this.renderCarousel() : this.renderResults()), this.recommendations.length === 0 && this.hasErrorOnLoad && (h("p", { class: "no-result-text" }, this.noResultText.length
|
|
@@ -69,7 +69,7 @@ export class VviinnVpsButton {
|
|
|
69
69
|
render() {
|
|
70
70
|
return (h(Host, { tabindex: "0", role: "button" }, h("vviinn-button", { onClick: () => {
|
|
71
71
|
this.handleClick();
|
|
72
|
-
}, addStyle: this.addStyle, part: "vviinn-button" }, h("slot", null, h(CameraIcon, null))),
|
|
72
|
+
}, addStyle: this.addStyle, part: "vviinn-button" }, h("slot", null, h(CameraIcon, null))), SlotSkeleton("vps"), h("vviinn-vps-widget", { mode: this.mode, "currency-sign": this.currencySign, token: this.token, locale: this.locale, apiPath: this.apiPath, exportparts: "brand, deeplink, currency, image, image-link, price-amount-sale, price-amount-outdated, price-amount-regular, price-container, price-outdated, price-regular, price-sale, price-prefix, title, product-card, upload-photo_button, show-files_button, start-camera_button", campaignId: this.campaignId, showingInButton: true, buttonPressed: this.buttonPressed, resetVpsButton: this.resetButton.bind(this), buttonElementId: this.el.id, active: this.buttonPressed &&
|
|
73
73
|
(this.mode === "modal" || this.mode === "camera"), excluded: this.excluded, productDetailNewTab: this.productDetailNewTab, imageResolutionWidth: this.imageResolutionWidth, exampleImageSource: this.exampleImageSource, textSearchShow: this.textSearchShow })));
|
|
74
74
|
}
|
|
75
75
|
static get is() { return "vviinn-vps-button"; }
|
|
@@ -23,7 +23,7 @@ import { createWidgetVpsEvent, createFilterEvent, createSearchEvent, createProdu
|
|
|
23
23
|
import { SlotSkeleton } from "../customized-slots";
|
|
24
24
|
import { campaignTypeNames } from "../../campaign/Campaign";
|
|
25
25
|
import { parseExcluded } from "../../utils/collections/collectionsUtils";
|
|
26
|
-
import { resources } from "../../locale
|
|
26
|
+
import { resources } from "../../locale";
|
|
27
27
|
import { CameraActionIcon, UploadActionIcon } from "../vviinn-icons";
|
|
28
28
|
import { DEFAULT_EXAMPLE_IMAGE } from "../../assets/constants";
|
|
29
29
|
import { videoStreamSettings } from "../../video/settings";
|
|
@@ -467,7 +467,7 @@ export class VviinnVpsWidget {
|
|
|
467
467
|
}
|
|
468
468
|
render() {
|
|
469
469
|
var _a;
|
|
470
|
-
return (h(Host, { exportparts: "text-search-input" }, !this.showingInButton &&
|
|
470
|
+
return (h(Host, { exportparts: "text-search-input" }, !this.showingInButton && SlotSkeleton("vps"), h("vviinn-overlayed-modal", { class: { "first-screen": this.isOnboardingSlide() }, isFirstScreen: this.isOnboardingSlide(), active: this.active, resetState: this.resetState.bind(this), onVviinnWidgetClose: () => this.handleModalClose(), buttonElementId: (_a = this.buttonElementId) !== null && _a !== void 0 ? _a : this.id, widgetVersion: version, hideBackButton: (this.mode === "upload" && this.showingInButton) ||
|
|
471
471
|
(!this.cameraEnabled && this.isOnboardingSlide()), exportparts: "secondary-action, title, close-button" }, h("vviinn-slider", { showBullets: false, position: this.slidePosition }, h("vviinn-slide", { class: {
|
|
472
472
|
"start-page": true,
|
|
473
473
|
"camera-enabled": this.cameraEnabled,
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./resources";
|
|
2
|
+
export * from "./types";
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
export const resources = {
|
|
2
2
|
de: {
|
|
3
3
|
translation: {
|
|
4
|
+
noResultText: "Keine Ergebnisse! Versuche es bitte später erneut.",
|
|
5
|
+
basketButtonText: "In den Warenkorb",
|
|
6
|
+
setMode: {
|
|
7
|
+
widgetTitle: "Kaufen Sie ein Set und erhalten Sie Rabatt",
|
|
8
|
+
widgetSubtitle: "Sparen Sie bis zu 15% beim Kauf von Produkten aus der Liste",
|
|
9
|
+
basketButtonText: "Als Set kaufen",
|
|
10
|
+
appliedDiscountText: "gespart",
|
|
11
|
+
updateButtonText: "Neues Set vorschlagen",
|
|
12
|
+
},
|
|
4
13
|
exampleImagesTitle: "Mit den Beispielbildern die Suche direkt ausprobieren",
|
|
5
14
|
imageUploadButtonText: "Bild hochladen",
|
|
6
15
|
cameraButtonTextStart: "Kamera starten",
|
|
@@ -30,6 +39,15 @@ export const resources = {
|
|
|
30
39
|
},
|
|
31
40
|
en: {
|
|
32
41
|
translation: {
|
|
42
|
+
noResultText: "No results! Please, try again later.",
|
|
43
|
+
basketButtonText: "Add to Basket",
|
|
44
|
+
setMode: {
|
|
45
|
+
widgetTitle: "Buy a set to get discount",
|
|
46
|
+
widgetSubtitle: "Save up to 15% for buying products from the list",
|
|
47
|
+
basketButtonText: "Buy as set",
|
|
48
|
+
appliedDiscountText: "saved",
|
|
49
|
+
updateButtonText: "Suggest New Set",
|
|
50
|
+
},
|
|
33
51
|
exampleImagesTitle: "Try out the search with the example images",
|
|
34
52
|
imageUploadButtonText: "Upload Photo",
|
|
35
53
|
cameraButtonTextStart: "Start Camera",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -13,9 +13,15 @@ function fromString(s) {
|
|
|
13
13
|
return s === "VPR" ? { _tag: "VPR" } : { _tag: "VCS" };
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const vprSlotsNames = [
|
|
17
17
|
"vviinn-recommendations-title",
|
|
18
18
|
"vviinn-recommendations-subtitle",
|
|
19
|
+
"vviinn-basket-button-text",
|
|
20
|
+
"vviinn-basket-button-icon",
|
|
21
|
+
"vviinn-update-button-icon",
|
|
22
|
+
"vviinn-update-button-text",
|
|
23
|
+
];
|
|
24
|
+
const vpsSlotsNames = [
|
|
19
25
|
"vviinn-teaser-text",
|
|
20
26
|
"vviinn-image-upload-button-text",
|
|
21
27
|
"vviinn-image-upload-icon",
|
|
@@ -26,13 +32,11 @@ const defaultSlotsNames = [
|
|
|
26
32
|
"vviinn-text-search-icon",
|
|
27
33
|
"vviinn-privacy-badge-text",
|
|
28
34
|
"vviinn-image-search-modal-title",
|
|
29
|
-
"vviinn-basket-button-text",
|
|
30
|
-
"vviinn-basket-button-icon",
|
|
31
|
-
"vviinn-update-button-icon",
|
|
32
|
-
"vviinn-update-button-text",
|
|
33
35
|
];
|
|
34
36
|
const renderNamedSlot = (name) => h("slot", { name: name });
|
|
35
|
-
const SlotSkeleton = () =>
|
|
37
|
+
const SlotSkeleton = (renderType) => {
|
|
38
|
+
return (renderType === "vps" ? vpsSlotsNames : vprSlotsNames).map(renderNamedSlot);
|
|
39
|
+
};
|
|
36
40
|
const getSlots = (element) => Array.from(element.shadowRoot.querySelectorAll("slot"));
|
|
37
41
|
const getNameAttribute = (element) => element.getAttribute("name");
|
|
38
42
|
const getSlotAttribute = (element) => element.getAttribute("slot");
|