@gradio/gallery 0.17.4 → 0.17.5

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,21 @@
1
1
  # @gradio/gallery
2
2
 
3
+ ## 0.17.5
4
+
5
+ ### Fixes
6
+
7
+ - [#13178](https://github.com/gradio-app/gradio/pull/13178) [`d815881`](https://github.com/gradio-app/gradio/commit/d815881739689f45f5387ea52cc92e2cddf8adcf) - fix(gallery): prevent incorrect selected_index clamping on image append. Thanks @Gopesh111!
8
+
9
+ ### Dependency updates
10
+
11
+ - @gradio/utils@0.12.2
12
+ - @gradio/atoms@0.23.0
13
+ - @gradio/statustracker@0.13.1
14
+ - @gradio/upload@0.17.8
15
+ - @gradio/image@0.26.1
16
+ - @gradio/video@0.20.6
17
+ - @gradio/file@0.14.6
18
+
3
19
  ## 0.17.4
4
20
 
5
21
  ### Dependency updates
@@ -229,15 +229,13 @@
229
229
  }
230
230
 
231
231
  $effect(() => {
232
+ // Only trigger the effect if the selected_index has actually changed
232
233
  if (selected_index !== old_selected_index) {
233
234
  old_selected_index = selected_index;
234
- if (selected_index !== null) {
235
- if (resolved_value != null) {
236
- selected_index = Math.max(
237
- 0,
238
- Math.min(selected_index, resolved_value.length - 1)
239
- );
240
- }
235
+
236
+ // Ensure we have a valid selection and data to work with
237
+ if (selected_index !== null && resolved_value !== null) {
238
+ // Notify the parent component or listener about the updated selection
241
239
  onselect({
242
240
  index: selected_index,
243
241
  value: resolved_value?.[selected_index]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/gallery",
3
- "version": "0.17.4",
3
+ "version": "0.17.5",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
@@ -8,18 +8,18 @@
8
8
  "private": false,
9
9
  "dependencies": {
10
10
  "dequal": "^2.0.3",
11
- "@gradio/atoms": "^0.22.2",
11
+ "@gradio/atoms": "^0.23.0",
12
+ "@gradio/file": "^0.14.6",
12
13
  "@gradio/client": "^2.1.0",
13
- "@gradio/file": "^0.14.5",
14
- "@gradio/image": "^0.26.0",
15
- "@gradio/statustracker": "^0.13.0",
14
+ "@gradio/image": "^0.26.1",
15
+ "@gradio/statustracker": "^0.13.1",
16
16
  "@gradio/icons": "^0.15.1",
17
- "@gradio/upload": "^0.17.7",
18
- "@gradio/utils": "^0.12.1",
19
- "@gradio/video": "^0.20.5"
17
+ "@gradio/utils": "^0.12.2",
18
+ "@gradio/video": "^0.20.6",
19
+ "@gradio/upload": "^0.17.8"
20
20
  },
21
21
  "devDependencies": {
22
- "@gradio/preview": "^0.16.1"
22
+ "@gradio/preview": "^0.16.2"
23
23
  },
24
24
  "main": "./Index.svelte",
25
25
  "main_changeset": true,
@@ -229,15 +229,13 @@
229
229
  }
230
230
 
231
231
  $effect(() => {
232
+ // Only trigger the effect if the selected_index has actually changed
232
233
  if (selected_index !== old_selected_index) {
233
234
  old_selected_index = selected_index;
234
- if (selected_index !== null) {
235
- if (resolved_value != null) {
236
- selected_index = Math.max(
237
- 0,
238
- Math.min(selected_index, resolved_value.length - 1)
239
- );
240
- }
235
+
236
+ // Ensure we have a valid selection and data to work with
237
+ if (selected_index !== null && resolved_value !== null) {
238
+ // Notify the parent component or listener about the updated selection
241
239
  onselect({
242
240
  index: selected_index,
243
241
  value: resolved_value?.[selected_index]