@gradio/draggable 0.2.0 → 0.3.0
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/CHANGELOG.md +40 -0
- package/Index.svelte +15 -20
- package/dist/Index.svelte +271 -205
- package/dist/Index.svelte.d.ts +18 -26
- package/dist/types.d.ts +7 -0
- package/dist/types.js +1 -0
- package/package.json +5 -5
- package/types.ts +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,44 @@
|
|
|
1
1
|
# @gradio/draggable
|
|
2
|
+
## 0.3.0
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
- [#12438](https://github.com/gradio-app/gradio/pull/12438) [`25ffc03`](https://github.com/gradio-app/gradio/commit/25ffc0398f8feb43d817c02b2ab970c16de6d797) - Svelte5 migration and bugfix
|
|
7
|
+
|
|
8
|
+
## 0.2.1
|
|
9
|
+
|
|
10
|
+
### Dependency updates
|
|
11
|
+
|
|
12
|
+
- @gradio/statustracker@0.12.0-dev.1
|
|
13
|
+
|
|
14
|
+
## 0.2.1
|
|
15
|
+
|
|
16
|
+
### Dependency updates
|
|
17
|
+
|
|
18
|
+
- @gradio/utils@0.10.3-dev.0
|
|
19
|
+
- @gradio/statustracker@0.12.0-dev.0
|
|
20
|
+
|
|
21
|
+
## 0.2.1
|
|
22
|
+
|
|
23
|
+
### Fixes
|
|
24
|
+
|
|
25
|
+
- [#11784](https://github.com/gradio-app/gradio/pull/11784) [`d9dd3f5`](https://github.com/gradio-app/gradio/commit/d9dd3f54b7fb34cf7118e549d39fc63937ca3489) - Add "hidden" option to component's `visible` kwarg to render but visually hide the component. Thanks @pngwn!
|
|
26
|
+
|
|
27
|
+
### Dependency updates
|
|
28
|
+
|
|
29
|
+
- @gradio/statustracker@0.11.1
|
|
30
|
+
|
|
31
|
+
## 0.2.0
|
|
32
|
+
|
|
33
|
+
### Dependency updates
|
|
34
|
+
|
|
35
|
+
- @gradio/statustracker@0.11.0
|
|
36
|
+
|
|
37
|
+
## 0.2.0
|
|
38
|
+
|
|
39
|
+
### Dependency updates
|
|
40
|
+
|
|
41
|
+
- @gradio/statustracker@0.10.18
|
|
2
42
|
|
|
3
43
|
## 0.2.0
|
|
4
44
|
|
package/Index.svelte
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { DraggableProps, DraggableEvents } from "./types";
|
|
3
|
+
import { Gradio } from "@gradio/utils";
|
|
2
4
|
import { StatusTracker } from "@gradio/statustracker";
|
|
3
|
-
import type { LoadingStatus } from "@gradio/statustracker";
|
|
4
|
-
import type { Gradio } from "@gradio/utils";
|
|
5
5
|
import { onMount, tick } from "svelte";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export let visible = true;
|
|
10
|
-
export let orientation: "row" | "column" = "row";
|
|
11
|
-
export let loading_status: LoadingStatus | undefined = undefined;
|
|
12
|
-
export let gradio: Gradio | undefined = undefined;
|
|
13
|
-
export let show_progress = false;
|
|
7
|
+
const props = $props();
|
|
8
|
+
const gradio = new Gradio<DraggableEvents, DraggableProps>(props);
|
|
14
9
|
|
|
15
10
|
let container_el: HTMLDivElement;
|
|
16
11
|
let dragged_el: HTMLElement | null = null;
|
|
@@ -267,23 +262,23 @@
|
|
|
267
262
|
|
|
268
263
|
<div
|
|
269
264
|
bind:this={container_el}
|
|
270
|
-
class:hide={!visible}
|
|
271
|
-
class:horizontal={orientation === "row"}
|
|
272
|
-
class:vertical={orientation === "column"}
|
|
273
|
-
id={elem_id}
|
|
274
|
-
class="draggable {elem_classes.join(' ')}"
|
|
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(' ')}"
|
|
275
270
|
role="region"
|
|
276
271
|
aria-label="Draggable items container"
|
|
277
272
|
>
|
|
278
|
-
{#if loading_status && show_progress
|
|
273
|
+
{#if gradio.shared.loading_status && gradio.props.show_progress}
|
|
279
274
|
<StatusTracker
|
|
280
|
-
autoscroll={gradio.autoscroll}
|
|
275
|
+
autoscroll={gradio.shared.autoscroll}
|
|
281
276
|
i18n={gradio.i18n}
|
|
282
|
-
{...loading_status}
|
|
283
|
-
status={loading_status
|
|
284
|
-
? loading_status.status == "pending"
|
|
277
|
+
{...gradio.shared.loading_status}
|
|
278
|
+
status={gradio.shared.loading_status
|
|
279
|
+
? gradio.shared.loading_status.status == "pending"
|
|
285
280
|
? "generating"
|
|
286
|
-
: loading_status.status
|
|
281
|
+
: gradio.shared.loading_status.status
|
|
287
282
|
: null}
|
|
288
283
|
/>
|
|
289
284
|
{/if}
|
package/dist/Index.svelte
CHANGED
|
@@ -1,218 +1,284 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
let container_el;
|
|
11
|
-
let dragged_el = null;
|
|
12
|
-
let dragged_index = -1;
|
|
13
|
-
let items = [];
|
|
14
|
-
let current_drop_target = null;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
function
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
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
|
+
});
|
|
195
261
|
</script>
|
|
196
262
|
|
|
197
263
|
<div
|
|
198
264
|
bind:this={container_el}
|
|
199
|
-
class:hide={!visible}
|
|
200
|
-
class:horizontal={orientation === "row"}
|
|
201
|
-
class:vertical={orientation === "column"}
|
|
202
|
-
id={elem_id}
|
|
203
|
-
class="draggable {elem_classes.join(' ')}"
|
|
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(' ')}"
|
|
204
270
|
role="region"
|
|
205
271
|
aria-label="Draggable items container"
|
|
206
272
|
>
|
|
207
|
-
{#if loading_status && show_progress
|
|
273
|
+
{#if gradio.shared.loading_status && gradio.props.show_progress}
|
|
208
274
|
<StatusTracker
|
|
209
|
-
autoscroll={gradio.autoscroll}
|
|
275
|
+
autoscroll={gradio.shared.autoscroll}
|
|
210
276
|
i18n={gradio.i18n}
|
|
211
|
-
{...loading_status}
|
|
212
|
-
status={loading_status
|
|
213
|
-
? loading_status.status == "pending"
|
|
277
|
+
{...gradio.shared.loading_status}
|
|
278
|
+
status={gradio.shared.loading_status
|
|
279
|
+
? gradio.shared.loading_status.status == "pending"
|
|
214
280
|
? "generating"
|
|
215
|
-
: loading_status.status
|
|
281
|
+
: gradio.shared.loading_status.status
|
|
216
282
|
: null}
|
|
217
283
|
/>
|
|
218
284
|
{/if}
|
package/dist/Index.svelte.d.ts
CHANGED
|
@@ -1,28 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
props: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
gradio?: Gradio | undefined;
|
|
12
|
-
show_progress?: boolean;
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
};
|
|
17
|
-
slots: {
|
|
18
|
-
default: {};
|
|
19
|
-
};
|
|
20
|
-
exports?: {} | undefined;
|
|
21
|
-
bindings?: string | undefined;
|
|
22
|
-
};
|
|
23
|
-
export type IndexProps = typeof __propDef.props;
|
|
24
|
-
export type IndexEvents = typeof __propDef.events;
|
|
25
|
-
export type IndexSlots = typeof __propDef.slots;
|
|
26
|
-
export default class Index extends SvelteComponent<IndexProps, IndexEvents, IndexSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
27
13
|
}
|
|
28
|
-
|
|
14
|
+
declare const Index: $$__sveltets_2_IsomorphicComponent<any, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {
|
|
17
|
+
default: {};
|
|
18
|
+
}, {}, "">;
|
|
19
|
+
type Index = InstanceType<typeof Index>;
|
|
20
|
+
export default Index;
|
package/dist/types.d.ts
ADDED
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/draggable",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Gradio Draggable layout component",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "",
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
"./package.json": "./package.json"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@gradio/
|
|
20
|
-
"@gradio/
|
|
21
|
-
"@gradio/utils": "^0.10.
|
|
19
|
+
"@gradio/preview": "^0.15.0",
|
|
20
|
+
"@gradio/statustracker": "^0.12.0",
|
|
21
|
+
"@gradio/utils": "^0.10.3"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"svelte": "^
|
|
24
|
+
"svelte": "^5.43.4"
|
|
25
25
|
},
|
|
26
26
|
"repository": {
|
|
27
27
|
"type": "git",
|