@gradio/multimodaltextbox 0.12.0 → 0.14.0

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,39 @@
1
1
  # @gradio/multimodaltextbox
2
2
 
3
+ ## 0.14.0
4
+
5
+ ### Features
6
+
7
+ - [#13543](https://github.com/gradio-app/gradio/pull/13543) [`0533483`](https://github.com/gradio-app/gradio/commit/0533483bccdee38f334a598f18297e8c02966343) - Migrate Image components to Svelte 5. Thanks @dawoodkhan82!
8
+
9
+ ### Dependency updates
10
+
11
+ - @gradio/statustracker@0.15.1
12
+ - @gradio/icons@0.16.0
13
+ - @gradio/atoms@0.26.0
14
+ - @gradio/image@0.28.0
15
+ - @gradio/video@0.22.0
16
+ - @gradio/client@2.3.1
17
+ - @gradio/upload@0.18.1
18
+ - @gradio/audio@0.24.1
19
+
20
+ ## 0.13.0
21
+
22
+ ### Features
23
+
24
+ - [#13526](https://github.com/gradio-app/gradio/pull/13526) [`53cb4ca`](https://github.com/gradio-app/gradio/commit/53cb4cae1ec3521e9170d12867253516413ba37a) - Run `pnpm lint` and `pnpm ts:check` on CI. Thanks @abidlabs!
25
+
26
+ ### Dependency updates
27
+
28
+ - @gradio/atoms@0.25.0
29
+ - @gradio/statustracker@0.15.0
30
+ - @gradio/utils@0.13.0
31
+ - @gradio/client@2.3.0
32
+ - @gradio/upload@0.18.0
33
+ - @gradio/image@0.27.0
34
+ - @gradio/video@0.21.0
35
+ - @gradio/audio@0.24.0
36
+
3
37
  ## 0.12.0
4
38
 
5
39
  ### Features
package/Index.svelte CHANGED
@@ -91,7 +91,7 @@
91
91
 
92
92
  // Create const references to the callbacks so that afterUpdate in child is not called on every prop change
93
93
  // in the DOM. See https://github.com/gradio-app/gradio/issues/11933
94
- // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
94
+
95
95
  const upload_fn = (...args: Parameters<typeof gradio.shared.client.upload>) =>
96
96
  gradio.shared.client.upload(...args);
97
97
  const i18n = (s: string | null | undefined): string => gradio.i18n(s);
@@ -81,29 +81,6 @@
81
81
  }}
82
82
  {template}
83
83
  />
84
- <Story
85
- name="MultimodalTextbox with 5 lines and max 5 lines"
86
- args={{
87
- lines: 5,
88
- max_lines: 5,
89
- sources: ["upload", "microphone"],
90
- file_types: [],
91
- value: { text: "", files: [] }
92
- }}
93
- {template}
94
- />
95
- <Story
96
- name="Right aligned textbox"
97
- args={{
98
- text_align: "right",
99
- sources: ["upload", "microphone"],
100
- file_types: [],
101
- lines: 1,
102
- max_lines: 5,
103
- value: { text: "", files: [] }
104
- }}
105
- {template}
106
- />
107
84
  <Story
108
85
  name="Single file upload"
