vviinn-widgets 2.74.2 → 2.76.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 (73) hide show
  1. package/dist/cjs/{index-d3fb3be1.js → index-85c223b1.js} +1 -1
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/{package-8b9fd099.js → package-46b840db.js} +1 -1
  4. package/dist/cjs/search-filters_18.cjs.entry.js +19 -19
  5. package/dist/cjs/{search.store-155814d5.js → search.store-a688362f.js} +13 -4
  6. package/dist/cjs/vviinn-carousel_8.cjs.entry.js +7 -7
  7. package/dist/cjs/vviinn-preloader.cjs.entry.js +1 -1
  8. package/dist/cjs/vviinn-vpr-button.cjs.entry.js +1 -1
  9. package/dist/cjs/vviinn-vps-button.cjs.entry.js +1 -1
  10. package/dist/cjs/vviinn-vps-widget.cjs.entry.js +4 -4
  11. package/dist/cjs/vviinn-widgets.cjs.js +1 -1
  12. package/dist/collection/components/vviinn-filters/stories/vviinn-extended-filters.stories.js +4 -7
  13. package/dist/collection/components/vviinn-filters/stories/vviinn-filters.stories.js +4 -7
  14. package/dist/collection/components/vviinn-filters/vviinn-extended-filters.js +17 -20
  15. package/dist/collection/components/vviinn-filters/vviinn-filters.css +1 -0
  16. package/dist/collection/components/vviinn-filters/vviinn-filters.js +17 -20
  17. package/dist/collection/components/vviinn-results/stories/ResultsTemplate.js +24 -0
  18. package/dist/collection/components/vviinn-results/stories/generalArgs.js +13 -0
  19. package/dist/collection/components/vviinn-results/stories/vviinn-results.stories.js +25 -0
  20. package/dist/collection/components/vviinn-results/vviinn-results.js +79 -73
  21. package/dist/collection/components/vviinn-text-search/stories/vviinn-text-search.stories.js +40 -0
  22. package/dist/collection/components/vviinn-text-search/vviinn-text-search.js +34 -31
  23. package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +1 -1
  24. package/dist/collection/store/search.store.js +8 -4
  25. package/dist/collection/utils/string/encodeToBase64UTF8.js +5 -0
  26. package/dist/collection/utils/string/index.js +1 -0
  27. package/dist/esm/{index-d7915af0.js → index-80d9da2f.js} +1 -1
  28. package/dist/esm/loader.js +1 -1
  29. package/dist/esm/{package-25f24f03.js → package-a9dace8c.js} +1 -1
  30. package/dist/esm/search-filters_18.entry.js +19 -19
  31. package/dist/esm/{search.store-1a984942.js → search.store-9acff206.js} +13 -4
  32. package/dist/esm/vviinn-carousel_8.entry.js +7 -7
  33. package/dist/esm/vviinn-preloader.entry.js +1 -1
  34. package/dist/esm/vviinn-vpr-button.entry.js +1 -1
  35. package/dist/esm/vviinn-vps-button.entry.js +1 -1
  36. package/dist/esm/vviinn-vps-widget.entry.js +4 -4
  37. package/dist/esm/vviinn-widgets.js +1 -1
  38. package/dist/types/components/vviinn-filters/stories/vviinn-extended-filters.stories.d.ts +1 -6
  39. package/dist/types/components/vviinn-filters/stories/vviinn-filters.stories.d.ts +1 -6
  40. package/dist/types/components/vviinn-filters/vviinn-extended-filters.d.ts +2 -2
  41. package/dist/types/components/vviinn-filters/vviinn-filters.d.ts +2 -2
  42. package/dist/types/components/vviinn-results/stories/ResultsTemplate.d.ts +1 -0
  43. package/dist/types/components/vviinn-results/stories/generalArgs.d.ts +13 -0
  44. package/dist/types/components/vviinn-results/stories/vviinn-results.stories.d.ts +7 -0
  45. package/dist/types/components/vviinn-results/vviinn-results.d.ts +12 -11
  46. package/dist/types/components/vviinn-text-search/stories/vviinn-text-search.stories.d.ts +7 -0
  47. package/dist/types/components/vviinn-text-search/vviinn-text-search.d.ts +6 -9
  48. package/dist/types/components.d.ts +28 -29
  49. package/dist/types/utils/string/encodeToBase64UTF8.d.ts +1 -0
  50. package/dist/types/utils/string/index.d.ts +1 -0
  51. package/dist/vviinn-widgets/{p-bb33a69a.entry.js → p-17d6fab0.entry.js} +1 -1
  52. package/dist/vviinn-widgets/{p-bba565ea.entry.js → p-400dac78.entry.js} +1 -1
  53. package/dist/vviinn-widgets/{p-95ce6cd2.entry.js → p-7bd909df.entry.js} +1 -1
  54. package/dist/vviinn-widgets/p-a08bc9bb.js +1 -0
  55. package/dist/vviinn-widgets/{p-c8aa8a84.entry.js → p-c724c8bd.entry.js} +1 -1
  56. package/{www/build/p-cd05d443.js → dist/vviinn-widgets/p-ddf609ee.js} +1 -1
  57. package/dist/vviinn-widgets/{p-34cec6de.js → p-dee78ef6.js} +1 -1
  58. package/dist/vviinn-widgets/{p-a9a19b3a.entry.js → p-f05a5179.entry.js} +2 -2
  59. package/dist/vviinn-widgets/{p-2a2115ff.entry.js → p-f45afcaa.entry.js} +1 -1
  60. package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
  61. package/package.json +1 -1
  62. package/www/build/{p-bb33a69a.entry.js → p-17d6fab0.entry.js} +1 -1
  63. package/www/build/{p-bba565ea.entry.js → p-400dac78.entry.js} +1 -1
  64. package/www/build/{p-95ce6cd2.entry.js → p-7bd909df.entry.js} +1 -1
  65. package/www/build/p-a08bc9bb.js +1 -0
  66. package/www/build/{p-c8aa8a84.entry.js → p-c724c8bd.entry.js} +1 -1
  67. package/{dist/vviinn-widgets/p-cd05d443.js → www/build/p-ddf609ee.js} +1 -1
  68. package/www/build/{p-34cec6de.js → p-dee78ef6.js} +1 -1
  69. package/www/build/{p-a9a19b3a.entry.js → p-f05a5179.entry.js} +2 -2
  70. package/www/build/{p-2a2115ff.entry.js → p-f45afcaa.entry.js} +1 -1
  71. package/www/build/vviinn-widgets.esm.js +1 -1
  72. package/dist/vviinn-widgets/p-6ea24620.js +0 -1
  73. package/www/build/p-6ea24620.js +0 -1
