@carbon/ai-chat-components 1.13.0 → 1.14.0-rc.1

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.
Files changed (206) hide show
  1. package/custom-elements.json +1147 -462
  2. package/es/components/audio-player/src/audio-player.scss.js +1 -1
  3. package/es/components/audio-player/src/transcript.js +15 -0
  4. package/es/components/audio-player/src/transcript.js.map +1 -1
  5. package/es/components/card/src/card-footer.scss.js +1 -1
  6. package/es/components/card/src/card-steps.scss.js +1 -1
  7. package/es/components/card/src/card.scss.js +1 -1
  8. package/es/components/chat-button/src/chat-button.scss.js +1 -1
  9. package/es/components/chat-history/src/chat-history.scss.js +1 -1
  10. package/es/components/chat-history/src/history-header.js +1 -0
  11. package/es/components/chat-history/src/history-header.js.map +1 -1
  12. package/es/components/chat-history/src/history-toolbar.js +4 -1
  13. package/es/components/chat-history/src/history-toolbar.js.map +1 -1
  14. package/es/components/chat-shell/src/shell.scss.js +1 -1
  15. package/es/components/code-snippet/src/code-snippet.d.ts +3 -2
  16. package/es/components/code-snippet/src/code-snippet.js +4 -3
  17. package/es/components/code-snippet/src/code-snippet.js.map +1 -1
  18. package/es/components/code-snippet/src/code-snippet.scss.js +1 -1
  19. package/es/components/feedback/src/feedback.js +17 -3
  20. package/es/components/feedback/src/feedback.js.map +1 -1
  21. package/es/components/file-uploads/src/file-upload-item.scss.js +1 -1
  22. package/es/components/file-uploads/src/file-uploads.scss.js +1 -1
  23. package/es/components/launcher/src/launcher.scss.js +1 -1
  24. package/es/components/markdown/__tests__/inline-selection-fixture.d.ts +13 -0
  25. package/es/components/markdown/index.d.ts +2 -0
  26. package/es/components/markdown/index.js +3 -0
  27. package/es/components/markdown/index.js.map +1 -1
  28. package/es/components/markdown/src/inline-markdown.d.ts +41 -0
  29. package/es/components/markdown/src/inline-markdown.js +92 -0
  30. package/es/components/markdown/src/inline-markdown.js.map +1 -0
  31. package/es/components/markdown/src/inline-markdown.scss.js +13 -0
  32. package/es/components/markdown/src/inline-markdown.scss.js.map +1 -0
  33. package/es/components/markdown/src/inline-run-projection.scss.js +13 -0
  34. package/es/components/markdown/src/inline-run-projection.scss.js.map +1 -0
  35. package/es/components/markdown/src/markdown-renderer-types.d.ts +132 -0
  36. package/es/components/markdown/src/markdown-renderer.js +131 -25
  37. package/es/components/markdown/src/markdown-renderer.js.map +1 -1
  38. package/es/components/markdown/src/markdown.js +1 -0
  39. package/es/components/markdown/src/markdown.js.map +1 -1
  40. package/es/components/markdown/src/markdown.scss.js +1 -1
  41. package/es/components/markdown/src/utils/inline-run-projection.d.ts +15 -0
  42. package/es/components/markdown/src/utils/inline-run-projection.js +196 -0
  43. package/es/components/markdown/src/utils/inline-run-projection.js.map +1 -0
  44. package/es/components/markdown/src/utils/inline-validation.d.ts +13 -0
  45. package/es/components/markdown/src/utils/inline-validation.js +97 -0
  46. package/es/components/markdown/src/utils/inline-validation.js.map +1 -0
  47. package/es/components/markdown/src/utils/plugin-fallback.js +20 -13
  48. package/es/components/markdown/src/utils/plugin-fallback.js.map +1 -1
  49. package/es/components/markdown/src/utils/plugin-host-container.d.ts +5 -6
  50. package/es/components/markdown/src/utils/plugin-host-container.js.map +1 -1
  51. package/es/components/messages-shell/index.d.ts +11 -0
  52. package/es/components/messages-shell/index.js +9 -0
  53. package/es/components/messages-shell/index.js.map +1 -0
  54. package/es/components/messages-shell/src/messages-shell.d.ts +57 -0
  55. package/es/components/messages-shell/src/messages-shell.js +141 -0
  56. package/es/components/messages-shell/src/messages-shell.js.map +1 -0
  57. package/es/components/messages-shell/src/messages-shell.scss.js +13 -0
  58. package/es/components/messages-shell/src/messages-shell.scss.js.map +1 -0
  59. package/es/components/processing/src/processing.scss.js +1 -1
  60. package/es/components/prompt-line/autocomplete/src/autocomplete.d.ts +26 -9
  61. package/es/components/prompt-line/autocomplete/src/autocomplete.js +116 -107
  62. package/es/components/prompt-line/autocomplete/src/autocomplete.js.map +1 -1
  63. package/es/components/prompt-line/autocomplete/src/autocomplete.scss.js +1 -1
  64. package/es/components/prompt-line/src/autocomplete-controller-element.js +13 -1
  65. package/es/components/prompt-line/src/autocomplete-controller-element.js.map +1 -1
  66. package/es/components/prompt-line/src/autocomplete-controller.js +9 -2
  67. package/es/components/prompt-line/src/autocomplete-controller.js.map +1 -1
  68. package/es/components/prompt-line/src/prompt-line-controller.d.ts +7 -0
  69. package/es/components/prompt-line/src/prompt-line-rich-runtime.js +17 -0
  70. package/es/components/prompt-line/src/prompt-line-rich-runtime.js.map +1 -1
  71. package/es/components/prompt-line/src/prompt-line-shell.scss.js +1 -1
  72. package/es/components/prompt-line/src/prompt-line-textarea-runtime.d.ts +1 -0
  73. package/es/components/prompt-line/src/prompt-line-textarea-runtime.js +3 -0
  74. package/es/components/prompt-line/src/prompt-line-textarea-runtime.js.map +1 -1
  75. package/es/components/prompt-line/src/prompt-line.d.ts +7 -0
  76. package/es/components/prompt-line/src/prompt-line.js +9 -0
  77. package/es/components/prompt-line/src/prompt-line.js.map +1 -1
  78. package/es/components/prompt-line/src/send-control.scss.js +1 -1
  79. package/es/components/prompt-line/src/stop-streaming-button.scss.js +1 -1
  80. package/es/components/prompt-line/src/tiptap/carbon-mention.js +43 -21
  81. package/es/components/prompt-line/src/tiptap/carbon-mention.js.map +1 -1
  82. package/es/components/prompt-line/src/tiptap/plain-text-paste.js +8 -3
  83. package/es/components/prompt-line/src/tiptap/plain-text-paste.js.map +1 -1
  84. package/es/components/prompt-line/src/tiptap/strip-presentation-fields.d.ts +3 -3
  85. package/es/components/prompt-line/src/tiptap/strip-presentation-fields.js.map +1 -1
  86. package/es/components/prompt-line/src/tiptap/types.d.ts +27 -11
  87. package/es/components/reasoning-steps/src/reasoning-step.d.ts +3 -3
  88. package/es/components/reasoning-steps/src/reasoning-step.js +4 -4
  89. package/es/components/reasoning-steps/src/reasoning-step.js.map +1 -1
  90. package/es/components/reasoning-steps/src/reasoning-step.scss.js +1 -1
  91. package/es/components/reasoning-steps/src/reasoning-steps-toggle.scss.js +1 -1
  92. package/es/components/reasoning-steps/src/reasoning-steps.d.ts +5 -4
  93. package/es/components/reasoning-steps/src/reasoning-steps.js +5 -4
  94. package/es/components/reasoning-steps/src/reasoning-steps.js.map +1 -1
  95. package/es/components/truncated-text/src/truncated-text.scss.js +1 -1
  96. package/es/components/video-player/src/video-player.scss.js +1 -1
  97. package/es/globals/scss/common.scss.js +1 -1
  98. package/es/react/hooks/useChatAutocomplete.js +7 -1
  99. package/es/react/hooks/useChatAutocomplete.js.map +1 -1
  100. package/es/react/messages-shell.d.ts +3 -0
  101. package/es/react/messages-shell.js +32 -0
  102. package/es/react/messages-shell.js.map +1 -0
  103. package/es-custom/components/audio-player/src/audio-player.scss.js +1 -1
  104. package/es-custom/components/audio-player/src/transcript.js +15 -0
  105. package/es-custom/components/audio-player/src/transcript.js.map +1 -1
  106. package/es-custom/components/card/src/card-footer.scss.js +1 -1
  107. package/es-custom/components/card/src/card-steps.scss.js +1 -1
  108. package/es-custom/components/card/src/card.scss.js +1 -1
  109. package/es-custom/components/chat-button/src/chat-button.scss.js +1 -1
  110. package/es-custom/components/chat-history/src/chat-history.scss.js +1 -1
  111. package/es-custom/components/chat-history/src/history-header.js +1 -0
  112. package/es-custom/components/chat-history/src/history-header.js.map +1 -1
  113. package/es-custom/components/chat-history/src/history-toolbar.js +4 -1
  114. package/es-custom/components/chat-history/src/history-toolbar.js.map +1 -1
  115. package/es-custom/components/chat-shell/src/shell.scss.js +1 -1
  116. package/es-custom/components/code-snippet/src/code-snippet.d.ts +3 -2
  117. package/es-custom/components/code-snippet/src/code-snippet.js +4 -3
  118. package/es-custom/components/code-snippet/src/code-snippet.js.map +1 -1
  119. package/es-custom/components/code-snippet/src/code-snippet.scss.js +1 -1
  120. package/es-custom/components/feedback/src/feedback.js +17 -3
  121. package/es-custom/components/feedback/src/feedback.js.map +1 -1
  122. package/es-custom/components/file-uploads/src/file-upload-item.scss.js +1 -1
  123. package/es-custom/components/file-uploads/src/file-uploads.scss.js +1 -1
  124. package/es-custom/components/launcher/src/launcher.scss.js +1 -1
  125. package/es-custom/components/markdown/__tests__/inline-selection-fixture.d.ts +13 -0
  126. package/es-custom/components/markdown/index.d.ts +2 -0
  127. package/es-custom/components/markdown/index.js +3 -0
  128. package/es-custom/components/markdown/index.js.map +1 -1
  129. package/es-custom/components/markdown/src/inline-markdown.d.ts +41 -0
  130. package/es-custom/components/markdown/src/inline-markdown.js +92 -0
  131. package/es-custom/components/markdown/src/inline-markdown.js.map +1 -0
  132. package/es-custom/components/markdown/src/inline-markdown.scss.js +13 -0
  133. package/es-custom/components/markdown/src/inline-markdown.scss.js.map +1 -0
  134. package/es-custom/components/markdown/src/inline-run-projection.scss.js +13 -0
  135. package/es-custom/components/markdown/src/inline-run-projection.scss.js.map +1 -0
  136. package/es-custom/components/markdown/src/markdown-renderer-types.d.ts +132 -0
  137. package/es-custom/components/markdown/src/markdown-renderer.js +131 -25
  138. package/es-custom/components/markdown/src/markdown-renderer.js.map +1 -1
  139. package/es-custom/components/markdown/src/markdown.js +1 -0
  140. package/es-custom/components/markdown/src/markdown.js.map +1 -1
  141. package/es-custom/components/markdown/src/markdown.scss.js +1 -1
  142. package/es-custom/components/markdown/src/utils/inline-run-projection.d.ts +15 -0
  143. package/es-custom/components/markdown/src/utils/inline-run-projection.js +196 -0
  144. package/es-custom/components/markdown/src/utils/inline-run-projection.js.map +1 -0
  145. package/es-custom/components/markdown/src/utils/inline-validation.d.ts +13 -0
  146. package/es-custom/components/markdown/src/utils/inline-validation.js +97 -0
  147. package/es-custom/components/markdown/src/utils/inline-validation.js.map +1 -0
  148. package/es-custom/components/markdown/src/utils/plugin-fallback.js +20 -13
  149. package/es-custom/components/markdown/src/utils/plugin-fallback.js.map +1 -1
  150. package/es-custom/components/markdown/src/utils/plugin-host-container.d.ts +5 -6
  151. package/es-custom/components/markdown/src/utils/plugin-host-container.js.map +1 -1
  152. package/es-custom/components/messages-shell/index.d.ts +11 -0
  153. package/es-custom/components/messages-shell/index.js +9 -0
  154. package/es-custom/components/messages-shell/index.js.map +1 -0
  155. package/es-custom/components/messages-shell/src/messages-shell.d.ts +57 -0
  156. package/es-custom/components/messages-shell/src/messages-shell.js +141 -0
  157. package/es-custom/components/messages-shell/src/messages-shell.js.map +1 -0
  158. package/es-custom/components/messages-shell/src/messages-shell.scss.js +13 -0
  159. package/es-custom/components/messages-shell/src/messages-shell.scss.js.map +1 -0
  160. package/es-custom/components/processing/src/processing.scss.js +1 -1
  161. package/es-custom/components/prompt-line/autocomplete/src/autocomplete.d.ts +26 -9
  162. package/es-custom/components/prompt-line/autocomplete/src/autocomplete.js +116 -107
  163. package/es-custom/components/prompt-line/autocomplete/src/autocomplete.js.map +1 -1
  164. package/es-custom/components/prompt-line/autocomplete/src/autocomplete.scss.js +1 -1
  165. package/es-custom/components/prompt-line/src/autocomplete-controller-element.js +13 -1
  166. package/es-custom/components/prompt-line/src/autocomplete-controller-element.js.map +1 -1
  167. package/es-custom/components/prompt-line/src/autocomplete-controller.js +9 -2
  168. package/es-custom/components/prompt-line/src/autocomplete-controller.js.map +1 -1
  169. package/es-custom/components/prompt-line/src/prompt-line-controller.d.ts +7 -0
  170. package/es-custom/components/prompt-line/src/prompt-line-rich-runtime.js +17 -0
  171. package/es-custom/components/prompt-line/src/prompt-line-rich-runtime.js.map +1 -1
  172. package/es-custom/components/prompt-line/src/prompt-line-shell.scss.js +1 -1
  173. package/es-custom/components/prompt-line/src/prompt-line-textarea-runtime.d.ts +1 -0
  174. package/es-custom/components/prompt-line/src/prompt-line-textarea-runtime.js +3 -0
  175. package/es-custom/components/prompt-line/src/prompt-line-textarea-runtime.js.map +1 -1
  176. package/es-custom/components/prompt-line/src/prompt-line.d.ts +7 -0
  177. package/es-custom/components/prompt-line/src/prompt-line.js +9 -0
  178. package/es-custom/components/prompt-line/src/prompt-line.js.map +1 -1
  179. package/es-custom/components/prompt-line/src/send-control.scss.js +1 -1
  180. package/es-custom/components/prompt-line/src/stop-streaming-button.scss.js +1 -1
  181. package/es-custom/components/prompt-line/src/tiptap/carbon-mention.js +43 -21
  182. package/es-custom/components/prompt-line/src/tiptap/carbon-mention.js.map +1 -1
  183. package/es-custom/components/prompt-line/src/tiptap/plain-text-paste.js +8 -3
  184. package/es-custom/components/prompt-line/src/tiptap/plain-text-paste.js.map +1 -1
  185. package/es-custom/components/prompt-line/src/tiptap/strip-presentation-fields.d.ts +3 -3
  186. package/es-custom/components/prompt-line/src/tiptap/strip-presentation-fields.js.map +1 -1
  187. package/es-custom/components/prompt-line/src/tiptap/types.d.ts +27 -11
  188. package/es-custom/components/reasoning-steps/src/reasoning-step.d.ts +3 -3
  189. package/es-custom/components/reasoning-steps/src/reasoning-step.js +4 -4
  190. package/es-custom/components/reasoning-steps/src/reasoning-step.js.map +1 -1
  191. package/es-custom/components/reasoning-steps/src/reasoning-step.scss.js +1 -1
  192. package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.scss.js +1 -1
  193. package/es-custom/components/reasoning-steps/src/reasoning-steps.d.ts +5 -4
  194. package/es-custom/components/reasoning-steps/src/reasoning-steps.js +5 -4
  195. package/es-custom/components/reasoning-steps/src/reasoning-steps.js.map +1 -1
  196. package/es-custom/components/truncated-text/src/truncated-text.scss.js +1 -1
  197. package/es-custom/components/video-player/src/video-player.scss.js +1 -1
  198. package/es-custom/globals/scss/common.scss.js +1 -1
  199. package/es-custom/react/hooks/useChatAutocomplete.js +7 -1
  200. package/es-custom/react/hooks/useChatAutocomplete.js.map +1 -1
  201. package/es-custom/react/messages-shell.d.ts +3 -0
  202. package/es-custom/react/messages-shell.js +32 -0
  203. package/es-custom/react/messages-shell.js.map +1 -0
  204. package/package.json +6 -6
  205. package/scss/_markdown-inline.scss +138 -0
  206. package/telemetry.yml +4 -0
