@gradio/gallery 0.15.35-dev.0 → 0.15.35-dev.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 +10 -0
- package/Gallery.stories.svelte +25 -0
- package/Index.svelte +2 -0
- package/dist/Index.svelte +2 -0
- package/dist/Index.svelte.d.ts +1 -0
- package/dist/shared/Gallery.svelte +2 -1
- package/dist/shared/Gallery.svelte.d.ts +1 -0
- package/package.json +6 -6
- package/shared/Gallery.svelte +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @gradio/gallery
|
|
2
2
|
|
|
3
|
+
## 0.15.35-dev.1
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- [#12066](https://github.com/gradio-app/gradio/pull/12066) [`6a4757a`](https://github.com/gradio-app/gradio/commit/6a4757ab289e8e53b5503eb6887333d7ad26c9eb) - Gallery: Allow empty columns when items < columns. Thanks @missionfloyd!
|
|
8
|
+
|
|
9
|
+
### Dependency updates
|
|
10
|
+
|
|
11
|
+
- @gradio/client@2.0.0-dev.1
|
|
12
|
+
|
|
3
13
|
## 0.15.35-dev.0
|
|
4
14
|
|
|
5
15
|
### Dependency updates
|
package/Gallery.stories.svelte
CHANGED
|
@@ -62,6 +62,13 @@
|
|
|
62
62
|
description: "Whether to show the share button in the gallery",
|
|
63
63
|
control: { type: "boolean" },
|
|
64
64
|
defaultValue: false
|
|
65
|
+
},
|
|
66
|
+
fit_columns: {
|
|
67
|
+
options: [true, false],
|
|
68
|
+
description:
|
|
69
|
+
"Whether the columns should fit the width of the container",
|
|
70
|
+
control: { type: "boolean" },
|
|
71
|
+
defaultValue: true
|
|
65
72
|
}
|
|
66
73
|
},
|
|
67
74
|
parameters: {
|
|
@@ -277,3 +284,21 @@
|
|
|
277
284
|
show_download_button: true
|
|
278
285
|
}}
|
|
279
286
|
/>
|
|
287
|
+
<Story
|
|
288
|
+
name="Gallery with fit_columns false"
|
|
289
|
+
args={{
|
|
290
|
+
label: "My Cheetah Gallery",
|
|
291
|
+
columns: 10,
|
|
292
|
+
show_download_button: true,
|
|
293
|
+
fit_columns: false
|
|
294
|
+
}}
|
|
295
|
+
/>
|
|
296
|
+
<Story
|
|
297
|
+
name="Gallery with fit_columns true"
|
|
298
|
+
args={{
|
|
299
|
+
label: "My Cheetah Gallery",
|
|
300
|
+
columns: 10,
|
|
301
|
+
show_download_button: true,
|
|
302
|
+
fit_columns: true
|
|
303
|
+
}}
|
|
304
|
+
/>
|
package/Index.svelte
CHANGED
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
preview_close: never;
|
|
52
52
|
}>;
|
|
53
53
|
export let fullscreen = false;
|
|
54
|
+
export let fit_columns = true;
|
|
54
55
|
|
|
55
56
|
const dispatch = createEventDispatcher();
|
|
56
57
|
|
|
@@ -168,6 +169,7 @@
|
|
|
168
169
|
bind:value
|
|
169
170
|
show_share_button={buttons?.includes("share") ?? true}
|
|
170
171
|
show_download_button={buttons?.includes("download") ?? true}
|
|
172
|
+
{fit_columns}
|
|
171
173
|
i18n={gradio.i18n}
|
|
172
174
|
_fetch={(...args) => gradio.client.fetch(...args)}
|
|
173
175
|
show_fullscreen_button={buttons?.includes("fullscreen") ?? true}
|
package/dist/Index.svelte
CHANGED
|
@@ -30,6 +30,7 @@ export let buttons = null;
|
|
|
30
30
|
export let interactive;
|
|
31
31
|
export let gradio;
|
|
32
32
|
export let fullscreen = false;
|
|
33
|
+
export let fit_columns = true;
|
|
33
34
|
const dispatch = createEventDispatcher();
|
|
34
35
|
$: no_value = value === null ? true : value.length === 0;
|
|
35
36
|
function handle_delete(event) {
|
|
@@ -136,6 +137,7 @@ async function process_upload_files(files) {
|
|
|
136
137
|
bind:value
|
|
137
138
|
show_share_button={buttons?.includes("share") ?? true}
|
|
138
139
|
show_download_button={buttons?.includes("download") ?? true}
|
|
140
|
+
{fit_columns}
|
|
139
141
|
i18n={gradio.i18n}
|
|
140
142
|
_fetch={(...args) => gradio.client.fetch(...args)}
|
|
141
143
|
show_fullscreen_button={buttons?.includes("fullscreen") ?? true}
|
package/dist/Index.svelte.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ export let file_types = ["image", "video"];
|
|
|
45
45
|
export let max_file_size = null;
|
|
46
46
|
export let upload = void 0;
|
|
47
47
|
export let stream_handler = void 0;
|
|
48
|
+
export let fit_columns = true;
|
|
48
49
|
let is_full_screen = false;
|
|
49
50
|
let image_container;
|
|
50
51
|
const dispatch = createEventDispatcher();
|
|
@@ -64,7 +65,7 @@ $: resolved_value = value == null ? null : value.map((data) => {
|
|
|
64
65
|
});
|
|
65
66
|
let effective_columns = columns;
|
|
66
67
|
$: {
|
|
67
|
-
if (resolved_value && columns) {
|
|
68
|
+
if (resolved_value && columns && fit_columns) {
|
|
68
69
|
const item_count = resolved_value.length;
|
|
69
70
|
if (Array.isArray(columns)) {
|
|
70
71
|
effective_columns = columns.map((col) => Math.min(col, item_count));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/gallery",
|
|
3
|
-
"version": "0.15.35-dev.
|
|
3
|
+
"version": "0.15.35-dev.1",
|
|
4
4
|
"description": "Gradio UI packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "",
|
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
"private": false,
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"dequal": "^2.0.2",
|
|
11
|
-
"@gradio/
|
|
12
|
-
"@gradio/client": "^2.0.0-dev.0",
|
|
11
|
+
"@gradio/client": "^2.0.0-dev.1",
|
|
13
12
|
"@gradio/icons": "^0.14.0",
|
|
13
|
+
"@gradio/atoms": "^0.18.1",
|
|
14
14
|
"@gradio/image": "^0.23.2-dev.0",
|
|
15
|
-
"@gradio/upload": "^0.17.2-dev.0",
|
|
16
15
|
"@gradio/statustracker": "^0.11.1",
|
|
16
|
+
"@gradio/upload": "^0.17.2-dev.0",
|
|
17
17
|
"@gradio/utils": "^0.10.2",
|
|
18
|
-
"@gradio/
|
|
19
|
-
"@gradio/
|
|
18
|
+
"@gradio/file": "^0.13.1-dev.0",
|
|
19
|
+
"@gradio/video": "^0.17.0-dev.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@gradio/preview": "^0.14.0"
|
package/shared/Gallery.svelte
CHANGED
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
export let max_file_size: number | null = null;
|
|
56
56
|
export let upload: Client["upload"] | undefined = undefined;
|
|
57
57
|
export let stream_handler: Client["stream"] | undefined = undefined;
|
|
58
|
+
export let fit_columns = true;
|
|
58
59
|
|
|
59
60
|
let is_full_screen = false;
|
|
60
61
|
let image_container: HTMLElement;
|
|
@@ -95,7 +96,7 @@
|
|
|
95
96
|
let effective_columns: number | number[] | undefined = columns;
|
|
96
97
|
|
|
97
98
|
$: {
|
|
98
|
-
if (resolved_value && columns) {
|
|
99
|
+
if (resolved_value && columns && fit_columns) {
|
|
99
100
|
const item_count = resolved_value.length;
|
|
100
101
|
if (Array.isArray(columns)) {
|
|
101
102
|
effective_columns = columns.map((col) => Math.min(col, item_count));
|