vviinn-widgets 2.18.21 → 2.19.1
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/{index-cb410762.js → Campaign-a94a827a.js} +17 -1
- package/dist/cjs/cropper-handler_29.cjs.entry.js +1418 -0
- package/dist/cjs/{imageSearch.store-98824653.js → index-48c94264.js} +16016 -11171
- package/dist/cjs/{index-7f1325a7.js → index-a4becaff.js} +683 -303
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/{vviinn-carousel_3.cjs.entry.js → vviinn-carousel_2.cjs.entry.js} +150 -270
- package/dist/cjs/vviinn-recommendations-sidebar.cjs.entry.js +14 -8
- package/dist/cjs/vviinn-vpr-button.cjs.entry.js +12 -14
- package/dist/cjs/vviinn-widgets.cjs.js +10 -3
- package/dist/collection/Image/sizing.spec.js +66 -0
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/image-search/image-view/highlight-box/highlight-box.css +2 -16
- package/dist/collection/components/image-search/image-view/highlight-box/highlight-box.js +11 -7
- package/dist/collection/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.css +0 -1
- package/dist/collection/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.js +40 -37
- package/dist/collection/components/image-search/image-view/image-cropper/image-cropper.js +73 -67
- package/dist/collection/components/image-search/search-filters/search-filters.css +4 -23
- package/dist/collection/components/image-search/search-filters/search-filters.js +97 -91
- package/dist/collection/components/vviinn-button/vviinn-button.js +34 -31
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.css +1 -2
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.js +161 -156
- package/dist/collection/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.js +12 -14
- package/dist/collection/components/vviinn-error/vviinn-error.js +12 -12
- package/dist/collection/components/vviinn-error/vviinn-server-error/vviinn-server-error.js +35 -30
- package/dist/collection/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.js +35 -30
- package/dist/collection/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.js +129 -121
- package/dist/collection/components/vviinn-example-images/vviinn-example-images.js +75 -75
- package/dist/collection/components/vviinn-icons/index.js +10 -27
- package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.js +120 -67
- package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.js +81 -69
- package/dist/collection/components/vviinn-image-view/vviinn-image-view.css +0 -1
- package/dist/collection/components/vviinn-image-view/vviinn-image-view.js +27 -28
- package/dist/collection/components/vviinn-modal/vviinn-modal.css +7 -36
- package/dist/collection/components/vviinn-modal/vviinn-modal.js +115 -93
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-1/vviinn-onboarding-card-1.js +12 -14
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-2/vviinn-onboarding-card-2.js +12 -14
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-3/vviinn-onboarding-card-3.js +12 -14
- package/dist/collection/components/vviinn-onboarding/vviinn-onboarding.js +12 -17
- package/dist/collection/components/vviinn-overlay/vviinn-overlay.css +1 -12
- package/dist/collection/components/vviinn-overlay/vviinn-overlay.js +12 -9
- package/dist/collection/components/vviinn-overlayed-modal/vviinn-overlayed-modal.js +107 -78
- package/dist/collection/components/vviinn-preloader/vviinn-preloader.css +1 -11
- package/dist/collection/components/vviinn-preloader/vviinn-preloader.js +11 -7
- package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.css +0 -1
- package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.js +12 -16
- package/dist/collection/components/vviinn-product-card/render-helpers.js +6 -14
- package/dist/collection/components/vviinn-product-card/vviinn-product-card.js +425 -415
- package/dist/collection/components/vviinn-slider/arrow.js +1 -2
- package/dist/collection/components/vviinn-slider/vviinn-slide/vviinn-slide.js +12 -9
- package/dist/collection/components/vviinn-slider/vviinn-slider.css +0 -1
- package/dist/collection/components/vviinn-slider/vviinn-slider.js +87 -82
- package/dist/collection/components/vviinn-teaser/vviinn-teaser.js +12 -18
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.css +12 -64
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js +371 -360
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +448 -444
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +545 -542
- package/dist/collection/components/vviinn-vps-button/stories/vviinn-vps-button.stories.js +2 -0
- package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +368 -332
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.css +0 -5
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.e2e.js +26 -0
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +502 -425
- package/dist/collection/geometry/Clip.spec.js +16 -0
- package/dist/collection/geometry/Rectangle.spec.js +66 -0
- package/dist/collection/geometry/Sized.spec.js +16 -0
- package/dist/collection/interfaces/generated.js +0 -4
- package/dist/collection/network/ion/Form.spec.js +43 -0
- package/dist/esm/{index-b31d86ce.js → Campaign-4aa53f29.js} +15 -2
- package/dist/esm/cropper-handler_29.entry.js +1386 -0
- package/dist/esm/{index-590cb67e.js → index-48ef9564.js} +683 -304
- package/dist/esm/{imageSearch.store-9dde5360.js → index-976acf7e.js} +16124 -11292
- package/dist/esm/loader.js +4 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/{vviinn-carousel_3.entry.js → vviinn-carousel_2.entry.js} +106 -225
- package/dist/esm/vviinn-recommendations-sidebar.entry.js +13 -7
- package/dist/esm/vviinn-vpr-button.entry.js +11 -13
- package/dist/esm/vviinn-widgets.js +7 -3
- package/dist/loader/index.d.ts +9 -0
- package/dist/loader/package.json +1 -0
- package/dist/types/Image/sizing.d.ts +4 -4
- package/dist/types/campaign/Campaign.d.ts +5 -5
- package/dist/types/campaign/VCSCampaignResponse.d.ts +1 -1
- package/dist/types/components/vviinn-carousel/vviinn-carousel.d.ts +2 -2
- package/dist/types/components/vviinn-image-selector/vviinn-image-selector.d.ts +4 -0
- package/dist/types/components/vviinn-modal/vviinn-modal.d.ts +2 -0
- package/dist/types/components/vviinn-overlayed-modal/vviinn-overlayed-modal.d.ts +2 -0
- package/dist/types/components/vviinn-product-card/render-helpers.d.ts +3 -3
- package/dist/types/components/vviinn-slider/arrow.d.ts +2 -2
- package/dist/types/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.d.ts +2 -2
- package/dist/types/components/vviinn-vps-button/vviinn-vps-button.d.ts +9 -4
- package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +8 -0
- package/dist/types/components.d.ts +154 -54
- package/dist/types/error.d.ts +1 -1
- package/dist/types/geometry/Point.d.ts +1 -1
- package/dist/types/geometry/Rectangle.d.ts +1 -1
- package/dist/types/geometry/Sized.d.ts +1 -1
- package/dist/types/interfaces/generated.d.ts +192 -371
- package/dist/types/network/ion/File.d.ts +2 -2
- package/dist/types/network/ion/Form.d.ts +5 -5
- package/dist/types/network/ion/Link.d.ts +1 -1
- package/dist/types/network/ion/ValueObject.d.ts +4 -4
- package/dist/types/network/utils.d.ts +3 -3
- package/dist/types/recommendation/events.d.ts +5 -5
- package/dist/types/recommendation/recommendation.d.ts +1 -1
- package/dist/types/searchSession/searchSession.d.ts +7 -7
- package/dist/types/slider/GridMode.d.ts +1 -1
- package/dist/types/stencil-public-runtime.d.ts +98 -23
- package/dist/types/store/imageSearch.store.d.ts +1 -1
- package/dist/types/tracking/models.d.ts +2 -2
- package/dist/types/utils/event/Events.d.ts +1 -1
- package/dist/vviinn-widgets/p-312b0eb7.entry.js +1 -0
- package/dist/vviinn-widgets/p-414b2291.js +1 -0
- package/dist/vviinn-widgets/p-5b50c7e5.entry.js +1 -0
- package/dist/vviinn-widgets/p-8deaa5da.entry.js +1 -0
- package/dist/vviinn-widgets/p-c6209bc1.entry.js +1 -0
- package/{www/build/p-2f9ee951.js → dist/vviinn-widgets/p-d08ce429.js} +1 -1
- package/dist/vviinn-widgets/p-fa17e81f.js +2 -0
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +12 -12
- package/www/build/p-312b0eb7.entry.js +1 -0
- package/www/build/p-414b2291.js +1 -0
- package/www/build/p-5b50c7e5.entry.js +1 -0
- package/www/build/p-8deaa5da.entry.js +1 -0
- package/www/build/p-c6209bc1.entry.js +1 -0
- package/{dist/vviinn-widgets/p-2f9ee951.js → www/build/p-d08ce429.js} +1 -1
- package/www/build/p-d39b7d70.js +161 -0
- package/www/build/p-fa17e81f.js +2 -0
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +2 -2
- package/dist/cjs/Campaign-13258569.js +0 -18
- package/dist/cjs/Handler-176539c8.js +0 -331
- package/dist/cjs/cropper-handler.cjs.entry.js +0 -27
- package/dist/cjs/customized-slots-6e56c354.js +0 -54
- package/dist/cjs/highlight-box_22.cjs.entry.js +0 -770
- package/dist/cjs/index-a99edb90.js +0 -3235
- package/dist/cjs/vviinn-button.cjs.entry.js +0 -21
- package/dist/cjs/vviinn-error.cjs.entry.js +0 -19
- package/dist/cjs/vviinn-preloader.cjs.entry.js +0 -26
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +0 -65
- package/dist/cjs/vviinn-vps-widget.cjs.entry.js +0 -251
- package/dist/esm/Campaign-90ba7e06.js +0 -14
- package/dist/esm/Handler-f9b8735c.js +0 -309
- package/dist/esm/cropper-handler.entry.js +0 -23
- package/dist/esm/customized-slots-00afe247.js +0 -51
- package/dist/esm/highlight-box_22.entry.js +0 -745
- package/dist/esm/index-4d5b52ba.js +0 -3224
- package/dist/esm/vviinn-button.entry.js +0 -17
- package/dist/esm/vviinn-error.entry.js +0 -15
- package/dist/esm/vviinn-preloader.entry.js +0 -22
- package/dist/esm/vviinn-vps-button.entry.js +0 -61
- package/dist/esm/vviinn-vps-widget.entry.js +0 -247
- package/dist/vviinn-widgets/p-11f61564.js +0 -1
- package/dist/vviinn-widgets/p-12851e97.entry.js +0 -1
- package/dist/vviinn-widgets/p-18fd769b.js +0 -1
- package/dist/vviinn-widgets/p-339c6838.js +0 -1
- package/dist/vviinn-widgets/p-3b2c91c0.entry.js +0 -1
- package/dist/vviinn-widgets/p-45df9f28.entry.js +0 -1
- package/dist/vviinn-widgets/p-57ed5303.entry.js +0 -1
- package/dist/vviinn-widgets/p-69850e5b.js +0 -1
- package/dist/vviinn-widgets/p-7c2f762a.entry.js +0 -1
- package/dist/vviinn-widgets/p-7c3b7388.entry.js +0 -1
- package/dist/vviinn-widgets/p-85006f41.entry.js +0 -1
- package/dist/vviinn-widgets/p-8a3dd76d.entry.js +0 -1
- package/dist/vviinn-widgets/p-99e58be7.entry.js +0 -1
- package/dist/vviinn-widgets/p-a2b450b6.entry.js +0 -1
- package/dist/vviinn-widgets/p-bcc1ccf0.js +0 -1
- package/dist/vviinn-widgets/p-e6fee8d2.js +0 -1
- package/www/build/p-11f61564.js +0 -1
- package/www/build/p-12851e97.entry.js +0 -1
- package/www/build/p-18fd769b.js +0 -1
- package/www/build/p-339c6838.js +0 -1
- package/www/build/p-3b2c91c0.entry.js +0 -1
- package/www/build/p-45df9f28.entry.js +0 -1
- package/www/build/p-57ed5303.entry.js +0 -1
- package/www/build/p-69850e5b.js +0 -1
- package/www/build/p-7c2f762a.entry.js +0 -1
- package/www/build/p-7c3b7388.entry.js +0 -1
- package/www/build/p-85006f41.entry.js +0 -1
- package/www/build/p-8a3dd76d.entry.js +0 -1
- package/www/build/p-99e58be7.entry.js +0 -1
- package/www/build/p-9e2c131a.js +0 -125
- package/www/build/p-a2b450b6.entry.js +0 -1
- package/www/build/p-bcc1ccf0.js +0 -1
- package/www/build/p-e6fee8d2.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Host, h, } from "@stencil/core";
|
|
2
2
|
import * as E from "fp-ts/Either";
|
|
3
3
|
import { pipe } from "fp-ts/lib/function";
|
|
4
4
|
import { imageSearchState, processSelectedFile, } from "../../store/imageSearch.store";
|
|
@@ -6,6 +6,11 @@ import { imageSearchState, processSelectedFile, } from "../../store/imageSearch.
|
|
|
6
6
|
* @part button - button look and feel
|
|
7
7
|
*/
|
|
8
8
|
export class VviinnImageSelector {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.basicEventData = undefined;
|
|
11
|
+
this.startUpload = undefined;
|
|
12
|
+
this.resetVpsButton = undefined;
|
|
13
|
+
}
|
|
9
14
|
async handleInputChange(event) {
|
|
10
15
|
const input = event.target;
|
|
11
16
|
const processingResult = await processSelectedFile(input.files[0]);
|
|
@@ -15,82 +20,130 @@ export class VviinnImageSelector {
|
|
|
15
20
|
isLoading() {
|
|
16
21
|
return imageSearchState.loading;
|
|
17
22
|
}
|
|
23
|
+
startUploadWatcher(upload) {
|
|
24
|
+
if (upload) {
|
|
25
|
+
this.fileInput.click();
|
|
26
|
+
this.resetVpsButton();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
18
29
|
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) })));
|
|
30
|
+
return (h(Host, { exportparts: "button" }, this.isLoading() ? h("vviinn-preloader", null) : null, this.isLoading() ? null : (h("label", { htmlFor: "fileInput", part: "button" }, h("slot", { name: "upload-button-text" }, "Upload image"))), h("input", { id: "fileInput", class: "visually-hidden", type: "file", accept: "image/*", onChange: (event) => this.handleInputChange(event), ref: (el) => (this.fileInput = el) })));
|
|
24
31
|
}
|
|
25
32
|
static get is() { return "vviinn-image-selector"; }
|
|
26
33
|
static get encapsulation() { return "shadow"; }
|
|
27
|
-
static get originalStyleUrls() {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
static get originalStyleUrls() {
|
|
35
|
+
return {
|
|
36
|
+
"$": ["vviinn-image-selector.css"]
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
static get styleUrls() {
|
|
40
|
+
return {
|
|
41
|
+
"$": ["vviinn-image-selector.css"]
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
static get properties() {
|
|
45
|
+
return {
|
|
46
|
+
"basicEventData": {
|
|
47
|
+
"type": "unknown",
|
|
48
|
+
"mutable": false,
|
|
49
|
+
"complexType": {
|
|
50
|
+
"original": "BasicEventData",
|
|
51
|
+
"resolved": "{ widgetType: WidgetType; campaignTypeId: CampaignTypeId; campaignTypeName: CampaignTypeTitle; widgetId?: string; }",
|
|
52
|
+
"references": {
|
|
53
|
+
"BasicEventData": {
|
|
54
|
+
"location": "import",
|
|
55
|
+
"path": "../../recommendation/events"
|
|
56
|
+
}
|
|
44
57
|
}
|
|
58
|
+
},
|
|
59
|
+
"required": false,
|
|
60
|
+
"optional": false,
|
|
61
|
+
"docs": {
|
|
62
|
+
"tags": [],
|
|
63
|
+
"text": ""
|
|
45
64
|
}
|
|
46
65
|
},
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"
|
|
63
|
-
"text": "Event fires when user select file"
|
|
66
|
+
"startUpload": {
|
|
67
|
+
"type": "boolean",
|
|
68
|
+
"mutable": false,
|
|
69
|
+
"complexType": {
|
|
70
|
+
"original": "boolean",
|
|
71
|
+
"resolved": "boolean",
|
|
72
|
+
"references": {}
|
|
73
|
+
},
|
|
74
|
+
"required": false,
|
|
75
|
+
"optional": false,
|
|
76
|
+
"docs": {
|
|
77
|
+
"tags": [],
|
|
78
|
+
"text": ""
|
|
79
|
+
},
|
|
80
|
+
"attribute": "start-upload",
|
|
81
|
+
"reflect": false
|
|
64
82
|
},
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
83
|
+
"resetVpsButton": {
|
|
84
|
+
"type": "unknown",
|
|
85
|
+
"mutable": false,
|
|
86
|
+
"complexType": {
|
|
87
|
+
"original": "() => void",
|
|
88
|
+
"resolved": "() => void",
|
|
89
|
+
"references": {}
|
|
90
|
+
},
|
|
91
|
+
"required": false,
|
|
92
|
+
"optional": false,
|
|
93
|
+
"docs": {
|
|
94
|
+
"tags": [],
|
|
95
|
+
"text": ""
|
|
73
96
|
}
|
|
74
97
|
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
|
|
91
|
-
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
static get events() {
|
|
101
|
+
return [{
|
|
102
|
+
"method": "vviinnImageUpload",
|
|
103
|
+
"name": "vviinnImageUpload",
|
|
104
|
+
"bubbles": true,
|
|
105
|
+
"cancelable": true,
|
|
106
|
+
"composed": true,
|
|
107
|
+
"docs": {
|
|
108
|
+
"tags": [],
|
|
109
|
+
"text": "Event fires when user select file"
|
|
110
|
+
},
|
|
111
|
+
"complexType": {
|
|
112
|
+
"original": "BasicEventData",
|
|
113
|
+
"resolved": "{ widgetType: WidgetType; campaignTypeId: CampaignTypeId; campaignTypeName: CampaignTypeTitle; widgetId?: string; }",
|
|
114
|
+
"references": {
|
|
115
|
+
"BasicEventData": {
|
|
116
|
+
"location": "import",
|
|
117
|
+
"path": "../../recommendation/events"
|
|
118
|
+
}
|
|
92
119
|
}
|
|
93
120
|
}
|
|
94
|
-
}
|
|
95
|
-
|
|
121
|
+
}, {
|
|
122
|
+
"method": "vviinnNoResult",
|
|
123
|
+
"name": "vviinnNoResult",
|
|
124
|
+
"bubbles": true,
|
|
125
|
+
"cancelable": true,
|
|
126
|
+
"composed": true,
|
|
127
|
+
"docs": {
|
|
128
|
+
"tags": [],
|
|
129
|
+
"text": "Event fires when user select file that no .jpg, .jpeg or png"
|
|
130
|
+
},
|
|
131
|
+
"complexType": {
|
|
132
|
+
"original": "BasicEventData",
|
|
133
|
+
"resolved": "{ widgetType: WidgetType; campaignTypeId: CampaignTypeId; campaignTypeName: CampaignTypeTitle; widgetId?: string; }",
|
|
134
|
+
"references": {
|
|
135
|
+
"BasicEventData": {
|
|
136
|
+
"location": "import",
|
|
137
|
+
"path": "../../recommendation/events"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}];
|
|
142
|
+
}
|
|
143
|
+
static get watchers() {
|
|
144
|
+
return [{
|
|
145
|
+
"propName": "startUpload",
|
|
146
|
+
"methodName": "startUploadWatcher"
|
|
147
|
+
}];
|
|
148
|
+
}
|
|
96
149
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Host, h, } from "@stencil/core";
|
|
2
2
|
import { pipe } from "fp-ts/lib/function";
|
|
3
3
|
import * as O from "fp-ts/lib/Option";
|
|
4
4
|
import { foldValueObject } from "../../../network/ion/ValueObject";
|
|
@@ -7,6 +7,8 @@ import { fromAlt, scaleWithSized, center } from "../../../geometry/Rectangle";
|
|
|
7
7
|
import { imageSearchState, makeRectangularSearchRequest, } from "../../../store/imageSearch.store";
|
|
8
8
|
export class VviinnDetectedObject {
|
|
9
9
|
constructor() {
|
|
10
|
+
this.detectedObject = undefined;
|
|
11
|
+
this.basicEventData = undefined;
|
|
10
12
|
this.position = ["0", "0"];
|
|
11
13
|
}
|
|
12
14
|
getObjectPosition() {
|
|
@@ -46,80 +48,90 @@ export class VviinnDetectedObject {
|
|
|
46
48
|
}
|
|
47
49
|
static get is() { return "vviinn-detected-object"; }
|
|
48
50
|
static get encapsulation() { return "shadow"; }
|
|
49
|
-
static get originalStyleUrls() {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
|
|
51
|
+
static get originalStyleUrls() {
|
|
52
|
+
return {
|
|
53
|
+
"$": ["vviinn-detected-object.css"]
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
static get styleUrls() {
|
|
57
|
+
return {
|
|
58
|
+
"$": ["vviinn-detected-object.css"]
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
static get properties() {
|
|
62
|
+
return {
|
|
63
|
+
"detectedObject": {
|
|
64
|
+
"type": "unknown",
|
|
65
|
+
"mutable": false,
|
|
66
|
+
"complexType": {
|
|
67
|
+
"original": "ValueObject<DetectedObject>",
|
|
68
|
+
"resolved": "Valueable<DetectedObject> & Partial<MemberObject> & Partial<Linked>",
|
|
69
|
+
"references": {
|
|
70
|
+
"ValueObject": {
|
|
71
|
+
"location": "import",
|
|
72
|
+
"path": "../../../network/ion/ValueObject"
|
|
73
|
+
},
|
|
74
|
+
"DetectedObject": {
|
|
75
|
+
"location": "import",
|
|
76
|
+
"path": "../../../searchSession/searchSession"
|
|
77
|
+
}
|
|
70
78
|
}
|
|
79
|
+
},
|
|
80
|
+
"required": false,
|
|
81
|
+
"optional": false,
|
|
82
|
+
"docs": {
|
|
83
|
+
"tags": [],
|
|
84
|
+
"text": ""
|
|
71
85
|
}
|
|
72
86
|
},
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"original": "BasicEventData",
|
|
85
|
-
"resolved": "{ widgetType: WidgetType; campaignTypeId: CampaignTypeId; campaignTypeName: CampaignTypeTitle; widgetId?: string; }",
|
|
86
|
-
"references": {
|
|
87
|
-
"BasicEventData": {
|
|
88
|
-
"location": "import",
|
|
89
|
-
"path": "../../../recommendation/events"
|
|
87
|
+
"basicEventData": {
|
|
88
|
+
"type": "unknown",
|
|
89
|
+
"mutable": false,
|
|
90
|
+
"complexType": {
|
|
91
|
+
"original": "BasicEventData",
|
|
92
|
+
"resolved": "{ widgetType: WidgetType; campaignTypeId: CampaignTypeId; campaignTypeName: CampaignTypeTitle; widgetId?: string; }",
|
|
93
|
+
"references": {
|
|
94
|
+
"BasicEventData": {
|
|
95
|
+
"location": "import",
|
|
96
|
+
"path": "../../../recommendation/events"
|
|
97
|
+
}
|
|
90
98
|
}
|
|
99
|
+
},
|
|
100
|
+
"required": false,
|
|
101
|
+
"optional": false,
|
|
102
|
+
"docs": {
|
|
103
|
+
"tags": [],
|
|
104
|
+
"text": ""
|
|
91
105
|
}
|
|
92
|
-
},
|
|
93
|
-
"required": false,
|
|
94
|
-
"optional": false,
|
|
95
|
-
"docs": {
|
|
96
|
-
"tags": [],
|
|
97
|
-
"text": ""
|
|
98
106
|
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
static get states() {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
|
|
120
|
-
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
static get states() {
|
|
110
|
+
return {
|
|
111
|
+
"position": {}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
static get events() {
|
|
115
|
+
return [{
|
|
116
|
+
"method": "vviinnSelectObject",
|
|
117
|
+
"name": "vviinnSelectObject",
|
|
118
|
+
"bubbles": true,
|
|
119
|
+
"cancelable": true,
|
|
120
|
+
"composed": true,
|
|
121
|
+
"docs": {
|
|
122
|
+
"tags": [],
|
|
123
|
+
"text": ""
|
|
124
|
+
},
|
|
125
|
+
"complexType": {
|
|
126
|
+
"original": "SelectObjectEventData",
|
|
127
|
+
"resolved": "BasicEventData & { detectedObject: ValueObject<DetectedObject>; }",
|
|
128
|
+
"references": {
|
|
129
|
+
"SelectObjectEventData": {
|
|
130
|
+
"location": "import",
|
|
131
|
+
"path": "../../../recommendation/events"
|
|
132
|
+
}
|
|
121
133
|
}
|
|
122
134
|
}
|
|
123
|
-
}
|
|
124
|
-
|
|
135
|
+
}];
|
|
136
|
+
}
|
|
125
137
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
2
|
import { imageSearchState } from "../../store/imageSearch.store";
|
|
3
3
|
import { pipe } from "fp-ts/lib/function";
|
|
4
4
|
import * as O from "fp-ts/lib/Option";
|
|
@@ -14,6 +14,9 @@ const getImageSizes = (i) => {
|
|
|
14
14
|
return [sizes[0], sizes[1]];
|
|
15
15
|
};
|
|
16
16
|
export class VviinnImageView {
|
|
17
|
+
constructor() {
|
|
18
|
+
this.basicEventData = undefined;
|
|
19
|
+
}
|
|
17
20
|
handleInitialImageLoad(ev) {
|
|
18
21
|
const target = ev.target;
|
|
19
22
|
const imageBounds = fromImage(target);
|
|
@@ -42,38 +45,34 @@ export class VviinnImageView {
|
|
|
42
45
|
return pipe(imageSearchState.imageUrl, O.map(() => h("image-cropper", { basicEventData: this.basicEventData })), O.getOrElse(() => null));
|
|
43
46
|
}
|
|
44
47
|
render() {
|
|
45
|
-
return (h(Host, null,
|
|
46
|
-
imageSearchState.
|
|
47
|
-
imageSearchState.objectDetectionInProgress ? (h("div", { class: "image-preloader" },
|
|
48
|
-
h("vviinn-preloader", null))) : null,
|
|
49
|
-
h("highlight-box", null),
|
|
50
|
-
this.renderImage(),
|
|
51
|
-
this.renderCropper(),
|
|
52
|
-
imageSearchState.detectedObjects.map((o) => this.renderDetectedObject(o))));
|
|
48
|
+
return (h(Host, null, imageSearchState.loading ||
|
|
49
|
+
imageSearchState.objectDetectionInProgress ? (h("div", { class: "image-preloader" }, h("vviinn-preloader", null))) : null, h("highlight-box", null), this.renderImage(), this.renderCropper(), imageSearchState.detectedObjects.map((o) => this.renderDetectedObject(o))));
|
|
53
50
|
}
|
|
54
51
|
static get is() { return "vviinn-image-view"; }
|
|
55
52
|
static get encapsulation() { return "shadow"; }
|
|
56
53
|
static get styles() { return styles; }
|
|
57
|
-
static get properties() {
|
|
58
|
-
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
|
|
54
|
+
static get properties() {
|
|
55
|
+
return {
|
|
56
|
+
"basicEventData": {
|
|
57
|
+
"type": "unknown",
|
|
58
|
+
"mutable": false,
|
|
59
|
+
"complexType": {
|
|
60
|
+
"original": "BasicEventData",
|
|
61
|
+
"resolved": "{ widgetType: WidgetType; campaignTypeId: CampaignTypeId; campaignTypeName: CampaignTypeTitle; widgetId?: string; }",
|
|
62
|
+
"references": {
|
|
63
|
+
"BasicEventData": {
|
|
64
|
+
"location": "import",
|
|
65
|
+
"path": "../../recommendation/events"
|
|
66
|
+
}
|
|
68
67
|
}
|
|
68
|
+
},
|
|
69
|
+
"required": false,
|
|
70
|
+
"optional": false,
|
|
71
|
+
"docs": {
|
|
72
|
+
"tags": [],
|
|
73
|
+
"text": ""
|
|
69
74
|
}
|
|
70
|
-
},
|
|
71
|
-
"required": false,
|
|
72
|
-
"optional": false,
|
|
73
|
-
"docs": {
|
|
74
|
-
"tags": [],
|
|
75
|
-
"text": ""
|
|
76
75
|
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
79
78
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
border-radius: 4px;
|
|
4
4
|
box-sizing: border-box;
|
|
5
5
|
display: grid;
|
|
6
|
-
grid-template-rows: -webkit-min-content auto;
|
|
7
6
|
grid-template-rows: min-content auto;
|
|
8
7
|
max-width: 960px;
|
|
9
8
|
overflow: auto;
|
|
@@ -11,19 +10,14 @@
|
|
|
11
10
|
|
|
12
11
|
@media (max-width: 415px) {
|
|
13
12
|
:host {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
animation-duration: 0.5s;
|
|
18
|
-
-webkit-animation-fill-mode: forwards;
|
|
19
|
-
animation-fill-mode: forwards;
|
|
13
|
+
animation-name: fade-in;
|
|
14
|
+
animation-duration: 0.5s;
|
|
15
|
+
animation-fill-mode: forwards;
|
|
20
16
|
}
|
|
21
17
|
|
|
22
18
|
:host(.closed) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
-webkit-animation-fill-mode: none;
|
|
26
|
-
animation-fill-mode: none;
|
|
19
|
+
animation-name: fade-out;
|
|
20
|
+
animation-fill-mode: none;
|
|
27
21
|
}
|
|
28
22
|
|
|
29
23
|
.body {
|
|
@@ -40,11 +34,7 @@
|
|
|
40
34
|
.head {
|
|
41
35
|
align-items: center;
|
|
42
36
|
border-bottom: 1px solid #f4f4f4;
|
|
43
|
-
display:
|
|
44
|
-
grid-gap: 16px;
|
|
45
|
-
grid-template-columns: -webkit-min-content auto -webkit-min-content;
|
|
46
|
-
grid-template-columns: min-content auto min-content;
|
|
47
|
-
justify-items: center;
|
|
37
|
+
display: flex;
|
|
48
38
|
padding: 16px;
|
|
49
39
|
}
|
|
50
40
|
|
|
@@ -52,6 +42,7 @@
|
|
|
52
42
|
font-weight: 600;
|
|
53
43
|
font-size: 18px;
|
|
54
44
|
line-height: 24px;
|
|
45
|
+
margin: 0 auto;
|
|
55
46
|
}
|
|
56
47
|
|
|
57
48
|
button {
|
|
@@ -65,16 +56,6 @@ button {
|
|
|
65
56
|
padding: unset;
|
|
66
57
|
}
|
|
67
58
|
|
|
68
|
-
@-webkit-keyframes fade-in {
|
|
69
|
-
from {
|
|
70
|
-
transform: translateY(100%);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
to {
|
|
74
|
-
transform: translateY(0);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
59
|
@keyframes fade-in {
|
|
79
60
|
from {
|
|
80
61
|
transform: translateY(100%);
|
|
@@ -85,16 +66,6 @@ button {
|
|
|
85
66
|
}
|
|
86
67
|
}
|
|
87
68
|
|
|
88
|
-
@-webkit-keyframes fade-out {
|
|
89
|
-
from {
|
|
90
|
-
transform: translateY(0);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
to {
|
|
94
|
-
transform: translateY(100%);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
69
|
@keyframes fade-out {
|
|
99
70
|
from {
|
|
100
71
|
transform: translateY(0);
|