@getlupa/client 0.15.3 → 0.16.0-alpha-1
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/RecommendationsEntry.vue.d.ts +6 -0
- package/dist/cjs/components/recommendations/Recommendations.vue.d.ts +22 -0
- package/dist/cjs/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +5 -0
- package/dist/cjs/constants/development/recommendations.example.const.d.ts +2 -0
- package/dist/cjs/index.d.ts +4 -1
- package/dist/cjs/index.min.js +1726 -1372
- package/dist/cjs/types/AnalyticsOptions.d.ts +6 -1
- package/dist/cjs/types/recommendations/RecommendationsOptions.d.ts +22 -0
- package/dist/cjs/types/search-box/Common.d.ts +1 -0
- package/dist/es/RecommendationsEntry.vue.d.ts +6 -0
- package/dist/es/components/recommendations/Recommendations.vue.d.ts +22 -0
- package/dist/es/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +5 -0
- package/dist/es/constants/development/recommendations.example.const.d.ts +2 -0
- package/dist/es/index.d.ts +4 -1
- package/dist/es/index.min.js +1726 -1372
- package/dist/es/types/AnalyticsOptions.d.ts +6 -1
- package/dist/es/types/recommendations/RecommendationsOptions.d.ts +22 -0
- package/dist/es/types/search-box/Common.d.ts +1 -0
- package/dist/iife/RecommendationsEntry.vue.d.ts +6 -0
- package/dist/iife/components/recommendations/Recommendations.vue.d.ts +22 -0
- package/dist/iife/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +5 -0
- package/dist/iife/constants/development/recommendations.example.const.d.ts +2 -0
- package/dist/iife/index.d.ts +4 -1
- package/dist/iife/index.min.js +1 -1
- package/dist/iife/types/AnalyticsOptions.d.ts +6 -1
- package/dist/iife/types/recommendations/RecommendationsOptions.d.ts +22 -0
- package/dist/iife/types/search-box/Common.d.ts +1 -0
- package/dist/lupaContainerStyle.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -2
- package/vue-carousel.d.ts +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const PARENT_EVENT_NAME = "GetLupa";
|
|
2
|
-
export declare type AnalyticsEventType = "search_query" | "search_form_submit" | "autocomplete_suggestion_click" | "autocomplete_product_click" | "search_product_click" | "search_zero_results" | "search_filters" | "search_add_to_cart" | "view_item_list" | "select_item";
|
|
2
|
+
export declare type AnalyticsEventType = "search_query" | "search_form_submit" | "autocomplete_suggestion_click" | "autocomplete_product_click" | "search_product_click" | "search_zero_results" | "search_filters" | "search_add_to_cart" | "view_item_list" | "select_item" | "product_recommendation_click";
|
|
3
3
|
export declare type AnalyticsOptions = {
|
|
4
4
|
type: "ua" | "ga4" | "debug";
|
|
5
5
|
enabled: boolean;
|
|
@@ -7,3 +7,8 @@ export declare type AnalyticsOptions = {
|
|
|
7
7
|
ignoreEvents?: AnalyticsEventType[];
|
|
8
8
|
itemMap?: (item: Record<string, unknown>) => Record<string, unknown>;
|
|
9
9
|
};
|
|
10
|
+
export declare type ProductClickTrackingSettings = {
|
|
11
|
+
eventType?: AnalyticsEventType;
|
|
12
|
+
eventLabel?: string;
|
|
13
|
+
listLabel?: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SdkOptions } from "../General";
|
|
2
|
+
import { SearchResultsProductCardOptions } from "../search-results/SearchResultsProductCardOptions";
|
|
3
|
+
export declare type ProductRecommendationOptions = SearchResultsProductCardOptions & {
|
|
4
|
+
options: SdkOptions;
|
|
5
|
+
} & {
|
|
6
|
+
containerSelector: string;
|
|
7
|
+
queryKey: string;
|
|
8
|
+
itemId: string;
|
|
9
|
+
abTesting?: RecommendationABTestingOptions;
|
|
10
|
+
carousel?: {
|
|
11
|
+
pageSizes: number[][];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare type RecommendationABTestingOptions = {
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
originalIds?: string[];
|
|
17
|
+
events?: {
|
|
18
|
+
lupaSearchEventName: string;
|
|
19
|
+
originalEventName: string;
|
|
20
|
+
};
|
|
21
|
+
oldRecommenderDisplayRatio?: number;
|
|
22
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import Vue from "vue";
|
|
2
|
+
import { ProductRecommendationOptions } from "@/types/recommendations/RecommendationsOptions";
|
|
3
|
+
import { Document } from "@getlupa/client-sdk/Types";
|
|
4
|
+
import { ProductClickTrackingSettings } from "@/types/AnalyticsOptions";
|
|
5
|
+
import { SearchResultsOptions } from "@/types/search-results/SearchResultsOptions";
|
|
6
|
+
export default class Recommendations extends Vue {
|
|
7
|
+
options: ProductRecommendationOptions;
|
|
8
|
+
recommendations: Document[];
|
|
9
|
+
recommendationsType: "recommendations_original" | "recommendations_lupasearch";
|
|
10
|
+
loading: boolean;
|
|
11
|
+
setSearchResultOptions: ({ options, }: {
|
|
12
|
+
options: SearchResultsOptions;
|
|
13
|
+
}) => void;
|
|
14
|
+
get pages(): number[][];
|
|
15
|
+
mounted(): void;
|
|
16
|
+
getProductKey(index: number, product: Document): string;
|
|
17
|
+
loadRecommendations(): void;
|
|
18
|
+
fetch(): void;
|
|
19
|
+
loadOriginalRecommendations(): Promise<void>;
|
|
20
|
+
loadLupaRecommendations(): Promise<void>;
|
|
21
|
+
get clickTrackingSettings(): ProductClickTrackingSettings;
|
|
22
|
+
}
|
package/dist/iife/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts
CHANGED
|
@@ -8,10 +8,12 @@ import { SearchResultsOptionLabels, SearchResultsOptions } from "@/types/search-
|
|
|
8
8
|
import { SearchResultsProductCardOptions } from "@/types/search-results/SearchResultsProductCardOptions";
|
|
9
9
|
import { Document, ReportableEventType } from "@getlupa/client-sdk/Types";
|
|
10
10
|
import Vue from "vue";
|
|
11
|
+
import { ProductClickTrackingSettings, AnalyticsEventType } from "@/types/AnalyticsOptions";
|
|
11
12
|
export default class SearchResultsProductCard extends Vue {
|
|
12
13
|
product: Document;
|
|
13
14
|
options: SearchResultsProductCardOptions;
|
|
14
15
|
isAdditionalPanel: boolean;
|
|
16
|
+
clickTrackingSettings: ProductClickTrackingSettings;
|
|
15
17
|
isInStock: boolean;
|
|
16
18
|
layout: ResultsLayout;
|
|
17
19
|
searchResultsRoutingBehavior: RoutingBehavior;
|
|
@@ -35,6 +37,9 @@ export default class SearchResultsProductCard extends Vue {
|
|
|
35
37
|
checkIfIsInStock(): Promise<void>;
|
|
36
38
|
get id(): string;
|
|
37
39
|
get title(): string;
|
|
40
|
+
get clickTrackingType(): AnalyticsEventType;
|
|
41
|
+
get trackingLabel(): string | undefined;
|
|
42
|
+
get trackingListLabel(): string | undefined;
|
|
38
43
|
handleClick(): void;
|
|
39
44
|
handleProductEvent(item: {
|
|
40
45
|
type: ReportableEventType;
|
package/dist/iife/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { AnchorPosition } from "./types/search-results/SearchResultsProductCardO
|
|
|
9
9
|
import { BadgeGenerateOptions, BadgeGenerateSeed, BadgeOptions, BadgeType, SearchResultBadgeElement, SearchResultBadgeType } from "./types/search-results/BadgeOptions";
|
|
10
10
|
import { SearchResultsSortOptions, SortOptions } from "./types/search-results/SearchResultsSort";
|
|
11
11
|
import { SearchContainerConfigOptions, SearchContainerOptions } from "./types/search-container/SearchContainerOptions";
|
|
12
|
+
import { ProductRecommendationOptions, RecommendationABTestingOptions } from "./types/recommendations/RecommendationsOptions";
|
|
12
13
|
declare type MountOptions = {
|
|
13
14
|
fetch: boolean;
|
|
14
15
|
};
|
|
@@ -18,10 +19,12 @@ declare const lupaSearch: {
|
|
|
18
19
|
tracking: (options: TrackingOptions) => void;
|
|
19
20
|
productList: (options: ProductListOptions, mountOptions?: MountOptions | undefined) => void;
|
|
20
21
|
searchContainer: (options: SearchContainerOptions, mountOptions?: MountOptions | undefined) => void;
|
|
22
|
+
recommendations: (options: ProductRecommendationOptions, mountOptions?: MountOptions | undefined) => void;
|
|
21
23
|
clearSearchBox: (selector?: string | undefined) => void;
|
|
22
24
|
clearSearchResults: (selector?: string | undefined) => void;
|
|
23
25
|
clearProductList: (selector?: string | undefined) => void;
|
|
24
26
|
clearSearchContainer: (selector?: string | undefined) => void;
|
|
27
|
+
clearRecommendations: (selector?: string | undefined) => void;
|
|
25
28
|
};
|
|
26
|
-
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, ResultFacetOptions, BadgeGenerateSeed, BadgeGenerateOptions, BadgeOptions, MountOptions, SearchContainerOptions, SearchContainerConfigOptions, SingleStarRatingElement, DynamicData, };
|
|
29
|
+
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, ResultFacetOptions, BadgeGenerateSeed, BadgeGenerateOptions, BadgeOptions, MountOptions, SearchContainerOptions, SearchContainerConfigOptions, SingleStarRatingElement, DynamicData, ProductRecommendationOptions, RecommendationABTestingOptions, };
|
|
27
30
|
export default lupaSearch;
|