@coveo/atomic 3.59.4 → 3.59.6
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 +1956 -1907
- package/dist/cjs/components/commerce/atomic-commerce-pager/atomic-commerce-pager.cjs +1 -1
- package/dist/cjs/components/common/atomic-smart-snippet-expandable-answer/atomic-smart-snippet-expandable-answer.cjs +1 -0
- package/dist/cjs/components/common/expandable-text/expandable-text.cjs +3 -0
- package/dist/cjs/components/common/facets/facet-search/facet-search-aria-live.cjs +6 -7
- package/dist/cjs/components/common/generated-answer/generated-answer-controller.cjs +1 -1
- package/dist/cjs/components/common/generated-answer/show-button.cjs +1 -0
- package/dist/cjs/components/insight/atomic-insight-pager/atomic-insight-pager.cjs +1 -1
- package/dist/cjs/components/insight/atomic-insight-smart-snippet-suggestions/atomic-insight-smart-snippet-suggestions.cjs +3 -3
- package/dist/cjs/components/search/atomic-breadbox/atomic-breadbox.cjs +38 -1
- package/dist/cjs/components/search/atomic-did-you-mean/atomic-did-you-mean.cjs +38 -1
- package/dist/cjs/components/search/atomic-notifications/atomic-notifications.cjs +38 -1
- package/dist/cjs/components/search/atomic-numeric-facet/atomic-numeric-facet.cjs +4 -3
- package/dist/cjs/components/search/atomic-pager/atomic-pager.cjs +1 -1
- package/dist/cjs/components/search/atomic-refine-modal/atomic-refine-modal.cjs +38 -1
- package/dist/cjs/components/search/atomic-smart-snippet/atomic-smart-snippet.cjs +3 -3
- package/dist/cjs/components/search/atomic-smart-snippet-suggestions/atomic-smart-snippet-suggestions.cjs +3 -3
- package/dist/cjs/global/environment.cjs +1 -1
- package/dist/cjs/utils/hidden-state-controller.cjs +5 -4
- package/dist/cjs/versions.cjs +1 -1
- package/dist/esm/components/commerce/atomic-commerce-pager/atomic-commerce-pager.js +1 -1
- package/dist/esm/components/common/atomic-smart-snippet-expandable-answer/atomic-smart-snippet-expandable-answer.js +1 -0
- package/dist/esm/components/common/expandable-text/expandable-text.js +3 -0
- package/dist/esm/components/common/facets/facet-search/facet-search-aria-live.js +6 -7
- package/dist/esm/components/common/generated-answer/generated-answer-controller.js +1 -1
- package/dist/esm/components/common/generated-answer/show-button.js +1 -0
- package/dist/esm/components/insight/atomic-insight-pager/atomic-insight-pager.js +1 -1
- package/dist/esm/components/insight/atomic-insight-smart-snippet-suggestions/atomic-insight-smart-snippet-suggestions.js +3 -3
- package/dist/esm/components/search/atomic-breadbox/atomic-breadbox.js +38 -1
- package/dist/esm/components/search/atomic-did-you-mean/atomic-did-you-mean.js +38 -1
- package/dist/esm/components/search/atomic-notifications/atomic-notifications.js +38 -1
- package/dist/esm/components/search/atomic-numeric-facet/atomic-numeric-facet.js +4 -3
- package/dist/esm/components/search/atomic-pager/atomic-pager.js +1 -1
- package/dist/esm/components/search/atomic-refine-modal/atomic-refine-modal.js +38 -1
- package/dist/esm/components/search/atomic-smart-snippet/atomic-smart-snippet.js +3 -3
- package/dist/esm/components/search/atomic-smart-snippet-suggestions/atomic-smart-snippet-suggestions.js +3 -3
- package/dist/esm/global/environment.js +1 -1
- package/dist/esm/utils/hidden-state-controller.js +5 -4
- package/dist/esm/versions.js +1 -1
- package/dist/types/components/insight/atomic-insight-generated-answer/atomic-insight-generated-answer.d.ts +0 -1
- package/dist/types/components/search/atomic-breadbox/atomic-breadbox.d.ts +3 -0
- package/dist/types/components/search/atomic-did-you-mean/atomic-did-you-mean.d.ts +3 -0
- package/dist/types/components/search/atomic-generated-answer/atomic-generated-answer.d.ts +0 -1
- package/dist/types/components/search/atomic-notifications/atomic-notifications.d.ts +3 -0
- package/dist/types/components/search/atomic-numeric-facet/atomic-numeric-facet.d.ts +1 -1
- package/dist/types/components/search/atomic-refine-modal/atomic-refine-modal.d.ts +3 -0
- package/dist/types/utils/hidden-state-controller.d.ts +15 -0
- package/package.json +4 -4
|
@@ -147,7 +147,7 @@ class AtomicCommercePager extends external_lit_namespaceObject.LitElement {
|
|
|
147
147
|
}
|
|
148
148
|
announcePageLoaded() {
|
|
149
149
|
this.ariaMessage.message = this.bindings.i18n.t('pager-page-loaded', {
|
|
150
|
-
|
|
150
|
+
page: this.pagerState.page
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
constructor(){
|
|
@@ -135,6 +135,7 @@ class AtomicSmartSnippetExpandableAnswer extends external_lit_namespaceObject.Li
|
|
|
135
135
|
@click=${()=>this.isExpanded ? this.handleCollapse() : this.handleExpand()}
|
|
136
136
|
class="text-primary mb-4 hover:underline"
|
|
137
137
|
part=${this.isExpanded ? 'show-less-button' : 'show-more-button'}
|
|
138
|
+
aria-expanded=${this.isExpanded ? 'true' : 'false'}
|
|
138
139
|
>
|
|
139
140
|
${this.bindings.i18n.t(this.isExpanded ? 'show-less' : 'show-more')}
|
|
140
141
|
<atomic-icon
|
|
@@ -82,6 +82,9 @@ const renderExpandableText = ({ props: { isExpanded, isTruncated, isCollapsible,
|
|
|
82
82
|
style: 'text-primary',
|
|
83
83
|
class: buttonClassString,
|
|
84
84
|
title: buttonLabel,
|
|
85
|
+
...isCollapsible && {
|
|
86
|
+
ariaExpanded: isExpanded ? 'true' : 'false'
|
|
87
|
+
},
|
|
85
88
|
onClick: onToggleExpand
|
|
86
89
|
}
|
|
87
90
|
})((0, external_lit_namespaceObject.html)` <atomic-icon
|
|
@@ -30,13 +30,12 @@ const external_facet_search_utils_cjs_namespaceObject = require("./facet-search-
|
|
|
30
30
|
function announceFacetSearchResultsWithAriaLive(facet, label, setAriaLive, i18n) {
|
|
31
31
|
let prevState = facet.state.facetSearch;
|
|
32
32
|
facet.subscribe(()=>{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
33
|
+
const nextState = facet.state.facetSearch;
|
|
34
|
+
if ((0, external_facet_search_utils_cjs_namespaceObject.shouldUpdateFacetSearchComponent)(nextState, prevState) && nextState.query) setAriaLive(i18n.t('facet-search-results-count', {
|
|
35
|
+
count: nextState.values.length,
|
|
36
|
+
label
|
|
37
|
+
}));
|
|
38
|
+
prevState = nextState;
|
|
40
39
|
});
|
|
41
40
|
}
|
|
42
41
|
exports.announceFacetSearchResultsWithAriaLive = __webpack_exports__.announceFacetSearchResultsWithAriaLive;
|
|
@@ -61,7 +61,7 @@ class GeneratedAnswerController {
|
|
|
61
61
|
const isHidden = !state.isVisible;
|
|
62
62
|
const isGenerating = !!state.isStreaming;
|
|
63
63
|
const hasNonEmptyAnswer = !!state.answer?.trim();
|
|
64
|
-
const hasError = !!state.error;
|
|
64
|
+
const hasError = !!state.error?.message;
|
|
65
65
|
if (isHidden) return bindings.i18n.t('generated-answer-hidden');
|
|
66
66
|
if (isGenerating) return bindings.i18n.t('generating-answer');
|
|
67
67
|
if (hasError) return bindings.i18n.t('answer-could-not-be-generated');
|
|
@@ -48,6 +48,7 @@ const renderShowButton = ({ props })=>(0, external_lit_namespaceObject.html)`${(
|
|
|
48
48
|
style: 'text-primary',
|
|
49
49
|
part: 'answer-show-button',
|
|
50
50
|
class: 'hidden items-center hover:bg-transparent',
|
|
51
|
+
ariaExpanded: props.isCollapsed ? 'false' : 'true',
|
|
51
52
|
onClick: props.onClick
|
|
52
53
|
}
|
|
53
54
|
})((0, external_lit_namespaceObject.html)`
|
|
@@ -144,7 +144,7 @@ class AtomicInsightPager extends external_lit_namespaceObject.LitElement {
|
|
|
144
144
|
}
|
|
145
145
|
announcePageLoaded() {
|
|
146
146
|
this.ariaMessage.message = this.bindings.i18n.t('pager-page-loaded', {
|
|
147
|
-
|
|
147
|
+
page: this.pagerState.currentPage
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
constructor(){
|
|
@@ -141,9 +141,9 @@ class AtomicInsightSmartSnippetSuggestions extends external_lit_namespaceObject.
|
|
|
141
141
|
})((0, external_lit_namespaceObject.html)`
|
|
142
142
|
<atomic-smart-snippet-source
|
|
143
143
|
.anchorAttributes=${(0, attributes_slot_cjs_namespaceObject.getAttributesFromLinkSlotContent)(this, 'source-anchor-attributes')}
|
|
144
|
-
@
|
|
145
|
-
@
|
|
146
|
-
@
|
|
144
|
+
@begin-delayed-select-source=${()=>this.smartSnippetQuestionsList.beginDelayedSelectSource(questionAnswerId)}
|
|
145
|
+
@cancel-pending-select-source=${()=>this.smartSnippetQuestionsList.cancelPendingSelectSource(questionAnswerId)}
|
|
146
|
+
@select-source=${()=>this.smartSnippetQuestionsList.selectSource(questionAnswerId)}
|
|
147
147
|
.source=${source}
|
|
148
148
|
></atomic-smart-snippet-source>
|
|
149
149
|
`);
|
|
@@ -44,6 +44,38 @@ const error_guard_cjs_namespaceObject = require("../../../decorators/error-guard
|
|
|
44
44
|
const with_tailwind_styles_cjs_namespaceObject = require("../../../decorators/with-tailwind-styles.cjs");
|
|
45
45
|
const accessibility_utils_cjs_namespaceObject = require("../../../utils/accessibility-utils.cjs");
|
|
46
46
|
const field_utils_cjs_namespaceObject = require("../../../utils/field-utils.cjs");
|
|
47
|
+
const hidden_state_controller_cjs_namespaceObject = require("../../../utils/hidden-state-controller.cjs");
|
|
48
|
+
function _check_private_redeclaration(obj, privateCollection) {
|
|
49
|
+
if (privateCollection.has(obj)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
50
|
+
}
|
|
51
|
+
function _class_apply_descriptor_get(receiver, descriptor) {
|
|
52
|
+
if (descriptor.get) return descriptor.get.call(receiver);
|
|
53
|
+
return descriptor.value;
|
|
54
|
+
}
|
|
55
|
+
function _class_apply_descriptor_set(receiver, descriptor, value) {
|
|
56
|
+
if (descriptor.set) descriptor.set.call(receiver, value);
|
|
57
|
+
else {
|
|
58
|
+
if (!descriptor.writable) throw new TypeError("attempted to set read only private field");
|
|
59
|
+
descriptor.value = value;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function _class_extract_field_descriptor(receiver, privateMap, action) {
|
|
63
|
+
if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance");
|
|
64
|
+
return privateMap.get(receiver);
|
|
65
|
+
}
|
|
66
|
+
function _class_private_field_get(receiver, privateMap) {
|
|
67
|
+
var descriptor = _class_extract_field_descriptor(receiver, privateMap, "get");
|
|
68
|
+
return _class_apply_descriptor_get(receiver, descriptor);
|
|
69
|
+
}
|
|
70
|
+
function _class_private_field_init(obj, privateMap, value) {
|
|
71
|
+
_check_private_redeclaration(obj, privateMap);
|
|
72
|
+
privateMap.set(obj, value);
|
|
73
|
+
}
|
|
74
|
+
function _class_private_field_set(receiver, privateMap, value) {
|
|
75
|
+
var descriptor = _class_extract_field_descriptor(receiver, privateMap, "set");
|
|
76
|
+
_class_apply_descriptor_set(receiver, descriptor, value);
|
|
77
|
+
return value;
|
|
78
|
+
}
|
|
47
79
|
function _ts_decorate(decorators, target, key, desc) {
|
|
48
80
|
var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
49
81
|
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -53,6 +85,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
53
85
|
function _ts_metadata(k, v) {
|
|
54
86
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
55
87
|
}
|
|
88
|
+
var _hiddenState = /*#__PURE__*/ new WeakMap();
|
|
56
89
|
class AtomicBreadbox extends external_lit_namespaceObject.LitElement {
|
|
57
90
|
initialize() {
|
|
58
91
|
this.breadcrumbManager = (0, headless_namespaceObject.buildBreadcrumbManager)(this.bindings.engine);
|
|
@@ -71,6 +104,7 @@ class AtomicBreadbox extends external_lit_namespaceObject.LitElement {
|
|
|
71
104
|
}
|
|
72
105
|
render() {
|
|
73
106
|
const breadcrumbs = this.allBreadcrumbs;
|
|
107
|
+
_class_private_field_get(this, _hiddenState).isEmpty = !breadcrumbs.length;
|
|
74
108
|
if (!breadcrumbs.length) return external_lit_namespaceObject.nothing;
|
|
75
109
|
return (0, external_lit_namespaceObject.html)`${(0, breadcrumb_container_cjs_namespaceObject.renderBreadcrumbContainer)({
|
|
76
110
|
props: {
|
|
@@ -289,7 +323,10 @@ class AtomicBreadbox extends external_lit_namespaceObject.LitElement {
|
|
|
289
323
|
});
|
|
290
324
|
}
|
|
291
325
|
constructor(){
|
|
292
|
-
super(),
|
|
326
|
+
super(), _class_private_field_init(this, _hiddenState, {
|
|
327
|
+
writable: true,
|
|
328
|
+
value: void 0
|
|
329
|
+
}), this.lastRemovedBreadcrumbIndex = 0, this.numberOfBreadcrumbs = 0, this.numberOfCollapsedBreadcrumbs = 0, _class_private_field_set(this, _hiddenState, new hidden_state_controller_cjs_namespaceObject.HiddenStateController(this)), this.isCollapsed = true, this.showMoreText = '', this.disableCollapse = false, this.breadboxAriaMessage = new accessibility_utils_cjs_namespaceObject.AriaLiveRegionController(this, 'breadbox', true), this.pathLimit = 3;
|
|
293
330
|
new validate_props_controller_cjs_namespaceObject.ValidatePropsController(this, ()=>({
|
|
294
331
|
pathLimit: this.pathLimit
|
|
295
332
|
}), AtomicBreadbox.propsSchema);
|
|
@@ -38,9 +38,41 @@ const binding_guard_cjs_namespaceObject = require("../../../decorators/binding-g
|
|
|
38
38
|
const bindings_cjs_namespaceObject = require("../../../decorators/bindings.cjs");
|
|
39
39
|
const error_guard_cjs_namespaceObject = require("../../../decorators/error-guard.cjs");
|
|
40
40
|
const with_tailwind_styles_cjs_namespaceObject = require("../../../decorators/with-tailwind-styles.cjs");
|
|
41
|
+
const hidden_state_controller_cjs_namespaceObject = require("../../../utils/hidden-state-controller.cjs");
|
|
41
42
|
const auto_correction_cjs_namespaceObject = require("../../common/query-correction/auto-correction.cjs");
|
|
42
43
|
const correction_cjs_namespaceObject = require("../../common/query-correction/correction.cjs");
|
|
43
44
|
const trigger_correction_cjs_namespaceObject = require("../../common/query-correction/trigger-correction.cjs");
|
|
45
|
+
function _check_private_redeclaration(obj, privateCollection) {
|
|
46
|
+
if (privateCollection.has(obj)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
47
|
+
}
|
|
48
|
+
function _class_apply_descriptor_get(receiver, descriptor) {
|
|
49
|
+
if (descriptor.get) return descriptor.get.call(receiver);
|
|
50
|
+
return descriptor.value;
|
|
51
|
+
}
|
|
52
|
+
function _class_apply_descriptor_set(receiver, descriptor, value) {
|
|
53
|
+
if (descriptor.set) descriptor.set.call(receiver, value);
|
|
54
|
+
else {
|
|
55
|
+
if (!descriptor.writable) throw new TypeError("attempted to set read only private field");
|
|
56
|
+
descriptor.value = value;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function _class_extract_field_descriptor(receiver, privateMap, action) {
|
|
60
|
+
if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance");
|
|
61
|
+
return privateMap.get(receiver);
|
|
62
|
+
}
|
|
63
|
+
function _class_private_field_get(receiver, privateMap) {
|
|
64
|
+
var descriptor = _class_extract_field_descriptor(receiver, privateMap, "get");
|
|
65
|
+
return _class_apply_descriptor_get(receiver, descriptor);
|
|
66
|
+
}
|
|
67
|
+
function _class_private_field_init(obj, privateMap, value) {
|
|
68
|
+
_check_private_redeclaration(obj, privateMap);
|
|
69
|
+
privateMap.set(obj, value);
|
|
70
|
+
}
|
|
71
|
+
function _class_private_field_set(receiver, privateMap, value) {
|
|
72
|
+
var descriptor = _class_extract_field_descriptor(receiver, privateMap, "set");
|
|
73
|
+
_class_apply_descriptor_set(receiver, descriptor, value);
|
|
74
|
+
return value;
|
|
75
|
+
}
|
|
44
76
|
function _ts_decorate(decorators, target, key, desc) {
|
|
45
77
|
var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
46
78
|
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -50,6 +82,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
50
82
|
function _ts_metadata(k, v) {
|
|
51
83
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
52
84
|
}
|
|
85
|
+
var _hiddenState = /*#__PURE__*/ new WeakMap();
|
|
53
86
|
class AtomicDidYouMean extends external_lit_namespaceObject.LitElement {
|
|
54
87
|
initialize() {
|
|
55
88
|
this.didYouMean = (0, headless_namespaceObject.buildDidYouMean)(this.bindings.engine, {
|
|
@@ -93,10 +126,14 @@ class AtomicDidYouMean extends external_lit_namespaceObject.LitElement {
|
|
|
93
126
|
}
|
|
94
127
|
render() {
|
|
95
128
|
const hasCorrection = this.didYouMeanState.hasQueryCorrection || this.queryTriggerState.wasQueryModified;
|
|
129
|
+
_class_private_field_get(this, _hiddenState).isEmpty = !hasCorrection;
|
|
96
130
|
return (0, external_lit_namespaceObject.html)`${(0, when_js_namespaceObject.when)(hasCorrection, ()=>this.content)}`;
|
|
97
131
|
}
|
|
98
132
|
constructor(){
|
|
99
|
-
super(), this
|
|
133
|
+
super(), _class_private_field_init(this, _hiddenState, {
|
|
134
|
+
writable: true,
|
|
135
|
+
value: void 0
|
|
136
|
+
}), _class_private_field_set(this, _hiddenState, new hidden_state_controller_cjs_namespaceObject.HiddenStateController(this)), this.automaticallyCorrectQuery = true, this.queryCorrectionMode = 'next';
|
|
100
137
|
new validate_props_controller_cjs_namespaceObject.ValidatePropsController(this, ()=>({
|
|
101
138
|
queryCorrectionMode: this.queryCorrectionMode
|
|
102
139
|
}), AtomicDidYouMean.propsSchema, false);
|
|
@@ -50,8 +50,40 @@ 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 bindings_mixin_cjs_namespaceObject = require("../../../mixins/bindings-mixin.cjs");
|
|
52
52
|
const accessibility_utils_cjs_namespaceObject = require("../../../utils/accessibility-utils.cjs");
|
|
53
|
+
const hidden_state_controller_cjs_namespaceObject = require("../../../utils/hidden-state-controller.cjs");
|
|
53
54
|
const info_cjs_namespaceObject = require("../../../images/info.cjs");
|
|
54
55
|
var info_cjs_default = /*#__PURE__*/ __webpack_require__.n(info_cjs_namespaceObject);
|
|
56
|
+
function _check_private_redeclaration(obj, privateCollection) {
|
|
57
|
+
if (privateCollection.has(obj)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
58
|
+
}
|
|
59
|
+
function _class_apply_descriptor_get(receiver, descriptor) {
|
|
60
|
+
if (descriptor.get) return descriptor.get.call(receiver);
|
|
61
|
+
return descriptor.value;
|
|
62
|
+
}
|
|
63
|
+
function _class_apply_descriptor_set(receiver, descriptor, value) {
|
|
64
|
+
if (descriptor.set) descriptor.set.call(receiver, value);
|
|
65
|
+
else {
|
|
66
|
+
if (!descriptor.writable) throw new TypeError("attempted to set read only private field");
|
|
67
|
+
descriptor.value = value;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function _class_extract_field_descriptor(receiver, privateMap, action) {
|
|
71
|
+
if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance");
|
|
72
|
+
return privateMap.get(receiver);
|
|
73
|
+
}
|
|
74
|
+
function _class_private_field_get(receiver, privateMap) {
|
|
75
|
+
var descriptor = _class_extract_field_descriptor(receiver, privateMap, "get");
|
|
76
|
+
return _class_apply_descriptor_get(receiver, descriptor);
|
|
77
|
+
}
|
|
78
|
+
function _class_private_field_init(obj, privateMap, value) {
|
|
79
|
+
_check_private_redeclaration(obj, privateMap);
|
|
80
|
+
privateMap.set(obj, value);
|
|
81
|
+
}
|
|
82
|
+
function _class_private_field_set(receiver, privateMap, value) {
|
|
83
|
+
var descriptor = _class_extract_field_descriptor(receiver, privateMap, "set");
|
|
84
|
+
_class_apply_descriptor_set(receiver, descriptor, value);
|
|
85
|
+
return value;
|
|
86
|
+
}
|
|
55
87
|
function _ts_decorate(decorators, target, key, desc) {
|
|
56
88
|
var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
57
89
|
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -61,6 +93,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
61
93
|
function _ts_metadata(k, v) {
|
|
62
94
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
63
95
|
}
|
|
96
|
+
var _hiddenState = /*#__PURE__*/ new WeakMap();
|
|
64
97
|
class AtomicNotifications extends (0, bindings_mixin_cjs_namespaceObject.InitializeBindingsMixin)(external_lit_namespaceObject.LitElement) {
|
|
65
98
|
initialize() {
|
|
66
99
|
this.notifyTrigger = (0, headless_namespaceObject.buildNotifyTrigger)(this.bindings.engine);
|
|
@@ -100,6 +133,7 @@ class AtomicNotifications extends (0, bindings_mixin_cjs_namespaceObject.Initial
|
|
|
100
133
|
`;
|
|
101
134
|
}
|
|
102
135
|
render() {
|
|
136
|
+
_class_private_field_get(this, _hiddenState).isEmpty = !this.notifications.length;
|
|
103
137
|
if (!this.notifications.length) return external_lit_namespaceObject.nothing;
|
|
104
138
|
this.ariaMessage.message = this.generateAriaMessage();
|
|
105
139
|
return (0, external_lit_namespaceObject.html)`
|
|
@@ -113,7 +147,10 @@ class AtomicNotifications extends (0, bindings_mixin_cjs_namespaceObject.Initial
|
|
|
113
147
|
`;
|
|
114
148
|
}
|
|
115
149
|
constructor(){
|
|
116
|
-
super(), this
|
|
150
|
+
super(), _class_private_field_init(this, _hiddenState, {
|
|
151
|
+
writable: true,
|
|
152
|
+
value: void 0
|
|
153
|
+
}), this.headingLevel = 0, this.ariaMessage = new accessibility_utils_cjs_namespaceObject.AriaLiveRegionController(this, 'notifications'), _class_private_field_set(this, _hiddenState, new hidden_state_controller_cjs_namespaceObject.HiddenStateController(this));
|
|
117
154
|
new validate_props_controller_cjs_namespaceObject.ValidatePropsController(this, ()=>({
|
|
118
155
|
headingLevel: this.headingLevel
|
|
119
156
|
}), AtomicNotifications.schema, false);
|
|
@@ -92,7 +92,7 @@ class AtomicNumericFacet extends external_lit_namespaceObject.LitElement {
|
|
|
92
92
|
disconnectedCallback() {
|
|
93
93
|
super.disconnectedCallback();
|
|
94
94
|
if (!this.isConnected) {
|
|
95
|
-
this.
|
|
95
|
+
this.conditionManagers.forEach((manager)=>manager.stopWatching());
|
|
96
96
|
this.removeNumberFormatListener?.();
|
|
97
97
|
this.removeNumberInputApplyListener?.();
|
|
98
98
|
this.unsubscribeFacetForRange?.();
|
|
@@ -205,6 +205,7 @@ class AtomicNumericFacet extends external_lit_namespaceObject.LitElement {
|
|
|
205
205
|
this.unsubscribeFacetForRange = this.facetForRange.subscribe(()=>{
|
|
206
206
|
this.facetState = this.facetForRange.state;
|
|
207
207
|
});
|
|
208
|
+
this.conditionManagers.push(this.initializeDependenciesManager(this.facetState.facetId));
|
|
208
209
|
return this.facetForRange;
|
|
209
210
|
}
|
|
210
211
|
initializeFilter() {
|
|
@@ -219,8 +220,8 @@ class AtomicNumericFacet extends external_lit_namespaceObject.LitElement {
|
|
|
219
220
|
}
|
|
220
221
|
}
|
|
221
222
|
});
|
|
222
|
-
this.filterDependenciesManager = this.initializeDependenciesManager(this.filter.state.facetId);
|
|
223
223
|
this.filterState = this.filter.state;
|
|
224
|
+
this.conditionManagers.push(this.initializeDependenciesManager(this.filterState.facetId));
|
|
224
225
|
this.unsubscribeFilter = this.filter.subscribe(()=>{
|
|
225
226
|
this.filterState = this.filter.state;
|
|
226
227
|
});
|
|
@@ -350,7 +351,7 @@ class AtomicNumericFacet extends external_lit_namespaceObject.LitElement {
|
|
|
350
351
|
${(0, when_js_namespaceObject.when)(this.shouldRenderInput, ()=>this.renderInput())}`)}`))}`;
|
|
351
352
|
}
|
|
352
353
|
constructor(){
|
|
353
|
-
super(), this.label = 'no-label', this.tabsIncluded = [], this.tabsExcluded = [], this.numberOfValues = 8, this.sortCriteria = 'ascending', this.rangeAlgorithm = 'equiprobable', this.displayValuesAs = 'checkbox', this.isCollapsed = false, this.headingLevel = 0, this.filterFacetCount = true, this.injectionDepth = 1000, this.manualRanges = [], this.formatter = format_common_cjs_namespaceObject.defaultNumberFormatter;
|
|
354
|
+
super(), this.label = 'no-label', this.tabsIncluded = [], this.tabsExcluded = [], this.numberOfValues = 8, this.sortCriteria = 'ascending', this.rangeAlgorithm = 'equiprobable', this.displayValuesAs = 'checkbox', this.isCollapsed = false, this.headingLevel = 0, this.filterFacetCount = true, this.injectionDepth = 1000, this.manualRanges = [], this.formatter = format_common_cjs_namespaceObject.defaultNumberFormatter, this.conditionManagers = [];
|
|
354
355
|
new validate_props_controller_cjs_namespaceObject.ValidatePropsController(this, ()=>({
|
|
355
356
|
displayValuesAs: this.displayValuesAs,
|
|
356
357
|
withInput: this.withInput
|
|
@@ -146,7 +146,7 @@ class AtomicPager extends (0, bindings_mixin_cjs_namespaceObject.InitializeBindi
|
|
|
146
146
|
}
|
|
147
147
|
announcePageLoaded() {
|
|
148
148
|
this.ariaMessage.message = this.bindings.i18n.t('pager-page-loaded', {
|
|
149
|
-
|
|
149
|
+
page: this.pagerState.currentPage
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
constructor(){
|
|
@@ -43,10 +43,42 @@ const bindings_cjs_namespaceObject = require("../../../decorators/bindings.cjs")
|
|
|
43
43
|
const error_guard_cjs_namespaceObject = require("../../../decorators/error-guard.cjs");
|
|
44
44
|
const watch_cjs_namespaceObject = require("../../../decorators/watch.cjs");
|
|
45
45
|
const with_tailwind_styles_cjs_namespaceObject = require("../../../decorators/with-tailwind-styles.cjs");
|
|
46
|
+
const hidden_state_controller_cjs_namespaceObject = require("../../../utils/hidden-state-controller.cjs");
|
|
46
47
|
const tab_utils_cjs_namespaceObject = require("../../../utils/tab-utils.cjs");
|
|
47
48
|
const utils_cjs_namespaceObject = require("../../../utils/utils.cjs");
|
|
48
49
|
const facet_common_cjs_namespaceObject = require("../../common/facets/facet-common.cjs");
|
|
49
50
|
require("../atomic-automatic-facet-generator/atomic-automatic-facet-generator.cjs");
|
|
51
|
+
function _check_private_redeclaration(obj, privateCollection) {
|
|
52
|
+
if (privateCollection.has(obj)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
53
|
+
}
|
|
54
|
+
function _class_apply_descriptor_get(receiver, descriptor) {
|
|
55
|
+
if (descriptor.get) return descriptor.get.call(receiver);
|
|
56
|
+
return descriptor.value;
|
|
57
|
+
}
|
|
58
|
+
function _class_apply_descriptor_set(receiver, descriptor, value) {
|
|
59
|
+
if (descriptor.set) descriptor.set.call(receiver, value);
|
|
60
|
+
else {
|
|
61
|
+
if (!descriptor.writable) throw new TypeError("attempted to set read only private field");
|
|
62
|
+
descriptor.value = value;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function _class_extract_field_descriptor(receiver, privateMap, action) {
|
|
66
|
+
if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance");
|
|
67
|
+
return privateMap.get(receiver);
|
|
68
|
+
}
|
|
69
|
+
function _class_private_field_get(receiver, privateMap) {
|
|
70
|
+
var descriptor = _class_extract_field_descriptor(receiver, privateMap, "get");
|
|
71
|
+
return _class_apply_descriptor_get(receiver, descriptor);
|
|
72
|
+
}
|
|
73
|
+
function _class_private_field_init(obj, privateMap, value) {
|
|
74
|
+
_check_private_redeclaration(obj, privateMap);
|
|
75
|
+
privateMap.set(obj, value);
|
|
76
|
+
}
|
|
77
|
+
function _class_private_field_set(receiver, privateMap, value) {
|
|
78
|
+
var descriptor = _class_extract_field_descriptor(receiver, privateMap, "set");
|
|
79
|
+
_class_apply_descriptor_set(receiver, descriptor, value);
|
|
80
|
+
return value;
|
|
81
|
+
}
|
|
50
82
|
function _ts_decorate(decorators, target, key, desc) {
|
|
51
83
|
var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
52
84
|
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -56,6 +88,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
56
88
|
function _ts_metadata(k, v) {
|
|
57
89
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
58
90
|
}
|
|
91
|
+
var _hiddenState = /*#__PURE__*/ new WeakMap();
|
|
59
92
|
class AtomicRefineModal extends external_lit_namespaceObject.LitElement {
|
|
60
93
|
initialize() {
|
|
61
94
|
this.breadcrumbManager = (0, headless_namespaceObject.buildBreadcrumbManager)(this.bindings.engine);
|
|
@@ -180,6 +213,7 @@ class AtomicRefineModal extends external_lit_namespaceObject.LitElement {
|
|
|
180
213
|
}) : external_lit_namespaceObject.nothing);
|
|
181
214
|
}
|
|
182
215
|
render() {
|
|
216
|
+
_class_private_field_get(this, _hiddenState).isEmpty = !this.isOpen;
|
|
183
217
|
return (0, external_lit_namespaceObject.html)`${(0, modal_cjs_namespaceObject.renderRefineModal)({
|
|
184
218
|
props: {
|
|
185
219
|
i18n: this.bindings.i18n,
|
|
@@ -198,7 +232,10 @@ class AtomicRefineModal extends external_lit_namespaceObject.LitElement {
|
|
|
198
232
|
`))}`;
|
|
199
233
|
}
|
|
200
234
|
constructor(...args){
|
|
201
|
-
super(...args), this
|
|
235
|
+
super(...args), _class_private_field_init(this, _hiddenState, {
|
|
236
|
+
writable: true,
|
|
237
|
+
value: void 0
|
|
238
|
+
}), this.isOpen = false, this.collapseFacetsAfter = 0, _class_private_field_set(this, _hiddenState, new hidden_state_controller_cjs_namespaceObject.HiddenStateController(this)), this.onSelectSortOption = (e)=>{
|
|
202
239
|
const select = e.composedPath()[0];
|
|
203
240
|
const option = this.options.find((option)=>option.expression === select.value);
|
|
204
241
|
option && this.sort.sortBy(option.criteria);
|
|
@@ -201,9 +201,9 @@ class AtomicSmartSnippet extends external_lit_namespaceObject.LitElement {
|
|
|
201
201
|
<atomic-smart-snippet-source
|
|
202
202
|
.source=${source}
|
|
203
203
|
.anchorAttributes=${(0, attributes_slot_cjs_namespaceObject.getAttributesFromLinkSlotContent)(this, 'source-anchor-attributes')}
|
|
204
|
-
@
|
|
205
|
-
@
|
|
206
|
-
@
|
|
204
|
+
@select-source=${this.smartSnippet.selectSource}
|
|
205
|
+
@begin-delayed-select-source=${this.smartSnippet.beginDelayedSelectSource}
|
|
206
|
+
@cancel-pending-select-source=${this.smartSnippet.cancelPendingSelectSource}
|
|
207
207
|
></atomic-smart-snippet-source>
|
|
208
208
|
`)}
|
|
209
209
|
${(0, smart_snippet_feedback_banner_cjs_namespaceObject.renderSmartSnippetFeedbackBanner)({
|
|
@@ -140,9 +140,9 @@ class AtomicSmartSnippetSuggestions extends external_lit_namespaceObject.LitElem
|
|
|
140
140
|
})((0, external_lit_namespaceObject.html)`
|
|
141
141
|
<atomic-smart-snippet-source
|
|
142
142
|
.anchorAttributes=${(0, attributes_slot_cjs_namespaceObject.getAttributesFromLinkSlotContent)(this, 'source-anchor-attributes')}
|
|
143
|
-
@
|
|
144
|
-
@
|
|
145
|
-
@
|
|
143
|
+
@begin-delayed-select-source=${()=>this.smartSnippetQuestionsList.beginDelayedSelectSource(questionAnswerId)}
|
|
144
|
+
@cancel-pending-select-source=${()=>this.smartSnippetQuestionsList.cancelPendingSelectSource(questionAnswerId)}
|
|
145
|
+
@select-source=${()=>this.smartSnippetQuestionsList.selectSource(questionAnswerId)}
|
|
146
146
|
.source=${source}
|
|
147
147
|
></atomic-smart-snippet-source>
|
|
148
148
|
`);
|
|
@@ -32,13 +32,14 @@ const lightSheet = new CSSStyleSheet();
|
|
|
32
32
|
lightSheet.replaceSync(':state(empty) { display: none }');
|
|
33
33
|
class HiddenStateController {
|
|
34
34
|
hostConnected() {
|
|
35
|
+
if (!this.internals) return;
|
|
35
36
|
const root = this.host.shadowRoot;
|
|
36
37
|
if (root) {
|
|
37
|
-
if (!root.adoptedStyleSheets.includes(shadowSheet)) root.adoptedStyleSheets.push(shadowSheet);
|
|
38
|
-
|
|
39
|
-
const parentRoot = this.host.getRootNode();
|
|
40
|
-
if (!parentRoot.adoptedStyleSheets.includes(lightSheet)) parentRoot.adoptedStyleSheets.push(lightSheet);
|
|
38
|
+
if (shadowSheet && !root.adoptedStyleSheets.includes(shadowSheet)) root.adoptedStyleSheets.push(shadowSheet);
|
|
39
|
+
return;
|
|
41
40
|
}
|
|
41
|
+
const parent = this.host.getRootNode();
|
|
42
|
+
if (lightSheet && (parent instanceof Document || parent instanceof ShadowRoot) && !parent.adoptedStyleSheets.includes(lightSheet)) parent.adoptedStyleSheets.push(lightSheet);
|
|
42
43
|
}
|
|
43
44
|
set isEmpty(value) {
|
|
44
45
|
if (value) this.internals.states.add('empty');
|
package/dist/cjs/versions.cjs
CHANGED
|
@@ -28,7 +28,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28
28
|
headlessVersion: ()=>package_json_namespaceObject.version
|
|
29
29
|
});
|
|
30
30
|
const package_json_namespaceObject = require("@coveo/headless/package.json");
|
|
31
|
-
const atomicVersion = "3.59.
|
|
31
|
+
const atomicVersion = "3.59.6";
|
|
32
32
|
exports.atomicVersion = __webpack_exports__.atomicVersion;
|
|
33
33
|
exports.headlessVersion = __webpack_exports__.headlessVersion;
|
|
34
34
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
@@ -108,7 +108,7 @@ class AtomicCommercePager extends LitElement {
|
|
|
108
108
|
}
|
|
109
109
|
announcePageLoaded() {
|
|
110
110
|
this.ariaMessage.message = this.bindings.i18n.t('pager-page-loaded', {
|
|
111
|
-
|
|
111
|
+
page: this.pagerState.page
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
constructor(){
|
|
@@ -96,6 +96,7 @@ class AtomicSmartSnippetExpandableAnswer extends LitElement {
|
|
|
96
96
|
@click=${()=>this.isExpanded ? this.handleCollapse() : this.handleExpand()}
|
|
97
97
|
class="text-primary mb-4 hover:underline"
|
|
98
98
|
part=${this.isExpanded ? 'show-less-button' : 'show-more-button'}
|
|
99
|
+
aria-expanded=${this.isExpanded ? 'true' : 'false'}
|
|
99
100
|
>
|
|
100
101
|
${this.bindings.i18n.t(this.isExpanded ? 'show-less' : 'show-more')}
|
|
101
102
|
<atomic-icon
|
|
@@ -43,6 +43,9 @@ const renderExpandableText = ({ props: { isExpanded, isTruncated, isCollapsible,
|
|
|
43
43
|
style: 'text-primary',
|
|
44
44
|
class: buttonClassString,
|
|
45
45
|
title: buttonLabel,
|
|
46
|
+
...isCollapsible && {
|
|
47
|
+
ariaExpanded: isExpanded ? 'true' : 'false'
|
|
48
|
+
},
|
|
46
49
|
onClick: onToggleExpand
|
|
47
50
|
}
|
|
48
51
|
})(html` <atomic-icon
|
|
@@ -2,13 +2,12 @@ import { shouldUpdateFacetSearchComponent } from "./facet-search-utils.js";
|
|
|
2
2
|
function announceFacetSearchResultsWithAriaLive(facet, label, setAriaLive, i18n) {
|
|
3
3
|
let prevState = facet.state.facetSearch;
|
|
4
4
|
facet.subscribe(()=>{
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
5
|
+
const nextState = facet.state.facetSearch;
|
|
6
|
+
if (shouldUpdateFacetSearchComponent(nextState, prevState) && nextState.query) setAriaLive(i18n.t('facet-search-results-count', {
|
|
7
|
+
count: nextState.values.length,
|
|
8
|
+
label
|
|
9
|
+
}));
|
|
10
|
+
prevState = nextState;
|
|
12
11
|
});
|
|
13
12
|
}
|
|
14
13
|
export { announceFacetSearchResultsWithAriaLive };
|
|
@@ -33,7 +33,7 @@ class GeneratedAnswerController {
|
|
|
33
33
|
const isHidden = !state.isVisible;
|
|
34
34
|
const isGenerating = !!state.isStreaming;
|
|
35
35
|
const hasNonEmptyAnswer = !!state.answer?.trim();
|
|
36
|
-
const hasError = !!state.error;
|
|
36
|
+
const hasError = !!state.error?.message;
|
|
37
37
|
if (isHidden) return bindings.i18n.t('generated-answer-hidden');
|
|
38
38
|
if (isGenerating) return bindings.i18n.t('generating-answer');
|
|
39
39
|
if (hasError) return bindings.i18n.t('answer-could-not-be-generated');
|
|
@@ -9,6 +9,7 @@ const renderShowButton = ({ props })=>html`${renderButton({
|
|
|
9
9
|
style: 'text-primary',
|
|
10
10
|
part: 'answer-show-button',
|
|
11
11
|
class: 'hidden items-center hover:bg-transparent',
|
|
12
|
+
ariaExpanded: props.isCollapsed ? 'false' : 'true',
|
|
12
13
|
onClick: props.onClick
|
|
13
14
|
}
|
|
14
15
|
})(html`
|
|
@@ -105,7 +105,7 @@ class AtomicInsightPager extends LitElement {
|
|
|
105
105
|
}
|
|
106
106
|
announcePageLoaded() {
|
|
107
107
|
this.ariaMessage.message = this.bindings.i18n.t('pager-page-loaded', {
|
|
108
|
-
|
|
108
|
+
page: this.pagerState.currentPage
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
111
|
constructor(){
|
|
@@ -101,9 +101,9 @@ class AtomicInsightSmartSnippetSuggestions extends LitElement {
|
|
|
101
101
|
})(html`
|
|
102
102
|
<atomic-smart-snippet-source
|
|
103
103
|
.anchorAttributes=${getAttributesFromLinkSlotContent(this, 'source-anchor-attributes')}
|
|
104
|
-
@
|
|
105
|
-
@
|
|
106
|
-
@
|
|
104
|
+
@begin-delayed-select-source=${()=>this.smartSnippetQuestionsList.beginDelayedSelectSource(questionAnswerId)}
|
|
105
|
+
@cancel-pending-select-source=${()=>this.smartSnippetQuestionsList.cancelPendingSelectSource(questionAnswerId)}
|
|
106
|
+
@select-source=${()=>this.smartSnippetQuestionsList.selectSource(questionAnswerId)}
|
|
107
107
|
.source=${source}
|
|
108
108
|
></atomic-smart-snippet-source>
|
|
109
109
|
`);
|