@@ -0,0 +1,57 @@
1
+ import { LitElement } from 'lit';
2
+ /**
3
+ * Details sent with each scroll event from the message list.
4
+ */
5
+ export interface MessagesShellScrollDetail {
6
+ /** How far the list is scrolled from the top, in pixels. */
7
+ scrollTop: number;
8
+ /** The full height of the content, in pixels. */
9
+ scrollHeight: number;
10
+ /** The visible height of the list, in pixels. */
11
+ clientHeight: number;
12
+ /** Whether the content is taller than the visible area. */
13
+ isScrollable: boolean;
14
+ /** Whether the list is scrolled to the bottom (within 1px). */
15
+ isAtBottom: boolean;
16
+ }
17
+ /**
18
+ * Layout container for the chat message list. It provides named slots for the
19
+ * rows and the controls around them, and reports scroll position. Autoscroll
20
+ * and row navigation are not part of this element yet.
21
+ *
22
+ * @experimental
23
+ * @element cds-custom-aichat-messages-shell
24
+ *
25
+ * @slot notifications - Sticky notices above the scroller (e.g. human-agent banners).
26
+ * @slot - Default slot. Message rows go here, inside the scroll container.
27
+ * @slot processing - The typing / processing indicator, inside the scroll container.
28
+ * @slot scroll-down - The scroll-to-bottom control. Rendered sticky inside the scroller.
29
+ * @slot error - Footer errors anchored below the scroller.
30
+ *
31
+ * @fires {CustomEvent<MessagesShellScrollDetail>} cds-custom-aichat-messages-shell-scroll -
32
+ * Fired on every scroll event. Detail carries position and geometry readings.
33
+ */
34
+ declare class CDSAIChatMessagesShell extends LitElement {
35
+ static styles: any[];
36
+ /** Name of the event fired when the list scrolls. */
37
+ static get eventScroll(): string;
38
+ /**
39
+ * Visible and accessible label for the top scroll handle.
40
+ * Provide a translated string for the host's locale. The handle is omitted when empty.
41
+ */
42
+ topHandleLabel: string;
43
+ /**
44
+ * Visible and accessible label for the bottom scroll handle.
45
+ * Provide a translated string for the host's locale. The handle is omitted when empty.
46
+ */
47
+ bottomHandleLabel: string;
48
+ private _scroller;
49
+ private _handleScroll;
50
+ private _onHandleFocus;
51
+ private _onHandleBlur;
52
+ private _onHandleKeyDown;
53
+ private _renderScrollHandle;
54
+ render(): import("lit-html").TemplateResult<1>;
55
+ }
56
+ export { CDSAIChatMessagesShell };
57
+ export default CDSAIChatMessagesShell;
@@ -0,0 +1,141 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import { __decorate } from 'tslib';
9
+ import { LitElement, nothing, html } from 'lit';
10
+ import { property, query } from 'lit/decorators.js';
11
+ import { carbonElement } from '../../../globals/decorators/carbon-element.js';
12
+ import prefix from '../../../globals/settings.js';
13
+ import commonStyles from '../../../globals/scss/common.scss.js';
14
+ import styles from './messages-shell.scss.js';
15
+
16
+ /*
17
+ * Copyright IBM Corp. 2025, 2026
18
+ *
19
+ * This source code is licensed under the Apache-2.0 license found in the
20
+ * LICENSE file in the root directory of this source tree.
21
+ *
22
+ * @license
23
+ */
24
+ var CDSAIChatMessagesShell_1;
25
+ const blockClass = `${prefix}-messages-shell`;
26
+ const focusClass = `${blockClass}__scroller--handle-focused`;
27
+ /**
28
+ * Layout container for the chat message list. It provides named slots for the
29
+ * rows and the controls around them, and reports scroll position. Autoscroll
30
+ * and row navigation are not part of this element yet.
31
+ *
32
+ * @experimental
33
+ * @element cds-custom-aichat-messages-shell
34
+ *
35
+ * @slot notifications - Sticky notices above the scroller (e.g. human-agent banners).
36
+ * @slot - Default slot. Message rows go here, inside the scroll container.
37
+ * @slot processing - The typing / processing indicator, inside the scroll container.
38
+ * @slot scroll-down - The scroll-to-bottom control. Rendered sticky inside the scroller.
39
+ * @slot error - Footer errors anchored below the scroller.
40
+ *
41
+ * @fires {CustomEvent<MessagesShellScrollDetail>} cds-custom-aichat-messages-shell-scroll -
42
+ * Fired on every scroll event. Detail carries position and geometry readings.
43
+ */
44
+ let CDSAIChatMessagesShell = CDSAIChatMessagesShell_1 = class CDSAIChatMessagesShell extends LitElement {
45
+ constructor() {
46
+ super(...arguments);
47
+ /**
48
+ * Visible and accessible label for the top scroll handle.
49
+ * Provide a translated string for the host's locale. The handle is omitted when empty.
50
+ */
51
+ this.topHandleLabel = '';
52
+ /**
53
+ * Visible and accessible label for the bottom scroll handle.
54
+ * Provide a translated string for the host's locale. The handle is omitted when empty.
55
+ */
56
+ this.bottomHandleLabel = '';
57
+ this._handleScroll = () => {
58
+ const { scrollTop, scrollHeight, clientHeight } = this._scroller;
59
+ this.dispatchEvent(new CustomEvent(CDSAIChatMessagesShell_1.eventScroll, {
60
+ bubbles: true,
61
+ composed: true,
62
+ detail: {
63
+ scrollTop,
64
+ scrollHeight,
65
+ clientHeight,
66
+ isScrollable: scrollHeight > clientHeight,
67
+ // Allow 1px of slack, because scroll positions can be fractional.
68
+ isAtBottom: scrollHeight - scrollTop - clientHeight <= 1,
69
+ },
70
+ }));
71
+ };
72
+ // The focus ring is switched on and off by editing the class directly,
73
+ // not through reactive state. A re-render while the handle has focus
74
+ // can make the browser drop that focus.
75
+ this._onHandleFocus = () => {
76
+ this._scroller.classList.add(focusClass);
77
+ };
78
+ this._onHandleBlur = () => {
79
+ this._scroller.classList.remove(focusClass);
80
+ };
81
+ this._onHandleKeyDown = (event) => {
82
+ if (event.key === 'Escape') {
83
+ event.preventDefault();
84
+ event.currentTarget.blur();
85
+ }
86
+ };
87
+ }
88
+ /** Name of the event fired when the list scrolls. */
89
+ static get eventScroll() {
90
+ return `${blockClass}-scroll`;
91
+ }
92
+ _renderScrollHandle(label) {
93
+ if (!label) {
94
+ return nothing;
95
+ }
96
+ return html `
97
+ <button
98
+ type="button"
99
+ class="${blockClass}__scroll-handle"
100
+ aria-label=${label}
101
+ @focus=${this._onHandleFocus}
102
+ @blur=${this._onHandleBlur}
103
+ @keydown=${this._onHandleKeyDown}>
104
+ ${label}
105
+ </button>
106
+ `;
107
+ }
108
+ render() {
109
+ return html `
110
+ <slot name="notifications" class="${blockClass}__notifications"></slot>
111
+ ${this._renderScrollHandle(this.topHandleLabel)}
112
+ <div class="${blockClass}__scroller" @scroll=${this._handleScroll}>
113
+ <div class="${blockClass}__content">
114
+ <slot></slot>
115
+ <slot name="processing"></slot>
116
+ <div class="${blockClass}__spacer"></div>
117
+ <slot name="scroll-down"></slot>
118
+ </div>
119
+ </div>
120
+ ${this._renderScrollHandle(this.bottomHandleLabel)}
121
+ <slot name="error" class="${blockClass}__error"></slot>
122
+ `;
123
+ }
124
+ };
125
+ CDSAIChatMessagesShell.styles = [commonStyles, styles];
126
+ __decorate([
127
+ property({ attribute: 'top-handle-label' })
128
+ ], CDSAIChatMessagesShell.prototype, "topHandleLabel", void 0);
129
+ __decorate([
130
+ property({ attribute: 'bottom-handle-label' })
131
+ ], CDSAIChatMessagesShell.prototype, "bottomHandleLabel", void 0);
132
+ __decorate([
133
+ query(`.${blockClass}__scroller`)
134
+ ], CDSAIChatMessagesShell.prototype, "_scroller", void 0);
135
+ CDSAIChatMessagesShell = CDSAIChatMessagesShell_1 = __decorate([
136
+ carbonElement(blockClass)
137
+ ], CDSAIChatMessagesShell);
138
+ var CDSAIChatMessagesShell$1 = CDSAIChatMessagesShell;
139
+
140
+ export { CDSAIChatMessagesShell, CDSAIChatMessagesShell$1 as default };
141
+ //# sourceMappingURL=messages-shell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages-shell.js","sources":["../../../../src/components/messages-shell/src/messages-shell.ts"],"sourcesContent":["/*\n * Copyright IBM Corp. 2025, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @license\n */\n\nimport { LitElement, html, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { carbonElement } from '../../../globals/decorators/index.js';\nimport prefix from '../../../globals/settings.js';\nimport commonStyles from '../../../globals/scss/common.scss?lit';\nimport styles from './messages-shell.scss?lit';\n\nconst blockClass = `${prefix}-messages-shell`;\nconst focusClass = `${blockClass}__scroller--handle-focused`;\n\n/**\n * Details sent with each scroll event from the message list.\n */\nexport interface MessagesShellScrollDetail {\n /** How far the list is scrolled from the top, in pixels. */\n scrollTop: number;\n /** The full height of the content, in pixels. */\n scrollHeight: number;\n /** The visible height of the list, in pixels. */\n clientHeight: number;\n /** Whether the content is taller than the visible area. */\n isScrollable: boolean;\n /** Whether the list is scrolled to the bottom (within 1px). */\n isAtBottom: boolean;\n}\n\n/**\n * Layout container for the chat message list. It provides named slots for the\n * rows and the controls around them, and reports scroll position. Autoscroll\n * and row navigation are not part of this element yet.\n *\n * @experimental\n * @element cds-custom-aichat-messages-shell\n *\n * @slot notifications - Sticky notices above the scroller (e.g. human-agent banners).\n * @slot - Default slot. Message rows go here, inside the scroll container.\n * @slot processing - The typing / processing indicator, inside the scroll container.\n * @slot scroll-down - The scroll-to-bottom control. Rendered sticky inside the scroller.\n * @slot error - Footer errors anchored below the scroller.\n *\n * @fires {CustomEvent<MessagesShellScrollDetail>} cds-custom-aichat-messages-shell-scroll -\n * Fired on every scroll event. Detail carries position and geometry readings.\n */\n@carbonElement(blockClass)\nclass CDSAIChatMessagesShell extends LitElement {\n static styles = [commonStyles, styles];\n\n /** Name of the event fired when the list scrolls. */\n static get eventScroll() {\n return `${blockClass}-scroll`;\n }\n\n /**\n * Visible and accessible label for the top scroll handle.\n * Provide a translated string for the host's locale. The handle is omitted when empty.\n */\n @property({ attribute: 'top-handle-label' })\n topHandleLabel = '';\n\n /**\n * Visible and accessible label for the bottom scroll handle.\n * Provide a translated string for the host's locale. The handle is omitted when empty.\n */\n @property({ attribute: 'bottom-handle-label' })\n bottomHandleLabel = '';\n\n @query(`.${blockClass}__scroller`)\n private _scroller!: HTMLElement;\n\n private _handleScroll = (): void => {\n const { scrollTop, scrollHeight, clientHeight } = this._scroller;\n\n this.dispatchEvent(\n new CustomEvent<MessagesShellScrollDetail>(\n CDSAIChatMessagesShell.eventScroll,\n {\n bubbles: true,\n composed: true,\n detail: {\n scrollTop,\n scrollHeight,\n clientHeight,\n isScrollable: scrollHeight > clientHeight,\n // Allow 1px of slack, because scroll positions can be fractional.\n isAtBottom: scrollHeight - scrollTop - clientHeight <= 1,\n },\n }\n )\n );\n };\n\n // The focus ring is switched on and off by editing the class directly,\n // not through reactive state. A re-render while the handle has focus\n // can make the browser drop that focus.\n private _onHandleFocus = (): void => {\n this._scroller.classList.add(focusClass);\n };\n\n private _onHandleBlur = (): void => {\n this._scroller.classList.remove(focusClass);\n };\n\n private _onHandleKeyDown = (event: KeyboardEvent): void => {\n if (event.key === 'Escape') {\n event.preventDefault();\n (event.currentTarget as HTMLElement).blur();\n }\n };\n\n private _renderScrollHandle(label: string) {\n if (!label) {\n return nothing;\n }\n return html`\n <button\n type=\"button\"\n class=\"${blockClass}__scroll-handle\"\n aria-label=${label}\n @focus=${this._onHandleFocus}\n @blur=${this._onHandleBlur}\n @keydown=${this._onHandleKeyDown}>\n ${label}\n </button>\n `;\n }\n\n render() {\n return html`\n <slot name=\"notifications\" class=\"${blockClass}__notifications\"></slot>\n ${this._renderScrollHandle(this.topHandleLabel)}\n <div class=\"${blockClass}__scroller\" @scroll=${this._handleScroll}>\n <div class=\"${blockClass}__content\">\n <slot></slot>\n <slot name=\"processing\"></slot>\n <div class=\"${blockClass}__spacer\"></div>\n <slot name=\"scroll-down\"></slot>\n </div>\n </div>\n ${this._renderScrollHandle(this.bottomHandleLabel)}\n <slot name=\"error\" class=\"${blockClass}__error\"></slot>\n `;\n }\n}\n\nexport { CDSAIChatMessagesShell };\nexport default CDSAIChatMessagesShell;\n"],"names":[],"mappings":"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"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import { css } from 'lit';
9
+
10
+ var styles = css([":host(cds-custom-aichat-messages-shell){block-size:100%;display:flex;flex-direction:column;inline-size:100%;min-block-size:0;overflow:hidden}slot[name=notifications]{display:block;flex-shrink:0}.cds-custom-aichat-messages-shell__scroll-handle{background:none;block-size:1px;border:none;flex-shrink:0;margin:0;overflow:hidden;padding:0;position:absolute;clip:rect(0 0 0 0);clip-path:inset(50%);color:inherit;cursor:default;font:inherit;inline-size:1px;outline:none;white-space:nowrap}@media (hover:hover) and (pointer:fine){.cds-custom-aichat-messages-shell__scroll-handle{block-size:0;overflow:hidden;padding:0 1rem;position:static;clip:auto;clip-path:none;inline-size:100%;margin-inline:auto;max-inline-size:var(--cds-aichat-messages-max-width,672px);pointer-events:none;white-space:normal}.cds-custom-aichat-messages-shell__scroll-handle:focus-visible{block-size:auto;border:1px solid var(--cds-focus,#0f62fe);outline:none;padding-block:1rem;pointer-events:auto}}.cds-custom-aichat-messages-shell__scroller{block-size:100%;flex:1 1 auto;inline-size:100%;min-block-size:0;overflow:hidden auto;overscroll-behavior:contain;position:relative}.cds-custom-aichat-messages-shell__scroller--handle-focused{outline:2px solid var(--cds-focus,#0f62fe);outline-offset:-2px}.cds-custom-aichat-messages-shell__content{block-size:100%;inline-size:100%}slot[name=processing]{display:block;min-block-size:2rem}slot[name=scroll-down]{display:block;inset-block-end:1rem;position:sticky;z-index:1}slot[name=error]{display:block;flex-shrink:0}"]);
11
+
12
+ export { styles as default };
13
+ //# sourceMappingURL=messages-shell.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages-shell.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -7,7 +7,7 @@
7
7
 
