vviinn-widgets 2.7.2 → 2.8.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/components/Handler.js +270 -0
- package/dist/components/NonEmptyArray.js +5699 -0
- package/dist/components/cropper-handler.js +6 -0
- package/dist/components/cropper-handler2.js +39 -0
- package/dist/{cjs/customized-slots-06ca4007.js → components/customized-slots.js} +3 -6
- package/dist/components/highlight-box.js +6 -0
- package/dist/components/highlight-box2.js +52 -0
- package/dist/components/image-cropper.js +6 -0
- package/dist/components/image-cropper2.js +138 -0
- package/dist/components/imageSearch.store.js +10686 -0
- package/dist/components/index.js +1 -0
- package/dist/{esm/index-443468c7.js → components/index2.js} +2 -2
- package/dist/components/index3.js +130 -0
- package/dist/components/recommendations-sidebar.js +101 -0
- package/dist/components/resizer.worker.js +11 -0
- package/dist/components/search-filters.js +6 -0
- package/dist/components/search-filters2.js +89 -0
- package/dist/components/tracking.worker.js +11 -0
- package/dist/components/vviinn-carousel.js +6 -0
- package/dist/components/vviinn-carousel2.js +235 -0
- package/dist/components/vviinn-detected-object.js +6 -0
- package/dist/components/vviinn-detected-object2.js +67 -0
- package/dist/components/vviinn-empty-results.js +6 -0
- package/dist/components/vviinn-empty-results2.js +35 -0
- package/dist/components/vviinn-error.js +6 -0
- package/dist/components/vviinn-error2.js +28 -0
- package/dist/components/vviinn-example-image.js +6 -0
- package/dist/components/vviinn-example-image2.js +57 -0
- package/dist/components/vviinn-example-images.js +6 -0
- package/dist/components/vviinn-example-images2.js +53 -0
- package/dist/components/vviinn-image-selector.js +6 -0
- package/dist/components/vviinn-image-selector2.js +135 -0
- package/dist/components/vviinn-image-view.js +6 -0
- package/dist/components/vviinn-image-view2.js +95 -0
- package/dist/components/vviinn-modal.js +6 -0
- package/dist/components/vviinn-modal2.js +46 -0
- package/dist/components/vviinn-onboarding-card-1.js +6 -0
- package/dist/components/vviinn-onboarding-card-12.js +34 -0
- package/dist/components/vviinn-onboarding-card-2.js +6 -0
- package/dist/components/vviinn-onboarding-card-22.js +34 -0
- package/dist/components/vviinn-onboarding-card-3.js +6 -0
- package/dist/components/vviinn-onboarding-card-32.js +34 -0
- package/dist/components/vviinn-onboarding.js +6 -0
- package/dist/components/vviinn-onboarding2.js +63 -0
- package/dist/components/vviinn-overlay.js +6 -0
- package/dist/components/vviinn-overlay2.js +28 -0
- package/dist/components/vviinn-overlayed-modal.js +6 -0
- package/dist/components/vviinn-overlayed-modal2.js +45 -0
- package/dist/components/vviinn-preloader.js +6 -0
- package/dist/components/vviinn-preloader2.js +34 -0
- package/dist/components/vviinn-privacy-badge.js +6 -0
- package/dist/components/vviinn-privacy-badge2.js +33 -0
- package/dist/components/vviinn-product-card.js +6 -0
- package/dist/components/vviinn-product-card2.js +216 -0
- package/dist/components/vviinn-recommendations-sidebar.js +6 -0
- package/dist/components/vviinn-server-error.js +6 -0
- package/dist/components/vviinn-server-error2.js +35 -0
- package/dist/components/vviinn-slide.js +6 -0
- package/dist/components/vviinn-slide2.js +28 -0
- package/dist/components/vviinn-slider.js +6 -0
- package/dist/components/vviinn-slider2.js +159 -0
- package/dist/components/vviinn-teaser.js +6 -0
- package/dist/components/vviinn-teaser2.js +33 -0
- package/dist/components/vviinn-vpr-button.js +93 -0
- package/dist/components/vviinn-vpr-vidget.js +3360 -0
- package/dist/components/vviinn-vpr-widget.js +6 -0
- package/dist/components/vviinn-vps-button.js +224 -0
- package/dist/components/vviinn-vps-widget.js +6 -0
- package/dist/components/vviinn-vps-widget2.js +350 -0
- package/dist/components/vviinn-wrong-format.js +6 -0
- package/dist/components/vviinn-wrong-format2.js +35 -0
- package/dist/types/components/vviinn-product-card/vviinn-product-card.d.ts +1 -0
- package/dist/types/components/vviinn-vpr-button/stories/lol.d.ts +2 -0
- package/dist/types/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.d.ts +1 -1
- package/dist/vviinn-widgets/Array-bdfc75db.js +4870 -0
- package/dist/vviinn-widgets/Handler-edcb46f4.js +1422 -0
- package/dist/vviinn-widgets/NonEmptyArray-947ab7b3.js +4411 -0
- package/dist/{esm/app-globals-865bc7a7.js → vviinn-widgets/app-globals-c0aa8ec3.js} +922 -10
- package/dist/vviinn-widgets/cropper-handler.entry.js +23 -0
- package/dist/vviinn-widgets/css-shim-f0027935.js +4 -0
- package/dist/{esm/customized-slots-96902edf.js → vviinn-widgets/customized-slots-5c1c623a.js} +1 -1
- package/dist/vviinn-widgets/dom-db0073f0.js +73 -0
- package/dist/vviinn-widgets/highlight-box.entry.js +41 -0
- package/dist/{collection/components/image-search/image-view/image-cropper/image-cropper.js → vviinn-widgets/image-cropper.entry.js} +33 -70
- package/dist/{cjs/index-df6896e2.js → vviinn-widgets/imageSearch.store-0eed9a5c.js} +11598 -15320
- package/dist/{esm/index-2fdd499d.js → vviinn-widgets/imageSearch.store-b28bddb0.js} +11971 -15281
- package/dist/{collection/components/vviinn-icons/index.js → vviinn-widgets/index-44058ea2.js} +14 -11
- package/dist/vviinn-widgets/index-6c6de682.js +3857 -0
- package/dist/vviinn-widgets/index-de3e14da.js +3010 -0
- package/dist/vviinn-widgets/index.esm.js +1 -0
- package/dist/vviinn-widgets/number-171db649.js +1499 -0
- package/dist/vviinn-widgets/search-filters.entry.js +76 -0
- package/dist/vviinn-widgets/shadow-css-c1fdfa9f.js +389 -0
- package/dist/{collection/components/vviinn-carousel/vviinn-carousel.js → vviinn-widgets/vviinn-carousel.entry.js} +18 -113
- package/dist/vviinn-widgets/vviinn-detected-object.entry.js +54 -0
- package/dist/vviinn-widgets/vviinn-empty-results.entry.js +16 -0
- package/dist/vviinn-widgets/vviinn-error.entry.js +15 -0
- package/dist/vviinn-widgets/vviinn-example-image.entry.js +38 -0
- package/dist/vviinn-widgets/vviinn-example-images.entry.js +28 -0
- package/dist/vviinn-widgets/vviinn-image-selector.entry.js +31 -0
- package/dist/vviinn-widgets/vviinn-image-view.entry.js +55 -0
- package/dist/vviinn-widgets/vviinn-modal.entry.js +30 -0
- package/dist/vviinn-widgets/vviinn-onboarding-card-1.entry.js +21 -0
- package/dist/vviinn-widgets/vviinn-onboarding-card-2.entry.js +21 -0
- package/dist/vviinn-widgets/vviinn-onboarding-card-3.entry.js +21 -0
- package/dist/vviinn-widgets/vviinn-onboarding.entry.js +20 -0
- package/dist/vviinn-widgets/vviinn-overlay.entry.js +15 -0
- package/dist/vviinn-widgets/vviinn-overlayed-modal.entry.js +18 -0
- package/dist/vviinn-widgets/vviinn-preloader.entry.js +25 -0
- package/dist/vviinn-widgets/vviinn-privacy-badge.entry.js +20 -0
- package/dist/vviinn-widgets/vviinn-product-card.entry.js +188 -0
- package/dist/{esm → vviinn-widgets}/vviinn-recommendations-sidebar.entry.js +2 -2
- package/dist/vviinn-widgets/vviinn-server-error.entry.js +16 -0
- package/dist/vviinn-widgets/vviinn-slide.entry.js +15 -0
- package/dist/vviinn-widgets/vviinn-slider.entry.js +120 -0
- package/dist/vviinn-widgets/vviinn-teaser.entry.js +20 -0
- package/dist/{esm → vviinn-widgets}/vviinn-vpr-button.entry.js +2 -2
- package/dist/vviinn-widgets/vviinn-vpr-widget.entry.js +4588 -0
- package/dist/{esm → vviinn-widgets}/vviinn-vps-button.entry.js +3 -3
- package/dist/vviinn-widgets/vviinn-vps-widget.entry.js +170 -0
- package/dist/vviinn-widgets/vviinn-widgets.css +6 -1
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +125 -1
- package/dist/vviinn-widgets/vviinn-wrong-format.entry.js +16 -0
- package/package.json +8 -2
- package/www/build/p-06c76b5e.js +1 -0
- package/www/build/p-07e16d04.js +15 -0
- package/{dist/vviinn-widgets/p-a6e0710f.entry.js → www/build/p-44bc50de.entry.js} +1 -1
- package/www/build/p-510922c6.js +1 -0
- package/www/build/p-57ce8de3.css +1 -0
- package/www/build/p-591cb193.entry.js +1 -0
- package/www/build/p-6b9d242e.js +1 -0
- package/www/build/p-880bccf1.js +1 -0
- package/www/build/p-b0ada114.entry.js +1 -0
- package/www/build/p-b7be7c70.entry.js +1 -0
- package/{dist/vviinn-widgets/p-166970f3.js → www/build/p-ea8dea5c.js} +1 -1
- package/www/build/vviinn-widgets.css +1 -1
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +32261 -1
- package/www/sw.js +66 -0
- package/dist/cjs/app-globals-8db3bcbe.js +0 -6912
- package/dist/cjs/cropper-handler_27.cjs.entry.js +0 -1135
- package/dist/cjs/index-3c3ab815.js +0 -1354
- package/dist/cjs/index-f66cd8d1.js +0 -39
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/loader.cjs.js +0 -23
- package/dist/cjs/vviinn-carousel_2.cjs.entry.js +0 -1001
- package/dist/cjs/vviinn-recommendations-sidebar.cjs.entry.js +0 -65
- package/dist/cjs/vviinn-vpr-button.cjs.entry.js +0 -49
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +0 -43
- package/dist/cjs/vviinn-widgets.cjs.js +0 -21
- package/dist/collection/Image/error.js +0 -14
- package/dist/collection/Image/form.js +0 -5
- package/dist/collection/Image/fromFile.js +0 -18
- package/dist/collection/Image/imageToB64.js +0 -9
- package/dist/collection/Image/index.js +0 -0
- package/dist/collection/Image/renderPromise.js +0 -6
- package/dist/collection/Image/resizeImage.js +0 -28
- package/dist/collection/Image/sizing.js +0 -39
- package/dist/collection/Image/toFile.js +0 -17
- package/dist/collection/analytics/GAnalytics.js +0 -32
- package/dist/collection/analytics/GeneralAnalytics.js +0 -9
- package/dist/collection/analytics/GtagAnalytics.js +0 -35
- package/dist/collection/analytics/ProductAnalytics.js +0 -1
- package/dist/collection/campaign/Campaign.js +0 -8
- package/dist/collection/campaign/CampaignService.js +0 -5
- package/dist/collection/campaign/VCSCampaign.js +0 -1
- package/dist/collection/campaign/VCSCampaignResponse.js +0 -1
- package/dist/collection/campaign/VCSCampaignService.js +0 -7
- package/dist/collection/campaign/VPRCampaignResponse.js +0 -1
- package/dist/collection/campaign/VPRCampaignService.js +0 -7
- package/dist/collection/collection-manifest.json +0 -43
- package/dist/collection/components/customized-slots.js +0 -47
- package/dist/collection/components/image-search/image-view/highlight-box/highlight-box.css +0 -71
- package/dist/collection/components/image-search/image-view/highlight-box/highlight-box.js +0 -25
- package/dist/collection/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.css +0 -49
- package/dist/collection/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.js +0 -64
- package/dist/collection/components/image-search/image-view/image-cropper/image-cropper.css +0 -33
- package/dist/collection/components/image-search/search-filters/search-filters.css +0 -120
- package/dist/collection/components/image-search/search-filters/search-filters.js +0 -125
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.css +0 -142
- package/dist/collection/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.css +0 -7
- package/dist/collection/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.js +0 -36
- package/dist/collection/components/vviinn-error/vviinn-error.css +0 -38
- package/dist/collection/components/vviinn-error/vviinn-error.js +0 -18
- package/dist/collection/components/vviinn-error/vviinn-server-error/vviinn-server-error.css +0 -3
- package/dist/collection/components/vviinn-error/vviinn-server-error/vviinn-server-error.js +0 -34
- package/dist/collection/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.css +0 -3
- package/dist/collection/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.js +0 -34
- package/dist/collection/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.css +0 -34
- package/dist/collection/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.js +0 -129
- package/dist/collection/components/vviinn-example-images/vviinn-example-images.css +0 -19
- package/dist/collection/components/vviinn-example-images/vviinn-example-images.js +0 -80
- package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.css +0 -25
- package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.js +0 -64
- package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.css +0 -47
- package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.js +0 -100
- package/dist/collection/components/vviinn-image-view/vviinn-image-view.css +0 -31
- package/dist/collection/components/vviinn-image-view/vviinn-image-view.js +0 -61
- package/dist/collection/components/vviinn-modal/vviinn-modal.css +0 -105
- package/dist/collection/components/vviinn-modal/vviinn-modal.js +0 -98
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/onboarding-card.css +0 -41
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-1/vviinn-onboarding-card-1.js +0 -26
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-2/vviinn-onboarding-card-2.js +0 -26
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-3/vviinn-onboarding-card-3.js +0 -26
- package/dist/collection/components/vviinn-onboarding/vviinn-onboarding.css +0 -58
- package/dist/collection/components/vviinn-onboarding/vviinn-onboarding.js +0 -28
- package/dist/collection/components/vviinn-overlay/vviinn-overlay.css +0 -33
- package/dist/collection/components/vviinn-overlay/vviinn-overlay.js +0 -15
- package/dist/collection/components/vviinn-overlayed-modal/vviinn-overlayed-modal.css +0 -29
- package/dist/collection/components/vviinn-overlayed-modal/vviinn-overlayed-modal.js +0 -71
- package/dist/collection/components/vviinn-preloader/vviinn-preloader.css +0 -37
- package/dist/collection/components/vviinn-preloader/vviinn-preloader.js +0 -20
- package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.css +0 -19
- package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.js +0 -27
- package/dist/collection/components/vviinn-product-card/render-helpers.js +0 -32
- package/dist/collection/components/vviinn-product-card/stories/args.js +0 -73
- package/dist/collection/components/vviinn-product-card/stories/decorators.js +0 -51
- package/dist/collection/components/vviinn-product-card/stories/vviinn-product-card.stories.js +0 -105
- package/dist/collection/components/vviinn-product-card/vviinn-product-card.css +0 -95
- package/dist/collection/components/vviinn-product-card/vviinn-product-card.js +0 -462
- package/dist/collection/components/vviinn-slider/arrow.js +0 -11
- package/dist/collection/components/vviinn-slider/vviinn-slide/vviinn-slide.css +0 -4
- package/dist/collection/components/vviinn-slider/vviinn-slide/vviinn-slide.js +0 -15
- package/dist/collection/components/vviinn-slider/vviinn-slider.css +0 -109
- package/dist/collection/components/vviinn-slider/vviinn-slider.js +0 -181
- package/dist/collection/components/vviinn-teaser/vviinn-teaser.css +0 -14
- package/dist/collection/components/vviinn-teaser/vviinn-teaser.js +0 -29
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.css +0 -238
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js +0 -220
- package/dist/collection/components/vviinn-vpr-button/stories/args.js +0 -213
- package/dist/collection/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.js +0 -91
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.css +0 -35
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +0 -179
- package/dist/collection/components/vviinn-vpr-widget/stories/args.js +0 -197
- package/dist/collection/components/vviinn-vpr-widget/stories/decorators.js +0 -29
- package/dist/collection/components/vviinn-vpr-widget/stories/vviinn-vpr-widget.stories.js +0 -211
- package/dist/collection/components/vviinn-vpr-widget/token-helpers.js +0 -11
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +0 -510
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-widget.css +0 -79
- package/dist/collection/components/vviinn-vps-button/stories/vviinn-vps-button.stories.js +0 -35
- package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.css +0 -3
- package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +0 -195
- package/dist/collection/components/vviinn-vps-widget/stories/vviinn-vps-widget.stories.js +0 -37
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.css +0 -350
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +0 -375
- package/dist/collection/cropper/Cropper.js +0 -1
- package/dist/collection/cropper/Handler.js +0 -61
- package/dist/collection/dom/index.js +0 -3
- package/dist/collection/error.js +0 -14
- package/dist/collection/file/index.js +0 -4
- package/dist/collection/geometry/Clip.js +0 -14
- package/dist/collection/geometry/Point.js +0 -32
- package/dist/collection/geometry/Rectangle.js +0 -95
- package/dist/collection/geometry/RectangleAlt.js +0 -1
- package/dist/collection/geometry/Sized.js +0 -8
- package/dist/collection/global.js +0 -19
- package/dist/collection/index.js +0 -1
- package/dist/collection/interfaces/generated.js +0 -5
- package/dist/collection/interfaces/recommendation.js +0 -1
- package/dist/collection/network/apiClient.js +0 -9
- package/dist/collection/network/ion/File.js +0 -14
- package/dist/collection/network/ion/Form.js +0 -64
- package/dist/collection/network/ion/Link.js +0 -8
- package/dist/collection/network/ion/ValueObject.js +0 -23
- package/dist/collection/network/request.js +0 -19
- package/dist/collection/network/utils.js +0 -37
- package/dist/collection/openApi/index.js +0 -27
- package/dist/collection/recommendation/events.js +0 -1
- package/dist/collection/recommendation/recommendation.js +0 -1
- package/dist/collection/searchSession/searchSession.js +0 -31
- package/dist/collection/sentry.js +0 -14
- package/dist/collection/slider/GridMode.js +0 -1
- package/dist/collection/store/file-processing.js +0 -13
- package/dist/collection/store/imageSearch.store.js +0 -133
- package/dist/collection/store/store.js +0 -3
- package/dist/collection/store/tracking.store.js +0 -3
- package/dist/collection/stories/Button.js +0 -21
- package/dist/collection/stories/Button.stories.js +0 -42
- package/dist/collection/stories/Header.js +0 -45
- package/dist/collection/stories/Header.stories.js +0 -15
- package/dist/collection/stories/Page.js +0 -61
- package/dist/collection/stories/Page.stories.js +0 -19
- package/dist/collection/stories/assets/code-brackets.svg +0 -1
- package/dist/collection/stories/assets/colors.svg +0 -1
- package/dist/collection/stories/assets/comments.svg +0 -1
- package/dist/collection/stories/assets/direction.svg +0 -1
- package/dist/collection/stories/assets/flow.svg +0 -1
- package/dist/collection/stories/assets/plugin.svg +0 -1
- package/dist/collection/stories/assets/repo.svg +0 -1
- package/dist/collection/stories/assets/stackalt.svg +0 -1
- package/dist/collection/stories/image-selector.stories.js +0 -6
- package/dist/collection/stories/image-view.stories.js +0 -6
- package/dist/collection/stories/modal.stories.js +0 -12
- package/dist/collection/stories/onboarding.stories.js +0 -11
- package/dist/collection/stories/overlay.stories.js +0 -5
- package/dist/collection/stories/overlayedModal.stories.js +0 -8
- package/dist/collection/stories/privacy-badge.stories.js +0 -11
- package/dist/collection/stories/slider.stories.js +0 -17
- package/dist/collection/stories/teaser.stories.js +0 -5
- package/dist/collection/stories/vps-widget.stories.js +0 -47
- package/dist/collection/stories/vviinn-product.stories.js +0 -19
- package/dist/collection/tracking/event.js +0 -3
- package/dist/collection/tracking/filter.js +0 -5
- package/dist/collection/tracking/index.js +0 -13
- package/dist/collection/tracking/models.js +0 -6
- package/dist/collection/tracking/product.js +0 -18
- package/dist/collection/tracking/search.js +0 -5
- package/dist/collection/tracking/widget.js +0 -10
- package/dist/collection/utils/collections/collectionsUtils.js +0 -5
- package/dist/collection/utils/either.js +0 -3
- package/dist/collection/utils/enum/enumUtils.js +0 -3
- package/dist/collection/utils/event/Events.js +0 -1
- package/dist/collection/utils/number/index.js +0 -4
- package/dist/collection/utils/option/option.js +0 -4
- package/dist/collection/utils/semigroup/semigroupDiff.js +0 -6
- package/dist/collection/utils/token/tokenUtils.js +0 -9
- package/dist/esm/cropper-handler_27.entry.js +0 -1105
- package/dist/esm/index-51f71d18.js +0 -1323
- package/dist/esm/index.js +0 -1
- package/dist/esm/loader.js +0 -19
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/vviinn-carousel_2.entry.js +0 -996
- package/dist/esm/vviinn-widgets.js +0 -19
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/loader/cdn.js +0 -3
- package/dist/loader/index.cjs.js +0 -3
- package/dist/loader/index.d.ts +0 -12
- package/dist/loader/index.es2017.js +0 -3
- package/dist/loader/index.js +0 -4
- package/dist/loader/package.json +0 -10
- package/dist/vviinn-widgets/p-2dd35f19.entry.js +0 -1
- package/dist/vviinn-widgets/p-3469b71a.js +0 -1
- package/dist/vviinn-widgets/p-40bea5b5.entry.js +0 -1
- package/dist/vviinn-widgets/p-465d043d.js +0 -15
- package/dist/vviinn-widgets/p-59bd2a99.js +0 -1
- package/dist/vviinn-widgets/p-74ed36af.entry.js +0 -1
- package/dist/vviinn-widgets/p-9def6b8b.entry.js +0 -1
- package/dist/vviinn-widgets/p-cd995515.js +0 -1
- package/www/build/p-166970f3.js +0 -1
- package/www/build/p-2dd35f19.entry.js +0 -1
- package/www/build/p-3469b71a.js +0 -1
- package/www/build/p-40bea5b5.entry.js +0 -1
- package/www/build/p-465d043d.js +0 -15
- package/www/build/p-59bd2a99.js +0 -1
- package/www/build/p-61933b75.js +0 -1
- package/www/build/p-74ed36af.entry.js +0 -1
- package/www/build/p-9def6b8b.entry.js +0 -1
- package/www/build/p-a67898be.css +0 -1
- package/www/build/p-a6e0710f.entry.js +0 -1
- package/www/build/p-cd995515.js +0 -1
- package/www/favicon.ico +0 -0
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-3c3ab815.js');
|
|
6
|
-
const index$1 = require('./index-f66cd8d1.js');
|
|
7
|
-
|
|
8
|
-
const recommendationsSidebarCss = ":host{--vviinn-carousel-columns:0;box-sizing:border-box;display:block;display:flex;height:100vh;left:0;position:fixed;top:0;transition:background 0.1s ease-in-out;width:100vw}:host(.open){background:rgba(0, 0, 0, 0.2)}:host(.bottom){flex-direction:column;justify-content:end}:host(.right){flex-direction:row;justify-content:flex-end}header{position:relative;text-align:center;padding:32px}header.contains-source-img{display:grid;justify-items:center;grid-gap:12px}img.source-image{width:64px;height:64px;border-radius:50%;box-shadow:0px 2px 4px rgba(0, 0, 0, 0.15);padding:8px}:host(.right) header{box-shadow:0px 2px 6px rgba(0, 0, 0, 0.1)}main{padding:0 24px}:host(.right) main{overflow:auto}.sidebar{background:white;box-sizing:border-box;display:flex;flex-direction:column}:host(.bottom.idle) .sidebar,:host(.bottom.closed) .sidebar{transform:translateY(100%)}:host(.bottom.closed) .sidebar{-webkit-animation-name:slideOutFromBottom;animation-name:slideOutFromBottom;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.bottom.open) .sidebar{-webkit-animation-name:slideInFromBottom;animation-name:slideInFromBottom;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right.idle) .sidebar{transform:translateX(100%)}:host(.right.closed) .sidebar{-webkit-animation-name:slideOutFromRight;animation-name:slideOutFromRight;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right.open) .sidebar{-webkit-animation-name:slideInFromRight;animation-name:slideInFromRight;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right) .sidebar{max-width:480px}:host(.right) vviinn-vpr-widget::part(recommendations-grid){display:grid;grid-template-columns:repeat(2, 1fr);grid-gap:24px}:host(.right) vviinn-vpr-widget{overflow:auto}:host(.right) vviinn-vpr-widget::part(image){border:none}.title{font-style:normal;font-weight:500;font-size:28px;line-height:40px;text-align:center;color:#000000}vviinn-vpr-widget::part(title),vviinn-vpr-widget::part(brand),vviinn-vpr-widget::part(type){text-align:left}vviinn-vpr-widget::part(price-container){align-self:start}.close-sidebar{background:transparent;border:none;cursor:pointer;margin:0;padding:0;position:absolute;right:24px;top:24px}@-webkit-keyframes slideInFromBottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideInFromBottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes slideOutFromBottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes slideOutFromBottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@-webkit-keyframes slideInFromRight{from{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes slideInFromRight{from{transform:translateX(100%)}to{transform:translateX(0)}}@-webkit-keyframes slideOutFromRight{from{transform:translateX(0)}to{transform:translateX(100%)}}@keyframes slideOutFromRight{from{transform:translateX(0)}to{transform:translateX(100%)}}";
|
|
9
|
-
|
|
10
|
-
let RecommendationsSidebar = class {
|
|
11
|
-
constructor(hostRef) {
|
|
12
|
-
index.registerInstance(this, hostRef);
|
|
13
|
-
this.modalClosed = index.createEvent(this, "modalClosed", 7);
|
|
14
|
-
this.position = "bottom";
|
|
15
|
-
this.sourceImage = null;
|
|
16
|
-
this.widgetScrollbar = false;
|
|
17
|
-
/** comma-separated list of campaign-ids */
|
|
18
|
-
this.campaigns = "";
|
|
19
|
-
this.state = "idle";
|
|
20
|
-
}
|
|
21
|
-
bodyClickListener(event) {
|
|
22
|
-
const { clientX, clientY } = event;
|
|
23
|
-
const sidebarRect = this.getSidebarRectangle();
|
|
24
|
-
if (!sidebarRect)
|
|
25
|
-
return;
|
|
26
|
-
const inLeftBound = clientX >= sidebarRect.left;
|
|
27
|
-
const inRightBound = clientX <= sidebarRect.right;
|
|
28
|
-
const inTopBound = clientY >= sidebarRect.top;
|
|
29
|
-
const inBottomBound = clientY <= sidebarRect.bottom;
|
|
30
|
-
const inBound = inLeftBound && inRightBound && inTopBound && inBottomBound;
|
|
31
|
-
if (!inBound) {
|
|
32
|
-
this.state = "closed";
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
getClassMap() {
|
|
36
|
-
return {
|
|
37
|
-
[this.position]: true,
|
|
38
|
-
[this.state]: true,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
getSidebarRectangle() {
|
|
42
|
-
var _a;
|
|
43
|
-
return (_a = this.el.shadowRoot.querySelector("aside")) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
44
|
-
}
|
|
45
|
-
render() {
|
|
46
|
-
return (index.h(index.Host, { class: this.getClassMap() }, index.h("aside", { class: "sidebar", part: "body", onAnimationEnd: (e) => this.handleAnimationEnd(e) }, index.h("header", { class: { "contains-source-img": this.isSourceImageValid() }, part: "sidebar-header" }, this.isSourceImageValid() ? this.renderSourceImage() : null, index.h("span", { class: "title", part: "title" }, this.sidebarTitle), index.h("button", { class: "close-sidebar", onClick: () => (this.state = "closed") }, index.h(index$1.CrossIcon, null))), index.h("main", { part: "sidebar-content" }, index.h("vviinn-vpr-widget", { exportparts: "brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title: product-title", token: this.token, productId: this.productId, imageWidth: 300, blockTitle: "", mode: this.position === "bottom" ? "continuity" : "grid", useCarousel: this.position === "bottom", onRecommendationsLoaded: () => (this.state = "open"), showScroll: this.widgetScrollbar, campaigns: this.campaigns })))));
|
|
47
|
-
}
|
|
48
|
-
renderSourceImage() {
|
|
49
|
-
return (index.h("img", { class: "source-image", part: "source-image", src: this.sourceImage }));
|
|
50
|
-
}
|
|
51
|
-
isSourceImageValid() {
|
|
52
|
-
var _a;
|
|
53
|
-
return ((_a = this.sourceImage) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
54
|
-
}
|
|
55
|
-
handleAnimationEnd({ animationName }) {
|
|
56
|
-
const isClosingAnimation = animationName.includes("slideOut");
|
|
57
|
-
if (!isClosingAnimation)
|
|
58
|
-
return;
|
|
59
|
-
this.modalClosed.emit();
|
|
60
|
-
}
|
|
61
|
-
get el() { return index.getElement(this); }
|
|
62
|
-
};
|
|
63
|
-
RecommendationsSidebar.style = recommendationsSidebarCss;
|
|
64
|
-
|
|
65
|
-
exports.vviinn_recommendations_sidebar = RecommendationsSidebar;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-3c3ab815.js');
|
|
6
|
-
const index$1 = require('./index-f66cd8d1.js');
|
|
7
|
-
|
|
8
|
-
const vviinnVprButtonCss = ":host{display:block}.open-button{align-items:center;background:rgba(255, 255, 255, 0.8);border-radius:50%;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);box-sizing:border-box;cursor:pointer;display:grid;height:40px;justify-items:center;padding:0;width:40px;transition:all 0.25s ease-in-out}.open-button:hover{box-shadow:0px 2px 6px rgba(0, 0, 0, 0.25)}.open-button:focus{border:2px solid rgba(15, 98, 254, 0.5);outline:none}.open-button:active{background:#F4F4F4;outline:none}";
|
|
9
|
-
|
|
10
|
-
let VviinnVprButton = class {
|
|
11
|
-
constructor(hostRef) {
|
|
12
|
-
index.registerInstance(this, hostRef);
|
|
13
|
-
this.position = "bottom";
|
|
14
|
-
this.sourceImage = null;
|
|
15
|
-
this.sidebarTitle = "Visually similar products";
|
|
16
|
-
this.modalScrollbar = false;
|
|
17
|
-
/** comma-separated list of campaign-ids */
|
|
18
|
-
this.campaigns = "";
|
|
19
|
-
this.sidebar = null;
|
|
20
|
-
this.sidebarCloseListener = () => {
|
|
21
|
-
document.body.removeChild(this.sidebar);
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
render() {
|
|
25
|
-
return (index.h(index.Host, null, index.h("button", { class: "open-button", part: "button", onClick: () => this.handleClick() }, index.h("slot", null, index.h(index$1.VisualSearchIcon, null)))));
|
|
26
|
-
}
|
|
27
|
-
handleClick() {
|
|
28
|
-
const sidebar = document.createElement("vviinn-recommendations-sidebar");
|
|
29
|
-
sidebar.sidebarTitle = this.sidebarTitle;
|
|
30
|
-
sidebar.productId = this.productId;
|
|
31
|
-
sidebar.token = this.token;
|
|
32
|
-
sidebar.position = this.position;
|
|
33
|
-
sidebar.sourceImage = this.sourceImage;
|
|
34
|
-
sidebar.widgetScrollbar = this.modalScrollbar;
|
|
35
|
-
sidebar.campaigns = this.campaigns;
|
|
36
|
-
this.sidebar = sidebar;
|
|
37
|
-
sidebar.addEventListener("modalClosed", this.sidebarCloseListener);
|
|
38
|
-
document.body.append(this.sidebar);
|
|
39
|
-
}
|
|
40
|
-
disconnectedCallback() {
|
|
41
|
-
if (!this.sidebar)
|
|
42
|
-
return;
|
|
43
|
-
this.sidebar.removeEventListener("modalCLosed", this.sidebarCloseListener);
|
|
44
|
-
document.body.removeChild(this.sidebar);
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
VviinnVprButton.style = vviinnVprButtonCss;
|
|
48
|
-
|
|
49
|
-
exports.vviinn_vpr_button = VviinnVprButton;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-3c3ab815.js');
|
|
6
|
-
const index$1 = require('./index-f66cd8d1.js');
|
|
7
|
-
const customizedSlots = require('./customized-slots-06ca4007.js');
|
|
8
|
-
|
|
9
|
-
const vviinnVpsButtonCss = ":host{cursor:pointer}";
|
|
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, example-images", campaignId: this.campaignId })));
|
|
38
|
-
}
|
|
39
|
-
get el() { return index.getElement(this); }
|
|
40
|
-
};
|
|
41
|
-
VviinnVpsButton.style = vviinnVpsButtonCss;
|
|
42
|
-
|
|
43
|
-
exports.vviinn_vps_button = VviinnVpsButton;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const index = require('./index-3c3ab815.js');
|
|
4
|
-
const appGlobals = require('./app-globals-8db3bcbe.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_27.cjs",[[1,"vviinn-vps-widget",{"token":[1],"apiPath":[1,"api-path"],"active":[1028],"currencySign":[1,"currency-sign"],"locale":[1],"campaignId":[1,"campaign-id"],"slidePosition":[32],"width":[32],"wrongImageFormat":[32]},[[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"],[0,"cropperChanged","trachSearchAreaChanges"],[0,"detectedObjectClicked","trackDetectedObject"],[0,"filterSelected","trackFilter"]]],[1,"vviinn-image-view"],[1,"vviinn-onboarding"],[1,"vviinn-example-images",null,[[0,"exampleImageSelected","handleImageSelection"],[0,"exampleImageError","handleImageSelectionError"]]],[1,"vviinn-overlayed-modal",{"active":[4]}],[1,"vviinn-empty-results"],[1,"vviinn-image-selector"],[1,"vviinn-server-error"],[1,"vviinn-wrong-format"],[1,"search-filters",{"filter":[16],"selectedCategoryId":[32],"hideFilters":[32]}],[1,"vviinn-privacy-badge"],[1,"vviinn-teaser"],[1,"image-cropper",{"disabled":[4],"handleMove":[32]}],[1,"vviinn-example-image",{"src":[1],"width":[2],"height":[2],"selected":[32]}],[1,"highlight-box"],[1,"vviinn-detected-object",{"detectedObject":[16],"position":[32]}],[1,"vviinn-modal",{"active":[1540],"slider":[32]}],[1,"vviinn-onboarding-card-1"],[1,"vviinn-onboarding-card-2"],[1,"vviinn-onboarding-card-3"],[1,"vviinn-overlay"],[1,"vviinn-slide"],[1,"vviinn-slider",{"showBullets":[4,"show-bullets"],"position":[514],"showArrows":[4,"show-arrows"],"elementsCount":[32],"internalPosition":[32],"swipeStartPosition":[32]}],[1,"cropper-handler",{"handler":[16],"disabled":[4]}],[1,"vviinn-error"],[1,"vviinn-preloader"],[1,"vviinn-product-card",{"brand":[1],"currency":[1],"deeplink":[1],"image":[1],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"locale":[1],"price":[2],"pricePrefix":[1,"price-prefix"],"productId":[1,"product-id"],"productTitle":[1,"product-title"],"productType":[1,"product-type"],"salePrice":[2,"sale-price"],"responsive":[4],"dimmedBackground":[4,"dimmed-background"],"index":[2],"imageLoaded":[32]}]]],["vviinn-vps-button.cjs",[[1,"vviinn-vps-button",{"token":[1],"currencySign":[1,"currency-sign"],"locale":[1],"campaignId":[1,"campaign-id"],"apiPath":[1,"api-path"],"pressed":[32]},[[0,"modalClosed","handleModalClosed"]]]]],["vviinn-carousel_2.cjs",[[1,"vviinn-vpr-widget",{"blockTitle":[1,"block-title"],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"productId":[1,"product-id"],"token":[1],"currencySign":[1,"currency-sign"],"pricePrefix":[1,"price-prefix"],"mode":[1],"campaignType":[1,"campaign-type"],"locale":[1],"campaigns":[1],"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]}]]],["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"],"campaigns":[1],"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"],"campaigns":[1]}]]]], options);
|
|
21
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
|
@@ -1,28 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
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());
|
|
@@ -1,35 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
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));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { apiGet } from "../network/apiClient";
|
|
2
|
-
import * as O from "fp-ts/Option";
|
|
3
|
-
import { pipe } from "fp-ts/lib/function";
|
|
4
|
-
export const getVCSRecommendations = (productId) => (campaigns) => (options) => {
|
|
5
|
-
const url = pipe(campaigns, O.map(encodeURIComponent), O.match(() => `product/${productId}/cross-selling-products`, (encodedCampaignsIds) => `product/${productId}/cross-selling-products?campaigns=${encodedCampaignsIds}`));
|
|
6
|
-
return apiGet(url, options);
|
|
7
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { apiGet } from "../network/apiClient";
|
|
2
|
-
import * as O from "fp-ts/Option";
|
|
3
|
-
import { pipe } from "fp-ts/lib/function";
|
|
4
|
-
export const getVPRRecommendations = (productId) => (campaigns) => (options) => {
|
|
5
|
-
const url = pipe(campaigns, O.map(encodeURIComponent), O.match(() => `product/${productId}/similar-products`, (encodedCampaignsIds) => `product/${productId}/similar-products?campaigns=${encodedCampaignsIds}`));
|
|
6
|
-
return apiGet(url, options);
|
|
7
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
display: grid;
|
|
3
|
-
position: absolute;
|
|
4
|
-
box-sizing: border-box;
|
|
5
|
-
border: none;
|
|
6
|
-
width: 100%;
|
|
7
|
-
height: 100%;
|
|
8
|
-
-webkit-user-select: none;
|
|
9
|
-
-moz-user-select: none;
|
|
10
|
-
-ms-user-select: none;
|
|
11
|
-
user-select: none;
|
|
12
|
-
|
|
13
|
-
--size: 10px;
|
|
14
|
-
--x-position: 0;
|
|
15
|
-
--y-position: 0;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
img {
|
|
19
|
-
-webkit-user-select: none;
|
|
20
|
-
-moz-user-select: none;
|
|
21
|
-
-ms-user-select: none;
|
|
22
|
-
user-select: none;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.pointer {
|
|
26
|
-
position: absolute;
|
|
27
|
-
width: var(--size);
|
|
28
|
-
height: var(--size);
|
|
29
|
-
background: black;
|
|
30
|
-
border-radius: 50%;
|
|
31
|
-
z-index: 2;
|
|
32
|
-
cursor: pointer;
|
|
33
|
-
transform: translate(var(--x-position), var(--y-position)) scale(0);
|
|
34
|
-
-webkit-animation: 0.25s linear fadein;
|
|
35
|
-
animation: 0.25s linear fadein;
|
|
36
|
-
-webkit-animation-fill-mode: forwards;
|
|
37
|
-
animation-fill-mode: forwards;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.pointer::after {
|
|
41
|
-
content: "";
|
|
42
|
-
cursor: pointer;
|
|
43
|
-
border: 5px solid black;
|
|
44
|
-
border-radius: 50%;
|
|
45
|
-
width: var(--size);
|
|
46
|
-
height: var(--size);
|
|
47
|
-
display: block;
|
|
48
|
-
transform: translate(calc(-50% + var(--size) * 0.5), calc(-50% + var(--size) * 0.5));
|
|
49
|
-
padding: calc(var(--size) * 0.5);
|
|
50
|
-
opacity: .75;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
@-webkit-keyframes fadein {
|
|
54
|
-
from {
|
|
55
|
-
transform: translate(var(--x-position), var(--y-position)) scale(0);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
to {
|
|
59
|
-
transform: translate(var(--x-position), var(--y-position)) scale(1);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
@keyframes fadein {
|
|
64
|
-
from {
|
|
65
|
-
transform: translate(var(--x-position), var(--y-position)) scale(0);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
to {
|
|
69
|
-
transform: translate(var(--x-position), var(--y-position)) scale(1);
|
|
70
|
-
}
|
|
71
|
-
}
|