gradio-pr-bot commited on
Commit
a0df575
·
verified ·
1 Parent(s): 38a7578

Upload folder using huggingface_hub

Browse files
6.13.0/imageslider/Index.svelte CHANGED
@@ -30,8 +30,6 @@
30
  const props = $props();
31
  const gradio = new ImageSliderGradio(props);
32
 
33
- let value_is_output = $state(false);
34
- let old_value = $state(gradio.props.value);
35
  let fullscreen = $state(false);
36
  let dragging = $state(false);
37
  let active_source: sources = $state(null);
@@ -41,15 +39,7 @@
41
  Math.max(0, Math.min(100, gradio.props.slider_position)) / 100
42
  );
43
 
44
- $effect(() => {
45
- if (old_value != gradio.props.value) {
46
- old_value = gradio.props.value;
47
- gradio.dispatch("change");
48
- if (!value_is_output) {
49
- gradio.dispatch("input");
50
- }
51
- }
52
- });
53
 
54
  const handle_drag_event = (event: Event): void => {
55
  const drag_event = event as DragEvent;
@@ -101,7 +91,10 @@
101
  on:select={({ detail }) => gradio.dispatch("select", detail)}
102
  on:share={({ detail }) => gradio.dispatch("share", detail)}
103
  on:error={({ detail }) => gradio.dispatch("error", detail)}
104
- on:clear={() => gradio.dispatch("clear")}
 
 
 
105
  on:fullscreen={({ detail }) => {
106
  fullscreen = detail;
107
  }}
@@ -162,9 +155,13 @@
162
  on:edit={() => gradio.dispatch("edit")}
163
  on:clear={() => {
164
  gradio.dispatch("clear");
 
165
  }}
166
  on:drag={({ detail }) => (dragging = detail)}
167
- on:upload={() => gradio.dispatch("upload")}
 
 
 
168
  on:error={({ detail }) => {
169
  if (gradio.shared.loading_status)
170
  gradio.shared.loading_status.status = "error";
 
30
  const props = $props();
31
  const gradio = new ImageSliderGradio(props);
32
 
 
 
33
  let fullscreen = $state(false);
34
  let dragging = $state(false);
35
  let active_source: sources = $state(null);
 
39
  Math.max(0, Math.min(100, gradio.props.slider_position)) / 100
40
  );
41
 
42
+ gradio.watch_for_change();
 
 
 
 
 
 
 
 
43
 
44
  const handle_drag_event = (event: Event): void => {
45
  const drag_event = event as DragEvent;
 
91
  on:select={({ detail }) => gradio.dispatch("select", detail)}
92
  on:share={({ detail }) => gradio.dispatch("share", detail)}
93
  on:error={({ detail }) => gradio.dispatch("error", detail)}
94
+ on:clear={() => {
95
+ gradio.dispatch("clear");
96
+ gradio.dispatch("input");
97
+ }}
98
  on:fullscreen={({ detail }) => {
99
  fullscreen = detail;
100
  }}
 
155
  on:edit={() => gradio.dispatch("edit")}
156
  on:clear={() => {
157
  gradio.dispatch("clear");
158
+ gradio.dispatch("input");
159
  }}
160
  on:drag={({ detail }) => (dragging = detail)}
161
+ on:upload={() => {
162
+ gradio.dispatch("upload");
163
+ gradio.dispatch("input");
164
+ }}
165
  on:error={({ detail }) => {
166
  if (gradio.shared.loading_status)
167
  gradio.shared.loading_status.status = "error";
6.13.0/imageslider/package.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "@gradio/imageslider",
3
- "version": "0.4.7",
4
  "description": "Gradio UI packages",
5
  "type": "module",
6
  "author": "",
 
1
  {
2
  "name": "@gradio/imageslider",
3
+ "version": "0.5.0",
4
  "description": "Gradio UI packages",
5
  "type": "module",
6
  "author": "",
6.13.0/imageslider/shared/ImageEl.svelte CHANGED
@@ -85,6 +85,7 @@
85
  <!-- svelte-ignore a11y-missing-attribute -->
86
  <img
87
  {src}
 
88
  {...$$restProps}
89
  class:fixed
90
  style:transform
 
85
  <!-- svelte-ignore a11y-missing-attribute -->
86
  <img
87
  {src}
88
+ data-testid="imageslider-image"
89
  {...$$restProps}
90
  class:fixed
91
  style:transform
6.13.0/imageslider/shared/Slider.svelte CHANGED
@@ -89,6 +89,7 @@
89
  <div
90
  class="outer"
91
  class:disabled
 
92
  bind:this={inner}
93
  role="none"
94
  style="transform: translateX({px}px)"
 
89
  <div
90
  class="outer"
91
  class:disabled
92
+ data-testid="slider"
93
  bind:this={inner}
94
  role="none"
95
  style="transform: translateX({px}px)"