@bbki.ng/bb-msg-history 0.1.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +174 -19
  2. package/dist/component.d.ts +35 -0
  3. package/dist/component.js +141 -0
  4. package/dist/const/authors.d.ts +10 -0
  5. package/dist/const/authors.js +29 -0
  6. package/dist/const/styles.d.ts +12 -0
  7. package/dist/const/styles.js +275 -0
  8. package/dist/const/theme.d.ts +6 -0
  9. package/dist/const/theme.js +32 -0
  10. package/dist/index.d.ts +3 -14
  11. package/dist/index.dev.js +12 -0
  12. package/dist/index.js +1 -1
  13. package/dist/types/index.d.ts +33 -0
  14. package/dist/types/index.js +4 -0
  15. package/dist/utils/author-resolver.d.ts +11 -0
  16. package/dist/utils/author-resolver.js +71 -0
  17. package/dist/utils/avatar.d.ts +4 -0
  18. package/dist/utils/avatar.js +18 -0
  19. package/dist/utils/html.d.ts +12 -0
  20. package/dist/utils/html.js +33 -0
  21. package/dist/utils/message-builder.d.ts +13 -0
  22. package/dist/utils/message-builder.js +49 -0
  23. package/dist/utils/message-parser.d.ts +6 -0
  24. package/dist/utils/message-parser.js +22 -0
  25. package/dist/utils/registration.d.ts +8 -0
  26. package/dist/utils/registration.js +29 -0
  27. package/dist/utils/tooltip.d.ts +5 -0
  28. package/dist/utils/tooltip.js +17 -0
  29. package/package.json +7 -6
  30. package/src/component.ts +172 -0
  31. package/src/const/authors.ts +32 -0
  32. package/src/const/styles.ts +278 -0
  33. package/src/const/theme.ts +34 -0
  34. package/src/index.ts +10 -478
  35. package/src/types/index.ts +37 -0
  36. package/src/utils/author-resolver.ts +81 -0
  37. package/src/utils/avatar.ts +19 -0
  38. package/src/utils/html.ts +35 -0
  39. package/src/utils/message-builder.ts +58 -0
  40. package/src/utils/message-parser.ts +27 -0
  41. package/src/utils/registration.ts +35 -0
  42. package/src/utils/tooltip.ts +16 -0
package/README.md CHANGED
@@ -37,54 +37,203 @@ Each message is a line with the author name, a colon, and the message text:
37
37
 
38
38
  Blank lines and lines without a colon are ignored.
39
39
 
40
- ## Built-in Authors
40
+ ## Author Avatars
41
41
 
42
- Two authors have built-in SVG avatars and are pre-configured with a specific side:
42
+ By default, every author gets a **letter avatar** (first character of their name) and appears on the **left** side.
43
43
 
44
- | Author | Side | Bubble Color |
45
- |--------|------|--------------|
46
- | `bbki.ng` | right | light gray |
47
- | `xwy` | left | light pink |
44
+ Use the `setAuthor()` method to customize avatar, side, bubble color, and text color:
48
45
 
