@gradio/dataset 0.2.2 → 0.2.4

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,33 @@
1
1
  # @gradio/dataset
2
2
 
3
+ ## 0.2.4
4
+
5
+ ### Features
6
+
7
+ - [#9118](https://github.com/gradio-app/gradio/pull/9118) [`e1c404d`](https://github.com/gradio-app/gradio/commit/e1c404da1143fb52b659d03e028bdba1badf443d) - setup npm-previews of all packages. Thanks @pngwn!
8
+
9
+ ### Fixes
10
+
11
+ - [#9093](https://github.com/gradio-app/gradio/pull/9093) [`60650d8`](https://github.com/gradio-app/gradio/commit/60650d84b2cfe93fd2ebf2d2997d6c0f382d5f1a) - Reset `Dataset` page to 0 when samples change. Thanks @abidlabs!
12
+ - [#8987](https://github.com/gradio-app/gradio/pull/8987) [`7b288cf`](https://github.com/gradio-app/gradio/commit/7b288cf6772ec3dc1fa603db859975e5dab90127) - Fix unexpected rendering of Dataset. Thanks @Col0ring!
13
+
14
+ ### Dependency updates
15
+
16
+ - @gradio/utils@0.6.0
17
+ - @gradio/upload@0.12.3
18
+ - @gradio/atoms@0.8.0
19
+ - @gradio/client@1.5.1
20
+ - @gradio/textbox@0.6.11
21
+
22
+ ## 0.2.3
23
+
24
+ ### Dependency updates
25
+
26
+ - @gradio/atoms@0.7.9
27
+ - @gradio/client@1.5.0
28
+ - @gradio/upload@0.12.2
29
+ - @gradio/textbox@0.6.10
30
+
3
31
  ## 0.2.2
4
32
 
5
33
  ### Dependency updates
package/Index.svelte CHANGED
@@ -14,6 +14,7 @@
14
14
  export let label = "Examples";
15
15
  export let headers: string[];
16
16
  export let samples: any[][] | null = null;
17
+ let old_samples: any[][] | null = null;
17
18
  export let sample_labels: string[] | null = null;
18
19
  export let elem_id = "";
19
20
  export let elem_classes: string[] = [];
@@ -35,6 +36,7 @@
35
36
  ? `/proxy=${proxy_url}file=`
36
37
  : `${root}/file=`;
37
38
  let page = 0;
39
+
38
40
  $: gallery = components.length < 2 || sample_labels !== null;
39
41
  let paginate = samples ? samples.length > samples_per_page : false;
40
42
 
@@ -53,7 +55,15 @@
53
55
  }
54
56
 
55
57
  $: {
56
- samples = sample_labels ? sample_labels.map((e) => [e]) : samples || [];
58
+ if (sample_labels) {
59
+ samples = sample_labels.map((e) => [e]);
60
+ } else if (!samples) {
61
+ samples = [];
62
+ }
63
+ if (samples !== old_samples) {
64
+ page = 0;
65
+ old_samples = samples;
66
+ }
57
67
  paginate = samples.length > samples_per_page;
58
68
  if (paginate) {
59
69
  visible_pages = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/dataset",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
@@ -12,13 +12,18 @@
12
12
  "./package.json": "./package.json"
13
13
  },
14
14
  "dependencies": {
15
- "@gradio/atoms": "^0.7.8",
16
- "@gradio/client": "^1.4.0",
17
- "@gradio/upload": "^0.12.1",
18
- "@gradio/textbox": "^0.6.9",
19
- "@gradio/utils": "^0.5.2"
15
+ "@gradio/client": "^1.5.1",
16
+ "@gradio/upload": "^0.12.3",
17
+ "@gradio/utils": "^0.6.0",
18
+ "@gradio/atoms": "^0.8.0",
19
+ "@gradio/textbox": "^0.6.11"
20
20
  },
21
21
  "devDependencies": {
22
- "@gradio/preview": "^0.10.2"
22
+ "@gradio/preview": "^0.11.0"
23
+ },
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/gradio-app/gradio.git",
27
+ "directory": "js/dataset"
23
28
  }
24
29
  }