@gradio/code 0.14.14 → 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 CHANGED
@@ -1,5 +1,36 @@
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
+
25
+ ## 0.14.15
26
+
27
+ ### Dependency updates
28
+
29
+ - @gradio/statustracker@0.10.17
30
+ - @gradio/atoms@0.16.5
31
+ - @gradio/icons@0.13.0
32
+ - @gradio/upload@0.16.15
33
+
3
34
  ## 0.14.14
4
35
 
5
36
  ### Dependency updates
@@ -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>
@@ -3,12 +3,14 @@ declare const __propDef: {
3
3
  props: {
4
4
  value: string | null;
5
5
  type: "gallery" | "table";
6
- selected?: boolean | undefined;
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
@@ -39,8 +39,7 @@ function handle_change() {
39
39
  afterUpdate(() => {
40
40
  value_is_output = false;
41
41
  });
42
- $:
43
- value, handle_change();
42
+ $: value, handle_change();
44
43
  </script>
45
44
 
46
45
  <Block
@@ -15,28 +15,30 @@ declare const __propDef: {
15
15
  focus: never;
16
16
  clear_status: LoadingStatus;
17
17
  }>;
18
- value?: string | undefined;
19
- value_is_output?: boolean | undefined;
20
- language?: string | undefined;
21
- lines?: number | undefined;
18
+ value?: string;
19
+ value_is_output?: boolean;
20
+ language?: string;
21
+ lines?: number;
22
22
  max_lines?: number | undefined;
23
- elem_id?: string | undefined;
24
- elem_classes?: string[] | undefined;
25
- visible?: boolean | undefined;
23
+ elem_id?: string;
24
+ elem_classes?: string[];
25
+ visible?: boolean;
26
26
  label?: any;
27
- show_label?: boolean | undefined;
27
+ show_label?: boolean;
28
28
  loading_status: LoadingStatus;
29
- scale?: (number | null) | undefined;
29
+ scale?: number | null;
30
30
  min_width?: number | undefined;
31
- wrap_lines?: boolean | undefined;
32
- show_line_numbers?: boolean | undefined;
33
- autocomplete?: boolean | undefined;
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;
@@ -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
- reconfigure(), lang_extension, readonly;
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 | undefined;
6
- value?: string | undefined;
5
+ class_names?: string;
6
+ value?: string;
7
7
  dark_mode: boolean;
8
- basic?: boolean | undefined;
8
+ basic?: boolean;
9
9
  language: string;
10
- lines?: number | undefined;
11
- max_lines?: (number | null) | undefined;
12
- extensions?: Extension[] | undefined;
13
- use_tab?: boolean | undefined;
14
- readonly?: boolean | undefined;
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 | undefined;
17
- show_line_numbers?: boolean | undefined;
18
- autocomplete?: boolean | undefined;
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;
@@ -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
 
@@ -7,6 +7,8 @@ declare const __propDef: {
7
7
  [evt: string]: CustomEvent<any>;
8
8
  };
9
9
  slots: {};
10
+ exports?: {} | undefined;
11
+ bindings?: string | undefined;
10
12
  };
11
13
  export type CopyProps = typeof __propDef.props;
12
14
  export type CopyEvents = typeof __propDef.events;
@@ -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
 
@@ -8,6 +8,8 @@ declare const __propDef: {
8
8
  [evt: string]: CustomEvent<any>;
9
9
  };
10
10
  slots: {};
11
+ exports?: {} | undefined;
12
+ bindings?: string | undefined;
11
13
  };
12
14
  export type DownloadProps = typeof __propDef.props;
13
15
  export type DownloadEvents = typeof __propDef.events;
@@ -8,6 +8,8 @@ declare const __propDef: {
8
8
  [evt: string]: CustomEvent<any>;
9
9
  };
10
10
  slots: {};
11
+ exports?: {} | undefined;
12
+ bindings?: string | undefined;
11
13
  };
12
14
  export type WidgetsProps = typeof __propDef.props;
13
15
  export type WidgetsEvents = typeof __propDef.events;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/code",
3
- "version": "0.14.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/atoms": "^0.16.4",
31
- "@gradio/statustracker": "^0.10.16",
32
- "@gradio/icons": "^0.12.0",
33
- "@gradio/upload": "^0.16.14",
30
+ "@gradio/atoms": "^0.17.0",
31
+ "@gradio/icons": "^0.14.0",
32
+ "@gradio/statustracker": "^0.11.0",
34
33
  "@gradio/utils": "^0.10.2",
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
- "types": "./dist/Index.svelte.d.ts"
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
- "types": "./dist/Example.svelte.d.ts"
50
+ "default": "./dist/Example.svelte"
49
51
  },
50
52
  "./package.json": "./package.json"
51
53
  },