@getlupa/client 0.6.0-alpha-23 → 0.7.0-alpha-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,6 +21,7 @@ export declare const SEARCH_RESULTS_CONFIGURATION: {
21
21
  didYouMean: string;
22
22
  similarQuery: string;
23
23
  similarQueries: string;
24
+ aiSuggestions: string;
24
25
  };
25
26
  toolbar: {
26
27
  totalCount: boolean;
@@ -1,12 +1,12 @@
1
1
  import { SearchBoxOptions } from "./types/search-box/SearchBoxOptions";
2
- import { CallbackContext, FacetFilterQuery, FacetStyle, SearchResultEventCallbacks, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
2
+ import { CallbackContext, FacetFilterQuery, FacetStyle, SearchResultEventCallbacks, SearchResultsFilterOptions, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
3
3
  import { SdkOptions, TrackingOptions, Environment, SortDirection } from "./types/General";
4
4
  import { CategoryFilterOptions, ProductListOptions } from "./types/product-list/ProductListOptions";
5
5
  import { AddToCartElement, CustomDocumentElement, CustomHtmlElement, DescriptionDocumentElement, DocumentElement, DocumentElementType, ImageDocumentElement, PriceElement, RatingElement, RegularPriceDocumentElement, TitleDocumentElement } from "./types/DocumentElement";
6
6
  import { SearchBoxPanelType } from "./types/search-box/SearchBoxPanel";
7
7
  import { RoutingBehavior } from "./types/search-results/RoutingBehavior";
8
8
  import { AnchorPosition } from "./types/search-results/SearchResultsProductCardOptions";
9
- import { BadgeType } from "./types/search-results/BadgeOptions";
9
+ import { BadgeType, SearchResultBadgeElement, SearchResultBadgeType } from "./types/search-results/BadgeOptions";
10
10
  import { SearchResultsSortOptions, SortOptions } from "./types/search-results/SearchResultsSort";
11
11
  declare const lupaSearch: {
12
12
  searchBox: (options: SearchBoxOptions) => void;
@@ -17,5 +17,5 @@ declare const lupaSearch: {
17
17
  clearSearchResults: () => void;
18
18
  clearProductList: () => void;
19
19
  };
20
- export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, FacetFilterQuery, CategoryFilterOptions, };
20
+ export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, FacetFilterQuery, CategoryFilterOptions, SearchResultsFilterOptions, SearchResultBadgeType, SearchResultBadgeElement, };
21
21
  export default lupaSearch;
@@ -16549,10 +16549,12 @@ exports.BadgeType = void 0;
16549
16549
 
16550
16550
  let CustomBadge = class CustomBadge extends Vue$1 {
16551
16551
  get text() {
16552
- return this.badge.html(this.badge.product);
16552
+ var _a;
16553
+ return this.badge.html((_a = this.badge.product) !== null && _a !== void 0 ? _a : {});
16553
16554
  }
16554
16555
  get className() {
16555
- return this.badge.className;
16556
+ var _a;
16557
+ return (_a = this.badge.className) !== null && _a !== void 0 ? _a : "";
16556
16558
  }
16557
16559
  };
16558
16560
  __decorate([
@@ -16768,9 +16770,10 @@ let SearchResultsBadgeWrapper = class SearchResultsBadgeWrapper extends Vue$1 {
16768
16770
  return [];
16769
16771
  }
16770
16772
  return this.options.elements
16771
- .filter((e) => !e.display || e.display(this.options.product))
16773
+ .filter((e) => { var _a; return !e.display || e.display((_a = this.options.product) !== null && _a !== void 0 ? _a : {}); })
16772
16774
  .map((x) => {
16773
- return Object.assign(Object.assign({}, x), { value: this.options.product[x.key] || "badge", product: this.options.product });
16775
+ var _a;
16776
+ return Object.assign(Object.assign({}, x), { value: ((_a = this.options.product) === null || _a === void 0 ? void 0 : _a[x.key]) || "badge", product: this.options.product });
16774
16777
  });
16775
16778
  }
16776
16779
  getBadgeComponent(type) {
@@ -19643,34 +19646,54 @@ var __vue_render__$a = function () {
19643
19646
  staticClass: "lupa-similar-query-label",
19644
19647
  attrs: { "data-cy": "lupa-similar-query-label" },
19645
19648
  },
19646
- _vm._l(_vm.labels.similarQuery.split(" "), function (label, index) {
19647
- return _c("span", { key: index }, [
19648
- label.includes("{1}")
19649
- ? _c(
19650
- "span",
19651
- {
19652
- staticClass:
19653
- "lupa-similar-query-value lupa-similar-query-link",
19654
- attrs: { "data-cy": "lupa-similar-query-value" },
19655
- on: {
19656
- click: function ($event) {
19657
- return _vm.goToResults({
19658
- searchText: similarQuery.query,
19659
- })
19660
- },
19661
- },
19662
- },
19663
- [
19664
- _c("SimilarQueryText", {
19665
- attrs: { label: label, similarQuery: similarQuery },
19666
- }),
19667
- ],
19668
- 1
19669
- )
19670
- : _c("span", [_vm._v(_vm._s(label) + " ")]),
19671
- ])
19672
- }),
19673
- 0
19649
+ [
19650
+ !similarQuery.aiSuggestions
19651
+ ? _vm._l(
19652
+ _vm.labels.similarQuery.split(" "),
19653
+ function (label, index) {
19654
+ return _c("span", { key: index }, [
19655
+ label.includes("{1}")
19656
+ ? _c(
19657
+ "span",
19658
+ {
19659
+ staticClass:
19660
+ "lupa-similar-query-value lupa-similar-query-link",
19661
+ attrs: {
19662
+ "data-cy": "lupa-similar-query-value",
19663
+ },
19664
+ on: {
19665
+ click: function ($event) {
19666
+ return _vm.goToResults({
19667
+ searchText: similarQuery.query,
19668
+ })
19669
+ },
19670
+ },
19671
+ },
19672
+ [
19673
+ _c("SimilarQueryText", {
19674
+ attrs: {
19675
+ label: label,
19676
+ similarQuery: similarQuery,
19677
+ },
19678
+ }),
19679
+ ],
19680
+ 1
19681
+ )
19682
+ : _c("span", [_vm._v(_vm._s(label) + " ")]),
19683
+ ])
19684
+ }
19685
+ )
19686
+ : [
19687
+ _c("span", [
19688
+ _c("span", { staticClass: "lupa-similar-query-value" }, [
19689
+ _vm._v(
19690
+ _vm._s(_vm.labels.aiSuggestions) + "\n "
19691
+ ),
19692
+ ]),
19693
+ ]),
19694
+ ],
19695
+ ],
19696
+ 2
19674
19697
  ),
19675
19698
  _vm._v(" "),
19676
19699
  _c(
@@ -19818,7 +19841,7 @@ let SearchResultsProducts = class SearchResultsProducts extends Vue$1 {
19818
19841
  ]);
19819
19842
  }
19820
19843
  get similarQueriesLabels() {
19821
- return pick(this.options.labels, ["similarQuery", "similarQueries"]);
19844
+ return this.options.labels;
19822
19845
  }
19823
19846
  get showTopFilters() {
19824
19847
  var _a, _b, _c;
@@ -1,4 +1,3 @@
1
- import { Document } from "@getlupa/client-sdk/Types";
2
1
  export declare enum DocumentElementType {
3
2
  IMAGE = "image",
4
3
  TITLE = "title",
@@ -10,10 +9,10 @@ export declare enum DocumentElementType {
10
9
  ADDTOCART = "addToCart",
11
10
  CUSTOM_HTML = "customHtml"
12
11
  }
13
- export declare type DocumentElementBase = {
12
+ export declare type DocumentElementBase<T = Record<string, unknown>> = {
14
13
  type: DocumentElementType;
15
14
  key?: string;
16
- display?: (document: Record<string, unknown>) => boolean;
15
+ display?: (document: T) => boolean;
17
16
  isHtml?: boolean;
18
17
  };
19
18
  export declare type ImageDocumentElement = DocumentElementBase & {
@@ -32,6 +31,7 @@ export declare type DescriptionDocumentElement = DocumentElementBase & {
32
31
  type: DocumentElementType.DESCRIPTION;
33
32
  maxLines: number;
34
33
  key: string;
34
+ className: string;
35
35
  };
36
36
  export declare type CustomDocumentElement = DocumentElementBase & {
37
37
  type: DocumentElementType.CUSTOM;
@@ -46,12 +46,12 @@ export declare type RegularPriceDocumentElement = DocumentElementBase & {
46
46
  type: DocumentElementType.REGULARPRICE;
47
47
  key: string;
48
48
  };
49
- export declare type RatingElement = DocumentElementBase & {
49
+ export declare type RatingElement<T = Record<string, unknown>> = DocumentElementBase<T> & {
50
50
  type: DocumentElementType.RATING;
51
51
  labels: RatingLabels;
52
52
  links: RatingLinks;
53
53
  totalKey: string;
54
- getRatingPercentage?: (doc: Document) => number;
54
+ getRatingPercentage?: (doc: T) => number;
55
55
  key: string;
56
56
  };
57
57
  export declare type RatingLabels = {
@@ -60,16 +60,16 @@ export declare type RatingLabels = {
60
60
  export declare type RatingLinks = {
61
61
  ratingDetails?: string;
62
62
  };
63
- export declare type AddToCartElement = DocumentElementBase & {
63
+ export declare type AddToCartElement<T = Record<string, unknown>> = DocumentElementBase<T> & {
64
64
  type: DocumentElementType.ADDTOCART;
65
- action: (document: Document, amount: number) => Promise<unknown> | undefined;
65
+ action: (document: T, amount: number) => Promise<unknown> | undefined;
66
66
  labels: {
67
67
  addToCart: string;
68
68
  };
69
69
  };
70
- export declare type CustomHtmlElement = DocumentElementBase & {
70
+ export declare type CustomHtmlElement<T = Record<string, unknown>> = DocumentElementBase<T> & {
71
71
  type: DocumentElementType.CUSTOM_HTML;
72
- html: (document: Document) => string;
72
+ html: (document: T) => string;
73
73
  className: string;
74
74
  };
75
75
  export declare type DocumentElement = ImageDocumentElement | TitleDocumentElement | DescriptionDocumentElement | CustomDocumentElement | PriceElement | RegularPriceDocumentElement | RatingElement | AddToCartElement | CustomHtmlElement;
@@ -14,12 +14,12 @@ export declare type CategoryFilterOptions = {
14
14
  title: string;
15
15
  };
16
16
  parent?: {
17
- url: string;
18
- title: string;
17
+ url?: string;
18
+ title?: string;
19
19
  };
20
20
  current?: {
21
- title: string;
22
- description: string;
21
+ title?: string;
22
+ description?: string;
23
23
  };
24
24
  };
25
25
  export declare type ProductListOptions = SearchResultsOptions & {
@@ -4,14 +4,16 @@ export declare type SearchResultBadgeType = "text" | "image" | "customHtml";
4
4
  export declare type BadgeOptions = {
5
5
  anchor: AnchorPosition;
6
6
  elements: BadgeElement[];
7
- product: Document;
7
+ product?: Document;
8
8
  };
9
- export declare type SearchResultBadgeElement = {
9
+ export declare type SearchResultBadgeElement<T = Record<string, unknown>> = {
10
10
  type: SearchResultBadgeType;
11
11
  key: string;
12
- isHtml: boolean;
13
- product: Document;
14
- display?: (document: Record<string, unknown>) => boolean;
12
+ isHtml?: boolean;
13
+ className?: string;
14
+ product?: T;
15
+ display?: (document: T) => boolean;
16
+ rootImageUrl?: string;
15
17
  };
16
18
  export declare type BaseBadgeElement = SearchResultBadgeElement & {
17
19
  value?: string;
@@ -28,7 +30,7 @@ export declare type ImageBadgeElement = BaseBadgeElement & {
28
30
  };
29
31
  export declare type CustomHtmlBadgeElement = BaseBadgeElement & {
30
32
  type: "customHtml";
31
- className: string;
33
+ className?: string;
32
34
  html: (doc: Document) => string;
33
35
  };
34
36
  export declare type BadgeElement = BaseBadgeElement | TextBadgeElement;
@@ -18,6 +18,7 @@ export declare type SearchResultsDidYouMeanLabels = {
18
18
  export declare type SearchResultsSimilarQueriesLabels = {
19
19
  similarQuery: string;
20
20
  similarQueries: string;
21
+ aiSuggestions?: string;
21
22
  };
22
23
  export declare type CallbackContext = {
23
24
  queryKey: string;
@@ -72,6 +73,7 @@ export declare type ProductGrid = {
72
73
  export declare type SearchResultsPaginationLabels = {
73
74
  pageSize: string;
74
75
  showMore: string;
76
+ showLess?: string;
75
77
  };
76
78
  export declare type ResponsiveSearchResultPageSizes = {
77
79
  xs: number[];
@@ -21,6 +21,7 @@ export declare const SEARCH_RESULTS_CONFIGURATION: {
21
21
  didYouMean: string;
22
22
  similarQuery: string;
23
23
  similarQueries: string;
24
+ aiSuggestions: string;
24
25
  };
25
26
  toolbar: {
26
27
  totalCount: boolean;
@@ -1,12 +1,12 @@
1
1
  import { SearchBoxOptions } from "./types/search-box/SearchBoxOptions";
2
- import { CallbackContext, FacetFilterQuery, FacetStyle, SearchResultEventCallbacks, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
2
+ import { CallbackContext, FacetFilterQuery, FacetStyle, SearchResultEventCallbacks, SearchResultsFilterOptions, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
3
3
  import { SdkOptions, TrackingOptions, Environment, SortDirection } from "./types/General";
4
4
  import { CategoryFilterOptions, ProductListOptions } from "./types/product-list/ProductListOptions";
5
5
  import { AddToCartElement, CustomDocumentElement, CustomHtmlElement, DescriptionDocumentElement, DocumentElement, DocumentElementType, ImageDocumentElement, PriceElement, RatingElement, RegularPriceDocumentElement, TitleDocumentElement } from "./types/DocumentElement";
6
6
  import { SearchBoxPanelType } from "./types/search-box/SearchBoxPanel";
7
7
  import { RoutingBehavior } from "./types/search-results/RoutingBehavior";
8
8
  import { AnchorPosition } from "./types/search-results/SearchResultsProductCardOptions";
9
- import { BadgeType } from "./types/search-results/BadgeOptions";
9
+ import { BadgeType, SearchResultBadgeElement, SearchResultBadgeType } from "./types/search-results/BadgeOptions";
10
10
  import { SearchResultsSortOptions, SortOptions } from "./types/search-results/SearchResultsSort";
11
11
  declare const lupaSearch: {
12
12
  searchBox: (options: SearchBoxOptions) => void;
@@ -17,5 +17,5 @@ declare const lupaSearch: {
17
17
  clearSearchResults: () => void;
18
18
  clearProductList: () => void;
19
19
  };
20
- export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, FacetFilterQuery, CategoryFilterOptions, };
20
+ export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, FacetFilterQuery, CategoryFilterOptions, SearchResultsFilterOptions, SearchResultBadgeType, SearchResultBadgeElement, };
21
21
  export default lupaSearch;
@@ -16545,10 +16545,12 @@ var BadgeType;
16545
16545
 
16546
16546
  let CustomBadge = class CustomBadge extends Vue$1 {
16547
16547
  get text() {
16548
- return this.badge.html(this.badge.product);
16548
+ var _a;
16549
+ return this.badge.html((_a = this.badge.product) !== null && _a !== void 0 ? _a : {});
16549
16550
  }
16550
16551
  get className() {
16551
- return this.badge.className;
16552
+ var _a;
16553
+ return (_a = this.badge.className) !== null && _a !== void 0 ? _a : "";
16552
16554
  }
16553
16555
  };
16554
16556
  __decorate([
@@ -16764,9 +16766,10 @@ let SearchResultsBadgeWrapper = class SearchResultsBadgeWrapper extends Vue$1 {
16764
16766
  return [];
16765
16767
  }
16766
16768
  return this.options.elements
16767
- .filter((e) => !e.display || e.display(this.options.product))
16769
+ .filter((e) => { var _a; return !e.display || e.display((_a = this.options.product) !== null && _a !== void 0 ? _a : {}); })
16768
16770
  .map((x) => {
16769
- return Object.assign(Object.assign({}, x), { value: this.options.product[x.key] || "badge", product: this.options.product });
16771
+ var _a;
16772
+ return Object.assign(Object.assign({}, x), { value: ((_a = this.options.product) === null || _a === void 0 ? void 0 : _a[x.key]) || "badge", product: this.options.product });
16770
16773
  });
16771
16774
  }
16772
16775
  getBadgeComponent(type) {
@@ -19639,34 +19642,54 @@ var __vue_render__$a = function () {
19639
19642
  staticClass: "lupa-similar-query-label",
19640
19643
  attrs: { "data-cy": "lupa-similar-query-label" },
19641
19644
  },
19642
- _vm._l(_vm.labels.similarQuery.split(" "), function (label, index) {
19643
- return _c("span", { key: index }, [
19644
- label.includes("{1}")
19645
- ? _c(
19646
- "span",
19647
- {
19648
- staticClass:
19649
- "lupa-similar-query-value lupa-similar-query-link",
19650
- attrs: { "data-cy": "lupa-similar-query-value" },
19651
- on: {
19652
- click: function ($event) {
19653
- return _vm.goToResults({
19654
- searchText: similarQuery.query,
19655
- })
19656
- },
19657
- },
19658
- },
19659
- [
19660
- _c("SimilarQueryText", {
19661
- attrs: { label: label, similarQuery: similarQuery },
19662
- }),
19663
- ],
19664
- 1
19665
- )
19666
- : _c("span", [_vm._v(_vm._s(label) + " ")]),
19667
- ])
19668
- }),
19669
- 0
19645
+ [
19646
+ !similarQuery.aiSuggestions
19647
+ ? _vm._l(
19648
+ _vm.labels.similarQuery.split(" "),
19649
+ function (label, index) {
19650
+ return _c("span", { key: index }, [
19651
+ label.includes("{1}")
19652
+ ? _c(
19653
+ "span",
19654
+ {
19655
+ staticClass:
19656
+ "lupa-similar-query-value lupa-similar-query-link",
19657
+ attrs: {
19658
+ "data-cy": "lupa-similar-query-value",
19659
+ },
19660
+ on: {
19661
+ click: function ($event) {
19662
+ return _vm.goToResults({
19663
+ searchText: similarQuery.query,
19664
+ })
19665
+ },
19666
+ },
19667
+ },
19668
+ [
19669
+ _c("SimilarQueryText", {
19670
+ attrs: {
19671
+ label: label,
19672
+ similarQuery: similarQuery,
19673
+ },
19674
+ }),
19675
+ ],
19676
+ 1
19677
+ )
19678
+ : _c("span", [_vm._v(_vm._s(label) + " ")]),
19679
+ ])
19680
+ }
19681
+ )
19682
+ : [
19683
+ _c("span", [
19684
+ _c("span", { staticClass: "lupa-similar-query-value" }, [
19685
+ _vm._v(
19686
+ _vm._s(_vm.labels.aiSuggestions) + "\n "
19687
+ ),
19688
+ ]),
19689
+ ]),
19690
+ ],
19691
+ ],
19692
+ 2
19670
19693
  ),
19671
19694
  _vm._v(" "),
19672
19695
  _c(
@@ -19814,7 +19837,7 @@ let SearchResultsProducts = class SearchResultsProducts extends Vue$1 {
19814
19837
  ]);
19815
19838
  }
19816
19839
  get similarQueriesLabels() {
19817
- return pick(this.options.labels, ["similarQuery", "similarQueries"]);
19840
+ return this.options.labels;
19818
19841
  }
19819
19842
  get showTopFilters() {
19820
19843
  var _a, _b, _c;
@@ -1,4 +1,3 @@
1
- import { Document } from "@getlupa/client-sdk/Types";
2
1
  export declare enum DocumentElementType {
3
2
  IMAGE = "image",
4
3
  TITLE = "title",
@@ -10,10 +9,10 @@ export declare enum DocumentElementType {
10
9
  ADDTOCART = "addToCart",
11
10
  CUSTOM_HTML = "customHtml"
12
11
  }
13
- export declare type DocumentElementBase = {
12
+ export declare type DocumentElementBase<T = Record<string, unknown>> = {
14
13
  type: DocumentElementType;
15
14
  key?: string;
16
- display?: (document: Record<string, unknown>) => boolean;
15
+ display?: (document: T) => boolean;
17
16
  isHtml?: boolean;
18
17
  };
19
18
  export declare type ImageDocumentElement = DocumentElementBase & {
@@ -32,6 +31,7 @@ export declare type DescriptionDocumentElement = DocumentElementBase & {
32
31
  type: DocumentElementType.DESCRIPTION;
33
32
  maxLines: number;
34
33
  key: string;
34
+ className: string;
35
35
  };
36
36
  export declare type CustomDocumentElement = DocumentElementBase & {
37
37
  type: DocumentElementType.CUSTOM;
@@ -46,12 +46,12 @@ export declare type RegularPriceDocumentElement = DocumentElementBase & {
46
46
  type: DocumentElementType.REGULARPRICE;
47
47
  key: string;
48
48
  };
49
- export declare type RatingElement = DocumentElementBase & {
49
+ export declare type RatingElement<T = Record<string, unknown>> = DocumentElementBase<T> & {
50
50
  type: DocumentElementType.RATING;
51
51
  labels: RatingLabels;
52
52
  links: RatingLinks;
53
53
  totalKey: string;
54
- getRatingPercentage?: (doc: Document) => number;
54
+ getRatingPercentage?: (doc: T) => number;
55
55
  key: string;
56
56
  };
57
57
  export declare type RatingLabels = {
@@ -60,16 +60,16 @@ export declare type RatingLabels = {
60
60
  export declare type RatingLinks = {
61
61
  ratingDetails?: string;
62
62
  };
63
- export declare type AddToCartElement = DocumentElementBase & {
63
+ export declare type AddToCartElement<T = Record<string, unknown>> = DocumentElementBase<T> & {
64
64
  type: DocumentElementType.ADDTOCART;
65
- action: (document: Document, amount: number) => Promise<unknown> | undefined;
65
+ action: (document: T, amount: number) => Promise<unknown> | undefined;
66
66
  labels: {
67
67
  addToCart: string;
68
68
  };
69
69
  };
70
- export declare type CustomHtmlElement = DocumentElementBase & {
70
+ export declare type CustomHtmlElement<T = Record<string, unknown>> = DocumentElementBase<T> & {
71
71
  type: DocumentElementType.CUSTOM_HTML;
72
- html: (document: Document) => string;
72
+ html: (document: T) => string;
73
73
  className: string;
74
74
  };
75
75
  export declare type DocumentElement = ImageDocumentElement | TitleDocumentElement | DescriptionDocumentElement | CustomDocumentElement | PriceElement | RegularPriceDocumentElement | RatingElement | AddToCartElement | CustomHtmlElement;
@@ -14,12 +14,12 @@ export declare type CategoryFilterOptions = {
14
14
  title: string;
15
15
  };
16
16
  parent?: {
17
- url: string;
18
- title: string;
17
+ url?: string;
18
+ title?: string;
19
19
  };
20
20
  current?: {
21
- title: string;
22
- description: string;
21
+ title?: string;
22
+ description?: string;
23
23
  };
24
24
  };
25
25
  export declare type ProductListOptions = SearchResultsOptions & {
@@ -4,14 +4,16 @@ export declare type SearchResultBadgeType = "text" | "image" | "customHtml";
4
4
  export declare type BadgeOptions = {
5
5
  anchor: AnchorPosition;
6
6
  elements: BadgeElement[];
7
- product: Document;
7
+ product?: Document;
8
8
  };
9
- export declare type SearchResultBadgeElement = {
9
+ export declare type SearchResultBadgeElement<T = Record<string, unknown>> = {
10
10
  type: SearchResultBadgeType;
11
11
  key: string;
12
- isHtml: boolean;
13
- product: Document;
14
- display?: (document: Record<string, unknown>) => boolean;
12
+ isHtml?: boolean;
13
+ className?: string;
14
+ product?: T;
15
+ display?: (document: T) => boolean;
16
+ rootImageUrl?: string;
15
17
  };
16
18
  export declare type BaseBadgeElement = SearchResultBadgeElement & {
17
19
  value?: string;
@@ -28,7 +30,7 @@ export declare type ImageBadgeElement = BaseBadgeElement & {
28
30
  };
29
31
  export declare type CustomHtmlBadgeElement = BaseBadgeElement & {
30
32
  type: "customHtml";
31
- className: string;
33
+ className?: string;
32
34
  html: (doc: Document) => string;
33
35
  };
34
36
  export declare type BadgeElement = BaseBadgeElement | TextBadgeElement;
@@ -18,6 +18,7 @@ export declare type SearchResultsDidYouMeanLabels = {
18
18
  export declare type SearchResultsSimilarQueriesLabels = {
19
19
  similarQuery: string;
20
20
  similarQueries: string;
21
+ aiSuggestions?: string;
21
22
  };
22
23
  export declare type CallbackContext = {
23
24
  queryKey: string;
@@ -72,6 +73,7 @@ export declare type ProductGrid = {
72
73
  export declare type SearchResultsPaginationLabels = {
73
74
  pageSize: string;
74
75
  showMore: string;
76
+ showLess?: string;
75
77
  };
76
78
  export declare type ResponsiveSearchResultPageSizes = {
77
79
  xs: number[];
@@ -21,6 +21,7 @@ export declare const SEARCH_RESULTS_CONFIGURATION: {
21
21
  didYouMean: string;
22
22
  similarQuery: string;
23
23
  similarQueries: string;
24
+ aiSuggestions: string;
24
25
  };
25
26
  toolbar: {
26
27
  totalCount: boolean;
@@ -1,12 +1,12 @@
1
1
  import { SearchBoxOptions } from "./types/search-box/SearchBoxOptions";
2
- import { CallbackContext, FacetFilterQuery, FacetStyle, SearchResultEventCallbacks, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
2
+ import { CallbackContext, FacetFilterQuery, FacetStyle, SearchResultEventCallbacks, SearchResultsFilterOptions, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
3
3
  import { SdkOptions, TrackingOptions, Environment, SortDirection } from "./types/General";
4
4
  import { CategoryFilterOptions, ProductListOptions } from "./types/product-list/ProductListOptions";
5
5
  import { AddToCartElement, CustomDocumentElement, CustomHtmlElement, DescriptionDocumentElement, DocumentElement, DocumentElementType, ImageDocumentElement, PriceElement, RatingElement, RegularPriceDocumentElement, TitleDocumentElement } from "./types/DocumentElement";
6
6
  import { SearchBoxPanelType } from "./types/search-box/SearchBoxPanel";
7
7
  import { RoutingBehavior } from "./types/search-results/RoutingBehavior";
8
8
  import { AnchorPosition } from "./types/search-results/SearchResultsProductCardOptions";
9
- import { BadgeType } from "./types/search-results/BadgeOptions";
9
+ import { BadgeType, SearchResultBadgeElement, SearchResultBadgeType } from "./types/search-results/BadgeOptions";
10
10
  import { SearchResultsSortOptions, SortOptions } from "./types/search-results/SearchResultsSort";
11
11
  declare const lupaSearch: {
12
12
  searchBox: (options: SearchBoxOptions) => void;
@@ -17,5 +17,5 @@ declare const lupaSearch: {
17
17
  clearSearchResults: () => void;
18
18
  clearProductList: () => void;
19
19
  };
20
- export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, FacetFilterQuery, CategoryFilterOptions, };
20
+ export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, FacetFilterQuery, CategoryFilterOptions, SearchResultsFilterOptions, SearchResultBadgeType, SearchResultBadgeElement, };
21
21
  export default lupaSearch;