@getlupa/vue 0.0.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.
Files changed (142) hide show
  1. package/.eslintrc.cjs +15 -0
  2. package/.prettierrc.json +8 -0
  3. package/README.md +46 -0
  4. package/dist/containerStyle.css +1 -0
  5. package/dist/favicon.ico +0 -0
  6. package/dist/lupaSearch.iife.js +15899 -0
  7. package/dist/lupaSearch.js +15897 -0
  8. package/dist/lupaSearch.mjs +15897 -0
  9. package/dist/lupaSearch.umd.js +15900 -0
  10. package/dist/src/components/common/ProductImage.vue.d.ts +39 -0
  11. package/dist/src/components/common/Spinner.vue.d.ts +2 -0
  12. package/dist/src/components/product-list/CategoryDescription.vue.d.ts +14 -0
  13. package/dist/src/components/product-list/CategoryFilter.vue.d.ts +14 -0
  14. package/dist/src/components/product-list/CategoryFilterItem.vue.d.ts +22 -0
  15. package/dist/src/components/product-list/CategoryTopFilters.vue.d.ts +14 -0
  16. package/dist/src/components/product-list/ProductList.vue.d.ts +14 -0
  17. package/dist/src/components/recommendations/Recommendations.vue.d.ts +14 -0
  18. package/dist/src/components/search-box/SearchBox.vue.d.ts +22 -0
  19. package/dist/src/components/search-box/SearchBoxInput.vue.d.ts +42 -0
  20. package/dist/src/components/search-box/SearchBoxMainPanel.vue.d.ts +52 -0
  21. package/dist/src/components/search-box/SearchBoxMoreResults.vue.d.ts +24 -0
  22. package/dist/src/components/search-box/history/SearchBoxHistoryItem.vue.d.ts +24 -0
  23. package/dist/src/components/search-box/history/SearchBoxHistoryPanel.vue.d.ts +16 -0
  24. package/dist/src/components/search-box/products/SearchBoxProduct.vue.d.ts +50 -0
  25. package/dist/src/components/search-box/products/SearchBoxProducts.vue.d.ts +40 -0
  26. package/dist/src/components/search-box/products/SearchBoxProductsWrapper.vue.d.ts +50 -0
  27. package/dist/src/components/search-box/products/elements/SearchBoxProductCustom.vue.d.ts +23 -0
  28. package/dist/src/components/search-box/products/elements/SearchBoxProductCustomHtml.vue.d.ts +22 -0
  29. package/dist/src/components/search-box/products/elements/SearchBoxProductDescription.vue.d.ts +23 -0
  30. package/dist/src/components/search-box/products/elements/SearchBoxProductElement.vue.d.ts +32 -0
  31. package/dist/src/components/search-box/products/elements/SearchBoxProductImage.vue.d.ts +23 -0
  32. package/dist/src/components/search-box/products/elements/SearchBoxProductPrice.vue.d.ts +32 -0
  33. package/dist/src/components/search-box/products/elements/SearchBoxProductRegularPrice.vue.d.ts +32 -0
  34. package/dist/src/components/search-box/products/elements/SearchBoxProductTitle.vue.d.ts +23 -0
  35. package/dist/src/components/search-box/suggestions/SearchBoxSuggestion.vue.d.ts +33 -0
  36. package/dist/src/components/search-box/suggestions/SearchBoxSuggestions.vue.d.ts +41 -0
  37. package/dist/src/components/search-box/suggestions/SearchBoxSuggestionsWrapper.vue.d.ts +51 -0
  38. package/dist/src/components/search-container/SearchContainer.vue.d.ts +14 -0
  39. package/dist/src/components/search-results/SearchResults.vue.d.ts +39 -0
  40. package/dist/src/components/search-results/SearchResultsBreadcrumbs.vue.d.ts +14 -0
  41. package/dist/src/components/search-results/SearchResultsDidYouMean.vue.d.ts +14 -0
  42. package/dist/src/components/search-results/SearchResultsTitle.vue.d.ts +30 -0
  43. package/dist/src/components/search-results/additional-panels/AdditionalPanel.vue.d.ts +23 -0
  44. package/dist/src/components/search-results/additional-panels/AdditionalPanels.vue.d.ts +31 -0
  45. package/dist/src/components/search-results/filters/CurrentFilterDisplay.vue.d.ts +16 -0
  46. package/dist/src/components/search-results/filters/CurrentFilters.vue.d.ts +22 -0
  47. package/dist/src/components/search-results/filters/FiltersTopDropdown.vue.d.ts +14 -0
  48. package/dist/src/components/search-results/filters/MobileFilterSidebar.vue.d.ts +14 -0
  49. package/dist/src/components/search-results/filters/SearchResultsFilters.vue.d.ts +22 -0
  50. package/dist/src/components/search-results/filters/facets/FacetDisplay.vue.d.ts +42 -0
  51. package/dist/src/components/search-results/filters/facets/FacetList.vue.d.ts +50 -0
  52. package/dist/src/components/search-results/filters/facets/Facets.vue.d.ts +30 -0
  53. package/dist/src/components/search-results/filters/facets/HierarchyFacet.vue.d.ts +33 -0
  54. package/dist/src/components/search-results/filters/facets/HierarchyFacetLevel.vue.d.ts +41 -0
  55. package/dist/src/components/search-results/filters/facets/StatsFacet.vue.d.ts +33 -0
  56. package/dist/src/components/search-results/filters/facets/TermFacet.vue.d.ts +33 -0
  57. package/dist/src/components/search-results/products/SearchResultsLayoutSelection.vue.d.ts +2 -0
  58. package/dist/src/components/search-results/products/SearchResultsMobileToggle.vue.d.ts +21 -0
  59. package/dist/src/components/search-results/products/SearchResultsProducts.vue.d.ts +14 -0
  60. package/dist/src/components/search-results/products/SearchResultsSummary.vue.d.ts +21 -0
  61. package/dist/src/components/search-results/products/SearchResultsToolbar.vue.d.ts +22 -0
  62. package/dist/src/components/search-results/products/pagination/SearchResultsPageSelect.vue.d.ts +30 -0
  63. package/dist/src/components/search-results/products/pagination/SearchResultsPageSize.vue.d.ts +22 -0
  64. package/dist/src/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +40 -0
  65. package/dist/src/components/search-results/products/product-card/badges/CustomBadge.vue.d.ts +14 -0
  66. package/dist/src/components/search-results/products/product-card/badges/ImageBadge.vue.d.ts +14 -0
  67. package/dist/src/components/search-results/products/product-card/badges/SearchResultGeneratedBadges.vue.d.ts +14 -0
  68. package/dist/src/components/search-results/products/product-card/badges/SearchResultsBadgeWrapper.vue.d.ts +22 -0
  69. package/dist/src/components/search-results/products/product-card/badges/TextBadge.vue.d.ts +14 -0
  70. package/dist/src/components/search-results/products/product-card/elements/SearchResultsProductAddToCart.vue.d.ts +33 -0
  71. package/dist/src/components/search-results/products/product-card/elements/SearchResultsProductCardElement.vue.d.ts +50 -0
  72. package/dist/src/components/search-results/products/product-card/elements/SearchResultsProductCustom.vue.d.ts +23 -0
  73. package/dist/src/components/search-results/products/product-card/elements/SearchResultsProductDescription.vue.d.ts +23 -0
  74. package/dist/src/components/search-results/products/product-card/elements/SearchResultsProductImage.vue.d.ts +23 -0
  75. package/dist/src/components/search-results/products/product-card/elements/SearchResultsProductPrice.vue.d.ts +32 -0
  76. package/dist/src/components/search-results/products/product-card/elements/SearchResultsProductRating.vue.d.ts +23 -0
  77. package/dist/src/components/search-results/products/product-card/elements/SearchResultsProductRegularPrice.vue.d.ts +32 -0
  78. package/dist/src/components/search-results/products/product-card/elements/SearchResultsProductSingleStarRating.vue.d.ts +23 -0
  79. package/dist/src/components/search-results/products/product-card/elements/SearchResultsProductTitle.vue.d.ts +31 -0
  80. package/dist/src/components/search-results/products/product-card/elements/custom/SearchResultsProductCustomHtmlElement.vue.d.ts +23 -0
  81. package/dist/src/components/search-results/products/similar-queries/SearchResultsSimilarQueries.vue.d.ts +31 -0
  82. package/dist/src/components/search-results/products/similar-queries/SimilarQueryText.vue.d.ts +22 -0
  83. package/dist/src/components/search-results/products/sort/SearchResultsSort.vue.d.ts +14 -0
  84. package/dist/src/constants/global.const.d.ts +17 -0
  85. package/dist/src/constants/queryParams.const.d.ts +26 -0
  86. package/dist/src/constants/searchBox.const.d.ts +48 -0
  87. package/dist/src/constants/searchResults.const.d.ts +107 -0
  88. package/dist/src/index.d.ts +21 -0
  89. package/dist/src/stores/dynamicData.d.ts +24 -0
  90. package/dist/src/stores/history.d.ts +31 -0
  91. package/dist/src/stores/options.d.ts +75 -0
  92. package/dist/src/stores/params.d.ts +124 -0
  93. package/dist/src/stores/screen.d.ts +22 -0
  94. package/dist/src/stores/searchBox.d.ts +204 -0
  95. package/dist/src/stores/searchResult.d.ts +125 -0
  96. package/dist/src/stores/tracking.d.ts +46 -0
  97. package/dist/src/types/AnalyticsOptions.d.ts +14 -0
  98. package/dist/src/types/DocumentElement.d.ts +91 -0
  99. package/dist/src/types/General.d.ts +20 -0
  100. package/dist/src/types/product-list/ProductListOptions.d.ts +29 -0
  101. package/dist/src/types/recommendations/RecommendationsOptions.d.ts +26 -0
  102. package/dist/src/types/search-box/Common.d.ts +51 -0
  103. package/dist/src/types/search-box/SearchBoxHistory.d.ts +6 -0
  104. package/dist/src/types/search-box/SearchBoxOptions.d.ts +36 -0
  105. package/dist/src/types/search-box/SearchBoxPanel.d.ts +28 -0
  106. package/dist/src/types/search-container/SearchContainerOptions.d.ts +15 -0
  107. package/dist/src/types/search-results/BadgeOptions.d.ts +61 -0
  108. package/dist/src/types/search-results/FacetAction.d.ts +16 -0
  109. package/dist/src/types/search-results/Filters.d.ts +9 -0
  110. package/dist/src/types/search-results/PaginationOptions.d.ts +20 -0
  111. package/dist/src/types/search-results/QueryParams.d.ts +4 -0
  112. package/dist/src/types/search-results/ResultsLayout.d.ts +5 -0
  113. package/dist/src/types/search-results/RoutingBehavior.d.ts +1 -0
  114. package/dist/src/types/search-results/SearchResultsAdditionalPanelOptions.d.ts +16 -0
  115. package/dist/src/types/search-results/SearchResultsOptions.d.ts +177 -0
  116. package/dist/src/types/search-results/SearchResultsPagination.d.ts +21 -0
  117. package/dist/src/types/search-results/SearchResultsProductCardOptions.d.ts +24 -0
  118. package/dist/src/types/search-results/SearchResultsSort.d.ts +11 -0
  119. package/dist/src/utils/debounce.utils.d.ts +1 -0
  120. package/dist/src/utils/document.utils.d.ts +1 -0
  121. package/dist/src/utils/event.utils.d.ts +2 -0
  122. package/dist/src/utils/filter.toggle.utils.d.ts +23 -0
  123. package/dist/src/utils/filter.utils.d.ts +11 -0
  124. package/dist/src/utils/history.utils.d.ts +2 -0
  125. package/dist/src/utils/link.utils.d.ts +6 -0
  126. package/dist/src/utils/params.utils.d.ts +9 -0
  127. package/dist/src/utils/picker.utils.d.ts +5 -0
  128. package/dist/src/utils/price.utils.d.ts +2 -0
  129. package/dist/src/utils/query.utils.d.ts +5 -0
  130. package/dist/src/utils/routing.utils.d.ts +6 -0
  131. package/dist/src/utils/scroll.utils.d.ts +4 -0
  132. package/dist/src/utils/string.utils.d.ts +9 -0
  133. package/dist/src/utils/suggestion.utils.d.ts +3 -0
  134. package/dist/src/utils/tracking.utils.d.ts +15 -0
  135. package/dist/style.css +1 -0
  136. package/dist/style.js +1 -0
  137. package/env.d.ts +1 -0
  138. package/index.html +13 -0
  139. package/package.json +62 -0
  140. package/tsconfig.app.json +18 -0
  141. package/tsconfig.node.json +15 -0
  142. package/vite.config.ts +35 -0
