@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
|
@@ -338,27 +338,27 @@ async function customSaved(offering: HelperOffering) {
|
|
|
338
338
|
}
|
|
339
339
|
</script>
|
|
340
340
|
|
|
341
|
-
<section class="helper-
|
|
341
|
+
<section class="smrt-helper-control-panel__root" aria-busy={loading || saving} aria-labelledby="helper-panel-title" data-smrt-component="HelperControlPanel">
|
|
342
342
|
<h2 id="helper-panel-title">{t(M['chat.helper.title'])}</h2>
|
|
343
|
-
{#if message}<p class="message" role={messageIsError ? 'alert' : 'status'} aria-live={messageIsError ? 'assertive' : 'polite'}>{message}</p>{/if}
|
|
344
|
-
{#if snapshot?.recovery}<p class="message" role="status">{snapshot.recovery.message}</p>{/if}
|
|
343
|
+
{#if message}<p class="smrt-helper-control-panel__message" data-smrt-part="message" role={messageIsError ? 'alert' : 'status'} aria-live={messageIsError ? 'assertive' : 'polite'}>{message}</p>{/if}
|
|
344
|
+
{#if snapshot?.recovery}<p class="smrt-helper-control-panel__message" data-smrt-part="message" role="status">{snapshot.recovery.message}</p>{/if}
|
|
345
345
|
{#if loading}<p>{t(M['chat.helper.loading'])}</p>
|
|
346
346
|
{:else if !snapshot}<p>{t(M['chat.helper.unavailable'])}</p>
|
|
347
347
|
{:else}
|
|
348
348
|
<fieldset disabled={saving}>
|
|
349
349
|
<legend>{t(M['chat.helper.gallery'])}</legend>
|
|
350
|
-
<div class="
|
|
350
|
+
<div class="smrt-helper-control-panel__gallery" data-smrt-part="list" role="radiogroup" tabindex="-1" aria-label={t(M['chat.helper.gallery'])} onkeydown={moveGallerySelection}>
|
|
351
351
|
{#each availableOfferings as offering, index (offering.id)}
|
|
352
|
-
<Button id={`${panelInstanceId}-offering-${index}`} tabindex={galleryTabStopIndex === index ? 0 : -1} type="button" variant="secondary"
|
|
352
|
+
<Button id={`${panelInstanceId}-offering-${index}`} tabindex={galleryTabStopIndex === index ? 0 : -1} type="button" variant="secondary" role="radio" aria-checked={draft?.offeringId === offering.id}
|
|
353
353
|
disabled={!draft || !editable('offeringId')} onclick={() => update('offeringId', offering.id)}>{offering.label}</Button>
|
|
354
354
|
{/each}
|
|
355
355
|
</div>
|
|
356
356
|
{#if previewOffering}
|
|
357
|
-
<div class="
|
|
357
|
+
<div class="smrt-helper-control-panel__preview" data-smrt-part="panel" aria-label={t(M['chat.helper.preview'])} bind:this={previewTarget}></div>
|
|
358
358
|
{/if}
|
|
359
|
-
{#if previewError}<p class="message" role="status">{previewError}</p>{/if}
|
|
359
|
+
{#if previewError}<p class="smrt-helper-control-panel__message" data-smrt-part="message" role="status">{previewError}</p>{/if}
|
|
360
360
|
{#if availableSetups.length}
|
|
361
|
-
<div class="
|
|
361
|
+
<div class="smrt-helper-control-panel__setup-actions" data-smrt-part="actions">
|
|
362
362
|
{#each availableSetups as style (style.id)}
|
|
363
363
|
<Button id={`${panelInstanceId}-setup-${style.id}`} type="button" variant="secondary" disabled={!editable('offeringId')} onclick={() => openSetup(style.id)}>{t(M['chat.helper.add_style'], { style: style.label })}</Button>
|
|
364
364
|
{/each}
|
|
@@ -366,7 +366,7 @@ async function customSaved(offering: HelperOffering) {
|
|
|
366
366
|
{/if}
|
|
367
367
|
{#if setupStyleId && registry.get(setupStyleId)?.Setup}
|
|
368
368
|
{@const Setup = registry.get(setupStyleId)?.Setup}
|
|
369
|
-
<section bind:this={setupTarget} class="
|
|
369
|
+
<section bind:this={setupTarget} class="smrt-helper-control-panel__custom-setup" data-smrt-part="actions" aria-label={t(M['chat.helper.custom_setup'])}>
|
|
370
370
|
<Button type="button" variant="secondary" onclick={closeSetup}>{t(M['chat.helper.back_to_settings'])}</Button>
|
|
371
371
|
{#if Setup}<Setup onsaved={customSaved} oncancel={closeSetup} />{/if}
|
|
372
372
|
</section>
|
|
@@ -378,27 +378,97 @@ async function customSaved(offering: HelperOffering) {
|
|
|
378
378
|
<Switch label={t(M['chat.helper.heard_subtitles'])} checked={draft.heardSubtitles} disabled={!editable('heardSubtitles')} onchange={(event) => update('heardSubtitles', event.currentTarget.checked)} />
|
|
379
379
|
<Switch label={t(M['chat.helper.spoken_subtitles'])} checked={draft.spokenSubtitles} disabled={!editable('spokenSubtitles')} onchange={(event) => update('spokenSubtitles', event.currentTarget.checked)} />
|
|
380
380
|
{:else}
|
|
381
|
-
<p class="message">{t(M['chat.helper.unavailable'])}</p>
|
|
381
|
+
<p class="smrt-helper-control-panel__message" data-smrt-part="message">{t(M['chat.helper.unavailable'])}</p>
|
|
382
382
|
{/if}
|
|
383
383
|
</fieldset>
|
|
384
|
-
{#if dirty}<p class="message" role="status">{t(M['chat.helper.unsaved_changes'])}</p>{/if}
|
|
385
|
-
<div class="actions">{#if canSave}<Button type="button" onclick={save} disabled={saving || !dirty}>{saving ? t(M['chat.helper.saving']) : t(M['chat.helper.save_changes'])}</Button>{/if}{#if snapshot.permissions.canReset}<Button type="button" variant="secondary" onclick={reset} disabled={saving}>{t(M['chat.helper.reset_button'])}</Button>{/if}</div>
|
|
384
|
+
{#if dirty}<p class="smrt-helper-control-panel__message" data-smrt-part="message" role="status">{t(M['chat.helper.unsaved_changes'])}</p>{/if}
|
|
385
|
+
<div class="smrt-helper-control-panel__actions" data-smrt-part="actions">{#if canSave}<Button type="button" onclick={save} disabled={saving || !dirty}>{saving ? t(M['chat.helper.saving']) : t(M['chat.helper.save_changes'])}</Button>{/if}{#if snapshot.permissions.canReset}<Button type="button" variant="secondary" onclick={reset} disabled={saving}>{t(M['chat.helper.reset_button'])}</Button>{/if}</div>
|
|
386
386
|
{/if}
|
|
387
387
|
</section>
|
|
388
388
|
|
|
389
389
|
<style>
|
|
390
390
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
391
|
+
@layer smrt.structure {
|
|
392
|
+
.smrt-helper-control-panel__root {
|
|
393
|
+
display: grid;
|
|
394
|
+
gap: var(--smrt-spacing-4);
|
|
395
|
+
max-width: 42rem;
|
|
396
|
+
padding: var(--smrt-spacing-4);
|
|
397
|
+
}
|
|
398
|
+
fieldset {
|
|
399
|
+
display: grid;
|
|
400
|
+
gap: var(--smrt-spacing-3);
|
|
401
|
+
margin: 0;
|
|
402
|
+
padding: 0;
|
|
403
|
+
}
|
|
404
|
+
label {
|
|
405
|
+
display: grid;
|
|
406
|
+
gap: var(--smrt-spacing-1);
|
|
407
|
+
}
|
|
408
|
+
.smrt-helper-control-panel__gallery {
|
|
409
|
+
display: grid;
|
|
410
|
+
grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
|
|
411
|
+
gap: var(--smrt-spacing-2);
|
|
412
|
+
}
|
|
413
|
+
.smrt-helper-control-panel__gallery :global([data-smrt-component="Button"]) {
|
|
414
|
+
min-height: 3rem;
|
|
415
|
+
}
|
|
416
|
+
.smrt-helper-control-panel__preview {
|
|
417
|
+
min-height: 5rem;
|
|
418
|
+
display: grid;
|
|
419
|
+
place-items: center;
|
|
420
|
+
overflow: hidden;
|
|
421
|
+
}
|
|
422
|
+
.smrt-helper-control-panel__preview :global(svg), .smrt-helper-control-panel__preview :global(img) {
|
|
423
|
+
max-width: 100%;
|
|
424
|
+
max-height: 12rem;
|
|
425
|
+
}
|
|
426
|
+
.smrt-helper-control-panel__setup-actions, .smrt-helper-control-panel__actions {
|
|
427
|
+
display: flex;
|
|
428
|
+
flex-wrap: wrap;
|
|
429
|
+
gap: var(--smrt-spacing-2);
|
|
430
|
+
}
|
|
431
|
+
.smrt-helper-control-panel__custom-setup {
|
|
432
|
+
display: grid;
|
|
433
|
+
gap: var(--smrt-spacing-3);
|
|
434
|
+
padding: var(--smrt-spacing-3);
|
|
435
|
+
}
|
|
436
|
+
.smrt-helper-control-panel__message {
|
|
437
|
+
margin: 0;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
391
441
|
@layer smrt.theme {
|
|
392
|
-
.
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
.
|
|
402
|
-
|
|
442
|
+
.smrt-helper-control-panel__root {
|
|
443
|
+
color: var(--smrt-color-on-surface);
|
|
444
|
+
}
|
|
445
|
+
fieldset {
|
|
446
|
+
border: 0;
|
|
447
|
+
}
|
|
448
|
+
label {
|
|
449
|
+
font: var(--smrt-typography-label-large-font);
|
|
450
|
+
}
|
|
451
|
+
.smrt-helper-control-panel__gallery :global([data-smrt-component="Button"]) {
|
|
452
|
+
border-color: var(--smrt-hairline-strong-color);
|
|
453
|
+
background: var(--smrt-color-surface);
|
|
454
|
+
color: inherit;
|
|
455
|
+
}
|
|
456
|
+
.smrt-helper-control-panel__gallery :global([data-smrt-component="Button"][aria-checked="true"]) {
|
|
457
|
+
border-color: var(--smrt-color-primary);
|
|
458
|
+
background: var(--smrt-color-primary-container);
|
|
459
|
+
}
|
|
460
|
+
.smrt-helper-control-panel__preview {
|
|
461
|
+
border: var(--smrt-hairline);
|
|
462
|
+
border-radius: var(--smrt-radius-small);
|
|
463
|
+
background: var(--smrt-color-surface-container-low);
|
|
464
|
+
}
|
|
465
|
+
.smrt-helper-control-panel__custom-setup {
|
|
466
|
+
border: var(--smrt-hairline);
|
|
467
|
+
border-radius: var(--smrt-radius-small);
|
|
468
|
+
}
|
|
469
|
+
.smrt-helper-control-panel__message {
|
|
470
|
+
color: var(--smrt-color-on-surface-variant);
|
|
471
|
+
}
|
|
403
472
|
}
|
|
473
|
+
|
|
404
474
|
</style>
|
|
@@ -58,9 +58,12 @@ function handlePointerUp() {
|
|
|
58
58
|
}
|
|
59
59
|
</script>
|
|
60
60
|
|
|
61
|
-
<div class="chat-
|
|
61
|
+
<div class="smrt-chat-layout__root" data-smrt-component="ChatLayout"
|
|
62
|
+
class:smrt-chat-layout__resizing={isResizing}
|
|
63
|
+
>
|
|
62
64
|
<aside
|
|
63
|
-
class="chat-layout__sidebar"
|
|
65
|
+
class="smrt-chat-layout__sidebar"
|
|
66
|
+
data-smrt-part="panel"
|
|
64
67
|
style:--smrt-chat-layout-sidebar-width="{sidebarWidth}px"
|
|
65
68
|
aria-label={t(M['chat.chat_layout.rooms_label'])}
|
|
66
69
|
>
|
|
@@ -75,7 +78,8 @@ function handlePointerUp() {
|
|
|
75
78
|
<!-- raw-primitive-allow: custom drag-to-resize splitter with pointer capture (pointerdown/move/up) and ArrowLeft/ArrowRight keyboard resizing; a press-and-drag control no Button primitive owns -->
|
|
76
79
|
<button
|
|
77
80
|
type="button"
|
|
78
|
-
class="chat-
|
|
81
|
+
class="smrt-chat-layout__handle"
|
|
82
|
+
data-smrt-part="meta"
|
|
79
83
|
aria-label={t(M['chat.chat_layout.resize_sidebar'])}
|
|
80
84
|
onpointerdown={handlePointerDown}
|
|
81
85
|
onpointermove={handlePointerMove}
|
|
@@ -86,83 +90,88 @@ function handlePointerUp() {
|
|
|
86
90
|
}}
|
|
87
91
|
></button>
|
|
88
92
|
|
|
89
|
-
<main class="chat-
|
|
93
|
+
<main class="smrt-chat-layout__body" data-smrt-part="body">
|
|
90
94
|
{@render children()}
|
|
91
95
|
</main>
|
|
92
96
|
</div>
|
|
93
97
|
|
|
94
98
|
<style>
|
|
95
99
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
96
|
-
@layer smrt.
|
|
97
|
-
.chat-
|
|
100
|
+
@layer smrt.structure {
|
|
101
|
+
.smrt-chat-layout__root {
|
|
98
102
|
display: flex;
|
|
99
103
|
height: 100%;
|
|
100
104
|
width: 100%;
|
|
101
105
|
overflow: hidden;
|
|
102
|
-
background: var(--smrt-color-surface);
|
|
103
|
-
color: var(--smrt-color-on-surface);
|
|
104
106
|
}
|
|
105
|
-
|
|
106
|
-
.chat-layout--resizing {
|
|
107
|
+
.smrt-chat-layout__resizing {
|
|
107
108
|
user-select: none;
|
|
108
109
|
cursor: col-resize;
|
|
109
110
|
}
|
|
110
|
-
|
|
111
|
-
.chat-layout__sidebar {
|
|
111
|
+
.smrt-chat-layout__sidebar {
|
|
112
112
|
flex-shrink: 0;
|
|
113
113
|
width: var(--smrt-chat-layout-sidebar-width);
|
|
114
114
|
display: flex;
|
|
115
115
|
flex-direction: column;
|
|
116
|
-
background: var(--smrt-color-surface-container);
|
|
117
|
-
border-right: var(--smrt-hairline);
|
|
118
116
|
overflow-y: auto;
|
|
119
117
|
overflow-x: hidden;
|
|
120
118
|
}
|
|
121
|
-
|
|
122
|
-
.chat-layout__resize-handle {
|
|
119
|
+
.smrt-chat-layout__handle {
|
|
123
120
|
flex-shrink: 0;
|
|
124
121
|
width: 4px;
|
|
125
122
|
padding: 0;
|
|
126
|
-
border: 0;
|
|
127
123
|
cursor: col-resize;
|
|
128
|
-
background: transparent;
|
|
129
|
-
transition: background var(--smrt-duration-short2, 150ms);
|
|
130
124
|
}
|
|
131
|
-
|
|
132
|
-
.chat-layout__resize-handle:hover,
|
|
133
|
-
.chat-layout__resize-handle:active {
|
|
134
|
-
background: var(--smrt-color-primary);
|
|
135
|
-
opacity: 0.4;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.chat-layout__resize-handle:focus-visible {
|
|
139
|
-
outline: 2px solid var(--smrt-color-primary);
|
|
140
|
-
outline-offset: -2px;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.chat-layout__content {
|
|
125
|
+
.smrt-chat-layout__body {
|
|
144
126
|
flex: 1;
|
|
145
127
|
display: flex;
|
|
146
128
|
flex-direction: column;
|
|
147
129
|
min-width: 0;
|
|
148
130
|
overflow: hidden;
|
|
149
131
|
}
|
|
150
|
-
|
|
151
132
|
@media (max-width: 600px) {
|
|
152
|
-
.chat-
|
|
133
|
+
.smrt-chat-layout__root {
|
|
153
134
|
flex-direction: column;
|
|
154
135
|
}
|
|
155
|
-
|
|
156
|
-
.chat-layout__sidebar {
|
|
136
|
+
.smrt-chat-layout__sidebar {
|
|
157
137
|
width: 100%;
|
|
158
138
|
max-height: 14rem;
|
|
159
|
-
border-right: 0;
|
|
160
|
-
border-bottom: var(--smrt-hairline);
|
|
161
139
|
}
|
|
162
|
-
|
|
163
|
-
.chat-layout__resize-handle {
|
|
140
|
+
.smrt-chat-layout__handle {
|
|
164
141
|
display: none;
|
|
165
142
|
}
|
|
166
143
|
}
|
|
167
144
|
}
|
|
145
|
+
|
|
146
|
+
@layer smrt.theme {
|
|
147
|
+
.smrt-chat-layout__root {
|
|
148
|
+
background: var(--smrt-color-surface);
|
|
149
|
+
color: var(--smrt-color-on-surface);
|
|
150
|
+
}
|
|
151
|
+
.smrt-chat-layout__sidebar {
|
|
152
|
+
background: var(--smrt-color-surface-container);
|
|
153
|
+
border-right: var(--smrt-hairline);
|
|
154
|
+
}
|
|
155
|
+
.smrt-chat-layout__handle {
|
|
156
|
+
border: 0;
|
|
157
|
+
background: transparent;
|
|
158
|
+
transition: background var(--smrt-duration-short2, 150ms);
|
|
159
|
+
}
|
|
160
|
+
.smrt-chat-layout__handle:hover,
|
|
161
|
+
.smrt-chat-layout__handle:active {
|
|
162
|
+
background: var(--smrt-color-primary);
|
|
163
|
+
opacity: 0.4;
|
|
164
|
+
}
|
|
165
|
+
.smrt-chat-layout__handle:focus-visible {
|
|
166
|
+
outline: 2px solid var(--smrt-color-primary);
|
|
167
|
+
outline-offset: -2px;
|
|
168
|
+
}
|
|
169
|
+
@media (max-width: 600px) {
|
|
170
|
+
.smrt-chat-layout__sidebar {
|
|
171
|
+
border-right: 0;
|
|
172
|
+
border-bottom: var(--smrt-hairline);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
168
177
|
</style>
|