@coveo/atomic 3.34.0-pre.9b1e6d5dc1 → 3.34.0-pre.b8c7c6d694

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 (178) 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 +0 -2
  4. package/dist/atomic/components/_index.js +0 -1
  5. package/dist/atomic/components/analytics-config.js +1 -1
  6. package/dist/atomic/components/atomic-insight-search-box.js +29 -2
  7. package/dist/atomic/components/atomic-insight-search-box.js.map +1 -1
  8. package/dist/atomic/components/atomic-ipx-result-link.js +3 -3
  9. package/dist/atomic/components/atomic-ipx-result-link.js.map +1 -1
  10. package/dist/atomic/components/atomic-result-link.js +3 -3
  11. package/dist/atomic/components/atomic-result-link.js.map +1 -1
  12. package/dist/atomic/components/atomic-search-box-recent-queries2.js +1 -1
  13. package/dist/atomic/components/atomic-search-box.js +6 -12
  14. package/dist/atomic/components/atomic-search-box.js.map +1 -1
  15. package/dist/atomic/components/atomic-smart-snippet-feedback-modal2.js +2 -2
  16. package/dist/atomic/components/atomic-tab-manager.js +1 -1
  17. package/dist/atomic/components/attributes-slot.js +3 -8
  18. package/dist/atomic/components/attributes-slot.js.map +1 -1
  19. package/dist/atomic/components/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.js +3 -6
  20. package/dist/atomic/components/components/common/item-link/attributes-slot.js +3 -8
  21. package/dist/atomic/components/components/common/suggestions/query-suggestions.js +1 -2
  22. package/dist/atomic/components/components/search/atomic-search-box-query-suggestions/atomic-search-box-query-suggestions.js +107 -0
  23. package/dist/atomic/components/components/search/index.js +1 -0
  24. package/dist/atomic/components/components/search/lazy-index.js +1 -0
  25. package/dist/atomic/components/generated-answer-common.js +3 -2
  26. package/dist/atomic/components/generated-answer-common.js.map +1 -1
  27. package/dist/atomic/components/global/environment.js +1 -1
  28. package/dist/atomic/components/index.js.map +1 -1
  29. package/dist/atomic/components/slot-utils.js +23 -6
  30. package/dist/atomic/components/slot-utils.js.map +1 -1
  31. package/dist/atomic/components/utils/slot-utils.js +22 -5
  32. package/dist/atomic/p-1891bbcf.js +2 -0
  33. package/dist/atomic/p-1891bbcf.js.map +1 -0
  34. package/dist/atomic/{p-6d52fad7.js → p-20cbcfb9.js} +2 -2
  35. package/dist/atomic/p-20cbcfb9.js.map +1 -0
  36. package/dist/atomic/{p-def0218c.js → p-2a240b53.js} +2 -2
  37. package/dist/atomic/{p-0aec5665.entry.js → p-2e4628bb.entry.js} +2 -2
  38. package/dist/atomic/p-2e4628bb.entry.js.map +1 -0
  39. package/dist/atomic/{p-f55bda96.entry.js → p-363efefa.entry.js} +2 -2
  40. package/dist/atomic/{p-644f71e2.entry.js → p-4601eb93.entry.js} +2 -2
  41. package/dist/atomic/p-4601eb93.entry.js.map +1 -0
  42. package/dist/atomic/{p-06349e36.entry.js → p-475124d2.entry.js} +2 -2
  43. package/dist/atomic/p-475124d2.entry.js.map +1 -0
  44. package/dist/atomic/{p-b2f5f6cb.entry.js → p-47ab6c9f.entry.js} +2 -2
  45. package/dist/atomic/{p-2925bd87.entry.js → p-59b15bd6.entry.js} +2 -2
  46. package/dist/atomic/{p-88af4470.entry.js → p-5a710350.entry.js} +2 -2
  47. package/dist/atomic/p-5d71a211.entry.js +2 -0
  48. package/dist/atomic/p-5d71a211.entry.js.map +1 -0
  49. package/dist/atomic/{p-548d6a74.entry.js → p-7e87124d.entry.js} +2 -2
  50. package/dist/atomic/p-b309aadd.js +2 -0
  51. package/dist/atomic/p-b309aadd.js.map +1 -0
  52. package/dist/atomic/{p-e01d5fdd.entry.js → p-c25f1437.entry.js} +2 -2
  53. package/dist/atomic/{p-20764605.entry.js → p-ca3dc59b.entry.js} +2 -2
  54. package/dist/atomic/{p-55211c25.entry.js → p-cafa4083.entry.js} +2 -2
  55. package/dist/atomic/{p-4701feae.entry.js → p-cb3fd0f4.entry.js} +2 -2
  56. package/dist/atomic/{p-f11c8293.entry.js → p-ce5b896e.entry.js} +2 -2
  57. package/dist/atomic/p-f2bab68d.entry.js +2 -0
  58. package/dist/atomic/p-f2bab68d.entry.js.map +1 -0
  59. package/dist/atomic/{p-7f977dca.entry.js → p-f76b7ac3.entry.js} +2 -2
  60. package/dist/cjs/_loader.cjs.js +1 -1
  61. package/dist/cjs/{analytics-config-006dbe59.js → analytics-config-f2ef4006.js} +2 -2
  62. package/dist/cjs/{analytics-config-006dbe59.js.map → analytics-config-f2ef4006.js.map} +1 -1
  63. package/dist/cjs/atomic-generated-answer.cjs.entry.js +2 -2
  64. package/dist/cjs/atomic-insight-generated-answer.cjs.entry.js +2 -2
  65. package/dist/cjs/atomic-insight-interface.cjs.entry.js +1 -1
  66. package/dist/cjs/atomic-insight-search-box.cjs.entry.js +30 -4
  67. package/dist/cjs/atomic-insight-search-box.cjs.entry.js.map +1 -1
  68. package/dist/cjs/atomic-insight-smart-snippet-suggestions.cjs.entry.js +2 -2
  69. package/dist/cjs/atomic-insight-smart-snippet.cjs.entry.js +2 -2
  70. package/dist/cjs/atomic-ipx-result-link.cjs.entry.js +4 -4
  71. package/dist/cjs/atomic-ipx-result-link.cjs.entry.js.map +1 -1
  72. package/dist/cjs/atomic-recs-interface.cjs.entry.js +1 -1
  73. package/dist/cjs/atomic-result-link.cjs.entry.js +4 -4
  74. package/dist/cjs/atomic-result-link.cjs.entry.js.map +1 -1
  75. package/dist/cjs/atomic-result-printable-uri.cjs.entry.js +2 -2
  76. package/dist/cjs/{atomic-search-box-query-suggestions_2.cjs.entry.js → atomic-search-box-recent-queries.cjs.entry.js} +5 -68
  77. package/dist/cjs/atomic-search-box-recent-queries.cjs.entry.js.map +1 -0
  78. package/dist/cjs/atomic-search-box.cjs.entry.js +5 -5
  79. package/dist/cjs/atomic-search-box.cjs.entry.js.map +1 -1
  80. package/dist/cjs/atomic-smart-snippet-feedback-modal.cjs.entry.js +2 -2
  81. package/dist/cjs/atomic-smart-snippet-suggestions.cjs.entry.js +2 -2
  82. package/dist/cjs/atomic-smart-snippet.cjs.entry.js +2 -2
  83. package/dist/cjs/atomic-tab-manager.cjs.entry.js +1 -1
  84. package/dist/cjs/atomic.cjs.js +1 -1
  85. package/dist/cjs/{attributes-slot-afccc1fd.js → attributes-slot-4e7d7a75.js} +4 -9
  86. package/dist/cjs/attributes-slot-4e7d7a75.js.map +1 -0
  87. package/dist/cjs/{generated-answer-common-57443e50.js → generated-answer-common-3c400311.js} +4 -3
  88. package/dist/cjs/generated-answer-common-3c400311.js.map +1 -0
  89. package/dist/cjs/index-757bc886.js +2 -2
  90. package/dist/cjs/slot-utils-a30cb814.js +40 -0
  91. package/dist/cjs/slot-utils-a30cb814.js.map +1 -0
  92. package/dist/cjs/version.cjs.js +1 -1
  93. package/dist/esm/_loader.js +1 -1
  94. package/dist/esm/{analytics-config-efb8a50f.js → analytics-config-d3ba4e1e.js} +2 -2
  95. package/dist/esm/{analytics-config-efb8a50f.js.map → analytics-config-d3ba4e1e.js.map} +1 -1
  96. package/dist/esm/atomic-generated-answer.entry.js +2 -2
  97. package/dist/esm/atomic-insight-generated-answer.entry.js +2 -2
  98. package/dist/esm/atomic-insight-interface.entry.js +1 -1
  99. package/dist/esm/atomic-insight-search-box.entry.js +29 -3
  100. package/dist/esm/atomic-insight-search-box.entry.js.map +1 -1
  101. package/dist/esm/atomic-insight-smart-snippet-suggestions.entry.js +2 -2
  102. package/dist/esm/atomic-insight-smart-snippet.entry.js +2 -2
  103. package/dist/esm/atomic-ipx-result-link.entry.js +4 -4
  104. package/dist/esm/atomic-ipx-result-link.entry.js.map +1 -1
  105. package/dist/esm/atomic-recs-interface.entry.js +1 -1
  106. package/dist/esm/atomic-result-link.entry.js +4 -4
  107. package/dist/esm/atomic-result-link.entry.js.map +1 -1
  108. package/dist/esm/atomic-result-printable-uri.entry.js +2 -2
  109. package/dist/esm/{atomic-search-box-query-suggestions_2.entry.js → atomic-search-box-recent-queries.entry.js} +8 -70
  110. package/dist/esm/atomic-search-box-recent-queries.entry.js.map +1 -0
  111. package/dist/esm/atomic-search-box.entry.js +5 -5
  112. package/dist/esm/atomic-search-box.entry.js.map +1 -1
  113. package/dist/esm/atomic-smart-snippet-feedback-modal.entry.js +2 -2
  114. package/dist/esm/atomic-smart-snippet-suggestions.entry.js +2 -2
  115. package/dist/esm/atomic-smart-snippet.entry.js +2 -2
  116. package/dist/esm/atomic-tab-manager.entry.js +1 -1
  117. package/dist/esm/atomic.js +1 -1
  118. package/dist/esm/{attributes-slot-7bf61dda.js → attributes-slot-cb60f29b.js} +4 -9
  119. package/dist/esm/attributes-slot-cb60f29b.js.map +1 -0
  120. package/dist/esm/{generated-answer-common-8b06a33d.js → generated-answer-common-9d0c5ada.js} +4 -3
  121. package/dist/esm/generated-answer-common-9d0c5ada.js.map +1 -0
  122. package/dist/esm/index-3f35faca.js +2 -2
  123. package/dist/esm/slot-utils-dcf4fc27.js +37 -0
  124. package/dist/esm/slot-utils-dcf4fc27.js.map +1 -0
  125. package/dist/esm/version.js +1 -1
  126. package/dist/types/components/search/{search-box-suggestions/atomic-search-box-query-suggestions → atomic-search-box-query-suggestions}/atomic-search-box-query-suggestions.d.ts +16 -7
  127. package/dist/types/components/search/index.d.ts +1 -0
  128. package/dist/types/components.d.ts +0 -49
  129. package/dist/types/utils/slot-utils.d.ts +2 -2
  130. package/docs/atomic-docs.json +3 -102
  131. package/package.json +1 -1
  132. package/dist/atomic/components/atomic-search-box-query-suggestions.d.ts +0 -11
  133. package/dist/atomic/components/atomic-search-box-query-suggestions.js +0 -8
  134. package/dist/atomic/components/atomic-search-box-query-suggestions.js.map +0 -1
  135. package/dist/atomic/components/atomic-search-box-query-suggestions2.js +0 -89
  136. package/dist/atomic/components/atomic-search-box-query-suggestions2.js.map +0 -1
  137. package/dist/atomic/components/stencil-query-suggestions.js +0 -33
  138. package/dist/atomic/components/stencil-query-suggestions.js.map +0 -1
  139. package/dist/atomic/p-06349e36.entry.js.map +0 -1
  140. package/dist/atomic/p-0aec5665.entry.js.map +0 -1
  141. package/dist/atomic/p-644f71e2.entry.js.map +0 -1
  142. package/dist/atomic/p-6d52fad7.js.map +0 -1
  143. package/dist/atomic/p-a1522fe5.entry.js +0 -2
  144. package/dist/atomic/p-a1522fe5.entry.js.map +0 -1
  145. package/dist/atomic/p-a62f2bf9.js +0 -2
  146. package/dist/atomic/p-a62f2bf9.js.map +0 -1
  147. package/dist/atomic/p-af93b44c.js +0 -2
  148. package/dist/atomic/p-af93b44c.js.map +0 -1
  149. package/dist/atomic/p-df4397ab.entry.js +0 -2
  150. package/dist/atomic/p-df4397ab.entry.js.map +0 -1
  151. package/dist/atomic/p-e7ca5aea.js +0 -2
  152. package/dist/atomic/p-e7ca5aea.js.map +0 -1
  153. package/dist/cjs/atomic-search-box-query-suggestions_2.cjs.entry.js.map +0 -1
  154. package/dist/cjs/attributes-slot-afccc1fd.js.map +0 -1
  155. package/dist/cjs/generated-answer-common-57443e50.js.map +0 -1
  156. package/dist/cjs/slot-utils-086dacac.js +0 -23
  157. package/dist/cjs/slot-utils-086dacac.js.map +0 -1
  158. package/dist/cjs/stencil-query-suggestions-03268ecc.js +0 -38
  159. package/dist/cjs/stencil-query-suggestions-03268ecc.js.map +0 -1
  160. package/dist/esm/atomic-search-box-query-suggestions_2.entry.js.map +0 -1
  161. package/dist/esm/attributes-slot-7bf61dda.js.map +0 -1
  162. package/dist/esm/generated-answer-common-8b06a33d.js.map +0 -1
  163. package/dist/esm/slot-utils-3a3874a2.js +0 -20
  164. package/dist/esm/slot-utils-3a3874a2.js.map +0 -1
  165. package/dist/esm/stencil-query-suggestions-5d6a46d7.js +0 -33
  166. package/dist/esm/stencil-query-suggestions-5d6a46d7.js.map +0 -1
  167. /package/dist/atomic/{p-def0218c.js.map → p-2a240b53.js.map} +0 -0
  168. /package/dist/atomic/{p-f55bda96.entry.js.map → p-363efefa.entry.js.map} +0 -0
  169. /package/dist/atomic/{p-b2f5f6cb.entry.js.map → p-47ab6c9f.entry.js.map} +0 -0
  170. /package/dist/atomic/{p-2925bd87.entry.js.map → p-59b15bd6.entry.js.map} +0 -0
  171. /package/dist/atomic/{p-88af4470.entry.js.map → p-5a710350.entry.js.map} +0 -0
  172. /package/dist/atomic/{p-548d6a74.entry.js.map → p-7e87124d.entry.js.map} +0 -0
  173. /package/dist/atomic/{p-e01d5fdd.entry.js.map → p-c25f1437.entry.js.map} +0 -0
  174. /package/dist/atomic/{p-20764605.entry.js.map → p-ca3dc59b.entry.js.map} +0 -0
  175. /package/dist/atomic/{p-55211c25.entry.js.map → p-cafa4083.entry.js.map} +0 -0
  176. /package/dist/atomic/{p-4701feae.entry.js.map → p-cb3fd0f4.entry.js.map} +0 -0
  177. /package/dist/atomic/{p-f11c8293.entry.js.map → p-ce5b896e.entry.js.map} +0 -0
  178. /package/dist/atomic/{p-7f977dca.entry.js.map → p-f76b7ac3.entry.js.map} +0 -0
