@gradio/gallery 0.15.10 → 0.15.11
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 +12 -0
- package/dist/shared/Gallery.svelte +14 -1
- package/package.json +9 -9
- package/shared/Gallery.svelte +14 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @gradio/gallery
|
|
2
2
|
|
|
3
|
+
## 0.15.11
|
|
4
|
+
|
|
5
|
+
### Dependency updates
|
|
6
|
+
|
|
7
|
+
- @gradio/video@0.14.6
|
|
8
|
+
- @gradio/atoms@0.14.1
|
|
9
|
+
- @gradio/statustracker@0.10.6
|
|
10
|
+
- @gradio/client@1.14.0
|
|
11
|
+
- @gradio/upload@0.15.6
|
|
12
|
+
- @gradio/image@0.21.6
|
|
13
|
+
- @gradio/file@0.12.11
|
|
14
|
+
|
|
3
15
|
## 0.15.10
|
|
4
16
|
|
|
5
17
|
### Dependency updates
|
|
@@ -63,7 +63,14 @@ $:
|
|
|
63
63
|
selected_index = preview && value?.length ? 0 : null;
|
|
64
64
|
was_reset = false;
|
|
65
65
|
} else {
|
|
66
|
-
|
|
66
|
+
if (selected_index !== null && value !== null) {
|
|
67
|
+
selected_index = Math.max(
|
|
68
|
+
0,
|
|
69
|
+
Math.min(selected_index, value.length - 1)
|
|
70
|
+
);
|
|
71
|
+
} else {
|
|
72
|
+
selected_index = null;
|
|
73
|
+
}
|
|
67
74
|
}
|
|
68
75
|
dispatch("change");
|
|
69
76
|
prev_value = value;
|
|
@@ -105,6 +112,12 @@ $: {
|
|
|
105
112
|
if (selected_index !== old_selected_index) {
|
|
106
113
|
old_selected_index = selected_index;
|
|
107
114
|
if (selected_index !== null) {
|
|
115
|
+
if (resolved_value != null) {
|
|
116
|
+
selected_index = Math.max(
|
|
117
|
+
0,
|
|
118
|
+
Math.min(selected_index, resolved_value.length - 1)
|
|
119
|
+
);
|
|
120
|
+
}
|
|
108
121
|
dispatch("select", {
|
|
109
122
|
index: selected_index,
|
|
110
123
|
value: resolved_value?.[selected_index]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/gallery",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.11",
|
|
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/atoms": "^0.14.
|
|
12
|
-
"@gradio/
|
|
13
|
-
"@gradio/image": "^0.21.
|
|
14
|
-
"@gradio/
|
|
15
|
-
"@gradio/
|
|
11
|
+
"@gradio/atoms": "^0.14.1",
|
|
12
|
+
"@gradio/icons": "^0.10.0",
|
|
13
|
+
"@gradio/image": "^0.21.6",
|
|
14
|
+
"@gradio/client": "^1.14.0",
|
|
15
|
+
"@gradio/statustracker": "^0.10.6",
|
|
16
|
+
"@gradio/upload": "^0.15.6",
|
|
16
17
|
"@gradio/utils": "^0.10.1",
|
|
17
|
-
"@gradio/video": "^0.14.
|
|
18
|
-
"@gradio/file": "^0.12.
|
|
19
|
-
"@gradio/icons": "^0.10.0"
|
|
18
|
+
"@gradio/video": "^0.14.6",
|
|
19
|
+
"@gradio/file": "^0.12.11"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@gradio/preview": "^0.13.0"
|
package/shared/Gallery.svelte
CHANGED
|
@@ -90,10 +90,14 @@
|
|
|
90
90
|
// Otherwise we keep the selected_index the same if the
|
|
91
91
|
// gallery has at least as many elements as it did before
|
|
92
92
|
} else {
|
|
93
|
-
selected_index
|
|
94
|
-
selected_index
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
if (selected_index !== null && value !== null) {
|
|
94
|
+
selected_index = Math.max(
|
|
95
|
+
0,
|
|
96
|
+
Math.min(selected_index, value.length - 1)
|
|
97
|
+
);
|
|
98
|
+
} else {
|
|
99
|
+
selected_index = null;
|
|
100
|
+
}
|
|
97
101
|
}
|
|
98
102
|
dispatch("change");
|
|
99
103
|
prev_value = value;
|
|
@@ -140,6 +144,12 @@
|
|
|
140
144
|
if (selected_index !== old_selected_index) {
|
|
141
145
|
old_selected_index = selected_index;
|
|
142
146
|
if (selected_index !== null) {
|
|
147
|
+
if (resolved_value != null) {
|
|
148
|
+
selected_index = Math.max(
|
|
149
|
+
0,
|
|
150
|
+
Math.min(selected_index, resolved_value.length - 1)
|
|
151
|
+
);
|
|
152
|
+
}
|
|
143
153
|
dispatch("select", {
|
|
144
154
|
index: selected_index,
|
|
145
155
|
value: resolved_value?.[selected_index]
|