8
8
  import { css } from 'lit';
9
9
 
10
- var styles = css([":host{display:inline-block}.dots{block-size:32px;inline-size:32px}.dot{fill:none;r:0;stroke:var(--cds-interactive,#0f62fe);stroke-width:0;transform:translateY(0)}@media screen and (prefers-reduced-motion:reduce){.linear .dot--left{animation:none;animation-delay:1s,1s,2s,2s;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1,1,infinite,infinite;transform-origin:25% 50%}}.linear .dot--left{animation:linear-load-size,linear-load-stroke,linear-loop-size,linear-loop-stroke;animation-delay:1s,1s,2s,2s;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1,1,infinite,infinite;transform-origin:25% 50%}@media screen and (prefers-reduced-motion:reduce){.linear .dot--center{animation:none;animation-delay:1167ms,1167ms,2167ms,2167ms;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1,1,infinite,infinite;transform-origin:50% 50%}}.linear .dot--center{animation:linear-load-size,linear-load-stroke,linear-loop-size,linear-loop-stroke;animation-delay:1167ms,1167ms,2167ms,2167ms;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1,1,infinite,infinite;transform-origin:50% 50%}@media screen and (prefers-reduced-motion:reduce){.linear .dot--right{animation:none;animation-delay:1334ms,1334ms,2334ms,2334ms;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1,1,infinite,infinite;transform-origin:75% 50%}}.linear .dot--right{animation:linear-load-size,linear-load-stroke,linear-loop-size,linear-loop-stroke;animation-delay:1334ms,1334ms,2334ms,2334ms;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1,1,infinite,infinite;transform-origin:75% 50%}@media screen and (prefers-reduced-motion:reduce){.linear--no-loop .dot--left{animation:none;animation-delay:1s,1s,2s,2s;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1;transform-origin:25% 50%}}.linear--no-loop .dot--left{animation:linear-load-size,linear-load-stroke,linear-unload-size,linear-unload-stroke;animation-delay:1s,1s,2s,2s;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1;transform-origin:25% 50%}@media screen and (prefers-reduced-motion:reduce){.linear--no-loop .dot--center{animation:none;animation-delay:1167ms,1167ms,2167ms,2167ms;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1;transform-origin:50% 50%}}.linear--no-loop .dot--center{animation:linear-load-size,linear-load-stroke,linear-unload-size,linear-unload-stroke;animation-delay:1167ms,1167ms,2167ms,2167ms;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1;transform-origin:50% 50%}@media screen and (prefers-reduced-motion:reduce){.linear--no-loop .dot--right{animation:none;animation-delay:1334ms,1334ms,2334ms,2334ms;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1;transform-origin:75% 50%}}.linear--no-loop .dot--right{animation:linear-load-size,linear-load-stroke,linear-unload-size,linear-unload-stroke;animation-delay:1334ms,1334ms,2334ms,2334ms;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1;transform-origin:75% 50%}.quick-load .dot--left{animation-delay:0ms,0ms,1s,1s}.quick-load .dot--center{animation-delay:167ms,167ms,1167ms,1167ms}.quick-load .dot--right{animation-delay:334ms,334ms,1334ms,1334ms}[dir=rtl] .linear .dot--left{animation-delay:1334ms,1334ms,2334ms,2334ms,7334ms,7334ms}[dir=rtl] .linear .dot--center{animation-delay:1167ms,1167ms,2167ms,2167ms,7167ms,7167ms}[dir=rtl] .linear .dot--right{animation-delay:1s,1s,2s,2s,7s,7s}[dir=rtl] .linear--no-loop .dot--left{animation-delay:1334ms,1334ms,2334ms,2334ms}[dir=rtl] .linear--no-loop .dot--center{animation-delay:1167ms,1167ms,2167ms,2167ms}[dir=rtl] .linear--no-loop .dot--right{animation-delay:1s,1s,2s,2s}[dir=rtl] .quick-load .dot--left{animation-delay:334ms,334ms,1334ms,1334ms}[dir=rtl] .quick-load .dot--center{animation-delay:167ms,167ms,1167ms,1167ms}[dir=rtl] .quick-load .dot--right{animation-delay:0ms,0ms,1s,1s}@keyframes linear-load-size{0%{r:0;animation-timing-function:cubic-bezier(0,0,.3,1)}25%{r:2.5px;animation-timing-function:cubic-bezier(0,0,.3,1)}83.3%{r:.875px}to{r:.875px}}@keyframes linear-load-stroke{0%{stroke-width:0;animation-timing-function:cubic-bezier(0,0,.3,1)}8.33%{stroke-width:1.72}to{stroke-width:1.72}}@keyframes linear-loop-size{0%{r:.875px;animation-timing-function:cubic-bezier(0,0,.3,1)}25%{r:2.5px;animation-timing-function:cubic-bezier(0,0,.3,1)}91.66%{r:.875px}to{r:.875px}}@keyframes linear-loop-stroke{0%{stroke-width:1.72;animation-timing-function:cubic-bezier(.4,.14,1,1)}to{stroke-width:1.72}}@keyframes linear-unload-size{0%{r:.875px}8.33%{r:.875px}33.33%{r:2.5px;animation-timing-function:cubic-bezier(.4,.14,1,1)}58.33%{r:0}to{r:0}}@keyframes linear-unload-stroke{0%{stroke-width:1.72}50%{stroke-width:1.72}58.33%{stroke-width:0}to{stroke-width:0}}@media (prefers-reduced-motion:reduce){.dot--center,.dot--left,.dot--right{animation:none;transition:none}}"]);
10
+ var styles = css([":host{display:inline-block}.dots{block-size:32px;inline-size:32px}.dot{fill:none;r:0;stroke:var(--cds-interactive,#0f62fe);stroke-width:0;transform:translateY(0)}@media screen and (prefers-reduced-motion:reduce){.linear .dot--left{animation:none;animation-delay:1s,1s,2s,2s;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1,1,infinite,infinite;transform-origin:25% 50%}}.linear .dot--left{animation:linear-load-size,linear-load-stroke,linear-loop-size,linear-loop-stroke;animation-delay:1s,1s,2s,2s;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1,1,infinite,infinite;transform-origin:25% 50%}@media screen and (prefers-reduced-motion:reduce){.linear .dot--center{animation:none;animation-delay:1167ms,1167ms,2167ms,2167ms;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1,1,infinite,infinite;transform-origin:50% 50%}}.linear .dot--center{animation:linear-load-size,linear-load-stroke,linear-loop-size,linear-loop-stroke;animation-delay:1167ms,1167ms,2167ms,2167ms;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1,1,infinite,infinite;transform-origin:50% 50%}@media screen and (prefers-reduced-motion:reduce){.linear .dot--right{animation:none;animation-delay:1334ms,1334ms,2334ms,2334ms;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1,1,infinite,infinite;transform-origin:75% 50%}}.linear .dot--right{animation:linear-load-size,linear-load-stroke,linear-loop-size,linear-loop-stroke;animation-delay:1334ms,1334ms,2334ms,2334ms;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1,1,infinite,infinite;transform-origin:75% 50%}@media screen and (prefers-reduced-motion:reduce){.linear--no-loop .dot--left{animation:none;animation-delay:1s,1s,2s,2s;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1;transform-origin:25% 50%}}.linear--no-loop .dot--left{animation:linear-load-size,linear-load-stroke,linear-unload-size,linear-unload-stroke;animation-delay:1s,1s,2s,2s;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1;transform-origin:25% 50%}@media screen and (prefers-reduced-motion:reduce){.linear--no-loop .dot--center{animation:none;animation-delay:1167ms,1167ms,2167ms,2167ms;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1;transform-origin:50% 50%}}.linear--no-loop .dot--center{animation:linear-load-size,linear-load-stroke,linear-unload-size,linear-unload-stroke;animation-delay:1167ms,1167ms,2167ms,2167ms;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1;transform-origin:50% 50%}@media screen and (prefers-reduced-motion:reduce){.linear--no-loop .dot--right{animation:none;animation-delay:1334ms,1334ms,2334ms,2334ms;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1;transform-origin:75% 50%}}.linear--no-loop .dot--right{animation:linear-load-size,linear-load-stroke,linear-unload-size,linear-unload-stroke;animation-delay:1334ms,1334ms,2334ms,2334ms;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:1;transform-origin:75% 50%}.quick-load .dot--left{animation-delay:0s,0s,1s,1s}.quick-load .dot--center{animation-delay:167ms,167ms,1167ms,1167ms}.quick-load .dot--right{animation-delay:334ms,334ms,1334ms,1334ms}[dir=rtl] .linear .dot--left{animation-delay:1334ms,1334ms,2334ms,2334ms,7334ms,7334ms}[dir=rtl] .linear .dot--center{animation-delay:1167ms,1167ms,2167ms,2167ms,7167ms,7167ms}[dir=rtl] .linear .dot--right{animation-delay:1s,1s,2s,2s,7s,7s}[dir=rtl] .linear--no-loop .dot--left{animation-delay:1334ms,1334ms,2334ms,2334ms}[dir=rtl] .linear--no-loop .dot--center{animation-delay:1167ms,1167ms,2167ms,2167ms}[dir=rtl] .linear--no-loop .dot--right{animation-delay:1s,1s,2s,2s}[dir=rtl] .quick-load .dot--left{animation-delay:334ms,334ms,1334ms,1334ms}[dir=rtl] .quick-load .dot--center{animation-delay:167ms,167ms,1167ms,1167ms}[dir=rtl] .quick-load .dot--right{animation-delay:0s,0s,1s,1s}@keyframes linear-load-size{0%{animation-timing-function:cubic-bezier(0,0,.3,1);r:0}25%{animation-timing-function:cubic-bezier(0,0,.3,1);r:2.5px}83.3%{r:.875px}to{r:.875px}}@keyframes linear-load-stroke{0%{animation-timing-function:cubic-bezier(0,0,.3,1);stroke-width:0}8.33%{stroke-width:1.72}to{stroke-width:1.72}}@keyframes linear-loop-size{0%{animation-timing-function:cubic-bezier(0,0,.3,1);r:.875px}25%{animation-timing-function:cubic-bezier(0,0,.3,1);r:2.5px}91.66%{r:.875px}to{r:.875px}}@keyframes linear-loop-stroke{0%{animation-timing-function:cubic-bezier(.4,.14,1,1);stroke-width:1.72}to{stroke-width:1.72}}@keyframes linear-unload-size{0%{r:.875px}8.33%{r:.875px}33.33%{animation-timing-function:cubic-bezier(.4,.14,1,1);r:2.5px}58.33%{r:0}to{r:0}}@keyframes linear-unload-stroke{0%{stroke-width:1.72}50%{stroke-width:1.72}58.33%{stroke-width:0}to{stroke-width:0}}@media (prefers-reduced-motion:reduce){.dot--center,.dot--left,.dot--right{animation:none;transition:none}}"]);
11
11
 
