@coveo/atomic 3.64.0 → 3.65.0
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/custom-elements.json +9436 -9292
- package/dist/cjs/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.cjs +108 -13
- package/dist/cjs/components/commerce/product-list/product-template-provider.cjs +2 -0
- package/dist/cjs/components/common/atomic-focus-trap/atomic-focus-trap.cjs +11 -1
- package/dist/cjs/components/common/atomic-layout-section/layout.cjs +6 -2
- package/dist/cjs/components/common/atomic-modal/atomic-modal.cjs +8 -1
- package/dist/cjs/components/common/atomic-tab-popover/atomic-tab-popover.cjs +1 -0
- package/dist/cjs/components/common/facets/facet-common.cjs +21 -2
- package/dist/cjs/components/common/facets/timeframe-facet-common.cjs +2 -2
- package/dist/cjs/components/common/generated-answer/generated-content/markdown-utils.cjs +1 -0
- package/dist/cjs/components/common/item-list/result-template-provider.cjs +1 -0
- package/dist/cjs/components/common/result-templates/result-template-controller.cjs +1 -0
- package/dist/cjs/components/common/suggestions/suggestion-manager.cjs +3 -0
- package/dist/cjs/components/insight/atomic-insight-facet/atomic-insight-facet.cjs +2 -2
- package/dist/cjs/components/insight/atomic-insight-result-attach-to-case-indicator/atomic-insight-result-attach-to-case-indicator.cjs +1 -0
- package/dist/cjs/components/insight/atomic-insight-user-actions-session/atomic-insight-user-actions-session.cjs +1 -0
- package/dist/cjs/components/insight/atomic-insight-user-actions-session/user-action.cjs +1 -0
- package/dist/cjs/components/search/atomic-facet-manager/atomic-facet-manager.cjs +7 -3
- package/dist/cjs/components/search/atomic-popover/atomic-popover.cjs +1 -2
- package/dist/cjs/components/search/atomic-rating-range-facet/atomic-rating-range-facet.cjs +3 -4
- package/dist/cjs/components/search/atomic-search-box/atomic-search-box.cjs +107 -13
- package/dist/cjs/components/search/atomic-search-box-instant-results/atomic-search-box-instant-results.cjs +1 -0
- package/dist/cjs/components/search/atomic-search-layout/atomic-search-layout.tw.css.cjs +12 -2
- package/dist/cjs/global/environment.cjs +1 -1
- package/dist/cjs/utils/tailwind.global.tw.css.cjs +1 -1
- package/dist/cjs/versions.cjs +1 -1
- package/dist/esm/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.js +109 -14
- package/dist/esm/components/commerce/product-list/product-template-provider.js +2 -0
- package/dist/esm/components/common/atomic-focus-trap/atomic-focus-trap.js +11 -1
- package/dist/esm/components/common/atomic-layout-section/layout.js +6 -2
- package/dist/esm/components/common/atomic-modal/atomic-modal.js +9 -2
- package/dist/esm/components/common/atomic-tab-popover/atomic-tab-popover.js +1 -0
- package/dist/esm/components/common/facets/facet-common.js +16 -3
- package/dist/esm/components/common/facets/timeframe-facet-common.js +2 -2
- package/dist/esm/components/common/generated-answer/generated-content/markdown-utils.js +1 -0
- package/dist/esm/components/common/item-list/result-template-provider.js +1 -0
- package/dist/esm/components/common/result-templates/result-template-controller.js +1 -0
- package/dist/esm/components/common/suggestions/suggestion-manager.js +3 -0
- package/dist/esm/components/insight/atomic-insight-facet/atomic-insight-facet.js +2 -2
- package/dist/esm/components/insight/atomic-insight-result-attach-to-case-indicator/atomic-insight-result-attach-to-case-indicator.js +1 -0
- package/dist/esm/components/insight/atomic-insight-user-actions-session/atomic-insight-user-actions-session.js +1 -0
- package/dist/esm/components/insight/atomic-insight-user-actions-session/user-action.js +1 -0
- package/dist/esm/components/search/atomic-facet-manager/atomic-facet-manager.js +8 -4
- package/dist/esm/components/search/atomic-popover/atomic-popover.js +1 -2
- package/dist/esm/components/search/atomic-rating-range-facet/atomic-rating-range-facet.js +3 -4
- package/dist/esm/components/search/atomic-search-box/atomic-search-box.js +109 -15
- package/dist/esm/components/search/atomic-search-box-instant-results/atomic-search-box-instant-results.js +1 -0
- package/dist/esm/components/search/atomic-search-layout/atomic-search-layout.tw.css.js +1 -1
- package/dist/esm/global/environment.js +1 -1
- package/dist/esm/utils/tailwind.global.tw.css.js +1 -1
- package/dist/esm/versions.js +1 -1
- package/dist/types/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.d.ts +23 -6
- package/dist/types/components/commerce/product-list/product-template-provider.d.ts +2 -0
- package/dist/types/components/common/atomic-focus-trap/atomic-focus-trap.d.ts +1 -0
- package/dist/types/components/common/atomic-modal/atomic-modal.d.ts +6 -0
- package/dist/types/components/common/atomic-tab-popover/atomic-tab-popover.d.ts +1 -0
- package/dist/types/components/common/facets/facet-common.d.ts +2 -0
- package/dist/types/components/common/generated-answer/generated-content/markdown-utils.d.ts +1 -0
- package/dist/types/components/common/item-list/result-template-provider.d.ts +1 -0
- package/dist/types/components/common/layout/item-layout-sections.d.ts +1 -1
- package/dist/types/components/common/result-templates/result-template-controller.d.ts +1 -0
- package/dist/types/components/insight/atomic-insight-result-attach-to-case-indicator/atomic-insight-result-attach-to-case-indicator.d.ts +1 -0
- package/dist/types/components/insight/atomic-insight-user-actions-session/atomic-insight-user-actions-session.d.ts +1 -0
- package/dist/types/components/insight/atomic-insight-user-actions-session/user-action.d.ts +1 -0
- package/dist/types/components/search/atomic-facet-manager/atomic-facet-manager.d.ts +6 -1
- package/dist/types/components/search/atomic-search-box/atomic-search-box.d.ts +23 -6
- package/dist/types/components/search/atomic-search-box-instant-results/atomic-search-box-instant-results.d.ts +1 -0
- package/package.json +30 -26
package/dist/cjs/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.cjs
CHANGED
|
@@ -30,11 +30,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
30
30
|
__webpack_require__.d(__webpack_exports__, {
|
|
31
31
|
AtomicCommerceSearchBox: ()=>AtomicCommerceSearchBox
|
|
32
32
|
});
|
|
33
|
+
const bueno_namespaceObject = require("@coveo/bueno");
|
|
33
34
|
const commerce_namespaceObject = require("@coveo/headless/commerce");
|
|
34
35
|
const external_lit_namespaceObject = require("lit");
|
|
35
36
|
const decorators_js_namespaceObject = require("lit/decorators.js");
|
|
36
37
|
const class_map_js_namespaceObject = require("lit/directives/class-map.js");
|
|
37
38
|
const ref_js_namespaceObject = require("lit/directives/ref.js");
|
|
39
|
+
const when_js_namespaceObject = require("lit/directives/when.js");
|
|
40
|
+
const button_cjs_namespaceObject = require("../../common/button.cjs");
|
|
41
|
+
const validate_props_controller_cjs_namespaceObject = require("../../common/validate-props-controller/validate-props-controller.cjs");
|
|
38
42
|
const boolean_converter_cjs_namespaceObject = require("../../../converters/boolean-converter.cjs");
|
|
39
43
|
const bind_state_cjs_namespaceObject = require("../../../decorators/bind-state.cjs");
|
|
40
44
|
const binding_guard_cjs_namespaceObject = require("../../../decorators/binding-guard.cjs");
|
|
@@ -258,7 +262,7 @@ class AtomicCommerceSearchBox extends external_lit_namespaceObject.LitElement {
|
|
|
258
262
|
}
|
|
259
263
|
break;
|
|
260
264
|
case 'Tab':
|
|
261
|
-
this.suggestionManager.clearSuggestions();
|
|
265
|
+
if ('bottom' !== this.clearRecentButtonPosition || !this.clearRecentQueriesElement) this.suggestionManager.clearSuggestions();
|
|
262
266
|
break;
|
|
263
267
|
default:
|
|
264
268
|
if (this.suggestionManager.keyboardActiveDescendant) this.suggestionManager.updateKeyboardActiveDescendant();
|
|
@@ -323,11 +327,59 @@ class AtomicCommerceSearchBox extends external_lit_namespaceObject.LitElement {
|
|
|
323
327
|
}
|
|
324
328
|
})}`;
|
|
325
329
|
}
|
|
330
|
+
get clearRecentQueriesElement() {
|
|
331
|
+
const { leftSuggestionElements, rightSuggestionElements } = this.suggestionManager;
|
|
332
|
+
return [
|
|
333
|
+
leftSuggestionElements,
|
|
334
|
+
rightSuggestionElements
|
|
335
|
+
].flatMap((elements)=>elements.slice(0, -1)).find((element)=>'recent-query-clear' === element.key);
|
|
336
|
+
}
|
|
337
|
+
renderRecentQueriesTitle() {
|
|
338
|
+
return (0, external_lit_namespaceObject.html)`<div
|
|
339
|
+
part="recent-query-title"
|
|
340
|
+
class="text-neutral-dark flex min-h-10 items-center px-4 font-bold"
|
|
341
|
+
@mousedown=${(e)=>e.preventDefault()}
|
|
342
|
+
>
|
|
343
|
+
${this.bindings.i18n.t('recent-searches')}
|
|
344
|
+
</div>`;
|
|
345
|
+
}
|
|
346
|
+
renderClearRecentQueriesButton(element) {
|
|
347
|
+
const deselectSuggestion = ()=>{
|
|
348
|
+
this.suggestionManager.updateKeyboardActiveDescendant();
|
|
349
|
+
this.suggestionManager.updateActiveDescendant();
|
|
350
|
+
};
|
|
351
|
+
return (0, external_lit_namespaceObject.html)`<div
|
|
352
|
+
class="border-neutral flex border-t"
|
|
353
|
+
@mousedown=${(e)=>e.preventDefault()}
|
|
354
|
+
@mouseenter=${deselectSuggestion}
|
|
355
|
+
@focusin=${deselectSuggestion}
|
|
356
|
+
@keydown=${(e)=>{
|
|
357
|
+
if ('Escape' !== e.key) return;
|
|
358
|
+
this.textAreaRef.value?.focus();
|
|
359
|
+
this.isExpanded = false;
|
|
360
|
+
this.suggestionManager.clearSuggestions();
|
|
361
|
+
}}
|
|
362
|
+
>
|
|
363
|
+
${(0, button_cjs_namespaceObject.renderButton)({
|
|
364
|
+
props: {
|
|
365
|
+
style: 'text-primary',
|
|
366
|
+
text: this.bindings.i18n.t('clear-recent-searches'),
|
|
367
|
+
part: 'recent-query-clear-button',
|
|
368
|
+
class: 'focus-visible:ring-ring-primary flex min-h-12 w-full items-center justify-center rounded-none px-4 focus-visible:ring-2 focus-visible:ring-inset',
|
|
369
|
+
onClick: (e)=>{
|
|
370
|
+
element.onSelect?.(e);
|
|
371
|
+
this.textAreaRef.value?.focus();
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
})(external_lit_namespaceObject.nothing)}
|
|
375
|
+
</div>`;
|
|
376
|
+
}
|
|
326
377
|
renderSuggestions() {
|
|
327
378
|
const part = `suggestions-wrapper ${this.suggestionManager.isDoubleList ? 'suggestions-double-list' : 'suggestions-single-list'}`;
|
|
328
379
|
const isVisible = this.suggestionManager.hasSuggestions && this.isExpanded && !this.isSearchDisabledForEndUser;
|
|
329
380
|
const classes = {
|
|
330
381
|
'bg-background border-neutral absolute top-full left-0 z-10 flex w-full rounded-md border': true,
|
|
382
|
+
'overflow-hidden': 'bottom' === this.clearRecentButtonPosition,
|
|
331
383
|
hidden: !isVisible
|
|
332
384
|
};
|
|
333
385
|
return (0, external_lit_namespaceObject.html)`<div
|
|
@@ -338,25 +390,43 @@ class AtomicCommerceSearchBox extends external_lit_namespaceObject.LitElement {
|
|
|
338
390
|
aria-label=${this.bindings.i18n.t(this.suggestionManager.isDoubleList ? 'search-suggestions-double-list' : 'search-suggestions-single-list')}
|
|
339
391
|
aria-activedescendant=${this.suggestionManager.activeDescendant}
|
|
340
392
|
>
|
|
341
|
-
${this.renderPanel('left', this.suggestionManager.leftSuggestionElements, (
|
|
342
|
-
|
|
343
|
-
}, ()=>this.suggestionManager.leftPanel)}
|
|
344
|
-
${this.renderPanel('right', this.suggestionManager.rightSuggestionElements, (el)=>{
|
|
345
|
-
this.suggestionManager.rightPanel = el;
|
|
346
|
-
}, ()=>this.suggestionManager.rightPanel)}
|
|
393
|
+
${this.renderPanel('left', this.suggestionManager.leftSuggestionElements, this.setLeftPanel, ()=>this.suggestionManager.leftPanel)}
|
|
394
|
+
${this.renderPanel('right', this.suggestionManager.rightSuggestionElements, this.setRightPanel, ()=>this.suggestionManager.rightPanel)}
|
|
347
395
|
</div>`;
|
|
348
396
|
}
|
|
349
397
|
renderPanel(side, elements, setRef, getRef) {
|
|
350
|
-
|
|
398
|
+
let listElements = elements;
|
|
399
|
+
let isListNested = false;
|
|
400
|
+
let recentQueriesTitle;
|
|
401
|
+
let clearRecentQueriesButton;
|
|
402
|
+
switch(this.clearRecentButtonPosition){
|
|
403
|
+
case 'bottom':
|
|
404
|
+
{
|
|
405
|
+
isListNested = true;
|
|
406
|
+
const clearElement = this.clearRecentQueriesElement;
|
|
407
|
+
if (clearElement && elements.includes(clearElement)) {
|
|
408
|
+
listElements = elements.filter((element)=>element !== clearElement);
|
|
409
|
+
clearRecentQueriesButton = this.renderClearRecentQueriesButton(clearElement);
|
|
410
|
+
if (elements[0] === clearElement) recentQueriesTitle = this.renderRecentQueriesTitle();
|
|
411
|
+
}
|
|
412
|
+
break;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
if (!listElements.length) return null;
|
|
416
|
+
const suggestions = listElements.map((suggestion, index)=>this.renderSuggestion(suggestion, index, listElements.length - 1, side));
|
|
351
417
|
return (0, external_lit_namespaceObject.html)`<div
|
|
352
418
|
part="suggestions suggestions-${side}"
|
|
353
|
-
${(0, ref_js_namespaceObject.ref)(setRef)}
|
|
419
|
+
${(0, ref_js_namespaceObject.ref)(isListNested ? void 0 : setRef)}
|
|
354
420
|
class="flex grow basis-1/2 flex-col"
|
|
355
421
|
@mousedown=${(e)=>{
|
|
356
422
|
if (e.target === getRef()) e.preventDefault();
|
|
357
423
|
}}
|
|
358
424
|
>
|
|
359
|
-
${
|
|
425
|
+
${recentQueriesTitle}
|
|
426
|
+
${(0, when_js_namespaceObject.when)(isListNested, ()=>(0, external_lit_namespaceObject.html)`<div class="flex grow flex-col" ${(0, ref_js_namespaceObject.ref)(setRef)}>
|
|
427
|
+
${suggestions}
|
|
428
|
+
</div>`, ()=>suggestions)}
|
|
429
|
+
${clearRecentQueriesButton}
|
|
360
430
|
</div>`;
|
|
361
431
|
}
|
|
362
432
|
renderSuggestion(item, index, lastIndex, side) {
|
|
@@ -422,10 +492,25 @@ class AtomicCommerceSearchBox extends external_lit_namespaceObject.LitElement {
|
|
|
422
492
|
announceClearSearchBoxToScreenReader() {
|
|
423
493
|
this.searchBoxAriaMessage.message = this.bindings.i18n.t('search-box-cleared');
|
|
424
494
|
}
|
|
425
|
-
constructor(
|
|
426
|
-
super(
|
|
495
|
+
constructor(){
|
|
496
|
+
super(), this.isExpanded = false, this.textAreaRef = (0, ref_js_namespaceObject.createRef)(), this.setLeftPanel = (el)=>{
|
|
497
|
+
this.suggestionManager.leftPanel = el;
|
|
498
|
+
}, this.setRightPanel = (el)=>{
|
|
499
|
+
this.suggestionManager.rightPanel = el;
|
|
500
|
+
}, this.searchBoxSuggestionEventsQueue = [], this.searchBoxAriaMessage = new accessibility_utils_cjs_namespaceObject.AriaLiveRegionController(this, 'search-box'), this.suggestionsAriaMessage = new accessibility_utils_cjs_namespaceObject.AriaLiveRegionController(this, 'search-suggestions', true), this.numberOfQueries = 8, this.suggestionTimeout = 400, this.suggestionDelay = 0, this.disableSearch = false, this.minimumQueryLength = 0, this.clearFilters = true, this.clearRecentButtonPosition = 'top', this.updateBreakpoints = (0, utils_cjs_namespaceObject.once)(()=>(0, replace_breakpoint_utils_cjs_namespaceObject.updateBreakpoints)(this));
|
|
501
|
+
new validate_props_controller_cjs_namespaceObject.ValidatePropsController(this, ()=>({
|
|
502
|
+
clearRecentButtonPosition: this.clearRecentButtonPosition
|
|
503
|
+
}), AtomicCommerceSearchBox.propsSchema);
|
|
427
504
|
}
|
|
428
505
|
}
|
|
506
|
+
AtomicCommerceSearchBox.propsSchema = new bueno_namespaceObject.Schema({
|
|
507
|
+
clearRecentButtonPosition: new bueno_namespaceObject.StringValue({
|
|
508
|
+
constrainTo: [
|
|
509
|
+
'top',
|
|
510
|
+
'bottom'
|
|
511
|
+
]
|
|
512
|
+
})
|
|
513
|
+
});
|
|
429
514
|
AtomicCommerceSearchBox.shadowRootOptions = {
|
|
430
515
|
...external_lit_namespaceObject.LitElement.shadowRootOptions,
|
|
431
516
|
delegatesFocus: true
|
|
@@ -499,6 +584,14 @@ _ts_decorate([
|
|
|
499
584
|
converter: boolean_converter_cjs_namespaceObject.booleanConverter
|
|
500
585
|
})
|
|
501
586
|
], AtomicCommerceSearchBox.prototype, "clearFilters", void 0);
|
|
587
|
+
_ts_decorate([
|
|
588
|
+
(0, decorators_js_namespaceObject.property)({
|
|
589
|
+
type: String,
|
|
590
|
+
attribute: 'clear-recent-button-position',
|
|
591
|
+
reflect: true
|
|
592
|
+
}),
|
|
593
|
+
_ts_metadata("design:type", String)
|
|
594
|
+
], AtomicCommerceSearchBox.prototype, "clearRecentButtonPosition", void 0);
|
|
502
595
|
_ts_decorate([
|
|
503
596
|
(0, watch_cjs_namespaceObject.watch)('redirectionUrl'),
|
|
504
597
|
_ts_metadata("design:type", Function),
|
|
@@ -515,7 +608,9 @@ _ts_decorate([
|
|
|
515
608
|
AtomicCommerceSearchBox = _ts_decorate([
|
|
516
609
|
(0, decorators_js_namespaceObject.customElement)('atomic-commerce-search-box'),
|
|
517
610
|
(0, bindings_cjs_namespaceObject.bindings)(),
|
|
518
|
-
with_tailwind_styles_cjs_namespaceObject.withTailwindStyles
|
|
611
|
+
with_tailwind_styles_cjs_namespaceObject.withTailwindStyles,
|
|
612
|
+
_ts_metadata("design:type", Function),
|
|
613
|
+
_ts_metadata("design:paramtypes", [])
|
|
519
614
|
], AtomicCommerceSearchBox);
|
|
520
615
|
exports.AtomicCommerceSearchBox = __webpack_exports__.AtomicCommerceSearchBox;
|
|
521
616
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
@@ -33,6 +33,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
33
33
|
const commerce_namespaceObject = require("@coveo/headless/commerce");
|
|
34
34
|
const template_provider_cjs_namespaceObject = require("../../common/template-provider/template-provider.cjs");
|
|
35
35
|
require("../atomic-product-template/atomic-product-template.cjs");
|
|
36
|
+
require("../atomic-product-section-name/atomic-product-section-name.cjs");
|
|
37
|
+
require("../atomic-product-section-visual/atomic-product-section-visual.cjs");
|
|
36
38
|
class ProductTemplateProvider extends template_provider_cjs_namespaceObject.TemplateProvider {
|
|
37
39
|
makeDefaultTemplate() {
|
|
38
40
|
const content = document.createDocumentFragment();
|
|
@@ -60,6 +60,10 @@ class AtomicFocusTrap extends (0, light_dom_cjs_namespaceObject.LightDomMixin)(e
|
|
|
60
60
|
if (element.hasAttribute('aria-hidden') || element.hasAttribute('aria-live') || 'atomic-aria-live' === element.tagName.toLowerCase()) return;
|
|
61
61
|
element.setAttribute('aria-hidden', 'true');
|
|
62
62
|
this.hiddenElements.push(element);
|
|
63
|
+
if (!element.hasAttribute('inert')) {
|
|
64
|
+
element.setAttribute('inert', '');
|
|
65
|
+
this.inertElements.push(element);
|
|
66
|
+
}
|
|
63
67
|
}
|
|
64
68
|
showAll() {
|
|
65
69
|
let el = this.hiddenElements.pop();
|
|
@@ -67,6 +71,11 @@ class AtomicFocusTrap extends (0, light_dom_cjs_namespaceObject.LightDomMixin)(e
|
|
|
67
71
|
el.removeAttribute('aria-hidden');
|
|
68
72
|
el = this.hiddenElements.pop();
|
|
69
73
|
}
|
|
74
|
+
let inertElement = this.inertElements.pop();
|
|
75
|
+
while(inertElement){
|
|
76
|
+
inertElement.removeAttribute('inert');
|
|
77
|
+
inertElement = this.inertElements.pop();
|
|
78
|
+
}
|
|
70
79
|
}
|
|
71
80
|
hideSiblingsRecursively(element) {
|
|
72
81
|
const parent = (0, utils_cjs_namespaceObject.getParent)(element);
|
|
@@ -100,6 +109,7 @@ class AtomicFocusTrap extends (0, light_dom_cjs_namespaceObject.LightDomMixin)(e
|
|
|
100
109
|
this.showSelf();
|
|
101
110
|
if (!isInitialLoad) {
|
|
102
111
|
await (0, utils_cjs_namespaceObject.defer)();
|
|
112
|
+
if (!this.active) return;
|
|
103
113
|
(0, accessibility_utils_cjs_namespaceObject.getFirstFocusableDescendant)(this)?.focus();
|
|
104
114
|
}
|
|
105
115
|
this.hideSiblingsRecursively(this);
|
|
@@ -113,7 +123,7 @@ class AtomicFocusTrap extends (0, light_dom_cjs_namespaceObject.LightDomMixin)(e
|
|
|
113
123
|
return this.container ?? this;
|
|
114
124
|
}
|
|
115
125
|
constructor(...args){
|
|
116
|
-
super(...args), this.active = false, this.shouldHideSelf = true, this.scope = document.body, this.hiddenElements = [], this.onFocusChanged = (e)=>{
|
|
126
|
+
super(...args), this.active = false, this.shouldHideSelf = true, this.scope = document.body, this.hiddenElements = [], this.inertElements = [], this.onFocusChanged = (e)=>{
|
|
117
127
|
if (!e.target || !this.active) return;
|
|
118
128
|
const focusedElement = (0, utils_cjs_namespaceObject.getFocusedElement)();
|
|
119
129
|
if (focusedElement && (0, utils_cjs_namespaceObject.isAncestorOf)(this, focusedElement)) return;
|
|
@@ -96,11 +96,15 @@ function buildCommonLayout(element, mobileBreakpoint, layoutWebComponentTagName,
|
|
|
96
96
|
}
|
|
97
97
|
}`;
|
|
98
98
|
};
|
|
99
|
-
const horizontalFacets = ()
|
|
100
|
-
|
|
99
|
+
const horizontalFacets = ()=>{
|
|
100
|
+
const horizontalFacetsSelector = `${layoutSelector} ${(0, external_atomic_layout_section_utils_cjs_namespaceObject.sectionSelector)('horizontal-facets')}`;
|
|
101
|
+
return `${mediaQuerySelector} {
|
|
102
|
+
${horizontalFacetsSelector} > atomic-popover:not(.atomic-hidden),
|
|
103
|
+
${horizontalFacetsSelector} > atomic-facet-manager > atomic-popover:not(.atomic-hidden) {
|
|
101
104
|
display: block;
|
|
102
105
|
}
|
|
103
106
|
}`;
|
|
107
|
+
};
|
|
104
108
|
return [
|
|
105
109
|
display,
|
|
106
110
|
search,
|
|
@@ -44,6 +44,7 @@ const bindings_mixin_cjs_namespaceObject = require("../../../mixins/bindings-mix
|
|
|
44
44
|
const event_utils_cjs_namespaceObject = require("../../../utils/event-utils.cjs");
|
|
45
45
|
const replace_breakpoint_utils_cjs_namespaceObject = require("../../../utils/replace-breakpoint-utils.cjs");
|
|
46
46
|
const utils_cjs_namespaceObject = require("../../../utils/utils.cjs");
|
|
47
|
+
require("../atomic-focus-trap/atomic-focus-trap.cjs");
|
|
47
48
|
function _ts_decorate(decorators, target, key, desc) {
|
|
48
49
|
var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
49
50
|
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -84,7 +85,7 @@ class AtomicModal extends (0, bindings_mixin_cjs_namespaceObject.InitializeBindi
|
|
|
84
85
|
role="dialog"
|
|
85
86
|
aria-modal=${this.isOpen ? 'true' : 'false'}
|
|
86
87
|
aria-labelledby=${this.headerId}
|
|
87
|
-
.source=${this.source}
|
|
88
|
+
.source=${this.source ?? this.focusedElementBeforeOpen}
|
|
88
89
|
.container=${this.container ?? this}
|
|
89
90
|
${(0, ref_js_namespaceObject.ref)(this.focusTrap)}
|
|
90
91
|
.scope=${this.scope ?? this.bindings?.interfaceElement ?? document.body}
|
|
@@ -128,6 +129,8 @@ class AtomicModal extends (0, bindings_mixin_cjs_namespaceObject.InitializeBindi
|
|
|
128
129
|
}
|
|
129
130
|
async handleModalOpen() {
|
|
130
131
|
const executionId = this.createExecutionTracker();
|
|
132
|
+
const focusedElement = (0, utils_cjs_namespaceObject.getFocusedElement)();
|
|
133
|
+
this.focusedElementBeforeOpen = focusedElement instanceof HTMLElement && !(0, utils_cjs_namespaceObject.isAncestorOf)(this, focusedElement) ? focusedElement : void 0;
|
|
131
134
|
if (!this.shouldRender) {
|
|
132
135
|
this.shouldRender = true;
|
|
133
136
|
await this.updateComplete;
|
|
@@ -345,6 +348,10 @@ _ts_decorate([
|
|
|
345
348
|
}),
|
|
346
349
|
_ts_metadata("design:type", "u" < typeof HTMLElement ? Object : HTMLElement)
|
|
347
350
|
], AtomicModal.prototype, "source", void 0);
|
|
351
|
+
_ts_decorate([
|
|
352
|
+
(0, decorators_js_namespaceObject.state)(),
|
|
353
|
+
_ts_metadata("design:type", "u" < typeof HTMLElement ? Object : HTMLElement)
|
|
354
|
+
], AtomicModal.prototype, "focusedElementBeforeOpen", void 0);
|
|
348
355
|
_ts_decorate([
|
|
349
356
|
(0, error_guard_cjs_namespaceObject.errorGuard)(),
|
|
350
357
|
_ts_metadata("design:type", Function),
|
|
@@ -51,6 +51,7 @@ const error_guard_cjs_namespaceObject = require("../../../decorators/error-guard
|
|
|
51
51
|
const with_tailwind_styles_cjs_namespaceObject = require("../../../decorators/with-tailwind-styles.cjs");
|
|
52
52
|
const arrow_bottom_rounded_cjs_namespaceObject = require("../../../images/arrow-bottom-rounded.cjs");
|
|
53
53
|
var arrow_bottom_rounded_cjs_default = /*#__PURE__*/ __webpack_require__.n(arrow_bottom_rounded_cjs_namespaceObject);
|
|
54
|
+
require("../atomic-icon/atomic-icon.cjs");
|
|
54
55
|
function _ts_decorate(decorators, target, key, desc) {
|
|
55
56
|
var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
56
57
|
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -63,9 +63,22 @@ function isAutomaticFacetGenerator(element) {
|
|
|
63
63
|
function isPseudoFacet(el) {
|
|
64
64
|
return 'facetId' in el;
|
|
65
65
|
}
|
|
66
|
+
function isPopover(element) {
|
|
67
|
+
return 'ATOMIC-POPOVER' === element.tagName;
|
|
68
|
+
}
|
|
69
|
+
function isFacetNestedInPopover(facet) {
|
|
70
|
+
return !!facet.parentElement && isPopover(facet.parentElement);
|
|
71
|
+
}
|
|
72
|
+
function getFacetElementToReorder(facet) {
|
|
73
|
+
return isFacetNestedInPopover(facet) ? facet.parentElement : facet;
|
|
74
|
+
}
|
|
66
75
|
function getFacetsInChildren(parent) {
|
|
67
|
-
|
|
68
|
-
|
|
76
|
+
return Array.from(parent.children).flatMap((child)=>{
|
|
77
|
+
if (isPseudoFacet(child)) return [
|
|
78
|
+
child
|
|
79
|
+
];
|
|
80
|
+
return isPopover(child) ? Array.from(child.children).filter(isPseudoFacet) : [];
|
|
81
|
+
});
|
|
69
82
|
}
|
|
70
83
|
function getAutomaticFacetGenerator(parent) {
|
|
71
84
|
return Array.from(parent.children).find(isAutomaticFacetGenerator);
|
|
@@ -90,27 +103,33 @@ function triageFacetsByParents(facets, ...parents) {
|
|
|
90
103
|
__webpack_require__.d(__webpack_exports__, {
|
|
91
104
|
collapseFacetsAfter: ()=>collapseFacetsAfter,
|
|
92
105
|
getAutomaticFacetGenerator: ()=>getAutomaticFacetGenerator,
|
|
106
|
+
getFacetElementToReorder: ()=>getFacetElementToReorder,
|
|
93
107
|
getFacetsInChildren: ()=>getFacetsInChildren,
|
|
94
108
|
getFirstNewFacetValueIndex: ()=>getFirstNewFacetValueIndex,
|
|
95
109
|
isAutomaticFacetGenerator: ()=>isAutomaticFacetGenerator,
|
|
110
|
+
isFacetNestedInPopover: ()=>isFacetNestedInPopover,
|
|
96
111
|
shouldDisplayInputForFacetRange: ()=>shouldDisplayInputForFacetRange,
|
|
97
112
|
sortFacetVisibility: ()=>sortFacetVisibility,
|
|
98
113
|
triageFacetsByParents: ()=>triageFacetsByParents
|
|
99
114
|
});
|
|
100
115
|
exports.collapseFacetsAfter = __webpack_exports__.collapseFacetsAfter;
|
|
101
116
|
exports.getAutomaticFacetGenerator = __webpack_exports__.getAutomaticFacetGenerator;
|
|
117
|
+
exports.getFacetElementToReorder = __webpack_exports__.getFacetElementToReorder;
|
|
102
118
|
exports.getFacetsInChildren = __webpack_exports__.getFacetsInChildren;
|
|
103
119
|
exports.getFirstNewFacetValueIndex = __webpack_exports__.getFirstNewFacetValueIndex;
|
|
104
120
|
exports.isAutomaticFacetGenerator = __webpack_exports__.isAutomaticFacetGenerator;
|
|
121
|
+
exports.isFacetNestedInPopover = __webpack_exports__.isFacetNestedInPopover;
|
|
105
122
|
exports.shouldDisplayInputForFacetRange = __webpack_exports__.shouldDisplayInputForFacetRange;
|
|
106
123
|
exports.sortFacetVisibility = __webpack_exports__.sortFacetVisibility;
|
|
107
124
|
exports.triageFacetsByParents = __webpack_exports__.triageFacetsByParents;
|
|
108
125
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
109
126
|
"collapseFacetsAfter",
|
|
110
127
|
"getAutomaticFacetGenerator",
|
|
128
|
+
"getFacetElementToReorder",
|
|
111
129
|
"getFacetsInChildren",
|
|
112
130
|
"getFirstNewFacetValueIndex",
|
|
113
131
|
"isAutomaticFacetGenerator",
|
|
132
|
+
"isFacetNestedInPopover",
|
|
114
133
|
"shouldDisplayInputForFacetRange",
|
|
115
134
|
"sortFacetVisibility",
|
|
116
135
|
"triageFacetsByParents"
|
|
@@ -188,8 +188,8 @@ class TimeframeFacetCommon {
|
|
|
188
188
|
label: this.props.label
|
|
189
189
|
}
|
|
190
190
|
})((0, external_lit_namespaceObject.html)`<ul class="mt-3" part="values">
|
|
191
|
-
|
|
192
|
-
|
|
191
|
+
${children}
|
|
192
|
+
</ul>`);
|
|
193
193
|
}
|
|
194
194
|
renderHeader(isCollapsed, headerFocus, onToggleCollapse) {
|
|
195
195
|
return (0, facet_header_cjs_namespaceObject.renderFacetHeader)({
|
|
@@ -33,6 +33,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
33
33
|
});
|
|
34
34
|
const external_marked_namespaceObject = require("marked");
|
|
35
35
|
const utils_cjs_namespaceObject = require("../../../../utils/utils.cjs");
|
|
36
|
+
require("../../atomic-generated-answer-inline-link/atomic-generated-answer-inline-link.cjs");
|
|
36
37
|
const toInlinePlainText = (textWithHtml)=>{
|
|
37
38
|
const withoutHtmlTags = textWithHtml.replace(/<[^>]*>/g, ' ');
|
|
38
39
|
const withCollapsedWhitespaces = withoutHtmlTags.replace(/\s{2,}/g, ' ');
|
|
@@ -32,6 +32,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
32
32
|
});
|
|
33
33
|
const headless_namespaceObject = require("@coveo/headless");
|
|
34
34
|
const template_provider_cjs_namespaceObject = require("../template-provider/template-provider.cjs");
|
|
35
|
+
require("../../search/atomic-result-link/atomic-result-link.cjs");
|
|
35
36
|
class ResultTemplateProvider extends template_provider_cjs_namespaceObject.TemplateProvider {
|
|
36
37
|
makeDefaultTemplate() {
|
|
37
38
|
const content = document.createDocumentFragment();
|
|
@@ -31,6 +31,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
31
31
|
ResultTemplateController: ()=>ResultTemplateController
|
|
32
32
|
});
|
|
33
33
|
const base_template_controller_cjs_namespaceObject = require("../template-controller/base-template-controller.cjs");
|
|
34
|
+
require("../../search/atomic-result-link/atomic-result-link.cjs");
|
|
34
35
|
class ResultTemplateController extends base_template_controller_cjs_namespaceObject.BaseTemplateController {
|
|
35
36
|
getTemplate(conditions) {
|
|
36
37
|
const baseTemplate = this.getBaseTemplate(conditions);
|
|
@@ -100,11 +100,13 @@ class SuggestionManager {
|
|
|
100
100
|
const panelHasActiveDescendant = this.previousActiveDescendantElement && panel.contains(this.previousActiveDescendantElement);
|
|
101
101
|
const newValue = panelHasActiveDescendant ? this.previousActiveDescendantElement : panel.firstElementChild;
|
|
102
102
|
this.updateDescendants(newValue.id);
|
|
103
|
+
this.updateKeyboardActiveDescendant(newValue.id);
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
106
|
clearSuggestions() {
|
|
106
107
|
this.clearSuggestionElements();
|
|
107
108
|
this.updateActiveDescendant();
|
|
109
|
+
this.updateKeyboardActiveDescendant();
|
|
108
110
|
}
|
|
109
111
|
async focusNextValue() {
|
|
110
112
|
if (!this.hasSuggestions || !this.nextOrFirstValue) return;
|
|
@@ -153,6 +155,7 @@ class SuggestionManager {
|
|
|
153
155
|
}
|
|
154
156
|
async executeQuerySuggestion() {
|
|
155
157
|
this.updateActiveDescendant();
|
|
158
|
+
this.updateKeyboardActiveDescendant();
|
|
156
159
|
const settled = await Promise.allSettled(this.suggestions.map((suggestion)=>(0, promise_utils_cjs_namespaceObject.promiseTimeout)(suggestion.onInput ? suggestion.onInput() : Promise.resolve(), this.ownerSearchBoxProps.getSuggestionTimeout())));
|
|
157
160
|
const fulfilledSuggestions = [];
|
|
158
161
|
settled.forEach((prom, j)=>{
|
|
@@ -155,8 +155,8 @@ class AtomicInsightFacet extends external_lit_namespaceObject.LitElement {
|
|
|
155
155
|
label: this.label
|
|
156
156
|
}
|
|
157
157
|
})((0, external_lit_namespaceObject.html)`<ul class="mt-3 ${'box' === this.displayValuesAs ? 'box-container' : ''}" part="values">
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
${children}
|
|
159
|
+
</ul>`);
|
|
160
160
|
}
|
|
161
161
|
renderValues() {
|
|
162
162
|
const firstNewValueIndex = (0, facet_common_cjs_namespaceObject.getFirstNewFacetValueIndex)(this.facet.state.values, this.valuesBeforeShowMore);
|
|
@@ -50,6 +50,7 @@ const error_guard_cjs_namespaceObject = require("../../../decorators/error-guard
|
|
|
50
50
|
const with_tailwind_styles_cjs_namespaceObject = require("../../../decorators/with-tailwind-styles.cjs");
|
|
51
51
|
const attach_cjs_namespaceObject = require("../../../images/attach.cjs");
|
|
52
52
|
var attach_cjs_default = /*#__PURE__*/ __webpack_require__.n(attach_cjs_namespaceObject);
|
|
53
|
+
require("../../common/atomic-icon/atomic-icon.cjs");
|
|
53
54
|
function _ts_decorate(decorators, target, key, desc) {
|
|
54
55
|
var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
55
56
|
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -53,6 +53,7 @@ var flag_cjs_default = /*#__PURE__*/ __webpack_require__.n(flag_cjs_namespaceObj
|
|
|
53
53
|
const three_dots_cjs_namespaceObject = require("../../../images/three-dots.cjs");
|
|
54
54
|
var three_dots_cjs_default = /*#__PURE__*/ __webpack_require__.n(three_dots_cjs_namespaceObject);
|
|
55
55
|
const external_user_action_cjs_namespaceObject = require("./user-action.cjs");
|
|
56
|
+
require("../../common/atomic-icon/atomic-icon.cjs");
|
|
56
57
|
function _ts_decorate(decorators, target, key, desc) {
|
|
57
58
|
var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
58
59
|
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -52,6 +52,7 @@ const quickview_cjs_namespaceObject = require("../../../images/quickview.cjs");
|
|
|
52
52
|
var quickview_cjs_default = /*#__PURE__*/ __webpack_require__.n(quickview_cjs_namespaceObject);
|
|
53
53
|
const search_cjs_namespaceObject = require("../../../images/search.cjs");
|
|
54
54
|
var search_cjs_default = /*#__PURE__*/ __webpack_require__.n(search_cjs_namespaceObject);
|
|
55
|
+
require("../../common/atomic-icon/atomic-icon.cjs");
|
|
55
56
|
const icons = {
|
|
56
57
|
SEARCH: search_cjs_default(),
|
|
57
58
|
CLICK: document_cjs_default(),
|
|
@@ -77,9 +77,13 @@ class AtomicFacetManager extends (0, children_update_complete_mixin_cjs_namespac
|
|
|
77
77
|
const sortedFacets = this.sortFacetsUsingManager(facets, this.facetManager);
|
|
78
78
|
const { visibleFacets, invisibleFacets } = (0, facet_common_cjs_namespaceObject.sortFacetVisibility)(sortedFacets, this.bindings.store.getAllFacets());
|
|
79
79
|
const generator = (0, facet_common_cjs_namespaceObject.getAutomaticFacetGenerator)(this);
|
|
80
|
-
(0, facet_common_cjs_namespaceObject.
|
|
81
|
-
|
|
82
|
-
this.
|
|
80
|
+
const collapsibleFacets = visibleFacets.filter((facet)=>!(0, facet_common_cjs_namespaceObject.isFacetNestedInPopover)(facet));
|
|
81
|
+
(0, facet_common_cjs_namespaceObject.collapseFacetsAfter)(collapsibleFacets, this.collapseFacetsAfter);
|
|
82
|
+
generator?.updateCollapseFacetsDependingOnFacetsVisibility?.(this.collapseFacetsAfter, collapsibleFacets.length);
|
|
83
|
+
this.append(...[
|
|
84
|
+
...visibleFacets,
|
|
85
|
+
...invisibleFacets
|
|
86
|
+
].map((facet)=>(0, facet_common_cjs_namespaceObject.getFacetElementToReorder)(facet)), ...generator ? [
|
|
83
87
|
generator
|
|
84
88
|
] : []);
|
|
85
89
|
};
|
|
@@ -104,9 +104,8 @@ class AtomicPopover extends external_lit_namespaceObject.LitElement {
|
|
|
104
104
|
.active=${this.isOpen}
|
|
105
105
|
.shouldHideSelf=${false}
|
|
106
106
|
>
|
|
107
|
-
${this.renderPopover()}
|
|
107
|
+
${this.renderPopover()} ${(0, when_js_namespaceObject.when)(this.isOpen, ()=>this.renderBackdrop())}
|
|
108
108
|
</atomic-focus-trap>
|
|
109
|
-
${(0, when_js_namespaceObject.when)(this.isOpen, ()=>this.renderBackdrop())}
|
|
110
109
|
`;
|
|
111
110
|
}
|
|
112
111
|
updated() {
|
|
@@ -239,8 +239,8 @@ class AtomicRatingRangeFacet extends external_lit_namespaceObject.LitElement {
|
|
|
239
239
|
label: this.label
|
|
240
240
|
}
|
|
241
241
|
})((0, external_lit_namespaceObject.html)`<ul class="mt-3" part="values">
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
${children}
|
|
243
|
+
</ul>`);
|
|
244
244
|
}
|
|
245
245
|
renderValues() {
|
|
246
246
|
return this.renderValuesContainer(this.valuesToRender.map((value)=>this.renderValue(value, ()=>this.facet.toggleSingleSelect(value))));
|
|
@@ -257,8 +257,7 @@ class AtomicRatingRangeFacet extends external_lit_namespaceObject.LitElement {
|
|
|
257
257
|
}
|
|
258
258
|
});
|
|
259
259
|
if (!this.valuesToRender.length) return external_lit_namespaceObject.nothing;
|
|
260
|
-
return (0, facet_container_cjs_namespaceObject.renderFacetContainer)()((0, external_lit_namespaceObject.html)`${this.renderHeader()}
|
|
261
|
-
${(0, when_js_namespaceObject.when)(!this.isCollapsed, ()=>this.renderValues())}`);
|
|
260
|
+
return (0, facet_container_cjs_namespaceObject.renderFacetContainer)()((0, external_lit_namespaceObject.html)`${this.renderHeader()} ${(0, when_js_namespaceObject.when)(!this.isCollapsed, ()=>this.renderValues())}`);
|
|
262
261
|
})}`;
|
|
263
262
|
}
|
|
264
263
|
constructor(){
|