@gradio/file 0.12.28 → 0.12.29

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,28 @@
1
1
  # @gradio/file
2
2
 
3
+ ## 0.12.29
4
+
5
+ ### Dependency updates
6
+
7
+ - @gradio/client@1.18.0
8
+ - @gradio/icons@0.14.0
9
+ - @gradio/atoms@0.17.0
10
+ - @gradio/statustracker@0.11.0
11
+ - @gradio/upload@0.16.17
12
+
13
+ ## 0.12.28
14
+
15
+ ### Dependency updates
16
+
17
+ - @gradio/statustracker@0.10.18
18
+
19
+ ## 0.12.28
20
+
21
+ ### Dependency updates
22
+
23
+ - @gradio/icons@0.13.1
24
+ - @gradio/upload@0.16.16
25
+
3
26
  ## 0.12.28
4
27
 
5
28
  ### Dependency updates
@@ -4,12 +4,14 @@ declare const __propDef: {
4
4
  props: {
5
5
  value: FileData | null;
6
6
  type: "gallery" | "table";
7
- selected?: boolean | undefined;
7
+ selected?: boolean;
8
8
  };
9
9
  events: {
10
10
  [evt: string]: CustomEvent<any>;
11
11
  };
12
12
  slots: {};
13
+ exports?: {} | undefined;
14
+ bindings?: string | undefined;
13
15
  };
14
16
  export type ExampleProps = typeof __propDef.props;
15
17
  export type ExampleEvents = typeof __propDef.events;
package/dist/Index.svelte CHANGED
@@ -30,14 +30,12 @@ export let file_types = ["file"];
30
30
  export let input_ready;
31
31
  export let allow_reordering = false;
32
32
  let uploading = false;
33
- $:
34
- input_ready = !uploading;
33
+ $: input_ready = !uploading;
35
34
  let old_value = value;
36
- $:
37
- if (JSON.stringify(old_value) !== JSON.stringify(value)) {
38
- gradio.dispatch("change");
39
- old_value = value;
40
- }
35
+ $: if (JSON.stringify(old_value) !== JSON.stringify(value)) {
36
+ gradio.dispatch("change");
37
+ old_value = value;
38
+ }
41
39
  let dragging = false;
42
40
  let pending_upload = false;
43
41
  </script>
@@ -8,19 +8,19 @@ import type { FileData } from "@gradio/client";
8
8
  import type { LoadingStatus } from "@gradio/statustracker";
