@happyvertical/smrt-chat 0.34.5 → 0.34.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/manifest.json +2 -2
- package/dist/smrt-knowledge.json +4 -4
- package/dist/svelte/components/agent/AgentChat.svelte +23 -26
- package/dist/svelte/components/agent/AgentChat.svelte.d.ts.map +1 -1
- package/dist/svelte/components/agent/AgentSelector.svelte +1 -0
- package/dist/svelte/components/agent/AgentSelector.svelte.d.ts.map +1 -1
- package/dist/svelte/components/agent/AgentSessionPanel.svelte +15 -16
- package/dist/svelte/components/agent/AgentSessionPanel.svelte.d.ts.map +1 -1
- package/dist/svelte/components/agent/ToolCallDisplay.svelte +1 -0
- package/dist/svelte/components/agent/ToolCallDisplay.svelte.d.ts.map +1 -1
- package/dist/svelte/components/dialogs/RoomCreateDialog.svelte +9 -44
- package/dist/svelte/components/dialogs/RoomCreateDialog.svelte.d.ts.map +1 -1
- package/dist/svelte/components/dialogs/SearchMessages.svelte +23 -24
- package/dist/svelte/components/dialogs/SearchMessages.svelte.d.ts.map +1 -1
- package/dist/svelte/components/layout/ChatLayout.svelte +1 -0
- package/dist/svelte/components/layout/ChatLayout.svelte.d.ts.map +1 -1
- package/dist/svelte/components/layout/MemberList.svelte +10 -15
- package/dist/svelte/components/layout/MemberList.svelte.d.ts.map +1 -1
- package/dist/svelte/components/layout/RoomHeader.svelte +13 -16
- package/dist/svelte/components/layout/RoomHeader.svelte.d.ts.map +1 -1
- package/dist/svelte/components/layout/RoomList.svelte +26 -17
- package/dist/svelte/components/layout/RoomList.svelte.d.ts.map +1 -1
- package/dist/svelte/components/messages/MessageInput.svelte +17 -20
- package/dist/svelte/components/messages/MessageInput.svelte.d.ts.map +1 -1
- package/dist/svelte/components/messages/MessageItem.svelte +45 -40
- package/dist/svelte/components/messages/MessageItem.svelte.d.ts.map +1 -1
- package/dist/svelte/components/messages/ThreadPanel.svelte +9 -9
- package/dist/svelte/components/messages/ThreadPanel.svelte.d.ts.map +1 -1
- package/dist/svelte/components/shared/FileUpload.svelte +22 -54
- package/dist/svelte/components/shared/FileUpload.svelte.d.ts.map +1 -1
- package/dist/svelte/components/shared/MentionAutocomplete.svelte +1 -0
- package/dist/svelte/components/shared/MentionAutocomplete.svelte.d.ts.map +1 -1
- package/dist/svelte/components/shared/ReactionPicker.svelte +8 -21
- package/dist/svelte/components/shared/ReactionPicker.svelte.d.ts.map +1 -1
- package/dist/svelte/components/tabs/ChatTab.svelte +20 -18
- package/dist/svelte/components/tabs/ChatTab.svelte.d.ts.map +1 -1
- package/dist/svelte/components/tabs/ChatTabList.svelte +13 -10
- package/dist/svelte/components/tabs/ChatTabList.svelte.d.ts.map +1 -1
- package/dist/svelte/components/tabs/MiniChat.svelte +11 -17
- package/dist/svelte/components/tabs/MiniChat.svelte.d.ts.map +1 -1
- package/package.json +9 -8
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Supports file type filtering and max size constraints.
|
|
6
6
|
*/
|
|
7
7
|
import { useI18n } from '@happyvertical/smrt-ui/i18n';
|
|
8
|
+
import { Button } from '@happyvertical/smrt-ui/ui';
|
|
8
9
|
import { M } from '../../i18n.js';
|
|
9
10
|
|
|
10
11
|
const { t } = useI18n();
|
|
@@ -116,7 +117,9 @@ function getFileIcon(type: string): string {
|
|
|
116
117
|
<span class="file-upload__file-name">{file.name}</span>
|
|
117
118
|
<span class="file-upload__file-size">{formatSize(file.size)}</span>
|
|
118
119
|
</div>
|
|
119
|
-
<
|
|
120
|
+
<Button
|
|
121
|
+
variant="ghost"
|
|
122
|
+
size="sm"
|
|
120
123
|
class="file-upload__file-remove"
|
|
121
124
|
type="button"
|
|
122
125
|
onclick={() => removePending(i)}
|
|
@@ -125,25 +128,27 @@ function getFileIcon(type: string): string {
|
|
|
125
128
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
126
129
|
<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" />
|
|
127
130
|
</svg>
|
|
128
|
-
</
|
|
131
|
+
</Button>
|
|
129
132
|
</div>
|
|
130
133
|
{/each}
|
|
131
134
|
|
|
132
135
|
<div class="file-upload__preview-actions">
|
|
133
|
-
<
|
|
134
|
-
|
|
136
|
+
<Button
|
|
137
|
+
variant="primary"
|
|
138
|
+
size="sm"
|
|
135
139
|
type="button"
|
|
136
140
|
onclick={confirmUpload}
|
|
137
141
|
>
|
|
138
142
|
{t(M['chat.file_upload.upload_files'], { count: pendingFiles.length, plural: pendingFiles.length !== 1 ? 's' : '' })}
|
|
139
|
-
</
|
|
140
|
-
<
|
|
141
|
-
|
|
143
|
+
</Button>
|
|
144
|
+
<Button
|
|
145
|
+
variant="secondary"
|
|
146
|
+
size="sm"
|
|
142
147
|
type="button"
|
|
143
148
|
onclick={() => { pendingFiles = []; sizeError = ''; }}
|
|
144
149
|
>
|
|
145
150
|
Clear
|
|
146
|
-
</
|
|
151
|
+
</Button>
|
|
147
152
|
</div>
|
|
148
153
|
</div>
|
|
149
154
|
{/if}
|
|
@@ -302,22 +307,19 @@ function getFileIcon(type: string): string {
|
|
|
302
307
|
color: var(--smrt-color-outline, #74777f);
|
|
303
308
|
}
|
|
304
309
|
|
|
305
|
-
.
|
|
306
|
-
|
|
307
|
-
align-items: center;
|
|
308
|
-
justify-content: center;
|
|
310
|
+
/* :global() pierces into the Button child's rendered <button> (see #1589). */
|
|
311
|
+
.file-upload__file :global(.file-upload__file-remove) {
|
|
309
312
|
width: 24px;
|
|
310
313
|
height: 24px;
|
|
311
|
-
|
|
314
|
+
padding: 0;
|
|
312
315
|
background: none;
|
|
313
316
|
color: var(--smrt-color-on-surface-variant, #43474e);
|
|
314
|
-
cursor: pointer;
|
|
315
317
|
border-radius: var(--smrt-radius-full, 9999px);
|
|
316
318
|
flex-shrink: 0;
|
|
317
319
|
transition: background var(--smrt-duration-short2, 150ms);
|
|
318
320
|
}
|
|
319
321
|
|
|
320
|
-
.file-upload__file-remove:hover {
|
|
322
|
+
.file-upload__file :global(.file-upload__file-remove:hover) {
|
|
321
323
|
background: var(--smrt-color-error-container, #ffdad6);
|
|
322
324
|
color: var(--smrt-color-error, #ba1a1a);
|
|
323
325
|
}
|
|
@@ -328,41 +330,6 @@ function getFileIcon(type: string): string {
|
|
|
328
330
|
padding-top: var(--smrt-spacing-1, 4px);
|
|
329
331
|
}
|
|
330
332
|
|
|
331
|
-
.file-upload__confirm-btn {
|
|
332
|
-
padding: var(--smrt-spacing-2, 8px) var(--smrt-spacing-4, 16px);
|
|
333
|
-
border: none;
|
|
334
|
-
border-radius: var(--smrt-radius-full, 9999px);
|
|
335
|
-
background: var(--smrt-color-primary, #005ac1);
|
|
336
|
-
color: var(--smrt-color-on-primary, #ffffff);
|
|
337
|
-
font: var(--smrt-typography-label-large-font, 500 0.875rem/1.25 sans-serif);
|
|
338
|
-
cursor: pointer;
|
|
339
|
-
transition: opacity var(--smrt-duration-short2, 150ms);
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
.file-upload__confirm-btn:hover {
|
|
343
|
-
opacity: 0.85;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
.file-upload__confirm-btn:focus-visible {
|
|
347
|
-
outline: 2px solid var(--smrt-color-primary, #005ac1);
|
|
348
|
-
outline-offset: 2px;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
.file-upload__clear-btn {
|
|
352
|
-
padding: var(--smrt-spacing-2, 8px) var(--smrt-spacing-4, 16px);
|
|
353
|
-
border: 1px solid var(--smrt-color-outline, #74777f);
|
|
354
|
-
border-radius: var(--smrt-radius-full, 9999px);
|
|
355
|
-
background: transparent;
|
|
356
|
-
color: var(--smrt-color-on-surface-variant, #43474e);
|
|
357
|
-
font: var(--smrt-typography-label-large-font, 500 0.875rem/1.25 sans-serif);
|
|
358
|
-
cursor: pointer;
|
|
359
|
-
transition: background var(--smrt-duration-short2, 150ms);
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
.file-upload__clear-btn:hover {
|
|
363
|
-
background: var(--smrt-color-surface-variant, #e1e2ec);
|
|
364
|
-
}
|
|
365
|
-
|
|
366
333
|
.file-upload__error {
|
|
367
334
|
padding: var(--smrt-spacing-2, 8px) var(--smrt-spacing-3, 12px);
|
|
368
335
|
border-radius: var(--smrt-radius-small, 4px);
|
|
@@ -372,10 +339,11 @@ function getFileIcon(type: string): string {
|
|
|
372
339
|
}
|
|
373
340
|
|
|
374
341
|
@media (prefers-reduced-motion: reduce) {
|
|
375
|
-
.file-upload__drop-zone
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
342
|
+
.file-upload__drop-zone {
|
|
343
|
+
transition: none;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.file-upload__file :global(.file-upload__file-remove) {
|
|
379
347
|
transition: none;
|
|
380
348
|
}
|
|
381
349
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUpload.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/shared/FileUpload.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FileUpload.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/shared/FileUpload.svelte.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,KAAK;IACpB,uCAAuC;IACvC,QAAQ,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IACpC,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA0JD,QAAA,MAAM,UAAU,2CAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
|
|
@@ -84,6 +84,7 @@ function highlightMatch(
|
|
|
84
84
|
>
|
|
85
85
|
{#each suggestions as suggestion, i (suggestion.id)}
|
|
86
86
|
{@const parts = highlightMatch(suggestion.name, query)}
|
|
87
|
+
<!-- raw-primitive-allow: role=option in a hand-rolled autocomplete listbox with roving active-index keyboard navigation (ArrowUp/Down/Enter/Tab) and onpointerenter active sync, wrapping rich content (avatar, highlighted name); no Button primitive owns this structural listbox-option pattern -->
|
|
87
88
|
<button
|
|
88
89
|
class="mention-autocomplete__item"
|
|
89
90
|
class:mention-autocomplete__item--active={i === activeIndex}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MentionAutocomplete.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/shared/MentionAutocomplete.svelte.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,KAAK;IACpB,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,WAAW,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrE,0BAA0B;IAC1B,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,mCAAmC;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;
|
|
1
|
+
{"version":3,"file":"MentionAutocomplete.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/shared/MentionAutocomplete.svelte.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,KAAK;IACpB,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,WAAW,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrE,0BAA0B;IAC1B,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,mCAAmC;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAkFD,QAAA,MAAM,mBAAmB,2CAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Compact popup grid of common emojis.
|
|
5
5
|
*/
|
|
6
6
|
import { useI18n } from '@happyvertical/smrt-ui/i18n';
|
|
7
|
+
import { Button } from '@happyvertical/smrt-ui/ui';
|
|
7
8
|
import { M } from '../../i18n.js';
|
|
8
9
|
|
|
9
10
|
const { t } = useI18n();
|
|
@@ -39,26 +40,21 @@ const emojis = [
|
|
|
39
40
|
function handleSelect(emoji: string) {
|
|
40
41
|
onreact(emoji);
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
-
function handleKeydown(event: KeyboardEvent, emoji: string) {
|
|
44
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
45
|
-
event.preventDefault();
|
|
46
|
-
handleSelect(emoji);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
43
|
</script>
|
|
50
44
|
|
|
51
45
|
{#if isOpen}
|
|
52
46
|
<div class="reaction-picker" role="group" aria-label={t(M['chat.reaction_picker.reactions'])}>
|
|
53
47
|
{#each emojis as emoji}
|
|
54
|
-
<
|
|
48
|
+
<Button
|
|
49
|
+
variant="ghost"
|
|
50
|
+
size="sm"
|
|
55
51
|
class="reaction-picker__item"
|
|
56
52
|
type="button"
|
|
57
53
|
onclick={() => handleSelect(emoji)}
|
|
58
54
|
aria-label={t(M['chat.reaction_picker.react_with'], { emoji })}
|
|
59
55
|
>
|
|
60
56
|
{emoji}
|
|
61
|
-
</
|
|
57
|
+
</Button>
|
|
62
58
|
{/each}
|
|
63
59
|
</div>
|
|
64
60
|
{/if}
|
|
@@ -76,28 +72,19 @@ function handleKeydown(event: KeyboardEvent, emoji: string) {
|
|
|
76
72
|
width: max-content;
|
|
77
73
|
}
|
|
78
74
|
|
|
79
|
-
.
|
|
80
|
-
|
|
81
|
-
align-items: center;
|
|
82
|
-
justify-content: center;
|
|
75
|
+
/* :global() pierces into each Button's rendered <button> (see #1589). */
|
|
76
|
+
.reaction-picker :global(.reaction-picker__item) {
|
|
83
77
|
width: 32px;
|
|
84
78
|
height: 32px;
|
|
85
|
-
border: none;
|
|
86
79
|
border-radius: var(--smrt-radius-small, 0.25rem);
|
|
87
80
|
background: transparent;
|
|
88
|
-
cursor: pointer;
|
|
89
81
|
font-size: var(--smrt-typography-body-large-size, 1.125rem);
|
|
90
82
|
line-height: 1;
|
|
91
83
|
padding: 0;
|
|
92
84
|
transition: background var(--smrt-duration-short2, 150ms) var(--smrt-easing-standard, ease);
|
|
93
85
|
}
|
|
94
86
|
|
|
95
|
-
.reaction-picker__item:hover {
|
|
87
|
+
.reaction-picker :global(.reaction-picker__item:hover) {
|
|
96
88
|
background: var(--smrt-color-surface-container-high, #e1e3e8);
|
|
97
89
|
}
|
|
98
|
-
|
|
99
|
-
.reaction-picker__item:focus-visible {
|
|
100
|
-
outline: 2px solid var(--smrt-color-primary, #005ac1);
|
|
101
|
-
outline-offset: -2px;
|
|
102
|
-
}
|
|
103
90
|
</style>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactionPicker.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/shared/ReactionPicker.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ReactionPicker.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/shared/ReactionPicker.svelte.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,KAAK;IACpB,yCAAyC;IACzC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,oCAAoC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAkDD,QAAA,MAAM,cAAc,2CAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Expands upward from the bottom tab bar.
|
|
6
6
|
*/
|
|
7
7
|
import { useI18n } from '@happyvertical/smrt-ui/i18n';
|
|
8
|
+
import { Button } from '@happyvertical/smrt-ui/ui';
|
|
8
9
|
import { M } from '../../i18n.messages.js';
|
|
9
10
|
import type { ChatMessageData, ChatTabState } from '../../types.js';
|
|
10
11
|
import Avatar from '../shared/Avatar.svelte';
|
|
@@ -43,6 +44,7 @@ const {
|
|
|
43
44
|
{#if tab.isExpanded}
|
|
44
45
|
<div class="chat-tab chat-tab--expanded" aria-label={t(M['chat.chat_tab.chat_with'], { name: tab.room.name })}>
|
|
45
46
|
<div class="chat-tab__header">
|
|
47
|
+
<!-- raw-primitive-allow: pressable header title wrapping rich content (room avatar component and name) that collapses the chat window on click; no Button primitive owns this structural avatar-header pattern -->
|
|
46
48
|
<button
|
|
47
49
|
class="chat-tab__header-btn"
|
|
48
50
|
type="button"
|
|
@@ -58,7 +60,9 @@ const {
|
|
|
58
60
|
</button>
|
|
59
61
|
|
|
60
62
|
<div class="chat-tab__actions">
|
|
61
|
-
<
|
|
63
|
+
<Button
|
|
64
|
+
variant="ghost"
|
|
65
|
+
size="sm"
|
|
62
66
|
class="chat-tab__icon-btn"
|
|
63
67
|
type="button"
|
|
64
68
|
onclick={oncollapse}
|
|
@@ -68,8 +72,10 @@ const {
|
|
|
68
72
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
|
|
69
73
|
<rect x="3" y="12" width="10" height="2" rx="1" />
|
|
70
74
|
</svg>
|
|
71
|
-
</
|
|
72
|
-
<
|
|
75
|
+
</Button>
|
|
76
|
+
<Button
|
|
77
|
+
variant="ghost"
|
|
78
|
+
size="sm"
|
|
73
79
|
class="chat-tab__icon-btn"
|
|
74
80
|
type="button"
|
|
75
81
|
onclick={onclose}
|
|
@@ -79,7 +85,7 @@ const {
|
|
|
79
85
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
|
|
80
86
|
<path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z" />
|
|
81
87
|
</svg>
|
|
82
|
-
</
|
|
88
|
+
</Button>
|
|
83
89
|
</div>
|
|
84
90
|
</div>
|
|
85
91
|
|
|
@@ -93,6 +99,7 @@ const {
|
|
|
93
99
|
</div>
|
|
94
100
|
</div>
|
|
95
101
|
{:else}
|
|
102
|
+
<!-- raw-primitive-allow: large pressable collapsed-tab card wrapping rich content (room avatar component, name, unread badge) that expands the chat window on click; no Button primitive owns this structural selection-card pattern -->
|
|
96
103
|
<button
|
|
97
104
|
class="chat-tab chat-tab--collapsed"
|
|
98
105
|
type="button"
|
|
@@ -164,29 +171,21 @@ const {
|
|
|
164
171
|
flex-shrink: 0;
|
|
165
172
|
}
|
|
166
173
|
|
|
167
|
-
.
|
|
168
|
-
|
|
169
|
-
align-items: center;
|
|
170
|
-
justify-content: center;
|
|
174
|
+
/* :global() pierces into each Button's rendered <button> (see #1589). */
|
|
175
|
+
.chat-tab__actions :global(.chat-tab__icon-btn) {
|
|
171
176
|
width: 28px;
|
|
172
177
|
height: 28px;
|
|
173
|
-
|
|
178
|
+
padding: 0;
|
|
174
179
|
background: none;
|
|
175
180
|
color: inherit;
|
|
176
|
-
cursor: pointer;
|
|
177
181
|
border-radius: var(--smrt-radius-full, 9999px);
|
|
178
182
|
transition: background var(--smrt-duration-short2, 150ms);
|
|
179
183
|
}
|
|
180
184
|
|
|
181
|
-
.chat-tab__icon-btn:hover {
|
|
185
|
+
.chat-tab__actions :global(.chat-tab__icon-btn:hover) {
|
|
182
186
|
background: color-mix(in srgb, var(--smrt-color-on-primary) 15%, transparent);
|
|
183
187
|
}
|
|
184
188
|
|
|
185
|
-
.chat-tab__icon-btn:focus-visible {
|
|
186
|
-
outline: 2px solid var(--smrt-color-on-primary, #ffffff);
|
|
187
|
-
outline-offset: -2px;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
189
|
.chat-tab__body {
|
|
191
190
|
flex: 1;
|
|
192
191
|
min-height: 0;
|
|
@@ -232,8 +231,11 @@ const {
|
|
|
232
231
|
}
|
|
233
232
|
|
|
234
233
|
@media (prefers-reduced-motion: reduce) {
|
|
235
|
-
.chat-tab--collapsed
|
|
236
|
-
|
|
234
|
+
.chat-tab--collapsed {
|
|
235
|
+
transition: none;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.chat-tab__actions :global(.chat-tab__icon-btn) {
|
|
237
239
|
transition: none;
|
|
238
240
|
}
|
|
239
241
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatTab.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/tabs/ChatTab.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChatTab.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/tabs/ChatTab.svelte.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAKpE,MAAM,WAAW,KAAK;IACpB,gBAAgB;IAChB,GAAG,EAAE,YAAY,CAAC;IAClB,4BAA4B;IAC5B,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,gCAAgC;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,qBAAqB;IACrB,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,wBAAwB;IACxB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,qBAAqB;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,sBAAsB;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAkED,QAAA,MAAM,OAAO,2CAAwC,CAAC;AACtD,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1C,eAAe,OAAO,CAAC"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Horizontal bar of small avatars/names at bottom. Shows unread badges.
|
|
5
5
|
*/
|
|
6
6
|
import { useI18n } from '@happyvertical/smrt-ui/i18n';
|
|
7
|
+
import { Button } from '@happyvertical/smrt-ui/ui';
|
|
7
8
|
import { M } from '../../i18n.messages.js';
|
|
8
9
|
import type { ChatTabState } from '../../types.js';
|
|
9
10
|
import Avatar from '../shared/Avatar.svelte';
|
|
@@ -26,6 +27,7 @@ const { tabs, onselect, onclose }: Props = $props();
|
|
|
26
27
|
<nav class="tab-list" aria-label={t(M['chat.chat_tab_list.minimized_chats'])}>
|
|
27
28
|
{#each tabs as tab (tab.roomId)}
|
|
28
29
|
<div class="tab-list__item">
|
|
30
|
+
<!-- raw-primitive-allow: pressable circular avatar tab wrapping rich content (room avatar component and overlaid unread badge) that opens the chat on click; no Button primitive owns this structural avatar-tab pattern -->
|
|
29
31
|
<button
|
|
30
32
|
class="tab-list__btn"
|
|
31
33
|
type="button"
|
|
@@ -44,7 +46,9 @@ const { tabs, onselect, onclose }: Props = $props();
|
|
|
44
46
|
</span>
|
|
45
47
|
{/if}
|
|
46
48
|
</button>
|
|
47
|
-
<
|
|
49
|
+
<Button
|
|
50
|
+
variant="ghost"
|
|
51
|
+
size="sm"
|
|
48
52
|
class="tab-list__close"
|
|
49
53
|
type="button"
|
|
50
54
|
onclick={(e) => { e.stopPropagation(); onclose(tab.roomId); }}
|
|
@@ -54,7 +58,7 @@ const { tabs, onselect, onclose }: Props = $props();
|
|
|
54
58
|
<svg width="12" height="12" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
|
|
55
59
|
<path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z" />
|
|
56
60
|
</svg>
|
|
57
|
-
</
|
|
61
|
+
</Button>
|
|
58
62
|
</div>
|
|
59
63
|
{/each}
|
|
60
64
|
</nav>
|
|
@@ -119,33 +123,32 @@ const { tabs, onselect, onclose }: Props = $props();
|
|
|
119
123
|
border: 2px solid var(--smrt-color-surface, #fefbff);
|
|
120
124
|
}
|
|
121
125
|
|
|
122
|
-
.
|
|
126
|
+
/* :global() pierces into the Button child's rendered <button> (see #1589). */
|
|
127
|
+
.tab-list__item :global(.tab-list__close) {
|
|
123
128
|
display: none;
|
|
124
129
|
position: absolute;
|
|
125
130
|
top: -4px;
|
|
126
131
|
right: -4px;
|
|
127
132
|
width: 18px;
|
|
128
133
|
height: 18px;
|
|
129
|
-
align-items: center;
|
|
130
|
-
justify-content: center;
|
|
131
|
-
border: none;
|
|
132
134
|
background: var(--smrt-color-surface-variant, #e1e2ec);
|
|
133
135
|
color: var(--smrt-color-on-surface-variant, #43474e);
|
|
134
136
|
border-radius: var(--smrt-radius-full, 9999px);
|
|
135
|
-
cursor: pointer;
|
|
136
137
|
padding: 0;
|
|
137
138
|
font-size: 0;
|
|
138
139
|
}
|
|
139
140
|
|
|
140
|
-
.tab-list__item:hover .tab-list__close
|
|
141
|
+
.tab-list__item:hover :global(.tab-list__close),
|
|
142
|
+
.tab-list__item:focus-within :global(.tab-list__close) {
|
|
141
143
|
display: inline-flex;
|
|
142
144
|
}
|
|
143
145
|
|
|
144
|
-
.tab-list__item:hover .tab-list__badge
|
|
146
|
+
.tab-list__item:hover .tab-list__badge,
|
|
147
|
+
.tab-list__item:focus-within .tab-list__badge {
|
|
145
148
|
display: none;
|
|
146
149
|
}
|
|
147
150
|
|
|
148
|
-
.tab-list__close:hover {
|
|
151
|
+
.tab-list__item :global(.tab-list__close:hover) {
|
|
149
152
|
background: var(--smrt-color-error-container, #ffdad6);
|
|
150
153
|
color: var(--smrt-color-on-error-container, #410002);
|
|
151
154
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatTabList.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/tabs/ChatTabList.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChatTabList.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/tabs/ChatTabList.svelte.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAInD,MAAM,WAAW,KAAK;IACpB,+BAA+B;IAC/B,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,4BAA4B;IAC5B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,kBAAkB;IAClB,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AA0CD,QAAA,MAAM,WAAW,2CAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* No thread panel, no reactions. Just messages and a send box.
|
|
6
6
|
*/
|
|
7
7
|
import { useI18n } from '@happyvertical/smrt-ui/i18n';
|
|
8
|
+
import { Button } from '@happyvertical/smrt-ui/ui';
|
|
8
9
|
import { M } from '../../i18n.messages.js';
|
|
9
10
|
import type { ChatMessageData } from '../../types.js';
|
|
10
11
|
import Avatar from '../shared/Avatar.svelte';
|
|
@@ -94,7 +95,8 @@ $effect(() => {
|
|
|
94
95
|
onkeydown={handleKeydown}
|
|
95
96
|
aria-label={t(M['chat.mini_chat.input_label'])}
|
|
96
97
|
/>
|
|
97
|
-
<
|
|
98
|
+
<Button
|
|
99
|
+
variant="ghost"
|
|
98
100
|
class="mini-chat__send-btn"
|
|
99
101
|
type="submit"
|
|
100
102
|
disabled={!inputValue.trim()}
|
|
@@ -103,7 +105,7 @@ $effect(() => {
|
|
|
103
105
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
104
106
|
<path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" />
|
|
105
107
|
</svg>
|
|
106
|
-
</
|
|
108
|
+
</Button>
|
|
107
109
|
</form>
|
|
108
110
|
</div>
|
|
109
111
|
|
|
@@ -212,41 +214,33 @@ $effect(() => {
|
|
|
212
214
|
color: var(--smrt-color-outline, #74777f);
|
|
213
215
|
}
|
|
214
216
|
|
|
215
|
-
.
|
|
216
|
-
|
|
217
|
-
align-items: center;
|
|
218
|
-
justify-content: center;
|
|
217
|
+
/* :global() pierces into the Button child's rendered <button> (see #1589). */
|
|
218
|
+
.mini-chat__input-bar :global(.mini-chat__send-btn) {
|
|
219
219
|
width: 32px;
|
|
220
220
|
height: 32px;
|
|
221
|
-
|
|
221
|
+
padding: 0;
|
|
222
222
|
background: var(--smrt-color-primary, #005ac1);
|
|
223
223
|
color: var(--smrt-color-on-primary, #ffffff);
|
|
224
224
|
border-radius: var(--smrt-radius-full, 9999px);
|
|
225
|
-
cursor: pointer;
|
|
226
225
|
flex-shrink: 0;
|
|
227
226
|
transition: opacity var(--smrt-duration-short2, 150ms);
|
|
228
227
|
}
|
|
229
228
|
|
|
230
|
-
.mini-chat__send-btn:disabled {
|
|
229
|
+
.mini-chat__input-bar :global(.mini-chat__send-btn:disabled) {
|
|
231
230
|
opacity: 0.4;
|
|
232
|
-
cursor: not-allowed;
|
|
233
231
|
}
|
|
234
232
|
|
|
235
|
-
.mini-chat__send-btn:not(:disabled):hover {
|
|
233
|
+
.mini-chat__input-bar :global(.mini-chat__send-btn:not(:disabled):hover) {
|
|
234
|
+
background: var(--smrt-color-primary, #005ac1);
|
|
236
235
|
opacity: 0.85;
|
|
237
236
|
}
|
|
238
237
|
|
|
239
|
-
.mini-chat__send-btn:focus-visible {
|
|
240
|
-
outline: 2px solid var(--smrt-color-primary, #005ac1);
|
|
241
|
-
outline-offset: 2px;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
238
|
@media (prefers-reduced-motion: reduce) {
|
|
245
239
|
.mini-chat__messages {
|
|
246
240
|
scroll-behavior: auto;
|
|
247
241
|
}
|
|
248
242
|
|
|
249
|
-
.mini-chat__send-btn {
|
|
243
|
+
.mini-chat__input-bar :global(.mini-chat__send-btn) {
|
|
250
244
|
transition: none;
|
|
251
245
|
}
|
|
252
246
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MiniChat.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/tabs/MiniChat.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MiniChat.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/tabs/MiniChat.svelte.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAItD,MAAM,WAAW,KAAK;IACpB,0BAA0B;IAC1B,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,gCAAgC;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,qBAAqB;IACrB,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAmFD,QAAA,MAAM,QAAQ,2CAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-chat",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.6",
|
|
4
4
|
"description": "Chat rooms, DMs, threads, and agent conversations for the SMRT framework",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"smrtRawPrimitives": "strict-buttons",
|
|
6
7
|
"main": "./dist/index.js",
|
|
7
8
|
"types": "./dist/index.d.ts",
|
|
8
9
|
"exports": {
|
|
@@ -55,10 +56,10 @@
|
|
|
55
56
|
"access": "public"
|
|
56
57
|
},
|
|
57
58
|
"dependencies": {
|
|
58
|
-
"@happyvertical/smrt-core": "0.34.
|
|
59
|
-
"@happyvertical/smrt-tenancy": "0.34.
|
|
60
|
-
"@happyvertical/smrt-types": "0.34.
|
|
61
|
-
"@happyvertical/smrt-ui": "0.34.
|
|
59
|
+
"@happyvertical/smrt-core": "0.34.6",
|
|
60
|
+
"@happyvertical/smrt-tenancy": "0.34.6",
|
|
61
|
+
"@happyvertical/smrt-types": "0.34.6",
|
|
62
|
+
"@happyvertical/smrt-ui": "0.34.6"
|
|
62
63
|
},
|
|
63
64
|
"peerDependencies": {
|
|
64
65
|
"svelte": "^5.18.0"
|
|
@@ -78,9 +79,9 @@
|
|
|
78
79
|
"typescript": "^5.9.3",
|
|
79
80
|
"vite": "^7.3.1",
|
|
80
81
|
"vitest": "^4.0.17",
|
|
81
|
-
"@happyvertical/smrt-agents": "0.34.
|
|
82
|
-
"@happyvertical/smrt-profiles": "0.34.
|
|
83
|
-
"@happyvertical/smrt-vitest": "0.34.
|
|
82
|
+
"@happyvertical/smrt-agents": "0.34.6",
|
|
83
|
+
"@happyvertical/smrt-profiles": "0.34.6",
|
|
84
|
+
"@happyvertical/smrt-vitest": "0.34.6"
|
|
84
85
|
},
|
|
85
86
|
"scripts": {
|
|
86
87
|
"build": "vite build --mode library && svelte-package -i src/svelte -o dist/svelte --tsconfig tsconfig.svelte.json",
|