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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<script lang="ts">
|
| 2 |
+
import type { DraggableProps, DraggableEvents } from "./types";
|
| 3 |
+
import { Gradio } from "@gradio/utils";
|
| 4 |
+
import { StatusTracker } from "@gradio/statustracker";
|
| 5 |
+
import { onMount, tick } from "svelte";
|
| 6 |
+
|
| 7 |
+
const props = $props();
|
| 8 |
+
const gradio = new Gradio<DraggableEvents, DraggableProps>(props);
|
| 9 |
+
|
| 10 |
+
let container_el: HTMLDivElement;
|
| 11 |
+
let dragged_el: HTMLElement | null = null;
|
| 12 |
+
let dragged_index = -1;
|
| 13 |
+
let items: HTMLElement[] = [];
|
| 14 |
+
let current_drop_target: HTMLElement | null = null;
|
| 15 |
+
|
| 16 |
+
const drag_event_handlers = [
|
| 17 |
+
{ event: "dragstart", handler: handle_drag_start },
|
| 18 |
+
{ event: "dragend", handler: handle_drag_end }
|
| 19 |
+
] as const;
|
| 20 |
+
|
| 21 |
+
const drop_event_handlers = [
|
| 22 |
+
{ event: "dragover", handler: handle_drag_over },
|
| 23 |
+
{ event: "drop", handler: handle_drop },
|
| 24 |
+
{ event: "dragenter", handler: handle_drag_enter }
|
| 25 |
+
] as const;
|
| 26 |
+
|
| 27 |
+
function add_drag_listeners(element: HTMLElement): void {
|
| 28 |
+
drag_event_handlers.forEach(({ event, handler }) => {
|
| 29 |
+
element.addEventListener(event, handler);
|
| 30 |
+
});
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
function remove_drag_listeners(element: HTMLElement): void {
|
| 34 |
+
drag_event_handlers.forEach(({ event, handler }) => {
|
| 35 |
+
element.removeEventListener(event, handler);
|
| 36 |
+
});
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
function add_drop_listeners(element: HTMLElement): void {
|
| 40 |
+
drop_event_handlers.forEach(({ event, handler }) => {
|
| 41 |
+
element.addEventListener(event, handler);
|
| 42 |
+
});
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
function remove_drop_listeners(element: HTMLElement): void {
|
| 46 |
+
drop_event_handlers.forEach(({ event, handler }) => {
|
| 47 |
+
element.removeEventListener(event, handler);
|
| 48 |
+
});
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
function setup_draggable_item(element: HTMLElement, index: number): void {
|
| 52 |
+
element.classList.add("draggable-item");
|
| 53 |
+
element.setAttribute("data-index", index.toString());
|
| 54 |
+
element.style.position = "relative";
|
| 55 |
+
|
| 56 |
+
const handle = document.createElement("div");
|
| 57 |
+
handle.className = "drag-handle";
|
| 58 |
+
handle.setAttribute("draggable", "true");
|
| 59 |
+
handle.setAttribute("aria-grabbed", "false");
|
| 60 |
+
handle.setAttribute("data-index", index.toString());
|
| 61 |
+
handle.innerHTML = "⋮⋮";
|
| 62 |
+
|
| 63 |
+
element.appendChild(handle);
|
| 64 |
+
add_drag_listeners(handle);
|
| 65 |
+
add_drop_listeners(element);
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
function setup_drag_and_drop(): void {
|
| 69 |
+
if (!container_el) return;
|
| 70 |
+
|
| 71 |
+
items.forEach((item) => {
|
| 72 |
+
const handle = item.querySelector(".drag-handle");
|
| 73 |
+
if (handle) {
|
| 74 |
+
remove_drag_listeners(handle as HTMLElement);
|
| 75 |
+
handle.remove();
|
| 76 |
+
}
|
| 77 |
+
remove_drop_listeners(item);
|
| 78 |
+
});
|
| 79 |
+
items = [];
|
| 80 |
+
|
| 81 |
+
const children = Array.from(container_el.children) as HTMLElement[];
|
| 82 |
+
let item_index = 0;
|
| 83 |
+
|
| 84 |
+
children.forEach((child) => {
|
| 85 |
+
if (child.classList.contains("status-tracker")) return;
|
| 86 |
+
|
| 87 |
+
if (child.classList.contains("form") && child.children.length > 0) {
|
| 88 |
+
const form_children = Array.from(child.children) as HTMLElement[];
|
| 89 |
+
form_children.forEach((form_child) => {
|
| 90 |
+
items.push(form_child);
|
| 91 |
+
setup_draggable_item(form_child, item_index);
|
| 92 |
+
item_index++;
|
| 93 |
+
});
|
| 94 |
+
} else {
|
| 95 |
+
items.push(child);
|
| 96 |
+
setup_draggable_item(child, item_index);
|
| 97 |
+
item_index++;
|
| 98 |
+
}
|
| 99 |
+
});
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
function handle_drag_start(e: DragEvent): void {
|
| 103 |
+
e.stopPropagation?.();
|
| 104 |
+
|
| 105 |
+
const handle = e.currentTarget as HTMLElement;
|
| 106 |
+
const element = handle.parentElement as HTMLElement;
|
| 107 |
+
dragged_el = element;
|
| 108 |
+
dragged_index = parseInt(handle.dataset.index || "-1");
|
| 109 |
+
|
| 110 |
+
handle.setAttribute("aria-grabbed", "true");
|
| 111 |
+
element.classList.add("dragging");
|
| 112 |
+
|
| 113 |
+
if (e.dataTransfer) {
|
| 114 |
+
e.dataTransfer.effectAllowed = "move";
|
| 115 |
+
e.dataTransfer.setData("text/html", element.outerHTML);
|
| 116 |
+
e.dataTransfer.setDragImage(element, 10, 10);
|
| 117 |
+
}
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
function handle_drag_end(e: DragEvent): void {
|
| 121 |
+
e.stopPropagation?.();
|
| 122 |
+
|
| 123 |
+
const handle = e.currentTarget as HTMLElement;
|
| 124 |
+
const element = handle.parentElement as HTMLElement;
|
| 125 |
+
element.classList.remove("dragging");
|
| 126 |
+
handle.setAttribute("aria-grabbed", "false");
|
| 127 |
+
|
| 128 |
+
if (current_drop_target) {
|
| 129 |
+
current_drop_target.classList.remove("drop-target");
|
| 130 |
+
current_drop_target = null;
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
dragged_el = null;
|
| 134 |
+
dragged_index = -1;
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
function handle_drag_over(e: DragEvent): boolean {
|
| 138 |
+
e.preventDefault();
|
| 139 |
+
e.dataTransfer && (e.dataTransfer.dropEffect = "move");
|
| 140 |
+
return false;
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
function handle_drag_enter(e: DragEvent): void {
|
| 144 |
+
e.stopPropagation?.();
|
| 145 |
+
|
| 146 |
+
const target = e.currentTarget as HTMLElement;
|
| 147 |
+
if (target === dragged_el) return;
|
| 148 |
+
|
| 149 |
+
if (!dragged_el || !container_el) return;
|
| 150 |
+
|
| 151 |
+
const dragged_parent = dragged_el.parentElement;
|
| 152 |
+
const target_parent = target.parentElement;
|
| 153 |
+
|
| 154 |
+
const is_dragged_in_form =
|
| 155 |
+
dragged_parent?.classList.contains("form") &&
|
| 156 |
+
dragged_parent.parentElement === container_el;
|
| 157 |
+
const is_target_in_form =
|
| 158 |
+
target_parent?.classList.contains("form") &&
|
| 159 |
+
target_parent.parentElement === container_el;
|
| 160 |
+
const is_dragged_direct = dragged_parent === container_el;
|
| 161 |
+
const is_target_direct = target_parent === container_el;
|
| 162 |
+
|
| 163 |
+
if (
|
| 164 |
+
!(
|
| 165 |
+
(is_dragged_in_form || is_dragged_direct) &&
|
| 166 |
+
(is_target_in_form || is_target_direct)
|
| 167 |
+
)
|
| 168 |
+
) {
|
| 169 |
+
return;
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
if (current_drop_target && current_drop_target !== target) {
|
| 173 |
+
current_drop_target.classList.remove("drop-target");
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
target.classList.add("drop-target");
|
| 177 |
+
current_drop_target = target;
|
| 178 |
+
}
|
| 179 |
+
|
| 180 |
+
async function handle_drop(e: DragEvent): Promise<boolean> {
|
| 181 |
+
e.stopPropagation?.();
|
| 182 |
+
|
| 183 |
+
const target = e.currentTarget as HTMLElement;
|
| 184 |
+
target.classList.remove("drop-target");
|
| 185 |
+
|
| 186 |
+
if (current_drop_target) {
|
| 187 |
+
current_drop_target.classList.remove("drop-target");
|
| 188 |
+
current_drop_target = null;
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
if (dragged_el && dragged_el !== target && container_el) {
|
| 192 |
+
const dragged_parent = dragged_el.parentElement;
|
| 193 |
+
const target_parent = target.parentElement;
|
| 194 |
+
|
| 195 |
+
const is_dragged_in_form =
|
| 196 |
+
dragged_parent?.classList.contains("form") &&
|
| 197 |
+
dragged_parent.parentElement === container_el;
|
| 198 |
+
const is_target_in_form =
|
| 199 |
+
target_parent?.classList.contains("form") &&
|
| 200 |
+
target_parent.parentElement === container_el;
|
| 201 |
+
const is_dragged_direct = dragged_parent === container_el;
|
| 202 |
+
const is_target_direct = target_parent === container_el;
|
| 203 |
+
|
| 204 |
+
if (
|
| 205 |
+
!(
|
| 206 |
+
(is_dragged_in_form || is_dragged_direct) &&
|
| 207 |
+
(is_target_in_form || is_target_direct)
|
| 208 |
+
)
|
| 209 |
+
) {
|
| 210 |
+
return false;
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
const placeholder = document.createElement("div");
|
| 214 |
+
placeholder.style.display = "none";
|
| 215 |
+
|
| 216 |
+
dragged_parent!.insertBefore(placeholder, dragged_el);
|
| 217 |
+
|
| 218 |
+
target_parent!.insertBefore(dragged_el, target);
|
| 219 |
+
dragged_parent!.insertBefore(target, placeholder);
|
| 220 |
+
|
| 221 |
+
placeholder.remove();
|
| 222 |
+
|
| 223 |
+
dragged_el?.classList.remove("dragging");
|
| 224 |
+
const dragged_handle = dragged_el?.querySelector(
|
| 225 |
+
".drag-handle"
|
| 226 |
+
) as HTMLElement;
|
| 227 |
+
if (dragged_handle) {
|
| 228 |
+
dragged_handle.setAttribute("aria-grabbed", "false");
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
await tick();
|
| 232 |
+
setup_drag_and_drop();
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
return false;
|
| 236 |
+
}
|
| 237 |
+
|
| 238 |
+
onMount(() => {
|
| 239 |
+
setup_drag_and_drop();
|
| 240 |
+
|
| 241 |
+
const observer = new MutationObserver(setup_drag_and_drop);
|
| 242 |
+
|
| 243 |
+
if (container_el) {
|
| 244 |
+
observer.observe(container_el, {
|
| 245 |
+
childList: true,
|
| 246 |
+
subtree: false
|
| 247 |
+
});
|
| 248 |
+
}
|
| 249 |
+
|
| 250 |
+
return () => {
|
| 251 |
+
observer.disconnect();
|
| 252 |
+
items.forEach((item) => {
|
| 253 |
+
const handle = item.querySelector(".drag-handle");
|
| 254 |
+
if (handle) {
|
| 255 |
+
remove_drag_listeners(handle as HTMLElement);
|
| 256 |
+
}
|
| 257 |
+
remove_drop_listeners(item);
|
| 258 |
+
});
|
| 259 |
+
};
|
| 260 |
+
});
|
| 261 |
+
</script>
|
| 262 |
+
|
| 263 |
+
<div
|
| 264 |
+
bind:this={container_el}
|
| 265 |
+
class:hide={!gradio.shared.visible}
|
| 266 |
+
class:horizontal={gradio.props.orientation === "row"}
|
| 267 |
+
class:vertical={gradio.props.orientation === "column"}
|
| 268 |
+
id={gradio.shared.elem_id}
|
| 269 |
+
class="draggable {(gradio.shared.elem_classes || []).join(' ')}"
|
| 270 |
+
role="region"
|
| 271 |
+
aria-label="Draggable items container"
|
| 272 |
+
>
|
| 273 |
+
{#if gradio.shared.loading_status && gradio.props.show_progress}
|
| 274 |
+
<StatusTracker
|
| 275 |
+
autoscroll={gradio.shared.autoscroll}
|
| 276 |
+
i18n={gradio.i18n}
|
| 277 |
+
{...gradio.shared.loading_status}
|
| 278 |
+
status={gradio.shared.loading_status
|
| 279 |
+
? gradio.shared.loading_status.status == "pending"
|
| 280 |
+
? "generating"
|
| 281 |
+
: gradio.shared.loading_status.status
|
| 282 |
+
: null}
|
| 283 |
+
/>
|
| 284 |
+
{/if}
|
| 285 |
+
<slot />
|
| 286 |
+
</div>
|
| 287 |
+
|
| 288 |
+
<style>
|
| 289 |
+
.draggable {
|
| 290 |
+
display: flex;
|
| 291 |
+
gap: var(--layout-gap);
|
| 292 |
+
width: var(--size-full);
|
| 293 |
+
position: relative;
|
| 294 |
+
}
|
| 295 |
+
|
| 296 |
+
.horizontal {
|
| 297 |
+
flex-direction: row;
|
| 298 |
+
flex-wrap: wrap;
|
| 299 |
+
}
|
| 300 |
+
|
| 301 |
+
.vertical {
|
| 302 |
+
flex-direction: column;
|
| 303 |
+
}
|
| 304 |
+
|
| 305 |
+
.hide {
|
| 306 |
+
display: none;
|
| 307 |
+
}
|
| 308 |
+
|
| 309 |
+
.draggable > :global(.draggable-item),
|
| 310 |
+
.draggable > :global(.form > .draggable-item) {
|
| 311 |
+
transition:
|
| 312 |
+
transform 0.2s ease,
|
| 313 |
+
border 0.2s ease;
|
| 314 |
+
}
|
| 315 |
+
|
| 316 |
+
.draggable > :global(.draggable-item.drop-target),
|
| 317 |
+
.draggable > :global(.form > .draggable-item.drop-target) {
|
| 318 |
+
border: 2px dashed var(--border-color-primary) !important;
|
| 319 |
+
border-radius: 8px;
|
| 320 |
+
transform: scale(0.98);
|
| 321 |
+
opacity: 0.8;
|
| 322 |
+
}
|
| 323 |
+
|
| 324 |
+
.draggable > :global(.draggable-item.dragging),
|
| 325 |
+
.draggable > :global(.form > .draggable-item.dragging) {
|
| 326 |
+
opacity: 0.5;
|
| 327 |
+
transform: scale(1.02);
|
| 328 |
+
z-index: 1001;
|
| 329 |
+
}
|
| 330 |
+
|
| 331 |
+
.draggable > :global(.draggable-item .drag-handle) {
|
| 332 |
+
position: absolute;
|
| 333 |
+
top: 4px;
|
| 334 |
+
left: 4px;
|
| 335 |
+
width: 20px;
|
| 336 |
+
height: 20px;
|
| 337 |
+
min-width: 20px;
|
| 338 |
+
max-width: 20px;
|
| 339 |
+
min-height: 20px;
|
| 340 |
+
max-height: 20px;
|
| 341 |
+
background: var(--background-fill-secondary);
|
| 342 |
+
border: 1px solid rgba(0, 0, 0, 0.2);
|
| 343 |
+
border-radius: 4px;
|
| 344 |
+
cursor: grab;
|
| 345 |
+
display: flex;
|
| 346 |
+
align-items: center;
|
| 347 |
+
justify-content: center;
|
| 348 |
+
font-size: 10px;
|
| 349 |
+
color: var(--body-text-color-subdued);
|
| 350 |
+
opacity: 0;
|
| 351 |
+
transition: opacity 0.2s ease;
|
| 352 |
+
z-index: 100;
|
| 353 |
+
user-select: none;
|
| 354 |
+
flex-shrink: 0;
|
| 355 |
+
}
|
| 356 |
+
|
| 357 |
+
.draggable > :global(.draggable-item:hover .drag-handle) {
|
| 358 |
+
opacity: 1;
|
| 359 |
+
}
|
| 360 |
+
|
| 361 |
+
.draggable > :global(.draggable-item .drag-handle:hover) {
|
| 362 |
+
background: var(--background-fill-secondary);
|
| 363 |
+
border-color: var(--border-color-primary);
|
| 364 |
+
opacity: 1;
|
| 365 |
+
z-index: 101;
|
| 366 |
+
}
|
| 367 |
+
|
| 368 |
+
.draggable > :global(.draggable-item .drag-handle:active) {
|
| 369 |
+
cursor: grabbing;
|
| 370 |
+
background: var(--background-fill-secondary);
|
| 371 |
+
opacity: 1;
|
| 372 |
+
z-index: 101;
|
| 373 |
+
}
|
| 374 |
+
|
| 375 |
+
.horizontal > :global(.draggable-item),
|
| 376 |
+
.horizontal > :global(.form > .draggable-item) {
|
| 377 |
+
flex: 1 1 0%;
|
| 378 |
+
flex-wrap: wrap;
|
| 379 |
+
min-width: min(160px, 100%);
|
| 380 |
+
}
|
| 381 |
+
|
| 382 |
+
.vertical > :global(.draggable-item),
|
| 383 |
+
.vertical > :global(.form > .draggable-item) {
|
| 384 |
+
width: var(--size-full);
|
| 385 |
+
}
|
| 386 |
+
</style>
|
6.0.0-dev.5/draggable/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@gradio/draggable",
|
| 3 |
+
"version": "0.2.1",
|
| 4 |
+
"description": "Gradio Draggable layout component",
|
| 5 |
+
"type": "module",
|
| 6 |
+
"author": "",
|
| 7 |
+
"license": "ISC",
|
| 8 |
+
"main_changeset": true,
|
| 9 |
+
"private": false,
|
| 10 |
+
"exports": {
|
| 11 |
+
".": {
|
| 12 |
+
"gradio": "./Index.svelte",
|
| 13 |
+
"svelte": "./dist/Index.svelte",
|
| 14 |
+
"types": "./dist/Index.svelte.d.ts"
|
| 15 |
+
},
|
| 16 |
+
"./package.json": "./package.json"
|
| 17 |
+
},
|
| 18 |
+
"devDependencies": {
|
| 19 |
+
"@gradio/preview": "workspace:^",
|
| 20 |
+
"@gradio/statustracker": "workspace:^",
|
| 21 |
+
"@gradio/utils": "workspace:^"
|
| 22 |
+
},
|
| 23 |
+
"peerDependencies": {
|
| 24 |
+
"svelte": "^5.43.4"
|
| 25 |
+
},
|
| 26 |
+
"repository": {
|
| 27 |
+
"type": "git",
|
| 28 |
+
"url": "git+https://github.com/gradio-app/gradio.git",
|
| 29 |
+
"directory": "js/draggable"
|
| 30 |
+
}
|
| 31 |
+
}
|
6.0.0-dev.5/draggable/types.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import type { LoadingStatus } from "@gradio/statustracker";
|
| 2 |
+
|
| 3 |
+
export interface DraggableProps {
|
| 4 |
+
orientation: "row" | "column";
|
| 5 |
+
show_progress: boolean;
|
| 6 |
+
}
|
| 7 |
+
|
| 8 |
+
export interface DraggableEvents {
|
| 9 |
+
clear_status: never;
|
| 10 |
+
}
|