@gradio/dataframe 0.6.4 → 0.6.5

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,11 @@
1
1
  # @gradio/dataframe
2
2
 
3
+ ## 0.6.5
4
+
5
+ ### Features
6
+
7
+ - [#7528](https://github.com/gradio-app/gradio/pull/7528) [`eda33b3`](https://github.com/gradio-app/gradio/commit/eda33b3763897a542acf298e523fa493dc655aee) - Refactors `get_fetchable_url_or_file()` to remove it from the frontend. Thanks [@abidlabs](https://github.com/abidlabs)!
8
+
3
9
  ## 0.6.4
4
10
 
5
11
  ### Fixes
package/Example.svelte CHANGED
@@ -1,10 +1,5 @@
1
1
  <script lang="ts">
2
- import { csvParseRows, tsvParseRows } from "d3-dsv";
3
- import type { Gradio } from "@gradio/utils";
4
-
5
- export let gradio: Gradio;
6
2
  export let value: (string | number)[][] | string;
7
- export let samples_dir: string;
8
3
  export let type: "gallery" | "table";
9
4
  export let selected = false;
10
5
  export let index: number;
@@ -12,42 +7,6 @@
12
7
  let hovered = false;
13
8
  let loaded_value: (string | number)[][] | string = value;
14
9
  let loaded = Array.isArray(loaded_value);
15
-
16
- $: if (!loaded && typeof value === "string" && /\.[a-zA-Z]+$/.test(value)) {
17
- fetch(samples_dir + value)
18
- .then((v) => v.text())
19
- .then((v) => {
20
- try {
21
- if ((value as string).endsWith("csv")) {
22
- const small_df = v
23
- .split("\n")
24
- .slice(0, 4)
25
- .map((v) => v.split(",").slice(0, 4).join(","))
26
- .join("\n");
27
-
28
- loaded_value = csvParseRows(small_df);
29
- } else if ((value as string).endsWith("tsv")) {
30
- const small_df = v
31
- .split("\n")
32
- .slice(0, 4)
33
- .map((v) => v.split("\t").slice(0, 4).join("\t"))
34
- .join("\n");
35
-
36
- loaded_value = tsvParseRows(small_df);
37
- } else {
38
- throw new Error(gradio.i18n("dataframe.incorrect_format"));
39
- }
40
-
41
- loaded = true;
42
- } catch (e) {
43
- console.error(e);
44
- }
45
- })
46
- .catch((e) => {
47
- loaded_value = value;
48
- loaded = true;
49
- });
50
- }
51
10
  </script>
52
11
 
53
12
  {#if loaded}
package/README.md CHANGED
@@ -35,7 +35,6 @@ BaseExample
35
35
  ```javascript
36
36
  export let gradio: Gradio;
37
37
  export let value: (string | number)[][] | string;
38
- export let samples_dir: string;
39
38
  export let type: "gallery" | "table";
40
39
  export let selected = false;
41
40
  export let index: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/dataframe",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
@@ -18,11 +18,11 @@
18
18
  "katex": "^0.16.7",
19
19
  "marked": "^12.0.0",
20
20
  "@gradio/atoms": "^0.5.3",
21
- "@gradio/button": "^0.2.22",
22
- "@gradio/markdown": "^0.6.5",
23
- "@gradio/upload": "^0.7.4",
21
+ "@gradio/button": "^0.2.23",
22
+ "@gradio/upload": "^0.7.5",
23
+ "@gradio/utils": "^0.3.0",
24
24
  "@gradio/statustracker": "^0.4.8",
25
- "@gradio/utils": "^0.3.0"
25
+ "@gradio/markdown": "^0.6.5"
26
26
  },
27
27
  "exports": {
28
28
  ".": "./Index.svelte",