@coveo/atomic 3.33.9-pre.a90e222cec → 3.33.9-pre.b08e1fed00

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 (94) 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-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-user-actions-toggle.js +2 -2
  9. package/dist/atomic/components/atomic-insight-user-actions-toggle.js.map +1 -1
  10. package/dist/atomic/components/atomic-search-box.js +2 -8
  11. package/dist/atomic/components/atomic-search-box.js.map +1 -1
  12. package/dist/atomic/components/atomic-smart-snippet-feedback-modal2.js +2 -2
  13. package/dist/atomic/components/atomic-tab-manager.js +1 -1
  14. package/dist/atomic/components/clock.js +2 -2
  15. package/dist/atomic/components/components/search/atomic-search-box-recent-queries/atomic-search-box-recent-queries.js +137 -0
  16. package/dist/atomic/components/components/search/index.js +1 -0
  17. package/dist/atomic/components/components/search/lazy-index.js +1 -0
  18. package/dist/atomic/components/global/environment.js +1 -1
  19. package/dist/atomic/components/index.js.map +1 -1
  20. package/dist/atomic/{p-4b9a166f.entry.js → p-10da7681.entry.js} +2 -2
  21. package/dist/atomic/{p-c66047b4.entry.js → p-3cb67f27.entry.js} +2 -2
  22. package/dist/atomic/{p-406a288c.entry.js → p-6078667f.entry.js} +2 -2
  23. package/dist/atomic/{p-7b3c0d3f.js → p-69eea667.js} +2 -2
  24. package/dist/atomic/{p-600edff9.entry.js → p-79085d3e.entry.js} +2 -2
  25. package/dist/atomic/{p-6289adc7.entry.js → p-9239be63.entry.js} +2 -2
  26. package/dist/atomic/p-b10211b6.entry.js +2 -0
  27. package/dist/atomic/p-b10211b6.entry.js.map +1 -0
  28. package/dist/atomic/{p-e3edbf14.entry.js → p-b5ed8ce2.entry.js} +2 -2
  29. package/dist/atomic/{p-c280cd05.js → p-e1cc5150.js} +1 -1
  30. package/dist/cjs/_loader.cjs.js +1 -1
  31. package/dist/cjs/{analytics-config-b2bfc979.js → analytics-config-1998fb16.js} +2 -2
  32. package/dist/cjs/{analytics-config-b2bfc979.js.map → analytics-config-1998fb16.js.map} +1 -1
  33. package/dist/cjs/atomic-insight-history-toggle.cjs.entry.js +2 -2
  34. package/dist/cjs/atomic-insight-history-toggle.cjs.entry.js.map +1 -1
  35. package/dist/cjs/atomic-insight-interface.cjs.entry.js +1 -1
  36. package/dist/cjs/atomic-insight-user-actions-toggle.cjs.entry.js +2 -2
  37. package/dist/cjs/atomic-insight-user-actions-toggle.cjs.entry.js.map +1 -1
  38. package/dist/cjs/atomic-recs-interface.cjs.entry.js +1 -1
  39. package/dist/cjs/atomic-search-box-query-suggestions.cjs.entry.js +76 -0
  40. package/dist/cjs/atomic-search-box-query-suggestions.cjs.entry.js.map +1 -0
  41. package/dist/cjs/atomic-smart-snippet-feedback-modal.cjs.entry.js +2 -2
  42. package/dist/cjs/atomic-tab-manager.cjs.entry.js +1 -1
  43. package/dist/cjs/atomic.cjs.js +1 -1
  44. package/dist/cjs/clock-7aeb19d0.js +7 -0
  45. package/dist/cjs/clock-7aeb19d0.js.map +1 -0
  46. package/dist/cjs/index-757bc886.js +2 -2
  47. package/dist/cjs/version.cjs.js +2 -2
  48. package/dist/esm/_loader.js +1 -1
  49. package/dist/esm/{analytics-config-2e82e70d.js → analytics-config-e57598dc.js} +2 -2
  50. package/dist/esm/{analytics-config-2e82e70d.js.map → analytics-config-e57598dc.js.map} +1 -1
  51. package/dist/esm/atomic-insight-history-toggle.entry.js +2 -2
  52. package/dist/esm/atomic-insight-history-toggle.entry.js.map +1 -1
  53. package/dist/esm/atomic-insight-interface.entry.js +1 -1
  54. package/dist/esm/atomic-insight-user-actions-toggle.entry.js +2 -2
  55. package/dist/esm/atomic-insight-user-actions-toggle.entry.js.map +1 -1
  56. package/dist/esm/atomic-recs-interface.entry.js +1 -1
  57. package/dist/esm/atomic-search-box-query-suggestions.entry.js +72 -0
  58. package/dist/esm/atomic-search-box-query-suggestions.entry.js.map +1 -0
  59. package/dist/esm/atomic-smart-snippet-feedback-modal.entry.js +2 -2
  60. package/dist/esm/atomic-tab-manager.entry.js +1 -1
  61. package/dist/esm/atomic.js +1 -1
  62. package/dist/esm/clock-b1f5d7f7.js +5 -0
  63. package/dist/esm/clock-b1f5d7f7.js.map +1 -0
  64. package/dist/esm/index-3f35faca.js +2 -2
  65. package/dist/esm/version.js +2 -2
  66. package/dist/types/components/search/atomic-search-box-recent-queries/atomic-search-box-recent-queries.d.ts +45 -0
  67. package/dist/types/components/search/index.d.ts +1 -0
  68. package/dist/types/components.d.ts +0 -49
  69. package/docs/atomic-docs.json +1 -98
  70. package/package.json +3 -3
  71. package/dist/atomic/components/atomic-search-box-recent-queries.d.ts +0 -11
  72. package/dist/atomic/components/atomic-search-box-recent-queries.js +0 -8
  73. package/dist/atomic/components/atomic-search-box-recent-queries.js.map +0 -1
  74. package/dist/atomic/components/atomic-search-box-recent-queries2.js +0 -183
  75. package/dist/atomic/components/atomic-search-box-recent-queries2.js.map +0 -1
  76. package/dist/atomic/p-516b8165.entry.js +0 -2
  77. package/dist/atomic/p-516b8165.entry.js.map +0 -1
  78. package/dist/cjs/atomic-search-box-query-suggestions_2.cjs.entry.js +0 -234
  79. package/dist/cjs/atomic-search-box-query-suggestions_2.cjs.entry.js.map +0 -1
  80. package/dist/cjs/clock-f03ff827.js +0 -7
  81. package/dist/cjs/clock-f03ff827.js.map +0 -1
  82. package/dist/esm/atomic-search-box-query-suggestions_2.entry.js +0 -229
  83. package/dist/esm/atomic-search-box-query-suggestions_2.entry.js.map +0 -1
  84. package/dist/esm/clock-add3e9a5.js +0 -5
  85. package/dist/esm/clock-add3e9a5.js.map +0 -1
  86. package/dist/types/components/search/search-box-suggestions/atomic-search-box-recent-queries/atomic-search-box-recent-queries.d.ts +0 -37
  87. /package/dist/atomic/{p-4b9a166f.entry.js.map → p-10da7681.entry.js.map} +0 -0
  88. /package/dist/atomic/{p-c66047b4.entry.js.map → p-3cb67f27.entry.js.map} +0 -0
  89. /package/dist/atomic/{p-406a288c.entry.js.map → p-6078667f.entry.js.map} +0 -0
  90. /package/dist/atomic/{p-7b3c0d3f.js.map → p-69eea667.js.map} +0 -0
  91. /package/dist/atomic/{p-600edff9.entry.js.map → p-79085d3e.entry.js.map} +0 -0
  92. /package/dist/atomic/{p-6289adc7.entry.js.map → p-9239be63.entry.js.map} +0 -0
  93. /package/dist/atomic/{p-e3edbf14.entry.js.map → p-b5ed8ce2.entry.js.map} +0 -0
  94. /package/dist/atomic/{p-c280cd05.js.map → p-e1cc5150.js.map} +0 -0
