@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
|
@@ -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[];
|