vviinn-widgets 2.2.2 → 2.4.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/{app-globals-30781f30.js → app-globals-2bcc74df.js} +1 -1
- package/dist/cjs/cropper-handler.cjs.entry.js +1 -1
- package/dist/cjs/{customized-slots-5d904d8e.js → customized-slots-4202eaf5.js} +1 -1
- package/dist/cjs/highlight-box_22.cjs.entry.js +20 -10
- package/dist/cjs/{imageSearch.store-128957a4.js → imageSearch.store-cb2b2cc8.js} +14 -11
- package/dist/cjs/{index-c493804d.js → index-44fc16ad.js} +7 -9
- package/dist/cjs/{index-741a970d.js → index-6771ae25.js} +1 -1
- package/dist/cjs/index-e9439500.js +3943 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{vviinn-carousel_5.cjs.entry.js → vviinn-carousel_3.cjs.entry.js} +54 -108
- package/dist/cjs/vviinn-error.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-preloader.cjs.entry.js +2 -2
- 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 +4 -4
- package/dist/cjs/vviinn-vps-widget.cjs.entry.js +74 -10
- package/dist/cjs/vviinn-widgets.cjs.js +3 -3
- package/dist/collection/components/image-search/image-view/image-cropper/image-cropper.js +27 -7
- package/dist/collection/components/image-search/search-filters/search-filters.js +24 -1
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.css +4 -0
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.js +6 -3
- package/dist/collection/components/vviinn-icons/index.js +6 -8
- package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.js +18 -1
- 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-product-card/vviinn-product-card.js +57 -12
- 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 +47 -9
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-widget.css +5 -0
- package/dist/collection/components/vviinn-vps-button/stories/vviinn-vps-button.stories.js +31 -0
- package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.css +3 -0
- package/dist/collection/components/vviinn-vps-widget/stories/vviinn-vps-widget.stories.js +33 -0
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +108 -10
- package/dist/collection/network/utils.js +1 -1
- package/dist/collection/openApi/index.js +27 -0
- package/dist/collection/{components/vviinn-vpr-widget/GridMode.js → recommendation/events.js} +0 -0
- package/dist/collection/store/store.js +7 -9
- package/dist/collection/store/tracking.store.js +3 -0
- package/dist/collection/tracking/event.js +3 -0
- package/dist/collection/tracking/filter.js +5 -0
- package/dist/collection/tracking/index.js +13 -0
- package/dist/collection/tracking/models.js +6 -0
- package/dist/collection/tracking/product.js +18 -0
- package/dist/collection/tracking/search.js +5 -0
- package/dist/collection/tracking/widget.js +10 -0
- package/dist/esm/{app-globals-345e497d.js → app-globals-550daa9b.js} +1 -1
- package/dist/esm/cropper-handler.entry.js +1 -1
- package/dist/esm/{customized-slots-a76a8d41.js → customized-slots-80625933.js} +1 -1
- package/dist/esm/highlight-box_22.entry.js +20 -10
- package/dist/esm/{imageSearch.store-8eab0da1.js → imageSearch.store-1268786d.js} +12 -10
- package/dist/esm/{index-8cb063df.js → index-1cf740a8.js} +8 -10
- package/dist/esm/{index-6fa21e24.js → index-c09e56b6.js} +1 -1
- package/dist/esm/index-fa27f1df.js +3934 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{vviinn-carousel_5.entry.js → vviinn-carousel_3.entry.js} +55 -107
- package/dist/esm/vviinn-error.entry.js +1 -1
- package/dist/esm/vviinn-preloader.entry.js +2 -2
- 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 +4 -4
- package/dist/esm/vviinn-vps-widget.entry.js +71 -7
- package/dist/esm/vviinn-widgets.js +3 -3
- package/dist/types/Image/error.d.ts +1 -0
- package/dist/types/Image/form.d.ts +1 -0
- package/dist/types/Image/fromFile.d.ts +1 -0
- package/dist/types/Image/imageToB64.d.ts +1 -0
- package/dist/types/Image/index.d.ts +1 -0
- package/dist/types/Image/renderPromise.d.ts +1 -0
- package/dist/types/Image/resizeImage.d.ts +1 -0
- package/dist/types/Image/sizing.d.ts +1 -0
- package/dist/types/Image/toFile.d.ts +1 -0
- package/dist/types/analytics/GAnalytics.d.ts +1 -0
- package/dist/types/analytics/GeneralAnalytics.d.ts +1 -0
- package/dist/types/analytics/GtagAnalytics.d.ts +1 -0
- package/dist/types/analytics/ProductAnalytics.d.ts +1 -0
- package/dist/types/campaign/Campaign.d.ts +1 -0
- package/dist/types/campaign/CampaignService.d.ts +1 -0
- package/dist/types/campaign/VCSCampaign.d.ts +1 -0
- package/dist/types/campaign/VCSCampaignResponse.d.ts +1 -0
- package/dist/types/campaign/VCSCampaignService.d.ts +1 -0
- package/dist/types/campaign/VPRCampaignResponse.d.ts +1 -0
- package/dist/types/campaign/VPRCampaignService.d.ts +1 -0
- package/dist/types/components/customized-slots.d.ts +1 -0
- package/dist/types/components/image-search/image-view/highlight-box/highlight-box.d.ts +1 -0
- package/dist/types/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.d.ts +1 -0
- package/dist/types/components/image-search/image-view/image-cropper/image-cropper.d.ts +4 -0
- package/dist/types/components/image-search/search-filters/search-filters.d.ts +4 -0
- package/dist/types/components/vviinn-carousel/vviinn-carousel.d.ts +4 -0
- package/dist/types/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.d.ts +1 -0
- package/dist/types/components/vviinn-error/vviinn-error.d.ts +1 -0
- package/dist/types/components/vviinn-error/vviinn-server-error/vviinn-server-error.d.ts +1 -0
- package/dist/types/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.d.ts +1 -0
- package/dist/types/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.d.ts +1 -0
- package/dist/types/components/vviinn-example-images/vviinn-example-images.d.ts +1 -0
- package/dist/types/components/vviinn-icons/index.d.ts +1 -0
- package/dist/types/components/vviinn-image-selector/vviinn-image-selector.d.ts +1 -0
- package/dist/types/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.d.ts +3 -0
- package/dist/types/components/vviinn-image-view/vviinn-image-view.d.ts +1 -0
- package/dist/types/components/vviinn-modal/vviinn-modal.d.ts +1 -0
- package/dist/types/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-1/vviinn-onboarding-card-1.d.ts +1 -0
- package/dist/types/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-2/vviinn-onboarding-card-2.d.ts +1 -0
- package/dist/types/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-3/vviinn-onboarding-card-3.d.ts +1 -0
- package/dist/types/components/vviinn-onboarding/vviinn-onboarding.d.ts +1 -0
- package/dist/types/components/vviinn-overlay/vviinn-overlay.d.ts +1 -0
- package/dist/types/components/vviinn-overlayed-modal/vviinn-overlayed-modal.d.ts +1 -0
- package/dist/types/components/vviinn-preloader/vviinn-preloader.d.ts +1 -0
- package/dist/types/components/vviinn-privacy-badge/vviinn-privacy-badge.d.ts +1 -0
- package/dist/types/components/vviinn-product-card/render-helpers.d.ts +1 -0
- package/dist/types/components/vviinn-product-card/stories/args.d.ts +74 -0
- package/dist/types/components/vviinn-product-card/stories/decorators.d.ts +2 -0
- package/dist/types/components/vviinn-product-card/stories/vviinn-product-card.stories.d.ts +81 -0
- package/dist/types/components/vviinn-product-card/vviinn-product-card.d.ts +9 -3
- package/dist/types/components/vviinn-slider/arrow.d.ts +1 -0
- package/dist/types/components/vviinn-slider/vviinn-slide/vviinn-slide.d.ts +1 -0
- package/dist/types/components/vviinn-slider/vviinn-slider.d.ts +1 -0
- package/dist/types/components/vviinn-teaser/vviinn-teaser.d.ts +1 -0
- package/dist/types/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.d.ts +1 -0
- package/dist/types/components/vviinn-vpr-button/stories/args.d.ts +208 -0
- package/dist/types/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.d.ts +215 -0
- package/dist/types/components/vviinn-vpr-button/vviinn-vpr-button.d.ts +4 -0
- package/dist/types/components/vviinn-vpr-widget/stories/args.d.ts +199 -0
- package/dist/types/components/vviinn-vpr-widget/stories/decorators.d.ts +3 -0
- package/dist/types/components/vviinn-vpr-widget/stories/vviinn-vpr-widget.stories.d.ts +142 -0
- package/dist/types/components/vviinn-vpr-widget/token-helpers.d.ts +1 -0
- package/dist/types/components/vviinn-vpr-widget/vviinn-vpr-vidget.d.ts +10 -1
- package/dist/types/components/vviinn-vps-button/stories/vviinn-vps-button.stories.d.ts +13 -0
- package/dist/types/components/vviinn-vps-button/vviinn-vps-button.d.ts +1 -0
- package/dist/types/components/vviinn-vps-widget/stories/vviinn-vps-widget.stories.d.ts +11 -0
- package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +14 -1
- package/dist/types/components.d.ts +10 -4
- package/dist/types/cropper/Cropper.d.ts +1 -0
- package/dist/types/cropper/Handler.d.ts +1 -0
- package/dist/types/dom/index.d.ts +1 -0
- package/dist/types/error.d.ts +1 -0
- package/dist/types/file/index.d.ts +1 -0
- package/dist/types/geometry/Clip.d.ts +1 -0
- package/dist/types/geometry/Point.d.ts +1 -0
- package/dist/types/geometry/Rectangle.d.ts +1 -0
- package/dist/types/geometry/RectangleAlt.d.ts +1 -0
- package/dist/types/geometry/Sized.d.ts +1 -0
- package/dist/types/global.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/interfaces/generated.d.ts +1 -0
- package/dist/types/interfaces/recommendation.d.ts +1 -0
- package/dist/types/network/apiClient.d.ts +1 -0
- package/dist/types/network/ion/File.d.ts +1 -0
- package/dist/types/network/ion/Form.d.ts +1 -0
- package/dist/types/network/ion/Link.d.ts +1 -0
- package/dist/types/network/ion/ValueObject.d.ts +1 -0
- package/dist/types/network/request.d.ts +1 -0
- package/dist/types/network/utils.d.ts +1 -0
- package/dist/types/openApi/index.d.ts +6 -0
- package/dist/types/recommendation/events.d.ts +6 -0
- package/dist/types/recommendation/recommendation.d.ts +1 -0
- package/dist/types/searchSession/searchSession.d.ts +1 -0
- package/dist/types/sentry.d.ts +1 -0
- package/dist/types/slider/GridMode.d.ts +1 -0
- package/dist/types/store/file-processing.d.ts +1 -0
- package/dist/types/store/imageSearch.store.d.ts +1 -0
- package/dist/types/store/store.d.ts +8 -6
- package/dist/types/store/tracking.store.d.ts +4 -0
- package/dist/types/stories/image-selector.stories.d.ts +1 -0
- package/dist/types/stories/image-view.stories.d.ts +1 -0
- package/dist/types/stories/modal.stories.d.ts +1 -0
- package/dist/types/stories/onboarding.stories.d.ts +1 -0
- package/dist/types/stories/overlay.stories.d.ts +1 -0
- package/dist/types/stories/overlayedModal.stories.d.ts +1 -0
- package/dist/types/stories/privacy-badge.stories.d.ts +1 -0
- package/dist/types/stories/slider.stories.d.ts +1 -0
- package/dist/types/stories/teaser.stories.d.ts +1 -0
- package/dist/types/stories/vps-widget.stories.d.ts +1 -0
- package/dist/types/stories/vviinn-product.stories.d.ts +1 -0
- package/dist/types/tracking/event.d.ts +4 -0
- package/dist/types/tracking/filter.d.ts +3 -0
- package/dist/types/tracking/index.d.ts +9 -0
- package/dist/types/tracking/models.d.ts +13 -0
- package/dist/types/tracking/product.d.ts +7 -0
- package/dist/types/tracking/search.d.ts +3 -0
- package/dist/types/tracking/widget.d.ts +5 -0
- package/dist/types/utils/collections/collectionsUtils.d.ts +1 -0
- package/dist/types/utils/either.d.ts +1 -0
- package/dist/types/utils/enum/enumUtils.d.ts +1 -0
- package/dist/types/utils/event/Events.d.ts +1 -0
- package/dist/types/utils/number/index.d.ts +1 -0
- package/dist/types/utils/option/option.d.ts +1 -0
- package/dist/types/utils/semigroup/semigroupDiff.d.ts +1 -0
- package/dist/types/utils/token/tokenUtils.d.ts +1 -0
- package/dist/vviinn-widgets/{p-78ccc9eb.js → p-07125f64.js} +1 -1
- package/dist/vviinn-widgets/{p-f47e82b2.entry.js → p-27ede517.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-9d24f51e.entry.js → p-314e40b3.entry.js} +1 -1
- package/dist/vviinn-widgets/p-316abc01.js +1 -0
- package/dist/vviinn-widgets/{p-fb14e3cc.entry.js → p-4bdb3027.entry.js} +1 -1
- package/dist/vviinn-widgets/p-5535163a.entry.js +1 -0
- package/dist/vviinn-widgets/{p-59edfbe2.js → p-78b65f70.js} +1 -1
- package/dist/vviinn-widgets/{p-400eb62f.entry.js → p-86ae782f.entry.js} +1 -1
- package/dist/vviinn-widgets/p-89f2c19a.entry.js +1 -0
- package/dist/vviinn-widgets/{p-e1ba8626.js → p-8e25b838.js} +1 -1
- package/dist/vviinn-widgets/p-94aa8705.entry.js +1 -0
- package/dist/vviinn-widgets/{p-e67cae57.js → p-97af45f0.js} +1 -1
- package/dist/vviinn-widgets/p-c5e6ec4f.js +1 -0
- package/dist/vviinn-widgets/p-c63fb46b.entry.js +1 -0
- package/{www/build/p-d085199d.entry.js → dist/vviinn-widgets/p-dd7cac6e.entry.js} +1 -1
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +11 -3
- package/www/build/{p-78ccc9eb.js → p-07125f64.js} +1 -1
- package/www/build/{p-f47e82b2.entry.js → p-27ede517.entry.js} +1 -1
- package/www/build/{p-9d24f51e.entry.js → p-314e40b3.entry.js} +1 -1
- package/www/build/p-316abc01.js +1 -0
- package/www/build/{p-fb14e3cc.entry.js → p-4bdb3027.entry.js} +1 -1
- package/www/build/p-5535163a.entry.js +1 -0
- package/www/build/{p-59edfbe2.js → p-78b65f70.js} +1 -1
- package/www/build/{p-400eb62f.entry.js → p-86ae782f.entry.js} +1 -1
- package/www/build/p-89f2c19a.entry.js +1 -0
- package/www/build/{p-e1ba8626.js → p-8e25b838.js} +1 -1
- package/www/build/p-94aa8705.entry.js +1 -0
- package/www/build/p-961822d3.js +125 -0
- package/www/build/{p-e67cae57.js → p-97af45f0.js} +1 -1
- package/www/build/p-c5e6ec4f.js +1 -0
- package/www/build/p-c63fb46b.entry.js +1 -0
- package/{dist/vviinn-widgets/p-d085199d.entry.js → www/build/p-dd7cac6e.entry.js} +1 -1
- package/www/build/p-e0153ae2.css +6 -0
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +1 -177
- package/dist/collection/components/vviinn-vpr-button/stories/kek.stories.js +0 -18
- package/dist/types/components/vviinn-vpr-button/stories/kek.stories.d.ts +0 -7
- package/dist/types/components/vviinn-vpr-widget/GridMode.d.ts +0 -1
- package/dist/vviinn-widgets/p-04b06ea9.entry.js +0 -1
- package/dist/vviinn-widgets/p-56fc949a.js +0 -1
- package/dist/vviinn-widgets/p-e38f4aa2.entry.js +0 -1
- package/www/build/p-04b06ea9.entry.js +0 -1
- package/www/build/p-56fc949a.js +0 -1
- package/www/build/p-7e4978d5.js +0 -1
- package/www/build/p-a67898be.css +0 -1
- package/www/build/p-e38f4aa2.entry.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
4
|
-
const appGlobals = require('./app-globals-
|
|
3
|
+
const index = require('./index-6771ae25.js');
|
|
4
|
+
const appGlobals = require('./app-globals-2bcc74df.js');
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
Stencil Client Patch Browser v2.9.0 | MIT Licensed | https://stenciljs.com
|
|
@@ -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","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]}],[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]}]]],["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]},[[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"],[0,"cropperChanged","trachSearchAreaChanges"],[0,"detectedObjectClicked","trackDetectedObject"],[0,"filterSelected","trackFilter"]]]]],["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
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Host, h, State, Element, Prop } from "@stencil/core";
|
|
1
|
+
import { Component, Host, h, State, Element, Prop, Event, } from "@stencil/core";
|
|
2
2
|
import { move, transform } from "../../../../geometry/Rectangle";
|
|
3
3
|
import { fromMouseEvent, pointDiffSemigroup, } from "../../../../geometry/Point";
|
|
4
4
|
import { imageSearchState, makeRectangularSearchRequest, } from "../../../../store/imageSearch.store";
|
|
@@ -27,18 +27,21 @@ export class ImageCropper {
|
|
|
27
27
|
};
|
|
28
28
|
pipe(imageSearchState.searchArea, O.map((area) => {
|
|
29
29
|
const newSearchArea = transform(area, transformedHandler);
|
|
30
|
-
if (newSearchArea
|
|
31
|
-
newSearchArea.height < MIN_SEARCHAREA_SIZE ||
|
|
32
|
-
newSearchArea.x < 0 ||
|
|
33
|
-
newSearchArea.y < 0 ||
|
|
34
|
-
this.bounds.height - (newSearchArea.y + newSearchArea.height) < 0 ||
|
|
35
|
-
this.bounds.width - (newSearchArea.x + newSearchArea.width) < 0)
|
|
30
|
+
if (this.outOfBounds(newSearchArea))
|
|
36
31
|
return;
|
|
37
32
|
imageSearchState.searchArea = O.some(newSearchArea);
|
|
38
33
|
this.mouseStartPoint = destination;
|
|
39
34
|
imageSearchState.detectedObject = undefined;
|
|
40
35
|
}));
|
|
41
36
|
}
|
|
37
|
+
outOfBounds(area) {
|
|
38
|
+
return (area.width < MIN_SEARCHAREA_SIZE ||
|
|
39
|
+
area.height < MIN_SEARCHAREA_SIZE ||
|
|
40
|
+
area.x < 0 ||
|
|
41
|
+
area.y < 0 ||
|
|
42
|
+
this.bounds.height - (area.y + area.height) < 0 ||
|
|
43
|
+
this.bounds.width - (area.x + area.width) < 0);
|
|
44
|
+
}
|
|
42
45
|
handleCropperMove(ev) {
|
|
43
46
|
ev.preventDefault();
|
|
44
47
|
ev.stopPropagation();
|
|
@@ -79,6 +82,7 @@ export class ImageCropper {
|
|
|
79
82
|
document.removeEventListener("pointerup", this.pointerReleaseListener);
|
|
80
83
|
this.mouseStartPoint = undefined;
|
|
81
84
|
makeRectangularSearchRequest();
|
|
85
|
+
this.cropperChanged.emit();
|
|
82
86
|
}
|
|
83
87
|
getStyleMap() {
|
|
84
88
|
return pipe(imageSearchState.searchArea, O.map((rectangle) => {
|
|
@@ -131,5 +135,21 @@ export class ImageCropper {
|
|
|
131
135
|
static get states() { return {
|
|
132
136
|
"handleMove": {}
|
|
133
137
|
}; }
|
|
138
|
+
static get events() { return [{
|
|
139
|
+
"method": "cropperChanged",
|
|
140
|
+
"name": "cropperChanged",
|
|
141
|
+
"bubbles": true,
|
|
142
|
+
"cancelable": true,
|
|
143
|
+
"composed": true,
|
|
144
|
+
"docs": {
|
|
145
|
+
"tags": [],
|
|
146
|
+
"text": ""
|
|
147
|
+
},
|
|
148
|
+
"complexType": {
|
|
149
|
+
"original": "any",
|
|
150
|
+
"resolved": "any",
|
|
151
|
+
"references": {}
|
|
152
|
+
}
|
|
153
|
+
}]; }
|
|
134
154
|
static get elementRef() { return "el"; }
|
|
135
155
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Host, h, Prop, State, Element } from "@stencil/core";
|
|
1
|
+
import { Component, Host, h, Prop, State, Element, Event } from "@stencil/core";
|
|
2
2
|
import { imageSearchState } from "../../../store/imageSearch.store";
|
|
3
3
|
import { CheckIcon } from "../../vviinn-icons";
|
|
4
4
|
const FILTERS_COUNT = 5;
|
|
@@ -18,11 +18,13 @@ export class SearchFilters {
|
|
|
18
18
|
selectFilter(filter) {
|
|
19
19
|
this.selectedCategoryId = getFilterId(filter);
|
|
20
20
|
imageSearchState.activeIonLink = filter;
|
|
21
|
+
this.filterSelected.emit("select");
|
|
21
22
|
}
|
|
22
23
|
clearSelectedFilter() {
|
|
23
24
|
this.selectedCategoryId = null;
|
|
24
25
|
imageSearchState.activeIonLink = undefined;
|
|
25
26
|
this.findSelectedFilter().blur();
|
|
27
|
+
this.filterSelected.emit("deselect");
|
|
26
28
|
}
|
|
27
29
|
findSelectedFilter() {
|
|
28
30
|
return this.el.shadowRoot.querySelector(ACTIVE_FILTER_CLASSNAME);
|
|
@@ -98,5 +100,26 @@ export class SearchFilters {
|
|
|
98
100
|
"selectedCategoryId": {},
|
|
99
101
|
"hideFilters": {}
|
|
100
102
|
}; }
|
|
103
|
+
static get events() { return [{
|
|
104
|
+
"method": "filterSelected",
|
|
105
|
+
"name": "filterSelected",
|
|
106
|
+
"bubbles": true,
|
|
107
|
+
"cancelable": true,
|
|
108
|
+
"composed": true,
|
|
109
|
+
"docs": {
|
|
110
|
+
"tags": [],
|
|
111
|
+
"text": ""
|
|
112
|
+
},
|
|
113
|
+
"complexType": {
|
|
114
|
+
"original": "FilterAction",
|
|
115
|
+
"resolved": "\"deselect\" | \"select\"",
|
|
116
|
+
"references": {
|
|
117
|
+
"FilterAction": {
|
|
118
|
+
"location": "import",
|
|
119
|
+
"path": "@vviinn/tracking-client-ts"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}]; }
|
|
101
124
|
static get elementRef() { return "el"; }
|
|
102
125
|
}
|
|
@@ -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
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
export const ArrowIcon = () => (h("svg", { width: "12", height: "20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
3
3
|
h("path", { d: "M0 10 10 0l1.4 1.4L2.8 10l8.6 8.6L10 20 0 10Z" })));
|
|
4
|
-
export const CameraIcon = () => (h("svg", {
|
|
5
|
-
h("
|
|
6
|
-
h("path", { fill: "#525252", "fill-rule": "evenodd", d: "M9.771 3.89a.875.875 0 01.728-.39h7c.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.25A2.625 2.625 0 012.625 21V8.75A2.625 2.625 0 015.25 6.125h3.031l1.49-2.235zm1.197 1.36l-1.49 2.235a.875.875 0 01-.729.39H5.25a.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" }),
|
|
7
|
-
h("path", { fill: "#525252", "fill-rule": "evenodd", d: "M14 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" })));
|
|
4
|
+
export const CameraIcon = () => (h("svg", { width: "22", height: "20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
5
|
+
h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M16.567 3H19A3.01 3.01 0 0 1 22 6v7.69h-2V6c0-.55-.451-1-1.001-1h-3.502l-2.03-3H8.543L6.603 5H3.001c-.55 0-1 .45-1 1v11c0 .55.45 1 1 1h5.933v2H3.001A3.01 3.01 0 0 1 0 17V6c0-1.65 1.35-3 3.001-3h2.522l1.94-3h7.074l2.03 3Zm-5.562 3c1.28 0 2.561.48 3.542 1.46h-.01a4.992 4.992 0 0 1 .64 6.29l3.051 3.05-1.41 1.41-3.052-3.05c-.84.55-1.8.83-2.76.83-1.282 0-2.562-.48-3.543-1.46a5.002 5.002 0 0 1 0-7.07A5.026 5.026 0 0 1 11.005 6Zm-2.771 5a2.763 2.763 0 0 0 2.771 2.77A2.763 2.763 0 0 0 13.776 11a2.763 2.763 0 0 0-2.771-2.77A2.763 2.763 0 0 0 8.234 11Z", fill: "#161616" })));
|
|
8
6
|
export const OnboardingCard1Icon = () => (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "120", height: "120", fill: "none" },
|
|
9
7
|
h("defs", null),
|
|
10
8
|
h("path", { fill: "#393939", d: "M74.55 20a5.06 5.06 0 014.14 2l4.72 9.32.1.18.11.17A5.07 5.07 0 0087.93 34h13.87c5.07 0 9.2 3.59 9.2 8v50c0 4.41-4.13 8-9.2 8H18.2c-5.07 0-9.2-3.59-9.2-8V42c0-4.41 4.13-8 9.2-8h13.87a5.072 5.072 0 004.31-2.34l.11-.17.1-.18L41.31 22a5.06 5.06 0 014.14-2h29.1zm0-4h-29.1a9 9 0 00-7.6 4L33 29.5a1.13 1.13 0 01-1 .5H18.2C10.91 30 5 35.37 5 42v50c0 6.63 5.91 12 13.2 12h83.6c7.29 0 13.2-5.37 13.2-12V42c0-6.63-5.91-12-13.2-12H87.93a1.13 1.13 0 01-1-.5L82.15 20a9 9 0 00-7.6-4z" }),
|
|
@@ -22,9 +20,9 @@ export const CheckIcon = () => (h("svg", { width: "14", height: "11", fill: "non
|
|
|
22
20
|
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
21
|
export const LoaderIcon = () => (h("svg", { width: "100%", height: "100%", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 28 28" },
|
|
24
22
|
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"
|
|
27
|
-
export const VisualSearchIcon = () => (h("svg", { width: "
|
|
28
|
-
h("path", { d: "
|
|
23
|
+
export const ChevronIcon = () => (h("svg", { width: "9", height: "16", xmlns: "http://www.w3.org/2000/svg" },
|
|
24
|
+
h("path", { d: "m9 8-7.895 8L0 14.88 6.79 8 0 1.12 1.105 0 9 8Z" })));
|
|
25
|
+
export const VisualSearchIcon = () => (h("svg", { width: "20", height: "20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
26
|
+
h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M5 2C3.35 2 2 3.35 2 5v2H0V5c0-2.76 2.24-5 5-5h2v2H5Zm5 3c1.28 0 2.56.48 3.54 1.46h-.01a4.994 4.994 0 0 1 .64 6.29l3.05 3.05-1.41 1.41-3.05-3.05c-.84.55-1.8.83-2.76.83a4.98 4.98 0 0 1-3.54-1.46 5.003 5.003 0 0 1 0-7.07C7.44 5.49 8.72 5 10 5Zm-2.77 5c0 .74.29 1.44.81 1.96s1.22.81 1.96.81 1.44-.29 1.96-.81.81-1.22.81-1.96-.29-1.44-.81-1.96-1.22-.81-1.96-.81-1.44.29-1.96.81-.81 1.22-.81 1.96ZM2 15v-2H0v2c0 2.76 2.24 5 5 5h2v-2H5c-1.65 0-3-1.35-3-3ZM13 0h2c2.76 0 5 2.24 5 5v2h-2V5c0-1.65-1.35-3-3-3h-2V0Z", fill: "#161616" })));
|
|
29
27
|
export const CrossIcon = () => (h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
30
28
|
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: "#161616" })));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Host, h, State, Prop } from "@stencil/core";
|
|
1
|
+
import { Component, Host, h, State, Prop, Event } from "@stencil/core";
|
|
2
2
|
import { pipe } from "fp-ts/lib/function";
|
|
3
3
|
import * as O from "fp-ts/lib/Option";
|
|
4
4
|
import { foldValueObject } from "../../../network/ion/ValueObject";
|
|
@@ -25,6 +25,7 @@ export class VviinnDetectedObject {
|
|
|
25
25
|
imageSearchState.searchArea = O.some(scaledRect);
|
|
26
26
|
}));
|
|
27
27
|
makeRectangularSearchRequest();
|
|
28
|
+
this.detectedObjectClicked.emit();
|
|
28
29
|
}
|
|
29
30
|
isActive() {
|
|
30
31
|
if (!this.detectedObject)
|
|
@@ -80,4 +81,20 @@ export class VviinnDetectedObject {
|
|
|
80
81
|
static get states() { return {
|
|
81
82
|
"position": {}
|
|
82
83
|
}; }
|
|
84
|
+
static get events() { return [{
|
|
85
|
+
"method": "detectedObjectClicked",
|
|
86
|
+
"name": "detectedObjectClicked",
|
|
87
|
+
"bubbles": true,
|
|
88
|
+
"cancelable": true,
|
|
89
|
+
"composed": true,
|
|
90
|
+
"docs": {
|
|
91
|
+
"tags": [],
|
|
92
|
+
"text": ""
|
|
93
|
+
},
|
|
94
|
+
"complexType": {
|
|
95
|
+
"original": "any",
|
|
96
|
+
"resolved": "any",
|
|
97
|
+
"references": {}
|
|
98
|
+
}
|
|
99
|
+
}]; }
|
|
83
100
|
}
|
|
@@ -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
|
+
};
|
|
@@ -28,22 +28,31 @@ export class VviinnProductCard {
|
|
|
28
28
|
this.pricePrefix = undefined;
|
|
29
29
|
this.responsive = false;
|
|
30
30
|
this.dimmedBackground = false;
|
|
31
|
+
/** @internal */
|
|
32
|
+
this.index = 0;
|
|
31
33
|
this.imageLoaded = false;
|
|
34
|
+
this.productData = null;
|
|
32
35
|
this.intersectionObserver = new IntersectionObserver(this.intersectionCallback.bind(this), { threshold: 1.0 });
|
|
33
36
|
}
|
|
37
|
+
connectedCallback() {
|
|
38
|
+
this.productData = {
|
|
39
|
+
product: this.productId,
|
|
40
|
+
rank: this.index
|
|
41
|
+
};
|
|
42
|
+
}
|
|
34
43
|
intersectionCallback(data) {
|
|
35
44
|
if (data.some((entry) => entry.isIntersecting)) {
|
|
36
45
|
pipe(getAnalyticsModule, O.map((analytics) => analytics.sendImpression(this.getProduct())));
|
|
37
|
-
this.recommendationView.emit(this.
|
|
46
|
+
this.recommendationView.emit(this.productData);
|
|
38
47
|
this.intersectionObserver.disconnect();
|
|
39
48
|
}
|
|
40
49
|
}
|
|
41
50
|
componentDidLoad() {
|
|
42
|
-
this.recommendationLoad.emit(this.
|
|
51
|
+
this.recommendationLoad.emit(this.productData);
|
|
43
52
|
this.intersectionObserver.observe(this.el);
|
|
44
53
|
const links = this.el.shadowRoot.querySelectorAll("a");
|
|
45
54
|
links.forEach((link) => link.addEventListener("mousedown", (event) => {
|
|
46
|
-
this.recommendationClick.emit(this.
|
|
55
|
+
this.recommendationClick.emit(this.productData);
|
|
47
56
|
if (window.ga) {
|
|
48
57
|
event.preventDefault();
|
|
49
58
|
}
|
|
@@ -355,6 +364,27 @@ export class VviinnProductCard {
|
|
|
355
364
|
"attribute": "dimmed-background",
|
|
356
365
|
"reflect": false,
|
|
357
366
|
"defaultValue": "false"
|
|
367
|
+
},
|
|
368
|
+
"index": {
|
|
369
|
+
"type": "number",
|
|
370
|
+
"mutable": false,
|
|
371
|
+
"complexType": {
|
|
372
|
+
"original": "number",
|
|
373
|
+
"resolved": "number",
|
|
374
|
+
"references": {}
|
|
375
|
+
},
|
|
376
|
+
"required": false,
|
|
377
|
+
"optional": false,
|
|
378
|
+
"docs": {
|
|
379
|
+
"tags": [{
|
|
380
|
+
"text": undefined,
|
|
381
|
+
"name": "internal"
|
|
382
|
+
}],
|
|
383
|
+
"text": ""
|
|
384
|
+
},
|
|
385
|
+
"attribute": "index",
|
|
386
|
+
"reflect": false,
|
|
387
|
+
"defaultValue": "0"
|
|
358
388
|
}
|
|
359
389
|
}; }
|
|
360
390
|
static get states() { return {
|
|
@@ -371,9 +401,14 @@ export class VviinnProductCard {
|
|
|
371
401
|
"text": "Event fires ones when recommendation rendered on page"
|
|
372
402
|
},
|
|
373
403
|
"complexType": {
|
|
374
|
-
"original": "
|
|
375
|
-
"resolved": "string",
|
|
376
|
-
"references": {
|
|
404
|
+
"original": "ProductCardEventData",
|
|
405
|
+
"resolved": "{ product: string; rank: number; }",
|
|
406
|
+
"references": {
|
|
407
|
+
"ProductCardEventData": {
|
|
408
|
+
"location": "import",
|
|
409
|
+
"path": "../../recommendation/events"
|
|
410
|
+
}
|
|
411
|
+
}
|
|
377
412
|
}
|
|
378
413
|
}, {
|
|
379
414
|
"method": "recommendationView",
|
|
@@ -386,9 +421,14 @@ export class VviinnProductCard {
|
|
|
386
421
|
"text": "Event fires ones when recommendation appears on the viewport"
|
|
387
422
|
},
|
|
388
423
|
"complexType": {
|
|
389
|
-
"original": "
|
|
390
|
-
"resolved": "string",
|
|
391
|
-
"references": {
|
|
424
|
+
"original": "ProductCardEventData",
|
|
425
|
+
"resolved": "{ product: string; rank: number; }",
|
|
426
|
+
"references": {
|
|
427
|
+
"ProductCardEventData": {
|
|
428
|
+
"location": "import",
|
|
429
|
+
"path": "../../recommendation/events"
|
|
430
|
+
}
|
|
431
|
+
}
|
|
392
432
|
}
|
|
393
433
|
}, {
|
|
394
434
|
"method": "recommendationClick",
|
|
@@ -401,9 +441,14 @@ export class VviinnProductCard {
|
|
|
401
441
|
"text": "Event fires ones when user click on deeplink"
|
|
402
442
|
},
|
|
403
443
|
"complexType": {
|
|
404
|
-
"original": "
|
|
405
|
-
"resolved": "string",
|
|
406
|
-
"references": {
|
|
444
|
+
"original": "ProductCardEventData",
|
|
445
|
+
"resolved": "{ product: string; rank: number; }",
|
|
446
|
+
"references": {
|
|
447
|
+
"ProductCardEventData": {
|
|
448
|
+
"location": "import",
|
|
449
|
+
"path": "../../recommendation/events"
|
|
450
|
+
}
|
|
451
|
+
}
|
|
407
452
|
}
|
|
408
453
|
}, {
|
|
409
454
|
"method": "productImageLoaded",
|