vviinn-widgets 2.1.0 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Handler-d1a8a86a.js +329 -0
- package/dist/{vviinn-widgets/app-globals-e0943e34.js → cjs/app-globals-30781f30.js} +15 -925
- package/{www/build/cropper-handler.entry.js → dist/cjs/cropper-handler.cjs.entry.js} +11 -7
- package/dist/{vviinn-widgets/customized-slots-f3449695.js → cjs/customized-slots-5d904d8e.js} +6 -3
- package/dist/cjs/highlight-box_22.cjs.entry.js +737 -0
- package/{www/build/imageSearch.store-407f49f0.js → dist/cjs/imageSearch.store-128957a4.js} +11573 -11902
- package/dist/cjs/index-741a970d.js +1354 -0
- package/dist/cjs/index-c493804d.js +41 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +23 -0
- package/dist/cjs/vviinn-carousel_5.cjs.entry.js +1232 -0
- package/dist/{vviinn-widgets/vviinn-error.entry.js → cjs/vviinn-error.cjs.entry.js} +8 -4
- package/{www/build/vviinn-preloader.entry.js → dist/cjs/vviinn-preloader.cjs.entry.js} +11 -10
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +43 -0
- package/{www/build/vviinn-vps-widget.entry.js → dist/cjs/vviinn-vps-widget.cjs.entry.js} +31 -30
- package/dist/cjs/vviinn-widgets.cjs.js +21 -0
- package/dist/collection/Image/error.js +14 -0
- package/dist/collection/Image/form.js +5 -0
- package/dist/collection/Image/fromFile.js +18 -0
- package/dist/collection/Image/imageToB64.js +9 -0
- package/dist/collection/Image/index.js +0 -0
- package/dist/collection/Image/renderPromise.js +6 -0
- package/dist/collection/Image/resizeImage.js +28 -0
- package/dist/collection/Image/sizing.js +39 -0
- package/dist/collection/Image/toFile.js +17 -0
- package/dist/collection/analytics/GAnalytics.js +32 -0
- package/dist/collection/analytics/GeneralAnalytics.js +9 -0
- package/dist/collection/analytics/GtagAnalytics.js +35 -0
- package/dist/collection/analytics/ProductAnalytics.js +1 -0
- package/dist/collection/campaign/Campaign.js +8 -0
- package/dist/collection/campaign/CampaignService.js +5 -0
- package/dist/collection/campaign/VCSCampaign.js +1 -0
- package/dist/collection/campaign/VCSCampaignResponse.js +1 -0
- package/dist/collection/campaign/VCSCampaignService.js +5 -0
- package/dist/collection/campaign/VPRCampaignResponse.js +1 -0
- package/dist/collection/campaign/VPRCampaignService.js +5 -0
- package/dist/collection/collection-manifest.json +43 -0
- package/dist/collection/components/customized-slots.js +47 -0
- package/dist/collection/components/image-search/image-view/highlight-box/highlight-box.css +71 -0
- package/dist/collection/components/image-search/image-view/highlight-box/highlight-box.js +25 -0
- package/dist/collection/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.css +49 -0
- package/dist/collection/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.js +64 -0
- package/dist/collection/components/image-search/image-view/image-cropper/image-cropper.css +33 -0
- package/dist/{vviinn-widgets/image-cropper.entry.js → collection/components/image-search/image-view/image-cropper/image-cropper.js} +54 -32
- package/dist/collection/components/image-search/search-filters/search-filters.css +120 -0
- package/dist/collection/components/image-search/search-filters/search-filters.js +102 -0
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.css +138 -0
- package/{www/build/vviinn-carousel.entry.js → dist/collection/components/vviinn-carousel/vviinn-carousel.js} +115 -18
- package/dist/collection/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.css +7 -0
- package/dist/collection/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.js +36 -0
- package/dist/collection/components/vviinn-error/vviinn-error.css +38 -0
- package/dist/collection/components/vviinn-error/vviinn-error.js +18 -0
- package/dist/collection/components/vviinn-error/vviinn-server-error/vviinn-server-error.css +3 -0
- package/dist/collection/components/vviinn-error/vviinn-server-error/vviinn-server-error.js +34 -0
- package/dist/collection/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.css +3 -0
- package/dist/collection/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.js +34 -0
- package/dist/collection/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.css +34 -0
- package/dist/collection/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.js +129 -0
- package/dist/collection/components/vviinn-example-images/vviinn-example-images.css +19 -0
- package/dist/collection/components/vviinn-example-images/vviinn-example-images.js +80 -0
- package/dist/{vviinn-widgets/index-c9483145.js → collection/components/vviinn-icons/index.js} +13 -12
- package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.css +25 -0
- package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.js +64 -0
- package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.css +47 -0
- package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.js +83 -0
- package/dist/collection/components/vviinn-image-view/vviinn-image-view.css +31 -0
- package/dist/collection/components/vviinn-image-view/vviinn-image-view.js +61 -0
- package/dist/collection/components/vviinn-modal/vviinn-modal.css +105 -0
- package/dist/collection/components/vviinn-modal/vviinn-modal.js +98 -0
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/onboarding-card.css +41 -0
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-1/vviinn-onboarding-card-1.js +26 -0
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-2/vviinn-onboarding-card-2.js +26 -0
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-3/vviinn-onboarding-card-3.js +26 -0
- package/dist/collection/components/vviinn-onboarding/vviinn-onboarding.css +58 -0
- package/dist/collection/components/vviinn-onboarding/vviinn-onboarding.js +28 -0
- package/dist/collection/components/vviinn-overlay/vviinn-overlay.css +33 -0
- package/dist/collection/components/vviinn-overlay/vviinn-overlay.js +15 -0
- package/dist/collection/components/vviinn-overlayed-modal/vviinn-overlayed-modal.css +29 -0
- package/dist/collection/components/vviinn-overlayed-modal/vviinn-overlayed-modal.js +71 -0
- package/dist/collection/components/vviinn-preloader/vviinn-preloader.css +37 -0
- package/dist/collection/components/vviinn-preloader/vviinn-preloader.js +20 -0
- package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.css +19 -0
- package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.js +27 -0
- package/dist/collection/components/vviinn-product-card/render-helpers.js +32 -0
- package/dist/collection/components/vviinn-product-card/vviinn-product-card.css +95 -0
- package/dist/collection/components/vviinn-product-card/vviinn-product-card.js +425 -0
- package/dist/collection/components/vviinn-slider/arrow.js +11 -0
- package/dist/collection/components/vviinn-slider/vviinn-slide/vviinn-slide.css +4 -0
- package/dist/collection/components/vviinn-slider/vviinn-slide/vviinn-slide.js +15 -0
- package/dist/collection/components/vviinn-slider/vviinn-slider.css +109 -0
- package/dist/collection/components/vviinn-slider/vviinn-slider.js +181 -0
- package/dist/collection/components/vviinn-teaser/vviinn-teaser.css +14 -0
- package/dist/collection/components/vviinn-teaser/vviinn-teaser.js +29 -0
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.css +238 -0
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js +200 -0
- package/dist/collection/components/vviinn-vpr-button/stories/kek.stories.js +18 -0
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.css +35 -0
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +149 -0
- package/dist/collection/components/vviinn-vpr-widget/GridMode.js +1 -0
- package/dist/collection/components/vviinn-vpr-widget/token-helpers.js +11 -0
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +441 -0
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-widget.css +74 -0
- package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.css +0 -0
- package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +177 -0
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.css +350 -0
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +247 -0
- package/dist/collection/cropper/Cropper.js +1 -0
- package/dist/collection/cropper/Handler.js +61 -0
- package/dist/collection/dom/index.js +3 -0
- package/dist/collection/error.js +14 -0
- package/dist/collection/file/index.js +4 -0
- package/dist/collection/geometry/Clip.js +14 -0
- package/dist/collection/geometry/Point.js +32 -0
- package/dist/collection/geometry/Rectangle.js +95 -0
- package/dist/collection/geometry/RectangleAlt.js +1 -0
- package/dist/collection/geometry/Sized.js +8 -0
- package/dist/collection/global.js +19 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/interfaces/generated.js +5 -0
- package/dist/collection/interfaces/recommendation.js +1 -0
- package/dist/collection/network/apiClient.js +9 -0
- package/dist/collection/network/ion/File.js +14 -0
- package/dist/collection/network/ion/Form.js +64 -0
- package/dist/collection/network/ion/Link.js +8 -0
- package/dist/collection/network/ion/ValueObject.js +23 -0
- package/dist/collection/network/request.js +19 -0
- package/dist/collection/network/utils.js +37 -0
- package/dist/collection/recommendation/recommendation.js +1 -0
- package/dist/collection/searchSession/searchSession.js +26 -0
- package/dist/collection/sentry.js +14 -0
- package/dist/collection/slider/GridMode.js +1 -0
- package/dist/collection/store/file-processing.js +13 -0
- package/dist/collection/store/imageSearch.store.js +138 -0
- package/dist/collection/store/store.js +11 -0
- package/dist/collection/stories/Button.js +21 -0
- package/dist/collection/stories/Button.stories.js +42 -0
- package/dist/collection/stories/Header.js +45 -0
- package/dist/collection/stories/Header.stories.js +15 -0
- package/dist/collection/stories/Page.js +61 -0
- package/dist/collection/stories/Page.stories.js +19 -0
- package/dist/collection/stories/assets/code-brackets.svg +1 -0
- package/dist/collection/stories/assets/colors.svg +1 -0
- package/dist/collection/stories/assets/comments.svg +1 -0
- package/dist/collection/stories/assets/direction.svg +1 -0
- package/dist/collection/stories/assets/flow.svg +1 -0
- package/dist/collection/stories/assets/plugin.svg +1 -0
- package/dist/collection/stories/assets/repo.svg +1 -0
- package/dist/collection/stories/assets/stackalt.svg +1 -0
- package/dist/collection/stories/image-selector.stories.js +6 -0
- package/dist/collection/stories/image-view.stories.js +6 -0
- package/dist/collection/stories/modal.stories.js +12 -0
- package/dist/collection/stories/onboarding.stories.js +11 -0
- package/dist/collection/stories/overlay.stories.js +5 -0
- package/dist/collection/stories/overlayedModal.stories.js +8 -0
- package/dist/collection/stories/privacy-badge.stories.js +11 -0
- package/dist/collection/stories/slider.stories.js +17 -0
- package/dist/collection/stories/teaser.stories.js +5 -0
- package/dist/collection/stories/vps-widget.stories.js +47 -0
- package/dist/collection/stories/vviinn-product.stories.js +19 -0
- package/dist/collection/utils/collections/collectionsUtils.js +5 -0
- package/dist/collection/utils/either.js +3 -0
- package/dist/collection/utils/enum/enumUtils.js +3 -0
- package/dist/collection/utils/event/Events.js +1 -0
- package/dist/collection/utils/number/index.js +4 -0
- package/dist/collection/utils/option/option.js +4 -0
- package/dist/collection/utils/semigroup/semigroupDiff.js +6 -0
- package/dist/collection/utils/token/tokenUtils.js +9 -0
- package/dist/esm/Handler-639a4cb3.js +308 -0
- package/{www/build/app-globals-e0943e34.js → dist/esm/app-globals-345e497d.js} +10 -922
- package/dist/{vviinn-widgets → esm}/cropper-handler.entry.js +2 -2
- package/{www/build/customized-slots-f3449695.js → dist/esm/customized-slots-a76a8d41.js} +1 -1
- package/dist/esm/highlight-box_22.entry.js +712 -0
- package/dist/{vviinn-widgets/imageSearch.store-407f49f0.js → esm/imageSearch.store-8eab0da1.js} +11510 -11872
- package/dist/esm/index-6fa21e24.js +1323 -0
- package/{www/build/index-c9483145.js → dist/esm/index-8cb063df.js} +6 -4
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +19 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/vviinn-carousel_5.entry.js +1224 -0
- package/{www/build → dist/esm}/vviinn-error.entry.js +1 -1
- package/dist/{vviinn-widgets → esm}/vviinn-preloader.entry.js +3 -6
- package/dist/{vviinn-widgets → esm}/vviinn-vps-button.entry.js +3 -3
- package/dist/{vviinn-widgets → esm}/vviinn-vps-widget.entry.js +4 -7
- package/dist/esm/vviinn-widgets.js +19 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/loader/cdn.js +3 -0
- package/dist/loader/index.cjs.js +3 -0
- package/dist/loader/index.d.ts +12 -0
- package/dist/loader/index.es2017.js +3 -0
- package/dist/loader/index.js +4 -0
- package/dist/loader/package.json +10 -0
- package/dist/types/components/vviinn-carousel/vviinn-carousel.d.ts +1 -0
- package/dist/types/components/vviinn-icons/index.d.ts +2 -0
- package/dist/types/components/vviinn-product-card/render-helpers.d.ts +3 -2
- package/dist/types/components/vviinn-product-card/vviinn-product-card.d.ts +2 -0
- package/dist/types/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.d.ts +25 -0
- package/dist/types/components/vviinn-vpr-button/stories/kek.stories.d.ts +7 -0
- package/dist/types/components/vviinn-vpr-button/vviinn-vpr-button.d.ts +14 -0
- package/dist/types/components/vviinn-vpr-widget/vviinn-vpr-vidget.d.ts +13 -3
- package/dist/types/components.d.ts +54 -0
- package/dist/vviinn-widgets/index.esm.js +0 -1
- package/dist/vviinn-widgets/p-04b06ea9.entry.js +1 -0
- package/dist/vviinn-widgets/p-400eb62f.entry.js +1 -0
- package/dist/vviinn-widgets/p-56fc949a.js +1 -0
- package/dist/vviinn-widgets/p-59edfbe2.js +1 -0
- package/dist/vviinn-widgets/p-78ccc9eb.js +15 -0
- package/dist/vviinn-widgets/p-9d24f51e.entry.js +1 -0
- package/dist/vviinn-widgets/p-d085199d.entry.js +1 -0
- package/dist/vviinn-widgets/p-e1ba8626.js +1 -0
- package/dist/vviinn-widgets/p-e38f4aa2.entry.js +1 -0
- package/dist/vviinn-widgets/p-e67cae57.js +1 -0
- package/dist/vviinn-widgets/p-f47e82b2.entry.js +1 -0
- package/dist/vviinn-widgets/p-f582db5c.js +1 -0
- package/dist/vviinn-widgets/p-fb14e3cc.entry.js +1 -0
- package/dist/vviinn-widgets/vviinn-widgets.css +1 -6
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -125
- package/package.json +3 -1
- package/www/build/index.esm.js +0 -1
- package/www/build/p-04b06ea9.entry.js +1 -0
- package/www/build/p-400eb62f.entry.js +1 -0
- package/www/build/p-56fc949a.js +1 -0
- package/www/build/p-59edfbe2.js +1 -0
- package/www/build/p-78ccc9eb.js +15 -0
- package/www/build/p-7e4978d5.js +1 -0
- package/www/build/p-9d24f51e.entry.js +1 -0
- package/www/build/p-a67898be.css +1 -0
- package/www/build/p-d085199d.entry.js +1 -0
- package/www/build/p-e1ba8626.js +1 -0
- package/www/build/p-e38f4aa2.entry.js +1 -0
- package/www/build/p-e67cae57.js +1 -0
- package/www/build/p-f47e82b2.entry.js +1 -0
- package/www/build/p-f582db5c.js +1 -0
- package/www/build/p-fb14e3cc.entry.js +1 -0
- package/www/build/vviinn-widgets.css +1 -6
- package/www/build/vviinn-widgets.esm.js +1 -125
- package/www/index.html +6 -13
- package/dist/vviinn-widgets/Array-4b9f84cf.js +0 -4295
- package/dist/vviinn-widgets/Handler-47db9890.js +0 -1428
- package/dist/vviinn-widgets/NonEmptyArray-6ef0d207.js +0 -4370
- package/dist/vviinn-widgets/css-shim-f0027935.js +0 -4
- package/dist/vviinn-widgets/dom-db0073f0.js +0 -73
- package/dist/vviinn-widgets/highlight-box.entry.js +0 -41
- package/dist/vviinn-widgets/index-b6d739a9.js +0 -3010
- package/dist/vviinn-widgets/number-98d54dd6.js +0 -1533
- package/dist/vviinn-widgets/search-filters.entry.js +0 -73
- package/dist/vviinn-widgets/shadow-css-c1fdfa9f.js +0 -389
- package/dist/vviinn-widgets/vviinn-carousel.entry.js +0 -205
- package/dist/vviinn-widgets/vviinn-detected-object.entry.js +0 -52
- package/dist/vviinn-widgets/vviinn-empty-results.entry.js +0 -16
- package/dist/vviinn-widgets/vviinn-example-image.entry.js +0 -38
- package/dist/vviinn-widgets/vviinn-example-images.entry.js +0 -28
- package/dist/vviinn-widgets/vviinn-image-selector.entry.js +0 -31
- package/dist/vviinn-widgets/vviinn-image-view.entry.js +0 -55
- package/dist/vviinn-widgets/vviinn-modal.entry.js +0 -30
- package/dist/vviinn-widgets/vviinn-onboarding-card-1.entry.js +0 -21
- package/dist/vviinn-widgets/vviinn-onboarding-card-2.entry.js +0 -21
- package/dist/vviinn-widgets/vviinn-onboarding-card-3.entry.js +0 -21
- package/dist/vviinn-widgets/vviinn-onboarding.entry.js +0 -20
- package/dist/vviinn-widgets/vviinn-overlay.entry.js +0 -15
- package/dist/vviinn-widgets/vviinn-overlayed-modal.entry.js +0 -18
- package/dist/vviinn-widgets/vviinn-privacy-badge.entry.js +0 -20
- package/dist/vviinn-widgets/vviinn-product-card.entry.js +0 -176
- package/dist/vviinn-widgets/vviinn-server-error.entry.js +0 -16
- package/dist/vviinn-widgets/vviinn-slide.entry.js +0 -15
- package/dist/vviinn-widgets/vviinn-slider.entry.js +0 -120
- package/dist/vviinn-widgets/vviinn-teaser.entry.js +0 -20
- package/dist/vviinn-widgets/vviinn-vpr-widget.entry.js +0 -128
- package/dist/vviinn-widgets/vviinn-wrong-format.entry.js +0 -16
- package/www/build/Array-4b9f84cf.js +0 -4295
- package/www/build/Handler-47db9890.js +0 -1428
- package/www/build/NonEmptyArray-6ef0d207.js +0 -4370
- package/www/build/css-shim-f0027935.js +0 -4
- package/www/build/dom-db0073f0.js +0 -73
- package/www/build/highlight-box.entry.js +0 -41
- package/www/build/image-cropper.entry.js +0 -113
- package/www/build/index-b6d739a9.js +0 -3010
- package/www/build/number-98d54dd6.js +0 -1533
- package/www/build/search-filters.entry.js +0 -73
- package/www/build/shadow-css-c1fdfa9f.js +0 -389
- package/www/build/vviinn-detected-object.entry.js +0 -52
- package/www/build/vviinn-empty-results.entry.js +0 -16
- package/www/build/vviinn-example-image.entry.js +0 -38
- package/www/build/vviinn-example-images.entry.js +0 -28
- package/www/build/vviinn-image-selector.entry.js +0 -31
- package/www/build/vviinn-image-view.entry.js +0 -55
- package/www/build/vviinn-modal.entry.js +0 -30
- package/www/build/vviinn-onboarding-card-1.entry.js +0 -21
- package/www/build/vviinn-onboarding-card-2.entry.js +0 -21
- package/www/build/vviinn-onboarding-card-3.entry.js +0 -21
- package/www/build/vviinn-onboarding.entry.js +0 -20
- package/www/build/vviinn-overlay.entry.js +0 -15
- package/www/build/vviinn-overlayed-modal.entry.js +0 -18
- package/www/build/vviinn-privacy-badge.entry.js +0 -20
- package/www/build/vviinn-product-card.entry.js +0 -176
- package/www/build/vviinn-server-error.entry.js +0 -16
- package/www/build/vviinn-slide.entry.js +0 -15
- package/www/build/vviinn-slider.entry.js +0 -120
- package/www/build/vviinn-teaser.entry.js +0 -20
- package/www/build/vviinn-vpr-widget.entry.js +0 -128
- package/www/build/vviinn-vps-button.entry.js +0 -39
- package/www/build/vviinn-wrong-format.entry.js +0 -16
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-741a970d.js');
|
|
2
6
|
|
|
3
7
|
const vviinnErrorCss = ":host{background:#F4F4F4;border-radius:8px;display:grid;grid-gap:20px;padding:24px;text-align:center}::slotted(svg){display:grid;align-self:center}::slotted(h4){margin:unset;font-weight:600;font-size:18px;line-height:24px}::slotted(span){font-size:14px;line-height:20px}::slotted(button){-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background:transparent;color:var(--color-primary, var(--color-primary-system));font-weight:600;font-size:16px;line-height:20px;cursor:pointer}";
|
|
4
8
|
|
|
5
9
|
let VviinnError = class {
|
|
6
10
|
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
8
12
|
}
|
|
9
13
|
render() {
|
|
10
|
-
return (h(Host, null, h("slot", { name: "icon" }), h("slot", { name: "title" }), h("slot", { name: "text" }), h("slot", { name: "action" })));
|
|
14
|
+
return (index.h(index.Host, null, index.h("slot", { name: "icon" }), index.h("slot", { name: "title" }), index.h("slot", { name: "text" }), index.h("slot", { name: "action" })));
|
|
11
15
|
}
|
|
12
16
|
};
|
|
13
17
|
VviinnError.style = vviinnErrorCss;
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
exports.vviinn_error = VviinnError;
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-741a970d.js');
|
|
6
|
+
const imageSearch_store = require('./imageSearch.store-128957a4.js');
|
|
7
|
+
require('./Handler-d1a8a86a.js');
|
|
7
8
|
|
|
8
9
|
const vviinnPreloaderCss = ":host{--preloader-size:24px;--preloader-width:calc(var(--preloader-size) / 6);transform-origin:center;-webkit-animation:rotate 3s linear infinite;animation:rotate 3s linear infinite;border:var(--preloader-width) solid white;border-radius:50%;border-top-color:transparent;display:none;outline:0;width:var(--preloader-size);height:var(--preloader-size);box-sizing:border-box}:host(.active){display:flex}@-webkit-keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}@keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}";
|
|
9
10
|
|
|
10
11
|
let VviinnPreloader = class {
|
|
11
12
|
constructor(hostRef) {
|
|
12
|
-
registerInstance(this, hostRef);
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
13
14
|
}
|
|
14
15
|
isActive() {
|
|
15
|
-
return (imageSearchState.loading || imageSearchState.objectDetectionInProgress);
|
|
16
|
+
return (imageSearch_store.imageSearchState.loading || imageSearch_store.imageSearchState.objectDetectionInProgress);
|
|
16
17
|
}
|
|
17
18
|
render() {
|
|
18
|
-
return (h(Host, { class: {
|
|
19
|
+
return (index.h(index.Host, { class: {
|
|
19
20
|
active: this.isActive(),
|
|
20
21
|
} }));
|
|
21
22
|
}
|
|
22
23
|
};
|
|
23
24
|
VviinnPreloader.style = vviinnPreloaderCss;
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
exports.vviinn_preloader = VviinnPreloader;
|
|
@@ -0,0 +1,43 @@
|
|
|
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-c493804d.js');
|
|
7
|
+
const customizedSlots = require('./customized-slots-5d904d8e.js');
|
|
8
|
+
|
|
9
|
+
const vviinnVpsButtonCss = "";
|
|
10
|
+
|
|
11
|
+
let VviinnVpsButton = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
this.globalSlotsChanged = index.createEvent(this, "globalSlotsChanged", 7);
|
|
15
|
+
/** Currency sign will shown after price */
|
|
16
|
+
this.currencySign = "€";
|
|
17
|
+
/** Locale for currency formatting */
|
|
18
|
+
this.locale = "de-DE";
|
|
19
|
+
this.pressed = false;
|
|
20
|
+
}
|
|
21
|
+
handleModalClosed() {
|
|
22
|
+
this.pressed = false;
|
|
23
|
+
}
|
|
24
|
+
componentDidLoad() {
|
|
25
|
+
const slots = this.el.querySelectorAll("[slot]");
|
|
26
|
+
this.globalSlotsChanged.emit(Array.from(slots));
|
|
27
|
+
}
|
|
28
|
+
handleKeyDown(ev) {
|
|
29
|
+
if (ev.code !== "Enter" && ev.code !== "Space")
|
|
30
|
+
return;
|
|
31
|
+
this.pressed = true;
|
|
32
|
+
}
|
|
33
|
+
handleClick() {
|
|
34
|
+
this.pressed = true;
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
return (index.h(index.Host, { tabindex: "0", role: "button", pressed: this.pressed, onClick: () => this.handleClick(), onKeyDown: (ev) => this.handleKeyDown(ev) }, index.h("slot", null, index.h(index$1.CameraIcon, null)), index.h(customizedSlots.SlotSkeleton, null), index.h("vviinn-vps-widget", { active: this.pressed, "currency-sign": "\u20AC", token: this.token, locale: this.locale, apiPath: this.apiPath, exportparts: "brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title, product-card" })));
|
|
38
|
+
}
|
|
39
|
+
get el() { return index.getElement(this); }
|
|
40
|
+
};
|
|
41
|
+
VviinnVpsButton.style = vviinnVpsButtonCss;
|
|
42
|
+
|
|
43
|
+
exports.vviinn_vps_button = VviinnVpsButton;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-741a970d.js');
|
|
6
|
+
const imageSearch_store = require('./imageSearch.store-128957a4.js');
|
|
7
|
+
const customizedSlots = require('./customized-slots-5d904d8e.js');
|
|
8
|
+
require('./Handler-d1a8a86a.js');
|
|
8
9
|
|
|
9
10
|
const vviinnVpsWidgetCss = ":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{display:block}.hidden{visibility:hidden;height:1px}vviinn-overlayed-modal.first-screen::part(title),vviinn-overlayed-modal.first-screen::part(secondary-action){visibility:hidden}.start-page{display:grid;grid-template-columns:repeat(2, 1fr);min-height:580px}.start-page_block{align-content:start;border-right:1px solid #F4F4F4;display:grid;padding:48px}.start-page_block.error{align-content:center}#onboarding-block{border-right:unset;box-sizing:border-box;grid-gap:24px;overflow-y:auto;position:relative;width:100%}vviinn-teaser{margin-bottom:32px;margin-top:-24px}vviinn-image-selector{align-items:center;background:var(--color-primary, var(--color-primary-system));border-color:var(--color-primary, var(--color-primary-system));border-radius:2px;color:white;display:grid;font-size:16px;font-weight:600;height:56px;justify-items:center;margin-bottom:16px;transition:background 0.1s ease-in-out}vviinn-image-selector:hover{background:var(--color-primary-hover, var(--color-primary-hover-system));border-color:var(--color-primary-hover, var(--color-primary-hover-system))}vviinn-image-selector:active{border-color:black}.upload-button-content{display:grid;align-items:center;justify-items:start;justify-content:center;grid-template-columns:-webkit-max-content auto;grid-template-columns:max-content auto;grid-gap:16px}.results-page{display:grid;grid-template-columns:336px auto;box-sizing:border-box}.results-page>*{padding:24px;box-sizing:border-box}.products{align-content:center;align-items:start;box-sizing:border-box;display:grid;grid-gap:32px 16px;grid-template-columns:repeat(auto-fill, minmax(152px, 1fr));justify-items:center;padding:24px;padding-right:0;position:absolute;width:calc(100% - 16px)}.products.hidden{display:none}vviinn-empty-results{width:280px;align-self:center;justify-self:center}.products-wrapper{display:grid;overflow-y:auto;overflow-x:hidden;padding:unset;position:relative;width:100%}.image-wrapper{border-right:1px solid #F4F4F4;display:grid;grid-template-rows:-webkit-min-content 170px;grid-template-rows:min-content 170px;grid-gap:24px;min-width:100%}.onboarding-wrapper{position:absolute;width:100%;padding:48px;box-sizing:border-box;display:grid;grid-gap:64px;padding-bottom:24px}vviinn-product-card{gap:0;width:100%}vviinn-product-card::part(image){border:1px solid #eaeaea;margin-bottom:8px}vviinn-product-card::part(price-container),vviinn-product-card::part(deeplink),vviinn-product-card::part(title){align-self:start}search-filters span{display:none}search-filters::part(filter){background:#F4F4F4;border-radius:4px;border:1px solid #F4F4F4;box-sizing:border-box;color:#161616;font-size:14px;font-weight:600;line-height:20px}search-filters::part(show-more-filters){border:1px solid #f4f4f4;border-radius:4px;box-sizing:border-box;color:#161616;font-size:14px;font-weight:600;line-height:20px;padding:6px 16px}search-filters::part(show-more-filters):hover{background:#EAEAEA}search-filters::part(filter):hover{background:#EAEAEA}search-filters::part(filter):focus{outline:none;border:1px solid var(--color-primary, var(--color-primary-system))}search-filters::part(filter active){background:rgba(15, 98, 254, 0.15);color:var(--color-primary, var(--color-primary-system))}.filters-wrapper{overflow:auto}.results-page:not(.active){display:none}.nothing-found{display:grid;grid-gap:64px;justify-self:center;padding-top:64px;padding-bottom:16px;position:absolute;width:60%}@media (max-width: 768px){.start-page_block{padding:24px}.onboarding-wrapper{padding:24px}}@media (max-width: 640px){.start-page{grid-template-rows:-webkit-min-content;grid-template-rows:min-content;grid-template-columns:unset;grid-gap:48px;padding:24px 0 48px 0}}@media (max-width: 640px) and (min-width: 415px){.onboarding-wrapper{position:unset}#onboarding-block{overflow:unset}.start-page.active{height:1px;overflow:auto}}@media (max-width: 415px){.results-page>*{box-sizing:border-box;padding:24px}vviinn-slide{padding-bottom:48px}.start-page_block:last-of-type{border-right:unset;overflow-y:unset;position:static;box-sizing:border-box;width:unset}.start-page_block{padding:0 24px}vviinn-teaser{margin-top:24px}.onboarding-wrapper{position:static;width:unset;padding:unset;box-sizing:border-box}.results-page{grid-template-columns:unset;grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto}.image{margin-bottom:8px}.image-wrapper{grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto;width:100%}.products-wrapper{align-content:start;position:static;overflow-y:unset;width:100%;padding-top:0}.products{position:static;padding:0;width:unset;grid-gap:32px 16px;justify-content:center}.nothing-found{position:static;grid-gap:64px;padding:unset;align-content:start;width:unset}}@media (max-width: 320px){.products{grid-template-columns:unset}}vviinn-wrong-format,vviinn-server-error{width:280px;align-self:center;justify-self:center}";
|
|
10
11
|
|
|
11
12
|
let VviinnVpsWidget = class {
|
|
12
13
|
constructor(hostRef) {
|
|
13
|
-
registerInstance(this, hostRef);
|
|
14
|
+
index.registerInstance(this, hostRef);
|
|
14
15
|
/** When true modal window with widget will be shown */
|
|
15
16
|
this.active = false;
|
|
16
17
|
/** Currency sign will shown after price */
|
|
@@ -31,13 +32,13 @@ let VviinnVpsWidget = class {
|
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
componentWillLoad() {
|
|
34
|
-
slotChangeListener(this, this.el);
|
|
35
|
+
customizedSlots.slotChangeListener(this, this.el);
|
|
35
36
|
}
|
|
36
37
|
connectedCallback() {
|
|
37
|
-
state.apiPath = this.apiPath;
|
|
38
|
-
state.currencySign = this.currencySign;
|
|
39
|
-
state.locale = this.locale;
|
|
40
|
-
imageSearchState.token = this.token;
|
|
38
|
+
imageSearch_store.state$1.apiPath = this.apiPath;
|
|
39
|
+
imageSearch_store.state$1.currencySign = this.currencySign;
|
|
40
|
+
imageSearch_store.state$1.locale = this.locale;
|
|
41
|
+
imageSearch_store.imageSearchState.token = this.token;
|
|
41
42
|
}
|
|
42
43
|
handleImageSelection() {
|
|
43
44
|
this.slidePosition = 1;
|
|
@@ -50,19 +51,19 @@ let VviinnVpsWidget = class {
|
|
|
50
51
|
resetState() {
|
|
51
52
|
this.resetScroll("onboarding-block");
|
|
52
53
|
this.slidePosition = 0;
|
|
53
|
-
imageSearchState.image = Option.none;
|
|
54
|
-
imageSearchState.imageUrl = Option.none;
|
|
55
|
-
imageSearchState.imageBounds = Option.none;
|
|
56
|
-
imageSearchState.searchArea = Option.none;
|
|
57
|
-
imageSearchState.results = [];
|
|
58
|
-
imageSearchState.filters = [];
|
|
59
|
-
imageSearchState.detectedObjects = [];
|
|
60
|
-
imageSearchState.activeIonLink = undefined;
|
|
61
|
-
imageSearchState.rectangleSearchForm = undefined;
|
|
54
|
+
imageSearch_store.imageSearchState.image = imageSearch_store.Option.none;
|
|
55
|
+
imageSearch_store.imageSearchState.imageUrl = imageSearch_store.Option.none;
|
|
56
|
+
imageSearch_store.imageSearchState.imageBounds = imageSearch_store.Option.none;
|
|
57
|
+
imageSearch_store.imageSearchState.searchArea = imageSearch_store.Option.none;
|
|
58
|
+
imageSearch_store.imageSearchState.results = [];
|
|
59
|
+
imageSearch_store.imageSearchState.filters = [];
|
|
60
|
+
imageSearch_store.imageSearchState.detectedObjects = [];
|
|
61
|
+
imageSearch_store.imageSearchState.activeIonLink = undefined;
|
|
62
|
+
imageSearch_store.imageSearchState.rectangleSearchForm = undefined;
|
|
62
63
|
this.resetScroll("results-block");
|
|
63
64
|
}
|
|
64
65
|
haveErrors() {
|
|
65
|
-
return this.wrongImageFormat || imageSearchState.serverError;
|
|
66
|
+
return this.wrongImageFormat || imageSearch_store.imageSearchState.serverError;
|
|
66
67
|
}
|
|
67
68
|
resetScroll(elementId, behavior = "auto") {
|
|
68
69
|
const element = this.el.shadowRoot.getElementById(elementId);
|
|
@@ -75,22 +76,22 @@ let VviinnVpsWidget = class {
|
|
|
75
76
|
elementsToReset.forEach((name) => this.resetScroll(name));
|
|
76
77
|
}
|
|
77
78
|
render() {
|
|
78
|
-
return (h(Host, null, h("vviinn-overlayed-modal", { class: { "first-screen": this.slidePosition === 0 }, active: this.active, onSecondaryActionClicked: () => this.resetState(), onModalClosed: () => this.handleModalClose(), exportparts: "secondary-action, title, close-button" }, h("vviinn-slider", { showBullets: false, position: this.slidePosition }, h("vviinn-slide", { class: { "start-page": true } }, h("div", { class: {
|
|
79
|
+
return (index.h(index.Host, null, index.h("vviinn-overlayed-modal", { class: { "first-screen": this.slidePosition === 0 }, active: this.active, onSecondaryActionClicked: () => this.resetState(), onModalClosed: () => this.handleModalClose(), exportparts: "secondary-action, title, close-button" }, index.h("vviinn-slider", { showBullets: false, position: this.slidePosition }, index.h("vviinn-slide", { class: { "start-page": true } }, index.h("div", { class: {
|
|
79
80
|
error: this.haveErrors(),
|
|
80
81
|
"start-page_block": true,
|
|
81
|
-
} }, h("vviinn-wrong-format", { class: { hidden: !this.wrongImageFormat }, onActionClick: () => (this.wrongImageFormat = false) }), h("vviinn-server-error", { class: { hidden: !imageSearchState.serverError }, onActionClick: () => (imageSearchState.serverError = false) }), h("vviinn-teaser", { class: { hidden: this.haveErrors() } }), h("vviinn-image-selector", { class: { hidden: this.haveErrors() }, onImageSelected: () => this.handleImageSelection(), onImageSelectedError: () => (this.wrongImageFormat = true), part: "select-image_button" }, h("span", { slot: "upload-button-text", class: "upload-button-content" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "29", height: "28", fill: "none" }, h("defs", null), h("path", { fill: "#fff", "fill-rule": "evenodd", d: "M10.271 3.89A.875.875 0 0111 3.5h7c.293 0 .566.146.728.39l1.49 2.235h3.033a2.625 2.625 0 012.625 2.625V21a2.625 2.625 0 01-2.625 2.625H5.75A2.625 2.625 0 013.125 21V8.75A2.625 2.625 0 015.75 6.125h3.031l1.49-2.235zm1.197 1.36l-1.49 2.235a.875.875 0 01-.729.39H5.75a.875.875 0 00-.875.875V21a.875.875 0 00.875.875h17.5a.875.875 0 00.875-.875V8.75a.875.875 0 00-.875-.875h-3.5a.875.875 0 01-.729-.39l-1.49-2.235h-6.063z", "clip-rule": "evenodd" }), h("path", { fill: "#fff", "fill-rule": "evenodd", d: "M14.5 11.375a3.062 3.062 0 100 6.125 3.062 3.062 0 000-6.125zm-4.813 3.063a4.812 4.812 0 119.625 0 4.812 4.812 0 01-9.625 0z", "clip-rule": "evenodd" })), h("slot", { name: "vviinn-image-upload-button-text" }, h("span", null, "Kamera oder Bild ausw\u00E4hlen")))), h("vviinn-privacy-badge", { class: { hidden: this.haveErrors() } })), h("div", { id: "onboarding-block", class: "start-page_block" }, h("div", { class: "onboarding-wrapper" }, h("vviinn-onboarding", null), h("vviinn-example-images", { onImageSelected: () => this.handleImageSelection(), onImageSelectedError: () => this.resetScroll("onboarding-block", "smooth") })))), h("vviinn-slide", { class: { "results-page": true, active: this.slidePosition == 1 } }, h("div", { class: "image-wrapper" }, h("vviinn-image-view", null), h("div", { class: "filters-wrapper" }, h("div", { class: "filters" }, imageSearchState.filters.map((filter) => (h("search-filters", { filter: filter })))))), h("div", { id: "results-block", class: "products-wrapper" }, h("div", { class: { "nothing-found": true, hidden: imageSearchState.results.length > 0 } }, h("vviinn-empty-results", null), h("vviinn-onboarding", null)), h("div", { class: {
|
|
82
|
-
hidden: imageSearchState.results.length <= 0,
|
|
82
|
+
} }, index.h("vviinn-wrong-format", { class: { hidden: !this.wrongImageFormat }, onActionClick: () => (this.wrongImageFormat = false) }), index.h("vviinn-server-error", { class: { hidden: !imageSearch_store.imageSearchState.serverError }, onActionClick: () => (imageSearch_store.imageSearchState.serverError = false) }), index.h("vviinn-teaser", { class: { hidden: this.haveErrors() } }), index.h("vviinn-image-selector", { class: { hidden: this.haveErrors() }, onImageSelected: () => this.handleImageSelection(), onImageSelectedError: () => (this.wrongImageFormat = true), part: "select-image_button" }, index.h("span", { slot: "upload-button-text", class: "upload-button-content" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "29", height: "28", fill: "none" }, index.h("defs", null), index.h("path", { fill: "#fff", "fill-rule": "evenodd", d: "M10.271 3.89A.875.875 0 0111 3.5h7c.293 0 .566.146.728.39l1.49 2.235h3.033a2.625 2.625 0 012.625 2.625V21a2.625 2.625 0 01-2.625 2.625H5.75A2.625 2.625 0 013.125 21V8.75A2.625 2.625 0 015.75 6.125h3.031l1.49-2.235zm1.197 1.36l-1.49 2.235a.875.875 0 01-.729.39H5.75a.875.875 0 00-.875.875V21a.875.875 0 00.875.875h17.5a.875.875 0 00.875-.875V8.75a.875.875 0 00-.875-.875h-3.5a.875.875 0 01-.729-.39l-1.49-2.235h-6.063z", "clip-rule": "evenodd" }), index.h("path", { fill: "#fff", "fill-rule": "evenodd", d: "M14.5 11.375a3.062 3.062 0 100 6.125 3.062 3.062 0 000-6.125zm-4.813 3.063a4.812 4.812 0 119.625 0 4.812 4.812 0 01-9.625 0z", "clip-rule": "evenodd" })), index.h("slot", { name: "vviinn-image-upload-button-text" }, index.h("span", null, "Kamera oder Bild ausw\u00E4hlen")))), index.h("vviinn-privacy-badge", { class: { hidden: this.haveErrors() } })), index.h("div", { id: "onboarding-block", class: "start-page_block" }, index.h("div", { class: "onboarding-wrapper" }, index.h("vviinn-onboarding", null), index.h("vviinn-example-images", { onImageSelected: () => this.handleImageSelection(), onImageSelectedError: () => this.resetScroll("onboarding-block", "smooth") })))), index.h("vviinn-slide", { class: { "results-page": true, active: this.slidePosition == 1 } }, index.h("div", { class: "image-wrapper" }, index.h("vviinn-image-view", null), index.h("div", { class: "filters-wrapper" }, index.h("div", { class: "filters" }, imageSearch_store.imageSearchState.filters.map((filter) => (index.h("search-filters", { filter: filter })))))), index.h("div", { id: "results-block", class: "products-wrapper" }, index.h("div", { class: { "nothing-found": true, hidden: imageSearch_store.imageSearchState.results.length > 0 } }, index.h("vviinn-empty-results", null), index.h("vviinn-onboarding", null)), index.h("div", { class: {
|
|
83
|
+
hidden: imageSearch_store.imageSearchState.results.length <= 0,
|
|
83
84
|
products: true,
|
|
84
|
-
} }, imageSearchState.results.map((p) => {
|
|
85
|
+
} }, imageSearch_store.imageSearchState.results.map((p) => {
|
|
85
86
|
var _a;
|
|
86
|
-
return (h("vviinn-product-card", { hidden: true, productTitle: p.title, productId: p.productId, brand: p.brand, deeplink: p.deeplink, price: p.price.actual, salePrice: p.price.sale, imageWidth: 160, image: (_a = p.image.thumbnail) !== null && _a !== void 0 ? _a : p.image.original, part: "product-card" }));
|
|
87
|
+
return (index.h("vviinn-product-card", { hidden: true, productTitle: p.title, productId: p.productId, brand: p.brand, deeplink: p.deeplink, price: p.price.actual, salePrice: p.price.sale, imageWidth: 160, image: (_a = p.image.thumbnail) !== null && _a !== void 0 ? _a : p.image.original, part: "product-card" }));
|
|
87
88
|
}))))))));
|
|
88
89
|
}
|
|
89
|
-
get el() { return getElement(this); }
|
|
90
|
+
get el() { return index.getElement(this); }
|
|
90
91
|
static get watchers() { return {
|
|
91
92
|
"active": ["activeWatcher"]
|
|
92
93
|
}; }
|
|
93
94
|
};
|
|
94
95
|
VviinnVpsWidget.style = vviinnVpsWidgetCss;
|
|
95
96
|
|
|
96
|
-
|
|
97
|
+
exports.vviinn_vps_widget = VviinnVpsWidget;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-741a970d.js');
|
|
4
|
+
const appGlobals = require('./app-globals-30781f30.js');
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
Stencil Client Patch Browser v2.9.0 | MIT Licensed | https://stenciljs.com
|
|
8
|
+
*/
|
|
9
|
+
const patchBrowser = () => {
|
|
10
|
+
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('vviinn-widgets.cjs.js', document.baseURI).href));
|
|
11
|
+
const opts = {};
|
|
12
|
+
if (importMeta !== '') {
|
|
13
|
+
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
14
|
+
}
|
|
15
|
+
return index.promiseResolve(opts);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
patchBrowser().then(options => {
|
|
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-carousel_5.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"]}],[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"]]],[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"]]]]]], options);
|
|
21
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { fromOption } from "fp-ts/lib/Either";
|
|
2
|
+
import { findFirstMap } from "fp-ts/Array";
|
|
3
|
+
import { pipe } from "fp-ts/lib/function";
|
|
4
|
+
import { none, some } from "fp-ts/lib/Option";
|
|
5
|
+
const SUPPORTED_FILE_TYPES = ["jpg", "jpeg", "png", "webp"];
|
|
6
|
+
const unsupportedFileTypeError = {
|
|
7
|
+
kind: "client",
|
|
8
|
+
inner: "File format not supported",
|
|
9
|
+
};
|
|
10
|
+
export const checkImageType = (file) => {
|
|
11
|
+
const fileType = file.type.split("/")[1];
|
|
12
|
+
const supportedFileType = findFirstMap((supportedType) => supportedType === fileType ? some(file) : none)(SUPPORTED_FILE_TYPES);
|
|
13
|
+
return pipe(supportedFileType, fromOption(() => unsupportedFileTypeError));
|
|
14
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const fromFile = (f) => new Promise((resolve, _) => {
|
|
2
|
+
const reader = new FileReader();
|
|
3
|
+
const image = new Image();
|
|
4
|
+
reader.onload = (e) => {
|
|
5
|
+
image.src = e.target.result;
|
|
6
|
+
resolve(image);
|
|
7
|
+
};
|
|
8
|
+
reader.readAsDataURL(f);
|
|
9
|
+
});
|
|
10
|
+
export const imageFromFileTask = (f) => () => new Promise((resolve, _) => {
|
|
11
|
+
const reader = new FileReader();
|
|
12
|
+
const image = new Image();
|
|
13
|
+
reader.onload = (e) => {
|
|
14
|
+
image.src = e.target.result;
|
|
15
|
+
};
|
|
16
|
+
image.onload = () => resolve(image);
|
|
17
|
+
reader.readAsDataURL(f);
|
|
18
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const imageToB64 = (i) => {
|
|
2
|
+
const canvas = document.createElement("canvas");
|
|
3
|
+
const { naturalWidth, naturalHeight } = i;
|
|
4
|
+
const ctx = canvas.getContext("2d");
|
|
5
|
+
canvas.width = naturalWidth;
|
|
6
|
+
canvas.height = naturalHeight;
|
|
7
|
+
ctx.drawImage(i, 0, 0, naturalWidth, naturalHeight);
|
|
8
|
+
return canvas.toDataURL();
|
|
9
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { lanczos } from "@rgba-image/lanczos";
|
|
2
|
+
import { dimensionsFromImage, scaleByLargestSide, } from "./sizing";
|
|
3
|
+
const createCanvasWithContext = () => {
|
|
4
|
+
const canvas = document.createElement("canvas");
|
|
5
|
+
const contenx = canvas.getContext("2d");
|
|
6
|
+
return [canvas, contenx];
|
|
7
|
+
};
|
|
8
|
+
const imageDataFromImage = (image) => {
|
|
9
|
+
const { naturalWidth, naturalHeight } = image;
|
|
10
|
+
const [canvas, context] = createCanvasWithContext();
|
|
11
|
+
canvas.width = naturalWidth;
|
|
12
|
+
canvas.height = naturalHeight;
|
|
13
|
+
context.drawImage(image, 0, 0);
|
|
14
|
+
return context.getImageData(0, 0, naturalWidth, naturalHeight);
|
|
15
|
+
};
|
|
16
|
+
export const resizeImage = (width, i) => {
|
|
17
|
+
const scale = scaleByLargestSide(width);
|
|
18
|
+
const [destinationCanvas, destinationContext] = createCanvasWithContext();
|
|
19
|
+
const imageDimensions = dimensionsFromImage(i);
|
|
20
|
+
const [destinationWidth, destinationHeight] = scale(imageDimensions).map((d) => d.size);
|
|
21
|
+
const destinationImageData = new ImageData(destinationWidth, destinationHeight);
|
|
22
|
+
const originImageData = imageDataFromImage(i);
|
|
23
|
+
destinationCanvas.width = destinationWidth;
|
|
24
|
+
destinationCanvas.height = destinationHeight;
|
|
25
|
+
lanczos(originImageData, destinationImageData);
|
|
26
|
+
destinationContext.putImageData(destinationImageData, 0, 0);
|
|
27
|
+
return destinationCanvas.toDataURL();
|
|
28
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Ord as OrdNumber } from "fp-ts/lib/number";
|
|
2
|
+
import { contramap } from "fp-ts/lib/Ord";
|
|
3
|
+
import { sort } from "fp-ts/lib/Array";
|
|
4
|
+
const makeWidth = (size) => {
|
|
5
|
+
return {
|
|
6
|
+
kind: "width",
|
|
7
|
+
size,
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
const makeHeight = (size) => {
|
|
11
|
+
return {
|
|
12
|
+
kind: "height",
|
|
13
|
+
size,
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
const ordBySize = contramap((s) => s.size)(OrdNumber);
|
|
17
|
+
const ordByKind = {
|
|
18
|
+
equals: (x, y) => x.kind === y.kind,
|
|
19
|
+
compare: (x, y) => {
|
|
20
|
+
return x.kind === y.kind ? 0 : x.kind === "width" ? -1 : 1;
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
const sortDimentionsBySize = sort(ordBySize);
|
|
24
|
+
const sortDimentionsByKind = sort(ordByKind);
|
|
25
|
+
const getDimentionsRatio = (sortedDimensions) => {
|
|
26
|
+
const [smallest, largest] = sortedDimensions;
|
|
27
|
+
return smallest.size / largest.size;
|
|
28
|
+
};
|
|
29
|
+
export const scaleByLargestSide = (toSize) => (dimensions) => {
|
|
30
|
+
const sortedDimensions = sortDimentionsBySize(dimensions);
|
|
31
|
+
const ratio = getDimentionsRatio(sortedDimensions);
|
|
32
|
+
const newSmallestSide = Object.assign(Object.assign({}, sortedDimensions[0]), { size: toSize * ratio });
|
|
33
|
+
const newLargestSide = Object.assign(Object.assign({}, sortedDimensions[1]), { size: toSize });
|
|
34
|
+
return sortDimentionsByKind([newLargestSide, newSmallestSide]);
|
|
35
|
+
};
|
|
36
|
+
export const dimensionsFromImage = (image) => {
|
|
37
|
+
const { naturalWidth, naturalHeight } = image;
|
|
38
|
+
return [makeWidth(naturalWidth), makeHeight(naturalHeight)];
|
|
39
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const toFile = async (b64data) => {
|
|
2
|
+
const request = await fetch(b64data);
|
|
3
|
+
const blob = await request.blob();
|
|
4
|
+
return new File([blob], "image", {
|
|
5
|
+
type: blob.type,
|
|
6
|
+
lastModified: Date.now(),
|
|
7
|
+
});
|
|
8
|
+
};
|
|
9
|
+
export const convertB64toFileTask = (b64data) => () => new Promise(async (resolve, _) => {
|
|
10
|
+
const request = await fetch(b64data);
|
|
11
|
+
const blob = await request.blob();
|
|
12
|
+
const file = new File([blob], "image", {
|
|
13
|
+
type: blob.type,
|
|
14
|
+
lastModified: Date.now(),
|
|
15
|
+
});
|
|
16
|
+
resolve(file);
|
|
17
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export class GAnalytics {
|
|
2
|
+
constructor() {
|
|
3
|
+
ga('require', 'ec');
|
|
4
|
+
}
|
|
5
|
+
convertProduct(product) {
|
|
6
|
+
var _a, _b, _c;
|
|
7
|
+
return {
|
|
8
|
+
id: product.productId,
|
|
9
|
+
name: product.title,
|
|
10
|
+
brand: (_a = product.brand) !== null && _a !== void 0 ? _a : '',
|
|
11
|
+
category: (_b = product.productType) !== null && _b !== void 0 ? _b : '',
|
|
12
|
+
list: 'VI VPR View',
|
|
13
|
+
price: Math.min(...[product.price.actual, (_c = product.price.sale) !== null && _c !== void 0 ? _c : Infinity])
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
sendImpression(product) {
|
|
17
|
+
ga('ec:addImpression', this.convertProduct(product));
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
sendClick(product) {
|
|
21
|
+
var _a, _b, _c;
|
|
22
|
+
ga('ec:addProduct', {
|
|
23
|
+
id: product.productId,
|
|
24
|
+
name: product.title,
|
|
25
|
+
brand: (_a = product.brand) !== null && _a !== void 0 ? _a : '',
|
|
26
|
+
category: (_b = product.productType) !== null && _b !== void 0 ? _b : '',
|
|
27
|
+
price: Math.min(...[product.price.actual, (_c = product.price.sale) !== null && _c !== void 0 ? _c : Infinity])
|
|
28
|
+
});
|
|
29
|
+
ga('ec:setAction', 'click', { list: 'VI VPR View' });
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { pipe } from "fp-ts/lib/function";
|
|
2
|
+
import { fromNullable, map, getMonoid } from "fp-ts/lib/Option";
|
|
3
|
+
import { GtagAnalytics } from "./GtagAnalytics";
|
|
4
|
+
import { GAnalytics } from "./GAnalytics";
|
|
5
|
+
import { first } from "fp-ts/lib/Semigroup";
|
|
6
|
+
const getGtagAnalytics = () => pipe(fromNullable(window.gtag), map(() => new GtagAnalytics()));
|
|
7
|
+
const getCommonAnalytics = () => pipe(fromNullable(window.ga), map(() => new GAnalytics()));
|
|
8
|
+
const analyticsMonoid = getMonoid(first());
|
|
9
|
+
export const getAnalyticsModule = analyticsMonoid.concat(getGtagAnalytics(), getCommonAnalytics());
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export class GtagAnalytics {
|
|
2
|
+
sendImpression(product) {
|
|
3
|
+
var _a, _b, _c;
|
|
4
|
+
gtag('event', 'view_item_list', {
|
|
5
|
+
items: [
|
|
6
|
+
{
|
|
7
|
+
id: product.productId,
|
|
8
|
+
name: product.title,
|
|
9
|
+
brand: (_a = product.brand) !== null && _a !== void 0 ? _a : '',
|
|
10
|
+
category: (_b = product.productType) !== null && _b !== void 0 ? _b : '',
|
|
11
|
+
list_name: 'VI VPR View',
|
|
12
|
+
price: Math.min(...[product.price.actual, (_c = product.price.sale) !== null && _c !== void 0 ? _c : Infinity])
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
});
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
sendClick(product) {
|
|
19
|
+
var _a, _b, _c;
|
|
20
|
+
gtag('event', 'select_content', {
|
|
21
|
+
content_type: 'product',
|
|
22
|
+
items: [
|
|
23
|
+
{
|
|
24
|
+
id: product.productId,
|
|
25
|
+
name: product.title,
|
|
26
|
+
brand: (_a = product.brand) !== null && _a !== void 0 ? _a : '',
|
|
27
|
+
category: (_b = product.productType) !== null && _b !== void 0 ? _b : '',
|
|
28
|
+
list_name: 'VI VPR View',
|
|
29
|
+
price: Math.min(...[product.price.actual, (_c = product.price.sale) !== null && _c !== void 0 ? _c : Infinity])
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
});
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const isVPR = (c) => c._tag === "VPR";
|
|
2
|
+
export const isVCS = (c) => c._tag === "VCS";
|
|
3
|
+
export function fold(onVPR, onVCS) {
|
|
4
|
+
return (c) => (isVPR(c) ? onVPR() : onVCS());
|
|
5
|
+
}
|
|
6
|
+
export function fromString(s) {
|
|
7
|
+
return s === "VPR" ? { _tag: "VPR" } : { _tag: "VCS" };
|
|
8
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as C from "./Campaign";
|
|
2
|
+
import { pipe } from "fp-ts/lib/function";
|
|
3
|
+
import { getVPRRecommendations } from "./VPRCampaignService";
|
|
4
|
+
import { getVCSRecommendations } from "./VCSCampaignService";
|
|
5
|
+
export const getRecommendationsService = (campaignType) => pipe(C.fromString(campaignType), C.fold(() => getVPRRecommendations, () => getVCSRecommendations));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entries": [
|
|
3
|
+
"./components/vviinn-carousel/vviinn-carousel.js",
|
|
4
|
+
"./components/image-search/image-view/highlight-box/highlight-box.js",
|
|
5
|
+
"./components/image-search/image-view/image-cropper/image-cropper.js",
|
|
6
|
+
"./components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.js",
|
|
7
|
+
"./components/image-search/search-filters/search-filters.js",
|
|
8
|
+
"./components/vviinn-error/vviinn-error.js",
|
|
9
|
+
"./components/vviinn-error/vviinn-empty-results/vviinn-empty-results.js",
|
|
10
|
+
"./components/vviinn-error/vviinn-server-error/vviinn-server-error.js",
|
|
11
|
+
"./components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.js",
|
|
12
|
+
"./components/vviinn-example-images/vviinn-example-images.js",
|
|
13
|
+
"./components/vviinn-example-images/vviinn-example-image/vviinn-example-image.js",
|
|
14
|
+
"./components/vviinn-image-selector/vviinn-image-selector.js",
|
|
15
|
+
"./components/vviinn-image-view/vviinn-image-view.js",
|
|
16
|
+
"./components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.js",
|
|
17
|
+
"./components/vviinn-modal/vviinn-modal.js",
|
|
18
|
+
"./components/vviinn-onboarding/vviinn-onboarding.js",
|
|
19
|
+
"./components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-1/vviinn-onboarding-card-1.js",
|
|
20
|
+
"./components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-2/vviinn-onboarding-card-2.js",
|
|
21
|
+
"./components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-3/vviinn-onboarding-card-3.js",
|
|
22
|
+
"./components/vviinn-overlay/vviinn-overlay.js",
|
|
23
|
+
"./components/vviinn-overlayed-modal/vviinn-overlayed-modal.js",
|
|
24
|
+
"./components/vviinn-preloader/vviinn-preloader.js",
|
|
25
|
+
"./components/vviinn-privacy-badge/vviinn-privacy-badge.js",
|
|
26
|
+
"./components/vviinn-product-card/vviinn-product-card.js",
|
|
27
|
+
"./components/vviinn-slider/vviinn-slider.js",
|
|
28
|
+
"./components/vviinn-slider/vviinn-slide/vviinn-slide.js",
|
|
29
|
+
"./components/vviinn-teaser/vviinn-teaser.js",
|
|
30
|
+
"./components/vviinn-vpr-button/vviinn-vpr-button.js",
|
|
31
|
+
"./components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js",
|
|
32
|
+
"./components/vviinn-vpr-widget/vviinn-vpr-vidget.js",
|
|
33
|
+
"./components/vviinn-vps-button/vviinn-vps-button.js",
|
|
34
|
+
"./components/vviinn-vps-widget/vviinn-vps-widget.js"
|
|
35
|
+
],
|
|
36
|
+
"compiler": {
|
|
37
|
+
"name": "@stencil/core",
|
|
38
|
+
"version": "2.9.0",
|
|
39
|
+
"typescriptVersion": "4.2.3"
|
|
40
|
+
},
|
|
41
|
+
"collections": [],
|
|
42
|
+
"bundles": []
|
|
43
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
const defaultSlotsNames = [
|
|
3
|
+
"vviinn-onboarding-title",
|
|
4
|
+
"vviinn-onboarding-card-1-icon",
|
|
5
|
+
"vviinn-onboarding-card-1-text",
|
|
6
|
+
"vviinn-onboarding-card-2-icon",
|
|
7
|
+
"vviinn-onboarding-card-2-text",
|
|
8
|
+
"vviinn-onboarding-card-3-icon",
|
|
9
|
+
"vviinn-onboarding-card-3-text",
|
|
10
|
+
"vviinn-example-images-title",
|
|
11
|
+
"vviinn-example-images-1",
|
|
12
|
+
"vviinn-example-images-2",
|
|
13
|
+
"vviinn-example-images-3",
|
|
14
|
+
"vviinn-example-images-4",
|
|
15
|
+
"vviinn-teaser-text",
|
|
16
|
+
"vviinn-image-upload-button-text",
|
|
17
|
+
"vviinn-privacy-badge-text"
|
|
18
|
+
];
|
|
19
|
+
const renderNamedSlot = (name) => h("slot", { name: name });
|
|
20
|
+
export const SlotSkeleton = () => defaultSlotsNames.map(renderNamedSlot);
|
|
21
|
+
const getSlots = (element) => Array.from(element.shadowRoot.querySelectorAll("slot"));
|
|
22
|
+
const getNameAttribute = (element) => element.getAttribute("name");
|
|
23
|
+
const getSlotAttribute = (element) => element.getAttribute("slot");
|
|
24
|
+
const elementContainSlot = (slot) => (container) => {
|
|
25
|
+
const name1 = getNameAttribute(slot);
|
|
26
|
+
const name2 = getSlotAttribute(container);
|
|
27
|
+
return name1 === name2;
|
|
28
|
+
};
|
|
29
|
+
const getContentToReplace = (targets) => (acc, content) => {
|
|
30
|
+
const replaceCandidate = targets.find(elementContainSlot(content));
|
|
31
|
+
if (replaceCandidate) {
|
|
32
|
+
acc.set(content, replaceCandidate);
|
|
33
|
+
}
|
|
34
|
+
return acc;
|
|
35
|
+
};
|
|
36
|
+
const replaceSlotContent = (content, target) => {
|
|
37
|
+
target.innerHTML = content.outerHTML;
|
|
38
|
+
};
|
|
39
|
+
export const slotChangeListener = (component, element) => {
|
|
40
|
+
component.connectedCallback = function () {
|
|
41
|
+
document.addEventListener("globalSlotsChanged", ({ detail }) => {
|
|
42
|
+
const slotsToReplace = getSlots(element).reduce(getContentToReplace(detail), new Map());
|
|
43
|
+
slotsToReplace.forEach(replaceSlotContent);
|
|
44
|
+
}, true);
|
|
45
|
+
};
|
|
46
|
+
component.connectedCallback.call(component);
|
|
47
|
+
};
|