@coveo/atomic 3.33.8-pre.52109a8c79 → 3.33.8-pre.59b23d72e0
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/atomic.esm.js.map +1 -1
- package/dist/atomic/components/_index.d.ts +2 -0
- package/dist/atomic/components/_index.js +3 -1
- package/dist/atomic/components/analytics-config.js +1 -1
- package/dist/atomic/components/atomic-insight-search-box.js +5 -33
- 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-suggestions.d.ts +11 -0
- package/dist/atomic/components/atomic-search-box-query-suggestions.js +8 -0
- package/dist/atomic/components/atomic-search-box-query-suggestions.js.map +1 -0
- package/dist/atomic/components/atomic-search-box-query-suggestions2.js +89 -0
- package/dist/atomic/components/atomic-search-box-query-suggestions2.js.map +1 -0
- 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 +12 -7
- package/dist/atomic/components/atomic-search-box.js.map +1 -1
- package/dist/atomic/components/atomic-smart-snippet-feedback-modal2.js +2 -2
- 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/atomic-tab-manager.js +1 -1
- package/dist/atomic/components/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.js +18 -11
- package/dist/atomic/components/components/commerce/atomic-commerce-interface/atomic-commerce-interface.js +2 -7
- package/dist/atomic/components/components/commerce/atomic-commerce-layout/atomic-commerce-layout.js +19 -10
- 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/atomic-modal/atomic-modal.js +2 -0
- package/dist/atomic/components/components/common/layout/layout-styles-controller.js +40 -0
- package/dist/atomic/components/components/common/layout/mobile-breakpoint-controller.js +26 -0
- package/dist/atomic/components/components/common/suggestions/suggestion-manager.js +1 -1
- package/dist/atomic/components/components/common/suggestions/{suggestions-common.js → suggestions-events.js} +16 -18
- package/dist/atomic/components/components/common/suggestions/suggestions-types.js +1 -0
- package/dist/atomic/components/components/common/suggestions/suggestions-utils.js +18 -0
- package/dist/atomic/components/components/search/index.js +0 -1
- package/dist/atomic/components/components/search/lazy-index.js +0 -1
- 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 +33 -0
- package/dist/atomic/components/stencil-query-suggestions.js.map +1 -0
- package/dist/atomic/components/stencil-suggestion-manager.js +20 -2
- package/dist/atomic/components/stencil-suggestion-manager.js.map +1 -1
- package/dist/atomic/components/{suggestions-common.js → suggestions-events.js} +18 -20
- package/dist/atomic/components/suggestions-events.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-0a051b8d.js +2 -0
- package/dist/atomic/p-0a051b8d.js.map +1 -0
- package/dist/atomic/p-16f4ce98.js +2 -0
- package/dist/atomic/p-16f4ce98.js.map +1 -0
- package/dist/atomic/p-26a51a77.entry.js +2 -0
- package/dist/atomic/p-26a51a77.entry.js.map +1 -0
- package/dist/atomic/p-31f1e44e.entry.js +2 -0
- package/dist/atomic/p-31f1e44e.entry.js.map +1 -0
- package/dist/atomic/p-4b7a19db.js +2 -0
- package/dist/atomic/p-4b7a19db.js.map +1 -0
- package/dist/atomic/{p-ae98c582.entry.js → p-7a625c7e.entry.js} +2 -2
- package/dist/atomic/{p-ab7c83d8.entry.js → p-9cfa782a.entry.js} +2 -2
- package/dist/atomic/{p-39e63678.entry.js → p-aa2a81fd.entry.js} +2 -2
- package/dist/atomic/p-af93b44c.js +2 -0
- package/dist/atomic/p-af93b44c.js.map +1 -0
- package/dist/atomic/{p-6b3c4d63.entry.js → p-b544e64a.entry.js} +2 -2
- package/dist/atomic/{p-3a53ad44.js → p-bc899000.js} +2 -2
- package/dist/atomic/{p-3d847e45.entry.js → p-c88a3d2d.entry.js} +2 -2
- package/dist/atomic/p-c88a3d2d.entry.js.map +1 -0
- package/dist/atomic/{p-b5dd6399.entry.js → p-cc6dc919.entry.js} +2 -2
- package/dist/atomic/{p-36e71b99.entry.js → p-d0f47b33.entry.js} +2 -2
- package/dist/atomic/p-d0f47b33.entry.js.map +1 -0
- package/dist/atomic/{p-aa4224ea.entry.js → p-fbfe913d.entry.js} +2 -2
- package/dist/atomic/p-fbfe913d.entry.js.map +1 -0
- package/dist/cjs/_index.cjs.js +5 -2
- package/dist/cjs/_loader.cjs.js +1 -1
- package/dist/cjs/{analytics-config-41fc74af.js → analytics-config-6ae1e3ec.js} +2 -2
- package/dist/cjs/{analytics-config-41fc74af.js.map → analytics-config-6ae1e3ec.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 +9 -35
- 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-recent-queries.cjs.entry.js → atomic-search-box-query-suggestions_2.cjs.entry.js} +69 -6
- package/dist/cjs/atomic-search-box-query-suggestions_2.cjs.entry.js.map +1 -0
- 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-smart-snippet-feedback-modal.cjs.entry.js +2 -2
- 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/atomic-tab-manager.cjs.entry.js +1 -1
- package/dist/cjs/atomic.cjs.js +1 -1
- package/dist/cjs/index-757bc886.js +2 -2
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/stencil-query-suggestions-03268ecc.js +38 -0
- package/dist/cjs/stencil-query-suggestions-03268ecc.js.map +1 -0
- package/dist/cjs/{stencil-suggestion-manager-c0878ef2.js → stencil-suggestion-manager-2cba6d69.js} +4 -4
- package/dist/cjs/{stencil-suggestion-manager-c0878ef2.js.map → stencil-suggestion-manager-2cba6d69.js.map} +1 -1
- package/dist/cjs/{suggestions-common-5097a362.js → suggestions-events-63dd0640.js} +17 -21
- package/dist/cjs/suggestions-events-63dd0640.js.map +1 -0
- package/dist/cjs/suggestions-utils-61000808.js +25 -0
- package/dist/cjs/suggestions-utils-61000808.js.map +1 -0
- package/dist/cjs/version.cjs.js +2 -2
- package/dist/esm/_index.js +2 -1
- package/dist/esm/_loader.js +1 -1
- package/dist/esm/{analytics-config-c1cef549.js → analytics-config-2ff8bd41.js} +2 -2
- package/dist/esm/{analytics-config-c1cef549.js.map → analytics-config-2ff8bd41.js.map} +1 -1
- package/dist/esm/atomic-insight-interface.entry.js +1 -1
- package/dist/esm/atomic-insight-search-box.entry.js +7 -33
- 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-recent-queries.entry.js → atomic-search-box-query-suggestions_2.entry.js} +70 -8
- package/dist/esm/atomic-search-box-query-suggestions_2.entry.js.map +1 -0
- 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-smart-snippet-feedback-modal.entry.js +2 -2
- package/dist/esm/atomic-suggestion-renderer.entry.js +1 -1
- package/dist/esm/atomic-suggestion-renderer.entry.js.map +1 -1
- package/dist/esm/atomic-tab-manager.entry.js +1 -1
- package/dist/esm/atomic.js +1 -1
- package/dist/esm/index-3f35faca.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/stencil-query-suggestions-5d6a46d7.js +33 -0
- package/dist/esm/stencil-query-suggestions-5d6a46d7.js.map +1 -0
- package/dist/esm/{stencil-suggestion-manager-486094dd.js → stencil-suggestion-manager-376f83e8.js} +2 -2
- package/dist/esm/{stencil-suggestion-manager-486094dd.js.map → stencil-suggestion-manager-376f83e8.js.map} +1 -1
- package/dist/esm/{suggestions-common-2b20db26.js → suggestions-events-b7a6f007.js} +18 -20
- package/dist/esm/suggestions-events-b7a6f007.js.map +1 -0
- package/dist/esm/suggestions-utils-591559a0.js +22 -0
- package/dist/esm/suggestions-utils-591559a0.js.map +1 -0
- package/dist/esm/version.js +2 -2
- package/dist/types/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.d.ts +2 -1
- package/dist/types/components/commerce/atomic-commerce-interface/atomic-commerce-interface.d.ts +0 -1
- package/dist/types/components/commerce/atomic-commerce-layout/atomic-commerce-layout.d.ts +3 -3
- 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/layout/layout-styles-controller.d.ts +22 -0
- package/dist/types/components/common/layout/mobile-breakpoint-controller.d.ts +18 -0
- 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-events.d.ts +14 -0
- package/dist/types/components/common/suggestions/{suggestions-common.d.ts → suggestions-types.d.ts} +6 -16
- package/dist/types/components/common/suggestions/suggestions-utils.d.ts +15 -0
- package/dist/types/components/search/atomic-search-box/atomic-search-box.d.ts +1 -1
- package/dist/types/components/search/index.d.ts +0 -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/search/search-box-suggestions/atomic-search-box-query-suggestions/atomic-search-box-query-suggestions.d.ts +29 -0
- package/dist/types/components.d.ts +51 -2
- package/dist/types/decorators/types.d.ts +1 -1
- package/dist/types/index.d.ts +3 -1
- package/docs/atomic-docs.json +104 -5
- package/package.json +3 -3
- package/dist/atomic/components/components/search/atomic-search-box-query-suggestions/atomic-search-box-query-suggestions.js +0 -118
- package/dist/atomic/components/suggestions-common.js.map +0 -1
- package/dist/atomic/p-29fd6768.js +0 -2
- package/dist/atomic/p-29fd6768.js.map +0 -1
- package/dist/atomic/p-36e71b99.entry.js.map +0 -1
- package/dist/atomic/p-3d847e45.entry.js.map +0 -1
- package/dist/atomic/p-7601c3de.js +0 -2
- package/dist/atomic/p-7601c3de.js.map +0 -1
- package/dist/atomic/p-a1333787.entry.js +0 -2
- package/dist/atomic/p-a1333787.entry.js.map +0 -1
- package/dist/atomic/p-a468ba8e.entry.js +0 -2
- package/dist/atomic/p-a468ba8e.entry.js.map +0 -1
- package/dist/atomic/p-aa4224ea.entry.js.map +0 -1
- package/dist/cjs/atomic-search-box-recent-queries.cjs.entry.js.map +0 -1
- package/dist/cjs/suggestions-common-5097a362.js.map +0 -1
- package/dist/esm/atomic-search-box-recent-queries.entry.js.map +0 -1
- package/dist/esm/suggestions-common-2b20db26.js.map +0 -1
- package/dist/types/components/search/atomic-search-box-query-suggestions/atomic-search-box-query-suggestions.d.ts +0 -38
- /package/dist/atomic/{p-ae98c582.entry.js.map → p-7a625c7e.entry.js.map} +0 -0
- /package/dist/atomic/{p-ab7c83d8.entry.js.map → p-9cfa782a.entry.js.map} +0 -0
- /package/dist/atomic/{p-39e63678.entry.js.map → p-aa2a81fd.entry.js.map} +0 -0
- /package/dist/atomic/{p-6b3c4d63.entry.js.map → p-b544e64a.entry.js.map} +0 -0
- /package/dist/atomic/{p-3a53ad44.js.map → p-bc899000.js.map} +0 -0
- /package/dist/atomic/{p-b5dd6399.entry.js.map → p-cc6dc919.entry.js.map} +0 -0
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import { c as closest } from './dom-utils-f6086cd3.js';
|
|
2
2
|
import { b as buildCustomEvent } from './event-utils-8de63ec3.js';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Dispatches an event which retrieves the `SearchBoxSuggestionsBindings` on a configured parent search box.
|
|
6
|
+
*
|
|
7
|
+
* @param event Event sent from the registered query suggestions to the parent search box
|
|
8
|
+
* @param element Element on which to dispatch the event, which must be the child of a configured search box
|
|
9
|
+
* @param allowedSearchBoxElements Optional array of allowed search box element selectors
|
|
10
|
+
*
|
|
11
|
+
* @throws Error if the element is not a child of an allowed search box element
|
|
12
|
+
*/
|
|
13
|
+
const dispatchSearchBoxSuggestionsEvent = (event, element, allowedSearchBoxElements = searchBoxElements) => {
|
|
14
|
+
const interfaceElement = closest(element, searchBoxElements.join(', '));
|
|
15
|
+
if (!interfaceElement) {
|
|
16
|
+
throw new Error(`The "${element.nodeName.toLowerCase()}" component was not handled, as it is not a child of the following elements: ${allowedSearchBoxElements.join(', ')}`);
|
|
17
|
+
}
|
|
18
|
+
void dispatchSearchBoxSuggestionsEventEventually(interfaceElement, element, event);
|
|
19
|
+
};
|
|
4
20
|
const searchBoxElements = [
|
|
5
21
|
'atomic-search-box',
|
|
6
22
|
'atomic-insight-search-box',
|
|
@@ -18,25 +34,7 @@ const dispatchSearchBoxSuggestionsEventEventually = async (interfaceElement, ele
|
|
|
18
34
|
}
|
|
19
35
|
element.dispatchEvent(buildCustomEvent('atomic/searchBoxSuggestion/register', event));
|
|
20
36
|
};
|
|
21
|
-
/**
|
|
22
|
-
* Dispatches an event which retrieves the `SearchBoxSuggestionsBindings` on a configured parent search box.
|
|
23
|
-
* @param event Event sent from the registered query suggestions to the parent search box.
|
|
24
|
-
* @param element Element on which to dispatch the event, which must be the child of a configured search box.
|
|
25
|
-
*/
|
|
26
|
-
const dispatchSearchBoxSuggestionsEvent = (event, element, allowedSearchBoxElements = searchBoxElements) => {
|
|
27
|
-
const interfaceElement = closest(element, searchBoxElements.join(', '));
|
|
28
|
-
if (!interfaceElement) {
|
|
29
|
-
throw new Error(`The "${element.nodeName.toLowerCase()}" component was not handled, as it is not a child of the following elements: ${allowedSearchBoxElements.join(', ')}`);
|
|
30
|
-
}
|
|
31
|
-
void dispatchSearchBoxSuggestionsEventEventually(interfaceElement, element, event);
|
|
32
|
-
};
|
|
33
|
-
function elementHasNoQuery(el) {
|
|
34
|
-
return !el.query || el.query.trim() === '';
|
|
35
|
-
}
|
|
36
|
-
function elementHasQuery(el) {
|
|
37
|
-
return !!el.query && el.query.trim() !== '';
|
|
38
|
-
}
|
|
39
37
|
|
|
40
|
-
export {
|
|
38
|
+
export { dispatchSearchBoxSuggestionsEvent as d };
|
|
41
39
|
|
|
42
|
-
//# sourceMappingURL=suggestions-
|
|
40
|
+
//# sourceMappingURL=suggestions-events-b7a6f007.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"suggestions-events-b7a6f007.js","mappings":";;;AAOA;;;;;;;;;MASa,iCAAiC,GAAG,CAI/C,KAA+D,EAC/D,OAAoB,EACpB,2BAA0E,iBAAiB;IAE3F,MAAM,gBAAgB,GAAG,OAAO,CAAC,OAAO,EAAE,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACxE,IAAI,CAAC,gBAAgB,EAAE;QACrB,MAAM,IAAI,KAAK,CACb,QAAQ,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,gFAAgF,wBAAwB,CAAC,IAAI,CACjJ,IAAI,CACL,EAAE,CACJ,CAAC;KACH;IACD,KAAK,2CAA2C,CAC9C,gBAAgB,EAChB,OAAO,EACP,KAAK,CACN,CAAC;AACJ,EAAE;AAEF,MAAM,iBAAiB,GAAG;IACxB,mBAAmB;IACnB,2BAA2B;IAC3B,4BAA4B;CACpB,CAAC;AAEX,MAAM,mBAAmB,GAAG,CAAC,SAAkB,KAC7C,gBAAgB,IAAK,SAAwB;IAC5C,SAAwB,CAAC,cAAc,YAAY,OAAO,CAAC;AAE9D,MAAM,2CAA2C,GAAG,OAIlD,gBAAyB,EACzB,OAAoB,EACpB,KAA+D;IAE/D,MAAM,cAAc,CAAC,WAAW,CAAC,gBAAgB,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;IAC1E,IAAI,mBAAmB,CAAC,gBAAgB,CAAC,EAAE;QACzC,MAAM,gBAAgB,CAAC,cAAc,CAAC;KACvC;SAAM,IAAI,kBAAkB,IAAI,gBAAgB,EAAE;QACjD,MAAO,gBAAuC,CAAC,gBAAgB,EAAE,CAAC;KACnE;IACD,OAAO,CAAC,aAAa,CACnB,gBAAgB,CAAC,qCAAqC,EAAE,KAAK,CAAC,CAC/D,CAAC;AACJ,CAAC;;;;","names":[],"sources":["src/components/common/suggestions/suggestions-events.ts"],"sourcesContent":["import type {HTMLStencilElement} from '@stencil/core/internal';\nimport type {LitElement} from 'lit';\nimport {closest} from '../../../utils/dom-utils';\nimport {buildCustomEvent} from '../../../utils/event-utils';\nimport type {AnyBindings} from '../interface/bindings';\nimport type {SearchBoxSuggestionsEvent} from './suggestions-types';\n\n/**\n * Dispatches an event which retrieves the `SearchBoxSuggestionsBindings` on a configured parent search box.\n *\n * @param event Event sent from the registered query suggestions to the parent search box\n * @param element Element on which to dispatch the event, which must be the child of a configured search box\n * @param allowedSearchBoxElements Optional array of allowed search box element selectors\n *\n * @throws Error if the element is not a child of an allowed search box element\n */\nexport const dispatchSearchBoxSuggestionsEvent = <\n SearchBoxController,\n Bindings = AnyBindings,\n>(\n event: SearchBoxSuggestionsEvent<SearchBoxController, Bindings>,\n element: HTMLElement,\n allowedSearchBoxElements: readonly (typeof searchBoxElements)[number][] = searchBoxElements\n) => {\n const interfaceElement = closest(element, searchBoxElements.join(', '));\n if (!interfaceElement) {\n throw new Error(\n `The \"${element.nodeName.toLowerCase()}\" component was not handled, as it is not a child of the following elements: ${allowedSearchBoxElements.join(\n ', '\n )}`\n );\n }\n void dispatchSearchBoxSuggestionsEventEventually(\n interfaceElement,\n element,\n event\n );\n};\n\nconst searchBoxElements = [\n 'atomic-search-box',\n 'atomic-insight-search-box',\n 'atomic-commerce-search-box',\n] as const;\n\nconst isLitElementLoosely = (candidate: unknown): candidate is LitElement =>\n 'updateComplete' in (candidate as LitElement) &&\n (candidate as LitElement).updateComplete instanceof Promise;\n\nconst dispatchSearchBoxSuggestionsEventEventually = async <\n SearchBoxController,\n Bindings = AnyBindings,\n>(\n interfaceElement: Element,\n element: HTMLElement,\n event: SearchBoxSuggestionsEvent<SearchBoxController, Bindings>\n) => {\n await customElements.whenDefined(interfaceElement.nodeName.toLowerCase());\n if (isLitElementLoosely(interfaceElement)) {\n await interfaceElement.updateComplete;\n } else if ('componentOnReady' in interfaceElement) {\n await (interfaceElement as HTMLStencilElement).componentOnReady();\n }\n element.dispatchEvent(\n buildCustomEvent('atomic/searchBoxSuggestion/register', event)\n );\n};\n"],"version":3}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if a search box suggestion element has no query.
|
|
3
|
+
*
|
|
4
|
+
* @param el - The search box suggestion element to check
|
|
5
|
+
* @returns True if the element has no query or the query is whitespace-only
|
|
6
|
+
*/
|
|
7
|
+
function elementHasNoQuery(el) {
|
|
8
|
+
return !el.query || el.query.trim() === '';
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Checks if a search box suggestion element has a query.
|
|
12
|
+
*
|
|
13
|
+
* @param el - The search box suggestion element to check
|
|
14
|
+
* @returns True if the element has a non-empty, non-whitespace query
|
|
15
|
+
*/
|
|
16
|
+
function elementHasQuery(el) {
|
|
17
|
+
return !!el.query && el.query.trim() !== '';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { elementHasQuery as a, elementHasNoQuery as e };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=suggestions-utils-591559a0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"suggestions-utils-591559a0.js","mappings":"AAEA;;;;;;SAMgB,iBAAiB,CAAC,EAA8B;IAC9D,OAAO,CAAC,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;AAC7C,CAAC;AAED;;;;;;SAMgB,eAAe,CAAC,EAA8B;IAC5D,OAAO,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;AAC9C;;;;","names":[],"sources":["src/components/common/suggestions/suggestions-utils.ts"],"sourcesContent":["import type {SearchBoxSuggestionElement} from './suggestions-types';\n\n/**\n * Checks if a search box suggestion element has no query.\n *\n * @param el - The search box suggestion element to check\n * @returns True if the element has no query or the query is whitespace-only\n */\nexport function elementHasNoQuery(el: SearchBoxSuggestionElement): boolean {\n return !el.query || el.query.trim() === '';\n}\n\n/**\n * Checks if a search box suggestion element has a query.\n *\n * @param el - The search box suggestion element to check\n * @returns True if the element has a non-empty, non-whitespace query\n */\nexport function elementHasQuery(el: SearchBoxSuggestionElement): boolean {\n return !!el.query && el.query.trim() !== '';\n}\n"],"version":3}
|
package/dist/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const headlessVersion = '3.31.
|
|
2
|
-
export const atomicVersion = '3.33.8-pre.
|
|
1
|
+
export const headlessVersion = '3.31.1-pre.59b23d72e0';
|
|
2
|
+
export const atomicVersion = '3.33.8-pre.59b23d72e0';
|
package/dist/types/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.d.ts
CHANGED
|
@@ -52,7 +52,8 @@ export declare class AtomicCommerceBreadbox extends LitElement implements Initia
|
|
|
52
52
|
*/
|
|
53
53
|
pathLimit: number;
|
|
54
54
|
initialize(): void;
|
|
55
|
-
|
|
55
|
+
willUpdate(changedProperties: Map<string, unknown>): void;
|
|
56
|
+
updated(): void;
|
|
56
57
|
private validateProps;
|
|
57
58
|
disconnectedCallback(): void;
|
|
58
59
|
private get breadcrumbs();
|
package/dist/types/components/commerce/atomic-commerce-interface/atomic-commerce-interface.d.ts
CHANGED
|
@@ -118,7 +118,6 @@ export declare class AtomicCommerceInterface extends AtomicCommerceInterface_bas
|
|
|
118
118
|
private onHashChange;
|
|
119
119
|
scrollToTop(): void;
|
|
120
120
|
private updateHash;
|
|
121
|
-
private updateMobileBreakpoint;
|
|
122
121
|
}
|
|
123
122
|
declare global {
|
|
124
123
|
interface HTMLElementTagNameMap {
|
|
@@ -8,19 +8,19 @@ declare const AtomicCommerceLayout_base: import("../../../mixins/mixin-common").
|
|
|
8
8
|
* @cssprop --atomic-layout-max-search-box-input-width: The maximum width that the search box input will take.
|
|
9
9
|
* @cssprop --atomic-layout-max-search-box-double-suggestions-width: The maximum width that the search box suggestions will take when displaying a double list.
|
|
10
10
|
* @cssprop --atomic-layout-search-box-left-suggestions-width: The width of the left list when displaying a double list.
|
|
11
|
-
*
|
|
12
|
-
* @slot default - The default slot for the layout content.
|
|
13
11
|
*/
|
|
14
12
|
export declare class AtomicCommerceLayout extends AtomicCommerceLayout_base {
|
|
15
13
|
static styles: import("lit").CSSResult[];
|
|
16
|
-
private addStyles;
|
|
17
14
|
error: Error;
|
|
18
15
|
/**
|
|
19
16
|
* The viewport width at which the layout goes from desktop to mobile.
|
|
20
17
|
* E.g., 800px, 65rem.
|
|
21
18
|
*/
|
|
22
19
|
mobileBreakpoint: string;
|
|
20
|
+
private layoutStylesController;
|
|
23
21
|
connectedCallback(): void;
|
|
22
|
+
private emitBreakpointChangeEvent;
|
|
23
|
+
onMobileBreakpointChange(): void;
|
|
24
24
|
}
|
|
25
25
|
declare global {
|
|
26
26
|
interface HTMLElementTagNameMap {
|
|
@@ -2,7 +2,7 @@ import { type Product, type SearchBox } from '@coveo/headless/commerce';
|
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
3
|
import type { ItemRenderingFunction } from "../../common/item-list/item-list-common";
|
|
4
4
|
import type { ItemDisplayDensity, ItemDisplayImageSize } from "../../common/layout/display-options";
|
|
5
|
-
import {
|
|
5
|
+
import type { SearchBoxSuggestions, SearchBoxSuggestionsBindings } from "../../common/suggestions/suggestions-types";
|
|
6
6
|
import type { SearchBoxSuggestionsComponent } from "../../../decorators/types";
|
|
7
7
|
import type { CommerceBindings } from '../atomic-commerce-interface/atomic-commerce-interface';
|
|
8
8
|
export type AriaLabelGenerator = (bindings: CommerceBindings, product: Product) => string | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SearchBox } from '@coveo/headless/commerce';
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
|
-
import {
|
|
3
|
+
import type { SearchBoxSuggestions, SearchBoxSuggestionsBindings } from "../../common/suggestions/suggestions-types";
|
|
4
4
|
import type { SearchBoxSuggestionsComponent } from "../../../decorators/types";
|
|
5
5
|
import type { CommerceBindings } from '../atomic-commerce-interface/atomic-commerce-interface';
|
|
6
6
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type SearchBox } from '@coveo/headless/commerce';
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
3
|
import type { SearchBoxSuggestionsComponent } from "../../../decorators/types";
|
|
4
|
-
import {
|
|
4
|
+
import type { SearchBoxSuggestions, SearchBoxSuggestionsBindings } from '../../common/suggestions/suggestions-types';
|
|
5
5
|
import type { CommerceBindings } from '../atomic-commerce-interface/atomic-commerce-interface';
|
|
6
6
|
/**
|
|
7
7
|
* The `atomic-commerce-search-box-recent-queries` component can be added as a child of an `atomic-commerce-search-box` component, allowing for the configuration of recent query suggestions.
|
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-types';
|
|
3
3
|
/**
|
|
4
4
|
* The `atomic-suggestion-renderer` component is used to render individual suggestions. It was created to isolate
|
|
5
5
|
* the rendering logic of the 'content' property of the `SearchBoxSuggestionElement` interface. This property can be Stencil
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
export interface LayoutStylesHost extends ReactiveControllerHost {
|
|
3
|
+
mobileBreakpoint: string;
|
|
4
|
+
getRootNode(): Node;
|
|
5
|
+
id?: string;
|
|
6
|
+
}
|
|
7
|
+
export type StylesBuilderFunction = (host: HTMLElement, mobileBreakpoint: string) => string;
|
|
8
|
+
/**
|
|
9
|
+
* A reactive controller that manages dynamic layout styles.
|
|
10
|
+
*/
|
|
11
|
+
export declare class LayoutStylesController implements ReactiveController {
|
|
12
|
+
private host;
|
|
13
|
+
private dynamicStyleSheet;
|
|
14
|
+
private stylesBuilder;
|
|
15
|
+
private componentPrefix;
|
|
16
|
+
constructor(host: LayoutStylesHost, stylesBuilder: StylesBuilderFunction, componentPrefix: string);
|
|
17
|
+
hostConnected(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Updates the dynamic styles based on the current mobile breakpoint
|
|
20
|
+
*/
|
|
21
|
+
updateStyles(): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
import type { BaseStore } from "../interface/store";
|
|
3
|
+
/**
|
|
4
|
+
* A reactive controller that manages mobile breakpoint changes through event communication.
|
|
5
|
+
* This controller listens for 'atomic-layout-breakpoint-change' events and updates a store
|
|
6
|
+
* with the new breakpoint value.
|
|
7
|
+
*/
|
|
8
|
+
export declare class MobileBreakpointController implements ReactiveController {
|
|
9
|
+
private host;
|
|
10
|
+
private store;
|
|
11
|
+
private eventListener;
|
|
12
|
+
constructor(host: ReactiveControllerHost, store: BaseStore<{
|
|
13
|
+
mobileBreakpoint: string;
|
|
14
|
+
}>);
|
|
15
|
+
hostConnected(): void;
|
|
16
|
+
hostDisconnected(): void;
|
|
17
|
+
private handleBreakpointChange;
|
|
18
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { i18n } from 'i18next';
|
|
2
|
-
import type { SearchBoxSuggestionElement } from './suggestions-
|
|
2
|
+
import type { SearchBoxSuggestionElement } from './suggestions-types';
|
|
3
3
|
export declare const getPartialInstantItemElement: (i18n: i18n, itemTitle: string, itemUniqueId: string) => Pick<SearchBoxSuggestionElement, "ariaLabel" | "key" | "part">;
|
|
4
4
|
export declare const getPartialInstantItemShowAllElement: (i18n: i18n) => Pick<SearchBoxSuggestionElement, "key" | "part" | "ariaLabel">;
|
|
5
5
|
interface InstantItemShowAllButtonProps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { i18n } from 'i18next';
|
|
2
|
-
import type { SearchBoxSuggestionElement } from './suggestions-
|
|
2
|
+
import type { SearchBoxSuggestionElement } from './suggestions-types';
|
|
3
3
|
export declare const getPartialRecentQueryElement: (value: string, i18n: i18n) => Pick<SearchBoxSuggestionElement, "ariaLabel" | "key" | "query" | "part">;
|
|
4
4
|
export declare const getPartialRecentQueryClearElement: (i18n: i18n) => Pick<SearchBoxSuggestionElement, "ariaLabel" | "key" | "part" | "hideIfLast">;
|
|
5
5
|
export interface RecentQueriesContainerProps {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FunctionalComponent } from '../../../stencil-public-runtime';
|
|
2
2
|
import { i18n } from 'i18next';
|
|
3
|
-
import { SearchBoxSuggestionElement } from './suggestions-
|
|
3
|
+
import { SearchBoxSuggestionElement } from './suggestions-types';
|
|
4
4
|
export declare const getPartialInstantItemElement: (i18n: i18n, itemTitle: string, itemUniqueId: string) => Pick<SearchBoxSuggestionElement, "ariaLabel" | "key" | "part">;
|
|
5
5
|
export declare const getPartialInstantItemShowAllElement: (i18n: i18n) => Pick<SearchBoxSuggestionElement, "key" | "part" | "ariaLabel">;
|
|
6
6
|
interface InstantItemShowAllButtonProps {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FunctionalComponent } from '../../../stencil-public-runtime';
|
|
2
2
|
import { i18n } from 'i18next';
|
|
3
|
-
import { SearchBoxSuggestionElement } from './suggestions-
|
|
3
|
+
import { SearchBoxSuggestionElement } from './suggestions-types.js';
|
|
4
4
|
interface Suggestion {
|
|
5
5
|
highlightedValue: string;
|
|
6
6
|
rawValue: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FunctionalComponent } from '../../../stencil-public-runtime';
|
|
2
2
|
import { i18n } from 'i18next';
|
|
3
|
-
import { SearchBoxSuggestionElement } from './suggestions-
|
|
3
|
+
import { SearchBoxSuggestionElement } from './suggestions-types';
|
|
4
4
|
export declare const getPartialRecentQueryElement: (value: string, i18n: i18n) => Pick<SearchBoxSuggestionElement, "ariaLabel" | "key" | "query" | "part">;
|
|
5
5
|
export declare const getPartialRecentQueryClearElement: (i18n: i18n) => Pick<SearchBoxSuggestionElement, "ariaLabel" | "key" | "part" | "hideIfLast">;
|
|
6
6
|
export declare const RecentQueriesContainer: FunctionalComponent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { SearchBoxSuggestionElement, SearchBoxSuggestionsBindings, SearchBoxSuggestionsEvent } from './suggestions-types';
|
|
2
2
|
/**
|
|
3
3
|
* List of suggestions that will be displayed along other lists (e.g recent queries) when the search box's input is selected.
|
|
4
4
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LitElement } from 'lit';
|
|
2
|
-
import {
|
|
2
|
+
import type { SearchBoxSuggestionElement, SearchBoxSuggestionsBindings, SearchBoxSuggestionsEvent } from './suggestions-types';
|
|
3
3
|
/**
|
|
4
4
|
* List of suggestions that will be displayed along other lists (e.g recent queries) when the search box's input is selected.
|
|
5
5
|
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AnyBindings } from '../interface/bindings';
|
|
2
|
+
import type { SearchBoxSuggestionsEvent } from './suggestions-types';
|
|
3
|
+
/**
|
|
4
|
+
* Dispatches an event which retrieves the `SearchBoxSuggestionsBindings` on a configured parent search box.
|
|
5
|
+
*
|
|
6
|
+
* @param event Event sent from the registered query suggestions to the parent search box
|
|
7
|
+
* @param element Element on which to dispatch the event, which must be the child of a configured search box
|
|
8
|
+
* @param allowedSearchBoxElements Optional array of allowed search box element selectors
|
|
9
|
+
*
|
|
10
|
+
* @throws Error if the element is not a child of an allowed search box element
|
|
11
|
+
*/
|
|
12
|
+
export declare const dispatchSearchBoxSuggestionsEvent: <SearchBoxController, Bindings = AnyBindings>(event: SearchBoxSuggestionsEvent<SearchBoxController, Bindings>, element: HTMLElement, allowedSearchBoxElements?: readonly (typeof searchBoxElements)[number][]) => void;
|
|
13
|
+
declare const searchBoxElements: readonly ["atomic-search-box", "atomic-insight-search-box", "atomic-commerce-search-box"];
|
|
14
|
+
export {};
|
package/dist/types/components/common/suggestions/{suggestions-common.d.ts → suggestions-types.d.ts}
RENAMED
|
@@ -68,15 +68,6 @@ export interface SearchBoxSuggestions {
|
|
|
68
68
|
*/
|
|
69
69
|
onSuggestedQueryChange?(q: string): Promise<unknown>;
|
|
70
70
|
}
|
|
71
|
-
/**
|
|
72
|
-
* Event sent from the registered query suggestions to the parent search box.
|
|
73
|
-
*/
|
|
74
|
-
export type SearchBoxSuggestionsEvent<SearchBoxController, Bindings = AnyBindings> = (
|
|
75
|
-
/**
|
|
76
|
-
* The bindings passed from the search box to the suggestions.
|
|
77
|
-
*/
|
|
78
|
-
bindings: SearchBoxSuggestionsBindings<SearchBoxController, Bindings>) => SearchBoxSuggestions;
|
|
79
|
-
declare const searchBoxElements: readonly ["atomic-search-box", "atomic-insight-search-box", "atomic-commerce-search-box"];
|
|
80
71
|
/**
|
|
81
72
|
* The bindings passed from the search box to the suggestions.
|
|
82
73
|
*/
|
|
@@ -124,11 +115,10 @@ export type SearchBoxSuggestionsBindings<SearchBoxController, Bindings = AnyBind
|
|
|
124
115
|
getSuggestionElements(): SearchBoxSuggestionElement[];
|
|
125
116
|
};
|
|
126
117
|
/**
|
|
127
|
-
*
|
|
128
|
-
* @param event Event sent from the registered query suggestions to the parent search box.
|
|
129
|
-
* @param element Element on which to dispatch the event, which must be the child of a configured search box.
|
|
118
|
+
* Event sent from the registered query suggestions to the parent search box.
|
|
130
119
|
*/
|
|
131
|
-
export
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
120
|
+
export type SearchBoxSuggestionsEvent<SearchBoxController, Bindings = AnyBindings> = (
|
|
121
|
+
/**
|
|
122
|
+
* The bindings passed from the search box to the suggestions.
|
|
123
|
+
*/
|
|
124
|
+
bindings: SearchBoxSuggestionsBindings<SearchBoxController, Bindings>) => SearchBoxSuggestions;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SearchBoxSuggestionElement } from './suggestions-types';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if a search box suggestion element has no query.
|
|
4
|
+
*
|
|
5
|
+
* @param el - The search box suggestion element to check
|
|
6
|
+
* @returns True if the element has no query or the query is whitespace-only
|
|
7
|
+
*/
|
|
8
|
+
export declare function elementHasNoQuery(el: SearchBoxSuggestionElement): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Checks if a search box suggestion element has a query.
|
|
11
|
+
*
|
|
12
|
+
* @param el - The search box suggestion element to check
|
|
13
|
+
* @returns True if the element has a non-empty, non-whitespace query
|
|
14
|
+
*/
|
|
15
|
+
export declare function elementHasQuery(el: SearchBoxSuggestionElement): boolean;
|
|
@@ -2,7 +2,7 @@ import { SearchBox, StandaloneSearchBox } from '@coveo/headless';
|
|
|
2
2
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
3
3
|
import { InitializableComponent } from '../../../utils/initialization-utils';
|
|
4
4
|
import { RedirectionPayload } from '../../common/search-box/redirection-payload';
|
|
5
|
-
import { SearchBoxSuggestionsEvent } from '../../common/suggestions/suggestions-
|
|
5
|
+
import type { SearchBoxSuggestionsEvent } from '../../common/suggestions/suggestions-types';
|
|
6
6
|
import { Bindings } from '../atomic-search-interface/atomic-search-interface';
|
|
7
7
|
/**
|
|
8
8
|
* The `atomic-search-box` component creates a search box with built-in support for suggestions.
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { AtomicQuerySummary } from './atomic-query-summary/atomic-query-summary.js';
|
|
2
2
|
export { AtomicResultsPerPage } from './atomic-results-per-page/atomic-results-per-page.js';
|
|
3
|
-
export { AtomicSearchBoxQuerySuggestions } from './atomic-search-box-query-suggestions/atomic-search-box-query-suggestions.js';
|
|
4
3
|
export { AtomicSearchLayout } from './atomic-search-layout/atomic-search-layout.js';
|
|
@@ -2,7 +2,7 @@ import { Result, SearchBox } from '@coveo/headless';
|
|
|
2
2
|
import { InitializableComponent } from '../../../../utils/initialization-utils';
|
|
3
3
|
import { ItemRenderingFunction } from '../../../common/item-list/stencil-item-list-common';
|
|
4
4
|
import { ItemDisplayDensity, ItemDisplayImageSize } from '../../../common/layout/display-options';
|
|
5
|
-
import { SearchBoxSuggestions, SearchBoxSuggestionsBindings } from '../../../common/suggestions/suggestions-
|
|
5
|
+
import type { SearchBoxSuggestions, SearchBoxSuggestionsBindings } from '../../../common/suggestions/suggestions-types';
|
|
6
6
|
import { Bindings } from '../../atomic-search-interface/atomic-search-interface';
|
|
7
7
|
export type AriaLabelGenerator = (bindings: Bindings, result: Result) => string | undefined;
|
|
8
8
|
/**
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `atomic-search-box-query-suggestions` component can be added as a child of an `atomic-search-box` component, allowing for the configuration of query suggestion behavior.
|
|
3
|
+
*/
|
|
4
|
+
export declare class AtomicSearchBoxQuerySuggestions {
|
|
5
|
+
private bindings;
|
|
6
|
+
private host;
|
|
7
|
+
error: Error;
|
|
8
|
+
/**
|
|
9
|
+
* The SVG icon to display.
|
|
10
|
+
*
|
|
11
|
+
* - Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location.
|
|
12
|
+
* - Use a value that starts with `assets://`, to display an icon from the Atomic package.
|
|
13
|
+
* - Use a stringified SVG to display it directly.
|
|
14
|
+
*/
|
|
15
|
+
icon?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The maximum number of suggestions that will be displayed if the user has typed something into the input field.
|
|
18
|
+
*/
|
|
19
|
+
maxWithQuery?: number;
|
|
20
|
+
/**
|
|
21
|
+
* The maximum number of suggestions that will be displayed initially when the input field is empty.
|
|
22
|
+
*/
|
|
23
|
+
maxWithoutQuery?: number;
|
|
24
|
+
componentWillLoad(): void;
|
|
25
|
+
private initialize;
|
|
26
|
+
private renderItems;
|
|
27
|
+
private renderItem;
|
|
28
|
+
render(): any;
|
|
29
|
+
}
|
|
@@ -26,7 +26,7 @@ import { RedirectionPayload } from "./components/common/search-box/redirection-p
|
|
|
26
26
|
import { AriaLabelGenerator } from "./components/search/search-box-suggestions/atomic-search-box-instant-results/atomic-search-box-instant-results";
|
|
27
27
|
import { InitializationOptions } from "./components/search/atomic-search-interface/atomic-search-interface";
|
|
28
28
|
import { StandaloneSearchBoxData } from "./utils/local-storage-utils";
|
|
29
|
-
import { SearchBoxSuggestionElement } from "./components/common/suggestions/suggestions-
|
|
29
|
+
import { SearchBoxSuggestionElement } from "./components/common/suggestions/suggestions-types";
|
|
30
30
|
export { AutomaticFacet, CategoryFacetSortCriterion, DateFilterRange, DateRangeRequest, FacetResultsMustMatch, FacetSortCriterion, FoldedResult, GeneratedAnswer, GeneratedAnswerCitation, InlineLink, InteractiveCitation, InteractiveResult, LogLevel, NumericFilter, NumericFilterState, RangeFacetRangeAlgorithm, RangeFacetSortCriterion, RelativeDateUnit, Result, ResultTemplate, ResultTemplateCondition, SearchEngine, SearchStatus } from "@coveo/headless";
|
|
31
31
|
export { AtomicInterface } from "./utils/initialization-utils";
|
|
32
32
|
export { AnyBindings } from "./components/common/interface/bindings";
|
|
@@ -48,7 +48,7 @@ export { RedirectionPayload } from "./components/common/search-box/redirection-p
|
|
|
48
48
|
export { AriaLabelGenerator } from "./components/search/search-box-suggestions/atomic-search-box-instant-results/atomic-search-box-instant-results";
|
|
49
49
|
export { InitializationOptions } from "./components/search/atomic-search-interface/atomic-search-interface";
|
|
50
50
|
export { StandaloneSearchBoxData } from "./utils/local-storage-utils";
|
|
51
|
-
export { SearchBoxSuggestionElement } from "./components/common/suggestions/suggestions-
|
|
51
|
+
export { SearchBoxSuggestionElement } from "./components/common/suggestions/suggestions-types";
|
|
52
52
|
export namespace Components {
|
|
53
53
|
/**
|
|
54
54
|
* An automatic facet is a special type of facet generated by the automatic facets feature.
|
|
@@ -2415,6 +2415,23 @@ export namespace Components {
|
|
|
2415
2415
|
*/
|
|
2416
2416
|
"setRenderFunction": (resultRenderingFunction: ItemRenderingFunction) => Promise<void>;
|
|
2417
2417
|
}
|
|
2418
|
+
/**
|
|
2419
|
+
* The `atomic-search-box-query-suggestions` component can be added as a child of an `atomic-search-box` component, allowing for the configuration of query suggestion behavior.
|
|
2420
|
+
*/
|
|
2421
|
+
interface AtomicSearchBoxQuerySuggestions {
|
|
2422
|
+
/**
|
|
2423
|
+
* The SVG icon to display. - Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location. - Use a value that starts with `assets://`, to display an icon from the Atomic package. - Use a stringified SVG to display it directly.
|
|
2424
|
+
*/
|
|
2425
|
+
"icon"?: string;
|
|
2426
|
+
/**
|
|
2427
|
+
* The maximum number of suggestions that will be displayed if the user has typed something into the input field.
|
|
2428
|
+
*/
|
|
2429
|
+
"maxWithQuery"?: number;
|
|
2430
|
+
/**
|
|
2431
|
+
* The maximum number of suggestions that will be displayed initially when the input field is empty.
|
|
2432
|
+
*/
|
|
2433
|
+
"maxWithoutQuery"?: number;
|
|
2434
|
+
}
|
|
2418
2435
|
/**
|
|
2419
2436
|
* 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.
|
|
2420
2437
|
*/
|
|
@@ -4177,6 +4194,15 @@ declare global {
|
|
|
4177
4194
|
prototype: HTMLAtomicSearchBoxInstantResultsElement;
|
|
4178
4195
|
new (): HTMLAtomicSearchBoxInstantResultsElement;
|
|
4179
4196
|
};
|
|
4197
|
+
/**
|
|
4198
|
+
* 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.
|
|
4199
|
+
*/
|
|
4200
|
+
interface HTMLAtomicSearchBoxQuerySuggestionsElement extends Components.AtomicSearchBoxQuerySuggestions, HTMLStencilElement {
|
|
4201
|
+
}
|
|
4202
|
+
var HTMLAtomicSearchBoxQuerySuggestionsElement: {
|
|
4203
|
+
prototype: HTMLAtomicSearchBoxQuerySuggestionsElement;
|
|
4204
|
+
new (): HTMLAtomicSearchBoxQuerySuggestionsElement;
|
|
4205
|
+
};
|
|
4180
4206
|
/**
|
|
4181
4207
|
* 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.
|
|
4182
4208
|
*/
|
|
@@ -4589,6 +4615,7 @@ declare global {
|
|
|
4589
4615
|
"atomic-result-timespan": HTMLAtomicResultTimespanElement;
|
|
4590
4616
|
"atomic-search-box": HTMLAtomicSearchBoxElement;
|
|
4591
4617
|
"atomic-search-box-instant-results": HTMLAtomicSearchBoxInstantResultsElement;
|
|
4618
|
+
"atomic-search-box-query-suggestions": HTMLAtomicSearchBoxQuerySuggestionsElement;
|
|
4592
4619
|
"atomic-search-box-recent-queries": HTMLAtomicSearchBoxRecentQueriesElement;
|
|
4593
4620
|
"atomic-search-interface": HTMLAtomicSearchInterfaceElement;
|
|
4594
4621
|
"atomic-segmented-facet": HTMLAtomicSegmentedFacetElement;
|
|
@@ -6855,6 +6882,23 @@ declare namespace LocalJSX {
|
|
|
6855
6882
|
*/
|
|
6856
6883
|
"maxResultsPerQuery"?: number;
|
|
6857
6884
|
}
|
|
6885
|
+
/**
|
|
6886
|
+
* 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.
|
|
6887
|
+
*/
|
|
6888
|
+
interface AtomicSearchBoxQuerySuggestions {
|
|
6889
|
+
/**
|
|
6890
|
+
* The SVG icon to display. - Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location. - Use a value that starts with `assets://`, to display an icon from the Atomic package. - Use a stringified SVG to display it directly.
|
|
6891
|
+
*/
|
|
6892
|
+
"icon"?: string;
|
|
6893
|
+
/**
|
|
6894
|
+
* The maximum number of suggestions that will be displayed if the user has typed something into the input field.
|
|
6895
|
+
*/
|
|
6896
|
+
"maxWithQuery"?: number;
|
|
6897
|
+
/**
|
|
6898
|
+
* The maximum number of suggestions that will be displayed initially when the input field is empty.
|
|
6899
|
+
*/
|
|
6900
|
+
"maxWithoutQuery"?: number;
|
|
6901
|
+
}
|
|
6858
6902
|
/**
|
|
6859
6903
|
* 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.
|
|
6860
6904
|
*/
|
|
@@ -7443,6 +7487,7 @@ declare namespace LocalJSX {
|
|
|
7443
7487
|
"atomic-result-timespan": AtomicResultTimespan;
|
|
7444
7488
|
"atomic-search-box": AtomicSearchBox;
|
|
7445
7489
|
"atomic-search-box-instant-results": AtomicSearchBoxInstantResults;
|
|
7490
|
+
"atomic-search-box-query-suggestions": AtomicSearchBoxQuerySuggestions;
|
|
7446
7491
|
"atomic-search-box-recent-queries": AtomicSearchBoxRecentQueries;
|
|
7447
7492
|
"atomic-search-interface": AtomicSearchInterface;
|
|
7448
7493
|
"atomic-segmented-facet": AtomicSegmentedFacet;
|
|
@@ -7956,6 +8001,10 @@ declare module "@stencil/core" {
|
|
|
7956
8001
|
* This component is not supported on mobile.
|
|
7957
8002
|
*/
|
|
7958
8003
|
"atomic-search-box-instant-results": LocalJSX.AtomicSearchBoxInstantResults & JSXBase.HTMLAttributes<HTMLAtomicSearchBoxInstantResultsElement>;
|
|
8004
|
+
/**
|
|
8005
|
+
* 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.
|
|
8006
|
+
*/
|
|
8007
|
+
"atomic-search-box-query-suggestions": LocalJSX.AtomicSearchBoxQuerySuggestions & JSXBase.HTMLAttributes<HTMLAtomicSearchBoxQuerySuggestionsElement>;
|
|
7959
8008
|
/**
|
|
7960
8009
|
* 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.
|
|
7961
8010
|
*/
|
|
@@ -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-types';
|
|
5
5
|
export type GenericRender<T extends TemplateResultType> = TemplateResult<T>;
|
|
6
6
|
export type RenderGuardDecorator<Component, T extends TemplateResultType, Descriptor = TypedPropertyDescriptor<() => GenericRender<T>>> = (target: Component, propertyKey: 'render', descriptor: Descriptor) => Descriptor;
|
|
7
7
|
/**
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,7 +5,9 @@ export { SelectChildProductEventArgs } from './components/commerce/atomic-produc
|
|
|
5
5
|
export { productContext } from './components/commerce/product-template-component-utils/stencil-product-template-decorators';
|
|
6
6
|
export { PopoverChildFacet } from './components/common/facets/popover/popover-type';
|
|
7
7
|
export { RedirectionPayload } from './components/common/search-box/redirection-payload';
|
|
8
|
-
export { dispatchSearchBoxSuggestionsEvent
|
|
8
|
+
export { dispatchSearchBoxSuggestionsEvent } from './components/common/suggestions/suggestions-events';
|
|
9
|
+
export type { SearchBoxSuggestionElement, SearchBoxSuggestions, SearchBoxSuggestionsBindings, SearchBoxSuggestionsEvent, } from './components/common/suggestions/suggestions-types';
|
|
10
|
+
export { elementHasNoQuery, elementHasQuery, } from './components/common/suggestions/suggestions-utils';
|
|
9
11
|
export { RecsBindings } from './components/recommendations/atomic-recs-interface/atomic-recs-interface';
|
|
10
12
|
export { Bindings } from './components/search/atomic-search-interface/atomic-search-interface';
|
|
11
13
|
export { resultContext } from './components/search/result-template-components/result-template-decorators';
|