49
- Any other author name is placed on the **left** side and receives a letter avatar (first character of the name).
46
+ ```js
47
+ const el = document.querySelector('bb-msg-history');
48
+
49
+ // Emoji avatar, right side
50
+ el.setAuthor('me', { avatar: '🐱', side: 'right' });
51
+
52
+ // Image avatar, custom bubble color
53
+ el.setAuthor('bot', {
54
+ avatar: '<img src="bot.png" width="28" height="28" />',
55
+ side: 'left',
56
+ bubbleColor: '#e0f2fe',
57
+ });
58
+
59
+ // SVG avatar
60
+ el.setAuthor('alice', {
61
+ avatar: '<svg viewBox="0 0 48 48">...</svg>',
62
+ side: 'left',
63
+ });
64
+ ```
65
+
66
+ ### `setAuthor(name, options)`
67
+
68
+ | Option | Type | Default | Description |
69
+ |--------|------|---------|-------------|
70
+ | `avatar` | `string` | letter avatar | HTML string: emoji, `<img>`, `<svg>`, or text |
71
+ | `side` | `'left' \| 'right'` | `'left'` | Which side the bubbles appear on |
72
+ | `bubbleColor` | `string` | `'#f9fafb'` | Bubble background color |
73
+ | `textColor` | `string` | `'#111827'` | Text color inside bubble |
74
+
75
+ Returns `this` for chaining:
76
+
77
+ ```js
78
+ el.setAuthor('me', { avatar: '🐱', side: 'right' })
79
+ .setAuthor('you', { avatar: '🐶', side: 'left' });
80
+ ```
81
+
82
+ Fuzzy matching: if an author name _contains_ a configured key (e.g. you configured `"alice"` and the message is from `"alice(phone)"`), the config is reused.
83
+
84
+ Use `removeAuthor(name)` to remove a custom config.
85
+
86
+ ### `appendMessage(message)`
87
+
88
+ Append a message programmatically with smooth scroll to the new message.
89
+
90
+ | Parameter | Type | Description |
91
+ |-----------|------|-------------|
92
+ | `message.author` | `string` | The author name |
93
+ | `message.text` | `string` | The message text |
94
+
95
+ ```js
96
+ el.appendMessage({ author: 'alice', text: 'Hello!' });
97
+ el.appendMessage({ author: 'bob', text: 'How are you?' });
98
+ ```
99
+
100
+ Returns `this` for chaining. This is ideal for chat applications where messages arrive in real-time.
101
+
102
+ **Note:** Unlike modifying `textContent` directly, `appendMessage()` scrolls smoothly to the newly added message.
103
+
104
+ ## Customization
105
+
106
+ ### CSS Custom Properties
107
+
108
+ | Property | Default | Description |
109
+ |----------|---------|-------------|
110
+ | `--bb-max-height` | `600px` | Maximum height of the message container |
111
+
112
+ ```css
113
+ bb-msg-history {
114
+ --bb-max-height: 400px;
115
+ }
116
+ ```
117
+
118
+ ### Manual Registration
119
+
120
+ By default, the component auto-registers as `<bb-msg-history>`. You can also register manually with a custom tag name:
121
+
122
+ ```js
123
+ import { BBMsgHistory, define } from '@bbki.ng/bb-msg-history';
124
+
125
+ // Register with default tag name
126
+ define();
127
+
128
+ // Or use a custom tag name
129
+ define('my-chat-history');
130
+ ```
50
131
 
51
132
  ## Features
52
133
 
53
134
  - Plain-text message format — no JSON or attributes needed
54
135
  - Left/right bubble layout based on author
55
- - SVG avatars with hover tooltip showing the author name
136
+ - Customizable avatars: emoji, `<img>`, `<svg>`, or letter avatars
137
+ - Hover tooltip showing the author name
138
+ - Consecutive messages from the same author are grouped (avatar hidden)
56
139
  - Auto-scroll to the latest message on render
57
- - Fade-in animation per message row
140
+ - **`appendMessage()` API** programmatically add messages with smooth scroll
141
+ - Long text word-wrap and overflow handling
142
+ - Empty state when no messages are provided
58
143
  - Dark mode support via `prefers-color-scheme`
59
144
  - Mobile responsive layout
60
145
  - `prefers-reduced-motion` support
146
+ - Reactive: automatically re-renders when content changes
147
+ - Customizable max-height via `--bb-max-height` CSS custom property
61
148
  - Graceful degradation to `<pre>` when Custom Elements are unsupported
62
149
 
63
150
  ## Examples
64
151
 
65
- ### Basic conversation
152
+ ### Basic
153
+
154
+ ```html
155
+ <bb-msg-history>
156
+ alice: Hey, are you free this weekend?
157
+ bob: Sounds good! When?
158
+ alice: Saturday morning, around 10?
159
+ bob: Perfect. See you then!
160
+ </bb-msg-history>
161
+ ```
162
+
163
+ ### Custom avatars
164
+
165
+ ```html
166
+ <bb-msg-history id="chat">
167
+ me: Hey there!
168
+ friend: What's up?
169
+ </bb-msg-history>
170
+
171
+ <script>
172
+ const el = document.getElementById('chat');
173
+ el.setAuthor('me', { avatar: '🐱', side: 'right', bubbleColor: '#f3f4f6' });
174
+ el.setAuthor('friend', { avatar: '🐶', side: 'left', bubbleColor: '#e0f2fe' });
175
+ </script>
176
+ ```
177
+
178
+ ### Consecutive messages — avatar grouping
179
+
180
+ When the same author sends multiple messages in a row, the avatar is only shown on the first one:
66
181
 