@@ -2428,23 +2428,6 @@ export namespace Components {
2428
2428
  */
2429
2429
  "maxWithoutQuery"?: number;
2430
2430
  }
2431
- /**
2432
- * 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.
2433
- */
2434
- interface AtomicSearchBoxRecentQueries {
2435
- /**
2436
- * 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.
2437
- */
2438
- "icon"?: string;
2439
- /**
2440
- * The maximum number of suggestions that will be displayed if the user has typed something into the input field.
2441
- */
2442
- "maxWithQuery": number;
2443
- /**
2444
- * The maximum number of suggestions that will be displayed initially when the input field is empty.
2445
- */
2446
- "maxWithoutQuery"?: number;
2447
- }
2448
2431
  /**
2449
2432
  * The `atomic-segmented-facet` displays a horizontal facet of the results for the current query.
2450
2433
  */
@@ -4121,15 +4104,6 @@ declare global {
4121
4104
  prototype: HTMLAtomicSearchBoxQuerySuggestionsElement;
4122
4105
  new (): HTMLAtomicSearchBoxQuerySuggestionsElement;
4123
4106
  };
4124
- /**
4125
- * 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.
4126
- */
4127
- interface HTMLAtomicSearchBoxRecentQueriesElement extends Components.AtomicSearchBoxRecentQueries, HTMLStencilElement {
4128
- }
4129
- var HTMLAtomicSearchBoxRecentQueriesElement: {
4130
- prototype: HTMLAtomicSearchBoxRecentQueriesElement;
4131
- new (): HTMLAtomicSearchBoxRecentQueriesElement;
4132
- };
4133
4107
  /**
4134
4108
  * The `atomic-segmented-facet` displays a horizontal facet of the results for the current query.
4135
4109
  */
@@ -4525,7 +4499,6 @@ declare global {
4525
4499
  "atomic-search-box": HTMLAtomicSearchBoxElement;
4526
4500
  "atomic-search-box-instant-results": HTMLAtomicSearchBoxInstantResultsElement;
4527
4501
  "atomic-search-box-query-suggestions": HTMLAtomicSearchBoxQuerySuggestionsElement;
4528
- "atomic-search-box-recent-queries": HTMLAtomicSearchBoxRecentQueriesElement;
4529
4502
  "atomic-segmented-facet": HTMLAtomicSegmentedFacetElement;
4530
4503
  "atomic-segmented-facet-scrollable": HTMLAtomicSegmentedFacetScrollableElement;
4531
4504
  "atomic-smart-snippet": HTMLAtomicSmartSnippetElement;
@@ -6807,23 +6780,6 @@ declare namespace LocalJSX {
6807
6780
  */
6808
6781
  "maxWithoutQuery"?: number;
6809
6782
  }
6810
- /**
6811
- * 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.
6812
- */
6813
- interface AtomicSearchBoxRecentQueries {
6814
- /**
6815
- * 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.
6816
- */
6817
- "icon"?: string;
6818
- /**
6819
- * The maximum number of suggestions that will be displayed if the user has typed something into the input field.
6820
- */
6821
- "maxWithQuery"?: number;
6822
- /**
6823
- * The maximum number of suggestions that will be displayed initially when the input field is empty.
6824
- */
6825
- "maxWithoutQuery"?: number;
6826
- }
6827
6783
  /**
6828
6784
  * The `atomic-segmented-facet` displays a horizontal facet of the results for the current query.
6829
6785
  */
@@ -7330,7 +7286,6 @@ declare namespace LocalJSX {
7330
7286
  "atomic-search-box": AtomicSearchBox;
7331
7287
  "atomic-search-box-instant-results": AtomicSearchBoxInstantResults;
7332
7288
  "atomic-search-box-query-suggestions": AtomicSearchBoxQuerySuggestions;
7333
- "atomic-search-box-recent-queries": AtomicSearchBoxRecentQueries;
7334
7289
  "atomic-segmented-facet": AtomicSegmentedFacet;
7335
7290
  "atomic-segmented-facet-scrollable": AtomicSegmentedFacetScrollable;
7336
7291
  "atomic-smart-snippet": AtomicSmartSnippet;
@@ -7846,10 +7801,6 @@ declare module "@stencil/core" {
7846
7801
  * 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.
7847
7802
  */
7848
7803
  "atomic-search-box-query-suggestions": LocalJSX.AtomicSearchBoxQuerySuggestions & JSXBase.HTMLAttributes<HTMLAtomicSearchBoxQuerySuggestionsElement>;
7849
- /**
7850
- * 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.
7851
- */
7852
- "atomic-search-box-recent-queries": LocalJSX.AtomicSearchBoxRecentQueries & JSXBase.HTMLAttributes<HTMLAtomicSearchBoxRecentQueriesElement>;
7853
7804
  /**
7854
7805
  * The `atomic-segmented-facet` displays a horizontal facet of the results for the current query.
7855
7806
  */
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2025-10-01T20:22:26",
2
+ "timestamp": "2025-10-01T22:02:14",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.20.0",
@@ -12474,13 +12474,11 @@
12474
12474
  "dependents": [],
12475
12475
  "dependencies": [
12476
12476
  "atomic-suggestion-renderer",
12477
- "atomic-search-box-recent-queries",
12478
12477
  "atomic-search-box-query-suggestions"
12479
12478
  ],
12480
12479
  "dependencyGraph": {
12481
12480
  "atomic-search-box": [
12482
12481
  "atomic-suggestion-renderer",
12483
- "atomic-search-box-recent-queries",
12484
12482
  "atomic-search-box-query-suggestions"
12485
12483
  ]
12486
12484
  }
@@ -12799,101 +12797,6 @@
12799
12797
  ]
12800
12798
  }
12801
12799
  },
