vviinn-widgets 2.220.0 → 2.222.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.
Files changed (117) hide show
  1. package/dist/cjs/{SecondaryActionIcon-Ng84u7-b.js → SecondaryActionIcon-CuNEBTWD.js} +1 -1
  2. package/dist/cjs/{cssUrlHelper-BX9kngtZ.js → cssUrlHelper-B5A2BBm7.js} +1 -1
  3. package/dist/cjs/{index-CvMi8_tX.js → index-BF9aENF8.js} +6 -2
  4. package/dist/cjs/{index-D38ORu31.js → index-BU8FMTXn.js} +3 -0
  5. package/dist/cjs/{index-CBteD3gC.js → index-CP1QUrJT.js} +11 -1
  6. package/dist/cjs/{index-FE9nOqQo.js → index-RlbsyJJk.js} +2 -2
  7. package/dist/cjs/loader.cjs.js +2 -2
  8. package/dist/cjs/{search.store-C6QU_D02.js → search.store-D4WiAMcl.js} +8 -3
  9. package/dist/cjs/vviinn-button_6.cjs.entry.js +13 -13
  10. package/dist/cjs/vviinn-camera_12.cjs.entry.js +219 -115
  11. package/dist/cjs/vviinn-carousel_10.cjs.entry.js +9 -9
  12. package/dist/cjs/vviinn-detected-object_2.cjs.entry.js +2 -2
  13. package/dist/cjs/vviinn-shop-the-look.cjs.entry.js +6 -6
  14. package/dist/cjs/vviinn-text-search.cjs.entry.js +11 -9
  15. package/dist/cjs/vviinn-vps-button.cjs.entry.js +15 -6
  16. package/dist/cjs/vviinn-widgets.cjs.js +2 -2
  17. package/dist/collection/Image/error.js +6 -1
  18. package/dist/collection/components/customized-slots.js +2 -0
  19. package/dist/collection/components/vviinn-icons/icons/DragDropImageIcon.js +2 -0
  20. package/dist/collection/components/vviinn-icons/index.js +1 -0
  21. package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.css +36 -1
  22. package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.js +132 -21
  23. package/dist/collection/components/vviinn-modal/vviinn-modal.js +2 -2
  24. package/dist/collection/components/vviinn-overlay/vviinn-overlay.js +1 -1
  25. package/dist/collection/components/vviinn-overlayed-modal/vviinn-overlayed-modal.js +1 -1
  26. package/dist/collection/components/vviinn-preloader/vviinn-preloader.js +1 -1
  27. package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.js +1 -1
  28. package/dist/collection/components/vviinn-product-card/vviinn-energy-label/vviinn-energy-label.js +2 -2
  29. package/dist/collection/components/vviinn-results/vviinn-results.js +3 -3
  30. package/dist/collection/components/vviinn-shop-the-look/vviinn-shop-the-look.js +1 -1
  31. package/dist/collection/components/vviinn-skeleton/vviinn-skeleton.js +1 -1
  32. package/dist/collection/components/vviinn-slider/vviinn-slide/vviinn-slide.js +1 -1
  33. package/dist/collection/components/vviinn-slider/vviinn-slider.js +1 -1
  34. package/dist/collection/components/vviinn-suggestions/helpers.js +27 -10
  35. package/dist/collection/components/vviinn-suggestions/render-helpers.js +42 -15
  36. package/dist/collection/components/vviinn-teaser/vviinn-teaser.js +1 -1
  37. package/dist/collection/components/vviinn-text-search/vviinn-text-search.js +27 -5
  38. package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js +3 -3
  39. package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +1 -1
  40. package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +37 -4
  41. package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.css +35 -1
  42. package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +37 -14
  43. package/dist/collection/cssParts/index.js +2 -0
  44. package/dist/collection/dom/index.js +7 -0
  45. package/dist/collection/helpers/dragAndDrop/parseDroppedFile.js +2 -0
  46. package/dist/collection/locale/resources.js +4 -2
  47. package/dist/esm/{SecondaryActionIcon-FWFzrhba.js → SecondaryActionIcon-D4f3aMUD.js} +1 -1
  48. package/dist/esm/{cssUrlHelper-DsQD_dY6.js → cssUrlHelper-Byz4s-MD.js} +1 -1
  49. package/dist/esm/{index-RkvPN2Rk.js → index-B89nCb_F.js} +3 -0
  50. package/dist/esm/{index-BtnjaTty.js → index-BCrstDkj.js} +6 -2
  51. package/dist/esm/{index-OsoUj2Au.js → index-C1-PYhS4.js} +11 -2
  52. package/dist/esm/{index-ChtanA0O.js → index-CEzGPs5u.js} +2 -2
  53. package/dist/esm/loader.js +3 -3
  54. package/dist/esm/{search.store-BVRhMpHA.js → search.store-Cgs5icgA.js} +8 -3
  55. package/dist/esm/vviinn-button_6.entry.js +13 -13
  56. package/dist/esm/vviinn-camera_12.entry.js +219 -115
  57. package/dist/esm/vviinn-carousel_10.entry.js +9 -9
  58. package/dist/esm/vviinn-detected-object_2.entry.js +2 -2
  59. package/dist/esm/vviinn-shop-the-look.entry.js +6 -6
  60. package/dist/esm/vviinn-text-search.entry.js +11 -9
  61. package/dist/esm/vviinn-vps-button.entry.js +15 -6
  62. package/dist/esm/vviinn-widgets.js +3 -3
  63. package/dist/types/components/vviinn-icons/icons/DragDropImageIcon.d.ts +1 -0
  64. package/dist/types/components/vviinn-icons/index.d.ts +1 -0
  65. package/dist/types/components/vviinn-image-selector/vviinn-image-selector.d.ts +11 -0
  66. package/dist/types/components/vviinn-suggestions/helpers.d.ts +1 -0
  67. package/dist/types/components/vviinn-text-search/vviinn-text-search.d.ts +2 -0
  68. package/dist/types/components/vviinn-vps-button/vviinn-vps-button.d.ts +6 -0
  69. package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +2 -0
  70. package/dist/types/components.d.ts +32 -0
  71. package/dist/types/dom/index.d.ts +1 -0
  72. package/dist/types/helpers/dragAndDrop/parseDroppedFile.d.ts +2 -0
  73. package/dist/vviinn-widgets/p-0b7e8e2e.entry.js +1 -0
  74. package/dist/vviinn-widgets/{p-a8d88d55.entry.js → p-27b41f88.entry.js} +1 -1
  75. package/dist/vviinn-widgets/p-7411202d.entry.js +1 -0
  76. package/dist/vviinn-widgets/p-818a1e53.entry.js +1 -0
  77. package/dist/vviinn-widgets/{p-CU3f7I7a.js → p-B246LK7U.js} +1 -1
  78. package/dist/vviinn-widgets/{p-RkvPN2Rk.js → p-B89nCb_F.js} +1 -1
  79. package/dist/vviinn-widgets/p-BadZr0hq.js +1 -0
  80. package/dist/vviinn-widgets/{p-D3wRLf2J.js → p-BfTXDLup.js} +1 -1
  81. package/dist/vviinn-widgets/p-Bq5Hj7Kz.js +1 -0
  82. package/{www/build/p-CZFFW_Cj.js → dist/vviinn-widgets/p-Cxd6yzhY.js} +1 -1
  83. package/dist/vviinn-widgets/{p-6vxKTHCE.js → p-DvD16Fp_.js} +1 -1
  84. package/{www/build/p-a145a231.entry.js → dist/vviinn-widgets/p-c1eac87b.entry.js} +1 -1
  85. package/dist/vviinn-widgets/p-df4365fb.entry.js +1 -0
  86. package/{www/build/p-1888506e.entry.js → dist/vviinn-widgets/p-df9a1d66.entry.js} +1 -1
  87. package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
  88. package/package.json +1 -2
  89. package/www/build/p-0b7e8e2e.entry.js +1 -0
  90. package/www/build/{p-a8d88d55.entry.js → p-27b41f88.entry.js} +1 -1
  91. package/www/build/p-7411202d.entry.js +1 -0
  92. package/www/build/p-818a1e53.entry.js +1 -0
  93. package/www/build/{p-CU3f7I7a.js → p-B246LK7U.js} +1 -1
  94. package/www/build/{p-RkvPN2Rk.js → p-B89nCb_F.js} +1 -1
  95. package/www/build/p-BadZr0hq.js +1 -0
  96. package/www/build/{p-D3wRLf2J.js → p-BfTXDLup.js} +1 -1
  97. package/www/build/p-Bq5Hj7Kz.js +1 -0
  98. package/{dist/vviinn-widgets/p-CZFFW_Cj.js → www/build/p-Cxd6yzhY.js} +1 -1
  99. package/www/build/{p-6vxKTHCE.js → p-DvD16Fp_.js} +1 -1
  100. package/{dist/vviinn-widgets/p-a145a231.entry.js → www/build/p-c1eac87b.entry.js} +1 -1
  101. package/www/build/p-df4365fb.entry.js +1 -0
  102. package/{dist/vviinn-widgets/p-1888506e.entry.js → www/build/p-df9a1d66.entry.js} +1 -1
  103. package/www/build/{p-1f41ab53.js → p-e969c76d.js} +1 -1
  104. package/www/build/vviinn-widgets.esm.js +1 -1
  105. package/www/index.html +1 -1
  106. package/dist/vviinn-widgets/p-55582bb6.entry.js +0 -1
  107. package/dist/vviinn-widgets/p-773cdbb0.entry.js +0 -1
  108. package/dist/vviinn-widgets/p-7f9e1cff.entry.js +0 -1
  109. package/dist/vviinn-widgets/p-CPTOq59a.js +0 -1
  110. package/dist/vviinn-widgets/p-DKHkeCw7.js +0 -1
  111. package/dist/vviinn-widgets/p-ffbd1062.entry.js +0 -1
  112. package/www/build/p-55582bb6.entry.js +0 -1
  113. package/www/build/p-773cdbb0.entry.js +0 -1
  114. package/www/build/p-7f9e1cff.entry.js +0 -1
  115. package/www/build/p-CPTOq59a.js +0 -1
  116. package/www/build/p-DKHkeCw7.js +0 -1
  117. package/www/build/p-ffbd1062.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 handleInputChange(event) {
15
- var _a;
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
- const processingResult = await makeUploadFileRequest(this.storeName, this.token, this.apiPath)(file);
28
- pipe(processingResult, E.match(({ kind, code }) => {
29
- this.vviinnNoResult.emit(Object.assign(Object.assign({}, this.basicEventData), { reason: kind, errorCode: code }));
30
- }, (response) => {
31
- var _a;
32
- if (!this.showInWidget)
33
- setLocalStorageItems((_a = this.state.image) === null || _a === void 0 ? void 0 : _a.src, this.state.detectedObjects);
34
- this.vviinnImageUploadFinished.emit({
35
- searchId: response.requestId,
36
- isTriggeredByVpsWidget: this.storeName === "widget",
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: '8b5391a9be30260571a08494f069bab7eeceb183', exportparts: "button" }, this.loading ? (h("vviinn-preloader", null)) : (h("label", { htmlFor: "fileInput", part: "button", tabindex: "0", onKeyDown: (e) => {
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: '7e21fce692bf7a41c274eec5a9cd198cbed023eb', id: "fileInput", class: "visually-hidden", type: "file", tabindex: "-1", accept: getAcceptableFileFormats(), onChange: (event) => this.handleInputChange(event), ref: (el) => (this.fileInput = el) })));
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: '2a16919fe88ccbb72795311fb6b8af471f043700', 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: 'c4fcf804eda5eb693d99af7feb00e3225ec7487e', class: "head" }, !this.hideBackButton && (h("button", { key: '4e9fd4c897201550c12718dda82b230381023b69', part: "secondary-action", onClick: () => {
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: '9c2669a30956cf13c3907c08cffc4f96b4ac9ab6' }))), h("div", { key: '6a035cd0270f40739e17290b6c71559e2edc88ee', class: "title", part: "results-title" }, renderTitleImage(searchState.image), h("slot", { key: 'f346c0bd895c16a4a6f1655977bfe59383968c74', name: "vviinn-image-search-modal-title" }, i18next.t("imageSearchModalTitle"))), h("button", { key: 'eee9e1c6721a87ca543d9d4167a41a2ce4b895b3', onClick: () => this.close(), onKeyDown: this.handleCloseButtonKeyDown, class: "close-button", part: "close-button", "aria-label": i18next.t("a11y.closeButton") }, h("svg", { key: '62b14679a4830b11c616a4a1ef3be8cb102a476e', xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true" }, h("path", { key: '239b466c878e112d8b47f23982f856718fe1150c', 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: 'd9d9be37267bf710b9b02ba54a8970cc7a3dae44', class: "body" }, h("slot", { key: '21d2d31cdc4350c170898f9572cf64b1de06d795' }))));
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: '1e0947052fc6b1df54cc1cc00207cdce30c1d5f0', ref: (el) => (this.dialogRef = el), onAnimationEnd: this.handleAnimationEnd }, h("slot", { key: '5cdb99e46c89612c113559aedb7b73328f0b6810' })));
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: '7f7b0ee43cb77127b47a0ba3be067662aa6a9e9b' }, h("vviinn-overlay", { key: '3a0da726703e5930b97b111b4039492156db8aff', active: this.active }, h("vviinn-modal", { key: 'c88334ba9d6c975a3fb93a002878284a102f2fcf', resetState: this.resetState, active: this.active, buttonElementId: this.buttonElementId, hideBackButton: this.hideBackButton, widgetVersion: this.widgetVersion, isFirstScreen: this.isFirstScreen }, h("slot", { key: '76a94f8c3591bf1a3e9a5f537196657c1c00b8e7' }, "CONTENT")))));
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: 'd8904f0c7dd8aebb13da4d44e2c5422d8d31667d' });
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: '3be7fae8e35376e72e1e780b89cc6b63a19a403f' }, h("slot", { key: '00ad4c7ce9fe26d3b7eafcde87953e1add9dd4a6', name: "vviinn-privacy-badge-text" }, h("div", { key: 'cc4eab27483574b5922eea7a24336aeeba229cf5', innerHTML: this.privacyBadgeText }))));
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"; }
@@ -36,9 +36,9 @@ export class VviinnEnergyLabel {
36
36
  return i18next.t("energyLabel.iconAlt");
37
37
  }
