@r2digisolutions/components 0.17.3 → 0.17.5
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.
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
placeholder?: string;
|
|
29
29
|
emptyHint?: string;
|
|
30
30
|
suggestions?: string[];
|
|
31
|
+
/** Chips shown under the conversation (after the user has messages). */
|
|
32
|
+
followUpSuggestions?: string[];
|
|
31
33
|
messages?: AssistantMessage[];
|
|
32
34
|
draft?: string;
|
|
33
35
|
loading?: boolean;
|
|
@@ -66,6 +68,7 @@
|
|
|
66
68
|
placeholder = 'Escribe un mensaje…',
|
|
67
69
|
emptyHint = '¿En qué puedo ayudarte?',
|
|
68
70
|
suggestions = [],
|
|
71
|
+
followUpSuggestions = [],
|
|
69
72
|
messages = [],
|
|
70
73
|
draft = $bindable(''),
|
|
71
74
|
loading = false,
|
|
@@ -309,6 +312,20 @@
|
|
|
309
312
|
</div>
|
|
310
313
|
</div>
|
|
311
314
|
{/if}
|
|
315
|
+
|
|
316
|
+
{#if !loading && followUpSuggestions.length}
|
|
317
|
+
<div class="ml-8 gap-2 flex flex-wrap">
|
|
318
|
+
{#each followUpSuggestions as suggestion (suggestion)}
|
|
319
|
+
<button
|
|
320
|
+
type="button"
|
|
321
|
+
class="border-border bg-surface px-3 py-1.5 text-xs text-secondary hover:border-brand-400 hover:text-brand-600 dark:hover:text-brand-400 rounded-full border transition-colors"
|
|
322
|
+
onclick={() => handleSuggestion(suggestion)}
|
|
323
|
+
>
|
|
324
|
+
{suggestion}
|
|
325
|
+
</button>
|
|
326
|
+
{/each}
|
|
327
|
+
</div>
|
|
328
|
+
{/if}
|
|
312
329
|
</div>
|
|
313
330
|
{/if}
|
|
314
331
|
</div>
|
|
@@ -11,6 +11,8 @@ interface AssistantChatProps {
|
|
|
11
11
|
placeholder?: string;
|
|
12
12
|
emptyHint?: string;
|
|
13
13
|
suggestions?: string[];
|
|
14
|
+
/** Chips shown under the conversation (after the user has messages). */
|
|
15
|
+
followUpSuggestions?: string[];
|
|
14
16
|
messages?: AssistantMessage[];
|
|
15
17
|
draft?: string;
|
|
16
18
|
loading?: boolean;
|
|
@@ -198,14 +198,10 @@
|
|
|
198
198
|
function handleBackdropClick(event: MouseEvent) {
|
|
199
199
|
if (!dialogEl) return;
|
|
200
200
|
if (Date.now() < suppressBackdropUntil) return;
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
event.clientY >= rect.top &&
|
|
206
|
-
event.clientY <= rect.bottom;
|
|
207
|
-
|
|
208
|
-
if (clickedInDialog) return;
|
|
201
|
+
// Native <dialog>: only the dialog node itself is the backdrop target.
|
|
202
|
+
// Children (and Popover API listboxes that extend outside the panel) still
|
|
203
|
+
// bubble here — ignore those so Select/DatePicker don't close the modal.
|
|
204
|
+
if (event.target !== dialogEl) return;
|
|
209
205
|
if (!closeOnBackdrop || confirmLoading) return;
|
|
210
206
|
close('backdrop');
|
|
211
207
|
}
|