@gradio/multimodaltextbox 0.10.17 → 0.10.19

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,49 @@
1
1
  # @gradio/multimodaltextbox
2
2
 
3
+ ## 0.10.19
4
+
5
+ ### Fixes
6
+
7
+ - [#11784](https://github.com/gradio-app/gradio/pull/11784) [`d9dd3f5`](https://github.com/gradio-app/gradio/commit/d9dd3f54b7fb34cf7118e549d39fc63937ca3489) - Add "hidden" option to component's `visible` kwarg to render but visually hide the component. Thanks @pngwn!
8
+
9
+ ### Dependency updates
10
+
11
+ - @gradio/statustracker@0.11.1
12
+ - @gradio/atoms@0.18.0
13
+ - @gradio/client@1.19.0
14
+ - @gradio/upload@0.17.0
15
+ - @gradio/image@0.23.0
16
+ - @gradio/video@0.16.0
17
+
18
+ ## 0.10.18
19
+
20
+ ### Fixes
21
+
22
+ - [#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!
23
+
24
+ ### Dependency updates
25
+
26
+ - @gradio/client@1.18.0
27
+ - @gradio/icons@0.14.0
28
+ - @gradio/atoms@0.17.0
29
+ - @gradio/statustracker@0.11.0
30
+ - @gradio/upload@0.16.17
31
+ - @gradio/image@0.22.18
32
+ - @gradio/video@0.15.1
33
+
34
+ ## 0.10.17
35
+
36
+ ### Dependency updates
37
+
38
+ - @gradio/statustracker@0.10.18
39
+
40
+ ## 0.10.17
41
+
42
+ ### Dependency updates
43
+
44
+ - @gradio/icons@0.13.1
45
+ - @gradio/upload@0.16.16
46
+
3
47
  ## 0.10.17
4
48
 
5
49
  ### Dependency updates
package/Index.svelte CHANGED
@@ -34,7 +34,7 @@
34
34
  }>;
35
35
  export let elem_id = "";
36
36
  export let elem_classes: string[] = [];
37
- export let visible = true;
37
+ export let visible: boolean | "hidden" = true;
38
38
  export let value: { text: string; files: FileData[] } = {
39
39
  text: "",
40
40
  files: []
@@ -5,14 +5,16 @@ declare const __propDef: {
5
5
  value?: {
6
6
  text: string;
7
7
  files: FileData[];
8
- } | undefined;
8
+ };
9
9
  type: "gallery" | "table";
10
- selected?: boolean | undefined;
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
- waveform_settings = {
59
- height: 50,
60
- barWidth: 2,
61
- barGap: 3,
62
- cursorWidth: 2,
63
- cursorColor: "#ddd5e9",
64
- autoplay: false,
65
- barRadius: 10,
66
- dragToSeek: true,
67
- normalize: true,
68
- minPxPerSec: 20
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,
@@ -26,35 +26,35 @@ declare const __propDef: {
26
26
  upload: FileData[] | FileData;
27
27
  clear: undefined;
28
28
  }>;
29
- elem_id?: string | undefined;
30
- elem_classes?: string[] | undefined;
31
- visible?: boolean | undefined;
29
+ elem_id?: string;
30
+ elem_classes?: string[];
31
+ visible?: boolean | "hidden";
32
32
  value?: {
33
33
  text: string;
34
34
  files: FileData[];
35
- } | undefined;
36
- file_types?: (string[] | null) | undefined;
35
+ };
36
+ file_types?: string[] | null;
37
37
  lines: number;
38
- placeholder?: string | undefined;
39
- label?: string | undefined;
38
+ placeholder?: string;
39
+ label?: string;
40
40
  info?: string | undefined;
41
41
  show_label: boolean;
42
42
  max_lines: number;
43
- scale?: (number | null) | undefined;
43
+ scale?: number | null;
44
44
  min_width?: number | undefined;
45
- submit_btn?: (string | boolean | null) | undefined;
46
- stop_btn?: (string | boolean | null) | undefined;
45
+ submit_btn?: string | boolean | null;
46
+ stop_btn?: string | boolean | null;
47
47
  loading_status?: LoadingStatus | undefined;
48
- value_is_output?: boolean | undefined;
49
- rtl?: boolean | undefined;
48
+ value_is_output?: boolean;
49
+ rtl?: boolean;
50
50
  text_align?: "left" | "right" | undefined;
51
- autofocus?: boolean | undefined;
52
- autoscroll?: boolean | undefined;
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"] | undefined;
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;
@@ -112,9 +114,9 @@ export default class Index extends SvelteComponent<IndexProps, IndexEvents, Inde
112
114
  get elem_classes(): string[] | undefined;
113
115
  /**accessor*/
114
116
  set elem_classes(_: string[] | undefined);
115
- get visible(): boolean | undefined;
117
+ get visible(): boolean | "hidden" | undefined;
116
118
  /**accessor*/
117
- set visible(_: boolean | undefined);
119
+ set visible(_: boolean | "hidden" | undefined);
118
120
  get value(): {
119
121
  text: string;
120
122
  files: FileData[];
@@ -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
- if (oldValue !== value.text) {
71
- dispatch("change", value);
72
- oldValue = value.text;
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
- } | undefined;
12
- value_is_output?: boolean | undefined;
13
- lines?: number | undefined;
11
+ };
12
+ value_is_output?: boolean;
13
+ lines?: number;
14
14
  i18n: I18nFormatter;
15
- placeholder?: string | undefined;
16
- disabled?: boolean | undefined;
15
+ placeholder?: string;
16
+ disabled?: boolean;
17
17
  label: string;
18
18
  info?: string | undefined;
19
- show_label?: boolean | undefined;
19
+ show_label?: boolean;
20
20
  max_lines: number;
21
- submit_btn?: (string | boolean | null) | undefined;
22
- stop_btn?: (string | boolean | null) | undefined;
23
- rtl?: boolean | undefined;
24
- autofocus?: boolean | undefined;
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 | undefined;
26
+ autoscroll?: boolean;
27
27
  root: string;
28
- file_types?: (string[] | null) | undefined;
29
- max_file_size?: (number | null) | undefined;
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?: ("single" | "multiple" | "directory") | undefined;
33
- max_plain_text_length?: number | undefined;
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"] | undefined;
37
- active_source?: ("microphone" | null) | undefined;
36
+ sources?: ["microphone" | "upload"];
37
+ active_source?: "microphone" | null;
38
38
  html_attributes?: InputHTMLAttributes | null;
39
- dragging?: boolean | undefined;
39
+ dragging?: boolean;
40
40
  };
41
41
  events: {
42
42
  dragover: DragEvent;
@@ -52,9 +52,9 @@ declare const __propDef: {
52
52
  select: CustomEvent<SelectData>;
53
53
  input: CustomEvent<undefined>;
54
54
  drag: CustomEvent<boolean>;
55
- upload: CustomEvent<FileData | FileData[]>;
55
+ upload: CustomEvent<any>;
56
56
  clear: CustomEvent<undefined>;
57
- load: CustomEvent<FileData | FileData[]>;
57
+ load: CustomEvent<any>;
58
58
  start_recording: CustomEvent<undefined>;
59
59
  pause_recording: CustomEvent<undefined>;
60
60
  stop_recording: CustomEvent<undefined>;
@@ -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.17",
3
+ "version": "0.10.19",
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.16.5",
25
+ "@gradio/atoms": "^0.18.0",
26
+ "@gradio/statustracker": "^0.11.1",
26
27
  "@gradio/utils": "^0.10.2",
27
- "@gradio/statustracker": "^0.10.17",
28
- "@gradio/icons": "^0.13.0",
29
- "@gradio/upload": "^0.16.15",
30
- "@gradio/client": "^1.17.1",
31
- "@gradio/video": "^0.15.0",
32
- "@gradio/image": "^0.22.17"
28
+ "@gradio/image": "^0.23.0",
29
+ "@gradio/icons": "^0.14.0",
30
+ "@gradio/video": "^0.16.0",
31
+ "@gradio/client": "^1.19.0",
32
+ "@gradio/upload": "^0.17.0"
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}