@@ -0,0 +1,37 @@
1
+ function hasLightDOMSlotContent(element) {
2
+ return ('slotContent' in element &&
3
+ typeof element.slotContent === 'object');
4
+ }
5
+ function getNamedSlotFromHost(host, slotName) {
6
+ if (hasLightDOMSlotContent(host)) {
7
+ const targetLightDomSlotContent = host.slotContent[slotName];
8
+ if (!targetLightDomSlotContent) {
9
+ return;
10
+ }
11
+ return targetLightDomSlotContent.find((node) => node instanceof Element);
12
+ }
13
+ const children = Array.from(host.children);
14
+ const targetSlot = children.filter((child) => child.getAttribute('slot') === slotName);
15
+ if (!targetSlot.length) {
16
+ return;
17
+ }
18
+ if (targetSlot.length > 1) {
19
+ console.warn(`Element should only have 1 slot named "${slotName}".`, host);
20
+ }
21
+ return targetSlot[0];
22
+ }
23
+ function getDefaultSlotFromHost(host) {
24
+ const children = Array.from(host.children);
25
+ const defaultSlot = children.filter((child) => !child.hasAttribute('slot') || child.getAttribute('slot') === '');
26
+ if (!defaultSlot.length) {
27
+ return;
28
+ }
29
+ if (defaultSlot.length > 1) {
30
+ console.warn('Element should only have 1 default slot.', host);
31
+ }
32
+ return defaultSlot[0];
33
+ }
34
+
35
+ export { getDefaultSlotFromHost as a, getNamedSlotFromHost as g };
36
+
37
+ //# sourceMappingURL=slot-utils-dcf4fc27.js.map
@@ -0,0 +1 @@
1
+ {"file":"slot-utils-dcf4fc27.js","mappings":"AAEA,SAAS,sBAAsB,CAC7B,OAAoB;IAEpB,QACE,aAAa,IAAI,OAAO;QACxB,OAAQ,OAA2C,CAAC,WAAW,KAAK,QAAQ,EAC5E;AACJ,CAAC;SAEe,oBAAoB,CAAC,IAAiB,EAAE,QAAgB;IACtE,IAAI,sBAAsB,CAAC,IAAI,CAAC,EAAE;QAChC,MAAM,yBAAyB,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAE7D,IAAI,CAAC,yBAAyB,EAAE;YAC9B,OAAO;SACR;QAED,OAAO,yBAAyB,CAAC,IAAI,CACnC,CAAC,IAAe,KAAK,IAAI,YAAY,OAAO,CAC7C,CAAC;KACH;IAED,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3C,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAChC,CAAC,KAAK,KAAK,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,QAAQ,CACnD,CAAC;IAEF,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;QACtB,OAAO;KACR;IAED,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;QACzB,OAAO,CAAC,IAAI,CAAC,0CAA0C,QAAQ,IAAI,EAAE,IAAI,CAAC,CAAC;KAC5E;IAED,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC;AACvB,CAAC;SAEe,sBAAsB,CAAC,IAAiB;IACtD,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3C,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CACjC,CAAC,KAAK,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,EAAE,CAC5E,CAAC;IAEF,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE;QACvB,OAAO;KACR;IAED,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;QAC1B,OAAO,CAAC,IAAI,CAAC,0CAA0C,EAAE,IAAI,CAAC,CAAC;KAChE;IAED,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC;AACxB;;;;","names":[],"sources":["src/utils/slot-utils.ts"],"sourcesContent":["import type {LightDOMWithSlots} from '@/src/mixins/slots-for-no-shadow-dom-mixin';\n\nfunction hasLightDOMSlotContent(\n element: HTMLElement\n): element is HTMLElement & LightDOMWithSlots {\n return (\n 'slotContent' in element &&\n typeof (element as HTMLElement & LightDOMWithSlots).slotContent === 'object'\n );\n}\n\nexport function getNamedSlotFromHost(host: HTMLElement, slotName: string) {\n if (hasLightDOMSlotContent(host)) {\n const targetLightDomSlotContent = host.slotContent[slotName];\n\n if (!targetLightDomSlotContent) {\n return;\n }\n\n return targetLightDomSlotContent.find(\n (node: ChildNode) => node instanceof Element\n );\n }\n\n const children = Array.from(host.children);\n const targetSlot = children.filter(\n (child) => child.getAttribute('slot') === slotName\n );\n\n if (!targetSlot.length) {\n return;\n }\n\n if (targetSlot.length > 1) {\n console.warn(`Element should only have 1 slot named \"${slotName}\".`, host);\n }\n\n return targetSlot[0];\n}\n\nexport function getDefaultSlotFromHost(host: HTMLElement) {\n const children = Array.from(host.children);\n const defaultSlot = children.filter(\n (child) => !child.hasAttribute('slot') || child.getAttribute('slot') === ''\n );\n\n if (!defaultSlot.length) {\n return;\n }\n\n if (defaultSlot.length > 1) {\n console.warn('Element should only have 1 default slot.', host);\n }\n\n return defaultSlot[0];\n}\n"],"version":3}
@@ -1,2 +1,2 @@
1
1
  export const headlessVersion = '3.31.1';
