@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.
- package/dist/cjs/constants/development/searchResultsDev.example.const.d.ts +1 -0
- package/dist/cjs/index.d.ts +3 -3
- package/dist/cjs/index.min.js +56 -33
- package/dist/cjs/types/DocumentElement.d.ts +9 -9
- package/dist/cjs/types/product-list/ProductListOptions.d.ts +4 -4
- package/dist/cjs/types/search-results/BadgeOptions.d.ts +8 -6
- package/dist/cjs/types/search-results/SearchResultsOptions.d.ts +2 -0
- package/dist/es/constants/development/searchResultsDev.example.const.d.ts +1 -0
- package/dist/es/index.d.ts +3 -3
- package/dist/es/index.min.js +56 -33
- package/dist/es/types/DocumentElement.d.ts +9 -9
- package/dist/es/types/product-list/ProductListOptions.d.ts +4 -4
- package/dist/es/types/search-results/BadgeOptions.d.ts +8 -6
- package/dist/es/types/search-results/SearchResultsOptions.d.ts +2 -0
- package/dist/iife/constants/development/searchResultsDev.example.const.d.ts +1 -0
- package/dist/iife/index.d.ts +3 -3
- package/dist/iife/index.min.js +1 -1
- package/dist/iife/types/DocumentElement.d.ts +9 -9
- package/dist/iife/types/product-list/ProductListOptions.d.ts +4 -4
- package/dist/iife/types/search-results/BadgeOptions.d.ts +8 -6
- package/dist/iife/types/search-results/SearchResultsOptions.d.ts +2 -0
- package/package.json +1 -1
package/dist/cjs/index.d.ts
CHANGED
|
@@ -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;
|
package/dist/cjs/index.min.js
CHANGED
|
@@ -16549,10 +16549,12 @@ exports.BadgeType = void 0;
|
|
|
16549
16549
|
|
|
16550
16550
|
let CustomBadge = class CustomBadge extends Vue$1 {
|
|
16551
16551
|
get text() {
|
|
16552
|
-
|
|
16552
|
+
var _a;
|
|
16553
|
+
return this.badge.html((_a = this.badge.product) !== null && _a !== void 0 ? _a : {});
|
|
16553
16554
|
}
|
|
16554
16555
|
get className() {
|
|
16555
|
-
|
|
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
|
-
|
|
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
|
-
|
|
19647
|
-
|
|
19648
|
-
|
|
19649
|
-
|
|
19650
|
-
|
|
19651
|
-
{
|
|
19652
|
-
|
|
19653
|
-
|
|
19654
|
-
|
|
19655
|
-
|
|
19656
|
-
|
|
19657
|
-
|
|
19658
|
-
|
|
19659
|
-
|
|
19660
|
-
|
|
19661
|
-
|
|
19662
|
-
|
|
19663
|
-
|
|
19664
|
-
|
|
19665
|
-
|
|
19666
|
-
|
|
19667
|
-
|
|
19668
|
-
|
|
19669
|
-
|
|
19670
|
-
|
|
19671
|
-
|
|
19672
|
-
|
|
19673
|
-
|
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
|
18
|
-
title
|
|
17
|
+
url?: string;
|
|
18
|
+
title?: string;
|
|
19
19
|
};
|
|
20
20
|
current?: {
|
|
21
|
-
title
|
|
22
|
-
description
|
|
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
|
|
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
|
|
13
|
-
|
|
14
|
-
|
|
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
|
|
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[];
|
package/dist/es/index.d.ts
CHANGED
|
@@ -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;
|
package/dist/es/index.min.js
CHANGED
|
@@ -16545,10 +16545,12 @@ var BadgeType;
|
|
|
16545
16545
|
|
|
16546
16546
|
let CustomBadge = class CustomBadge extends Vue$1 {
|
|
16547
16547
|
get text() {
|
|
16548
|
-
|
|
16548
|
+
var _a;
|
|
16549
|
+
return this.badge.html((_a = this.badge.product) !== null && _a !== void 0 ? _a : {});
|
|
16549
16550
|
}
|
|
16550
16551
|
get className() {
|
|
16551
|
-
|
|
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
|
-
|
|
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
|
-
|
|
19643
|
-
|
|
19644
|
-
|
|
19645
|
-
|
|
19646
|
-
|
|
19647
|
-
{
|
|
19648
|
-
|
|
19649
|
-
|
|
19650
|
-
|
|
19651
|
-
|
|
19652
|
-
|
|
19653
|
-
|
|
19654
|
-
|
|
19655
|
-
|
|
19656
|
-
|
|
19657
|
-
|
|
19658
|
-
|
|
19659
|
-
|
|
19660
|
-
|
|
19661
|
-
|
|
19662
|
-
|
|
19663
|
-
|
|
19664
|
-
|
|
19665
|
-
|
|
19666
|
-
|
|
19667
|
-
|
|
19668
|
-
|
|
19669
|
-
|
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
|
18
|
-
title
|
|
17
|
+
url?: string;
|
|
18
|
+
title?: string;
|
|
19
19
|
};
|
|
20
20
|
current?: {
|
|
21
|
-
title
|
|
22
|
-
description
|
|
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
|
|
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
|
|
13
|
-
|
|
14
|
-
|
|
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
|
|
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[];
|
package/dist/iife/index.d.ts
CHANGED
|
@@ -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;
|