@@ -0,0 +1,204 @@
1
+ import { type Ref } from 'vue';
2
+ import { type PublicQuery, type SearchQueryResult } from '@getlupa/client-sdk/Types';
3
+ import type { SearchBoxOptions } from '../types/search-box/SearchBoxOptions';
4
+ import type { DisplaySuggestion } from '../types/search-box/Common';
5
+ import type { SdkOptions } from '../types/General';
6
+ export declare const useSearchBoxStore: import("pinia").StoreDefinition<"searchBox", import("pinia")._UnwrapAll<Pick<{
7
+ options: Ref<SearchBoxOptions>;
8
+ docResults: Ref<Record<string, SearchQueryResult>>;
9
+ suggestionResults: Ref<Record<string, DisplaySuggestion[]>>;
10
+ highlightedIndex: Ref<number>;
11
+ inputValue: Ref<string>;
12
+ resultsVisible: import("vue").ComputedRef<boolean>;
13
+ panelItemCounts: import("vue").ComputedRef<({
14
+ queryKey: string;
15
+ count: number;
16
+ panel: import('../types/search-box/SearchBoxPanel').SuggestionSearchBoxPanel;
17
+ } | {
18
+ queryKey: string;
19
+ count: number;
20
+ panel: import('../types/search-box/SearchBoxPanel').DocumentSearchBoxPanel;
21
+ })[]>;
22
+ totalCount: import("vue").ComputedRef<number>;
23
+ highlightedItem: import("vue").ComputedRef<{
24
+ queryKey: string;
25
+ index: number;
26
+ panel: import('../types/search-box/SearchBoxPanel').DocumentSearchBoxPanel | import('../types/search-box/SearchBoxPanel').SuggestionSearchBoxPanel;
27
+ }>;
28
+ highlightedDocument: import("vue").ComputedRef<{
29
+ doc: any;
30
+ link?: undefined;
31
+ queryKey?: undefined;
32
+ id?: undefined;
33
+ title?: undefined;
34
+ } | {
35
+ doc: import("@getlupa/client-sdk/Types").Document;
36
+ link: string;
37
+ queryKey: string;
38
+ id: unknown;
39
+ title: string;
40
+ }>;
41
+ querySuggestions: ({ queryKey, publicQuery, options }: {
42
+ queryKey: string;
43
+ publicQuery: PublicQuery;
44
+ options?: SdkOptions;
45
+ }) => Promise<{
46
+ suggestions: import("@getlupa/client-sdk/Types").Suggestion[];
47
+ }>;
48
+ queryDocuments: ({ queryKey, publicQuery, options }: {
49
+ queryKey: string;
50
+ publicQuery: PublicQuery;
51
+ options?: SdkOptions;
52
+ }) => Promise<{
53
+ queryKey: string;
54
+ result: {
55
+ items: any[];
56
+ };
57
+ } | {
58
+ queryKey: string;
59
+ result: SearchQueryResult;
60
+ }>;
61
+ highlightChange: ({ action }: {
62
+ action: 'down' | 'up' | 'clear';
63
+ }) => {
64
+ highlightIndex: number;
65
+ };
66
+ saveInputValue: ({ input }: {
67
+ input: string;
68
+ }) => void;
69
+ saveOptions: ({ newOptions }: {
70
+ newOptions: SearchBoxOptions;
71
+ }) => void;
72
+ }, "options" | "docResults" | "suggestionResults" | "highlightedIndex" | "inputValue">>, Pick<{
73
+ options: Ref<SearchBoxOptions>;
74
+ docResults: Ref<Record<string, SearchQueryResult>>;
75
+ suggestionResults: Ref<Record<string, DisplaySuggestion[]>>;
76
+ highlightedIndex: Ref<number>;
77
+ inputValue: Ref<string>;
78
+ resultsVisible: import("vue").ComputedRef<boolean>;
79
+ panelItemCounts: import("vue").ComputedRef<({
80
+ queryKey: string;
81
+ count: number;
82
+ panel: import('../types/search-box/SearchBoxPanel').SuggestionSearchBoxPanel;
83
+ } | {
84
+ queryKey: string;
85
+ count: number;
86
+ panel: import('../types/search-box/SearchBoxPanel').DocumentSearchBoxPanel;
87
+ })[]>;
88
+ totalCount: import("vue").ComputedRef<number>;
89
+ highlightedItem: import("vue").ComputedRef<{
90
+ queryKey: string;
91
+ index: number;
92
+ panel: import('../types/search-box/SearchBoxPanel').DocumentSearchBoxPanel | import('../types/search-box/SearchBoxPanel').SuggestionSearchBoxPanel;
93
+ }>;
94
+ highlightedDocument: import("vue").ComputedRef<{
95
+ doc: any;
96
+ link?: undefined;
97
+ queryKey?: undefined;
98
+ id?: undefined;
99
+ title?: undefined;
100
+ } | {
101
+ doc: import("@getlupa/client-sdk/Types").Document;
102
+ link: string;
103
+ queryKey: string;
104
+ id: unknown;
105
+ title: string;
106
+ }>;
107
+ querySuggestions: ({ queryKey, publicQuery, options }: {
108
+ queryKey: string;
109
+ publicQuery: PublicQuery;
110
+ options?: SdkOptions;
111
+ }) => Promise<{
112
+ suggestions: import("@getlupa/client-sdk/Types").Suggestion[];
113
+ }>;
114
+ queryDocuments: ({ queryKey, publicQuery, options }: {
115
+ queryKey: string;
116
+ publicQuery: PublicQuery;
117
+ options?: SdkOptions;
118
+ }) => Promise<{
119
+ queryKey: string;
120
+ result: {
121
+ items: any[];
122
+ };
123
+ } | {
124
+ queryKey: string;
125
+ result: SearchQueryResult;
126
+ }>;
127
+ highlightChange: ({ action }: {
128
+ action: 'down' | 'up' | 'clear';
129
+ }) => {
130
+ highlightIndex: number;
131
+ };
132
+ saveInputValue: ({ input }: {
133
+ input: string;
134
+ }) => void;
135
+ saveOptions: ({ newOptions }: {
136
+ newOptions: SearchBoxOptions;
137
+ }) => void;
138
+ }, "totalCount" | "resultsVisible" | "panelItemCounts" | "highlightedItem" | "highlightedDocument">, Pick<{
139
+ options: Ref<SearchBoxOptions>;
140
+ docResults: Ref<Record<string, SearchQueryResult>>;
141
+ suggestionResults: Ref<Record<string, DisplaySuggestion[]>>;
142
+ highlightedIndex: Ref<number>;
143
+ inputValue: Ref<string>;
144
+ resultsVisible: import("vue").ComputedRef<boolean>;
145
+ panelItemCounts: import("vue").ComputedRef<({
146
+ queryKey: string;
147
+ count: number;
148
+ panel: import('../types/search-box/SearchBoxPanel').SuggestionSearchBoxPanel;
149
+ } | {
150
+ queryKey: string;
151
+ count: number;
152
+ panel: import('../types/search-box/SearchBoxPanel').DocumentSearchBoxPanel;
153
+ })[]>;
154
+ totalCount: import("vue").ComputedRef<number>;
155
+ highlightedItem: import("vue").ComputedRef<{
156
+ queryKey: string;
157
+ index: number;
158
+ panel: import('../types/search-box/SearchBoxPanel').DocumentSearchBoxPanel | import('../types/search-box/SearchBoxPanel').SuggestionSearchBoxPanel;
159
+ }>;
160
+ highlightedDocument: import("vue").ComputedRef<{
161
+ doc: any;
162
+ link?: undefined;
163
+ queryKey?: undefined;
164
+ id?: undefined;
165
+ title?: undefined;
166
+ } | {
167
+ doc: import("@getlupa/client-sdk/Types").Document;
168
+ link: string;
169
+ queryKey: string;
170
+ id: unknown;
171
+ title: string;
172
+ }>;
173
+ querySuggestions: ({ queryKey, publicQuery, options }: {
174
+ queryKey: string;
175
+ publicQuery: PublicQuery;
176
+ options?: SdkOptions;
177
+ }) => Promise<{
178
+ suggestions: import("@getlupa/client-sdk/Types").Suggestion[];
179
+ }>;
180
+ queryDocuments: ({ queryKey, publicQuery, options }: {
181
+ queryKey: string;
182
+ publicQuery: PublicQuery;
183
+ options?: SdkOptions;
184
+ }) => Promise<{
185
+ queryKey: string;
186
+ result: {
187
+ items: any[];
188
+ };
189
+ } | {
190
+ queryKey: string;
191
+ result: SearchQueryResult;
192
+ }>;
193
+ highlightChange: ({ action }: {
194
+ action: 'down' | 'up' | 'clear';
195
+ }) => {
196
+ highlightIndex: number;
197
+ };
198
+ saveInputValue: ({ input }: {
199
+ input: string;
200
+ }) => void;
201
+ saveOptions: ({ newOptions }: {
202
+ newOptions: SearchBoxOptions;
203
+ }) => void;
204
+ }, "querySuggestions" | "queryDocuments" | "highlightChange" | "saveInputValue" | "saveOptions">>;
@@ -0,0 +1,125 @@
1
+ import { type Ref } from 'vue';
2
+ import type { SearchQueryResult } from '@getlupa/client-sdk/Types';
3
+ import { ResultsLayoutEnum, type ResultsLayout } from '../types/search-results/ResultsLayout';
4
+ import type { ProductGrid } from '../types/search-results/SearchResultsOptions';
5
+ export declare const useSearchResultStore: import("pinia").StoreDefinition<"searchResult", import("pinia")._UnwrapAll<Pick<{
6
+ isMobileSidebarVisible: Ref<boolean>;
7
+ searchResult: Ref<SearchQueryResult>;
8
+ columnCount: Ref<number>;
9
+ addToCartAmount: Ref<number>;
10
+ facets: import("vue").ComputedRef<import("@getlupa/client-sdk/Types").FacetResult[]>;
11
+ filters: import("vue").ComputedRef<import("@getlupa/client-sdk/Types").FilterGroup>;
12
+ loading: Ref<boolean>;
13
+ layout: Ref<ResultsLayoutEnum>;
14
+ currentQueryText: import("vue").ComputedRef<string>;
15
+ totalItems: import("vue").ComputedRef<number>;
16
+ hasResults: import("vue").ComputedRef<boolean>;
17
+ labeledFilters: import("vue").ComputedRef<import("../types/search-results/Filters").LabeledFilter[]>;
18
+ displayFilters: import("vue").ComputedRef<import("../types/search-results/Filters").LabeledFilter[]>;
19
+ currentFilterCount: import("vue").ComputedRef<number>;
20
+ currentFilterKeys: import("vue").ComputedRef<string[]>;
21
+ hasAnyFilter: import("vue").ComputedRef<boolean>;
22
+ itemRange: import("vue").ComputedRef<number[]>;
23
+ isPageEmpty: import("vue").ComputedRef<boolean>;
24
+ setSidebarState: ({ visible }: {
25
+ visible: boolean;
26
+ }) => void;
27
+ queryFacet: ({ queryKey, facetKey }: {
28
+ queryKey: string;
29
+ facetKey: string;
30
+ }) => Promise<void>;
31
+ add: (newSearchResult: SearchQueryResult) => {
32
+ searchResult: SearchQueryResult;
33
+ pageSize: number;
34
+ } | {
35
+ searchResult: SearchQueryResult;
36
+ pageSize?: undefined;
37
+ };
38
+ setColumnCount: ({ width, grid }: {
39
+ width: number;
40
+ grid: ProductGrid;
41
+ }) => void;
42
+ setAddToCartAmount: (newAddToCartAmount: number) => void;
43
+ setLayout: (newLayout: ResultsLayout) => void;
44
+ setLoading: (state: boolean) => void;
45
+ }, "loading" | "searchResult" | "isMobileSidebarVisible" | "columnCount" | "addToCartAmount" | "layout">>, Pick<{
46
+ isMobileSidebarVisible: Ref<boolean>;
47
+ searchResult: Ref<SearchQueryResult>;
48
+ columnCount: Ref<number>;
49
+ addToCartAmount: Ref<number>;
50
+ facets: import("vue").ComputedRef<import("@getlupa/client-sdk/Types").FacetResult[]>;
51
+ filters: import("vue").ComputedRef<import("@getlupa/client-sdk/Types").FilterGroup>;
52
+ loading: Ref<boolean>;
53
+ layout: Ref<ResultsLayoutEnum>;
54
+ currentQueryText: import("vue").ComputedRef<string>;
55
+ totalItems: import("vue").ComputedRef<number>;
56
+ hasResults: import("vue").ComputedRef<boolean>;
57
+ labeledFilters: import("vue").ComputedRef<import("../types/search-results/Filters").LabeledFilter[]>;
58
+ displayFilters: import("vue").ComputedRef<import("../types/search-results/Filters").LabeledFilter[]>;
59
+ currentFilterCount: import("vue").ComputedRef<number>;
60
+ currentFilterKeys: import("vue").ComputedRef<string[]>;
61
+ hasAnyFilter: import("vue").ComputedRef<boolean>;
62
+ itemRange: import("vue").ComputedRef<number[]>;
63
+ isPageEmpty: import("vue").ComputedRef<boolean>;
64
+ setSidebarState: ({ visible }: {
65
+ visible: boolean;
66
+ }) => void;
67
+ queryFacet: ({ queryKey, facetKey }: {
68
+ queryKey: string;
69
+ facetKey: string;
70
+ }) => Promise<void>;
71
+ add: (newSearchResult: SearchQueryResult) => {
72
+ searchResult: SearchQueryResult;
73
+ pageSize: number;
74
+ } | {
75
+ searchResult: SearchQueryResult;
76
+ pageSize?: undefined;
77
+ };
78
+ setColumnCount: ({ width, grid }: {
79
+ width: number;
80
+ grid: ProductGrid;
81
+ }) => void;
82
+ setAddToCartAmount: (newAddToCartAmount: number) => void;
83
+ setLayout: (newLayout: ResultsLayout) => void;
84
+ setLoading: (state: boolean) => void;
85
+ }, "filters" | "facets" | "currentQueryText" | "totalItems" | "hasResults" | "labeledFilters" | "displayFilters" | "currentFilterCount" | "currentFilterKeys" | "hasAnyFilter" | "itemRange" | "isPageEmpty">, Pick<{
86
+ isMobileSidebarVisible: Ref<boolean>;
87
+ searchResult: Ref<SearchQueryResult>;
88
+ columnCount: Ref<number>;
89
+ addToCartAmount: Ref<number>;
90
+ facets: import("vue").ComputedRef<import("@getlupa/client-sdk/Types").FacetResult[]>;
91
+ filters: import("vue").ComputedRef<import("@getlupa/client-sdk/Types").FilterGroup>;
92
+ loading: Ref<boolean>;
93
+ layout: Ref<ResultsLayoutEnum>;
94
+ currentQueryText: import("vue").ComputedRef<string>;
95
+ totalItems: import("vue").ComputedRef<number>;
96
+ hasResults: import("vue").ComputedRef<boolean>;
97
+ labeledFilters: import("vue").ComputedRef<import("../types/search-results/Filters").LabeledFilter[]>;
98
+ displayFilters: import("vue").ComputedRef<import("../types/search-results/Filters").LabeledFilter[]>;
99
+ currentFilterCount: import("vue").ComputedRef<number>;
100
+ currentFilterKeys: import("vue").ComputedRef<string[]>;
101
+ hasAnyFilter: import("vue").ComputedRef<boolean>;
102
+ itemRange: import("vue").ComputedRef<number[]>;
103
+ isPageEmpty: import("vue").ComputedRef<boolean>;
104
+ setSidebarState: ({ visible }: {
105
+ visible: boolean;
106
+ }) => void;
107
+ queryFacet: ({ queryKey, facetKey }: {
108
+ queryKey: string;
109
+ facetKey: string;
110
+ }) => Promise<void>;
111
+ add: (newSearchResult: SearchQueryResult) => {
112
+ searchResult: SearchQueryResult;
113
+ pageSize: number;
114
+ } | {
115
+ searchResult: SearchQueryResult;
116
+ pageSize?: undefined;
117
+ };
118
+ setColumnCount: ({ width, grid }: {
119
+ width: number;
120
+ grid: ProductGrid;
121
+ }) => void;
122
+ setAddToCartAmount: (newAddToCartAmount: number) => void;
123
+ setLayout: (newLayout: ResultsLayout) => void;
124
+ setLoading: (state: boolean) => void;
125
+ }, "add" | "setSidebarState" | "queryFacet" | "setColumnCount" | "setAddToCartAmount" | "setLayout" | "setLoading">>;
@@ -0,0 +1,46 @@
1
+ import type { AnalyticsEventType } from '../types/AnalyticsOptions';
2
+ import type { TrackableEventData } from '../types/search-box/Common';
3
+ import type { PublicQuery, SearchQueryResult } from '@getlupa/client-sdk/Types';
4
+ export declare const useTrackingStore: import("pinia").StoreDefinition<"tracking", import("pinia")._UnwrapAll<Pick<{
5
+ trackSearch: ({ queryKey, query, type }: {
6
+ queryKey: string;
7
+ query: PublicQuery;
8
+ type?: AnalyticsEventType;
9
+ }) => void;
10
+ trackResults: ({ queryKey, results }: {
11
+ queryKey: string;
12
+ results: SearchQueryResult;
13
+ }) => void;
14
+ trackEvent: ({ queryKey, data }: {
15
+ queryKey: string;
16
+ data: TrackableEventData;
17
+ }) => void;
18
+ }, never>>, Pick<{
19
+ trackSearch: ({ queryKey, query, type }: {
20
+ queryKey: string;
21
+ query: PublicQuery;
22
+ type?: AnalyticsEventType;
23
+ }) => void;
24
+ trackResults: ({ queryKey, results }: {
25
+ queryKey: string;
26
+ results: SearchQueryResult;
27
+ }) => void;
28
+ trackEvent: ({ queryKey, data }: {
29
+ queryKey: string;
30
+ data: TrackableEventData;
31
+ }) => void;
32
+ }, never>, Pick<{
33
+ trackSearch: ({ queryKey, query, type }: {
34
+ queryKey: string;
35
+ query: PublicQuery;
36
+ type?: AnalyticsEventType;
37
+ }) => void;
38
+ trackResults: ({ queryKey, results }: {
39
+ queryKey: string;
40
+ results: SearchQueryResult;
41
+ }) => void;
42
+ trackEvent: ({ queryKey, data }: {
43
+ queryKey: string;
44
+ data: TrackableEventData;
45
+ }) => void;
46
+ }, "trackSearch" | "trackResults" | "trackEvent">>;
@@ -0,0 +1,14 @@
1
+ export declare const PARENT_EVENT_NAME = "GetLupa";
2
+ export 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
+ export type AnalyticsOptions = {
4
+ type: 'ua' | 'ga4' | 'debug';
5
+ enabled: boolean;
6
+ parentEventName: string;
7
+ ignoreEvents?: AnalyticsEventType[];
8
+ itemMap?: (item: Record<string, unknown>) => Record<string, unknown>;
9
+ };
10
+ export type ProductClickTrackingSettings = {
11
+ eventType?: AnalyticsEventType;
12
+ eventLabel?: string;
13
+ listLabel?: string;
14
+ };
@@ -0,0 +1,91 @@
1
+ export declare enum DocumentElementType {
2
+ IMAGE = "image",
3
+ TITLE = "title",
4
+ CUSTOM = "custom",
5
+ DESCRIPTION = "description",
6
+ PRICE = "price",
7
+ REGULARPRICE = "regularPrice",
8
+ RATING = "rating",
9
+ SINGLE_STAR_RATING = "singleStarRating",
10
+ ADDTOCART = "addToCart",
11
+ CUSTOM_HTML = "customHtml"
12
+ }
13
+ export type DocumentElementBase<T = any> = {
14
+ type: DocumentElementType;
15
+ key?: string;
16
+ display?: (document: T) => boolean;
17
+ isHtml?: boolean;
18
+ group?: string;
19
+ dynamic?: boolean;
20
+ };
21
+ export type ImageDocumentElement<T = any> = DocumentElementBase<T> & {
22
+ type: DocumentElementType.IMAGE;
23
+ placeholder: string;
24
+ baseUrl?: string;
25
+ key: string;
26
+ customUrl?: (document: T) => string;
27
+ };
28
+ export type TitleDocumentElement<T = any> = DocumentElementBase<T> & {
29
+ type: DocumentElementType.TITLE;
30
+ maxLines: number;
31
+ link?: boolean;
32
+ key: string;
33
+ };
34
+ export type DescriptionDocumentElement<T = any> = DocumentElementBase<T> & {
35
+ type: DocumentElementType.DESCRIPTION;
36
+ maxLines: number;
37
+ key: string;
38
+ className: string;
39
+ };
40
+ export type CustomDocumentElement<T = any> = DocumentElementBase<T> & {
41
+ type: DocumentElementType.CUSTOM;
42
+ maxLines?: number;
43
+ className: string;
44
+ key: string;
45
+ label?: string;
46
+ action?: (document: T) => Promise<unknown> | undefined;
47
+ };
48
+ export type PriceElement<T = any> = DocumentElementBase<T> & {
49
+ type: DocumentElementType.PRICE;
50
+ key: string;
51
+ };
52
+ export type RegularPriceDocumentElement<T = any> = DocumentElementBase<T> & {
53
+ type: DocumentElementType.REGULARPRICE;
54
+ key: string;
55
+ };
56
+ export type RatingElement<T = any> = DocumentElementBase<T> & {
57
+ type: DocumentElementType.RATING;
58
+ labels: RatingLabels;
59
+ links: RatingLinks;
60
+ totalKey: string;
61
+ getRatingPercentage?: (doc: T) => number;
62
+ key: string;
63
+ };
64
+ export type SingleStarRatingElement<T = any> = DocumentElementBase<T> & {
65
+ type: DocumentElementType.SINGLE_STAR_RATING;
66
+ labels: RatingLabels;
67
+ links: RatingLinks;
68
+ key: string;
69
+ totalKey: string;
70
+ displayRating: (doc: T) => string;
71
+ };
72
+ export type RatingLabels = {
73
+ numberOfRatings: string;
74
+ };
75
+ export type RatingLinks = {
76
+ ratingDetails?: string;
77
+ };
78
+ export type AddToCartElement<T = any> = DocumentElementBase<T> & {
79
+ type: DocumentElementType.ADDTOCART;
80
+ action: (document: T, amount: number) => Promise<unknown> | undefined;
81
+ labels: {
82
+ addToCart: string;
83
+ };
84
+ };
85
+ export type CustomHtmlElement<T = any> = DocumentElementBase<T> & {
86
+ type: DocumentElementType.CUSTOM_HTML;
87
+ html: (document: T) => string;
88
+ className: string;
89
+ action?: (document: T) => Promise<unknown> | undefined;
90
+ };
91
+ export type DocumentElement = ImageDocumentElement | TitleDocumentElement | DescriptionDocumentElement | CustomDocumentElement | PriceElement | RegularPriceDocumentElement | RatingElement | SingleStarRatingElement | AddToCartElement | CustomHtmlElement;
@@ -0,0 +1,20 @@
1
+ import type { AnalyticsOptions } from './AnalyticsOptions';
2
+ import type { Environment as SdkEnvironment } from '@getlupa/client-sdk/Types';
3
+ export type SdkOptions = {
4
+ environment: SdkEnvironment;
5
+ customBaseUrl?: string;
6
+ customUrl?: string;
7
+ customPayload?: Record<string, unknown>;
8
+ customHeaders?: Record<string, string>;
9
+ onError?: (err: unknown) => unknown;
10
+ };
11
+ export type TrackingOptions = {
12
+ trackBase?: boolean;
13
+ trackSession?: boolean;
14
+ trackUser?: boolean;
15
+ userKey?: string;
16
+ analytics?: AnalyticsOptions;
17
+ };
18
+ export type Environment = SdkEnvironment;
19
+ export type SortDirection = 'asc' | 'desc';
20
+ export type ScreenSize = 'xs' | 'sm' | 'md' | 'l' | 'xl';
@@ -0,0 +1,29 @@
1
+ import type { FilterGroup } from '@getlupa/client-sdk/Types';
2
+ import type { RoutingBehavior } from '../search-results/RoutingBehavior';
3
+ import type { SearchResultsOptions } from '../search-results/SearchResultsOptions';
4
+ export type CategoryFilterOptions = {
5
+ queryKey?: string;
6
+ routingBehavior?: RoutingBehavior;
7
+ keys: {
8
+ titleKey?: string;
9
+ urlKey?: string;
10
+ };
11
+ filters?: Record<string, string[]>;
12
+ back?: {
13
+ url: string;
14
+ title: string;
15
+ };
16
+ parent?: {
17
+ url?: string;
18
+ title?: string;
19
+ };
20
+ current?: {
21
+ title?: string;
22
+ description?: string;
23
+ descriptionTop?: string;
24
+ };
25
+ };
26
+ export type ProductListOptions = SearchResultsOptions & {
27
+ initialFilters?: FilterGroup;
28
+ categories?: CategoryFilterOptions;
29
+ };
@@ -0,0 +1,26 @@
1
+ import type { SdkOptions } from '../General';
2
+ import type { SearchResultsProductCardOptions } from '../search-results/SearchResultsProductCardOptions';
3
+ export type RecommenderCarouselOptions = {
4
+ itemsToShow?: number;
5
+ snapAlign?: string;
6
+ scrollPerPage?: number;
7
+ breakpoints?: Record<number, RecommenderCarouselOptions>;
8
+ };
9
+ export type ProductRecommendationOptions = SearchResultsProductCardOptions & {
10
+ options: SdkOptions;
11
+ } & {
12
+ containerSelector: string;
13
+ queryKey: string;
14
+ itemId: string;
15
+ abTesting?: RecommendationABTestingOptions;
16
+ carousel?: RecommenderCarouselOptions;
17
+ };
18
+ export type RecommendationABTestingOptions = {
19
+ enabled: boolean;
20
+ originalIds?: string[];
21
+ events?: {
22
+ lupaSearchEventName: string;
23
+ originalEventName: string;
24
+ };
25
+ oldRecommenderDisplayRatio?: number;
26
+ };
@@ -0,0 +1,51 @@
1
+ import type { Document, Suggestion, ReportableEventType } from '@getlupa/client-sdk/Types';
2
+ import type { AnalyticsEventType } from '../AnalyticsOptions';
3
+ import type { SearchBoxPanelType } from './SearchBoxPanel';
4
+ export type FetchedData = {
5
+ items: Document[] | Suggestion[];
6
+ type: SearchBoxPanelType;
7
+ };
8
+ export type InputSuggestion = {
9
+ item: Suggestion;
10
+ queryKey: string;
11
+ override: boolean;
12
+ facet?: InputSuggestionFacet;
13
+ };
14
+ export type InputSuggestionFacet = {
15
+ label?: string;
16
+ count?: number;
17
+ key: string;
18
+ title: string;
19
+ };
20
+ export type DisplaySuggestion = {
21
+ suggestion: Suggestion;
22
+ display: string;
23
+ displayHighlight: string;
24
+ facet?: InputSuggestionFacet;
25
+ };
26
+ export type SelectedData = {
27
+ item: Document | InputSuggestion;
28
+ type: SearchBoxPanelType;
29
+ };
30
+ export type TrackableEventData = {
31
+ type?: ReportableEventType;
32
+ searchQuery?: string;
33
+ itemId?: string;
34
+ analytics?: {
35
+ type: AnalyticsEventType;
36
+ label: string;
37
+ listLabel?: string;
38
+ items?: Record<string, unknown>[];
39
+ itemId?: string;
40
+ };
41
+ options?: {
42
+ allowEmptySearchQuery: boolean;
43
+ };
44
+ };
45
+ export type HighlightedDocInfo = {
46
+ doc?: Document;
47
+ link?: string;
48
+ queryKey?: string;
49
+ id?: unknown;
50
+ title?: string;
51
+ };
@@ -0,0 +1,6 @@
1
+ export type SearchBoxHistory = {
2
+ labels: HistoryLabel;
3
+ };
4
+ export type HistoryLabel = {
5
+ clear: string;
6
+ };
@@ -0,0 +1,36 @@
1
+ import type { SdkOptions } from '../General';
2
+ import type { RoutingBehavior } from '../search-results/RoutingBehavior';
3
+ import type { DynamicData } from '../search-results/SearchResultsOptions';
4
+ import type { SearchBoxHistory } from './SearchBoxHistory';
5
+ import type { SearchBoxPanel } from './SearchBoxPanel';
6
+ export type SearchBoxOptions = SearchBoxPanelOptions & {
7
+ inputSelector: string;
8
+ searchTriggers?: string[];
9
+ routingBehavior?: RoutingBehavior;
10
+ dynamicData?: DynamicData;
11
+ };
12
+ export type SearchBoxOptionLabels = {
13
+ placeholder: string;
14
+ noResults: string;
15
+ moreResults: string;
16
+ currency: string;
17
+ priceSeparator?: string;
18
+ defaultFacetLabel?: string;
19
+ close?: string;
20
+ };
21
+ export type SearchBoxOptionLinks = {
22
+ searchResults: string;
23
+ };
24
+ export type SearchBoxInputOptions = {
25
+ minInputLength: number;
26
+ labels: SearchBoxOptionLabels;
27
+ links: SearchBoxOptionLinks;
28
+ inputAttributes?: Record<string, string>;
29
+ };
30
+ export type SearchBoxPanelOptions = SearchBoxInputOptions & {
31
+ history: SearchBoxHistory;
32
+ panels: SearchBoxPanel[];
33
+ options: SdkOptions;
34
+ debounce?: number;
35
+ showTotalCount?: boolean;
36
+ };