@gradio/multimodaltextbox 0.10.17 → 0.10.18
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 +29 -0
- package/dist/Example.svelte.d.ts +4 -2
- package/dist/Index.svelte +12 -13
- package/dist/Index.svelte.d.ts +17 -15
- package/dist/shared/MultimodalTextbox.svelte +12 -18
- package/dist/shared/MultimodalTextbox.svelte.d.ts +20 -18
- package/package.json +8 -8
- package/shared/MultimodalTextbox.svelte +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @gradio/multimodaltextbox
|
|
2
2
|
|
|
3
|
+
## 0.10.18
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- [#11822](https://github.com/gradio-app/gradio/pull/11822) [`c9a5424`](https://github.com/gradio-app/gradio/commit/c9a5424e30bee42f4052d0fd1cef8dd61e8382f5) - Fix bug where multimodal textbox was not auto focused after updates. Thanks @freddyaboulton!
|
|
8
|
+
|
|
9
|
+
### Dependency updates
|
|
10
|
+
|
|
11
|
+
- @gradio/client@1.18.0
|
|
12
|
+
- @gradio/icons@0.14.0
|
|
13
|
+
- @gradio/atoms@0.17.0
|
|
14
|
+
- @gradio/statustracker@0.11.0
|
|
15
|
+
- @gradio/upload@0.16.17
|
|
16
|
+
- @gradio/image@0.22.18
|
|
17
|
+
- @gradio/video@0.15.1
|
|
18
|
+
|
|
19
|
+
## 0.10.17
|
|
20
|
+
|
|
21
|
+
### Dependency updates
|
|
22
|
+
|
|
23
|
+
- @gradio/statustracker@0.10.18
|
|
24
|
+
|
|
25
|
+
## 0.10.17
|
|
26
|
+
|
|
27
|
+
### Dependency updates
|
|
28
|
+
|
|
29
|
+
- @gradio/icons@0.13.1
|
|
30
|
+
- @gradio/upload@0.16.16
|
|
31
|
+
|
|
3
32
|
## 0.10.17
|
|
4
33
|
|
|
5
34
|
### Dependency updates
|
package/dist/Example.svelte.d.ts
CHANGED
|
@@ -5,14 +5,16 @@ declare const __propDef: {
|
|
|
5
5
|
value?: {
|
|
6
6
|
text: string;
|
|
7
7
|
files: FileData[];
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
9
|
type: "gallery" | "table";
|
|
10
|
-
selected?: boolean
|
|
10
|
+
selected?: boolean;
|
|
11
11
|
};
|
|
12
12
|
events: {
|
|
13
13
|
[evt: string]: CustomEvent<any>;
|
|
14
14
|
};
|
|
15
15
|
slots: {};
|
|
16
|
+
exports?: {} | undefined;
|
|
17
|
+
bindings?: string | undefined;
|
|
16
18
|
};
|
|
17
19
|
export type ExampleProps = typeof __propDef.props;
|
|
18
20
|
export type ExampleEvents = typeof __propDef.events;
|
package/dist/Index.svelte
CHANGED
|
@@ -54,19 +54,18 @@ onMount(() => {
|
|
|
54
54
|
waveform_settings.mediaControls = waveform_options.show_controls;
|
|
55
55
|
waveform_settings.sampleRate = waveform_options.sample_rate || 44100;
|
|
56
56
|
});
|
|
57
|
-
$:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
};
|
|
57
|
+
$: waveform_settings = {
|
|
58
|
+
height: 50,
|
|
59
|
+
barWidth: 2,
|
|
60
|
+
barGap: 3,
|
|
61
|
+
cursorWidth: 2,
|
|
62
|
+
cursorColor: "#ddd5e9",
|
|
63
|
+
autoplay: false,
|
|
64
|
+
barRadius: 10,
|
|
65
|
+
dragToSeek: true,
|
|
66
|
+
normalize: true,
|
|
67
|
+
minPxPerSec: 20
|
|
68
|
+
};
|
|
70
69
|
const trim_region_settings = {
|
|
71
70
|
color: waveform_options.trim_region_color,
|
|
72
71
|
drag: true,
|
package/dist/Index.svelte.d.ts
CHANGED
|
@@ -26,35 +26,35 @@ declare const __propDef: {
|
|
|
26
26
|
upload: FileData[] | FileData;
|
|
27
27
|
clear: undefined;
|
|
28
28
|
}>;
|
|
29
|
-
elem_id?: string
|
|
30
|
-
elem_classes?: string[]
|
|
31
|
-
visible?: boolean
|
|
29
|
+
elem_id?: string;
|
|
30
|
+
elem_classes?: string[];
|
|
31
|
+
visible?: boolean;
|
|
32
32
|
value?: {
|
|
33
33
|
text: string;
|
|
34
34
|
files: FileData[];
|
|
35
|
-
}
|
|
36
|
-
file_types?:
|
|
35
|
+
};
|
|
36
|
+
file_types?: string[] | null;
|
|
37
37
|
lines: number;
|
|
38
|
-
placeholder?: string
|
|
39
|
-
label?: string
|
|
38
|
+
placeholder?: string;
|
|
39
|
+
label?: string;
|
|
40
40
|
info?: string | undefined;
|
|
41
41
|
show_label: boolean;
|
|
42
42
|
max_lines: number;
|
|
43
|
-
scale?:
|
|
43
|
+
scale?: number | null;
|
|
44
44
|
min_width?: number | undefined;
|
|
45
|
-
submit_btn?:
|
|
46
|
-
stop_btn?:
|
|
45
|
+
submit_btn?: string | boolean | null;
|
|
46
|
+
stop_btn?: string | boolean | null;
|
|
47
47
|
loading_status?: LoadingStatus | undefined;
|
|
48
|
-
value_is_output?: boolean
|
|
49
|
-
rtl?: boolean
|
|
48
|
+
value_is_output?: boolean;
|
|
49
|
+
rtl?: boolean;
|
|
50
50
|
text_align?: "left" | "right" | undefined;
|
|
51
|
-
autofocus?: boolean
|
|
52
|
-
autoscroll?: boolean
|
|
51
|
+
autofocus?: boolean;
|
|
52
|
+
autoscroll?: boolean;
|
|
53
53
|
interactive: boolean;
|
|
54
54
|
root: string;
|
|
55
55
|
file_count: "single" | "multiple" | "directory";
|
|
56
56
|
max_plain_text_length: number;
|
|
57
|
-
sources?: ["microphone" | "upload"]
|
|
57
|
+
sources?: ["microphone" | "upload"];
|
|
58
58
|
waveform_options?: any;
|
|
59
59
|
html_attributes?: InputHTMLAttributes | null;
|
|
60
60
|
};
|
|
@@ -62,6 +62,8 @@ declare const __propDef: {
|
|
|
62
62
|
[evt: string]: CustomEvent<any>;
|
|
63
63
|
};
|
|
64
64
|
slots: {};
|
|
65
|
+
exports?: {} | undefined;
|
|
66
|
+
bindings?: string | undefined;
|
|
65
67
|
};
|
|
66
68
|
export type IndexProps = typeof __propDef.props;
|
|
67
69
|
export type IndexEvents = typeof __propDef.events;
|
|
@@ -62,20 +62,15 @@ export let dragging = false;
|
|
|
62
62
|
let uploading = false;
|
|
63
63
|
let oldValue = value?.text ?? "";
|
|
64
64
|
let recording = false;
|
|
65
|
-
$:
|
|
66
|
-
dispatch("drag", dragging);
|
|
65
|
+
$: dispatch("drag", dragging);
|
|
67
66
|
let mic_audio = null;
|
|
68
67
|
let full_container;
|
|
69
|
-
$:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
$:
|
|
75
|
-
if (value === null)
|
|
76
|
-
value = { text: "", files: [] };
|
|
77
|
-
$:
|
|
78
|
-
value, el && lines !== max_lines && resize(el, lines, max_lines);
|
|
68
|
+
$: if (oldValue !== value.text) {
|
|
69
|
+
dispatch("change", value);
|
|
70
|
+
oldValue = value.text;
|
|
71
|
+
}
|
|
72
|
+
$: if (value === null) value = { text: "", files: [] };
|
|
73
|
+
$: value, el && lines !== max_lines && resize(el, lines, max_lines);
|
|
79
74
|
const dispatch = createEventDispatcher();
|
|
80
75
|
beforeUpdate(() => {
|
|
81
76
|
can_scroll = el && el.offsetHeight + el.scrollTop > el.scrollHeight - 100;
|
|
@@ -100,6 +95,9 @@ afterUpdate(() => {
|
|
|
100
95
|
if (can_scroll && autoscroll) {
|
|
101
96
|
scroll();
|
|
102
97
|
}
|
|
98
|
+
if (autofocus && el !== null) {
|
|
99
|
+
el.focus();
|
|
100
|
+
}
|
|
103
101
|
value_is_output = false;
|
|
104
102
|
});
|
|
105
103
|
function handle_select(event) {
|
|
@@ -179,8 +177,7 @@ function handle_submit() {
|
|
|
179
177
|
}
|
|
180
178
|
}
|
|
181
179
|
async function handle_paste(event) {
|
|
182
|
-
if (!event.clipboardData)
|
|
183
|
-
return;
|
|
180
|
+
if (!event.clipboardData) return;
|
|
184
181
|
const items = event.clipboardData.items;
|
|
185
182
|
const text = event.clipboardData.getData("text");
|
|
186
183
|
if (text && text.length > max_plain_text_length) {
|
|
@@ -198,8 +195,7 @@ async function handle_paste(event) {
|
|
|
198
195
|
const item = items[index];
|
|
199
196
|
if (item.kind === "file" && item.type.includes("image")) {
|
|
200
197
|
const blob = item.getAsFile();
|
|
201
|
-
if (blob)
|
|
202
|
-
upload_component.load_files([blob]);
|
|
198
|
+
if (blob) upload_component.load_files([blob]);
|
|
203
199
|
}
|
|
204
200
|
}
|
|
205
201
|
}
|
|
@@ -371,7 +367,6 @@ function handle_drop(event) {
|
|
|
371
367
|
<Microphone />
|
|
372
368
|
</button>
|
|
373
369
|
{/if}
|
|
374
|
-
<!-- svelte-ignore a11y-autofocus -->
|
|
375
370
|
<textarea
|
|
376
371
|
data-testid="textbox"
|
|
377
372
|
use:text_area_resize={{
|
|
@@ -387,7 +382,6 @@ function handle_drop(event) {
|
|
|
387
382
|
{placeholder}
|
|
388
383
|
rows={lines}
|
|
389
384
|
{disabled}
|
|
390
|
-
{autofocus}
|
|
391
385
|
on:keypress={handle_keypress}
|
|
392
386
|
on:blur
|
|
393
387
|
on:select={handle_select}
|
|
@@ -8,35 +8,35 @@ declare const __propDef: {
|
|
|
8
8
|
value?: {
|
|
9
9
|
text: string;
|
|
10
10
|
files: FileData[];
|
|
11
|
-
}
|
|
12
|
-
value_is_output?: boolean
|
|
13
|
-
lines?: number
|
|
11
|
+
};
|
|
12
|
+
value_is_output?: boolean;
|
|
13
|
+
lines?: number;
|
|
14
14
|
i18n: I18nFormatter;
|
|
15
|
-
placeholder?: string
|
|
16
|
-
disabled?: boolean
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
17
|
label: string;
|
|
18
18
|
info?: string | undefined;
|
|
19
|
-
show_label?: boolean
|
|
19
|
+
show_label?: boolean;
|
|
20
20
|
max_lines: number;
|
|
21
|
-
submit_btn?:
|
|
22
|
-
stop_btn?:
|
|
23
|
-
rtl?: boolean
|
|
24
|
-
autofocus?: boolean
|
|
21
|
+
submit_btn?: string | boolean | null;
|
|
22
|
+
stop_btn?: string | boolean | null;
|
|
23
|
+
rtl?: boolean;
|
|
24
|
+
autofocus?: boolean;
|
|
25
25
|
text_align?: "left" | "right" | undefined;
|
|
26
|
-
autoscroll?: boolean
|
|
26
|
+
autoscroll?: boolean;
|
|
27
27
|
root: string;
|
|
28
|
-
file_types?:
|
|
29
|
-
max_file_size?:
|
|
28
|
+
file_types?: string[] | null;
|
|
29
|
+
max_file_size?: number | null;
|
|
30
30
|
upload: Client["upload"];
|
|
31
31
|
stream_handler: Client["stream"];
|
|
32
|
-
file_count?:
|
|
33
|
-
max_plain_text_length?: number
|
|
32
|
+
file_count?: "single" | "multiple" | "directory";
|
|
33
|
+
max_plain_text_length?: number;
|
|
34
34
|
waveform_settings: Record<string, any>;
|
|
35
35
|
waveform_options?: any;
|
|
36
|
-
sources?: ["microphone" | "upload"]
|
|
37
|
-
active_source?:
|
|
36
|
+
sources?: ["microphone" | "upload"];
|
|
37
|
+
active_source?: "microphone" | null;
|
|
38
38
|
html_attributes?: InputHTMLAttributes | null;
|
|
39
|
-
dragging?: boolean
|
|
39
|
+
dragging?: boolean;
|
|
40
40
|
};
|
|
41
41
|
events: {
|
|
42
42
|
dragover: DragEvent;
|
|
@@ -62,6 +62,8 @@ declare const __propDef: {
|
|
|
62
62
|
[evt: string]: CustomEvent<any>;
|
|
63
63
|
};
|
|
64
64
|
slots: {};
|
|
65
|
+
exports?: {} | undefined;
|
|
66
|
+
bindings?: string | undefined;
|
|
65
67
|
};
|
|
66
68
|
export type MultimodalTextboxProps = typeof __propDef.props;
|
|
67
69
|
export type MultimodalTextboxEvents = typeof __propDef.events;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/multimodaltextbox",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.18",
|
|
4
4
|
"description": "Gradio UI packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"./package.json": "./package.json"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@gradio/atoms": "^0.
|
|
25
|
+
"@gradio/atoms": "^0.17.0",
|
|
26
|
+
"@gradio/icons": "^0.14.0",
|
|
27
|
+
"@gradio/statustracker": "^0.11.0",
|
|
26
28
|
"@gradio/utils": "^0.10.2",
|
|
27
|
-
"@gradio/
|
|
28
|
-
"@gradio/
|
|
29
|
-
"@gradio/
|
|
30
|
-
"@gradio/
|
|
31
|
-
"@gradio/video": "^0.15.0",
|
|
32
|
-
"@gradio/image": "^0.22.17"
|
|
29
|
+
"@gradio/upload": "^0.16.17",
|
|
30
|
+
"@gradio/image": "^0.22.18",
|
|
31
|
+
"@gradio/client": "^1.18.0",
|
|
32
|
+
"@gradio/video": "^0.15.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@gradio/preview": "^0.14.0"
|
|
@@ -130,6 +130,9 @@
|
|
|
130
130
|
if (can_scroll && autoscroll) {
|
|
131
131
|
scroll();
|
|
132
132
|
}
|
|
133
|
+
if (autofocus && el !== null) {
|
|
134
|
+
el.focus();
|
|
135
|
+
}
|
|
133
136
|
value_is_output = false;
|
|
134
137
|
});
|
|
135
138
|
|
|
@@ -429,7 +432,6 @@
|
|
|
429
432
|
<Microphone />
|
|
430
433
|
</button>
|
|
431
434
|
{/if}
|
|
432
|
-
<!-- svelte-ignore a11y-autofocus -->
|
|
433
435
|
<textarea
|
|
434
436
|
data-testid="textbox"
|
|
435
437
|
use:text_area_resize={{
|
|
@@ -445,7 +447,6 @@
|
|
|
445
447
|
{placeholder}
|
|
446
448
|
rows={lines}
|
|
447
449
|
{disabled}
|
|
448
|
-
{autofocus}
|
|
449
450
|
on:keypress={handle_keypress}
|
|
450
451
|
on:blur
|
|
451
452
|
on:select={handle_select}
|