2
- export const atomicVersion = '3.34.0-pre.9b1e6d5dc1';
2
+ export const atomicVersion = '3.34.0-pre.b8c7c6d694';
@@ -1,9 +1,13 @@
1
+ import { type SearchBox } from '@coveo/headless';
2
+ import { LitElement } from 'lit';
3
+ import type { SearchBoxSuggestions, SearchBoxSuggestionsBindings } from "../../common/suggestions/suggestions-types";
4
+ import type { Bindings } from "../atomic-search-interface/interfaces";
5
+ import type { SearchBoxSuggestionsComponent } from "../../../decorators/types";
1
6
  /**
2
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.
3
8
  */
4
- export declare class AtomicSearchBoxQuerySuggestions {
5
- private bindings;
6
- private host;
9
+ export declare class AtomicSearchBoxQuerySuggestions extends LitElement implements SearchBoxSuggestionsComponent<Bindings> {
10
+ bindings: SearchBoxSuggestionsBindings<SearchBox, Bindings>;
7
11
  error: Error;
8
12
  /**
9
13
  * The SVG icon to display.
@@ -16,14 +20,19 @@ export declare class AtomicSearchBoxQuerySuggestions {
16
20
  /**
17
21
  * The maximum number of suggestions that will be displayed if the user has typed something into the input field.
18
22
  */
19
- maxWithQuery?: number;
23
+ maxWithQuery: number;
20
24
  /**
21
25
  * The maximum number of suggestions that will be displayed initially when the input field is empty.
22
26
  */
23
27
  maxWithoutQuery?: number;
24
- componentWillLoad(): void;
25
- private initialize;
28
+ connectedCallback(): void;
29
+ initialize(): SearchBoxSuggestions;
26
30
  private renderItems;
27
31
  private renderItem;
28
- render(): any;
32
+ render(): import("lit-html").TemplateResult<1>;
33
+ }
34
+ declare global {
35
+ interface HTMLElementTagNameMap {
36
+ 'atomic-search-box-query-suggestions': AtomicSearchBoxQuerySuggestions;
37
+ }
29
38
  }
@@ -1,5 +1,6 @@
1
1
  export { AtomicPager } from './atomic-pager/atomic-pager.js';
2
2
  export { AtomicQuerySummary } from './atomic-query-summary/atomic-query-summary.js';
3
3
  export { AtomicResultsPerPage } from './atomic-results-per-page/atomic-results-per-page.js';
4
+ export { AtomicSearchBoxQuerySuggestions } from './atomic-search-box-query-suggestions/atomic-search-box-query-suggestions.js';
4
5
  export { AtomicSearchInterface } from './atomic-search-interface/atomic-search-interface.js';
5
6
  export { AtomicSearchLayout } from './atomic-search-layout/atomic-search-layout.js';
@@ -2394,23 +2394,6 @@ export namespace Components {
2394
2394
  */
2395
2395
  "setRenderFunction": (resultRenderingFunction: ItemRenderingFunction) => Promise<void>;
2396
2396
  }
2397
- /**
2398
- * 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.
2399
- */
2400
- interface AtomicSearchBoxQuerySuggestions {
2401
- /**
2402
- * 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.
2403
- */
2404
- "icon"?: string;
2405
- /**
2406
- * The maximum number of suggestions that will be displayed if the user has typed something into the input field.
2407
- */
2408
- "maxWithQuery"?: number;
2409
- /**
2410
- * The maximum number of suggestions that will be displayed initially when the input field is empty.
2411
- */
2412
- "maxWithoutQuery"?: number;
2413
- }
2414
2397
  /**
2415
2398
  * 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.
2416
2399
  */
@@ -4071,15 +4054,6 @@ declare global {
4071
4054
  prototype: HTMLAtomicSearchBoxInstantResultsElement;
4072
4055
  new (): HTMLAtomicSearchBoxInstantResultsElement;
4073
4056
  };
4074
- /**
4075
- * 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.
4076
- */
4077
- interface HTMLAtomicSearchBoxQuerySuggestionsElement extends Components.AtomicSearchBoxQuerySuggestions, HTMLStencilElement {
4078
- }
4079
- var HTMLAtomicSearchBoxQuerySuggestionsElement: {
4080
- prototype: HTMLAtomicSearchBoxQuerySuggestionsElement;
4081
- new (): HTMLAtomicSearchBoxQuerySuggestionsElement;
4082
- };
4083
4057
  /**
4084
4058
  * 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.
4085
4059
  */
@@ -4482,7 +4456,6 @@ declare global {
4482
4456
  "atomic-result-timespan": HTMLAtomicResultTimespanElement;
4483
4457
  "atomic-search-box": HTMLAtomicSearchBoxElement;
4484
4458
  "atomic-search-box-instant-results": HTMLAtomicSearchBoxInstantResultsElement;
4485
- "atomic-search-box-query-suggestions": HTMLAtomicSearchBoxQuerySuggestionsElement;
4486
4459
  "atomic-search-box-recent-queries": HTMLAtomicSearchBoxRecentQueriesElement;
4487
4460
  "atomic-segmented-facet": HTMLAtomicSegmentedFacetElement;
4488
4461
  "atomic-segmented-facet-scrollable": HTMLAtomicSegmentedFacetScrollableElement;
@@ -6730,23 +6703,6 @@ declare namespace LocalJSX {
6730
6703
  */
6731
6704
  "maxResultsPerQuery"?: number;
6732
6705
  }
6733
- /**
6734
- * 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.
6735
- */
6736
- interface AtomicSearchBoxQuerySuggestions {
6737
- /**
6738
- * 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.
6739
- */
6740
- "icon"?: string;
6741
- /**
6742
- * The maximum number of suggestions that will be displayed if the user has typed something into the input field.
6743
- */
6744
- "maxWithQuery"?: number;
6745
- /**
6746
- * The maximum number of suggestions that will be displayed initially when the input field is empty.
6747
- */
6748
- "maxWithoutQuery"?: number;
6749
- }
6750
6706
  /**
6751
6707
  * 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.
6752
6708
  */
@@ -7268,7 +7224,6 @@ declare namespace LocalJSX {
7268
7224
  "atomic-result-timespan": AtomicResultTimespan;
7269
7225
  "atomic-search-box": AtomicSearchBox;
7270
7226
  "atomic-search-box-instant-results": AtomicSearchBoxInstantResults;
7271
- "atomic-search-box-query-suggestions": AtomicSearchBoxQuerySuggestions;
7272
7227
  "atomic-search-box-recent-queries": AtomicSearchBoxRecentQueries;
7273
7228
  "atomic-segmented-facet": AtomicSegmentedFacet;
7274
7229
  "atomic-segmented-facet-scrollable": AtomicSegmentedFacetScrollable;
@@ -7777,10 +7732,6 @@ declare module "@stencil/core" {
7777
7732
  * This component is not supported on mobile.
7778
7733
  */
7779
7734
  "atomic-search-box-instant-results": LocalJSX.AtomicSearchBoxInstantResults & JSXBase.HTMLAttributes<HTMLAtomicSearchBoxInstantResultsElement>;
7780
- /**
7781
- * 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.
7782
- */
7783
- "atomic-search-box-query-suggestions": LocalJSX.AtomicSearchBoxQuerySuggestions & JSXBase.HTMLAttributes<HTMLAtomicSearchBoxQuerySuggestionsElement>;
7784
7735
  /**
7785
7736
  * 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.
7786
7737
  */
@@ -1,2 +1,2 @@
1
- export declare function getNamedSlotContent(host: HTMLElement, slotName: string): Element[];
2
- export declare function getDefaultSlotContent(host: HTMLElement): Element[];
1
+ export declare function getNamedSlotFromHost(host: HTMLElement, slotName: string): Element | undefined;
2
+ export declare function getDefaultSlotFromHost(host: HTMLElement): Element | undefined;
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2025-10-03T13:25:19",
2
+ "timestamp": "2025-10-03T21:04:34",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.20.0",
@@ -12308,14 +12308,12 @@
12308
12308
  "dependents": [],
12309
12309
  "dependencies": [
12310
12310
  "atomic-suggestion-renderer",
12311
- "atomic-search-box-recent-queries",
12312
- "atomic-search-box-query-suggestions"
12311
+ "atomic-search-box-recent-queries"
12313
12312
  ],
12314
12313
  "dependencyGraph": {
12315
12314
  "atomic-search-box": [
12316
12315
  "atomic-suggestion-renderer",
12317
- "atomic-search-box-recent-queries",
12318
- "atomic-search-box-query-suggestions"
12316
+ "atomic-search-box-recent-queries"
12319
12317
  ]
12320
12318
  }
12321
12319
  },
@@ -12536,103 +12534,6 @@
12536
12534
  ]
12537
12535
  }
12538
12536
  },