12802
- {
12803
- "filePath": "src/components/search/search-box-suggestions/atomic-search-box-recent-queries/atomic-search-box-recent-queries.tsx",
12804
- "encapsulation": "shadow",
12805
- "tag": "atomic-search-box-recent-queries",
12806
- "docs": "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.",
12807
- "docsTags": [],
12808
- "usage": {},
12809
- "props": [
12810
- {
12811
- "name": "icon",
12812
- "type": "string | undefined",
12813
- "complexType": {
12814
- "original": "string",
12815
- "resolved": "string | undefined",
12816
- "references": {}
12817
- },
12818
- "mutable": false,
12819
- "attr": "icon",
12820
- "reflectToAttr": false,
12821
- "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.",
12822
- "docsTags": [],
12823
- "values": [
12824
- {
12825
- "type": "string"
12826
- },
12827
- {
12828
- "type": "undefined"
12829
- }
12830
- ],
12831
- "optional": true,
12832
- "required": false
12833
- },
12834
- {
12835
- "name": "maxWithQuery",
12836
- "type": "number",
12837
- "complexType": {
12838
- "original": "number",
12839
- "resolved": "number",
12840
- "references": {}
12841
- },
12842
- "mutable": false,
12843
- "attr": "max-with-query",
12844
- "reflectToAttr": true,
12845
- "docs": "The maximum number of suggestions that will be displayed if the user has typed something into the input field.",
12846
- "docsTags": [],
12847
- "default": "3",
12848
- "values": [
12849
- {
12850
- "type": "number"
12851
- }
12852
- ],
12853
- "optional": false,
12854
- "required": false
12855
- },
12856
- {
12857
- "name": "maxWithoutQuery",
12858
- "type": "number | undefined",
12859
- "complexType": {
12860
- "original": "number",
12861
- "resolved": "number | undefined",
12862
- "references": {}
12863
- },
12864
- "mutable": false,
12865
- "attr": "max-without-query",
12866
- "reflectToAttr": true,
12867
- "docs": "The maximum number of suggestions that will be displayed initially when the input field is empty.",
12868
- "docsTags": [],
12869
- "values": [
12870
- {
12871
- "type": "number"
12872
- },
12873
- {
12874
- "type": "undefined"
12875
- }
12876
- ],
12877
- "optional": true,
12878
- "required": false
12879
- }
12880
- ],
12881
- "methods": [],
12882
- "events": [],
12883
- "listeners": [],
12884
- "styles": [],
12885
- "slots": [],
12886
- "parts": [],
12887
- "dependents": [
12888
- "atomic-search-box"
12889
- ],
12890
- "dependencies": [],
12891
- "dependencyGraph": {
12892
- "atomic-search-box": [
12893
- "atomic-search-box-recent-queries"
12894
- ]
12895
- }
12896
- },
12897
12800
  {
12898
12801
  "filePath": "src/components/search/facets/atomic-segmented-facet/atomic-segmented-facet.tsx",
12899
12802
  "encapsulation": "shadow",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coveo/atomic",
3
3
  "type": "module",
4
- "version": "3.33.9-pre.a90e222cec",
4
+ "version": "3.33.9-pre.b08e1fed00",
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": {
@@ -81,7 +81,7 @@
81
81
  },
82
82
  "dependencies": {
83
83
  "@coveo/bueno": "1.1.2",
84
- "@coveo/headless": "3.31.2-pre.a90e222cec",
84
+ "@coveo/headless": "3.31.1",
85
85
  "@lit/context": "1.1.6",
86
86
  "@open-wc/lit-helpers": "0.7.0",
87
87
  "@popperjs/core": "2.11.8",
@@ -153,7 +153,7 @@
153
153
  },
154
154
  "peerDependencies": {
155
155
  "@coveo/bueno": "1.1.2",
156
- "@coveo/headless": "3.31.2-pre.a90e222cec",
156
+ "@coveo/headless": "3.31.1",
157
157
  "typescript": ">=5.0.0"
158
158
  },
