@coveo/atomic 3.33.8-pre.52109a8c79 → 3.33.8-pre.5b06866794

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 (209) hide show
  1. package/dist/atomic/_atomic.esm.js +1 -1
  2. package/dist/atomic/atomic.esm.js.map +1 -1
  3. package/dist/atomic/components/_index.d.ts +2 -2
  4. package/dist/atomic/components/_index.js +3 -2
  5. package/dist/atomic/components/analytics-config.js +1 -1
  6. package/dist/atomic/components/atomic-insight-history-toggle.js +2 -2
  7. package/dist/atomic/components/atomic-insight-history-toggle.js.map +1 -1
  8. package/dist/atomic/components/atomic-insight-search-box.js +5 -33
  9. package/dist/atomic/components/atomic-insight-search-box.js.map +1 -1
  10. package/dist/atomic/components/atomic-insight-user-actions-toggle.js +2 -2
  11. package/dist/atomic/components/atomic-insight-user-actions-toggle.js.map +1 -1
  12. package/dist/atomic/components/atomic-search-box-instant-results.js +2 -2
  13. package/dist/atomic/components/atomic-search-box-instant-results.js.map +1 -1
  14. package/dist/atomic/components/atomic-search-box-query-suggestions.d.ts +11 -0
  15. package/dist/atomic/components/atomic-search-box-query-suggestions.js +8 -0
  16. package/dist/atomic/components/atomic-search-box-query-suggestions.js.map +1 -0
  17. package/dist/atomic/components/atomic-search-box-query-suggestions2.js +89 -0
  18. package/dist/atomic/components/atomic-search-box-query-suggestions2.js.map +1 -0
  19. package/dist/atomic/components/atomic-search-box.js +8 -9
  20. package/dist/atomic/components/atomic-search-box.js.map +1 -1
  21. package/dist/atomic/components/atomic-suggestion-renderer2.js +1 -1
  22. package/dist/atomic/components/atomic-suggestion-renderer2.js.map +1 -1
  23. package/dist/atomic/components/clock.js +2 -2
  24. package/dist/atomic/components/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.js +18 -11
  25. package/dist/atomic/components/components/commerce/atomic-commerce-interface/atomic-commerce-interface.js +2 -7
  26. package/dist/atomic/components/components/commerce/atomic-commerce-layout/atomic-commerce-layout.js +19 -10
  27. package/dist/atomic/components/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.js +1 -1
  28. package/dist/atomic/components/components/commerce/atomic-commerce-search-box-instant-products/atomic-commerce-search-box-instant-products.js +1 -1
  29. package/dist/atomic/components/components/commerce/atomic-commerce-search-box-query-suggestions/atomic-commerce-search-box-query-suggestions.js +1 -1
  30. package/dist/atomic/components/components/commerce/atomic-commerce-search-box-recent-queries/atomic-commerce-search-box-recent-queries.js +1 -1
  31. package/dist/atomic/components/components/common/layout/layout-styles-controller.js +40 -0
  32. package/dist/atomic/components/components/common/layout/mobile-breakpoint-controller.js +26 -0
  33. package/dist/atomic/components/components/common/suggestions/suggestion-manager.js +1 -1
  34. package/dist/atomic/components/components/common/suggestions/{suggestions-common.js → suggestions-events.js} +16 -18
  35. package/dist/atomic/components/components/common/suggestions/suggestions-types.js +1 -0
  36. package/dist/atomic/components/components/common/suggestions/suggestions-utils.js +18 -0
  37. package/dist/atomic/components/components/search/atomic-search-box-recent-queries/atomic-search-box-recent-queries.js +137 -0
  38. package/dist/atomic/components/components/search/index.js +1 -1
  39. package/dist/atomic/components/components/search/lazy-index.js +1 -1
  40. package/dist/atomic/components/global/environment.js +1 -1
  41. package/dist/atomic/components/index.js.map +1 -1
  42. package/dist/atomic/components/stencil-query-suggestions.js +33 -0
  43. package/dist/atomic/components/stencil-query-suggestions.js.map +1 -0
  44. package/dist/atomic/components/stencil-suggestion-manager.js +20 -2
  45. package/dist/atomic/components/stencil-suggestion-manager.js.map +1 -1
  46. package/dist/atomic/components/{suggestions-common.js → suggestions-events.js} +18 -20
  47. package/dist/atomic/components/suggestions-events.js.map +1 -0
  48. package/dist/atomic/index.esm.js +1 -1
  49. package/dist/atomic/index.esm.js.map +1 -1
  50. package/dist/atomic/{p-ab7c83d8.entry.js → p-03addf89.entry.js} +2 -2
  51. package/dist/atomic/p-0a051b8d.js +2 -0
  52. package/dist/atomic/p-0a051b8d.js.map +1 -0
  53. package/dist/atomic/p-16f4ce98.js +2 -0
  54. package/dist/atomic/p-16f4ce98.js.map +1 -0
  55. package/dist/atomic/p-26a51a77.entry.js +2 -0
  56. package/dist/atomic/p-26a51a77.entry.js.map +1 -0
  57. package/dist/atomic/p-2e9db4ca.entry.js +2 -0
  58. package/dist/atomic/p-2e9db4ca.entry.js.map +1 -0
  59. package/dist/atomic/{p-6b3c4d63.entry.js → p-3213157f.entry.js} +2 -2
  60. package/dist/atomic/p-4b7a19db.js +2 -0
  61. package/dist/atomic/p-4b7a19db.js.map +1 -0
  62. package/dist/atomic/{p-b5dd6399.entry.js → p-5210f9a9.entry.js} +2 -2
  63. package/dist/atomic/{p-6e6d686e.entry.js → p-7383fd32.entry.js} +2 -2
  64. package/dist/atomic/{p-3a53ad44.js → p-a2a9c37a.js} +2 -2
  65. package/dist/atomic/p-af93b44c.js +2 -0
  66. package/dist/atomic/p-af93b44c.js.map +1 -0
  67. package/dist/atomic/{p-6329ff94.entry.js → p-ba4bf29f.entry.js} +2 -2
  68. package/dist/atomic/{p-3d847e45.entry.js → p-c88a3d2d.entry.js} +2 -2
  69. package/dist/atomic/p-c88a3d2d.entry.js.map +1 -0
  70. package/dist/atomic/{p-36e71b99.entry.js → p-d0f47b33.entry.js} +2 -2
  71. package/dist/atomic/p-d0f47b33.entry.js.map +1 -0
  72. package/dist/atomic/{p-c280cd05.js → p-e1cc5150.js} +1 -1
  73. package/dist/atomic/{p-aa4224ea.entry.js → p-fbfe913d.entry.js} +2 -2
  74. package/dist/atomic/p-fbfe913d.entry.js.map +1 -0
  75. package/dist/cjs/_index.cjs.js +5 -2
  76. package/dist/cjs/_loader.cjs.js +1 -1
  77. package/dist/cjs/{analytics-config-41fc74af.js → analytics-config-9b1760f9.js} +2 -2
  78. package/dist/cjs/{analytics-config-41fc74af.js.map → analytics-config-9b1760f9.js.map} +1 -1
  79. package/dist/cjs/atomic-insight-history-toggle.cjs.entry.js +2 -2
  80. package/dist/cjs/atomic-insight-history-toggle.cjs.entry.js.map +1 -1
  81. package/dist/cjs/atomic-insight-interface.cjs.entry.js +1 -1
  82. package/dist/cjs/atomic-insight-search-box.cjs.entry.js +9 -35
  83. package/dist/cjs/atomic-insight-search-box.cjs.entry.js.map +1 -1
  84. package/dist/cjs/atomic-insight-user-actions-toggle.cjs.entry.js +2 -2
  85. package/dist/cjs/atomic-insight-user-actions-toggle.cjs.entry.js.map +1 -1
  86. package/dist/cjs/atomic-recs-interface.cjs.entry.js +1 -1
  87. package/dist/cjs/atomic-search-box-instant-results.cjs.entry.js +3 -3
  88. package/dist/cjs/atomic-search-box-instant-results.cjs.entry.js.map +1 -1
  89. package/dist/cjs/atomic-search-box-query-suggestions.cjs.entry.js +76 -0
  90. package/dist/cjs/atomic-search-box-query-suggestions.cjs.entry.js.map +1 -0
  91. package/dist/cjs/atomic-search-box.cjs.entry.js +7 -7
  92. package/dist/cjs/atomic-search-box.cjs.entry.js.map +1 -1
  93. package/dist/cjs/atomic-search-interface.cjs.entry.js +1 -1
  94. package/dist/cjs/atomic-suggestion-renderer.cjs.entry.js +1 -1
  95. package/dist/cjs/atomic-suggestion-renderer.cjs.entry.js.map +1 -1
  96. package/dist/cjs/atomic.cjs.js +1 -1
  97. package/dist/cjs/clock-7aeb19d0.js +7 -0
  98. package/dist/cjs/clock-7aeb19d0.js.map +1 -0
  99. package/dist/cjs/index-757bc886.js +2 -2
  100. package/dist/cjs/index.cjs.js.map +1 -1
  101. package/dist/cjs/stencil-query-suggestions-03268ecc.js +38 -0
  102. package/dist/cjs/stencil-query-suggestions-03268ecc.js.map +1 -0
  103. package/dist/cjs/{stencil-suggestion-manager-c0878ef2.js → stencil-suggestion-manager-2cba6d69.js} +4 -4
  104. package/dist/cjs/{stencil-suggestion-manager-c0878ef2.js.map → stencil-suggestion-manager-2cba6d69.js.map} +1 -1
  105. package/dist/cjs/{suggestions-common-5097a362.js → suggestions-events-63dd0640.js} +17 -21
  106. package/dist/cjs/suggestions-events-63dd0640.js.map +1 -0
  107. package/dist/cjs/suggestions-utils-61000808.js +25 -0
  108. package/dist/cjs/suggestions-utils-61000808.js.map +1 -0
  109. package/dist/cjs/version.cjs.js +2 -2
  110. package/dist/esm/_index.js +2 -1
  111. package/dist/esm/_loader.js +1 -1
  112. package/dist/esm/{analytics-config-c1cef549.js → analytics-config-43504b5c.js} +2 -2
  113. package/dist/esm/{analytics-config-c1cef549.js.map → analytics-config-43504b5c.js.map} +1 -1
  114. package/dist/esm/atomic-insight-history-toggle.entry.js +2 -2
  115. package/dist/esm/atomic-insight-history-toggle.entry.js.map +1 -1
  116. package/dist/esm/atomic-insight-interface.entry.js +1 -1
  117. package/dist/esm/atomic-insight-search-box.entry.js +7 -33
  118. package/dist/esm/atomic-insight-search-box.entry.js.map +1 -1
  119. package/dist/esm/atomic-insight-user-actions-toggle.entry.js +2 -2
  120. package/dist/esm/atomic-insight-user-actions-toggle.entry.js.map +1 -1
  121. package/dist/esm/atomic-recs-interface.entry.js +1 -1
  122. package/dist/esm/atomic-search-box-instant-results.entry.js +2 -2
  123. package/dist/esm/atomic-search-box-instant-results.entry.js.map +1 -1
  124. package/dist/esm/atomic-search-box-query-suggestions.entry.js +72 -0
  125. package/dist/esm/atomic-search-box-query-suggestions.entry.js.map +1 -0
  126. package/dist/esm/atomic-search-box.entry.js +6 -6
  127. package/dist/esm/atomic-search-box.entry.js.map +1 -1
  128. package/dist/esm/atomic-search-interface.entry.js +1 -1
  129. package/dist/esm/atomic-suggestion-renderer.entry.js +1 -1
  130. package/dist/esm/atomic-suggestion-renderer.entry.js.map +1 -1
  131. package/dist/esm/atomic.js +1 -1
  132. package/dist/esm/clock-b1f5d7f7.js +5 -0
  133. package/dist/esm/clock-b1f5d7f7.js.map +1 -0
  134. package/dist/esm/index-3f35faca.js +2 -2
  135. package/dist/esm/index.js.map +1 -1
  136. package/dist/esm/stencil-query-suggestions-5d6a46d7.js +33 -0
  137. package/dist/esm/stencil-query-suggestions-5d6a46d7.js.map +1 -0
  138. package/dist/esm/{stencil-suggestion-manager-486094dd.js → stencil-suggestion-manager-376f83e8.js} +2 -2
  139. package/dist/esm/{stencil-suggestion-manager-486094dd.js.map → stencil-suggestion-manager-376f83e8.js.map} +1 -1
  140. package/dist/esm/{suggestions-common-2b20db26.js → suggestions-events-b7a6f007.js} +18 -20
  141. package/dist/esm/suggestions-events-b7a6f007.js.map +1 -0
  142. package/dist/esm/suggestions-utils-591559a0.js +22 -0
  143. package/dist/esm/suggestions-utils-591559a0.js.map +1 -0
  144. package/dist/esm/version.js +2 -2
  145. package/dist/types/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.d.ts +2 -1
  146. package/dist/types/components/commerce/atomic-commerce-interface/atomic-commerce-interface.d.ts +0 -1
  147. package/dist/types/components/commerce/atomic-commerce-layout/atomic-commerce-layout.d.ts +3 -3
  148. package/dist/types/components/commerce/atomic-commerce-search-box-instant-products/atomic-commerce-search-box-instant-products.d.ts +1 -1
  149. package/dist/types/components/commerce/atomic-commerce-search-box-query-suggestions/atomic-commerce-search-box-query-suggestions.d.ts +1 -1
  150. package/dist/types/components/commerce/atomic-commerce-search-box-recent-queries/atomic-commerce-search-box-recent-queries.d.ts +1 -1
  151. package/dist/types/components/common/atomic-suggestion-renderer/atomic-suggestion-renderer.d.ts +1 -1
  152. package/dist/types/components/common/layout/layout-styles-controller.d.ts +22 -0
  153. package/dist/types/components/common/layout/mobile-breakpoint-controller.d.ts +18 -0
  154. package/dist/types/components/common/suggestions/instant-item.d.ts +1 -1
  155. package/dist/types/components/common/suggestions/query-suggestions.d.ts +1 -1
  156. package/dist/types/components/common/suggestions/recent-queries.d.ts +1 -1
  157. package/dist/types/components/common/suggestions/stencil-instant-item.d.ts +1 -1
  158. package/dist/types/components/common/suggestions/stencil-query-suggestions.d.ts +1 -1
  159. package/dist/types/components/common/suggestions/stencil-recent-queries.d.ts +1 -1
  160. package/dist/types/components/common/suggestions/stencil-suggestion-manager.d.ts +1 -1
  161. package/dist/types/components/common/suggestions/suggestion-manager.d.ts +1 -1
  162. package/dist/types/components/common/suggestions/suggestions-events.d.ts +14 -0
  163. package/dist/types/components/common/suggestions/{suggestions-common.d.ts → suggestions-types.d.ts} +6 -16
  164. package/dist/types/components/common/suggestions/suggestions-utils.d.ts +15 -0
  165. package/dist/types/components/search/atomic-search-box/atomic-search-box.d.ts +1 -1
  166. package/dist/types/components/search/{atomic-search-box-query-suggestions/atomic-search-box-query-suggestions.d.ts → atomic-search-box-recent-queries/atomic-search-box-recent-queries.d.ts} +15 -8
  167. package/dist/types/components/search/index.d.ts +1 -1
  168. package/dist/types/components/search/search-box-suggestions/atomic-search-box-instant-results/atomic-search-box-instant-results.d.ts +1 -1
  169. package/dist/types/components/search/search-box-suggestions/{atomic-search-box-recent-queries/atomic-search-box-recent-queries.d.ts → atomic-search-box-query-suggestions/atomic-search-box-query-suggestions.d.ts} +3 -11
  170. package/dist/types/components.d.ts +16 -16
  171. package/dist/types/decorators/types.d.ts +1 -1
  172. package/dist/types/index.d.ts +3 -1
  173. package/docs/atomic-docs.json +15 -13
  174. package/package.json +3 -3
  175. package/dist/atomic/components/atomic-search-box-recent-queries.d.ts +0 -11
  176. package/dist/atomic/components/atomic-search-box-recent-queries.js +0 -8
  177. package/dist/atomic/components/atomic-search-box-recent-queries.js.map +0 -1
  178. package/dist/atomic/components/atomic-search-box-recent-queries2.js +0 -183
  179. package/dist/atomic/components/atomic-search-box-recent-queries2.js.map +0 -1
  180. package/dist/atomic/components/components/search/atomic-search-box-query-suggestions/atomic-search-box-query-suggestions.js +0 -118
  181. package/dist/atomic/components/suggestions-common.js.map +0 -1
  182. package/dist/atomic/p-29fd6768.js +0 -2
  183. package/dist/atomic/p-29fd6768.js.map +0 -1
  184. package/dist/atomic/p-36e71b99.entry.js.map +0 -1
  185. package/dist/atomic/p-3d847e45.entry.js.map +0 -1
  186. package/dist/atomic/p-7601c3de.js +0 -2
  187. package/dist/atomic/p-7601c3de.js.map +0 -1
  188. package/dist/atomic/p-a1333787.entry.js +0 -2
  189. package/dist/atomic/p-a1333787.entry.js.map +0 -1
  190. package/dist/atomic/p-a468ba8e.entry.js +0 -2
  191. package/dist/atomic/p-a468ba8e.entry.js.map +0 -1
  192. package/dist/atomic/p-aa4224ea.entry.js.map +0 -1
  193. package/dist/cjs/atomic-search-box-recent-queries.cjs.entry.js +0 -171
  194. package/dist/cjs/atomic-search-box-recent-queries.cjs.entry.js.map +0 -1
  195. package/dist/cjs/clock-f03ff827.js +0 -7
  196. package/dist/cjs/clock-f03ff827.js.map +0 -1
  197. package/dist/cjs/suggestions-common-5097a362.js.map +0 -1
  198. package/dist/esm/atomic-search-box-recent-queries.entry.js +0 -167
  199. package/dist/esm/atomic-search-box-recent-queries.entry.js.map +0 -1
  200. package/dist/esm/clock-add3e9a5.js +0 -5
  201. package/dist/esm/clock-add3e9a5.js.map +0 -1
  202. package/dist/esm/suggestions-common-2b20db26.js.map +0 -1
  203. /package/dist/atomic/{p-ab7c83d8.entry.js.map → p-03addf89.entry.js.map} +0 -0
  204. /package/dist/atomic/{p-6b3c4d63.entry.js.map → p-3213157f.entry.js.map} +0 -0
  205. /package/dist/atomic/{p-b5dd6399.entry.js.map → p-5210f9a9.entry.js.map} +0 -0
  206. /package/dist/atomic/{p-6e6d686e.entry.js.map → p-7383fd32.entry.js.map} +0 -0
  207. /package/dist/atomic/{p-3a53ad44.js.map → p-a2a9c37a.js.map} +0 -0
  208. /package/dist/atomic/{p-6329ff94.entry.js.map → p-ba4bf29f.entry.js.map} +0 -0
  209. /package/dist/atomic/{p-c280cd05.js.map → p-e1cc5150.js.map} +0 -0