@@ -246,26 +246,28 @@ export class VviinnExtendedFilters {
246
246
  }
247
247
  }
248
248
  }, {
249
- "method": "globalSlotsChanged",
250
- "name": "globalSlotsChanged",
249
+ "method": "vviinnFilters",
250
+ "name": "vviinnFilters",
251
251
  "bubbles": true,
252
252
  "cancelable": true,
253
253
  "composed": true,
254
254
  "docs": {
255
- "tags": [{
256
- "name": "internal",
257
- "text": undefined
258
- }],
259
- "text": ""
255
+ "tags": [],
256
+ "text": "The filters received"
260
257
  },
261
258
  "complexType": {
262
- "original": "any",
263
- "resolved": "any",
264
- "references": {}
259
+ "original": "DynamicFiltersEventData",
260
+ "resolved": "({ column: string; label: string; isPrimary: boolean; values: ({ value: string | number | { value: string; name: string; } | ({ value: string; name: string; } & { hexCode?: string; rgb?: { red?: number; green?: number; blue?: number; }; family?: string; } & { value: unknown; name: unknown; hexCode: unknown; rgb: unknown; family: unknown; }); label: string; } & { active: boolean; selected: boolean; } & { value: unknown; label: unknown; })[]; } | { column: string; label: string; isPrimary: boolean; full: { start?: number; end?: number; }; selectedValues: { start?: number; end?: number; }[]; suggestions: { value: { frequency?: number; interval?: { start?: number; end?: number; }; }; label: string; active: boolean; }[]; histogram: { value: { frequency?: number; interval?: { start?: number; end?: number; }; }; label: string; active: boolean; }[]; })[]",
261
+ "references": {
262
+ "DynamicFiltersEventData": {
263
+ "location": "import",
264
+ "path": "../../recommendation/events"
265
+ }
266
+ }
265
267
  }
266
268
  }, {
267
- "method": "vviinnFilters",
268
- "name": "vviinnFilters",
269
+ "method": "globalSlotsChanged",
270
+ "name": "globalSlotsChanged",
269
271
  "bubbles": true,
270
272
  "cancelable": true,
271
273
  "composed": true,
@@ -277,14 +279,9 @@ export class VviinnExtendedFilters {
277
279
  "text": ""
278
280
  },
279
281
  "complexType": {
280
- "original": "DynamicFiltersEventData",
281
- "resolved": "({ column: string; label: string; isPrimary: boolean; values: ({ value: string | number | { value: string; name: string; } | ({ value: string; name: string; } & { hexCode?: string; rgb?: { red?: number; green?: number; blue?: number; }; family?: string; } & { value: unknown; name: unknown; hexCode: unknown; rgb: unknown; family: unknown; }); label: string; } & { active: boolean; selected: boolean; } & { value: unknown; label: unknown; })[]; } | { column: string; label: string; isPrimary: boolean; full: { start?: number; end?: number; }; selectedValues: { start?: number; end?: number; }[]; suggestions: { value: { frequency?: number; interval?: { start?: number; end?: number; }; }; label: string; active: boolean; }[]; histogram: { value: { frequency?: number; interval?: { start?: number; end?: number; }; }; label: string; active: boolean; }[]; })[]",
282
- "references": {
283
- "DynamicFiltersEventData": {
284
- "location": "import",
285
- "path": "../../recommendation/events"
286
- }
287
- }
282
+ "original": "any",
283
+ "resolved": "any",
284
+ "references": {}
288
285
  }
289
286
  }];