38
38
  render() {
39
- return (h(Host, { key: 'f311f7c89f27a7dd90a8198284b179fe6e04cb3f', class: {
39
+ return (h(Host, { key: '9a53d56bb0772e1118fc4f5cda718e9b29adaf24', class: {
40
40
  hidden: !this.classIconUrls && !this.productType && !this.classDataSheetUrl,
41
- }, exportparts: energyLabelParts }, h("div", { key: 'd20b22eaca0f7121a09f20e9a1a8e16ae8c77a16', class: "container", part: "energy-label-container" }, !!this.classIconUrls && (h("img", { key: '4551fc562d643b825ff489ebd4fcf51812479862', class: "class-label-icon", part: "energy-label-icon", src: this.classIconUrls[this.iconDirection], alt: this.getEnergyIconAltText() })), (this.productType || this.classDataSheetUrl) && (h("div", { key: '3260e0e590ed46c72daf3b06075a153c23ed0c51', class: "info-container" }, this.productType && (h("span", { key: 'be310b1e00cc1b279d58ce2d56cee9803622f01b', class: "product-type", part: "energy-label-product-type" }, this.productType)), this.classDataSheetUrl && (h("a", { key: '2e4f3d3985d11d7b2bba729b6c1816af866cafdc', class: "data-sheet-link", part: "energy-label-data-sheet-link", href: this.classDataSheetUrl, target: "_blank", rel: "noopener noreferrer" }, h("slot", { key: 'ca584e501471e5d6bc9c76f7d3767910ed645016', name: "vviinn-energy-label-data-sheet-text" }, i18next.t("energyLabel.dataSheetText")))))))));
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: '2ba9c019be5e6d2a70f299ebd4827baefa671cad', id: "results-block", class: {
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: '8521abb79a86723af8f18cd66558f8cd56d0d725', class: "nothing-found" }, this.getCurrentErrorType() && (h("vviinn-error", { key: '030f376feaa161d598dc60e2deae0bcde368759a', errorType: this.getCurrentErrorType(), handler: this.resetWidgetState, hasBackground: this.showInWidget, searchType: this.state.searchType }))), h("div", { key: '82a242f74f6a5481b40ec26a977d11465a5c58da', class: {
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: 'ed28c78ddfa0826f8ad8a70639e83386d9297c7c', id: "one-click-discovery-append", style: {
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: '4734dcdc0c1a7d206970c8baf08e257077e952f9', exportparts: shopTheLookParts }, renderExternalCSS(this.cssUrl), h("div", { key: '129438fdcf114bd903ad6888287e060e5fdc3948', class: `shop-the-look-container ${this.showModal ? "modal-open" : ""} ${this.showCropper ? "with-cropper" : ""} widget-style-${this.widgetStyle}` }, h("div", { key: '04e037ad029930bd366920ca79e0ae7becebaf2c', class: "main-content" }, this.renderSwiperWrapper(), this.showLoadingSpinner && (h("div", { key: '18ca739ed4cf0b1167fd8976fdab0c5e6e0ee410', class: "search-loader" }, h("vviinn-preloader", { key: 'efd47991fa32bf315c4985f98f0c14ccbf6f5a72' })))), this.renderModalWrapper(), h("div", { key: '332adbe2912fb61f82f9cf0488a13f7c9a0a405c', class: "actions-container", part: "shop-the-look-actions-container" }, this.uploadMode && (h("div", { key: '55c748ffeded24b97801683454f9a1b8675f6ed6', class: "upload-button-container" }, h("button", { key: '7cfa399b98e254bd12bff706cf6c4bea42dce684', 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: '48b59d82816a50b6f98bbf68c8a6849679437852', class: "upload-button-icon", part: "shop-the-look-upload-button-icon" }, h("slot", { key: '14f12cf7f44a39ba4f1d9cbecb6fa3558ae5fd5d', name: "vviinn-image-upload-icon" }, h(UploadActionIconVariant, { key: '1937cea6010c0a21182e88f365f188a65b0f3a70' }))), h("span", { key: 'd62a5ee1ac2c17a663dda26cb0debd83821510c0', class: "upload-button-text", part: "shop-the-look-upload-button-text" }, h("slot", { key: '42a4910a590a2b258dccb2a3ace5da8f60099791', name: "upload-button-text" }))), h("input", { key: '242e2ed2e319428ebde6dff7df8c37b60d33a8f1', type: "file", class: "visually-hidden", accept: getAcceptableFileFormats(), onChange: this.handleFileUpload, ref: (el) => (this.fileInput = el) }))), this.showNavigation() &&
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: '149fe2396c333fff4ff01e607a8f1b238ac12bdb' }, h("div", { key: '6a9e376f9955458af0c30c9df01ea7c2b8849196', class: {
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: '133a498cc9bacc4be222f7bc10aab41581e81f1a' }, h("slot", { key: '4c6793ca181403a57e378b9212d341cdfe2c529c' })));
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: 'cae995bbfc00ab993963b12e219ca9e7d1b88a10' }, h("div", { key: 'ef4812aaa71a522c8bd038596d5f3d4b8e068057', class: "items-wrapper" }, h("div", { key: '56796be36f776337632f02b6b0e3cf034e36c0a7', class: "items" }, h("slot", { key: '6f9d9f5a6d6a8abb27689e7d5c724bb0a696659d' })))));
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"; }
@@ -8,12 +8,21 @@ export const toggleFilterInSet = (appliedFilters, suggestionText) => {
8
8
  }
9
9
  return newAppliedFilters;
10
10
  };
11
+ export const formatIntervalKey = (column, start, end) => `${column}:${start}-${end}`;
11
12
  export const extractActiveFilterValues = (activeFilters) => {
12
13
  const activeValues = new Set();
13
14
  activeFilters.forEach((filter) => {
14
- if (Array.isArray(filter.values)) {
15
- filter.values.forEach((v) => activeValues.add(`${filter.column}:${String(v)}`));
16
- }
15
+ if (!Array.isArray(filter.values))
16
+ return;
17
+ filter.values.forEach((v) => {
18
+ // Interval values are `{start, end}` objects; categorical values are strings.
19
+ if (v !== null && typeof v === "object" && "start" in v) {
20
+ activeValues.add(formatIntervalKey(filter.column, v.start, v.end));
21
+ }
22
+ else {
23
+ activeValues.add(`${filter.column}:${String(v)}`);
24
+ }
25
+ });
17
26
  });
18
27
  return activeValues;
19
28
  };
@@ -33,13 +42,21 @@ export const syncSuggestionFilters = (activeFilters, stream) => {
33
42
  if (!((_c = (_b = annotation.interactions) === null || _b === void 0 ? void 0 : _b.dynamicFilters) === null || _c === void 0 ? void 0 : _c.length))
34
43
  continue;
35
44
  for (const filter of annotation.interactions.dynamicFilters) {
36
- if (filter.type !== "categorical" || !("values" in filter))
37
- continue;
38
- filter.values.forEach((value) => {
39
- if (activeValues.has(`${filter.column}:${String(value.value)}`)) {
40
- updatedAppliedFilters.add(`${filter.column}:${value.value}`);
41
- }
42
- });
45
+ if (filter.type === "categorical" && "values" in filter) {
46
+ filter.values.forEach((value) => {
47
+ if (activeValues.has(`${filter.column}:${String(value.value)}`)) {
48
+ updatedAppliedFilters.add(`${filter.column}:${value.value}`);
49
+ }
50
+ });
51
+ }
52
+ else if (filter.type === "interval" && "selectedValues" in filter) {
53
+ filter.selectedValues.forEach((interval) => {
54
+ const key = formatIntervalKey(filter.column, interval.start, interval.end);
55
+ if (activeValues.has(key)) {
56
+ updatedAppliedFilters.add(key);
57
+ }
58
+ });
59
+ }
43
60
  }
44
61
  }
45
62
  }
@@ -1,6 +1,7 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { marked } from "marked";
3
3
  import { triggerFilter } from "../vviinn-filters/helpers/triggerFilter";
4
+ import { formatIntervalKey } from "./helpers";
4
5
  export const extractDataItems = (annotation) => annotation.data.items;
5
6
  export const findMatchingFilterValue = (item, filter) => {
6
7
  if (filter.type !== "categorical" ||
@@ -21,18 +22,38 @@ export const applyFiltersForItems = (dataItems, interactions, currentRequestFilt
21
22
  let updatedFilters = currentRequestFilters;
22
23
  if (dataItems.length === 0) {
23
24
  for (const filter of filters) {
24
- if (filter.type !== "categorical" || !("values" in filter))
25
- continue;
26
- for (const filterValue of filter.values) {
27
- updatedFilters = triggerFilter({
28
- filterValue: filterValue,
29
- selectedFilter: filter,
30
- requestFilters: updatedFilters,
31
- vviinnFilterTriggered: handlers.vviinnFilterTriggered,
32
- vviinnFiltersChanged: handlers.vviinnFiltersChanged,
33
- el: handlers.el,
34
- isTriggeredByVpsWidget: handlers.isTriggeredByVpsWidget,
35
- });
25
+ if (filter.type === "categorical" && "values" in filter) {
26
+ for (const filterValue of filter.values) {
27
+ updatedFilters = triggerFilter({
28
+ filterValue: filterValue,
29
+ selectedFilter: filter,
30
+ requestFilters: updatedFilters,
31
+ vviinnFilterTriggered: handlers.vviinnFilterTriggered,
32
+ vviinnFiltersChanged: handlers.vviinnFiltersChanged,
33
+ el: handlers.el,
34
+ isTriggeredByVpsWidget: handlers.isTriggeredByVpsWidget,
35
+ });
36
+ }
37
+ }
38
+ else if (filter.type === "interval" && "selectedValues" in filter) {
39
+ // A suggestion chip represents one specific range to toggle, not a slider.
40
+ // The backend emits `full === selectedValues[0]`, which would make
41
+ // `isFullRangeInterval` read every click as "cleared to the full range"
42
+ // (deselect-only). Neutralize `full` so the shared toggle logic selects /
43
+ // deselects this exact interval by value match. Only the object passed to
44
+ // `triggerFilter` is affected; `value` still carries the real interval.
45
+ const chipFilter = Object.assign(Object.assign({}, filter), { full: { start: undefined, end: undefined } });
46
+ for (const interval of filter.selectedValues) {
47
+ updatedFilters = triggerFilter({
48
+ filterValue: { interval },
49
+ selectedFilter: chipFilter,
50
+ requestFilters: updatedFilters,
51
+ vviinnFilterTriggered: handlers.vviinnFilterTriggered,
52
+ vviinnFiltersChanged: handlers.vviinnFiltersChanged,
53
+ el: handlers.el,
54
+ isTriggeredByVpsWidget: handlers.isTriggeredByVpsWidget,
55
+ });
56
+ }
36
57
  }
37
58
  }
38
59
  return updatedFilters;
@@ -81,9 +102,15 @@ export const splitContentByLocators = (content, annotations) => {
81
102
  };
82
103
  export const getAnnotationFilterKeys = (annotation) => {
83
104
  var _a, _b, _c;
84
- return (_c = (_b = (_a = annotation.interactions) === null || _a === void 0 ? void 0 : _a.dynamicFilters) === null || _b === void 0 ? void 0 : _b.flatMap((filter) => "values" in filter
85
- ? filter.values.map((v) => `${filter.column}:${v.value}`)
86
- : [])) !== null && _c !== void 0 ? _c : [];
105
+ return (_c = (_b = (_a = annotation.interactions) === null || _a === void 0 ? void 0 : _a.dynamicFilters) === null || _b === void 0 ? void 0 : _b.flatMap((filter) => {
106
+ if (filter.type === "categorical" && "values" in filter) {
107
+ return filter.values.map((v) => `${filter.column}:${v.value}`);
108
+ }
109
+ if (filter.type === "interval" && "selectedValues" in filter) {
110
+ return filter.selectedValues.map((interval) => formatIntervalKey(filter.column, interval.start, interval.end));
111
+ }
112
+ return [];
113
+ })) !== null && _c !== void 0 ? _c : [];
87
114
  };
88
115
  const getAnnotationDeeplink = (annotation) => {
89
116
  for (const item of annotation.data.items) {
@@ -6,7 +6,7 @@ export class VviinnTeaser {
6
6
  slotChangeListener(this, this.el);
7
7
  }
8
8
  render() {
9
- return (h(Host, { key: '8a000f0c33266514f8665f595f5de4e3be66a92a' }, h("slot", { key: '5d6f646a3efc56a7a8f69b299e550685763f3d58' }, h("span", { key: 'b044024aab57627bd5a7236c6cb8f170b6a18d9c', class: "vviinn-teaser-text" }, h("slot", { key: '41dbdef5be7ce19a88c34521b94332de7a2c0b21', name: "vviinn-teaser-text" }, i18next.t("teaserText"))))));
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"; }
@@ -47,6 +47,8 @@ export class VviinnTextSearch {
47
47
  this.placeholder = "";
48
48
  /** Show auto-suggest dropdown with search completions */
49
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;
@@ -270,7 +272,7 @@ export class VviinnTextSearch {
270
272
  }
271
273
  }
272
274
  render() {
273
- return (h(Host, { key: '0ac6e28c6631ea47c8e7c47b63fa2eb3af500087', exportparts: `${searchBarParts}, ${searchModalFirstScreenParts}` }, h("div", { key: '4b1d8edd675e91f4abd1a5933a1449b721a571c1', class: "text-search-container", part: "text-search-container" }, h("input", Object.assign({ key: '13e356c598ada0b70e9b5c99531563dae6c334b5', 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 && {
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 && {
274
276
  role: "combobox",
275
277
  "aria-autocomplete": "list",
276
278
  "aria-expanded": this.autoSuggestCompletions.length > 0 &&
@@ -281,11 +283,11 @@ export class VviinnTextSearch {
281
283
  "aria-activedescendant": this.activeSuggestionIndex >= 0
282
284
  ? `suggestion-${this.activeSuggestionIndex}`
283
285
  : undefined,
284
- }))), this.mode === "extended" && (h("vviinn-vps-button", Object.assign({ key: 'c3d89667ac1eaa2682a4e3c68481b06f9479e0d6', token: this.token, locale: this.locale, apiPath: this.apiPath, addStyle: false, showResultsInModal: false, resultsPageUrl: this.resultsPageUrl, resultsPageParams: this.resultsPageParams }, (this.exampleImageSource && {
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 && {
285
287
  exampleImageSource: this.exampleImageSource,
286
- }), (this.cssUrl != null && { cssUrl: this.cssUrl }), (this.visualSearchMode && { mode: this.visualSearchMode }), { parentSlots: this.slots }))), this.mode === "basic" && (h("slot", { key: 'c900b67d3dcffb64f3ca513c0475f64eb72ef495', name: "vviinn-text-search-actions" })), (this.mode === "extended" || this.showInWidget) &&
287
- this.recognition && (h("button", { key: '99f75f77a43f618a45bd06124f283a5b97e422c3', 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: 'ab0676502accecbb25377737a595550ae96b19cc' }), this.isShowRecording() && (h("span", { key: 'ece24c838cabc64e9b045c5eb97bc47d7bd932ba', class: "recording-indicator" })))), h("button", { key: 'e986f20a8e3d02f38e58c6a6e6946795d6d29875', 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 &&
288
- renderSuggestions(this.autoSuggestCompletions, this.state.textSearchQuery, this.activeSuggestionIndex, this.selectSuggestion), this.showTooltip && (h("p", { key: '470a0c67f9f310f775566a4e581be3dbb7a7cb95', class: "text-search-tooltip", part: "text-search-tooltip" }, i18next.t(this.tooltipText)))));
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)))));
289
291
  }
290
292
  static get is() { return "vviinn-text-search"; }
291
293
  static get encapsulation() { return "shadow"; }
@@ -550,6 +552,26 @@ export class VviinnTextSearch {
550
552
  "setter": false,
551
553
  "reflect": false
552
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
+ },
553
575
  "showInWidget": {
554
576
  "type": "boolean",
555
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: '1da9acded2d47540c3a92ef4bfe6c1dfad7ba39b', class: this.getClassMap(), style: { display: this.hidden ? "none" : undefined }, exportparts: `body, close-sidebar, ${carouselParts}, ${productCardParts}, ${recommendationsParts}` }, h("div", { key: 'df6276e5001060d9a5b6507b351997eb8f3aab22', 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: '81f8cb97127186a5ae51d69e6c9d815791f7c7c3', class: {
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: '65f2c04676e8e75895030d117483a55cfe8431cd' }, this.renderSourceImage(), ((_a = this.sidebarTitle) === null || _a === void 0 ? void 0 : _a.length) !== 0 && (h("span", { key: '1a5949d7ef73e7d8fd54da8852b9f6ac3fb24b67', class: "title", part: "recommendations-title" }, this.sidebarTitle || i18next.t("discoveryWidgetTitle"))), !!this.sidebarSubtitle && (h("span", { key: 'b373c3999803fc4b53a40f0f31fb17488dfa7e31', class: "subtitle", part: "recommendations-subtitle" }, this.sidebarSubtitle)))), h("button", { key: 'a11032fd9b99cfecb9be506967714620e100cfd7', class: "close-sidebar", onClick: () => {
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: '94a609c658ca36192380ee232d956cfc9e77da15' }))), h("div", { key: '4f62b4e918a084cb7b02141df2bba3d612c382cd', class: "sidebar-content", part: "sidebar-content" }, h("vviinn-vpr-widget", { key: '2ca2caa3da08a59eb7e8d724369f2a8343fe1119', 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: () => {
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: '2d6cd8ecdeadf7205ad1b9b7170dc5ad28d43c3b', role: "button", tabindex: "0", "aria-label": this.getAriaLabel(), onClick: this.handleButtonClick, onKeyDown: this.handleKeyDown }, renderExternalCSS(this.cssUrl), h("vviinn-button", { key: 'f6852f2eb943f40d692bf5e0609a5ac1628f598f', addStyle: this.addStyle, part: "vviinn-button" }, h("slot", { key: '5f934ba1ef44cb5133dcf2a843429c5f92858514' }, this.campaignType === "VCS" ? (h(CrossSellingIcon, { width: this.iconSideSize, height: this.iconSideSize })) : (h(SimilarProductsIcon, { width: this.iconSideSize, height: this.iconSideSize }))))));
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");