@gradio/multimodaltextbox 0.6.0-beta.5 → 0.6.0-beta.7

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,37 @@
1
1
  # @gradio/multimodaltextbox
2
2
 
3
+ ## 0.6.0-beta.7
4
+
5
+ ### Features
6
+
7
+ - [#9437](https://github.com/gradio-app/gradio/pull/9437) [`c3d93be`](https://github.com/gradio-app/gradio/commit/c3d93bef94b9401747a363f7bad88a1d347d535b) - Adding new themes to Gradio 5.0. Thanks @allisonwhilden!
8
+ - [#9593](https://github.com/gradio-app/gradio/pull/9593) [`cc61fe7`](https://github.com/gradio-app/gradio/commit/cc61fe7047ac61779a61cce52c666400b9517daa) - Some more chatbot fixes. Thanks @dawoodkhan82!
9
+ - [#9583](https://github.com/gradio-app/gradio/pull/9583) [`b92a762`](https://github.com/gradio-app/gradio/commit/b92a7623e1ebd801587041e1ccca058a61058da9) - Disable the submit button and enter-key submit when the text is empty. Thanks @whitphx!
10
+
11
+ ### Dependency updates
12
+
13
+ - @gradio/upload@0.13.0-beta.7
14
+ - @gradio/statustracker@0.8.0-beta.5
15
+ - @gradio/icons@0.8.0-beta.4
16
+ - @gradio/atoms@0.9.0-beta.5
17
+ - @gradio/image@0.16.0-beta.7
18
+ - @gradio/video@0.11.0-beta.7
19
+
20
+ ## 0.6.0-beta.6
21
+
22
+ ### Features
23
+
24
+ - [#9521](https://github.com/gradio-app/gradio/pull/9521) [`06ef22e`](https://github.com/gradio-app/gradio/commit/06ef22e83cdd27e7afb381396d153d9db3dea16e) - Allow `info=` to render markdown. Thanks @dawoodkhan82!
25
+
26
+ ### Dependency updates
27
+
28
+ - @gradio/video@0.11.0-beta.6
29
+ - @gradio/statustracker@0.8.0-beta.4
30
+ - @gradio/atoms@0.9.0-beta.4
31
+ - @gradio/client@1.6.0-beta.4
32
+ - @gradio/upload@0.13.0-beta.6
33
+ - @gradio/image@0.16.0-beta.6
34
+
3
35
  ## 0.6.0-beta.5
4
36
 
5
37
  ### Dependency updates
@@ -64,6 +64,8 @@ $:
64
64
  value = { text: "", files: [] };
65
65
  $:
66
66
  value, el && lines !== max_lines && resize(el, lines, max_lines);
67
+ $:
68
+ can_submit = value.text !== "" || value.files.length > 0;
67
69
  const dispatch = createEventDispatcher();
68
70
  beforeUpdate(() => {
69
71
  can_scroll = el && el.offsetHeight + el.scrollTop > el.scrollHeight - 100;
@@ -101,10 +103,14 @@ async function handle_keypress(e) {
101
103
  await tick();
102
104
  if (e.key === "Enter" && e.shiftKey && lines > 1) {
103
105
  e.preventDefault();
104
- dispatch("submit");
106
+ if (can_submit) {
107
+ dispatch("submit");
108
+ }
105
109
  } else if (e.key === "Enter" && !e.shiftKey && lines === 1 && max_lines >= 1) {
106
110
  e.preventDefault();
107
- dispatch("submit");
111
+ if (can_submit) {
112
+ dispatch("submit");
113
+ }
108
114
  }
109
115
  }
110
116
  function handle_scroll(event) {
@@ -202,7 +208,7 @@ function handle_drop(event) {
202
208
  >
203
209
  <!-- svelte-ignore a11y-autofocus -->
204
210
  <label class:container>
205
- <BlockTitle {show_label} {info}>{label}</BlockTitle>
211
+ <BlockTitle {root} {show_label} {info}>{label}</BlockTitle>
206
212
  {#if value.files.length > 0 || uploading}
207
213
  <div
208
214
  class="thumbnails scroll-hide"
@@ -296,6 +302,7 @@ function handle_drop(event) {
296
302
  class="submit-button"
297
303
  class:padded-button={submit_btn !== true}
298
304
  on:click={handle_submit}
305
+ disabled={!can_submit}
299
306
  >
300
307
  {#if submit_btn === true}
301
308
  <Send />
@@ -346,7 +353,7 @@ function handle_drop(event) {
346
353
  textarea {
347
354
  flex-grow: 1;
348
355
  outline: none !important;
349
- background: var(--input-background-fill);
356
+ background: var(--block-background-fill);
350
357
  padding: var(--input-padding);
351
358
  color: var(--body-text-color);
352
359
  font-weight: var(--input-text-weight);
@@ -406,10 +413,11 @@ function handle_drop(event) {
406
413
  background: var(--button-secondary-background-fill-hover);
407
414
  }
408
415
 
409
- .stop-button:active,
410
- .upload-button:active,
411
- .submit-button:active {
412
- box-shadow: var(--button-shadow-active);
416
+ .stop-button:disabled,
417
+ .upload-button:disabled,
418
+ .submit-button:disabled {
419
+ background: var(--button-secondary-background-fill);
420
+ cursor: initial;
413
421
  }
414
422
 
415
423
  .submit-button :global(svg) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/multimodaltextbox",
3
- "version": "0.6.0-beta.5",
3
+ "version": "0.6.0-beta.7",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
@@ -22,17 +22,17 @@
22
22
  "./package.json": "./package.json"
23
23
  },
24
24
  "dependencies": {
25
- "@gradio/atoms": "^0.9.0-beta.3",
26
- "@gradio/statustracker": "^0.8.0-beta.3",
25
+ "@gradio/atoms": "^0.9.0-beta.5",
26
+ "@gradio/icons": "^0.8.0-beta.4",
27
+ "@gradio/statustracker": "^0.8.0-beta.5",
27
28
  "@gradio/utils": "^0.7.0-beta.2",
28
- "@gradio/upload": "^0.13.0-beta.5",
29
- "@gradio/image": "^0.16.0-beta.5",
30
- "@gradio/video": "^0.11.0-beta.5",
31
- "@gradio/icons": "^0.8.0-beta.3",
32
- "@gradio/client": "^1.6.0-beta.3"
29
+ "@gradio/upload": "^0.13.0-beta.7",
30
+ "@gradio/image": "^0.16.0-beta.7",
31
+ "@gradio/client": "^1.6.0-beta.4",
32
+ "@gradio/video": "^0.11.0-beta.7"
33
33
  },
34
34
  "devDependencies": {
35
- "@gradio/preview": "^0.11.2-beta.0"
35
+ "@gradio/preview": "^0.12.0-beta.1"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "svelte": "^4.0.0"
@@ -68,6 +68,7 @@
68
68
 
69
69
  $: if (value === null) value = { text: "", files: [] };
70
70
  $: value, el && lines !== max_lines && resize(el, lines, max_lines);
71
+ $: can_submit = value.text !== "" || value.files.length > 0;
71
72
 
72
73
  const dispatch = createEventDispatcher<{
73
74
  change: typeof value;
@@ -127,7 +128,9 @@
127
128
  await tick();
128
129
  if (e.key === "Enter" && e.shiftKey && lines > 1) {
129
130
  e.preventDefault();
130
- dispatch("submit");
131
+ if (can_submit) {
132
+ dispatch("submit");
133
+ }
131
134
  } else if (
132
135
  e.key === "Enter" &&
133
136
  !e.shiftKey &&
@@ -135,7 +138,9 @@
135
138
  max_lines >= 1
136
139
  ) {
137
140
  e.preventDefault();
138
- dispatch("submit");
141
+ if (can_submit) {
142
+ dispatch("submit");
143
+ }
139
144
  }
140
145
  }
141
146
 
@@ -247,7 +252,7 @@
247
252
  >
248
253
  <!-- svelte-ignore a11y-autofocus -->
249
254
  <label class:container>
250
- <BlockTitle {show_label} {info}>{label}</BlockTitle>
255
+ <BlockTitle {root} {show_label} {info}>{label}</BlockTitle>
251
256
  {#if value.files.length > 0 || uploading}
252
257
  <div
253
258
  class="thumbnails scroll-hide"
@@ -341,6 +346,7 @@
341
346
  class="submit-button"
342
347
  class:padded-button={submit_btn !== true}
343
348
  on:click={handle_submit}
349
+ disabled={!can_submit}
344
350
  >
345
351
  {#if submit_btn === true}
346
352
  <Send />
@@ -391,7 +397,7 @@
391
397
  textarea {
392
398
  flex-grow: 1;
393
399
  outline: none !important;
394
- background: var(--input-background-fill);
400
+ background: var(--block-background-fill);
395
401
  padding: var(--input-padding);
396
402
  color: var(--body-text-color);
397
403
  font-weight: var(--input-text-weight);
@@ -451,10 +457,11 @@
451
457
  background: var(--button-secondary-background-fill-hover);
452
458
  }
453
459
 
454
- .stop-button:active,
455
- .upload-button:active,
456
- .submit-button:active {
457
- box-shadow: var(--button-shadow-active);
460
+ .stop-button:disabled,
461
+ .upload-button:disabled,
462
+ .submit-button:disabled {
463
+ background: var(--button-secondary-background-fill);
464
+ cursor: initial;
458
465
  }
459
466
 
460
467
  .submit-button :global(svg) {