@r2digisolutions/components 0.21.22 → 0.21.24
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.
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
LoaderCircle,
|
|
13
13
|
RotateCcw,
|
|
14
14
|
Copy,
|
|
15
|
-
Check
|
|
15
|
+
Check,
|
|
16
|
+
ChevronLeft
|
|
16
17
|
} from '@lucide/svelte';
|
|
17
18
|
|
|
18
19
|
export interface AssistantMessage {
|
|
@@ -52,12 +53,16 @@
|
|
|
52
53
|
voiceOffLabel?: string;
|
|
53
54
|
copyChatLabel?: string;
|
|
54
55
|
copiedChatLabel?: string;
|
|
56
|
+
/** Optional back control (e.g. return to conversation list). */
|
|
57
|
+
backLabel?: string;
|
|
58
|
+
subtitle?: string;
|
|
55
59
|
class?: string;
|
|
56
60
|
result?: Snippet<[AssistantMessage]>;
|
|
57
61
|
footerExtra?: Snippet;
|
|
58
62
|
onsend?: () => void;
|
|
59
63
|
onclose?: () => void;
|
|
60
64
|
onnewchat?: () => void;
|
|
65
|
+
onback?: () => void;
|
|
61
66
|
oncopychat?: () => void | Promise<void>;
|
|
62
67
|
onmicclick?: () => void;
|
|
63
68
|
onvoiceoutputchange?: (on: boolean) => void;
|
|
@@ -92,12 +97,15 @@
|
|
|
92
97
|
voiceOffLabel = 'Voz desactivada',
|
|
93
98
|
copyChatLabel = 'Copiar chat',
|
|
94
99
|
copiedChatLabel = 'Copiado',
|
|
100
|
+
backLabel = 'Volver',
|
|
101
|
+
subtitle = '',
|
|
95
102
|
class: className = '',
|
|
96
103
|
result,
|
|
97
104
|
footerExtra,
|
|
98
105
|
onsend,
|
|
99
106
|
onclose,
|
|
100
107
|
onnewchat,
|
|
108
|
+
onback,
|
|
101
109
|
oncopychat,
|
|
102
110
|
onmicclick,
|
|
103
111
|
onvoiceoutputchange,
|
|
@@ -201,16 +209,24 @@
|
|
|
201
209
|
>
|
|
202
210
|
<!-- Header -->
|
|
203
211
|
<header class="gap-2 border-border px-3 py-2.5 flex shrink-0 items-center border-b">
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
212
|
+
{#if onback}
|
|
213
|
+
<IconButton variant="ghost" size="xs" label={backLabel} onclick={() => onback()}>
|
|
214
|
+
<ChevronLeft size={16} strokeWidth={2} />
|
|
215
|
+
</IconButton>
|
|
216
|
+
{:else}
|
|
217
|
+
<span
|
|
218
|
+
class="h-7 w-7 rounded-lg bg-brand-100 text-brand-600 dark:bg-brand-900/40 dark:text-brand-400 flex shrink-0 items-center justify-center"
|
|
219
|
+
aria-hidden="true"
|
|
220
|
+
>
|
|
221
|
+
<Sparkles size={15} strokeWidth={2} />
|
|
222
|
+
</span>
|
|
223
|
+
{/if}
|
|
210
224
|
<div class="min-w-0 flex-1">
|
|
211
225
|
<p class="text-sm font-semibold text-primary truncate">{title}</p>
|
|
212
226
|
{#if statusLabel}
|
|
213
227
|
<p class="text-xs text-muted truncate">{statusLabel}</p>
|
|
228
|
+
{:else if subtitle}
|
|
229
|
+
<p class="text-xs text-muted truncate">{subtitle}</p>
|
|
214
230
|
{/if}
|
|
215
231
|
</div>
|
|
216
232
|
<IconButton
|
|
@@ -35,12 +35,16 @@ interface AssistantChatProps {
|
|
|
35
35
|
voiceOffLabel?: string;
|
|
36
36
|
copyChatLabel?: string;
|
|
37
37
|
copiedChatLabel?: string;
|
|
38
|
+
/** Optional back control (e.g. return to conversation list). */
|
|
39
|
+
backLabel?: string;
|
|
40
|
+
subtitle?: string;
|
|
38
41
|
class?: string;
|
|
39
42
|
result?: Snippet<[AssistantMessage]>;
|
|
40
43
|
footerExtra?: Snippet;
|
|
41
44
|
onsend?: () => void;
|
|
42
45
|
onclose?: () => void;
|
|
43
46
|
onnewchat?: () => void;
|
|
47
|
+
onback?: () => void;
|
|
44
48
|
oncopychat?: () => void | Promise<void>;
|
|
45
49
|
onmicclick?: () => void;
|
|
46
50
|
onvoiceoutputchange?: (on: boolean) => void;
|
|
@@ -108,18 +108,24 @@
|
|
|
108
108
|
{:else if children}
|
|
109
109
|
{@render children()}
|
|
110
110
|
{:else if hasBody}
|
|
111
|
-
|
|
111
|
+
{#if secondary}
|
|
112
|
+
<div class="grid gap-4 lg:grid-cols-[minmax(0,1fr)_20rem] xl:grid-cols-[minmax(0,1fr)_22rem]">
|
|
113
|
+
<div class="min-w-0 space-y-4">
|
|
114
|
+
{#if primary}
|
|
115
|
+
{@render primary()}
|
|
116
|
+
{/if}
|
|
117
|
+
</div>
|
|
118
|
+
<aside class="min-w-0 space-y-4">
|
|
119
|
+
{@render secondary()}
|
|
120
|
+
</aside>
|
|
121
|
+
</div>
|
|
122
|
+
{:else}
|
|
112
123
|
<div class="min-w-0 space-y-4">
|
|
113
124
|
{#if primary}
|
|
114
125
|
{@render primary()}
|
|
115
126
|
{/if}
|
|
116
127
|
</div>
|
|
117
|
-
|
|
118
|
-
<aside class="min-w-0 space-y-4">
|
|
119
|
-
{@render secondary()}
|
|
120
|
-
</aside>
|
|
121
|
-
{/if}
|
|
122
|
-
</div>
|
|
128
|
+
{/if}
|
|
123
129
|
{#if footer}
|
|
124
130
|
<div class="space-y-4">
|
|
125
131
|
{@render footer()}
|