@gradio/code 0.14.6 → 0.14.8
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 +20 -0
- package/Example.svelte +8 -1
- package/dist/Example.svelte +9 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,25 @@
|
|
1
1
|
# @gradio/code
|
2
2
|
|
3
|
+
## 0.14.8
|
4
|
+
|
5
|
+
### Dependency updates
|
6
|
+
|
7
|
+
- @gradio/statustracker@0.10.13
|
8
|
+
- @gradio/atoms@0.16.2
|
9
|
+
- @gradio/upload@0.16.8
|
10
|
+
|
11
|
+
## 0.14.7
|
12
|
+
|
13
|
+
### Dependency updates
|
14
|
+
|
15
|
+
- @gradio/statustracker@0.10.12
|
16
|
+
|
17
|
+
## 0.14.7
|
18
|
+
|
19
|
+
### Features
|
20
|
+
|
21
|
+
- [#11380](https://github.com/gradio-app/gradio/pull/11380) [`0b2b6cb`](https://github.com/gradio-app/gradio/commit/0b2b6cbd44562a2f5843af872fe6761c5f255185) - Truncate textbox examples to 70 chars. Thanks @hannahblair!
|
22
|
+
|
3
23
|
## 0.14.6
|
4
24
|
|
5
25
|
### Dependency updates
|
package/Example.svelte
CHANGED
@@ -2,12 +2,19 @@
|
|
2
2
|
export let value: string | null;
|
3
3
|
export let type: "gallery" | "table";
|
4
4
|
export let selected = false;
|
5
|
+
|
6
|
+
function truncate_text(text: string | null, max_length = 60): string {
|
7
|
+
if (!text) return "";
|
8
|
+
const str = String(text);
|
9
|
+
if (str.length <= max_length) return str;
|
10
|
+
return str.slice(0, max_length) + "...";
|
11
|
+
}
|
5
12
|
</script>
|
6
13
|
|
7
14
|
<pre
|
8
15
|
class:table={type === "table"}
|
9
16
|
class:gallery={type === "gallery"}
|
10
|
-
class:selected>{value
|
17
|
+
class:selected>{truncate_text(value)}</pre>
|
11
18
|
|
12
19
|
<style>
|
13
20
|
pre {
|
package/dist/Example.svelte
CHANGED
@@ -1,12 +1,20 @@
|
|
1
1
|
<script>export let value;
|
2
2
|
export let type;
|
3
3
|
export let selected = false;
|
4
|
+
function truncate_text(text, max_length = 60) {
|
5
|
+
if (!text)
|
6
|
+
return "";
|
7
|
+
const str = String(text);
|
8
|
+
if (str.length <= max_length)
|
9
|
+
return str;
|
10
|
+
return str.slice(0, max_length) + "...";
|
11
|
+
}
|
4
12
|
</script>
|
5
13
|
|
6
14
|
<pre
|
7
15
|
class:table={type === "table"}
|
8
16
|
class:gallery={type === "gallery"}
|
9
|
-
class:selected>{value
|
17
|
+
class:selected>{truncate_text(value)}</pre>
|
10
18
|
|
11
19
|
<style>
|
12
20
|
pre {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@gradio/code",
|
3
|
-
"version": "0.14.
|
3
|
+
"version": "0.14.8",
|
4
4
|
"description": "Gradio UI packages",
|
5
5
|
"type": "module",
|
6
6
|
"author": "",
|
@@ -27,12 +27,12 @@
|
|
27
27
|
"cm6-theme-basic-dark": "^0.2.0",
|
28
28
|
"cm6-theme-basic-light": "^0.2.0",
|
29
29
|
"codemirror": "^6.0.1",
|
30
|
-
"@gradio/atoms": "^0.16.
|
31
|
-
"@gradio/statustracker": "^0.10.
|
32
|
-
"@gradio/upload": "^0.16.
|
30
|
+
"@gradio/atoms": "^0.16.2",
|
31
|
+
"@gradio/statustracker": "^0.10.13",
|
32
|
+
"@gradio/upload": "^0.16.8",
|
33
|
+
"@gradio/icons": "^0.12.0",
|
33
34
|
"@gradio/utils": "^0.10.2",
|
34
|
-
"@gradio/wasm": "^0.18.1"
|
35
|
-
"@gradio/icons": "^0.12.0"
|
35
|
+
"@gradio/wasm": "^0.18.1"
|
36
36
|
},
|
37
37
|
"main_changeset": true,
|
38
38
|
"main": "./Index.svelte",
|
@@ -50,7 +50,7 @@
|
|
50
50
|
"./package.json": "./package.json"
|
51
51
|
},
|
52
52
|
"devDependencies": {
|
53
|
-
"@gradio/preview": "^0.13.
|
53
|
+
"@gradio/preview": "^0.13.2"
|
54
54
|
},
|
55
55
|
"peerDependencies": {
|
56
56
|
"svelte": "^4.0.0"
|