Spaces:
Runtime error
Runtime error
Thomas G. Lopes
commited on
Commit
·
72dbde7
1
Parent(s):
92d7705
drag n drop
Browse files
src/lib/components/inference-playground/message-textarea.svelte
CHANGED
|
@@ -11,6 +11,8 @@
|
|
| 11 |
import IconMaximize from "~icons/carbon/maximize";
|
| 12 |
import Tooltip from "../tooltip.svelte";
|
| 13 |
import { previewImage } from "./img-preview.svelte";
|
|
|
|
|
|
|
| 14 |
|
| 15 |
const multiple = $derived(conversations.active.length > 1);
|
| 16 |
const loading = $derived(conversations.generating);
|
|
@@ -72,7 +74,20 @@
|
|
| 72 |
<svelte:window onkeydown={onKeydown} />
|
| 73 |
|
| 74 |
<div class="relative mt-auto px-2 pt-1">
|
| 75 |
-
<label
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
<div class="flex w-full items-end">
|
| 77 |
<textarea
|
| 78 |
placeholder="Enter your message"
|
|
@@ -139,7 +154,7 @@
|
|
| 139 |
</button>
|
| 140 |
</div>
|
| 141 |
|
| 142 |
-
<div class="flex w-full items-center">
|
| 143 |
{#each fileUpload.selected as file}
|
| 144 |
<div class="group/img relative">
|
| 145 |
<button
|
|
|
|
| 11 |
import IconMaximize from "~icons/carbon/maximize";
|
| 12 |
import Tooltip from "../tooltip.svelte";
|
| 13 |
import { previewImage } from "./img-preview.svelte";
|
| 14 |
+
import { omit } from "$lib/utils/object.svelte";
|
| 15 |
+
import { fade } from "svelte/transition";
|
| 16 |
|
| 17 |
const multiple = $derived(conversations.active.length > 1);
|
| 18 |
const loading = $derived(conversations.generating);
|
|
|
|
| 74 |
<svelte:window onkeydown={onKeydown} />
|
| 75 |
|
| 76 |
<div class="relative mt-auto px-2 pt-1">
|
| 77 |
+
<label
|
| 78 |
+
class="relative block rounded-[32px] bg-gray-200 p-2 pl-6 outline-gray-400 focus-within:outline-2 dark:bg-gray-800"
|
| 79 |
+
{...omit(fileUpload.dropzone, "onclick")}
|
| 80 |
+
>
|
| 81 |
+
{#if fileUpload.isDragging}
|
| 82 |
+
<div
|
| 83 |
+
class="absolute inset-0 z-10 flex items-center justify-center gap-2 rounded-[32px] bg-gray-800/50 backdrop-blur-md"
|
| 84 |
+
transition:fade={{ duration: 100 }}
|
| 85 |
+
>
|
| 86 |
+
<IconImage />
|
| 87 |
+
<p>Drop the image here to upload</p>
|
| 88 |
+
</div>
|
| 89 |
+
{/if}
|
| 90 |
+
|
| 91 |
<div class="flex w-full items-end">
|
| 92 |
<textarea
|
| 93 |
placeholder="Enter your message"
|
|
|
|
| 154 |
</button>
|
| 155 |
</div>
|
| 156 |
|
| 157 |
+
<div class="flex w-full items-center gap-2">
|
| 158 |
{#each fileUpload.selected as file}
|
| 159 |
<div class="group/img relative">
|
| 160 |
<button
|