vviinn-widgets 2.44.0 → 2.44.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/loader.cjs.js +1 -1
- package/dist/cjs/{package-9e48dffa.js → package-5912f89d.js} +1 -1
- package/dist/cjs/{search-filters_15.cjs.entry.js → search-filters_16.cjs.entry.js} +56 -14
- package/dist/cjs/vviinn-carousel_4.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-vpr-button.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-vps-widget.cjs.entry.js +25 -5
- package/dist/cjs/vviinn-widgets.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/image-search/search-filters/search-filters.css +8 -3
- package/dist/collection/components/vviinn-error/vviinn-wrong-aspect-ratio/vviinn-wrong-aspect-ratio.js +36 -0
- package/dist/collection/components/vviinn-example-image/vviinn-example-image.js +10 -3
- package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.css +1 -0
- package/dist/collection/components/vviinn-image-view/vviinn-image-view.css +66 -24
- package/dist/collection/components/vviinn-image-view/vviinn-image-view.js +66 -9
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.css +17 -11
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +17 -4
- package/dist/collection/locale/resources-vps.js +8 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{package-fb112b84.js → package-b2424850.js} +1 -1
- package/dist/esm/{search-filters_15.entry.js → search-filters_16.entry.js} +56 -15
- package/dist/esm/vviinn-carousel_4.entry.js +1 -1
- package/dist/esm/vviinn-vpr-button.entry.js +1 -1
- package/dist/esm/vviinn-vps-button.entry.js +1 -1
- package/dist/esm/vviinn-vps-widget.entry.js +25 -5
- package/dist/esm/vviinn-widgets.js +1 -1
- package/dist/types/components/vviinn-error/vviinn-wrong-aspect-ratio/vviinn-wrong-aspect-ratio.d.ts +4 -0
- package/dist/types/components/vviinn-image-view/vviinn-image-view.d.ts +3 -0
- package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +2 -0
- package/dist/types/components.d.ts +19 -0
- package/dist/vviinn-widgets/p-044c5f45.entry.js +1 -0
- package/dist/vviinn-widgets/p-726774f9.js +1 -0
- package/dist/vviinn-widgets/{p-0d37441f.entry.js → p-a7cc44b3.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-32938807.entry.js → p-b1e9dd46.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-da0b001f.entry.js → p-ecd1c141.entry.js} +2 -2
- package/dist/vviinn-widgets/{p-40e2fb73.entry.js → p-ed082ecf.entry.js} +1 -1
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +1 -1
- package/www/build/p-044c5f45.entry.js +1 -0
- package/www/build/p-726774f9.js +1 -0
- package/www/build/{p-0d37441f.entry.js → p-a7cc44b3.entry.js} +1 -1
- package/www/build/{p-32938807.entry.js → p-b1e9dd46.entry.js} +1 -1
- package/www/build/{p-da0b001f.entry.js → p-ecd1c141.entry.js} +2 -2
- package/www/build/{p-40e2fb73.entry.js → p-ed082ecf.entry.js} +1 -1
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/dist/vviinn-widgets/p-8b0f06e7.js +0 -1
- package/dist/vviinn-widgets/p-8c681088.entry.js +0 -1
- package/www/build/p-8b0f06e7.js +0 -1
- package/www/build/p-8c681088.entry.js +0 -1
|
@@ -1,8 +1,42 @@
|
|
|
1
1
|
:host {
|
|
2
|
-
|
|
2
|
+
min-height: 160px;
|
|
3
|
+
display: flex;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
background-color: rgba(0, 0, 0, 0.32);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
:host(.bordered) {
|
|
9
|
+
background-color: transparent;
|
|
10
|
+
border: 1px solid #eaeaea;
|
|
11
|
+
margin-top: 40px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@media (max-width: 768px) {
|
|
15
|
+
:host {
|
|
16
|
+
min-height: unset;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:host(.bordered) {
|
|
20
|
+
border: none;
|
|
21
|
+
margin-top: 48px;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.container {
|
|
26
|
+
max-width: 100%;
|
|
27
|
+
height: 100%;
|
|
28
|
+
position: relative;
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.image-container {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
align-items: center;
|
|
3
39
|
position: relative;
|
|
4
|
-
justify-self: center;
|
|
5
|
-
direction: ltr;
|
|
6
40
|
}
|
|
7
41
|
|
|
8
42
|
.image-container > img {
|
|
@@ -14,11 +48,11 @@
|
|
|
14
48
|
background: rgba(0, 0, 0, 0.25);
|
|
15
49
|
border-radius: 4px;
|
|
16
50
|
bottom: 18px;
|
|
17
|
-
|
|
51
|
+
right: 18px;
|
|
52
|
+
padding: 4px;
|
|
18
53
|
pointer-events: none;
|
|
19
54
|
color: white;
|
|
20
55
|
position: absolute;
|
|
21
|
-
right: 18px;
|
|
22
56
|
z-index: 4;
|
|
23
57
|
}
|
|
24
58
|
|
|
@@ -103,8 +137,9 @@ vviinn-preloader {
|
|
|
103
137
|
}
|
|
104
138
|
|
|
105
139
|
.cropper-point {
|
|
106
|
-
|
|
107
|
-
|
|
140
|
+
--cropper-point-width: 44px;
|
|
141
|
+
height: var(--cropper-point-width);
|
|
142
|
+
width: var(--cropper-point-width);
|
|
108
143
|
opacity: 1;
|
|
109
144
|
}
|
|
110
145
|
|
|
@@ -115,58 +150,65 @@ vviinn-preloader {
|
|
|
115
150
|
display: none;
|
|
116
151
|
}
|
|
117
152
|
|
|
153
|
+
.point-ne,
|
|
154
|
+
.point-nw,
|
|
155
|
+
.point-sw,
|
|
156
|
+
.point-se {
|
|
157
|
+
--delta: -9px;
|
|
158
|
+
}
|
|
159
|
+
|
|
118
160
|
.point-ne {
|
|
119
161
|
cursor: nesw-resize;
|
|
120
|
-
right:
|
|
121
|
-
top:
|
|
162
|
+
right: var(--delta);
|
|
163
|
+
top: var(--delta);
|
|
122
164
|
}
|
|
123
165
|
|
|
124
166
|
.point-nw {
|
|
125
167
|
cursor: nwse-resize;
|
|
126
|
-
left:
|
|
127
|
-
top:
|
|
168
|
+
left: var(--delta);
|
|
169
|
+
top: var(--delta);
|
|
128
170
|
}
|
|
129
171
|
|
|
130
172
|
.point-sw {
|
|
131
173
|
cursor: nesw-resize;
|
|
132
|
-
bottom:
|
|
133
|
-
left:
|
|
174
|
+
bottom: var(--delta);
|
|
175
|
+
left: var(--delta);
|
|
134
176
|
}
|
|
135
177
|
|
|
136
178
|
.point-se {
|
|
137
179
|
cursor: nwse-resize;
|
|
138
|
-
bottom:
|
|
139
|
-
right:
|
|
180
|
+
bottom: var(--delta);
|
|
181
|
+
right: var(--delta);
|
|
140
182
|
}
|
|
141
183
|
|
|
142
184
|
.cropper-point::before {
|
|
143
185
|
position: absolute;
|
|
144
186
|
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='38' height='38' viewBox='0 0 38 38' fill='none'%3E%3Cpath d='M3 35H23C29.6274 35 35 29.6274 35 23V3' stroke='white' stroke-width='6' stroke-linecap='square'/%3E%3C/svg%3E");
|
|
145
187
|
display: block;
|
|
146
|
-
|
|
188
|
+
pointer-events: none;
|
|
147
189
|
}
|
|
148
190
|
|
|
149
191
|
.point-ne::before {
|
|
150
192
|
transform: rotate(-90deg);
|
|
151
|
-
left:
|
|
152
|
-
top:
|
|
193
|
+
left: 0px;
|
|
194
|
+
top: 6px;
|
|
153
195
|
}
|
|
154
196
|
|
|
155
197
|
.point-nw::before {
|
|
156
198
|
transform: rotate(180deg);
|
|
157
|
-
left:
|
|
158
|
-
top:
|
|
199
|
+
left: 6px;
|
|
200
|
+
top: 6px;
|
|
159
201
|
}
|
|
160
202
|
|
|
161
203
|
.point-sw::before {
|
|
162
204
|
transform: rotate(90deg);
|
|
163
|
-
left:
|
|
164
|
-
top:
|
|
205
|
+
left: 6px;
|
|
206
|
+
top: 0px;
|
|
165
207
|
}
|
|
166
208
|
|
|
167
209
|
.point-se::before {
|
|
168
|
-
left:
|
|
169
|
-
top:
|
|
210
|
+
left: 0px;
|
|
211
|
+
top: 0px;
|
|
170
212
|
}
|
|
171
213
|
|
|
172
214
|
.cropper-invisible {
|
|
@@ -7,13 +7,18 @@ import { sequenceToOption } from "../../utils/option/option";
|
|
|
7
7
|
import { fromImage } from "../../geometry/Rectangle";
|
|
8
8
|
import { dimensionsFromImage, scaleByLargestSide } from "../../Image/sizing";
|
|
9
9
|
import styles from "./vviinn-image-view.css";
|
|
10
|
-
const INITIAL_CROP_AREA = 0.
|
|
10
|
+
const INITIAL_CROP_AREA = 0.9;
|
|
11
11
|
const INITIAL_CROP_AREA_OFFSET = 1 - INITIAL_CROP_AREA;
|
|
12
12
|
const MIN_SEARCH_AREA_SIZE = 82;
|
|
13
|
+
const MIN_IMAGE_SIDE_FOR_CROPPER = 90;
|
|
14
|
+
const SUPPORTED_ASPECT_RATIO = 0.1;
|
|
15
|
+
const DEFAULT_IMAGE_SIZE = 288;
|
|
13
16
|
const cropperOptions = {
|
|
14
17
|
autoCropArea: INITIAL_CROP_AREA,
|
|
15
18
|
minCropBoxHeight: MIN_SEARCH_AREA_SIZE,
|
|
16
19
|
minCropBoxWidth: MIN_SEARCH_AREA_SIZE,
|
|
20
|
+
minContainerWidth: MIN_IMAGE_SIDE_FOR_CROPPER,
|
|
21
|
+
minContainerHeight: MIN_IMAGE_SIDE_FOR_CROPPER,
|
|
17
22
|
movable: false,
|
|
18
23
|
zoomable: false,
|
|
19
24
|
rotatable: false,
|
|
@@ -21,10 +26,11 @@ const cropperOptions = {
|
|
|
21
26
|
zoomOnTouch: false,
|
|
22
27
|
zoomOnWheel: false,
|
|
23
28
|
toggleDragModeOnDblclick: false,
|
|
29
|
+
viewMode: 1,
|
|
24
30
|
};
|
|
25
31
|
const getImageSizes = (i) => {
|
|
26
32
|
const dimensions = dimensionsFromImage(i);
|
|
27
|
-
const resize = scaleByLargestSide(
|
|
33
|
+
const resize = scaleByLargestSide(DEFAULT_IMAGE_SIZE);
|
|
28
34
|
const newDimensions = resize(dimensions);
|
|
29
35
|
const sizes = newDimensions.map((d) => d.size);
|
|
30
36
|
return [sizes[0], sizes[1]];
|
|
@@ -59,10 +65,14 @@ export class VviinnImageView {
|
|
|
59
65
|
this.vviinnImageCrop.emit(this.basicEventData);
|
|
60
66
|
};
|
|
61
67
|
this.basicEventData = undefined;
|
|
68
|
+
this.setShowAspectRatioError = undefined;
|
|
69
|
+
this.showAspectRatioError = undefined;
|
|
62
70
|
this.cropper = null;
|
|
71
|
+
this.hidePreloader = false;
|
|
63
72
|
}
|
|
64
73
|
disconnectedCallback() {
|
|
65
|
-
this.cropper
|
|
74
|
+
if (this.cropper)
|
|
75
|
+
this.cropper.destroy();
|
|
66
76
|
}
|
|
67
77
|
selectDetectedObject({ detail }) {
|
|
68
78
|
const { top, left, width, height } = detail.detectedObject.value.rectangle;
|
|
@@ -93,15 +103,27 @@ export class VviinnImageView {
|
|
|
93
103
|
this.cropper.destroy();
|
|
94
104
|
}
|
|
95
105
|
const imageBounds = fromImage(imageElement);
|
|
96
|
-
const { x, y } = imageBounds;
|
|
106
|
+
const { x, y, width, height } = imageBounds;
|
|
97
107
|
const searchArea = {
|
|
98
108
|
x,
|
|
99
109
|
y,
|
|
100
|
-
width:
|
|
101
|
-
height:
|
|
110
|
+
width: width - width * INITIAL_CROP_AREA_OFFSET,
|
|
111
|
+
height: height - height * INITIAL_CROP_AREA_OFFSET,
|
|
102
112
|
};
|
|
103
113
|
imageSearchState.imageBounds = O.some(imageBounds);
|
|
104
114
|
imageSearchState.searchArea = O.some(searchArea);
|
|
115
|
+
if (width / height < SUPPORTED_ASPECT_RATIO ||
|
|
116
|
+
height / width < SUPPORTED_ASPECT_RATIO) {
|
|
117
|
+
this.setShowAspectRatioError(true);
|
|
118
|
+
this.el.classList.add("bordered");
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (width < MIN_IMAGE_SIDE_FOR_CROPPER ||
|
|
122
|
+
height < MIN_IMAGE_SIDE_FOR_CROPPER) {
|
|
123
|
+
this.el.classList.add("bordered");
|
|
124
|
+
this.hidePreloader = true;
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
105
127
|
this.cropper = new Cropper(imageElement, Object.assign(Object.assign({}, cropperOptions), { cropend: this.cropEnd, data }));
|
|
106
128
|
}
|
|
107
129
|
}
|
|
@@ -115,8 +137,10 @@ export class VviinnImageView {
|
|
|
115
137
|
}), O.getOrElse(() => null));
|
|
116
138
|
}
|
|
117
139
|
render() {
|
|
118
|
-
return (h(Host, null, h("div", { class: "image-container" }, imageSearchState.loading ||
|
|
119
|
-
imageSearchState.objectDetectionInProgress
|
|
140
|
+
return (h(Host, null, h("div", { class: "container" }, h("div", { class: "image-container" }, this.renderImage(), imageSearchState.detectedObjects.map((o) => this.renderDetectedObject(o))), (imageSearchState.loading ||
|
|
141
|
+
imageSearchState.objectDetectionInProgress) &&
|
|
142
|
+
!this.showAspectRatioError &&
|
|
143
|
+
!this.hidePreloader ? (h("div", { class: "image-preloader" }, h("vviinn-preloader", null))) : null)));
|
|
120
144
|
}
|
|
121
145
|
static get is() { return "vviinn-image-view"; }
|
|
122
146
|
static get encapsulation() { return "shadow"; }
|
|
@@ -142,12 +166,45 @@ export class VviinnImageView {
|
|
|
142
166
|
"tags": [],
|
|
143
167
|
"text": ""
|
|
144
168
|
}
|
|
169
|
+
},
|
|
170
|
+
"setShowAspectRatioError": {
|
|
171
|
+
"type": "unknown",
|
|
172
|
+
"mutable": false,
|
|
173
|
+
"complexType": {
|
|
174
|
+
"original": "(isError: boolean) => void",
|
|
175
|
+
"resolved": "(isError: boolean) => void",
|
|
176
|
+
"references": {}
|
|
177
|
+
},
|
|
178
|
+
"required": false,
|
|
179
|
+
"optional": false,
|
|
180
|
+
"docs": {
|
|
181
|
+
"tags": [],
|
|
182
|
+
"text": ""
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
"showAspectRatioError": {
|
|
186
|
+
"type": "boolean",
|
|
187
|
+
"mutable": false,
|
|
188
|
+
"complexType": {
|
|
189
|
+
"original": "boolean",
|
|
190
|
+
"resolved": "boolean",
|
|
191
|
+
"references": {}
|
|
192
|
+
},
|
|
193
|
+
"required": false,
|
|
194
|
+
"optional": false,
|
|
195
|
+
"docs": {
|
|
196
|
+
"tags": [],
|
|
197
|
+
"text": ""
|
|
198
|
+
},
|
|
199
|
+
"attribute": "show-aspect-ratio-error",
|
|
200
|
+
"reflect": false
|
|
145
201
|
}
|
|
146
202
|
};
|
|
147
203
|
}
|
|
148
204
|
static get states() {
|
|
149
205
|
return {
|
|
150
|
-
"cropper": {}
|
|
206
|
+
"cropper": {},
|
|
207
|
+
"hidePreloader": {}
|
|
151
208
|
};
|
|
152
209
|
}
|
|
153
210
|
static get events() {
|
|
@@ -109,7 +109,7 @@ vviinn-overlayed-modal.first-screen::part(secondary-action) {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
.results-page {
|
|
112
|
-
margin-top:
|
|
112
|
+
margin-top: 64px;
|
|
113
113
|
display: grid;
|
|
114
114
|
grid-template-columns: 336px auto;
|
|
115
115
|
box-sizing: border-box;
|
|
@@ -155,10 +155,16 @@ vviinn-empty-results {
|
|
|
155
155
|
.image-wrapper {
|
|
156
156
|
display: grid;
|
|
157
157
|
grid-template-rows: min-content 1fr;
|
|
158
|
-
grid-gap: 24px;
|
|
159
158
|
min-width: 100%;
|
|
160
159
|
}
|
|
161
160
|
|
|
161
|
+
.filters-wrapper {
|
|
162
|
+
margin-top: 24px;
|
|
163
|
+
overflow-x: auto;
|
|
164
|
+
transform: translateX(-24px);
|
|
165
|
+
min-width: calc(100% + 48px);
|
|
166
|
+
}
|
|
167
|
+
|
|
162
168
|
vviinn-product-card {
|
|
163
169
|
gap: 0;
|
|
164
170
|
width: 100%;
|
|
@@ -211,12 +217,6 @@ search-filters::part(filter active) {
|
|
|
211
217
|
color: white;
|
|
212
218
|
}
|
|
213
219
|
|
|
214
|
-
.filters-wrapper {
|
|
215
|
-
overflow-x: auto;
|
|
216
|
-
transform: translateX(-24px);
|
|
217
|
-
min-width: calc(100% + 48px);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
220
|
.results-page:not(.active) {
|
|
221
221
|
display: none;
|
|
222
222
|
}
|
|
@@ -263,10 +263,15 @@ search-filters::part(filter active) {
|
|
|
263
263
|
|
|
264
264
|
.results-page > * {
|
|
265
265
|
box-sizing: border-box;
|
|
266
|
-
padding:
|
|
266
|
+
padding: 12px 24px 24px;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.image-wrapper {
|
|
270
|
+
padding: 0;
|
|
267
271
|
}
|
|
268
272
|
|
|
269
273
|
.filters-wrapper {
|
|
274
|
+
padding-left: 24px;
|
|
270
275
|
min-width: calc(100% + 40px);
|
|
271
276
|
}
|
|
272
277
|
|
|
@@ -297,6 +302,7 @@ search-filters::part(filter active) {
|
|
|
297
302
|
overflow-y: unset;
|
|
298
303
|
width: 100%;
|
|
299
304
|
padding-top: 0;
|
|
305
|
+
margin-top: 24px;
|
|
300
306
|
}
|
|
301
307
|
|
|
302
308
|
.products {
|
|
@@ -327,8 +333,8 @@ search-filters::part(filter active) {
|
|
|
327
333
|
}
|
|
328
334
|
|
|
329
335
|
@media (max-width: 380px) {
|
|
330
|
-
.
|
|
331
|
-
padding:
|
|
336
|
+
.filters-wrapper {
|
|
337
|
+
padding-left: 24px;
|
|
332
338
|
}
|
|
333
339
|
|
|
334
340
|
.products {
|
|
@@ -161,6 +161,9 @@ export class VviinnVpsWidget {
|
|
|
161
161
|
this.resetState();
|
|
162
162
|
}
|
|
163
163
|
};
|
|
164
|
+
this.setShowAspectRatioError = (isError) => {
|
|
165
|
+
this.showAspectRatioError = isError;
|
|
166
|
+
};
|
|
164
167
|
this.setTrackingDeactivated = (result) => {
|
|
165
168
|
if (result.status === "rejected") {
|
|
166
169
|
this.trackingDeactivated = true;
|
|
@@ -199,6 +202,7 @@ export class VviinnVpsWidget {
|
|
|
199
202
|
this.cameraEnabled = false;
|
|
200
203
|
this.cameraButtonClicked = false;
|
|
201
204
|
this.uploadSource = undefined;
|
|
205
|
+
this.showAspectRatioError = false;
|
|
202
206
|
}
|
|
203
207
|
initResultEvents() {
|
|
204
208
|
this.resultLoaded = false;
|
|
@@ -445,6 +449,7 @@ export class VviinnVpsWidget {
|
|
|
445
449
|
this.stream = null;
|
|
446
450
|
this.cameraEnabled = false;
|
|
447
451
|
this.cameraButtonClicked = false;
|
|
452
|
+
this.setShowAspectRatioError(false);
|
|
448
453
|
}
|
|
449
454
|
haveErrors() {
|
|
450
455
|
return this.wrongImageFormat || imageSearchState.serverError;
|
|
@@ -476,11 +481,18 @@ export class VviinnVpsWidget {
|
|
|
476
481
|
} }, h("vviinn-wrong-format", { class: { hidden: !this.wrongImageFormat }, handler: () => this.resetState() }), h("vviinn-server-error", { class: { hidden: !imageSearchState.serverError }, handler: () => this.resetState() })), !this.haveErrors() && h("vviinn-teaser", null), !this.haveErrors() && (h("div", { class: "buttons-group" }, this.renderButtons()))), h("vviinn-privacy-badge", { privacyBadgeText: i18next.t("privacyBadgeText"), class: { invisible: this.haveErrors() } }))), h("vviinn-slide", { class: {
|
|
477
482
|
"results-page": true,
|
|
478
483
|
active: this.isResultSlide(),
|
|
479
|
-
} }, h("div", { class: "image-wrapper" }, this.isResultSlide() && (h("vviinn-image-view", { basicEventData: this.getBasicEventData()
|
|
484
|
+
} }, h("div", { class: "image-wrapper" }, this.isResultSlide() && (h("vviinn-image-view", { basicEventData: this.getBasicEventData(), setShowAspectRatioError: this.setShowAspectRatioError, showAspectRatioError: this.showAspectRatioError })), h("div", { class: {
|
|
485
|
+
"filters-wrapper": true,
|
|
486
|
+
hidden: this.showAspectRatioError,
|
|
487
|
+
} }, h("div", { class: "filters" }, imageSearchState.filters.map((filter) => (h("search-filters", { filter: filter, basicEventData: this.getBasicEventData() })))))), h("div", { id: "results-block", class: "products-wrapper" }, h("div", { class: {
|
|
480
488
|
"nothing-found": true,
|
|
481
489
|
hidden: imageSearchState.results.length > 0,
|
|
482
|
-
} }, h("vviinn-empty-results", { handler: () => this.resetState() })
|
|
483
|
-
|
|
490
|
+
} }, h("vviinn-empty-results", { handler: () => this.resetState() })), h("div", { class: {
|
|
491
|
+
"nothing-found": true,
|
|
492
|
+
hidden: !this.showAspectRatioError,
|
|
493
|
+
} }, h("vviinn-wrong-aspect-ratio", { handler: () => this.resetState() })), h("div", { class: {
|
|
494
|
+
hidden: imageSearchState.results.length <= 0 ||
|
|
495
|
+
this.showAspectRatioError,
|
|
484
496
|
products: true,
|
|
485
497
|
} }, this.active && this.renderResults())))))));
|
|
486
498
|
}
|
|
@@ -796,7 +808,8 @@ export class VviinnVpsWidget {
|
|
|
796
808
|
"stream": {},
|
|
797
809
|
"cameraEnabled": {},
|
|
798
810
|
"cameraButtonClicked": {},
|
|
799
|
-
"uploadSource": {}
|
|
811
|
+
"uploadSource": {},
|
|
812
|
+
"showAspectRatioError": {}
|
|
800
813
|
};
|
|
801
814
|
}
|
|
802
815
|
static get events() {
|
|
@@ -21,6 +21,10 @@ export const resources = {
|
|
|
21
21
|
text: "Bitte laden Sie eine .jpg, .png oder .webp Bilddatei hoch.",
|
|
22
22
|
button: "Neues Bild hochladen",
|
|
23
23
|
},
|
|
24
|
+
wrongAspectRatioBlock: {
|
|
25
|
+
title: "Das Bild ist zu schmal",
|
|
26
|
+
button: "Neues Bild hochladen",
|
|
27
|
+
},
|
|
24
28
|
},
|
|
25
29
|
},
|
|
26
30
|
en: {
|
|
@@ -45,6 +49,10 @@ export const resources = {
|
|
|
45
49
|
text: "Please upload a .jpg, .png or .webp image file.",
|
|
46
50
|
button: "Upload another file",
|
|
47
51
|
},
|
|
52
|
+
wrongAspectRatioBlock: {
|
|
53
|
+
title: "The image is too narrow",
|
|
54
|
+
button: "Upload another image",
|
|
55
|
+
},
|
|
48
56
|
},
|
|
49
57
|
},
|
|
50
58
|
};
|
package/dist/esm/loader.js
CHANGED
|
@@ -11,7 +11,7 @@ const patchEsm = () => {
|
|
|
11
11
|
const defineCustomElements = (win, options) => {
|
|
12
12
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
13
13
|
return patchEsm().then(() => {
|
|
14
|
-
return bootstrapLazy([["vviinn-button",[[1,"vviinn-button",{"addStyle":[4,"add-style"]}]]],["vviinn-preloader",[[1,"vviinn-preloader"]]],["vviinn-error",[[1,"vviinn-error"]]],["vviinn-carousel_4",[[1,"vviinn-vpr-widget",{"blockTitle":[1,"block-title"],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"productId":[1,"product-id"],"token":[1],"currencySign":[1,"currency-sign"],"pricePrefix":[1,"price-prefix"],"mode":[1],"campaignType":[1,"campaign-type"],"locale":[1],"campaigns":[1],"color":[1],"gridArrowsDynamic":[4,"grid-arrows-dynamic"],"noResultText":[1,"no-result-text"],"noResultShow":[4,"no-result-show"],"showScroll":[4,"show-scroll"],"cssUrl":[1,"css-url"],"excluded":[1],"productDetailNewTab":[4,"product-detail-new-tab"],"addToBasketShow":[4,"add-to-basket-show"],"updateButtonLocation":[1,"update-button-location"],"apiPath":[1,"api-path"],"useCarousel":[4,"use-carousel"],"showingInButton":[4,"showing-in-button"],"buttonElementId":[1,"button-element-id"],"closed":[4],"opened":[4],"recommendations":[32],"trackingDeactivated":[32],"hasErrorOnLoad":[32],"updatingAllCards":[32]},[[0,"vviinnProductLoad","trackProductLoad"],[0,"vviinnProductView","trackProductView"],[0,"vviinnProductClick","trackProductClick"],[0,"vviinnAuxClick","trackAuxClick"],[0,"vviinnAddToBasket","trackAddToBasket"],[0,"vviinnUpdatingAllCardsFinished","updatingAllCardsFinishedListener"]]],[0,"vviinn-carousel",{"mode":[1],"imageWidth":[2,"image-width"],"showScroll":[4,"show-scroll"],"campaignTypeId":[1,"campaign-type-id"],"widgetElementId":[1,"widget-element-id"],"gridArrowsDynamic":[4,"grid-arrows-dynamic"],"recommendations":[16],"widgetVersion":[1,"widget-version"],"addToBasketShow":[4,"add-to-basket-show"],"updatingAllCards":[4,"updating-all-cards"],"updateButtonLocation":[1,"update-button-location"],"moveDirection":[32],"contentGroups":[32],"activeContentGroup":[32],"isRTL":[32],"crossSellingRecommendations":[32]},[[0,"vviinnCrossSellingClick","crossSellingClickListener"]]],[1,"vviinn-product-card",{"brand":[1],"currency":[1],"deeplink":[1],"image":[1],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"locale":[1],"price":[2],"pricePrefix":[1,"price-prefix"],"productId":[1,"product-id"],"productTitle":[1,"product-title"],"productType":[1,"product-type"],"salePrice":[2,"sale-price"],"responsive":[4],"dimmedBackground":[4,"dimmed-background"],"mode":[1],"addToBasketShow":[4,"add-to-basket-show"],"updateButtonLocation":[1,"update-button-location"],"campaignTypeId":[1,"campaign-type-id"],"widgetElementId":[1,"widget-element-id"],"buttonElementId":[1,"button-element-id"],"widgetVersion":[1,"widget-version"],"index":[2],"updatingAllCards":[4,"updating-all-cards"],"defaultAnimationInterval":[2,"default-animation-interval"],"imageLoaded":[32],"isTransitioning":[32]},[[0,"vviinnCrossSellingClick","crossSellingClickListener"]]],[1,"vviinn-skeleton",{"height":[2],"halfWidth":[4,"half-width"]}]]],["search-
|
|
14
|
+
return bootstrapLazy([["vviinn-button",[[1,"vviinn-button",{"addStyle":[4,"add-style"]}]]],["vviinn-preloader",[[1,"vviinn-preloader"]]],["vviinn-error",[[1,"vviinn-error"]]],["vviinn-carousel_4",[[1,"vviinn-vpr-widget",{"blockTitle":[1,"block-title"],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"productId":[1,"product-id"],"token":[1],"currencySign":[1,"currency-sign"],"pricePrefix":[1,"price-prefix"],"mode":[1],"campaignType":[1,"campaign-type"],"locale":[1],"campaigns":[1],"color":[1],"gridArrowsDynamic":[4,"grid-arrows-dynamic"],"noResultText":[1,"no-result-text"],"noResultShow":[4,"no-result-show"],"showScroll":[4,"show-scroll"],"cssUrl":[1,"css-url"],"excluded":[1],"productDetailNewTab":[4,"product-detail-new-tab"],"addToBasketShow":[4,"add-to-basket-show"],"updateButtonLocation":[1,"update-button-location"],"apiPath":[1,"api-path"],"useCarousel":[4,"use-carousel"],"showingInButton":[4,"showing-in-button"],"buttonElementId":[1,"button-element-id"],"closed":[4],"opened":[4],"recommendations":[32],"trackingDeactivated":[32],"hasErrorOnLoad":[32],"updatingAllCards":[32]},[[0,"vviinnProductLoad","trackProductLoad"],[0,"vviinnProductView","trackProductView"],[0,"vviinnProductClick","trackProductClick"],[0,"vviinnAuxClick","trackAuxClick"],[0,"vviinnAddToBasket","trackAddToBasket"],[0,"vviinnUpdatingAllCardsFinished","updatingAllCardsFinishedListener"]]],[0,"vviinn-carousel",{"mode":[1],"imageWidth":[2,"image-width"],"showScroll":[4,"show-scroll"],"campaignTypeId":[1,"campaign-type-id"],"widgetElementId":[1,"widget-element-id"],"gridArrowsDynamic":[4,"grid-arrows-dynamic"],"recommendations":[16],"widgetVersion":[1,"widget-version"],"addToBasketShow":[4,"add-to-basket-show"],"updatingAllCards":[4,"updating-all-cards"],"updateButtonLocation":[1,"update-button-location"],"moveDirection":[32],"contentGroups":[32],"activeContentGroup":[32],"isRTL":[32],"crossSellingRecommendations":[32]},[[0,"vviinnCrossSellingClick","crossSellingClickListener"]]],[1,"vviinn-product-card",{"brand":[1],"currency":[1],"deeplink":[1],"image":[1],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"locale":[1],"price":[2],"pricePrefix":[1,"price-prefix"],"productId":[1,"product-id"],"productTitle":[1,"product-title"],"productType":[1,"product-type"],"salePrice":[2,"sale-price"],"responsive":[4],"dimmedBackground":[4,"dimmed-background"],"mode":[1],"addToBasketShow":[4,"add-to-basket-show"],"updateButtonLocation":[1,"update-button-location"],"campaignTypeId":[1,"campaign-type-id"],"widgetElementId":[1,"widget-element-id"],"buttonElementId":[1,"button-element-id"],"widgetVersion":[1,"widget-version"],"index":[2],"updatingAllCards":[4,"updating-all-cards"],"defaultAnimationInterval":[2,"default-animation-interval"],"imageLoaded":[32],"isTransitioning":[32]},[[0,"vviinnCrossSellingClick","crossSellingClickListener"]]],[1,"vviinn-skeleton",{"height":[2],"halfWidth":[4,"half-width"]}]]],["search-filters_16",[[1,"vviinn-image-view",{"basicEventData":[16],"setShowAspectRatioError":[16],"showAspectRatioError":[4,"show-aspect-ratio-error"],"cropper":[32],"hidePreloader":[32]},[[0,"vviinnSelectObject","selectDetectedObject"]]],[1,"vviinn-overlayed-modal",{"active":[4],"resetState":[16],"buttonElementId":[1,"button-element-id"],"hideBackButton":[4,"hide-back-button"],"widgetVersion":[1,"widget-version"],"isFirstScreen":[4,"is-first-screen"]}],[1,"vviinn-empty-results",{"handler":[16]}],[1,"vviinn-image-selector",{"basicEventData":[16],"startUpload":[4,"start-upload"],"loading":[4],"accept":[1],"resetVpsButton":[16],"capture":[1]}],[1,"vviinn-server-error",{"handler":[16]}],[1,"vviinn-wrong-aspect-ratio",{"handler":[16]}],[1,"vviinn-wrong-format",{"handler":[16]}],[1,"search-filters",{"filter":[16],"basicEventData":[16],"selectedFilter":[32],"hideFilters":[32]}],[1,"vviinn-example-image",{"exampleImageSource":[1,"example-image-source"],"width":[2],"height":[2],"basicEventData":[16],"srcObject":[16],"cameraButtonClicked":[4,"camera-button-clicked"],"selected":[32],"videoInitialized":[32],"zoomCapabilities":[32]}],[1,"vviinn-privacy-badge",{"privacyBadgeText":[1,"privacy-badge-text"]}],[1,"vviinn-slide"],[1,"vviinn-slider",{"showBullets":[4,"show-bullets"],"position":[514],"showArrows":[4,"show-arrows"],"elementsCount":[32],"internalPosition":[32],"swipeStartPosition":[32],"isRTL":[32]}],[1,"vviinn-teaser"],[1,"vviinn-detected-object",{"detectedObject":[16],"basicEventData":[16],"position":[32]}],[1,"vviinn-modal",{"active":[1540],"resetState":[16],"buttonElementId":[1,"button-element-id"],"widgetVersion":[1,"widget-version"],"hideBackButton":[4,"hide-back-button"],"isFirstScreen":[4,"is-first-screen"],"slider":[32]}],[1,"vviinn-overlay"]]],["vviinn-vps-widget",[[1,"vviinn-vps-widget",{"token":[1],"active":[1028],"currencySign":[1,"currency-sign"],"locale":[1],"campaignId":[1,"campaign-id"],"excluded":[1],"productDetailNewTab":[4,"product-detail-new-tab"],"imageResolutionWidth":[2,"image-resolution-width"],"exampleImageSource":[1,"example-image-source"],"apiPath":[1,"api-path"],"showingInButton":[4,"showing-in-button"],"buttonElementId":[1,"button-element-id"],"buttonPressed":[4,"button-pressed"],"mode":[1],"resetVpsButton":[16],"slidePosition":[32],"width":[32],"wrongImageFormat":[32],"trackingDeactivated":[32],"stream":[32],"cameraEnabled":[32],"cameraButtonClicked":[32],"uploadSource":[32],"showAspectRatioError":[32]},[[0,"vviinnCameraEnabled","trackCameraEnabled"],[0,"vviinnProductLoad","trackProductLoad"],[0,"vviinnProductView","trackProductView"],[0,"vviinnProductClick","trackProductClick"],[0,"vviinnAuxClick","trackAuxClick"],[0,"vviinnImageCrop","trachSearchAreaChanges"],[0,"vviinnSelectObject","trackDetectedObject"],[0,"vviinnSelectFilter","trackFilter"]]]]],["vviinn-vps-button",[[1,"vviinn-vps-button",{"token":[1],"currencySign":[1,"currency-sign"],"locale":[1],"campaignId":[1,"campaign-id"],"addStyle":[4,"add-style"],"mode":[1],"excluded":[1],"productDetailNewTab":[4,"product-detail-new-tab"],"imageResolutionWidth":[2,"image-resolution-width"],"exampleImageSource":[1,"example-image-source"],"apiPath":[1,"api-path"],"buttonPressed":[32]},[[0,"vviinnWidgetClose","handleModalClosed"]]]]],["vviinn-recommendations-sidebar",[[1,"vviinn-recommendations-sidebar",{"sidebarTitle":[1,"sidebar-title"],"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"widgetScrollbar":[4,"widget-scrollbar"],"mode":[1],"campaigns":[1],"campaignType":[1,"campaign-type"],"color":[1],"locale":[1],"imageWidth":[2,"image-width"],"currencySign":[1,"currency-sign"],"noResultText":[1,"no-result-text"],"noResultShow":[4,"no-result-show"],"gridArrowsDynamic":[4,"grid-arrows-dynamic"],"excluded":[1],"productDetailNewTab":[4,"product-detail-new-tab"],"addToBasketShow":[4,"add-to-basket-show"],"buttonChildren":[16],"apiPath":[1,"api-path"],"buttonElementId":[1,"button-element-id"],"widgetVersion":[1,"widget-version"],"showingInButton":[4,"showing-in-button"],"state":[32]},[[16,"click","bodyClickListener"]]]]],["vviinn-vpr-button",[[1,"vviinn-vpr-button",{"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"sidebarTitle":[1,"sidebar-title"],"modalScrollbar":[4,"modal-scrollbar"],"campaigns":[1],"campaignType":[1,"campaign-type"],"locale":[1],"color":[1],"addStyle":[4,"add-style"],"mode":[1],"imageWidth":[2,"image-width"],"currencySign":[1,"currency-sign"],"noResultText":[1,"no-result-text"],"noResultShow":[4,"no-result-show"],"gridArrowsDynamic":[4,"grid-arrows-dynamic"],"excluded":[1],"productDetailNewTab":[4,"product-detail-new-tab"],"addToBasketShow":[4,"add-to-basket-show"],"apiPath":[1,"api-path"]}]]]], options);
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
|