@@ -1,6 +1,22 @@
1
1
  import { c as closest } from './dom-utils-f6086cd3.js';
2
2
  import { b as buildCustomEvent } from './event-utils-8de63ec3.js';
3
3
 
4
+ /**
5
+ * Dispatches an event which retrieves the `SearchBoxSuggestionsBindings` on a configured parent search box.
6
+ *
7
+ * @param event Event sent from the registered query suggestions to the parent search box
8
+ * @param element Element on which to dispatch the event, which must be the child of a configured search box
9
+ * @param allowedSearchBoxElements Optional array of allowed search box element selectors
10
+ *
11
+ * @throws Error if the element is not a child of an allowed search box element
12
+ */
13
+ const dispatchSearchBoxSuggestionsEvent = (event, element, allowedSearchBoxElements = searchBoxElements) => {
14
+ const interfaceElement = closest(element, searchBoxElements.join(', '));
15
+ if (!interfaceElement) {
16
+ throw new Error(`The "${element.nodeName.toLowerCase()}" component was not handled, as it is not a child of the following elements: ${allowedSearchBoxElements.join(', ')}`);
17
+ }
18
+ void dispatchSearchBoxSuggestionsEventEventually(interfaceElement, element, event);
19
+ };
4
20
  const searchBoxElements = [
5
21
  'atomic-search-box',
6
22
  'atomic-insight-search-box',
@@ -18,25 +34,7 @@ const dispatchSearchBoxSuggestionsEventEventually = async (interfaceElement, ele
18
34
  }
19
35
  element.dispatchEvent(buildCustomEvent('atomic/searchBoxSuggestion/register', event));
20
36
  };