67
182
  ```html
68
183
  <bb-msg-history>
69
- bbki.ng: 谁呀?
70
- xwy: 谁谁谁,你猴爷爷!
71
- bbki.ng: foo
72
- xwy: bar
184
+ alice: First message
185
+ alice: Second message, avatar hidden
186
+ alice: Third, still hidden
187
+ bob: Got it!
188
+ bob: I'll send two as well
73
189
  </bb-msg-history>
74
190
  ```
75
191
 
76
- ### Unknown / custom authors
192
+ ### Unknown authors letter avatars
77
193
 
78
- Authors not listed in the built-in config receive a letter avatar and appear on the left:
194
+ Authors without custom config receive a letter avatar and appear on the left:
79
195
 
80
196
  ```html
81
197
  <bb-msg-history>
82
- alice: Hey!
198
+ alice: Hello!
83
199
  bob: Hi there!
84
- alice: How are you?
200
+ charlie: Hey everyone!
85
201
  </bb-msg-history>
86
202
  ```
87
203
 
204
+ ### Empty state
205
+
206
+ When no messages are provided, a "No messages" placeholder is shown:
207
+
208
+ ```html
209
+ <bb-msg-history></bb-msg-history>
210
+ ```
211
+
212
+ ### Dynamic message appending
213
+
214
+ Use `appendMessage()` to add messages programmatically with smooth scrolling:
215
+
216
+ ```html
217
+ <bb-msg-history id="chat" style="--bb-max-height: 300px;">
218
+ alice: Hey there!
219
+ </bb-msg-history>
220
+
221
+ <script>
222
+ const el = document.getElementById('chat');
223
+ el.setAuthor('alice', { avatar: '👩', side: 'right' });
224
+ el.setAuthor('bob', { avatar: '👨', side: 'left' });
225
+
226
+ // Add messages dynamically with smooth scroll
227
+ el.appendMessage({ author: 'bob', text: 'Hello! How are you?' });
228
+ el.appendMessage({ author: 'alice', text: 'I\'m doing great!' });
229
+
230
+ // Simulate receiving a message after 2 seconds
231
+ setTimeout(() => {
232
+ el.appendMessage({ author: 'bob', text: 'Nice to hear that!' });
233
+ }, 2000);
234
+ </script>
235
+ ```
236
+
88
237
  ### Full page example
89
238
 
90
239
  ```html
@@ -94,13 +243,19 @@ Authors not listed in the built-in config receive a letter avatar and appear on
94
243
  <script type="module" src="https://cdn.jsdelivr.net/npm/@bbki.ng/bb-msg-history@latest/dist/index.js"></script>
95
244
  </head>
96
245
  <body>
97
- <bb-msg-history>
246
+ <bb-msg-history id="chat">
98
247
  alice: Hey, are you free this weekend?
99
248
  bob: Yeah, what's up?
100
249
  alice: Want to grab coffee?
101
250
  bob: Sounds good! Saturday morning?
102
251
  alice: Perfect, see you then!
103
252
  </bb-msg-history>
253
+
254
+ <script>
255
+ const el = document.getElementById('chat');
256
+ el.setAuthor('alice', { avatar: '👩', side: 'right' });
257
+ el.setAuthor('bob', { avatar: '👨', side: 'left', bubbleColor: '#ecfdf5' });
258
+ </script>
104
259
  </body>
105
260
  </html>
106
261
  ```
