vviinn-widgets 2.219.0 → 2.221.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{SecondaryActionIcon-Ng84u7-b.js → SecondaryActionIcon-CuNEBTWD.js} +1 -1
- package/dist/cjs/{cssUrlHelper-BX9kngtZ.js → cssUrlHelper-B5A2BBm7.js} +1 -1
- package/dist/cjs/{index-CvMi8_tX.js → index-BF9aENF8.js} +6 -2
- package/dist/cjs/{index-D38ORu31.js → index-BU8FMTXn.js} +3 -0
- package/dist/cjs/{index-CBteD3gC.js → index-CP1QUrJT.js} +11 -1
- package/dist/cjs/{index-DdCwxNyl.js → index-sL3iGA57.js} +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{search.store-DiomZf0i.js → search.store-C-fS-eJR.js} +10 -11
- package/dist/cjs/vviinn-button_6.cjs.entry.js +13 -13
- package/dist/cjs/vviinn-camera_12.cjs.entry.js +113 -52
- package/dist/cjs/vviinn-carousel_10.cjs.entry.js +9 -9
- package/dist/cjs/vviinn-detected-object_2.cjs.entry.js +2 -2
- package/dist/cjs/vviinn-shop-the-look.cjs.entry.js +6 -6
- package/dist/cjs/vviinn-text-search.cjs.entry.js +32 -27
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +16 -7
- package/dist/cjs/vviinn-widgets.cjs.js +2 -2
- package/dist/collection/Image/error.js +6 -1
- package/dist/collection/components/customized-slots.js +2 -0
- package/dist/collection/components/vviinn-icons/icons/DragDropImageIcon.js +2 -0
- package/dist/collection/components/vviinn-icons/index.js +1 -0
- package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.css +36 -1
- package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.js +132 -21
- package/dist/collection/components/vviinn-modal/vviinn-modal.js +2 -2
- package/dist/collection/components/vviinn-overlay/vviinn-overlay.js +1 -1
- package/dist/collection/components/vviinn-overlayed-modal/vviinn-overlayed-modal.js +1 -1
- package/dist/collection/components/vviinn-preloader/vviinn-preloader.js +1 -1
- package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.js +1 -1
- package/dist/collection/components/vviinn-product-card/vviinn-energy-label/vviinn-energy-label.js +2 -2
- package/dist/collection/components/vviinn-results/vviinn-results.js +3 -3
- package/dist/collection/components/vviinn-shop-the-look/vviinn-shop-the-look.js +1 -1
- package/dist/collection/components/vviinn-skeleton/vviinn-skeleton.js +1 -1
- package/dist/collection/components/vviinn-slider/vviinn-slide/vviinn-slide.js +1 -1
- package/dist/collection/components/vviinn-slider/vviinn-slider.js +1 -1
- package/dist/collection/components/vviinn-teaser/vviinn-teaser.js +1 -1
- package/dist/collection/components/vviinn-text-search/helpers/autoSuggestDebounce.js +4 -4
- package/dist/collection/components/vviinn-text-search/vviinn-text-search.js +47 -22
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js +3 -3
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +1 -1
- package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +39 -6
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.css +35 -1
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +39 -16
- package/dist/collection/cssParts/index.js +2 -0
- package/dist/collection/dom/index.js +7 -0
- package/dist/collection/helpers/dragAndDrop/parseDroppedFile.js +2 -0
- package/dist/collection/locale/resources.js +4 -2
- package/dist/collection/store/search.store.js +2 -7
- package/dist/esm/{SecondaryActionIcon-FWFzrhba.js → SecondaryActionIcon-D4f3aMUD.js} +1 -1
- package/dist/esm/{cssUrlHelper-DsQD_dY6.js → cssUrlHelper-Byz4s-MD.js} +1 -1
- package/dist/esm/{index-RkvPN2Rk.js → index-B89nCb_F.js} +3 -0
- package/dist/esm/{index-BtnjaTty.js → index-BCrstDkj.js} +6 -2
- package/dist/esm/{index-OsoUj2Au.js → index-C1-PYhS4.js} +11 -2
- package/dist/esm/{index-DHNImAac.js → index-D5yWioO8.js} +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{search.store-DUkS1MAq.js → search.store-C8LIDQfX.js} +11 -11
- package/dist/esm/vviinn-button_6.entry.js +13 -13
- package/dist/esm/vviinn-camera_12.entry.js +113 -52
- package/dist/esm/vviinn-carousel_10.entry.js +9 -9
- package/dist/esm/vviinn-detected-object_2.entry.js +2 -2
- package/dist/esm/vviinn-shop-the-look.entry.js +6 -6
- package/dist/esm/vviinn-text-search.entry.js +32 -27
- package/dist/esm/vviinn-vps-button.entry.js +16 -7
- package/dist/esm/vviinn-widgets.js +3 -3
- package/dist/types/components/vviinn-icons/icons/DragDropImageIcon.d.ts +1 -0
- package/dist/types/components/vviinn-icons/index.d.ts +1 -0
- package/dist/types/components/vviinn-image-selector/vviinn-image-selector.d.ts +11 -0
- package/dist/types/components/vviinn-text-search/helpers/autoSuggestDebounce.d.ts +2 -1
- package/dist/types/components/vviinn-text-search/vviinn-text-search.d.ts +4 -1
- package/dist/types/components/vviinn-vps-button/vviinn-vps-button.d.ts +6 -0
- package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +2 -0
- package/dist/types/components.d.ts +32 -0
- package/dist/types/dom/index.d.ts +1 -0
- package/dist/types/helpers/dragAndDrop/parseDroppedFile.d.ts +2 -0
- package/dist/types/store/search.store.d.ts +1 -3
- package/dist/vviinn-widgets/p-07211a51.entry.js +1 -0
- package/dist/vviinn-widgets/{p-a8d88d55.entry.js → p-27b41f88.entry.js} +1 -1
- package/dist/vviinn-widgets/p-7411202d.entry.js +1 -0
- package/{www/build/p-5e186249.entry.js → dist/vviinn-widgets/p-95423f25.entry.js} +1 -1
- package/{www/build/p-RkvPN2Rk.js → dist/vviinn-widgets/p-B89nCb_F.js} +1 -1
- package/dist/vviinn-widgets/p-BadZr0hq.js +1 -0
- package/dist/vviinn-widgets/{p-D3wRLf2J.js → p-BfTXDLup.js} +1 -1
- package/dist/vviinn-widgets/{p-C063BS9s.js → p-BpHXy3Gg.js} +1 -1
- package/dist/vviinn-widgets/p-Bq5Hj7Kz.js +1 -0
- package/{www/build/p-DXT8Rt8G.js → dist/vviinn-widgets/p-DTASrq1W.js} +1 -1
- package/dist/vviinn-widgets/{p-6vxKTHCE.js → p-DvD16Fp_.js} +1 -1
- package/dist/vviinn-widgets/p-e7b0a5b9.entry.js +1 -0
- package/dist/vviinn-widgets/{p-fa907040.entry.js → p-f46ad1fd.entry.js} +1 -1
- package/{www/build/p-fcbaa790.entry.js → dist/vviinn-widgets/p-f48452fd.entry.js} +1 -1
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +1 -2
- package/www/build/p-07211a51.entry.js +1 -0
- package/www/build/{p-a8d88d55.entry.js → p-27b41f88.entry.js} +1 -1
- package/www/build/{p-ed15ff33.js → p-2d5777fa.js} +1 -1
- package/www/build/p-7411202d.entry.js +1 -0
- package/{dist/vviinn-widgets/p-5e186249.entry.js → www/build/p-95423f25.entry.js} +1 -1
- package/{dist/vviinn-widgets/p-RkvPN2Rk.js → www/build/p-B89nCb_F.js} +1 -1
- package/www/build/p-BadZr0hq.js +1 -0
- package/www/build/{p-D3wRLf2J.js → p-BfTXDLup.js} +1 -1
- package/www/build/{p-C063BS9s.js → p-BpHXy3Gg.js} +1 -1
- package/www/build/p-Bq5Hj7Kz.js +1 -0
- package/{dist/vviinn-widgets/p-DXT8Rt8G.js → www/build/p-DTASrq1W.js} +1 -1
- package/www/build/{p-6vxKTHCE.js → p-DvD16Fp_.js} +1 -1
- package/www/build/p-e7b0a5b9.entry.js +1 -0
- package/www/build/{p-fa907040.entry.js → p-f46ad1fd.entry.js} +1 -1
- package/{dist/vviinn-widgets/p-fcbaa790.entry.js → www/build/p-f48452fd.entry.js} +1 -1
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +1 -1
- package/dist/vviinn-widgets/p-315db5a2.entry.js +0 -1
- package/dist/vviinn-widgets/p-91768e9c.entry.js +0 -1
- package/dist/vviinn-widgets/p-CPTOq59a.js +0 -1
- package/dist/vviinn-widgets/p-DKHkeCw7.js +0 -1
- package/dist/vviinn-widgets/p-ab6447df.entry.js +0 -1
- package/www/build/p-315db5a2.entry.js +0 -1
- package/www/build/p-91768e9c.entry.js +0 -1
- package/www/build/p-CPTOq59a.js +0 -1
- package/www/build/p-DKHkeCw7.js +0 -1
- package/www/build/p-ab6447df.entry.js +0 -1
|
@@ -4,40 +4,93 @@ import { pipe } from "fp-ts/lib/function";
|
|
|
4
4
|
import { makeUploadFileRequest, } from "../../store/search.store";
|
|
5
5
|
import { setLocalStorageItems } from "../../localStorage";
|
|
6
6
|
import { getAcceptableFileFormats, checkImageType } from "../../Image/error";
|
|
7
|
+
import { parseDroppedFile } from "../../helpers/dragAndDrop/parseDroppedFile";
|
|
7
8
|
/**
|
|
8
9
|
* @part button - button look and feel
|
|
9
10
|
*/
|
|
10
11
|
export class VviinnImageSelector {
|
|
11
12
|
constructor() {
|
|
12
13
|
this.loading = false;
|
|
14
|
+
/** Accept image files dropped from the OS onto the selector */
|
|
15
|
+
this.useDragAndDrop = false;
|
|
16
|
+
this.isDragOver = false;
|
|
17
|
+
// Guards against a second drop / file-input change starting a concurrent
|
|
18
|
+
// upload while the first request is still in flight (racing two searches).
|
|
19
|
+
this.isProcessing = false;
|
|
13
20
|
}
|
|
14
|
-
async
|
|
15
|
-
|
|
16
|
-
const input = event.target;
|
|
17
|
-
const file = (_a = input.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
18
|
-
if (!file)
|
|
21
|
+
async processFile(file) {
|
|
22
|
+
if (this.isProcessing)
|
|
19
23
|
return;
|
|
20
24
|
const validationResult = checkImageType(file);
|
|
21
25
|
if (E.isLeft(validationResult)) {
|
|
22
26
|
this.vviinnNoResult.emit(Object.assign(Object.assign({}, this.basicEventData), { reason: validationResult.left.kind, errorMessage: validationResult.left.inner, errorCode: validationResult.left.code }));
|
|
23
|
-
input.value = "";
|
|
24
27
|
return;
|
|
25
28
|
}
|
|
26
29
|
this.vviinnImageUploadStarted.emit(Object.assign(Object.assign({}, this.basicEventData), { isTriggeredByVpsWidget: this.storeName === "widget" }));
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
this.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
this.isProcessing = true;
|
|
31
|
+
try {
|
|
32
|
+
const processingResult = await makeUploadFileRequest(this.storeName, this.token, this.apiPath)(file);
|
|
33
|
+
pipe(processingResult, E.match(({ kind, code }) => {
|
|
34
|
+
this.vviinnNoResult.emit(Object.assign(Object.assign({}, this.basicEventData), { reason: kind, errorCode: code }));
|
|
35
|
+
}, (response) => {
|
|
36
|
+
var _a;
|
|
37
|
+
if (!this.showInWidget)
|
|
38
|
+
setLocalStorageItems((_a = this.state.image) === null || _a === void 0 ? void 0 : _a.src, this.state.detectedObjects);
|
|
39
|
+
this.vviinnImageUploadFinished.emit({
|
|
40
|
+
searchId: response.requestId,
|
|
41
|
+
isTriggeredByVpsWidget: this.storeName === "widget",
|
|
42
|
+
});
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
finally {
|
|
46
|
+
this.isProcessing = false;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
async handleInputChange(event) {
|
|
50
|
+
var _a;
|
|
51
|
+
const input = event.target;
|
|
52
|
+
const file = (_a = input.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
53
|
+
if (!file)
|
|
54
|
+
return;
|
|
55
|
+
await this.processFile(file);
|
|
39
56
|
input.value = "";
|
|
40
57
|
}
|
|
58
|
+
onDragOver(event) {
|
|
59
|
+
if (!this.useDragAndDrop)
|
|
60
|
+
return;
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
if (event.dataTransfer)
|
|
63
|
+
event.dataTransfer.dropEffect = "copy";
|
|
64
|
+
clearTimeout(this.dragLeaveTimer);
|
|
65
|
+
this.isDragOver = true;
|
|
66
|
+
}
|
|
67
|
+
onDragLeave() {
|
|
68
|
+
if (!this.useDragAndDrop)
|
|
69
|
+
return;
|
|
70
|
+
clearTimeout(this.dragLeaveTimer);
|
|
71
|
+
this.dragLeaveTimer = setTimeout(() => (this.isDragOver = false), 50);
|
|
72
|
+
}
|
|
73
|
+
async onDrop(event) {
|
|
74
|
+
if (!this.useDragAndDrop)
|
|
75
|
+
return;
|
|
76
|
+
event.preventDefault();
|
|
77
|
+
clearTimeout(this.dragLeaveTimer);
|
|
78
|
+
this.isDragOver = false;
|
|
79
|
+
const file = parseDroppedFile(event.dataTransfer);
|
|
80
|
+
if (file)
|
|
81
|
+
await this.processFile(file);
|
|
82
|
+
}
|
|
83
|
+
// Safety net for a drag that ends without a dragleave reaching this host
|
|
84
|
+
// (dropped outside the element, or cancelled): clears a stuck highlight.
|
|
85
|
+
onGlobalDragEnd() {
|
|
86
|
+
if (!this.useDragAndDrop || !this.isDragOver)
|
|
87
|
+
return;
|
|
88
|
+
clearTimeout(this.dragLeaveTimer);
|
|
89
|
+
this.isDragOver = false;
|
|
90
|
+
}
|
|
91
|
+
disconnectedCallback() {
|
|
92
|
+
clearTimeout(this.dragLeaveTimer);
|
|
93
|
+
}
|
|
41
94
|
startUploadWatcher(upload) {
|
|
42
95
|
if (upload) {
|
|
43
96
|
this.fileInput.click();
|
|
@@ -45,13 +98,13 @@ export class VviinnImageSelector {
|
|
|
45
98
|
}
|
|
46
99
|
}
|
|
47
100
|
render() {
|
|
48
|
-
return (h(Host, { key: '
|
|
101
|
+
return (h(Host, { key: '616c751da82243f02d9d9cbc4f908702c49b3889', exportparts: this.useDragAndDrop ? "button:upload-photo_button" : "button", class: { "drag-over": this.isDragOver } }, this.useDragAndDrop && (h("div", { key: 'b02ad9a11981be6f13bd1347279fe4dad3046887', class: "drop-zone__hint", "aria-hidden": "true" }, h("span", { key: '9f5ed13a34f05cd9dd13aeddf3bfe166b84ee6f6', class: "drop-zone__icon" }, h("slot", { key: 'ccbadd5393155b7e2222d89afad490f43e93b0bc', name: "drop-zone-icon" })), h("span", { key: '0cd1cbaaadb326ef8d53bd8c895c9d72af8571a0', class: "drop-zone__text" }, h("slot", { key: '659b6e91869f7fbb1d73df37d6e25a54ebd200a1', name: "drop-zone-text" })))), h("label", { key: '3684c5e7afefa0403b8d760db89390530834d16d', htmlFor: "fileInput", part: "button", class: { loading: this.loading }, tabindex: this.loading ? -1 : 0, onKeyDown: (e) => {
|
|
49
102
|
var _a;
|
|
50
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
103
|
+
if (!this.loading && (e.key === "Enter" || e.key === " ")) {
|
|
51
104
|
e.preventDefault();
|
|
52
105
|
(_a = this.fileInput) === null || _a === void 0 ? void 0 : _a.click();
|
|
53
106
|
}
|
|
54
|
-
} }, h("slot", { name: "upload-button-text" }, "Upload image"))), h("input", { key: '
|
|
107
|
+
} }, this.loading ? (h("vviinn-preloader", null)) : (h("slot", { name: "upload-button-text" }, "Upload image"))), h("input", { key: '7d9cfd89c2d64cdf3c262e89f652da500dcc80ba', id: "fileInput", class: "visually-hidden", type: "file", tabindex: "-1", accept: getAcceptableFileFormats(), onChange: (event) => this.handleInputChange(event), ref: (el) => (this.fileInput = el) })));
|
|
55
108
|
}
|
|
56
109
|
static get is() { return "vviinn-image-selector"; }
|
|
57
110
|
static get encapsulation() { return "shadow"; }
|
|
@@ -272,9 +325,34 @@ export class VviinnImageSelector {
|
|
|
272
325
|
},
|
|
273
326
|
"getter": false,
|
|
274
327
|
"setter": false
|
|
328
|
+
},
|
|
329
|
+
"useDragAndDrop": {
|
|
330
|
+
"type": "boolean",
|
|
331
|
+
"attribute": "use-drag-and-drop",
|
|
332
|
+
"mutable": false,
|
|
333
|
+
"complexType": {
|
|
334
|
+
"original": "boolean",
|
|
335
|
+
"resolved": "boolean",
|
|
336
|
+
"references": {}
|
|
337
|
+
},
|
|
338
|
+
"required": false,
|
|
339
|
+
"optional": false,
|
|
340
|
+
"docs": {
|
|
341
|
+
"tags": [],
|
|
342
|
+
"text": "Accept image files dropped from the OS onto the selector"
|
|
343
|
+
},
|
|
344
|
+
"getter": false,
|
|
345
|
+
"setter": false,
|
|
346
|
+
"reflect": false,
|
|
347
|
+
"defaultValue": "false"
|
|
275
348
|
}
|
|
276
349
|
};
|
|
277
350
|
}
|
|
351
|
+
static get states() {
|
|
352
|
+
return {
|
|
353
|
+
"isDragOver": {}
|
|
354
|
+
};
|
|
355
|
+
}
|
|
278
356
|
static get events() {
|
|
279
357
|
return [{
|
|
280
358
|
"method": "vviinnImageUploadStarted",
|
|
@@ -347,4 +425,37 @@ export class VviinnImageSelector {
|
|
|
347
425
|
"methodName": "startUploadWatcher"
|
|
348
426
|
}];
|
|
349
427
|
}
|
|
428
|
+
static get listeners() {
|
|
429
|
+
return [{
|
|
430
|
+
"name": "dragover",
|
|
431
|
+
"method": "onDragOver",
|
|
432
|
+
"target": undefined,
|
|
433
|
+
"capture": false,
|
|
434
|
+
"passive": false
|
|
435
|
+
}, {
|
|
436
|
+
"name": "dragleave",
|
|
437
|
+
"method": "onDragLeave",
|
|
438
|
+
"target": undefined,
|
|
439
|
+
"capture": false,
|
|
440
|
+
"passive": true
|
|
441
|
+
}, {
|
|
442
|
+
"name": "drop",
|
|
443
|
+
"method": "onDrop",
|
|
444
|
+
"target": undefined,
|
|
445
|
+
"capture": false,
|
|
446
|
+
"passive": false
|
|
447
|
+
}, {
|
|
448
|
+
"name": "drop",
|
|
449
|
+
"method": "onGlobalDragEnd",
|
|
450
|
+
"target": "document",
|
|
451
|
+
"capture": false,
|
|
452
|
+
"passive": true
|
|
453
|
+
}, {
|
|
454
|
+
"name": "dragend",
|
|
455
|
+
"method": "onGlobalDragEnd",
|
|
456
|
+
"target": "document",
|
|
457
|
+
"capture": false,
|
|
458
|
+
"passive": true
|
|
459
|
+
}];
|
|
460
|
+
}
|
|
350
461
|
}
|
|
@@ -57,10 +57,10 @@ export class VviinnModal {
|
|
|
57
57
|
}, this.slider ? SIDEBAR_ANIMATION_DURATION : 0);
|
|
58
58
|
}
|
|
59
59
|
render() {
|
|
60
|
-
return (h(Host, { key: '
|
|
60
|
+
return (h(Host, { key: 'a9ddbc40121ee0f9e747460ba826f910376960f1', exportparts: modalParts, class: { closed: !this.active, "first-screen": this.isFirstScreen }, onAnimationEnd: this.handleAnimationEnd, role: "dialog", "aria-modal": this.active ? "true" : "false", "aria-label": i18next.t("imageSearchModalTitle"), inert: !this.active ? true : undefined }, h("div", { key: '27a1c2d17b975d1bff0c04392b03f850cb1f8cf0', class: "head" }, !this.hideBackButton && (h("button", { key: '02d89560819b3b1f19c75569531d670efedf8e54', part: "secondary-action", onClick: () => {
|
|
61
61
|
this.resetState();
|
|
62
62
|
this.resetTopScroll();
|
|
63
|
-
}, "aria-label": i18next.t("a11y.backButton") }, h(SecondaryActionIcon, { key: '
|
|
63
|
+
}, "aria-label": i18next.t("a11y.backButton") }, h(SecondaryActionIcon, { key: 'd61a2d35f90c4f64209839c7c738b8afc78131b0' }))), h("div", { key: '59530e27b5283104f0296122551752de0456c999', class: "title", part: "results-title" }, renderTitleImage(searchState.image), h("slot", { key: '81b817f993da5fb1ebb383b19a6c49f5fcb652b3', name: "vviinn-image-search-modal-title" }, i18next.t("imageSearchModalTitle"))), h("button", { key: '7b8b0b319a4d173bd1f6cc3bb9642091e1d25920', onClick: () => this.close(), onKeyDown: this.handleCloseButtonKeyDown, class: "close-button", part: "close-button", "aria-label": i18next.t("a11y.closeButton") }, h("svg", { key: 'd2399b4c6cb68169b5fa2c3785fbf4d5417e3d1f', xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true" }, h("path", { key: 'cfb7d199d0bb7f6d366a246a63e43c22ff1fe19b', d: "M12 13.3892L6.91958 18.4696C6.72248 18.6667 6.49095 18.7653 6.225 18.7653C5.95905 18.7653 5.72753 18.6667 5.53043 18.4696C5.33333 18.2725 5.23478 18.041 5.23478 17.775C5.23478 17.5091 5.33333 17.2776 5.53043 17.0805L10.6109 12L5.53043 6.9196C5.33333 6.7225 5.23478 6.49098 5.23478 6.22503C5.23478 5.95908 5.33333 5.72755 5.53043 5.53045C5.72753 5.33335 5.95905 5.2348 6.225 5.2348C6.49095 5.2348 6.72248 5.33335 6.91958 5.53045L12 10.6109L17.0804 5.53045C17.2775 5.33335 17.5091 5.2348 17.775 5.2348C18.041 5.2348 18.2725 5.33335 18.4696 5.53045C18.6667 5.72755 18.7652 5.95908 18.7652 6.22503C18.7652 6.49098 18.6667 6.7225 18.4696 6.9196L13.3892 12L18.4696 17.0805C18.6667 17.2776 18.7652 17.5091 18.7652 17.775C18.7652 18.041 18.6667 18.2725 18.4696 18.4696C18.2725 18.6667 18.041 18.7653 17.775 18.7653C17.5091 18.7653 17.2775 18.6667 17.0804 18.4696L12 13.3892Z", fill: "currentColor" })))), h("div", { key: 'e4649662e7054a5b77ba9e1d72e619ef71cb259d', class: "body" }, h("slot", { key: '6b177965d3c98596dfe8e29efc0d6be158eb5d09' }))));
|
|
64
64
|
}
|
|
65
65
|
static get is() { return "vviinn-modal"; }
|
|
66
66
|
static get encapsulation() { return "shadow"; }
|
|
@@ -32,7 +32,7 @@ export class VviinnOverlay {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
render() {
|
|
35
|
-
return (h("dialog", { key: '
|
|
35
|
+
return (h("dialog", { key: 'a35c2023604b1de5f6c38869832a1bc82ada47d3', ref: (el) => (this.dialogRef = el), onAnimationEnd: this.handleAnimationEnd }, h("slot", { key: 'f48f9137827b0cbdac4022f1be0a33330f278552' })));
|
|
36
36
|
}
|
|
37
37
|
static get is() { return "vviinn-overlay"; }
|
|
38
38
|
static get encapsulation() { return "shadow"; }
|
|
@@ -6,7 +6,7 @@ export class VviinnOverlayedModal {
|
|
|
6
6
|
this.hideBackButton = false;
|
|
7
7
|
}
|
|
8
8
|
render() {
|
|
9
|
-
return (h(Host, { key: '
|
|
9
|
+
return (h(Host, { key: '32e8d4e925e77941445edaf5b403e1ae020e33fb' }, h("vviinn-overlay", { key: '584afbe6de3cc7d6670e0242fe5bdc1853efa787', active: this.active }, h("vviinn-modal", { key: '03993aaa1c481819cf6909ea1c83dd501a34b164', resetState: this.resetState, active: this.active, buttonElementId: this.buttonElementId, hideBackButton: this.hideBackButton, widgetVersion: this.widgetVersion, isFirstScreen: this.isFirstScreen }, h("slot", { key: '59ff72bd0569dd3a0cb1ecefcd94f7f22ded92bb' }, "CONTENT")))));
|
|
10
10
|
}
|
|
11
11
|
static get is() { return "vviinn-overlayed-modal"; }
|
|
12
12
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
export class VviinnPreloader {
|
|
3
3
|
render() {
|
|
4
|
-
return h(Host, { key: '
|
|
4
|
+
return h(Host, { key: '9915424347748222693eb70e98216b2d2fe6969b' });
|
|
5
5
|
}
|
|
6
6
|
static get is() { return "vviinn-preloader"; }
|
|
7
7
|
static get encapsulation() { return "shadow"; }
|
|
@@ -19,7 +19,7 @@ export class VviinnPrivacyBadge {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
return (h(Host, { key: '
|
|
22
|
+
return (h(Host, { key: 'c1bd1ffac9b817b4bb8ca9b0b9f66b406abf6b69' }, h("slot", { key: 'a55744d30b8957f7eb1f2114361ac26cd670974f', name: "vviinn-privacy-badge-text" }, h("div", { key: '66ed59809f59942c3bbf00b1a26dddf17cfb31ce', innerHTML: this.privacyBadgeText }))));
|
|
23
23
|
}
|
|
24
24
|
static get is() { return "vviinn-privacy-badge"; }
|
|
25
25
|
static get encapsulation() { return "shadow"; }
|
package/dist/collection/components/vviinn-product-card/vviinn-energy-label/vviinn-energy-label.js
CHANGED
|
@@ -36,9 +36,9 @@ export class VviinnEnergyLabel {
|
|
|
36
36
|
return i18next.t("energyLabel.iconAlt");
|
|
37
37
|
}
|
|
38
38
|
render() {
|
|
39
|
-
return (h(Host, { key: '
|
|
39
|
+
return (h(Host, { key: '9a53d56bb0772e1118fc4f5cda718e9b29adaf24', class: {
|
|
40
40
|
hidden: !this.classIconUrls && !this.productType && !this.classDataSheetUrl,
|
|
41
|
-
}, exportparts: energyLabelParts }, h("div", { key: '
|
|
41
|
+
}, exportparts: energyLabelParts }, h("div", { key: '73fa2bd6c113c6fc3f1834b630403271fb168da4', class: "container", part: "energy-label-container" }, !!this.classIconUrls && (h("img", { key: '3737b12a4aab1f06205186d9ffd7642a1ed527c0', class: "class-label-icon", part: "energy-label-icon", src: this.classIconUrls[this.iconDirection], alt: this.getEnergyIconAltText() })), (this.productType || this.classDataSheetUrl) && (h("div", { key: '45c195a6b7bcd3fbf69d330ae22e6666519b54e6', class: "info-container" }, this.productType && (h("span", { key: '52725161ec90599fadb046ab396194b1d83b3bb1', class: "product-type", part: "energy-label-product-type" }, this.productType)), this.classDataSheetUrl && (h("a", { key: '31efc6ee893e9721cf58a6387b4568832c81ddee', class: "data-sheet-link", part: "energy-label-data-sheet-link", href: this.classDataSheetUrl, target: "_blank", rel: "noopener noreferrer" }, h("slot", { key: 'ece6066ee47b41db4b7dfd43a50ad24210e0d037', name: "vviinn-energy-label-data-sheet-text" }, i18next.t("energyLabel.dataSheetText")))))))));
|
|
42
42
|
}
|
|
43
43
|
static get is() { return "vviinn-energy-label"; }
|
|
44
44
|
static get encapsulation() { return "shadow"; }
|
|
@@ -432,13 +432,13 @@ export class VviinnResults {
|
|
|
432
432
|
render() {
|
|
433
433
|
var _a;
|
|
434
434
|
const resultsLength = this.getResults().length;
|
|
435
|
-
return (h(Host, { key: '
|
|
435
|
+
return (h(Host, { key: '0767d0c21dee72b9a0f09a80dfe2ca7c375e4d50', id: "results-block", class: {
|
|
436
436
|
"show-in-widget": this.showInWidget,
|
|
437
437
|
"matching-discovery": this.oneClickDiscoveryMode === "append-slider",
|
|
438
|
-
}, exportparts: `${productCardParts}, ${listCardParts}, ${contentCardParts}, ${productCardsGridPart}` }, renderExternalCSS(this.cssUrl), h("div", { key: '
|
|
438
|
+
}, exportparts: `${productCardParts}, ${listCardParts}, ${contentCardParts}, ${productCardsGridPart}` }, renderExternalCSS(this.cssUrl), h("div", { key: 'bfd01f2bf39be84501ce0cf42f5672acda3e500b', class: "nothing-found" }, this.getCurrentErrorType() && (h("vviinn-error", { key: 'ce077ad92253c7727a509567571d821ebda6dbd4', errorType: this.getCurrentErrorType(), handler: this.resetWidgetState, hasBackground: this.showInWidget, searchType: this.state.searchType }))), h("div", { key: 'dc63984664328f04abe6011aa0db856cb862f37c', class: {
|
|
439
439
|
hidden: this.showAspectRatioError || resultsLength === 0,
|
|
440
440
|
products: true,
|
|
441
|
-
}, part: productCardsGridPart, id: "vviinn-results-products" }, resultsLength > 0 && this.renderResults(), h("div", { key: '
|
|
441
|
+
}, part: productCardsGridPart, id: "vviinn-results-products" }, resultsLength > 0 && this.renderResults(), h("div", { key: '2e39c5d65c5c7981c0b9a93dfe97ad62165a25b4', id: "one-click-discovery-append", style: {
|
|
442
442
|
order: ((_a = this.oneClickDiscoveryAppendIndex) !== null && _a !== void 0 ? _a : resultsLength).toString(),
|
|
443
443
|
} }))));
|
|
444
444
|
}
|
|
@@ -849,7 +849,7 @@ export class VviinnShopTheLook {
|
|
|
849
849
|
}, TIMING.SEARCH_DEBOUNCE_DELAY);
|
|
850
850
|
}
|
|
851
851
|
render() {
|
|
852
|
-
return (h(Host, { key: '
|
|
852
|
+
return (h(Host, { key: '810afce8775ce69f39d3ddb19dbfafc081f90b95', exportparts: shopTheLookParts }, renderExternalCSS(this.cssUrl), h("div", { key: 'ab678e97ff5878b7d68fb63fa6ad0344f55e56eb', class: `shop-the-look-container ${this.showModal ? "modal-open" : ""} ${this.showCropper ? "with-cropper" : ""} widget-style-${this.widgetStyle}` }, h("div", { key: '78fe26aa58f8c8da8a49a0a1f20d27025de4270e', class: "main-content" }, this.renderSwiperWrapper(), this.showLoadingSpinner && (h("div", { key: '02ee522ea4f2f60a5becae75834123f7f2059d31', class: "search-loader" }, h("vviinn-preloader", { key: '209d5b1caf48f57ef4ab0f143e77c83e9547403d' })))), this.renderModalWrapper(), h("div", { key: '8a92411b196592578c1811e88b20b5c79d955751', class: "actions-container", part: "shop-the-look-actions-container" }, this.uploadMode && (h("div", { key: '283494b6ed7e2279ebc12ba00bff48679bd84515', class: "upload-button-container" }, h("button", { key: '6843b123419ab70e75c38d2ef1fc6f95724198f6', class: "upload-button", part: "shop-the-look-upload-button", onClick: () => { var _a; return (_a = this.fileInput) === null || _a === void 0 ? void 0 : _a.click(); }, disabled: this.showLoadingSpinner }, h("span", { key: '921d7b5487c68d1e5f3095415d7d195a76de5a53', class: "upload-button-icon", part: "shop-the-look-upload-button-icon" }, h("slot", { key: 'c5a149403be172d546d34e4271a04b6bf7184cf2', name: "vviinn-image-upload-icon" }, h(UploadActionIconVariant, { key: '363804dec9e24cf917d8da7244285f14dd874e61' }))), h("span", { key: 'fde616b05fc029c9cc45e063483f0401efdf2ba5', class: "upload-button-text", part: "shop-the-look-upload-button-text" }, h("slot", { key: '756831c7b944e0f651b7907bf522375a35acb247', name: "upload-button-text" }))), h("input", { key: '6489e9ccae6426f4a96d57c2bec5b9c41b77916b', type: "file", class: "visually-hidden", accept: getAcceptableFileFormats(), onChange: this.handleFileUpload, ref: (el) => (this.fileInput = el) }))), this.showNavigation() &&
|
|
853
853
|
renderNavigation(this.swiperActiveIndex, this.totalImages, this.handleNavigatePrev, this.handleNavigateNext)))));
|
|
854
854
|
}
|
|
855
855
|
static get is() { return "vviinn-shop-the-look"; }
|
|
@@ -4,7 +4,7 @@ export class VviinnSkeleton {
|
|
|
4
4
|
this.halfWidth = false;
|
|
5
5
|
}
|
|
6
6
|
render() {
|
|
7
|
-
return (h(Host, { key: '
|
|
7
|
+
return (h(Host, { key: '762b28b1619a152ca13d7f71c23ede1b8182bf8a' }, h("div", { key: '4509aa114dddccfaa65a5bb593f1dfecddb054ba', class: {
|
|
8
8
|
"vviinn-skeleton": true,
|
|
9
9
|
}, style: {
|
|
10
10
|
height: this.height ? `${this.height.toString()}px` : "100%",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
export class VviinnSlide {
|
|
3
3
|
render() {
|
|
4
|
-
return (h(Host, { key: '
|
|
4
|
+
return (h(Host, { key: '8740746256bbf7c374da17ff2bca8730108586c8' }, h("slot", { key: '2de442bb958c11b063b2d9d3a416e5a8df33d3cb' })));
|
|
5
5
|
}
|
|
6
6
|
static get is() { return "vviinn-slide"; }
|
|
7
7
|
static get encapsulation() { return "shadow"; }
|
|
@@ -38,7 +38,7 @@ export class VviinnSlider {
|
|
|
38
38
|
return this.isRTL ? position * -1 : position;
|
|
39
39
|
}
|
|
40
40
|
render() {
|
|
41
|
-
return (h(Host, { key: '
|
|
41
|
+
return (h(Host, { key: '6ee307d2510c452af6a730498f67fa26324f2990' }, h("div", { key: '1e721a9e0da711a893d318a3536668362da3c2b7', class: "items-wrapper" }, h("div", { key: 'd48b29eb243c35ac655e0b784b7303e239b416b0', class: "items" }, h("slot", { key: 'dc63e964c8def5b7202377c0c9f75681e7220ad9' })))));
|
|
42
42
|
}
|
|
43
43
|
static get is() { return "vviinn-slider"; }
|
|
44
44
|
static get encapsulation() { return "shadow"; }
|
|
@@ -6,7 +6,7 @@ export class VviinnTeaser {
|
|
|
6
6
|
slotChangeListener(this, this.el);
|
|
7
7
|
}
|
|
8
8
|
render() {
|
|
9
|
-
return (h(Host, { key: '
|
|
9
|
+
return (h(Host, { key: 'fe777d0460b338bc11c372b2ae6d1c75120484cd' }, h("slot", { key: '85b8c8777d91d0fe48e955a601bf5742e50a3f12' }, h("span", { key: '2f4033a65dac4820a1236e52a470cc0523a31745', class: "vviinn-teaser-text" }, h("slot", { key: '75f5fbc11611d5b12d996dbf9267cc47c59f0269', name: "vviinn-teaser-text" }, i18next.t("teaserText"))))));
|
|
10
10
|
}
|
|
11
11
|
static get is() { return "vviinn-teaser"; }
|
|
12
12
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { makeAutoSuggestRequest, setTextSearchQuery, } from "../../../store/search.store";
|
|
2
2
|
const AUTO_SUGGEST_DEBOUNCE_MS = 300;
|
|
3
|
-
export const createAutoSuggestHandler = (storeName, token, apiPath) => {
|
|
3
|
+
export const createAutoSuggestHandler = (storeName, token, apiPath, onCompletions) => {
|
|
4
4
|
let debounceTimer;
|
|
5
5
|
const handleInputChange = (value) => {
|
|
6
6
|
setTextSearchQuery(storeName, value);
|
|
7
7
|
clearTimeout(debounceTimer);
|
|
8
8
|
if (!value) {
|
|
9
|
-
|
|
9
|
+
onCompletions([]);
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
12
12
|
debounceTimer = setTimeout(() => {
|
|
13
|
-
makeAutoSuggestRequest(storeName, value, token, apiPath);
|
|
13
|
+
makeAutoSuggestRequest(storeName, value, token, apiPath, onCompletions);
|
|
14
14
|
}, AUTO_SUGGEST_DEBOUNCE_MS);
|
|
15
15
|
};
|
|
16
16
|
const cancelPending = () => clearTimeout(debounceTimer);
|
|
@@ -2,7 +2,7 @@ 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 { version } from "../../../package.json";
|
|
5
|
-
import {
|
|
5
|
+
import { makeAutoSuggestRequest, makeTextSearchRequest, setTextSearchQuery, useSearchStore, } from "../../store/search.store";
|
|
6
6
|
import { TextSearchIcon } from "../vviinn-icons";
|
|
7
7
|
import { slotChangeListener } from "../customized-slots";
|
|
8
8
|
import i18next from "i18next";
|
|
@@ -46,7 +46,9 @@ export class VviinnTextSearch {
|
|
|
46
46
|
/** Custom placeholder for the text search input */
|
|
47
47
|
this.placeholder = "";
|
|
48
48
|
/** Show auto-suggest dropdown with search completions */
|
|
49
|
-
this.autoSuggestShow =
|
|
49
|
+
this.autoSuggestShow = true;
|
|
50
|
+
/** Accept image files dropped from the OS onto the upload button (desktop only) */
|
|
51
|
+
this.useDragAndDrop = false;
|
|
50
52
|
/** True, when used inside the widget */
|
|
51
53
|
/** @internal */
|
|
52
54
|
this.showInWidget = false;
|
|
@@ -59,6 +61,7 @@ export class VviinnTextSearch {
|
|
|
59
61
|
this.activeSuggestionIndex = -1;
|
|
60
62
|
this.originalQuery = "";
|
|
61
63
|
this.searchSubmitted = false;
|
|
64
|
+
this.isDisconnected = false;
|
|
62
65
|
this.slots = [];
|
|
63
66
|
this.isShowPreloader = () => this.state.searchStatus === "loading" && this.state.searchType === "text";
|
|
64
67
|
this.isShowRecording = () => this.isRecording;
|
|
@@ -74,6 +77,14 @@ export class VviinnTextSearch {
|
|
|
74
77
|
? this.placeholder
|
|
75
78
|
: i18next.t("textSearchPlaceholder");
|
|
76
79
|
this.recognition = null;
|
|
80
|
+
this.setAutoSuggestCompletions = (completions) => {
|
|
81
|
+
if (this.isDisconnected)
|
|
82
|
+
return;
|
|
83
|
+
if (this.searchSubmitted && completions.length > 0)
|
|
84
|
+
return;
|
|
85
|
+
this.autoSuggestCompletions = completions;
|
|
86
|
+
this.activeSuggestionIndex = -1;
|
|
87
|
+
};
|
|
77
88
|
this.trackTextSearch = () => this.vviinnFilterTriggered.emit({
|
|
78
89
|
kind: this.state.textSearchQuery,
|
|
79
90
|
action: "select",
|
|
@@ -108,7 +119,8 @@ export class VviinnTextSearch {
|
|
|
108
119
|
}
|
|
109
120
|
};
|
|
110
121
|
this.hideSuggestions = () => {
|
|
111
|
-
|
|
122
|
+
this.autoSuggestCompletions = [];
|
|
123
|
+
this.activeSuggestionIndex = -1;
|
|
112
124
|
};
|
|
113
125
|
this.selectSuggestion = (completion) => {
|
|
114
126
|
setTextSearchQuery(this.storeName, completion.suggestion);
|
|
@@ -166,7 +178,7 @@ export class VviinnTextSearch {
|
|
|
166
178
|
}
|
|
167
179
|
};
|
|
168
180
|
this.checkAutoSuggest = async (query) => {
|
|
169
|
-
pipe(await makeAutoSuggestRequest(this.storeName, query, this.token, this.apiPath), E.fold(
|
|
181
|
+
pipe(await makeAutoSuggestRequest(this.storeName, query, this.token, this.apiPath, this.setAutoSuggestCompletions), E.fold(
|
|
170
182
|
// Intentionally ignore errors for auto-suggest
|
|
171
183
|
() => { }, () => { }));
|
|
172
184
|
};
|
|
@@ -197,24 +209,17 @@ export class VviinnTextSearch {
|
|
|
197
209
|
};
|
|
198
210
|
}
|
|
199
211
|
connectedCallback() {
|
|
200
|
-
const { state, storeName
|
|
212
|
+
const { state, storeName } = useSearchStore(this.showInWidget);
|
|
201
213
|
this.state = state;
|
|
202
214
|
this.storeName = storeName;
|
|
203
|
-
|
|
204
|
-
this.disposeOnChange = onChange("autoSuggestCompletions", (completions) => {
|
|
205
|
-
if (this.searchSubmitted && completions.length > 0)
|
|
206
|
-
return;
|
|
207
|
-
this.autoSuggestCompletions = completions;
|
|
208
|
-
this.activeSuggestionIndex = -1;
|
|
209
|
-
});
|
|
210
|
-
}
|
|
215
|
+
this.isDisconnected = false;
|
|
211
216
|
}
|
|
212
217
|
disconnectedCallback() {
|
|
213
|
-
var _a
|
|
218
|
+
var _a;
|
|
219
|
+
this.isDisconnected = true;
|
|
214
220
|
clearTimeout(this.triggerTooltipStart);
|
|
215
221
|
clearTimeout(this.triggerTooltipEnd);
|
|
216
222
|
(_a = this.autoSuggestHandler) === null || _a === void 0 ? void 0 : _a.cleanup();
|
|
217
|
-
(_b = this.disposeOnChange) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
218
223
|
}
|
|
219
224
|
async componentWillLoad() {
|
|
220
225
|
var _a, _b, _c;
|
|
@@ -222,7 +227,7 @@ export class VviinnTextSearch {
|
|
|
222
227
|
slotChangeListener(this, this.el);
|
|
223
228
|
this.slots = findSlotElements(this.el);
|
|
224
229
|
if (this.autoSuggestShow) {
|
|
225
|
-
this.autoSuggestHandler = createAutoSuggestHandler(this.storeName, this.token, this.apiPath);
|
|
230
|
+
this.autoSuggestHandler = createAutoSuggestHandler(this.storeName, this.token, this.apiPath, this.setAutoSuggestCompletions);
|
|
226
231
|
}
|
|
227
232
|
this.recognition = initializeRecognition((_a = this.locale) !== null && _a !== void 0 ? _a : defaultConfig.locale, () => {
|
|
228
233
|
this.showRecording();
|
|
@@ -267,7 +272,7 @@ export class VviinnTextSearch {
|
|
|
267
272
|
}
|
|
268
273
|
}
|
|
269
274
|
render() {
|
|
270
|
-
return (h(Host, { key: '
|
|
275
|
+
return (h(Host, { key: '1a6f096832c3cf72d92192e45633a4232ddcd16d', exportparts: `${searchBarParts}, ${searchModalFirstScreenParts}` }, h("div", { key: '7aa3981060a964959c714bf63bcc15d0e0c63250', class: "text-search-container", part: "text-search-container" }, h("input", Object.assign({ key: '21f53521ba84845aaaacc3a6ee80c42ebe1886e1', class: "text-search-input", part: "text-search-input", type: "text", placeholder: this.getPlaceholderText(), value: this.state.textSearchQuery || "", onInput: (event) => this.handleInputChange(event), onKeyDown: this.handleKeyDown, onBlur: this.autoSuggestShow ? this.hideSuggestions : undefined }, (this.autoSuggestShow && {
|
|
271
276
|
role: "combobox",
|
|
272
277
|
"aria-autocomplete": "list",
|
|
273
278
|
"aria-expanded": this.autoSuggestCompletions.length > 0 &&
|
|
@@ -278,11 +283,11 @@ export class VviinnTextSearch {
|
|
|
278
283
|
"aria-activedescendant": this.activeSuggestionIndex >= 0
|
|
279
284
|
? `suggestion-${this.activeSuggestionIndex}`
|
|
280
285
|
: undefined,
|
|
281
|
-
}))), this.mode === "extended" && (h("vviinn-vps-button", Object.assign({ key: '
|
|
286
|
+
}))), this.mode === "extended" && (h("vviinn-vps-button", Object.assign({ key: '5c30334834e202f2961c8b31b722755254e65509', token: this.token, locale: this.locale, apiPath: this.apiPath, addStyle: false, showResultsInModal: false, resultsPageUrl: this.resultsPageUrl, resultsPageParams: this.resultsPageParams }, (this.exampleImageSource && {
|
|
282
287
|
exampleImageSource: this.exampleImageSource,
|
|
283
|
-
}), (this.cssUrl != null && { cssUrl: this.cssUrl }), (this.visualSearchMode && { mode: this.visualSearchMode }), { parentSlots: this.slots }))), this.mode === "basic" && (h("slot", { key: '
|
|
284
|
-
this.recognition && (h("button", { key: '
|
|
285
|
-
renderSuggestions(this.autoSuggestCompletions, this.state.textSearchQuery, this.activeSuggestionIndex, this.selectSuggestion), this.showTooltip && (h("p", { key: '
|
|
288
|
+
}), (this.cssUrl != null && { cssUrl: this.cssUrl }), (this.visualSearchMode && { mode: this.visualSearchMode }), { useDragAndDrop: this.useDragAndDrop, parentSlots: this.slots }))), this.mode === "basic" && (h("slot", { key: 'a5ab212b55f258c70fa0fbee172753614ef9c363', name: "vviinn-text-search-actions" })), (this.mode === "extended" || this.showInWidget) &&
|
|
289
|
+
this.recognition && (h("button", { key: '251ac94cac8ae50af09ea450f66348faad27f347', class: "speech-button", part: "speech-button", "aria-label": i18next.t("a11y.speechButton"), onClick: this.handleSpeech, onKeyDown: (event) => this.handleButtonKeyDown(event, this.handleSpeech) }, h(MicIcon, { key: '3ee272b4696a78dbe8c8c4ecc915c3704fecb7a3' }), this.isShowRecording() && (h("span", { key: 'a0b2bcaeff31df8d27a2645da02dc00a78940735', class: "recording-indicator" })))), h("button", { key: '1639827b452ff09835eeee31736cd86d80036681', class: "text-search-button", part: "text-search-button", onClick: () => this.handleTextSearch(), onKeyDown: (event) => this.handleButtonKeyDown(event, this.handleTextSearch), disabled: this.state.searchStatus === "loading", "aria-label": i18next.t("a11y.textSearchButton") }, this.isShowPreloader() ? (h("vviinn-preloader", null)) : (h("slot", { name: "vviinn-text-search-icon" }, h(TextSearchIcon, null))))), this.autoSuggestShow &&
|
|
290
|
+
renderSuggestions(this.autoSuggestCompletions, this.state.textSearchQuery, this.activeSuggestionIndex, this.selectSuggestion), this.showTooltip && (h("p", { key: '5cdc28a630f1d1e92444382e5c13da889b617e15', class: "text-search-tooltip", part: "text-search-tooltip" }, i18next.t(this.tooltipText)))));
|
|
286
291
|
}
|
|
287
292
|
static get is() { return "vviinn-text-search"; }
|
|
288
293
|
static get encapsulation() { return "shadow"; }
|
|
@@ -482,7 +487,7 @@ export class VviinnTextSearch {
|
|
|
482
487
|
"getter": false,
|
|
483
488
|
"setter": false,
|
|
484
489
|
"reflect": false,
|
|
485
|
-
"defaultValue": "
|
|
490
|
+
"defaultValue": "true"
|
|
486
491
|
},
|
|
487
492
|
"exampleImageSource": {
|
|
488
493
|
"type": "string",
|
|
@@ -547,6 +552,26 @@ export class VviinnTextSearch {
|
|
|
547
552
|
"setter": false,
|
|
548
553
|
"reflect": false
|
|
549
554
|
},
|
|
555
|
+
"useDragAndDrop": {
|
|
556
|
+
"type": "boolean",
|
|
557
|
+
"attribute": "use-drag-and-drop",
|
|
558
|
+
"mutable": false,
|
|
559
|
+
"complexType": {
|
|
560
|
+
"original": "boolean",
|
|
561
|
+
"resolved": "boolean",
|
|
562
|
+
"references": {}
|
|
563
|
+
},
|
|
564
|
+
"required": false,
|
|
565
|
+
"optional": false,
|
|
566
|
+
"docs": {
|
|
567
|
+
"tags": [],
|
|
568
|
+
"text": "Accept image files dropped from the OS onto the upload button (desktop only)"
|
|
569
|
+
},
|
|
570
|
+
"getter": false,
|
|
571
|
+
"setter": false,
|
|
572
|
+
"reflect": false,
|
|
573
|
+
"defaultValue": "false"
|
|
574
|
+
},
|
|
550
575
|
"showInWidget": {
|
|
551
576
|
"type": "boolean",
|
|
552
577
|
"attribute": "show-in-widget",
|
|
@@ -124,17 +124,17 @@ export class RecommendationsSidebar {
|
|
|
124
124
|
}
|
|
125
125
|
render() {
|
|
126
126
|
var _a;
|
|
127
|
-
return (h(Host, { key: '
|
|
127
|
+
return (h(Host, { key: '1d8e4cd403128aab03e0944fc2e4a5b0233872d0', class: this.getClassMap(), style: { display: this.hidden ? "none" : undefined }, exportparts: `body, close-sidebar, ${carouselParts}, ${productCardParts}, ${recommendationsParts}` }, h("div", { key: 'b930c6fd2eb2af705b15fc6a06e87f674a7b4f8b', class: "sidebar", part: "body", onAnimationEnd: (e) => this.handleAnimationEnd(e), role: this.showInModal ? "dialog" : "region", "aria-modal": this.showInModal ? "true" : undefined, "aria-label": i18next.t("a11y.recommendations") }, h("div", { key: 'dd428f49ceb3a3b3ef6fa81419de0575df1323ec', class: {
|
|
128
128
|
"sidebar-header": true,
|
|
129
129
|
"contains-source-img": this.isSourceImageValid(),
|
|
130
|
-
}, part: "sidebar-header" }, this.mode !== "set" && (h(Fragment, { key: '
|
|
130
|
+
}, part: "sidebar-header" }, this.mode !== "set" && (h(Fragment, { key: '21fafcf398cf1f3edb25cbeffdc80ecc3edc4926' }, this.renderSourceImage(), ((_a = this.sidebarTitle) === null || _a === void 0 ? void 0 : _a.length) !== 0 && (h("span", { key: '1a35ffde2d9360bc50399919bb210f38df6bd906', class: "title", part: "recommendations-title" }, this.sidebarTitle || i18next.t("discoveryWidgetTitle"))), !!this.sidebarSubtitle && (h("span", { key: 'a97989a713840aabcf5e54ca2b7867a21bc3ddb4', class: "subtitle", part: "recommendations-subtitle" }, this.sidebarSubtitle)))), h("button", { key: 'c41bd72d0344559e9536c62981ffd3e9a123253c', class: "close-sidebar", onClick: () => {
|
|
131
131
|
this.sidebarState = "closed";
|
|
132
132
|
}, onKeyDown: (event) => {
|
|
133
133
|
if (event.key === "Enter" || event.key === " ") {
|
|
134
134
|
event.preventDefault();
|
|
135
135
|
this.sidebarState = "closed";
|
|
136
136
|
}
|
|
137
|
-
}, part: "close-sidebar", "aria-label": i18next.t("a11y.closeButton") }, h(CrossIcon, { key: '
|
|
137
|
+
}, part: "close-sidebar", "aria-label": i18next.t("a11y.closeButton") }, h(CrossIcon, { key: 'aaaee4b427d589ba8daacd323b3d3f249f1ac31c' }))), h("div", { key: '0b8861dffd567eb124e5bce8fc813f74227cdcb9', class: "sidebar-content", part: "sidebar-content" }, h("vviinn-vpr-widget", { key: 'bec924b0073e25b2f57ab3d05c532facd542b0a5', token: this.token, currencySign: this.currencySign, pricePrefix: this.pricePrefix, apiPath: this.apiPath, locale: this.locale, numberLocale: this.numberLocale, productId: this.productId, exportparts: `${carouselParts}, ${productCardParts}, ${recommendationsParts}`, imageWidth: this.imageWidth, showMultipleImages: this.showMultipleImages, setItemsAmount: this.setItemsAmount, blockTitle: this.mode !== "set" ? "" : this.sidebarTitle, blockSubtitle: this.mode === "set" ? this.sidebarSubtitle : undefined, mode: this.mode, "campaign-type": this.campaignType, useCarousel: this.useCarousel, onVviinnRecommendationsLoaded: () => {
|
|
138
138
|
this.hidden = false;
|
|
139
139
|
this.sidebarState = "open";
|
|
140
140
|
}, showScroll: this.widgetScrollbar, campaigns: this.campaigns, color: this.color, buttonElementId: this.buttonElementId, noResultText: this.noResultText, noResultShow: this.noResultShow, gridArrowsDynamic: this.gridArrowsDynamic, showingInButton: this.showingInButton, excluded: this.excluded, productDetailsNewTab: this.productDetailsNewTab, productDetailsRedirect: this.productDetailsRedirect, closed: this.sidebarState === "closed", opened: this.sidebarState === "open", addToBasketShow: this.addToBasketShow, cssUrl: this.cssUrl, showFilters: this.showFilters, setModeDiscounts: this.setModeDiscounts, updateButtonLocation: this.updateButtonLocation, addPriceContainer: this.addPriceContainer, favoriteShow: this.favoriteShow, isAppended: this.isAppended, showInWidget: this.showInWidget, recommendationsLoading: this.recommendationsLoading, setRecommendationsLoading: this.setRecommendationsLoading, imageResolutionWidth: this.imageResolutionWidth, uiSessionId: this.uiSessionId })))));
|
|
@@ -214,7 +214,7 @@ export class VviinnVprButton {
|
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
render() {
|
|
217
|
-
return (h(Host, { key: '
|
|
217
|
+
return (h(Host, { key: '6edbdcb0f7dc456060d8a87cab4d347fca170165', role: "button", tabindex: "0", "aria-label": this.getAriaLabel(), onClick: this.handleButtonClick, onKeyDown: this.handleKeyDown }, renderExternalCSS(this.cssUrl), h("vviinn-button", { key: '3dbb30111e60d51feb77a2ac9cbeb669f11dd620', addStyle: this.addStyle, part: "vviinn-button" }, h("slot", { key: '3dee5fa42088fb238db95b62b7a97aa6cff56b93' }, this.campaignType === "VCS" ? (h(CrossSellingIcon, { width: this.iconSideSize, height: this.iconSideSize })) : (h(SimilarProductsIcon, { width: this.iconSideSize, height: this.iconSideSize }))))));
|
|
218
218
|
}
|
|
219
219
|
handleClick() {
|
|
220
220
|
const sidebar = document.createElement("vviinn-recommendations-sidebar");
|