@coveo/quantic 3.21.1 → 3.21.2-pre.6321b5196e

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.
@@ -11,7 +11,7 @@
11
11
  <template lwc:if={shouldDisplayRecentQueriesCard}>
12
12
  <c-quantic-card-container data-cy="recent-queries-card" title={label} onquantic__headerclick={toggleVisibility} onquantic__headerkeydown={toggleVisibility}>
13
13
  <lightning-button-icon class="slds-p-bottom_small" slot="actions" icon-name={actionButtonIcon}
14
- alternative-text={actionButtonLabel} variant="bare" tabindex="-1" aria-hidden="true">
14
+ alternative-text={actionButtonLabel} variant="bare" tabindex="-1" aria-hidden="true" data-testid="action-button">
15
15
  </lightning-button-icon>
16
16
  <template if:false={isCollapsed}>
17
17
  <div class="slds-m-top_medium">
@@ -23,12 +23,12 @@
23
23
  </template>
24
24
  <ul>
25
25
  <template for:each={queries} for:item="query" for:index="index">
26
- <li key={query} class="slds-grid" value={index} onclick={executeQuery}>
26
+ <li key={query} class="slds-grid" value={index} onclick={executeQuery} data-testid="recent-query-item">
27
27
  <button
28
28
  class="slds-button recent-query__container slds-grid_vertical-align-center slds-size_1-of-1 slds-p-around_x-small">
29
29
  <lightning-icon class="recent-query__icon slds-current-color" icon-name="utility:search"
30
30
  size="xx-small" aria-hidden="true"></lightning-icon>
31
- <span class="slds-text-body_small query-text__container slds-truncate">{query}</span>
31
+ <span class="slds-text-body_small query-text__container slds-truncate" data-testid="recent-query-text">{query}</span>
32
32
  </button>
33
33
  </li>
34
34
  </template>
@@ -5,6 +5,7 @@ import recentQueriesLabel from '@salesforce/label/c.quantic_RecentQueries';
5
5
  import {
6
6
  registerComponentForInit,
7
7
  initializeWithHeadless,
8
+ getHeadlessBundle,
8
9
  } from 'c/quanticHeadlessLoader';
9
10
  import {
10
11
  I18nUtils,
@@ -94,7 +95,8 @@ export default class QuanticRecentQueriesList extends LightningElement {
94
95
  * @param {SearchEngine} engine
95
96
  */
96
97
  initialize = (engine) => {
97
- this.recentQueriesList = CoveoHeadless.buildRecentQueriesList(engine, {
98
+ this.headless = getHeadlessBundle(this.engineId);
99
+ this.recentQueriesList = this.headless.buildRecentQueriesList(engine, {
98
100
  initialState: {
99
101
  queries: getItemFromLocalStorage(this.localStorageKey) ?? [],
100
102
  },