290
287
  }
@@ -234,6 +234,7 @@
234
234
 
235
235
 
236
236
  :host {
237
+ display: block;
237
238
  }
238
239
 
239
240
  .filters-footer {
@@ -180,26 +180,28 @@ export class VviinnFilters {
180
180
  }
181
181
  }
182
182
  }, {
183
- "method": "globalSlotsChanged",
184
- "name": "globalSlotsChanged",
183
+ "method": "vviinnFilters",
184
+ "name": "vviinnFilters",
185
185
  "bubbles": true,
186
186
  "cancelable": true,
187
187
  "composed": true,
188
188
  "docs": {
189
- "tags": [{
190
- "name": "internal",
191
- "text": undefined
192
- }],
193
- "text": ""
189
+ "tags": [],
190
+ "text": "The filters received"
194
191
  },
195
192
  "complexType": {
196
- "original": "any",
197
- "resolved": "any",
198
- "references": {}
193
+ "original": "DynamicFiltersEventData",
194
+ "resolved": "({ column: string; label: string; isPrimary: boolean; values: ({ value: string | number | { value: string; name: string; } | ({ value: string; name: string; } & { hexCode?: string; rgb?: { red?: number; green?: number; blue?: number; }; family?: string; } & { value: unknown; name: unknown; hexCode: unknown; rgb: unknown; family: unknown; }); label: string; } & { active: boolean; selected: boolean; } & { value: unknown; label: unknown; })[]; } | { column: string; label: string; isPrimary: boolean; full: { start?: number; end?: number; }; selectedValues: { start?: number; end?: number; }[]; suggestions: { value: { frequency?: number; interval?: { start?: number; end?: number; }; }; label: string; active: boolean; }[]; histogram: { value: { frequency?: number; interval?: { start?: number; end?: number; }; }; label: string; active: boolean; }[]; })[]",
195
+ "references": {
196
+ "DynamicFiltersEventData": {
197
+ "location": "import",
198
+ "path": "../../recommendation/events"
199
+ }
200
+ }
199
201
  }
200
202
  }, {
201
- "method": "vviinnFilters",
202
- "name": "vviinnFilters",
203
+ "method": "globalSlotsChanged",
204
+ "name": "globalSlotsChanged",
203
205
  "bubbles": true,
204
206
  "cancelable": true,
205
207
  "composed": true,
@@ -211,14 +213,9 @@ export class VviinnFilters {
211
213
  "text": ""
212
214
  },
213
215
  "complexType": {
214
- "original": "DynamicFiltersEventData",
215
- "resolved": "({ column: string; label: string; isPrimary: boolean; values: ({ value: string | number | { value: string; name: string; } | ({ value: string; name: string; } & { hexCode?: string; rgb?: { red?: number; green?: number; blue?: number; }; family?: string; } & { value: unknown; name: unknown; hexCode: unknown; rgb: unknown; family: unknown; }); label: string; } & { active: boolean; selected: boolean; } & { value: unknown; label: unknown; })[]; } | { column: string; label: string; isPrimary: boolean; full: { start?: number; end?: number; }; selectedValues: { start?: number; end?: number; }[]; suggestions: { value: { frequency?: number; interval?: { start?: number; end?: number; }; }; label: string; active: boolean; }[]; histogram: { value: { frequency?: number; interval?: { start?: number; end?: number; }; }; label: string; active: boolean; }[]; })[]",
216
- "references": {
217
- "DynamicFiltersEventData": {
218
- "location": "import",
219
- "path": "../../recommendation/events"
220
- }
221
- }
216
+ "original": "any",
217
+ "resolved": "any",
218
+ "references": {}
222
219
  }
223
220
  }];
224
221
  }