12539
- {
12540
- "filePath": "src/components/search/search-box-suggestions/atomic-search-box-query-suggestions/atomic-search-box-query-suggestions.tsx",
12541
- "encapsulation": "shadow",
12542
- "tag": "atomic-search-box-query-suggestions",
12543
- "docs": "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.",
12544
- "docsTags": [],
12545
- "usage": {},
12546
- "props": [
12547
- {
12548
- "name": "icon",
12549
- "type": "string | undefined",
12550
- "complexType": {
12551
- "original": "string",
12552
- "resolved": "string | undefined",
12553
- "references": {}
12554
- },
12555
- "mutable": false,
12556
- "attr": "icon",
12557
- "reflectToAttr": false,
12558
- "docs": "The SVG icon to display.\n\n- Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location.\n- Use a value that starts with `assets://`, to display an icon from the Atomic package.\n- Use a stringified SVG to display it directly.",
12559
- "docsTags": [],
12560
- "values": [
12561
- {
12562
- "type": "string"
12563
- },
12564
- {
12565
- "type": "undefined"
12566
- }
12567
- ],
12568
- "optional": true,
12569
- "required": false
12570
- },
12571
- {
12572
- "name": "maxWithQuery",
12573
- "type": "number | undefined",
12574
- "complexType": {
12575
- "original": "number",
12576
- "resolved": "number | undefined",
12577
- "references": {}
12578
- },
12579
- "mutable": false,
12580
- "attr": "max-with-query",
12581
- "reflectToAttr": true,
12582
- "docs": "The maximum number of suggestions that will be displayed if the user has typed something into the input field.",
12583
- "docsTags": [],
12584
- "values": [
12585
- {
12586
- "type": "number"
12587
- },
12588
- {
12589
- "type": "undefined"
12590
- }
12591
- ],
12592
- "optional": true,
12593
- "required": false
12594
- },
12595
- {
12596
- "name": "maxWithoutQuery",
12597
- "type": "number | undefined",
12598
- "complexType": {
12599
- "original": "number",
12600
- "resolved": "number | undefined",
12601
- "references": {}
12602
- },
12603
- "mutable": false,
12604
- "attr": "max-without-query",
12605
- "reflectToAttr": true,
12606
- "docs": "The maximum number of suggestions that will be displayed initially when the input field is empty.",
12607
- "docsTags": [],
12608
- "values": [
12609
- {
12610
- "type": "number"
12611
- },
12612
- {
12613
- "type": "undefined"
12614
- }
12615
- ],
12616
- "optional": true,
12617
- "required": false
12618
- }
12619
- ],
12620
- "methods": [],
12621
- "events": [],
12622
- "listeners": [],
12623
- "styles": [],
12624
- "slots": [],
12625
- "parts": [],
12626
- "dependents": [
12627
- "atomic-search-box"
12628
- ],
12629
- "dependencies": [],
12630
- "dependencyGraph": {
12631
- "atomic-search-box": [
12632
- "atomic-search-box-query-suggestions"
12633
- ]
12634
- }
12635
- },
12636
12537
  {
12637
12538
  "filePath": "src/components/search/search-box-suggestions/atomic-search-box-recent-queries/atomic-search-box-recent-queries.tsx",
12638
12539
  "encapsulation": "shadow",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coveo/atomic",
3
3
  "type": "module",
4
- "version": "3.34.0-pre.9b1e6d5dc1",
4
+ "version": "3.34.0-pre.b8c7c6d694",
5
5
  "description": "A web-component library for building modern UIs interfacing with the Coveo platform",
6
6
  "homepage": "https://docs.coveo.com/en/atomic/latest/",
7
7
  "repository": {
@@ -1,11 +0,0 @@
1
- import type { Components, JSX } from "../../types/components";
2
-
3
- interface AtomicSearchBoxQuerySuggestions extends Components.AtomicSearchBoxQuerySuggestions, HTMLElement {}
4
- export const AtomicSearchBoxQuerySuggestions: {
5
- prototype: AtomicSearchBoxQuerySuggestions;
6
- new (): AtomicSearchBoxQuerySuggestions;
7
- };
8
- /**
9
- * Used to define this component and all nested components recursively.
10
- */
11
- export const defineCustomElement: () => void;
@@ -1,8 +0,0 @@
1
- import { A as AtomicSearchBoxQuerySuggestions$1, d as defineCustomElement$1 } from './atomic-search-box-query-suggestions2.js';
2
-
3
- const AtomicSearchBoxQuerySuggestions = AtomicSearchBoxQuerySuggestions$1;
4
- const defineCustomElement = defineCustomElement$1;
5
-
6
- export { AtomicSearchBoxQuerySuggestions, defineCustomElement };
7
-
8
- //# sourceMappingURL=atomic-search-box-query-suggestions.js.map
@@ -1 +0,0 @@
1
- {"file":"atomic-search-box-query-suggestions.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -1,89 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
- import { loadQuerySuggestActions } from '@coveo/headless';
3
- import { S as SearchIcon } from './search.js';
4
- import { g as getPartialSearchBoxSuggestionElement, Q as QuerySuggestionContainer, a as QuerySuggestionIcon, b as QuerySuggestionText } from './stencil-query-suggestions.js';
5
- import { d as dispatchSearchBoxSuggestionsEvent } from './suggestions-events.js';
6
-
7
- const AtomicSearchBoxQuerySuggestions = /*@__PURE__*/ proxyCustomElement(class AtomicSearchBoxQuerySuggestions extends HTMLElement {
8
- constructor() {
9
- super();
10
- this.__registerHost();
11
- this.__attachShadow();
12
- this.error = undefined;
13
- this.icon = undefined;
14
- this.maxWithQuery = undefined;
15
- this.maxWithoutQuery = undefined;
16
- }
17
- componentWillLoad() {
18
- try {
19
- dispatchSearchBoxSuggestionsEvent((bindings) => {
20
- this.bindings = bindings;
21
- return this.initialize();
22
- }, this.host, ['atomic-search-box']);
23
- }
24
- catch (error) {
25
- this.error = error;
26
- }
27
- }
28
- initialize() {
29
- const engine = this.bindings.engine;
30
- const { registerQuerySuggest, fetchQuerySuggestions } = loadQuerySuggestActions(engine);
31
- engine.dispatch(registerQuerySuggest({
32
- id: this.bindings.id,
33
- count: this.bindings.numberOfQueries,
34
- }));
35
- return {
36
- position: Array.from(this.host.parentNode.children).indexOf(this.host),
37
- onInput: () => engine.dispatch(fetchQuerySuggestions({
38
- id: this.bindings.id,
39
- })),
40
- renderItems: () => this.renderItems(),
41
- };
42
- }
43
- renderItems() {
44
- const hasQuery = this.bindings.searchBoxController.state.value !== '';
45
- const max = hasQuery ? this.maxWithQuery : this.maxWithoutQuery;
46
- return this.bindings.searchBoxController.state.suggestions
47
- .slice(0, max)
48
- .map((suggestion) => this.renderItem(suggestion));
49
- }
50
- renderItem(suggestion) {
51
- const hasQuery = this.bindings.searchBoxController.state.value !== '';
52
- const partialItem = getPartialSearchBoxSuggestionElement(suggestion, this.bindings.i18n);
53
- return {
54
- ...partialItem,
55
- content: (h(QuerySuggestionContainer, null, h(QuerySuggestionIcon, { icon: this.icon || SearchIcon, hasSuggestion: this.bindings.getSuggestions().length > 1 }), h(QuerySuggestionText, { suggestion: suggestion, hasQuery: hasQuery }))),
56
- onSelect: () => {
57
- this.bindings.searchBoxController.selectSuggestion(suggestion.rawValue);
58
- },
59
- };
60
- }
61
- render() {
62
- if (this.error) {
63
- return (h("atomic-component-error", { key: 'd8ace632cbbd5924ed771125cea0b395b021fe3e', element: this.host, error: this.error }));
64
- }
65
- }
66
- get host() { return this; }
67
- }, [1, "atomic-search-box-query-suggestions", {
68
- "icon": [1],
69
- "maxWithQuery": [514, "max-with-query"],
70
- "maxWithoutQuery": [514, "max-without-query"],
71
- "error": [32]
72
- }]);
73
- function defineCustomElement() {
74
- if (typeof customElements === "undefined") {
75
- return;
76
- }
77
- const components = ["atomic-search-box-query-suggestions"];
78
- components.forEach(tagName => { switch (tagName) {
79
- case "atomic-search-box-query-suggestions":
80
- if (!customElements.get(tagName)) {
81
- customElements.define(tagName, AtomicSearchBoxQuerySuggestions);
82
- }
83
- break;
84
- } });
85
- }
86
-
87
- export { AtomicSearchBoxQuerySuggestions as A, defineCustomElement as d };
88
-
89
- //# sourceMappingURL=atomic-search-box-query-suggestions2.js.map
@@ -1 +0,0 @@
1
- {"file":"atomic-search-box-query-suggestions2.js","mappings":";;;;;;MA8Ba,+BAA+B;;;;;;;;;;IAwB1C,iBAAiB;QACf,IAAI;YACF,iCAAiC,CAC/B,CAAC,QAAQ;gBACP,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;gBACzB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;aAC1B,EACD,IAAI,CAAC,IAAI,EACT,CAAC,mBAAmB,CAAC,CACtB,CAAC;SACH;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,KAAK,GAAG,KAAc,CAAC;SAC7B;KACF;IAEO,UAAU;QAChB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAG3B,CAAC;QACH,MAAM,EAAC,oBAAoB,EAAE,qBAAqB,EAAC,GACjD,uBAAuB,CAAC,MAAM,CAAC,CAAC;QAElC,MAAM,CAAC,QAAQ,CACb,oBAAoB,CAAC;YACnB,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE;YACpB,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,eAAe;SACrC,CAAC,CACH,CAAC;QAEF,OAAO;YACL,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAW,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YACvE,OAAO,EAAE,MACP,MAAM,CAAC,QAAQ,CACb,qBAAqB,CAAC;gBACpB,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE;aACrB,CAAC,CACH;YACH,WAAW,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE;SACtC,CAAC;KACH;IAEO,WAAW;QACjB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,KAAK,EAAE,CAAC;QACtE,MAAM,GAAG,GAAG,QAAQ,GAAG,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,eAAe,CAAC;QAChE,OAAO,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,KAAK,CAAC,WAAW;aACvD,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC;aACb,GAAG,CAAC,CAAC,UAAU,KAAK,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;KACrD;IAEO,UAAU,CAAC,UAAsB;QACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,KAAK,EAAE,CAAC;QACtE,MAAM,WAAW,GAAG,oCAAoC,CACtD,UAAU,EACV,IAAI,CAAC,QAAQ,CAAC,IAAI,CACnB,CAAC;QAEF,OAAO;YACL,GAAG,WAAW;YACd,OAAO,GACL,EAAC,wBAAwB,QACvB,EAAC,mBAAmB,IAClB,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,UAAU,EAC7B,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,MAAM,GAAG,CAAC,GACxD,EAEF,EAAC,mBAAmB,IAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAC1C,CAC5B;YACD,QAAQ,EAAE;gBACR,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;aACzE;SACF,CAAC;KACH;IAEM,MAAM;QACX,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,QACE,+EACE,OAAO,EAAE,IAAI,CAAC,IAAI,EAClB,KAAK,EAAE,IAAI,CAAC,KAAK,GACO,EAC1B;SACH;KACF;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/search/search-box-suggestions/atomic-search-box-query-suggestions/atomic-search-box-query-suggestions.tsx"],"sourcesContent":["import {\n loadQuerySuggestActions,\n SearchBox,\n SearchEngine,\n Suggestion,\n} from '@coveo/headless';\nimport {Component, Element, Prop, State, h} from '@stencil/core';\nimport SearchIcon from '../../../../images/search.svg';\nimport {\n getPartialSearchBoxSuggestionElement,\n QuerySuggestionContainer,\n QuerySuggestionIcon,\n QuerySuggestionText,\n} from '../../../common/suggestions/stencil-query-suggestions';\nimport {\n dispatchSearchBoxSuggestionsEvent,\n} from '../../../common/suggestions/suggestions-events';\nimport type {\n SearchBoxSuggestionElement,\n SearchBoxSuggestions,\n SearchBoxSuggestionsBindings,\n} from '../../../common/suggestions/suggestions-types';\n\n/**\n * 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.\n */\n@Component({\n tag: 'atomic-search-box-query-suggestions',\n shadow: true,\n})\nexport class AtomicSearchBoxQuerySuggestions {\n private bindings!: SearchBoxSuggestionsBindings<SearchBox>;\n @Element() private host!: HTMLElement;\n\n @State() public error!: Error;\n\n /**\n * The SVG icon to display.\n *\n * - Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location.\n * - Use a value that starts with `assets://`, to display an icon from the Atomic package.\n * - Use a stringified SVG to display it directly.\n */\n @Prop() public icon?: string;\n\n /**\n * The maximum number of suggestions that will be displayed if the user has typed something into the input field.\n */\n @Prop({reflect: true}) public maxWithQuery?: number;\n /**\n * The maximum number of suggestions that will be displayed initially when the input field is empty.\n */\n @Prop({reflect: true}) public maxWithoutQuery?: number;\n\n componentWillLoad() {\n try {\n dispatchSearchBoxSuggestionsEvent<SearchBox>(\n (bindings) => {\n this.bindings = bindings;\n return this.initialize();\n },\n this.host,\n ['atomic-search-box']\n );\n } catch (error) {\n this.error = error as Error;\n }\n }\n\n private initialize(): SearchBoxSuggestions {\n const engine = this.bindings.engine as SearchEngine<{\n querySet: string;\n querySuggest: string;\n }>;\n const {registerQuerySuggest, fetchQuerySuggestions} =\n loadQuerySuggestActions(engine);\n\n engine.dispatch(\n registerQuerySuggest({\n id: this.bindings.id,\n count: this.bindings.numberOfQueries,\n })\n );\n\n return {\n position: Array.from(this.host.parentNode!.children).indexOf(this.host),\n onInput: () =>\n engine.dispatch(\n fetchQuerySuggestions({\n id: this.bindings.id,\n })\n ),\n renderItems: () => this.renderItems(),\n };\n }\n\n private renderItems(): SearchBoxSuggestionElement[] {\n const hasQuery = this.bindings.searchBoxController.state.value !== '';\n const max = hasQuery ? this.maxWithQuery : this.maxWithoutQuery;\n return this.bindings.searchBoxController.state.suggestions\n .slice(0, max)\n .map((suggestion) => this.renderItem(suggestion));\n }\n\n private renderItem(suggestion: Suggestion) {\n const hasQuery = this.bindings.searchBoxController.state.value !== '';\n const partialItem = getPartialSearchBoxSuggestionElement(\n suggestion,\n this.bindings.i18n\n );\n\n return {\n ...partialItem,\n content: (\n <QuerySuggestionContainer>\n <QuerySuggestionIcon\n icon={this.icon || SearchIcon}\n hasSuggestion={this.bindings.getSuggestions().length > 1}\n />\n\n <QuerySuggestionText suggestion={suggestion} hasQuery={hasQuery} />\n </QuerySuggestionContainer>\n ),\n onSelect: () => {\n this.bindings.searchBoxController.selectSuggestion(suggestion.rawValue);\n },\n };\n }\n\n public render() {\n if (this.error) {\n return (\n <atomic-component-error\n element={this.host}\n error={this.error}\n ></atomic-component-error>\n );\n }\n }\n}\n"],"version":3}
@@ -1,33 +0,0 @@
1
- import { h } from '@stencil/core/internal/client';
2
- import { e as encodeForDomAttribute } from './string-utils.js';
3
-
4
- const getPartialSearchBoxSuggestionElement = (suggestion, i18n) => {
5
- return {
6
- part: 'query-suggestion-item',
7
- key: `qs-${encodeForDomAttribute(suggestion.rawValue)}`,
8
- query: suggestion.rawValue,
9
- ariaLabel: i18n.t('query-suggestion-label', {
10
- query: suggestion.rawValue,
11
- interpolation: { escapeValue: false },
12
- }),
13
- };
14
- };
15
- const QuerySuggestionContainer = (_, children) => {
16
- return (h("div", { part: "query-suggestion-content", class: "flex items-center" }, children));
17
- };
18
- const QuerySuggestionIcon = ({ icon, hasSuggestion }) => {
19
- if (!hasSuggestion) {
20
- return;
21
- }
22
- return (h("atomic-icon", { part: "query-suggestion-icon", icon: icon, class: "mr-2 h-4 w-4 shrink-0" }));
23
- };
24
- const QuerySuggestionText = ({ suggestion, hasQuery }) => {
25
- if (hasQuery) {
26
- return (h("span", { part: "query-suggestion-text", class: "line-clamp-2 break-all", innerHTML: suggestion.highlightedValue }));
27
- }
28
- return (h("span", { part: "query-suggestion-text", class: "line-clamp-2 break-all" }, suggestion.rawValue));
29
- };
30
-
31
- export { QuerySuggestionContainer as Q, QuerySuggestionIcon as a, QuerySuggestionText as b, getPartialSearchBoxSuggestionElement as g };
32
-
33
- //# sourceMappingURL=stencil-query-suggestions.js.map
@@ -1 +0,0 @@
1
- {"file":"stencil-query-suggestions.js","mappings":";;;MAUa,oCAAoC,GAAG,CAClD,UAAsB,EACtB,IAAU;IAEV,OAAO;QACL,IAAI,EAAE,uBAAuB;QAC7B,GAAG,EAAE,MAAM,qBAAqB,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QACvD,KAAK,EAAE,UAAU,CAAC,QAAQ;QAC1B,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,wBAAwB,EAAE;YAC1C,KAAK,EAAE,UAAU,CAAC,QAAQ;YAC1B,aAAa,EAAE,EAAC,WAAW,EAAE,KAAK,EAAC;SACpC,CAAC;KACH,CAAC;AACJ,EAAE;MAEW,wBAAwB,GAAwB,CAAC,CAAC,EAAE,QAAQ;IACvE,QACE,WAAK,IAAI,EAAC,0BAA0B,EAAC,KAAK,EAAC,mBAAmB,IAC3D,QAAQ,CACL,EACN;AACJ,EAAE;MAOW,mBAAmB,GAE5B,CAAC,EAAC,IAAI,EAAE,aAAa,EAAC;IACxB,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO;KACR;IAED,QACE,mBACE,IAAI,EAAC,uBAAuB,EAC5B,IAAI,EAAE,IAAI,EACV,KAAK,EAAC,uBAAuB,GAChB,EACf;AACJ,EAAE;MAOW,mBAAmB,GAE5B,CAAC,EAAC,UAAU,EAAE,QAAQ,EAAC;IACzB,IAAI,QAAQ,EAAE;QACZ,QACE,YACE,IAAI,EAAC,uBAAuB,EAC5B,KAAK,EAAC,wBAAwB,EAC9B,SAAS,EAAE,UAAU,CAAC,gBAAgB,GAChC,EACR;KACH;IAED,QACE,YAAM,IAAI,EAAC,uBAAuB,EAAC,KAAK,EAAC,wBAAwB,IAC9D,UAAU,CAAC,QAAQ,CACf,EACP;AACJ;;;;","names":[],"sources":["src/components/common/suggestions/stencil-query-suggestions.tsx"],"sourcesContent":["import {FunctionalComponent, h} from '@stencil/core';\nimport {i18n} from 'i18next';\nimport {encodeForDomAttribute} from '../../../utils/string-utils.js';\nimport {SearchBoxSuggestionElement} from './suggestions-types.js';\n\ninterface Suggestion {\n highlightedValue: string;\n rawValue: string;\n}\n\nexport const getPartialSearchBoxSuggestionElement = (\n suggestion: Suggestion,\n i18n: i18n\n): Pick<SearchBoxSuggestionElement, 'ariaLabel' | 'key' | 'query' | 'part'> => {\n return {\n part: 'query-suggestion-item',\n key: `qs-${encodeForDomAttribute(suggestion.rawValue)}`,\n query: suggestion.rawValue,\n ariaLabel: i18n.t('query-suggestion-label', {\n query: suggestion.rawValue,\n interpolation: {escapeValue: false},\n }),\n };\n};\n\nexport const QuerySuggestionContainer: FunctionalComponent = (_, children) => {\n return (\n <div part=\"query-suggestion-content\" class=\"flex items-center\">\n {children}\n </div>\n );\n};\n\ninterface QuerySuggestionIconProps {\n icon: string;\n hasSuggestion: boolean;\n}\n\nexport const QuerySuggestionIcon: FunctionalComponent<\n QuerySuggestionIconProps\n> = ({icon, hasSuggestion}) => {\n if (!hasSuggestion) {\n return;\n }\n\n return (\n <atomic-icon\n part=\"query-suggestion-icon\"\n icon={icon}\n class=\"mr-2 h-4 w-4 shrink-0\"\n ></atomic-icon>\n );\n};\n\ninterface QuerySuggestionTextProps {\n suggestion: Suggestion;\n hasQuery: boolean;\n}\n\nexport const QuerySuggestionText: FunctionalComponent<\n QuerySuggestionTextProps\n> = ({suggestion, hasQuery}) => {\n if (hasQuery) {\n return (\n <span\n part=\"query-suggestion-text\"\n class=\"line-clamp-2 break-all\"\n innerHTML={suggestion.highlightedValue}\n ></span>\n );\n }\n\n return (\n <span part=\"query-suggestion-text\" class=\"line-clamp-2 break-all\">\n {suggestion.rawValue}\n </span>\n );\n};\n"],"version":3}
@@ -1 +0,0 @@
1
- {"version":3,"names":["atomicResultLinkCss","AtomicResultLinkStyle0","AtomicResultLink","initialize","this","host","dispatchEvent","buildCustomEvent","stopPropagation","connectedCallback","slotName","hasDefaultSlot","getDefaultSlotContent","length","linkAttributes","getAttributesFromLinkSlot","render","href","isUndefined","hrefTemplate","result","clickUri","buildStringTemplateFromResult","bindings","h","LinkWithItemAnalytics","key","onSelect","interactiveResult","select","onBeginDelayedSelect","beginDelayedSelect","onCancelPendingSelect","cancelPendingSelect","attributes","field","default","__decorate","InitializeBindings","ResultContext","InteractiveResultContext"],"sources":["src/components/search/result-template-components/atomic-result-link/atomic-result-link.pcss?tag=atomic-result-link","src/components/search/result-template-components/atomic-result-link/atomic-result-link.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n@reference '../../../../utils/tailwind-utilities/link-style.css';\natomic-result-link {\n a {\n @apply link-style;\n }\n}\n","import {isUndefined} from '@coveo/bueno';\nimport {InteractiveResult} from '@coveo/headless';\nimport {Component, h, Prop, Element} from '@stencil/core';\nimport {buildCustomEvent} from '../../../../utils/event-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {buildStringTemplateFromResult} from '../../../../utils/result-utils';\nimport {getDefaultSlotContent} from '../../../../utils/slot-utils';\nimport {AnyUnfoldedItem} from '../../../common/item-list/unfolded-item';\nimport {getAttributesFromLinkSlot} from '../../../common/item-link/attributes-slot';\nimport {LinkWithItemAnalytics} from '../../../common/item-link/stencil-item-link';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {\n InteractiveResultContext,\n ResultContext,\n} from '../result-template-decorators';\n\n/**\n * The `atomic-result-link` component automatically transforms a search result title into a clickable link that points to the original item.\n * @slot default - Lets you display alternative content inside the link\n * @slot attributes - Lets you pass [attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attributes) down to the link element, overriding other attributes, to be used exclusively with an \"a\" tag such as `<a slot=\"attributes\" target=\"_blank\" download></a>`.\n */\n@Component({\n tag: 'atomic-result-link',\n styleUrl: 'atomic-result-link.pcss',\n shadow: false,\n})\nexport class AtomicResultLink implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n public error!: Error;\n\n @ResultContext() private result!: AnyUnfoldedItem;\n @InteractiveResultContext() private interactiveResult!: InteractiveResult;\n\n @Element() private host!: HTMLElement;\n\n /**\n * Specifies a template literal from which to generate the `href` attribute value (see\n * [Template literals](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals)).\n *\n * The template literal can reference any number of result properties from the parent result. It can also reference the window object.\n *\n * For example, the following markup generates an `href` value such as `http://uri.com?id=itemTitle`, using the result's `clickUri` and `itemtitle` fields.\n * ```html\n * <atomic-result-link href-template='${clickUri}?id=${raw.itemtitle}'></atomic-result-link>\n * ```\n */\n @Prop({reflect: true}) hrefTemplate?: string;\n\n private hasDefaultSlot!: boolean;\n private linkAttributes?: Attr[];\n private stopPropagation?: boolean;\n\n public initialize() {\n this.host.dispatchEvent(\n buildCustomEvent(\n 'atomic/resolveStopPropagation',\n (stopPropagation: boolean) => {\n this.stopPropagation = stopPropagation;\n }\n )\n );\n }\n\n public connectedCallback() {\n const slotName = 'attributes';\n this.hasDefaultSlot = getDefaultSlotContent(this.host).length > 0;\n this.linkAttributes = getAttributesFromLinkSlot(this.host, slotName);\n }\n\n public render() {\n const href = isUndefined(this.hrefTemplate)\n ? this.result.clickUri\n : buildStringTemplateFromResult(\n this.hrefTemplate,\n this.result,\n this.bindings\n );\n\n return (\n <LinkWithItemAnalytics\n href={href}\n onSelect={() => this.interactiveResult.select()}\n onBeginDelayedSelect={() => this.interactiveResult.beginDelayedSelect()}\n onCancelPendingSelect={() =>\n this.interactiveResult.cancelPendingSelect()\n }\n attributes={this.linkAttributes}\n stopPropagation={this.stopPropagation}\n >\n {this.hasDefaultSlot ? (\n <slot />\n ) : (\n <atomic-result-text\n field=\"title\"\n default=\"no-title\"\n ></atomic-result-text>\n )}\n </LinkWithItemAnalytics>\n );\n }\n}\n"],"mappings":"gfAAA,MAAMA,EAAsB,qwkEAC5B,MAAAC,EAAeD,E,iXC4BFE,EAAgB,M,qDA0BpB,UAAAC,GACLC,KAAKC,KAAKC,cACRC,EACE,iCACCC,IACCJ,KAAKI,gBAAkBA,CAAe,I,CAMvC,iBAAAC,GACL,MAAMC,EAAW,aACjBN,KAAKO,eAAkBC,EAAsBR,KAAKC,MAAMQ,OAAS,EACjET,KAAKU,eAAiBC,EAA0BX,KAAKC,KAAMK,E,CAGtD,MAAAM,GACL,MAAMC,EAAOC,EAAYd,KAAKe,cAC1Bf,KAAKgB,OAAOC,SACZC,EACElB,KAAKe,aACLf,KAAKgB,OACLhB,KAAKmB,UAGX,OACEC,EAACC,EAAqB,CAAAC,IAAA,2CACpBT,KAAMA,EACNU,SAAU,IAAMvB,KAAKwB,kBAAkBC,SACvCC,qBAAsB,IAAM1B,KAAKwB,kBAAkBG,qBACnDC,sBAAuB,IACrB5B,KAAKwB,kBAAkBK,sBAEzBC,WAAY9B,KAAKU,eACjBN,gBAAiBJ,KAAKI,iBAErBJ,KAAKO,eACJa,EAAA,aAEAA,EAAA,sBACEW,MAAM,QACNC,QAAQ,a,6BAnEWC,EAAA,CAA5BC,K,+BAGwBD,EAAA,CAAxBE,K,6BACmCF,EAAA,CAAnCG,K","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["atomicIpxResultLinkCss","AtomicIpxResultLinkStyle0","AtomicIPXResultLink","initialize","this","host","dispatchEvent","buildCustomEvent","stopPropagation","actionsHistoryActions","loadIPXActionsHistoryActions","bindings","engine","connectedCallback","slotName","hasDefaultSlot","getDefaultSlotContent","length","linkAttributes","getAttributesFromLinkSlot","onSelect","resultPermanentId","result","raw","permanentid","action","addPageViewEntryInActionsHistory","dispatch","interactiveResult","select","render","href","isUndefined","hrefTemplate","clickUri","buildStringTemplateFromResult","h","LinkWithItemAnalytics","key","onBeginDelayedSelect","beginDelayedSelect","onCancelPendingSelect","cancelPendingSelect","attributes","field","default","__decorate","InitializeBindings","ResultContext","InteractiveResultContext"],"sources":["src/components/ipx/atomic-ipx-result-link/atomic-ipx-result-link.pcss?tag=atomic-ipx-result-link","src/components/ipx/atomic-ipx-result-link/atomic-ipx-result-link.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n@reference '../../../utils/tailwind-utilities/link-style.css';\n\natomic-ipx-result-link {\n a {\n @apply link-style;\n }\n}\n","import {isUndefined} from '@coveo/bueno';\nimport {\n IPXActionsHistoryActionCreators,\n InteractiveResult,\n loadIPXActionsHistoryActions,\n} from '@coveo/headless';\nimport {Component, h, Prop, Element} from '@stencil/core';\nimport {buildCustomEvent} from '../../../utils/event-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {buildStringTemplateFromResult} from '../../../utils/result-utils';\nimport {getDefaultSlotContent} from '../../../utils/slot-utils';\nimport {AnyUnfoldedItem} from '../../common/item-list/unfolded-item';\nimport {getAttributesFromLinkSlot} from '../../common/item-link/attributes-slot';\nimport {LinkWithItemAnalytics} from '../../common/item-link/stencil-item-link';\nimport {RecsBindings} from '../../recommendations/atomic-recs-interface/atomic-recs-interface';\nimport {\n ResultContext,\n InteractiveResultContext,\n} from '../../search/result-template-components/result-template-decorators';\n\n/**\n * The `atomic-ipx-result-link` component automatically transforms a search result title into a clickable link that points to the original item. It is an experimental internal component not intended for general use.\n * @slot default - Lets you display alternative content inside the link\n * @slot attributes - Lets you pass [attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attributes) down to the link element, overriding other attributes, to be used exclusively with an \"a\" tag such as `<a slot=\"attributes\" target=\"_blank\" download></a>`.\n * @internal\n */\n@Component({\n tag: 'atomic-ipx-result-link',\n styleUrl: 'atomic-ipx-result-link.pcss',\n shadow: false,\n})\nexport class AtomicIPXResultLink\n implements InitializableComponent<RecsBindings>\n{\n @InitializeBindings() public bindings!: RecsBindings;\n public error!: Error;\n\n @ResultContext() private result!: AnyUnfoldedItem;\n @InteractiveResultContext() private interactiveResult!: InteractiveResult;\n\n @Element() private host!: HTMLElement;\n\n /**\n * Specifies a template literal from which to generate the `href` attribute value (see\n * [Template literals](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals)).\n *\n * The template literal can reference any number of result properties from the parent result. It can also reference the window object.\n *\n * For example, the following markup generates an `href` value such as `http://uri.com?id=itemTitle`, using the result's `clickUri` and `itemtitle` fields.\n * ```html\n * <atomic-ipx-result-link href-template='${clickUri}?id=${raw.itemtitle}'></atomic-ipx-result-link>\n * ```\n */\n @Prop({reflect: true}) hrefTemplate?: string;\n\n private hasDefaultSlot!: boolean;\n private linkAttributes?: Attr[];\n private stopPropagation?: boolean;\n private actionsHistoryActions?: IPXActionsHistoryActionCreators;\n\n public initialize() {\n this.host.dispatchEvent(\n buildCustomEvent(\n 'atomic/resolveStopPropagation',\n (stopPropagation: boolean) => {\n this.stopPropagation = stopPropagation;\n }\n )\n );\n this.actionsHistoryActions = loadIPXActionsHistoryActions(\n this.bindings.engine\n );\n }\n\n public connectedCallback() {\n const slotName = 'attributes';\n this.hasDefaultSlot = getDefaultSlotContent(this.host).length > 0;\n this.linkAttributes = getAttributesFromLinkSlot(this.host, slotName);\n }\n\n public async onSelect() {\n const resultPermanentId = this.result.raw.permanentid;\n if (resultPermanentId && this.actionsHistoryActions) {\n const action =\n this.actionsHistoryActions.addPageViewEntryInActionsHistory(\n resultPermanentId\n );\n this.bindings.engine.dispatch(action);\n }\n this.interactiveResult.select();\n }\n\n public render() {\n const href = isUndefined(this.hrefTemplate)\n ? this.result.clickUri\n : buildStringTemplateFromResult(\n this.hrefTemplate,\n this.result,\n this.bindings\n );\n\n return (\n <LinkWithItemAnalytics\n href={href}\n onSelect={() => this.onSelect()}\n onBeginDelayedSelect={() => this.interactiveResult.beginDelayedSelect()}\n onCancelPendingSelect={() =>\n this.interactiveResult.cancelPendingSelect()\n }\n attributes={this.linkAttributes}\n stopPropagation={this.stopPropagation}\n >\n {this.hasDefaultSlot ? (\n <slot />\n ) : (\n <atomic-result-text\n field=\"title\"\n default=\"no-title\"\n ></atomic-result-text>\n )}\n </LinkWithItemAnalytics>\n );\n }\n}\n"],"mappings":"uhBAAA,MAAMA,EAAyB,yzkEAC/B,MAAAC,EAAeD,E,iXCiCFE,EAAmB,M,qDA6BvB,UAAAC,GACLC,KAAKC,KAAKC,cACRC,EACE,iCACCC,IACCJ,KAAKI,gBAAkBA,CAAe,KAI5CJ,KAAKK,sBAAwBC,EAC3BN,KAAKO,SAASC,O,CAIX,iBAAAC,GACL,MAAMC,EAAW,aACjBV,KAAKW,eAAkBC,EAAsBZ,KAAKC,MAAMY,OAAS,EACjEb,KAAKc,eAAiBC,EAA0Bf,KAAKC,KAAMS,E,CAGtD,cAAMM,GACX,MAAMC,EAAoBjB,KAAKkB,OAAOC,IAAIC,YAC1C,GAAIH,GAAqBjB,KAAKK,sBAAuB,CACnD,MAAMgB,EACJrB,KAAKK,sBAAsBiB,iCACzBL,GAEJjB,KAAKO,SAASC,OAAOe,SAASF,E,CAEhCrB,KAAKwB,kBAAkBC,Q,CAGlB,MAAAC,GACL,MAAMC,EAAOC,EAAY5B,KAAK6B,cAC1B7B,KAAKkB,OAAOY,SACZC,EACE/B,KAAK6B,aACL7B,KAAKkB,OACLlB,KAAKO,UAGX,OACEyB,EAACC,EAAqB,CAAAC,IAAA,2CACpBP,KAAMA,EACNX,SAAU,IAAMhB,KAAKgB,WACrBmB,qBAAsB,IAAMnC,KAAKwB,kBAAkBY,qBACnDC,sBAAuB,IACrBrC,KAAKwB,kBAAkBc,sBAEzBC,WAAYvC,KAAKc,eACjBV,gBAAiBJ,KAAKI,iBAErBJ,KAAKW,eACJqB,EAAA,aAEAA,EAAA,sBACEQ,MAAM,QACNC,QAAQ,a,6BAnFWC,EAAA,CAA5BC,K,+BAGwBD,EAAA,CAAxBE,K,6BACmCF,EAAA,CAAnCG,K","ignoreList":[]}