@sveda-ai/vue 0.1.0 → 0.1.3
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/README.md +2 -0
- package/dist/appearance.d.ts +13 -0
- package/dist/appearance.d.ts.map +1 -1
- package/dist/components/chat/ChatInput.vue.d.ts.map +1 -1
- package/dist/components/shell/SvedaFrameTicks.vue.d.ts +3 -0
- package/dist/components/shell/SvedaFrameTicks.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaResizeHandles.vue.d.ts +2 -2
- package/dist/components/shell/SvedaToolbar.vue.d.ts +2 -2
- package/dist/composables/useSvedaChatLayout.d.ts +5 -5
- package/dist/composables/useSvedaChatLayout.d.ts.map +1 -1
- package/dist/composables/useSvedaChatPage.d.ts +2 -2
- package/dist/composables/useSvedaChatPage.d.ts.map +1 -1
- package/dist/composables/useSvedaMessaging.d.ts.map +1 -1
- package/dist/composables/useSvedaModel.d.ts.map +1 -1
- package/dist/composables/useSvedaShell.d.ts +2 -2
- package/dist/composables/useSvedaShell.d.ts.map +1 -1
- package/dist/composables/useSvedaStreaming.d.ts.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2755 -2547
- package/dist/lib/chatResize.d.ts +42 -0
- package/dist/lib/chatResize.d.ts.map +1 -0
- package/dist/lib/chatUiStorage.d.ts +2 -0
- package/dist/lib/chatUiStorage.d.ts.map +1 -1
- package/dist/plugin.d.ts +4 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/styles.css +2 -4
- package/dist/vue.css +1 -1
- package/package.json +29 -18
- package/src/appearance.ts +147 -40
- package/src/components/chat/ChatHistoryDropdown.vue +6 -5
- package/src/components/chat/ChatInput.vue +8 -8
- package/src/components/chat/ChatMessageItem.vue +7 -7
- package/src/components/chat/ChatPendingIndicator.vue +1 -1
- package/src/components/shell/SvedaChat.vue +12 -9
- package/src/components/shell/SvedaFrameTicks.vue +18 -0
- package/src/components/shell/SvedaMinimizedTrigger.vue +2 -2
- package/src/components/shell/SvedaModelControls.vue +13 -3
- package/src/components/shell/SvedaModelSelect.vue +1 -1
- package/src/components/shell/SvedaResizeHandles.vue +8 -8
- package/src/components/shell/SvedaTabs.vue +3 -3
- package/src/components/shell/SvedaToolbar.vue +3 -3
- package/src/composables/useSvedaChatLayout.ts +203 -93
- package/src/composables/useSvedaChatPage.ts +4 -2
- package/src/composables/useSvedaMessaging.ts +12 -1
- package/src/composables/useSvedaModel.ts +3 -1
- package/src/composables/useSvedaShell.ts +12 -9
- package/src/composables/useSvedaStreaming.ts +9 -1
- package/src/index.ts +12 -0
- package/src/lib/chatResize.ts +123 -0
- package/src/lib/chatUiStorage.ts +46 -10
- package/src/plugin.ts +45 -1
- package/src/theme.css +56 -43
- package/src/theme.test.mjs +33 -1
- package/src/ui/button/index.ts +7 -7
- package/src/ui/card/Card.vue +1 -1
- package/src/ui/switch/Switch.vue +2 -2
package/src/appearance.ts
CHANGED
|
@@ -61,6 +61,11 @@ export type SvedaAppearanceLauncher = {
|
|
|
61
61
|
image: string;
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
+
export type SvedaAppearanceChrome = {
|
|
65
|
+
modelSelect: boolean;
|
|
66
|
+
thinking: boolean;
|
|
67
|
+
};
|
|
68
|
+
|
|
64
69
|
export type SvedaAppearance = {
|
|
65
70
|
preset?: string;
|
|
66
71
|
radius?: string;
|
|
@@ -68,60 +73,65 @@ export type SvedaAppearance = {
|
|
|
68
73
|
tokens?: Partial<SvedaAppearanceTokens> | Record<string, string>;
|
|
69
74
|
dark_tokens?: Partial<SvedaAppearanceTokens> | Record<string, string>;
|
|
70
75
|
launcher?: Partial<SvedaAppearanceLauncher> | { label?: string; icon?: string; image?: string };
|
|
76
|
+
chrome?: Partial<SvedaAppearanceChrome>;
|
|
71
77
|
};
|
|
72
78
|
|
|
73
79
|
export const SVEDA_APPEARANCE_PRESET_IDS = ['default', 'lms', 'ocean', 'forest', 'sunset', 'sand'] as const;
|
|
74
80
|
|
|
75
81
|
export type SvedaAppearancePresetId = (typeof SVEDA_APPEARANCE_PRESET_IDS)[number];
|
|
76
82
|
|
|
77
|
-
const
|
|
78
|
-
background: '
|
|
79
|
-
foreground: '0 0%
|
|
83
|
+
const LANDING_LIGHT: SvedaAppearanceTokens = {
|
|
84
|
+
background: '0 0% 100%',
|
|
85
|
+
foreground: '0 0% 4%',
|
|
80
86
|
card: '0 0% 100%',
|
|
81
|
-
card_foreground: '0 0%
|
|
87
|
+
card_foreground: '0 0% 4%',
|
|
82
88
|
popover: '0 0% 100%',
|
|
83
|
-
popover_foreground: '0 0%
|
|
84
|
-
primary: '0 0%
|
|
85
|
-
primary_foreground: '0 0%
|
|
86
|
-
secondary: '
|
|
87
|
-
secondary_foreground: '0 0%
|
|
88
|
-
muted: '
|
|
89
|
-
muted_foreground: '
|
|
90
|
-
accent: '
|
|
91
|
-
accent_foreground: '0 0%
|
|
89
|
+
popover_foreground: '0 0% 4%',
|
|
90
|
+
primary: '0 0% 4%',
|
|
91
|
+
primary_foreground: '0 0% 100%',
|
|
92
|
+
secondary: '40 20% 90%',
|
|
93
|
+
secondary_foreground: '0 0% 4%',
|
|
94
|
+
muted: '40 22% 90%',
|
|
95
|
+
muted_foreground: '40 6% 41%',
|
|
96
|
+
accent: '40 22% 90%',
|
|
97
|
+
accent_foreground: '0 0% 4%',
|
|
92
98
|
destructive: '0 84.2% 60.2%',
|
|
93
99
|
destructive_foreground: '0 0% 98%',
|
|
94
|
-
border: '
|
|
95
|
-
input: '
|
|
96
|
-
ring: '0 0%
|
|
97
|
-
brand: '0 0%
|
|
98
|
-
brand_foreground: '0 0%
|
|
100
|
+
border: '42 18% 82%',
|
|
101
|
+
input: '40 22% 92%',
|
|
102
|
+
ring: '0 0% 4%',
|
|
103
|
+
brand: '0 0% 4%',
|
|
104
|
+
brand_foreground: '0 0% 100%',
|
|
99
105
|
};
|
|
100
106
|
|
|
101
|
-
const
|
|
102
|
-
background: '
|
|
103
|
-
foreground: '
|
|
104
|
-
card: '
|
|
105
|
-
card_foreground: '
|
|
106
|
-
popover: '
|
|
107
|
-
popover_foreground: '
|
|
108
|
-
primary: '
|
|
109
|
-
primary_foreground: '
|
|
110
|
-
secondary: '
|
|
111
|
-
secondary_foreground: '
|
|
112
|
-
muted: '
|
|
113
|
-
muted_foreground: '
|
|
114
|
-
accent: '
|
|
115
|
-
accent_foreground: '
|
|
107
|
+
const LANDING_DARK: SvedaAppearanceTokens = {
|
|
108
|
+
background: '30 12% 9%',
|
|
109
|
+
foreground: '40 24% 94%',
|
|
110
|
+
card: '30 10% 12%',
|
|
111
|
+
card_foreground: '40 24% 94%',
|
|
112
|
+
popover: '30 10% 12%',
|
|
113
|
+
popover_foreground: '40 24% 94%',
|
|
114
|
+
primary: '40 24% 94%',
|
|
115
|
+
primary_foreground: '30 12% 9%',
|
|
116
|
+
secondary: '30 8% 16%',
|
|
117
|
+
secondary_foreground: '40 24% 94%',
|
|
118
|
+
muted: '30 8% 16%',
|
|
119
|
+
muted_foreground: '36 10% 62%',
|
|
120
|
+
accent: '30 8% 16%',
|
|
121
|
+
accent_foreground: '40 24% 94%',
|
|
116
122
|
destructive: '0 62.8% 30.6%',
|
|
117
|
-
destructive_foreground: '
|
|
118
|
-
border: '
|
|
119
|
-
input: '
|
|
120
|
-
ring: '
|
|
121
|
-
brand: '
|
|
122
|
-
brand_foreground: '
|
|
123
|
+
destructive_foreground: '40 24% 94%',
|
|
124
|
+
border: '30 8% 22%',
|
|
125
|
+
input: '30 8% 16%',
|
|
126
|
+
ring: '40 24% 94%',
|
|
127
|
+
brand: '40 24% 94%',
|
|
128
|
+
brand_foreground: '30 12% 9%',
|
|
123
129
|
};
|
|
124
130
|
|
|
131
|
+
const NEUTRAL_LIGHT: SvedaAppearanceTokens = { ...LANDING_LIGHT };
|
|
132
|
+
|
|
133
|
+
const NEUTRAL_DARK: SvedaAppearanceTokens = { ...LANDING_DARK };
|
|
134
|
+
|
|
125
135
|
export const SVEDA_APPEARANCE_PRESETS: Record<SvedaAppearancePresetId, Required<Pick<SvedaAppearance, 'preset' | 'radius'>> & {
|
|
126
136
|
tokens: SvedaAppearanceTokens;
|
|
127
137
|
dark_tokens: SvedaAppearanceTokens;
|
|
@@ -317,6 +327,24 @@ export const svedaLauncher = reactive<SvedaAppearanceLauncher>(sanitizeSvedaLaun
|
|
|
317
327
|
|
|
318
328
|
export const useSvedaLauncher = (): SvedaAppearanceLauncher => svedaLauncher;
|
|
319
329
|
|
|
330
|
+
const readChromeFlag = (value: unknown, fallback: boolean): boolean =>
|
|
331
|
+
typeof value === 'boolean' ? value : fallback;
|
|
332
|
+
|
|
333
|
+
export const sanitizeSvedaChrome = (
|
|
334
|
+
chrome: SvedaAppearance['chrome'] | Record<string, unknown> | null | undefined,
|
|
335
|
+
): SvedaAppearanceChrome => {
|
|
336
|
+
const record = chrome && typeof chrome === 'object' ? (chrome as Record<string, unknown>) : null;
|
|
337
|
+
|
|
338
|
+
return {
|
|
339
|
+
modelSelect: readChromeFlag(record?.modelSelect ?? record?.model_select, true),
|
|
340
|
+
thinking: readChromeFlag(record?.thinking, true),
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
export const svedaChrome = reactive<SvedaAppearanceChrome>(sanitizeSvedaChrome(null));
|
|
345
|
+
|
|
346
|
+
export const useSvedaChrome = (): SvedaAppearanceChrome => svedaChrome;
|
|
347
|
+
|
|
320
348
|
export const sanitizeSvedaRadius = (value: unknown): string | null => {
|
|
321
349
|
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
322
350
|
return `${Math.max(0, Math.min(64, Math.round(value)))}px`;
|
|
@@ -489,6 +517,7 @@ export const resolveSvedaAppearance = (appearance: SvedaAppearance | null | unde
|
|
|
489
517
|
|
|
490
518
|
const theme = sanitizeSvedaTheme(appearance.theme);
|
|
491
519
|
const launcher = sanitizeSvedaLauncher(appearance.launcher);
|
|
520
|
+
const chrome = sanitizeSvedaChrome(appearance.chrome);
|
|
492
521
|
|
|
493
522
|
if (appearance.preset === 'custom' || customTokens) {
|
|
494
523
|
return {
|
|
@@ -498,6 +527,7 @@ export const resolveSvedaAppearance = (appearance: SvedaAppearance | null | unde
|
|
|
498
527
|
tokens,
|
|
499
528
|
dark_tokens: darkTokens,
|
|
500
529
|
launcher,
|
|
530
|
+
chrome,
|
|
501
531
|
};
|
|
502
532
|
}
|
|
503
533
|
|
|
@@ -508,6 +538,7 @@ export const resolveSvedaAppearance = (appearance: SvedaAppearance | null | unde
|
|
|
508
538
|
tokens: named.tokens,
|
|
509
539
|
dark_tokens: named.dark_tokens,
|
|
510
540
|
launcher,
|
|
541
|
+
chrome,
|
|
511
542
|
};
|
|
512
543
|
};
|
|
513
544
|
|
|
@@ -547,12 +578,88 @@ export const buildAppearanceCss = (appearance: SvedaAppearance | null | undefine
|
|
|
547
578
|
return `.sveda-chat{${light}}.dark .sveda-chat,.sveda-chat.dark{${dark}}`;
|
|
548
579
|
};
|
|
549
580
|
|
|
581
|
+
const isPlainAppearance = (value: unknown): value is SvedaAppearance =>
|
|
582
|
+
Boolean(value) && typeof value === 'object' && !Array.isArray(value);
|
|
583
|
+
|
|
584
|
+
export const isSvedaAppearanceProvided = (value: unknown): value is SvedaAppearance =>
|
|
585
|
+
isPlainAppearance(value) && Object.keys(value).length > 0;
|
|
586
|
+
|
|
587
|
+
const overlayRecord = <T extends Record<string, unknown>>(
|
|
588
|
+
admin: T | null | undefined,
|
|
589
|
+
host: T | null | undefined,
|
|
590
|
+
): T | undefined => {
|
|
591
|
+
if (!host && !admin) {
|
|
592
|
+
return undefined;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
return { ...(admin ?? {}), ...(host ?? {}) } as T;
|
|
596
|
+
};
|
|
597
|
+
|
|
598
|
+
export const mergeSvedaAppearance = (
|
|
599
|
+
admin: SvedaAppearance | null | undefined,
|
|
600
|
+
host: SvedaAppearance | null | undefined,
|
|
601
|
+
): SvedaAppearance | null => {
|
|
602
|
+
const adminProvided = isSvedaAppearanceProvided(admin);
|
|
603
|
+
const hostProvided = isSvedaAppearanceProvided(host);
|
|
604
|
+
if (!adminProvided && !hostProvided) {
|
|
605
|
+
return null;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
if (!hostProvided) {
|
|
609
|
+
return { ...(admin as SvedaAppearance) };
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
if (!adminProvided) {
|
|
613
|
+
return { ...(host as SvedaAppearance) };
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
const base = admin as SvedaAppearance;
|
|
617
|
+
const overlay = host as SvedaAppearance;
|
|
618
|
+
const merged: SvedaAppearance = { ...base, ...overlay };
|
|
619
|
+
const launcher = overlayRecord(base.launcher as Record<string, unknown> | undefined, overlay.launcher as Record<string, unknown> | undefined);
|
|
620
|
+
const chrome = overlayRecord(base.chrome as Record<string, unknown> | undefined, overlay.chrome as Record<string, unknown> | undefined);
|
|
621
|
+
|
|
622
|
+
if (launcher) {
|
|
623
|
+
merged.launcher = launcher;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
if (chrome) {
|
|
627
|
+
merged.chrome = chrome;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
const hostSetsPreset = Object.prototype.hasOwnProperty.call(overlay, 'preset');
|
|
631
|
+
const hostSetsTokens = Object.prototype.hasOwnProperty.call(overlay, 'tokens');
|
|
632
|
+
const hostSetsDarkTokens = Object.prototype.hasOwnProperty.call(overlay, 'dark_tokens');
|
|
633
|
+
|
|
634
|
+
if (hostSetsPreset && !hostSetsTokens) {
|
|
635
|
+
delete merged.tokens;
|
|
636
|
+
} else if (base.tokens || overlay.tokens) {
|
|
637
|
+
merged.tokens = overlayRecord(base.tokens as Record<string, unknown> | undefined, overlay.tokens as Record<string, unknown> | undefined);
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
if (hostSetsPreset && !hostSetsDarkTokens) {
|
|
641
|
+
delete merged.dark_tokens;
|
|
642
|
+
} else if (base.dark_tokens || overlay.dark_tokens) {
|
|
643
|
+
merged.dark_tokens = overlayRecord(
|
|
644
|
+
base.dark_tokens as Record<string, unknown> | undefined,
|
|
645
|
+
overlay.dark_tokens as Record<string, unknown> | undefined,
|
|
646
|
+
);
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
return merged;
|
|
650
|
+
};
|
|
651
|
+
|
|
550
652
|
export const applySvedaAppearance = (appearance: SvedaAppearance | null | undefined): void => {
|
|
551
|
-
const
|
|
653
|
+
const resolved = resolveSvedaAppearance(appearance);
|
|
654
|
+
const launcher = sanitizeSvedaLauncher(resolved?.launcher);
|
|
552
655
|
svedaLauncher.label = launcher.label;
|
|
553
656
|
svedaLauncher.icon = launcher.icon;
|
|
554
657
|
svedaLauncher.image = launcher.image;
|
|
555
658
|
|
|
659
|
+
const chrome = sanitizeSvedaChrome(resolved?.chrome);
|
|
660
|
+
svedaChrome.modelSelect = chrome.modelSelect;
|
|
661
|
+
svedaChrome.thinking = chrome.thinking;
|
|
662
|
+
|
|
556
663
|
if (typeof document === 'undefined') {
|
|
557
664
|
return;
|
|
558
665
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { Button } from '../../ui/button/index.js';
|
|
3
|
-
import { Input } from '../../ui/input/index.js';
|
|
4
3
|
import { ScrollArea } from '../../ui/scroll-area/index.js';
|
|
5
4
|
import { useSvedaT } from '../../i18n/index.js';
|
|
6
5
|
import { Search, SquarePen, Trash2, X } from 'lucide-vue-next';
|
|
@@ -158,12 +157,14 @@
|
|
|
158
157
|
<X class="h-4 w-4" />
|
|
159
158
|
</Button>
|
|
160
159
|
</div>
|
|
161
|
-
<div class="
|
|
162
|
-
<Search class="
|
|
163
|
-
<
|
|
160
|
+
<div class="flex h-10 items-center gap-2 rounded-[var(--sveda-radius)] border border-input-border bg-input px-3">
|
|
161
|
+
<Search class="h-4 w-4 shrink-0 text-muted-foreground" aria-hidden="true" />
|
|
162
|
+
<input
|
|
164
163
|
v-model="searchQuery"
|
|
164
|
+
type="text"
|
|
165
|
+
autocomplete="off"
|
|
165
166
|
:placeholder="t('searchChats')"
|
|
166
|
-
class="
|
|
167
|
+
class="h-full min-w-0 flex-1 border-0 bg-transparent p-0 text-sm text-card-foreground outline-none placeholder:text-muted-foreground focus-visible:outline-none"
|
|
167
168
|
/>
|
|
168
169
|
</div>
|
|
169
170
|
</div>
|
|
@@ -332,11 +332,11 @@
|
|
|
332
332
|
const micStopButtonClass = 'h-8 w-8 rounded-[var(--sveda-radius)] text-destructive hover:bg-destructive/10 hover:text-destructive';
|
|
333
333
|
|
|
334
334
|
const sendButtonClass =
|
|
335
|
-
'h-8 w-8 rounded-
|
|
335
|
+
'h-8 w-8 rounded-none border border-dashed border-primary bg-primary text-primary-foreground hover:opacity-90 disabled:opacity-50';
|
|
336
336
|
|
|
337
|
-
const streamStopButtonClass = 'h-8 w-8 rounded-
|
|
337
|
+
const streamStopButtonClass = 'h-8 w-8 rounded-none border border-dashed border-destructive text-destructive hover:bg-destructive/10';
|
|
338
338
|
|
|
339
|
-
const controlToolbarClass = 'flex items-center justify-between px-2';
|
|
339
|
+
const controlToolbarClass = 'flex items-center justify-between border-t border-dashed border-foreground px-2 py-1';
|
|
340
340
|
|
|
341
341
|
const adjustTextareaHeight = () => {
|
|
342
342
|
nextTick(() => {
|
|
@@ -393,12 +393,12 @@
|
|
|
393
393
|
:class="
|
|
394
394
|
noBorder
|
|
395
395
|
? 'flex flex-shrink-0 flex-col bg-transparent p-4'
|
|
396
|
-
: '
|
|
396
|
+
: 'flex flex-shrink-0 flex-col bg-background p-3'
|
|
397
397
|
"
|
|
398
398
|
>
|
|
399
399
|
<div
|
|
400
400
|
v-if="hasStatusBanner"
|
|
401
|
-
class="mb-3 flex items-center gap-2
|
|
401
|
+
class="mb-3 flex items-center gap-2 border border-dashed border-foreground bg-muted px-3 py-2 font-mono text-[11px] tracking-[0.08em] text-muted-foreground"
|
|
402
402
|
>
|
|
403
403
|
<Loader2 class="h-4 w-4 shrink-0 animate-spin" />
|
|
404
404
|
<span class="leading-snug">{{ statusBanner }}</span>
|
|
@@ -412,8 +412,8 @@
|
|
|
412
412
|
@change="onFileInputChange"
|
|
413
413
|
/>
|
|
414
414
|
<div
|
|
415
|
-
class="
|
|
416
|
-
:class="isDragActive && !attachmentToolbarDisabled ? '
|
|
415
|
+
class="sveda-chat-frame relative flex flex-col bg-background transition-colors"
|
|
416
|
+
:class="isDragActive && !attachmentToolbarDisabled ? 'bg-muted' : ''"
|
|
417
417
|
@dragenter="onDragEnter"
|
|
418
418
|
@dragleave="onDragLeave"
|
|
419
419
|
@dragover="onDragOver"
|
|
@@ -450,7 +450,7 @@
|
|
|
450
450
|
:placeholder="t('typeMessage')"
|
|
451
451
|
:disabled="isLoading"
|
|
452
452
|
:readonly="isListening"
|
|
453
|
-
class="sveda-chat-input-textarea max-h-[250px] min-h-[60px] w-full resize-none border-0 bg-transparent p-3 shadow-none !outline-none !ring-0 focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0"
|
|
453
|
+
class="sveda-chat-input-textarea max-h-[250px] min-h-[60px] w-full resize-none border-0 bg-transparent p-3 font-sans text-sm text-foreground shadow-none !outline-none !ring-0 placeholder:font-mono placeholder:text-[11px] placeholder:tracking-[0.08em] placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0"
|
|
454
454
|
style="height: 60px; outline: none; box-shadow: none"
|
|
455
455
|
/>
|
|
456
456
|
|
|
@@ -211,20 +211,20 @@
|
|
|
211
211
|
></div>
|
|
212
212
|
<div
|
|
213
213
|
v-else-if="message.role === 'user'"
|
|
214
|
-
class="max-w-[80%]
|
|
214
|
+
class="max-w-[80%] border border-primary bg-primary p-3 text-primary-foreground"
|
|
215
215
|
>
|
|
216
216
|
<div
|
|
217
217
|
v-if="userAttachmentNames.length"
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
218
|
+
class="mb-2 flex flex-col gap-1.5 border-b border-primary-foreground/20 pb-2"
|
|
219
|
+
>
|
|
220
|
+
<p class="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-primary-foreground/80">
|
|
221
221
|
{{ t('attachmentsLabel') }}
|
|
222
222
|
</p>
|
|
223
223
|
<div class="flex flex-wrap gap-1.5">
|
|
224
224
|
<span
|
|
225
225
|
v-for="(name, i) in userAttachmentNames"
|
|
226
226
|
:key="`${name}-${i}`"
|
|
227
|
-
class="inline-flex max-w-full items-center gap-1
|
|
227
|
+
class="inline-flex max-w-full items-center gap-1 border border-primary-foreground/20 bg-primary-foreground/10 px-2 py-1 text-xs [overflow-wrap:anywhere]"
|
|
228
228
|
>
|
|
229
229
|
<Paperclip class="h-3 w-3 shrink-0 opacity-90" />
|
|
230
230
|
<span>{{ name }}</span>
|
|
@@ -245,7 +245,7 @@
|
|
|
245
245
|
<div
|
|
246
246
|
v-if="workflowSegments.length > 0"
|
|
247
247
|
ref="workflowPanelRef"
|
|
248
|
-
class="assistant-workflow-panel max-h-[25dvh] touch-pan-y overflow-y-auto overflow-x-hidden
|
|
248
|
+
class="assistant-workflow-panel max-h-[25dvh] touch-pan-y overflow-y-auto overflow-x-hidden border border-border bg-muted/40 p-2"
|
|
249
249
|
:class="{ 'assistant-workflow-panel--locked': shouldFollowWorkflowStream }"
|
|
250
250
|
@wheel="blockWorkflowPanelUserScroll"
|
|
251
251
|
@touchmove="blockWorkflowPanelUserScroll"
|
|
@@ -292,7 +292,7 @@
|
|
|
292
292
|
>
|
|
293
293
|
<div :class="message.isError ? 'text-destructive' : ''">
|
|
294
294
|
<div
|
|
295
|
-
class="prose prose-sm dark:prose-invert max-w-none break-words text-sm text-foreground [overflow-wrap:anywhere] [&_code]:
|
|
295
|
+
class="prose prose-sm dark:prose-invert max-w-none break-words text-sm text-foreground [overflow-wrap:anywhere] [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_pre]:overflow-x-auto [&_pre]:border [&_pre]:border-border [&_pre]:bg-muted [&_pre]:p-2 [&_pre]:font-mono [&_pre]:text-xs"
|
|
296
296
|
@click="handleContentClick"
|
|
297
297
|
>
|
|
298
298
|
<div
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
class="flex justify-start"
|
|
109
109
|
data-testid="chat-pending-indicator"
|
|
110
110
|
>
|
|
111
|
-
<div class="max-w-[85%] rounded-
|
|
111
|
+
<div class="max-w-[85%] rounded-[var(--sveda-radius)] border border-border bg-muted px-4 py-3">
|
|
112
112
|
<div class="flex items-center gap-3">
|
|
113
113
|
<div
|
|
114
114
|
class="flex shrink-0 items-center space-x-1"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import SvedaAgentCompletedNotice from './SvedaAgentCompletedNotice.vue';
|
|
3
3
|
import SvedaAgentTasksPanel from './SvedaAgentTasksPanel.vue';
|
|
4
|
+
import SvedaFrameTicks from './SvedaFrameTicks.vue';
|
|
4
5
|
import SvedaHistorySheet from './SvedaHistorySheet.vue';
|
|
5
6
|
import SvedaHistorySidebar from './SvedaHistorySidebar.vue';
|
|
6
7
|
import SvedaInputSection from './SvedaInputSection.vue';
|
|
@@ -287,12 +288,13 @@
|
|
|
287
288
|
/>
|
|
288
289
|
<Card
|
|
289
290
|
ref="chatCardRef"
|
|
290
|
-
class="sveda-chat-surface relative flex min-h-0 flex-col overflow-
|
|
291
|
+
class="sveda-chat-surface relative flex min-h-0 flex-col overflow-visible"
|
|
291
292
|
:class="{
|
|
292
293
|
resizing: chat.isResizing || chat.isEnteringImmersiveFromDrag,
|
|
293
|
-
'
|
|
294
|
-
'
|
|
295
|
-
'h-full min-w-0 flex-1 rounded-none
|
|
294
|
+
'sveda-chat-frame': chat.viewMode === 'floating' && !chat.isMobile && !chat.fillHost,
|
|
295
|
+
'border-0': chat.fillHost || chat.isMobile,
|
|
296
|
+
'h-full min-w-0 flex-1 rounded-none': chat.isMobile,
|
|
297
|
+
'h-full min-w-0 flex-1 rounded-none border-b-0 border-l border-r-0 border-t-0 border-border': chat.viewMode === 'fixed' && !chat.isMobile,
|
|
296
298
|
'rounded-[var(--sveda-radius)]': chat.viewMode === 'floating',
|
|
297
299
|
'rounded-none': chat.isMobile || chat.viewMode === 'fixed',
|
|
298
300
|
'transition-[width] duration-300 ease-out': chat.isEnteringImmersiveFromDrag && chat.viewMode === 'fixed' && !chat.isMobile,
|
|
@@ -301,11 +303,6 @@
|
|
|
301
303
|
}"
|
|
302
304
|
:style="chat.chatCardStyle"
|
|
303
305
|
>
|
|
304
|
-
<SvedaResizeHandles
|
|
305
|
-
:is-mobile="chat.isMobile"
|
|
306
|
-
:view-mode="chat.viewMode"
|
|
307
|
-
@start-resize="chat.startResize"
|
|
308
|
-
/>
|
|
309
306
|
<SvedaToolbar
|
|
310
307
|
:is-mobile="chat.isMobile"
|
|
311
308
|
:view-mode="chat.viewMode"
|
|
@@ -395,6 +392,12 @@
|
|
|
395
392
|
</div>
|
|
396
393
|
</CardContent>
|
|
397
394
|
</Card>
|
|
395
|
+
<SvedaFrameTicks v-if="!chat.isMobile && chat.viewMode === 'floating'" />
|
|
396
|
+
<SvedaResizeHandles
|
|
397
|
+
:is-mobile="chat.isMobile"
|
|
398
|
+
:view-mode="chat.viewMode"
|
|
399
|
+
@start-resize="chat.startResize"
|
|
400
|
+
/>
|
|
398
401
|
</div>
|
|
399
402
|
</div>
|
|
400
403
|
</Transition>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span
|
|
3
|
+
class="pointer-events-none absolute -left-px -top-px z-10 h-2.5 w-2.5 border-l border-t border-foreground"
|
|
4
|
+
aria-hidden="true"
|
|
5
|
+
/>
|
|
6
|
+
<span
|
|
7
|
+
class="pointer-events-none absolute -right-px -top-px z-10 h-2.5 w-2.5 border-r border-t border-foreground"
|
|
8
|
+
aria-hidden="true"
|
|
9
|
+
/>
|
|
10
|
+
<span
|
|
11
|
+
class="pointer-events-none absolute -bottom-px -left-px z-10 h-2.5 w-2.5 border-b border-l border-foreground"
|
|
12
|
+
aria-hidden="true"
|
|
13
|
+
/>
|
|
14
|
+
<span
|
|
15
|
+
class="pointer-events-none absolute -bottom-px -right-px z-10 h-2.5 w-2.5 border-b border-r border-foreground"
|
|
16
|
+
aria-hidden="true"
|
|
17
|
+
/>
|
|
18
|
+
</template>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
const Icon = computed(() => svedaLauncherIconComponent(props.icon));
|
|
16
16
|
|
|
17
17
|
const triggerClass =
|
|
18
|
-
'flex h-
|
|
18
|
+
'inline-flex h-auto min-w-0 items-center justify-center gap-2 rounded-none border border-primary bg-primary px-3.5 py-2 font-mono text-[11px] tracking-[0.14em] text-primary-foreground shadow-none transition-opacity hover:opacity-90 [&_svg]:!h-3.5 [&_svg]:!w-3.5';
|
|
19
19
|
</script>
|
|
20
20
|
|
|
21
21
|
<template>
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
/>
|
|
38
38
|
<span
|
|
39
39
|
v-if="label"
|
|
40
|
-
class="font-
|
|
40
|
+
class="font-mono text-[11px] font-normal tracking-[0.14em]"
|
|
41
41
|
>{{ label }}</span>
|
|
42
42
|
</Button>
|
|
43
43
|
</template>
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../../ui/tooltip';
|
|
5
5
|
import { Brain } from 'lucide-vue-next';
|
|
6
6
|
import { computed } from 'vue';
|
|
7
|
+
import { useSvedaChrome } from '../../appearance';
|
|
7
8
|
|
|
8
9
|
const chatModel = defineModel({ type: String, required: true });
|
|
9
10
|
const thinkingEnabled = defineModel('thinkingEnabled', { type: Boolean, default: true });
|
|
@@ -14,22 +15,31 @@
|
|
|
14
15
|
models: { type: Array, default: () => [] },
|
|
15
16
|
});
|
|
16
17
|
|
|
18
|
+
const chrome = useSvedaChrome();
|
|
19
|
+
|
|
17
20
|
const selectedSupportsThinking = computed(
|
|
18
21
|
() => props.models.some(option => option.id === chatModel.value && option.supportsThinking)
|
|
19
22
|
);
|
|
23
|
+
|
|
24
|
+
const showModelSelect = computed(() => chrome.modelSelect && props.models.length > 0);
|
|
25
|
+
const showThinking = computed(() => chrome.thinking && selectedSupportsThinking.value);
|
|
20
26
|
</script>
|
|
21
27
|
|
|
22
28
|
<template>
|
|
23
|
-
<div
|
|
29
|
+
<div
|
|
30
|
+
v-if="showModelSelect || showThinking"
|
|
31
|
+
class="flex items-center gap-1"
|
|
32
|
+
>
|
|
24
33
|
<SvedaModelSelect
|
|
34
|
+
v-if="showModelSelect"
|
|
25
35
|
v-model="chatModel"
|
|
26
36
|
:placeholder="placeholder"
|
|
27
37
|
:models="models"
|
|
28
38
|
/>
|
|
29
|
-
<TooltipProvider v-if="
|
|
39
|
+
<TooltipProvider v-if="showThinking">
|
|
30
40
|
<Tooltip>
|
|
31
41
|
<TooltipTrigger as-child>
|
|
32
|
-
<div class="flex cursor-default items-center gap-1
|
|
42
|
+
<div class="flex cursor-default items-center gap-1 px-0.5 py-0.5 text-muted-foreground hover:text-foreground">
|
|
33
43
|
<Brain class="h-3.5 w-3.5 shrink-0" />
|
|
34
44
|
<Switch
|
|
35
45
|
v-model="thinkingEnabled"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<template>
|
|
13
13
|
<Select v-model="model">
|
|
14
14
|
<SelectTrigger
|
|
15
|
-
class="h-7 w-fit
|
|
15
|
+
class="h-7 w-fit max-w-[11rem] min-w-0 border-none bg-transparent px-1.5 font-mono text-[11px] font-normal tracking-[0.08em] text-muted-foreground shadow-none hover:text-foreground focus:ring-0 focus:ring-offset-0 [&>span]:block [&>span]:max-w-[9.5rem] [&>span]:truncate [&>span]:font-mono [&>span]:text-[11px] [&>span]:tracking-[0.08em] [&_svg]:h-3 [&_svg]:w-3"
|
|
16
16
|
>
|
|
17
17
|
<SelectValue :placeholder="placeholder" />
|
|
18
18
|
</SelectTrigger>
|
|
@@ -10,22 +10,22 @@
|
|
|
10
10
|
<template>
|
|
11
11
|
<div
|
|
12
12
|
v-if="!isMobile && viewMode === 'fixed'"
|
|
13
|
-
class="absolute bottom-3 left-0 top-3 z-10 w-1 cursor-ew-resize hover:bg-primary/30"
|
|
14
|
-
@
|
|
13
|
+
class="absolute bottom-3 left-0 top-3 z-10 w-1 touch-none cursor-ew-resize hover:bg-primary/30"
|
|
14
|
+
@pointerdown="$emit('start-resize', 'fixed-left', $event)"
|
|
15
15
|
></div>
|
|
16
16
|
<div
|
|
17
17
|
v-if="!isMobile && viewMode === 'floating'"
|
|
18
|
-
class="absolute left-0 top-0 z-10 h-3 w-3 cursor-nw-resize rounded-br hover:bg-primary/20"
|
|
19
|
-
@
|
|
18
|
+
class="absolute left-0 top-0 z-10 h-3 w-3 touch-none cursor-nw-resize rounded-br hover:bg-primary/20"
|
|
19
|
+
@pointerdown="$emit('start-resize', 'top-left', $event)"
|
|
20
20
|
></div>
|
|
21
21
|
<div
|
|
22
22
|
v-if="!isMobile && viewMode === 'floating'"
|
|
23
|
-
class="absolute left-3 right-3 top-0 z-10 h-1 cursor-n-resize hover:bg-primary/30"
|
|
24
|
-
@
|
|
23
|
+
class="absolute left-3 right-3 top-0 z-10 h-1 touch-none cursor-n-resize hover:bg-primary/30"
|
|
24
|
+
@pointerdown="$emit('start-resize', 'top', $event)"
|
|
25
25
|
></div>
|
|
26
26
|
<div
|
|
27
27
|
v-if="!isMobile && viewMode === 'floating'"
|
|
28
|
-
class="absolute bottom-3 left-0 top-3 z-10 w-1 cursor-w-resize hover:bg-primary/30"
|
|
29
|
-
@
|
|
28
|
+
class="absolute bottom-3 left-0 top-3 z-10 w-1 touch-none cursor-w-resize hover:bg-primary/30"
|
|
29
|
+
@pointerdown="$emit('start-resize', 'left', $event)"
|
|
30
30
|
></div>
|
|
31
31
|
</template>
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
|
|
52
52
|
const tabTriggerClass = chatId =>
|
|
53
53
|
[
|
|
54
|
-
'inline-flex h-10 max-w-56 shrink-0 items-center gap-1.5 whitespace-nowrap border-b
|
|
54
|
+
'inline-flex h-10 max-w-56 shrink-0 items-center gap-1.5 whitespace-nowrap border-b border-transparent px-3 py-2 font-mono text-[11px] tracking-[0.12em] text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none',
|
|
55
55
|
props.currentChatId === chatId
|
|
56
|
-
? 'border-
|
|
56
|
+
? 'border-foreground bg-transparent text-foreground'
|
|
57
57
|
: '',
|
|
58
58
|
].join(' ');
|
|
59
59
|
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
<template>
|
|
67
67
|
<div
|
|
68
68
|
v-if="visibleTabs.length > 0"
|
|
69
|
-
class="flex shrink-0 items-stretch border-b border-border
|
|
69
|
+
class="flex shrink-0 items-stretch border-b border-border bg-card"
|
|
70
70
|
:class="compact ? 'px-3' : 'px-4 md:px-6'"
|
|
71
71
|
>
|
|
72
72
|
<ScrollArea class="min-w-0 flex-1">
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
|
|
35
35
|
const headerClass = computed(() => {
|
|
36
36
|
const base =
|
|
37
|
-
'flex h-
|
|
37
|
+
'flex h-12 shrink-0 flex-row items-center justify-between border-b border-border bg-card px-3';
|
|
38
38
|
if (props.viewMode === 'immersive') {
|
|
39
39
|
return `${base} rounded-none`;
|
|
40
40
|
}
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
<p>{{ t('chatHistory') }}</p>
|
|
69
69
|
</TooltipContent>
|
|
70
70
|
</Tooltip>
|
|
71
|
-
<h2 class="min-w-0 flex-1 truncate text-left text-
|
|
71
|
+
<h2 class="min-w-0 flex-1 truncate text-left font-mono text-[11px] font-normal uppercase tracking-[0.14em] text-foreground">
|
|
72
72
|
{{ title }}
|
|
73
73
|
</h2>
|
|
74
74
|
</div>
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
</span>
|
|
94
94
|
</div>
|
|
95
95
|
</div>
|
|
96
|
-
<h2 class="min-w-0 flex-1 truncate text-left text-
|
|
96
|
+
<h2 class="min-w-0 flex-1 truncate text-left font-mono text-[11px] font-normal uppercase tracking-[0.14em] text-foreground">
|
|
97
97
|
{{ title }}
|
|
98
98
|
</h2>
|
|
99
99
|
</div>
|