@@ -0,0 +1,24 @@
1
+ export const ResultsTemplate = (args) => {
2
+ const { token, apiPath, searchId, imageResolutionWidth, currencySign, locale, productDetailsRedirect, productDetailsNewTab, showInWidget, uiSessionId, resultsCount, filterColumn, filterValue, textSearchQuery, } = args;
3
+ const filterAttributes = filterColumn && filterValue
4
+ ? `filter-column="${filterColumn}" filter-value="${filterValue}"`
5
+ : "";
6
+ const searchQueryAttribute = textSearchQuery
7
+ ? `text-search-query="${textSearchQuery}"`
8
+ : "";
9
+ return `<vviinn-results
10
+ token="${token}"
11
+ api-path="${apiPath}"
12
+ search-id="${searchId}"
13
+ image-resolution-width="${imageResolutionWidth}"
14
+ currency-sign="${currencySign}"
15
+ locale="${locale}"
16
+ product-details-redirect="${productDetailsRedirect}"
17
+ product-details-new-tab="${productDetailsNewTab}"
18
+ show-in-widget="${showInWidget}"
19
+ ${searchQueryAttribute}
20
+ ${filterAttributes}
21
+ ui-session-id="${uiSessionId}"
22
+ results-count="${resultsCount}"
23
+ ></vviinn-results>`;
24
+ };
@@ -0,0 +1,13 @@
1
+ export const generalArgs = {
2
+ token: process.env.STORYBOOK_TOKEN,
3
+ apiPath: process.env.STORYBOOK_API_PATH,
4
+ resultsCount: 12,
5
+ imageResolutionWidth: 250,
6
+ currencySign: "€",
7
+ locale: "en-US",
8
+ productDetailsRedirect: true,
9
+ productDetailsNewTab: false,
10
+ showInWidget: false,
11
+ uiSessionId: "",
12
+ searchId: "",
13
+ };
@@ -0,0 +1,25 @@
1
+ import { generalArgs } from "./generalArgs";
2
+ import { ResultsTemplate } from "./ResultsTemplate";
3
+ export default {
4
+ title: "Elements/Product Listing",
5
+ component: "vviinn-results",
6
+ };
7
+ export const StaticFilters = ResultsTemplate.bind({});
8
+ StaticFilters.storyName = "Static Filters";
9
+ StaticFilters.argTypes = {
10
+ textSearchQuery: {
11
+ control: false,
12
+ },
13
+ };
14
+ StaticFilters.args = Object.assign({ filterColumn: "product_type", filterValue: "Möbel > Schränke & Regale" }, generalArgs);
15
+ export const TextSearch = ResultsTemplate.bind({});
16
+ TextSearch.storyName = "Text Search";
17
+ TextSearch.argTypes = {
18
+ filterValue: {
19
+ control: false,
20
+ },
21
+ filterColumn: {
22
+ control: false,
23
+ },
24
+ };
25
+ TextSearch.args = Object.assign({ textSearchQuery: "Chair" }, generalArgs);
@@ -74,6 +74,7 @@ export class VviinnResults {
74
74
  };
75
75
  this.token = undefined;
76
76
  this.searchId = undefined;
77
+ this.uiSessionId = undefined;
77
78
  this.imageResolutionWidth = 250;
78
79
  this.currencySign = "€";
79
80
  this.locale = "de-DE";
@@ -83,11 +84,10 @@ export class VviinnResults {
83
84
  this.filterColumn = "product_type";
84
85
  this.filterValue = undefined;
85
86
  this.resultsCount = undefined;
86
- this.showingInWidget = false;
87
- this.uiSessionId = undefined;
87
+ this.showInWidget = false;
88
+ this.apiPath = "https://api.vviinn.com";
88
89
  this.buttonElementId = undefined;
89
90
  this.widgetElementId = undefined;
90
- this.apiPath = "https://api.vviinn.com";
91
91
  this.showAspectRatioError = undefined;
92
92
  this.trackingDeactivated = false;
93
93
  this.resetState = undefined;
@@ -166,13 +166,13 @@ export class VviinnResults {
166
166
  }
167
167
  }
168
168
  async getResultsByTextQuery(query, filters) {
169
- if (this.showingInWidget || query === undefined)
169
+ if (this.showInWidget || !query)
170
170
  return;
171
171
  state.apiPath = this.apiPath; //FIXME: #36877
172
172
  pipe(await makeSearchQueryRequest(this.token, query, this.resultsCount, filters), E.getOrElse(() => null), (response) => {
173
- var _a, _b;
174
- this.recommendations = (_a = response === null || response === void 0 ? void 0 : response.data.products) !== null && _a !== void 0 ? _a : [];
175
- this.vviinnFilters.emit((_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.interactions.dynamicFilters);
173
+ var _a, _b, _c;
174
+ this.recommendations = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.products) !== null && _b !== void 0 ? _b : [];
175
+ this.vviinnFilters.emit((_c = response === null || response === void 0 ? void 0 : response.data) === null || _c === void 0 ? void 0 : _c.interactions.dynamicFilters);
176
176
  });
177
177
  }
