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,375 +0,0 @@
|
|
|
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 { isEmpty } from "fp-ts/string";
|
|
6
|
-
import { slotChangeListener } from "../customized-slots";
|
|
7
|
-
import { v4 as uuidv4 } from "uuid";
|
|
8
|
-
import { createTrackingApi } from "../../openApi";
|
|
9
|
-
import { createFilterEvent, createProductClickVpsEvent, createProductViewVpsEvent, createSearchEvent, createWidgetVpsEvent, } from "../../tracking";
|
|
10
|
-
import { pipe } from "fp-ts/lib/function";
|
|
11
|
-
const filterInt = (value) => /^[-+]?(\d+|Infinity)$/.test(value) ? Number(value) : NaN;
|
|
12
|
-
const notEmptyString = (s) => !isEmpty(s);
|
|
13
|
-
const notNan = (n) => !isNaN(n);
|
|
14
|
-
/**
|
|
15
|
-
* @prop --color-primary: color used for action button, slider bullets and selected detected object;
|
|
16
|
-
*
|
|
17
|
-
* @part close-button - close button on modal header.
|
|
18
|
-
* @part secondary-action - back button on modal header.
|
|
19
|
-
* @part title - modal window title.
|
|
20
|
-
*
|
|
21
|
-
* @part select-image_button
|
|
22
|
-
*
|
|
23
|
-
* @part product-card - product card.
|
|
24
|
-
* @part product-card_brand - product card brand.
|
|
25
|
-
* @part product-card_currency - currency sign. Renders after price-amount inside product card.
|
|
26
|
-
* @part product-card_deeplink - anchor element for title. Rendered only if "deeplink" property filled.
|
|
27
|
-
* @part product-card_image - product image inside product card.
|
|
28
|
-
* @part product-card_image-link - anchor element for image. Rendered only if "deeplink" property filled.
|
|
29
|
-
* @part product-card_price-amount - numeric part of price inside product card.
|
|
30
|
-
* @part product-card_price-container - block contains all prices inside product card.
|
|
31
|
-
* @part product-card_price-outdated - renders inside price-container when "sale-price" property filled. Contains regular price.
|
|
32
|
-
* @part product-card_price-prefix - renders before price-amount. Can be set with "price-prefix" property or inherited from parent component.
|
|
33
|
-
* @part product-card_price-regular - renders inside price-container when "sale-price" property is empty.
|
|
34
|
-
* @part product-card_price-sale - renders inside price-container when "sale-price" property filled. Contains sale price.
|
|
35
|
-
* @part product-card_title - product title
|
|
36
|
-
* @part example-images - example images block
|
|
37
|
-
*/
|
|
38
|
-
export class VviinnVpsWidget {
|
|
39
|
-
constructor() {
|
|
40
|
-
/** @internal */
|
|
41
|
-
this.apiPath = "https://api.vviinn.com";
|
|
42
|
-
/** When true modal window with widget will be shown */
|
|
43
|
-
this.active = false;
|
|
44
|
-
/** Currency sign will shown after price */
|
|
45
|
-
this.currencySign = "€";
|
|
46
|
-
/** Locale for currency formatting */
|
|
47
|
-
this.locale = "de-DE";
|
|
48
|
-
this.slidePosition = 0;
|
|
49
|
-
this.width = 0;
|
|
50
|
-
this.wrongImageFormat = false;
|
|
51
|
-
this.imageSource = null;
|
|
52
|
-
}
|
|
53
|
-
activeWatcher(value) {
|
|
54
|
-
if (value) {
|
|
55
|
-
this.overflow = document.body.style.overflow;
|
|
56
|
-
document.body.style.overflow = "hidden";
|
|
57
|
-
this.trackOpenEvent();
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
document.body.style.overflow = this.overflow;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
trackRecommendationView({ detail }) {
|
|
64
|
-
const recommendationViewEvent = createProductViewVpsEvent(Object.assign({ session_id: this.uiSessionId }, detail));
|
|
65
|
-
this.trackingApi.trackEvent(recommendationViewEvent);
|
|
66
|
-
}
|
|
67
|
-
trackRecommendationClick({ detail }) {
|
|
68
|
-
const recommendationClickEvent = createProductClickVpsEvent(Object.assign({ session_id: this.uiSessionId }, detail));
|
|
69
|
-
this.trackingApi.trackEvent(recommendationClickEvent).finally(() => {
|
|
70
|
-
const product = imageSearchState.results.find((r) => r.productId === detail.product);
|
|
71
|
-
if (!product || !product.deeplink)
|
|
72
|
-
return;
|
|
73
|
-
window.location.href = product.deeplink;
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
trachSearchAreaChanges() {
|
|
77
|
-
const searchEvent = createSearchEvent({
|
|
78
|
-
session_id: this.uiSessionId,
|
|
79
|
-
source: this.imageSource,
|
|
80
|
-
search_area: "manual-selection",
|
|
81
|
-
});
|
|
82
|
-
this.trackingApi.trackEvent(searchEvent);
|
|
83
|
-
}
|
|
84
|
-
trackDetectedObject() {
|
|
85
|
-
const searchEvent = createSearchEvent({
|
|
86
|
-
session_id: this.uiSessionId,
|
|
87
|
-
source: this.imageSource,
|
|
88
|
-
search_area: "attention-point",
|
|
89
|
-
});
|
|
90
|
-
this.trackingApi.trackEvent(searchEvent);
|
|
91
|
-
}
|
|
92
|
-
trackFilter({ detail }) {
|
|
93
|
-
const searchEvent = createFilterEvent({
|
|
94
|
-
session_id: this.uiSessionId,
|
|
95
|
-
source: this.imageSource,
|
|
96
|
-
kind: "category",
|
|
97
|
-
action: detail,
|
|
98
|
-
});
|
|
99
|
-
this.trackingApi.trackEvent(searchEvent);
|
|
100
|
-
}
|
|
101
|
-
componentWillLoad() {
|
|
102
|
-
slotChangeListener(this, this.el);
|
|
103
|
-
}
|
|
104
|
-
connectedCallback() {
|
|
105
|
-
state.apiPath = this.apiPath;
|
|
106
|
-
state.currencySign = this.currencySign;
|
|
107
|
-
state.locale = this.locale;
|
|
108
|
-
imageSearchState.token = this.token;
|
|
109
|
-
imageSearchState.campaignId = pipe(this.campaignId, O.fromNullable, O.chain(O.fromPredicate(notEmptyString)), O.map(filterInt), O.chain(O.fromPredicate(notNan)), O.map((s) => `${s}`));
|
|
110
|
-
this.uiSessionId = uuidv4();
|
|
111
|
-
this.trackingApi = createTrackingApi(this.apiPath, this.token);
|
|
112
|
-
}
|
|
113
|
-
trackOpenEvent() {
|
|
114
|
-
const widgetOpenEvent = createWidgetVpsEvent({
|
|
115
|
-
action: "open",
|
|
116
|
-
session_id: this.uiSessionId,
|
|
117
|
-
});
|
|
118
|
-
this.trackingApi.trackEvent(widgetOpenEvent);
|
|
119
|
-
}
|
|
120
|
-
handleImageSelection(source) {
|
|
121
|
-
this.imageSource = source;
|
|
122
|
-
this.slidePosition = 1;
|
|
123
|
-
const root = this.el.shadowRoot.querySelector("vviinn-overlayed-modal");
|
|
124
|
-
const overlay = root.shadowRoot.querySelector("vviinn-overlay");
|
|
125
|
-
const modal = overlay.querySelector("vviinn-modal");
|
|
126
|
-
const modalBody = modal.shadowRoot.querySelector(".body");
|
|
127
|
-
modalBody.scrollTop = 0;
|
|
128
|
-
this.trackInitialSearch();
|
|
129
|
-
}
|
|
130
|
-
trackInitialSearch() {
|
|
131
|
-
const searchEvent = createSearchEvent({
|
|
132
|
-
session_id: this.uiSessionId,
|
|
133
|
-
source: this.imageSource,
|
|
134
|
-
search_area: "full",
|
|
135
|
-
});
|
|
136
|
-
this.trackingApi.trackEvent(searchEvent);
|
|
137
|
-
}
|
|
138
|
-
resetState() {
|
|
139
|
-
this.resetScroll("onboarding-block");
|
|
140
|
-
this.slidePosition = 0;
|
|
141
|
-
imageSearchState.image = O.none;
|
|
142
|
-
imageSearchState.imageUrl = O.none;
|
|
143
|
-
imageSearchState.imageBounds = O.none;
|
|
144
|
-
imageSearchState.searchArea = O.none;
|
|
145
|
-
imageSearchState.results = [];
|
|
146
|
-
imageSearchState.filters = [];
|
|
147
|
-
imageSearchState.detectedObjects = [];
|
|
148
|
-
imageSearchState.activeIonLink = undefined;
|
|
149
|
-
imageSearchState.rectangleSearchForm = undefined;
|
|
150
|
-
this.resetScroll("results-block");
|
|
151
|
-
}
|
|
152
|
-
haveErrors() {
|
|
153
|
-
return this.wrongImageFormat || imageSearchState.serverError;
|
|
154
|
-
}
|
|
155
|
-
resetScroll(elementId, behavior = "auto") {
|
|
156
|
-
const element = this.el.shadowRoot.getElementById(elementId);
|
|
157
|
-
element.scroll({ top: 0, left: 0, behavior });
|
|
158
|
-
}
|
|
159
|
-
handleModalClose() {
|
|
160
|
-
this.active = false;
|
|
161
|
-
this.resetState();
|
|
162
|
-
const elementsToReset = ["onboarding-block", "results-block"];
|
|
163
|
-
elementsToReset.forEach((name) => this.resetScroll(name));
|
|
164
|
-
const widgetOpenEvent = createWidgetVpsEvent({
|
|
165
|
-
action: "close",
|
|
166
|
-
session_id: this.uiSessionId,
|
|
167
|
-
});
|
|
168
|
-
this.trackingApi.trackEvent(widgetOpenEvent);
|
|
169
|
-
}
|
|
170
|
-
render() {
|
|
171
|
-
return (h(Host, null,
|
|
172
|
-
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" },
|
|
173
|
-
h("vviinn-slider", { showBullets: false, position: this.slidePosition },
|
|
174
|
-
h("vviinn-slide", { class: { "start-page": true } },
|
|
175
|
-
h("div", { class: {
|
|
176
|
-
error: this.haveErrors(),
|
|
177
|
-
"start-page_block": true,
|
|
178
|
-
} },
|
|
179
|
-
h("vviinn-wrong-format", { class: { hidden: !this.wrongImageFormat }, onActionClick: () => (this.wrongImageFormat = false) }),
|
|
180
|
-
h("vviinn-server-error", { class: { hidden: !imageSearchState.serverError }, onActionClick: () => (imageSearchState.serverError = false) }),
|
|
181
|
-
h("vviinn-teaser", { class: { hidden: this.haveErrors() } }),
|
|
182
|
-
h("vviinn-image-selector", { class: { hidden: this.haveErrors() }, onImageSelected: () => this.handleImageSelection("upload"), onImageSelectedError: () => (this.wrongImageFormat = true), part: "select-image_button" },
|
|
183
|
-
h("span", { slot: "upload-button-text", class: "upload-button-content" },
|
|
184
|
-
h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "29", height: "28", fill: "none" },
|
|
185
|
-
h("defs", null),
|
|
186
|
-
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" }),
|
|
187
|
-
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" })),
|
|
188
|
-
h("slot", { name: "vviinn-image-upload-button-text" },
|
|
189
|
-
h("span", null, "Kamera oder Bild ausw\u00E4hlen")))),
|
|
190
|
-
h("vviinn-privacy-badge", { class: { hidden: this.haveErrors() } })),
|
|
191
|
-
h("div", { id: "onboarding-block", class: "start-page_block" },
|
|
192
|
-
h("div", { class: "onboarding-wrapper" },
|
|
193
|
-
h("vviinn-onboarding", null),
|
|
194
|
-
h("vviinn-example-images", { part: "example-images", onImageSelected: () => this.handleImageSelection("example"), onImageSelectedError: () => this.resetScroll("onboarding-block", "smooth") })))),
|
|
195
|
-
h("vviinn-slide", { class: { "results-page": true, active: this.slidePosition == 1 } },
|
|
196
|
-
h("div", { class: "image-wrapper" },
|
|
197
|
-
h("vviinn-image-view", null),
|
|
198
|
-
h("div", { class: "filters-wrapper" },
|
|
199
|
-
h("div", { class: "filters" }, imageSearchState.filters.map((filter) => (h("search-filters", { filter: filter })))))),
|
|
200
|
-
h("div", { id: "results-block", class: "products-wrapper" },
|
|
201
|
-
h("div", { class: {
|
|
202
|
-
"nothing-found": true,
|
|
203
|
-
hidden: imageSearchState.results.length > 0,
|
|
204
|
-
} },
|
|
205
|
-
h("vviinn-empty-results", null),
|
|
206
|
-
h("vviinn-onboarding", null)),
|
|
207
|
-
h("div", { class: {
|
|
208
|
-
hidden: imageSearchState.results.length <= 0,
|
|
209
|
-
products: true,
|
|
210
|
-
} }, imageSearchState.results.map((p, i) => {
|
|
211
|
-
var _a;
|
|
212
|
-
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 }));
|
|
213
|
-
}))))))));
|
|
214
|
-
}
|
|
215
|
-
static get is() { return "vviinn-vps-widget"; }
|
|
216
|
-
static get encapsulation() { return "shadow"; }
|
|
217
|
-
static get originalStyleUrls() { return {
|
|
218
|
-
"$": ["vviinn-vps-widget.css"]
|
|
219
|
-
}; }
|
|
220
|
-
static get styleUrls() { return {
|
|
221
|
-
"$": ["vviinn-vps-widget.css"]
|
|
222
|
-
}; }
|
|
223
|
-
static get properties() { return {
|
|
224
|
-
"token": {
|
|
225
|
-
"type": "string",
|
|
226
|
-
"mutable": false,
|
|
227
|
-
"complexType": {
|
|
228
|
-
"original": "string | undefined",
|
|
229
|
-
"resolved": "string",
|
|
230
|
-
"references": {}
|
|
231
|
-
},
|
|
232
|
-
"required": false,
|
|
233
|
-
"optional": false,
|
|
234
|
-
"docs": {
|
|
235
|
-
"tags": [],
|
|
236
|
-
"text": "vviinn customer token"
|
|
237
|
-
},
|
|
238
|
-
"attribute": "token",
|
|
239
|
-
"reflect": false
|
|
240
|
-
},
|
|
241
|
-
"apiPath": {
|
|
242
|
-
"type": "string",
|
|
243
|
-
"mutable": false,
|
|
244
|
-
"complexType": {
|
|
245
|
-
"original": "string",
|
|
246
|
-
"resolved": "string",
|
|
247
|
-
"references": {}
|
|
248
|
-
},
|
|
249
|
-
"required": false,
|
|
250
|
-
"optional": false,
|
|
251
|
-
"docs": {
|
|
252
|
-
"tags": [{
|
|
253
|
-
"text": undefined,
|
|
254
|
-
"name": "internal"
|
|
255
|
-
}],
|
|
256
|
-
"text": ""
|
|
257
|
-
},
|
|
258
|
-
"attribute": "api-path",
|
|
259
|
-
"reflect": false,
|
|
260
|
-
"defaultValue": "\"https://api.vviinn.com\""
|
|
261
|
-
},
|
|
262
|
-
"active": {
|
|
263
|
-
"type": "boolean",
|
|
264
|
-
"mutable": true,
|
|
265
|
-
"complexType": {
|
|
266
|
-
"original": "boolean",
|
|
267
|
-
"resolved": "boolean",
|
|
268
|
-
"references": {}
|
|
269
|
-
},
|
|
270
|
-
"required": false,
|
|
271
|
-
"optional": false,
|
|
272
|
-
"docs": {
|
|
273
|
-
"tags": [],
|
|
274
|
-
"text": "When true modal window with widget will be shown"
|
|
275
|
-
},
|
|
276
|
-
"attribute": "active",
|
|
277
|
-
"reflect": false,
|
|
278
|
-
"defaultValue": "false"
|
|
279
|
-
},
|
|
280
|
-
"currencySign": {
|
|
281
|
-
"type": "string",
|
|
282
|
-
"mutable": false,
|
|
283
|
-
"complexType": {
|
|
284
|
-
"original": "string",
|
|
285
|
-
"resolved": "string",
|
|
286
|
-
"references": {}
|
|
287
|
-
},
|
|
288
|
-
"required": false,
|
|
289
|
-
"optional": false,
|
|
290
|
-
"docs": {
|
|
291
|
-
"tags": [],
|
|
292
|
-
"text": "Currency sign will shown after price"
|
|
293
|
-
},
|
|
294
|
-
"attribute": "currency-sign",
|
|
295
|
-
"reflect": false,
|
|
296
|
-
"defaultValue": "\"\u20AC\""
|
|
297
|
-
},
|
|
298
|
-
"locale": {
|
|
299
|
-
"type": "string",
|
|
300
|
-
"mutable": false,
|
|
301
|
-
"complexType": {
|
|
302
|
-
"original": "string",
|
|
303
|
-
"resolved": "string",
|
|
304
|
-
"references": {}
|
|
305
|
-
},
|
|
306
|
-
"required": false,
|
|
307
|
-
"optional": false,
|
|
308
|
-
"docs": {
|
|
309
|
-
"tags": [],
|
|
310
|
-
"text": "Locale for currency formatting"
|
|
311
|
-
},
|
|
312
|
-
"attribute": "locale",
|
|
313
|
-
"reflect": false,
|
|
314
|
-
"defaultValue": "\"de-DE\""
|
|
315
|
-
},
|
|
316
|
-
"campaignId": {
|
|
317
|
-
"type": "string",
|
|
318
|
-
"mutable": false,
|
|
319
|
-
"complexType": {
|
|
320
|
-
"original": "string",
|
|
321
|
-
"resolved": "string",
|
|
322
|
-
"references": {}
|
|
323
|
-
},
|
|
324
|
-
"required": false,
|
|
325
|
-
"optional": true,
|
|
326
|
-
"docs": {
|
|
327
|
-
"tags": [],
|
|
328
|
-
"text": "Campaign using for visual search"
|
|
329
|
-
},
|
|
330
|
-
"attribute": "campaign-id",
|
|
331
|
-
"reflect": false
|
|
332
|
-
}
|
|
333
|
-
}; }
|
|
334
|
-
static get states() { return {
|
|
335
|
-
"slidePosition": {},
|
|
336
|
-
"width": {},
|
|
337
|
-
"wrongImageFormat": {}
|
|
338
|
-
}; }
|
|
339
|
-
static get elementRef() { return "el"; }
|
|
340
|
-
static get watchers() { return [{
|
|
341
|
-
"propName": "active",
|
|
342
|
-
"methodName": "activeWatcher"
|
|
343
|
-
}]; }
|
|
344
|
-
static get listeners() { return [{
|
|
345
|
-
"name": "recommendationView",
|
|
346
|
-
"method": "trackRecommendationView",
|
|
347
|
-
"target": undefined,
|
|
348
|
-
"capture": false,
|
|
349
|
-
"passive": false
|
|
350
|
-
}, {
|
|
351
|
-
"name": "recommendationClick",
|
|
352
|
-
"method": "trackRecommendationClick",
|
|
353
|
-
"target": undefined,
|
|
354
|
-
"capture": false,
|
|
355
|
-
"passive": false
|
|
356
|
-
}, {
|
|
357
|
-
"name": "cropperChanged",
|
|
358
|
-
"method": "trachSearchAreaChanges",
|
|
359
|
-
"target": undefined,
|
|
360
|
-
"capture": false,
|
|
361
|
-
"passive": false
|
|
362
|
-
}, {
|
|
363
|
-
"name": "detectedObjectClicked",
|
|
364
|
-
"method": "trackDetectedObject",
|
|
365
|
-
"target": undefined,
|
|
366
|
-
"capture": false,
|
|
367
|
-
"passive": false
|
|
368
|
-
}, {
|
|
369
|
-
"name": "filterSelected",
|
|
370
|
-
"method": "trackFilter",
|
|
371
|
-
"target": undefined,
|
|
372
|
-
"capture": false,
|
|
373
|
-
"passive": false
|
|
374
|
-
}]; }
|
|
375
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,61 +0,0 @@
|
|
|
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
|
-
];
|
package/dist/collection/error.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
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));
|
|
@@ -1,32 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,95 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
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);
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
}
|
package/dist/collection/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
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)));
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
};
|