@happyvertical/smrt-chat 0.60.16 → 0.60.18
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/chunks/{chat-stream-Bdvah1X7.js → chat-stream-Blri3lj0.js} +2 -2
- package/dist/chunks/{chat-stream-Bdvah1X7.js.map → chat-stream-Blri3lj0.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/manifest.json +1 -1
- package/dist/smrt-knowledge.json +3 -3
- package/dist/svelte/components/agent/AgentChat.svelte +213 -205
- package/dist/svelte/components/agent/AgentSelector.svelte +72 -70
- package/dist/svelte/components/agent/AgentSessionPanel.svelte +121 -122
- package/dist/svelte/components/agent/ToolCallDisplay.svelte +133 -144
- package/dist/svelte/components/assistant/AssistantChoiceCards.svelte +97 -90
- package/dist/svelte/components/assistant/AssistantComposer.svelte +95 -92
- package/dist/svelte/components/assistant/AssistantDock.svelte +271 -269
- package/dist/svelte/components/assistant/AssistantDock.svelte.d.ts.map +1 -1
- package/dist/svelte/components/assistant/AssistantQuestionForm.svelte +35 -29
- package/dist/svelte/components/assistant/AssistantThreadList.svelte +48 -49
- package/dist/svelte/components/assistant/AssistantThreadList.svelte.d.ts.map +1 -1
- package/dist/svelte/components/assistant/FloatingAssistant.svelte +66 -55
- package/dist/svelte/components/assistant/captions/CaptionOverlay.svelte +21 -15
- package/dist/svelte/components/assistant/captions/HeardCaptions.svelte +43 -9
- package/dist/svelte/components/assistant/captions/SpokenCaptions.svelte +40 -9
- package/dist/svelte/components/dialogs/RoomCreateDialog.svelte +64 -63
- package/dist/svelte/components/dialogs/SearchMessages.svelte +179 -167
- package/dist/svelte/components/helper/HelperControlPanel.svelte +93 -23
- package/dist/svelte/components/layout/ChatLayout.svelte +49 -40
- package/dist/svelte/components/layout/MemberList.svelte +132 -127
- package/dist/svelte/components/layout/RoomHeader.svelte +71 -66
- package/dist/svelte/components/layout/RoomList.svelte +185 -174
- package/dist/svelte/components/messages/MessageInput.svelte +69 -58
- package/dist/svelte/components/messages/MessageItem.svelte +166 -177
- package/dist/svelte/components/messages/MessageList.svelte +20 -15
- package/dist/svelte/components/messages/ThreadPanel.svelte +53 -48
- package/dist/svelte/components/shared/AiUnavailableNotice.svelte +11 -6
- package/dist/svelte/components/shared/FileUpload.svelte +106 -103
- package/dist/svelte/components/shared/LinkPreview.svelte +40 -35
- package/dist/svelte/components/shared/MentionAutocomplete.svelte +34 -28
- package/dist/svelte/components/shared/ReadReceipts.svelte +44 -38
- package/dist/svelte/components/shared/UserPresence.svelte +17 -17
- package/dist/svelte/components/tabs/ChatTab.svelte +72 -68
- package/dist/svelte/components/tabs/ChatTabList.svelte +51 -51
- package/dist/svelte/components/tabs/ChatTabs.svelte +6 -6
- package/dist/svelte/components/tabs/MiniChat.svelte +75 -68
- package/dist/sveltekit.js +1 -1
- package/package.json +22 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantDock.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/assistant/AssistantDock.svelte.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,OAAO,EAAiB,MAAM,QAAQ,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAWzE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAOnF,OAAO,KAAK,EAEV,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAE/B,MAAM,mBAAmB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AG,IAAI,CAAC;IAC3C;;kCAE8B;IAC9B,UAAU,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACxC;2DACuD;IACvD,aAAa,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IACtC;8EAC0E;IAC1E,gBAAgB,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAClD,4EAA4E;IAC5E,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC,gFAAgF;IAChF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mEAAmE;IACnE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;kCAC8B;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;2DAEuD;IACvD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;
|
|
1
|
+
{"version":3,"file":"AssistantDock.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/assistant/AssistantDock.svelte.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,OAAO,EAAiB,MAAM,QAAQ,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAWzE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAOnF,OAAO,KAAK,EAEV,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAE/B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,u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I,CAAC;IACxC;2DACuD;IACvD,aAAa,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IACtC;8EAC0E;IAC1E,gBAAgB,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAClD,4EAA4E;IAC5E,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC,gFAAgF;IAChF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mEAAmE;IACnE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;kCAC8B;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;2DAEuD;IACvD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AA8zBD,QAAA,MAAM,aAAa,0BAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
|
@@ -109,16 +109,16 @@ async function submit() {
|
|
|
109
109
|
|
|
110
110
|
<div
|
|
111
111
|
bind:this={container}
|
|
112
|
-
class="assistant-question"
|
|
112
|
+
class="smrt-assistant-question-form__root"
|
|
113
113
|
data-smrt-component="AssistantQuestionForm"
|
|
114
114
|
>
|
|
115
115
|
{#if answer}
|
|
116
|
-
<p class="assistant-question-summary" role="status">
|
|
117
|
-
<span class="assistant-question-
|
|
116
|
+
<p class="smrt-assistant-question-form__summary" data-smrt-part="summary" role="status">
|
|
117
|
+
<span class="smrt-assistant-question-form__prompt" data-smrt-part="field">{question.prompt}</span>
|
|
118
118
|
{describeAssistantQuestionAnswer(question, answer)}
|
|
119
119
|
</p>
|
|
120
120
|
{:else}
|
|
121
|
-
<Form
|
|
121
|
+
<Form onsubmit={submit} aria-label={question.prompt}>
|
|
122
122
|
<Fieldset legend={question.prompt} stack>
|
|
123
123
|
{#snippet children()}
|
|
124
124
|
{#each question.fields as field (field.name)}
|
|
@@ -139,7 +139,7 @@ async function submit() {
|
|
|
139
139
|
{/snippet}
|
|
140
140
|
</Fieldset>
|
|
141
141
|
{:else if field.options.length > RADIO_LIMIT}
|
|
142
|
-
<label class="assistant-question-
|
|
142
|
+
<label class="smrt-assistant-question-form__select" data-smrt-part="field">
|
|
143
143
|
<span>{field.label}</span>
|
|
144
144
|
<Select
|
|
145
145
|
name={`${formId}-${field.name}`}
|
|
@@ -180,7 +180,7 @@ async function submit() {
|
|
|
180
180
|
{/each}
|
|
181
181
|
{/snippet}
|
|
182
182
|
</Fieldset>
|
|
183
|
-
<div class="assistant-question-actions">
|
|
183
|
+
<div class="smrt-assistant-question-form__actions" data-smrt-part="actions">
|
|
184
184
|
<Button type="submit" disabled={disabled || submitting || !valid}>
|
|
185
185
|
{question.submitLabel ?? t(M['chat.assistant_question.submit'])}
|
|
186
186
|
</Button>
|
|
@@ -191,55 +191,61 @@ async function submit() {
|
|
|
191
191
|
|
|
192
192
|
<style>
|
|
193
193
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
194
|
-
@layer smrt.
|
|
194
|
+
@layer smrt.structure {
|
|
195
195
|
/* A card spanning the thread, like the other structured cards. */
|
|
196
|
-
.assistant-question {
|
|
196
|
+
.smrt-assistant-question-form__root {
|
|
197
197
|
box-sizing: border-box;
|
|
198
198
|
inline-size: 100%;
|
|
199
199
|
padding: var(--smrt-spacing-3);
|
|
200
|
-
border: var(--smrt-hairline);
|
|
201
|
-
border-radius: var(--smrt-radius-large);
|
|
202
|
-
background: var(--smrt-color-surface-container);
|
|
203
|
-
color: var(--smrt-color-on-surface);
|
|
204
200
|
}
|
|
205
|
-
|
|
206
|
-
.assistant-question :global(.assistant-question-form) {
|
|
201
|
+
.smrt-assistant-question-form__root :global([data-smrt-component="Form"]) {
|
|
207
202
|
display: grid;
|
|
208
203
|
gap: var(--smrt-spacing-3);
|
|
209
204
|
}
|
|
210
|
-
|
|
211
|
-
.assistant-question :global(fieldset) {
|
|
205
|
+
.smrt-assistant-question-form__root :global(fieldset) {
|
|
212
206
|
min-inline-size: 0;
|
|
213
207
|
margin: 0;
|
|
214
208
|
}
|
|
215
|
-
|
|
216
|
-
.assistant-question-select {
|
|
209
|
+
.smrt-assistant-question-form__select {
|
|
217
210
|
display: grid;
|
|
218
211
|
gap: var(--smrt-spacing-1);
|
|
219
|
-
font: var(--smrt-typography-label-large-font);
|
|
220
212
|
}
|
|
221
|
-
|
|
222
|
-
.assistant-question-select :global(select) {
|
|
213
|
+
.smrt-assistant-question-form__select :global(select) {
|
|
223
214
|
inline-size: 100%;
|
|
224
215
|
}
|
|
225
|
-
|
|
226
216
|
/* Actions sit at the end, like a report card's; a narrow dock gives the
|
|
227
|
-
|
|
228
|
-
.assistant-question-
|
|
217
|
+
button the whole row. */
|
|
218
|
+
.smrt-assistant-question-form__actions {
|
|
229
219
|
display: flex;
|
|
230
220
|
justify-content: flex-end;
|
|
231
221
|
}
|
|
232
|
-
|
|
233
|
-
.assistant-question-summary {
|
|
222
|
+
.smrt-assistant-question-form__summary {
|
|
234
223
|
margin: 0;
|
|
224
|
+
}
|
|
225
|
+
.smrt-assistant-question-form__prompt {
|
|
226
|
+
display: block;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
@layer smrt.theme {
|
|
231
|
+
/* A card spanning the thread, like the other structured cards. */
|
|
232
|
+
.smrt-assistant-question-form__root {
|
|
233
|
+
border: var(--smrt-hairline);
|
|
234
|
+
border-radius: var(--smrt-radius-large);
|
|
235
|
+
background: var(--smrt-color-surface-container);
|
|
236
|
+
color: var(--smrt-color-on-surface);
|
|
237
|
+
}
|
|
238
|
+
.smrt-assistant-question-form__select {
|
|
239
|
+
font: var(--smrt-typography-label-large-font);
|
|
240
|
+
}
|
|
241
|
+
.smrt-assistant-question-form__summary {
|
|
235
242
|
color: var(--smrt-color-on-surface-variant);
|
|
236
243
|
font: var(--smrt-typography-body-small-font);
|
|
237
244
|
}
|
|
238
|
-
|
|
239
|
-
.assistant-question-prompt {
|
|
240
|
-
display: block;
|
|
245
|
+
.smrt-assistant-question-form__prompt {
|
|
241
246
|
color: var(--smrt-color-on-surface);
|
|
242
247
|
font: var(--smrt-typography-label-large-font);
|
|
243
248
|
}
|
|
244
249
|
}
|
|
250
|
+
|
|
245
251
|
</style>
|
|
@@ -24,36 +24,32 @@ const { threads, activeThreadId = null, onselect, oncreate }: Props = $props();
|
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
26
|
<nav
|
|
27
|
-
class="assistant-thread-
|
|
27
|
+
class="smrt-assistant-thread-list__root"
|
|
28
28
|
aria-label={t(M['chat.assistant_thread_list.conversations_label'])} data-smrt-component="AssistantThreadList"
|
|
29
29
|
>
|
|
30
30
|
{#if oncreate}
|
|
31
31
|
<Button
|
|
32
32
|
type="button"
|
|
33
33
|
variant="ghost"
|
|
34
|
-
class="assistant-thread-list-new"
|
|
35
34
|
onclick={oncreate}
|
|
36
35
|
>
|
|
37
36
|
{t(M['chat.assistant_thread_list.new_conversation'])}
|
|
38
37
|
</Button>
|
|
39
38
|
{/if}
|
|
40
|
-
<ul>
|
|
39
|
+
<ul data-smrt-part="list">
|
|
41
40
|
{#each threads as thread (thread.id)}
|
|
42
41
|
<li>
|
|
43
42
|
<Button
|
|
44
43
|
type="button"
|
|
45
44
|
variant="ghost"
|
|
46
|
-
class={thread.id === activeThreadId
|
|
47
|
-
? 'assistant-thread-list-item active'
|
|
48
|
-
: 'assistant-thread-list-item'}
|
|
49
45
|
onclick={() => onselect(thread.id)}
|
|
50
46
|
aria-current={thread.id === activeThreadId ? 'true' : undefined}
|
|
51
47
|
>
|
|
52
|
-
<span class="title">
|
|
48
|
+
<span class="smrt-assistant-thread-list__title" data-smrt-part="title">
|
|
53
49
|
{thread.title || t(M['chat.assistant_thread_list.untitled'])}
|
|
54
50
|
</span>
|
|
55
51
|
{#if thread.messageCount > 0}
|
|
56
|
-
<span class="count">{thread.messageCount}</span>
|
|
52
|
+
<span class="smrt-assistant-thread-list__count" data-smrt-part="count">{thread.messageCount}</span>
|
|
57
53
|
{/if}
|
|
58
54
|
</Button>
|
|
59
55
|
</li>
|
|
@@ -63,33 +59,19 @@ const { threads, activeThreadId = null, onselect, oncreate }: Props = $props();
|
|
|
63
59
|
|
|
64
60
|
<style>
|
|
65
61
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
66
|
-
@layer smrt.
|
|
67
|
-
.assistant-thread-
|
|
62
|
+
@layer smrt.structure {
|
|
63
|
+
.smrt-assistant-thread-list__root {
|
|
68
64
|
display: flex;
|
|
69
65
|
flex-direction: column;
|
|
70
|
-
border-right: var(--smrt-hairline);
|
|
71
|
-
background: var(--smrt-color-surface-container-low);
|
|
72
66
|
min-width: 160px;
|
|
73
67
|
overflow-y: auto;
|
|
74
68
|
}
|
|
75
|
-
|
|
76
|
-
:global(.assistant-thread-list-new) {
|
|
69
|
+
:global(:where([data-smrt-component="AssistantThreadList"]) > [data-smrt-component="Button"]) {
|
|
77
70
|
margin: var(--smrt-spacing-2);
|
|
78
71
|
padding: var(--smrt-spacing-2) var(--smrt-spacing-3);
|
|
79
|
-
border: 1px dashed var(--smrt-color-outline-variant);
|
|
80
|
-
border-radius: var(--smrt-radius-medium);
|
|
81
|
-
background: transparent;
|
|
82
|
-
color: var(--smrt-color-primary);
|
|
83
|
-
font: var(--smrt-typography-label-medium-font, 500 0.8125rem/1.3 sans-serif);
|
|
84
72
|
cursor: pointer;
|
|
85
|
-
text-align: left;
|
|
86
73
|
}
|
|
87
|
-
|
|
88
|
-
:global(.assistant-thread-list-new:hover) {
|
|
89
|
-
background: var(--smrt-color-surface-container);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.assistant-thread-list ul {
|
|
74
|
+
.smrt-assistant-thread-list__root ul {
|
|
93
75
|
list-style: none;
|
|
94
76
|
margin: 0;
|
|
95
77
|
padding: 0 var(--smrt-spacing-2) var(--smrt-spacing-2);
|
|
@@ -97,8 +79,7 @@ const { threads, activeThreadId = null, onselect, oncreate }: Props = $props();
|
|
|
97
79
|
flex-direction: column;
|
|
98
80
|
gap: var(--smrt-spacing-1);
|
|
99
81
|
}
|
|
100
|
-
|
|
101
|
-
:global(.assistant-thread-list-item) {
|
|
82
|
+
:global(:where([data-smrt-component="AssistantThreadList"] li) > [data-smrt-component="Button"]) {
|
|
102
83
|
display: flex;
|
|
103
84
|
align-items: center;
|
|
104
85
|
justify-content: flex-start;
|
|
@@ -106,17 +87,10 @@ const { threads, activeThreadId = null, onselect, oncreate }: Props = $props();
|
|
|
106
87
|
width: 100%;
|
|
107
88
|
min-width: 0;
|
|
108
89
|
padding: var(--smrt-spacing-2) var(--smrt-spacing-3);
|
|
109
|
-
border: none;
|
|
110
|
-
border-radius: var(--smrt-radius-medium);
|
|
111
|
-
background: transparent;
|
|
112
|
-
color: var(--smrt-color-on-surface);
|
|
113
|
-
font: var(--smrt-typography-body-medium-font, 0.875rem/1.4 sans-serif);
|
|
114
|
-
text-align: left;
|
|
115
90
|
cursor: pointer;
|
|
116
91
|
}
|
|
117
|
-
|
|
118
92
|
/* The Button's inner row: title left (clipped with an ellipsis), count right. */
|
|
119
|
-
:global(
|
|
93
|
+
:global(:where([data-smrt-component="AssistantThreadList"] li) > [data-smrt-component="Button"] > [data-smrt-part="label"]) {
|
|
120
94
|
flex: 1 1 auto;
|
|
121
95
|
min-width: 0;
|
|
122
96
|
display: flex;
|
|
@@ -124,28 +98,53 @@ const { threads, activeThreadId = null, onselect, oncreate }: Props = $props();
|
|
|
124
98
|
justify-content: space-between;
|
|
125
99
|
gap: var(--smrt-spacing-2);
|
|
126
100
|
}
|
|
101
|
+
.smrt-assistant-thread-list__title {
|
|
102
|
+
min-width: 0;
|
|
103
|
+
overflow: hidden;
|
|
104
|
+
text-overflow: ellipsis;
|
|
105
|
+
white-space: nowrap;
|
|
106
|
+
}
|
|
107
|
+
.smrt-assistant-thread-list__count {
|
|
108
|
+
flex-shrink: 0;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
127
111
|
|
|
128
|
-
|
|
112
|
+
@layer smrt.theme {
|
|
113
|
+
.smrt-assistant-thread-list__root {
|
|
114
|
+
border-right: var(--smrt-hairline);
|
|
115
|
+
background: var(--smrt-color-surface-container-low);
|
|
116
|
+
}
|
|
117
|
+
:global(:where([data-smrt-component="AssistantThreadList"]) > [data-smrt-component="Button"]) {
|
|
118
|
+
border: 1px dashed var(--smrt-color-outline-variant);
|
|
119
|
+
border-radius: var(--smrt-radius-medium);
|
|
120
|
+
background: transparent;
|
|
121
|
+
color: var(--smrt-color-primary);
|
|
122
|
+
font: var(--smrt-typography-label-medium-font, 500 0.8125rem/1.3 sans-serif);
|
|
123
|
+
text-align: left;
|
|
124
|
+
}
|
|
125
|
+
:global(:where([data-smrt-component="AssistantThreadList"]) > [data-smrt-component="Button"]:hover) {
|
|
129
126
|
background: var(--smrt-color-surface-container);
|
|
130
127
|
}
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
:global(:where([data-smrt-component="AssistantThreadList"] li) > [data-smrt-component="Button"]) {
|
|
129
|
+
border: none;
|
|
130
|
+
border-radius: var(--smrt-radius-medium);
|
|
131
|
+
background: transparent;
|
|
132
|
+
color: var(--smrt-color-on-surface);
|
|
133
|
+
font: var(--smrt-typography-body-medium-font, 0.875rem/1.4 sans-serif);
|
|
134
|
+
text-align: left;
|
|
135
|
+
}
|
|
136
|
+
:global(:where([data-smrt-component="AssistantThreadList"] li) > [data-smrt-component="Button"]:hover) {
|
|
137
|
+
background: var(--smrt-color-surface-container);
|
|
138
|
+
}
|
|
139
|
+
:global(:where([data-smrt-component="AssistantThreadList"] li) > [data-smrt-component="Button"][aria-current="true"]) {
|
|
133
140
|
background: var(--smrt-color-secondary-container);
|
|
134
141
|
color: var(--smrt-color-on-secondary-container);
|
|
135
142
|
font-weight: var(--smrt-typography-weight-semibold, 600);
|
|
136
143
|
}
|
|
137
|
-
|
|
138
|
-
.title {
|
|
139
|
-
min-width: 0;
|
|
140
|
-
overflow: hidden;
|
|
141
|
-
text-overflow: ellipsis;
|
|
142
|
-
white-space: nowrap;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.count {
|
|
146
|
-
flex-shrink: 0;
|
|
144
|
+
.smrt-assistant-thread-list__count {
|
|
147
145
|
font: var(--smrt-typography-label-small-font, 500 0.6875rem/1 sans-serif);
|
|
148
146
|
color: var(--smrt-color-on-surface-variant);
|
|
149
147
|
}
|
|
150
148
|
}
|
|
149
|
+
|
|
151
150
|
</style>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantThreadList.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/assistant/AssistantThreadList.svelte.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGvE,MAAM,WAAW,KAAK;IACpB,mEAAmE;IACnE,OAAO,EAAE,sBAAsB,EAAE,CAAC;IAClC,oEAAoE;IACpE,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,6DAA6D;IAC7D,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;
|
|
1
|
+
{"version":3,"file":"AssistantThreadList.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/assistant/AssistantThreadList.svelte.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGvE,MAAM,WAAW,KAAK;IACpB,mEAAmE;IACnE,OAAO,EAAE,sBAAsB,EAAE,CAAC;IAClC,oEAAoE;IACpE,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,6DAA6D;IAC7D,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAwCD,QAAA,MAAM,mBAAmB,2CAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
|
|
@@ -156,25 +156,25 @@ function handleKeydown(event: KeyboardEvent) {
|
|
|
156
156
|
<svelte:window onkeydown={handleKeydown} />
|
|
157
157
|
|
|
158
158
|
<div
|
|
159
|
-
class="floating-
|
|
160
|
-
class:bottom-left={placement === 'bottom-left'}
|
|
159
|
+
class="smrt-floating-assistant__root"
|
|
161
160
|
data-expanded={panelExpanded || undefined}
|
|
162
161
|
hidden={!visible}
|
|
163
162
|
inert={!visible}
|
|
164
163
|
aria-hidden={!visible} data-smrt-component="FloatingAssistant"
|
|
164
|
+
|
|
165
|
+
class:smrt-floating-assistant__bottom-left={placement === 'bottom-left'}
|
|
165
166
|
>
|
|
166
167
|
{#if launcherVisible}
|
|
167
168
|
<Button
|
|
168
169
|
{@attach captureLauncher}
|
|
169
170
|
variant="ghost"
|
|
170
171
|
type="button"
|
|
171
|
-
class="floating-assistant-launcher"
|
|
172
172
|
aria-expanded={panelExpanded}
|
|
173
173
|
aria-controls={panelId}
|
|
174
174
|
onclick={open}
|
|
175
175
|
>
|
|
176
176
|
{#if character}
|
|
177
|
-
<span class="floating-
|
|
177
|
+
<span class="smrt-floating-assistant__character" data-smrt-part="icon" aria-hidden="true">
|
|
178
178
|
{@render character(presentationState)}
|
|
179
179
|
</span>
|
|
180
180
|
{/if}
|
|
@@ -185,7 +185,8 @@ function handleKeydown(event: KeyboardEvent) {
|
|
|
185
185
|
<section
|
|
186
186
|
bind:this={panel}
|
|
187
187
|
id={panelId}
|
|
188
|
-
class="floating-
|
|
188
|
+
class="smrt-floating-assistant__panel"
|
|
189
|
+
data-smrt-part="panel"
|
|
189
190
|
aria-label={panelLabel}
|
|
190
191
|
aria-hidden={!panelExpanded}
|
|
191
192
|
inert={!panelExpanded}
|
|
@@ -193,7 +194,6 @@ function handleKeydown(event: KeyboardEvent) {
|
|
|
193
194
|
<Button
|
|
194
195
|
variant="ghost"
|
|
195
196
|
type="button"
|
|
196
|
-
class="floating-assistant-collapse"
|
|
197
197
|
aria-label={t(M['chat.floating_assistant.collapse'])}
|
|
198
198
|
onclick={collapse}
|
|
199
199
|
>
|
|
@@ -213,8 +213,8 @@ function handleKeydown(event: KeyboardEvent) {
|
|
|
213
213
|
|
|
214
214
|
<style>
|
|
215
215
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
216
|
-
@layer smrt.
|
|
217
|
-
.floating-
|
|
216
|
+
@layer smrt.structure {
|
|
217
|
+
.smrt-floating-assistant__root {
|
|
218
218
|
position: fixed;
|
|
219
219
|
z-index: var(--smrt-z-index-overlay, 1200);
|
|
220
220
|
right: max(1rem, env(safe-area-inset-right));
|
|
@@ -223,90 +223,101 @@ function handleKeydown(event: KeyboardEvent) {
|
|
|
223
223
|
justify-items: end;
|
|
224
224
|
gap: 0.75rem;
|
|
225
225
|
}
|
|
226
|
-
.floating-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
226
|
+
.smrt-floating-assistant__root.smrt-floating-assistant__bottom-left {
|
|
227
|
+
right: auto;
|
|
228
|
+
left: max(1rem, env(safe-area-inset-left));
|
|
229
|
+
justify-items: start;
|
|
230
230
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
.floating-assistant :global(.floating-assistant-collapse) {
|
|
234
|
-
border: var(--smrt-hairline-strong);
|
|
235
|
-
border-radius: var(--smrt-radius-full);
|
|
236
|
-
background: var(--smrt-color-surface, Canvas);
|
|
237
|
-
color: var(--smrt-color-on-surface, CanvasText);
|
|
238
|
-
font: inherit;
|
|
231
|
+
.smrt-floating-assistant__root[hidden] {
|
|
232
|
+
display: none;
|
|
239
233
|
}
|
|
240
|
-
|
|
241
|
-
.floating-assistant :global(.floating-assistant-launcher) {
|
|
234
|
+
.smrt-floating-assistant__root > :global([data-smrt-component="Button"]) {
|
|
242
235
|
display: inline-flex;
|
|
243
236
|
align-items: center;
|
|
244
237
|
gap: 0.5rem;
|
|
245
238
|
min-block-size: 2.75rem;
|
|
246
239
|
padding: 0.5rem 0.875rem;
|
|
247
|
-
box-shadow: var(
|
|
248
|
-
--smrt-elevation-4,
|
|
249
|
-
0 0.5rem 1.5rem color-mix(in srgb, CanvasText 18%, transparent)
|
|
250
|
-
);
|
|
251
240
|
}
|
|
252
|
-
|
|
253
|
-
.floating-assistant-character {
|
|
241
|
+
.smrt-floating-assistant__character {
|
|
254
242
|
display: grid;
|
|
255
243
|
place-items: center;
|
|
256
244
|
inline-size: 1.75rem;
|
|
257
245
|
block-size: 1.75rem;
|
|
258
246
|
overflow: hidden;
|
|
259
|
-
border-radius: var(--smrt-radius-full);
|
|
260
247
|
}
|
|
261
|
-
|
|
262
|
-
|
|
248
|
+
.smrt-floating-assistant__root:not([data-expanded]) .smrt-floating-assistant__panel {
|
|
249
|
+
visibility: hidden;
|
|
250
|
+
pointer-events: none;
|
|
251
|
+
}
|
|
252
|
+
.smrt-floating-assistant__panel {
|
|
263
253
|
box-sizing: border-box;
|
|
264
254
|
display: block;
|
|
265
255
|
inline-size: min(28rem, calc(100vw - 2rem));
|
|
266
256
|
max-block-size: min(42rem, calc(100dvh - 6rem));
|
|
267
257
|
overflow: auto;
|
|
268
258
|
padding: 0.75rem;
|
|
269
|
-
border: var(--smrt-hairline-strong);
|
|
270
|
-
border-radius: 1rem;
|
|
271
|
-
background: var(--smrt-color-surface, Canvas);
|
|
272
|
-
color: var(--smrt-color-on-surface, CanvasText);
|
|
273
|
-
box-shadow: var(
|
|
274
|
-
--smrt-elevation-5,
|
|
275
|
-
0 1rem 2rem color-mix(in srgb, CanvasText 24%, transparent)
|
|
276
|
-
);
|
|
277
|
-
transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
|
|
278
259
|
}
|
|
279
|
-
|
|
280
|
-
.floating-assistant:not([data-expanded]) .floating-assistant-panel {
|
|
281
|
-
visibility: hidden;
|
|
282
|
-
pointer-events: none;
|
|
283
|
-
opacity: 0;
|
|
284
|
-
transform: translateY(0.5rem);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
.floating-assistant :global(.floating-assistant-collapse) {
|
|
260
|
+
.smrt-floating-assistant__panel > :global([data-smrt-component="Button"]) {
|
|
288
261
|
float: inline-end;
|
|
289
262
|
min-block-size: 2rem;
|
|
290
263
|
padding-inline: 0.625rem;
|
|
291
264
|
}
|
|
292
|
-
|
|
293
265
|
@media (max-width: 30rem) {
|
|
294
|
-
.floating-
|
|
266
|
+
.smrt-floating-assistant__root {
|
|
295
267
|
right: max(0.5rem, env(safe-area-inset-right));
|
|
296
268
|
bottom: max(0.5rem, env(safe-area-inset-bottom));
|
|
297
269
|
}
|
|
298
|
-
.floating-
|
|
299
|
-
|
|
300
|
-
|
|
270
|
+
.smrt-floating-assistant__root.smrt-floating-assistant__bottom-left {
|
|
271
|
+
right: auto;
|
|
272
|
+
left: max(0.5rem, env(safe-area-inset-left));
|
|
273
|
+
}
|
|
274
|
+
.smrt-floating-assistant__panel {
|
|
301
275
|
inline-size: calc(100vw - 1rem);
|
|
302
276
|
max-block-size: calc(100dvh - 4.5rem);
|
|
303
277
|
}
|
|
304
278
|
}
|
|
279
|
+
.smrt-floating-assistant__root:not([data-expanded]) .smrt-floating-assistant__panel {
|
|
280
|
+
opacity: 0;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
305
283
|
|
|
284
|
+
@layer smrt.theme {
|
|
285
|
+
.smrt-floating-assistant__root > :global([data-smrt-component="Button"]),
|
|
286
|
+
.smrt-floating-assistant__panel > :global([data-smrt-component="Button"]) {
|
|
287
|
+
border: var(--smrt-hairline-strong);
|
|
288
|
+
border-radius: var(--smrt-radius-full);
|
|
289
|
+
background: var(--smrt-color-surface, Canvas);
|
|
290
|
+
color: var(--smrt-color-on-surface, CanvasText);
|
|
291
|
+
font: inherit;
|
|
292
|
+
}
|
|
293
|
+
.smrt-floating-assistant__root > :global([data-smrt-component="Button"]) {
|
|
294
|
+
box-shadow: var(
|
|
295
|
+
--smrt-elevation-4,
|
|
296
|
+
0 0.5rem 1.5rem color-mix(in srgb, CanvasText 18%, transparent)
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
.smrt-floating-assistant__character {
|
|
300
|
+
border-radius: var(--smrt-radius-full);
|
|
301
|
+
}
|
|
302
|
+
.smrt-floating-assistant__panel {
|
|
303
|
+
border: var(--smrt-hairline-strong);
|
|
304
|
+
border-radius: 1rem;
|
|
305
|
+
background: var(--smrt-color-surface, Canvas);
|
|
306
|
+
color: var(--smrt-color-on-surface, CanvasText);
|
|
307
|
+
box-shadow: var(
|
|
308
|
+
--smrt-elevation-5,
|
|
309
|
+
0 1rem 2rem color-mix(in srgb, CanvasText 24%, transparent)
|
|
310
|
+
);
|
|
311
|
+
transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
|
|
312
|
+
}
|
|
313
|
+
.smrt-floating-assistant__root:not([data-expanded]) .smrt-floating-assistant__panel {
|
|
314
|
+
transform: translateY(0.5rem);
|
|
315
|
+
}
|
|
306
316
|
@media (prefers-reduced-motion: reduce) {
|
|
307
|
-
.floating-
|
|
317
|
+
.smrt-floating-assistant__panel {
|
|
308
318
|
transition: none;
|
|
309
319
|
}
|
|
310
320
|
}
|
|
311
321
|
}
|
|
322
|
+
|
|
312
323
|
</style>
|
|
@@ -51,14 +51,14 @@ $effect(() => {
|
|
|
51
51
|
});
|
|
52
52
|
</script>
|
|
53
53
|
|
|
54
|
-
<section bind:this={group} class="caption-
|
|
55
|
-
<div bind:this={viewport} class="caption-
|
|
56
|
-
<div bind:this={content} class="caption-
|
|
54
|
+
<section bind:this={group} class="smrt-caption-overlay__root" aria-label={label} data-smrt-component="CaptionOverlay">
|
|
55
|
+
<div bind:this={viewport} class="smrt-caption-overlay__viewport" data-smrt-part="body" onscroll={updatePosition}>
|
|
56
|
+
<div bind:this={content} class="smrt-caption-overlay__list" data-smrt-part="list">
|
|
57
57
|
{@render children()}
|
|
58
58
|
</div>
|
|
59
59
|
</div>
|
|
60
60
|
{#if overflowing}
|
|
61
|
-
<div class="caption-
|
|
61
|
+
<div class="smrt-caption-overlay__controls" data-smrt-part="actions">
|
|
62
62
|
<Button size="sm" disabled={atStart} onclick={() => scroll(-1)}>{t(M['chat.caption_overlay.scroll_up'])}</Button>
|
|
63
63
|
<Button size="sm" disabled={atEnd} onclick={() => scroll(1)}>{t(M['chat.caption_overlay.scroll_down'])}</Button>
|
|
64
64
|
</div>
|
|
@@ -67,8 +67,8 @@ $effect(() => {
|
|
|
67
67
|
|
|
68
68
|
<style>
|
|
69
69
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
70
|
-
@layer smrt.
|
|
71
|
-
.caption-
|
|
70
|
+
@layer smrt.structure {
|
|
71
|
+
.smrt-caption-overlay__root {
|
|
72
72
|
position: fixed;
|
|
73
73
|
z-index: var(--smrt-z-index-sticky, 1100);
|
|
74
74
|
inset-inline-start: max(var(--smrt-spacing-4, 1rem), env(safe-area-inset-left));
|
|
@@ -82,27 +82,33 @@ $effect(() => {
|
|
|
82
82
|
margin-inline: auto;
|
|
83
83
|
overflow: hidden;
|
|
84
84
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
.caption-
|
|
85
|
+
.smrt-caption-overlay__root:not(:has(.smrt-caption-overlay__list > *)) {
|
|
86
|
+
display: none;
|
|
87
|
+
}
|
|
88
|
+
.smrt-caption-overlay__viewport {
|
|
89
89
|
min-block-size: 0;
|
|
90
90
|
overflow: auto;
|
|
91
91
|
overscroll-behavior: contain;
|
|
92
|
-
scroll-behavior: auto;
|
|
93
92
|
}
|
|
94
|
-
|
|
95
|
-
.caption-overlay-content {
|
|
93
|
+
.smrt-caption-overlay__list {
|
|
96
94
|
display: grid;
|
|
97
95
|
gap: var(--smrt-spacing-3, .75rem);
|
|
98
96
|
}
|
|
99
|
-
|
|
100
|
-
.caption-overlay-controls {
|
|
97
|
+
.smrt-caption-overlay__controls {
|
|
101
98
|
display: flex;
|
|
102
99
|
justify-content: space-between;
|
|
103
100
|
gap: var(--smrt-spacing-3, .75rem);
|
|
104
101
|
padding-block-start: var(--smrt-spacing-2, .5rem);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@layer smrt.theme {
|
|
106
|
+
.smrt-caption-overlay__viewport {
|
|
107
|
+
scroll-behavior: auto;
|
|
108
|
+
}
|
|
109
|
+
.smrt-caption-overlay__controls {
|
|
105
110
|
background: var(--smrt-color-surface, Canvas);
|
|
106
111
|
}
|
|
107
112
|
}
|
|
113
|
+
|
|
108
114
|
</style>
|
|
@@ -33,9 +33,9 @@ const visibleLines = $derived(lines.slice(-Math.max(1, maxLines)));
|
|
|
33
33
|
</script>
|
|
34
34
|
|
|
35
35
|
{#snippet surface()}
|
|
36
|
-
<section class="heard-
|
|
37
|
-
<p class="
|
|
38
|
-
<div class="
|
|
36
|
+
<section class="smrt-heard-captions__root" aria-label={speakerLabel} data-smrt-component="HeardCaptions">
|
|
37
|
+
<p class="smrt-heard-captions__speaker" data-smrt-part="label">{speakerLabel}</p>
|
|
38
|
+
<div class="smrt-heard-captions__lines" data-smrt-part="body" aria-live="polite" aria-atomic="false">
|
|
39
39
|
{#each visibleLines as line (line.id)}
|
|
40
40
|
<p>{line.text}</p>
|
|
41
41
|
{/each}
|
|
@@ -43,7 +43,7 @@ const visibleLines = $derived(lines.slice(-Math.max(1, maxLines)));
|
|
|
43
43
|
{#if interim}
|
|
44
44
|
<!-- A partial transcript is visually useful but should not repeat the
|
|
45
45
|
final phrase in a screen reader's live region. -->
|
|
46
|
-
<p class="
|
|
46
|
+
<p class="smrt-heard-captions__interim" data-smrt-part="message" aria-hidden="true">{interim}</p>
|
|
47
47
|
{/if}
|
|
48
48
|
</section>
|
|
49
49
|
{/snippet}
|
|
@@ -58,11 +58,45 @@ const visibleLines = $derived(lines.slice(-Math.max(1, maxLines)));
|
|
|
58
58
|
|
|
59
59
|
<style>
|
|
60
60
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
61
|
+
@layer smrt.structure {
|
|
62
|
+
.smrt-heard-captions__root {
|
|
63
|
+
box-sizing: border-box;
|
|
64
|
+
min-inline-size: 0;
|
|
65
|
+
max-inline-size: min(42rem, calc(100vw - 2rem));
|
|
66
|
+
overflow-wrap: anywhere;
|
|
67
|
+
padding: .6rem .85rem;
|
|
68
|
+
}
|
|
69
|
+
.smrt-heard-captions__speaker {
|
|
70
|
+
margin: 0 0 .25rem;
|
|
71
|
+
}
|
|
72
|
+
.smrt-heard-captions__lines p, .smrt-heard-captions__interim {
|
|
73
|
+
margin: .15rem 0 0;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
61
77
|
@layer smrt.theme {
|
|
62
|
-
.heard-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
78
|
+
.smrt-heard-captions__root {
|
|
79
|
+
border-inline-start: .25rem solid var(--smrt-color-primary);
|
|
80
|
+
background: color-mix(in srgb, var(--smrt-color-surface, white) 92%, var(--smrt-color-primary-container));
|
|
81
|
+
color: var(--smrt-color-on-surface);
|
|
82
|
+
border-radius: .35rem;
|
|
83
|
+
box-shadow: var(--smrt-elevation-4, 0 .25rem .9rem color-mix(in srgb, var(--smrt-color-shadow, black) 16%, transparent));
|
|
84
|
+
}
|
|
85
|
+
.smrt-heard-captions__speaker {
|
|
86
|
+
font-weight: var(--smrt-typography-weight-bold, 700);
|
|
87
|
+
letter-spacing: .03em;
|
|
88
|
+
text-transform: uppercase;
|
|
89
|
+
font-size: var(--smrt-typography-label-medium-size, .75rem);
|
|
90
|
+
}
|
|
91
|
+
.smrt-heard-captions__interim {
|
|
92
|
+
font-style: italic;
|
|
93
|
+
opacity: .8;
|
|
94
|
+
}
|
|
95
|
+
@media (prefers-reduced-motion: reduce) {
|
|
96
|
+
.smrt-heard-captions__root {
|
|
97
|
+
scroll-behavior: auto;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
67
100
|
}
|
|
101
|
+
|
|
68
102
|
</style>
|