@happyvertical/smrt-chat 0.60.15 → 0.60.17
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-FDF9I30Z.js → chat-stream-Cl_kkuiU.js} +2 -2
- package/dist/chunks/{chat-stream-FDF9I30Z.js.map → chat-stream-Cl_kkuiU.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.d.ts.map +1 -1
- package/dist/sveltekit.js +3 -2
- package/dist/sveltekit.js.map +1 -1
- package/package.json +21 -21
|
@@ -71,58 +71,59 @@ const { t } = useI18n();
|
|
|
71
71
|
{@const cards = preview && set.original ? [set.original, ...set.options] : set.options}
|
|
72
72
|
<!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
|
|
73
73
|
<div
|
|
74
|
-
class="assistant-
|
|
74
|
+
class="smrt-assistant-choice-cards__root"
|
|
75
75
|
role="group"
|
|
76
76
|
aria-label={set.title}
|
|
77
77
|
aria-busy={making ? 'true' : undefined}
|
|
78
78
|
onkeydown={(event) => onkeydown(event, set)} data-smrt-component="AssistantChoiceCards"
|
|
79
79
|
>
|
|
80
|
-
<p class="assistant-
|
|
80
|
+
<p class="smrt-assistant-choice-cards__title" data-smrt-part="title">{set.title}</p>
|
|
81
81
|
{#if making}
|
|
82
|
-
<p class="assistant-
|
|
82
|
+
<p class="smrt-assistant-choice-cards__status smrt-assistant-choice-cards__making" data-smrt-part="status" role="status">{making.message}</p>
|
|
83
83
|
{/if}
|
|
84
84
|
{#if !(preview && set.status === 'applied')}
|
|
85
|
-
<ul class="assistant-
|
|
85
|
+
<ul class="smrt-assistant-choice-cards__list" data-smrt-part="list">
|
|
86
86
|
{#each cards as option (option.id)}
|
|
87
87
|
<li>
|
|
88
88
|
<!-- raw-primitive-allow: a picture card that is itself the choice (image, label and description inside one pressable target); Button's single-label layout does not fit -->
|
|
89
89
|
<button
|
|
90
90
|
type="button"
|
|
91
|
-
class="assistant-
|
|
92
|
-
|
|
91
|
+
class="smrt-assistant-choice-cards__card"
|
|
92
|
+
data-smrt-part="option"
|
|
93
93
|
aria-pressed={preview ? previewed === option.id : set.chosenOptionId === option.id}
|
|
94
94
|
aria-busy={previewing && set.previewPendingId === option.id ? 'true' : undefined}
|
|
95
95
|
disabled={!open || previewing}
|
|
96
96
|
onclick={() => (preview ? onpreview?.(set.id, option.id) : onchoose(set.id, option.id))}
|
|
97
|
+
class:smrt-assistant-choice-cards__chosen={preview ? previewed === option.id : set.chosenOptionId === option.id}
|
|
98
|
+
|
|
97
99
|
>
|
|
98
100
|
{#if option.imageUrl}
|
|
99
101
|
<img src={option.imageUrl} alt={option.imageAlt ?? option.label} loading="lazy" />
|
|
100
102
|
{/if}
|
|
101
|
-
<span class="assistant-
|
|
103
|
+
<span class="smrt-assistant-choice-cards__label" data-smrt-part="label">{option.label}</span>
|
|
102
104
|
{#if option.description}
|
|
103
|
-
<span class="assistant-
|
|
105
|
+
<span class="smrt-assistant-choice-cards__description" data-smrt-part="meta">{option.description}</span>
|
|
104
106
|
{/if}
|
|
105
107
|
</button>
|
|
106
108
|
</li>
|
|
107
109
|
{/each}
|
|
108
110
|
{#if making}
|
|
109
111
|
{#each { length: making.expected } as _, index (index)}
|
|
110
|
-
<li class="assistant-
|
|
111
|
-
<span class="assistant-
|
|
112
|
-
<span class="assistant-
|
|
112
|
+
<li class="smrt-assistant-choice-cards__pending" data-smrt-part="placeholder" aria-hidden="true">
|
|
113
|
+
<span class="smrt-assistant-choice-cards__placeholder" data-smrt-part="placeholder"></span>
|
|
114
|
+
<span class="smrt-assistant-choice-cards__label" data-smrt-part="label">{t(M['chat.assistant_dock.choices_making'])}</span>
|
|
113
115
|
</li>
|
|
114
116
|
{/each}
|
|
115
117
|
{/if}
|
|
116
118
|
</ul>
|
|
117
119
|
{/if}
|
|
118
120
|
{#if set.note && set.status === 'waiting'}
|
|
119
|
-
<p class="assistant-
|
|
121
|
+
<p class="smrt-assistant-choice-cards__status" data-smrt-part="status">{set.note}</p>
|
|
120
122
|
{/if}
|
|
121
123
|
{#if preview && open}
|
|
122
|
-
<div class="assistant-
|
|
124
|
+
<div class="smrt-assistant-choice-cards__actions smrt-assistant-choice-cards__commit" data-smrt-part="actions">
|
|
123
125
|
<Button
|
|
124
126
|
type="button"
|
|
125
|
-
class="assistant-dock-choices-use"
|
|
126
127
|
disabled={previewing || !previewed || previewed === set.original?.id}
|
|
127
128
|
onclick={() => oncommit?.(set.id)}
|
|
128
129
|
>
|
|
@@ -133,30 +134,30 @@ const { t } = useI18n();
|
|
|
133
134
|
</Button>
|
|
134
135
|
</div>
|
|
135
136
|
{#if set.status === 'failed'}
|
|
136
|
-
<p class="assistant-
|
|
137
|
+
<p class="smrt-assistant-choice-cards__status smrt-assistant-choice-cards__error" data-smrt-part="error" role="alert">
|
|
137
138
|
{t(M['chat.assistant_dock.choices_failed'], { message: set.error ?? '' })}
|
|
138
139
|
</p>
|
|
139
140
|
{/if}
|
|
140
141
|
{:else if set.status === 'waiting'}
|
|
141
|
-
<div class="assistant-
|
|
142
|
+
<div class="smrt-assistant-choice-cards__actions" data-smrt-part="actions">
|
|
142
143
|
<span>{set.options.length > 0 ? t(M['chat.assistant_dock.choices_pick']) : ''}</span>
|
|
143
144
|
<Button type="button" size="sm" variant="ghost" onclick={() => ondismiss(set.id)}>
|
|
144
145
|
{t(M['chat.assistant_dock.choices_none'])}
|
|
145
146
|
</Button>
|
|
146
147
|
</div>
|
|
147
148
|
{:else if set.status === 'applying'}
|
|
148
|
-
<p class="assistant-
|
|
149
|
+
<p class="smrt-assistant-choice-cards__status" data-smrt-part="status" role="status">{t(M['chat.assistant_dock.choices_applying'])}</p>
|
|
149
150
|
{:else if set.status === 'applied'}
|
|
150
|
-
<p class="assistant-
|
|
151
|
+
<p class="smrt-assistant-choice-cards__status" data-smrt-part="status" role="status">
|
|
151
152
|
{set.outcome ?? t(M['chat.assistant_dock.choices_applied'], { label: chosen?.label ?? '' })}
|
|
152
153
|
</p>
|
|
153
154
|
{:else if set.status === 'failed' && !preview}
|
|
154
|
-
<p class="assistant-
|
|
155
|
+
<p class="smrt-assistant-choice-cards__status smrt-assistant-choice-cards__error" data-smrt-part="error" role="alert">
|
|
155
156
|
{t(M['chat.assistant_dock.choices_failed'], { message: set.error ?? '' })}
|
|
156
157
|
</p>
|
|
157
158
|
{:else if set.status === 'unavailable'}
|
|
158
|
-
<div class="assistant-
|
|
159
|
-
<p class="assistant-
|
|
159
|
+
<div class="smrt-assistant-choice-cards__actions" data-smrt-part="actions">
|
|
160
|
+
<p class="smrt-assistant-choice-cards__status smrt-assistant-choice-cards__error" data-smrt-part="error" role="alert">
|
|
160
161
|
{t(M['chat.assistant_dock.choices_unavailable'], { message: set.error ?? '' })}
|
|
161
162
|
</p>
|
|
162
163
|
<Button type="button" size="sm" variant="ghost" onclick={() => ondismiss(set.id)}>
|
|
@@ -169,23 +170,17 @@ const { t } = useI18n();
|
|
|
169
170
|
|
|
170
171
|
<style>
|
|
171
172
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
172
|
-
@layer smrt.
|
|
173
|
-
.assistant-
|
|
173
|
+
@layer smrt.structure {
|
|
174
|
+
.smrt-assistant-choice-cards__root {
|
|
174
175
|
display: grid;
|
|
175
176
|
gap: 0.5rem;
|
|
176
177
|
margin: 0.5rem 0;
|
|
177
178
|
padding: 0.75rem;
|
|
178
|
-
border: var(--smrt-hairline);
|
|
179
|
-
border-radius: 0.75rem;
|
|
180
|
-
background: var(--smrt-color-surface-container-low);
|
|
181
179
|
}
|
|
182
|
-
|
|
183
|
-
.assistant-dock-choices-title {
|
|
180
|
+
.smrt-assistant-choice-cards__title {
|
|
184
181
|
margin: 0;
|
|
185
|
-
font-weight: var(--smrt-typography-weight-semibold, 600);
|
|
186
182
|
}
|
|
187
|
-
|
|
188
|
-
.assistant-dock-choice-list {
|
|
183
|
+
.smrt-assistant-choice-cards__list {
|
|
189
184
|
display: grid;
|
|
190
185
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
191
186
|
gap: 0.5rem;
|
|
@@ -193,119 +188,131 @@ const { t } = useI18n();
|
|
|
193
188
|
padding: 0;
|
|
194
189
|
list-style: none;
|
|
195
190
|
}
|
|
196
|
-
|
|
197
|
-
.assistant-dock-choice {
|
|
191
|
+
.smrt-assistant-choice-cards__card {
|
|
198
192
|
display: grid;
|
|
199
193
|
gap: 0.25rem;
|
|
200
194
|
align-content: start;
|
|
201
195
|
width: 100%;
|
|
202
196
|
min-height: 44px;
|
|
203
197
|
padding: 0.35rem;
|
|
198
|
+
cursor: pointer;
|
|
199
|
+
}
|
|
200
|
+
.smrt-assistant-choice-cards__card:disabled:not(.smrt-assistant-choice-cards__chosen) {
|
|
201
|
+
cursor: default;
|
|
202
|
+
}
|
|
203
|
+
.smrt-assistant-choice-cards__card img {
|
|
204
|
+
width: 100%;
|
|
205
|
+
aspect-ratio: 4 / 3;
|
|
206
|
+
object-fit: cover;
|
|
207
|
+
}
|
|
208
|
+
.smrt-assistant-choice-cards__actions {
|
|
209
|
+
display: flex;
|
|
210
|
+
flex-wrap: wrap;
|
|
211
|
+
align-items: center;
|
|
212
|
+
justify-content: space-between;
|
|
213
|
+
gap: 0.5rem;
|
|
214
|
+
}
|
|
215
|
+
/* The buttons stay in view while the cards scroll. */
|
|
216
|
+
.smrt-assistant-choice-cards__commit {
|
|
217
|
+
position: sticky;
|
|
218
|
+
inset-block-end: 0;
|
|
219
|
+
padding-block: 0.25rem;
|
|
220
|
+
}
|
|
221
|
+
.smrt-assistant-choice-cards__commit :global(button) {
|
|
222
|
+
min-block-size: 44px;
|
|
223
|
+
}
|
|
224
|
+
.smrt-assistant-choice-cards__commit > :global([data-smrt-component="Button"]:where(:first-of-type)) {
|
|
225
|
+
flex: 1 1 auto;
|
|
226
|
+
}
|
|
227
|
+
.smrt-assistant-choice-cards__status {
|
|
228
|
+
margin: 0;
|
|
229
|
+
}
|
|
230
|
+
.smrt-assistant-choice-cards__pending {
|
|
231
|
+
display: grid;
|
|
232
|
+
gap: 0.25rem;
|
|
233
|
+
align-content: start;
|
|
234
|
+
min-height: 44px;
|
|
235
|
+
padding: 0.35rem;
|
|
236
|
+
}
|
|
237
|
+
.smrt-assistant-choice-cards__placeholder {
|
|
238
|
+
width: 100%;
|
|
239
|
+
aspect-ratio: 4 / 3;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
@layer smrt.theme {
|
|
244
|
+
.smrt-assistant-choice-cards__root {
|
|
245
|
+
border: var(--smrt-hairline);
|
|
246
|
+
border-radius: 0.75rem;
|
|
247
|
+
background: var(--smrt-color-surface-container-low);
|
|
248
|
+
}
|
|
249
|
+
.smrt-assistant-choice-cards__title {
|
|
250
|
+
font-weight: var(--smrt-typography-weight-semibold, 600);
|
|
251
|
+
}
|
|
252
|
+
.smrt-assistant-choice-cards__card {
|
|
204
253
|
border: 2px solid var(--smrt-color-outline-variant);
|
|
205
254
|
border-radius: 0.6rem;
|
|
206
255
|
background: var(--smrt-color-surface);
|
|
207
256
|
color: var(--smrt-color-on-surface);
|
|
208
257
|
font: inherit;
|
|
209
258
|
text-align: left;
|
|
210
|
-
cursor: pointer;
|
|
211
259
|
}
|
|
212
|
-
|
|
213
|
-
.assistant-
|
|
214
|
-
.assistant-dock-choice:focus-visible {
|
|
260
|
+
.smrt-assistant-choice-cards__card:hover:not(:disabled),
|
|
261
|
+
.smrt-assistant-choice-cards__card:focus-visible {
|
|
215
262
|
border-color: var(--smrt-color-primary);
|
|
216
263
|
}
|
|
217
|
-
|
|
218
|
-
.assistant-dock-choice.chosen {
|
|
264
|
+
.smrt-assistant-choice-cards__card.smrt-assistant-choice-cards__chosen {
|
|
219
265
|
border-color: var(--smrt-color-primary);
|
|
220
266
|
background: var(--smrt-color-primary-container);
|
|
221
267
|
}
|
|
222
|
-
|
|
223
|
-
.assistant-dock-choice:disabled:not(.chosen) {
|
|
268
|
+
.smrt-assistant-choice-cards__card:disabled:not(.smrt-assistant-choice-cards__chosen) {
|
|
224
269
|
opacity: 0.55;
|
|
225
|
-
cursor: default;
|
|
226
270
|
}
|
|
227
|
-
|
|
228
|
-
.assistant-dock-choice img {
|
|
229
|
-
width: 100%;
|
|
230
|
-
aspect-ratio: 4 / 3;
|
|
231
|
-
object-fit: cover;
|
|
271
|
+
.smrt-assistant-choice-cards__card img {
|
|
232
272
|
border-radius: 0.4rem;
|
|
233
273
|
background: var(--smrt-color-surface-container);
|
|
234
274
|
}
|
|
235
|
-
|
|
236
|
-
.assistant-dock-choice-label {
|
|
275
|
+
.smrt-assistant-choice-cards__label {
|
|
237
276
|
font-size: var(--smrt-typography-body-medium-size, 0.85rem);
|
|
238
277
|
font-weight: var(--smrt-typography-weight-semibold, 600);
|
|
239
278
|
}
|
|
240
|
-
|
|
241
|
-
.assistant-dock-choice-description {
|
|
279
|
+
.smrt-assistant-choice-cards__description {
|
|
242
280
|
color: var(--smrt-color-on-surface-variant);
|
|
243
281
|
font-size: var(--smrt-typography-body-small-size, 0.78rem);
|
|
244
282
|
}
|
|
245
|
-
|
|
246
|
-
.assistant-dock-choices-actions {
|
|
247
|
-
display: flex;
|
|
248
|
-
flex-wrap: wrap;
|
|
249
|
-
align-items: center;
|
|
250
|
-
justify-content: space-between;
|
|
251
|
-
gap: 0.5rem;
|
|
283
|
+
.smrt-assistant-choice-cards__actions {
|
|
252
284
|
font-size: var(--smrt-typography-body-medium-size, 0.85rem);
|
|
253
285
|
}
|
|
254
|
-
|
|
255
286
|
/* The buttons stay in view while the cards scroll. */
|
|
256
|
-
.assistant-
|
|
257
|
-
position: sticky;
|
|
258
|
-
inset-block-end: 0;
|
|
259
|
-
padding-block: 0.25rem;
|
|
287
|
+
.smrt-assistant-choice-cards__commit {
|
|
260
288
|
background: var(--smrt-color-surface-container-low);
|
|
261
289
|
}
|
|
262
|
-
|
|
263
|
-
.assistant-dock-choices-commit :global(button) {
|
|
264
|
-
min-block-size: 44px;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
.assistant-dock-choices-commit :global(.assistant-dock-choices-use) {
|
|
268
|
-
flex: 1 1 auto;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
.assistant-dock-choices-status {
|
|
272
|
-
margin: 0;
|
|
290
|
+
.smrt-assistant-choice-cards__status {
|
|
273
291
|
font-size: var(--smrt-typography-body-medium-size, 0.85rem);
|
|
274
292
|
}
|
|
275
|
-
|
|
276
|
-
.assistant-dock-choices-error {
|
|
293
|
+
.smrt-assistant-choice-cards__error {
|
|
277
294
|
color: var(--smrt-color-error);
|
|
278
295
|
}
|
|
279
|
-
|
|
280
|
-
.assistant-dock-choice-pending {
|
|
281
|
-
display: grid;
|
|
282
|
-
gap: 0.25rem;
|
|
283
|
-
align-content: start;
|
|
284
|
-
min-height: 44px;
|
|
285
|
-
padding: 0.35rem;
|
|
296
|
+
.smrt-assistant-choice-cards__pending {
|
|
286
297
|
border: 2px dashed var(--smrt-color-outline-variant);
|
|
287
298
|
border-radius: 0.6rem;
|
|
288
299
|
color: var(--smrt-color-on-surface-variant);
|
|
289
300
|
}
|
|
290
|
-
|
|
291
|
-
.assistant-dock-choice-placeholder {
|
|
292
|
-
width: 100%;
|
|
293
|
-
aspect-ratio: 4 / 3;
|
|
301
|
+
.smrt-assistant-choice-cards__placeholder {
|
|
294
302
|
border-radius: 0.4rem;
|
|
295
303
|
background: var(--smrt-color-surface-container);
|
|
296
304
|
animation: assistant-dock-choice-pulse 1.4s ease-in-out infinite;
|
|
297
305
|
}
|
|
298
|
-
|
|
299
306
|
@keyframes assistant-dock-choice-pulse {
|
|
300
307
|
50% {
|
|
301
308
|
opacity: 0.45;
|
|
302
309
|
}
|
|
303
310
|
}
|
|
304
|
-
|
|
305
311
|
@media (prefers-reduced-motion: reduce) {
|
|
306
|
-
.assistant-
|
|
312
|
+
.smrt-assistant-choice-cards__placeholder {
|
|
307
313
|
animation: none;
|
|
308
314
|
}
|
|
309
315
|
}
|
|
310
316
|
}
|
|
317
|
+
|
|
311
318
|
</style>
|
|
@@ -390,30 +390,30 @@ function removeAttachment(id: string) {
|
|
|
390
390
|
|
|
391
391
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
392
392
|
<div
|
|
393
|
-
class="assistant-
|
|
393
|
+
class="smrt-assistant-composer__root"
|
|
394
394
|
ondrop={onupload ? handleDrop : undefined}
|
|
395
395
|
ondragover={onupload ? (event) => event.preventDefault() : undefined} data-smrt-component="AssistantComposer"
|
|
396
396
|
>
|
|
397
397
|
{#if sendError}
|
|
398
|
-
<p class="assistant-
|
|
398
|
+
<p class="smrt-assistant-composer__error" data-smrt-part="error" role="alert">
|
|
399
399
|
{t(M['chat.assistant_composer.send_error'], { message: sendError })}
|
|
400
400
|
</p>
|
|
401
401
|
{/if}
|
|
402
402
|
{#if uploadError}
|
|
403
|
-
<p class="assistant-
|
|
403
|
+
<p class="smrt-assistant-composer__error" data-smrt-part="error" role="alert">
|
|
404
404
|
{t(M['chat.assistant_composer.upload_error'], { message: uploadError })}
|
|
405
405
|
</p>
|
|
406
406
|
{/if}
|
|
407
407
|
{#if stagedAttachments.length > 0}
|
|
408
|
-
<ul class="assistant-
|
|
408
|
+
<ul class="smrt-assistant-composer__attachments" data-smrt-part="list">
|
|
409
409
|
{#each stagedAttachments as attachment (attachment.id)}
|
|
410
|
-
<li class="assistant-
|
|
411
|
-
<span class="assistant-
|
|
410
|
+
<li class="smrt-assistant-composer__chip" data-smrt-part="badge">
|
|
411
|
+
<span class="smrt-assistant-composer__chip-name" data-smrt-part="label">{attachment.name}</span>
|
|
412
412
|
<Button
|
|
413
413
|
type="button"
|
|
414
414
|
variant="ghost"
|
|
415
415
|
size="sm"
|
|
416
|
-
class="assistant-
|
|
416
|
+
class="smrt-assistant-composer__chip-remove"
|
|
417
417
|
onclick={() => removeAttachment(attachment.id)}
|
|
418
418
|
aria-label={t(M['chat.assistant_composer.remove_attachment'], {
|
|
419
419
|
name: attachment.name,
|
|
@@ -428,14 +428,14 @@ function removeAttachment(id: string) {
|
|
|
428
428
|
{#if canDictate}
|
|
429
429
|
<DictationStatus {dictation} sending={autoSendCountdown || autoSendWaiting} />
|
|
430
430
|
{/if}
|
|
431
|
-
<div class="assistant-
|
|
431
|
+
<div class="smrt-assistant-composer__row" data-smrt-part="panel">
|
|
432
432
|
{#if onupload}
|
|
433
433
|
<!-- raw-primitive-allow: compact icon-only attach control backed by a hidden native file input; opens the OS picker, matching MessageInput's icon-button send control pattern -->
|
|
434
434
|
<Button
|
|
435
435
|
type="button"
|
|
436
436
|
variant="secondary"
|
|
437
437
|
size="sm"
|
|
438
|
-
class="assistant-
|
|
438
|
+
class="smrt-assistant-composer__attach"
|
|
439
439
|
onclick={() => fileInputEl?.click()}
|
|
440
440
|
disabled={disabled || uploading}
|
|
441
441
|
aria-label={t(M['chat.assistant_composer.attach_files'])}
|
|
@@ -456,27 +456,27 @@ function removeAttachment(id: string) {
|
|
|
456
456
|
<input
|
|
457
457
|
bind:this={fileInputEl}
|
|
458
458
|
type="file"
|
|
459
|
-
class="assistant-
|
|
459
|
+
class="smrt-assistant-composer__file-input"
|
|
460
460
|
multiple
|
|
461
461
|
onchange={handleFileChange}
|
|
462
462
|
disabled={disabled || uploading}
|
|
463
463
|
tabindex="-1"
|
|
464
|
-
aria-label={t(M['chat.assistant_composer.attach_files'])}
|
|
464
|
+
aria-label={t(M['chat.assistant_composer.attach_files'])} data-smrt-part="input"
|
|
465
465
|
/>
|
|
466
466
|
{/if}
|
|
467
467
|
<div
|
|
468
|
-
class="assistant-
|
|
468
|
+
class="smrt-assistant-composer__field"
|
|
469
469
|
use:longPress={{
|
|
470
470
|
onPressStart: () => primeReadyBeep(),
|
|
471
471
|
onLongPress: startDictationFromHold,
|
|
472
472
|
onRelease: () => void dictation.unlock(),
|
|
473
473
|
disabled: !canDictate || disabled || uploading,
|
|
474
|
-
}}
|
|
474
|
+
}} data-smrt-part="field"
|
|
475
475
|
>
|
|
476
476
|
<Textarea
|
|
477
477
|
bind:this={textareaComponent}
|
|
478
478
|
bind:value={content}
|
|
479
|
-
class="assistant-
|
|
479
|
+
class="smrt-assistant-composer__textarea"
|
|
480
480
|
{placeholder}
|
|
481
481
|
disabled={disabled || uploading}
|
|
482
482
|
rows={1}
|
|
@@ -490,7 +490,7 @@ function removeAttachment(id: string) {
|
|
|
490
490
|
{/if}
|
|
491
491
|
<Button
|
|
492
492
|
type="button"
|
|
493
|
-
class="assistant-
|
|
493
|
+
class="smrt-assistant-composer__send"
|
|
494
494
|
onclick={() => handleSend()}
|
|
495
495
|
disabled={disabled || uploading || sending || !content.trim()}
|
|
496
496
|
>
|
|
@@ -501,23 +501,18 @@ function removeAttachment(id: string) {
|
|
|
501
501
|
|
|
502
502
|
<style>
|
|
503
503
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
504
|
-
@layer smrt.
|
|
505
|
-
.assistant-
|
|
506
|
-
border-top: var(--smrt-hairline);
|
|
507
|
-
background: var(--smrt-color-surface);
|
|
504
|
+
@layer smrt.structure {
|
|
505
|
+
.smrt-assistant-composer__root {
|
|
508
506
|
padding: var(--smrt-spacing-2);
|
|
509
507
|
flex-shrink: 0;
|
|
510
508
|
container-type: inline-size;
|
|
511
509
|
}
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
.assistant-composer-row {
|
|
510
|
+
.smrt-assistant-composer__row {
|
|
515
511
|
display: flex;
|
|
516
512
|
align-items: flex-end;
|
|
517
513
|
gap: var(--smrt-spacing-2);
|
|
518
514
|
}
|
|
519
|
-
|
|
520
|
-
:global(.assistant-composer-attach) {
|
|
515
|
+
:global(.smrt-assistant-composer__attach) {
|
|
521
516
|
flex-shrink: 0;
|
|
522
517
|
display: inline-flex;
|
|
523
518
|
align-items: center;
|
|
@@ -525,68 +520,36 @@ function removeAttachment(id: string) {
|
|
|
525
520
|
width: 44px;
|
|
526
521
|
height: 44px;
|
|
527
522
|
padding: 0;
|
|
528
|
-
border: var(--smrt-hairline);
|
|
529
|
-
border-radius: var(--smrt-radius-full);
|
|
530
|
-
background: var(--smrt-color-surface-container-low);
|
|
531
|
-
color: var(--smrt-color-on-surface-variant);
|
|
532
523
|
cursor: pointer;
|
|
533
524
|
}
|
|
534
|
-
|
|
535
|
-
:global(.assistant-composer-attach:hover:not(:disabled)) {
|
|
536
|
-
background: var(--smrt-color-surface-container);
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
:global(.assistant-composer-attach:disabled) {
|
|
540
|
-
opacity: 0.5;
|
|
525
|
+
:global(.smrt-assistant-composer__attach:disabled) {
|
|
541
526
|
cursor: not-allowed;
|
|
542
527
|
}
|
|
543
|
-
|
|
544
|
-
.assistant-composer-file-input {
|
|
528
|
+
.smrt-assistant-composer__file-input {
|
|
545
529
|
position: absolute;
|
|
546
530
|
width: 1px;
|
|
547
531
|
height: 1px;
|
|
548
532
|
overflow: hidden;
|
|
549
533
|
clip: rect(0 0 0 0);
|
|
550
534
|
}
|
|
551
|
-
|
|
552
|
-
.assistant-composer-field {
|
|
535
|
+
.smrt-assistant-composer__field {
|
|
553
536
|
flex: 1;
|
|
554
537
|
display: flex;
|
|
555
538
|
min-inline-size: 0;
|
|
556
539
|
}
|
|
557
|
-
|
|
558
|
-
:global(.assistant-composer-textarea) {
|
|
540
|
+
:global(.smrt-assistant-composer__textarea) {
|
|
559
541
|
flex: 1;
|
|
560
542
|
resize: none;
|
|
561
|
-
/* #3000: form controls don't inherit font; use the theme's family. */
|
|
562
|
-
font-family: var(--smrt-font-family, inherit);
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
/* Phones: 16px text so iOS Safari doesn't zoom the page when the
|
|
566
|
-
message field gets focus. */
|
|
567
|
-
@media (max-width: 48rem) {
|
|
568
|
-
:global(.assistant-composer-textarea) {
|
|
569
|
-
font-size: max(1rem, 16px);
|
|
570
|
-
}
|
|
571
543
|
}
|
|
572
|
-
|
|
573
|
-
:global(.assistant-composer-send) {
|
|
544
|
+
:global(.smrt-assistant-composer__send) {
|
|
574
545
|
flex-shrink: 0;
|
|
575
546
|
padding: var(--smrt-spacing-2) var(--smrt-spacing-3);
|
|
576
|
-
border: none;
|
|
577
|
-
border-radius: var(--smrt-radius-medium);
|
|
578
|
-
background: var(--smrt-color-primary);
|
|
579
|
-
color: var(--smrt-color-on-primary);
|
|
580
|
-
font: var(--smrt-typography-label-large-font, 500 0.875rem/1.25 sans-serif);
|
|
581
547
|
cursor: pointer;
|
|
582
548
|
}
|
|
583
|
-
|
|
584
|
-
:global(.assistant-composer-send:disabled) {
|
|
585
|
-
opacity: 0.5;
|
|
549
|
+
:global(.smrt-assistant-composer__send:disabled) {
|
|
586
550
|
cursor: not-allowed;
|
|
587
551
|
}
|
|
588
|
-
|
|
589
|
-
.assistant-composer-attachments {
|
|
552
|
+
.smrt-assistant-composer__attachments {
|
|
590
553
|
list-style: none;
|
|
591
554
|
display: flex;
|
|
592
555
|
flex-wrap: wrap;
|
|
@@ -594,60 +557,100 @@ function removeAttachment(id: string) {
|
|
|
594
557
|
margin: 0 0 var(--smrt-spacing-2);
|
|
595
558
|
padding: 0;
|
|
596
559
|
}
|
|
597
|
-
|
|
598
|
-
.assistant-composer-chip {
|
|
560
|
+
.smrt-assistant-composer__chip {
|
|
599
561
|
display: inline-flex;
|
|
600
562
|
align-items: center;
|
|
601
563
|
gap: var(--smrt-spacing-1);
|
|
602
564
|
padding: var(--smrt-spacing-1) var(--smrt-spacing-2);
|
|
603
|
-
border-radius: var(--smrt-radius-full);
|
|
604
|
-
background: var(--smrt-color-surface-container-low);
|
|
605
|
-
border: var(--smrt-hairline);
|
|
606
|
-
font: var(--smrt-typography-label-small-font, 500 0.6875rem/1 sans-serif);
|
|
607
|
-
color: var(--smrt-color-on-surface);
|
|
608
565
|
max-width: 160px;
|
|
609
566
|
}
|
|
610
|
-
|
|
611
|
-
.assistant-composer-chip-name {
|
|
567
|
+
.smrt-assistant-composer__chip-name {
|
|
612
568
|
overflow: hidden;
|
|
613
569
|
text-overflow: ellipsis;
|
|
614
570
|
white-space: nowrap;
|
|
615
571
|
}
|
|
616
|
-
|
|
617
|
-
:global(.assistant-composer-chip-remove) {
|
|
618
|
-
border: none;
|
|
619
|
-
background: none;
|
|
620
|
-
color: var(--smrt-color-on-surface-variant);
|
|
572
|
+
:global(.smrt-assistant-composer__chip-remove) {
|
|
621
573
|
cursor: pointer;
|
|
622
|
-
line-height: 1;
|
|
623
574
|
padding: 0;
|
|
624
575
|
}
|
|
625
|
-
|
|
626
|
-
.assistant-composer-error {
|
|
576
|
+
.smrt-assistant-composer__error {
|
|
627
577
|
margin: 0 0 var(--smrt-spacing-2);
|
|
628
578
|
padding: var(--smrt-spacing-2) var(--smrt-spacing-3);
|
|
629
|
-
border-radius: var(--smrt-radius-medium);
|
|
630
|
-
background: var(--smrt-color-error-container);
|
|
631
|
-
color: var(--smrt-color-on-error-container);
|
|
632
|
-
font: var(--smrt-typography-body-small-font, 0.8125rem/1.4 sans-serif);
|
|
633
579
|
}
|
|
634
|
-
|
|
635
580
|
/* A narrow dock (a sidebar a couple of hundred pixels wide): the message
|
|
636
|
-
|
|
637
|
-
|
|
581
|
+
field takes the whole row and the attach, dictate and send controls sit
|
|
582
|
+
under it, so the placeholder never wraps a syllable per line. */
|
|
638
583
|
@container (max-width: 22rem) {
|
|
639
|
-
.assistant-
|
|
584
|
+
.smrt-assistant-composer__row {
|
|
640
585
|
flex-wrap: wrap;
|
|
641
586
|
}
|
|
642
|
-
|
|
643
|
-
.assistant-composer-field {
|
|
587
|
+
.smrt-assistant-composer__field {
|
|
644
588
|
flex: 1 1 100%;
|
|
645
589
|
order: -1;
|
|
646
590
|
}
|
|
647
|
-
|
|
648
|
-
:global(.assistant-composer-send) {
|
|
591
|
+
:global(.smrt-assistant-composer__send) {
|
|
649
592
|
margin-inline-start: auto;
|
|
650
593
|
}
|
|
651
594
|
}
|
|
652
595
|
}
|
|
596
|
+
|
|
597
|
+
@layer smrt.theme {
|
|
598
|
+
.smrt-assistant-composer__root {
|
|
599
|
+
border-top: var(--smrt-hairline);
|
|
600
|
+
background: var(--smrt-color-surface);
|
|
601
|
+
}
|
|
602
|
+
:global(.smrt-assistant-composer__attach) {
|
|
603
|
+
border: var(--smrt-hairline);
|
|
604
|
+
border-radius: var(--smrt-radius-full);
|
|
605
|
+
background: var(--smrt-color-surface-container-low);
|
|
606
|
+
color: var(--smrt-color-on-surface-variant);
|
|
607
|
+
}
|
|
608
|
+
:global(.smrt-assistant-composer__attach:hover:not(:disabled)) {
|
|
609
|
+
background: var(--smrt-color-surface-container);
|
|
610
|
+
}
|
|
611
|
+
:global(.smrt-assistant-composer__attach:disabled) {
|
|
612
|
+
opacity: 0.5;
|
|
613
|
+
}
|
|
614
|
+
:global(.smrt-assistant-composer__textarea) {
|
|
615
|
+
/* #3000: form controls don't inherit font; use the theme's family. */
|
|
616
|
+
font-family: var(--smrt-font-family, inherit);
|
|
617
|
+
}
|
|
618
|
+
/* Phones: 16px text so iOS Safari doesn't zoom the page when the
|
|
619
|
+
message field gets focus. */
|
|
620
|
+
@media (max-width: 48rem) {
|
|
621
|
+
:global(.smrt-assistant-composer__textarea) {
|
|
622
|
+
font-size: max(1rem, 16px);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
:global(.smrt-assistant-composer__send) {
|
|
626
|
+
border: none;
|
|
627
|
+
border-radius: var(--smrt-radius-medium);
|
|
628
|
+
background: var(--smrt-color-primary);
|
|
629
|
+
color: var(--smrt-color-on-primary);
|
|
630
|
+
font: var(--smrt-typography-label-large-font, 500 0.875rem/1.25 sans-serif);
|
|
631
|
+
}
|
|
632
|
+
:global(.smrt-assistant-composer__send:disabled) {
|
|
633
|
+
opacity: 0.5;
|
|
634
|
+
}
|
|
635
|
+
.smrt-assistant-composer__chip {
|
|
636
|
+
border-radius: var(--smrt-radius-full);
|
|
637
|
+
background: var(--smrt-color-surface-container-low);
|
|
638
|
+
border: var(--smrt-hairline);
|
|
639
|
+
font: var(--smrt-typography-label-small-font, 500 0.6875rem/1 sans-serif);
|
|
640
|
+
color: var(--smrt-color-on-surface);
|
|
641
|
+
}
|
|
642
|
+
:global(.smrt-assistant-composer__chip-remove) {
|
|
643
|
+
border: none;
|
|
644
|
+
background: none;
|
|
645
|
+
color: var(--smrt-color-on-surface-variant);
|
|
646
|
+
line-height: 1;
|
|
647
|
+
}
|
|
648
|
+
.smrt-assistant-composer__error {
|
|
649
|
+
border-radius: var(--smrt-radius-medium);
|
|
650
|
+
background: var(--smrt-color-error-container);
|
|
651
|
+
color: var(--smrt-color-on-error-container);
|
|
652
|
+
font: var(--smrt-typography-body-small-font, 0.8125rem/1.4 sans-serif);
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
|
|
653
656
|
</style>
|