vviinn-widgets 2.17.9 → 2.18.3
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/cropper-handler_27.cjs.entry.js +28 -9
- package/dist/cjs/{customized-slots-6b38279f.js → customized-slots-8a1a9aed.js} +8 -7
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/vviinn-carousel_2.cjs.entry.js +9 -1
- package/dist/cjs/vviinn-recommendations-sidebar.cjs.entry.js +4 -1
- package/dist/cjs/vviinn-vpr-button.cjs.entry.js +5 -0
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +2 -2
- package/dist/cjs/vviinn-widgets.cjs.js +1 -1
- package/dist/collection/components/customized-slots.js +8 -7
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.js +11 -2
- package/dist/collection/components/vviinn-image-view/vviinn-image-view.css +10 -9
- package/dist/collection/components/vviinn-modal/vviinn-modal.js +8 -2
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-1/vviinn-onboarding-card-1.js +3 -3
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-2/vviinn-onboarding-card-2.js +3 -3
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-3/vviinn-onboarding-card-3.js +3 -3
- package/dist/collection/components/vviinn-slider/vviinn-slider.js +15 -6
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js +43 -1
- package/dist/collection/components/vviinn-vpr-button/stories/args.js +6 -0
- package/dist/collection/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.js +15 -1
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +44 -0
- package/dist/collection/components/vviinn-vpr-widget/stories/vviinn-vpr-widget.stories.js +23 -23
- package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +8 -7
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +53 -7
- package/dist/esm/cropper-handler_27.entry.js +28 -9
- package/dist/esm/{customized-slots-aa123817.js → customized-slots-4f7327c6.js} +8 -7
- package/dist/esm/loader.js +1 -1
- package/dist/esm/vviinn-carousel_2.entry.js +9 -1
- package/dist/esm/vviinn-recommendations-sidebar.entry.js +4 -1
- package/dist/esm/vviinn-vpr-button.entry.js +5 -0
- package/dist/esm/vviinn-vps-button.entry.js +2 -2
- package/dist/esm/vviinn-widgets.js +1 -1
- package/dist/types/components/vviinn-carousel/vviinn-carousel.d.ts +2 -0
- package/dist/types/components/vviinn-modal/vviinn-modal.d.ts +2 -0
- package/dist/types/components/vviinn-product-card/stories/decorators.d.ts +1 -1
- package/dist/types/components/vviinn-product-card/stories/vviinn-product-card.stories.d.ts +1 -1
- package/dist/types/components/vviinn-slider/vviinn-slider.d.ts +3 -0
- package/dist/types/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.d.ts +3 -0
- package/dist/types/components/vviinn-vpr-button/stories/args.d.ts +6 -0
- package/dist/types/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.d.ts +7 -1
- package/dist/types/components/vviinn-vpr-button/vviinn-vpr-button.d.ts +3 -0
- package/dist/types/components/vviinn-vpr-widget/stories/decorators.d.ts +2 -2
- package/dist/types/components/vviinn-vpr-widget/stories/vviinn-vpr-widget.stories.d.ts +1 -1
- package/dist/types/components/vviinn-vps-button/stories/vviinn-vps-button.stories.d.ts +1 -1
- package/dist/types/components/vviinn-vps-button/vviinn-vps-button.d.ts +7 -6
- package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +13 -6
- package/dist/types/components.d.ts +14 -0
- package/dist/types/interfaces/generated.d.ts +0 -114
- package/dist/vviinn-widgets/p-2ebfde1e.entry.js +1 -0
- package/dist/vviinn-widgets/p-7e9f9325.entry.js +1 -0
- package/dist/vviinn-widgets/p-7ed1f1b5.js +1 -0
- package/dist/vviinn-widgets/p-97243fdc.entry.js +1 -0
- package/dist/vviinn-widgets/p-ad1b0872.entry.js +1 -0
- package/dist/vviinn-widgets/p-c5b1ff23.entry.js +1 -0
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +1 -1
- package/www/build/p-2ebfde1e.entry.js +1 -0
- package/www/build/{p-a38523da.js → p-7ddda4b2.js} +2 -2
- package/www/build/p-7e9f9325.entry.js +1 -0
- package/www/build/p-7ed1f1b5.js +1 -0
- package/www/build/p-97243fdc.entry.js +1 -0
- package/www/build/p-ad1b0872.entry.js +1 -0
- package/www/build/p-c5b1ff23.entry.js +1 -0
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +4 -1
- package/dist/vviinn-widgets/p-06d86abe.entry.js +0 -1
- package/dist/vviinn-widgets/p-1013a00f.entry.js +0 -1
- package/dist/vviinn-widgets/p-132c12eb.entry.js +0 -1
- package/dist/vviinn-widgets/p-7a773bb6.js +0 -1
- package/dist/vviinn-widgets/p-d6c85b74.entry.js +0 -1
- package/dist/vviinn-widgets/p-fb14ace7.entry.js +0 -1
- package/www/build/p-06d86abe.entry.js +0 -1
- package/www/build/p-1013a00f.entry.js +0 -1
- package/www/build/p-132c12eb.entry.js +0 -1
- package/www/build/p-7a773bb6.js +0 -1
- package/www/build/p-d6c85b74.entry.js +0 -1
- package/www/build/p-fb14ace7.entry.js +0 -1
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-0bda22ec.js');
|
|
6
6
|
const index$1 = require('./index-8e47383c.js');
|
|
7
7
|
const index$2 = require('./index-5ce4918b.js');
|
|
8
|
-
const customizedSlots = require('./customized-slots-
|
|
8
|
+
const customizedSlots = require('./customized-slots-8a1a9aed.js');
|
|
9
9
|
|
|
10
10
|
const cropperHandlerCss = ":host{--size:20px;background:transparent;border:4px solid white;box-sizing:content-box;display:block;height:var(--size);touch-action:none;position:absolute;width:var(--size);z-index:4;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host(.disabled){opacity:0.25}:host(.nw-resize){border-bottom:none;border-right:none;top:0;left:0}:host(.ne-resize){border-left:none;border-bottom:none;right:0;top:0}:host(.sw-resize){border-right:none;border-top:none;left:0;bottom:0}:host(.se-resize){border-left:none;border-top:none;bottom:0;right:0}";
|
|
11
11
|
|
|
@@ -420,7 +420,7 @@ let VviinnImageSelector = class {
|
|
|
420
420
|
};
|
|
421
421
|
VviinnImageSelector.style = vviinnImageSelectorCss;
|
|
422
422
|
|
|
423
|
-
const vviinnImageViewCss = ":host{display:grid;position:relative;justify-self:center}img{box-sizing:border-box;filter:brightness(60%);position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:-1}.image-preloader{background:rgba(0, 0, 0, 0.25);border-radius:4px;bottom:18px;padding:4px 6px;pointer-events:none;position:absolute;right:18px;z-index:4}vviinn-preloader{--preloader-size:12px}";
|
|
423
|
+
const vviinnImageViewCss = ":host{display:grid;position:relative;justify-self:center;direction:ltr}img{box-sizing:border-box;filter:brightness(60%);position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:-1}.image-preloader{background:rgba(0, 0, 0, 0.25);border-radius:4px;bottom:18px;padding:4px 6px;pointer-events:none;position:absolute;right:18px;z-index:4}vviinn-preloader{--preloader-size:12px}";
|
|
424
424
|
|
|
425
425
|
const getImageSizes = (i) => {
|
|
426
426
|
const dimensions = index$1.dimensionsFromImage(i);
|
|
@@ -477,6 +477,9 @@ let VviinnModal = class {
|
|
|
477
477
|
this.active = false;
|
|
478
478
|
this.slider = false;
|
|
479
479
|
}
|
|
480
|
+
componentWillLoad() {
|
|
481
|
+
customizedSlots.slotChangeListener(this, this.el);
|
|
482
|
+
}
|
|
480
483
|
close() {
|
|
481
484
|
this.active = false;
|
|
482
485
|
setTimeout(() => {
|
|
@@ -489,8 +492,9 @@ let VviinnModal = class {
|
|
|
489
492
|
this.slider = true;
|
|
490
493
|
}
|
|
491
494
|
render() {
|
|
492
|
-
return (index.h(index.Host, { exportparts: "secondary-action, title, close-button", class: { closed: !this.active }, onAnimationEnd: (ev) => this.handleAnimationEnd(ev) }, index.h("div", { class: "head" }, index.h("button", { part: "secondary-action", onClick: () => this.secondaryActionClicked.emit() }, index.h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M20.25 12H3.75", stroke: "#161616", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("path", { d: "M10.5 5.25L3.75 12L10.5 18.75", stroke: "#161616", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }))), index.h("div", { class: "title", part: "title" }, "Bildsuche"), index.h("button", { onClick: () => this.close(), class: "close-button", part: "close-button" }, index.h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M16 1.4L14.6 0L8 6.6L1.4 0L0 1.4L6.6 8L0 14.6L1.4 16L8 9.4L14.6 16L16 14.6L9.4 8L16 1.4Z", fill: "#333333" })))), index.h("div", { class: "body" }, index.h("slot", null))));
|
|
495
|
+
return (index.h(index.Host, { exportparts: "secondary-action, title, close-button", class: { closed: !this.active }, onAnimationEnd: (ev) => this.handleAnimationEnd(ev) }, index.h("div", { class: "head" }, index.h("button", { part: "secondary-action", onClick: () => this.secondaryActionClicked.emit() }, index.h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M20.25 12H3.75", stroke: "#161616", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("path", { d: "M10.5 5.25L3.75 12L10.5 18.75", stroke: "#161616", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }))), index.h("div", { class: "title", part: "title" }, index.h("slot", { name: "vviinn-image-search-modal-title" }, "Bildsuche")), index.h("button", { onClick: () => this.close(), class: "close-button", part: "close-button" }, index.h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M16 1.4L14.6 0L8 6.6L1.4 0L0 1.4L6.6 8L0 14.6L1.4 16L8 9.4L14.6 16L16 14.6L9.4 8L16 1.4Z", fill: "#333333" })))), index.h("div", { class: "body" }, index.h("slot", null))));
|
|
493
496
|
}
|
|
497
|
+
get el() { return index.getElement(this); }
|
|
494
498
|
};
|
|
495
499
|
VviinnModal.style = vviinnModalCss;
|
|
496
500
|
|
|
@@ -845,15 +849,19 @@ let VviinnSlider = class {
|
|
|
845
849
|
this.elementsCount = 0;
|
|
846
850
|
this.internalPosition = 0;
|
|
847
851
|
this.swipeStartPosition = index$1.Option.none;
|
|
852
|
+
this.isRTL = false;
|
|
848
853
|
this.showBullets = true;
|
|
849
854
|
this.position = 0;
|
|
850
855
|
this.showArrows = false;
|
|
851
856
|
}
|
|
852
857
|
positionWatchHandler(newValue) {
|
|
853
858
|
this.internalPosition = newValue;
|
|
854
|
-
this.el.style.setProperty("--position", `${newValue}`);
|
|
859
|
+
this.el.style.setProperty("--position", `${this.calculatePosition(newValue)}`);
|
|
855
860
|
this.setActiveCssClassToSlide(newValue);
|
|
856
861
|
}
|
|
862
|
+
componentWillLoad() {
|
|
863
|
+
this.isRTL = document.dir === "rtl";
|
|
864
|
+
}
|
|
857
865
|
connectedCallback() {
|
|
858
866
|
this.handleDomContentChanges();
|
|
859
867
|
}
|
|
@@ -876,7 +884,7 @@ let VviinnSlider = class {
|
|
|
876
884
|
renderBullets() {
|
|
877
885
|
return this.showBullets ? (index.h("div", { class: "controls" }, index$1.NonEmptyArray.range(0, this.elementsCount - 1).map((i) => (index.h("div", { class: {
|
|
878
886
|
bullet: true,
|
|
879
|
-
active: i == this.internalPosition % this.elementsCount,
|
|
887
|
+
active: i == Math.abs(this.internalPosition) % this.elementsCount,
|
|
880
888
|
}, onClick: () => this.goToSlide(i) }))))) : null;
|
|
881
889
|
}
|
|
882
890
|
nextSlide() {
|
|
@@ -890,10 +898,14 @@ let VviinnSlider = class {
|
|
|
890
898
|
this.renderSlidePosition();
|
|
891
899
|
}
|
|
892
900
|
renderSlidePosition() {
|
|
901
|
+
const position = this.internalPosition % this.elementsCount;
|
|
893
902
|
requestAnimationFrame(() => {
|
|
894
|
-
this.el.style.setProperty("--position", `${this.
|
|
903
|
+
this.el.style.setProperty("--position", `${this.calculatePosition(position)}`);
|
|
895
904
|
});
|
|
896
905
|
}
|
|
906
|
+
calculatePosition(position) {
|
|
907
|
+
return this.isRTL ? position * -1 : position;
|
|
908
|
+
}
|
|
897
909
|
handleKeyDown(event) {
|
|
898
910
|
if (event.key !== "Space" && event.key !== "Enter")
|
|
899
911
|
return;
|
|
@@ -929,8 +941,8 @@ let VviinnSlider = class {
|
|
|
929
941
|
render() {
|
|
930
942
|
return (index.h(index.Host, null, index.h("div", { class: "items-wrapper" }, index.h("div", { class: "items", onTouchStart: (e) => this.handleTouchStart(e), onTouchEnd: (e) => this.handleTouchEnd(e) }, index.h("slot", null))), this.showArrows
|
|
931
943
|
? [
|
|
932
|
-
index.h(Arrow, { kind: "prev", onClick: () => this.prevSlide(), onKeyDown: (ev) => this.handleKeyDown(ev), tabindex: 1, disabled: false }),
|
|
933
|
-
index.h(Arrow, { kind: "next", onClick: () => this.nextSlide(), onKeyDown: (ev) => this.handleKeyDown(ev), tabindex: 0, disabled: false }),
|
|
944
|
+
index.h(Arrow, { kind: "prev", onClick: () => this.isRTL ? this.nextSlide() : this.prevSlide(), onKeyDown: (ev) => this.handleKeyDown(ev), tabindex: 1, disabled: false }),
|
|
945
|
+
index.h(Arrow, { kind: "next", onClick: () => this.isRTL ? this.prevSlide() : this.nextSlide(), onKeyDown: (ev) => this.handleKeyDown(ev), tabindex: 0, disabled: false }),
|
|
934
946
|
]
|
|
935
947
|
: null, this.renderBullets()));
|
|
936
948
|
}
|
|
@@ -965,6 +977,7 @@ const notNan = (n) => !isNaN(n);
|
|
|
965
977
|
let VviinnVpsWidget = class {
|
|
966
978
|
constructor(hostRef) {
|
|
967
979
|
index.registerInstance(this, hostRef);
|
|
980
|
+
this.globalSlotsChanged = index.createEvent(this, "globalSlotsChanged", 7);
|
|
968
981
|
/** @internal */
|
|
969
982
|
this.apiPath = "https://api.vviinn.com";
|
|
970
983
|
/** When true modal window with widget will be shown */
|
|
@@ -973,6 +986,8 @@ let VviinnVpsWidget = class {
|
|
|
973
986
|
this.currencySign = "€";
|
|
974
987
|
/** Locale for currency formatting */
|
|
975
988
|
this.locale = "de-DE";
|
|
989
|
+
/** set true when showing the widget in button */
|
|
990
|
+
this.showingInButton = false;
|
|
976
991
|
this.slidePosition = 0;
|
|
977
992
|
this.width = 0;
|
|
978
993
|
this.wrongImageFormat = false;
|
|
@@ -984,6 +999,10 @@ let VviinnVpsWidget = class {
|
|
|
984
999
|
}
|
|
985
1000
|
};
|
|
986
1001
|
}
|
|
1002
|
+
componentDidLoad() {
|
|
1003
|
+
const slots = this.el.querySelectorAll("[slot]");
|
|
1004
|
+
this.globalSlotsChanged.emit(Array.from(slots));
|
|
1005
|
+
}
|
|
987
1006
|
activeWatcher(value) {
|
|
988
1007
|
if (value) {
|
|
989
1008
|
this.overflow = document.body.style.overflow;
|
|
@@ -1126,7 +1145,7 @@ let VviinnVpsWidget = class {
|
|
|
1126
1145
|
.then(this.setTrackingDeactivated);
|
|
1127
1146
|
}
|
|
1128
1147
|
render() {
|
|
1129
|
-
return (index.h(index.Host, null, index.h("vviinn-overlayed-modal", { class: { "first-screen": this.slidePosition === 0 }, active: this.active, onSecondaryActionClicked: () => this.resetState(), onModalClosed: () => this.handleModalClose(), exportparts: "secondary-action, title, close-button, example-images" }, index.h("vviinn-slider", { showBullets: false, position: this.slidePosition }, index.h("vviinn-slide", { class: { "start-page": true } }, index.h("div", { class: {
|
|
1148
|
+
return (index.h(index.Host, null, !this.showingInButton && index.h(customizedSlots.SlotSkeleton, null), index.h("vviinn-overlayed-modal", { class: { "first-screen": this.slidePosition === 0 }, active: this.active, onSecondaryActionClicked: () => this.resetState(), onModalClosed: () => this.handleModalClose(), exportparts: "secondary-action, title, close-button, example-images" }, index.h("vviinn-slider", { showBullets: false, position: this.slidePosition }, index.h("vviinn-slide", { class: { "start-page": true } }, index.h("div", { class: {
|
|
1130
1149
|
error: this.haveErrors(),
|
|
1131
1150
|
"start-page_block": true,
|
|
1132
1151
|
} }, index.h("vviinn-wrong-format", { class: { hidden: !this.wrongImageFormat }, onActionClick: () => (this.wrongImageFormat = false) }), index.h("vviinn-server-error", { class: { hidden: !index$1.imageSearchState.serverError }, onActionClick: () => (index$1.imageSearchState.serverError = false) }), index.h("vviinn-teaser", { class: { hidden: this.haveErrors() } }), index.h("vviinn-image-selector", { class: { hidden: this.haveErrors() }, onImageSelected: () => this.handleImageSelection("upload"), onImageSelectedError: () => (this.wrongImageFormat = true), part: "select-image_button" }, index.h("span", { slot: "upload-button-text", class: "upload-button-content" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "29", height: "28", fill: "none" }, index.h("defs", null), index.h("path", { fill: "#fff", "fill-rule": "evenodd", d: "M10.271 3.89A.875.875 0 0111 3.5h7c.293 0 .566.146.728.39l1.49 2.235h3.033a2.625 2.625 0 012.625 2.625V21a2.625 2.625 0 01-2.625 2.625H5.75A2.625 2.625 0 013.125 21V8.75A2.625 2.625 0 015.75 6.125h3.031l1.49-2.235zm1.197 1.36l-1.49 2.235a.875.875 0 01-.729.39H5.75a.875.875 0 00-.875.875V21a.875.875 0 00.875.875h17.5a.875.875 0 00.875-.875V8.75a.875.875 0 00-.875-.875h-3.5a.875.875 0 01-.729-.39l-1.49-2.235h-6.063z", "clip-rule": "evenodd" }), index.h("path", { fill: "#fff", "fill-rule": "evenodd", d: "M14.5 11.375a3.062 3.062 0 100 6.125 3.062 3.062 0 000-6.125zm-4.813 3.063a4.812 4.812 0 119.625 0 4.812 4.812 0 01-9.625 0z", "clip-rule": "evenodd" })), index.h("slot", { name: "vviinn-image-upload-button-text" }, index.h("span", null, "Kamera oder Bild ausw\u00E4hlen")))), index.h("vviinn-privacy-badge", { class: { hidden: this.haveErrors() } })), index.h("div", { id: "onboarding-block", class: "start-page_block" }, index.h("div", { class: "onboarding-wrapper" }, index.h("vviinn-onboarding", null), index.h("vviinn-example-images", { part: "example-images", onImageSelected: () => this.handleImageSelection("example"), onImageSelectedError: () => this.resetScroll("onboarding-block", "smooth") })))), index.h("vviinn-slide", { class: { "results-page": true, active: this.slidePosition == 1 } }, index.h("div", { class: "image-wrapper" }, index.h("vviinn-image-view", null), index.h("div", { class: "filters-wrapper" }, index.h("div", { class: "filters" }, index$1.imageSearchState.filters.map((filter) => (index.h("search-filters", { filter: filter })))))), index.h("div", { id: "results-block", class: "products-wrapper" }, index.h("div", { class: {
|
|
@@ -4,12 +4,12 @@ const index = require('./index-0bda22ec.js');
|
|
|
4
4
|
|
|
5
5
|
const defaultSlotsNames = [
|
|
6
6
|
"vviinn-onboarding-title",
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
7
|
+
"onboarding-card-1-icon",
|
|
8
|
+
"onboarding-card-1-text",
|
|
9
|
+
"onboarding-card-2-icon",
|
|
10
|
+
"onboarding-card-2-text",
|
|
11
|
+
"onboarding-card-3-icon",
|
|
12
|
+
"onboarding-card-3-text",
|
|
13
13
|
"vviinn-example-images-title",
|
|
14
14
|
"vviinn-example-images-1",
|
|
15
15
|
"vviinn-example-images-2",
|
|
@@ -17,7 +17,8 @@ const defaultSlotsNames = [
|
|
|
17
17
|
"vviinn-example-images-4",
|
|
18
18
|
"vviinn-teaser-text",
|
|
19
19
|
"vviinn-image-upload-button-text",
|
|
20
|
-
"vviinn-privacy-badge-text"
|
|
20
|
+
"vviinn-privacy-badge-text",
|
|
21
|
+
"vviinn-image-search-modal-title",
|
|
21
22
|
];
|
|
22
23
|
const renderNamedSlot = (name) => index.h("slot", { name: name });
|
|
23
24
|
const SlotSkeleton = () => defaultSlotsNames.map(renderNamedSlot);
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["cropper-handler_27.cjs",[[1,"vviinn-vps-widget",{"token":[1],"apiPath":[1,"api-path"],"active":[1028],"currencySign":[1,"currency-sign"],"locale":[1],"campaignId":[1,"campaign-id"],"slidePosition":[32],"width":[32],"wrongImageFormat":[32],"trackingDeactivated":[32]},[[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"],[0,"cropperChanged","trachSearchAreaChanges"],[0,"detectedObjectClicked","trackDetectedObject"],[0,"filterSelected","trackFilter"]]],[1,"vviinn-image-view"],[1,"vviinn-onboarding"],[1,"vviinn-example-images",null,[[0,"exampleImageSelected","handleImageSelection"],[0,"exampleImageError","handleImageSelectionError"]]],[1,"vviinn-overlayed-modal",{"active":[4]}],[1,"vviinn-empty-results"],[1,"vviinn-image-selector"],[1,"vviinn-server-error"],[1,"vviinn-wrong-format"],[1,"search-filters",{"filter":[16],"selectedCategoryId":[32],"hideFilters":[32]}],[1,"vviinn-privacy-badge"],[1,"vviinn-teaser"],[1,"image-cropper",{"disabled":[4],"handleMove":[32]}],[1,"vviinn-example-image",{"src":[1],"width":[2],"height":[2],"selected":[32]}],[1,"highlight-box"],[1,"vviinn-detected-object",{"detectedObject":[16],"position":[32]}],[1,"vviinn-modal",{"active":[1540],"slider":[32]}],[1,"vviinn-onboarding-card-1"],[1,"vviinn-onboarding-card-2"],[1,"vviinn-onboarding-card-3"],[1,"vviinn-overlay"],[1,"vviinn-slide"],[1,"vviinn-slider",{"showBullets":[4,"show-bullets"],"position":[514],"showArrows":[4,"show-arrows"],"elementsCount":[32],"internalPosition":[32],"swipeStartPosition":[32]}],[1,"cropper-handler",{"handler":[16],"disabled":[4]}],[1,"vviinn-error"],[1,"vviinn-preloader"],[1,"vviinn-product-card",{"brand":[1],"currency":[1],"deeplink":[1],"image":[1],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"locale":[1],"price":[2],"pricePrefix":[1,"price-prefix"],"productId":[1,"product-id"],"productTitle":[1,"product-title"],"productType":[1,"product-type"],"salePrice":[2,"sale-price"],"responsive":[4],"dimmedBackground":[4,"dimmed-background"],"index":[2],"imageLoaded":[32]}]]],["vviinn-vps-button.cjs",[[1,"vviinn-vps-button",{"token":[1],"currencySign":[1,"currency-sign"],"locale":[1],"campaignId":[1,"campaign-id"],"addStyle":[4,"add-style"],"apiPath":[1,"api-path"],"pressed":[32]},[[0,"modalClosed","handleModalClosed"]]]]],["vviinn-carousel_2.cjs",[[1,"vviinn-vpr-widget",{"blockTitle":[1,"block-title"],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"productId":[1,"product-id"],"token":[1],"currencySign":[1,"currency-sign"],"pricePrefix":[1,"price-prefix"],"mode":[1],"campaignType":[1,"campaign-type"],"locale":[1],"campaigns":[1],"color":[1],"apiPath":[1,"api-path"],"useCarousel":[4,"use-carousel"],"showScroll":[4,"show-scroll"],"cssUrl":[1,"css-url"],"recommendations":[32],"loaded":[32],"trackingDeactivated":[32]},[[0,"productImageLoaded","handleImageLoading"],[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"]]],[0,"vviinn-carousel",{"mode":[1],"imageWidth":[2,"image-width"],"showScroll":[4,"show-scroll"],"recommendations":[16],"moveDirection":[32],"contentGroups":[32],"activeContentGroup":[32]}]]],["vviinn-recommendations-sidebar.cjs",[[1,"vviinn-recommendations-sidebar",{"sidebarTitle":[1,"sidebar-title"],"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"widgetScrollbar":[4,"widget-scrollbar"],"mode":[1],"campaigns":[1],"color":[1],"imageWidth":[2,"image-width"],"state":[32]},[[16,"click","bodyClickListener"]]]]],["vviinn-button.cjs",[[1,"vviinn-button",{"addStyle":[4,"add-style"]}]]],["vviinn-vpr-button.cjs",[[1,"vviinn-vpr-button",{"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"sidebarTitle":[1,"sidebar-title"],"modalScrollbar":[4,"modal-scrollbar"],"campaigns":[1],"color":[1],"addStyle":[4,"add-style"],"mode":[1],"imageWidth":[2,"image-width"]}]]]], options);
|
|
17
|
+
return index.bootstrapLazy([["cropper-handler_27.cjs",[[1,"vviinn-vps-widget",{"token":[1],"apiPath":[1,"api-path"],"active":[1028],"currencySign":[1,"currency-sign"],"locale":[1],"campaignId":[1,"campaign-id"],"showingInButton":[4,"showing-in-button"],"slidePosition":[32],"width":[32],"wrongImageFormat":[32],"trackingDeactivated":[32]},[[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"],[0,"cropperChanged","trachSearchAreaChanges"],[0,"detectedObjectClicked","trackDetectedObject"],[0,"filterSelected","trackFilter"]]],[1,"vviinn-image-view"],[1,"vviinn-onboarding"],[1,"vviinn-example-images",null,[[0,"exampleImageSelected","handleImageSelection"],[0,"exampleImageError","handleImageSelectionError"]]],[1,"vviinn-overlayed-modal",{"active":[4]}],[1,"vviinn-empty-results"],[1,"vviinn-image-selector"],[1,"vviinn-server-error"],[1,"vviinn-wrong-format"],[1,"search-filters",{"filter":[16],"selectedCategoryId":[32],"hideFilters":[32]}],[1,"vviinn-privacy-badge"],[1,"vviinn-teaser"],[1,"image-cropper",{"disabled":[4],"handleMove":[32]}],[1,"vviinn-example-image",{"src":[1],"width":[2],"height":[2],"selected":[32]}],[1,"highlight-box"],[1,"vviinn-detected-object",{"detectedObject":[16],"position":[32]}],[1,"vviinn-modal",{"active":[1540],"slider":[32]}],[1,"vviinn-onboarding-card-1"],[1,"vviinn-onboarding-card-2"],[1,"vviinn-onboarding-card-3"],[1,"vviinn-overlay"],[1,"vviinn-slide"],[1,"vviinn-slider",{"showBullets":[4,"show-bullets"],"position":[514],"showArrows":[4,"show-arrows"],"elementsCount":[32],"internalPosition":[32],"swipeStartPosition":[32],"isRTL":[32]}],[1,"cropper-handler",{"handler":[16],"disabled":[4]}],[1,"vviinn-error"],[1,"vviinn-preloader"],[1,"vviinn-product-card",{"brand":[1],"currency":[1],"deeplink":[1],"image":[1],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"locale":[1],"price":[2],"pricePrefix":[1,"price-prefix"],"productId":[1,"product-id"],"productTitle":[1,"product-title"],"productType":[1,"product-type"],"salePrice":[2,"sale-price"],"responsive":[4],"dimmedBackground":[4,"dimmed-background"],"index":[2],"imageLoaded":[32]}]]],["vviinn-vps-button.cjs",[[1,"vviinn-vps-button",{"token":[1],"currencySign":[1,"currency-sign"],"locale":[1],"campaignId":[1,"campaign-id"],"addStyle":[4,"add-style"],"apiPath":[1,"api-path"],"pressed":[32]},[[0,"modalClosed","handleModalClosed"]]]]],["vviinn-carousel_2.cjs",[[1,"vviinn-vpr-widget",{"blockTitle":[1,"block-title"],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"productId":[1,"product-id"],"token":[1],"currencySign":[1,"currency-sign"],"pricePrefix":[1,"price-prefix"],"mode":[1],"campaignType":[1,"campaign-type"],"locale":[1],"campaigns":[1],"color":[1],"apiPath":[1,"api-path"],"useCarousel":[4,"use-carousel"],"showScroll":[4,"show-scroll"],"cssUrl":[1,"css-url"],"recommendations":[32],"loaded":[32],"trackingDeactivated":[32]},[[0,"productImageLoaded","handleImageLoading"],[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"]]],[0,"vviinn-carousel",{"mode":[1],"imageWidth":[2,"image-width"],"showScroll":[4,"show-scroll"],"recommendations":[16],"moveDirection":[32],"contentGroups":[32],"activeContentGroup":[32],"isRTL":[32]}]]],["vviinn-recommendations-sidebar.cjs",[[1,"vviinn-recommendations-sidebar",{"sidebarTitle":[1,"sidebar-title"],"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"widgetScrollbar":[4,"widget-scrollbar"],"mode":[1],"campaigns":[1],"color":[1],"imageWidth":[2,"image-width"],"currencySign":[1,"currency-sign"],"apiPath":[1,"api-path"],"state":[32]},[[16,"click","bodyClickListener"]]]]],["vviinn-button.cjs",[[1,"vviinn-button",{"addStyle":[4,"add-style"]}]]],["vviinn-vpr-button.cjs",[[1,"vviinn-vpr-button",{"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"sidebarTitle":[1,"sidebar-title"],"modalScrollbar":[4,"modal-scrollbar"],"campaigns":[1],"color":[1],"addStyle":[4,"add-style"],"mode":[1],"imageWidth":[2,"image-width"],"currencySign":[1,"currency-sign"],"apiPath":[1,"api-path"]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -18,6 +18,7 @@ let VviinnCarousel = class {
|
|
|
18
18
|
this.moveDirection = "right";
|
|
19
19
|
this.contentGroups = [];
|
|
20
20
|
this.activeContentGroup = 0;
|
|
21
|
+
this.isRTL = false;
|
|
21
22
|
this.mode = "continuity";
|
|
22
23
|
this.imageWidth = 140;
|
|
23
24
|
this.showScroll = true;
|
|
@@ -26,6 +27,9 @@ let VviinnCarousel = class {
|
|
|
26
27
|
this.resizeObserver = new ResizeObserver(() => this.handleResize());
|
|
27
28
|
this.mutationObserver = new MutationObserver(() => this.cloneSlottedContent());
|
|
28
29
|
}
|
|
30
|
+
componentWillLoad() {
|
|
31
|
+
this.isRTL = document.dir === "rtl";
|
|
32
|
+
}
|
|
29
33
|
connectedCallback() {
|
|
30
34
|
this.setItemWidth();
|
|
31
35
|
}
|
|
@@ -105,7 +109,11 @@ let VviinnCarousel = class {
|
|
|
105
109
|
const indexedPositions = groupsPositions
|
|
106
110
|
.map((value, index) => [value, index])
|
|
107
111
|
.filter((x) => x[0] >= 0);
|
|
108
|
-
return indexedPositions.length > 0
|
|
112
|
+
return indexedPositions.length > 0
|
|
113
|
+
? this.isRTL
|
|
114
|
+
? indexedPositions[indexedPositions.length - 1][1]
|
|
115
|
+
: indexedPositions[0][1]
|
|
116
|
+
: 0;
|
|
109
117
|
}
|
|
110
118
|
getContentNode() {
|
|
111
119
|
return this.el.querySelector(".content");
|
|
@@ -18,6 +18,9 @@ let RecommendationsSidebar = class {
|
|
|
18
18
|
/** comma-separated list of campaign-ids */
|
|
19
19
|
this.campaigns = "";
|
|
20
20
|
this.imageWidth = 300;
|
|
21
|
+
this.currencySign = "€";
|
|
22
|
+
/** @internal */
|
|
23
|
+
this.apiPath = "https://api.vviinn.com";
|
|
21
24
|
this.state = "idle";
|
|
22
25
|
}
|
|
23
26
|
bodyClickListener(event) {
|
|
@@ -45,7 +48,7 @@ let RecommendationsSidebar = class {
|
|
|
45
48
|
return (_a = this.el.shadowRoot.querySelector("aside")) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
46
49
|
}
|
|
47
50
|
render() {
|
|
48
|
-
return (index.h(index.Host, { class: this.getClassMap() }, index.h("aside", { class: "sidebar", part: "body", onAnimationEnd: (e) => this.handleAnimationEnd(e) }, index.h("header", { class: { "contains-source-img": this.isSourceImageValid() }, part: "sidebar-header" }, this.isSourceImageValid() ? this.renderSourceImage() : null, index.h("span", { class: "title", part: "title" }, this.sidebarTitle), index.h("button", { class: "close-sidebar", onClick: () => (this.state = "closed") }, index.h(index$1.CrossIcon, null))), index.h("main", { part: "sidebar-content" }, index.h("vviinn-vpr-widget", { exportparts: "brand, currency, deeplink, image, image-link, price-amount, price-container, price-prefix, price-outdated, price-regular, price-sale, title: product-title, carousel-button, product-card, items-group", token: this.token, productId: this.productId, imageWidth: this.imageWidth, blockTitle: "", mode: this.mode, useCarousel: this.position === "bottom", onRecommendationsLoaded: () => (this.state = "open"), showScroll: this.widgetScrollbar, campaigns: this.campaigns, color: this.color })))));
|
|
51
|
+
return (index.h(index.Host, { class: this.getClassMap() }, index.h("aside", { class: "sidebar", part: "body", onAnimationEnd: (e) => this.handleAnimationEnd(e) }, index.h("header", { class: { "contains-source-img": this.isSourceImageValid() }, part: "sidebar-header" }, this.isSourceImageValid() ? this.renderSourceImage() : null, index.h("span", { class: "title", part: "title" }, this.sidebarTitle), index.h("button", { class: "close-sidebar", onClick: () => (this.state = "closed") }, index.h(index$1.CrossIcon, null))), index.h("main", { part: "sidebar-content" }, index.h("vviinn-vpr-widget", { exportparts: "brand, currency, deeplink, image, image-link, price-amount, price-container, price-prefix, price-outdated, price-regular, price-sale, title: product-title, carousel-button, product-card, items-group", token: this.token, productId: this.productId, imageWidth: this.imageWidth, blockTitle: "", mode: this.mode, useCarousel: this.position === "bottom", onRecommendationsLoaded: () => (this.state = "open"), showScroll: this.widgetScrollbar, campaigns: this.campaigns, color: this.color, currencySign: this.currencySign, apiPath: this.apiPath })))));
|
|
49
52
|
}
|
|
50
53
|
renderSourceImage() {
|
|
51
54
|
return (index.h("img", { class: "source-image", part: "source-image", src: this.sourceImage }));
|
|
@@ -19,6 +19,9 @@ let VviinnVprButton = class {
|
|
|
19
19
|
this.addStyle = true;
|
|
20
20
|
this.mode = "continuity";
|
|
21
21
|
this.imageWidth = 300;
|
|
22
|
+
this.currencySign = "€";
|
|
23
|
+
/** @internal */
|
|
24
|
+
this.apiPath = "https://api.vviinn.com";
|
|
22
25
|
this.sidebar = null;
|
|
23
26
|
this.sidebarCloseListener = () => {
|
|
24
27
|
document.body.removeChild(this.sidebar);
|
|
@@ -39,6 +42,8 @@ let VviinnVprButton = class {
|
|
|
39
42
|
sidebar.color = this.color;
|
|
40
43
|
sidebar.mode = this.position === "right" ? "grid" : this.mode;
|
|
41
44
|
sidebar.imageWidth = this.imageWidth;
|
|
45
|
+
sidebar.currencySign = this.currencySign;
|
|
46
|
+
sidebar.apiPath = this.apiPath;
|
|
42
47
|
this.sidebar = sidebar;
|
|
43
48
|
sidebar.addEventListener("modalClosed", this.sidebarCloseListener);
|
|
44
49
|
document.body.append(this.sidebar);
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-0bda22ec.js');
|
|
6
6
|
const index$1 = require('./index-5ce4918b.js');
|
|
7
|
-
const customizedSlots = require('./customized-slots-
|
|
7
|
+
const customizedSlots = require('./customized-slots-8a1a9aed.js');
|
|
8
8
|
|
|
9
9
|
const vviinnVpsButtonCss = ":host{display:block}";
|
|
10
10
|
|
|
@@ -36,7 +36,7 @@ let VviinnVpsButton = class {
|
|
|
36
36
|
this.pressed = true;
|
|
37
37
|
}
|
|
38
38
|
render() {
|
|
39
|
-
return (index.h(index.Host, { tabindex: "0", role: "button", pressed: this.pressed, onKeyDown: (ev) => this.handleKeyDown(ev) }, index.h("vviinn-button", { onClick: () => this.handleClick(), addStyle: this.addStyle, part: "vviinn-button" }, index.h("slot", null, index.h(index$1.CameraIcon, null))), index.h(customizedSlots.SlotSkeleton, null), index.h("vviinn-vps-widget", { active: this.pressed, "currency-sign":
|
|
39
|
+
return (index.h(index.Host, { tabindex: "0", role: "button", pressed: this.pressed, onKeyDown: (ev) => this.handleKeyDown(ev) }, index.h("vviinn-button", { onClick: () => this.handleClick(), addStyle: this.addStyle, part: "vviinn-button" }, index.h("slot", null, index.h(index$1.CameraIcon, null))), index.h(customizedSlots.SlotSkeleton, null), index.h("vviinn-vps-widget", { active: this.pressed, "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, example-images", campaignId: this.campaignId, showingInButton: true })));
|
|
40
40
|
}
|
|
41
41
|
get el() { return index.getElement(this); }
|
|
42
42
|
};
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["cropper-handler_27.cjs",[[1,"vviinn-vps-widget",{"token":[1],"apiPath":[1,"api-path"],"active":[1028],"currencySign":[1,"currency-sign"],"locale":[1],"campaignId":[1,"campaign-id"],"slidePosition":[32],"width":[32],"wrongImageFormat":[32],"trackingDeactivated":[32]},[[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"],[0,"cropperChanged","trachSearchAreaChanges"],[0,"detectedObjectClicked","trackDetectedObject"],[0,"filterSelected","trackFilter"]]],[1,"vviinn-image-view"],[1,"vviinn-onboarding"],[1,"vviinn-example-images",null,[[0,"exampleImageSelected","handleImageSelection"],[0,"exampleImageError","handleImageSelectionError"]]],[1,"vviinn-overlayed-modal",{"active":[4]}],[1,"vviinn-empty-results"],[1,"vviinn-image-selector"],[1,"vviinn-server-error"],[1,"vviinn-wrong-format"],[1,"search-filters",{"filter":[16],"selectedCategoryId":[32],"hideFilters":[32]}],[1,"vviinn-privacy-badge"],[1,"vviinn-teaser"],[1,"image-cropper",{"disabled":[4],"handleMove":[32]}],[1,"vviinn-example-image",{"src":[1],"width":[2],"height":[2],"selected":[32]}],[1,"highlight-box"],[1,"vviinn-detected-object",{"detectedObject":[16],"position":[32]}],[1,"vviinn-modal",{"active":[1540],"slider":[32]}],[1,"vviinn-onboarding-card-1"],[1,"vviinn-onboarding-card-2"],[1,"vviinn-onboarding-card-3"],[1,"vviinn-overlay"],[1,"vviinn-slide"],[1,"vviinn-slider",{"showBullets":[4,"show-bullets"],"position":[514],"showArrows":[4,"show-arrows"],"elementsCount":[32],"internalPosition":[32],"swipeStartPosition":[32]}],[1,"cropper-handler",{"handler":[16],"disabled":[4]}],[1,"vviinn-error"],[1,"vviinn-preloader"],[1,"vviinn-product-card",{"brand":[1],"currency":[1],"deeplink":[1],"image":[1],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"locale":[1],"price":[2],"pricePrefix":[1,"price-prefix"],"productId":[1,"product-id"],"productTitle":[1,"product-title"],"productType":[1,"product-type"],"salePrice":[2,"sale-price"],"responsive":[4],"dimmedBackground":[4,"dimmed-background"],"index":[2],"imageLoaded":[32]}]]],["vviinn-vps-button.cjs",[[1,"vviinn-vps-button",{"token":[1],"currencySign":[1,"currency-sign"],"locale":[1],"campaignId":[1,"campaign-id"],"addStyle":[4,"add-style"],"apiPath":[1,"api-path"],"pressed":[32]},[[0,"modalClosed","handleModalClosed"]]]]],["vviinn-carousel_2.cjs",[[1,"vviinn-vpr-widget",{"blockTitle":[1,"block-title"],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"productId":[1,"product-id"],"token":[1],"currencySign":[1,"currency-sign"],"pricePrefix":[1,"price-prefix"],"mode":[1],"campaignType":[1,"campaign-type"],"locale":[1],"campaigns":[1],"color":[1],"apiPath":[1,"api-path"],"useCarousel":[4,"use-carousel"],"showScroll":[4,"show-scroll"],"cssUrl":[1,"css-url"],"recommendations":[32],"loaded":[32],"trackingDeactivated":[32]},[[0,"productImageLoaded","handleImageLoading"],[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"]]],[0,"vviinn-carousel",{"mode":[1],"imageWidth":[2,"image-width"],"showScroll":[4,"show-scroll"],"recommendations":[16],"moveDirection":[32],"contentGroups":[32],"activeContentGroup":[32]}]]],["vviinn-recommendations-sidebar.cjs",[[1,"vviinn-recommendations-sidebar",{"sidebarTitle":[1,"sidebar-title"],"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"widgetScrollbar":[4,"widget-scrollbar"],"mode":[1],"campaigns":[1],"color":[1],"imageWidth":[2,"image-width"],"state":[32]},[[16,"click","bodyClickListener"]]]]],["vviinn-button.cjs",[[1,"vviinn-button",{"addStyle":[4,"add-style"]}]]],["vviinn-vpr-button.cjs",[[1,"vviinn-vpr-button",{"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"sidebarTitle":[1,"sidebar-title"],"modalScrollbar":[4,"modal-scrollbar"],"campaigns":[1],"color":[1],"addStyle":[4,"add-style"],"mode":[1],"imageWidth":[2,"image-width"]}]]]], options);
|
|
18
|
+
return index.bootstrapLazy([["cropper-handler_27.cjs",[[1,"vviinn-vps-widget",{"token":[1],"apiPath":[1,"api-path"],"active":[1028],"currencySign":[1,"currency-sign"],"locale":[1],"campaignId":[1,"campaign-id"],"showingInButton":[4,"showing-in-button"],"slidePosition":[32],"width":[32],"wrongImageFormat":[32],"trackingDeactivated":[32]},[[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"],[0,"cropperChanged","trachSearchAreaChanges"],[0,"detectedObjectClicked","trackDetectedObject"],[0,"filterSelected","trackFilter"]]],[1,"vviinn-image-view"],[1,"vviinn-onboarding"],[1,"vviinn-example-images",null,[[0,"exampleImageSelected","handleImageSelection"],[0,"exampleImageError","handleImageSelectionError"]]],[1,"vviinn-overlayed-modal",{"active":[4]}],[1,"vviinn-empty-results"],[1,"vviinn-image-selector"],[1,"vviinn-server-error"],[1,"vviinn-wrong-format"],[1,"search-filters",{"filter":[16],"selectedCategoryId":[32],"hideFilters":[32]}],[1,"vviinn-privacy-badge"],[1,"vviinn-teaser"],[1,"image-cropper",{"disabled":[4],"handleMove":[32]}],[1,"vviinn-example-image",{"src":[1],"width":[2],"height":[2],"selected":[32]}],[1,"highlight-box"],[1,"vviinn-detected-object",{"detectedObject":[16],"position":[32]}],[1,"vviinn-modal",{"active":[1540],"slider":[32]}],[1,"vviinn-onboarding-card-1"],[1,"vviinn-onboarding-card-2"],[1,"vviinn-onboarding-card-3"],[1,"vviinn-overlay"],[1,"vviinn-slide"],[1,"vviinn-slider",{"showBullets":[4,"show-bullets"],"position":[514],"showArrows":[4,"show-arrows"],"elementsCount":[32],"internalPosition":[32],"swipeStartPosition":[32],"isRTL":[32]}],[1,"cropper-handler",{"handler":[16],"disabled":[4]}],[1,"vviinn-error"],[1,"vviinn-preloader"],[1,"vviinn-product-card",{"brand":[1],"currency":[1],"deeplink":[1],"image":[1],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"locale":[1],"price":[2],"pricePrefix":[1,"price-prefix"],"productId":[1,"product-id"],"productTitle":[1,"product-title"],"productType":[1,"product-type"],"salePrice":[2,"sale-price"],"responsive":[4],"dimmedBackground":[4,"dimmed-background"],"index":[2],"imageLoaded":[32]}]]],["vviinn-vps-button.cjs",[[1,"vviinn-vps-button",{"token":[1],"currencySign":[1,"currency-sign"],"locale":[1],"campaignId":[1,"campaign-id"],"addStyle":[4,"add-style"],"apiPath":[1,"api-path"],"pressed":[32]},[[0,"modalClosed","handleModalClosed"]]]]],["vviinn-carousel_2.cjs",[[1,"vviinn-vpr-widget",{"blockTitle":[1,"block-title"],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"productId":[1,"product-id"],"token":[1],"currencySign":[1,"currency-sign"],"pricePrefix":[1,"price-prefix"],"mode":[1],"campaignType":[1,"campaign-type"],"locale":[1],"campaigns":[1],"color":[1],"apiPath":[1,"api-path"],"useCarousel":[4,"use-carousel"],"showScroll":[4,"show-scroll"],"cssUrl":[1,"css-url"],"recommendations":[32],"loaded":[32],"trackingDeactivated":[32]},[[0,"productImageLoaded","handleImageLoading"],[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"]]],[0,"vviinn-carousel",{"mode":[1],"imageWidth":[2,"image-width"],"showScroll":[4,"show-scroll"],"recommendations":[16],"moveDirection":[32],"contentGroups":[32],"activeContentGroup":[32],"isRTL":[32]}]]],["vviinn-recommendations-sidebar.cjs",[[1,"vviinn-recommendations-sidebar",{"sidebarTitle":[1,"sidebar-title"],"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"widgetScrollbar":[4,"widget-scrollbar"],"mode":[1],"campaigns":[1],"color":[1],"imageWidth":[2,"image-width"],"currencySign":[1,"currency-sign"],"apiPath":[1,"api-path"],"state":[32]},[[16,"click","bodyClickListener"]]]]],["vviinn-button.cjs",[[1,"vviinn-button",{"addStyle":[4,"add-style"]}]]],["vviinn-vpr-button.cjs",[[1,"vviinn-vpr-button",{"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"sidebarTitle":[1,"sidebar-title"],"modalScrollbar":[4,"modal-scrollbar"],"campaigns":[1],"color":[1],"addStyle":[4,"add-style"],"mode":[1],"imageWidth":[2,"image-width"],"currencySign":[1,"currency-sign"],"apiPath":[1,"api-path"]}]]]], options);
|
|
19
19
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
const defaultSlotsNames = [
|
|
3
3
|
"vviinn-onboarding-title",
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
4
|
+
"onboarding-card-1-icon",
|
|
5
|
+
"onboarding-card-1-text",
|
|
6
|
+
"onboarding-card-2-icon",
|
|
7
|
+
"onboarding-card-2-text",
|
|
8
|
+
"onboarding-card-3-icon",
|
|
9
|
+
"onboarding-card-3-text",
|
|
10
10
|
"vviinn-example-images-title",
|
|
11
11
|
"vviinn-example-images-1",
|
|
12
12
|
"vviinn-example-images-2",
|
|
@@ -14,7 +14,8 @@ const defaultSlotsNames = [
|
|
|
14
14
|
"vviinn-example-images-4",
|
|
15
15
|
"vviinn-teaser-text",
|
|
16
16
|
"vviinn-image-upload-button-text",
|
|
17
|
-
"vviinn-privacy-badge-text"
|
|
17
|
+
"vviinn-privacy-badge-text",
|
|
18
|
+
"vviinn-image-search-modal-title",
|
|
18
19
|
];
|
|
19
20
|
const renderNamedSlot = (name) => h("slot", { name: name });
|
|
20
21
|
export const SlotSkeleton = () => defaultSlotsNames.map(renderNamedSlot);
|
|
@@ -13,6 +13,7 @@ export class VviinnCarousel {
|
|
|
13
13
|
this.moveDirection = "right";
|
|
14
14
|
this.contentGroups = [];
|
|
15
15
|
this.activeContentGroup = 0;
|
|
16
|
+
this.isRTL = false;
|
|
16
17
|
this.mode = "continuity";
|
|
17
18
|
this.imageWidth = 140;
|
|
18
19
|
this.showScroll = true;
|
|
@@ -21,6 +22,9 @@ export class VviinnCarousel {
|
|
|
21
22
|
this.resizeObserver = new ResizeObserver(() => this.handleResize());
|
|
22
23
|
this.mutationObserver = new MutationObserver(() => this.cloneSlottedContent());
|
|
23
24
|
}
|
|
25
|
+
componentWillLoad() {
|
|
26
|
+
this.isRTL = document.dir === "rtl";
|
|
27
|
+
}
|
|
24
28
|
connectedCallback() {
|
|
25
29
|
this.setItemWidth();
|
|
26
30
|
}
|
|
@@ -100,7 +104,11 @@ export class VviinnCarousel {
|
|
|
100
104
|
const indexedPositions = groupsPositions
|
|
101
105
|
.map((value, index) => [value, index])
|
|
102
106
|
.filter((x) => x[0] >= 0);
|
|
103
|
-
return indexedPositions.length > 0
|
|
107
|
+
return indexedPositions.length > 0
|
|
108
|
+
? this.isRTL
|
|
109
|
+
? indexedPositions[indexedPositions.length - 1][1]
|
|
110
|
+
: indexedPositions[0][1]
|
|
111
|
+
: 0;
|
|
104
112
|
}
|
|
105
113
|
getContentNode() {
|
|
106
114
|
return this.el.querySelector(".content");
|
|
@@ -302,7 +310,8 @@ export class VviinnCarousel {
|
|
|
302
310
|
static get states() { return {
|
|
303
311
|
"moveDirection": {},
|
|
304
312
|
"contentGroups": {},
|
|
305
|
-
"activeContentGroup": {}
|
|
313
|
+
"activeContentGroup": {},
|
|
314
|
+
"isRTL": {}
|
|
306
315
|
}; }
|
|
307
316
|
static get elementRef() { return "el"; }
|
|
308
317
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
display: grid;
|
|
3
3
|
position: relative;
|
|
4
4
|
justify-self: center;
|
|
5
|
+
direction: ltr;
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
img {
|
|
@@ -16,16 +17,16 @@ img {
|
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
.image-preloader {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
background: rgba(0, 0, 0, 0.25);
|
|
21
|
+
border-radius: 4px;
|
|
22
|
+
bottom: 18px;
|
|
23
|
+
padding: 4px 6px;
|
|
24
|
+
pointer-events: none;
|
|
25
|
+
position: absolute;
|
|
26
|
+
right: 18px;
|
|
27
|
+
z-index: 4;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
vviinn-preloader {
|
|
30
|
-
|
|
31
|
+
--preloader-size: 12px;
|
|
31
32
|
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { Component, Host, h, State, Event, Prop } from "@stencil/core";
|
|
1
|
+
import { Component, Host, h, State, Event, Prop, Element, } from "@stencil/core";
|
|
2
|
+
import { slotChangeListener } from "../customized-slots";
|
|
2
3
|
export class VviinnModal {
|
|
3
4
|
constructor() {
|
|
4
5
|
this.active = false;
|
|
5
6
|
this.slider = false;
|
|
6
7
|
}
|
|
8
|
+
componentWillLoad() {
|
|
9
|
+
slotChangeListener(this, this.el);
|
|
10
|
+
}
|
|
7
11
|
close() {
|
|
8
12
|
this.active = false;
|
|
9
13
|
setTimeout(() => {
|
|
@@ -22,7 +26,8 @@ export class VviinnModal {
|
|
|
22
26
|
h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
23
27
|
h("path", { d: "M20.25 12H3.75", stroke: "#161616", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }),
|
|
24
28
|
h("path", { d: "M10.5 5.25L3.75 12L10.5 18.75", stroke: "#161616", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }))),
|
|
25
|
-
h("div", { class: "title", part: "title" },
|
|
29
|
+
h("div", { class: "title", part: "title" },
|
|
30
|
+
h("slot", { name: "vviinn-image-search-modal-title" }, "Bildsuche")),
|
|
26
31
|
h("button", { onClick: () => this.close(), class: "close-button", part: "close-button" },
|
|
27
32
|
h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
28
33
|
h("path", { d: "M16 1.4L14.6 0L8 6.6L1.4 0L0 1.4L6.6 8L0 14.6L1.4 16L8 9.4L14.6 16L16 14.6L9.4 8L16 1.4Z", fill: "#333333" })))),
|
|
@@ -95,4 +100,5 @@ export class VviinnModal {
|
|
|
95
100
|
"references": {}
|
|
96
101
|
}
|
|
97
102
|
}]; }
|
|
103
|
+
static get elementRef() { return "el"; }
|
|
98
104
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Component, Host, h, Element } from
|
|
2
|
-
import { slotChangeListener } from
|
|
3
|
-
import { OnboardingCard1Icon } from
|
|
1
|
+
import { Component, Host, h, Element } from "@stencil/core";
|
|
2
|
+
import { slotChangeListener } from "../../../customized-slots";
|
|
3
|
+
import { OnboardingCard1Icon } from "../../../vviinn-icons";
|
|
4
4
|
export class VviinnOnboardingCard1 {
|
|
5
5
|
componentWillLoad() {
|
|
6
6
|
slotChangeListener(this, this.el);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Component, Host, h, Element } from
|
|
2
|
-
import { OnboardingCard2Icon } from
|
|
3
|
-
import { slotChangeListener } from
|
|
1
|
+
import { Component, Host, h, Element } from "@stencil/core";
|
|
2
|
+
import { OnboardingCard2Icon } from "../../../vviinn-icons";
|
|
3
|
+
import { slotChangeListener } from "../../../customized-slots";
|
|
4
4
|
export class VviinnOnboardingCard2 {
|
|
5
5
|
componentWillLoad() {
|
|
6
6
|
slotChangeListener(this, this.el);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Component, Host, h, Element } from
|
|
2
|
-
import { OnboardingCard3Icon } from
|
|
3
|
-
import { slotChangeListener } from
|
|
1
|
+
import { Component, Host, h, Element } from "@stencil/core";
|
|
2
|
+
import { OnboardingCard3Icon } from "../../../vviinn-icons";
|
|
3
|
+
import { slotChangeListener } from "../../../customized-slots";
|
|
4
4
|
export class VviinnOnboardingCard3 {
|
|
5
5
|
componentWillLoad() {
|
|
6
6
|
slotChangeListener(this, this.el);
|
|
@@ -10,15 +10,19 @@ export class VviinnSlider {
|
|
|
10
10
|
this.elementsCount = 0;
|
|
11
11
|
this.internalPosition = 0;
|
|
12
12
|
this.swipeStartPosition = O.none;
|
|
13
|
+
this.isRTL = false;
|
|
13
14
|
this.showBullets = true;
|
|
14
15
|
this.position = 0;
|
|
15
16
|
this.showArrows = false;
|
|
16
17
|
}
|
|
17
18
|
positionWatchHandler(newValue) {
|
|
18
19
|
this.internalPosition = newValue;
|
|
19
|
-
this.el.style.setProperty("--position", `${newValue}`);
|
|
20
|
+
this.el.style.setProperty("--position", `${this.calculatePosition(newValue)}`);
|
|
20
21
|
this.setActiveCssClassToSlide(newValue);
|
|
21
22
|
}
|
|
23
|
+
componentWillLoad() {
|
|
24
|
+
this.isRTL = document.dir === "rtl";
|
|
25
|
+
}
|
|
22
26
|
connectedCallback() {
|
|
23
27
|
this.handleDomContentChanges();
|
|
24
28
|
}
|
|
@@ -41,7 +45,7 @@ export class VviinnSlider {
|
|
|
41
45
|
renderBullets() {
|
|
42
46
|
return this.showBullets ? (h("div", { class: "controls" }, range(0, this.elementsCount - 1).map((i) => (h("div", { class: {
|
|
43
47
|
bullet: true,
|
|
44
|
-
active: i == this.internalPosition % this.elementsCount,
|
|
48
|
+
active: i == Math.abs(this.internalPosition) % this.elementsCount,
|
|
45
49
|
}, onClick: () => this.goToSlide(i) }))))) : null;
|
|
46
50
|
}
|
|
47
51
|
nextSlide() {
|
|
@@ -55,10 +59,14 @@ export class VviinnSlider {
|
|
|
55
59
|
this.renderSlidePosition();
|
|
56
60
|
}
|
|
57
61
|
renderSlidePosition() {
|
|
62
|
+
const position = this.internalPosition % this.elementsCount;
|
|
58
63
|
requestAnimationFrame(() => {
|
|
59
|
-
this.el.style.setProperty("--position", `${this.
|
|
64
|
+
this.el.style.setProperty("--position", `${this.calculatePosition(position)}`);
|
|
60
65
|
});
|
|
61
66
|
}
|
|
67
|
+
calculatePosition(position) {
|
|
68
|
+
return this.isRTL ? position * -1 : position;
|
|
69
|
+
}
|
|
62
70
|
handleKeyDown(event) {
|
|
63
71
|
if (event.key !== "Space" && event.key !== "Enter")
|
|
64
72
|
return;
|
|
@@ -98,8 +106,8 @@ export class VviinnSlider {
|
|
|
98
106
|
h("slot", null))),
|
|
99
107
|
this.showArrows
|
|
100
108
|
? [
|
|
101
|
-
h(Arrow, { kind: "prev", onClick: () => this.prevSlide(), onKeyDown: (ev) => this.handleKeyDown(ev), tabindex: 1, disabled: false }),
|
|
102
|
-
h(Arrow, { kind: "next", onClick: () => this.nextSlide(), onKeyDown: (ev) => this.handleKeyDown(ev), tabindex: 0, disabled: false }),
|
|
109
|
+
h(Arrow, { kind: "prev", onClick: () => this.isRTL ? this.nextSlide() : this.prevSlide(), onKeyDown: (ev) => this.handleKeyDown(ev), tabindex: 1, disabled: false }),
|
|
110
|
+
h(Arrow, { kind: "next", onClick: () => this.isRTL ? this.prevSlide() : this.nextSlide(), onKeyDown: (ev) => this.handleKeyDown(ev), tabindex: 0, disabled: false }),
|
|
103
111
|
]
|
|
104
112
|
: null,
|
|
105
113
|
this.renderBullets()));
|
|
@@ -171,7 +179,8 @@ export class VviinnSlider {
|
|
|
171
179
|
static get states() { return {
|
|
172
180
|
"elementsCount": {},
|
|
173
181
|
"internalPosition": {},
|
|
174
|
-
"swipeStartPosition": {}
|
|
182
|
+
"swipeStartPosition": {},
|
|
183
|
+
"isRTL": {}
|
|
175
184
|
}; }
|
|
176
185
|
static get elementRef() { return "el"; }
|
|
177
186
|
static get watchers() { return [{
|
|
@@ -9,6 +9,9 @@ export class RecommendationsSidebar {
|
|
|
9
9
|
/** comma-separated list of campaign-ids */
|
|
10
10
|
this.campaigns = "";
|
|
11
11
|
this.imageWidth = 300;
|
|
12
|
+
this.currencySign = "€";
|
|
13
|
+
/** @internal */
|
|
14
|
+
this.apiPath = "https://api.vviinn.com";
|
|
12
15
|
this.state = "idle";
|
|
13
16
|
}
|
|
14
17
|
bodyClickListener(event) {
|
|
@@ -44,7 +47,7 @@ export class RecommendationsSidebar {
|
|
|
44
47
|
h("button", { class: "close-sidebar", onClick: () => (this.state = "closed") },
|
|
45
48
|
h(CrossIcon, null))),
|
|
46
49
|
h("main", { part: "sidebar-content" },
|
|
47
|
-
h("vviinn-vpr-widget", { exportparts: "brand, currency, deeplink, image, image-link, price-amount, price-container, price-prefix, price-outdated, price-regular, price-sale, title: product-title, carousel-button, product-card, items-group", token: this.token, productId: this.productId, imageWidth: this.imageWidth, blockTitle: "", mode: this.mode, useCarousel: this.position === "bottom", onRecommendationsLoaded: () => (this.state = "open"), showScroll: this.widgetScrollbar, campaigns: this.campaigns, color: this.color })))));
|
|
50
|
+
h("vviinn-vpr-widget", { exportparts: "brand, currency, deeplink, image, image-link, price-amount, price-container, price-prefix, price-outdated, price-regular, price-sale, title: product-title, carousel-button, product-card, items-group", token: this.token, productId: this.productId, imageWidth: this.imageWidth, blockTitle: "", mode: this.mode, useCarousel: this.position === "bottom", onRecommendationsLoaded: () => (this.state = "open"), showScroll: this.widgetScrollbar, campaigns: this.campaigns, color: this.color, currencySign: this.currencySign, apiPath: this.apiPath })))));
|
|
48
51
|
}
|
|
49
52
|
renderSourceImage() {
|
|
50
53
|
return (h("img", { class: "source-image", part: "source-image", src: this.sourceImage }));
|
|
@@ -248,6 +251,45 @@ export class RecommendationsSidebar {
|
|
|
248
251
|
"attribute": "image-width",
|
|
249
252
|
"reflect": false,
|
|
250
253
|
"defaultValue": "300"
|
|
254
|
+
},
|
|
255
|
+
"currencySign": {
|
|
256
|
+
"type": "string",
|
|
257
|
+
"mutable": false,
|
|
258
|
+
"complexType": {
|
|
259
|
+
"original": "string",
|
|
260
|
+
"resolved": "string",
|
|
261
|
+
"references": {}
|
|
262
|
+
},
|
|
263
|
+
"required": false,
|
|
264
|
+
"optional": false,
|
|
265
|
+
"docs": {
|
|
266
|
+
"tags": [],
|
|
267
|
+
"text": ""
|
|
268
|
+
},
|
|
269
|
+
"attribute": "currency-sign",
|
|
270
|
+
"reflect": false,
|
|
271
|
+
"defaultValue": "\"\u20AC\""
|
|
272
|
+
},
|
|
273
|
+
"apiPath": {
|
|
274
|
+
"type": "string",
|
|
275
|
+
"mutable": false,
|
|
276
|
+
"complexType": {
|
|
277
|
+
"original": "string | undefined",
|
|
278
|
+
"resolved": "string",
|
|
279
|
+
"references": {}
|
|
280
|
+
},
|
|
281
|
+
"required": false,
|
|
282
|
+
"optional": false,
|
|
283
|
+
"docs": {
|
|
284
|
+
"tags": [{
|
|
285
|
+
"text": undefined,
|
|
286
|
+
"name": "internal"
|
|
287
|
+
}],
|
|
288
|
+
"text": ""
|
|
289
|
+
},
|
|
290
|
+
"attribute": "api-path",
|
|
291
|
+
"reflect": false,
|
|
292
|
+
"defaultValue": "\"https://api.vviinn.com\""
|
|
251
293
|
}
|
|
252
294
|
}; }
|
|
253
295
|
static get states() { return {
|