109
86
  args={{
@@ -3,7 +3,7 @@ import { cleanup, render } from "@self/tootils/render";
3
3
  import event from "@testing-library/user-event";
4
4
 
5
5
  import MultimodalTextbox from "./Index.svelte";
6
- import type { LoadingStatus } from "@gradio/statustracker";
6
+ import type { ILoadingStatus as LoadingStatus } from "@gradio/statustracker";
7
7
 
8
8
  const loading_status: LoadingStatus = {
9
9
  eta: 0,
@@ -18,14 +18,3 @@
18
18
  <MultimodalTextbox {...args} />
19
19
  {/snippet}
20
20
  </Story>
21
-
22
- <Story
23
- name="Empty Value"
24
- args={{
25
- value: { text: "", files: [] }
26
- }}
27
- >
28
- {#snippet template(args)}
29
- <MultimodalTextbox {...args} />
30
- {/snippet}
31
- </Story>
package/dist/Index.svelte CHANGED
@@ -91,7 +91,7 @@
91
91
 
92
92
  // Create const references to the callbacks so that afterUpdate in child is not called on every prop change
93
93
  // in the DOM. See https://github.com/gradio-app/gradio/issues/11933
94
- // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
94
+
95
95
  const upload_fn = (...args: Parameters<typeof gradio.shared.client.upload>) =>
96
96
  gradio.shared.client.upload(...args);
97
97
  const i18n = (s: string | null | undefined): string => gradio.i18n(s);
@@ -26,7 +26,10 @@
26
26
  import type { InputHTMLAttributes } from "./types";
27
27
 
28
28
  let {
29
- value = $bindable(),
29
+ value = $bindable<{ text: string; files: FileData[] }>({
30
+ text: "",
31
+ files: []
32
+ }),
30
33
  value_is_output = false,
31
34
  lines = 1,
32
35
  i18n: _i18n,
@@ -28,8 +28,12 @@ export async function resize(target, lines, max_lines) {
28
28
  function update_scrollbar_visibility(textarea) {
29
29
  const content_height = textarea.scrollHeight;
30
30
  const visible_height = textarea.clientHeight;
31
- const line_height = parseFloat(window.getComputedStyle(textarea).lineHeight);
32
- if (content_height > visible_height + line_height) {
31
+ const computed_style = window.getComputedStyle(textarea);
32
+ const line_height = parseFloat(computed_style.lineHeight);
33
+ const threshold = Number.isFinite(line_height)
34
+ ? line_height
35
+ : parseFloat(computed_style.fontSize) * 1.2;
36
+ if (content_height > visible_height + threshold) {
33
37
  textarea.style.overflowY = "scroll";
34
38
  }
35
39
  else {
package/dist/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { FileData } from "@gradio/client";
2
2
  import type { SelectData } from "@gradio/utils";
3
- import type { LoadingStatus } from "@gradio/statustracker";
3
+ import type { ILoadingStatus as LoadingStatus } from "@gradio/statustracker";
4
4
  import type { InputHTMLAttributes } from "./shared/types";
5
5
  import type { WaveformOptions } from "js/audio/shared/types";
6
6
  export interface MultimodalTextboxEvents {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/multimodaltextbox",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
@@ -22,15 +22,15 @@
22
22
  "./package.json": "./package.json"
23
23
  },
24
24
  "dependencies": {
25
- "@gradio/icons": "^0.15.1",
26
- "@gradio/atoms": "^0.24.0",
27
- "@gradio/utils": "^0.12.2",
28
- "@gradio/statustracker": "^0.14.1",
29
- "@gradio/upload": "^0.17.10",
30
- "@gradio/client": "^2.2.2",
31
- "@gradio/video": "^0.20.9",
32
- "@gradio/image": "^0.26.3",
33
- "@gradio/audio": "^0.23.4"
25
+ "@gradio/atoms": "^0.26.0",
26
+ "@gradio/icons": "^0.16.0",
27
+ "@gradio/statustracker": "^0.15.1",
28
+ "@gradio/utils": "^0.13.0",
29
+ "@gradio/image": "^0.28.0",
30
+ "@gradio/video": "^0.22.0",
31
+ "@gradio/upload": "^0.18.1",
32
+ "@gradio/client": "^2.3.1",
33
+ "@gradio/audio": "^0.24.1"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@gradio/preview": "^0.16.2"
@@ -26,7 +26,10 @@
26
26
  import type { InputHTMLAttributes } from "./types";
27
27
 
28
28
  let {
29
- value = $bindable(),
29
+ value = $bindable<{ text: string; files: FileData[] }>({
30
+ text: "",
31
+ files: []
32
+ }),
30
33
  value_is_output = false,
31
34
  lines = 1,
32
35
  i18n: _i18n,
package/shared/utils.ts CHANGED
@@ -45,8 +45,12 @@ function update_scrollbar_visibility(
45
45
  ): void {
46
46
  const content_height = textarea.scrollHeight;
47
47
  const visible_height = textarea.clientHeight;
48
- const line_height = parseFloat(window.getComputedStyle(textarea).lineHeight);
49
- if (content_height > visible_height + line_height) {
48
+ const computed_style = window.getComputedStyle(textarea);
49
+ const line_height = parseFloat(computed_style.lineHeight);
50
+ const threshold = Number.isFinite(line_height)
51
+ ? line_height
52
+ : parseFloat(computed_style.fontSize) * 1.2;
53
+ if (content_height > visible_height + threshold) {
50
54
  textarea.style.overflowY = "scroll";
51
55
  } else {
52
56
  textarea.style.overflowY = "hidden";
package/types.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { FileData } from "@gradio/client";
2
2
  import type { SelectData } from "@gradio/utils";
3
- import type { LoadingStatus } from "@gradio/statustracker";
3
+ import type { ILoadingStatus as LoadingStatus } from "@gradio/statustracker";
4
4
  import type { InputHTMLAttributes } from "./shared/types";
5
5
  import type { WaveformOptions } from "js/audio/shared/types";
6
6