@coveo/atomic 3.33.8-pre.b74eafaaaf → 3.33.8-pre.bfb642d322
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.
- package/dist/atomic/_atomic.esm.js +1 -1
- package/dist/atomic/components/_index.js +1 -2
- package/dist/atomic/components/analytics-config.js +1 -1
- package/dist/atomic/components/atomic-insight-search-box.js +4 -3
- package/dist/atomic/components/atomic-insight-search-box.js.map +1 -1
- package/dist/atomic/components/atomic-search-box-instant-results.js +2 -2
- package/dist/atomic/components/atomic-search-box-instant-results.js.map +1 -1
- package/dist/atomic/components/atomic-search-box-query-suggestions2.js +2 -2
- package/dist/atomic/components/atomic-search-box-query-suggestions2.js.map +1 -1
- package/dist/atomic/components/atomic-search-box-recent-queries2.js +2 -2
- package/dist/atomic/components/atomic-search-box-recent-queries2.js.map +1 -1
- package/dist/atomic/components/atomic-search-box.js +6 -5
- package/dist/atomic/components/atomic-search-box.js.map +1 -1
- package/dist/atomic/components/atomic-suggestion-renderer2.js +1 -1
- package/dist/atomic/components/atomic-suggestion-renderer2.js.map +1 -1
- package/dist/atomic/components/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-commerce-search-box-instant-products/atomic-commerce-search-box-instant-products.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-commerce-search-box-query-suggestions/atomic-commerce-search-box-query-suggestions.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-commerce-search-box-recent-queries/atomic-commerce-search-box-recent-queries.js +1 -1
- package/dist/atomic/components/components/common/suggestions/suggestion-manager.js +1 -1
- package/dist/atomic/components/components/common/suggestions/{suggestions-events.js → suggestions-common.js} +18 -16
- package/dist/atomic/components/global/environment.js +1 -1
- package/dist/atomic/components/index.js.map +1 -1
- package/dist/atomic/components/stencil-query-suggestions.js.map +1 -1
- package/dist/atomic/components/stencil-suggestion-manager.js +2 -20
- package/dist/atomic/components/stencil-suggestion-manager.js.map +1 -1
- package/dist/atomic/components/{suggestions-events.js → suggestions-common.js} +20 -18
- package/dist/atomic/components/suggestions-common.js.map +1 -0
- package/dist/atomic/index.esm.js +1 -1
- package/dist/atomic/index.esm.js.map +1 -1
- package/dist/atomic/p-29fd6768.js +2 -0
- package/dist/atomic/p-29fd6768.js.map +1 -0
- package/dist/atomic/{p-d0f47b33.entry.js → p-36e71b99.entry.js} +2 -2
- package/dist/atomic/p-36e71b99.entry.js.map +1 -0
- package/dist/atomic/{p-c88a3d2d.entry.js → p-3d847e45.entry.js} +2 -2
- package/dist/atomic/p-3d847e45.entry.js.map +1 -0
- package/dist/atomic/p-7601c3de.js +2 -0
- package/dist/atomic/p-7601c3de.js.map +1 -0
- package/dist/atomic/{p-534b8550.entry.js → p-83e20cc3.entry.js} +2 -2
- package/dist/atomic/{p-26a51a77.entry.js → p-8867af82.entry.js} +2 -2
- package/dist/atomic/p-8867af82.entry.js.map +1 -0
- package/dist/atomic/{p-82450237.js → p-94b5f495.js} +2 -2
- package/dist/atomic/{p-02d3a2ef.entry.js → p-a09b4db4.entry.js} +2 -2
- package/dist/atomic/{p-fbfe913d.entry.js → p-aa4224ea.entry.js} +2 -2
- package/dist/atomic/p-aa4224ea.entry.js.map +1 -0
- package/dist/atomic/{p-3b3dfa51.entry.js → p-aa8e0616.entry.js} +2 -2
- package/dist/atomic/p-af93b44c.js.map +1 -1
- package/dist/atomic/{p-31f1e44e.entry.js → p-c1bf43cf.entry.js} +2 -2
- package/dist/atomic/p-c1bf43cf.entry.js.map +1 -0
- package/dist/cjs/_index.cjs.js +2 -5
- package/dist/cjs/{analytics-config-91d76002.js → analytics-config-b8fab215.js} +2 -2
- package/dist/cjs/{analytics-config-91d76002.js.map → analytics-config-b8fab215.js.map} +1 -1
- package/dist/cjs/atomic-insight-interface.cjs.entry.js +1 -1
- package/dist/cjs/atomic-insight-search-box.cjs.entry.js +5 -5
- package/dist/cjs/atomic-insight-search-box.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-recs-interface.cjs.entry.js +1 -1
- package/dist/cjs/atomic-search-box-instant-results.cjs.entry.js +3 -3
- package/dist/cjs/atomic-search-box-instant-results.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-search-box-query-suggestions_2.cjs.entry.js +5 -5
- package/dist/cjs/atomic-search-box-query-suggestions_2.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-search-box.cjs.entry.js +7 -7
- package/dist/cjs/atomic-search-box.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-search-interface.cjs.entry.js +1 -1
- package/dist/cjs/atomic-suggestion-renderer.cjs.entry.js +1 -1
- package/dist/cjs/atomic-suggestion-renderer.cjs.entry.js.map +1 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/stencil-query-suggestions-03268ecc.js.map +1 -1
- package/dist/cjs/{stencil-suggestion-manager-2cba6d69.js → stencil-suggestion-manager-c0878ef2.js} +4 -4
- package/dist/cjs/{stencil-suggestion-manager-2cba6d69.js.map → stencil-suggestion-manager-c0878ef2.js.map} +1 -1
- package/dist/cjs/{suggestions-events-63dd0640.js → suggestions-common-5097a362.js} +21 -17
- package/dist/cjs/suggestions-common-5097a362.js.map +1 -0
- package/dist/cjs/version.cjs.js +2 -2
- package/dist/esm/_index.js +1 -2
- package/dist/esm/{analytics-config-5742f5ee.js → analytics-config-d0c5b639.js} +2 -2
- package/dist/esm/{analytics-config-5742f5ee.js.map → analytics-config-d0c5b639.js.map} +1 -1
- package/dist/esm/atomic-insight-interface.entry.js +1 -1
- package/dist/esm/atomic-insight-search-box.entry.js +4 -4
- package/dist/esm/atomic-insight-search-box.entry.js.map +1 -1
- package/dist/esm/atomic-recs-interface.entry.js +1 -1
- package/dist/esm/atomic-search-box-instant-results.entry.js +2 -2
- package/dist/esm/atomic-search-box-instant-results.entry.js.map +1 -1
- package/dist/esm/atomic-search-box-query-suggestions_2.entry.js +3 -3
- package/dist/esm/atomic-search-box-query-suggestions_2.entry.js.map +1 -1
- package/dist/esm/atomic-search-box.entry.js +6 -6
- package/dist/esm/atomic-search-box.entry.js.map +1 -1
- package/dist/esm/atomic-search-interface.entry.js +1 -1
- package/dist/esm/atomic-suggestion-renderer.entry.js +1 -1
- package/dist/esm/atomic-suggestion-renderer.entry.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/stencil-query-suggestions-5d6a46d7.js.map +1 -1
- package/dist/esm/{stencil-suggestion-manager-376f83e8.js → stencil-suggestion-manager-486094dd.js} +2 -2
- package/dist/esm/{stencil-suggestion-manager-376f83e8.js.map → stencil-suggestion-manager-486094dd.js.map} +1 -1
- package/dist/esm/{suggestions-events-b7a6f007.js → suggestions-common-2b20db26.js} +20 -18
- package/dist/esm/suggestions-common-2b20db26.js.map +1 -0
- package/dist/esm/version.js +2 -2
- package/dist/types/components/commerce/atomic-commerce-search-box-instant-products/atomic-commerce-search-box-instant-products.d.ts +1 -1
- package/dist/types/components/commerce/atomic-commerce-search-box-query-suggestions/atomic-commerce-search-box-query-suggestions.d.ts +1 -1
- package/dist/types/components/commerce/atomic-commerce-search-box-recent-queries/atomic-commerce-search-box-recent-queries.d.ts +1 -1
- package/dist/types/components/common/atomic-suggestion-renderer/atomic-suggestion-renderer.d.ts +1 -1
- package/dist/types/components/common/suggestions/instant-item.d.ts +1 -1
- package/dist/types/components/common/suggestions/query-suggestions.d.ts +1 -1
- package/dist/types/components/common/suggestions/recent-queries.d.ts +1 -1
- package/dist/types/components/common/suggestions/stencil-instant-item.d.ts +1 -1
- package/dist/types/components/common/suggestions/stencil-query-suggestions.d.ts +1 -1
- package/dist/types/components/common/suggestions/stencil-recent-queries.d.ts +1 -1
- package/dist/types/components/common/suggestions/stencil-suggestion-manager.d.ts +1 -1
- package/dist/types/components/common/suggestions/suggestion-manager.d.ts +1 -1
- package/dist/types/components/common/suggestions/{suggestions-types.d.ts → suggestions-common.d.ts} +16 -6
- package/dist/types/components/search/atomic-search-box/atomic-search-box.d.ts +1 -1
- package/dist/types/components/search/search-box-suggestions/atomic-search-box-instant-results/atomic-search-box-instant-results.d.ts +1 -1
- package/dist/types/components.d.ts +2 -2
- package/dist/types/decorators/types.d.ts +1 -1
- package/dist/types/index.d.ts +1 -3
- package/docs/atomic-docs.json +3 -3
- package/package.json +4 -4
- package/dist/atomic/components/components/common/suggestions/suggestions-types.js +0 -1
- package/dist/atomic/components/components/common/suggestions/suggestions-utils.js +0 -18
- package/dist/atomic/components/suggestions-events.js.map +0 -1
- package/dist/atomic/p-0a051b8d.js +0 -2
- package/dist/atomic/p-0a051b8d.js.map +0 -1
- package/dist/atomic/p-16f4ce98.js +0 -2
- package/dist/atomic/p-16f4ce98.js.map +0 -1
- package/dist/atomic/p-26a51a77.entry.js.map +0 -1
- package/dist/atomic/p-31f1e44e.entry.js.map +0 -1
- package/dist/atomic/p-4b7a19db.js +0 -2
- package/dist/atomic/p-4b7a19db.js.map +0 -1
- package/dist/atomic/p-c88a3d2d.entry.js.map +0 -1
- package/dist/atomic/p-d0f47b33.entry.js.map +0 -1
- package/dist/atomic/p-fbfe913d.entry.js.map +0 -1
- package/dist/cjs/suggestions-events-63dd0640.js.map +0 -1
- package/dist/cjs/suggestions-utils-61000808.js +0 -25
- package/dist/cjs/suggestions-utils-61000808.js.map +0 -1
- package/dist/esm/suggestions-events-b7a6f007.js.map +0 -1
- package/dist/esm/suggestions-utils-591559a0.js +0 -22
- package/dist/esm/suggestions-utils-591559a0.js.map +0 -1
- package/dist/types/components/common/suggestions/suggestions-events.d.ts +0 -14
- package/dist/types/components/common/suggestions/suggestions-utils.d.ts +0 -15
- /package/dist/atomic/{p-534b8550.entry.js.map → p-83e20cc3.entry.js.map} +0 -0
- /package/dist/atomic/{p-82450237.js.map → p-94b5f495.js.map} +0 -0
- /package/dist/atomic/{p-02d3a2ef.entry.js.map → p-a09b4db4.entry.js.map} +0 -0
- /package/dist/atomic/{p-3b3dfa51.entry.js.map → p-aa8e0616.entry.js.map} +0 -0
@@ -2,7 +2,7 @@ import { type Product, type SearchBox } from '@coveo/headless/commerce';
|
|
2
2
|
import { LitElement } from 'lit';
|
3
3
|
import type { ItemRenderingFunction } from "../../common/item-list/item-list-common";
|
4
4
|
import type { ItemDisplayDensity, ItemDisplayImageSize } from "../../common/layout/display-options";
|
5
|
-
import type
|
5
|
+
import { type SearchBoxSuggestions, type SearchBoxSuggestionsBindings } from "../../common/suggestions/suggestions-common";
|
6
6
|
import type { SearchBoxSuggestionsComponent } from "../../../decorators/types";
|
7
7
|
import type { CommerceBindings } from '../atomic-commerce-interface/atomic-commerce-interface';
|
8
8
|
export type AriaLabelGenerator = (bindings: CommerceBindings, product: Product) => string | undefined;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { type SearchBox } from '@coveo/headless/commerce';
|
2
2
|
import { LitElement } from 'lit';
|
3
|
-
import type
|
3
|
+
import { type SearchBoxSuggestions, type SearchBoxSuggestionsBindings } from "../../common/suggestions/suggestions-common";
|
4
4
|
import type { SearchBoxSuggestionsComponent } from "../../../decorators/types";
|
5
5
|
import type { CommerceBindings } from '../atomic-commerce-interface/atomic-commerce-interface';
|
6
6
|
/**
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { type SearchBox } from '@coveo/headless/commerce';
|
2
2
|
import { LitElement } from 'lit';
|
3
3
|
import type { SearchBoxSuggestionsComponent } from "../../../decorators/types";
|
4
|
-
import type
|
4
|
+
import { type SearchBoxSuggestions, type SearchBoxSuggestionsBindings } from '../../common/suggestions/suggestions-common';
|
5
5
|
import type { CommerceBindings } from '../atomic-commerce-interface/atomic-commerce-interface';
|
6
6
|
/**
|
7
7
|
* The `atomic-commerce-search-box-recent-queries` component can be added as a child of an `atomic-commerce-search-box` component, allowing for the configuration of recent query suggestions.
|
package/dist/types/components/common/atomic-suggestion-renderer/atomic-suggestion-renderer.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { i18n } from 'i18next';
|
2
|
-
import { SearchBoxSuggestionElement } from '../suggestions/suggestions-
|
2
|
+
import { SearchBoxSuggestionElement } from '../suggestions/suggestions-common';
|
3
3
|
/**
|
4
4
|
* The `atomic-suggestion-renderer` component is used to render individual suggestions. It was created to isolate
|
5
5
|
* the rendering logic of the 'content' property of the `SearchBoxSuggestionElement` interface. This property can be Stencil
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { i18n } from 'i18next';
|
2
|
-
import type { SearchBoxSuggestionElement } from './suggestions-
|
2
|
+
import type { SearchBoxSuggestionElement } from './suggestions-common';
|
3
3
|
export declare const getPartialInstantItemElement: (i18n: i18n, itemTitle: string, itemUniqueId: string) => Pick<SearchBoxSuggestionElement, "ariaLabel" | "key" | "part">;
|
4
4
|
export declare const getPartialInstantItemShowAllElement: (i18n: i18n) => Pick<SearchBoxSuggestionElement, "key" | "part" | "ariaLabel">;
|
5
5
|
interface InstantItemShowAllButtonProps {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { i18n } from 'i18next';
|
2
|
-
import type { SearchBoxSuggestionElement } from './suggestions-
|
2
|
+
import type { SearchBoxSuggestionElement } from './suggestions-common';
|
3
3
|
export declare const getPartialRecentQueryElement: (value: string, i18n: i18n) => Pick<SearchBoxSuggestionElement, "ariaLabel" | "key" | "query" | "part">;
|
4
4
|
export declare const getPartialRecentQueryClearElement: (i18n: i18n) => Pick<SearchBoxSuggestionElement, "ariaLabel" | "key" | "part" | "hideIfLast">;
|
5
5
|
export interface RecentQueriesContainerProps {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { FunctionalComponent } from '../../../stencil-public-runtime';
|
2
2
|
import { i18n } from 'i18next';
|
3
|
-
import { SearchBoxSuggestionElement } from './suggestions-
|
3
|
+
import { SearchBoxSuggestionElement } from './suggestions-common';
|
4
4
|
export declare const getPartialInstantItemElement: (i18n: i18n, itemTitle: string, itemUniqueId: string) => Pick<SearchBoxSuggestionElement, "ariaLabel" | "key" | "part">;
|
5
5
|
export declare const getPartialInstantItemShowAllElement: (i18n: i18n) => Pick<SearchBoxSuggestionElement, "key" | "part" | "ariaLabel">;
|
6
6
|
interface InstantItemShowAllButtonProps {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { FunctionalComponent } from '../../../stencil-public-runtime';
|
2
2
|
import { i18n } from 'i18next';
|
3
|
-
import { SearchBoxSuggestionElement } from './suggestions-
|
3
|
+
import { SearchBoxSuggestionElement } from './suggestions-common.js';
|
4
4
|
interface Suggestion {
|
5
5
|
highlightedValue: string;
|
6
6
|
rawValue: string;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { FunctionalComponent } from '../../../stencil-public-runtime';
|
2
2
|
import { i18n } from 'i18next';
|
3
|
-
import { SearchBoxSuggestionElement } from './suggestions-
|
3
|
+
import { SearchBoxSuggestionElement } from './suggestions-common';
|
4
4
|
export declare const getPartialRecentQueryElement: (value: string, i18n: i18n) => Pick<SearchBoxSuggestionElement, "ariaLabel" | "key" | "query" | "part">;
|
5
5
|
export declare const getPartialRecentQueryClearElement: (i18n: i18n) => Pick<SearchBoxSuggestionElement, "ariaLabel" | "key" | "part" | "hideIfLast">;
|
6
6
|
export declare const RecentQueriesContainer: FunctionalComponent;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type
|
1
|
+
import { type SearchBoxSuggestionElement, type SearchBoxSuggestionsBindings, type SearchBoxSuggestionsEvent } from './suggestions-common';
|
2
2
|
/**
|
3
3
|
* List of suggestions that will be displayed along other lists (e.g recent queries) when the search box's input is selected.
|
4
4
|
*/
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { LitElement } from 'lit';
|
2
|
-
import type
|
2
|
+
import { type SearchBoxSuggestionElement, type SearchBoxSuggestionsBindings, type SearchBoxSuggestionsEvent } from './suggestions-common';
|
3
3
|
/**
|
4
4
|
* List of suggestions that will be displayed along other lists (e.g recent queries) when the search box's input is selected.
|
5
5
|
*/
|
package/dist/types/components/common/suggestions/{suggestions-types.d.ts → suggestions-common.d.ts}
RENAMED
@@ -68,6 +68,15 @@ export interface SearchBoxSuggestions {
|
|
68
68
|
*/
|
69
69
|
onSuggestedQueryChange?(q: string): Promise<unknown>;
|
70
70
|
}
|
71
|
+
/**
|
72
|
+
* Event sent from the registered query suggestions to the parent search box.
|
73
|
+
*/
|
74
|
+
export type SearchBoxSuggestionsEvent<SearchBoxController, Bindings = AnyBindings> = (
|
75
|
+
/**
|
76
|
+
* The bindings passed from the search box to the suggestions.
|
77
|
+
*/
|
78
|
+
bindings: SearchBoxSuggestionsBindings<SearchBoxController, Bindings>) => SearchBoxSuggestions;
|
79
|
+
declare const searchBoxElements: readonly ["atomic-search-box", "atomic-insight-search-box", "atomic-commerce-search-box"];
|
71
80
|
/**
|
72
81
|
* The bindings passed from the search box to the suggestions.
|
73
82
|
*/
|
@@ -115,10 +124,11 @@ export type SearchBoxSuggestionsBindings<SearchBoxController, Bindings = AnyBind
|
|
115
124
|
getSuggestionElements(): SearchBoxSuggestionElement[];
|
116
125
|
};
|
117
126
|
/**
|
118
|
-
*
|
127
|
+
* Dispatches an event which retrieves the `SearchBoxSuggestionsBindings` on a configured parent search box.
|
128
|
+
* @param event Event sent from the registered query suggestions to the parent search box.
|
129
|
+
* @param element Element on which to dispatch the event, which must be the child of a configured search box.
|
119
130
|
*/
|
120
|
-
export
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
bindings: SearchBoxSuggestionsBindings<SearchBoxController, Bindings>) => SearchBoxSuggestions;
|
131
|
+
export declare const dispatchSearchBoxSuggestionsEvent: <SearchBoxController, Bindings = AnyBindings>(event: SearchBoxSuggestionsEvent<SearchBoxController, Bindings>, element: HTMLElement, allowedSearchBoxElements?: readonly (typeof searchBoxElements)[number][]) => void;
|
132
|
+
export declare function elementHasNoQuery(el: SearchBoxSuggestionElement): boolean;
|
133
|
+
export declare function elementHasQuery(el: SearchBoxSuggestionElement): boolean;
|
134
|
+
export {};
|
@@ -2,7 +2,7 @@ import { SearchBox, StandaloneSearchBox } from '@coveo/headless';
|
|
2
2
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
3
3
|
import { InitializableComponent } from '../../../utils/initialization-utils';
|
4
4
|
import { RedirectionPayload } from '../../common/search-box/redirection-payload';
|
5
|
-
import
|
5
|
+
import { SearchBoxSuggestionsEvent } from '../../common/suggestions/suggestions-common';
|
6
6
|
import { Bindings } from '../atomic-search-interface/atomic-search-interface';
|
7
7
|
/**
|
8
8
|
* The `atomic-search-box` component creates a search box with built-in support for suggestions.
|
@@ -2,7 +2,7 @@ import { Result, SearchBox } from '@coveo/headless';
|
|
2
2
|
import { InitializableComponent } from '../../../../utils/initialization-utils';
|
3
3
|
import { ItemRenderingFunction } from '../../../common/item-list/stencil-item-list-common';
|
4
4
|
import { ItemDisplayDensity, ItemDisplayImageSize } from '../../../common/layout/display-options';
|
5
|
-
import
|
5
|
+
import { SearchBoxSuggestions, SearchBoxSuggestionsBindings } from '../../../common/suggestions/suggestions-common';
|
6
6
|
import { Bindings } from '../../atomic-search-interface/atomic-search-interface';
|
7
7
|
export type AriaLabelGenerator = (bindings: Bindings, result: Result) => string | undefined;
|
8
8
|
/**
|
@@ -26,7 +26,7 @@ import { RedirectionPayload } from "./components/common/search-box/redirection-p
|
|
26
26
|
import { AriaLabelGenerator } from "./components/search/search-box-suggestions/atomic-search-box-instant-results/atomic-search-box-instant-results";
|
27
27
|
import { InitializationOptions } from "./components/search/atomic-search-interface/atomic-search-interface";
|
28
28
|
import { StandaloneSearchBoxData } from "./utils/local-storage-utils";
|
29
|
-
import { SearchBoxSuggestionElement } from "./components/common/suggestions/suggestions-
|
29
|
+
import { SearchBoxSuggestionElement } from "./components/common/suggestions/suggestions-common";
|
30
30
|
export { AutomaticFacet, CategoryFacetSortCriterion, DateFilterRange, DateRangeRequest, FacetResultsMustMatch, FacetSortCriterion, FoldedResult, GeneratedAnswer, GeneratedAnswerCitation, InlineLink, InteractiveCitation, InteractiveResult, LogLevel, NumericFilter, NumericFilterState, RangeFacetRangeAlgorithm, RangeFacetSortCriterion, RelativeDateUnit, Result, ResultTemplate, ResultTemplateCondition, SearchEngine, SearchStatus } from "@coveo/headless";
|
31
31
|
export { AtomicInterface } from "./utils/initialization-utils";
|
32
32
|
export { AnyBindings } from "./components/common/interface/bindings";
|
@@ -48,7 +48,7 @@ export { RedirectionPayload } from "./components/common/search-box/redirection-p
|
|
48
48
|
export { AriaLabelGenerator } from "./components/search/search-box-suggestions/atomic-search-box-instant-results/atomic-search-box-instant-results";
|
49
49
|
export { InitializationOptions } from "./components/search/atomic-search-interface/atomic-search-interface";
|
50
50
|
export { StandaloneSearchBoxData } from "./utils/local-storage-utils";
|
51
|
-
export { SearchBoxSuggestionElement } from "./components/common/suggestions/suggestions-
|
51
|
+
export { SearchBoxSuggestionElement } from "./components/common/suggestions/suggestions-common";
|
52
52
|
export namespace Components {
|
53
53
|
/**
|
54
54
|
* An automatic facet is a special type of facet generated by the automatic facets feature.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { LitElement, TemplateResult } from 'lit';
|
2
2
|
import type { TemplateResultType } from 'lit/directive-helpers.js';
|
3
3
|
import type { AnyBindings } from '../components/common/interface/bindings';
|
4
|
-
import type { SearchBoxSuggestions } from '../components/common/suggestions/suggestions-
|
4
|
+
import type { SearchBoxSuggestions } from '../components/common/suggestions/suggestions-common';
|
5
5
|
export type GenericRender<T extends TemplateResultType> = TemplateResult<T>;
|
6
6
|
export type RenderGuardDecorator<Component, T extends TemplateResultType, Descriptor = TypedPropertyDescriptor<() => GenericRender<T>>> = (target: Component, propertyKey: 'render', descriptor: Descriptor) => Descriptor;
|
7
7
|
/**
|
package/dist/types/index.d.ts
CHANGED
@@ -5,9 +5,7 @@ export { SelectChildProductEventArgs } from './components/commerce/atomic-produc
|
|
5
5
|
export { productContext } from './components/commerce/product-template-component-utils/stencil-product-template-decorators';
|
6
6
|
export { PopoverChildFacet } from './components/common/facets/popover/popover-type';
|
7
7
|
export { RedirectionPayload } from './components/common/search-box/redirection-payload';
|
8
|
-
export { dispatchSearchBoxSuggestionsEvent } from './components/common/suggestions/suggestions-
|
9
|
-
export type { SearchBoxSuggestionElement, SearchBoxSuggestions, SearchBoxSuggestionsBindings, SearchBoxSuggestionsEvent, } from './components/common/suggestions/suggestions-types';
|
10
|
-
export { elementHasNoQuery, elementHasQuery, } from './components/common/suggestions/suggestions-utils';
|
8
|
+
export { dispatchSearchBoxSuggestionsEvent, SearchBoxSuggestionElement, SearchBoxSuggestions, SearchBoxSuggestionsBindings, SearchBoxSuggestionsEvent, } from './components/common/suggestions/suggestions-common';
|
11
9
|
export { RecsBindings } from './components/recommendations/atomic-recs-interface/atomic-recs-interface';
|
12
10
|
export { Bindings } from './components/search/atomic-search-interface/atomic-search-interface';
|
13
11
|
export { resultContext } from './components/search/result-template-components/result-template-decorators';
|
package/docs/atomic-docs.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"timestamp": "2025-09-
|
2
|
+
"timestamp": "2025-09-24T16:16:45",
|
3
3
|
"compiler": {
|
4
4
|
"name": "@stencil/core",
|
5
5
|
"version": "4.20.0",
|
@@ -16089,10 +16089,10 @@
|
|
16089
16089
|
"docstring": "",
|
16090
16090
|
"path": "src/components/common/layout/display-options.ts"
|
16091
16091
|
},
|
16092
|
-
"src/components/common/suggestions/suggestions-
|
16092
|
+
"src/components/common/suggestions/suggestions-common.ts::SearchBoxSuggestionElement": {
|
16093
16093
|
"declaration": "export interface SearchBoxSuggestionElement {\n /**\n * Stable identity which enables Stencil to reuse DOM elements for better performance.\n * The best way to pick a key is to use a string that uniquely identifies that list item among its siblings (often your data will already have IDs).\n */\n key: string;\n /**\n * Rendered content of the element.\n *\n * @remarks\n * The `VNode` type will be deprecated in v4 as we are detaching from Stencil.\n */\n content: Element | VNode;\n /**\n * Hook called when the selection is selected.\n * @param e DOM event.\n */\n onSelect?(e: Event): void;\n /**\n * The query associated with the suggestion which will replace the query in the search box if the suggestion is selected.\n */\n query?: string;\n /**\n * For improved accessibility, provide this property with additional information.\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label\n */\n ariaLabel?: string;\n /**\n * Adds a specific shadow part attribute that can be selected with the CSS ::part pseudo-element.\n * https://developer.mozilla.org/en-US/docs/Web/CSS/::part\n */\n part?: string;\n /**\n * Hide the suggestion if it's the last in the list.\n */\n hideIfLast?: boolean;\n}",
|
16094
16094
|
"docstring": "Element which will be rendered in the list of suggestions.",
|
16095
|
-
"path": "src/components/common/suggestions/suggestions-
|
16095
|
+
"path": "src/components/common/suggestions/suggestions-common.ts"
|
16096
16096
|
},
|
16097
16097
|
"../headless/dist/definitions/index.d.ts::RelativeDateUnit": {
|
16098
16098
|
"declaration": "any",
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@coveo/atomic",
|
3
3
|
"type": "module",
|
4
|
-
"version": "3.33.8-pre.
|
4
|
+
"version": "3.33.8-pre.bfb642d322",
|
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.
|
84
|
+
"@coveo/headless": "3.31.0",
|
85
85
|
"@lit/context": "1.1.6",
|
86
86
|
"@open-wc/lit-helpers": "0.7.0",
|
87
87
|
"@popperjs/core": "2.11.8",
|
@@ -149,11 +149,11 @@
|
|
149
149
|
"typescript": "5.8.3",
|
150
150
|
"vite": "7.0.6",
|
151
151
|
"vitest": "3.2.4",
|
152
|
-
"wait-on": "
|
152
|
+
"wait-on": "9.0.0"
|
153
153
|
},
|
154
154
|
"peerDependencies": {
|
155
155
|
"@coveo/bueno": "1.1.2",
|
156
|
-
"@coveo/headless": "3.31.
|
156
|
+
"@coveo/headless": "3.31.0",
|
157
157
|
"typescript": ">=5.0.0"
|
158
158
|
},
|
159
159
|
"peerDependenciesMeta": {
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,18 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Checks if a search box suggestion element has no query.
|
3
|
-
*
|
4
|
-
* @param el - The search box suggestion element to check
|
5
|
-
* @returns True if the element has no query or the query is whitespace-only
|
6
|
-
*/
|
7
|
-
export function elementHasNoQuery(el) {
|
8
|
-
return !el.query || el.query.trim() === '';
|
9
|
-
}
|
10
|
-
/**
|
11
|
-
* Checks if a search box suggestion element has a query.
|
12
|
-
*
|
13
|
-
* @param el - The search box suggestion element to check
|
14
|
-
* @returns True if the element has a non-empty, non-whitespace query
|
15
|
-
*/
|
16
|
-
export function elementHasQuery(el) {
|
17
|
-
return !!el.query && el.query.trim() !== '';
|
18
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"suggestions-events.js","mappings":";;;AAOA;;;;;;;;;MASa,iCAAiC,GAAG,CAI/C,KAA+D,EAC/D,OAAoB,EACpB,2BAA0E,iBAAiB;IAE3F,MAAM,gBAAgB,GAAG,OAAO,CAAC,OAAO,EAAE,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACxE,IAAI,CAAC,gBAAgB,EAAE;QACrB,MAAM,IAAI,KAAK,CACb,QAAQ,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,gFAAgF,wBAAwB,CAAC,IAAI,CACjJ,IAAI,CACL,EAAE,CACJ,CAAC;KACH;IACD,KAAK,2CAA2C,CAC9C,gBAAgB,EAChB,OAAO,EACP,KAAK,CACN,CAAC;AACJ,EAAE;AAEF,MAAM,iBAAiB,GAAG;IACxB,mBAAmB;IACnB,2BAA2B;IAC3B,4BAA4B;CACpB,CAAC;AAEX,MAAM,mBAAmB,GAAG,CAAC,SAAkB,KAC7C,gBAAgB,IAAK,SAAwB;IAC5C,SAAwB,CAAC,cAAc,YAAY,OAAO,CAAC;AAE9D,MAAM,2CAA2C,GAAG,OAIlD,gBAAyB,EACzB,OAAoB,EACpB,KAA+D;IAE/D,MAAM,cAAc,CAAC,WAAW,CAAC,gBAAgB,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;IAC1E,IAAI,mBAAmB,CAAC,gBAAgB,CAAC,EAAE;QACzC,MAAM,gBAAgB,CAAC,cAAc,CAAC;KACvC;SAAM,IAAI,kBAAkB,IAAI,gBAAgB,EAAE;QACjD,MAAO,gBAAuC,CAAC,gBAAgB,EAAE,CAAC;KACnE;IACD,OAAO,CAAC,aAAa,CACnB,gBAAgB,CAAC,qCAAqC,EAAE,KAAK,CAAC,CAC/D,CAAC;AACJ,CAAC;;;;","names":[],"sources":["src/components/common/suggestions/suggestions-events.ts"],"sourcesContent":["import type {HTMLStencilElement} from '@stencil/core/internal';\nimport type {LitElement} from 'lit';\nimport {closest} from '../../../utils/dom-utils';\nimport {buildCustomEvent} from '../../../utils/event-utils';\nimport type {AnyBindings} from '../interface/bindings';\nimport type {SearchBoxSuggestionsEvent} from './suggestions-types';\n\n/**\n * Dispatches an event which retrieves the `SearchBoxSuggestionsBindings` on a configured parent search box.\n *\n * @param event Event sent from the registered query suggestions to the parent search box\n * @param element Element on which to dispatch the event, which must be the child of a configured search box\n * @param allowedSearchBoxElements Optional array of allowed search box element selectors\n *\n * @throws Error if the element is not a child of an allowed search box element\n */\nexport const dispatchSearchBoxSuggestionsEvent = <\n SearchBoxController,\n Bindings = AnyBindings,\n>(\n event: SearchBoxSuggestionsEvent<SearchBoxController, Bindings>,\n element: HTMLElement,\n allowedSearchBoxElements: readonly (typeof searchBoxElements)[number][] = searchBoxElements\n) => {\n const interfaceElement = closest(element, searchBoxElements.join(', '));\n if (!interfaceElement) {\n throw new Error(\n `The \"${element.nodeName.toLowerCase()}\" component was not handled, as it is not a child of the following elements: ${allowedSearchBoxElements.join(\n ', '\n )}`\n );\n }\n void dispatchSearchBoxSuggestionsEventEventually(\n interfaceElement,\n element,\n event\n );\n};\n\nconst searchBoxElements = [\n 'atomic-search-box',\n 'atomic-insight-search-box',\n 'atomic-commerce-search-box',\n] as const;\n\nconst isLitElementLoosely = (candidate: unknown): candidate is LitElement =>\n 'updateComplete' in (candidate as LitElement) &&\n (candidate as LitElement).updateComplete instanceof Promise;\n\nconst dispatchSearchBoxSuggestionsEventEventually = async <\n SearchBoxController,\n Bindings = AnyBindings,\n>(\n interfaceElement: Element,\n element: HTMLElement,\n event: SearchBoxSuggestionsEvent<SearchBoxController, Bindings>\n) => {\n await customElements.whenDefined(interfaceElement.nodeName.toLowerCase());\n if (isLitElementLoosely(interfaceElement)) {\n await interfaceElement.updateComplete;\n } else if ('componentOnReady' in interfaceElement) {\n await (interfaceElement as HTMLStencilElement).componentOnReady();\n }\n element.dispatchEvent(\n buildCustomEvent('atomic/searchBoxSuggestion/register', event)\n );\n};\n"],"version":3}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["elementHasNoQuery","el","query","trim","elementHasQuery"],"sources":["src/components/common/suggestions/suggestions-utils.ts"],"sourcesContent":["import type {SearchBoxSuggestionElement} from './suggestions-types';\n\n/**\n * Checks if a search box suggestion element has no query.\n *\n * @param el - The search box suggestion element to check\n * @returns True if the element has no query or the query is whitespace-only\n */\nexport function elementHasNoQuery(el: SearchBoxSuggestionElement): boolean {\n return !el.query || el.query.trim() === '';\n}\n\n/**\n * Checks if a search box suggestion element has a query.\n *\n * @param el - The search box suggestion element to check\n * @returns True if the element has a non-empty, non-whitespace query\n */\nexport function elementHasQuery(el: SearchBoxSuggestionElement): boolean {\n return !!el.query && el.query.trim() !== '';\n}\n"],"mappings":"SAQgBA,EAAkBC,GAChC,OAAQA,EAAGC,OAASD,EAAGC,MAAMC,SAAW,EAC1C,C,SAQgBC,EAAgBH,GAC9B,QAASA,EAAGC,OAASD,EAAGC,MAAMC,SAAW,EAC3C,Q","ignoreList":[]}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{h as t,f as s}from"./p-dc3df5ce.js";import{B as i}from"./p-b93ccff9.js";import{isNullOrUndefined as e}from"@coveo/bueno";import{D as n}from"./p-f284897c.js";import{d as r}from"./p-01c91b69.js";import{a as o,e as a}from"./p-0a051b8d.js";const h=`<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n<circle cx="7" cy="7" r="6.5" stroke="currentColor"/>\n<path d="M16 16L12 12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n`;const u=(s,i)=>{const e=()=>{const t="flex bg-background w-full border border-neutral rounded-md focus-within:ring-3 absolute top-0 left-0";const i=s.disabled?"focus-within:border-disabled focus-within:ring-neutral":"focus-within:border-primary focus-within:ring-ring-primary";return[t,i].join(" ")};return t("div",{part:"wrapper",class:e(),onFocusout:s.onFocusout},i)};const c=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M15 1.00012L1.00012 14.9999" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M0.999878 1L14.9999 15" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n`;const l=({inputRef:s,bindings:e,onClick:n,...r})=>t("div",{part:"clear-button-wrapper",class:"ml-2 flex items-center justify-center py-2"},t(i,{style:"text-transparent",part:"clear-button",class:"text-neutral-dark flex h-8 w-8 shrink-0 items-center justify-center",onClick:()=>{n?.();s?.focus()},ariaLabel:e.i18n.t("clear"),...r},t("atomic-icon",{part:"clear-icon",icon:c,class:"h-4 w-4"})));function g(t){return{autocomplete:"off",autocapitalize:"off",autocorrect:"off",...t.activeDescendant&&{"aria-activedescendant":t.activeDescendant},"aria-autocomplete":"both","aria-haspopup":"true","aria-controls":t.id}}function f(t,s){const i=t?.parentNode;if(!i){return}if(t.value==="\n"){return}i.dataset.replicatedValue=s??t.value}function d(t){const s=t?.parentNode;if(s){delete s.dataset.replicatedValue}}function p(t){const s=t?.parentNode;if(s){s.classList.remove("expanded")}}function m(t){const s=t?.parentNode;if(s){s.classList.add("expanded")}}const w=({textAreaRef:s,loading:i,bindings:e,onInput:n,onFocus:r,onBlur:o,onChange:a,onKeyDown:h,onKeyUp:u,value:c,ariaLabel:w,onClear:b,popup:v,...y})=>t("div",{class:"flex grow overflow-hidden"},t("div",{part:"textarea-expander",class:"grid grow overflow-hidden"},t("textarea",{part:"textarea","aria-label":w,placeholder:e.i18n.t("search"),class:"placeholder-neutral-dark",rows:1,onInput:t=>{n?.(t);f(s)},onKeyDown:t=>{f(s);if(t.key==="Enter"){if(t.shiftKey){return}t.preventDefault()}h?.(t)},onKeyUp:t=>{u?.(t);if(t.key==="Enter"){t.preventDefault();return}f(s)},onBlur:t=>{o?.(t);p(s);f(s)},onChange:t=>{a?.(t);f(s)},onFocus:t=>{r?.(t);const i=t.target;f(s??i);m(s??i)},autocomplete:"off",...v&&g(v),...y,value:c})),i&&t("div",{class:"searchbox-button-wrapper ml-2 flex items-center justify-center"},t("span",{part:"loading",class:"loading mr-2 grid h-5 w-5 animate-spin place-items-center rounded-full bg-linear-to-r"})),!i&&c&&t(l,{inputRef:s,bindings:e,onClick:()=>{b();d(s)}}));function b(t,s){let i;const e=new Promise(((t,e)=>{i=setTimeout((()=>{e(new Error("Promise timed out."))}),s)}));return Promise.race([t,e]).then((()=>{clearTimeout(i)}))}class v{constructor(t){this.ownerSearchBoxProps=t;this.suggestions=[];this.leftSuggestionElements=[];this.rightSuggestionElements=[];this.leftPanel=undefined;this.rightPanel=undefined;this.activeDescendant="";this.suggestedQuery="";this.keyboardActiveDescendant="";this.queryDataAttribute="data-query";this.suggestionEvents=[];this.previousActiveDescendantElement=null;this.leftSuggestions=[];this.rightSuggestions=[];this.triggerSuggestions=r((()=>this.executeQuerySuggestion()),this.ownerSearchBoxProps.getSuggestionDelay())}get partialSuggestionBindings(){return{suggestedQuery:()=>this.suggestedQuery,clearSuggestions:()=>this.clearSuggestions(),triggerSuggestions:()=>this.triggerSuggestions(),getSuggestions:()=>this.suggestions,getSuggestionElements:()=>this.allSuggestionElements}}get activeDescendantElement(){if(!this.hasActiveDescendant){return null}return this.leftPanel?.querySelector(`#${this.activeDescendant}`)||this.rightPanel?.querySelector(`#${this.activeDescendant}`)||null}onSubmit(){this.clickOnActiveElement();this.clearSuggestions()}updateActiveDescendant(t=""){this.activeDescendant=t;s(this.ownerSearchBoxProps.getHost())}updateKeyboardActiveDescendant(t=""){this.keyboardActiveDescendant=t}clickOnActiveElement(){this.activeDescendantElement?.click();this.updateActiveDescendant()}isRightPanelInFocus(){if(e(this.panelInFocus)||e(this.rightPanel)){return false}return this.panelInFocus===this.rightPanel}initializeSuggestions(t){this.suggestions=this.suggestionEvents.map((s=>s(t)))}registerSuggestionsFromEvent(t,s){t.preventDefault();t.stopPropagation();this.suggestionEvents.push(t.detail);this.suggestions.push(t.detail(s))}registerSuggestions(t){this.suggestions.push(t)}get isDoubleList(){return Boolean(this.leftSuggestionElements.length&&this.rightSuggestionElements.length)}focusPanel(t){const s=t==="left"?this.leftPanel:this.rightPanel;if(this.panelInFocus===s){return}if(s?.firstElementChild){const t=this.previousActiveDescendantElement&&s.contains(this.previousActiveDescendantElement);const i=t?this.previousActiveDescendantElement:s.firstElementChild;this.updateDescendants(i.id)}}clearSuggestions(){this.clearSuggestionElements();this.updateActiveDescendant()}async focusNextValue(){if(!this.hasSuggestions||!this.nextOrFirstValue){return}await this.focusValue(this.nextOrFirstValue)}async focusValue(t){this.updateKeyboardActiveDescendant(t.id);this.updateActiveDescendant(t.id);this.scrollActiveDescendantIntoView();await this.updateQueryFromSuggestion()}async onSuggestionMouseOver(t,s,i){const e=s==="left"?this.leftPanel:this.rightPanel;this.updateKeyboardActiveDescendant();if(this.panelInFocus===e){this.updateActiveDescendant(i)}else{this.updateDescendants(i)}if(t.query){await this.updateSuggestedQuery(t.query)}}async onSuggestionClick(t,s){if(t.query){this.clearSuggestions();await this.updateOwnerSearchboxQuery(t.query)}t.onSelect?.(s)}get hasSuggestions(){return!!this.allSuggestionElements.length}get allSuggestionElements(){return[...this.leftSuggestionElements,...this.rightSuggestionElements]}async focusPreviousValue(){if(this.firstValue===this.activeDescendantElement){this.updateKeyboardActiveDescendant();this.updateActiveDescendant();return}if(!this.hasSuggestions||!this.previousOrLastValue){return}await this.focusValue(this.previousOrLastValue)}get hasActiveDescendant(){return this.activeDescendant!==""}async executeQuerySuggestion(){this.updateActiveDescendant();const t=await Promise.allSettled(this.suggestions.map((t=>b(t.onInput?t.onInput():Promise.resolve(),this.ownerSearchBoxProps.getSuggestionTimeout()))));const s=[];t.forEach(((t,i)=>{if(t.status==="fulfilled"){s.push(this.suggestions[i])}else{this.ownerSearchBoxProps.getLogger().warn("Some query suggestions are not being shown because the promise timed out.")}}));const i=(t,i=false)=>s.filter((s=>s.panel===t||!s.panel&&i)).sort(this.sortSuggestions);this.leftSuggestions=i("left",true);this.leftSuggestionElements=this.getAndFilterLeftSuggestionElements();this.rightSuggestions=i("right");this.rightSuggestionElements=this.getSuggestionElements(this.rightSuggestions);const e=this.allSuggestionElements.find(o)?.query||"";await this.updateSuggestedQuery(e)}get lastValue(){return this.panelInFocus?.lastElementChild}get previousOrLastValue(){if(!this.hasActiveDescendant){return this.lastValue?.firstChild}const t=this.activeDescendantElement?.parentElement;return t?.previousElementSibling?.firstChild||this.firstValue?.firstChild}sortSuggestions(t,s){return t.position-s.position}get nextOrFirstValue(){if(!this.hasActiveDescendant){return this.firstValue?.firstChild}const t=this.activeDescendantElement?.parentElement;return t?.nextElementSibling?.firstChild||this.firstValue?.firstChild}get firstValue(){return this.panelInFocus?.firstElementChild}get panelInFocus(){if(this.leftPanel?.contains(this.activeDescendantElement)){return this.leftPanel}if(this.rightPanel?.contains(this.activeDescendantElement)){return this.rightPanel}return this.leftPanel||this.rightPanel}scrollActiveDescendantIntoView(){this.activeDescendantElement?.scrollIntoView({block:"nearest"})}async updateQueryFromSuggestion(){const t=this.activeDescendantElement?.getAttribute(this.queryDataAttribute);await this.updateOwnerSearchboxQuery(t||"")}async updateOwnerSearchboxQuery(t){if(t&&this.ownerSearchBoxProps.getSearchBoxValue()!==t){this.ownerSearchBoxProps.updateQuery(t);await this.updateSuggestedQuery(t)}}async updateSuggestedQuery(t){await Promise.allSettled(this.suggestions.map((s=>b(s.onSuggestedQueryChange?s.onSuggestedQueryChange(t):Promise.resolve(),this.ownerSearchBoxProps.getSuggestionTimeout()))));this.suggestedQuery=t;this.updateSuggestionElements(t);s(this.ownerSearchBoxProps.getHost())}updateSuggestionElements(t){if(!this.isPanelInFocus(this.leftPanel,t)){this.leftSuggestionElements=this.getAndFilterLeftSuggestionElements()}if(!this.isPanelInFocus(this.rightPanel,t)){this.rightSuggestionElements=this.getSuggestionElements(this.rightSuggestions)}}forceUpdate(){this.updateSuggestionElements(this.suggestedQuery);s(this.ownerSearchBoxProps.getHost())}isPanelInFocus(t,s){if(!this.activeDescendantElement){return false}if(s){const i=n.sanitize(s);return!!t?.querySelector(`[${this.queryDataAttribute}="${CSS.escape(i)}"]`)}return this.activeDescendantElement?.closest("ul")===t}getAndFilterLeftSuggestionElements(){const t=this.getSuggestionElements(this.leftSuggestions);const s=new Set;const i=t.filter((t=>{if(e(t.query)){return true}if(s.has(t.query)){return false}else{s.add(t.query);return true}}));return i}getSuggestionElements(t){const s=t.flatMap((t=>t.renderItems()));const i=this.ownerSearchBoxProps.getNumberOfSuggestionsToDisplay()+s.filter(a).length;return s.slice(0,i)}updateDescendants(t=""){const s=this.activeDescendantElement;this.previousActiveDescendantElement=s;this.updateActiveDescendant(t)}clearSuggestionElements(){this.leftSuggestionElements=[];this.rightSuggestionElements=[]}}export{v as S,h as a,w as b,u as c};
|
2
|
-
//# sourceMappingURL=p-16f4ce98.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["SearchBoxWrapper","props","children","getClasses","baseClasses","focusClasses","disabled","join","h","part","class","onFocusout","TextAreaClearButton","inputRef","bindings","onClick","defaultButtonProps","Button","style","focus","ariaLabel","i18n","t","icon","ClearSlim","getPopupAttributes","autocomplete","autocapitalize","autocorrect","activeDescendant","id","syncTextWithReplica","elem","value","parent","parentNode","dataset","replicatedValue","resetReplicaText","collapseTextArea","classList","remove","expandTextArea","add","SearchTextArea","textAreaRef","loading","onInput","onFocus","onBlur","onChange","onKeyDown","onKeyUp","onClear","popup","defaultInputProps","placeholder","rows","e","key","shiftKey","preventDefault","target","promiseTimeout","prom","ms","timeout","Promise","_","reject","setTimeout","Error","race","then","clearTimeout","SuggestionManager","constructor","ownerSearchBoxProps","this","suggestions","leftSuggestionElements","rightSuggestionElements","leftPanel","undefined","rightPanel","suggestedQuery","keyboardActiveDescendant","queryDataAttribute","suggestionEvents","previousActiveDescendantElement","leftSuggestions","rightSuggestions","triggerSuggestions","debounce","executeQuerySuggestion","getSuggestionDelay","partialSuggestionBindings","clearSuggestions","getSuggestions","getSuggestionElements","allSuggestionElements","activeDescendantElement","hasActiveDescendant","querySelector","onSubmit","clickOnActiveElement","updateActiveDescendant","forceUpdate","getHost","updateKeyboardActiveDescendant","click","isRightPanelInFocus","isNullOrUndefined","panelInFocus","initializeSuggestions","map","event","registerSuggestionsFromEvent","stopPropagation","push","detail","registerSuggestions","isDoubleList","Boolean","length","focusPanel","side","panel","firstElementChild","panelHasActiveDescendant","contains","newValue","updateDescendants","clearSuggestionElements","focusNextValue","hasSuggestions","nextOrFirstValue","focusValue","scrollActiveDescendantIntoView","updateQueryFromSuggestion","onSuggestionMouseOver","item","thisPanel","query","updateSuggestedQuery","onSuggestionClick","updateOwnerSearchboxQuery","onSelect","focusPreviousValue","firstValue","previousOrLastValue","settled","allSettled","suggestion","resolve","getSuggestionTimeout","fulfilledSuggestions","forEach","j","status","getLogger","warn","splitSuggestions","isDefault","filter","sort","sortSuggestions","getAndFilterLeftSuggestionElements","defaultSuggestedQuery","find","elementHasQuery","lastValue","lastElementChild","firstChild","parentOfActiveDescendant","parentElement","previousElementSibling","a","b","position","nextElementSibling","scrollIntoView","block","getAttribute","getSearchBoxValue","updateQuery","onSuggestedQueryChange","updateSuggestionElements","isPanelInFocus","escaped","DOMPurify","sanitize","CSS","escape","closest","suggestionElements","filterOnDuplicate","Set","out","suggestionElement","has","elements","flatMap","renderItems","max","getNumberOfSuggestionsToDisplay","elementHasNoQuery","slice","newPrevDescendantElement"],"sources":["src/components/common/search-box/stencil-search-box-wrapper.tsx","src/components/common/search-box/stencil-text-area-clear-button.tsx","src/components/common/search-box/stencil-search-text-area.tsx","src/utils/promise-utils.ts","src/components/common/suggestions/stencil-suggestion-manager.ts"],"sourcesContent":["import {FunctionalComponent, h} from '@stencil/core';\n\ninterface Props {\n disabled: boolean;\n onFocusout?: (event: FocusEvent) => void;\n}\n\nexport const SearchBoxWrapper: FunctionalComponent<Props> = (\n props,\n children\n) => {\n const getClasses = () => {\n const baseClasses =\n 'flex bg-background w-full border border-neutral rounded-md focus-within:ring-3 absolute top-0 left-0';\n const focusClasses = props.disabled\n ? 'focus-within:border-disabled focus-within:ring-neutral'\n : 'focus-within:border-primary focus-within:ring-ring-primary';\n\n return [baseClasses, focusClasses].join(' ');\n };\n\n return (\n <div part=\"wrapper\" class={getClasses()} onFocusout={props.onFocusout}>\n {children}\n </div>\n );\n};\n","import {FunctionalComponent, h} from '@stencil/core';\nimport ClearSlim from '../../../images/clear-slim.svg';\nimport {AnyBindings} from '../interface/bindings';\nimport {Button, StencilButtonProps} from '../stencil-button';\n\ninterface Props extends Partial<StencilButtonProps> {\n bindings: AnyBindings;\n inputRef: HTMLInputElement | HTMLTextAreaElement | null;\n}\n\nexport const TextAreaClearButton: FunctionalComponent<Props> = ({\n inputRef,\n bindings,\n onClick,\n ...defaultButtonProps\n}) => (\n <div\n part=\"clear-button-wrapper\"\n class=\"ml-2 flex items-center justify-center py-2\"\n >\n <Button\n style=\"text-transparent\"\n part=\"clear-button\"\n class=\"text-neutral-dark flex h-8 w-8 shrink-0 items-center justify-center\"\n onClick={() => {\n onClick?.();\n inputRef?.focus();\n }}\n ariaLabel={bindings.i18n.t('clear')}\n {...defaultButtonProps}\n >\n <atomic-icon\n part=\"clear-icon\"\n icon={ClearSlim}\n class=\"h-4 w-4\"\n ></atomic-icon>\n </Button>\n </div>\n);\n","import {FunctionalComponent, h} from '@stencil/core';\nimport {JSXBase} from '@stencil/core/internal';\nimport {AnyBindings} from '../interface/bindings';\nimport {TextAreaClearButton} from './stencil-text-area-clear-button';\n\ninterface Props extends JSXBase.TextareaHTMLAttributes<HTMLTextAreaElement> {\n textAreaRef: HTMLTextAreaElement;\n loading: boolean;\n bindings: AnyBindings;\n value: string;\n ariaLabel: string;\n onClear(): void;\n popup?: {\n id: string;\n activeDescendant: string;\n expanded: boolean;\n hasSuggestions: boolean;\n };\n}\n\nfunction getPopupAttributes(props: Required<Props>['popup']) {\n return {\n autocomplete: 'off',\n autocapitalize: 'off',\n autocorrect: 'off',\n ...(props.activeDescendant && {\n 'aria-activedescendant': props.activeDescendant,\n }),\n 'aria-autocomplete': 'both',\n 'aria-haspopup': 'true',\n 'aria-controls': props.id,\n };\n}\n\nfunction syncTextWithReplica(elem: HTMLTextAreaElement, value?: string) {\n const parent = elem?.parentNode as HTMLElement;\n if (!parent) {\n return;\n }\n if (elem.value === '\\n') {\n return;\n }\n parent.dataset.replicatedValue = value ?? elem.value;\n}\n\nfunction resetReplicaText(elem: HTMLTextAreaElement) {\n const parent = elem?.parentNode as HTMLElement;\n if (parent) {\n delete parent.dataset.replicatedValue;\n }\n}\n\nfunction collapseTextArea(elem: HTMLTextAreaElement) {\n const parent = elem?.parentNode as HTMLElement;\n if (parent) {\n parent.classList.remove('expanded');\n }\n}\n\nfunction expandTextArea(elem: HTMLTextAreaElement) {\n const parent = elem?.parentNode as HTMLElement;\n if (parent) {\n parent.classList.add('expanded');\n }\n}\n\nexport const SearchTextArea: FunctionalComponent<Props> = ({\n textAreaRef,\n loading,\n bindings,\n onInput,\n onFocus,\n onBlur,\n onChange,\n onKeyDown,\n onKeyUp,\n value,\n ariaLabel,\n onClear,\n popup,\n ...defaultInputProps\n}) => (\n <div class=\"flex grow overflow-hidden\">\n <div part=\"textarea-expander\" class=\"grid grow overflow-hidden\">\n <textarea\n part=\"textarea\"\n aria-label={ariaLabel}\n placeholder={bindings.i18n.t('search')}\n class=\"placeholder-neutral-dark\"\n rows={1}\n onInput={(e) => {\n onInput?.(e);\n syncTextWithReplica(textAreaRef);\n }}\n onKeyDown={(e) => {\n syncTextWithReplica(textAreaRef);\n if (e.key === 'Enter') {\n if (e.shiftKey) {\n return;\n }\n e.preventDefault();\n }\n onKeyDown?.(e);\n }}\n onKeyUp={(e) => {\n onKeyUp?.(e);\n if (e.key === 'Enter') {\n e.preventDefault();\n return;\n }\n syncTextWithReplica(textAreaRef);\n }}\n onBlur={(e) => {\n onBlur?.(e);\n collapseTextArea(textAreaRef);\n syncTextWithReplica(textAreaRef);\n }}\n onChange={(e) => {\n onChange?.(e);\n syncTextWithReplica(textAreaRef);\n }}\n onFocus={(e) => {\n onFocus?.(e);\n const target = e.target as HTMLTextAreaElement;\n syncTextWithReplica(textAreaRef ?? target);\n expandTextArea(textAreaRef ?? target);\n }}\n autocomplete=\"off\"\n {...(popup && getPopupAttributes(popup))}\n {...defaultInputProps}\n value={value}\n />\n </div>\n\n {loading && (\n <div class=\"searchbox-button-wrapper ml-2 flex items-center justify-center\">\n <span\n part=\"loading\"\n class=\"loading mr-2 grid h-5 w-5 animate-spin place-items-center rounded-full bg-linear-to-r\"\n ></span>\n </div>\n )}\n {!loading && value && (\n <TextAreaClearButton\n inputRef={textAreaRef}\n bindings={bindings}\n onClick={() => {\n onClear();\n resetReplicaText(textAreaRef);\n }}\n />\n )}\n </div>\n);\n","export function promiseTimeout<T>(prom: T | Promise<T>, ms: number) {\n let id: NodeJS.Timeout;\n const timeout = new Promise((_, reject) => {\n id = setTimeout(() => {\n reject(new Error('Promise timed out.'));\n }, ms);\n });\n return Promise.race([prom, timeout]).then(() => {\n clearTimeout(id);\n });\n}\n","import {isNullOrUndefined} from '@coveo/bueno';\nimport {forceUpdate} from '@stencil/core';\nimport DOMPurify from 'dompurify';\nimport {debounce} from '../../../utils/debounce-utils';\nimport {promiseTimeout} from '../../../utils/promise-utils';\nimport type {\n SearchBoxSuggestionElement,\n SearchBoxSuggestionsBindings,\n SearchBoxSuggestionsEvent,\n} from './suggestions-types';\nimport {elementHasNoQuery, elementHasQuery} from './suggestions-utils';\n\n/**\n * List of suggestions that will be displayed along other lists (e.g recent queries) when the search box's input is selected.\n */\nexport interface SearchBoxSuggestions {\n /**\n * The search box will sort the position of suggestions using this value, the lowest value being first.\n * By default, the DOM position will be used.\n */\n position: number;\n /**\n * Whether the suggestions should be listed in the right or left panel. By default, the suggestions are listed in the right panel.\n */\n panel?: 'left' | 'right';\n /**\n * Method that returns the list of elements which will be rendered in the list of suggestions.\n */\n renderItems(): SearchBoxSuggestionElement[];\n /**\n * Hook called when the user changes the search box's input value. This can lead to all the query suggestions being updated.\n */\n onInput?(): Promise<unknown>;\n /**\n * Hook called when the current suggested query changes as the user navigates the list of suggestions.\n * This is used for instant results, which are rendered based on the current suggested query.\n * @param q The new current suggested query.\n */\n onSuggestedQueryChange?(q: string): Promise<unknown>;\n}\n\ninterface SearchBoxProps {\n getSearchBoxValue: () => string;\n updateQuery: (suggestedQuery: string) => void;\n getSuggestionTimeout: () => number;\n getNumberOfSuggestionsToDisplay: () => number;\n getSuggestionDelay: () => number;\n getLogger: () => Pick<typeof console, 'warn'>;\n getHost: () => HTMLElement;\n}\n\nexport class SuggestionManager<SearchBoxController> {\n public suggestions: SearchBoxSuggestions[] = [];\n public leftSuggestionElements: SearchBoxSuggestionElement[] = [];\n public rightSuggestionElements: SearchBoxSuggestionElement[] = [];\n public leftPanel: HTMLElement | undefined = undefined;\n public rightPanel: HTMLElement | undefined = undefined;\n public triggerSuggestions: () => Promise<void>;\n public activeDescendant = '';\n public suggestedQuery = '';\n public keyboardActiveDescendant = '';\n\n private queryDataAttribute = 'data-query';\n private suggestionEvents: SearchBoxSuggestionsEvent<SearchBoxController>[] =\n [];\n\n private previousActiveDescendantElement: HTMLElement | null = null;\n private leftSuggestions: SearchBoxSuggestions[] = [];\n private rightSuggestions: SearchBoxSuggestions[] = [];\n\n constructor(private ownerSearchBoxProps: SearchBoxProps) {\n this.triggerSuggestions = debounce(\n () => this.executeQuerySuggestion(),\n this.ownerSearchBoxProps.getSuggestionDelay()\n );\n }\n\n public get partialSuggestionBindings(): Pick<\n SearchBoxSuggestionsBindings<SearchBoxController>,\n | 'suggestedQuery'\n | 'clearSuggestions'\n | 'triggerSuggestions'\n | 'getSuggestions'\n | 'getSuggestionElements'\n > {\n return {\n suggestedQuery: () => this.suggestedQuery,\n clearSuggestions: () => this.clearSuggestions(),\n triggerSuggestions: () => this.triggerSuggestions(),\n getSuggestions: () => this.suggestions,\n getSuggestionElements: () => this.allSuggestionElements,\n };\n }\n\n public get activeDescendantElement(): HTMLElement | null {\n if (!this.hasActiveDescendant) {\n return null;\n }\n\n return (\n this.leftPanel?.querySelector(`#${this.activeDescendant}`) ||\n this.rightPanel?.querySelector(`#${this.activeDescendant}`) ||\n null\n );\n }\n\n public onSubmit() {\n this.clickOnActiveElement();\n this.clearSuggestions();\n }\n\n public updateActiveDescendant(id = '') {\n this.activeDescendant = id;\n forceUpdate(this.ownerSearchBoxProps.getHost());\n }\n\n public updateKeyboardActiveDescendant(id = '') {\n this.keyboardActiveDescendant = id;\n }\n\n public clickOnActiveElement() {\n this.activeDescendantElement?.click();\n this.updateActiveDescendant();\n }\n\n public isRightPanelInFocus() {\n if (\n isNullOrUndefined(this.panelInFocus) ||\n isNullOrUndefined(this.rightPanel)\n ) {\n return false;\n }\n\n return this.panelInFocus === this.rightPanel;\n }\n\n public initializeSuggestions(\n bindings: SearchBoxSuggestionsBindings<SearchBoxController>\n ) {\n this.suggestions = this.suggestionEvents.map((event) => event(bindings));\n }\n\n public registerSuggestionsFromEvent(\n event: CustomEvent<SearchBoxSuggestionsEvent<SearchBoxController>>,\n bindings: SearchBoxSuggestionsBindings<SearchBoxController>\n ) {\n event.preventDefault();\n event.stopPropagation();\n this.suggestionEvents.push(event.detail);\n this.suggestions.push(event.detail(bindings));\n }\n\n public registerSuggestions(suggestions: SearchBoxSuggestions) {\n this.suggestions.push(suggestions);\n }\n\n public get isDoubleList() {\n return Boolean(\n this.leftSuggestionElements.length && this.rightSuggestionElements.length\n );\n }\n\n public focusPanel(side: 'left' | 'right') {\n const panel = side === 'left' ? this.leftPanel : this.rightPanel;\n\n if (this.panelInFocus === panel) {\n return;\n }\n if (panel?.firstElementChild) {\n const panelHasActiveDescendant =\n this.previousActiveDescendantElement &&\n panel.contains(this.previousActiveDescendantElement);\n const newValue = panelHasActiveDescendant\n ? this.previousActiveDescendantElement!\n : (panel.firstElementChild as HTMLElement);\n this.updateDescendants(newValue.id);\n }\n }\n\n public clearSuggestions() {\n this.clearSuggestionElements();\n this.updateActiveDescendant();\n }\n\n public async focusNextValue() {\n if (!this.hasSuggestions || !this.nextOrFirstValue) {\n return;\n }\n\n await this.focusValue(this.nextOrFirstValue as HTMLElement);\n }\n\n public async focusValue(value: HTMLElement) {\n this.updateKeyboardActiveDescendant(value.id);\n this.updateActiveDescendant(value.id);\n this.scrollActiveDescendantIntoView();\n await this.updateQueryFromSuggestion();\n }\n\n public async onSuggestionMouseOver(\n item: SearchBoxSuggestionElement,\n side: 'left' | 'right',\n id: string\n ) {\n const thisPanel = side === 'left' ? this.leftPanel : this.rightPanel;\n // When hovering, always reset the keyboard active descendant\n this.updateKeyboardActiveDescendant();\n if (this.panelInFocus === thisPanel) {\n this.updateActiveDescendant(id);\n } else {\n this.updateDescendants(id);\n }\n if (item.query) {\n await this.updateSuggestedQuery(item.query);\n }\n }\n\n public async onSuggestionClick(item: SearchBoxSuggestionElement, e: Event) {\n if (item.query) {\n this.clearSuggestions();\n await this.updateOwnerSearchboxQuery(item.query);\n }\n item.onSelect?.(e);\n }\n\n public get hasSuggestions() {\n return !!this.allSuggestionElements.length;\n }\n\n public get allSuggestionElements() {\n return [...this.leftSuggestionElements, ...this.rightSuggestionElements];\n }\n\n public async focusPreviousValue() {\n if (this.firstValue === this.activeDescendantElement) {\n this.updateKeyboardActiveDescendant();\n this.updateActiveDescendant();\n return;\n }\n\n if (!this.hasSuggestions || !this.previousOrLastValue) {\n return;\n }\n\n await this.focusValue(this.previousOrLastValue as HTMLElement);\n }\n\n public get hasActiveDescendant() {\n return this.activeDescendant !== '';\n }\n\n private async executeQuerySuggestion() {\n this.updateActiveDescendant();\n const settled = await Promise.allSettled(\n this.suggestions.map((suggestion) =>\n promiseTimeout(\n suggestion.onInput ? suggestion.onInput() : Promise.resolve(),\n this.ownerSearchBoxProps.getSuggestionTimeout()\n )\n )\n );\n\n const fulfilledSuggestions: SearchBoxSuggestions[] = [];\n\n settled.forEach((prom, j) => {\n if (prom.status === 'fulfilled') {\n fulfilledSuggestions.push(this.suggestions[j]);\n } else {\n this.ownerSearchBoxProps\n .getLogger()\n .warn(\n 'Some query suggestions are not being shown because the promise timed out.'\n );\n }\n });\n\n const splitSuggestions = (side: 'left' | 'right', isDefault = false) =>\n fulfilledSuggestions\n .filter(\n (suggestion) =>\n suggestion.panel === side || (!suggestion.panel && isDefault)\n )\n .sort(this.sortSuggestions);\n\n this.leftSuggestions = splitSuggestions('left', true);\n this.leftSuggestionElements = this.getAndFilterLeftSuggestionElements();\n\n this.rightSuggestions = splitSuggestions('right');\n this.rightSuggestionElements = this.getSuggestionElements(\n this.rightSuggestions\n );\n\n const defaultSuggestedQuery =\n this.allSuggestionElements.find(elementHasQuery)?.query || '';\n\n await this.updateSuggestedQuery(defaultSuggestedQuery);\n }\n\n private get lastValue() {\n return this.panelInFocus?.lastElementChild;\n }\n\n private get previousOrLastValue() {\n if (!this.hasActiveDescendant) {\n return this.lastValue?.firstChild;\n }\n\n const parentOfActiveDescendant =\n this.activeDescendantElement?.parentElement;\n return (\n parentOfActiveDescendant?.previousElementSibling?.firstChild ||\n this.firstValue?.firstChild\n );\n }\n\n private sortSuggestions(a: SearchBoxSuggestions, b: SearchBoxSuggestions) {\n return a.position - b.position;\n }\n\n private get nextOrFirstValue() {\n if (!this.hasActiveDescendant) {\n return this.firstValue?.firstChild;\n }\n\n const parentOfActiveDescendant =\n this.activeDescendantElement?.parentElement;\n return (\n parentOfActiveDescendant?.nextElementSibling?.firstChild ||\n this.firstValue?.firstChild\n );\n }\n\n private get firstValue() {\n return this.panelInFocus?.firstElementChild;\n }\n\n private get panelInFocus() {\n if (this.leftPanel?.contains(this.activeDescendantElement)) {\n return this.leftPanel;\n }\n if (this.rightPanel?.contains(this.activeDescendantElement)) {\n return this.rightPanel;\n }\n return this.leftPanel || this.rightPanel;\n }\n\n private scrollActiveDescendantIntoView() {\n this.activeDescendantElement?.scrollIntoView({\n block: 'nearest',\n });\n }\n\n private async updateQueryFromSuggestion() {\n const suggestedQuery = this.activeDescendantElement?.getAttribute(\n this.queryDataAttribute\n );\n await this.updateOwnerSearchboxQuery(suggestedQuery || '');\n }\n\n private async updateOwnerSearchboxQuery(query: string) {\n if (query && this.ownerSearchBoxProps.getSearchBoxValue() !== query) {\n this.ownerSearchBoxProps.updateQuery(query);\n await this.updateSuggestedQuery(query);\n }\n }\n\n private async updateSuggestedQuery(suggestedQuery: string) {\n await Promise.allSettled(\n this.suggestions.map((suggestion) =>\n promiseTimeout(\n suggestion.onSuggestedQueryChange\n ? suggestion.onSuggestedQueryChange(suggestedQuery)\n : Promise.resolve(),\n this.ownerSearchBoxProps.getSuggestionTimeout()\n )\n )\n );\n this.suggestedQuery = suggestedQuery;\n this.updateSuggestionElements(suggestedQuery);\n forceUpdate(this.ownerSearchBoxProps.getHost());\n }\n\n private updateSuggestionElements(query: string) {\n if (!this.isPanelInFocus(this.leftPanel, query)) {\n this.leftSuggestionElements = this.getAndFilterLeftSuggestionElements();\n }\n\n if (!this.isPanelInFocus(this.rightPanel, query)) {\n this.rightSuggestionElements = this.getSuggestionElements(\n this.rightSuggestions\n );\n }\n }\n\n public forceUpdate() {\n this.updateSuggestionElements(this.suggestedQuery);\n forceUpdate(this.ownerSearchBoxProps.getHost());\n }\n\n private isPanelInFocus(\n panel: HTMLElement | undefined,\n query: string\n ): boolean {\n if (!this.activeDescendantElement) {\n return false;\n }\n\n if (query) {\n const escaped = DOMPurify.sanitize(query);\n return !!panel?.querySelector(\n `[${this.queryDataAttribute}=\"${CSS.escape(escaped)}\"]`\n );\n }\n\n return this.activeDescendantElement?.closest('ul') === panel;\n }\n\n private getAndFilterLeftSuggestionElements() {\n const suggestionElements = this.getSuggestionElements(this.leftSuggestions);\n const filterOnDuplicate = new Set();\n\n const out = suggestionElements.filter((suggestionElement) => {\n if (isNullOrUndefined(suggestionElement.query)) {\n return true;\n }\n if (filterOnDuplicate.has(suggestionElement.query)) {\n return false;\n } else {\n filterOnDuplicate.add(suggestionElement.query);\n return true;\n }\n });\n\n return out;\n }\n\n private getSuggestionElements(suggestions: SearchBoxSuggestions[]) {\n const elements = suggestions.flatMap((suggestion) =>\n suggestion.renderItems()\n );\n\n const max =\n this.ownerSearchBoxProps.getNumberOfSuggestionsToDisplay() +\n elements.filter(elementHasNoQuery).length;\n\n return elements.slice(0, max);\n }\n\n private updateDescendants(activeDescendant = '') {\n const newPrevDescendantElement = this.activeDescendantElement;\n this.previousActiveDescendantElement = newPrevDescendantElement;\n this.updateActiveDescendant(activeDescendant);\n }\n\n private clearSuggestionElements() {\n this.leftSuggestionElements = [];\n this.rightSuggestionElements = [];\n }\n}\n"],"mappings":"mgBAOaA,EAA+C,CAC1DC,EACAC,KAEA,MAAMC,EAAa,KACjB,MAAMC,EACJ,uGACF,MAAMC,EAAeJ,EAAMK,SACvB,yDACA,6DAEJ,MAAO,CAACF,EAAaC,GAAcE,KAAK,IAAI,EAG9C,OACEC,EAAA,OAAKC,KAAK,UAAUC,MAAOP,IAAcQ,WAAYV,EAAMU,YACxDT,EACG,E,2UCdH,MAAMU,EAAkD,EAC7DC,WACAC,WACAC,aACGC,KAEHR,EAAA,OACEC,KAAK,uBACLC,MAAM,8CAENF,EAACS,EAAM,CACLC,MAAM,mBACNT,KAAK,eACLC,MAAM,sEACNK,QAAS,KACPA,MACAF,GAAUM,OAAO,EAEnBC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AgB,GAEA,IAAKjE,KAAKuB,wBAAyB,CACjC,OAAO,K,CAGT,GAAI0C,EAAO,CACT,MAAM8C,EAAUC,EAAUC,SAAShD,GACnC,QAAShB,GAAOxB,cACd,IAAIzB,KAAKS,uBAAuByG,IAAIC,OAAOJ,O,CAI/C,OAAO/G,KAAKuB,yBAAyB6F,QAAQ,QAAUnE,C,CAGjD,kCAAAwC,GACN,MAAM4B,EAAqBrH,KAAKqB,sBAAsBrB,KAAKY,iBAC3D,MAAM0G,EAAoB,IAAIC,IAE9B,MAAMC,EAAMH,EAAmB/B,QAAQmC,IACrC,GAAIvF,EAAkBuF,EAAkBxD,OAAQ,CAC9C,OAAO,I,CAET,GAAIqD,EAAkBI,IAAID,EAAkBxD,OAAQ,CAClD,OAAO,K,KACF,CACLqD,EAAkBzJ,IAAI4J,EAAkBxD,OACxC,OAAO,I,KAIX,OAAOuD,C,CAGD,qBAAAnG,CAAsBpB,GAC5B,MAAM0H,EAAW1H,EAAY2H,SAASjD,GACpCA,EAAWkD,gBAGb,MAAMC,EACJ9H,KAAKD,oBAAoBgI,kCACzBJ,EAASrC,OAAO0C,GAAmBlF,OAErC,OAAO6E,EAASM,MAAM,EAAGH,E,CAGnB,iBAAAxE,CAAkBvG,EAAmB,IAC3C,MAAMmL,EAA2BlI,KAAKuB,wBACtCvB,KAAKW,gCAAkCuH,EACvClI,KAAK4B,uBAAuB7E,E,CAGtB,uBAAAwG,GACNvD,KAAKE,uBAAyB,GAC9BF,KAAKG,wBAA0B,E","ignoreList":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["atomicInsightSearchBoxCss","AtomicInsightSearchBoxStyle0","AtomicInsightSearchBox","this","isExpanded","disableSearch","numberOfSuggestions","initialize","id","randomID","searchBoxOptions","highlightOptions","notMatchDelimiters","open","close","correctionDelimiters","fetchQuerySuggestions","registerQuerySuggest","loadInsightSearchActions","bindings","engine","searchBox","buildInsightSearchBox","options","dispatch","count","suggestionManager","SuggestionManager","getNumberOfSuggestionsToDisplay","updateQuery","query","updateText","getSearchBoxValue","searchBoxState","value","getSuggestionTimeout","getSuggestionDelay","getHost","host","getLogger","logger","registerSuggestions","position","renderItems","state","suggestions","map","suggestion","renderSuggestionItem","onInput","panel","onSubmit","activeDescendantElement","clickOnActiveElement","submit","clearSuggestions","onKeyDown","e","key","preventDefault","focusNextValue","announceNewActiveSuggestionToScreenReader","focusPreviousValue","triggerTextAreaChange","textAreaRef","dispatchEvent","window","Event","renderSuggestion","item","index","lastIndex","isSelected","activeDescendant","suggestedQuery","hideIfLast","h","i18n","side","isDoubleList","onClick","onSuggestionClick","onMouseOver","onSuggestionMouseOver","hasQuery","partialItem","getPartialSearchBoxSuggestionElement","content","QuerySuggestionContainer","QuerySuggestionIcon","icon","SearchSlimIcon","hasSuggestion","length","QuerySuggestionText","onSelect","selectSuggestion","rawValue","renderPanel","elements","setRef","getRef","part","ref","class","onMouseDown","target","renderSuggestions","hasSuggestions","updateActiveDescendant","role","t","allSuggestionElements","el","leftPanel","getSearchInputLabel","isMacOS","hasKeyboard","onFocus","triggerSuggestions","announceNewSuggestionsToScreenReader","ariaLabel","suggestionsAriaMessage","numberOfSuggestionsToAnnounce","filter","elementHasQuery","searchBoxAriaMessage","render","SearchBoxWrapper","disabled","onFocusout","event","isFocusingOut","SearchTextArea","loading","isLoading","placeholder","onClear","clear","__decorate","InitializeBindings","BindStateToController","AriaLiveRegion"],"sources":["src/components/insight/atomic-insight-search-box/atomic-insight-search-box.pcss?tag=atomic-insight-search-box&encapsulation=shadow","src/components/insight/atomic-insight-search-box/atomic-insight-search-box.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n@import '../../common/search-box/search-box.pcss';\n\n[part='wrapper'] {\n @apply z-10;\n}\n\n:host {\n position: relative;\n}\n\n[part='input'] {\n padding-top: 0.675rem;\n padding-bottom: 0.675rem;\n}\n\n[part='submit-icon'] {\n @apply text-on-background;\n}\n\n[part='submit-button'] {\n @apply flex w-10 items-center justify-center;\n}\n\n.loading::after {\n content: '';\n @apply bg-background absolute h-5/6 w-5/6 rounded-full;\n}\n\n[part='clear-button-wrapper'] {\n @apply mr-2 py-0;\n}\n\n[part='clear-icon'] {\n @apply h-3 w-3;\n}\n\n[part='textarea-expander'] {\n &::after {\n @apply p-2 px-4;\n }\n}\n\n[part='textarea-expander'] {\n [part='textarea'] {\n @apply p-2 px-4;\n }\n}\n","import {loadInsightSearchActions} from '@coveo/headless/insight';\nimport {\n buildSearchBox as buildInsightSearchBox,\n SearchBox as InsightSearchBox,\n SearchBoxState as InsightSearchBoxState,\n Suggestion as InsightSuggestion,\n} from '@coveo/headless/insight';\nimport {Component, Element, h, Prop, State} from '@stencil/core';\nimport SearchSlimIcon from '../../../images/search-slim.svg';\nimport {hasKeyboard, isMacOS} from '../../../utils/device-utils';\nimport {\n BindStateToController,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {AriaLiveRegion} from '../../../utils/stencil-accessibility-utils';\nimport {isFocusingOut, randomID} from '../../../utils/utils';\nimport {SearchBoxWrapper} from '../../common/search-box/stencil-search-box-wrapper';\nimport {SearchTextArea} from '../../common/search-box/stencil-search-text-area';\nimport {\n getPartialSearchBoxSuggestionElement,\n QuerySuggestionContainer,\n QuerySuggestionIcon,\n QuerySuggestionText,\n} from '../../common/suggestions/stencil-query-suggestions';\nimport {SuggestionManager} from '../../common/suggestions/stencil-suggestion-manager';\nimport {\n elementHasQuery,\n} from '../../common/suggestions/suggestions-utils';\nimport {\n SearchBoxSuggestionElement,\n} from '../../common/suggestions/suggestions-types';\nimport {InsightBindings} from '../atomic-insight-interface/atomic-insight-interface';\n\n/**\n * @internal\n */\n@Component({\n tag: 'atomic-insight-search-box',\n styleUrl: 'atomic-insight-search-box.pcss',\n shadow: true,\n})\nexport class AtomicInsightSearchBox {\n @InitializeBindings() public bindings!: InsightBindings;\n\n private searchBox!: InsightSearchBox;\n private id!: string;\n private textAreaRef!: HTMLTextAreaElement;\n private suggestionManager!: SuggestionManager<InsightSearchBox>;\n\n @Element() private host!: HTMLElement;\n\n @BindStateToController('searchBox')\n @State()\n private searchBoxState!: InsightSearchBoxState;\n @State() public error!: Error;\n @State() private isExpanded = false;\n\n /**\n * Whether to prevent the user from triggering a search from the component.\n * Perfect for use cases where you need to disable the search conditionally, like when the input is empty.\n */\n @Prop({reflect: true}) public disableSearch = false;\n /**\n * The number of query suggestions to display when interacting with the search box.\n */\n @Prop({reflect: true}) public numberOfSuggestions = 5;\n\n @AriaLiveRegion('search-box')\n protected searchBoxAriaMessage!: string;\n\n @AriaLiveRegion('search-suggestions', true)\n protected suggestionsAriaMessage!: string;\n\n public initialize() {\n this.id = randomID('atomic-search-box-');\n\n const searchBoxOptions = {\n id: this.id,\n numberOfSuggestions: 0,\n highlightOptions: {\n notMatchDelimiters: {\n open: '<span class=\"font-bold\">',\n close: '</span>',\n },\n correctionDelimiters: {\n open: '<span class=\"font-normal\">',\n close: '</span>',\n },\n },\n };\n\n const {fetchQuerySuggestions, registerQuerySuggest} =\n loadInsightSearchActions(this.bindings.engine);\n\n this.searchBox = buildInsightSearchBox(this.bindings.engine, {\n options: searchBoxOptions,\n });\n\n this.bindings.engine.dispatch(\n registerQuerySuggest({id: this.id, count: this.numberOfSuggestions})\n );\n\n this.suggestionManager = new SuggestionManager({\n getNumberOfSuggestionsToDisplay: () => this.numberOfSuggestions,\n updateQuery: (query) => this.searchBox.updateText(query),\n getSearchBoxValue: () => this.searchBoxState.value,\n getSuggestionTimeout: () => 500,\n getSuggestionDelay: () => 0,\n getHost: () => this.host,\n getLogger: () => this.bindings.engine.logger,\n });\n\n this.suggestionManager.registerSuggestions({\n position: 0,\n renderItems: () =>\n this.searchBox.state.suggestions.map((suggestion) =>\n this.renderSuggestionItem(suggestion)\n ),\n onInput: () => this.bindings.engine.dispatch(fetchQuerySuggestions({id: this.id})),\n panel: 'left',\n });\n }\n\n private onSubmit() {\n if (this.suggestionManager.activeDescendantElement) {\n this.suggestionManager.clickOnActiveElement();\n return;\n }\n\n this.searchBox.submit();\n this.suggestionManager.clearSuggestions();\n }\n\n private async onKeyDown(e: KeyboardEvent) {\n if (this.disableSearch) {\n return;\n }\n\n switch (e.key) {\n case 'Enter':\n this.onSubmit();\n break;\n case 'Escape':\n this.suggestionManager.clearSuggestions();\n break;\n case 'ArrowDown':\n e.preventDefault();\n await this.suggestionManager.focusNextValue();\n this.announceNewActiveSuggestionToScreenReader();\n break;\n case 'ArrowUp':\n e.preventDefault();\n await this.suggestionManager.focusPreviousValue();\n this.announceNewActiveSuggestionToScreenReader();\n break;\n case 'Tab':\n this.suggestionManager.clearSuggestions();\n break;\n }\n }\n\n private triggerTextAreaChange(value: string) {\n this.textAreaRef.value = value;\n this.textAreaRef.dispatchEvent(new window.Event('change'));\n }\n\n private renderSuggestion(\n item: SearchBoxSuggestionElement,\n index: number,\n lastIndex: number\n ) {\n const id = `${this.id}-suggestion-${item.key}`;\n\n const isSelected =\n id === this.suggestionManager.activeDescendant ||\n this.suggestionManager.suggestedQuery === item.query;\n\n if (index === lastIndex && item.hideIfLast) {\n return null;\n }\n\n return (\n <atomic-suggestion-renderer\n i18n={this.bindings.i18n}\n id={id}\n suggestion={item}\n isSelected={isSelected}\n side={'left'}\n index={index}\n lastIndex={lastIndex}\n isDoubleList={false}\n onClick={(e: Event) => {\n this.suggestionManager.onSuggestionClick(item, e);\n }}\n onMouseOver={() => {\n this.suggestionManager.onSuggestionMouseOver(item, 'left', id);\n }}\n ></atomic-suggestion-renderer>\n );\n }\n\n private renderSuggestionItem(\n suggestion: InsightSuggestion\n ): SearchBoxSuggestionElement {\n const hasQuery = this.searchBox.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={SearchSlimIcon}\n hasSuggestion={this.searchBoxState.suggestions.length > 1}\n />\n\n <QuerySuggestionText suggestion={suggestion} hasQuery={hasQuery} />\n </QuerySuggestionContainer>\n ),\n onSelect: () => {\n this.searchBox.selectSuggestion(suggestion.rawValue);\n },\n };\n }\n\n private renderPanel(\n elements: SearchBoxSuggestionElement[],\n setRef: (el: HTMLElement | undefined) => void,\n getRef: () => HTMLElement | undefined\n ) {\n if (!elements.length) {\n return null;\n }\n\n return (\n <div\n part={'suggestions'}\n ref={setRef}\n class=\"flex grow basis-1/2 flex-col\"\n onMouseDown={(e) => {\n if (e.target === getRef()) {\n e.preventDefault();\n }\n }}\n >\n {elements.map((suggestion, index) =>\n this.renderSuggestion(suggestion, index, elements.length - 1)\n )}\n </div>\n );\n }\n\n private renderSuggestions() {\n if (!this.suggestionManager.hasSuggestions) {\n this.suggestionManager.updateActiveDescendant();\n return null;\n }\n\n return (\n <div\n id={`${this.id}-popup`}\n part=\"suggestions-wrapper\"\n class={`bg-background border-neutral absolute top-full left-0 z-10 flex w-full rounded-md border ${\n this.suggestionManager.hasSuggestions && this.isExpanded\n ? ''\n : 'hidden'\n }`}\n role=\"application\"\n aria-label={this.bindings.i18n.t('search-suggestions-single-list')}\n {...(this.suggestionManager.activeDescendant && {\n 'aria-activedescendant': this.suggestionManager.activeDescendant,\n })}\n >\n {this.renderPanel(\n this.suggestionManager.allSuggestionElements,\n (el) => (this.suggestionManager.leftPanel = el),\n () => this.suggestionManager.leftPanel\n )}\n </div>\n );\n }\n\n private getSearchInputLabel() {\n if (isMacOS()) {\n return this.bindings.i18n.t('search-box-with-suggestions-macos');\n }\n if (!hasKeyboard()) {\n return this.bindings.i18n.t('search-box-with-suggestions-keyboardless');\n }\n return this.bindings.i18n.t('search-box-with-suggestions');\n }\n\n private async onFocus() {\n if (this.isExpanded) {\n return;\n }\n this.isExpanded = true;\n await this.suggestionManager.triggerSuggestions();\n this.announceNewSuggestionsToScreenReader();\n }\n\n private async onInput(value: string) {\n this.searchBox.updateText(value);\n this.isExpanded = true;\n await this.suggestionManager.triggerSuggestions();\n this.announceNewSuggestionsToScreenReader();\n }\n\n private announceNewActiveSuggestionToScreenReader() {\n const ariaLabel = this.suggestionManager.activeDescendantElement?.ariaLabel;\n if (isMacOS() && ariaLabel) {\n this.suggestionsAriaMessage = ariaLabel;\n }\n }\n\n private announceNewSuggestionsToScreenReader() {\n const numberOfSuggestionsToAnnounce =\n this.suggestionManager.allSuggestionElements.filter(\n elementHasQuery\n ).length;\n this.searchBoxAriaMessage = numberOfSuggestionsToAnnounce\n ? this.bindings.i18n.t(\n this.searchBoxState.value\n ? 'query-suggestions-available'\n : 'query-suggestions-available-no-query',\n {\n count: numberOfSuggestionsToAnnounce,\n query: this.searchBoxState.value,\n }\n )\n : this.bindings.i18n.t('query-suggestions-unavailable');\n }\n\n public render() {\n return (\n <SearchBoxWrapper\n disabled={this.disableSearch}\n onFocusout={(event) => {\n if (!isFocusingOut(event)) {\n return;\n }\n this.suggestionManager.clearSuggestions();\n this.isExpanded = false;\n }}\n >\n <atomic-icon\n part=\"submit-icon\"\n icon={SearchSlimIcon}\n class=\"my-auto mr-0 ml-4 h-4 w-4\"\n />\n <SearchTextArea\n textAreaRef={this.textAreaRef}\n loading={this.searchBoxState.isLoading}\n ref={(el) => el && (this.textAreaRef = el)}\n bindings={this.bindings}\n value={this.searchBoxState.value}\n ariaLabel={this.getSearchInputLabel()}\n placeholder={this.bindings.i18n.t('search-ellipsis')}\n onFocus={() => this.onFocus()}\n onKeyDown={(e) => this.onKeyDown(e)}\n onClear={() => {\n this.searchBox.clear();\n this.triggerTextAreaChange('');\n }}\n onInput={(e) => this.onInput((e.target as HTMLInputElement).value)}\n />\n {this.renderSuggestions()}\n </SearchBoxWrapper>\n );\n }\n}\n"],"mappings":"ysBAAA,MAAMA,EAA4B,smpEAClC,MAAAC,EAAeD,E,iXCwCFE,EAAsB,M,yBAchBC,KAAAC,WAAa,MAMAD,KAAAE,cAAgB,MAIhBF,KAAAG,oBAAsB,E,mEAVtB,M,mBAMgB,M,yBAIM,C,CAQ7C,UAAAC,GACLJ,KAAKK,GAAKC,EAAS,sBAEnB,MA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 -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,CACnBI,GAAIT,KAAKD,SAASU,GAClBC,MAAOV,KAAKD,SAASY,mBAIzB,MAAO,CACLC,SAAUC,MAAMC,KAAKd,KAAKE,KAAKa,WAAYC,UAAUC,QAAQjB,KAAKE,MAClEgB,QAAS,IACPd,EAAOI,SACLF,EAAsB,CACpBG,GAAIT,KAAKD,SAASU,MAGxBU,YAAa,IAAMnB,KAAKmB,c,CAIpB,WAAAA,GACN,MAAMC,EAAWpB,KAAKD,SAASsB,oBAAoBC,MAAMC,QAAU,GACnE,MAAMC,EAAMJ,EAAWpB,KAAKyB,aAAezB,KAAK0B,gBAChD,OAAO1B,KAAKD,SAASsB,oBAAoBC,MAAMK,YAC5CC,MAAM,EAAGJ,GACTK,KAAKC,GAAe9B,KAAK+B,WAAWD,I,CAGjC,UAAAC,CAAWD,GACjB,MAAMV,EAAWpB,KAAKD,SAASsB,oBAAoBC,MAAMC,QAAU,GACnE,MAAMS,EAAcC,EAClBH,EACA9B,KAAKD,SAASmC,MAGhB,MAAO,IACFF,EACHG,QACEC,EAACC,EAAwB,KACvBD,EAACE,EAAmB,CAClBC,KAAMvC,KAAKuC,MAAQC,EACnBC,cAAezC,KAAKD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import{b as t}from"./p-1580513b.js";const e=(t,e,a=s)=>{const n=o(e,s.join(", "));if(!n){throw new Error(`The "${e.nodeName.toLowerCase()}" component was not handled, as it is not a child of the following elements: ${a.join(", ")}`)}void i(n,e,t)};const s=["atomic-search-box","atomic-insight-search-box","atomic-commerce-search-box"];const a=o=>"updateComplete"in o&&o.updateComplete instanceof Promise;const i=async(o,e,s)=>{await customElements.whenDefined(o.nodeName.toLowerCase());if(a(o)){await o.updateComplete}else if("componentOnReady"in o){await o.componentOnReady()}e.dispatchEvent(t("atomic/searchBoxSuggestion/register",s))};export{e as d};
|
2
|
-
//# sourceMappingURL=p-4b7a19db.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["dispatchSearchBoxSuggestionsEvent","event","element","allowedSearchBoxElements","searchBoxElements","interfaceElement","closest","join","Error","nodeName","toLowerCase","dispatchSearchBoxSuggestionsEventEventually","isLitElementLoosely","candidate","updateComplete","Promise","async","customElements","whenDefined","componentOnReady","dispatchEvent","buildCustomEvent"],"sources":["src/components/common/suggestions/suggestions-events.ts"],"sourcesContent":["import type {HTMLStencilElement} from '@stencil/core/internal';\nimport type {LitElement} from 'lit';\nimport {closest} from '../../../utils/dom-utils';\nimport {buildCustomEvent} from '../../../utils/event-utils';\nimport type {AnyBindings} from '../interface/bindings';\nimport type {SearchBoxSuggestionsEvent} from './suggestions-types';\n\n/**\n * Dispatches an event which retrieves the `SearchBoxSuggestionsBindings` on a configured parent search box.\n *\n * @param event Event sent from the registered query suggestions to the parent search box\n * @param element Element on which to dispatch the event, which must be the child of a configured search box\n * @param allowedSearchBoxElements Optional array of allowed search box element selectors\n *\n * @throws Error if the element is not a child of an allowed search box element\n */\nexport const dispatchSearchBoxSuggestionsEvent = <\n SearchBoxController,\n Bindings = AnyBindings,\n>(\n event: SearchBoxSuggestionsEvent<SearchBoxController, Bindings>,\n element: HTMLElement,\n allowedSearchBoxElements: readonly (typeof searchBoxElements)[number][] = searchBoxElements\n) => {\n const interfaceElement = closest(element, searchBoxElements.join(', '));\n if (!interfaceElement) {\n throw new Error(\n `The \"${element.nodeName.toLowerCase()}\" component was not handled, as it is not a child of the following elements: ${allowedSearchBoxElements.join(\n ', '\n )}`\n );\n }\n void dispatchSearchBoxSuggestionsEventEventually(\n interfaceElement,\n element,\n event\n );\n};\n\nconst searchBoxElements = [\n 'atomic-search-box',\n 'atomic-insight-search-box',\n 'atomic-commerce-search-box',\n] as const;\n\nconst isLitElementLoosely = (candidate: unknown): candidate is LitElement =>\n 'updateComplete' in (candidate as LitElement) &&\n (candidate as LitElement).updateComplete instanceof Promise;\n\nconst dispatchSearchBoxSuggestionsEventEventually = async <\n SearchBoxController,\n Bindings = AnyBindings,\n>(\n interfaceElement: Element,\n element: HTMLElement,\n event: SearchBoxSuggestionsEvent<SearchBoxController, Bindings>\n) => {\n await customElements.whenDefined(interfaceElement.nodeName.toLowerCase());\n if (isLitElementLoosely(interfaceElement)) {\n await interfaceElement.updateComplete;\n } else if ('componentOnReady' in interfaceElement) {\n await (interfaceElement as HTMLStencilElement).componentOnReady();\n }\n element.dispatchEvent(\n buildCustomEvent('atomic/searchBoxSuggestion/register', event)\n );\n};\n"],"mappings":"8EAgBaA,EAAoC,CAI/CC,EACAC,EACAC,EAA0EC,KAE1E,MAAMC,EAAmBC,EAAQJ,EAASE,EAAkBG,KAAK,OACjE,IAAKF,EAAkB,CACrB,MAAM,IAAIG,MACR,QAAQN,EAAQO,SAASC,6FAA6FP,EAAyBI,KAC7I,Q,MAIDI,EACHN,EACAH,EACAD,EACD,EAGH,MAAMG,EAAoB,CACxB,oBACA,4BACA,8BAGF,MAAMQ,EAAuBC,GAC3B,mBAAqBA,GACpBA,EAAyBC,0BAA0BC,QAEtD,MAAMJ,EAA8CK,MAIlDX,EACAH,EACAD,WAEMgB,eAAeC,YAAYb,EAAiBI,SAASC,eAC3D,GAAIE,EAAoBP,GAAmB,OACnCA,EAAiBS,c,MAClB,GAAI,qBAAsBT,EAAkB,OAC1CA,EAAwCc,kB,CAEjDjB,EAAQkB,cACNC,EAAiB,sCAAuCpB,GACzD,S","ignoreList":[]}
|