@gradio/imageeditor 0.7.13 → 0.8.0
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,25 @@
|
|
|
1
1
|
# @gradio/imageeditor
|
|
2
2
|
|
|
3
|
+
## 0.8.0
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- [#8803](https://github.com/gradio-app/gradio/pull/8803) [`e1a4040`](https://github.com/gradio-app/gradio/commit/e1a404093cfaf9d8f2a92bc1d28fb6aa254848d1) - Ensure all upload components have consistent upload regions. Thanks @pngwn!
|
|
8
|
+
|
|
9
|
+
### Fixes
|
|
10
|
+
|
|
11
|
+
- [#8802](https://github.com/gradio-app/gradio/pull/8802) [`7b19474`](https://github.com/gradio-app/gradio/commit/7b19474cb2dd8f2c34d630f43edb0fcb0e05aa0c) - Ensure `ImageEditor` brush color can be updated with `gr.update`. Thanks @pngwn!
|
|
12
|
+
- [#8852](https://github.com/gradio-app/gradio/pull/8852) [`16b8200`](https://github.com/gradio-app/gradio/commit/16b820038df43905447ab7623d39d91ceb0d6238) - Fix gr.Image height inconsistencies. Thanks @hannahblair!
|
|
13
|
+
|
|
14
|
+
### Dependency updates
|
|
15
|
+
|
|
16
|
+
- @gradio/wasm@0.12.0
|
|
17
|
+
- @gradio/client@1.4.0
|
|
18
|
+
- @gradio/image@0.13.0
|
|
19
|
+
- @gradio/statustracker@0.7.2
|
|
20
|
+
- @gradio/upload@0.12.0
|
|
21
|
+
- @gradio/atoms@0.7.7
|
|
22
|
+
|
|
3
23
|
## 0.7.13
|
|
4
24
|
|
|
5
25
|
### Dependency updates
|
package/Index.svelte
CHANGED
|
@@ -117,6 +117,8 @@
|
|
|
117
117
|
tick().then((_) => (value_is_output = false));
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
+
|
|
121
|
+
$: has_value = value?.background || value?.layers?.length || value?.composite;
|
|
120
122
|
</script>
|
|
121
123
|
|
|
122
124
|
{#if !interactive}
|
|
@@ -156,7 +158,7 @@
|
|
|
156
158
|
{:else}
|
|
157
159
|
<Block
|
|
158
160
|
{visible}
|
|
159
|
-
variant={
|
|
161
|
+
variant={has_value ? "solid" : "dashed"}
|
|
160
162
|
border_mode={dragging ? "focus" : "base"}
|
|
161
163
|
padding={false}
|
|
162
164
|
{elem_id}
|
|
@@ -176,6 +178,7 @@
|
|
|
176
178
|
/>
|
|
177
179
|
|
|
178
180
|
<InteractiveImageEditor
|
|
181
|
+
bind:dragging
|
|
179
182
|
{canvas_size}
|
|
180
183
|
on:change={() => handle_history_change()}
|
|
181
184
|
bind:image_id
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/imageeditor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Gradio UI packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "",
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
"@types/tinycolor2": "^1.4.6",
|
|
11
11
|
"pixi.js": "^7.3.2",
|
|
12
12
|
"tinycolor2": "^1.6.0",
|
|
13
|
+
"@gradio/atoms": "^0.7.7",
|
|
14
|
+
"@gradio/client": "^1.4.0",
|
|
13
15
|
"@gradio/icons": "^0.6.0",
|
|
14
|
-
"@gradio/
|
|
15
|
-
"@gradio/image": "^0.
|
|
16
|
-
"@gradio/
|
|
17
|
-
"@gradio/statustracker": "^0.7.1",
|
|
18
|
-
"@gradio/upload": "^0.11.5",
|
|
16
|
+
"@gradio/statustracker": "^0.7.2",
|
|
17
|
+
"@gradio/image": "^0.13.0",
|
|
18
|
+
"@gradio/upload": "^0.12.0",
|
|
19
19
|
"@gradio/utils": "^0.5.1",
|
|
20
|
-
"@gradio/wasm": "^0.
|
|
20
|
+
"@gradio/wasm": "^0.12.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@gradio/preview": "^0.10.1"
|
|
@@ -357,7 +357,8 @@
|
|
|
357
357
|
<slot />
|
|
358
358
|
</div>
|
|
359
359
|
<div
|
|
360
|
-
class="
|
|
360
|
+
class="canvas"
|
|
361
|
+
class:no-border={!bg && $active_tool === "bg" && !history}
|
|
361
362
|
style:width="{$crop[2] * $editor_box.child_width + 1}px"
|
|
362
363
|
style:height="{$crop[3] * $editor_box.child_height + 1}px"
|
|
363
364
|
style:top="{$crop[1] * $editor_box.child_height +
|
|
@@ -378,13 +379,17 @@
|
|
|
378
379
|
justify-content: center;
|
|
379
380
|
align-items: flex-start;
|
|
380
381
|
}
|
|
381
|
-
.
|
|
382
|
+
.canvas {
|
|
382
383
|
position: absolute;
|
|
383
384
|
border: var(--block-border-color) 1px solid;
|
|
384
385
|
pointer-events: none;
|
|
385
386
|
border-radius: var(--radius-md);
|
|
386
387
|
}
|
|
387
388
|
|
|
389
|
+
.no-border {
|
|
390
|
+
border: none;
|
|
391
|
+
}
|
|
392
|
+
|
|
388
393
|
.stage-wrap {
|
|
389
394
|
margin: var(--size-8);
|
|
390
395
|
margin-bottom: var(--size-1);
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
export let realtime: boolean;
|
|
49
49
|
export let upload: Client["upload"];
|
|
50
50
|
export let stream_handler: Client["stream"];
|
|
51
|
+
export let dragging: boolean;
|
|
51
52
|
|
|
52
53
|
const dispatch = createEventDispatcher<{
|
|
53
54
|
clear?: never;
|
|
@@ -221,6 +222,7 @@
|
|
|
221
222
|
<Layers layer_files={value?.layers || null} enable_layers={layers} />
|
|
222
223
|
|
|
223
224
|
<Sources
|
|
225
|
+
bind:dragging
|
|
224
226
|
{i18n}
|
|
225
227
|
{root}
|
|
226
228
|
{sources}
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
export let color_mode: Brush["color_mode"] | undefined = undefined;
|
|
44
44
|
export let mode: "erase" | "draw";
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
$: processed_colors = colors
|
|
47
47
|
? colors.map(process_color).filter((_, i) => i < 4)
|
|
48
48
|
: [];
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
$: selected_color =
|
|
51
51
|
default_color === "auto"
|
|
52
52
|
? processed_colors[0]
|
|
53
53
|
: !default_color
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
export let i18n: I18nFormatter;
|
|
28
28
|
export let upload: Client["upload"];
|
|
29
29
|
export let stream_handler: Client["stream"];
|
|
30
|
+
export let dragging: boolean;
|
|
30
31
|
|
|
31
32
|
const { active_tool } = getContext<ToolContext>(TOOL_KEY);
|
|
32
33
|
const { pixi, dimensions, register_context, reset, editor_box } =
|
|
@@ -179,13 +180,21 @@
|
|
|
179
180
|
{/each}
|
|
180
181
|
<span class="sep"></span>
|
|
181
182
|
</div>
|
|
182
|
-
<div
|
|
183
|
+
<div
|
|
184
|
+
class="upload-container"
|
|
185
|
+
class:click-disabled={!!bg ||
|
|
186
|
+
active_mode === "webcam" ||
|
|
187
|
+
$active_tool !== "bg"}
|
|
188
|
+
style:height="{$editor_box.child_height +
|
|
189
|
+
($editor_box.child_top - $editor_box.parent_top)}px"
|
|
190
|
+
>
|
|
183
191
|
<Upload
|
|
184
|
-
hidden={
|
|
192
|
+
hidden={bg || active_mode === "webcam" || $active_tool !== "bg"}
|
|
185
193
|
bind:this={upload_component}
|
|
186
194
|
filetype="image/*"
|
|
187
195
|
on:load={handle_upload}
|
|
188
196
|
on:error
|
|
197
|
+
bind:dragging
|
|
189
198
|
{root}
|
|
190
199
|
disable_click={!sources.includes("upload")}
|
|
191
200
|
format="blob"
|
|
@@ -250,4 +259,18 @@
|
|
|
250
259
|
margin-left: var(--spacing-lg);
|
|
251
260
|
height: 100%;
|
|
252
261
|
}
|
|
262
|
+
|
|
263
|
+
.upload-container {
|
|
264
|
+
position: absolute;
|
|
265
|
+
height: 100%;
|
|
266
|
+
flex-shrink: 1;
|
|
267
|
+
max-height: 100%;
|
|
268
|
+
width: 100%;
|
|
269
|
+
left: 0;
|
|
270
|
+
top: 0;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.upload-container.click-disabled {
|
|
274
|
+
pointer-events: none;
|
|
275
|
+
}
|
|
253
276
|
</style>
|