@gradio/multimodaltextbox 0.3.0 → 0.4.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,44 @@
1
1
  # @gradio/multimodaltextbox
2
2
 
3
+ ## 0.4.1
4
+
5
+ ### Features
6
+
7
+ - [#8236](https://github.com/gradio-app/gradio/pull/8236) [`bf909bd`](https://github.com/gradio-app/gradio/commit/bf909bd14532a27e119fb401003a7d94c0618ffb) - Change upload icon for MultimodalTextbox. Thanks @dawoodkhan82!
8
+
9
+ ### Fixes
10
+
11
+ - [#8252](https://github.com/gradio-app/gradio/pull/8252) [`22df61a`](https://github.com/gradio-app/gradio/commit/22df61a26adf8023f6dd49c051979990e8d3879a) - Client node fix. Thanks @pngwn!
12
+
13
+ ### Dependency updates
14
+
15
+ - @gradio/atoms@0.7.3
16
+ - @gradio/statustracker@0.5.2
17
+ - @gradio/client@0.19.0
18
+ - @gradio/icons@0.4.1
19
+ - @gradio/image@0.11.1
20
+ - @gradio/upload@0.10.1
21
+
22
+ ## 0.4.0
23
+
24
+ ### Features
25
+
26
+ - [#8121](https://github.com/gradio-app/gradio/pull/8121) [`f5b710c`](https://github.com/gradio-app/gradio/commit/f5b710c919b0ce604ea955f0d5f4faa91095ca4a) - chore(deps): update dependency eslint to v9. Thanks @renovate!
27
+ - [#8209](https://github.com/gradio-app/gradio/pull/8209) [`b9afe93`](https://github.com/gradio-app/gradio/commit/b9afe93915401df5bd6737c89395c2477acfa585) - Rename `eventSource_Factory` and `fetch_implementation`. Thanks @hannahblair!
28
+
29
+ ### Fixes
30
+
31
+ - [#8179](https://github.com/gradio-app/gradio/pull/8179) [`6a218b4`](https://github.com/gradio-app/gradio/commit/6a218b4148095aaa0c58d8c20973ba01c8764fc2) - rework upload to be a class method + pass client into each component. Thanks @pngwn!
32
+
33
+ ### Dependency updates
34
+
35
+ - @gradio/atoms@0.7.2
36
+ - @gradio/client@0.18.0
37
+ - @gradio/upload@0.10.0
38
+ - @gradio/utils@0.4.1
39
+ - @gradio/statustracker@0.5.1
40
+ - @gradio/image@0.11.0
41
+
3
42
  ## 0.3.0
4
43
 
5
44
  ### Highlights
package/Index.svelte CHANGED
@@ -97,5 +97,7 @@
97
97
  gradio.dispatch("error", detail);
98
98
  }}
99
99
  disabled={!interactive}
100
+ upload={gradio.client.upload}
101
+ stream_handler={gradio.client.stream}
100
102
  />
101
103
  </Block>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/multimodaltextbox",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
@@ -14,15 +14,15 @@
14
14
  "./package.json": "./package.json"
15
15
  },
16
16
  "dependencies": {
17
- "@gradio/atoms": "^0.7.1",
18
- "@gradio/icons": "^0.4.0",
19
- "@gradio/statustracker": "^0.5.0",
20
- "@gradio/upload": "^0.9.0",
21
- "@gradio/utils": "^0.4.0",
22
- "@gradio/client": "^0.17.0",
23
- "@gradio/image": "^0.10.0"
17
+ "@gradio/icons": "^0.4.1",
18
+ "@gradio/atoms": "^0.7.3",
19
+ "@gradio/statustracker": "^0.5.2",
20
+ "@gradio/utils": "^0.4.1",
21
+ "@gradio/image": "^0.11.1",
22
+ "@gradio/upload": "^0.10.1",
23
+ "@gradio/client": "^0.19.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@gradio/preview": "^0.8.0"
26
+ "@gradio/preview": "^0.9.0"
27
27
  }
28
28
  }
@@ -9,8 +9,8 @@
9
9
  import { BlockTitle } from "@gradio/atoms";
10
10
  import { Upload } from "@gradio/upload";
11
11
  import { Image } from "@gradio/image/shared";
12
- import type { FileData, upload } from "@gradio/client";
13
- import { Clear, File, Music, Video, Send } from "@gradio/icons";
12
+ import type { FileData, Client } from "@gradio/client";
13
+ import { Clear, File, Music, Paperclip, Video, Send } from "@gradio/icons";
14
14
  import type { SelectData } from "@gradio/utils";
15
15
 
16
16
  export let value: { text: string; files: FileData[] } = {
@@ -35,6 +35,8 @@
35
35
  export let root: string;
36
36
  export let file_types: string[] | null = null;
37
37
  export let max_file_size: number | null = null;
38
+ export let upload: Client["upload"];
39
+ export let stream_handler: Client["stream"];
38
40
 
39
41
  let upload_component: Upload;
40
42
  let hidden_upload: HTMLInputElement;
@@ -215,6 +217,8 @@
215
217
  disable_click={true}
216
218
  bind:hidden_upload
217
219
  on:error
220
+ {upload}
221
+ {stream_handler}
218
222
  >
219
223
  {#if submit_btn !== null}
220
224
  <button class:disabled class="submit-button" on:click={handle_submit}
@@ -225,8 +229,10 @@
225
229
  ><Send /></button
226
230
  >
227
231
  {/if}
228
- <button class:disabled class="plus-button" on:click={handle_upload_click}
229
- >+</button
232
+ <button
233
+ data-testid="upload-button"
234
+ class="upload-button"
235
+ on:click={handle_upload_click}><Paperclip /></button
230
236
  >
231
237
  {#if value.files.length > 0 || uploading}
232
238
  <div
@@ -333,7 +339,7 @@
333
339
  color: var(--input-placeholder-color);
334
340
  }
335
341
 
336
- .plus-button,
342
+ .upload-button,
337
343
  .submit-button {
338
344
  position: absolute;
339
345
  background: var(--button-secondary-background-fill);
@@ -349,12 +355,12 @@
349
355
  bottom: 15px;
350
356
  }
351
357
 
352
- .plus-button:hover,
358
+ .upload-button:hover,
353
359
  .submit-button:hover {
354
360
  background: var(--button-secondary-background-fill-hover);
355
361
  }
356
362
 
357
- .plus-button:active,
363
+ .upload-button:active,
358
364
  .submit-button:active {
359
365
  box-shadow: var(--button-shadow-active);
360
366
  }
@@ -373,11 +379,17 @@
373
379
  padding-top: 2px;
374
380
  }
375
381
 
376
- .plus-button {
382
+ .upload-button {
377
383
  left: 10px;
378
384
  margin-right: 5px;
379
385
  }
380
386
 
387
+ .upload-button :global(svg) {
388
+ height: 23px;
389
+ width: 23px;
390
+ padding-left: 7px;
391
+ }
392
+
381
393
  .loader {
382
394
  display: flex;
383
395
  justify-content: center;
package/shared/utils.ts CHANGED
@@ -18,8 +18,8 @@ export async function resize(
18
18
  max_lines === undefined
19
19
  ? false
20
20
  : max_lines === undefined // default
21
- ? 21 * 11
22
- : 21 * (max_lines + 1);
21
+ ? 21 * 11
22
+ : 21 * (max_lines + 1);
23
23
  let min = 21 * (lines + 1);
24
24
 
25
25
  target.style.height = "1px";