@gradio/imageeditor 0.1.4 → 0.1.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,11 @@
1
1
  # @gradio/imageeditor
2
2
 
3
+ ## 0.1.5
4
+
5
+ ### Fixes
6
+
7
+ - [#6799](https://github.com/gradio-app/gradio/pull/6799) [`c352811`](https://github.com/gradio-app/gradio/commit/c352811f76d4126613ece0a584f8c552fdd8d1f6) - Adds docstrings for `gr.WaveformOptions`, `gr.Brush`, and `gr.Eraser`, fixes examples for `ImageEditor`, and allows individual images to be used as the initial `value` for `ImageEditor`. Thanks [@abidlabs](https://github.com/abidlabs)!
8
+
3
9
  ## 0.1.4
4
10
 
5
11
  ### Patch Changes
@@ -96,4 +102,4 @@ Thanks [@pngwn](https://github.com/pngwn)!
96
102
 
97
103
  - [#6502](https://github.com/gradio-app/gradio/pull/6502) [`070f71c93`](https://github.com/gradio-app/gradio/commit/070f71c933d846ce8e2fe11cdd9bc0f3f897f29f) - Ensure image editor crop and draw cursor works as expected when the scroll position changes. Thanks [@pngwn](https://github.com/pngwn)!
98
104
 
99
- # @gradio/image
105
+ # @gradio/image
package/Example.svelte CHANGED
@@ -1,7 +1,8 @@
1
1
  <script lang="ts">
2
2
  import { BaseImage as Image } from "@gradio/image";
3
+ import type { EditorData } from "./shared/InteractiveImageEditor.svelte";
3
4
 
4
- export let value: string;
5
+ export let value: EditorData;
5
6
  export let samples_dir: string;
6
7
  export let type: "gallery" | "table";
7
8
  export let selected = false;
@@ -13,10 +14,15 @@
13
14
  class:gallery={type === "gallery"}
14
15
  class:selected
15
16
  >
16
- <Image src={samples_dir + value} alt="" />
17
+ <Image src={samples_dir + (value.composite || value.background)} alt="" />
17
18
  </div>
18
19
 
19
20
  <style>
21
+ .container :global(img) {
22
+ width: 100%;
23
+ height: 100%;
24
+ }
25
+
20
26
  .container.selected {
21
27
  border-color: var(--border-color-accent);
22
28
  }
@@ -25,17 +25,12 @@
25
25
  interactive: "true",
26
26
  brush: {
27
27
  default_size: "auto",
28
- sizes: "auto",
29
- size_mode: "fixed",
30
- antialias: true,
31
28
  colors: ["#ff0000", "#00ff00", "#0000ff"],
32
- default_color: "#ff0000"
29
+ default_color: "#ff0000",
30
+ color_mode: "defaults"
33
31
  },
34
32
  eraser: {
35
- default_size: "auto",
36
- sizes: "auto",
37
- size_mode: "fixed",
38
- antialias: true
33
+ default_size: "auto"
39
34
  }
40
35
  }}
41
36
  />
@@ -53,17 +48,12 @@
53
48
  interactive: "true",
54
49
  brush: {
55
50
  default_size: "auto",
56
- sizes: "auto",
57
- size_mode: "fixed",
58
- antialias: true,
59
51
  colors: ["#ff0000", "#00ff00", "#0000ff"],
60
- default_color: "#ff0000"
52
+ default_color: "#ff0000",
53
+ color_mode: "defaults"
61
54
  },
62
55
  eraser: {
63
- default_size: "auto",
64
- sizes: "auto",
65
- size_mode: "fixed",
66
- antialias: true
56
+ default_size: "auto"
67
57
  }
68
58
  }}
69
59
  play={async ({ canvasElement }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/imageeditor",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
@@ -11,13 +11,13 @@
11
11
  "pixi.js": "^7.3.2",
12
12
  "tinycolor2": "^1.6.0",
13
13
  "@gradio/atoms": "^0.4.0",
14
- "@gradio/client": "^0.9.1",
14
+ "@gradio/client": "^0.9.2",
15
15
  "@gradio/icons": "^0.3.2",
16
+ "@gradio/image": "^0.5.2",
16
17
  "@gradio/statustracker": "^0.4.2",
17
- "@gradio/image": "^0.5.1",
18
- "@gradio/upload": "^0.5.4",
19
18
  "@gradio/utils": "^0.2.0",
20
- "@gradio/wasm": "^0.4.0"
19
+ "@gradio/wasm": "^0.4.0",
20
+ "@gradio/upload": "^0.5.5"
21
21
  },
22
22
  "main_changeset": true,
23
23
  "main": "./Index.svelte",
@@ -6,18 +6,6 @@
6
6
  * The default size of the eraser.
7
7
  */
8
8
  default_size: number | "auto";
9
- /**
10
- * The sizes to show in the size swatch
11
- */
12
- sizes: number[] | "auto";
13
- /**
14
- * Whether to show _only_ the sizes specified in `sizes`, or to show the sizes specified in `sizes` along with the size slider.
15
- */
16
- size_mode: "fixed" | "defaults";
17
- /**
18
- * Whether to use antialiasing when drawing the eraser.
19
- */
20
- antialias: boolean;
21
9
  }
22
10
 
23
11
  export interface Brush extends Eraser {