@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.
- package/custom-elements.json +1147 -462
- package/es/components/audio-player/src/audio-player.scss.js +1 -1
- package/es/components/audio-player/src/transcript.js +15 -0
- package/es/components/audio-player/src/transcript.js.map +1 -1
- package/es/components/card/src/card-footer.scss.js +1 -1
- package/es/components/card/src/card-steps.scss.js +1 -1
- package/es/components/card/src/card.scss.js +1 -1
- package/es/components/chat-button/src/chat-button.scss.js +1 -1
- package/es/components/chat-history/src/chat-history.scss.js +1 -1
- package/es/components/chat-history/src/history-header.js +1 -0
- package/es/components/chat-history/src/history-header.js.map +1 -1
- package/es/components/chat-history/src/history-toolbar.js +4 -1
- package/es/components/chat-history/src/history-toolbar.js.map +1 -1
- package/es/components/chat-shell/src/shell.scss.js +1 -1
- package/es/components/code-snippet/src/code-snippet.d.ts +3 -2
- package/es/components/code-snippet/src/code-snippet.js +4 -3
- package/es/components/code-snippet/src/code-snippet.js.map +1 -1
- package/es/components/code-snippet/src/code-snippet.scss.js +1 -1
- package/es/components/feedback/src/feedback.js +17 -3
- package/es/components/feedback/src/feedback.js.map +1 -1
- package/es/components/file-uploads/src/file-upload-item.scss.js +1 -1
- package/es/components/file-uploads/src/file-uploads.scss.js +1 -1
- package/es/components/launcher/src/launcher.scss.js +1 -1
- package/es/components/markdown/__tests__/inline-selection-fixture.d.ts +13 -0
- package/es/components/markdown/index.d.ts +2 -0
- package/es/components/markdown/index.js +3 -0
- package/es/components/markdown/index.js.map +1 -1
- package/es/components/markdown/src/inline-markdown.d.ts +41 -0
- package/es/components/markdown/src/inline-markdown.js +92 -0
- package/es/components/markdown/src/inline-markdown.js.map +1 -0
- package/es/components/markdown/src/inline-markdown.scss.js +13 -0
- package/es/components/markdown/src/inline-markdown.scss.js.map +1 -0
- package/es/components/markdown/src/inline-run-projection.scss.js +13 -0
- package/es/components/markdown/src/inline-run-projection.scss.js.map +1 -0
- package/es/components/markdown/src/markdown-renderer-types.d.ts +132 -0
- package/es/components/markdown/src/markdown-renderer.js +131 -25
- package/es/components/markdown/src/markdown-renderer.js.map +1 -1
- package/es/components/markdown/src/markdown.js +1 -0
- package/es/components/markdown/src/markdown.js.map +1 -1
- package/es/components/markdown/src/markdown.scss.js +1 -1
- package/es/components/markdown/src/utils/inline-run-projection.d.ts +15 -0
- package/es/components/markdown/src/utils/inline-run-projection.js +196 -0
- package/es/components/markdown/src/utils/inline-run-projection.js.map +1 -0
- package/es/components/markdown/src/utils/inline-validation.d.ts +13 -0
- package/es/components/markdown/src/utils/inline-validation.js +97 -0
- package/es/components/markdown/src/utils/inline-validation.js.map +1 -0
- package/es/components/markdown/src/utils/plugin-fallback.js +20 -13
- package/es/components/markdown/src/utils/plugin-fallback.js.map +1 -1
- package/es/components/markdown/src/utils/plugin-host-container.d.ts +5 -6
- package/es/components/markdown/src/utils/plugin-host-container.js.map +1 -1
- package/es/components/messages-shell/index.d.ts +11 -0
- package/es/components/messages-shell/index.js +9 -0
- package/es/components/messages-shell/index.js.map +1 -0
- package/es/components/messages-shell/src/messages-shell.d.ts +57 -0
- package/es/components/messages-shell/src/messages-shell.js +141 -0
- package/es/components/messages-shell/src/messages-shell.js.map +1 -0
- package/es/components/messages-shell/src/messages-shell.scss.js +13 -0
- package/es/components/messages-shell/src/messages-shell.scss.js.map +1 -0
- package/es/components/processing/src/processing.scss.js +1 -1
- package/es/components/prompt-line/autocomplete/src/autocomplete.d.ts +26 -9
- package/es/components/prompt-line/autocomplete/src/autocomplete.js +116 -107
- package/es/components/prompt-line/autocomplete/src/autocomplete.js.map +1 -1
- package/es/components/prompt-line/autocomplete/src/autocomplete.scss.js +1 -1
- package/es/components/prompt-line/src/autocomplete-controller-element.js +13 -1
- package/es/components/prompt-line/src/autocomplete-controller-element.js.map +1 -1
- package/es/components/prompt-line/src/autocomplete-controller.js +9 -2
- package/es/components/prompt-line/src/autocomplete-controller.js.map +1 -1
- package/es/components/prompt-line/src/prompt-line-controller.d.ts +7 -0
- package/es/components/prompt-line/src/prompt-line-rich-runtime.js +17 -0
- package/es/components/prompt-line/src/prompt-line-rich-runtime.js.map +1 -1
- package/es/components/prompt-line/src/prompt-line-shell.scss.js +1 -1
- package/es/components/prompt-line/src/prompt-line-textarea-runtime.d.ts +1 -0
- package/es/components/prompt-line/src/prompt-line-textarea-runtime.js +3 -0
- package/es/components/prompt-line/src/prompt-line-textarea-runtime.js.map +1 -1
- package/es/components/prompt-line/src/prompt-line.d.ts +7 -0
- package/es/components/prompt-line/src/prompt-line.js +9 -0
- package/es/components/prompt-line/src/prompt-line.js.map +1 -1
- package/es/components/prompt-line/src/send-control.scss.js +1 -1
- package/es/components/prompt-line/src/stop-streaming-button.scss.js +1 -1
- package/es/components/prompt-line/src/tiptap/carbon-mention.js +43 -21
- package/es/components/prompt-line/src/tiptap/carbon-mention.js.map +1 -1
- package/es/components/prompt-line/src/tiptap/plain-text-paste.js +8 -3
- package/es/components/prompt-line/src/tiptap/plain-text-paste.js.map +1 -1
- package/es/components/prompt-line/src/tiptap/strip-presentation-fields.d.ts +3 -3
- package/es/components/prompt-line/src/tiptap/strip-presentation-fields.js.map +1 -1
- package/es/components/prompt-line/src/tiptap/types.d.ts +27 -11
- package/es/components/reasoning-steps/src/reasoning-step.d.ts +3 -3
- package/es/components/reasoning-steps/src/reasoning-step.js +4 -4
- package/es/components/reasoning-steps/src/reasoning-step.js.map +1 -1
- package/es/components/reasoning-steps/src/reasoning-step.scss.js +1 -1
- package/es/components/reasoning-steps/src/reasoning-steps-toggle.scss.js +1 -1
- package/es/components/reasoning-steps/src/reasoning-steps.d.ts +5 -4
- package/es/components/reasoning-steps/src/reasoning-steps.js +5 -4
- package/es/components/reasoning-steps/src/reasoning-steps.js.map +1 -1
- package/es/components/truncated-text/src/truncated-text.scss.js +1 -1
- package/es/components/video-player/src/video-player.scss.js +1 -1
- package/es/globals/scss/common.scss.js +1 -1
- package/es/react/hooks/useChatAutocomplete.js +7 -1
- package/es/react/hooks/useChatAutocomplete.js.map +1 -1
- package/es/react/messages-shell.d.ts +3 -0
- package/es/react/messages-shell.js +32 -0
- package/es/react/messages-shell.js.map +1 -0
- package/es-custom/components/audio-player/src/audio-player.scss.js +1 -1
- package/es-custom/components/audio-player/src/transcript.js +15 -0
- package/es-custom/components/audio-player/src/transcript.js.map +1 -1
- package/es-custom/components/card/src/card-footer.scss.js +1 -1
- package/es-custom/components/card/src/card-steps.scss.js +1 -1
- package/es-custom/components/card/src/card.scss.js +1 -1
- package/es-custom/components/chat-button/src/chat-button.scss.js +1 -1
- package/es-custom/components/chat-history/src/chat-history.scss.js +1 -1
- package/es-custom/components/chat-history/src/history-header.js +1 -0
- package/es-custom/components/chat-history/src/history-header.js.map +1 -1
- package/es-custom/components/chat-history/src/history-toolbar.js +4 -1
- package/es-custom/components/chat-history/src/history-toolbar.js.map +1 -1
- package/es-custom/components/chat-shell/src/shell.scss.js +1 -1
- package/es-custom/components/code-snippet/src/code-snippet.d.ts +3 -2
- package/es-custom/components/code-snippet/src/code-snippet.js +4 -3
- package/es-custom/components/code-snippet/src/code-snippet.js.map +1 -1
- package/es-custom/components/code-snippet/src/code-snippet.scss.js +1 -1
- package/es-custom/components/feedback/src/feedback.js +17 -3
- package/es-custom/components/feedback/src/feedback.js.map +1 -1
- package/es-custom/components/file-uploads/src/file-upload-item.scss.js +1 -1
- package/es-custom/components/file-uploads/src/file-uploads.scss.js +1 -1
- package/es-custom/components/launcher/src/launcher.scss.js +1 -1
- package/es-custom/components/markdown/__tests__/inline-selection-fixture.d.ts +13 -0
- package/es-custom/components/markdown/index.d.ts +2 -0
- package/es-custom/components/markdown/index.js +3 -0
- package/es-custom/components/markdown/index.js.map +1 -1
- package/es-custom/components/markdown/src/inline-markdown.d.ts +41 -0
- package/es-custom/components/markdown/src/inline-markdown.js +92 -0
- package/es-custom/components/markdown/src/inline-markdown.js.map +1 -0
- package/es-custom/components/markdown/src/inline-markdown.scss.js +13 -0
- package/es-custom/components/markdown/src/inline-markdown.scss.js.map +1 -0
- package/es-custom/components/markdown/src/inline-run-projection.scss.js +13 -0
- package/es-custom/components/markdown/src/inline-run-projection.scss.js.map +1 -0
- package/es-custom/components/markdown/src/markdown-renderer-types.d.ts +132 -0
- package/es-custom/components/markdown/src/markdown-renderer.js +131 -25
- package/es-custom/components/markdown/src/markdown-renderer.js.map +1 -1
- package/es-custom/components/markdown/src/markdown.js +1 -0
- package/es-custom/components/markdown/src/markdown.js.map +1 -1
- package/es-custom/components/markdown/src/markdown.scss.js +1 -1
- package/es-custom/components/markdown/src/utils/inline-run-projection.d.ts +15 -0
- package/es-custom/components/markdown/src/utils/inline-run-projection.js +196 -0
- package/es-custom/components/markdown/src/utils/inline-run-projection.js.map +1 -0
- package/es-custom/components/markdown/src/utils/inline-validation.d.ts +13 -0
- package/es-custom/components/markdown/src/utils/inline-validation.js +97 -0
- package/es-custom/components/markdown/src/utils/inline-validation.js.map +1 -0
- package/es-custom/components/markdown/src/utils/plugin-fallback.js +20 -13
- package/es-custom/components/markdown/src/utils/plugin-fallback.js.map +1 -1
- package/es-custom/components/markdown/src/utils/plugin-host-container.d.ts +5 -6
- package/es-custom/components/markdown/src/utils/plugin-host-container.js.map +1 -1
- package/es-custom/components/messages-shell/index.d.ts +11 -0
- package/es-custom/components/messages-shell/index.js +9 -0
- package/es-custom/components/messages-shell/index.js.map +1 -0
- package/es-custom/components/messages-shell/src/messages-shell.d.ts +57 -0
- package/es-custom/components/messages-shell/src/messages-shell.js +141 -0
- package/es-custom/components/messages-shell/src/messages-shell.js.map +1 -0
- package/es-custom/components/messages-shell/src/messages-shell.scss.js +13 -0
- package/es-custom/components/messages-shell/src/messages-shell.scss.js.map +1 -0
- package/es-custom/components/processing/src/processing.scss.js +1 -1
- package/es-custom/components/prompt-line/autocomplete/src/autocomplete.d.ts +26 -9
- package/es-custom/components/prompt-line/autocomplete/src/autocomplete.js +116 -107
- package/es-custom/components/prompt-line/autocomplete/src/autocomplete.js.map +1 -1
- package/es-custom/components/prompt-line/autocomplete/src/autocomplete.scss.js +1 -1
- package/es-custom/components/prompt-line/src/autocomplete-controller-element.js +13 -1
- package/es-custom/components/prompt-line/src/autocomplete-controller-element.js.map +1 -1
- package/es-custom/components/prompt-line/src/autocomplete-controller.js +9 -2
- package/es-custom/components/prompt-line/src/autocomplete-controller.js.map +1 -1
- package/es-custom/components/prompt-line/src/prompt-line-controller.d.ts +7 -0
- package/es-custom/components/prompt-line/src/prompt-line-rich-runtime.js +17 -0
- package/es-custom/components/prompt-line/src/prompt-line-rich-runtime.js.map +1 -1
- package/es-custom/components/prompt-line/src/prompt-line-shell.scss.js +1 -1
- package/es-custom/components/prompt-line/src/prompt-line-textarea-runtime.d.ts +1 -0
- package/es-custom/components/prompt-line/src/prompt-line-textarea-runtime.js +3 -0
- package/es-custom/components/prompt-line/src/prompt-line-textarea-runtime.js.map +1 -1
- package/es-custom/components/prompt-line/src/prompt-line.d.ts +7 -0
- package/es-custom/components/prompt-line/src/prompt-line.js +9 -0
- package/es-custom/components/prompt-line/src/prompt-line.js.map +1 -1
- package/es-custom/components/prompt-line/src/send-control.scss.js +1 -1
- package/es-custom/components/prompt-line/src/stop-streaming-button.scss.js +1 -1
- package/es-custom/components/prompt-line/src/tiptap/carbon-mention.js +43 -21
- package/es-custom/components/prompt-line/src/tiptap/carbon-mention.js.map +1 -1
- package/es-custom/components/prompt-line/src/tiptap/plain-text-paste.js +8 -3
- package/es-custom/components/prompt-line/src/tiptap/plain-text-paste.js.map +1 -1
- package/es-custom/components/prompt-line/src/tiptap/strip-presentation-fields.d.ts +3 -3
- package/es-custom/components/prompt-line/src/tiptap/strip-presentation-fields.js.map +1 -1
- package/es-custom/components/prompt-line/src/tiptap/types.d.ts +27 -11
- package/es-custom/components/reasoning-steps/src/reasoning-step.d.ts +3 -3
- package/es-custom/components/reasoning-steps/src/reasoning-step.js +4 -4
- package/es-custom/components/reasoning-steps/src/reasoning-step.js.map +1 -1
- package/es-custom/components/reasoning-steps/src/reasoning-step.scss.js +1 -1
- package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.scss.js +1 -1
- package/es-custom/components/reasoning-steps/src/reasoning-steps.d.ts +5 -4
- package/es-custom/components/reasoning-steps/src/reasoning-steps.js +5 -4
- package/es-custom/components/reasoning-steps/src/reasoning-steps.js.map +1 -1
- package/es-custom/components/truncated-text/src/truncated-text.scss.js +1 -1
- package/es-custom/components/video-player/src/video-player.scss.js +1 -1
- package/es-custom/globals/scss/common.scss.js +1 -1
- package/es-custom/react/hooks/useChatAutocomplete.js +7 -1
- package/es-custom/react/hooks/useChatAutocomplete.js.map +1 -1
- package/es-custom/react/messages-shell.d.ts +3 -0
- package/es-custom/react/messages-shell.js +32 -0
- package/es-custom/react/messages-shell.js.map +1 -0
- package/package.json +6 -6
- package/scss/_markdown-inline.scss +138 -0
- 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:
|
|
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
|
-
*
|
|
149
|
-
|
|
150
|
-
|
|
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
|
|
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
|
|
159
|
-
*
|
|
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
|