178
178
  async getResultsByCategory() {
@@ -180,8 +180,8 @@ export class VviinnResults {
180
180
  return;
181
181
  state.apiPath = this.apiPath; //FIXME: #36877
182
182
  pipe(await makeProductListingPageRequest(this.token, this.filterColumn, this.filterValue, this.resultsCount), E.getOrElse(() => null), (response) => {
183
- var _a;
184
- this.recommendations = (_a = response === null || response === void 0 ? void 0 : response.data.products) !== null && _a !== void 0 ? _a : [];
183
+ var _a, _b;
184
+ this.recommendations = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.products) !== null && _b !== void 0 ? _b : [];
185
185
  });
186
186
  }
187
187
  trackResultEvent(type) {
@@ -233,21 +233,21 @@ export class VviinnResults {
233
233
  }
234
234
  render() {
235
235
  return (h(Host, { id: "results-block", class: {
236
- "widget-results": this.showingInWidget,
236
+ "widget-results": this.showInWidget,
237
237
  }, exportparts: "brand, deeplink, currency, image, image-link, price-amount-sale, price-amount-outdated, price-amount-regular, price-container, price-outdated, price-regular, price-sale, price-prefix, title, product-card" }, h("div", { class: {
238
238
  "nothing-found": true,
239
239
  hidden: this.recommendations.length > 0 ||
240
240
  searchState.results.length > 0 ||
241
- !this.showingInWidget,
241
+ !this.showInWidget,
242
242
  } }, h("vviinn-empty-results", { handler: () => this === null || this === void 0 ? void 0 : this.resetState() })), h("div", { class: {
243
243
  "nothing-found": true,
244
- hidden: !this.showAspectRatioError || !this.showingInWidget,
244
+ hidden: !this.showAspectRatioError || !this.showInWidget,
245
245
  } }, h("vviinn-wrong-aspect-ratio", { handler: () => this === null || this === void 0 ? void 0 : this.resetState() })), h("div", { class: {
246
246
  hidden: this.showAspectRatioError ||
247
247
  (this.recommendations.length === 0 &&
248
248
  searchState.results.length === 0),
249
249
  products: true,
250
- } }, this.renderResults(this.showingInWidget ? searchState.results : this.recommendations))));
250
+ } }, this.renderResults(this.showInWidget ? searchState.results : this.recommendations))));
251
251
  }
252
252
  static get is() { return "vviinn-results"; }
253
253
  static get encapsulation() { return "shadow"; }
@@ -297,6 +297,23 @@ export class VviinnResults {
297
297
  "attribute": "search-id",
298
298
  "reflect": false
299
299
  },
