@gradio/draggable 0.2.1 → 0.3.1

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 CHANGED
@@ -1,5 +1,54 @@
1
1
  # @gradio/draggable
2
2
 
3
+ ## 0.3.1
4
+
5
+ ### Fixes
6
+
7
+ - [#12800](https://github.com/gradio-app/gradio/pull/12800) [`7a1c321`](https://github.com/gradio-app/gradio/commit/7a1c321b6546ba05a353488f5133e8262c4a8a39) - Bump svelte/kit for security reasons. Thanks @freddyaboulton!
8
+
9
+ ### Dependency updates
10
+
11
+ - @gradio/statustracker@0.12.2
12
+ - @gradio/utils@0.11.2
13
+
14
+ ## 0.3.0
15
+
16
+ ### Dependency updates
17
+
18
+ - @gradio/utils@0.11.1
19
+
20
+ ## 0.3.0
21
+
22
+ ### Dependency updates
23
+
24
+ - @gradio/utils@0.11.0
25
+ - @gradio/statustracker@0.12.1
26
+
27
+ ## 0.3.0
28
+
29
+ ### Dependency updates
30
+
31
+ - @gradio/utils@0.10.4
32
+
33
+ ## 0.3.0
34
+
35
+ ### Features
36
+
37
+ - [#12438](https://github.com/gradio-app/gradio/pull/12438) [`25ffc03`](https://github.com/gradio-app/gradio/commit/25ffc0398f8feb43d817c02b2ab970c16de6d797) - Svelte5 migration and bugfix
38
+
39
+ ## 0.2.1
40
+
41
+ ### Dependency updates
42
+
43
+ - @gradio/statustracker@0.12.0-dev.1
44
+
45
+ ## 0.2.1
46
+
47
+ ### Dependency updates
48
+
49
+ - @gradio/utils@0.10.3-dev.0
50
+ - @gradio/statustracker@0.12.0-dev.0
51
+
3
52
  ## 0.2.1
4
53
 
5
54
  ### Fixes
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
- export let elem_id: string;
8
- export let elem_classes: string[] = [];
9
- export let visible: boolean | "hidden" = 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 && gradio}
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>import { StatusTracker } from "@gradio/statustracker";
2
- import { onMount, tick } from "svelte";
3
- export let elem_id;
4
- export let elem_classes = [];
5
- export let visible = true;
6
- export let orientation = "row";
7
- export let loading_status = void 0;
8
- export let gradio = void 0;
9
- export let show_progress = false;
10
- let container_el;
11
- let dragged_el = null;
12
- let dragged_index = -1;
13
- let items = [];
14
- let current_drop_target = null;
15
- const drag_event_handlers = [
16
- { event: "dragstart", handler: handle_drag_start },
17
- { event: "dragend", handler: handle_drag_end }
18
- ];
19
- const drop_event_handlers = [
20
- { event: "dragover", handler: handle_drag_over },
21
- { event: "drop", handler: handle_drop },
22
- { event: "dragenter", handler: handle_drag_enter }
23
- ];
24
- function add_drag_listeners(element) {
25
- drag_event_handlers.forEach(({ event, handler }) => {
26
- element.addEventListener(event, handler);
27
- });
28
- }
29
- function remove_drag_listeners(element) {
30
- drag_event_handlers.forEach(({ event, handler }) => {
31
- element.removeEventListener(event, handler);
32
- });
33
- }
34
- function add_drop_listeners(element) {
35
- drop_event_handlers.forEach(({ event, handler }) => {
36
- element.addEventListener(event, handler);
37
- });
38
- }
39
- function remove_drop_listeners(element) {
40
- drop_event_handlers.forEach(({ event, handler }) => {
41
- element.removeEventListener(event, handler);
42
- });
43
- }
44
- function setup_draggable_item(element, index) {
45
- element.classList.add("draggable-item");
46
- element.setAttribute("data-index", index.toString());
47
- element.style.position = "relative";
48
- const handle = document.createElement("div");
49
- handle.className = "drag-handle";
50
- handle.setAttribute("draggable", "true");
51
- handle.setAttribute("aria-grabbed", "false");
52
- handle.setAttribute("data-index", index.toString());
53
- handle.innerHTML = "\u22EE\u22EE";
54
- element.appendChild(handle);
55
- add_drag_listeners(handle);
56
- add_drop_listeners(element);
57
- }
58
- function setup_drag_and_drop() {
59
- if (!container_el) return;
60
- items.forEach((item) => {
61
- const handle = item.querySelector(".drag-handle");
62
- if (handle) {
63
- remove_drag_listeners(handle);
64
- handle.remove();
65
- }
66
- remove_drop_listeners(item);
67
- });
68
- items = [];
69
- const children = Array.from(container_el.children);
70
- let item_index = 0;
71
- children.forEach((child) => {
72
- if (child.classList.contains("status-tracker")) return;
73
- if (child.classList.contains("form") && child.children.length > 0) {
74
- const form_children = Array.from(child.children);
75
- form_children.forEach((form_child) => {
76
- items.push(form_child);
77
- setup_draggable_item(form_child, item_index);
78
- item_index++;
79
- });
80
- } else {
81
- items.push(child);
82
- setup_draggable_item(child, item_index);
83
- item_index++;
84
- }
85
- });
86
- }
87
- function handle_drag_start(e) {
88
- e.stopPropagation?.();
89
- const handle = e.currentTarget;
90
- const element = handle.parentElement;
91
- dragged_el = element;
92
- dragged_index = parseInt(handle.dataset.index || "-1");
93
- handle.setAttribute("aria-grabbed", "true");
94
- element.classList.add("dragging");
95
- if (e.dataTransfer) {
96
- e.dataTransfer.effectAllowed = "move";
97
- e.dataTransfer.setData("text/html", element.outerHTML);
98
- e.dataTransfer.setDragImage(element, 10, 10);
99
- }
100
- }
101
- function handle_drag_end(e) {
102
- e.stopPropagation?.();
103
- const handle = e.currentTarget;
104
- const element = handle.parentElement;
105
- element.classList.remove("dragging");
106
- handle.setAttribute("aria-grabbed", "false");
107
- if (current_drop_target) {
108
- current_drop_target.classList.remove("drop-target");
109
- current_drop_target = null;
110
- }
111
- dragged_el = null;
112
- dragged_index = -1;
113
- }
114
- function handle_drag_over(e) {
115
- e.preventDefault();
116
- e.dataTransfer && (e.dataTransfer.dropEffect = "move");
117
- return false;
118
- }
119
- function handle_drag_enter(e) {
120
- e.stopPropagation?.();
121
- const target = e.currentTarget;
122
- if (target === dragged_el) return;
123
- if (!dragged_el || !container_el) return;
124
- const dragged_parent = dragged_el.parentElement;
125
- const target_parent = target.parentElement;
126
- const is_dragged_in_form = dragged_parent?.classList.contains("form") && dragged_parent.parentElement === container_el;
127
- const is_target_in_form = target_parent?.classList.contains("form") && target_parent.parentElement === container_el;
128
- const is_dragged_direct = dragged_parent === container_el;
129
- const is_target_direct = target_parent === container_el;
130
- if (!((is_dragged_in_form || is_dragged_direct) && (is_target_in_form || is_target_direct))) {
131
- return;
132
- }
133
- if (current_drop_target && current_drop_target !== target) {
134
- current_drop_target.classList.remove("drop-target");
135
- }
136
- target.classList.add("drop-target");
137
- current_drop_target = target;
138
- }
139
- async function handle_drop(e) {
140
- e.stopPropagation?.();
141
- const target = e.currentTarget;
142
- target.classList.remove("drop-target");
143
- if (current_drop_target) {
144
- current_drop_target.classList.remove("drop-target");
145
- current_drop_target = null;
146
- }
147
- if (dragged_el && dragged_el !== target && container_el) {
148
- const dragged_parent = dragged_el.parentElement;
149
- const target_parent = target.parentElement;
150
- const is_dragged_in_form = dragged_parent?.classList.contains("form") && dragged_parent.parentElement === container_el;
151
- const is_target_in_form = target_parent?.classList.contains("form") && target_parent.parentElement === container_el;
152
- const is_dragged_direct = dragged_parent === container_el;
153
- const is_target_direct = target_parent === container_el;
154
- if (!((is_dragged_in_form || is_dragged_direct) && (is_target_in_form || is_target_direct))) {
155
- return false;
156
- }
157
- const placeholder = document.createElement("div");
158
- placeholder.style.display = "none";
159
- dragged_parent.insertBefore(placeholder, dragged_el);
160
- target_parent.insertBefore(dragged_el, target);
161
- dragged_parent.insertBefore(target, placeholder);
162
- placeholder.remove();
163
- dragged_el?.classList.remove("dragging");
164
- const dragged_handle = dragged_el?.querySelector(
165
- ".drag-handle"
166
- );
167
- if (dragged_handle) {
168
- dragged_handle.setAttribute("aria-grabbed", "false");
169
- }
170
- await tick();
171
- setup_drag_and_drop();
172
- }
173
- return false;
174
- }
175
- onMount(() => {
176
- setup_drag_and_drop();
177
- const observer = new MutationObserver(setup_drag_and_drop);
178
- if (container_el) {
179
- observer.observe(container_el, {
180
- childList: true,
181
- subtree: false
182
- });
183
- }
184
- return () => {
185
- observer.disconnect();
186
- items.forEach((item) => {
187
- const handle = item.querySelector(".drag-handle");
188
- if (handle) {
189
- remove_drag_listeners(handle);
190
- }
191
- remove_drop_listeners(item);
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 && gradio}
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}
@@ -1,28 +1,20 @@
1
- import { SvelteComponent } from "svelte";
2
- import type { LoadingStatus } from "@gradio/statustracker";
3
- import type { Gradio } from "@gradio/utils";
4
- declare const __propDef: {
5
- props: {
6
- elem_id: string;
7
- elem_classes?: string[];
8
- visible?: boolean | "hidden";
9
- orientation?: "row" | "column";
10
- loading_status?: LoadingStatus | undefined;
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
- events: {
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
- export {};
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;
@@ -0,0 +1,7 @@
1
+ export interface DraggableProps {
2
+ orientation: "row" | "column";
3
+ show_progress: boolean;
4
+ }
5
+ export interface DraggableEvents {
6
+ clear_status: never;
7
+ }
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.2.1",
3
+ "version": "0.3.1",
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/preview": "^0.14.0",
20
- "@gradio/statustracker": "^0.11.1",
21
- "@gradio/utils": "^0.10.2"
19
+ "@gradio/preview": "^0.15.2",
20
+ "@gradio/statustracker": "^0.12.2",
21
+ "@gradio/utils": "^0.11.2"
22
22
  },
23
23
  "peerDependencies": {
24
- "svelte": "^4.0.0"
24
+ "svelte": "^5.48.0"
25
25
  },
26
26
  "repository": {
27
27
  "type": "git",
package/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
+ }