@gradio/dataset 0.3.10 → 0.4.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 +22 -0
- package/Index.svelte +25 -20
- package/dist/Index.svelte +24 -20
- package/dist/Index.svelte.d.ts +2 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,27 @@
|
|
1
1
|
# @gradio/dataset
|
2
2
|
|
3
|
+
## 0.4.0
|
4
|
+
|
5
|
+
### Features
|
6
|
+
|
7
|
+
- [#10191](https://github.com/gradio-app/gradio/pull/10191) [`5ce2832`](https://github.com/gradio-app/gradio/commit/5ce28324971e974ae24dc9a229b2160793140fb2) - Support saving chat history in `gr.ChatInterface`. Thanks @abidlabs!
|
8
|
+
|
9
|
+
### Dependency updates
|
10
|
+
|
11
|
+
- @gradio/atoms@0.13.0
|
12
|
+
- @gradio/utils@0.10.0
|
13
|
+
- @gradio/upload@0.14.4
|
14
|
+
- @gradio/client@1.9.0
|
15
|
+
- @gradio/textbox@0.10.0
|
16
|
+
|
17
|
+
## 0.3.11
|
18
|
+
|
19
|
+
### Dependency updates
|
20
|
+
|
21
|
+
- @gradio/upload@0.14.3
|
22
|
+
- @gradio/atoms@0.12.0
|
23
|
+
- @gradio/textbox@0.9.1
|
24
|
+
|
3
25
|
## 0.3.10
|
4
26
|
|
5
27
|
### Dependency updates
|
package/Index.svelte
CHANGED
@@ -12,6 +12,7 @@
|
|
12
12
|
}>
|
13
13
|
>;
|
14
14
|
export let label = "Examples";
|
15
|
+
export let show_label = true;
|
15
16
|
export let headers: string[];
|
16
17
|
export let samples: any[][] | null = null;
|
17
18
|
let old_samples: any[][] | null = null;
|
@@ -29,6 +30,7 @@
|
|
29
30
|
click: number;
|
30
31
|
select: SelectData;
|
31
32
|
}>;
|
33
|
+
export let layout: "gallery" | "table" | null = null;
|
32
34
|
|
33
35
|
// Although the `samples_dir` prop is not used in any of the core Gradio component, it is kept for backward compatibility
|
34
36
|
// with any custom components created with gradio<=4.20.0
|
@@ -37,7 +39,8 @@
|
|
37
39
|
: `${root}/file=`;
|
38
40
|
let page = 0;
|
39
41
|
|
40
|
-
$: gallery =
|
42
|
+
$: gallery =
|
43
|
+
(components.length < 2 || sample_labels !== null) && layout !== "table";
|
41
44
|
let paginate = samples ? samples.length > samples_per_page : false;
|
42
45
|
|
43
46
|
let selected_samples: any[][];
|
@@ -126,24 +129,26 @@
|
|
126
129
|
allow_overflow={false}
|
127
130
|
container={false}
|
128
131
|
>
|
129
|
-
|
130
|
-
<
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
132
|
+
{#if show_label}
|
133
|
+
<div class="label">
|
134
|
+
<svg
|
135
|
+
xmlns="http://www.w3.org/2000/svg"
|
136
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
137
|
+
aria-hidden="true"
|
138
|
+
role="img"
|
139
|
+
width="1em"
|
140
|
+
height="1em"
|
141
|
+
preserveAspectRatio="xMidYMid meet"
|
142
|
+
viewBox="0 0 32 32"
|
143
|
+
>
|
144
|
+
<path
|
145
|
+
fill="currentColor"
|
146
|
+
d="M10 6h18v2H10zm0 18h18v2H10zm0-9h18v2H10zm-6 0h2v2H4zm0-9h2v2H4zm0 18h2v2H4z"
|
147
|
+
/>
|
148
|
+
</svg>
|
149
|
+
{label}
|
150
|
+
</div>
|
151
|
+
{/if}
|
147
152
|
{#if gallery}
|
148
153
|
<div class="gallery">
|
149
154
|
{#each selected_samples as sample_row, i}
|
@@ -180,7 +185,7 @@
|
|
180
185
|
{/if}
|
181
186
|
{/each}
|
182
187
|
</div>
|
183
|
-
{:else}
|
188
|
+
{:else if selected_samples.length > 0}
|
184
189
|
<div class="table-wrap">
|
185
190
|
<table tabindex="0" role="grid">
|
186
191
|
<thead>
|
package/dist/Index.svelte
CHANGED
@@ -4,6 +4,7 @@ export let components;
|
|
4
4
|
export let component_props;
|
5
5
|
export let component_map;
|
6
6
|
export let label = "Examples";
|
7
|
+
export let show_label = true;
|
7
8
|
export let headers;
|
8
9
|
export let samples = null;
|
9
10
|
let old_samples = null;
|
@@ -18,10 +19,11 @@ export let samples_per_page = 10;
|
|
18
19
|
export let scale = null;
|
19
20
|
export let min_width = void 0;
|
20
21
|
export let gradio;
|
22
|
+
export let layout = null;
|
21
23
|
let samples_dir = proxy_url ? `/proxy=${proxy_url}file=` : `${root}/file=`;
|
22
24
|
let page = 0;
|
23
25
|
$:
|
24
|
-
gallery = components.length < 2 || sample_labels !== null;
|
26
|
+
gallery = (components.length < 2 || sample_labels !== null) && layout !== "table";
|
25
27
|
let paginate = samples ? samples.length > samples_per_page : false;
|
26
28
|
let selected_samples;
|
27
29
|
let page_count;
|
@@ -94,24 +96,26 @@ $:
|
|
94
96
|
allow_overflow={false}
|
95
97
|
container={false}
|
96
98
|
>
|
97
|
-
|
98
|
-
<
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
99
|
+
{#if show_label}
|
100
|
+
<div class="label">
|
101
|
+
<svg
|
102
|
+
xmlns="http://www.w3.org/2000/svg"
|
103
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
104
|
+
aria-hidden="true"
|
105
|
+
role="img"
|
106
|
+
width="1em"
|
107
|
+
height="1em"
|
108
|
+
preserveAspectRatio="xMidYMid meet"
|
109
|
+
viewBox="0 0 32 32"
|
110
|
+
>
|
111
|
+
<path
|
112
|
+
fill="currentColor"
|
113
|
+
d="M10 6h18v2H10zm0 18h18v2H10zm0-9h18v2H10zm-6 0h2v2H4zm0-9h2v2H4zm0 18h2v2H4z"
|
114
|
+
/>
|
115
|
+
</svg>
|
116
|
+
{label}
|
117
|
+
</div>
|
118
|
+
{/if}
|
115
119
|
{#if gallery}
|
116
120
|
<div class="gallery">
|
117
121
|
{#each selected_samples as sample_row, i}
|
@@ -148,7 +152,7 @@ $:
|
|
148
152
|
{/if}
|
149
153
|
{/each}
|
150
154
|
</div>
|
151
|
-
{:else}
|
155
|
+
{:else if selected_samples.length > 0}
|
152
156
|
<div class="table-wrap">
|
153
157
|
<table tabindex="0" role="grid">
|
154
158
|
<thead>
|
package/dist/Index.svelte.d.ts
CHANGED
@@ -9,6 +9,7 @@ declare const __propDef: {
|
|
9
9
|
default: ComponentType<SvelteComponent>;
|
10
10
|
}>>;
|
11
11
|
label?: string | undefined;
|
12
|
+
show_label?: boolean | undefined;
|
12
13
|
headers: string[];
|
13
14
|
samples?: (any[][] | null) | undefined;
|
14
15
|
sample_labels?: (string[] | null) | undefined;
|
@@ -25,6 +26,7 @@ declare const __propDef: {
|
|
25
26
|
click: number;
|
26
27
|
select: SelectData;
|
27
28
|
}>;
|
29
|
+
layout?: ("gallery" | "table" | null) | undefined;
|
28
30
|
};
|
29
31
|
events: {
|
30
32
|
[evt: string]: CustomEvent<any>;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@gradio/dataset",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.4.0",
|
4
4
|
"description": "Gradio UI packages",
|
5
5
|
"type": "module",
|
6
6
|
"author": "",
|
@@ -16,11 +16,11 @@
|
|
16
16
|
"./package.json": "./package.json"
|
17
17
|
},
|
18
18
|
"dependencies": {
|
19
|
-
"@gradio/atoms": "^0.
|
20
|
-
"@gradio/
|
21
|
-
"@gradio/
|
22
|
-
"@gradio/
|
23
|
-
"@gradio/
|
19
|
+
"@gradio/atoms": "^0.13.0",
|
20
|
+
"@gradio/client": "^1.9.0",
|
21
|
+
"@gradio/utils": "^0.10.0",
|
22
|
+
"@gradio/upload": "^0.14.4",
|
23
|
+
"@gradio/textbox": "^0.10.0"
|
24
24
|
},
|
25
25
|
"devDependencies": {
|
26
26
|
"@gradio/preview": "^0.13.0"
|