300
+ "uiSessionId": {
301
+ "type": "string",
302
+ "mutable": true,
303
+ "complexType": {
304
+ "original": "string",
305
+ "resolved": "string",
306
+ "references": {}
307
+ },
308
+ "required": false,
309
+ "optional": true,
310
+ "docs": {
311
+ "tags": [],
312
+ "text": "uiSessionId from vps-widget"
313
+ },
314
+ "attribute": "ui-session-id",
315
+ "reflect": false
316
+ },
300
317
  "imageResolutionWidth": {
301
318
  "type": "number",
302
319
  "mutable": false,
@@ -418,7 +435,7 @@ export class VviinnResults {
418
435
  "references": {}
419
436
  },
420
437
  "required": false,
421
- "optional": false,
438
+ "optional": true,
422
439
  "docs": {
423
440
  "tags": [],
424
441
  "text": "Column for performing Product Listing Page request"
@@ -436,7 +453,7 @@ export class VviinnResults {
436
453
  "references": {}
437
454
  },
438
455
  "required": false,
439
- "optional": false,
456
+ "optional": true,
440
457
  "docs": {
441
458
  "tags": [],
442
459
  "text": "Value for performing Product Listing Page request"
@@ -461,7 +478,7 @@ export class VviinnResults {
461
478
  "attribute": "results-count",
462
479
  "reflect": false
463
480
  },
464
- "showingInWidget": {
481
+ "showInWidget": {
465
482
  "type": "boolean",
466
483
  "mutable": false,
467
484
  "complexType": {
@@ -472,19 +489,16 @@ export class VviinnResults {
472
489
  "required": false,
473
490
  "optional": true,
474
491
  "docs": {
475
- "tags": [{
476
- "name": "internal",
477
- "text": undefined
478
- }],
479
- "text": ""
492
+ "tags": [],
493
+ "text": "True when we use vviinn-results inside the widget"
480
494
  },
481
- "attribute": "showing-in-widget",
495
+ "attribute": "show-in-widget",
482
496
  "reflect": false,
483
497
  "defaultValue": "false"
484
498
  },
485
- "uiSessionId": {
499
+ "apiPath": {
486
500
  "type": "string",
487
- "mutable": true,
501
+ "mutable": false,
488
502
  "complexType": {
489
503
  "original": "string",
490
504
  "resolved": "string",
@@ -499,8 +513,9 @@ export class VviinnResults {
499
513
  }],
500
514
  "text": ""
501
515
  },
502
- "attribute": "ui-session-id",
503
- "reflect": false
516
+ "attribute": "api-path",
517
+ "reflect": false,
518
+ "defaultValue": "\"https://api.vviinn.com\""
504
519
  },
505
520
  "buttonElementId": {
506
521
  "type": "string",
@@ -542,27 +557,6 @@ export class VviinnResults {
542
557
  "attribute": "widget-element-id",
543
558
  "reflect": false
544
559
  },
545
- "apiPath": {
546
- "type": "string",
547
- "mutable": false,
548
- "complexType": {
549
- "original": "string",
550
- "resolved": "string",
551
- "references": {}
552
- },
553
- "required": false,
554
- "optional": true,
555
- "docs": {
556
- "tags": [{
557
- "name": "internal",
558
- "text": undefined
559
- }],
560
- "text": ""
561
- },
562
- "attribute": "api-path",
563
- "reflect": false,
564
- "defaultValue": "\"https://api.vviinn.com\""
565
- },
566
560
  "showAspectRatioError": {
567
561
  "type": "boolean",
568
562
  "mutable": false,
@@ -731,6 +725,29 @@ export class VviinnResults {
731
725
  }
732
726
  }
733
727
  }
728
+ }, {
729
+ "method": "vviinnFiltersChanged",
730
+ "name": "vviinnFiltersChanged",
731
+ "bubbles": true,
732
+ "cancelable": true,
733
+ "composed": true,
734
+ "docs": {
735
+ "tags": [{
736
+ "name": "internal",
737
+ "text": undefined
738
+ }],
739
+ "text": ""
740
+ },
741
+ "complexType": {
742
+ "original": "ChangedFiltersEventData",
743
+ "resolved": "{ filters: { column: string; values: string[] | { start?: number; end?: number; }[]; }[]; el: HTMLElement; }",
744
+ "references": {
745
+ "ChangedFiltersEventData": {
746
+ "location": "import",
747
+ "path": "../../recommendation/events"
748
+ }
749
+ }
750
+ }
734
751
  }, {
735
752
  "method": "vviinnSearchIdReceived",
736
753
  "name": "vviinnSearchIdReceived",
@@ -738,8 +755,11 @@ export class VviinnResults {
738
755
  "cancelable": true,
739
756
  "composed": true,
740
757
  "docs": {
741
- "tags": [],
742
- "text": "The 'searchId' is received for performing a Visual Search"
758
+ "tags": [{
759
+ "name": "internal",
760
+ "text": undefined
761
+ }],
762
+ "text": ""
743
763
  },
744
764
  "complexType": {
745
765
  "original": "SearchIdEventData",
@@ -758,8 +778,11 @@ export class VviinnResults {
758
778
  "cancelable": true,
759
779
  "composed": true,
760
780
  "docs": {
761
- "tags": [],
762
- "text": "The 'query' is received for performing a Text Search"
781
+ "tags": [{
782
+ "name": "internal",
783
+ "text": undefined
784
+ }],
785
+ "text": ""
763
786
  },
764
787
  "complexType": {
765
788
  "original": "TextSearchEventData",
@@ -778,8 +801,11 @@ export class VviinnResults {
778
801
  "cancelable": true,
779
802
  "composed": true,
780
803
  "docs": {
781
- "tags": [],
782
- "text": "Dynamic filters are received from the API."
804
+ "tags": [{
805
+ "name": "internal",
806
+ "text": undefined
807
+ }],
808
+ "text": ""
783
809
  },
784
810
  "complexType": {
785
811
  "original": "DynamicFiltersEventData",
@@ -791,26 +817,6 @@ export class VviinnResults {
791
817
  }
792
818
  }
793
819
  }
794
- }, {
795
- "method": "vviinnFiltersChanged",
796
- "name": "vviinnFiltersChanged",
797
- "bubbles": true,
798
- "cancelable": true,
799
- "composed": true,
800
- "docs": {
801
- "tags": [],
802
- "text": "The filter's state changes"
803
- },
804
- "complexType": {
805
- "original": "ChangedFiltersEventData",
806
- "resolved": "{ filters: { column: string; values: string[] | { start?: number; end?: number; }[]; }[]; el: HTMLElement; }",
807
- "references": {
808
- "ChangedFiltersEventData": {
809
- "location": "import",
810
- "path": "../../recommendation/events"
811
- }
812
- }
813
- }
814
820
  }];
815
821
  }
816
822
  static get elementRef() { return "el"; }
@@ -0,0 +1,40 @@
1
+ const textSearchDecorator = (story) => `
2
+ <div>
3
+ ${story()}
4
+ </div>
5
+ `;
6
+ export default {
7
+ title: "Widgets/Search",
8
+ component: "vviinn-text-search",
9
+ decorators: [textSearchDecorator],
10
+ };
11
+ const Template = (args) => `
12
+ <vviinn-text-search
13
+ token="${args.token}"
14
+ api-path="${args.apiPath}"
15
+ search-query="${args.searchQuery}"
16
+ mode="${args.mode}"
17
+ locale="${args.locale}"
18
+ show-in-widget="${args.showInWidget}"
19
+ ></vviinn-text-search>
20
+
21
+ <vviinn-results
22
+ token="${args.token}"
23
+ ></vviinn-results>
24
+ `;
25
+ export const TextSearch = Template.bind({});
26
+ TextSearch.storyName = "Text Search";
27
+ TextSearch.args = {
28
+ token: process.env.STORYBOOK_TOKEN,
29
+ apiPath: process.env.STORYBOOK_API_PATH,
30
+ searchQuery: "",
31
+ mode: "textAndImage",
32
+ locale: "en-US",
33
+ showInWidget: false,
34
+ };
35
+ TextSearch.parameters = {
36
+ design: {
37
+ type: "figma",
38
+ url: "https://www.figma.com/design/4xUlo6X4l7FHKcHkJRW4C4/Visual-Search-Widget?node-id=1370-226&t=iiWX4CdPIRXmBKQ3-0",
39
+ },
40
+ };
@@ -16,9 +16,9 @@ export class VviinnTextSearch {
16
16
  this.token = undefined;
17
17
  this.locale = "de-DE";
18
18
  this.mode = "text";
19
- this.apiPath = "https://api.vviinn.com";
20
19
  this.showInWidget = false;
21
20
  this.searchQuery = undefined;
21
+ this.apiPath = "https://api.vviinn.com";
22
22
  }
23
23
  async componentWillLoad() {
24
24
  await i18next.init({
@@ -136,24 +136,6 @@ export class VviinnTextSearch {
136
136
  "reflect": false,
137
137
  "defaultValue": "\"text\""
138
138
  },
139
- "apiPath": {
140
- "type": "string",
141
- "mutable": false,
142
- "complexType": {
143
- "original": "string",
144
- "resolved": "string",
145
- "references": {}
146
- },
147
- "required": false,
148
- "optional": true,
149
- "docs": {
150
- "tags": [],
151
- "text": "API path passed from widget"
152
- },
153
- "attribute": "api-path",
154
- "reflect": false,
155
- "defaultValue": "\"https://api.vviinn.com\""
156
- },
157
139
  "showInWidget": {
158
140
  "type": "boolean",
159
141
  "mutable": false,
@@ -188,6 +170,27 @@ export class VviinnTextSearch {
188
170
  },
189
171
  "attribute": "search-query",
190
172
  "reflect": false
173
+ },
174
+ "apiPath": {
175
+ "type": "string",
176
+ "mutable": false,
177
+ "complexType": {
178
+ "original": "string",
179
+ "resolved": "string",
180
+ "references": {}
181
+ },
182
+ "required": false,
183
+ "optional": true,
184
+ "docs": {
185
+ "tags": [{
186
+ "name": "internal",
187
+ "text": undefined
188
+ }],
189
+ "text": ""
190
+ },
191
+ "attribute": "api-path",
192
+ "reflect": false,
193
+ "defaultValue": "\"https://api.vviinn.com\""
191
194
  }
192
195
  };
193
196
  }
@@ -200,7 +203,7 @@ export class VviinnTextSearch {
200
203
  "composed": true,
201
204
  "docs": {
202
205
  "tags": [],
203
- "text": "A text search was initiated (used by the vviinn-results component)"
206
+ "text": "A text search was initiated (used by vviinn-results component)"
204
207
  },
205
208
  "complexType": {
206
209
  "original": "TextSearchEventData",
@@ -213,28 +216,28 @@ export class VviinnTextSearch {
213
216
  }
214
217
  }
215
218
  }, {
216
- "method": "vviinnTextSearchFinished",
217
- "name": "vviinnTextSearchFinished",
219
+ "method": "vviinnSearchIdReceived",
220
+ "name": "vviinnSearchIdReceived",
218
221
  "bubbles": true,
219
222
  "cancelable": true,
220
223
  "composed": true,
221
224
  "docs": {
222
225
  "tags": [],
223
- "text": "A text search API response was received (used internally by vviinn-vps-widget)"
226
+ "text": "An image search ID was received (used by vviinn-results component)"
224
227
  },
225
228
  "complexType": {
226
- "original": "TextSearchEventData",
227
- "resolved": "{ query: string; }",
229
+ "original": "SearchIdEventData",
230
+ "resolved": "{ searchId: string; }",
228
231
  "references": {
229
- "TextSearchEventData": {
232
+ "SearchIdEventData": {
230
233
  "location": "import",
231
234
  "path": "../../recommendation/events"
232
235
  }
233
236
  }
234
237
  }
235
238
  }, {
236
- "method": "vviinnSearchIdReceived",
237
- "name": "vviinnSearchIdReceived",
239
+ "method": "vviinnTextSearchFinished",
240
+ "name": "vviinnTextSearchFinished",
238
241
  "bubbles": true,
239
242
  "cancelable": true,
240
243
  "composed": true,
@@ -246,10 +249,10 @@ export class VviinnTextSearch {
246
249
  "text": ""
247
250
  },
248
251
  "complexType": {
249
- "original": "SearchIdEventData",
250
- "resolved": "{ searchId: string; }",
252
+ "original": "TextSearchEventData",
253
+ "resolved": "{ query: string; }",
251
254
  "references": {
252
- "SearchIdEventData": {
255
+ "TextSearchEventData": {
253
256
  "location": "import",
254
257
  "path": "../../recommendation/events"
255
258
  }
@@ -412,7 +412,7 @@ export class VviinnVpsWidget {
412
412
  } }, h("div", { class: "filters" }, searchState.filters.map((filter) => (h("search-filters", { filter: filter, basicEventData: this.getBasicEventData() }))))))), this.isResultSlide() && searchState.searchType === "text" && (h("div", { class: "source-wrapper text-search-wrapper" }, h("vviinn-text-search", { token: this.token, showInWidget: true, searchQuery: this.searchQuery, apiPath: this.apiPath }), h("div", { class: {
413
413
  "filters-wrapper": true,
414
414
  hidden: this.showAspectRatioError,
415
- } }, h("div", { class: "filters" }, searchState.textSearchFilters.map((filter) => (h("search-filters", { textSearchFiltersGroup: filter, basicEventData: this.getBasicEventData() }))))))), this.isResultSlide() && (h("vviinn-results", { token: this.token, uiSessionId: this.uiSessionId, apiPath: this.apiPath, widgetElementId: (_b = this.buttonElementId) !== null && _b !== void 0 ? _b : this.widgetElementId, showingInWidget: true, buttonElementId: this.buttonElementId, imageResolutionWidth: this.imageResolutionWidth, "currency-sign": this.currencySign, locale: this.locale, productDetailsNewTab: this.productDetailsNewTab, productDetailsRedirect: this.productDetailsRedirect, showAspectRatioError: this.showAspectRatioError, trackingDeactivated: this.trackingDeactivated, resetState: this.resetState.bind(this), textSearchQuery: this.searchQuery })))))));
415
+ } }, h("div", { class: "filters" }, searchState.textSearchFilters.map((filter) => (h("search-filters", { textSearchFiltersGroup: filter, basicEventData: this.getBasicEventData() }))))))), this.isResultSlide() && (h("vviinn-results", { token: this.token, uiSessionId: this.uiSessionId, apiPath: this.apiPath, widgetElementId: (_b = this.buttonElementId) !== null && _b !== void 0 ? _b : this.widgetElementId, showInWidget: true, buttonElementId: this.buttonElementId, imageResolutionWidth: this.imageResolutionWidth, "currency-sign": this.currencySign, locale: this.locale, productDetailsNewTab: this.productDetailsNewTab, productDetailsRedirect: this.productDetailsRedirect, showAspectRatioError: this.showAspectRatioError, trackingDeactivated: this.trackingDeactivated, resetState: this.resetState.bind(this), textSearchQuery: this.searchQuery })))))));
416
416
  }
417
417
  static get is() { return "vviinn-vps-widget"; }
418
418
  static get encapsulation() { return "shadow"; }