21
- /**
22
- * Dispatches an event which retrieves the `SearchBoxSuggestionsBindings` on a configured parent search box.
23
- * @param event Event sent from the registered query suggestions to the parent search box.
24
- * @param element Element on which to dispatch the event, which must be the child of a configured search box.
25
- */
26
- const dispatchSearchBoxSuggestionsEvent = (event, element, allowedSearchBoxElements = searchBoxElements) => {
27
- const interfaceElement = closest(element, searchBoxElements.join(', '));
28
- if (!interfaceElement) {
29
- throw new Error(`The "${element.nodeName.toLowerCase()}" component was not handled, as it is not a child of the following elements: ${allowedSearchBoxElements.join(', ')}`);
30
- }
31
- void dispatchSearchBoxSuggestionsEventEventually(interfaceElement, element, event);
32
- };
33
- function elementHasNoQuery(el) {
34
- return !el.query || el.query.trim() === '';
35
- }
36
- function elementHasQuery(el) {
37
- return !!el.query && el.query.trim() !== '';
38
- }
39
37
 
40
- export { elementHasNoQuery as a, dispatchSearchBoxSuggestionsEvent as d, elementHasQuery as e };
38
+ export { dispatchSearchBoxSuggestionsEvent as d };
41
39
 
42
- //# sourceMappingURL=suggestions-common-2b20db26.js.map
40
+ //# sourceMappingURL=suggestions-events-b7a6f007.js.map
@@ -0,0 +1 @@
1
+ {"file":"suggestions-events-b7a6f007.js","mappings":";;;AAOA;;;;;;;;;MASa,iCAAiC,GAAG,CAI/C,KAA+D,EAC/D,OAAoB,EACpB,2BAA0E,iBAAiB;IAE3F,MAAM,gBAAgB,GAAG,OAAO,CAAC,OAAO,EAAE,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACxE,IAAI,CAAC,gBAAgB,EAAE;QACrB,MAAM,IAAI,KAAK,CACb,QAAQ,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,gFAAgF,wBAAwB,CAAC,IAAI,CACjJ,IAAI,CACL,EAAE,CACJ,CAAC;KACH;IACD,KAAK,2CAA2C,CAC9C,gBAAgB,EAChB,OAAO,EACP,KAAK,CACN,CAAC;AACJ,EAAE;AAEF,MAAM,iBAAiB,GAAG;IACxB,mBAAmB;IACnB,2BAA2B;IAC3B,4BAA4B;CACpB,CAAC;AAEX,MAAM,mBAAmB,GAAG,CAAC,SAAkB,KAC7C,gBAAgB,IAAK,SAAwB;IAC5C,SAAwB,CAAC,cAAc,YAAY,OAAO,CAAC;AAE9D,MAAM,2CAA2C,GAAG,OAIlD,gBAAyB,EACzB,OAAoB,EACpB,KAA+D;IAE/D,MAAM,cAAc,CAAC,WAAW,CAAC,gBAAgB,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;IAC1E,IAAI,mBAAmB,CAAC,gBAAgB,CAAC,EAAE;QACzC,MAAM,gBAAgB,CAAC,cAAc,CAAC;KACvC;SAAM,IAAI,kBAAkB,IAAI,gBAAgB,EAAE;QACjD,MAAO,gBAAuC,CAAC,gBAAgB,EAAE,CAAC;KACnE;IACD,OAAO,CAAC,aAAa,CACnB,gBAAgB,CAAC,qCAAqC,EAAE,KAAK,CAAC,CAC/D,CAAC;AACJ,CAAC;;;;","names":[],"sources":["src/components/common/suggestions/suggestions-events.ts"],"sourcesContent":["import type {HTMLStencilElement} from '@stencil/core/internal';\nimport type {LitElement} from 'lit';\nimport {closest} from '../../../utils/dom-utils';\nimport {buildCustomEvent} from '../../../utils/event-utils';\nimport type {AnyBindings} from '../interface/bindings';\nimport type {SearchBoxSuggestionsEvent} from './suggestions-types';\n\n/**\n * Dispatches an event which retrieves the `SearchBoxSuggestionsBindings` on a configured parent search box.\n *\n * @param event Event sent from the registered query suggestions to the parent search box\n * @param element Element on which to dispatch the event, which must be the child of a configured search box\n * @param allowedSearchBoxElements Optional array of allowed search box element selectors\n *\n * @throws Error if the element is not a child of an allowed search box element\n */\nexport const dispatchSearchBoxSuggestionsEvent = <\n SearchBoxController,\n Bindings = AnyBindings,\n>(\n event: SearchBoxSuggestionsEvent<SearchBoxController, Bindings>,\n element: HTMLElement,\n allowedSearchBoxElements: readonly (typeof searchBoxElements)[number][] = searchBoxElements\n) => {\n const interfaceElement = closest(element, searchBoxElements.join(', '));\n if (!interfaceElement) {\n throw new Error(\n `The \"${element.nodeName.toLowerCase()}\" component was not handled, as it is not a child of the following elements: ${allowedSearchBoxElements.join(\n ', '\n )}`\n );\n }\n void dispatchSearchBoxSuggestionsEventEventually(\n interfaceElement,\n element,\n event\n );\n};\n\nconst searchBoxElements = [\n 'atomic-search-box',\n 'atomic-insight-search-box',\n 'atomic-commerce-search-box',\n] as const;\n\nconst isLitElementLoosely = (candidate: unknown): candidate is LitElement =>\n 'updateComplete' in (candidate as LitElement) &&\n (candidate as LitElement).updateComplete instanceof Promise;\n\nconst dispatchSearchBoxSuggestionsEventEventually = async <\n SearchBoxController,\n Bindings = AnyBindings,\n>(\n interfaceElement: Element,\n element: HTMLElement,\n event: SearchBoxSuggestionsEvent<SearchBoxController, Bindings>\n) => {\n await customElements.whenDefined(interfaceElement.nodeName.toLowerCase());\n if (isLitElementLoosely(interfaceElement)) {\n await interfaceElement.updateComplete;\n } else if ('componentOnReady' in interfaceElement) {\n await (interfaceElement as HTMLStencilElement).componentOnReady();\n }\n element.dispatchEvent(\n buildCustomEvent('atomic/searchBoxSuggestion/register', event)\n );\n};\n"],"version":3}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Checks if a search box suggestion element has no query.
3
+ *
4
+ * @param el - The search box suggestion element to check
5
+ * @returns True if the element has no query or the query is whitespace-only
6
+ */
7
+ function elementHasNoQuery(el) {
8
+ return !el.query || el.query.trim() === '';
9
+ }
10
+ /**
11
+ * Checks if a search box suggestion element has a query.
12
+ *
13
+ * @param el - The search box suggestion element to check
14
+ * @returns True if the element has a non-empty, non-whitespace query
15
+ */
16
+ function elementHasQuery(el) {
17
+ return !!el.query && el.query.trim() !== '';
18
+ }
19
+
20
+ export { elementHasQuery as a, elementHasNoQuery as e };
21
+
22
+ //# sourceMappingURL=suggestions-utils-591559a0.js.map
@@ -0,0 +1 @@
1
+ {"file":"suggestions-utils-591559a0.js","mappings":"AAEA;;;;;;SAMgB,iBAAiB,CAAC,EAA8B;IAC9D,OAAO,CAAC,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;AAC7C,CAAC;AAED;;;;;;SAMgB,eAAe,CAAC,EAA8B;IAC5D,OAAO,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;AAC9C;;;;","names":[],"sources":["src/components/common/suggestions/suggestions-utils.ts"],"sourcesContent":["import type {SearchBoxSuggestionElement} from './suggestions-types';\n\n/**\n * Checks if a search box suggestion element has no query.\n *\n * @param el - The search box suggestion element to check\n * @returns True if the element has no query or the query is whitespace-only\n */\nexport function elementHasNoQuery(el: SearchBoxSuggestionElement): boolean {\n return !el.query || el.query.trim() === '';\n}\n\n/**\n * Checks if a search box suggestion element has a query.\n *\n * @param el - The search box suggestion element to check\n * @returns True if the element has a non-empty, non-whitespace query\n */\nexport function elementHasQuery(el: SearchBoxSuggestionElement): boolean {\n return !!el.query && el.query.trim() !== '';\n}\n"],"version":3}
@@ -1,2 +1,2 @@
1
- export const headlessVersion = '3.31.0';
2
- export const atomicVersion = '3.33.8-pre.52109a8c79';
1
+ export const headlessVersion = '3.31.1-pre.5b06866794';
2
+ export const atomicVersion = '3.33.8-pre.5b06866794';
@@ -52,7 +52,8 @@ export declare class AtomicCommerceBreadbox extends LitElement implements Initia
52
52
  */
