@coveo/atomic 3.59.2 → 3.59.4
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 +536 -81
- package/dist/cjs/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.cjs +1 -0
- package/dist/cjs/components/insight/atomic-insight-search-box/atomic-insight-search-box.cjs +1 -0
- package/dist/cjs/components/insight/atomic-insight-tab/atomic-insight-tab.cjs +66 -22
- package/dist/cjs/components/insight/atomic-insight-tabs/atomic-insight-tabs.cjs +3 -1
- package/dist/cjs/components/ipx/atomic-ipx-tab/atomic-ipx-tab.cjs +66 -30
- package/dist/cjs/components/ipx/atomic-ipx-tabs/atomic-ipx-tabs.cjs +3 -1
- package/dist/cjs/components/search/atomic-search-box/atomic-search-box.cjs +1 -0
- package/dist/cjs/generated/dayjs-locales-data.cjs +6 -6
- package/dist/cjs/global/environment.cjs +1 -1
- package/dist/cjs/utils/hidden-state-controller.cjs +63 -0
- package/dist/cjs/versions.cjs +1 -1
- package/dist/esm/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.js +1 -0
- package/dist/esm/components/insight/atomic-insight-search-box/atomic-insight-search-box.js +1 -0
- package/dist/esm/components/insight/atomic-insight-tab/atomic-insight-tab.js +51 -20
- package/dist/esm/components/insight/atomic-insight-tabs/atomic-insight-tabs.js +3 -1
- package/dist/esm/components/ipx/atomic-ipx-tab/atomic-ipx-tab.js +52 -29
- package/dist/esm/components/ipx/atomic-ipx-tabs/atomic-ipx-tabs.js +3 -1
- package/dist/esm/components/search/atomic-search-box/atomic-search-box.js +1 -0
- package/dist/esm/generated/dayjs-locales-data.js +6 -6
- package/dist/esm/global/environment.js +1 -1
- package/dist/esm/utils/hidden-state-controller.js +29 -0
- package/dist/esm/versions.js +1 -1
- package/dist/types/components/insight/atomic-insight-smart-snippet-feedback-modal/atomic-insight-smart-snippet-feedback-modal.d.ts +0 -2
- package/dist/types/components/insight/atomic-insight-tab/atomic-insight-tab.d.ts +5 -0
- package/dist/types/components/insight/atomic-insight-user-actions-modal/atomic-insight-user-actions-modal.d.ts +0 -2
- package/dist/types/components/ipx/atomic-ipx-tab/atomic-ipx-tab.d.ts +6 -1
- package/package.json +13 -13
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { buildTab } from "@coveo/headless";
|
|
2
|
-
import { LitElement, css, html
|
|
2
|
+
import { LitElement, css, html } from "lit";
|
|
3
3
|
import { customElement, property, state } from "lit/decorators.js";
|
|
4
4
|
import { when } from "lit/directives/when.js";
|
|
5
|
-
import { renderButton } from "../../common/button.js";
|
|
6
5
|
import { createAppLoadedListener } from "../../common/interface/store.js";
|
|
7
6
|
import { dispatchTabLoaded } from "../../common/tabs/tab-common.js";
|
|
8
7
|
import { bindStateToController } from "../../../decorators/bind-state.js";
|
|
@@ -18,6 +17,17 @@ function _ts_metadata(k, v) {
|
|
|
18
17
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
19
18
|
}
|
|
20
19
|
class AtomicIpxTab extends LitElement {
|
|
20
|
+
connectedCallback() {
|
|
21
|
+
super.connectedCallback();
|
|
22
|
+
this.addEventListener('click', this.handleClick);
|
|
23
|
+
this.addEventListener('keydown', this.handleKeydown);
|
|
24
|
+
this.updateHostAttributes();
|
|
25
|
+
}
|
|
26
|
+
disconnectedCallback() {
|
|
27
|
+
super.disconnectedCallback();
|
|
28
|
+
this.removeEventListener('click', this.handleClick);
|
|
29
|
+
this.removeEventListener('keydown', this.handleKeydown);
|
|
30
|
+
}
|
|
21
31
|
initialize() {
|
|
22
32
|
this.tab = buildTab(this.bindings.engine, {
|
|
23
33
|
options: {
|
|
@@ -33,42 +43,55 @@ class AtomicIpxTab extends LitElement {
|
|
|
33
43
|
});
|
|
34
44
|
}
|
|
35
45
|
select() {
|
|
36
|
-
this.tab
|
|
46
|
+
this.tab?.select();
|
|
37
47
|
}
|
|
38
48
|
updated() {
|
|
39
|
-
if (this.tabState)
|
|
49
|
+
if (this.tabState) {
|
|
50
|
+
this.active = this.tabState.isActive;
|
|
51
|
+
this.updateHostAttributes();
|
|
52
|
+
}
|
|
40
53
|
dispatchTabLoaded(this);
|
|
41
54
|
}
|
|
55
|
+
updateHostAttributes() {
|
|
56
|
+
this.setAttribute('role', 'tab');
|
|
57
|
+
this.setAttribute('aria-selected', this.active ? 'true' : 'false');
|
|
58
|
+
this.tabIndex = this.active ? 0 : -1;
|
|
59
|
+
}
|
|
42
60
|
render() {
|
|
43
|
-
return
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
'pb-3',
|
|
47
|
-
'mt-1',
|
|
48
|
-
'mr-6',
|
|
49
|
-
'font-semibold'
|
|
50
|
-
];
|
|
51
|
-
if (this.tabState.isActive) buttonClasses.push('active');
|
|
52
|
-
return renderButton({
|
|
53
|
-
props: {
|
|
54
|
-
style: 'text-transparent',
|
|
55
|
-
part: 'tab',
|
|
56
|
-
class: buttonClasses.join(' '),
|
|
57
|
-
ariaLabel: this.bindings.i18n.t('tab-search', {
|
|
58
|
-
label: this.label
|
|
59
|
-
}),
|
|
60
|
-
title: this.label,
|
|
61
|
-
ariaPressed: this.tabState.isActive ? 'true' : 'false',
|
|
62
|
-
onClick: ()=>this.tab.select()
|
|
63
|
-
}
|
|
64
|
-
})(html`${this.label}`);
|
|
65
|
-
}, ()=>nothing);
|
|
61
|
+
return html`<span part="tab" title=${this.label}
|
|
62
|
+
>${when(this.isAppLoaded, ()=>this.label)}</span
|
|
63
|
+
>`;
|
|
66
64
|
}
|
|
67
65
|
constructor(...args){
|
|
68
|
-
super(...args), this.label = 'no-label', this.active = false, this.isAppLoaded = false
|
|
66
|
+
super(...args), this.label = 'no-label', this.active = false, this.isAppLoaded = false, this.handleClick = ()=>{
|
|
67
|
+
this.tab?.select();
|
|
68
|
+
}, this.handleKeydown = (event)=>{
|
|
69
|
+
if ('Enter' === event.key || ' ' === event.key) {
|
|
70
|
+
event.preventDefault();
|
|
71
|
+
this.tab?.select();
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const tablist = this.closest('[role="tablist"]');
|
|
75
|
+
if (!tablist) return;
|
|
76
|
+
const tabs = Array.from(tablist.querySelectorAll('[role="tab"]'));
|
|
77
|
+
const currentIndex = tabs.indexOf(this);
|
|
78
|
+
if (-1 === currentIndex) return;
|
|
79
|
+
let nextIndex = null;
|
|
80
|
+
if ('ArrowRight' === event.key) nextIndex = (currentIndex + 1) % tabs.length;
|
|
81
|
+
else if ('ArrowLeft' === event.key) nextIndex = (currentIndex - 1 + tabs.length) % tabs.length;
|
|
82
|
+
else if ('Home' === event.key) nextIndex = 0;
|
|
83
|
+
else if ('End' === event.key) nextIndex = tabs.length - 1;
|
|
84
|
+
if (null !== nextIndex) {
|
|
85
|
+
event.preventDefault();
|
|
86
|
+
tabs.forEach((tab, index)=>{
|
|
87
|
+
tab.tabIndex = index === nextIndex ? 0 : -1;
|
|
88
|
+
});
|
|
89
|
+
tabs[nextIndex].focus();
|
|
90
|
+
}
|
|
91
|
+
};
|
|
69
92
|
}
|
|
70
93
|
}
|
|
71
|
-
AtomicIpxTab.styles = css`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com
|
|
94
|
+
AtomicIpxTab.styles = css`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-font-weight:initial}}}:host{cursor:pointer;display:flex}:host:focus-visible{--tw-outline-style:none;outline-style:none}[part=tab]{margin-right:calc(var(--spacing,.25rem)*6);margin-top:calc(var(--spacing,.25rem)*1);padding-bottom:calc(var(--spacing,.25rem)*3);--tw-font-weight:var(--font-weight-semibold,600);color:var(--atomic-on-background);font-weight:var(--font-weight-semibold,600);max-width:150px;overflow:hidden;position:relative;text-overflow:ellipsis}:host(:focus-visible) [part=tab],:host(:hover) [part=tab]{color:var(--atomic-primary)}:host([active]) [part=tab]:after{background-color:var(--atomic-primary);border-radius:var(--atomic-border-radius);bottom:calc(var(--spacing,.25rem)*0);content:"";display:block;height:calc(var(--spacing,.25rem)*1);position:absolute;width:100%}@property --tw-font-weight{syntax:"*";inherits:false}`;
|
|
72
95
|
_ts_decorate([
|
|
73
96
|
property({
|
|
74
97
|
type: String,
|
|
@@ -17,7 +17,9 @@ class AtomicIpxTabs extends LightDomMixin(SlotsForNoShadowDOMMixin(LitElement))
|
|
|
17
17
|
initialize() {}
|
|
18
18
|
render() {
|
|
19
19
|
return html`<atomic-tab-bar
|
|
20
|
-
|
|
20
|
+
><div role="tablist" style="display:flex;flex-direction:row;width:100%">
|
|
21
|
+
${this.renderDefaultSlotContent()}
|
|
22
|
+
</div></atomic-tab-bar
|
|
21
23
|
>`;
|
|
22
24
|
}
|
|
23
25
|
}
|
|
@@ -25,11 +25,11 @@ const locales = {
|
|
|
25
25
|
cy: ()=>import("dayjs/locale/cy"),
|
|
26
26
|
da: ()=>import("dayjs/locale/da"),
|
|
27
27
|
'de-AT': ()=>import("dayjs/locale/de-at"),
|
|
28
|
-
'de-CH': ()=>import("dayjs/locale/de-ch"),
|
|
29
28
|
de: ()=>import("dayjs/locale/de"),
|
|
29
|
+
'de-CH': ()=>import("dayjs/locale/de-ch"),
|
|
30
30
|
dv: ()=>import("dayjs/locale/dv"),
|
|
31
|
-
el: ()=>import("dayjs/locale/el"),
|
|
32
31
|
'en-AU': ()=>import("dayjs/locale/en-au"),
|
|
32
|
+
el: ()=>import("dayjs/locale/el"),
|
|
33
33
|
'en-CA': ()=>import("dayjs/locale/en-ca"),
|
|
34
34
|
'en-GB': ()=>import("dayjs/locale/en-gb"),
|
|
35
35
|
'en-IE': ()=>import("dayjs/locale/en-ie"),
|
|
@@ -55,9 +55,9 @@ const locales = {
|
|
|
55
55
|
fr: ()=>import("dayjs/locale/fr"),
|
|
56
56
|
fy: ()=>import("dayjs/locale/fy"),
|
|
57
57
|
ga: ()=>import("dayjs/locale/ga"),
|
|
58
|
-
gd: ()=>import("dayjs/locale/gd"),
|
|
59
58
|
gl: ()=>import("dayjs/locale/gl"),
|
|
60
59
|
'gom-LATN': ()=>import("dayjs/locale/gom-latn"),
|
|
60
|
+
gd: ()=>import("dayjs/locale/gd"),
|
|
61
61
|
gu: ()=>import("dayjs/locale/gu"),
|
|
62
62
|
he: ()=>import("dayjs/locale/he"),
|
|
63
63
|
hi: ()=>import("dayjs/locale/hi"),
|
|
@@ -122,14 +122,14 @@ const locales = {
|
|
|
122
122
|
te: ()=>import("dayjs/locale/te"),
|
|
123
123
|
tet: ()=>import("dayjs/locale/tet"),
|
|
124
124
|
tg: ()=>import("dayjs/locale/tg"),
|
|
125
|
-
th: ()=>import("dayjs/locale/th"),
|
|
126
125
|
tk: ()=>import("dayjs/locale/tk"),
|
|
126
|
+
th: ()=>import("dayjs/locale/th"),
|
|
127
127
|
'tl-PH': ()=>import("dayjs/locale/tl-ph"),
|
|
128
|
-
tlh: ()=>import("dayjs/locale/tlh"),
|
|
129
128
|
tr: ()=>import("dayjs/locale/tr"),
|
|
130
|
-
|
|
129
|
+
tlh: ()=>import("dayjs/locale/tlh"),
|
|
131
130
|
'tzm-LATN': ()=>import("dayjs/locale/tzm-latn"),
|
|
132
131
|
tzm: ()=>import("dayjs/locale/tzm"),
|
|
132
|
+
tzl: ()=>import("dayjs/locale/tzl"),
|
|
133
133
|
'ug-CN': ()=>import("dayjs/locale/ug-cn"),
|
|
134
134
|
uk: ()=>import("dayjs/locale/uk"),
|
|
135
135
|
ur: ()=>import("dayjs/locale/ur"),
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const shadowSheet = new CSSStyleSheet();
|
|
2
|
+
shadowSheet.replaceSync(':host(:state(empty)) { display: none }');
|
|
3
|
+
const lightSheet = new CSSStyleSheet();
|
|
4
|
+
lightSheet.replaceSync(':state(empty) { display: none }');
|
|
5
|
+
class HiddenStateController {
|
|
6
|
+
hostConnected() {
|
|
7
|
+
const root = this.host.shadowRoot;
|
|
8
|
+
if (root) {
|
|
9
|
+
if (!root.adoptedStyleSheets.includes(shadowSheet)) root.adoptedStyleSheets.push(shadowSheet);
|
|
10
|
+
} else {
|
|
11
|
+
const parentRoot = this.host.getRootNode();
|
|
12
|
+
if (!parentRoot.adoptedStyleSheets.includes(lightSheet)) parentRoot.adoptedStyleSheets.push(lightSheet);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
set isEmpty(value) {
|
|
16
|
+
if (value) this.internals.states.add('empty');
|
|
17
|
+
else this.internals.states.delete('empty');
|
|
18
|
+
}
|
|
19
|
+
get isEmpty() {
|
|
20
|
+
return this.internals.states.has('empty');
|
|
21
|
+
}
|
|
22
|
+
constructor(host){
|
|
23
|
+
this.host = host;
|
|
24
|
+
this.internals = host.attachInternals();
|
|
25
|
+
this.internals.states.add('empty');
|
|
26
|
+
host.addController(this);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export { HiddenStateController };
|
package/dist/esm/versions.js
CHANGED
|
@@ -7,8 +7,6 @@ import type { InitializableComponent } from '../../../decorators/types';
|
|
|
7
7
|
*
|
|
8
8
|
* When the modal is opened, the class `atomic-modal-opened` is added to the body, allowing further customization.
|
|
9
9
|
*
|
|
10
|
-
* @internal
|
|
11
|
-
*
|
|
12
10
|
* @part backdrop - The transparent backdrop hiding the content behind the modal.
|
|
13
11
|
* @part container - The modal's outermost container with the outline and background.
|
|
14
12
|
* @part header-wrapper - The wrapper around the header.
|
|
@@ -29,12 +29,17 @@ export declare class AtomicInsightTab extends LitElement implements TabCommon, I
|
|
|
29
29
|
tab: InsightTab;
|
|
30
30
|
private isAppLoaded;
|
|
31
31
|
private tabId;
|
|
32
|
+
connectedCallback(): void;
|
|
33
|
+
disconnectedCallback(): void;
|
|
32
34
|
initialize(): void;
|
|
33
35
|
/**
|
|
34
36
|
* Activates the tab.
|
|
35
37
|
*/
|
|
36
38
|
select(): void;
|
|
37
39
|
protected updated(): void;
|
|
40
|
+
private updateHostAttributes;
|
|
41
|
+
private handleClick;
|
|
42
|
+
private handleKeydown;
|
|
38
43
|
render(): import("lit-html").TemplateResult<1>;
|
|
39
44
|
}
|
|
40
45
|
declare global {
|
|
@@ -8,8 +8,6 @@ import type { InitializableComponent } from '../../../decorators/types';
|
|
|
8
8
|
*
|
|
9
9
|
* When the modal is opened, the CSS class `atomic-modal-opened` is added to the interface element and the body, allowing further customization.
|
|
10
10
|
*
|
|
11
|
-
* @internal
|
|
12
|
-
*
|
|
13
11
|
* @part title - The title element displaying "user-actions" text.
|
|
14
12
|
* @part close-button - The button used to close the modal.
|
|
15
13
|
* @part close-icon - The close icon within the close button.
|
|
@@ -28,13 +28,18 @@ export declare class AtomicIpxTab extends LitElement implements TabCommon, Initi
|
|
|
28
28
|
private tabState;
|
|
29
29
|
tab: Tab;
|
|
30
30
|
private isAppLoaded;
|
|
31
|
+
connectedCallback(): void;
|
|
32
|
+
disconnectedCallback(): void;
|
|
31
33
|
initialize(): void;
|
|
32
34
|
/**
|
|
33
35
|
* Activates the tab.
|
|
34
36
|
*/
|
|
35
37
|
select(): void;
|
|
36
38
|
protected updated(): void;
|
|
37
|
-
|
|
39
|
+
private updateHostAttributes;
|
|
40
|
+
private handleClick;
|
|
41
|
+
private handleKeydown;
|
|
42
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
38
43
|
}
|
|
39
44
|
declare global {
|
|
40
45
|
interface HTMLElementTagNameMap {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coveo/atomic",
|
|
3
|
-
"version": "3.59.
|
|
3
|
+
"version": "3.59.4",
|
|
4
4
|
"description": "A web-component library for building modern UIs interfacing with the Coveo platform",
|
|
5
5
|
"homepage": "https://docs.coveo.com/en/atomic/latest/",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -55,23 +55,23 @@
|
|
|
55
55
|
"./custom-elements-manifest": "./custom-elements.json"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@coveo/relay-event-types": "19.
|
|
58
|
+
"@coveo/relay-event-types": "19.13.0",
|
|
59
59
|
"@lit/context": "1.1.6",
|
|
60
60
|
"@open-wc/lit-helpers": "0.7.0",
|
|
61
61
|
"@popperjs/core": "2.11.8",
|
|
62
62
|
"@salesforce-ux/design-system": "2.30.3",
|
|
63
63
|
"@stencil/core": "4.20.0",
|
|
64
64
|
"cssnano": "7.1.9",
|
|
65
|
-
"dayjs": "1.11.
|
|
65
|
+
"dayjs": "1.11.21",
|
|
66
66
|
"dompurify": "3.4.5",
|
|
67
67
|
"escape-html": "1.0.3",
|
|
68
68
|
"i18next": "25.10.10",
|
|
69
69
|
"i18next-http-backend": "3.0.6",
|
|
70
70
|
"lit": "3.3.3",
|
|
71
71
|
"marked": "12.0.2",
|
|
72
|
-
"@coveo/atomic-legacy": "0.0.
|
|
72
|
+
"@coveo/atomic-legacy": "0.0.20",
|
|
73
73
|
"@coveo/bueno": "1.1.9",
|
|
74
|
-
"@coveo/headless": "3.51.
|
|
74
|
+
"@coveo/headless": "3.51.4"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@ag-ui/client": "0.0.53",
|
|
@@ -79,12 +79,12 @@
|
|
|
79
79
|
"@playwright/test": "1.60.0",
|
|
80
80
|
"@rollup/plugin-replace": "6.0.3",
|
|
81
81
|
"@rslib/core": "0.21.5",
|
|
82
|
-
"@storybook/addon-a11y": "10.4.
|
|
83
|
-
"@storybook/addon-docs": "10.4.
|
|
82
|
+
"@storybook/addon-a11y": "10.4.1",
|
|
83
|
+
"@storybook/addon-docs": "10.4.1",
|
|
84
84
|
"@storybook/addon-mcp": "0.6.0",
|
|
85
|
-
"@storybook/addon-vitest": "10.4.
|
|
85
|
+
"@storybook/addon-vitest": "10.4.1",
|
|
86
86
|
"@storybook/icons": "2.0.2",
|
|
87
|
-
"@storybook/web-components-vite": "10.4.
|
|
87
|
+
"@storybook/web-components-vite": "10.4.1",
|
|
88
88
|
"@tailwindcss/postcss": "4.3.0",
|
|
89
89
|
"@tailwindcss/vite": "4.3.0",
|
|
90
90
|
"@types/escape-html": "1.0.4",
|
|
@@ -102,23 +102,23 @@
|
|
|
102
102
|
"postcss": "8.5.15",
|
|
103
103
|
"postcss-load-config": "6.0.1",
|
|
104
104
|
"prettier": "3.8.3",
|
|
105
|
-
"puppeteer": "24.
|
|
105
|
+
"puppeteer": "24.43.1",
|
|
106
106
|
"react": "19.2.6",
|
|
107
107
|
"remark-gfm": "4.0.1",
|
|
108
108
|
"shadow-dom-testing-library": "1.13.1",
|
|
109
|
-
"storybook": "10.4.
|
|
109
|
+
"storybook": "10.4.1",
|
|
110
110
|
"tailwindcss": "4.3.0",
|
|
111
111
|
"ts-dedent": "2.2.0",
|
|
112
112
|
"ts-lit-plugin": "2.0.2",
|
|
113
113
|
"typescript": "6.0.3",
|
|
114
|
-
"vite": "8.0.
|
|
114
|
+
"vite": "8.0.14",
|
|
115
115
|
"vitest": "4.1.7",
|
|
116
116
|
"@coveo/atomic-a11y": "1.0.0"
|
|
117
117
|
},
|
|
118
118
|
"peerDependencies": {
|
|
119
119
|
"typescript": ">=5.0.0",
|
|
120
120
|
"@coveo/bueno": "^1.1.9",
|
|
121
|
-
"@coveo/headless": "^3.51.
|
|
121
|
+
"@coveo/headless": "^3.51.4"
|
|
122
122
|
},
|
|
123
123
|
"peerDependenciesMeta": {
|
|
124
124
|
"typescript": {
|