12
12
  export { styles as default };
13
13
  //# sourceMappingURL=processing.scss.js.map
@@ -8,6 +8,16 @@
8
8
  */
9
9
  import { LitElement } from 'lit';
10
10
  import type { SuggestionItem, SuggestionItemGroup } from '../../src/tiptap/types.js';
11
+ /**
12
+ * One option in render order. `index` is its flat keyboard index;
13
+ * `groupIndex` is its position in `groups`, or `undefined` when ungrouped.
14
+ */
15
+ export interface FlatEntry {
16
+ item: SuggestionItem;
17
+ index: number;
18
+ groupIndex: number | undefined;
19
+ groupTitle: string | undefined;
20
+ }
11
21
  /**
12
22
  * Configuration for the autocomplete header
13
23
  */
@@ -137,26 +147,34 @@ declare class AutocompleteElement extends LitElement {
137
147
  * only the last pending label is spoken.
138
148
  */
139
149
  private _moveAnnouncePending;
150
+ /** Cached flat item list, rebuilt on every update via willUpdate. */
151
+ private _flatList;
140
152
  /** Whether the open announcement has already fired for this show. */
141
153
  private _openAnnounced;
154
+ /** Total item count from the last announcement, used to detect count changes. */
155
+ private _previousTotalItems;
156
+ /**
157
+ * Pending timer for filtered count announcement. Keystroke updates are debounced
158
+ * so rapid typing does not interrupt typing echo with an announcement on every key.
159
+ */
160
+ private _filterAnnouncePending;
142
161
  connectedCallback(): void;
143
162
  disconnectedCallback(): void;
144
163
  hasNavigated(): boolean;
145
164
  firstUpdated(): void;
165
+ willUpdate(changedProperties: Map<string, any>): void;
146
166
  updated(changedProperties: Map<string, any>): void;
147
167
  /**
148
- * Get the total count of all items (flat items + items in groups)
149
- */
150
- private _getTotalItemCount;
151
- /**
152
- * Get the item at a specific index (accounting for both flat items and groups)
168
+ * Build a flat list of all items in render order: ungrouped items first,
169
+ * then each group's items in group order. Called unconditionally from
170
+ * willUpdate so in-place mutations followed by requestUpdate() are reflected.
153
171
  */
154
- private _getItemAtIndex;
172
+ private _buildFlatList;
155
173
  /**
156
174
  * Move focus to the next enabled item in the given direction (+1 / -1),
157
175
  * skipping over any disabled items. Mirrors the Carbon Dropdown `_navigate`
158
- * pattern. Returns the resolved index, or the current index if no enabled
159
- * item exists in that direction.
176
+ * pattern. Returns the resolved index, or `from` if no enabled item exists
177
+ * in that direction.
160
178
  */
161
179
  private _navigateTo;
162
180
  private _handleKeydown;
@@ -174,7 +192,6 @@ declare class AutocompleteElement extends LitElement {
174
192
  private _dismiss;
175
193
  private _handleItemClick;
176
194
  private _getActiveOptionId;
177
- private _getGroupTitleAtIndex;
178
195
  private _getLabelParts;
179
196
  /**
180
197
  * Render the avatar if provided