vviinn-widgets 2.2.2 → 2.3.0
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/highlight-box_22.cjs.entry.js +1 -1
- package/dist/cjs/{index-c493804d.js → index-363cfe0b.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{vviinn-carousel_5.cjs.entry.js → vviinn-carousel_3.cjs.entry.js} +4 -90
- package/dist/cjs/vviinn-recommendations-sidebar.cjs.entry.js +63 -0
- package/dist/cjs/vviinn-vpr-button.cjs.entry.js +44 -0
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-widgets.cjs.js +1 -1
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.css +4 -0
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.js +6 -3
- package/dist/collection/components/vviinn-icons/index.js +2 -2
- package/dist/collection/components/vviinn-product-card/stories/args.js +73 -0
- package/dist/collection/components/vviinn-product-card/stories/decorators.js +51 -0
- package/dist/collection/components/vviinn-product-card/stories/vviinn-product-card.stories.js +105 -0
- package/dist/collection/components/vviinn-vpr-button/stories/args.js +207 -0
- package/dist/collection/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.js +89 -0
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +11 -4
- package/dist/collection/components/vviinn-vpr-widget/stories/args.js +190 -0
- package/dist/collection/components/vviinn-vpr-widget/stories/decorators.js +29 -0
- package/dist/collection/components/vviinn-vpr-widget/stories/vviinn-vpr-widget.stories.js +212 -0
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +1 -0
- package/dist/collection/components/vviinn-vps-button/stories/vviinn-vps-button.stories.js +31 -0
- package/dist/collection/components/vviinn-vps-widget/stories/vviinn-vps-widget.stories.js +33 -0
- package/dist/esm/highlight-box_22.entry.js +1 -1
- package/dist/esm/{index-8cb063df.js → index-9e125c6c.js} +3 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{vviinn-carousel_5.entry.js → vviinn-carousel_3.entry.js} +5 -89
- package/dist/esm/vviinn-recommendations-sidebar.entry.js +59 -0
- package/dist/esm/vviinn-vpr-button.entry.js +40 -0
- package/dist/esm/vviinn-vps-button.entry.js +1 -1
- package/dist/esm/vviinn-widgets.js +1 -1
- package/dist/types/components/vviinn-carousel/vviinn-carousel.d.ts +3 -0
- package/dist/types/components/vviinn-product-card/stories/args.d.ts +73 -0
- package/dist/types/components/vviinn-product-card/stories/decorators.d.ts +1 -0
- package/dist/types/components/vviinn-product-card/stories/vviinn-product-card.stories.d.ts +80 -0
- package/dist/types/components/vviinn-vpr-button/stories/args.d.ts +207 -0
- package/dist/types/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.d.ts +214 -0
- package/dist/types/components/vviinn-vpr-button/vviinn-vpr-button.d.ts +3 -0
- package/dist/types/components/vviinn-vpr-widget/stories/args.d.ts +198 -0
- package/dist/types/components/vviinn-vpr-widget/stories/decorators.d.ts +2 -0
- package/dist/types/components/vviinn-vpr-widget/stories/vviinn-vpr-widget.stories.d.ts +141 -0
- package/dist/types/components/vviinn-vpr-widget/vviinn-vpr-vidget.d.ts +1 -0
- package/dist/types/components/vviinn-vps-button/stories/vviinn-vps-button.stories.d.ts +12 -0
- package/dist/types/components/{vviinn-vpr-button/stories/kek.stories.d.ts → vviinn-vps-widget/stories/vviinn-vps-widget.stories.d.ts} +5 -2
- package/dist/vviinn-widgets/{p-56fc949a.js → p-126775a2.js} +1 -1
- package/dist/vviinn-widgets/p-1f0c8cf6.entry.js +1 -0
- package/dist/vviinn-widgets/p-3734a3ef.entry.js +1 -0
- package/{www/build/p-d085199d.entry.js → dist/vviinn-widgets/p-71809bed.entry.js} +1 -1
- package/dist/vviinn-widgets/p-9ea96a69.entry.js +1 -0
- package/dist/vviinn-widgets/p-a95c00c9.entry.js +1 -0
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +1 -1
- package/www/build/{p-56fc949a.js → p-126775a2.js} +1 -1
- package/www/build/p-1f0c8cf6.entry.js +1 -0
- package/www/build/p-3734a3ef.entry.js +1 -0
- package/www/build/p-4379b1c2.js +1 -0
- package/{dist/vviinn-widgets/p-d085199d.entry.js → www/build/p-71809bed.entry.js} +1 -1
- package/www/build/p-9ea96a69.entry.js +1 -0
- package/www/build/p-a95c00c9.entry.js +1 -0
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +4 -74
- package/dist/collection/components/vviinn-vpr-button/stories/kek.stories.js +0 -18
- package/dist/vviinn-widgets/p-04b06ea9.entry.js +0 -1
- package/dist/vviinn-widgets/p-400eb62f.entry.js +0 -1
- package/www/build/p-04b06ea9.entry.js +0 -1
- package/www/build/p-400eb62f.entry.js +0 -1
- package/www/build/p-7e4978d5.js +0 -1
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-741a970d.js');
|
|
6
6
|
const imageSearch_store = require('./imageSearch.store-128957a4.js');
|
|
7
7
|
const Handler = require('./Handler-d1a8a86a.js');
|
|
8
|
-
const index$1 = require('./index-
|
|
8
|
+
const index$1 = require('./index-363cfe0b.js');
|
|
9
9
|
const customizedSlots = require('./customized-slots-5d904d8e.js');
|
|
10
10
|
|
|
11
11
|
// -------------------------------------------------------------------------------------
|
|
@@ -23,8 +23,8 @@ const OnboardingCard3Icon = () => (index.h("svg", { xmlns: "http://www.w3.org/20
|
|
|
23
23
|
index.h("path", { class: "colored", d: "M100 7.94H20a12 12 0 00-12 12v80a11.998 11.998 0 0012 12h80c3.183 0 6.235-1.264 8.485-3.515A11.996 11.996 0 00112 99.94v-80a11.998 11.998 0 00-12-12zm-8 69.24a1.69 1.69 0 01-.85 1.45l-30.31 17.1a1.77 1.77 0 01-1.67 0l-30.32-17.1a1.689 1.689 0 01-.85-1.45V42.82a1.66 1.66 0 01.85-1.45l30.32-17.21a1.71 1.71 0 011.67 0l30.31 17.21a1.67 1.67 0 01.85 1.45v34.36z" })));
|
|
24
24
|
const CheckIcon = () => (index.h("svg", { width: "14", height: "11", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
25
25
|
index.h("path", { d: "M5 10.414 0 5.413 1.413 4 5 7.586 12.585 0 14 1.415l-9 8.999Z", fill: "var(--color-primary, var(--color-primary-system))" })));
|
|
26
|
-
const ChevronIcon = () => (index.h("svg", { width: "9", height: "16",
|
|
27
|
-
index.h("path", { d: "m9 8-7.895 8L0 14.88 6.79 8 0 1.12 1.105 0 9 8Z"
|
|
26
|
+
const ChevronIcon = () => (index.h("svg", { width: "9", height: "16", xmlns: "http://www.w3.org/2000/svg" },
|
|
27
|
+
index.h("path", { d: "m9 8-7.895 8L0 14.88 6.79 8 0 1.12 1.105 0 9 8Z" })));
|
|
28
28
|
const VisualSearchIcon = () => (index.h("svg", { width: "22", height: "22", xmlns: "http://www.w3.org/2000/svg" },
|
|
29
29
|
index.h("path", { d: "M18 0h-3v2h3c1.103 0 2 .897 2 2v3h2V4c0-2.206-1.794-4-4-4Zm2 18c0 1.103-.897 2-2 2h-3v2h3c2.206 0 4-1.794 4-4v-3h-2v3ZM2 18v-3H0v3c0 2.206 1.794 4 4 4h3v-2H4c-1.103 0-2-.897-2-2ZM2 4c0-1.103.897-2 2-2h3V0H4C1.794 0 0 1.794 0 4v3h2V4Zm6 6.5C8 9.122 9.122 8 10.5 8S13 9.122 13 10.5 11.878 13 10.5 13A2.503 2.503 0 0 1 8 10.5Zm7.5 6.5a1.503 1.503 0 0 0 1.061-2.561l-2.012-2.011c.293-.6.448-1.26.451-1.928C15 8.019 12.981 6 10.5 6A4.505 4.505 0 0 0 6 10.5c0 2.481 2.019 4.5 4.5 4.5.693 0 1.341-.17 1.928-.451l2.011 2.012c.293.293.677.439 1.061.439Z" })));
|
|
30
30
|
const CrossIcon = () => (index.h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -16,7 +16,7 @@ const defineCustomElements = (win, options) => {
|
|
|
16
16
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
17
17
|
return patchEsm().then(() => {
|
|
18
18
|
appGlobals.globalScripts();
|
|
19
|
-
return index.bootstrapLazy([["cropper-handler.cjs",[[1,"cropper-handler",{"handler":[16],"disabled":[4]}]]],["vviinn-error.cjs",[[1,"vviinn-error"]]],["vviinn-preloader.cjs",[[1,"vviinn-preloader"]]],["vviinn-
|
|
19
|
+
return index.bootstrapLazy([["cropper-handler.cjs",[[1,"cropper-handler",{"handler":[16],"disabled":[4]}]]],["vviinn-error.cjs",[[1,"vviinn-error"]]],["vviinn-preloader.cjs",[[1,"vviinn-preloader"]]],["vviinn-carousel_3.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],"apiPath":[1,"api-path"],"useCarousel":[4,"use-carousel"],"showScroll":[4,"show-scroll"],"cssUrl":[1,"css-url"],"recommendations":[32],"loaded":[32]},[[0,"productImageLoaded","lol"]]],[0,"vviinn-carousel",{"mode":[1],"imageWidth":[2,"image-width"],"showScroll":[4,"show-scroll"],"recommendations":[16],"moveDirection":[32],"contentGroups":[32],"activeContentGroup":[32]}],[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"],"imageLoaded":[32]}]]],["highlight-box_22.cjs",[[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]}]]],["vviinn-vps-widget.cjs",[[1,"vviinn-vps-widget",{"token":[1],"apiPath":[1,"api-path"],"active":[1028],"currencySign":[1,"currency-sign"],"locale":[1],"slidePosition":[32],"width":[32],"wrongImageFormat":[32]}]]],["vviinn-vps-button.cjs",[[1,"vviinn-vps-button",{"token":[1],"currencySign":[1,"currency-sign"],"locale":[1],"apiPath":[1,"api-path"],"pressed":[32]},[[0,"modalClosed","handleModalClosed"]]]]],["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"],"state":[32]},[[16,"click","bodyClickListener"]]]]],["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"]}]]]], options);
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-741a970d.js');
|
|
6
6
|
const imageSearch_store = require('./imageSearch.store-128957a4.js');
|
|
7
|
-
const index$1 = require('./index-
|
|
7
|
+
const index$1 = require('./index-363cfe0b.js');
|
|
8
8
|
const Handler = require('./Handler-d1a8a86a.js');
|
|
9
9
|
|
|
10
|
-
const vviinnCarouselCss = ":host{--vviinn-progressbar-width:0;--vviinn-carousel-item-width:150px;--vviinn-carousel-columns-internal:var(--vviinn-carousel-columns, 4);--vviinn-carousel-image-width-system:140px}.body{display:flex;position:relative;width:var(--vviinn-carousel-content-width);flex-direction:column}.content-wrapper *{box-sizing:border-box}.content-wrapper{overflow-y:hidden;overflow-x:auto;flex-grow:1}.bullets{margin-top:16px;display:flex;flex-direction:row;grid-gap:24px;justify-content:center}.bullet{width:10px;height:10px;background:#E0E0E0;border-radius:50%;cursor:pointer}.bullet.active{background:#161616}.content:not(.show-scrollbar),.content.grid{scrollbar-color:#fff0 #fff0}.content:not(.show-scrollbar)::-webkit-scrollbar,.content.grid::-webkit-scrollbar{opacity:0}.content{display:flex;flex-direction:row;grid-gap:8px;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-y:hidden;overflow-x:auto;flex-grow:1;padding-bottom:16px}.content.left>*{scroll-snap-align:start}.content.right>*{scroll-snap-align:end}:host(.continuity) button{border-radius:2px}:host(.grid) button{border-radius:50%}button{align-items:center;background-color:white;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);cursor:pointer;display:grid;height:40px;justify-items:center;position:absolute;top:calc(50% - 20px);width:40px;z-index:1;padding:0;margin:0}button.prev svg{transform:rotate(180deg);margin-left:-5px}.prev{left:0}.next{right:0}.items-group{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--vviinn-carousel-columns-internal), 1fr);min-width:100%}vviinn-product-card::part(price-container){text-align:center}:host(.classic) vviinn-product-card::part(title),:host(.classic) vviinn-product-card::part(brand),:host(.classic) vviinn-product-card::part(type){text-align:center}@media (max-width: 480px){:host(.modern) button{display:none}.items-group{grid-template-columns:repeat(2, 1fr)}}";
|
|
10
|
+
const vviinnCarouselCss = ":host{--vviinn-progressbar-width:0;--vviinn-carousel-item-width:150px;--vviinn-carousel-columns-internal:var(--vviinn-carousel-columns, 4);--vviinn-carousel-image-width-system:140px}.body{display:flex;position:relative;width:var(--vviinn-carousel-content-width);flex-direction:column}.content-wrapper *{box-sizing:border-box}.content-wrapper{overflow-y:hidden;overflow-x:auto;flex-grow:1}.bullets{margin-top:16px;display:flex;flex-direction:row;grid-gap:24px;justify-content:center}.bullet{width:10px;height:10px;background:#E0E0E0;border-radius:50%;cursor:pointer}.bullet.active{background:#161616}.content:not(.show-scrollbar),.content.grid{scrollbar-color:#fff0 #fff0}.content:not(.show-scrollbar)::-webkit-scrollbar,.content.grid::-webkit-scrollbar{opacity:0}.content{display:flex;flex-direction:row;grid-gap:8px;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-y:hidden;overflow-x:auto;flex-grow:1;padding-bottom:16px}.content.left>*{scroll-snap-align:start}.content.right>*{scroll-snap-align:end}:host(.continuity) button{border-radius:2px}:host(.grid) button{border-radius:50%}button{align-items:center;background-color:white;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);cursor:pointer;display:grid;height:40px;justify-items:center;position:absolute;top:calc(50% - 20px);width:40px;z-index:1;padding:0;margin:0}button{fill:#525252}button.prev svg{transform:rotate(180deg);margin-left:-5px}.prev{left:0}.next{right:0}.items-group{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--vviinn-carousel-columns-internal), 1fr);min-width:100%}vviinn-product-card::part(price-container){text-align:center}:host(.classic) vviinn-product-card::part(title),:host(.classic) vviinn-product-card::part(brand),:host(.classic) vviinn-product-card::part(type){text-align:center}@media (max-width: 480px){:host(.modern) button{display:none}.items-group{grid-template-columns:repeat(2, 1fr)}}";
|
|
11
11
|
|
|
12
12
|
const COLUMNS_NUMBER_CSS_VAR = "--vviinn-carousel-columns-internal";
|
|
13
13
|
const CAROUSEL_WIDTH_CSS_VAR = "--vviinn-carousel-content-width";
|
|
@@ -56,7 +56,7 @@ let VviinnCarousel = class {
|
|
|
56
56
|
content: true,
|
|
57
57
|
[this.moveDirection]: true,
|
|
58
58
|
[this.mode]: true,
|
|
59
|
-
"show-scrollbar": this.showScroll
|
|
59
|
+
"show-scrollbar": this.showScroll,
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
handleResize() {
|
|
@@ -205,7 +205,7 @@ let VviinnCarousel = class {
|
|
|
205
205
|
}, onClick: () => this.scroll(index$1) })));
|
|
206
206
|
}
|
|
207
207
|
render() {
|
|
208
|
-
return (index.h(index.Host, { class: this.getClassMap() }, index.h("div", { class: Object.assign({ body: true }, this.getClassMap()) }, index.h("button", { class: "prev", onClick: () => this.showPrev() }, index.h(index$1.ChevronIcon, null)), index.h("div", { class: this.getContentClassMap(), onScroll: () => this.processScrollbarWidth() }, this.renderRecommendations()), index.h("button", { class: "next", onClick: () => this.showNext() }, index.h(index$1.ChevronIcon, null))), this.showBullets() ? (index.h("div", { class: "bullets" }, this.renderBullets())) : ("")));
|
|
208
|
+
return (index.h(index.Host, { class: this.getClassMap() }, index.h("div", { class: Object.assign({ body: true }, this.getClassMap()) }, index.h("button", { class: "prev", onClick: () => this.showPrev(), part: "carousel-button" }, index.h(index$1.ChevronIcon, null)), index.h("div", { class: this.getContentClassMap(), onScroll: () => this.processScrollbarWidth() }, this.renderRecommendations()), index.h("button", { class: "next", onClick: () => this.showNext(), part: "carousel-button" }, index.h(index$1.ChevronIcon, null))), this.showBullets() ? (index.h("div", { class: "bullets" }, this.renderBullets())) : ("")));
|
|
209
209
|
}
|
|
210
210
|
get el() { return index.getElement(this); }
|
|
211
211
|
};
|
|
@@ -386,90 +386,6 @@ let VviinnProductCard = class {
|
|
|
386
386
|
};
|
|
387
387
|
VviinnProductCard.style = vviinnProductCardCss;
|
|
388
388
|
|
|
389
|
-
const recommendationsSidebarCss = ":host{--vviinn-carousel-columns:0;box-sizing:border-box;display:block;display:flex;height:100vh;left:0;position:fixed;top:0;transition:background 0.1s ease-in-out;width:100vw}:host(.open){background:rgba(0, 0, 0, 0.2)}:host(.bottom){flex-direction:column;justify-content:end}:host(.right){flex-direction:row;justify-content:flex-end}header{position:relative;text-align:center;padding:32px}header.contains-source-img{display:grid;justify-items:center;grid-gap:12px}img.source-image{width:64px;height:64px;border-radius:50%;box-shadow:0px 2px 4px rgba(0, 0, 0, 0.15);padding:8px}:host(.right) header{box-shadow:0px 2px 6px rgba(0, 0, 0, 0.1)}main{padding:0 24px}:host(.right) main{overflow:auto}.sidebar{background:white;box-sizing:border-box;display:flex;flex-direction:column}:host(.bottom.idle) .sidebar,:host(.bottom.closed) .sidebar{transform:translateY(100%)}:host(.bottom.closed) .sidebar{-webkit-animation-name:slideOutFromBottom;animation-name:slideOutFromBottom;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.bottom.open) .sidebar{-webkit-animation-name:slideInFromBottom;animation-name:slideInFromBottom;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right.idle) .sidebar{transform:translateX(100%)}:host(.right.closed) .sidebar{-webkit-animation-name:slideOutFromRight;animation-name:slideOutFromRight;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right.open) .sidebar{-webkit-animation-name:slideInFromRight;animation-name:slideInFromRight;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right) .sidebar{max-width:480px}:host(.right) vviinn-vpr-widget::part(recommendations-grid){display:grid;grid-template-columns:repeat(2, 1fr);grid-gap:24px}:host(.right) vviinn-vpr-widget{overflow:auto}:host(.right) vviinn-vpr-widget::part(image){border:none}.title{font-style:normal;font-weight:500;font-size:28px;line-height:40px;text-align:center;color:#000000}vviinn-vpr-widget::part(title),vviinn-vpr-widget::part(brand),vviinn-vpr-widget::part(type){text-align:left}vviinn-vpr-widget::part(price-container){align-self:start}.close-sidebar{background:transparent;border:none;cursor:pointer;margin:0;padding:0;position:absolute;right:24px;top:24px}@-webkit-keyframes slideInFromBottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideInFromBottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes slideOutFromBottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes slideOutFromBottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@-webkit-keyframes slideInFromRight{from{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes slideInFromRight{from{transform:translateX(100%)}to{transform:translateX(0)}}@-webkit-keyframes slideOutFromRight{from{transform:translateX(0)}to{transform:translateX(100%)}}@keyframes slideOutFromRight{from{transform:translateX(0)}to{transform:translateX(100%)}}";
|
|
390
|
-
|
|
391
|
-
let RecommendationsSidebar = class {
|
|
392
|
-
constructor(hostRef) {
|
|
393
|
-
index.registerInstance(this, hostRef);
|
|
394
|
-
this.modalClosed = index.createEvent(this, "modalClosed", 7);
|
|
395
|
-
this.position = "bottom";
|
|
396
|
-
this.sourceImage = null;
|
|
397
|
-
this.widgetScrollbar = false;
|
|
398
|
-
this.state = "idle";
|
|
399
|
-
}
|
|
400
|
-
bodyClickListener(event) {
|
|
401
|
-
const { clientX, clientY } = event;
|
|
402
|
-
const sidebarRect = this.getSidebarRectangle();
|
|
403
|
-
if (!sidebarRect)
|
|
404
|
-
return;
|
|
405
|
-
const inLeftBound = clientX >= sidebarRect.left;
|
|
406
|
-
const inRightBound = clientX <= sidebarRect.right;
|
|
407
|
-
const inTopBound = clientY >= sidebarRect.top;
|
|
408
|
-
const inBottomBound = clientY <= sidebarRect.bottom;
|
|
409
|
-
const inBound = inLeftBound && inRightBound && inTopBound && inBottomBound;
|
|
410
|
-
if (!inBound) {
|
|
411
|
-
this.state = "closed";
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
getClassMap() {
|
|
415
|
-
return {
|
|
416
|
-
[this.position]: true,
|
|
417
|
-
[this.state]: true,
|
|
418
|
-
};
|
|
419
|
-
}
|
|
420
|
-
getSidebarRectangle() {
|
|
421
|
-
var _a;
|
|
422
|
-
return (_a = this.el.shadowRoot.querySelector("aside")) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
423
|
-
}
|
|
424
|
-
render() {
|
|
425
|
-
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-outdated, price-prefix, price-regular, price-sale, title: product-title", token: this.token, productId: this.productId, imageWidth: 300, blockTitle: "", mode: this.position === "bottom" ? "continuity" : "grid", useCarousel: this.position === "bottom", onRecommendationsLoaded: () => (this.state = "open"), showScroll: this.widgetScrollbar })))));
|
|
426
|
-
}
|
|
427
|
-
renderSourceImage() {
|
|
428
|
-
return (index.h("img", { class: "source-image", part: "source-image", src: this.sourceImage }));
|
|
429
|
-
}
|
|
430
|
-
isSourceImageValid() {
|
|
431
|
-
var _a;
|
|
432
|
-
return ((_a = this.sourceImage) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
433
|
-
}
|
|
434
|
-
handleAnimationEnd({ animationName }) {
|
|
435
|
-
const isClosingAnimation = animationName.includes("slideOut");
|
|
436
|
-
if (!isClosingAnimation)
|
|
437
|
-
return;
|
|
438
|
-
this.modalClosed.emit();
|
|
439
|
-
}
|
|
440
|
-
get el() { return index.getElement(this); }
|
|
441
|
-
};
|
|
442
|
-
RecommendationsSidebar.style = recommendationsSidebarCss;
|
|
443
|
-
|
|
444
|
-
const vviinnVprButtonCss = ":host{display:block}.open-button{align-items:center;background:rgba(255, 255, 255, 0.8);border-radius:50%;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);box-sizing:border-box;cursor:pointer;display:grid;height:40px;justify-items:center;padding:0;width:40px;transition:all 0.25s ease-in-out}.open-button:hover{box-shadow:0px 2px 6px rgba(0, 0, 0, 0.25)}.open-button:focus{border:2px solid rgba(15, 98, 254, 0.5);outline:none}.open-button:active{background:#F4F4F4;outline:none}";
|
|
445
|
-
|
|
446
|
-
let VviinnVprButton = class {
|
|
447
|
-
constructor(hostRef) {
|
|
448
|
-
index.registerInstance(this, hostRef);
|
|
449
|
-
this.position = "bottom";
|
|
450
|
-
this.sourceImage = null;
|
|
451
|
-
this.sidebarTitle = "Visually similar products";
|
|
452
|
-
this.modalScrollbar = false;
|
|
453
|
-
}
|
|
454
|
-
render() {
|
|
455
|
-
return (index.h(index.Host, null, index.h("button", { class: "open-button", part: "button", onClick: () => this.handleClick() }, index.h("slot", null, index.h(index$1.VisualSearchIcon, null)))));
|
|
456
|
-
}
|
|
457
|
-
handleClick() {
|
|
458
|
-
const sidebar = document.createElement("vviinn-recommendations-sidebar");
|
|
459
|
-
sidebar.sidebarTitle = this.sidebarTitle;
|
|
460
|
-
sidebar.productId = this.productId;
|
|
461
|
-
sidebar.token = this.token;
|
|
462
|
-
sidebar.position = this.position;
|
|
463
|
-
sidebar.sourceImage = this.sourceImage;
|
|
464
|
-
sidebar.widgetScrollbar = this.modalScrollbar;
|
|
465
|
-
sidebar.addEventListener("modalClosed", () => {
|
|
466
|
-
document.body.removeChild(sidebar);
|
|
467
|
-
});
|
|
468
|
-
document.body.append(sidebar);
|
|
469
|
-
}
|
|
470
|
-
};
|
|
471
|
-
VviinnVprButton.style = vviinnVprButtonCss;
|
|
472
|
-
|
|
473
389
|
const createBearerString = (x) => `Bearer ${x}`;
|
|
474
390
|
const createAuthedHeader = (x) => new Headers({
|
|
475
391
|
Authorization: x,
|
|
@@ -1227,6 +1143,4 @@ VviinnVprWidget.style = vviinnVprWidgetCss;
|
|
|
1227
1143
|
|
|
1228
1144
|
exports.vviinn_carousel = VviinnCarousel;
|
|
1229
1145
|
exports.vviinn_product_card = VviinnProductCard;
|
|
1230
|
-
exports.vviinn_recommendations_sidebar = RecommendationsSidebar;
|
|
1231
|
-
exports.vviinn_vpr_button = VviinnVprButton;
|
|
1232
1146
|
exports.vviinn_vpr_widget = VviinnVprWidget;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-741a970d.js');
|
|
6
|
+
const index$1 = require('./index-363cfe0b.js');
|
|
7
|
+
|
|
8
|
+
const recommendationsSidebarCss = ":host{--vviinn-carousel-columns:0;box-sizing:border-box;display:block;display:flex;height:100vh;left:0;position:fixed;top:0;transition:background 0.1s ease-in-out;width:100vw}:host(.open){background:rgba(0, 0, 0, 0.2)}:host(.bottom){flex-direction:column;justify-content:end}:host(.right){flex-direction:row;justify-content:flex-end}header{position:relative;text-align:center;padding:32px}header.contains-source-img{display:grid;justify-items:center;grid-gap:12px}img.source-image{width:64px;height:64px;border-radius:50%;box-shadow:0px 2px 4px rgba(0, 0, 0, 0.15);padding:8px}:host(.right) header{box-shadow:0px 2px 6px rgba(0, 0, 0, 0.1)}main{padding:0 24px}:host(.right) main{overflow:auto}.sidebar{background:white;box-sizing:border-box;display:flex;flex-direction:column}:host(.bottom.idle) .sidebar,:host(.bottom.closed) .sidebar{transform:translateY(100%)}:host(.bottom.closed) .sidebar{-webkit-animation-name:slideOutFromBottom;animation-name:slideOutFromBottom;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.bottom.open) .sidebar{-webkit-animation-name:slideInFromBottom;animation-name:slideInFromBottom;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right.idle) .sidebar{transform:translateX(100%)}:host(.right.closed) .sidebar{-webkit-animation-name:slideOutFromRight;animation-name:slideOutFromRight;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right.open) .sidebar{-webkit-animation-name:slideInFromRight;animation-name:slideInFromRight;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right) .sidebar{max-width:480px}:host(.right) vviinn-vpr-widget::part(recommendations-grid){display:grid;grid-template-columns:repeat(2, 1fr);grid-gap:24px}:host(.right) vviinn-vpr-widget{overflow:auto}:host(.right) vviinn-vpr-widget::part(image){border:none}.title{font-style:normal;font-weight:500;font-size:28px;line-height:40px;text-align:center;color:#000000}vviinn-vpr-widget::part(title),vviinn-vpr-widget::part(brand),vviinn-vpr-widget::part(type){text-align:left}vviinn-vpr-widget::part(price-container){align-self:start}.close-sidebar{background:transparent;border:none;cursor:pointer;margin:0;padding:0;position:absolute;right:24px;top:24px}@-webkit-keyframes slideInFromBottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideInFromBottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes slideOutFromBottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes slideOutFromBottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@-webkit-keyframes slideInFromRight{from{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes slideInFromRight{from{transform:translateX(100%)}to{transform:translateX(0)}}@-webkit-keyframes slideOutFromRight{from{transform:translateX(0)}to{transform:translateX(100%)}}@keyframes slideOutFromRight{from{transform:translateX(0)}to{transform:translateX(100%)}}";
|
|
9
|
+
|
|
10
|
+
let RecommendationsSidebar = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
this.modalClosed = index.createEvent(this, "modalClosed", 7);
|
|
14
|
+
this.position = "bottom";
|
|
15
|
+
this.sourceImage = null;
|
|
16
|
+
this.widgetScrollbar = false;
|
|
17
|
+
this.state = "idle";
|
|
18
|
+
}
|
|
19
|
+
bodyClickListener(event) {
|
|
20
|
+
const { clientX, clientY } = event;
|
|
21
|
+
const sidebarRect = this.getSidebarRectangle();
|
|
22
|
+
if (!sidebarRect)
|
|
23
|
+
return;
|
|
24
|
+
const inLeftBound = clientX >= sidebarRect.left;
|
|
25
|
+
const inRightBound = clientX <= sidebarRect.right;
|
|
26
|
+
const inTopBound = clientY >= sidebarRect.top;
|
|
27
|
+
const inBottomBound = clientY <= sidebarRect.bottom;
|
|
28
|
+
const inBound = inLeftBound && inRightBound && inTopBound && inBottomBound;
|
|
29
|
+
if (!inBound) {
|
|
30
|
+
this.state = "closed";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
getClassMap() {
|
|
34
|
+
return {
|
|
35
|
+
[this.position]: true,
|
|
36
|
+
[this.state]: true,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
getSidebarRectangle() {
|
|
40
|
+
var _a;
|
|
41
|
+
return (_a = this.el.shadowRoot.querySelector("aside")) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
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-outdated, price-prefix, price-regular, price-sale, title: product-title", token: this.token, productId: this.productId, imageWidth: 300, blockTitle: "", mode: this.position === "bottom" ? "continuity" : "grid", useCarousel: this.position === "bottom", onRecommendationsLoaded: () => (this.state = "open"), showScroll: this.widgetScrollbar })))));
|
|
45
|
+
}
|
|
46
|
+
renderSourceImage() {
|
|
47
|
+
return (index.h("img", { class: "source-image", part: "source-image", src: this.sourceImage }));
|
|
48
|
+
}
|
|
49
|
+
isSourceImageValid() {
|
|
50
|
+
var _a;
|
|
51
|
+
return ((_a = this.sourceImage) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
52
|
+
}
|
|
53
|
+
handleAnimationEnd({ animationName }) {
|
|
54
|
+
const isClosingAnimation = animationName.includes("slideOut");
|
|
55
|
+
if (!isClosingAnimation)
|
|
56
|
+
return;
|
|
57
|
+
this.modalClosed.emit();
|
|
58
|
+
}
|
|
59
|
+
get el() { return index.getElement(this); }
|
|
60
|
+
};
|
|
61
|
+
RecommendationsSidebar.style = recommendationsSidebarCss;
|
|
62
|
+
|
|
63
|
+
exports.vviinn_recommendations_sidebar = RecommendationsSidebar;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-741a970d.js');
|
|
6
|
+
const index$1 = require('./index-363cfe0b.js');
|
|
7
|
+
|
|
8
|
+
const vviinnVprButtonCss = ":host{display:block}.open-button{align-items:center;background:rgba(255, 255, 255, 0.8);border-radius:50%;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);box-sizing:border-box;cursor:pointer;display:grid;height:40px;justify-items:center;padding:0;width:40px;transition:all 0.25s ease-in-out}.open-button:hover{box-shadow:0px 2px 6px rgba(0, 0, 0, 0.25)}.open-button:focus{border:2px solid rgba(15, 98, 254, 0.5);outline:none}.open-button:active{background:#F4F4F4;outline:none}";
|
|
9
|
+
|
|
10
|
+
let VviinnVprButton = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
this.position = "bottom";
|
|
14
|
+
this.sourceImage = null;
|
|
15
|
+
this.sidebarTitle = "Visually similar products";
|
|
16
|
+
this.modalScrollbar = false;
|
|
17
|
+
this.sidebar = null;
|
|
18
|
+
this.sidebarCloseListener = () => {
|
|
19
|
+
document.body.removeChild(this.sidebar);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
return (index.h(index.Host, null, index.h("button", { class: "open-button", part: "button", onClick: () => this.handleClick() }, index.h("slot", null, index.h(index$1.VisualSearchIcon, null)))));
|
|
24
|
+
}
|
|
25
|
+
handleClick() {
|
|
26
|
+
const sidebar = document.createElement("vviinn-recommendations-sidebar");
|
|
27
|
+
sidebar.sidebarTitle = this.sidebarTitle;
|
|
28
|
+
sidebar.productId = this.productId;
|
|
29
|
+
sidebar.token = this.token;
|
|
30
|
+
sidebar.position = this.position;
|
|
31
|
+
sidebar.sourceImage = this.sourceImage;
|
|
32
|
+
sidebar.widgetScrollbar = this.modalScrollbar;
|
|
33
|
+
this.sidebar = sidebar;
|
|
34
|
+
sidebar.addEventListener("modalClosed", this.sidebarCloseListener);
|
|
35
|
+
document.body.append(this.sidebar);
|
|
36
|
+
}
|
|
37
|
+
disconnectedCallback() {
|
|
38
|
+
this.sidebar.removeEventListener("modalCLosed", this.sidebarCloseListener);
|
|
39
|
+
document.body.removeChild(this.sidebar);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
VviinnVprButton.style = vviinnVprButtonCss;
|
|
43
|
+
|
|
44
|
+
exports.vviinn_vpr_button = VviinnVprButton;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-741a970d.js');
|
|
6
|
-
const index$1 = require('./index-
|
|
6
|
+
const index$1 = require('./index-363cfe0b.js');
|
|
7
7
|
const customizedSlots = require('./customized-slots-5d904d8e.js');
|
|
8
8
|
|
|
9
9
|
const vviinnVpsButtonCss = "";
|
|
@@ -17,5 +17,5 @@ const patchBrowser = () => {
|
|
|
17
17
|
|
|
18
18
|
patchBrowser().then(options => {
|
|
19
19
|
appGlobals.globalScripts();
|
|
20
|
-
return index.bootstrapLazy([["cropper-handler.cjs",[[1,"cropper-handler",{"handler":[16],"disabled":[4]}]]],["vviinn-error.cjs",[[1,"vviinn-error"]]],["vviinn-preloader.cjs",[[1,"vviinn-preloader"]]],["vviinn-
|
|
20
|
+
return index.bootstrapLazy([["cropper-handler.cjs",[[1,"cropper-handler",{"handler":[16],"disabled":[4]}]]],["vviinn-error.cjs",[[1,"vviinn-error"]]],["vviinn-preloader.cjs",[[1,"vviinn-preloader"]]],["vviinn-carousel_3.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],"apiPath":[1,"api-path"],"useCarousel":[4,"use-carousel"],"showScroll":[4,"show-scroll"],"cssUrl":[1,"css-url"],"recommendations":[32],"loaded":[32]},[[0,"productImageLoaded","lol"]]],[0,"vviinn-carousel",{"mode":[1],"imageWidth":[2,"image-width"],"showScroll":[4,"show-scroll"],"recommendations":[16],"moveDirection":[32],"contentGroups":[32],"activeContentGroup":[32]}],[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"],"imageLoaded":[32]}]]],["highlight-box_22.cjs",[[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]}]]],["vviinn-vps-widget.cjs",[[1,"vviinn-vps-widget",{"token":[1],"apiPath":[1,"api-path"],"active":[1028],"currencySign":[1,"currency-sign"],"locale":[1],"slidePosition":[32],"width":[32],"wrongImageFormat":[32]}]]],["vviinn-vps-button.cjs",[[1,"vviinn-vps-button",{"token":[1],"currencySign":[1,"currency-sign"],"locale":[1],"apiPath":[1,"api-path"],"pressed":[32]},[[0,"modalClosed","handleModalClosed"]]]]],["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"],"state":[32]},[[16,"click","bodyClickListener"]]]]],["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"]}]]]], options);
|
|
21
21
|
});
|
|
@@ -5,6 +5,9 @@ const COLUMNS_NUMBER_CSS_VAR = "--vviinn-carousel-columns-internal";
|
|
|
5
5
|
const CAROUSEL_WIDTH_CSS_VAR = "--vviinn-carousel-content-width";
|
|
6
6
|
const CAROUSEL_IMAGE_WIDTH_CSS_VAR = "--vviinn-carousel-image-width";
|
|
7
7
|
const CONTENT_GROUP_CSS_CLASS = "items-group";
|
|
8
|
+
/**
|
|
9
|
+
* @part carousel-button
|
|
10
|
+
**/
|
|
8
11
|
export class VviinnCarousel {
|
|
9
12
|
constructor() {
|
|
10
13
|
this.moveDirection = "right";
|
|
@@ -47,7 +50,7 @@ export class VviinnCarousel {
|
|
|
47
50
|
content: true,
|
|
48
51
|
[this.moveDirection]: true,
|
|
49
52
|
[this.mode]: true,
|
|
50
|
-
"show-scrollbar": this.showScroll
|
|
53
|
+
"show-scrollbar": this.showScroll,
|
|
51
54
|
};
|
|
52
55
|
}
|
|
53
56
|
handleResize() {
|
|
@@ -198,10 +201,10 @@ export class VviinnCarousel {
|
|
|
198
201
|
render() {
|
|
199
202
|
return (h(Host, { class: this.getClassMap() },
|
|
200
203
|
h("div", { class: Object.assign({ body: true }, this.getClassMap()) },
|
|
201
|
-
h("button", { class: "prev", onClick: () => this.showPrev() },
|
|
204
|
+
h("button", { class: "prev", onClick: () => this.showPrev(), part: "carousel-button" },
|
|
202
205
|
h(ChevronIcon, null)),
|
|
203
206
|
h("div", { class: this.getContentClassMap(), onScroll: () => this.processScrollbarWidth() }, this.renderRecommendations()),
|
|
204
|
-
h("button", { class: "next", onClick: () => this.showNext() },
|
|
207
|
+
h("button", { class: "next", onClick: () => this.showNext(), part: "carousel-button" },
|
|
205
208
|
h(ChevronIcon, null))),
|
|
206
209
|
this.showBullets() ? (h("div", { class: "bullets" }, this.renderBullets())) : ("")));
|
|
207
210
|
}
|
|
@@ -22,8 +22,8 @@ export const CheckIcon = () => (h("svg", { width: "14", height: "11", fill: "non
|
|
|
22
22
|
h("path", { d: "M5 10.414 0 5.413 1.413 4 5 7.586 12.585 0 14 1.415l-9 8.999Z", fill: "var(--color-primary, var(--color-primary-system))" })));
|
|
23
23
|
export const LoaderIcon = () => (h("svg", { width: "100%", height: "100%", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 28 28" },
|
|
24
24
|
h("path", { fill: "#fff", d: "M23,14a9,9,0,1,1-9-9V2A12,12,0,1,0,26,14Z" })));
|
|
25
|
-
export const ChevronIcon = () => (h("svg", { width: "9", height: "16",
|
|
26
|
-
h("path", { d: "m9 8-7.895 8L0 14.88 6.79 8 0 1.12 1.105 0 9 8Z"
|
|
25
|
+
export const ChevronIcon = () => (h("svg", { width: "9", height: "16", xmlns: "http://www.w3.org/2000/svg" },
|
|
26
|
+
h("path", { d: "m9 8-7.895 8L0 14.88 6.79 8 0 1.12 1.105 0 9 8Z" })));
|
|
27
27
|
export const VisualSearchIcon = () => (h("svg", { width: "22", height: "22", xmlns: "http://www.w3.org/2000/svg" },
|
|
28
28
|
h("path", { d: "M18 0h-3v2h3c1.103 0 2 .897 2 2v3h2V4c0-2.206-1.794-4-4-4Zm2 18c0 1.103-.897 2-2 2h-3v2h3c2.206 0 4-1.794 4-4v-3h-2v3ZM2 18v-3H0v3c0 2.206 1.794 4 4 4h3v-2H4c-1.103 0-2-.897-2-2ZM2 4c0-1.103.897-2 2-2h3V0H4C1.794 0 0 1.794 0 4v3h2V4Zm6 6.5C8 9.122 9.122 8 10.5 8S13 9.122 13 10.5 11.878 13 10.5 13A2.503 2.503 0 0 1 8 10.5Zm7.5 6.5a1.503 1.503 0 0 0 1.061-2.561l-2.012-2.011c.293-.6.448-1.26.451-1.928C15 8.019 12.981 6 10.5 6A4.505 4.505 0 0 0 6 10.5c0 2.481 2.019 4.5 4.5 4.5.693 0 1.341-.17 1.928-.451l2.011 2.012c.293.293.677.439 1.061.439Z" })));
|
|
29
29
|
export const CrossIcon = () => (h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export const argTypes = {
|
|
2
|
+
imageWidth: {
|
|
3
|
+
name: "Card width (px)",
|
|
4
|
+
},
|
|
5
|
+
imageBorder: {
|
|
6
|
+
name: "Image border",
|
|
7
|
+
},
|
|
8
|
+
imageBorderColor: {
|
|
9
|
+
name: "Image border color",
|
|
10
|
+
control: {
|
|
11
|
+
type: "color",
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
imageBackground: {
|
|
15
|
+
name: "Image background",
|
|
16
|
+
description: "Adding a light-gray filter on top of the image to distinguish it from the rest of the product card content.",
|
|
17
|
+
},
|
|
18
|
+
showBrand: {
|
|
19
|
+
name: "Show brand",
|
|
20
|
+
description: "Using the [title] attribute from product feed.",
|
|
21
|
+
},
|
|
22
|
+
titleLineCount: {
|
|
23
|
+
name: "Number of text lines for Product title",
|
|
24
|
+
options: [1, 2, 3],
|
|
25
|
+
control: {
|
|
26
|
+
type: "select",
|
|
27
|
+
default: 0,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
locale: {
|
|
31
|
+
name: "Locale",
|
|
32
|
+
options: ["de-DE", "en-US"],
|
|
33
|
+
control: {
|
|
34
|
+
type: "select",
|
|
35
|
+
default: 0,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
currencyValue: {
|
|
39
|
+
name: "Currency",
|
|
40
|
+
options: ["$", "€", "£", "¥", "₽"],
|
|
41
|
+
control: {
|
|
42
|
+
type: "select",
|
|
43
|
+
default: 0,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
contentAlignment: {
|
|
47
|
+
name: "Content alignment",
|
|
48
|
+
options: ["Left", "Centered", "Right"],
|
|
49
|
+
mapping: {
|
|
50
|
+
Left: 0,
|
|
51
|
+
Centered: 1,
|
|
52
|
+
Right: 2,
|
|
53
|
+
},
|
|
54
|
+
control: {
|
|
55
|
+
type: "select",
|
|
56
|
+
default: 0,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
primaryTextColor: {
|
|
60
|
+
name: "Primary text color",
|
|
61
|
+
control: {
|
|
62
|
+
type: "color",
|
|
63
|
+
},
|
|
64
|
+
description: "Used where the most user attention is needed: product brand, product title, and price.",
|
|
65
|
+
},
|
|
66
|
+
secondaryTextColor: {
|
|
67
|
+
name: "Secondary text color",
|
|
68
|
+
description: "Used in Old Price",
|
|
69
|
+
control: {
|
|
70
|
+
type: "color",
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export const productDecorator = (story) => `
|
|
2
|
+
<style>
|
|
3
|
+
html, body, #root, #root-inner {
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
#root-inner {
|
|
9
|
+
display: grid;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-items: center;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.product-wrapper {
|
|
15
|
+
width: 240px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
vviinn-product-card {
|
|
19
|
+
align-items: start;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
vviinn-product-card::part(image) {
|
|
23
|
+
border: 1px solid #DDDDDD;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
vviinn-product-card::part(brand) {
|
|
27
|
+
display: flex;
|
|
28
|
+
font-weight: 500;
|
|
29
|
+
font-size: 16px;
|
|
30
|
+
line-height: 24px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
vviinn-product-card::part(brand),
|
|
34
|
+
vviinn-product-card::part(title) {
|
|
35
|
+
text-align: left;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
vviinn-product-card::part(title) {
|
|
39
|
+
order: 2;
|
|
40
|
+
max-width: unset;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
vviinn-product-card::part(price-container) {
|
|
44
|
+
order: 3;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
</style>
|
|
48
|
+
<div class="product-wrapper">
|
|
49
|
+
${story()}
|
|
50
|
+
</div>
|
|
51
|
+
`;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { argTypes } from "./args";
|
|
2
|
+
import { productDecorator } from "./decorators";
|
|
3
|
+
export default {
|
|
4
|
+
title: "Elements/Product Card",
|
|
5
|
+
component: "vviinn-product-card",
|
|
6
|
+
decorators: [
|
|
7
|
+
productDecorator
|
|
8
|
+
],
|
|
9
|
+
argTypes
|
|
10
|
+
};
|
|
11
|
+
const showImageBorders = (x, color) => {
|
|
12
|
+
const borderRule = x ? `1px solid ${color}` : "none";
|
|
13
|
+
return `
|
|
14
|
+
vviinn-product-card::part(image) {
|
|
15
|
+
border: ${borderRule};
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
};
|
|
19
|
+
const setupBrandVisibility = (show) => `
|
|
20
|
+
vviinn-product-card::part(brand) {
|
|
21
|
+
display: ${show ? "flex" : "none"};
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
const setupTitleLineCount = (count) => `
|
|
25
|
+
vviinn-product-card::part(title) {
|
|
26
|
+
-webkit-line-clamp: ${count};
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
const allignementLeft = `
|
|
30
|
+
vviinn-product-card::part(title),
|
|
31
|
+
vviinn-product-card::part(brand),
|
|
32
|
+
vviinn-product-card::part(type),
|
|
33
|
+
vviinn-product-card::part(deeplink),
|
|
34
|
+
vviinn-product-card::part(price-container) {
|
|
35
|
+
align-self: start;
|
|
36
|
+
text-align: left;
|
|
37
|
+
}`;
|
|
38
|
+
const allignementCenter = `
|
|
39
|
+
vviinn-product-card::part(title),
|
|
40
|
+
vviinn-product-card::part(brand),
|
|
41
|
+
vviinn-product-card::part(type),
|
|
42
|
+
vviinn-product-card::part(deeplink),
|
|
43
|
+
vviinn-product-card::part(price-container) {
|
|
44
|
+
align-self: center;
|
|
45
|
+
text-align: center;
|
|
46
|
+
}`;
|
|
47
|
+
const allignementRight = `
|
|
48
|
+
vviinn-product-card::part(title),
|
|
49
|
+
vviinn-product-card::part(brand),
|
|
50
|
+
vviinn-product-card::part(type),
|
|
51
|
+
vviinn-product-card::part(deeplink),
|
|
52
|
+
vviinn-product-card::part(price-container) {
|
|
53
|
+
align-self: end;
|
|
54
|
+
text-align: right;
|
|
55
|
+
}`;
|
|
56
|
+
const allignement = new Map([
|
|
57
|
+
[0, allignementLeft],
|
|
58
|
+
[1, allignementCenter],
|
|
59
|
+
[2, allignementRight],
|
|
60
|
+
]);
|
|
61
|
+
const Template = (args) => `
|
|
62
|
+
<style>
|
|
63
|
+
${allignement.get(args.contentAlignment)}
|
|
64
|
+
${showImageBorders(args.imageBorder, args.imageBorderColor)}
|
|
65
|
+
${setupBrandVisibility(args.showBrand)}
|
|
66
|
+
${setupTitleLineCount(args.titleLineCount)}
|
|
67
|
+
|
|
68
|
+
vviinn-product-card::part(title),
|
|
69
|
+
vviinn-product-card::part(brand),
|
|
70
|
+
vviinn-product-card::part(type),
|
|
71
|
+
vviinn-product-card::part(price-sale),
|
|
72
|
+
vviinn-product-card::part(price-regular) {
|
|
73
|
+
color: ${args.primaryTextColor};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
vviinn-product-card::part(price-outdated) {
|
|
77
|
+
color: ${args.secondaryTextColor};
|
|
78
|
+
}
|
|
79
|
+
</style>
|
|
80
|
+
<vviinn-product-card
|
|
81
|
+
product-title="Couchtisch Rolf Benz 8770 Ronald Schmitt"
|
|
82
|
+
brand="Ronald Schmitt"
|
|
83
|
+
product-type="Couchtische"
|
|
84
|
+
price="3629"
|
|
85
|
+
sale-price="1653"
|
|
86
|
+
image="https://www.moebel-shop.de/media/image/e3/e9/28/0749295-001_600x600.jpg"
|
|
87
|
+
image-width="${args.imageWidth}"
|
|
88
|
+
dimmed-background="${args.imageBackground}"
|
|
89
|
+
locale="${args.locale}"
|
|
90
|
+
currency="${args.currencyValue}"
|
|
91
|
+
></vviinn-product-card>`;
|
|
92
|
+
export const Default = Template.bind({});
|
|
93
|
+
Default.args = {
|
|
94
|
+
imageWidth: 240,
|
|
95
|
+
contentAlignment: "Left",
|
|
96
|
+
imageBorder: true,
|
|
97
|
+
imageBorderColor: "#dddddd",
|
|
98
|
+
imageBackground: false,
|
|
99
|
+
primaryTextColor: "#161616",
|
|
100
|
+
secondaryTextColor: "#757575",
|
|
101
|
+
showBrand: false,
|
|
102
|
+
titleLineCount: 2,
|
|
103
|
+
locale: "en-US",
|
|
104
|
+
currencyValue: "€"
|
|
105
|
+
};
|