vviinn-widgets 2.5.0 → 2.5.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-176539c8.js +331 -0
- package/dist/{vviinn-widgets/app-globals-4fe0376b.js → cjs/app-globals-d15b4c2c.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-5dbf778c.js → cjs/customized-slots-0c0d0665.js} +6 -3
- package/dist/cjs/highlight-box_22.cjs.entry.js +747 -0
- package/{www/build/imageSearch.store-3204bc99.js → dist/cjs/imageSearch.store-865c23f4.js} +11902 -11653
- package/{www/build/index-89e62050.js → dist/cjs/index-0eb3036a.js} +76 -698
- package/dist/cjs/index-0f5516a6.js +1354 -0
- package/dist/cjs/index-31b9cb7a.js +39 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +23 -0
- package/dist/cjs/vviinn-carousel_3.cjs.entry.js +1174 -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/{www/build/vviinn-recommendations-sidebar.entry.js → dist/cjs/vviinn-recommendations-sidebar.cjs.entry.js} +12 -8
- package/dist/{vviinn-widgets/vviinn-vpr-button.entry.js → cjs/vviinn-vpr-button.cjs.entry.js} +9 -5
- 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} +51 -49
- 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/{www/build/image-cropper.entry.js → dist/collection/components/image-search/image-view/image-cropper/image-cropper.js} +70 -33
- package/dist/collection/components/image-search/search-filters/search-filters.css +120 -0
- package/dist/collection/components/image-search/search-filters/search-filters.js +125 -0
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.css +142 -0
- package/{www/build/vviinn-carousel.entry.js → dist/collection/components/vviinn-carousel/vviinn-carousel.js} +113 -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-bbcd6be9.js → collection/components/vviinn-icons/index.js} +11 -14
- 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 +100 -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/stories/args.js +73 -0
- package/dist/collection/components/vviinn-product-card/stories/decorators.js +51 -0
- package/dist/collection/components/vviinn-product-card/stories/vviinn-product-card.stories.js +105 -0
- package/dist/collection/components/vviinn-product-card/vviinn-product-card.css +95 -0
- package/dist/collection/components/vviinn-product-card/vviinn-product-card.js +462 -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/args.js +207 -0
- package/dist/collection/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.js +89 -0
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.css +35 -0
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +156 -0
- package/dist/collection/components/vviinn-vpr-widget/stories/args.js +190 -0
- package/dist/collection/components/vviinn-vpr-widget/stories/decorators.js +29 -0
- package/dist/collection/components/vviinn-vpr-widget/stories/vviinn-vpr-widget.stories.js +212 -0
- package/dist/collection/components/vviinn-vpr-widget/token-helpers.js +11 -0
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +483 -0
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-widget.css +79 -0
- package/dist/collection/components/vviinn-vps-button/stories/vviinn-vps-button.stories.js +31 -0
- package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.css +3 -0
- package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +178 -0
- package/dist/collection/components/vviinn-vps-widget/stories/vviinn-vps-widget.stories.js +33 -0
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.css +350 -0
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +352 -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/openApi/index.js +27 -0
- package/dist/collection/recommendation/events.js +1 -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 +3 -0
- package/dist/collection/store/tracking.store.js +3 -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/tracking/event.js +3 -0
- package/dist/collection/tracking/filter.js +5 -0
- package/dist/collection/tracking/index.js +13 -0
- package/dist/collection/tracking/models.js +6 -0
- package/dist/collection/tracking/product.js +18 -0
- package/dist/collection/tracking/search.js +5 -0
- package/dist/collection/tracking/widget.js +10 -0
- package/dist/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-f9b8735c.js +309 -0
- package/{www/build/app-globals-4fe0376b.js → dist/esm/app-globals-6f6aa89e.js} +10 -922
- package/dist/{vviinn-widgets → esm}/cropper-handler.entry.js +2 -2
- package/{www/build/customized-slots-5dbf778c.js → dist/esm/customized-slots-6b427dda.js} +1 -1
- package/dist/esm/highlight-box_22.entry.js +722 -0
- package/dist/{vviinn-widgets/imageSearch.store-3204bc99.js → esm/imageSearch.store-0ae87235.js} +12070 -11855
- package/dist/{vviinn-widgets/index-89e62050.js → esm/index-2e296af4.js} +6 -639
- package/dist/esm/index-59f44eaa.js +1323 -0
- package/{www/build/index-bbcd6be9.js → dist/esm/index-ac05c460.js} +2 -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_3.entry.js +1168 -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-recommendations-sidebar.entry.js +2 -2
- package/{www/build → dist/esm}/vviinn-vpr-button.entry.js +2 -2
- package/dist/{vviinn-widgets → esm}/vviinn-vps-button.entry.js +3 -3
- package/dist/{vviinn-widgets → esm}/vviinn-vps-widget.entry.js +12 -14
- 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-vpr-widget/vviinn-vpr-vidget.d.ts +1 -1
- package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +1 -1
- package/dist/vviinn-widgets/index.esm.js +0 -1
- package/dist/vviinn-widgets/p-118ac907.js +1 -0
- package/dist/vviinn-widgets/p-11f61564.js +1 -0
- package/dist/vviinn-widgets/p-39fdc5c9.entry.js +1 -0
- package/dist/vviinn-widgets/p-762dc067.entry.js +1 -0
- package/dist/vviinn-widgets/p-7e2f542c.js +1 -0
- package/dist/vviinn-widgets/p-8d56e795.entry.js +1 -0
- package/dist/vviinn-widgets/p-8f955b15.entry.js +1 -0
- package/dist/vviinn-widgets/p-9654fe35.entry.js +1 -0
- package/dist/vviinn-widgets/p-9e5adc42.js +1 -0
- package/dist/vviinn-widgets/p-b3731705.entry.js +1 -0
- package/dist/vviinn-widgets/p-bad1809f.js +1 -0
- package/dist/vviinn-widgets/p-c36546fa.js +15 -0
- package/dist/vviinn-widgets/p-d991330b.entry.js +1 -0
- package/dist/vviinn-widgets/p-da9c933b.entry.js +1 -0
- package/dist/vviinn-widgets/p-ee46fc83.js +1 -0
- package/dist/vviinn-widgets/p-f41e25f0.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 +1 -1
- package/www/build/index.esm.js +0 -1
- package/www/build/p-118ac907.js +1 -0
- package/www/build/p-11f61564.js +1 -0
- package/www/build/p-39fdc5c9.entry.js +1 -0
- package/www/build/p-762dc067.entry.js +1 -0
- package/www/build/p-7e2f542c.js +1 -0
- package/www/build/p-8d56e795.entry.js +1 -0
- package/www/build/p-8f955b15.entry.js +1 -0
- package/www/build/p-9654fe35.entry.js +1 -0
- package/www/build/p-9e5adc42.js +1 -0
- package/www/build/p-a67898be.css +1 -0
- package/www/build/p-b3731705.entry.js +1 -0
- package/www/build/p-bad1809f.js +1 -0
- package/www/build/p-c36546fa.js +15 -0
- package/www/build/p-cfd998c1.js +1 -0
- package/www/build/p-d991330b.entry.js +1 -0
- package/www/build/p-da9c933b.entry.js +1 -0
- package/www/build/p-ee46fc83.js +1 -0
- package/www/build/p-f41e25f0.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 +1 -12
- package/dist/vviinn-widgets/Array-c4dc02db.js +0 -4295
- package/dist/vviinn-widgets/Handler-47db9890.js +0 -1428
- package/dist/vviinn-widgets/NonEmptyArray-65395d97.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/image-cropper.entry.js +0 -118
- package/dist/vviinn-widgets/index-c8128606.js +0 -3010
- package/dist/vviinn-widgets/number-a80a4b3c.js +0 -1533
- package/dist/vviinn-widgets/search-filters.entry.js +0 -76
- package/dist/vviinn-widgets/shadow-css-c1fdfa9f.js +0 -389
- package/dist/vviinn-widgets/vviinn-carousel.entry.js +0 -210
- package/dist/vviinn-widgets/vviinn-detected-object.entry.js +0 -54
- 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 -184
- 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 -4581
- package/dist/vviinn-widgets/vviinn-wrong-format.entry.js +0 -16
- package/www/build/Array-c4dc02db.js +0 -4295
- package/www/build/Handler-47db9890.js +0 -1428
- package/www/build/NonEmptyArray-65395d97.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/index-c8128606.js +0 -3010
- package/www/build/number-a80a4b3c.js +0 -1533
- package/www/build/search-filters.entry.js +0 -76
- package/www/build/shadow-css-c1fdfa9f.js +0 -389
- package/www/build/vviinn-detected-object.entry.js +0 -54
- 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 -184
- 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 -4581
- package/www/build/vviinn-vps-button.entry.js +0 -39
- package/www/build/vviinn-wrong-format.entry.js +0 -16
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { Component, Host, h, State, Prop, Element, Watch, Listen, } from "@stencil/core";
|
|
2
|
+
import { state } from "../../store/store";
|
|
3
|
+
import { imageSearchState } from "../../store/imageSearch.store";
|
|
4
|
+
import * as O from "fp-ts/lib/Option";
|
|
5
|
+
import { slotChangeListener } from "../customized-slots";
|
|
6
|
+
import { v4 as uuidv4 } from "uuid";
|
|
7
|
+
import { createTrackingApi } from "../../openApi";
|
|
8
|
+
import { createFilterEvent, createProductClickVpsEvent, createProductViewVpsEvent, createSearchEvent, createWidgetVpsEvent, } from "../../tracking";
|
|
9
|
+
/**
|
|
10
|
+
* @prop --color-primary: color used for action button, slider bullets and selected detected object;
|
|
11
|
+
*
|
|
12
|
+
* @part close-button - close button on modal header.
|
|
13
|
+
* @part secondary-action - back button on modal header.
|
|
14
|
+
* @part title - modal window title.
|
|
15
|
+
*
|
|
16
|
+
* @part select-image_button
|
|
17
|
+
*
|
|
18
|
+
* @part product-card - product card.
|
|
19
|
+
* @part product-card_brand - product card brand.
|
|
20
|
+
* @part product-card_currency - currency sign. Renders after price-amount inside product card.
|
|
21
|
+
* @part product-card_deeplink - anchor element for title. Rendered only if "deeplink" property filled.
|
|
22
|
+
* @part product-card_image - product image inside product card.
|
|
23
|
+
* @part product-card_image-link - anchor element for image. Rendered only if "deeplink" property filled.
|
|
24
|
+
* @part product-card_price-amount - numeric part of price inside product card.
|
|
25
|
+
* @part product-card_price-container - block contains all prices inside product card.
|
|
26
|
+
* @part product-card_price-outdated - renders inside price-container when "sale-price" property filled. Contains regular price.
|
|
27
|
+
* @part product-card_price-prefix - renders before price-amount. Can be set with "price-prefix" property or inherited from parent component.
|
|
28
|
+
* @part product-card_price-regular - renders inside price-container when "sale-price" property is empty.
|
|
29
|
+
* @part product-card_price-sale - renders inside price-container when "sale-price" property filled. Contains sale price.
|
|
30
|
+
* @part product-card_title - product title
|
|
31
|
+
* @part example-images - example images block
|
|
32
|
+
*/
|
|
33
|
+
export class VviinnVpsWidget {
|
|
34
|
+
constructor() {
|
|
35
|
+
/** @internal */
|
|
36
|
+
this.apiPath = "https://api.vviinn.com";
|
|
37
|
+
/** When true modal window with widget will be shown */
|
|
38
|
+
this.active = false;
|
|
39
|
+
/** Currency sign will shown after price */
|
|
40
|
+
this.currencySign = "€";
|
|
41
|
+
/** Locale for currency formatting */
|
|
42
|
+
this.locale = "de-DE";
|
|
43
|
+
this.slidePosition = 0;
|
|
44
|
+
this.width = 0;
|
|
45
|
+
this.wrongImageFormat = false;
|
|
46
|
+
this.imageSource = null;
|
|
47
|
+
}
|
|
48
|
+
activeWatcher(value) {
|
|
49
|
+
if (value) {
|
|
50
|
+
this.overflow = document.body.style.overflow;
|
|
51
|
+
document.body.style.overflow = "hidden";
|
|
52
|
+
this.trackOpenEvent();
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
document.body.style.overflow = this.overflow;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
trackRecommendationView({ detail }) {
|
|
59
|
+
const recommendationViewEvent = createProductViewVpsEvent(Object.assign({ session_id: this.uiSessionId }, detail));
|
|
60
|
+
this.trackingApi.trackEvent(recommendationViewEvent);
|
|
61
|
+
}
|
|
62
|
+
trackRecommendationClick({ detail }) {
|
|
63
|
+
const recommendationClickEvent = createProductClickVpsEvent(Object.assign({ sessionId: this.uiSessionId }, detail));
|
|
64
|
+
this.trackingApi.trackEvent(recommendationClickEvent).finally(() => {
|
|
65
|
+
const product = imageSearchState.results.find((r) => r.productId === detail.product);
|
|
66
|
+
if (!product || !product.deeplink)
|
|
67
|
+
return;
|
|
68
|
+
window.location.href = product.deeplink;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
trachSearchAreaChanges() {
|
|
72
|
+
const searchEvent = createSearchEvent({
|
|
73
|
+
session_id: this.uiSessionId,
|
|
74
|
+
source: this.imageSource,
|
|
75
|
+
search_area: "manual-selection",
|
|
76
|
+
});
|
|
77
|
+
this.trackingApi.trackEvent(searchEvent);
|
|
78
|
+
}
|
|
79
|
+
trackDetectedObject() {
|
|
80
|
+
const searchEvent = createSearchEvent({
|
|
81
|
+
session_id: this.uiSessionId,
|
|
82
|
+
source: this.imageSource,
|
|
83
|
+
search_area: "attention-point",
|
|
84
|
+
});
|
|
85
|
+
this.trackingApi.trackEvent(searchEvent);
|
|
86
|
+
}
|
|
87
|
+
trackFilter({ detail }) {
|
|
88
|
+
const searchEvent = createFilterEvent({
|
|
89
|
+
session_id: this.uiSessionId,
|
|
90
|
+
source: this.imageSource,
|
|
91
|
+
kind: "category",
|
|
92
|
+
action: detail,
|
|
93
|
+
});
|
|
94
|
+
this.trackingApi.trackEvent(searchEvent);
|
|
95
|
+
}
|
|
96
|
+
componentWillLoad() {
|
|
97
|
+
slotChangeListener(this, this.el);
|
|
98
|
+
}
|
|
99
|
+
connectedCallback() {
|
|
100
|
+
state.apiPath = this.apiPath;
|
|
101
|
+
state.currencySign = this.currencySign;
|
|
102
|
+
state.locale = this.locale;
|
|
103
|
+
imageSearchState.token = this.token;
|
|
104
|
+
this.uiSessionId = uuidv4();
|
|
105
|
+
}
|
|
106
|
+
trackOpenEvent() {
|
|
107
|
+
this.trackingApi = createTrackingApi(this.apiPath, this.token);
|
|
108
|
+
const widgetOpenEvent = createWidgetVpsEvent({
|
|
109
|
+
action: "open",
|
|
110
|
+
session_id: this.uiSessionId,
|
|
111
|
+
});
|
|
112
|
+
this.trackingApi.trackEvent(widgetOpenEvent);
|
|
113
|
+
}
|
|
114
|
+
handleImageSelection(source) {
|
|
115
|
+
this.imageSource = source;
|
|
116
|
+
this.slidePosition = 1;
|
|
117
|
+
const root = this.el.shadowRoot.querySelector("vviinn-overlayed-modal");
|
|
118
|
+
const overlay = root.shadowRoot.querySelector("vviinn-overlay");
|
|
119
|
+
const modal = overlay.querySelector("vviinn-modal");
|
|
120
|
+
const modalBody = modal.shadowRoot.querySelector(".body");
|
|
121
|
+
modalBody.scrollTop = 0;
|
|
122
|
+
this.trackInitialSearch();
|
|
123
|
+
}
|
|
124
|
+
trackInitialSearch() {
|
|
125
|
+
const searchEvent = createSearchEvent({
|
|
126
|
+
session_id: this.uiSessionId,
|
|
127
|
+
source: this.imageSource,
|
|
128
|
+
search_area: "full",
|
|
129
|
+
});
|
|
130
|
+
this.trackingApi.trackEvent(searchEvent);
|
|
131
|
+
}
|
|
132
|
+
resetState() {
|
|
133
|
+
this.resetScroll("onboarding-block");
|
|
134
|
+
this.slidePosition = 0;
|
|
135
|
+
imageSearchState.image = O.none;
|
|
136
|
+
imageSearchState.imageUrl = O.none;
|
|
137
|
+
imageSearchState.imageBounds = O.none;
|
|
138
|
+
imageSearchState.searchArea = O.none;
|
|
139
|
+
imageSearchState.results = [];
|
|
140
|
+
imageSearchState.filters = [];
|
|
141
|
+
imageSearchState.detectedObjects = [];
|
|
142
|
+
imageSearchState.activeIonLink = undefined;
|
|
143
|
+
imageSearchState.rectangleSearchForm = undefined;
|
|
144
|
+
this.resetScroll("results-block");
|
|
145
|
+
}
|
|
146
|
+
haveErrors() {
|
|
147
|
+
return this.wrongImageFormat || imageSearchState.serverError;
|
|
148
|
+
}
|
|
149
|
+
resetScroll(elementId, behavior = "auto") {
|
|
150
|
+
const element = this.el.shadowRoot.getElementById(elementId);
|
|
151
|
+
element.scroll({ top: 0, left: 0, behavior });
|
|
152
|
+
}
|
|
153
|
+
handleModalClose() {
|
|
154
|
+
this.active = false;
|
|
155
|
+
this.resetState();
|
|
156
|
+
const elementsToReset = ["onboarding-block", "results-block"];
|
|
157
|
+
elementsToReset.forEach((name) => this.resetScroll(name));
|
|
158
|
+
const widgetOpenEvent = createWidgetVpsEvent({
|
|
159
|
+
action: "close",
|
|
160
|
+
session_id: this.uiSessionId,
|
|
161
|
+
});
|
|
162
|
+
this.trackingApi.trackEvent(widgetOpenEvent);
|
|
163
|
+
}
|
|
164
|
+
render() {
|
|
165
|
+
return (h(Host, null,
|
|
166
|
+
h("vviinn-overlayed-modal", { class: { "first-screen": this.slidePosition === 0 }, active: this.active, onSecondaryActionClicked: () => this.resetState(), onModalClosed: () => this.handleModalClose(), exportparts: "secondary-action, title, close-button, example-images" },
|
|
167
|
+
h("vviinn-slider", { showBullets: false, position: this.slidePosition },
|
|
168
|
+
h("vviinn-slide", { class: { "start-page": true } },
|
|
169
|
+
h("div", { class: {
|
|
170
|
+
error: this.haveErrors(),
|
|
171
|
+
"start-page_block": true,
|
|
172
|
+
} },
|
|
173
|
+
h("vviinn-wrong-format", { class: { hidden: !this.wrongImageFormat }, onActionClick: () => (this.wrongImageFormat = false) }),
|
|
174
|
+
h("vviinn-server-error", { class: { hidden: !imageSearchState.serverError }, onActionClick: () => (imageSearchState.serverError = false) }),
|
|
175
|
+
h("vviinn-teaser", { class: { hidden: this.haveErrors() } }),
|
|
176
|
+
h("vviinn-image-selector", { class: { hidden: this.haveErrors() }, onImageSelected: () => this.handleImageSelection("upload"), onImageSelectedError: () => (this.wrongImageFormat = true), part: "select-image_button" },
|
|
177
|
+
h("span", { slot: "upload-button-text", class: "upload-button-content" },
|
|
178
|
+
h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "29", height: "28", fill: "none" },
|
|
179
|
+
h("defs", null),
|
|
180
|
+
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" }),
|
|
181
|
+
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" })),
|
|
182
|
+
h("slot", { name: "vviinn-image-upload-button-text" },
|
|
183
|
+
h("span", null, "Kamera oder Bild ausw\u00E4hlen")))),
|
|
184
|
+
h("vviinn-privacy-badge", { class: { hidden: this.haveErrors() } })),
|
|
185
|
+
h("div", { id: "onboarding-block", class: "start-page_block" },
|
|
186
|
+
h("div", { class: "onboarding-wrapper" },
|
|
187
|
+
h("vviinn-onboarding", null),
|
|
188
|
+
h("vviinn-example-images", { part: "example-images", onImageSelected: () => this.handleImageSelection("example"), onImageSelectedError: () => this.resetScroll("onboarding-block", "smooth") })))),
|
|
189
|
+
h("vviinn-slide", { class: { "results-page": true, active: this.slidePosition == 1 } },
|
|
190
|
+
h("div", { class: "image-wrapper" },
|
|
191
|
+
h("vviinn-image-view", null),
|
|
192
|
+
h("div", { class: "filters-wrapper" },
|
|
193
|
+
h("div", { class: "filters" }, imageSearchState.filters.map((filter) => (h("search-filters", { filter: filter })))))),
|
|
194
|
+
h("div", { id: "results-block", class: "products-wrapper" },
|
|
195
|
+
h("div", { class: {
|
|
196
|
+
"nothing-found": true,
|
|
197
|
+
hidden: imageSearchState.results.length > 0,
|
|
198
|
+
} },
|
|
199
|
+
h("vviinn-empty-results", null),
|
|
200
|
+
h("vviinn-onboarding", null)),
|
|
201
|
+
h("div", { class: {
|
|
202
|
+
hidden: imageSearchState.results.length <= 0,
|
|
203
|
+
products: true,
|
|
204
|
+
} }, imageSearchState.results.map((p, i) => {
|
|
205
|
+
var _a;
|
|
206
|
+
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", index: i }));
|
|
207
|
+
}))))))));
|
|
208
|
+
}
|
|
209
|
+
static get is() { return "vviinn-vps-widget"; }
|
|
210
|
+
static get encapsulation() { return "shadow"; }
|
|
211
|
+
static get originalStyleUrls() { return {
|
|
212
|
+
"$": ["vviinn-vps-widget.css"]
|
|
213
|
+
}; }
|
|
214
|
+
static get styleUrls() { return {
|
|
215
|
+
"$": ["vviinn-vps-widget.css"]
|
|
216
|
+
}; }
|
|
217
|
+
static get properties() { return {
|
|
218
|
+
"token": {
|
|
219
|
+
"type": "string",
|
|
220
|
+
"mutable": false,
|
|
221
|
+
"complexType": {
|
|
222
|
+
"original": "string | undefined",
|
|
223
|
+
"resolved": "string",
|
|
224
|
+
"references": {}
|
|
225
|
+
},
|
|
226
|
+
"required": false,
|
|
227
|
+
"optional": false,
|
|
228
|
+
"docs": {
|
|
229
|
+
"tags": [],
|
|
230
|
+
"text": "vviinn customer token"
|
|
231
|
+
},
|
|
232
|
+
"attribute": "token",
|
|
233
|
+
"reflect": false
|
|
234
|
+
},
|
|
235
|
+
"apiPath": {
|
|
236
|
+
"type": "string",
|
|
237
|
+
"mutable": false,
|
|
238
|
+
"complexType": {
|
|
239
|
+
"original": "string",
|
|
240
|
+
"resolved": "string",
|
|
241
|
+
"references": {}
|
|
242
|
+
},
|
|
243
|
+
"required": false,
|
|
244
|
+
"optional": false,
|
|
245
|
+
"docs": {
|
|
246
|
+
"tags": [{
|
|
247
|
+
"text": undefined,
|
|
248
|
+
"name": "internal"
|
|
249
|
+
}],
|
|
250
|
+
"text": ""
|
|
251
|
+
},
|
|
252
|
+
"attribute": "api-path",
|
|
253
|
+
"reflect": false,
|
|
254
|
+
"defaultValue": "\"https://api.vviinn.com\""
|
|
255
|
+
},
|
|
256
|
+
"active": {
|
|
257
|
+
"type": "boolean",
|
|
258
|
+
"mutable": true,
|
|
259
|
+
"complexType": {
|
|
260
|
+
"original": "boolean",
|
|
261
|
+
"resolved": "boolean",
|
|
262
|
+
"references": {}
|
|
263
|
+
},
|
|
264
|
+
"required": false,
|
|
265
|
+
"optional": false,
|
|
266
|
+
"docs": {
|
|
267
|
+
"tags": [],
|
|
268
|
+
"text": "When true modal window with widget will be shown"
|
|
269
|
+
},
|
|
270
|
+
"attribute": "active",
|
|
271
|
+
"reflect": false,
|
|
272
|
+
"defaultValue": "false"
|
|
273
|
+
},
|
|
274
|
+
"currencySign": {
|
|
275
|
+
"type": "string",
|
|
276
|
+
"mutable": false,
|
|
277
|
+
"complexType": {
|
|
278
|
+
"original": "string",
|
|
279
|
+
"resolved": "string",
|
|
280
|
+
"references": {}
|
|
281
|
+
},
|
|
282
|
+
"required": false,
|
|
283
|
+
"optional": false,
|
|
284
|
+
"docs": {
|
|
285
|
+
"tags": [],
|
|
286
|
+
"text": "Currency sign will shown after price"
|
|
287
|
+
},
|
|
288
|
+
"attribute": "currency-sign",
|
|
289
|
+
"reflect": false,
|
|
290
|
+
"defaultValue": "\"\u20AC\""
|
|
291
|
+
},
|
|
292
|
+
"locale": {
|
|
293
|
+
"type": "string",
|
|
294
|
+
"mutable": false,
|
|
295
|
+
"complexType": {
|
|
296
|
+
"original": "string",
|
|
297
|
+
"resolved": "string",
|
|
298
|
+
"references": {}
|
|
299
|
+
},
|
|
300
|
+
"required": false,
|
|
301
|
+
"optional": false,
|
|
302
|
+
"docs": {
|
|
303
|
+
"tags": [],
|
|
304
|
+
"text": "Locale for currency formatting"
|
|
305
|
+
},
|
|
306
|
+
"attribute": "locale",
|
|
307
|
+
"reflect": false,
|
|
308
|
+
"defaultValue": "\"de-DE\""
|
|
309
|
+
}
|
|
310
|
+
}; }
|
|
311
|
+
static get states() { return {
|
|
312
|
+
"slidePosition": {},
|
|
313
|
+
"width": {},
|
|
314
|
+
"wrongImageFormat": {}
|
|
315
|
+
}; }
|
|
316
|
+
static get elementRef() { return "el"; }
|
|
317
|
+
static get watchers() { return [{
|
|
318
|
+
"propName": "active",
|
|
319
|
+
"methodName": "activeWatcher"
|
|
320
|
+
}]; }
|
|
321
|
+
static get listeners() { return [{
|
|
322
|
+
"name": "recommendationView",
|
|
323
|
+
"method": "trackRecommendationView",
|
|
324
|
+
"target": undefined,
|
|
325
|
+
"capture": false,
|
|
326
|
+
"passive": false
|
|
327
|
+
}, {
|
|
328
|
+
"name": "recommendationClick",
|
|
329
|
+
"method": "trackRecommendationClick",
|
|
330
|
+
"target": undefined,
|
|
331
|
+
"capture": false,
|
|
332
|
+
"passive": false
|
|
333
|
+
}, {
|
|
334
|
+
"name": "cropperChanged",
|
|
335
|
+
"method": "trachSearchAreaChanges",
|
|
336
|
+
"target": undefined,
|
|
337
|
+
"capture": false,
|
|
338
|
+
"passive": false
|
|
339
|
+
}, {
|
|
340
|
+
"name": "detectedObjectClicked",
|
|
341
|
+
"method": "trackDetectedObject",
|
|
342
|
+
"target": undefined,
|
|
343
|
+
"capture": false,
|
|
344
|
+
"passive": false
|
|
345
|
+
}, {
|
|
346
|
+
"name": "filterSelected",
|
|
347
|
+
"method": "trackFilter",
|
|
348
|
+
"target": undefined,
|
|
349
|
+
"capture": false,
|
|
350
|
+
"passive": false
|
|
351
|
+
}]; }
|
|
352
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as Point from "../geometry/Point";
|
|
2
|
+
export var HandlerDirection;
|
|
3
|
+
(function (HandlerDirection) {
|
|
4
|
+
HandlerDirection[HandlerDirection["East"] = 0] = "East";
|
|
5
|
+
HandlerDirection[HandlerDirection["North"] = 1] = "North";
|
|
6
|
+
HandlerDirection[HandlerDirection["NorthEast"] = 2] = "NorthEast";
|
|
7
|
+
HandlerDirection[HandlerDirection["NorthWest"] = 3] = "NorthWest";
|
|
8
|
+
HandlerDirection[HandlerDirection["South"] = 4] = "South";
|
|
9
|
+
HandlerDirection[HandlerDirection["SouthEast"] = 5] = "SouthEast";
|
|
10
|
+
HandlerDirection[HandlerDirection["SouthWest"] = 6] = "SouthWest";
|
|
11
|
+
HandlerDirection[HandlerDirection["West"] = 7] = "West";
|
|
12
|
+
})(HandlerDirection || (HandlerDirection = {}));
|
|
13
|
+
export const getCursorValue = (direction) => {
|
|
14
|
+
switch (direction) {
|
|
15
|
+
case HandlerDirection.East:
|
|
16
|
+
return "e-resize";
|
|
17
|
+
case HandlerDirection.North:
|
|
18
|
+
return "n-resize";
|
|
19
|
+
case HandlerDirection.NorthEast:
|
|
20
|
+
return "ne-resize";
|
|
21
|
+
case HandlerDirection.NorthWest:
|
|
22
|
+
return "nw-resize";
|
|
23
|
+
case HandlerDirection.South:
|
|
24
|
+
return "s-resize";
|
|
25
|
+
case HandlerDirection.SouthEast:
|
|
26
|
+
return "se-resize";
|
|
27
|
+
case HandlerDirection.SouthWest:
|
|
28
|
+
return "sw-resize";
|
|
29
|
+
case HandlerDirection.West:
|
|
30
|
+
return "w-resize";
|
|
31
|
+
default:
|
|
32
|
+
return "pointer";
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
export const fromRectangle = (r) => [
|
|
36
|
+
{
|
|
37
|
+
position: Point.fromRectangle(r),
|
|
38
|
+
direction: HandlerDirection.NorthWest,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
position: Point.pointSumSemigroup.concat(Point.fromRectangle(r), {
|
|
42
|
+
x: r.width,
|
|
43
|
+
y: 0,
|
|
44
|
+
}),
|
|
45
|
+
direction: HandlerDirection.NorthEast,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
position: Point.pointSumSemigroup.concat(Point.fromRectangle(r), {
|
|
49
|
+
x: 0,
|
|
50
|
+
y: r.height,
|
|
51
|
+
}),
|
|
52
|
+
direction: HandlerDirection.SouthWest,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
position: Point.pointSumSemigroup.concat(Point.fromRectangle(r), {
|
|
56
|
+
x: r.width,
|
|
57
|
+
y: r.height,
|
|
58
|
+
}),
|
|
59
|
+
direction: HandlerDirection.SouthEast,
|
|
60
|
+
},
|
|
61
|
+
];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const basicErrorFromResponse = (error) => {
|
|
2
|
+
return {
|
|
3
|
+
kind: "server",
|
|
4
|
+
inner: error,
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export const invalidTokenError = {
|
|
8
|
+
kind: "client",
|
|
9
|
+
inner: "Token not exist or empty",
|
|
10
|
+
};
|
|
11
|
+
export const emptyApiPathError = {
|
|
12
|
+
kind: "client",
|
|
13
|
+
inner: "Api path empty or missing",
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const fromRectangle = (shape, target) => {
|
|
2
|
+
const top = `${shape.y}px`;
|
|
3
|
+
const left = `${shape.x}px`;
|
|
4
|
+
const right = `${target.width - (shape.x + shape.width)}px`;
|
|
5
|
+
const bottom = `${target.height - (shape.y + shape.height)}px`;
|
|
6
|
+
return {
|
|
7
|
+
top,
|
|
8
|
+
right,
|
|
9
|
+
bottom,
|
|
10
|
+
left,
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
const printClip = (clip) => `inset(${clip.top} ${clip.right} ${clip.bottom} ${clip.left})`;
|
|
14
|
+
export const getClipValue = (shape, target) => printClip(fromRectangle(shape, target));
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { semigroupSum, semigroupProduct, struct } from "fp-ts/Semigroup";
|
|
2
|
+
import { semigroupDiff } from "../utils/semigroup/semigroupDiff";
|
|
3
|
+
export const fromRectangle = ({ x, y }) => {
|
|
4
|
+
return {
|
|
5
|
+
x,
|
|
6
|
+
y,
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export const fromMouseEvent = ({ clientX, clientY }) => {
|
|
10
|
+
return {
|
|
11
|
+
x: clientX,
|
|
12
|
+
y: clientY,
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export const fromTouchEvent = ({ touches }) => {
|
|
16
|
+
return {
|
|
17
|
+
x: touches[0].clientX,
|
|
18
|
+
y: touches[0].clientY,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export const pointDiffSemigroup = struct({
|
|
22
|
+
x: semigroupDiff,
|
|
23
|
+
y: semigroupDiff,
|
|
24
|
+
});
|
|
25
|
+
export const pointSumSemigroup = struct({
|
|
26
|
+
x: semigroupSum,
|
|
27
|
+
y: semigroupSum,
|
|
28
|
+
});
|
|
29
|
+
export const pointProductSemigroup = struct({
|
|
30
|
+
x: semigroupProduct,
|
|
31
|
+
y: semigroupProduct,
|
|
32
|
+
});
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { fromRectangle, pointSumSemigroup, pointProductSemigroup, } from "./Point";
|
|
2
|
+
import { HandlerDirection } from "../cropper/Handler";
|
|
3
|
+
import { sizedDivSemigroup } from "./Sized";
|
|
4
|
+
export const move = (origin, position) => {
|
|
5
|
+
const originPosition = fromRectangle(origin);
|
|
6
|
+
const newPosition = pointSumSemigroup.concat(originPosition, position);
|
|
7
|
+
return Object.assign(Object.assign({}, newPosition), { width: origin.width, height: origin.height });
|
|
8
|
+
};
|
|
9
|
+
const transformNorthEast = (origin, handler) => {
|
|
10
|
+
const newPosition = pointSumSemigroup.concat(fromRectangle(origin), {
|
|
11
|
+
x: 0,
|
|
12
|
+
y: handler.position.y,
|
|
13
|
+
});
|
|
14
|
+
return Object.assign(Object.assign({}, newPosition), { width: origin.width + handler.position.x, height: origin.height - handler.position.y });
|
|
15
|
+
};
|
|
16
|
+
export const transformNorthWest = (origin, handler) => {
|
|
17
|
+
const newPosition = pointSumSemigroup.concat(fromRectangle(origin), handler.position);
|
|
18
|
+
return Object.assign(Object.assign({}, newPosition), { width: origin.width - handler.position.x, height: origin.height - handler.position.y });
|
|
19
|
+
};
|
|
20
|
+
const transformSouthEast = (origin, handler) => {
|
|
21
|
+
return Object.assign(Object.assign({}, origin), { width: origin.width + handler.position.x, height: origin.height + handler.position.y });
|
|
22
|
+
};
|
|
23
|
+
const transformSouthWest = (origin, handler) => {
|
|
24
|
+
const newPosition = pointSumSemigroup.concat(fromRectangle(origin), {
|
|
25
|
+
x: handler.position.x,
|
|
26
|
+
y: 0,
|
|
27
|
+
});
|
|
28
|
+
return Object.assign(Object.assign({}, newPosition), { width: origin.width - handler.position.x, height: origin.height + handler.position.y });
|
|
29
|
+
};
|
|
30
|
+
export const transform = (origin, handler) => {
|
|
31
|
+
switch (handler.direction) {
|
|
32
|
+
case HandlerDirection.NorthEast:
|
|
33
|
+
return transformNorthEast(origin, handler);
|
|
34
|
+
case HandlerDirection.NorthWest:
|
|
35
|
+
return transformNorthWest(origin, handler);
|
|
36
|
+
case HandlerDirection.SouthEast:
|
|
37
|
+
return transformSouthEast(origin, handler);
|
|
38
|
+
case HandlerDirection.SouthWest:
|
|
39
|
+
return transformSouthWest(origin, handler);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
export const fromImage = (image) => {
|
|
43
|
+
return {
|
|
44
|
+
x: 0,
|
|
45
|
+
y: 0,
|
|
46
|
+
width: image.width,
|
|
47
|
+
height: image.height,
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export const fromNaturalImage = (image) => {
|
|
51
|
+
return {
|
|
52
|
+
x: 0,
|
|
53
|
+
y: 0,
|
|
54
|
+
width: image.naturalWidth,
|
|
55
|
+
height: image.naturalHeight,
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export const getScaleRange = (source, target) => {
|
|
59
|
+
const difference = sizedDivSemigroup.concat(target, source);
|
|
60
|
+
return {
|
|
61
|
+
x: difference.width,
|
|
62
|
+
y: difference.height,
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
export const scaleSelection = (source, sourceSelection, target) => {
|
|
66
|
+
const sourcePosition = fromRectangle(source);
|
|
67
|
+
const scale = getScaleRange(source, target);
|
|
68
|
+
const newPosition = pointProductSemigroup.concat(sourcePosition, scale);
|
|
69
|
+
return Object.assign(Object.assign({}, newPosition), { width: sourceSelection.width * scale.x, height: sourceSelection.height * scale.y });
|
|
70
|
+
};
|
|
71
|
+
export const fromAlt = (r) => {
|
|
72
|
+
return Object.assign({ x: r.left, y: r.top }, r);
|
|
73
|
+
};
|
|
74
|
+
export const scaleWithSized = (s) => (r) => {
|
|
75
|
+
return {
|
|
76
|
+
x: r.x * s.width,
|
|
77
|
+
y: r.y * s.height,
|
|
78
|
+
width: r.width * s.width,
|
|
79
|
+
height: r.height * s.height,
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
export const divideOnSized = (s) => (r) => {
|
|
83
|
+
return {
|
|
84
|
+
x: r.x / s.width,
|
|
85
|
+
y: r.y / s.height,
|
|
86
|
+
width: r.width / s.width,
|
|
87
|
+
height: r.height / s.height,
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
export const center = (r) => {
|
|
91
|
+
return {
|
|
92
|
+
x: r.x + r.width * 0.5,
|
|
93
|
+
y: r.y + r.height * 0.5,
|
|
94
|
+
};
|
|
95
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { semigroupDiv } from "../utils/semigroup/semigroupDiff";
|
|
2
|
+
import { getStructSemigroup } from "fp-ts/Semigroup";
|
|
3
|
+
import * as Ord from "fp-ts/Ord";
|
|
4
|
+
export const sizedDivSemigroup = getStructSemigroup({
|
|
5
|
+
width: semigroupDiv,
|
|
6
|
+
height: semigroupDiv,
|
|
7
|
+
});
|
|
8
|
+
export const ordSized = Ord.contramap((s) => s.width * s.height)(Ord.ordNumber);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as Sentry from "@sentry/browser";
|
|
2
|
+
import { Env } from "@stencil/core";
|
|
3
|
+
import { filterInternalExeptions } from "./sentry";
|
|
4
|
+
const setupSentry = () => {
|
|
5
|
+
Sentry.init({
|
|
6
|
+
dsn: "https://70bcf561598b44148bd3cabc7c142a6c@o1015876.ingest.sentry.io/5983034",
|
|
7
|
+
release: `${Env.packageName}@${Env.packageVersion}`,
|
|
8
|
+
environment: Env.environment,
|
|
9
|
+
tracesSampleRate: 0.0,
|
|
10
|
+
maxBreadcrumbs: 4,
|
|
11
|
+
beforeSend: filterInternalExeptions,
|
|
12
|
+
allowUrls: [
|
|
13
|
+
/https?:\/\/cdn\.jsdelivr\.net\/npm\/vviinn-widgets.+/
|
|
14
|
+
]
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
export default function () {
|
|
18
|
+
setupSentry();
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as E from "fp-ts/Either";
|
|
2
|
+
import * as TE from "fp-ts/TaskEither";
|
|
3
|
+
import { pipe } from "fp-ts/function";
|
|
4
|
+
import { sequenceT } from "fp-ts/Apply";
|
|
5
|
+
import { createInitGetRequest, createInitPostRequest, getApiPath, } from "./utils";
|
|
6
|
+
import { makeRequest } from "./request";
|
|
7
|
+
const sequenceToEither = sequenceT(E.Apply);
|
|
8
|
+
export const apiGet = (path, data = {}) => pipe(sequenceToEither(getApiPath(), createInitGetRequest), TE.fromEither, TE.chainW(makeRequest(path, data)));
|
|
9
|
+
export const apiPost = (path, data = {}) => pipe(sequenceToEither(getApiPath(), createInitPostRequest), TE.fromEither, TE.chainW(makeRequest(path, data)));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const fileToB64 = async (f) => new Promise((resolve) => {
|
|
2
|
+
const reader = new FileReader();
|
|
3
|
+
reader.addEventListener("load", () => {
|
|
4
|
+
resolve(reader.result);
|
|
5
|
+
});
|
|
6
|
+
reader.readAsDataURL(f);
|
|
7
|
+
});
|
|
8
|
+
export const fromFile = async (f) => {
|
|
9
|
+
return {
|
|
10
|
+
name: f.name,
|
|
11
|
+
mediaType: f.type,
|
|
12
|
+
value: await fileToB64(f),
|
|
13
|
+
};
|
|
14
|
+
};
|