9
9
  declare const __propDef: {
10
10
  props: {
11
- elem_id?: string | undefined;
12
- elem_classes?: string[] | undefined;
13
- visible?: boolean | undefined;
11
+ elem_id?: string;
12
+ elem_classes?: string[];
13
+ visible?: boolean;
14
14
  value: null | FileData | FileData[];
15
15
  interactive: boolean;
16
16
  root: string;
17
17
  label: string;
18
18
  show_label: boolean;
19
19
  height?: number | undefined;
20
- _selectable?: boolean | undefined;
20
+ _selectable?: boolean;
21
21
  loading_status: LoadingStatus;
22
- container?: boolean | undefined;
23
- scale?: (number | null) | undefined;
22
+ container?: boolean;
23
+ scale?: number | null;
24
24
  min_width?: number | undefined;
25
25
  gradio: Gradio<{
26
26
  change: never;
@@ -33,14 +33,16 @@ declare const __propDef: {
33
33
  download: FileData;
34
34
  }>;
35
35
  file_count: "single" | "multiple" | "directory";
36
- file_types?: string[] | undefined;
36
+ file_types?: string[];
37
37
  input_ready: boolean;
38
- allow_reordering?: boolean | undefined;
38
+ allow_reordering?: boolean;
39
39
  };
40
40
  events: {
41
41
  [evt: string]: CustomEvent<any>;
42
42
  };
43
43
  slots: {};
44
+ exports?: {} | undefined;
45
+ bindings?: string | undefined;
44
46
  };
45
47
  export type IndexProps = typeof __propDef.props;
46
48
  export type IndexEvents = typeof __propDef.events;
@@ -3,10 +3,10 @@ import type { FileData } from "@gradio/client";
3
3
  import type { I18nFormatter } from "@gradio/utils";
4
4
  declare const __propDef: {
5
5
  props: {
6
- value?: (FileData | FileData[] | null) | undefined;
6
+ value?: FileData | FileData[] | null;
7
7
  label: string;
8
- show_label?: boolean | undefined;
9
- selectable?: boolean | undefined;
8
+ show_label?: boolean;
9
+ selectable?: boolean;
10
10
  height?: number | undefined;
11
11
  i18n: I18nFormatter;
12
12
  };
@@ -17,6 +17,8 @@ declare const __propDef: {
17
17
  [evt: string]: CustomEvent<any>;
18
18
  };
19
19
  slots: {};
20
+ exports?: {} | undefined;
21
+ bindings?: string | undefined;
20
22
  };
21
23
  export type FileProps = typeof __propDef.props;
22
24
  export type FileEvents = typeof __propDef.events;
@@ -37,8 +37,7 @@ function handle_drag_end(event) {
37
37
  }
38
38
  function handle_drop(event, index) {
39
39
  event.preventDefault();
40
- if (dragging_index === null || dragging_index === index)
41
- return;
40
+ if (dragging_index === null || dragging_index === index) return;
42
41
  const files = Array.isArray(value) ? [...value] : [value];
43
42
  const [removed] = files.splice(dragging_index, 1);
44
43
  files.splice(
@@ -58,15 +57,14 @@ function split_filename(filename) {
58
57
  }
59
58
  return [filename.slice(0, last_dot), filename.slice(last_dot)];
60
59
  }
61
- $:
62
- normalized_files = (Array.isArray(value) ? value : [value]).map((file) => {
63
- const [filename_stem, filename_ext] = split_filename(file.orig_name ?? "");
64
- return {
65
- ...file,
66
- filename_stem,
67
- filename_ext
68
- };
69
- });
60
+ $: normalized_files = (Array.isArray(value) ? value : [value]).map((file) => {
61
+ const [filename_stem, filename_ext] = split_filename(file.orig_name ?? "");
62
+ return {
63
+ ...file,
64
+ filename_stem,
65
+ filename_ext
66
+ };
67
+ });
70
68
  function handle_row_click(event, index) {
71
69
  const tr = event.currentTarget;
72
70
  const should_select = event.target === tr || // Only select if the click is on the row itself
@@ -4,10 +4,10 @@ import type { I18nFormatter, SelectData } from "@gradio/utils";
4
4
  declare const __propDef: {
5
5
  props: {
6
6
  value: FileData | FileData[];
7
- selectable?: boolean | undefined;
7
+ selectable?: boolean;
8
8
  height?: number | string | undefined;
9
9
  i18n: I18nFormatter;
10
- allow_reordering?: boolean | undefined;
10
+ allow_reordering?: boolean;
11
11
  };
12
12
  events: {
13
13
  dragenter: DragEvent;
@@ -19,6 +19,8 @@ declare const __propDef: {
19
19
  [evt: string]: CustomEvent<any>;
20
20
  };
21
21
  slots: {};
22
+ exports?: {} | undefined;
23
+ bindings?: string | undefined;
22
24
  };
23
25
  export type FilePreviewProps = typeof __propDef.props;
24
26
  export type FilePreviewEvents = typeof __propDef.events;
@@ -38,8 +38,7 @@ function handle_clear() {
38
38
  }
39
39
  const dispatch = createEventDispatcher();
40
40
  let dragging = false;
41
- $:
42
- dispatch("drag", dragging);
41
+ $: dispatch("drag", dragging);
43
42
  </script>
44
43
 
45
44
  <BlockLabel {show_label} Icon={File} float={!value} label={label || "File"} />
@@ -5,18 +5,18 @@ declare const __propDef: {
5
5
  props: {
6
6
  value: null | FileData | FileData[];
7
7
  label: string;
8
- show_label?: boolean | undefined;
9
- file_count?: ("single" | "multiple" | "directory") | undefined;
10
- file_types?: (string[] | null) | undefined;
11
- selectable?: boolean | undefined;
8
+ show_label?: boolean;
9
+ file_count?: "single" | "multiple" | "directory";
10
+ file_types?: string[] | null;
11
+ selectable?: boolean;
12
12
  root: string;
13
13
  height?: number | undefined;
14
14
  i18n: I18nFormatter;
15
- max_file_size?: (number | null) | undefined;
15
+ max_file_size?: number | null;
16
16
  upload: Client["upload"];
17
17
  stream_handler: Client["stream"];
18
- uploading?: boolean | undefined;
19
- allow_reordering?: boolean | undefined;
18
+ uploading?: boolean;
19
+ allow_reordering?: boolean;
20
20
  };
21
21
  events: {
22
22
  error: CustomEvent<any>;
@@ -33,6 +33,8 @@ declare const __propDef: {
33
33
  slots: {
34
34
  default: {};
35
35
  };
36
+ exports?: {} | undefined;
37
+ bindings?: string | undefined;
36
38
  };
37
39
  export type FileUploadProps = typeof __propDef.props;
38
40
  export type FileUploadEvents = typeof __propDef.events;
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@gradio/file",
3
- "version": "0.12.28",
3
+ "version": "0.12.29",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
7
7
  "license": "ISC",
8
8
  "private": false,
9
9
  "dependencies": {
10
- "@gradio/atoms": "^0.16.5",
11
- "@gradio/icons": "^0.13.0",
12
- "@gradio/client": "^1.17.1",
13
- "@gradio/statustracker": "^0.10.17",
14
- "@gradio/upload": "^0.16.15",
10
+ "@gradio/atoms": "^0.17.0",
11
+ "@gradio/client": "^1.18.0",
12
+ "@gradio/statustracker": "^0.11.0",
13
+ "@gradio/icons": "^0.14.0",
14
+ "@gradio/upload": "^0.16.17",
15
15
  "@gradio/utils": "^0.10.2",
16
16
  "@gradio/wasm": "^0.18.1"
17
17
  },