@@ -0,0 +1,35 @@
1
+ import type { AuthorOptions, Message } from './types/index.js';
2
+ export declare class BBMsgHistory extends HTMLElement {
3
+ private _mutationObserver?;
4
+ private _userAuthors;
5
+ private _lastAuthor;
6
+ constructor();
7
+ /**
8
+ * Configure an author's avatar, side, and colors.
9
+ * Call before or after rendering — the component re-renders automatically.
10
+ *
11
+ * @example
12
+ * el.setAuthor('alice', { avatar: '🐱', side: 'right', bubbleColor: '#e0f2fe' });
13
+ * el.setAuthor('bob', { avatar: '<img src="bob.png" />', side: 'left' });
14
+ */
15
+ setAuthor(name: string, options: AuthorOptions): this;
16
+ /**
17
+ * Remove a previously set author config.
18
+ */
19
+ removeAuthor(name: string): this;
20
+ /**
21
+ * Append a message to the history.
22
+ * Automatically scrolls to the new message with smooth animation.
23
+ *
24
+ * @example
25
+ * el.appendMessage({ author: 'alice', text: 'Hello!' });
26
+ * el.appendMessage({ author: 'bob', text: 'How are you?' });
27
+ */
28
+ appendMessage(message: Message): this;
29
+ private _appendSingleMessage;
30
+ connectedCallback(): void;
31
+ disconnectedCallback(): void;
32
+ private _setupMutationObserver;
33
+ private render;
34
+ private _renderEmpty;
35
+ }
@@ -0,0 +1,141 @@
1
+ import { MAIN_STYLES, EMPTY_STYLES } from './const/styles.js';
2
+ import { parseMessages } from './utils/message-parser.js';
3
+ import { resolveAuthorConfig } from './utils/author-resolver.js';
4
+ import { setupTooltips } from './utils/tooltip.js';
5
+ import { buildMessageRowHtml, setupTooltipForElement } from './utils/message-builder.js';
6
+ export class BBMsgHistory extends HTMLElement {
7
+ constructor() {
8
+ super();
9
+ this._userAuthors = new Map();
10
+ this._lastAuthor = '';
11
+ this.attachShadow({ mode: 'open' });
12
+ }
13
+ /**
14
+ * Configure an author's avatar, side, and colors.
15
+ * Call before or after rendering — the component re-renders automatically.
16
+ *
17
+ * @example
18
+ * el.setAuthor('alice', { avatar: '🐱', side: 'right', bubbleColor: '#e0f2fe' });
19
+ * el.setAuthor('bob', { avatar: '<img src="bob.png" />', side: 'left' });
20
+ */
21
+ setAuthor(name, options) {
22
+ this._userAuthors.set(name, options);
23
+ this.render();
24
+ return this;
25
+ }
26
+ /**
27
+ * Remove a previously set author config.
28
+ */
29
+ removeAuthor(name) {
30
+ this._userAuthors.delete(name);
31
+ this.render();
32
+ return this;
33
+ }
34
+ /**
35
+ * Append a message to the history.
36
+ * Automatically scrolls to the new message with smooth animation.
37
+ *
38
+ * @example
39
+ * el.appendMessage({ author: 'alice', text: 'Hello!' });
40
+ * el.appendMessage({ author: 'bob', text: 'How are you?' });
41
+ */
42
+ appendMessage(message) {
43
+ // Update textContent
44
+ const currentText = this.textContent || '';
45
+ const separator = currentText && !currentText.endsWith('\n') ? '\n' : '';
46
+ this.textContent = currentText + separator + `${message.author}: ${message.text}`;
47
+ // Temporarily disconnect observer to prevent recursive render
48
+ this._mutationObserver?.disconnect();
49
+ // Append single message without re-rendering entire list
50
+ this._appendSingleMessage(message);
51
+ // Reconnect observer
52
+ this._setupMutationObserver();
53
+ return this;
54
+ }
55
+ _appendSingleMessage(message) {
56
+ const container = this.shadowRoot.querySelector('.history');
57
+ // If empty state or no container, do full render first
58
+ if (!container) {
59
+ this.render();
60
+ return;
61
+ }
62
+ const author = message.author;
63
+ const text = message.text;
64
+ const config = resolveAuthorConfig(author, this._userAuthors);
65
+ const isFirstFromAuthor = author !== this._lastAuthor;
66
+ this._lastAuthor = author;
67
+ const isSubsequent = !isFirstFromAuthor;
68
+ // Use utility function to build message HTML
69
+ const msgHtml = buildMessageRowHtml(author, text, config, isSubsequent);
70
+ // Append to container
71
+ container.insertAdjacentHTML('beforeend', msgHtml);
72
+ // Setup tooltip for new element using utility function
73
+ const newWrapper = container.lastElementChild?.querySelector('.avatar-wrapper');
74
+ if (newWrapper) {
75
+ setupTooltipForElement(newWrapper);
76
+ }
77
+ // Smooth scroll to bottom
78
+ container.scrollTo({
79
+ top: container.scrollHeight,
80
+ behavior: 'smooth'
81
+ });
82
+ }
83
+ connectedCallback() {
84
+ this.render();
85
+ this._setupMutationObserver();
86
+ }
87
+ disconnectedCallback() {
88
+ this._mutationObserver?.disconnect();
89
+ }
90
+ _setupMutationObserver() {
91
+ let debounceTimer;
92
+ this._mutationObserver = new MutationObserver(() => {
93
+ clearTimeout(debounceTimer);
94
+ debounceTimer = setTimeout(() => this.render(), 50);
95
+ });
96
+ this._mutationObserver.observe(this, {
97
+ childList: true,
98
+ characterData: true,
99
+ subtree: true,
100
+ });
101
+ }
102
+ render() {
103
+ const messages = parseMessages(this.textContent);
104
+ if (messages.length === 0) {
105
+ this._lastAuthor = '';
106
+ this._renderEmpty();
107
+ return;
108
+ }
109
+ let lastAuthor = '';
110
+ const messagesHtml = messages
111
+ .map(({ author, text }) => {
112
+ const config = resolveAuthorConfig(author, this._userAuthors);
113
+ const isFirstFromAuthor = author !== lastAuthor;
114
+ lastAuthor = author;
115
+ const isSubsequent = !isFirstFromAuthor;
116
+ // Use utility function to build message HTML
117
+ return buildMessageRowHtml(author, text, config, isSubsequent);
118
+ })
119
+ .join('');
120
+ this._lastAuthor = lastAuthor;
121
+ this.shadowRoot.innerHTML = `
122
+ <style>${MAIN_STYLES}</style>
123
+ <div class="history" role="log" aria-live="polite" aria-label="Message history">
124
+ ${messagesHtml}
125
+ </div>
126
+ `;
127
+ requestAnimationFrame(() => {
128
+ const container = this.shadowRoot.querySelector('.history');
129
+ if (container) {
130
+ container.scrollTop = container.scrollHeight;
131
+ }
132
+ setupTooltips(this.shadowRoot);
133
+ });
134
+ }
135
+ _renderEmpty() {
136
+ this.shadowRoot.innerHTML = `
137
+ <style>${EMPTY_STYLES}</style>
138
+ <div class="empty-state">No messages</div>
139
+ `;
140
+ }
141
+ }
@@ -0,0 +1,10 @@
1
+ import type { AuthorConfig } from '../types/index.js';
2
+ /**
3
+ * Built-in author configurations (secret presets)
4
+ * These are used for specific authors in personal projects
5
+ */
6
+ export declare const AUTHOR_CONFIG: Record<string, Omit<AuthorConfig, 'isCustomAvatar'>>;
7
+ /**
8
+ * Authors that should use first-character avatar instead of SVG
9
+ */
10
+ export declare const FIRST_CHAR_AVATAR_AUTHORS: Set<string>;
@@ -0,0 +1,29 @@
1
+ import { THEME } from './theme.js';
2
+ /**
3
+ * Built-in author configurations (secret presets)
4
+ * These are used for specific authors in personal projects
5
+ */
6
+ export const AUTHOR_CONFIG = {
7
+ 'bbki.ng': {
8
+ avatar: `<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 48 48" fill="none"><path d="M29.1152 21.3106C32.0605 21.3106 34.4481 18.9101 34.4481 15.9489V24.6457C34.4481 25.7585 33.5508 26.6607 32.444 26.6607H15.1207C14.0138 26.6607 13.1166 25.7585 13.1166 24.6457V15.9489C13.1166 18.9101 15.5042 21.3106 18.4494 21.3106C21.3947 21.3106 23.7823 18.9101 23.7823 15.9489C23.7823 18.9101 26.17 21.3106 29.1152 21.3106Z" fill="${THEME.gray[400]}"/><path d="M23.7823 15.9373L23.7823 15.9489C23.7823 15.9451 23.7823 15.9412 23.7823 15.9373Z" fill="${THEME.gray[400]}"/><path d="M23.1143 28.004C23.1205 30.9598 25.5057 33.3541 28.4472 33.3541C31.3886 33.3541 33.7738 30.9598 33.7801 28.004H23.1143Z" fill="${THEME.gray[400]}"/><path d="M13.7846 28.004C13.7846 28.0079 13.7846 28.0117 13.7846 28.0156C13.7908 30.9714 16.1761 33.3657 19.1175 33.3657C22.0589 33.3657 24.4442 30.9714 24.4504 28.0156H13.7846V28.004Z" fill="${THEME.gray[400]}"/><path d="M14.4527 15.9373C14.4527 16.6792 13.8545 17.2806 13.1166 17.2806C12.3786 17.2806 11.7805 16.6792 11.7805 15.9373C11.7805 15.1954 12.3786 14.594 13.1166 14.594C13.8545 14.594 14.4527 15.1954 14.4527 15.9373Z" fill="${THEME.gray[400]}"/><path d="M25.1184 15.2657C25.1184 16.0076 24.5202 16.609 23.7823 16.609C23.0444 16.609 22.4462 16.0076 22.4462 15.2657C22.4462 14.5238 23.0444 13.9224 23.7823 13.9224C24.5202 13.9224 25.1184 14.5238 25.1184 15.2657Z" fill="${THEME.gray[400]}"/><path d="M35.7842 15.9373C35.7842 16.6792 35.186 17.2806 34.4481 17.2806C33.7102 17.2806 33.112 16.6792 33.112 15.9373C33.112 15.1954 33.7102 14.594 34.4481 14.594C35.186 14.594 35.7842 15.1954 35.7842 15.9373Z" fill="${THEME.gray[400]}"/></svg>`,
9
+ bubbleColor: THEME.gray[100],
10
+ textColor: THEME.gray[900],
11
+ side: 'right'
12
+ },
13
+ 'xwy': {
14
+ avatar: `<svg width="28" height="28" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.821 17.5305C10.709 18.17 9.68345 19.4423 9.22624 20.1359C9.11159 20.3099 9.21615 20.5428 9.42038 20.5839L12.67 21.2381C12.8291 21.2702 12.9328 21.4275 12.9084 21.5879C11.3004 32.1653 21.5275 36.7547 28.6638 33.0597C28.7443 33.018 28.8408 33.0139 28.9245 33.0487C32.8032 34.6598 35.967 34.5662 37.8217 34.3099C38.131 34.2671 38.1505 33.841 37.855 33.7401C29.1343 30.7633 26.0152 24.5245 25.5144 18.8022C25.3835 17.3066 23.8172 13.2016 19.2675 13.0058C15.7934 12.8563 13.6137 15.6103 13.0319 17.325C12.9986 17.4231 12.9201 17.5004 12.821 17.5305Z" fill="${THEME.yyPink[100]}"/><circle cx="17.6178" cy="18.2688" r="0.995689" fill="white"/></svg>`,
15
+ bubbleColor: THEME.yyPink[50],
16
+ textColor: THEME.gray[900],
17
+ side: 'left'
18
+ },
19
+ '小乌鸦': {
20
+ avatar: `<svg width="28" height="28" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.821 17.5305C10.709 18.17 9.68345 19.4423 9.22624 20.1359C9.11159 20.3099 9.21615 20.5428 9.42038 20.5839L12.67 21.2381C12.8291 21.2702 12.9328 21.4275 12.9084 21.5879C11.3004 32.1653 21.5275 36.7547 28.6638 33.0597C28.7443 33.018 28.8408 33.0139 28.9245 33.0487C32.8032 34.6598 35.967 34.5662 37.8217 34.3099C38.131 34.2671 38.1505 33.841 37.855 33.7401C29.1343 30.7633 26.0152 24.5245 25.5144 18.8022C25.3835 17.3066 23.8172 13.2016 19.2675 13.0058C15.7934 12.8563 13.6137 15.6103 13.0319 17.325C12.9986 17.4231 12.9201 17.5004 12.821 17.5305Z" fill="${THEME.yyPink[100]}"/><circle cx="17.6178" cy="18.2688" r="0.995689" fill="white"/></svg>`,
21
+ bubbleColor: THEME.yyPink[50],
22
+ textColor: THEME.gray[900],
23
+ side: 'left'
24
+ }
25
+ };
26
+ /**
27
+ * Authors that should use first-character avatar instead of SVG
28
+ */
29
+ export const FIRST_CHAR_AVATAR_AUTHORS = new Set(['小乌鸦']);
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Main component styles
3
+ */
4
+ export declare const MAIN_STYLES: string;
5
+ /**
6
+ * Empty state styles
7
+ */
8
+ export declare const EMPTY_STYLES: string;
9
+ /**
10
+ * Fallback styles for when custom elements are not supported
11
+ */
12
+ export declare const FALLBACK_STYLES: string;