@gradio/dataset 0.1.45 → 0.2.1
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 +23 -0
- package/Index.svelte +11 -3
- package/package.json +7 -6
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,28 @@
|
|
1
1
|
# @gradio/dataset
|
2
2
|
|
3
|
+
## 0.2.1
|
4
|
+
|
5
|
+
### Dependency updates
|
6
|
+
|
7
|
+
- @gradio/client@1.4.0
|
8
|
+
- @gradio/upload@0.12.0
|
9
|
+
- @gradio/atoms@0.7.7
|
10
|
+
- @gradio/textbox@0.6.8
|
11
|
+
|
12
|
+
## 0.2.0
|
13
|
+
|
14
|
+
### Features
|
15
|
+
|
16
|
+
- [#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!
|
17
|
+
|
18
|
+
### Dependency updates
|
19
|
+
|
20
|
+
- @gradio/atoms@0.7.6
|
21
|
+
- @gradio/utils@0.5.1
|
22
|
+
- @gradio/client@1.3.0
|
23
|
+
- @gradio/upload@0.11.5
|
24
|
+
- @gradio/textbox@0.6.7
|
25
|
+
|
3
26
|
## 0.1.45
|
4
27
|
|
5
28
|
### Dependency updates
|
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
|
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
|
3
|
+
"version": "0.2.1",
|
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/
|
16
|
-
"@gradio/utils": "^0.5.
|
17
|
-
"@gradio/upload": "^0.
|
18
|
-
"@gradio/
|
15
|
+
"@gradio/atoms": "^0.7.7",
|
16
|
+
"@gradio/utils": "^0.5.1",
|
17
|
+
"@gradio/upload": "^0.12.0",
|
18
|
+
"@gradio/client": "^1.4.0",
|
19
|
+
"@gradio/textbox": "^0.6.8"
|
19
20
|
},
|
20
21
|
"devDependencies": {
|
21
|
-
"@gradio/preview": "^0.10.
|
22
|
+
"@gradio/preview": "^0.10.1"
|
22
23
|
}
|
23
24
|
}
|