@gradio/multimodaltextbox 0.10.19 → 0.10.21
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,29 @@
|
|
|
1
1
|
# @gradio/multimodaltextbox
|
|
2
2
|
|
|
3
|
+
## 0.10.21
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- [#12019](https://github.com/gradio-app/gradio/pull/12019) [`81fc464`](https://github.com/gradio-app/gradio/commit/81fc4647cdc9ffd724b69ec7286f1d686571062a) - Fix MultimodalTextbox autofocus issue when file_types is specified. Thanks @freddyaboulton!
|
|
8
|
+
|
|
9
|
+
## 0.10.20
|
|
10
|
+
|
|
11
|
+
### Dependency updates
|
|
12
|
+
|
|
13
|
+
- @gradio/client@1.19.1
|
|
14
|
+
|
|
15
|
+
## 0.10.20
|
|
16
|
+
|
|
17
|
+
### Fixes
|
|
18
|
+
|
|
19
|
+
- [#11937](https://github.com/gradio-app/gradio/pull/11937) [`1b97ed7`](https://github.com/gradio-app/gradio/commit/1b97ed760c6adc6f7eef613904b90a0bfd0e9970) - Fix bug where multimodaltextbox would focus on any app update. Thanks @freddyaboulton!
|
|
20
|
+
|
|
21
|
+
### Dependency updates
|
|
22
|
+
|
|
23
|
+
- @gradio/image@0.23.1
|
|
24
|
+
- @gradio/upload@0.17.1
|
|
25
|
+
- @gradio/atoms@0.18.1
|
|
26
|
+
|
|
3
27
|
## 0.10.19
|
|
4
28
|
|
|
5
29
|
### Fixes
|
package/Index.svelte
CHANGED
|
@@ -107,6 +107,24 @@
|
|
|
107
107
|
trim_region_settings.color || color_accent
|
|
108
108
|
);
|
|
109
109
|
}
|
|
110
|
+
|
|
111
|
+
// Create const references to the callbacks so that afterUpdate in child is not called on every prop change
|
|
112
|
+
// in the DOM. See https://github.com/gradio-app/gradio/issues/11933
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
114
|
+
const upload_fn = (...args: Parameters<typeof gradio.client.upload>) =>
|
|
115
|
+
gradio.client.upload(...args);
|
|
116
|
+
const i18n = (s: string | null | undefined): string => gradio.i18n(s);
|
|
117
|
+
const stream_handler_fn = (
|
|
118
|
+
...args: Parameters<typeof gradio.client.stream>
|
|
119
|
+
): EventSource => gradio.client.stream(...args);
|
|
120
|
+
|
|
121
|
+
$: sources_string = sources.join(",") as
|
|
122
|
+
| "upload"
|
|
123
|
+
| "upload,microphone"
|
|
124
|
+
| "microphone"
|
|
125
|
+
| "microphone,upload";
|
|
126
|
+
|
|
127
|
+
$: file_types_string = (file_types || []).join(",") || null;
|
|
110
128
|
</script>
|
|
111
129
|
|
|
112
130
|
<Block
|
|
@@ -133,7 +151,7 @@
|
|
|
133
151
|
bind:value_is_output
|
|
134
152
|
bind:dragging
|
|
135
153
|
bind:active_source
|
|
136
|
-
{
|
|
154
|
+
{file_types_string}
|
|
137
155
|
{root}
|
|
138
156
|
{label}
|
|
139
157
|
{info}
|
|
@@ -142,7 +160,7 @@
|
|
|
142
160
|
{rtl}
|
|
143
161
|
{text_align}
|
|
144
162
|
{waveform_settings}
|
|
145
|
-
|
|
163
|
+
{i18n}
|
|
146
164
|
max_lines={!max_lines ? lines + 1 : max_lines}
|
|
147
165
|
{placeholder}
|
|
148
166
|
{submit_btn}
|
|
@@ -150,7 +168,7 @@
|
|
|
150
168
|
{autofocus}
|
|
151
169
|
{autoscroll}
|
|
152
170
|
{file_count}
|
|
153
|
-
{
|
|
171
|
+
{sources_string}
|
|
154
172
|
max_file_size={gradio.max_file_size}
|
|
155
173
|
on:change={() => gradio.dispatch("change", value)}
|
|
156
174
|
on:input={() => gradio.dispatch("input")}
|
|
@@ -168,8 +186,8 @@
|
|
|
168
186
|
on:upload={(e) => gradio.dispatch("upload", e.detail)}
|
|
169
187
|
on:clear={() => gradio.dispatch("clear")}
|
|
170
188
|
disabled={!interactive}
|
|
171
|
-
upload={
|
|
172
|
-
stream_handler={
|
|
189
|
+
upload={upload_fn}
|
|
190
|
+
stream_handler={stream_handler_fn}
|
|
173
191
|
{max_plain_text_length}
|
|
174
192
|
{html_attributes}
|
|
175
193
|
/>
|
package/dist/Index.svelte
CHANGED
|
@@ -77,6 +77,11 @@ function set_trim_region_colour() {
|
|
|
77
77
|
trim_region_settings.color || color_accent
|
|
78
78
|
);
|
|
79
79
|
}
|
|
80
|
+
const upload_fn = (...args) => gradio.client.upload(...args);
|
|
81
|
+
const i18n = (s) => gradio.i18n(s);
|
|
82
|
+
const stream_handler_fn = (...args) => gradio.client.stream(...args);
|
|
83
|
+
$: sources_string = sources.join(",");
|
|
84
|
+
$: file_types_string = (file_types || []).join(",") || null;
|
|
80
85
|
</script>
|
|
81
86
|
|
|
82
87
|
<Block
|
|
@@ -103,7 +108,7 @@ function set_trim_region_colour() {
|
|
|
103
108
|
bind:value_is_output
|
|
104
109
|
bind:dragging
|
|
105
110
|
bind:active_source
|
|
106
|
-
{
|
|
111
|
+
{file_types_string}
|
|
107
112
|
{root}
|
|
108
113
|
{label}
|
|
109
114
|
{info}
|
|
@@ -112,7 +117,7 @@ function set_trim_region_colour() {
|
|
|
112
117
|
{rtl}
|
|
113
118
|
{text_align}
|
|
114
119
|
{waveform_settings}
|
|
115
|
-
|
|
120
|
+
{i18n}
|
|
116
121
|
max_lines={!max_lines ? lines + 1 : max_lines}
|
|
117
122
|
{placeholder}
|
|
118
123
|
{submit_btn}
|
|
@@ -120,7 +125,7 @@ function set_trim_region_colour() {
|
|
|
120
125
|
{autofocus}
|
|
121
126
|
{autoscroll}
|
|
122
127
|
{file_count}
|
|
123
|
-
{
|
|
128
|
+
{sources_string}
|
|
124
129
|
max_file_size={gradio.max_file_size}
|
|
125
130
|
on:change={() => gradio.dispatch("change", value)}
|
|
126
131
|
on:input={() => gradio.dispatch("input")}
|
|
@@ -138,8 +143,8 @@ function set_trim_region_colour() {
|
|
|
138
143
|
on:upload={(e) => gradio.dispatch("upload", e.detail)}
|
|
139
144
|
on:clear={() => gradio.dispatch("clear")}
|
|
140
145
|
disabled={!interactive}
|
|
141
|
-
upload={
|
|
142
|
-
stream_handler={
|
|
146
|
+
upload={upload_fn}
|
|
147
|
+
stream_handler={stream_handler_fn}
|
|
143
148
|
{max_plain_text_length}
|
|
144
149
|
{html_attributes}
|
|
145
150
|
/>
|
|
@@ -40,7 +40,7 @@ export let autofocus = false;
|
|
|
40
40
|
export let text_align = void 0;
|
|
41
41
|
export let autoscroll = true;
|
|
42
42
|
export let root;
|
|
43
|
-
export let
|
|
43
|
+
export let file_types_string = null;
|
|
44
44
|
export let max_file_size = null;
|
|
45
45
|
export let upload;
|
|
46
46
|
export let stream_handler;
|
|
@@ -50,7 +50,7 @@ export let waveform_settings;
|
|
|
50
50
|
export let waveform_options = {
|
|
51
51
|
show_recording_waveform: true
|
|
52
52
|
};
|
|
53
|
-
export let
|
|
53
|
+
export let sources_string = "upload";
|
|
54
54
|
export let active_source = null;
|
|
55
55
|
export let html_attributes = null;
|
|
56
56
|
let upload_component;
|
|
@@ -62,6 +62,8 @@ export let dragging = false;
|
|
|
62
62
|
let uploading = false;
|
|
63
63
|
let oldValue = value?.text ?? "";
|
|
64
64
|
let recording = false;
|
|
65
|
+
$: sources = sources_string.split(",").map((s) => s.trim()).filter((s) => s === "upload" || s === "microphone");
|
|
66
|
+
$: file_types = file_types_string ? file_types_string.split(",").map((s) => s.trim()) : null;
|
|
65
67
|
$: dispatch("drag", dragging);
|
|
66
68
|
let mic_audio = null;
|
|
67
69
|
let full_container;
|
|
@@ -91,15 +93,15 @@ onMount(() => {
|
|
|
91
93
|
el.focus();
|
|
92
94
|
}
|
|
93
95
|
});
|
|
94
|
-
|
|
96
|
+
const after_update = () => {
|
|
95
97
|
if (can_scroll && autoscroll) {
|
|
96
98
|
scroll();
|
|
97
99
|
}
|
|
98
|
-
if (autofocus && el
|
|
100
|
+
if (autofocus && el) {
|
|
99
101
|
el.focus();
|
|
100
102
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
};
|
|
104
|
+
afterUpdate(after_update);
|
|
103
105
|
function handle_select(event) {
|
|
104
106
|
const target = event.target;
|
|
105
107
|
const text = target.value;
|
|
@@ -25,7 +25,7 @@ declare const __propDef: {
|
|
|
25
25
|
text_align?: "left" | "right" | undefined;
|
|
26
26
|
autoscroll?: boolean;
|
|
27
27
|
root: string;
|
|
28
|
-
|
|
28
|
+
file_types_string?: string | null;
|
|
29
29
|
max_file_size?: number | null;
|
|
30
30
|
upload: Client["upload"];
|
|
31
31
|
stream_handler: Client["stream"];
|
|
@@ -33,7 +33,7 @@ declare const __propDef: {
|
|
|
33
33
|
max_plain_text_length?: number;
|
|
34
34
|
waveform_settings: Record<string, any>;
|
|
35
35
|
waveform_options?: any;
|
|
36
|
-
|
|
36
|
+
sources_string?: "upload" | "upload,microphone" | "microphone" | "microphone,upload";
|
|
37
37
|
active_source?: "microphone" | null;
|
|
38
38
|
html_attributes?: InputHTMLAttributes | null;
|
|
39
39
|
dragging?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/multimodaltextbox",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.21",
|
|
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.18.
|
|
26
|
-
"@gradio/statustracker": "^0.11.1",
|
|
27
|
-
"@gradio/utils": "^0.10.2",
|
|
28
|
-
"@gradio/image": "^0.23.0",
|
|
25
|
+
"@gradio/atoms": "^0.18.1",
|
|
29
26
|
"@gradio/icons": "^0.14.0",
|
|
27
|
+
"@gradio/utils": "^0.10.2",
|
|
28
|
+
"@gradio/statustracker": "^0.11.1",
|
|
29
|
+
"@gradio/upload": "^0.17.1",
|
|
30
|
+
"@gradio/image": "^0.23.1",
|
|
30
31
|
"@gradio/video": "^0.16.0",
|
|
31
|
-
"@gradio/client": "^1.19.
|
|
32
|
-
"@gradio/upload": "^0.17.0"
|
|
32
|
+
"@gradio/client": "^1.19.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@gradio/preview": "^0.14.0"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
export let text_align: "left" | "right" | undefined = undefined;
|
|
49
49
|
export let autoscroll = true;
|
|
50
50
|
export let root: string;
|
|
51
|
-
export let
|
|
51
|
+
export let file_types_string: string | null = null;
|
|
52
52
|
export let max_file_size: number | null = null;
|
|
53
53
|
export let upload: Client["upload"];
|
|
54
54
|
export let stream_handler: Client["stream"];
|
|
@@ -58,7 +58,11 @@
|
|
|
58
58
|
export let waveform_options: WaveformOptions = {
|
|
59
59
|
show_recording_waveform: true
|
|
60
60
|
};
|
|
61
|
-
export let
|
|
61
|
+
export let sources_string:
|
|
62
|
+
| "upload"
|
|
63
|
+
| "upload,microphone"
|
|
64
|
+
| "microphone"
|
|
65
|
+
| "microphone,upload" = "upload";
|
|
62
66
|
export let active_source: "microphone" | null = null;
|
|
63
67
|
export let html_attributes: InputHTMLAttributes | null = null;
|
|
64
68
|
|
|
@@ -72,6 +76,17 @@
|
|
|
72
76
|
// value can be null in multimodalchatinterface when loading a deep link
|
|
73
77
|
let oldValue = value?.text ?? "";
|
|
74
78
|
let recording = false;
|
|
79
|
+
|
|
80
|
+
$: sources = sources_string
|
|
81
|
+
.split(",")
|
|
82
|
+
.map((s) => s.trim())
|
|
83
|
+
.filter((s) => s === "upload" || s === "microphone") as (
|
|
84
|
+
| "upload"
|
|
85
|
+
| "microphone"
|
|
86
|
+
)[];
|
|
87
|
+
$: file_types = file_types_string
|
|
88
|
+
? file_types_string.split(",").map((s) => s.trim())
|
|
89
|
+
: null;
|
|
75
90
|
$: dispatch("drag", dragging);
|
|
76
91
|
let mic_audio: FileData | null = null;
|
|
77
92
|
|
|
@@ -126,15 +141,16 @@
|
|
|
126
141
|
}
|
|
127
142
|
});
|
|
128
143
|
|
|
129
|
-
|
|
144
|
+
const after_update = (): void => {
|
|
130
145
|
if (can_scroll && autoscroll) {
|
|
131
146
|
scroll();
|
|
132
147
|
}
|
|
133
|
-
if (autofocus && el
|
|
148
|
+
if (autofocus && el) {
|
|
134
149
|
el.focus();
|
|
135
150
|
}
|
|
136
|
-
|
|
137
|
-
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
afterUpdate(after_update);
|
|
138
154
|
|
|
139
155
|
function handle_select(event: Event): void {
|
|
140
156
|
const target: HTMLTextAreaElement | HTMLInputElement = event.target as
|