@gradio/image 0.22.5 → 0.22.7

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,26 @@
1
1
  # @gradio/image
2
2
 
3
+ ## 0.22.7
4
+
5
+ ### Dependency updates
6
+
7
+ - @gradio/statustracker@0.10.12
8
+ - @gradio/client@1.15.1
9
+ - @gradio/upload@0.16.6
10
+
11
+ ## 0.22.6
12
+
13
+ ### Features
14
+
15
+ - [#11177](https://github.com/gradio-app/gradio/pull/11177) [`3068196`](https://github.com/gradio-app/gradio/commit/3068196d47234fd1c1634f33b9ddfc089f5cbbe0) - Improved, smoother fullscreen mode for components. Thanks @aliabid94!
16
+
17
+ ### Dependency updates
18
+
19
+ - @gradio/statustracker@0.10.11
20
+ - @gradio/atoms@0.16.1
21
+ - @gradio/client@1.15.0
22
+ - @gradio/upload@0.16.5
23
+
3
24
  ## 0.22.5
4
25
 
5
26
  ### Fixes
@@ -51,7 +51,7 @@
51
51
  const canvas = within(canvasElement);
52
52
 
53
53
  const expand_btn = canvas.getByRole("button", {
54
- name: "View in full screen"
54
+ name: "Fullscreen"
55
55
  });
56
56
  await userEvent.click(expand_btn);
57
57
  }}
package/Index.svelte CHANGED
@@ -66,6 +66,7 @@
66
66
  export let show_fullscreen_button: boolean;
67
67
  export let input_ready: boolean;
68
68
  export let webcam_options: WebcamOptions;
69
+ let fullscreen = false;
69
70
 
70
71
  let uploading = false;
71
72
  $: input_ready = !uploading;
@@ -140,6 +141,7 @@
140
141
  {container}
141
142
  {scale}
142
143
  {min_width}
144
+ bind:fullscreen
143
145
  >
144
146
  <StatusTracker
145
147
  autoscroll={gradio.autoscroll}
@@ -150,6 +152,10 @@
150
152
  on:select={({ detail }) => gradio.dispatch("select", detail)}
151
153
  on:share={({ detail }) => gradio.dispatch("share", detail)}
152
154
  on:error={({ detail }) => gradio.dispatch("error", detail)}
155
+ on:fullscreen={({ detail }) => {
156
+ fullscreen = detail;
157
+ }}
158
+ {fullscreen}
153
159
  {value}
154
160
  {label}
155
161
  {show_label}
@@ -174,6 +180,7 @@
174
180
  {container}
175
181
  {scale}
176
182
  {min_width}
183
+ bind:fullscreen
177
184
  on:dragenter={handle_drag_event}
178
185
  on:dragleave={handle_drag_event}
179
186
  on:dragover={handle_drag_event}
@@ -195,6 +202,7 @@
195
202
  selectable={_selectable}
196
203
  {root}
197
204
  {sources}
205
+ {fullscreen}
198
206
  on:edit={() => gradio.dispatch("edit")}