159
159
  "peerDependenciesMeta": {
@@ -1,11 +0,0 @@
1
- import type { Components, JSX } from "../../types/components";
2
-
3
- interface AtomicSearchBoxRecentQueries extends Components.AtomicSearchBoxRecentQueries, HTMLElement {}
4
- export const AtomicSearchBoxRecentQueries: {
5
- prototype: AtomicSearchBoxRecentQueries;
6
- new (): AtomicSearchBoxRecentQueries;
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 AtomicSearchBoxRecentQueries$1, d as defineCustomElement$1 } from './atomic-search-box-recent-queries2.js';
2
-
3
- const AtomicSearchBoxRecentQueries = AtomicSearchBoxRecentQueries$1;
4
- const defineCustomElement = defineCustomElement$1;
5
-
6
- export { AtomicSearchBoxRecentQueries, defineCustomElement };
7
-
8
- //# sourceMappingURL=atomic-search-box-recent-queries.js.map
@@ -1 +0,0 @@
1
- {"file":"atomic-search-box-recent-queries.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -1,183 +0,0 @@
1
- import { h, proxyCustomElement, HTMLElement } from '@stencil/core/internal/client';
2
- import { HighlightUtils, buildRecentQueriesList } from '@coveo/headless';
3
- import { C as Clock } from './clock.js';
4
- import { a as SafeStorage, S as StorageItems } from './local-storage-utils.js';
5
- import { o as once } from './utils.js';
6
- import { e as encodeForDomAttribute } from './string-utils.js';
7
- import { d as dispatchSearchBoxSuggestionsEvent } from './suggestions-events.js';
8
-
9
- const getPartialRecentQueryElement = (value, i18n) => {
10
- return {
11
- part: 'recent-query-item',
12
- query: value,
13
- key: `recent-${encodeForDomAttribute(value)}`,
14
- ariaLabel: i18n.t('recent-query-suggestion-label', {
15
- query: value,
16
- interpolation: { escapeValue: false },
17
- }),
18
- };
19
- };
20
- const getPartialRecentQueryClearElement = (i18n) => {
21
- return {
22
- key: 'recent-query-clear',
23
- ariaLabel: i18n.t('clear-recent-searches', {
24
- interpolation: { escapeValue: false },
25
- }),
26
- part: 'recent-query-title-item suggestion-divider',
27
- hideIfLast: true,
28
- };
29
- };
30
- const RecentQueriesContainer = (_, children) => {
31
- return (h("div", { part: "recent-query-content", class: "flex items-center text-left break-all" }, children));
32
- };
33
- const RecentQueryIcon = ({ icon, }) => {
34
- return (h("atomic-icon", { part: "recent-query-icon", icon: icon, class: "mr-2 h-4 w-4 shrink-0" }));
35
- };
36
- const RecentQueryText = ({ query, value, }) => {
37
- if (query === '') {
38
- return (h("span", { part: "recent-query-text", class: "line-clamp-2 break-all" }, value));
39
- }
40
- return (h("span", { part: "recent-query-text", class: "line-clamp-2 break-all", innerHTML: HighlightUtils.highlightString({
41
- content: value,
42
- openingDelimiter: '<span part="recent-query-text-highlight" class="font-bold">',
43
- closingDelimiter: '</span>',
44
- highlights: [
45
- {
46
- offset: query.length,
47
- length: value.length - query.length,
48
- },
49
- ],
50
- }) }));
51
- };
52
- const RecentQueryClear = ({ i18n, }) => {
53
- return (h("div", { part: "recent-query-title-content", class: "flex w-full justify-between" },
54
- h("span", { class: "font-bold", part: "recent-query-title" }, i18n.t('recent-searches')),
55
- h("span", { part: "recent-query-clear" }, i18n.t('clear'))));
56
- };
57
-
58
- const AtomicSearchBoxRecentQueries = /*@__PURE__*/ proxyCustomElement(class AtomicSearchBoxRecentQueries extends HTMLElement {
59
- constructor() {
60
- super();
61
- this.__registerHost();
62
- this.__attachShadow();
63
- /**
64
- * The maximum number of suggestions that will be displayed if the user has typed something into the input field.
65
- */
66
- this.maxWithQuery = 3;
67
- this.warnUser = once(() => this.bindings.engine.logger.warn('Because analytics are disabled, the recent queries feature is deactivated.'));
68
- this.error = undefined;
69
- this.icon = undefined;
70
- this.maxWithQuery = 3;
71
- this.maxWithoutQuery = undefined;
72
- }
73
- componentWillLoad() {
74
- try {
75
- dispatchSearchBoxSuggestionsEvent((bindings) => {
76
- this.bindings = bindings;
77
- return this.initialize();
78
- }, this.host, ['atomic-search-box']);
79
- }
80
- catch (error) {
81
- this.error = error;
82
- }
83
- }
84
- renderIcon() {
85
- return this.icon || Clock;
86
- }
87
- initialize() {
88
- this.storage = new SafeStorage();
89
- this.recentQueriesList = buildRecentQueriesList(this.bindings.engine, {
90
- initialState: { queries: this.retrieveLocalStorage() },
91
- options: { maxLength: 1000, clearFilters: this.bindings.clearFilters },
92
- });
93
- this.recentQueriesList.subscribe(() => this.updateLocalStorage());
94
- return {
95
- position: Array.from(this.host.parentNode.children).indexOf(this.host),
96
- renderItems: () => this.renderItems(),
97
- };
98
- }
99
- retrieveLocalStorage() {
100
- return this.storage.getParsedJSON(StorageItems.RECENT_QUERIES, []);
101
- }
102
- updateLocalStorage() {
103
- if (!this.recentQueriesList.state.analyticsEnabled) {
104
- return this.disableFeature();
105
- }
106
- return this.storage.setJSON(StorageItems.RECENT_QUERIES, this.recentQueriesList.state.queries);
107
- }
108
- disableFeature() {
109
- this.warnUser();
110
- this.storage.removeItem(StorageItems.RECENT_QUERIES);
111
- }
112
- renderItems() {
113
- if (!this.recentQueriesList.state.analyticsEnabled) {
114
- return [];
115
- }
116
- const query = this.bindings.searchBoxController.state.value;
117
- const hasQuery = query !== '';
118
- const max = hasQuery ? this.maxWithQuery : this.maxWithoutQuery;
119
- const filteredQueries = this.recentQueriesList.state.queries
120
- .filter((recentQuery) => recentQuery.toLowerCase().startsWith(query.toLowerCase()))
121
- .slice(0, max);
122
- const suggestionElements = filteredQueries.map((value) => this.renderItem(value));
123
- if (suggestionElements.length) {
124
- suggestionElements.unshift(this.renderClear());
125
- }
126
- return suggestionElements;
127
- }
128
- renderClear() {
129
- const partialItem = getPartialRecentQueryClearElement(this.bindings.i18n);
130
- return {
131
- ...partialItem,
132
- content: h(RecentQueryClear, { i18n: this.bindings.i18n }),
133
- onSelect: () => {
134
- this.recentQueriesList.clear();
135
- this.bindings.triggerSuggestions();
136
- },
137
- };
138
- }
139
- renderItem(value) {
140
- const query = this.bindings.searchBoxController.state.value;
141
- const partialItem = getPartialRecentQueryElement(value, this.bindings.i18n);
142
- return {
143
- ...partialItem,
144
- content: (h(RecentQueriesContainer, null, h(RecentQueryIcon, { icon: this.renderIcon() }), h(RecentQueryText, { query: query, value: value }))),
145
- onSelect: () => {
146
- if (this.bindings.isStandalone) {
147
- this.bindings.searchBoxController.updateText(value);
148
- this.bindings.searchBoxController.submit();
149
- return;
150
- }
151
- this.recentQueriesList.executeRecentQuery(this.recentQueriesList.state.queries.indexOf(value));
152
- },
153
- };
154
- }
155
- render() {
156
- if (this.error) {
157
- return (h("atomic-component-error", { key: '577129c08c073b99dbb6b86b77e2ffa7c2ff7f69', element: this.host, error: this.error }));
158
- }
159
- }
160
- get host() { return this; }
161
- }, [1, "atomic-search-box-recent-queries", {
162
- "icon": [1],
163
- "maxWithQuery": [514, "max-with-query"],
164
- "maxWithoutQuery": [514, "max-without-query"],
165
- "error": [32]
166
- }]);
167
- function defineCustomElement() {
168
- if (typeof customElements === "undefined") {
169
- return;
170
- }
171
- const components = ["atomic-search-box-recent-queries"];
172
- components.forEach(tagName => { switch (tagName) {
173
- case "atomic-search-box-recent-queries":
174
- if (!customElements.get(tagName)) {
175
- customElements.define(tagName, AtomicSearchBoxRecentQueries);
176
- }
177
- break;
178
- } });
179
- }
180
-
181
- export { AtomicSearchBoxRecentQueries as A, defineCustomElement as d };
182
-
183
- //# sourceMappingURL=atomic-search-box-recent-queries2.js.map
@@ -1 +0,0 @@
1
- {"file":"atomic-search-box-recent-queries2.js","mappings":";;;;;;;;AAMO,MAAM,4BAA4B,GAAG,CAC1C,KAAa,EACb,IAAU;IAEV,OAAO;QACL,IAAI,EAAE,mBAAmB;QACzB,KAAK,EAAE,KAAK;QACZ,GAAG,EAAE,UAAU,qBAAqB,CAAC,KAAK,CAAC,EAAE;QAC7C,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,+BAA+B,EAAE;YACjD,KAAK,EAAE,KAAK;YACZ,aAAa,EAAE,EAAC,WAAW,EAAE,KAAK,EAAC;SACpC,CAAC;KACH,CAAC;AACJ,CAAC,CAAC;AAEK,MAAM,iCAAiC,GAAG,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,CAAC,mBAAmB,CAAC,MAAM,EAAE,CAAC;oBAC3C,OAAO;iBACR;gBAED,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,CACvC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CACpD,CAAC;aACH;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/common/suggestions/stencil-recent-queries.tsx","src/components/search/search-box-suggestions/atomic-search-box-recent-queries/atomic-search-box-recent-queries.tsx"],"sourcesContent":["import {HighlightUtils} from '@coveo/headless';\nimport {FunctionalComponent, h} from '@stencil/core';\nimport {i18n} from 'i18next';\nimport {encodeForDomAttribute} from '../../../utils/string-utils';\nimport {SearchBoxSuggestionElement} from './suggestions-types';\n\nexport const getPartialRecentQueryElement = (\n value: string,\n i18n: i18n\n): Pick<SearchBoxSuggestionElement, 'ariaLabel' | 'key' | 'query' | 'part'> => {\n return {\n part: 'recent-query-item',\n query: value,\n key: `recent-${encodeForDomAttribute(value)}`,\n ariaLabel: i18n.t('recent-query-suggestion-label', {\n query: value,\n interpolation: {escapeValue: false},\n }),\n };\n};\n\nexport const getPartialRecentQueryClearElement = (\n i18n: i18n\n): Pick<\n SearchBoxSuggestionElement,\n 'ariaLabel' | 'key' | 'part' | 'hideIfLast'\n> => {\n return {\n key: 'recent-query-clear',\n ariaLabel: i18n.t('clear-recent-searches', {\n interpolation: {escapeValue: false},\n }),\n part: 'recent-query-title-item suggestion-divider',\n hideIfLast: true,\n };\n};\n\nexport const RecentQueriesContainer: FunctionalComponent = (_, children) => {\n return (\n <div\n part=\"recent-query-content\"\n class=\"flex items-center text-left break-all\"\n >\n {children}\n </div>\n );\n};\n\ninterface RecentQueryIconProps {\n icon: string;\n}\n\nexport const RecentQueryIcon: FunctionalComponent<RecentQueryIconProps> = ({\n icon,\n}) => {\n return (\n <atomic-icon\n part=\"recent-query-icon\"\n icon={icon}\n class=\"mr-2 h-4 w-4 shrink-0\"\n ></atomic-icon>\n );\n};\n\ninterface RecentQueryTextProps {\n query: string;\n value: string;\n}\n\nexport const RecentQueryText: FunctionalComponent<RecentQueryTextProps> = ({\n query,\n value,\n}) => {\n if (query === '') {\n return (\n <span part=\"recent-query-text\" class=\"line-clamp-2 break-all\">\n {value}\n </span>\n );\n }\n return (\n <span\n part=\"recent-query-text\"\n class=\"line-clamp-2 break-all\"\n innerHTML={HighlightUtils.highlightString({\n content: value,\n openingDelimiter:\n '<span part=\"recent-query-text-highlight\" class=\"font-bold\">',\n closingDelimiter: '</span>',\n highlights: [\n {\n offset: query.length,\n length: value.length - query.length,\n },\n ],\n })}\n ></span>\n );\n};\n\ninterface RecentQueryClearProps {\n i18n: i18n;\n}\n\nexport const RecentQueryClear: FunctionalComponent<RecentQueryClearProps> = ({\n i18n,\n}) => {\n return (\n <div part=\"recent-query-title-content\" class=\"flex w-full justify-between\">\n <span class=\"font-bold\" part=\"recent-query-title\">\n {i18n.t('recent-searches')}\n </span>\n <span part=\"recent-query-clear\">{i18n.t('clear')}</span>\n </div>\n );\n};\n","import {\n buildRecentQueriesList,\n RecentQueriesList,\n SearchBox,\n} from '@coveo/headless';\nimport {Component, Element, Prop, State, h} from '@stencil/core';\nimport Clock from '../../../../images/clock.svg';\nimport {SafeStorage, StorageItems} from '../../../../utils/local-storage-utils';\nimport {once} from '../../../../utils/utils';\nimport {\n getPartialRecentQueryClearElement,\n getPartialRecentQueryElement,\n RecentQueriesContainer,\n RecentQueryClear,\n RecentQueryIcon,\n RecentQueryText,\n} from '../../../common/suggestions/stencil-recent-queries';\nimport {\n dispatchSearchBoxSuggestionsEvent,\n} from '../../../common/suggestions/suggestions-events';\nimport type {\n SearchBoxSuggestionElement,\n SearchBoxSuggestions,\n SearchBoxSuggestionsBindings,\n} from '../../../common/suggestions/suggestions-types';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\n\n/**\n * 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.\n */\n@Component({\n tag: 'atomic-search-box-recent-queries',\n shadow: true,\n})\nexport class AtomicSearchBoxRecentQueries {\n private bindings!: SearchBoxSuggestionsBindings<SearchBox, Bindings>;\n private recentQueriesList!: RecentQueriesList;\n private storage!: SafeStorage;\n\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 = 3;\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, Bindings>(\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 renderIcon() {\n return this.icon || Clock;\n }\n\n private initialize(): SearchBoxSuggestions {\n this.storage = new SafeStorage();\n this.recentQueriesList = buildRecentQueriesList(this.bindings.engine, {\n initialState: {queries: this.retrieveLocalStorage()},\n options: {maxLength: 1000, clearFilters: this.bindings.clearFilters},\n });\n\n this.recentQueriesList.subscribe(() => this.updateLocalStorage());\n\n return {\n position: Array.from(this.host.parentNode!.children).indexOf(this.host),\n renderItems: () => this.renderItems(),\n };\n }\n\n private retrieveLocalStorage() {\n return this.storage.getParsedJSON(StorageItems.RECENT_QUERIES, []);\n }\n\n private updateLocalStorage() {\n if (!this.recentQueriesList.state.analyticsEnabled) {\n return this.disableFeature();\n }\n\n return this.storage.setJSON(\n StorageItems.RECENT_QUERIES,\n this.recentQueriesList.state.queries\n );\n }\n\n private warnUser = once(() =>\n this.bindings.engine.logger.warn(\n 'Because analytics are disabled, the recent queries feature is deactivated.'\n )\n );\n\n private disableFeature() {\n this.warnUser();\n this.storage.removeItem(StorageItems.RECENT_QUERIES);\n }\n\n private renderItems(): SearchBoxSuggestionElement[] {\n if (!this.recentQueriesList.state.analyticsEnabled) {\n return [];\n }\n\n const query = this.bindings.searchBoxController.state.value;\n const hasQuery = query !== '';\n const max = hasQuery ? this.maxWithQuery : this.maxWithoutQuery;\n const filteredQueries = this.recentQueriesList.state.queries\n .filter((recentQuery) =>\n recentQuery.toLowerCase().startsWith(query.toLowerCase())\n )\n .slice(0, max);\n\n const suggestionElements: SearchBoxSuggestionElement[] =\n filteredQueries.map((value) => this.renderItem(value));\n if (suggestionElements.length) {\n suggestionElements.unshift(this.renderClear());\n }\n\n return suggestionElements;\n }\n\n private renderClear(): SearchBoxSuggestionElement {\n const partialItem = getPartialRecentQueryClearElement(this.bindings.i18n);\n\n return {\n ...partialItem,\n content: <RecentQueryClear i18n={this.bindings.i18n} />,\n onSelect: () => {\n this.recentQueriesList.clear();\n this.bindings.triggerSuggestions();\n },\n };\n }\n\n private renderItem(value: string): SearchBoxSuggestionElement {\n const query = this.bindings.searchBoxController.state.value;\n const partialItem = getPartialRecentQueryElement(value, this.bindings.i18n);\n return {\n ...partialItem,\n content: (\n <RecentQueriesContainer>\n <RecentQueryIcon icon={this.renderIcon()} />\n <RecentQueryText query={query} value={value} />\n </RecentQueriesContainer>\n ),\n\n onSelect: () => {\n if (this.bindings.isStandalone) {\n this.bindings.searchBoxController.updateText(value);\n this.bindings.searchBoxController.submit();\n return;\n }\n\n this.recentQueriesList.executeRecentQuery(\n this.recentQueriesList.state.queries.indexOf(value)\n );\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,2 +0,0 @@
1
- import{r as t,h as e,g as s}from"./p-dc3df5ce.js";import{loadQuerySuggestActions as r,HighlightUtils as i,buildRecentQueriesList as n}from"@coveo/headless";import{S as c}from"./p-cfb3c589.js";import{g as o,Q as a,a as h,b as l}from"./p-af93b44c.js";import{d as u}from"./p-4b7a19db.js";import{C as p}from"./p-c280cd05.js";import{S as d,a as f}from"./p-946fe85f.js";import{o as m}from"./p-a12e1c59.js";import{e as y}from"./p-8f5830b4.js";import"./p-c9074946.js";import"./p-1580513b.js";import"./p-f284897c.js";import"./p-0462f723.js";const b=class{constructor(e){t(this,e);this.error=undefined;this.icon=undefined;this.maxWithQuery=undefined;this.maxWithoutQuery=undefined}componentWillLoad(){try{u((t=>{this.bindings=t;return this.initialize()}),this.host,["atomic-search-box"])}catch(t){this.error=t}}initialize(){const t=this.bindings.engine;const{registerQuerySuggest:e,fetchQuerySuggestions:s}=r(t);t.dispatch(e({id:this.bindings.id,count:this.bindings.numberOfQueries}));return{position:Array.from(this.host.parentNode.children).indexOf(this.host),onInput:()=>t.dispatch(s({id:this.bindings.id})),renderItems:()=>this.renderItems()}}renderItems(){const t=this.bindings.searchBoxController.state.value!=="";const e=t?this.maxWithQuery:this.maxWithoutQuery;return this.bindings.searchBoxController.state.suggestions.slice(0,e).map((t=>this.renderItem(t)))}renderItem(t){const s=this.bindings.searchBoxController.state.value!=="";const r=o(t,this.bindings.i18n);return{...r,content:e(l,null,e(h,{icon:this.icon||c,hasSuggestion:this.bindings.getSuggestions().length>1}),e(a,{suggestion:t,hasQuery:s})),onSelect:()=>{this.bindings.searchBoxController.selectSuggestion(t.rawValue)}}}render(){if(this.error){return e("atomic-component-error",{key:"ee518dd01ee68d5ac1e13c37335888acf7089beb",element:this.host,error:this.error})}}get host(){return s(this)}};const g=(t,e)=>({part:"recent-query-item",query:t,key:`recent-${y(t)}`,ariaLabel:e.t("recent-query-suggestion-label",{query:t,interpolation:{escapeValue:false}})});const q=t=>({key:"recent-query-clear",ariaLabel:t.t("clear-recent-searches",{interpolation:{escapeValue:false}}),part:"recent-query-title-item suggestion-divider",hideIfLast:true});const j=(t,s)=>e("div",{part:"recent-query-content",class:"flex items-center text-left break-all"},s);const x=({icon:t})=>e("atomic-icon",{part:"recent-query-icon",icon:t,class:"mr-2 h-4 w-4 shrink-0"});const S=({query:t,value:s})=>{if(t===""){return e("span",{part:"recent-query-text",class:"line-clamp-2 break-all"},s)}return e("span",{part:"recent-query-text",class:"line-clamp-2 break-all",innerHTML:i.highlightString({content:s,openingDelimiter:'<span part="recent-query-text-highlight" class="font-bold">',closingDelimiter:"</span>",highlights:[{offset:t.length,length:s.length-t.length}]})})};const I=({i18n:t})=>e("div",{part:"recent-query-title-content",class:"flex w-full justify-between"},e("span",{class:"font-bold",part:"recent-query-title"},t.t("recent-searches")),e("span",{part:"recent-query-clear"},t.t("clear")));const L=class{constructor(e){t(this,e);this.maxWithQuery=3;this.warnUser=m((()=>this.bindings.engine.logger.warn("Because analytics are disabled, the recent queries feature is deactivated.")));this.error=undefined;this.icon=undefined;this.maxWithQuery=3;this.maxWithoutQuery=undefined}componentWillLoad(){try{u((t=>{this.bindings=t;return this.initialize()}),this.host,["atomic-search-box"])}catch(t){this.error=t}}renderIcon(){return this.icon||p}initialize(){this.storage=new d;this.recentQueriesList=n(this.bindings.engine,{initialState:{queries:this.retrieveLocalStorage()},options:{maxLength:1e3,clearFilters:this.bindings.clearFilters}});this.recentQueriesList.subscribe((()=>this.updateLocalStorage()));return{position:Array.from(this.host.parentNode.children).indexOf(this.host),renderItems:()=>this.renderItems()}}retrieveLocalStorage(){return this.storage.getParsedJSON(f.RECENT_QUERIES,[])}updateLocalStorage(){if(!this.recentQueriesList.state.analyticsEnabled){return this.disableFeature()}return this.storage.setJSON(f.RECENT_QUERIES,this.recentQueriesList.state.queries)}disableFeature(){this.warnUser();this.storage.removeItem(f.RECENT_QUERIES)}renderItems(){if(!this.recentQueriesList.state.analyticsEnabled){return[]}const t=this.bindings.searchBoxController.state.value;const e=t!=="";const s=e?this.maxWithQuery:this.maxWithoutQuery;const r=this.recentQueriesList.state.queries.filter((e=>e.toLowerCase().startsWith(t.toLowerCase()))).slice(0,s);const i=r.map((t=>this.renderItem(t)));if(i.length){i.unshift(this.renderClear())}return i}renderClear(){const t=q(this.bindings.i18n);return{...t,content:e(I,{i18n:this.bindings.i18n}),onSelect:()=>{this.recentQueriesList.clear();this.bindings.triggerSuggestions()}}}renderItem(t){const s=this.bindings.searchBoxController.state.value;const r=g(t,this.bindings.i18n);return{...r,content:e(j,null,e(x,{icon:this.renderIcon()}),e(S,{query:s,value:t})),onSelect:()=>{if(this.bindings.isStandalone){this.bindings.searchBoxController.updateText(t);this.bindings.searchBoxController.submit();return}this.recentQueriesList.executeRecentQuery(this.recentQueriesList.state.queries.indexOf(t))}}}render(){if(this.error){return e("atomic-component-error",{key:"577129c08c073b99dbb6b86b77e2ffa7c2ff7f69",element:this.host,error:this.error})}}get host(){return s(this)}};export{b as atomic_search_box_query_suggestions,L as atomic_search_box_recent_queries};
2
- //# sourceMappingURL=p-516b8165.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["AtomicSearchBoxQuerySuggestions","componentWillLoad","dispatchSearchBoxSuggestionsEvent","bindings","this","initialize","host","error","engine","registerQuerySuggest","fetchQuerySuggestions","loadQuerySuggestActions","dispatch","id","count","numberOfQueries","position","Array","from","parentNode","children","indexOf","onInput","renderItems","hasQuery","searchBoxController","state","value","max","maxWithQuery","maxWithoutQuery","suggestions","slice","map","suggestion","renderItem","partialItem","getPartialSearchBoxSuggestionElement","i18n","content","h","QuerySuggestionContainer","QuerySuggestionIcon","icon","SearchIcon","hasSuggestion","getSuggestions","length","QuerySuggestionText","onSelect","selectSuggestion","rawValue","render","key","element","getPartialRecentQueryElement","part","query","encodeForDomAttribute","ariaLabel","t","interpolation","escapeValue","getPartialRecentQueryClearElement","hideIfLast","RecentQueriesContainer","_","class","RecentQueryIcon","RecentQueryText","innerHTML","HighlightUtils","highlightString","openingDelimiter","closingDelimiter","highlights","offset","RecentQueryClear","AtomicSearchBoxRecentQueries","warnUser","once","logger","warn","renderIcon","Clock","storage","SafeStorage","recentQueriesList","buildRecentQueriesList","initialState","queries","retrieveLocalStorage","options","maxLength","clearFilters","subscribe","updateLocalStorage","getParsedJSON","StorageItems","RECENT_QUERIES","analyticsEnabled","disableFeature","setJSON","removeItem","filteredQueries","filter","recentQuery","toLowerCase","startsWith","suggestionElements","unshift","renderClear","clear","triggerSuggestions","isStandalone","updateText","submit","executeRecentQuery"],"sources":["src/components/search/search-box-suggestions/atomic-search-box-query-suggestions/atomic-search-box-query-suggestions.tsx","src/components/common/suggestions/stencil-recent-queries.tsx","src/components/search/search-box-suggestions/atomic-search-box-recent-queries/atomic-search-box-recent-queries.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","import {HighlightUtils} from '@coveo/headless';\nimport {FunctionalComponent, h} from '@stencil/core';\nimport {i18n} from 'i18next';\nimport {encodeForDomAttribute} from '../../../utils/string-utils';\nimport {SearchBoxSuggestionElement} from './suggestions-types';\n\nexport const getPartialRecentQueryElement = (\n value: string,\n i18n: i18n\n): Pick<SearchBoxSuggestionElement, 'ariaLabel' | 'key' | 'query' | 'part'> => {\n return {\n part: 'recent-query-item',\n query: value,\n key: `recent-${encodeForDomAttribute(value)}`,\n ariaLabel: i18n.t('recent-query-suggestion-label', {\n query: value,\n interpolation: {escapeValue: false},\n }),\n };\n};\n\nexport const getPartialRecentQueryClearElement = (\n i18n: i18n\n): Pick<\n SearchBoxSuggestionElement,\n 'ariaLabel' | 'key' | 'part' | 'hideIfLast'\n> => {\n return {\n key: 'recent-query-clear',\n ariaLabel: i18n.t('clear-recent-searches', {\n interpolation: {escapeValue: false},\n }),\n part: 'recent-query-title-item suggestion-divider',\n hideIfLast: true,\n };\n};\n\nexport const RecentQueriesContainer: FunctionalComponent = (_, children) => {\n return (\n <div\n part=\"recent-query-content\"\n class=\"flex items-center text-left break-all\"\n >\n {children}\n </div>\n );\n};\n\ninterface RecentQueryIconProps {\n icon: string;\n}\n\nexport const RecentQueryIcon: FunctionalComponent<RecentQueryIconProps> = ({\n icon,\n}) => {\n return (\n <atomic-icon\n part=\"recent-query-icon\"\n icon={icon}\n class=\"mr-2 h-4 w-4 shrink-0\"\n ></atomic-icon>\n );\n};\n\ninterface RecentQueryTextProps {\n query: string;\n value: string;\n}\n\nexport const RecentQueryText: FunctionalComponent<RecentQueryTextProps> = ({\n query,\n value,\n}) => {\n if (query === '') {\n return (\n <span part=\"recent-query-text\" class=\"line-clamp-2 break-all\">\n {value}\n </span>\n );\n }\n return (\n <span\n part=\"recent-query-text\"\n class=\"line-clamp-2 break-all\"\n innerHTML={HighlightUtils.highlightString({\n content: value,\n openingDelimiter:\n '<span part=\"recent-query-text-highlight\" class=\"font-bold\">',\n closingDelimiter: '</span>',\n highlights: [\n {\n offset: query.length,\n length: value.length - query.length,\n },\n ],\n })}\n ></span>\n );\n};\n\ninterface RecentQueryClearProps {\n i18n: i18n;\n}\n\nexport const RecentQueryClear: FunctionalComponent<RecentQueryClearProps> = ({\n i18n,\n}) => {\n return (\n <div part=\"recent-query-title-content\" class=\"flex w-full justify-between\">\n <span class=\"font-bold\" part=\"recent-query-title\">\n {i18n.t('recent-searches')}\n </span>\n <span part=\"recent-query-clear\">{i18n.t('clear')}</span>\n </div>\n );\n};\n","import {\n buildRecentQueriesList,\n RecentQueriesList,\n SearchBox,\n} from '@coveo/headless';\nimport {Component, Element, Prop, State, h} from '@stencil/core';\nimport Clock from '../../../../images/clock.svg';\nimport {SafeStorage, StorageItems} from '../../../../utils/local-storage-utils';\nimport {once} from '../../../../utils/utils';\nimport {\n getPartialRecentQueryClearElement,\n getPartialRecentQueryElement,\n RecentQueriesContainer,\n RecentQueryClear,\n RecentQueryIcon,\n RecentQueryText,\n} from '../../../common/suggestions/stencil-recent-queries';\nimport {\n dispatchSearchBoxSuggestionsEvent,\n} from '../../../common/suggestions/suggestions-events';\nimport type {\n SearchBoxSuggestionElement,\n SearchBoxSuggestions,\n SearchBoxSuggestionsBindings,\n} from '../../../common/suggestions/suggestions-types';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\n\n/**\n * 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.\n */\n@Component({\n tag: 'atomic-search-box-recent-queries',\n shadow: true,\n})\nexport class AtomicSearchBoxRecentQueries {\n private bindings!: SearchBoxSuggestionsBindings<SearchBox, Bindings>;\n private recentQueriesList!: RecentQueriesList;\n private storage!: SafeStorage;\n\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 = 3;\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, Bindings>(\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 renderIcon() {\n return this.icon || Clock;\n }\n\n private initialize(): SearchBoxSuggestions {\n this.storage = new SafeStorage();\n this.recentQueriesList = buildRecentQueriesList(this.bindings.engine, {\n initialState: {queries: this.retrieveLocalStorage()},\n options: {maxLength: 1000, clearFilters: this.bindings.clearFilters},\n });\n\n this.recentQueriesList.subscribe(() => this.updateLocalStorage());\n\n return {\n position: Array.from(this.host.parentNode!.children).indexOf(this.host),\n renderItems: () => this.renderItems(),\n };\n }\n\n private retrieveLocalStorage() {\n return this.storage.getParsedJSON(StorageItems.RECENT_QUERIES, []);\n }\n\n private updateLocalStorage() {\n if (!this.recentQueriesList.state.analyticsEnabled) {\n return this.disableFeature();\n }\n\n return this.storage.setJSON(\n StorageItems.RECENT_QUERIES,\n this.recentQueriesList.state.queries\n );\n }\n\n private warnUser = once(() =>\n this.bindings.engine.logger.warn(\n 'Because analytics are disabled, the recent queries feature is deactivated.'\n )\n );\n\n private disableFeature() {\n this.warnUser();\n this.storage.removeItem(StorageItems.RECENT_QUERIES);\n }\n\n private renderItems(): SearchBoxSuggestionElement[] {\n if (!this.recentQueriesList.state.analyticsEnabled) {\n return [];\n }\n\n const query = this.bindings.searchBoxController.state.value;\n const hasQuery = query !== '';\n const max = hasQuery ? this.maxWithQuery : this.maxWithoutQuery;\n const filteredQueries = this.recentQueriesList.state.queries\n .filter((recentQuery) =>\n recentQuery.toLowerCase().startsWith(query.toLowerCase())\n )\n .slice(0, max);\n\n const suggestionElements: SearchBoxSuggestionElement[] =\n filteredQueries.map((value) => this.renderItem(value));\n if (suggestionElements.length) {\n suggestionElements.unshift(this.renderClear());\n }\n\n return suggestionElements;\n }\n\n private renderClear(): SearchBoxSuggestionElement {\n const partialItem = getPartialRecentQueryClearElement(this.bindings.i18n);\n\n return {\n ...partialItem,\n content: <RecentQueryClear i18n={this.bindings.i18n} />,\n onSelect: () => {\n this.recentQueriesList.clear();\n this.bindings.triggerSuggestions();\n },\n };\n }\n\n private renderItem(value: string): SearchBoxSuggestionElement {\n const query = this.bindings.searchBoxController.state.value;\n const partialItem = getPartialRecentQueryElement(value, this.bindings.i18n);\n return {\n ...partialItem,\n content: (\n <RecentQueriesContainer>\n <RecentQueryIcon icon={this.renderIcon()} />\n <RecentQueryText query={query} value={value} />\n </RecentQueriesContainer>\n ),\n\n onSelect: () => {\n if (this.bindings.isStandalone) {\n this.bindings.searchBoxController.updateText(value);\n this.bindings.searchBoxController.submit();\n return;\n }\n\n this.recentQueriesList.executeRecentQuery(\n this.recentQueriesList.state.queries.indexOf(value)\n );\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"],"mappings":"0hBA8BaA,EAA+B,M,6HAwB1C,iBAAAC,GACE,IACEC,GACGC,IACCC,KAAKD,SAAWA,EAChB,OAAOC,KAAKC,YAAY,GAE1BD,KAAKE,KACL,CAAC,qB,CAEH,MAAOC,GACPH,KAAKG,MAAQA,C,EAIT,UAAAF,GACN,MAAMG,EAASJ,KAAKD,SAASK,OAI7B,MAAMC,qBAACA,EAAoBC,sBAAEA,GAC3BC,EAAwBH,GAE1BA,EAAOI,SACLH,EAAqB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