53
53
  pathLimit: number;
54
54
  initialize(): void;
55
- updated(changedProperties: Map<string, unknown>): void;
55
+ willUpdate(changedProperties: Map<string, unknown>): void;
56
+ updated(): void;
56
57
  private validateProps;
57
58
  disconnectedCallback(): void;
58
59
  private get breadcrumbs();
@@ -118,7 +118,6 @@ export declare class AtomicCommerceInterface extends AtomicCommerceInterface_bas
118
118
  private onHashChange;
119
119
  scrollToTop(): void;
120
120
  private updateHash;
121
- private updateMobileBreakpoint;
122
121
  }
123
122
  declare global {
124
123
  interface HTMLElementTagNameMap {
@@ -8,19 +8,19 @@ declare const AtomicCommerceLayout_base: import("../../../mixins/mixin-common").
8
8
  * @cssprop --atomic-layout-max-search-box-input-width: The maximum width that the search box input will take.
9
9
  * @cssprop --atomic-layout-max-search-box-double-suggestions-width: The maximum width that the search box suggestions will take when displaying a double list.
10
10
  * @cssprop --atomic-layout-search-box-left-suggestions-width: The width of the left list when displaying a double list.
11
- *
12
- * @slot default - The default slot for the layout content.
13
11
  */
14
12
  export declare class AtomicCommerceLayout extends AtomicCommerceLayout_base {
15
13
  static styles: import("lit").CSSResult[];
16
- private addStyles;
17
14
  error: Error;
18
15
  /**
19
16
  * The viewport width at which the layout goes from desktop to mobile.
20
17
  * E.g., 800px, 65rem.
21
18
  */
22
19
  mobileBreakpoint: string;
20
+ private layoutStylesController;
23
21
  connectedCallback(): void;
22
+ private emitBreakpointChangeEvent;
23
+ onMobileBreakpointChange(): void;
24
24
  }
25
25
  declare global {
26
26
  interface HTMLElementTagNameMap {
@@ -2,7 +2,7 @@ import { type Product, type SearchBox } from '@coveo/headless/commerce';
2
2
  import { LitElement } from 'lit';
3
3
  import type { ItemRenderingFunction } from "../../common/item-list/item-list-common";
4
4
  import type { ItemDisplayDensity, ItemDisplayImageSize } from "../../common/layout/display-options";
5
- import { type SearchBoxSuggestions, type SearchBoxSuggestionsBindings } from "../../common/suggestions/suggestions-common";
5
+ import type { SearchBoxSuggestions, SearchBoxSuggestionsBindings } from "../../common/suggestions/suggestions-types";
6
6
  import type { SearchBoxSuggestionsComponent } from "../../../decorators/types";
7
7
  import type { CommerceBindings } from '../atomic-commerce-interface/atomic-commerce-interface';
8
8
  export type AriaLabelGenerator = (bindings: CommerceBindings, product: Product) => string | undefined;
@@ -1,6 +1,6 @@
1
1
  import { type SearchBox } from '@coveo/headless/commerce';
2
2
  import { LitElement } from 'lit';
3
- import { type SearchBoxSuggestions, type SearchBoxSuggestionsBindings } from "../../common/suggestions/suggestions-common";
3
+ import type { SearchBoxSuggestions, SearchBoxSuggestionsBindings } from "../../common/suggestions/suggestions-types";
4
4
  import type { SearchBoxSuggestionsComponent } from "../../../decorators/types";
5
5
  import type { CommerceBindings } from '../atomic-commerce-interface/atomic-commerce-interface';
6
6
  /**
@@ -1,7 +1,7 @@
1
1
  import { type SearchBox } from '@coveo/headless/commerce';
2
2
  import { LitElement } from 'lit';
3
3
  import type { SearchBoxSuggestionsComponent } from "../../../decorators/types";
4
- import { type SearchBoxSuggestions, type SearchBoxSuggestionsBindings } from '../../common/suggestions/suggestions-common';
4
+ import type { SearchBoxSuggestions, SearchBoxSuggestionsBindings } from '../../common/suggestions/suggestions-types';
5
5
  import type { CommerceBindings } from '../atomic-commerce-interface/atomic-commerce-interface';
6
6
  /**
7
7
  * The `atomic-commerce-search-box-recent-queries` component can be added as a child of an `atomic-commerce-search-box` component, allowing for the configuration of recent query suggestions.
@@ -1,5 +1,5 @@
1
1
  import { i18n } from 'i18next';
2
- import { SearchBoxSuggestionElement } from '../suggestions/suggestions-common';
2
+ import { SearchBoxSuggestionElement } from '../suggestions/suggestions-types';
3
3
  /**
4
4
  * The `atomic-suggestion-renderer` component is used to render individual suggestions. It was created to isolate
5
5
  * the rendering logic of the 'content' property of the `SearchBoxSuggestionElement` interface. This property can be Stencil
@@ -0,0 +1,22 @@
1
+ import type { ReactiveController, ReactiveControllerHost } from 'lit';
2
+ export interface LayoutStylesHost extends ReactiveControllerHost {
3
+ mobileBreakpoint: string;
4
+ getRootNode(): Node;
5
+ id?: string;
6
+ }
7
+ export type StylesBuilderFunction = (host: HTMLElement, mobileBreakpoint: string) => string;
8
+ /**
9
+ * A reactive controller that manages dynamic layout styles.
10
+ */
11
+ export declare class LayoutStylesController implements ReactiveController {
12
+ private host;
13
+ private dynamicStyleSheet;
14
+ private stylesBuilder;
15
+ private componentPrefix;
16
+ constructor(host: LayoutStylesHost, stylesBuilder: StylesBuilderFunction, componentPrefix: string);
17
+ hostConnected(): void;
18
+ /**
19
+ * Updates the dynamic styles based on the current mobile breakpoint
20
+ */
21
+ updateStyles(): void;
22
+ }
@@ -0,0 +1,18 @@
1
+ import type { ReactiveController, ReactiveControllerHost } from 'lit';
2
+ import type { BaseStore } from "../interface/store";
3
+ /**
4
+ * A reactive controller that manages mobile breakpoint changes through event communication.
5
+ * This controller listens for 'atomic-layout-breakpoint-change' events and updates a store
6
+ * with the new breakpoint value.
7
+ */
8
+ export declare class MobileBreakpointController implements ReactiveController {
9
+ private host;
10
+ private store;
11
+ private eventListener;
12
+ constructor(host: ReactiveControllerHost, store: BaseStore<{
13
+ mobileBreakpoint: string;
14
+ }>);
15
+ hostConnected(): void;
16
+ hostDisconnected(): void;
17
+ private handleBreakpointChange;
18
+ }
@@ -1,5 +1,5 @@
1
1
  import type { i18n } from 'i18next';
2
- import type { SearchBoxSuggestionElement } from './suggestions-common';
2
+ import type { SearchBoxSuggestionElement } from './suggestions-types';
3
3
  export declare const getPartialInstantItemElement: (i18n: i18n, itemTitle: string, itemUniqueId: string) => Pick<SearchBoxSuggestionElement, "ariaLabel" | "key" | "part">;
4
4
  export declare const getPartialInstantItemShowAllElement: (i18n: i18n) => Pick<SearchBoxSuggestionElement, "key" | "part" | "ariaLabel">;
5
5
  interface InstantItemShowAllButtonProps {
@@ -1,5 +1,5 @@
1
1
  import type { i18n } from 'i18next';
2
- import type { SearchBoxSuggestionElement } from './suggestions-common.js';
2
+ import type { SearchBoxSuggestionElement } from './suggestions-types.js';
3
3
  interface Suggestion {
4
4
  highlightedValue: string;
5
5
  rawValue: string;
@@ -1,5 +1,5 @@
1
1
  import type { i18n } from 'i18next';
2
- import type { SearchBoxSuggestionElement } from './suggestions-common';
2
+ import type { SearchBoxSuggestionElement } from './suggestions-types';
3
3
  export declare const getPartialRecentQueryElement: (value: string, i18n: i18n) => Pick<SearchBoxSuggestionElement, "ariaLabel" | "key" | "query" | "part">;
4
4
  export declare const getPartialRecentQueryClearElement: (i18n: i18n) => Pick<SearchBoxSuggestionElement, "ariaLabel" | "key" | "part" | "hideIfLast">;
5
5
  export interface RecentQueriesContainerProps {
@@ -1,6 +1,6 @@
1
1
  import { FunctionalComponent } from '../../../stencil-public-runtime';
2
2
  import { i18n } from 'i18next';
3
- import { SearchBoxSuggestionElement } from './suggestions-common';
3
+ import { SearchBoxSuggestionElement } from './suggestions-types';
4
4
  export declare const getPartialInstantItemElement: (i18n: i18n, itemTitle: string, itemUniqueId: string) => Pick<SearchBoxSuggestionElement, "ariaLabel" | "key" | "part">;
5
5
  export declare const getPartialInstantItemShowAllElement: (i18n: i18n) => Pick<SearchBoxSuggestionElement, "key" | "part" | "ariaLabel">;
6
6
  interface InstantItemShowAllButtonProps {
@@ -1,6 +1,6 @@
1
1
  import { FunctionalComponent } from '../../../stencil-public-runtime';
2
2
  import { i18n } from 'i18next';
3
- import { SearchBoxSuggestionElement } from './suggestions-common.js';
3
+ import { SearchBoxSuggestionElement } from './suggestions-types.js';
4
4
  interface Suggestion {
5
5
  highlightedValue: string;
6
6
  rawValue: string;
@@ -1,6 +1,6 @@
1
1
  import { FunctionalComponent } from '../../../stencil-public-runtime';
2
2
  import { i18n } from 'i18next';
3
- import { SearchBoxSuggestionElement } from './suggestions-common';
3
+ import { SearchBoxSuggestionElement } from './suggestions-types';
4
4
  export declare const getPartialRecentQueryElement: (value: string, i18n: i18n) => Pick<SearchBoxSuggestionElement, "ariaLabel" | "key" | "query" | "part">;
5
5
  export declare const getPartialRecentQueryClearElement: (i18n: i18n) => Pick<SearchBoxSuggestionElement, "ariaLabel" | "key" | "part" | "hideIfLast">;
6
6
  export declare const RecentQueriesContainer: FunctionalComponent;
@@ -1,4 +1,4 @@
1
- import { type SearchBoxSuggestionElement, type SearchBoxSuggestionsBindings, type SearchBoxSuggestionsEvent } from './suggestions-common';
1
+ import type { SearchBoxSuggestionElement, SearchBoxSuggestionsBindings, SearchBoxSuggestionsEvent } from './suggestions-types';
2
2
  /**
3
3
  * List of suggestions that will be displayed along other lists (e.g recent queries) when the search box's input is selected.
4
4
  */
@@ -1,5 +1,5 @@
1
1
  import type { LitElement } from 'lit';
2
- import { type SearchBoxSuggestionElement, type SearchBoxSuggestionsBindings, type SearchBoxSuggestionsEvent } from './suggestions-common';
2
+ import type { SearchBoxSuggestionElement, SearchBoxSuggestionsBindings, SearchBoxSuggestionsEvent } from './suggestions-types';
3
3
  /**
4
4
  * List of suggestions that will be displayed along other lists (e.g recent queries) when the search box's input is selected.
5
5
  */
@@ -0,0 +1,14 @@
1
+ import type { AnyBindings } from '../interface/bindings';
2
+ import type { SearchBoxSuggestionsEvent } from './suggestions-types';
3
+ /**
4
+ * Dispatches an event which retrieves the `SearchBoxSuggestionsBindings` on a configured parent search box.
5
+ *
6
+ * @param event Event sent from the registered query suggestions to the parent search box
7
+ * @param element Element on which to dispatch the event, which must be the child of a configured search box
8
+ * @param allowedSearchBoxElements Optional array of allowed search box element selectors
9
+ *
10
+ * @throws Error if the element is not a child of an allowed search box element
11
+ */
12
+ export declare const dispatchSearchBoxSuggestionsEvent: <SearchBoxController, Bindings = AnyBindings>(event: SearchBoxSuggestionsEvent<SearchBoxController, Bindings>, element: HTMLElement, allowedSearchBoxElements?: readonly (typeof searchBoxElements)[number][]) => void;
13
+ declare const searchBoxElements: readonly ["atomic-search-box", "atomic-insight-search-box", "atomic-commerce-search-box"];
14
+ export {};
@@ -68,15 +68,6 @@ export interface SearchBoxSuggestions {
68
68
  */
69
69
  onSuggestedQueryChange?(q: string): Promise<unknown>;
70
70
  }
71
- /**
72
- * Event sent from the registered query suggestions to the parent search box.
73
- */
74
- export type SearchBoxSuggestionsEvent<SearchBoxController, Bindings = AnyBindings> = (
75
- /**
76
- * The bindings passed from the search box to the suggestions.
77
- */
78
- bindings: SearchBoxSuggestionsBindings<SearchBoxController, Bindings>) => SearchBoxSuggestions;
79
- declare const searchBoxElements: readonly ["atomic-search-box", "atomic-insight-search-box", "atomic-commerce-search-box"];
80
71
  /**
81
72
  * The bindings passed from the search box to the suggestions.
82
73
  */
@@ -124,11 +115,10 @@ export type SearchBoxSuggestionsBindings<SearchBoxController, Bindings = AnyBind
124
115
  getSuggestionElements(): SearchBoxSuggestionElement[];
125
116
  };
126
117
  /**
127
- * Dispatches an event which retrieves the `SearchBoxSuggestionsBindings` on a configured parent search box.
128
- * @param event Event sent from the registered query suggestions to the parent search box.
129
- * @param element Element on which to dispatch the event, which must be the child of a configured search box.
118
+ * Event sent from the registered query suggestions to the parent search box.
130
119
  */
131
- export declare const dispatchSearchBoxSuggestionsEvent: <SearchBoxController, Bindings = AnyBindings>(event: SearchBoxSuggestionsEvent<SearchBoxController, Bindings>, element: HTMLElement, allowedSearchBoxElements?: readonly (typeof searchBoxElements)[number][]) => void;
132
- export declare function elementHasNoQuery(el: SearchBoxSuggestionElement): boolean;
133
- export declare function elementHasQuery(el: SearchBoxSuggestionElement): boolean;
134
- export {};
120
+ export type SearchBoxSuggestionsEvent<SearchBoxController, Bindings = AnyBindings> = (
121
+ /**
122
+ * The bindings passed from the search box to the suggestions.
123
+ */
124
+ bindings: SearchBoxSuggestionsBindings<SearchBoxController, Bindings>) => SearchBoxSuggestions;
@@ -0,0 +1,15 @@
1
+ import type { SearchBoxSuggestionElement } from './suggestions-types';
2
+ /**
3
+ * Checks if a search box suggestion element has no query.
4
+ *
5
+ * @param el - The search box suggestion element to check
6
+ * @returns True if the element has no query or the query is whitespace-only
7
+ */
8
+ export declare function elementHasNoQuery(el: SearchBoxSuggestionElement): boolean;
9
+ /**
10
+ * Checks if a search box suggestion element has a query.
11
+ *
12
+ * @param el - The search box suggestion element to check
13
+ * @returns True if the element has a non-empty, non-whitespace query
14
+ */
15
+ export declare function elementHasQuery(el: SearchBoxSuggestionElement): boolean;
@@ -2,7 +2,7 @@ import { SearchBox, StandaloneSearchBox } from '@coveo/headless';
2
2
  import { EventEmitter } from '../../../stencil-public-runtime';
3
3
  import { InitializableComponent } from '../../../utils/initialization-utils';
4
4
  import { RedirectionPayload } from '../../common/search-box/redirection-payload';
5
- import { SearchBoxSuggestionsEvent } from '../../common/suggestions/suggestions-common';
5
+ import type { SearchBoxSuggestionsEvent } from '../../common/suggestions/suggestions-types';
6
6
  import { Bindings } from '../atomic-search-interface/atomic-search-interface';
7
7
  /**
8
8
  * The `atomic-search-box` component creates a search box with built-in support for suggestions.
@@ -1,13 +1,15 @@
1
1
  import { type SearchBox } from '@coveo/headless';
2
2
  import { LitElement } from 'lit';
3
- import { type SearchBoxSuggestions, type SearchBoxSuggestionsBindings } from "../../common/suggestions/suggestions-common.js";
4
- import type { SearchBoxSuggestionsComponent } from "../../../decorators/types.js";
5
- import type { Bindings } from '../atomic-search-interface/interfaces.js';
3
+ import type { SearchBoxSuggestionsComponent } from "../../../decorators/types";
4
+ import type { SearchBoxSuggestions, SearchBoxSuggestionsBindings } from '../../common/suggestions/suggestions-types';
5
+ import type { Bindings } from '../atomic-search-interface/interfaces';
6
6
  /**
7
- * The `atomic-search-box-query-suggestions` component can be added as a child of an `atomic-search-box` component, allowing for the configuration of query suggestion behavior.
7
+ * The `atomic-search-box-recent-queries` component can be added as a child of an `atomic-search-box` component, allowing for the configuration of recent query suggestions.
8
8
  */
9
- export declare class AtomicSearchBoxQuerySuggestions extends LitElement implements SearchBoxSuggestionsComponent<Bindings> {
9
+ export declare class AtomicSearchBoxRecentQueries extends LitElement implements SearchBoxSuggestionsComponent<Bindings> {
10
10
  bindings: SearchBoxSuggestionsBindings<SearchBox, Bindings>;
11
+ private recentQueriesList;
12
+ private storage;
11
13
  error: Error;
12
14
  /**
13
15
  * The SVG icon to display.
@@ -16,7 +18,7 @@ export declare class AtomicSearchBoxQuerySuggestions extends LitElement implemen
16
18
  * - Use a value that starts with `assets://`, to display an icon from the Atomic package.
17
19
  * - Use a stringified SVG to display it directly.
18
20
  */
19
- icon: string;
21
+ icon?: string;
20
22
  /**
21
23
  * The maximum number of suggestions that will be displayed if the user has typed something into the input field.
22
24
  */
@@ -24,15 +26,20 @@ export declare class AtomicSearchBoxQuerySuggestions extends LitElement implemen
24
26
  /**
25
27
  * The maximum number of suggestions that will be displayed initially when the input field is empty.
26
28
  */
27
- maxWithoutQuery: number;
29
+ maxWithoutQuery?: number;
28
30
  connectedCallback(): void;
29
31
  initialize(): SearchBoxSuggestions;
32
+ private retrieveLocalStorage;
33
+ private updateLocalStorage;
34
+ private warnUser;
35
+ private disableFeature;
30
36
  private renderItems;
37
+ private renderClear;
31
38
  private renderItem;
32
39
  render(): import("lit-html").TemplateResult<1>;
33
40
  }
34
41
  declare global {
35
42
  interface HTMLElementTagNameMap {
36
- 'atomic-search-box-query-suggestions': AtomicSearchBoxQuerySuggestions;
43
+ 'atomic-search-box-recent-queries': AtomicSearchBoxRecentQueries;
37
44
  }
38
45
  }
@@ -1,4 +1,4 @@
1
1
  export { AtomicQuerySummary } from './atomic-query-summary/atomic-query-summary.js';
2
2
  export { AtomicResultsPerPage } from './atomic-results-per-page/atomic-results-per-page.js';
3
- export { AtomicSearchBoxQuerySuggestions } from './atomic-search-box-query-suggestions/atomic-search-box-query-suggestions.js';
3
+ export { AtomicSearchBoxRecentQueries } from './atomic-search-box-recent-queries/atomic-search-box-recent-queries.js';
4
4
  export { AtomicSearchLayout } from './atomic-search-layout/atomic-search-layout.js';
@@ -2,7 +2,7 @@ import { Result, SearchBox } from '@coveo/headless';
2
2
  import { InitializableComponent } from '../../../../utils/initialization-utils';
3
3
  import { ItemRenderingFunction } from '../../../common/item-list/stencil-item-list-common';
4
4
  import { ItemDisplayDensity, ItemDisplayImageSize } from '../../../common/layout/display-options';
5
- import { SearchBoxSuggestions, SearchBoxSuggestionsBindings } from '../../../common/suggestions/suggestions-common';
5
+ import type { SearchBoxSuggestions, SearchBoxSuggestionsBindings } from '../../../common/suggestions/suggestions-types';
6
6
  import { Bindings } from '../../atomic-search-interface/atomic-search-interface';
7
7
  export type AriaLabelGenerator = (bindings: Bindings, result: Result) => string | undefined;
8
8
  /**
@@ -1,10 +1,8 @@
1
1
  /**
2
- * The `atomic-search-box-recent-queries` component can be added as a child of an `atomic-search-box` component, allowing for the configuration of recent query suggestions.
2
+ * The `atomic-search-box-query-suggestions` component can be added as a child of an `atomic-search-box` component, allowing for the configuration of query suggestion behavior.
3
3
  */
4
- export declare class AtomicSearchBoxRecentQueries {
4
+ export declare class AtomicSearchBoxQuerySuggestions {
5
5
  private bindings;
6
- private recentQueriesList;
7
- private storage;
8
6
  private host;
9
7
  error: Error;
10
8
  /**
@@ -18,20 +16,14 @@ export declare class AtomicSearchBoxRecentQueries {
18
16
  /**
19
17
  * The maximum number of suggestions that will be displayed if the user has typed something into the input field.
20
18
  */
21
- maxWithQuery: number;
19
+ maxWithQuery?: number;
22
20
  /**
23
21
  * The maximum number of suggestions that will be displayed initially when the input field is empty.
24
22
  */
25
23
  maxWithoutQuery?: number;
26
24
  componentWillLoad(): void;
27
- private renderIcon;
28
25
  private initialize;
29
- private retrieveLocalStorage;
30
- private updateLocalStorage;
31
- private warnUser;
32
- private disableFeature;
33
26
  private renderItems;
34
- private renderClear;
35
27
  private renderItem;
36
28
  render(): any;
37
29
  }
@@ -26,7 +26,7 @@ import { RedirectionPayload } from "./components/common/search-box/redirection-p
26
26
  import { AriaLabelGenerator } from "./components/search/search-box-suggestions/atomic-search-box-instant-results/atomic-search-box-instant-results";
27
27
  import { InitializationOptions } from "./components/search/atomic-search-interface/atomic-search-interface";
28
28
  import { StandaloneSearchBoxData } from "./utils/local-storage-utils";
29
- import { SearchBoxSuggestionElement } from "./components/common/suggestions/suggestions-common";
29
+ import { SearchBoxSuggestionElement } from "./components/common/suggestions/suggestions-types";
30
30
  export { AutomaticFacet, CategoryFacetSortCriterion, DateFilterRange, DateRangeRequest, FacetResultsMustMatch, FacetSortCriterion, FoldedResult, GeneratedAnswer, GeneratedAnswerCitation, InlineLink, InteractiveCitation, InteractiveResult, LogLevel, NumericFilter, NumericFilterState, RangeFacetRangeAlgorithm, RangeFacetSortCriterion, RelativeDateUnit, Result, ResultTemplate, ResultTemplateCondition, SearchEngine, SearchStatus } from "@coveo/headless";
31
31
  export { AtomicInterface } from "./utils/initialization-utils";
32
32
  export { AnyBindings } from "./components/common/interface/bindings";
@@ -48,7 +48,7 @@ export { RedirectionPayload } from "./components/common/search-box/redirection-p
48
48
  export { AriaLabelGenerator } from "./components/search/search-box-suggestions/atomic-search-box-instant-results/atomic-search-box-instant-results";
49
49
  export { InitializationOptions } from "./components/search/atomic-search-interface/atomic-search-interface";
50
50
  export { StandaloneSearchBoxData } from "./utils/local-storage-utils";
51
- export { SearchBoxSuggestionElement } from "./components/common/suggestions/suggestions-common";
51
+ export { SearchBoxSuggestionElement } from "./components/common/suggestions/suggestions-types";
52
52
  export namespace Components {
53
53
  /**
54
54
  * An automatic facet is a special type of facet generated by the automatic facets feature.
@@ -2416,9 +2416,9 @@ export namespace Components {
2416
2416
  "setRenderFunction": (resultRenderingFunction: ItemRenderingFunction) => Promise<void>;
2417
2417
  }
2418
2418
  /**
2419
- * The `atomic-search-box-recent-queries` component can be added as a child of an `atomic-search-box` component, allowing for the configuration of recent query suggestions.
2419
+ * The `atomic-search-box-query-suggestions` component can be added as a child of an `atomic-search-box` component, allowing for the configuration of query suggestion behavior.
2420
2420
  */
2421
- interface AtomicSearchBoxRecentQueries {
2421
+ interface AtomicSearchBoxQuerySuggestions {
2422
2422
  /**
2423
2423
  * The SVG icon to display. - Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location. - Use a value that starts with `assets://`, to display an icon from the Atomic package. - Use a stringified SVG to display it directly.
2424
2424
  */
@@ -2426,7 +2426,7 @@ export namespace Components {
2426
2426
  /**
2427
2427
  * The maximum number of suggestions that will be displayed if the user has typed something into the input field.
2428
2428
  */
2429
- "maxWithQuery": number;
2429
+ "maxWithQuery"?: number;
2430
2430
  /**
2431
2431
  * The maximum number of suggestions that will be displayed initially when the input field is empty.
2432
2432
  */
@@ -4178,13 +4178,13 @@ declare global {
4178
4178
  new (): HTMLAtomicSearchBoxInstantResultsElement;
4179
4179
  };
4180
4180
  /**
4181
- * The `atomic-search-box-recent-queries` component can be added as a child of an `atomic-search-box` component, allowing for the configuration of recent query suggestions.
4181
+ * The `atomic-search-box-query-suggestions` component can be added as a child of an `atomic-search-box` component, allowing for the configuration of query suggestion behavior.
4182
4182
  */
4183
- interface HTMLAtomicSearchBoxRecentQueriesElement extends Components.AtomicSearchBoxRecentQueries, HTMLStencilElement {
4183
+ interface HTMLAtomicSearchBoxQuerySuggestionsElement extends Components.AtomicSearchBoxQuerySuggestions, HTMLStencilElement {
4184
4184
  }
4185
- var HTMLAtomicSearchBoxRecentQueriesElement: {
4186
- prototype: HTMLAtomicSearchBoxRecentQueriesElement;
4187
- new (): HTMLAtomicSearchBoxRecentQueriesElement;
4185
+ var HTMLAtomicSearchBoxQuerySuggestionsElement: {
4186
+ prototype: HTMLAtomicSearchBoxQuerySuggestionsElement;
4187
+ new (): HTMLAtomicSearchBoxQuerySuggestionsElement;
4188
4188
  };
4189
4189
  /**
4190
4190
  * The `atomic-search-interface` component is the parent to all other atomic components in a search page. It handles the headless search engine and localization configurations.
@@ -4589,7 +4589,7 @@ declare global {
4589
4589
  "atomic-result-timespan": HTMLAtomicResultTimespanElement;
4590
4590
  "atomic-search-box": HTMLAtomicSearchBoxElement;
4591
4591
  "atomic-search-box-instant-results": HTMLAtomicSearchBoxInstantResultsElement;
4592
- "atomic-search-box-recent-queries": HTMLAtomicSearchBoxRecentQueriesElement;
4592
+ "atomic-search-box-query-suggestions": HTMLAtomicSearchBoxQuerySuggestionsElement;
4593
4593
  "atomic-search-interface": HTMLAtomicSearchInterfaceElement;
4594
4594
  "atomic-segmented-facet": HTMLAtomicSegmentedFacetElement;
4595
4595
  "atomic-segmented-facet-scrollable": HTMLAtomicSegmentedFacetScrollableElement;
@@ -6856,9 +6856,9 @@ declare namespace LocalJSX {
6856
6856
  "maxResultsPerQuery"?: number;
6857
6857
  }
6858
6858
  /**
6859
- * The `atomic-search-box-recent-queries` component can be added as a child of an `atomic-search-box` component, allowing for the configuration of recent query suggestions.
6859
+ * The `atomic-search-box-query-suggestions` component can be added as a child of an `atomic-search-box` component, allowing for the configuration of query suggestion behavior.
6860
6860
  */
6861
- interface AtomicSearchBoxRecentQueries {
6861
+ interface AtomicSearchBoxQuerySuggestions {
6862
6862
  /**
6863
6863
  * The SVG icon to display. - Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location. - Use a value that starts with `assets://`, to display an icon from the Atomic package. - Use a stringified SVG to display it directly.
6864
6864
  */
@@ -7443,7 +7443,7 @@ declare namespace LocalJSX {
7443
7443
  "atomic-result-timespan": AtomicResultTimespan;
7444
7444
  "atomic-search-box": AtomicSearchBox;
7445
7445
  "atomic-search-box-instant-results": AtomicSearchBoxInstantResults;
7446
- "atomic-search-box-recent-queries": AtomicSearchBoxRecentQueries;
7446
+ "atomic-search-box-query-suggestions": AtomicSearchBoxQuerySuggestions;
7447
7447
  "atomic-search-interface": AtomicSearchInterface;
7448
7448
  "atomic-segmented-facet": AtomicSegmentedFacet;
7449
7449
  "atomic-segmented-facet-scrollable": AtomicSegmentedFacetScrollable;
@@ -7957,9 +7957,9 @@ declare module "@stencil/core" {
7957
7957
  */
7958
7958
  "atomic-search-box-instant-results": LocalJSX.AtomicSearchBoxInstantResults & JSXBase.HTMLAttributes<HTMLAtomicSearchBoxInstantResultsElement>;
7959
7959
  /**
7960
- * The `atomic-search-box-recent-queries` component can be added as a child of an `atomic-search-box` component, allowing for the configuration of recent query suggestions.
7960
+ * The `atomic-search-box-query-suggestions` component can be added as a child of an `atomic-search-box` component, allowing for the configuration of query suggestion behavior.
7961
7961
  */
7962
- "atomic-search-box-recent-queries": LocalJSX.AtomicSearchBoxRecentQueries & JSXBase.HTMLAttributes<HTMLAtomicSearchBoxRecentQueriesElement>;
7962
+ "atomic-search-box-query-suggestions": LocalJSX.AtomicSearchBoxQuerySuggestions & JSXBase.HTMLAttributes<HTMLAtomicSearchBoxQuerySuggestionsElement>;
7963
7963
  /**
7964
7964
  * The `atomic-search-interface` component is the parent to all other atomic components in a search page. It handles the headless search engine and localization configurations.
7965
7965
  */
@@ -1,7 +1,7 @@
1
1
  import type { LitElement, TemplateResult } from 'lit';
2
2
  import type { TemplateResultType } from 'lit/directive-helpers.js';
3
3
  import type { AnyBindings } from '../components/common/interface/bindings';
4
- import type { SearchBoxSuggestions } from '../components/common/suggestions/suggestions-common';
4
+ import type { SearchBoxSuggestions } from '../components/common/suggestions/suggestions-types';
5
5
  export type GenericRender<T extends TemplateResultType> = TemplateResult<T>;
6
6
  export type RenderGuardDecorator<Component, T extends TemplateResultType, Descriptor = TypedPropertyDescriptor<() => GenericRender<T>>> = (target: Component, propertyKey: 'render', descriptor: Descriptor) => Descriptor;
7
7
  /**
@@ -5,7 +5,9 @@ export { SelectChildProductEventArgs } from './components/commerce/atomic-produc
5
5
  export { productContext } from './components/commerce/product-template-component-utils/stencil-product-template-decorators';
6
6
  export { PopoverChildFacet } from './components/common/facets/popover/popover-type';
7
7
  export { RedirectionPayload } from './components/common/search-box/redirection-payload';
8
- export { dispatchSearchBoxSuggestionsEvent, SearchBoxSuggestionElement, SearchBoxSuggestions, SearchBoxSuggestionsBindings, SearchBoxSuggestionsEvent, } from './components/common/suggestions/suggestions-common';
8
+ export { dispatchSearchBoxSuggestionsEvent } from './components/common/suggestions/suggestions-events';
9
+ export type { SearchBoxSuggestionElement, SearchBoxSuggestions, SearchBoxSuggestionsBindings, SearchBoxSuggestionsEvent, } from './components/common/suggestions/suggestions-types';
10
+ export { elementHasNoQuery, elementHasQuery, } from './components/common/suggestions/suggestions-utils';
9
11
  export { RecsBindings } from './components/recommendations/atomic-recs-interface/atomic-recs-interface';
10
12
  export { Bindings } from './components/search/atomic-search-interface/atomic-search-interface';
11
13
  export { resultContext } from './components/search/result-template-components/result-template-decorators';