199
207
  on:clear={() => {
200
208
  gradio.dispatch("clear");
@@ -212,6 +220,9 @@
212
220
  on:close_stream={() => {
213
221
  gradio.dispatch("close_stream", "stream");
214
222
  }}
223
+ on:fullscreen={({ detail }) => {
224
+ fullscreen = detail;
225
+ }}
215
226
  {label}
216
227
  {show_label}
217
228
  {pending}
package/dist/Index.svelte CHANGED
@@ -54,6 +54,7 @@ export let placeholder = void 0;
54
54
  export let show_fullscreen_button;
55
55
  export let input_ready;
56
56
  export let webcam_options;
57
+ let fullscreen = false;
57
58
  let uploading = false;
58
59
  $:
59
60
  input_ready = !uploading;
@@ -110,6 +111,7 @@ const handle_drop = (event) => {
110
111
  {container}
111
112
  {scale}
112
113
  {min_width}
114
+ bind:fullscreen
113
115
  >
114
116
  <StatusTracker
115
117
  autoscroll={gradio.autoscroll}
@@ -120,6 +122,10 @@ const handle_drop = (event) => {
120
122
  on:select={({ detail }) => gradio.dispatch("select", detail)}
121
123
  on:share={({ detail }) => gradio.dispatch("share", detail)}
122
124
  on:error={({ detail }) => gradio.dispatch("error", detail)}
125
+ on:fullscreen={({ detail }) => {
126
+ fullscreen = detail;
127
+ }}
128
+ {fullscreen}
123
129
  {value}
124
130
  {label}
125
131
  {show_label}
@@ -144,6 +150,7 @@ const handle_drop = (event) => {
144
150
  {container}
145
151
  {scale}
146
152
  {min_width}
153
+ bind:fullscreen
147
154
  on:dragenter={handle_drag_event}
148
155
  on:dragleave={handle_drag_event}
149
156
  on:dragover={handle_drag_event}
@@ -165,6 +172,7 @@ const handle_drop = (event) => {
165
172
  selectable={_selectable}
166
173
  {root}
167
174
  {sources}
175
+ {fullscreen}
168
176
  on:edit={() => gradio.dispatch("edit")}
169
177
  on:clear={() => {
170
178
  gradio.dispatch("clear");
@@ -182,6 +190,9 @@ const handle_drop = (event) => {
182
190
  on:close_stream={() => {
183
191
  gradio.dispatch("close_stream", "stream");
184
192
  }}
193
+ on:fullscreen={({ detail }) => {
194
+ fullscreen = detail;
195
+ }}
185
196
  {label}
186
197
  {show_label}
187
198
  {pending}
@@ -21,6 +21,7 @@ export let show_share_button = false;
21
21
  export let i18n;
22
22
  export let show_fullscreen_button = true;
23
23
  export let display_icon_button_wrapper_top_corner = false;
24
+ export let fullscreen = false;
24
25
  const dispatch = createEventDispatcher();
25
26
  const handle_click = (evt) => {
26
27
  let coordinates = get_coordinates_of_clicked_image(evt);
@@ -44,7 +45,7 @@ let image_container;
44
45
  display_top_corner={display_icon_button_wrapper_top_corner}
45
46
  >
46
47
  {#if show_fullscreen_button}
47
- <FullscreenButton container={image_container} />
48
+ <FullscreenButton {fullscreen} on:fullscreen />
48
49
  {/if}
49
50
 
50
51
  {#if show_download_button}
@@ -13,8 +13,10 @@ declare const __propDef: {
13
13
  i18n: I18nFormatter;
14
14
  show_fullscreen_button?: boolean | undefined;
15
15
  display_icon_button_wrapper_top_corner?: boolean | undefined;
16
+ fullscreen?: boolean | undefined;
16
17
  };
17
18
  events: {
19
+ fullscreen: CustomEvent<any>;
18
20
  share: CustomEvent<import("@gradio/utils").ShareData>;
19
21
  error: CustomEvent<string>;
20
22
  load: Event;
@@ -30,6 +30,7 @@ export let show_fullscreen_button = true;
30
30
  let upload_input;
31
31
  export let uploading = false;
32
32
  export let active_source = null;
33
+ export let fullscreen = false;
33
34
  async function handle_upload({
34
35
  detail
35
36
  }) {
@@ -129,7 +130,7 @@ async function on_drop(evt) {
129
130
  <IconButtonWrapper>
130
131
  {#if value?.url && !active_streaming}
131
132
  {#if show_fullscreen_button}
132
- <FullscreenButton container={image_container} />
133
+ <FullscreenButton {fullscreen} on:fullscreen />
133
134
  {/if}
134
135
  <IconButton
135
136
  Icon={Clear}
@@ -23,9 +23,11 @@ declare const __propDef: {
23
23
  show_fullscreen_button?: boolean | undefined;
24
24
  uploading?: boolean | undefined;
25
25
  active_source?: ("clipboard" | "upload" | "microphone" | "webcam" | null) | undefined;
26
+ fullscreen?: boolean | undefined;
26
27
  dragging?: boolean | undefined;
27
28
  };
28
29
  events: {
30
+ fullscreen: CustomEvent<boolean>;
29
31
  error: CustomEvent<string> | CustomEvent<any>;
30
32
  drag: CustomEvent<any>;
31
33
  close_stream: CustomEvent<undefined>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/image",
3
- "version": "0.22.5",
3
+ "version": "0.22.7",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
@@ -10,13 +10,13 @@
10
10
  "cropperjs": "^1.5.12",
11
11
  "lazy-brush": "^1.0.1",
12
12
  "resize-observer-polyfill": "^1.5.1",
13
- "@gradio/client": "^1.14.2",
13
+ "@gradio/atoms": "^0.16.1",
14
+ "@gradio/client": "^1.15.1",
14
15
  "@gradio/icons": "^0.12.0",
15
- "@gradio/statustracker": "^0.10.10",
16
- "@gradio/upload": "^0.16.4",
17
- "@gradio/atoms": "^0.16.0",
18
- "@gradio/utils": "^0.10.2",
19
- "@gradio/wasm": "^0.18.1"
16
+ "@gradio/statustracker": "^0.10.12",
17
+ "@gradio/upload": "^0.16.6",
18
+ "@gradio/wasm": "^0.18.1",
19
+ "@gradio/utils": "^0.10.2"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@gradio/preview": "^0.13.0"
@@ -27,10 +27,12 @@
27
27
  export let i18n: I18nFormatter;
28
28
  export let show_fullscreen_button = true;
29
29
  export let display_icon_button_wrapper_top_corner = false;
30
+ export let fullscreen = false;
30
31
 
31
32
  const dispatch = createEventDispatcher<{
32
33
  change: string;
33
34
  select: SelectData;
35
+ fullscreen: boolean;
34
36
  }>();
35
37
 
36
38
  const handle_click = (evt: MouseEvent): void => {
@@ -56,7 +58,7 @@
56
58
  display_top_corner={display_icon_button_wrapper_top_corner}
57
59
  >
58
60
  {#if show_fullscreen_button}
59
- <FullscreenButton container={image_container} />
61
+ <FullscreenButton {fullscreen} on:fullscreen />
60
62
  {/if}
61
63
 
62
64
  {#if show_download_button}
@@ -42,6 +42,7 @@
42
42
  let upload_input: Upload;
43
43
  export let uploading = false;
44
44
  export let active_source: source_type = null;
45
+ export let fullscreen = false;
45
46
 
46
47
  async function handle_upload({
47
48
  detail
@@ -167,7 +168,7 @@
167
168
  <IconButtonWrapper>
168
169
  {#if value?.url && !active_streaming}
169
170
  {#if show_fullscreen_button}
170
- <FullscreenButton container={image_container} />
171
+ <FullscreenButton {fullscreen} on:fullscreen />
171
172
  {/if}
172
173
  <IconButton
173
174
  Icon={Clear}