@gradio/imageeditor 0.3.0 → 0.3.2
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 +20 -2
- package/ImageEditor.stories.svelte +21 -4
- package/Index.svelte +2 -0
- package/package.json +8 -8
- package/shared/Controls.svelte +0 -4
- package/shared/InteractiveImageEditor.svelte +9 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,34 @@
|
|
|
1
1
|
# @gradio/imageeditor
|
|
2
2
|
|
|
3
|
+
## 0.3.2
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- [#7219](https://github.com/gradio-app/gradio/pull/7219) [`faead14`](https://github.com/gradio-app/gradio/commit/faead1403cdba6415912a6ad512291ac63b04173) - Show label in interactive image editor. Thanks [@hannahblair](https://github.com/hannahblair)!
|
|
8
|
+
|
|
9
|
+
## 0.3.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`5727b92`](https://github.com/gradio-app/gradio/commit/5727b92abc8a00a675bfc0a921b38de771af947b), [`bc2cdc1`](https://github.com/gradio-app/gradio/commit/bc2cdc1df95b38025486cf76df4a494b66d98585), [`c60ad4d`](https://github.com/gradio-app/gradio/commit/c60ad4d34ab5b56a89bf6796822977e51e7a4a32), [`be56c76`](https://github.com/gradio-app/gradio/commit/be56c76c7b5d2814ea8239c7dbeddc4b1d3701c4), [`8c355a4`](https://github.com/gradio-app/gradio/commit/8c355a47844296e3aab250fe61e2ecc706122e78)]:
|
|
14
|
+
- @gradio/utils@0.2.1
|
|
15
|
+
- @gradio/upload@0.7.0
|
|
16
|
+
- @gradio/atoms@0.5.0
|
|
17
|
+
- @gradio/wasm@0.5.1
|
|
18
|
+
- @gradio/image@0.7.1
|
|
19
|
+
- @gradio/statustracker@0.4.4
|
|
20
|
+
|
|
3
21
|
## 0.3.0
|
|
4
22
|
|
|
5
23
|
### Fixes
|
|
6
24
|
|
|
7
|
-
- [#6933](https://github.com/gradio-app/gradio/pull/6933) [`9cefd2e`](https://github.com/gradio-app/gradio/commit/9cefd2e90a1d0cc4d3e4e953fc5b9b1a7afb68dd) - Refactor examples so they accept data in the same format as is returned by function, rename `.as_example()` to `.process_example()`.
|
|
25
|
+
- [#6933](https://github.com/gradio-app/gradio/pull/6933) [`9cefd2e`](https://github.com/gradio-app/gradio/commit/9cefd2e90a1d0cc4d3e4e953fc5b9b1a7afb68dd) - Refactor examples so they accept data in the same format as is returned by function, rename `.as_example()` to `.process_example()`. Thanks [@abidlabs](https://github.com/abidlabs)!
|
|
8
26
|
|
|
9
27
|
## 0.2.3
|
|
10
28
|
|
|
11
29
|
### Fixes
|
|
12
30
|
|
|
13
|
-
- [#6885](https://github.com/gradio-app/gradio/pull/6885) [`640b7fe`](https://github.com/gradio-app/gradio/commit/640b7fe05276e11720b4341cadf088491395e53d) - Fix issue with Webcam Recording.
|
|
31
|
+
- [#6885](https://github.com/gradio-app/gradio/pull/6885) [`640b7fe`](https://github.com/gradio-app/gradio/commit/640b7fe05276e11720b4341cadf088491395e53d) - Fix issue with Webcam Recording. Thanks [@dawoodkhan82](https://github.com/dawoodkhan82)!
|
|
14
32
|
|
|
15
33
|
## 0.2.2
|
|
16
34
|
|
|
@@ -1,13 +1,25 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
1
|
+
<script context="module">
|
|
2
|
+
import { Template, Story } from "@storybook/addon-svelte-csf";
|
|
3
3
|
import ImageEditor from "./Index.svelte";
|
|
4
4
|
import { format } from "svelte-i18n";
|
|
5
5
|
import { get } from "svelte/store";
|
|
6
6
|
import { userEvent, within } from "@storybook/testing-library";
|
|
7
|
+
import { allModes } from "../storybook/modes";
|
|
8
|
+
|
|
9
|
+
export const meta = {
|
|
10
|
+
title: "Components/Image Editor",
|
|
11
|
+
component: ImageEditor,
|
|
12
|
+
parameters: {
|
|
13
|
+
chromatic: {
|
|
14
|
+
modes: {
|
|
15
|
+
desktop: allModes["desktop"],
|
|
16
|
+
mobile: allModes["mobile"]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
7
21
|
</script>
|
|
8
22
|
|
|
9
|
-
<Meta title="Components/Image Editor" component={ImageEditor} />
|
|
10
|
-
|
|
11
23
|
<Template let:args>
|
|
12
24
|
<div
|
|
13
25
|
class="image-container"
|
|
@@ -23,6 +35,8 @@
|
|
|
23
35
|
sources: ["webcam", "upload"],
|
|
24
36
|
type: "pil",
|
|
25
37
|
interactive: "true",
|
|
38
|
+
label: "Image Editor",
|
|
39
|
+
show_label: true,
|
|
26
40
|
brush: {
|
|
27
41
|
default_size: "auto",
|
|
28
42
|
colors: ["#ff0000", "#00ff00", "#0000ff"],
|
|
@@ -37,6 +51,9 @@
|
|
|
37
51
|
|
|
38
52
|
<Story
|
|
39
53
|
name="Image Editor Interactions"
|
|
54
|
+
parameters={{
|
|
55
|
+
diffThreshold: 0.1
|
|
56
|
+
}}
|
|
40
57
|
args={{
|
|
41
58
|
value: {
|
|
42
59
|
path: "https://gradio-builds.s3.amazonaws.com/demo-files/ghepardo-primo-piano.jpg",
|
package/Index.svelte
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/imageeditor",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
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.
|
|
14
|
-
"@gradio/
|
|
15
|
-
"@gradio/
|
|
16
|
-
"@gradio/image": "^0.7.0",
|
|
13
|
+
"@gradio/atoms": "^0.5.1",
|
|
14
|
+
"@gradio/client": "^0.11.0",
|
|
15
|
+
"@gradio/image": "^0.8.0",
|
|
17
16
|
"@gradio/icons": "^0.3.2",
|
|
18
|
-
"@gradio/
|
|
19
|
-
"@gradio/upload": "^0.
|
|
20
|
-
"@gradio/
|
|
17
|
+
"@gradio/statustracker": "^0.4.5",
|
|
18
|
+
"@gradio/upload": "^0.7.1",
|
|
19
|
+
"@gradio/utils": "^0.2.2",
|
|
20
|
+
"@gradio/wasm": "^0.6.0"
|
|
21
21
|
},
|
|
22
22
|
"main_changeset": true,
|
|
23
23
|
"main": "./Index.svelte",
|
package/shared/Controls.svelte
CHANGED
|
@@ -29,12 +29,16 @@
|
|
|
29
29
|
export let brush: IBrush | null;
|
|
30
30
|
export let eraser: Eraser | null;
|
|
31
31
|
import { Tools, Crop, Brush, Sources } from "./tools";
|
|
32
|
+
import { BlockLabel } from "@gradio/atoms";
|
|
33
|
+
import { Image as ImageIcon } from "@gradio/icons";
|
|
32
34
|
|
|
33
35
|
export let sources: ("clipboard" | "webcam" | "upload")[];
|
|
34
36
|
export let crop_size: [number, number] | `${string}:${string}` | null = null;
|
|
35
37
|
export let i18n: I18nFormatter;
|
|
36
38
|
export let root: string;
|
|
37
39
|
export let proxy_url: string;
|
|
40
|
+
export let label: string | undefined = undefined;
|
|
41
|
+
export let show_label: boolean;
|
|
38
42
|
export let changeable = false;
|
|
39
43
|
export let value: EditorData | null = {
|
|
40
44
|
background: null,
|
|
@@ -111,6 +115,11 @@
|
|
|
111
115
|
: editor.set_tool("draw"));
|
|
112
116
|
</script>
|
|
113
117
|
|
|
118
|
+
<BlockLabel
|
|
119
|
+
{show_label}
|
|
120
|
+
Icon={ImageIcon}
|
|
121
|
+
label={label || i18n("image.image")}
|
|
122
|
+
/>
|
|
114
123
|
<ImageEditor
|
|
115
124
|
bind:this={editor}
|
|
116
125
|
{changeable}
|