@gradio/dataset 0.1.44 → 0.2.0

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,26 @@
1
1
  # @gradio/dataset
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Features
6
+
7
+ - [#8733](https://github.com/gradio-app/gradio/pull/8733) [`fb0daf3`](https://github.com/gradio-app/gradio/commit/fb0daf3730ffbe6aab5ebe4210eae150729a40b1) - Improvements to `gr.Examples`: adds events as attributes and documents, them, adds `sample_labels`, and `visible` properties. Thanks @abidlabs!
8
+
9
+ ### Dependency updates
10
+
11
+ - @gradio/atoms@0.7.6
12
+ - @gradio/utils@0.5.1
13
+ - @gradio/client@1.3.0
14
+ - @gradio/upload@0.11.5
15
+ - @gradio/textbox@0.6.7
16
+
17
+ ## 0.1.45
18
+
19
+ ### Dependency updates
20
+
21
+ - @gradio/upload@0.11.4
22
+ - @gradio/client@1.2.1
23
+
3
24
  ## 0.1.44
4
25
 
5
26
  ### Fixes
package/Index.svelte CHANGED
@@ -2,6 +2,7 @@
2
2
  import { Block } from "@gradio/atoms";
3
3
  import type { SvelteComponent, ComponentType } from "svelte";
4
4
  import type { Gradio, SelectData } from "@gradio/utils";
5
+ import { BaseExample } from "@gradio/textbox";
5
6
  export let components: string[];
6
7
  export let component_props: Record<string, any>[];
7
8
  export let component_map: Map<
@@ -13,6 +14,7 @@
13
14
  export let label = "Examples";
14
15
  export let headers: string[];
15
16
  export let samples: any[][] | null = null;
17
+ export let sample_labels: string[] | null = null;
16
18
  export let elem_id = "";
17
19
  export let elem_classes: string[] = [];
18
20
  export let visible = true;
@@ -33,7 +35,7 @@
33
35
  ? `/proxy=${proxy_url}file=`
34
36
  : `${root}/file=`;
35
37
  let page = 0;
36
- $: gallery = components.length < 2;
38
+ $: gallery = components.length < 2 || sample_labels !== null;
37
39
  let paginate = samples ? samples.length > samples_per_page : false;
38
40
 
39
41
  let selected_samples: any[][];
@@ -51,7 +53,7 @@
51
53
  }
52
54
 
53
55
  $: {
54
- samples = samples || [];
56
+ samples = sample_labels ? sample_labels.map((e) => [e]) : samples || [];
55
57
  paginate = samples.length > samples_per_page;
56
58
  if (paginate) {
57
59
  visible_pages = [];
@@ -146,7 +148,13 @@
146
148
  on:mouseenter={() => handle_mouseenter(i)}
147
149
  on:mouseleave={() => handle_mouseleave()}
148
150
  >
149
- {#if component_meta.length && component_map.get(components[0])}
151
+ {#if sample_labels}
152
+ <BaseExample
153
+ value={sample_row[0]}
154
+ selected={current_hover === i}
155
+ type="gallery"
156
+ />
157
+ {:else if component_meta.length && component_map.get(components[0])}
150
158
  <svelte:component
151
159
  this={component_meta[0][0].component}
152
160
  {...component_props[0]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/dataset",
3
- "version": "0.1.44",
3
+ "version": "0.2.0",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
@@ -12,12 +12,13 @@
12
12
  "./package.json": "./package.json"
13
13
  },
14
14
  "dependencies": {
15
- "@gradio/atoms": "^0.7.5",
16
- "@gradio/client": "^1.2.0",
17
- "@gradio/upload": "^0.11.3",
18
- "@gradio/utils": "^0.5.0"
15
+ "@gradio/atoms": "^0.7.6",
16
+ "@gradio/client": "^1.3.0",
17
+ "@gradio/utils": "^0.5.1",
18
+ "@gradio/upload": "^0.11.5",
19
+ "@gradio/textbox": "^0.6.7"
19
20
  },
20
21
  "devDependencies": {
21
- "@gradio/preview": "^0.10.0"
22
+ "@gradio/preview": "^0.10.1"
22
23
  }
23
24
  }