vviinn-widgets 2.1.0 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Handler-d1a8a86a.js +329 -0
- package/dist/{vviinn-widgets/app-globals-e0943e34.js → cjs/app-globals-30781f30.js} +15 -925
- package/{www/build/cropper-handler.entry.js → dist/cjs/cropper-handler.cjs.entry.js} +11 -7
- package/dist/{vviinn-widgets/customized-slots-f3449695.js → cjs/customized-slots-5d904d8e.js} +6 -3
- package/dist/cjs/highlight-box_22.cjs.entry.js +737 -0
- package/{www/build/imageSearch.store-407f49f0.js → dist/cjs/imageSearch.store-128957a4.js} +11573 -11902
- package/dist/cjs/index-741a970d.js +1354 -0
- package/dist/cjs/index-c493804d.js +41 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +23 -0
- package/dist/cjs/vviinn-carousel_5.cjs.entry.js +1232 -0
- package/dist/{vviinn-widgets/vviinn-error.entry.js → cjs/vviinn-error.cjs.entry.js} +8 -4
- package/{www/build/vviinn-preloader.entry.js → dist/cjs/vviinn-preloader.cjs.entry.js} +11 -10
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +43 -0
- package/{www/build/vviinn-vps-widget.entry.js → dist/cjs/vviinn-vps-widget.cjs.entry.js} +31 -30
- package/dist/cjs/vviinn-widgets.cjs.js +21 -0
- package/dist/collection/Image/error.js +14 -0
- package/dist/collection/Image/form.js +5 -0
- package/dist/collection/Image/fromFile.js +18 -0
- package/dist/collection/Image/imageToB64.js +9 -0
- package/dist/collection/Image/index.js +0 -0
- package/dist/collection/Image/renderPromise.js +6 -0
- package/dist/collection/Image/resizeImage.js +28 -0
- package/dist/collection/Image/sizing.js +39 -0
- package/dist/collection/Image/toFile.js +17 -0
- package/dist/collection/analytics/GAnalytics.js +32 -0
- package/dist/collection/analytics/GeneralAnalytics.js +9 -0
- package/dist/collection/analytics/GtagAnalytics.js +35 -0
- package/dist/collection/analytics/ProductAnalytics.js +1 -0
- package/dist/collection/campaign/Campaign.js +8 -0
- package/dist/collection/campaign/CampaignService.js +5 -0
- package/dist/collection/campaign/VCSCampaign.js +1 -0
- package/dist/collection/campaign/VCSCampaignResponse.js +1 -0
- package/dist/collection/campaign/VCSCampaignService.js +5 -0
- package/dist/collection/campaign/VPRCampaignResponse.js +1 -0
- package/dist/collection/campaign/VPRCampaignService.js +5 -0
- package/dist/collection/collection-manifest.json +43 -0
- package/dist/collection/components/customized-slots.js +47 -0
- package/dist/collection/components/image-search/image-view/highlight-box/highlight-box.css +71 -0
- package/dist/collection/components/image-search/image-view/highlight-box/highlight-box.js +25 -0
- package/dist/collection/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.css +49 -0
- package/dist/collection/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.js +64 -0
- package/dist/collection/components/image-search/image-view/image-cropper/image-cropper.css +33 -0
- package/dist/{vviinn-widgets/image-cropper.entry.js → collection/components/image-search/image-view/image-cropper/image-cropper.js} +54 -32
- package/dist/collection/components/image-search/search-filters/search-filters.css +120 -0
- package/dist/collection/components/image-search/search-filters/search-filters.js +102 -0
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.css +138 -0
- package/{www/build/vviinn-carousel.entry.js → dist/collection/components/vviinn-carousel/vviinn-carousel.js} +115 -18
- package/dist/collection/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.css +7 -0
- package/dist/collection/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.js +36 -0
- package/dist/collection/components/vviinn-error/vviinn-error.css +38 -0
- package/dist/collection/components/vviinn-error/vviinn-error.js +18 -0
- package/dist/collection/components/vviinn-error/vviinn-server-error/vviinn-server-error.css +3 -0
- package/dist/collection/components/vviinn-error/vviinn-server-error/vviinn-server-error.js +34 -0
- package/dist/collection/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.css +3 -0
- package/dist/collection/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.js +34 -0
- package/dist/collection/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.css +34 -0
- package/dist/collection/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.js +129 -0
- package/dist/collection/components/vviinn-example-images/vviinn-example-images.css +19 -0
- package/dist/collection/components/vviinn-example-images/vviinn-example-images.js +80 -0
- package/dist/{vviinn-widgets/index-c9483145.js → collection/components/vviinn-icons/index.js} +13 -12
- package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.css +25 -0
- package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.js +64 -0
- package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.css +47 -0
- package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.js +83 -0
- package/dist/collection/components/vviinn-image-view/vviinn-image-view.css +31 -0
- package/dist/collection/components/vviinn-image-view/vviinn-image-view.js +61 -0
- package/dist/collection/components/vviinn-modal/vviinn-modal.css +105 -0
- package/dist/collection/components/vviinn-modal/vviinn-modal.js +98 -0
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/onboarding-card.css +41 -0
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-1/vviinn-onboarding-card-1.js +26 -0
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-2/vviinn-onboarding-card-2.js +26 -0
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-3/vviinn-onboarding-card-3.js +26 -0
- package/dist/collection/components/vviinn-onboarding/vviinn-onboarding.css +58 -0
- package/dist/collection/components/vviinn-onboarding/vviinn-onboarding.js +28 -0
- package/dist/collection/components/vviinn-overlay/vviinn-overlay.css +33 -0
- package/dist/collection/components/vviinn-overlay/vviinn-overlay.js +15 -0
- package/dist/collection/components/vviinn-overlayed-modal/vviinn-overlayed-modal.css +29 -0
- package/dist/collection/components/vviinn-overlayed-modal/vviinn-overlayed-modal.js +71 -0
- package/dist/collection/components/vviinn-preloader/vviinn-preloader.css +37 -0
- package/dist/collection/components/vviinn-preloader/vviinn-preloader.js +20 -0
- package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.css +19 -0
- package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.js +27 -0
- package/dist/collection/components/vviinn-product-card/render-helpers.js +32 -0
- package/dist/collection/components/vviinn-product-card/vviinn-product-card.css +95 -0
- package/dist/collection/components/vviinn-product-card/vviinn-product-card.js +425 -0
- package/dist/collection/components/vviinn-slider/arrow.js +11 -0
- package/dist/collection/components/vviinn-slider/vviinn-slide/vviinn-slide.css +4 -0
- package/dist/collection/components/vviinn-slider/vviinn-slide/vviinn-slide.js +15 -0
- package/dist/collection/components/vviinn-slider/vviinn-slider.css +109 -0
- package/dist/collection/components/vviinn-slider/vviinn-slider.js +181 -0
- package/dist/collection/components/vviinn-teaser/vviinn-teaser.css +14 -0
- package/dist/collection/components/vviinn-teaser/vviinn-teaser.js +29 -0
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.css +238 -0
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js +200 -0
- package/dist/collection/components/vviinn-vpr-button/stories/kek.stories.js +18 -0
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.css +35 -0
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +149 -0
- package/dist/collection/components/vviinn-vpr-widget/GridMode.js +1 -0
- package/dist/collection/components/vviinn-vpr-widget/token-helpers.js +11 -0
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +441 -0
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-widget.css +74 -0
- package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.css +0 -0
- package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +177 -0
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.css +350 -0
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +247 -0
- package/dist/collection/cropper/Cropper.js +1 -0
- package/dist/collection/cropper/Handler.js +61 -0
- package/dist/collection/dom/index.js +3 -0
- package/dist/collection/error.js +14 -0
- package/dist/collection/file/index.js +4 -0
- package/dist/collection/geometry/Clip.js +14 -0
- package/dist/collection/geometry/Point.js +32 -0
- package/dist/collection/geometry/Rectangle.js +95 -0
- package/dist/collection/geometry/RectangleAlt.js +1 -0
- package/dist/collection/geometry/Sized.js +8 -0
- package/dist/collection/global.js +19 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/interfaces/generated.js +5 -0
- package/dist/collection/interfaces/recommendation.js +1 -0
- package/dist/collection/network/apiClient.js +9 -0
- package/dist/collection/network/ion/File.js +14 -0
- package/dist/collection/network/ion/Form.js +64 -0
- package/dist/collection/network/ion/Link.js +8 -0
- package/dist/collection/network/ion/ValueObject.js +23 -0
- package/dist/collection/network/request.js +19 -0
- package/dist/collection/network/utils.js +37 -0
- package/dist/collection/recommendation/recommendation.js +1 -0
- package/dist/collection/searchSession/searchSession.js +26 -0
- package/dist/collection/sentry.js +14 -0
- package/dist/collection/slider/GridMode.js +1 -0
- package/dist/collection/store/file-processing.js +13 -0
- package/dist/collection/store/imageSearch.store.js +138 -0
- package/dist/collection/store/store.js +11 -0
- package/dist/collection/stories/Button.js +21 -0
- package/dist/collection/stories/Button.stories.js +42 -0
- package/dist/collection/stories/Header.js +45 -0
- package/dist/collection/stories/Header.stories.js +15 -0
- package/dist/collection/stories/Page.js +61 -0
- package/dist/collection/stories/Page.stories.js +19 -0
- package/dist/collection/stories/assets/code-brackets.svg +1 -0
- package/dist/collection/stories/assets/colors.svg +1 -0
- package/dist/collection/stories/assets/comments.svg +1 -0
- package/dist/collection/stories/assets/direction.svg +1 -0
- package/dist/collection/stories/assets/flow.svg +1 -0
- package/dist/collection/stories/assets/plugin.svg +1 -0
- package/dist/collection/stories/assets/repo.svg +1 -0
- package/dist/collection/stories/assets/stackalt.svg +1 -0
- package/dist/collection/stories/image-selector.stories.js +6 -0
- package/dist/collection/stories/image-view.stories.js +6 -0
- package/dist/collection/stories/modal.stories.js +12 -0
- package/dist/collection/stories/onboarding.stories.js +11 -0
- package/dist/collection/stories/overlay.stories.js +5 -0
- package/dist/collection/stories/overlayedModal.stories.js +8 -0
- package/dist/collection/stories/privacy-badge.stories.js +11 -0
- package/dist/collection/stories/slider.stories.js +17 -0
- package/dist/collection/stories/teaser.stories.js +5 -0
- package/dist/collection/stories/vps-widget.stories.js +47 -0
- package/dist/collection/stories/vviinn-product.stories.js +19 -0
- package/dist/collection/utils/collections/collectionsUtils.js +5 -0
- package/dist/collection/utils/either.js +3 -0
- package/dist/collection/utils/enum/enumUtils.js +3 -0
- package/dist/collection/utils/event/Events.js +1 -0
- package/dist/collection/utils/number/index.js +4 -0
- package/dist/collection/utils/option/option.js +4 -0
- package/dist/collection/utils/semigroup/semigroupDiff.js +6 -0
- package/dist/collection/utils/token/tokenUtils.js +9 -0
- package/dist/esm/Handler-639a4cb3.js +308 -0
- package/{www/build/app-globals-e0943e34.js → dist/esm/app-globals-345e497d.js} +10 -922
- package/dist/{vviinn-widgets → esm}/cropper-handler.entry.js +2 -2
- package/{www/build/customized-slots-f3449695.js → dist/esm/customized-slots-a76a8d41.js} +1 -1
- package/dist/esm/highlight-box_22.entry.js +712 -0
- package/dist/{vviinn-widgets/imageSearch.store-407f49f0.js → esm/imageSearch.store-8eab0da1.js} +11510 -11872
- package/dist/esm/index-6fa21e24.js +1323 -0
- package/{www/build/index-c9483145.js → dist/esm/index-8cb063df.js} +6 -4
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +19 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/vviinn-carousel_5.entry.js +1224 -0
- package/{www/build → dist/esm}/vviinn-error.entry.js +1 -1
- package/dist/{vviinn-widgets → esm}/vviinn-preloader.entry.js +3 -6
- package/dist/{vviinn-widgets → esm}/vviinn-vps-button.entry.js +3 -3
- package/dist/{vviinn-widgets → esm}/vviinn-vps-widget.entry.js +4 -7
- package/dist/esm/vviinn-widgets.js +19 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/loader/cdn.js +3 -0
- package/dist/loader/index.cjs.js +3 -0
- package/dist/loader/index.d.ts +12 -0
- package/dist/loader/index.es2017.js +3 -0
- package/dist/loader/index.js +4 -0
- package/dist/loader/package.json +10 -0
- package/dist/types/components/vviinn-carousel/vviinn-carousel.d.ts +1 -0
- package/dist/types/components/vviinn-icons/index.d.ts +2 -0
- package/dist/types/components/vviinn-product-card/render-helpers.d.ts +3 -2
- package/dist/types/components/vviinn-product-card/vviinn-product-card.d.ts +2 -0
- package/dist/types/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.d.ts +25 -0
- package/dist/types/components/vviinn-vpr-button/stories/kek.stories.d.ts +7 -0
- package/dist/types/components/vviinn-vpr-button/vviinn-vpr-button.d.ts +14 -0
- package/dist/types/components/vviinn-vpr-widget/vviinn-vpr-vidget.d.ts +13 -3
- package/dist/types/components.d.ts +54 -0
- package/dist/vviinn-widgets/index.esm.js +0 -1
- package/dist/vviinn-widgets/p-04b06ea9.entry.js +1 -0
- package/dist/vviinn-widgets/p-400eb62f.entry.js +1 -0
- package/dist/vviinn-widgets/p-56fc949a.js +1 -0
- package/dist/vviinn-widgets/p-59edfbe2.js +1 -0
- package/dist/vviinn-widgets/p-78ccc9eb.js +15 -0
- package/dist/vviinn-widgets/p-9d24f51e.entry.js +1 -0
- package/dist/vviinn-widgets/p-d085199d.entry.js +1 -0
- package/dist/vviinn-widgets/p-e1ba8626.js +1 -0
- package/dist/vviinn-widgets/p-e38f4aa2.entry.js +1 -0
- package/dist/vviinn-widgets/p-e67cae57.js +1 -0
- package/dist/vviinn-widgets/p-f47e82b2.entry.js +1 -0
- package/dist/vviinn-widgets/p-f582db5c.js +1 -0
- package/dist/vviinn-widgets/p-fb14e3cc.entry.js +1 -0
- package/dist/vviinn-widgets/vviinn-widgets.css +1 -6
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -125
- package/package.json +3 -1
- package/www/build/index.esm.js +0 -1
- package/www/build/p-04b06ea9.entry.js +1 -0
- package/www/build/p-400eb62f.entry.js +1 -0
- package/www/build/p-56fc949a.js +1 -0
- package/www/build/p-59edfbe2.js +1 -0
- package/www/build/p-78ccc9eb.js +15 -0
- package/www/build/p-7e4978d5.js +1 -0
- package/www/build/p-9d24f51e.entry.js +1 -0
- package/www/build/p-a67898be.css +1 -0
- package/www/build/p-d085199d.entry.js +1 -0
- package/www/build/p-e1ba8626.js +1 -0
- package/www/build/p-e38f4aa2.entry.js +1 -0
- package/www/build/p-e67cae57.js +1 -0
- package/www/build/p-f47e82b2.entry.js +1 -0
- package/www/build/p-f582db5c.js +1 -0
- package/www/build/p-fb14e3cc.entry.js +1 -0
- package/www/build/vviinn-widgets.css +1 -6
- package/www/build/vviinn-widgets.esm.js +1 -125
- package/www/index.html +6 -13
- package/dist/vviinn-widgets/Array-4b9f84cf.js +0 -4295
- package/dist/vviinn-widgets/Handler-47db9890.js +0 -1428
- package/dist/vviinn-widgets/NonEmptyArray-6ef0d207.js +0 -4370
- package/dist/vviinn-widgets/css-shim-f0027935.js +0 -4
- package/dist/vviinn-widgets/dom-db0073f0.js +0 -73
- package/dist/vviinn-widgets/highlight-box.entry.js +0 -41
- package/dist/vviinn-widgets/index-b6d739a9.js +0 -3010
- package/dist/vviinn-widgets/number-98d54dd6.js +0 -1533
- package/dist/vviinn-widgets/search-filters.entry.js +0 -73
- package/dist/vviinn-widgets/shadow-css-c1fdfa9f.js +0 -389
- package/dist/vviinn-widgets/vviinn-carousel.entry.js +0 -205
- package/dist/vviinn-widgets/vviinn-detected-object.entry.js +0 -52
- package/dist/vviinn-widgets/vviinn-empty-results.entry.js +0 -16
- package/dist/vviinn-widgets/vviinn-example-image.entry.js +0 -38
- package/dist/vviinn-widgets/vviinn-example-images.entry.js +0 -28
- package/dist/vviinn-widgets/vviinn-image-selector.entry.js +0 -31
- package/dist/vviinn-widgets/vviinn-image-view.entry.js +0 -55
- package/dist/vviinn-widgets/vviinn-modal.entry.js +0 -30
- package/dist/vviinn-widgets/vviinn-onboarding-card-1.entry.js +0 -21
- package/dist/vviinn-widgets/vviinn-onboarding-card-2.entry.js +0 -21
- package/dist/vviinn-widgets/vviinn-onboarding-card-3.entry.js +0 -21
- package/dist/vviinn-widgets/vviinn-onboarding.entry.js +0 -20
- package/dist/vviinn-widgets/vviinn-overlay.entry.js +0 -15
- package/dist/vviinn-widgets/vviinn-overlayed-modal.entry.js +0 -18
- package/dist/vviinn-widgets/vviinn-privacy-badge.entry.js +0 -20
- package/dist/vviinn-widgets/vviinn-product-card.entry.js +0 -176
- package/dist/vviinn-widgets/vviinn-server-error.entry.js +0 -16
- package/dist/vviinn-widgets/vviinn-slide.entry.js +0 -15
- package/dist/vviinn-widgets/vviinn-slider.entry.js +0 -120
- package/dist/vviinn-widgets/vviinn-teaser.entry.js +0 -20
- package/dist/vviinn-widgets/vviinn-vpr-widget.entry.js +0 -128
- package/dist/vviinn-widgets/vviinn-wrong-format.entry.js +0 -16
- package/www/build/Array-4b9f84cf.js +0 -4295
- package/www/build/Handler-47db9890.js +0 -1428
- package/www/build/NonEmptyArray-6ef0d207.js +0 -4370
- package/www/build/css-shim-f0027935.js +0 -4
- package/www/build/dom-db0073f0.js +0 -73
- package/www/build/highlight-box.entry.js +0 -41
- package/www/build/image-cropper.entry.js +0 -113
- package/www/build/index-b6d739a9.js +0 -3010
- package/www/build/number-98d54dd6.js +0 -1533
- package/www/build/search-filters.entry.js +0 -73
- package/www/build/shadow-css-c1fdfa9f.js +0 -389
- package/www/build/vviinn-detected-object.entry.js +0 -52
- package/www/build/vviinn-empty-results.entry.js +0 -16
- package/www/build/vviinn-example-image.entry.js +0 -38
- package/www/build/vviinn-example-images.entry.js +0 -28
- package/www/build/vviinn-image-selector.entry.js +0 -31
- package/www/build/vviinn-image-view.entry.js +0 -55
- package/www/build/vviinn-modal.entry.js +0 -30
- package/www/build/vviinn-onboarding-card-1.entry.js +0 -21
- package/www/build/vviinn-onboarding-card-2.entry.js +0 -21
- package/www/build/vviinn-onboarding-card-3.entry.js +0 -21
- package/www/build/vviinn-onboarding.entry.js +0 -20
- package/www/build/vviinn-overlay.entry.js +0 -15
- package/www/build/vviinn-overlayed-modal.entry.js +0 -18
- package/www/build/vviinn-privacy-badge.entry.js +0 -20
- package/www/build/vviinn-product-card.entry.js +0 -176
- package/www/build/vviinn-server-error.entry.js +0 -16
- package/www/build/vviinn-slide.entry.js +0 -15
- package/www/build/vviinn-slider.entry.js +0 -120
- package/www/build/vviinn-teaser.entry.js +0 -20
- package/www/build/vviinn-vpr-widget.entry.js +0 -128
- package/www/build/vviinn-vps-button.entry.js +0 -39
- package/www/build/vviinn-wrong-format.entry.js +0 -16
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Component, Host, h, Event, Listen, Element } from "@stencil/core";
|
|
2
|
+
import { slotChangeListener } from "../customized-slots";
|
|
3
|
+
export class VviinnExampleImages {
|
|
4
|
+
handleImageSelection() {
|
|
5
|
+
this.imageSelected.emit();
|
|
6
|
+
}
|
|
7
|
+
handleImageSelectionError() {
|
|
8
|
+
this.imageSelectedError.emit();
|
|
9
|
+
}
|
|
10
|
+
componentWillLoad() {
|
|
11
|
+
slotChangeListener(this, this.el);
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return (h(Host, null,
|
|
15
|
+
h("slot", { name: "vviinn-example-images-title" },
|
|
16
|
+
h("h3", null, "Mit den Beispielbildern die Suche direkt ausprobieren")),
|
|
17
|
+
h("div", { class: "images" },
|
|
18
|
+
h("slot", { name: "vviinn-example-images-1" },
|
|
19
|
+
h("vviinn-example-image", { width: 240, height: 320, src: "https://cdn.vviinn.com/0/fit/240/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDEtTC5qcGc=" })),
|
|
20
|
+
h("slot", { name: "vviinn-example-images-2" },
|
|
21
|
+
h("vviinn-example-image", { width: 240, height: 240, src: "https://cdn.vviinn.com/0/fit/240/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDItTS5qcGc=" })),
|
|
22
|
+
h("slot", { name: "vviinn-example-images-3" },
|
|
23
|
+
h("vviinn-example-image", { width: 240, height: 240, src: "https://cdn.vviinn.com/0/fit/240/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDMtTS5qcGc=" })),
|
|
24
|
+
h("slot", { name: "vviinn-example-images-4" },
|
|
25
|
+
h("vviinn-example-image", { width: 240, height: 320, src: "https://cdn.vviinn.com/0/fit/240/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDQtTC5qcGc=" })))));
|
|
26
|
+
}
|
|
27
|
+
static get is() { return "vviinn-example-images"; }
|
|
28
|
+
static get encapsulation() { return "shadow"; }
|
|
29
|
+
static get originalStyleUrls() { return {
|
|
30
|
+
"$": ["vviinn-example-images.css"]
|
|
31
|
+
}; }
|
|
32
|
+
static get styleUrls() { return {
|
|
33
|
+
"$": ["vviinn-example-images.css"]
|
|
34
|
+
}; }
|
|
35
|
+
static get events() { return [{
|
|
36
|
+
"method": "imageSelected",
|
|
37
|
+
"name": "imageSelected",
|
|
38
|
+
"bubbles": true,
|
|
39
|
+
"cancelable": true,
|
|
40
|
+
"composed": true,
|
|
41
|
+
"docs": {
|
|
42
|
+
"tags": [],
|
|
43
|
+
"text": ""
|
|
44
|
+
},
|
|
45
|
+
"complexType": {
|
|
46
|
+
"original": "void",
|
|
47
|
+
"resolved": "void",
|
|
48
|
+
"references": {}
|
|
49
|
+
}
|
|
50
|
+
}, {
|
|
51
|
+
"method": "imageSelectedError",
|
|
52
|
+
"name": "imageSelectedError",
|
|
53
|
+
"bubbles": true,
|
|
54
|
+
"cancelable": true,
|
|
55
|
+
"composed": true,
|
|
56
|
+
"docs": {
|
|
57
|
+
"tags": [],
|
|
58
|
+
"text": ""
|
|
59
|
+
},
|
|
60
|
+
"complexType": {
|
|
61
|
+
"original": "void",
|
|
62
|
+
"resolved": "void",
|
|
63
|
+
"references": {}
|
|
64
|
+
}
|
|
65
|
+
}]; }
|
|
66
|
+
static get elementRef() { return "el"; }
|
|
67
|
+
static get listeners() { return [{
|
|
68
|
+
"name": "exampleImageSelected",
|
|
69
|
+
"method": "handleImageSelection",
|
|
70
|
+
"target": undefined,
|
|
71
|
+
"capture": false,
|
|
72
|
+
"passive": false
|
|
73
|
+
}, {
|
|
74
|
+
"name": "exampleImageError",
|
|
75
|
+
"method": "handleImageSelectionError",
|
|
76
|
+
"target": undefined,
|
|
77
|
+
"capture": false,
|
|
78
|
+
"passive": false
|
|
79
|
+
}]; }
|
|
80
|
+
}
|
package/dist/{vviinn-widgets/index-c9483145.js → collection/components/vviinn-icons/index.js}
RENAMED
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import { h } from
|
|
2
|
-
|
|
3
|
-
const ArrowIcon = () => (h("svg", { width: "12", height: "20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
export const ArrowIcon = () => (h("svg", { width: "12", height: "20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
4
3
|
h("path", { d: "M0 10 10 0l1.4 1.4L2.8 10l8.6 8.6L10 20 0 10Z" })));
|
|
5
|
-
const CameraIcon = () => (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "28", height: "28", fill: "none" },
|
|
4
|
+
export const CameraIcon = () => (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "28", height: "28", fill: "none" },
|
|
6
5
|
h("defs", null),
|
|
7
6
|
h("path", { fill: "#525252", "fill-rule": "evenodd", d: "M9.771 3.89a.875.875 0 01.728-.39h7c.293 0 .566.146.728.39l1.49 2.235h3.033a2.625 2.625 0 012.625 2.625V21a2.625 2.625 0 01-2.625 2.625H5.25A2.625 2.625 0 012.625 21V8.75A2.625 2.625 0 015.25 6.125h3.031l1.49-2.235zm1.197 1.36l-1.49 2.235a.875.875 0 01-.729.39H5.25a.875.875 0 00-.875.875V21a.875.875 0 00.875.875h17.5a.875.875 0 00.875-.875V8.75a.875.875 0 00-.875-.875h-3.5a.875.875 0 01-.729-.39l-1.49-2.235h-6.063z", "clip-rule": "evenodd" }),
|
|
8
7
|
h("path", { fill: "#525252", "fill-rule": "evenodd", d: "M14 11.375a3.062 3.062 0 100 6.125 3.062 3.062 0 000-6.125zm-4.813 3.063a4.812 4.812 0 119.625 0 4.812 4.812 0 01-9.625 0z", "clip-rule": "evenodd" })));
|
|
9
|
-
const OnboardingCard1Icon = () => (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "120", height: "120", fill: "none" },
|
|
8
|
+
export const OnboardingCard1Icon = () => (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "120", height: "120", fill: "none" },
|
|
10
9
|
h("defs", null),
|
|
11
10
|
h("path", { fill: "#393939", d: "M74.55 20a5.06 5.06 0 014.14 2l4.72 9.32.1.18.11.17A5.07 5.07 0 0087.93 34h13.87c5.07 0 9.2 3.59 9.2 8v50c0 4.41-4.13 8-9.2 8H18.2c-5.07 0-9.2-3.59-9.2-8V42c0-4.41 4.13-8 9.2-8h13.87a5.072 5.072 0 004.31-2.34l.11-.17.1-.18L41.31 22a5.06 5.06 0 014.14-2h29.1zm0-4h-29.1a9 9 0 00-7.6 4L33 29.5a1.13 1.13 0 01-1 .5H18.2C10.91 30 5 35.37 5 42v50c0 6.63 5.91 12 13.2 12h83.6c7.29 0 13.2-5.37 13.2-12V42c0-6.63-5.91-12-13.2-12H87.93a1.13 1.13 0 01-1-.5L82.15 20a9 9 0 00-7.6-4z" }),
|
|
12
11
|
h("path", { fill: "#393939", d: "M96 46a4 4 0 110 8 4 4 0 010-8zm0-4a8 8 0 100 16.001A8 8 0 0096 42z" }),
|
|
13
12
|
h("path", { class: "colored", d: "M60 42a24 24 0 100 48.001A24 24 0 0060 42zm12 26H62v10a2 2 0 01-4 0V68H48a2 2 0 010-4h10V54a2 2 0 014 0v10h10a2 2 0 110 4z" })));
|
|
14
|
-
const OnboardingCard2Icon = () => (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "120", height: "120", fill: "none" },
|
|
13
|
+
export const OnboardingCard2Icon = () => (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "120", height: "120", fill: "none" },
|
|
15
14
|
h("defs", null),
|
|
16
15
|
h("path", { fill: "#393939", d: "M110.35 96.52l-24.8-22.66a6.22 6.22 0 00-8.14-.27l-.09.07-10.57 8.93-18.33-17.88a6.001 6.001 0 00-8.51-.35L8.69 91.49a2 2 0 002.62 3l31.3-27.2a2 2 0 012.233-.359 2 2 0 01.637.479l.1.1 45 43.9a2.005 2.005 0 002.83-.03 2.003 2.003 0 00-.03-2.83L69.63 85.39l10.22-8.63a2.3 2.3 0 013 .07l24.77 22.65c.377.343.871.529 1.38.52a2 2 0 001.35-3.48zM75 31a10 10 0 110 20 10 10 0 010-20zm0-4a14 14 0 100 28 14 14 0 000-28z" }),
|
|
17
16
|
h("path", { class: "colored", d: "M12 36H8V20A12 12 0 0120 8h16v4H20a8 8 0 00-8 8v16zM112 36h-4V20a8.001 8.001 0 00-8-8H84V8h16a11.998 11.998 0 0112 12v16zM36 112H20a11.998 11.998 0 01-12-12V84h4v16a8 8 0 008 8h16v4zM100 112H84v-4h16a8 8 0 008-8V84h4v16c0 3.183-1.264 6.235-3.515 8.485A11.996 11.996 0 01100 112z" })));
|
|
18
|
-
const OnboardingCard3Icon = () => (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "120", height: "120", fill: "none" },
|
|
17
|
+
export const OnboardingCard3Icon = () => (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "120", height: "120", fill: "none" },
|
|
19
18
|
h("defs", null),
|
|
20
19
|
h("path", { class: "colored", d: "M84.09 43.24a.53.53 0 00-.29-.48L60.28 29.4a.522.522 0 00-.27-.07.531.531 0 00-.28.07L36.2 42.76a.54.54 0 000 1l23.53 13.3a.54.54 0 00.55 0L83.8 43.72a.53.53 0 00.29-.48zM57.28 61.23L33.73 47.88a.569.569 0 00-.85.48V75a.54.54 0 00.29.48L56.72 88.8a.56.56 0 00.56 0 .53.53 0 00.28-.48V61.71a.56.56 0 00-.28-.48zM86.84 47.88a.63.63 0 00-.29-.08.55.55 0 00-.28.08L62.73 61.23a.56.56 0 00-.28.48v26.61a.53.53 0 00.28.48.56.56 0 00.56 0l23.54-13.29a.54.54 0 00.29-.48V48.36a.55.55 0 00-.28-.48z" }),
|
|
21
20
|
h("path", { class: "colored", d: "M100 7.94H20a12 12 0 00-12 12v80a11.998 11.998 0 0012 12h80c3.183 0 6.235-1.264 8.485-3.515A11.996 11.996 0 00112 99.94v-80a11.998 11.998 0 00-12-12zm-8 69.24a1.69 1.69 0 01-.85 1.45l-30.31 17.1a1.77 1.77 0 01-1.67 0l-30.32-17.1a1.689 1.689 0 01-.85-1.45V42.82a1.66 1.66 0 01.85-1.45l30.32-17.21a1.71 1.71 0 011.67 0l30.31 17.21a1.67 1.67 0 01.85 1.45v34.36z" })));
|
|
22
|
-
const CheckIcon = () => (h("svg", { width: "14", height: "11", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
21
|
+
export const CheckIcon = () => (h("svg", { width: "14", height: "11", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
23
22
|
h("path", { d: "M5 10.414 0 5.413 1.413 4 5 7.586 12.585 0 14 1.415l-9 8.999Z", fill: "var(--color-primary, var(--color-primary-system))" })));
|
|
24
|
-
const LoaderIcon = () => (h("svg", { width: "100%", height: "100%", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 28 28" },
|
|
23
|
+
export const LoaderIcon = () => (h("svg", { width: "100%", height: "100%", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 28 28" },
|
|
25
24
|
h("path", { fill: "#fff", d: "M23,14a9,9,0,1,1-9-9V2A12,12,0,1,0,26,14Z" })));
|
|
26
|
-
const ChevronIcon = () => (h("svg", { width: "9", height: "16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
25
|
+
export const ChevronIcon = () => (h("svg", { width: "9", height: "16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
27
26
|
h("path", { d: "m9 8-7.895 8L0 14.88 6.79 8 0 1.12 1.105 0 9 8Z", fill: "#525252" })));
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
export const VisualSearchIcon = () => (h("svg", { width: "22", height: "22", xmlns: "http://www.w3.org/2000/svg" },
|
|
28
|
+
h("path", { d: "M18 0h-3v2h3c1.103 0 2 .897 2 2v3h2V4c0-2.206-1.794-4-4-4Zm2 18c0 1.103-.897 2-2 2h-3v2h3c2.206 0 4-1.794 4-4v-3h-2v3ZM2 18v-3H0v3c0 2.206 1.794 4 4 4h3v-2H4c-1.103 0-2-.897-2-2ZM2 4c0-1.103.897-2 2-2h3V0H4C1.794 0 0 1.794 0 4v3h2V4Zm6 6.5C8 9.122 9.122 8 10.5 8S13 9.122 13 10.5 11.878 13 10.5 13A2.503 2.503 0 0 1 8 10.5Zm7.5 6.5a1.503 1.503 0 0 0 1.061-2.561l-2.012-2.011c.293-.6.448-1.26.451-1.928C15 8.019 12.981 6 10.5 6A4.505 4.505 0 0 0 6 10.5c0 2.481 2.019 4.5 4.5 4.5.693 0 1.341-.17 1.928-.451l2.011 2.012c.293.293.677.439 1.061.439Z" })));
|
|
29
|
+
export const CrossIcon = () => (h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
30
|
+
h("path", { d: "M16 1.4L14.6 0L8 6.6L1.4 0L0 1.4L6.6 8L0 14.6L1.4 16L8 9.4L14.6 16L16 14.6L9.4 8L16 1.4Z", fill: "#161616" })));
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
:host(::hover) {
|
|
6
|
+
background: whitesmoke;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.visually-hidden {
|
|
10
|
+
clip: rect(0 0 0 0);
|
|
11
|
+
-webkit-clip-path: inset(50%);
|
|
12
|
+
clip-path: inset(50%);
|
|
13
|
+
height: 1px;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
position: absolute;
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
width: 1px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
label {
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
display: grid;
|
|
23
|
+
padding: 0.5rem;
|
|
24
|
+
transition: background 0.1s ease-in-out;
|
|
25
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Component, Host, h, Event } from "@stencil/core";
|
|
2
|
+
import * as E from "fp-ts/Either";
|
|
3
|
+
import { pipe } from "fp-ts/lib/function";
|
|
4
|
+
import { imageSearchState, processSelectedFile, } from "../../store/imageSearch.store";
|
|
5
|
+
/**
|
|
6
|
+
* @part button - button look and feel
|
|
7
|
+
*/
|
|
8
|
+
export class VviinnImageSelector {
|
|
9
|
+
async handleInputChange(event) {
|
|
10
|
+
const input = event.target;
|
|
11
|
+
const processingResult = await processSelectedFile(input.files[0]);
|
|
12
|
+
pipe(processingResult, E.match(() => this.imageSelectedError.emit(), () => this.imageSelected.emit()));
|
|
13
|
+
input.value = null;
|
|
14
|
+
}
|
|
15
|
+
isLoading() {
|
|
16
|
+
return (imageSearchState.loading || imageSearchState.objectDetectionInProgress);
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
return (h(Host, { exportparts: "button" },
|
|
20
|
+
this.isLoading() ? h("vviinn-preloader", null) : null,
|
|
21
|
+
this.isLoading() ? null : (h("label", { htmlFor: "fileInput", part: "button" },
|
|
22
|
+
h("slot", { name: "upload-button-text" }, "Upload image"))),
|
|
23
|
+
h("input", { id: "fileInput", class: "visually-hidden", type: "file", accept: "image/*", onChange: (event) => this.handleInputChange(event) })));
|
|
24
|
+
}
|
|
25
|
+
static get is() { return "vviinn-image-selector"; }
|
|
26
|
+
static get encapsulation() { return "shadow"; }
|
|
27
|
+
static get originalStyleUrls() { return {
|
|
28
|
+
"$": ["vviinn-image-selector.css"]
|
|
29
|
+
}; }
|
|
30
|
+
static get styleUrls() { return {
|
|
31
|
+
"$": ["vviinn-image-selector.css"]
|
|
32
|
+
}; }
|
|
33
|
+
static get events() { return [{
|
|
34
|
+
"method": "imageSelected",
|
|
35
|
+
"name": "imageSelected",
|
|
36
|
+
"bubbles": true,
|
|
37
|
+
"cancelable": true,
|
|
38
|
+
"composed": true,
|
|
39
|
+
"docs": {
|
|
40
|
+
"tags": [],
|
|
41
|
+
"text": "Event fires when user select file"
|
|
42
|
+
},
|
|
43
|
+
"complexType": {
|
|
44
|
+
"original": "void",
|
|
45
|
+
"resolved": "void",
|
|
46
|
+
"references": {}
|
|
47
|
+
}
|
|
48
|
+
}, {
|
|
49
|
+
"method": "imageSelectedError",
|
|
50
|
+
"name": "imageSelectedError",
|
|
51
|
+
"bubbles": true,
|
|
52
|
+
"cancelable": true,
|
|
53
|
+
"composed": true,
|
|
54
|
+
"docs": {
|
|
55
|
+
"tags": [],
|
|
56
|
+
"text": "Event fires when user select file that no .jpg, .jpeg or png"
|
|
57
|
+
},
|
|
58
|
+
"complexType": {
|
|
59
|
+
"original": "void",
|
|
60
|
+
"resolved": "void",
|
|
61
|
+
"references": {}
|
|
62
|
+
}
|
|
63
|
+
}]; }
|
|
64
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
--color-primary-system: #0F62FE;
|
|
3
|
+
--color-primary-hover-system: #014CDA;
|
|
4
|
+
--color-icons-system: #2F8EDF;
|
|
5
|
+
--spacer: 8px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
:host {
|
|
10
|
+
--size: 32px;
|
|
11
|
+
--x-position: 0;
|
|
12
|
+
--y-position: 0;
|
|
13
|
+
|
|
14
|
+
background: rgba(22, 22, 22, 0.5);
|
|
15
|
+
border-radius: 50%;
|
|
16
|
+
border: none;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
display: block;
|
|
19
|
+
height: var(--size);
|
|
20
|
+
position: absolute;
|
|
21
|
+
transition: opacity 0.25s;
|
|
22
|
+
width: var(--size);
|
|
23
|
+
z-index: 2;
|
|
24
|
+
transform: translate(calc(var(--x-position) - (var(--size) * 0.5)), calc(var(--y-position) - (var(--size) * 0.5)));
|
|
25
|
+
transition: background 0.1 ease-in-out;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host(:hover) {
|
|
29
|
+
background: rgba(22, 22, 22, 0.75);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:host(.active) {
|
|
33
|
+
background: var(--color-primary, var(--color-primary-system))!important;
|
|
34
|
+
border: 2px solid white;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:host::after {
|
|
38
|
+
--size: 32px;
|
|
39
|
+
border-radius: 50%;
|
|
40
|
+
content: "";
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
display: block;
|
|
43
|
+
height: calc(var(--size) * 0.25);
|
|
44
|
+
transform: translate(calc(-50% + var(--size) * 0.5), calc(-50% + var(--size) * 0.5));
|
|
45
|
+
width: calc(var(--size) * 0.25);
|
|
46
|
+
background: white;
|
|
47
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Component, Host, h, State, Prop } from "@stencil/core";
|
|
2
|
+
import { pipe } from "fp-ts/lib/function";
|
|
3
|
+
import * as O from "fp-ts/lib/Option";
|
|
4
|
+
import { foldValueObject } from "../../../network/ion/ValueObject";
|
|
5
|
+
import { detectedObjectEq, } from "../../../searchSession/searchSession";
|
|
6
|
+
import { fromAlt, scaleWithSized, center } from "../../../geometry/Rectangle";
|
|
7
|
+
import { imageSearchState, makeRectangularSearchRequest, } from "../../../store/imageSearch.store";
|
|
8
|
+
export class VviinnDetectedObject {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.position = ["0", "0"];
|
|
11
|
+
}
|
|
12
|
+
getObjectPosition() {
|
|
13
|
+
return pipe(imageSearchState.imageBounds, O.map((bounds) => {
|
|
14
|
+
const objectRectangle = fromAlt(foldValueObject(this.detectedObject).rectangle);
|
|
15
|
+
const { x, y } = pipe(objectRectangle, scaleWithSized(bounds), center);
|
|
16
|
+
return [`${x}px`, `${y}px`];
|
|
17
|
+
}), O.getOrElse(() => ["0", "0"]));
|
|
18
|
+
}
|
|
19
|
+
selectDetectedObject() {
|
|
20
|
+
pipe(imageSearchState.imageBounds, O.map((bounds) => {
|
|
21
|
+
const rectangle = foldValueObject(this.detectedObject).rectangle;
|
|
22
|
+
const transformedRect = fromAlt(rectangle);
|
|
23
|
+
const scaledRect = scaleWithSized(bounds)(transformedRect);
|
|
24
|
+
imageSearchState.detectedObject = this.detectedObject;
|
|
25
|
+
imageSearchState.searchArea = O.some(scaledRect);
|
|
26
|
+
}));
|
|
27
|
+
makeRectangularSearchRequest();
|
|
28
|
+
}
|
|
29
|
+
isActive() {
|
|
30
|
+
if (!this.detectedObject)
|
|
31
|
+
return false;
|
|
32
|
+
if (!imageSearchState.detectedObject)
|
|
33
|
+
return false;
|
|
34
|
+
const thisObject = foldValueObject(this.detectedObject);
|
|
35
|
+
const savedObject = foldValueObject(imageSearchState.detectedObject);
|
|
36
|
+
return detectedObjectEq.equals(thisObject, savedObject);
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
return (h(Host, { class: {
|
|
40
|
+
active: this.isActive(),
|
|
41
|
+
}, onClick: () => this.selectDetectedObject(), style: {
|
|
42
|
+
"--x-position": this.getObjectPosition()[0],
|
|
43
|
+
"--y-position": this.getObjectPosition()[1],
|
|
44
|
+
} }));
|
|
45
|
+
}
|
|
46
|
+
static get is() { return "vviinn-detected-object"; }
|
|
47
|
+
static get encapsulation() { return "shadow"; }
|
|
48
|
+
static get originalStyleUrls() { return {
|
|
49
|
+
"$": ["vviinn-detected-object.css"]
|
|
50
|
+
}; }
|
|
51
|
+
static get styleUrls() { return {
|
|
52
|
+
"$": ["vviinn-detected-object.css"]
|
|
53
|
+
}; }
|
|
54
|
+
static get properties() { return {
|
|
55
|
+
"detectedObject": {
|
|
56
|
+
"type": "unknown",
|
|
57
|
+
"mutable": false,
|
|
58
|
+
"complexType": {
|
|
59
|
+
"original": "ValueObject<DetectedObject>",
|
|
60
|
+
"resolved": "Valueable<DetectedObject> & Partial<MemberObject> & Partial<Linked>",
|
|
61
|
+
"references": {
|
|
62
|
+
"ValueObject": {
|
|
63
|
+
"location": "import",
|
|
64
|
+
"path": "../../../network/ion/ValueObject"
|
|
65
|
+
},
|
|
66
|
+
"DetectedObject": {
|
|
67
|
+
"location": "import",
|
|
68
|
+
"path": "../../../searchSession/searchSession"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"required": false,
|
|
73
|
+
"optional": false,
|
|
74
|
+
"docs": {
|
|
75
|
+
"tags": [],
|
|
76
|
+
"text": ""
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}; }
|
|
80
|
+
static get states() { return {
|
|
81
|
+
"position": {}
|
|
82
|
+
}; }
|
|
83
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: grid;
|
|
3
|
+
position: relative;
|
|
4
|
+
justify-self: center;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
img {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
filter: brightness(60%);
|
|
10
|
+
position: relative;
|
|
11
|
+
-webkit-user-select: none;
|
|
12
|
+
-moz-user-select: none;
|
|
13
|
+
-ms-user-select: none;
|
|
14
|
+
user-select: none;
|
|
15
|
+
z-index: -1;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.image-preloader {
|
|
19
|
+
background: rgba(0, 0, 0, 0.25);
|
|
20
|
+
border-radius: 4px;
|
|
21
|
+
bottom: 18px;
|
|
22
|
+
padding: 4px 6px;
|
|
23
|
+
pointer-events: none;
|
|
24
|
+
position: absolute;
|
|
25
|
+
right: 18px;
|
|
26
|
+
z-index: 4;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
vviinn-preloader {
|
|
30
|
+
--preloader-size: 12px;
|
|
31
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Component, Host, h } from "@stencil/core";
|
|
2
|
+
import { imageSearchState } from "../../store/imageSearch.store";
|
|
3
|
+
import { pipe } from "fp-ts/lib/function";
|
|
4
|
+
import * as O from "fp-ts/lib/Option";
|
|
5
|
+
import { sequenceToOption } from "../../utils/option/option";
|
|
6
|
+
import { fromImage, move } from "../../geometry/Rectangle";
|
|
7
|
+
import { dimensionsFromImage, scaleByLargestSide } from "../../Image/sizing";
|
|
8
|
+
const getImageSizes = (i) => {
|
|
9
|
+
const dimensions = dimensionsFromImage(i);
|
|
10
|
+
const resize = scaleByLargestSide(288);
|
|
11
|
+
const newDimensions = resize(dimensions);
|
|
12
|
+
const sizes = newDimensions.map(d => d.size);
|
|
13
|
+
return [sizes[0], sizes[1]];
|
|
14
|
+
};
|
|
15
|
+
export class VviinnImageView {
|
|
16
|
+
handleInitialImageLoad(ev) {
|
|
17
|
+
const target = ev.target;
|
|
18
|
+
const imageBounds = fromImage(target);
|
|
19
|
+
const padding = 12;
|
|
20
|
+
const { x, y } = move(imageBounds, { x: padding, y: padding });
|
|
21
|
+
const searchArea = {
|
|
22
|
+
x,
|
|
23
|
+
y,
|
|
24
|
+
width: imageBounds.width - padding * 2,
|
|
25
|
+
height: imageBounds.height - padding * 2,
|
|
26
|
+
};
|
|
27
|
+
imageSearchState.imageBounds = O.some(imageBounds);
|
|
28
|
+
imageSearchState.searchArea = O.some(searchArea);
|
|
29
|
+
}
|
|
30
|
+
renderDetectedObject(object) {
|
|
31
|
+
return h("vviinn-detected-object", { detectedObject: object });
|
|
32
|
+
}
|
|
33
|
+
renderImage() {
|
|
34
|
+
return pipe(sequenceToOption(imageSearchState.imageUrl, imageSearchState.image), O.map(([url, refImage]) => {
|
|
35
|
+
const [width, height] = getImageSizes(refImage);
|
|
36
|
+
const image = (h("img", { decoding: "async", width: width, height: height, src: url, onLoad: (el) => this.handleInitialImageLoad(el), draggable: false }));
|
|
37
|
+
return image;
|
|
38
|
+
}), O.getOrElse(() => null));
|
|
39
|
+
}
|
|
40
|
+
renderCropper() {
|
|
41
|
+
return pipe(imageSearchState.imageUrl, O.map(() => h("image-cropper", null)), O.getOrElse(() => null));
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
return (h(Host, null,
|
|
45
|
+
imageSearchState.loading ||
|
|
46
|
+
imageSearchState.objectDetectionInProgress ? (h("div", { class: "image-preloader" },
|
|
47
|
+
h("vviinn-preloader", null))) : null,
|
|
48
|
+
h("highlight-box", null),
|
|
49
|
+
this.renderImage(),
|
|
50
|
+
this.renderCropper(),
|
|
51
|
+
imageSearchState.detectedObjects.map((o) => this.renderDetectedObject(o))));
|
|
52
|
+
}
|
|
53
|
+
static get is() { return "vviinn-image-view"; }
|
|
54
|
+
static get encapsulation() { return "shadow"; }
|
|
55
|
+
static get originalStyleUrls() { return {
|
|
56
|
+
"$": ["vviinn-image-view.css"]
|
|
57
|
+
}; }
|
|
58
|
+
static get styleUrls() { return {
|
|
59
|
+
"$": ["vviinn-image-view.css"]
|
|
60
|
+
}; }
|
|
61
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
background: white;
|
|
3
|
+
border-radius: 4px;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
display: grid;
|
|
6
|
+
grid-template-rows: -webkit-min-content auto;
|
|
7
|
+
grid-template-rows: min-content auto;
|
|
8
|
+
max-width: 960px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@media (max-width: 415px) {
|
|
12
|
+
:host {
|
|
13
|
+
-webkit-animation-name: fade-in;
|
|
14
|
+
animation-name: fade-in;
|
|
15
|
+
-webkit-animation-duration: 0.5s;
|
|
16
|
+
animation-duration: 0.5s;
|
|
17
|
+
-webkit-animation-fill-mode: forwards;
|
|
18
|
+
animation-fill-mode: forwards;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:host(.closed) {
|
|
22
|
+
-webkit-animation-name: fade-out;
|
|
23
|
+
animation-name: fade-out;
|
|
24
|
+
-webkit-animation-fill-mode: none;
|
|
25
|
+
animation-fill-mode: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.body {
|
|
29
|
+
overflow-y: auto;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@media (max-width: 640px) and (min-width: 415px) {
|
|
34
|
+
:host {
|
|
35
|
+
max-width: 80%;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.head {
|
|
40
|
+
align-items: center;
|
|
41
|
+
border-bottom: 1px solid #F4F4F4;
|
|
42
|
+
display: grid;
|
|
43
|
+
grid-gap: 16px;
|
|
44
|
+
grid-template-columns: -webkit-min-content auto -webkit-min-content;
|
|
45
|
+
grid-template-columns: min-content auto min-content;
|
|
46
|
+
justify-items: center;
|
|
47
|
+
padding: 16px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.title {
|
|
51
|
+
font-weight: 600;
|
|
52
|
+
font-size: 18px;
|
|
53
|
+
line-height: 24px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
button {
|
|
57
|
+
-webkit-appearance: none;
|
|
58
|
+
-moz-appearance: none;
|
|
59
|
+
appearance: none;
|
|
60
|
+
background: none;
|
|
61
|
+
border: none;
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
display: grid;
|
|
64
|
+
padding: unset;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@-webkit-keyframes fade-in {
|
|
68
|
+
from {
|
|
69
|
+
transform: translateY(100%);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
to {
|
|
73
|
+
transform: translateY(0);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@keyframes fade-in {
|
|
78
|
+
from {
|
|
79
|
+
transform: translateY(100%);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
to {
|
|
83
|
+
transform: translateY(0);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@-webkit-keyframes fade-out {
|
|
88
|
+
from {
|
|
89
|
+
transform: translateY(0);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
to {
|
|
93
|
+
transform: translateY(100%);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@keyframes fade-out {
|
|
98
|
+
from {
|
|
99
|
+
transform: translateY(0);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
to {
|
|
103
|
+
transform: translateY(100%);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { Component, Host, h, State, Event, Prop } from "@stencil/core";
|
|
2
|
+
export class VviinnModal {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.active = false;
|
|
5
|
+
this.slider = false;
|
|
6
|
+
}
|
|
7
|
+
close() {
|
|
8
|
+
this.active = false;
|
|
9
|
+
setTimeout(() => {
|
|
10
|
+
this.modalClosed.emit();
|
|
11
|
+
}, this.slider ? 500 : 0);
|
|
12
|
+
}
|
|
13
|
+
handleAnimationEnd(ev) {
|
|
14
|
+
if (ev.animationName !== "fade-in")
|
|
15
|
+
return;
|
|
16
|
+
this.slider = true;
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
return (h(Host, { exportparts: "secondary-action, title, close-button", class: { closed: !this.active }, onAnimationEnd: (ev) => this.handleAnimationEnd(ev) },
|
|
20
|
+
h("div", { class: "head" },
|
|
21
|
+
h("button", { part: "secondary-action", onClick: () => this.secondaryActionClicked.emit() },
|
|
22
|
+
h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
23
|
+
h("path", { d: "M20.25 12H3.75", stroke: "#161616", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }),
|
|
24
|
+
h("path", { d: "M10.5 5.25L3.75 12L10.5 18.75", stroke: "#161616", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }))),
|
|
25
|
+
h("div", { class: "title", part: "title" }, "Bildsuche"),
|
|
26
|
+
h("button", { onClick: () => this.close(), class: "close-button", part: "close-button" },
|
|
27
|
+
h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
28
|
+
h("path", { d: "M16 1.4L14.6 0L8 6.6L1.4 0L0 1.4L6.6 8L0 14.6L1.4 16L8 9.4L14.6 16L16 14.6L9.4 8L16 1.4Z", fill: "#333333" })))),
|
|
29
|
+
h("div", { class: "body" },
|
|
30
|
+
h("slot", null))));
|
|
31
|
+
}
|
|
32
|
+
static get is() { return "vviinn-modal"; }
|
|
33
|
+
static get encapsulation() { return "shadow"; }
|
|
34
|
+
static get originalStyleUrls() { return {
|
|
35
|
+
"$": ["vviinn-modal.css"]
|
|
36
|
+
}; }
|
|
37
|
+
static get styleUrls() { return {
|
|
38
|
+
"$": ["vviinn-modal.css"]
|
|
39
|
+
}; }
|
|
40
|
+
static get properties() { return {
|
|
41
|
+
"active": {
|
|
42
|
+
"type": "boolean",
|
|
43
|
+
"mutable": true,
|
|
44
|
+
"complexType": {
|
|
45
|
+
"original": "boolean",
|
|
46
|
+
"resolved": "boolean",
|
|
47
|
+
"references": {}
|
|
48
|
+
},
|
|
49
|
+
"required": false,
|
|
50
|
+
"optional": false,
|
|
51
|
+
"docs": {
|
|
52
|
+
"tags": [],
|
|
53
|
+
"text": ""
|
|
54
|
+
},
|
|
55
|
+
"attribute": "active",
|
|
56
|
+
"reflect": true,
|
|
57
|
+
"defaultValue": "false"
|
|
58
|
+
}
|
|
59
|
+
}; }
|
|
60
|
+
static get states() { return {
|
|
61
|
+
"slider": {}
|
|
62
|
+
}; }
|
|
63
|
+
static get events() { return [{
|
|
64
|
+
"method": "modalClosed",
|
|
65
|
+
"name": "modalClosed",
|
|
66
|
+
"bubbles": true,
|
|
67
|
+
"cancelable": true,
|
|
68
|
+
"composed": true,
|
|
69
|
+
"docs": {
|
|
70
|
+
"tags": [],
|
|
71
|
+
"text": "Event emitted when close button clicked and close animation ends"
|
|
72
|
+
},
|
|
73
|
+
"complexType": {
|
|
74
|
+
"original": "AnimationEvent",
|
|
75
|
+
"resolved": "AnimationEvent",
|
|
76
|
+
"references": {
|
|
77
|
+
"AnimationEvent": {
|
|
78
|
+
"location": "global"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}, {
|
|
83
|
+
"method": "secondaryActionClicked",
|
|
84
|
+
"name": "secondaryActionClicked",
|
|
85
|
+
"bubbles": true,
|
|
86
|
+
"cancelable": true,
|
|
87
|
+
"composed": true,
|
|
88
|
+
"docs": {
|
|
89
|
+
"tags": [],
|
|
90
|
+
"text": "Event emitted when secondary action button clicked"
|
|
91
|
+
},
|
|
92
|
+
"complexType": {
|
|
93
|
+
"original": "void",
|
|
94
|
+
"resolved": "void",
|
|
95
|
+
"references": {}
|
|
96
|
+
}
|
|
97
|
+
}]; }
|
|
98
|
+
}
|