@gradio/code 0.14.15 → 0.14.16
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 +22 -0
- package/dist/Example.svelte +2 -4
- package/dist/Example.svelte.d.ts +3 -1
- package/dist/Index.svelte +1 -2
- package/dist/Index.svelte.d.ts +14 -12
- package/dist/shared/Code.svelte +4 -8
- package/dist/shared/Code.svelte.d.ts +13 -11
- package/dist/shared/Copy.svelte +2 -4
- package/dist/shared/Copy.svelte.d.ts +2 -0
- package/dist/shared/Download.svelte +4 -8
- package/dist/shared/Download.svelte.d.ts +2 -0
- package/dist/shared/Widgets.svelte.d.ts +2 -0
- package/package.json +9 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @gradio/code
|
|
2
2
|
|
|
3
|
+
## 0.14.16
|
|
4
|
+
|
|
5
|
+
### Dependency updates
|
|
6
|
+
|
|
7
|
+
- @gradio/icons@0.14.0
|
|
8
|
+
- @gradio/atoms@0.17.0
|
|
9
|
+
- @gradio/statustracker@0.11.0
|
|
10
|
+
- @gradio/upload@0.16.17
|
|
11
|
+
|
|
12
|
+
## 0.14.15
|
|
13
|
+
|
|
14
|
+
### Dependency updates
|
|
15
|
+
|
|
16
|
+
- @gradio/statustracker@0.10.18
|
|
17
|
+
|
|
18
|
+
## 0.14.15
|
|
19
|
+
|
|
20
|
+
### Dependency updates
|
|
21
|
+
|
|
22
|
+
- @gradio/icons@0.13.1
|
|
23
|
+
- @gradio/upload@0.16.16
|
|
24
|
+
|
|
3
25
|
## 0.14.15
|
|
4
26
|
|
|
5
27
|
### Dependency updates
|
package/dist/Example.svelte
CHANGED
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
export let type;
|
|
3
3
|
export let selected = false;
|
|
4
4
|
function truncate_text(text, max_length = 60) {
|
|
5
|
-
if (!text)
|
|
6
|
-
return "";
|
|
5
|
+
if (!text) return "";
|
|
7
6
|
const str = String(text);
|
|
8
|
-
if (str.length <= max_length)
|
|
9
|
-
return str;
|
|
7
|
+
if (str.length <= max_length) return str;
|
|
10
8
|
return str.slice(0, max_length) + "...";
|
|
11
9
|
}
|
|
12
10
|
</script>
|
package/dist/Example.svelte.d.ts
CHANGED
|
@@ -3,12 +3,14 @@ declare const __propDef: {
|
|
|
3
3
|
props: {
|
|
4
4
|
value: string | null;
|
|
5
5
|
type: "gallery" | "table";
|
|
6
|
-
selected?: boolean
|
|
6
|
+
selected?: boolean;
|
|
7
7
|
};
|
|
8
8
|
events: {
|
|
9
9
|
[evt: string]: CustomEvent<any>;
|
|
10
10
|
};
|
|
11
11
|
slots: {};
|
|
12
|
+
exports?: {} | undefined;
|
|
13
|
+
bindings?: string | undefined;
|
|
12
14
|
};
|
|
13
15
|
export type ExampleProps = typeof __propDef.props;
|
|
14
16
|
export type ExampleEvents = typeof __propDef.events;
|
package/dist/Index.svelte
CHANGED
package/dist/Index.svelte.d.ts
CHANGED
|
@@ -15,28 +15,30 @@ declare const __propDef: {
|
|
|
15
15
|
focus: never;
|
|
16
16
|
clear_status: LoadingStatus;
|
|
17
17
|
}>;
|
|
18
|
-
value?: string
|
|
19
|
-
value_is_output?: boolean
|
|
20
|
-
language?: string
|
|
21
|
-
lines?: number
|
|
18
|
+
value?: string;
|
|
19
|
+
value_is_output?: boolean;
|
|
20
|
+
language?: string;
|
|
21
|
+
lines?: number;
|
|
22
22
|
max_lines?: number | undefined;
|
|
23
|
-
elem_id?: string
|
|
24
|
-
elem_classes?: string[]
|
|
25
|
-
visible?: boolean
|
|
23
|
+
elem_id?: string;
|
|
24
|
+
elem_classes?: string[];
|
|
25
|
+
visible?: boolean;
|
|
26
26
|
label?: any;
|
|
27
|
-
show_label?: boolean
|
|
27
|
+
show_label?: boolean;
|
|
28
28
|
loading_status: LoadingStatus;
|
|
29
|
-
scale?:
|
|
29
|
+
scale?: number | null;
|
|
30
30
|
min_width?: number | undefined;
|
|
31
|
-
wrap_lines?: boolean
|
|
32
|
-
show_line_numbers?: boolean
|
|
33
|
-
autocomplete?: boolean
|
|
31
|
+
wrap_lines?: boolean;
|
|
32
|
+
show_line_numbers?: boolean;
|
|
33
|
+
autocomplete?: boolean;
|
|
34
34
|
interactive: boolean;
|
|
35
35
|
};
|
|
36
36
|
events: {
|
|
37
37
|
[evt: string]: CustomEvent<any>;
|
|
38
38
|
};
|
|
39
39
|
slots: {};
|
|
40
|
+
exports?: {} | undefined;
|
|
41
|
+
bindings?: string | undefined;
|
|
40
42
|
};
|
|
41
43
|
export type IndexProps = typeof __propDef.props;
|
|
42
44
|
export type IndexEvents = typeof __propDef.events;
|
package/dist/shared/Code.svelte
CHANGED
|
@@ -33,8 +33,7 @@ const dispatch = createEventDispatcher();
|
|
|
33
33
|
let lang_extension;
|
|
34
34
|
let element;
|
|
35
35
|
let view;
|
|
36
|
-
$:
|
|
37
|
-
get_lang(language);
|
|
36
|
+
$: get_lang(language);
|
|
38
37
|
const pyodide_autocomplete = create_pyodide_autocomplete();
|
|
39
38
|
async function get_lang(val) {
|
|
40
39
|
const ext = await getLanguageExtension(val);
|
|
@@ -45,12 +44,9 @@ async function get_lang(val) {
|
|
|
45
44
|
}
|
|
46
45
|
lang_extension = ext;
|
|
47
46
|
}
|
|
48
|
-
$:
|
|
49
|
-
|
|
50
|
-
$:
|
|
51
|
-
set_doc(value);
|
|
52
|
-
$:
|
|
53
|
-
update_lines();
|
|
47
|
+
$: reconfigure(), lang_extension, readonly;
|
|
48
|
+
$: set_doc(value);
|
|
49
|
+
$: update_lines();
|
|
54
50
|
function set_doc(new_doc) {
|
|
55
51
|
if (view && new_doc !== view.state.doc.toString()) {
|
|
56
52
|
view.dispatch({
|
|
@@ -2,20 +2,20 @@ import { SvelteComponent } from "svelte";
|
|
|
2
2
|
import { type Extension } from "@codemirror/state";
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
class_names?: string
|
|
6
|
-
value?: string
|
|
5
|
+
class_names?: string;
|
|
6
|
+
value?: string;
|
|
7
7
|
dark_mode: boolean;
|
|
8
|
-
basic?: boolean
|
|
8
|
+
basic?: boolean;
|
|
9
9
|
language: string;
|
|
10
|
-
lines?: number
|
|
11
|
-
max_lines?:
|
|
12
|
-
extensions?: Extension[]
|
|
13
|
-
use_tab?: boolean
|
|
14
|
-
readonly?: boolean
|
|
10
|
+
lines?: number;
|
|
11
|
+
max_lines?: number | null;
|
|
12
|
+
extensions?: Extension[];
|
|
13
|
+
use_tab?: boolean;
|
|
14
|
+
readonly?: boolean;
|
|
15
15
|
placeholder?: string | HTMLElement | null | undefined;
|
|
16
|
-
wrap_lines?: boolean
|
|
17
|
-
show_line_numbers?: boolean
|
|
18
|
-
autocomplete?: boolean
|
|
16
|
+
wrap_lines?: boolean;
|
|
17
|
+
show_line_numbers?: boolean;
|
|
18
|
+
autocomplete?: boolean;
|
|
19
19
|
};
|
|
20
20
|
events: {
|
|
21
21
|
change: CustomEvent<string>;
|
|
@@ -25,6 +25,8 @@ declare const __propDef: {
|
|
|
25
25
|
[evt: string]: CustomEvent<any>;
|
|
26
26
|
};
|
|
27
27
|
slots: {};
|
|
28
|
+
exports?: {} | undefined;
|
|
29
|
+
bindings?: string | undefined;
|
|
28
30
|
};
|
|
29
31
|
export type CodeProps = typeof __propDef.props;
|
|
30
32
|
export type CodeEvents = typeof __propDef.events;
|
package/dist/shared/Copy.svelte
CHANGED
|
@@ -6,8 +6,7 @@ export let value;
|
|
|
6
6
|
let timer;
|
|
7
7
|
function copy_feedback() {
|
|
8
8
|
copied = true;
|
|
9
|
-
if (timer)
|
|
10
|
-
clearTimeout(timer);
|
|
9
|
+
if (timer) clearTimeout(timer);
|
|
11
10
|
timer = setTimeout(() => {
|
|
12
11
|
copied = false;
|
|
13
12
|
}, 2e3);
|
|
@@ -19,8 +18,7 @@ async function handle_copy() {
|
|
|
19
18
|
}
|
|
20
19
|
}
|
|
21
20
|
onDestroy(() => {
|
|
22
|
-
if (timer)
|
|
23
|
-
clearTimeout(timer);
|
|
21
|
+
if (timer) clearTimeout(timer);
|
|
24
22
|
});
|
|
25
23
|
</script>
|
|
26
24
|
|
|
@@ -4,8 +4,7 @@ import { DownloadLink } from "@gradio/wasm/svelte";
|
|
|
4
4
|
import { IconButton } from "@gradio/atoms";
|
|
5
5
|
export let value;
|
|
6
6
|
export let language;
|
|
7
|
-
$:
|
|
8
|
-
ext = get_ext_for_type(language);
|
|
7
|
+
$: ext = get_ext_for_type(language);
|
|
9
8
|
function get_ext_for_type(type) {
|
|
10
9
|
const exts = {
|
|
11
10
|
py: "py",
|
|
@@ -35,17 +34,14 @@ let copied = false;
|
|
|
35
34
|
let timer;
|
|
36
35
|
function copy_feedback() {
|
|
37
36
|
copied = true;
|
|
38
|
-
if (timer)
|
|
39
|
-
clearTimeout(timer);
|
|
37
|
+
if (timer) clearTimeout(timer);
|
|
40
38
|
timer = setTimeout(() => {
|
|
41
39
|
copied = false;
|
|
42
40
|
}, 2e3);
|
|
43
41
|
}
|
|
44
|
-
$:
|
|
45
|
-
download_value = URL.createObjectURL(new Blob([value]));
|
|
42
|
+
$: download_value = URL.createObjectURL(new Blob([value]));
|
|
46
43
|
onDestroy(() => {
|
|
47
|
-
if (timer)
|
|
48
|
-
clearTimeout(timer);
|
|
44
|
+
if (timer) clearTimeout(timer);
|
|
49
45
|
});
|
|
50
46
|
</script>
|
|
51
47
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/code",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.16",
|
|
4
4
|
"description": "Gradio UI packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "",
|
|
@@ -27,25 +27,27 @@
|
|
|
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/
|
|
31
|
-
"@gradio/
|
|
32
|
-
"@gradio/
|
|
30
|
+
"@gradio/atoms": "^0.17.0",
|
|
31
|
+
"@gradio/icons": "^0.14.0",
|
|
32
|
+
"@gradio/statustracker": "^0.11.0",
|
|
33
33
|
"@gradio/utils": "^0.10.2",
|
|
34
|
-
"@gradio/
|
|
34
|
+
"@gradio/upload": "^0.16.17",
|
|
35
35
|
"@gradio/wasm": "^0.18.1"
|
|
36
36
|
},
|
|
37
37
|
"main_changeset": true,
|
|
38
38
|
"main": "./Index.svelte",
|
|
39
39
|
"exports": {
|
|
40
40
|
".": {
|
|
41
|
+
"types": "./dist/Index.svelte.d.ts",
|
|
41
42
|
"gradio": "./Index.svelte",
|
|
42
43
|
"svelte": "./dist/Index.svelte",
|
|
43
|
-
"
|
|
44
|
+
"default": "./dist/Index.svelte"
|
|
44
45
|
},
|
|
45
46
|
"./example": {
|
|
47
|
+
"types": "./dist/Example.svelte.d.ts",
|
|
46
48
|
"gradio": "./Example.svelte",
|
|
47
49
|
"svelte": "./dist/Example.svelte",
|
|
48
|
-
"
|
|
50
|
+
"default": "./dist/Example.svelte"
|
|
49
51
|
},
|
|
50
52
|
"./package.json": "./package.json"
|
|
51
53
|
},
|