@erase2d/fabric 1.1.7 → 1.1.9

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/README.md CHANGED
@@ -24,10 +24,22 @@ object.clipPath instanceof ClippingGroup
24
24
  : delete object.clipPath;
25
25
  ```
26
26
 
27
+ ### Type Caveat
28
+
29
+ The `erasable` property is added by this module.
30
+ In case typescript fails to augment fabric, update your `tsconfig.ts`:
31
+
32
+ ```json
33
+ ...
34
+ "compilerOptions": {
35
+ "types": ["node_modules/@erase2d/fabric/types"]
36
+ }
37
+ ```
38
+
27
39
  ## Quick Start
28
40
 
29
41
  ```bash
30
- npm i fabric@beta @erase2d/fabric --save
42
+ npm i fabric @erase2d/fabric --save
31
43
  ```
32
44
 
33
45
  ```typescript
@@ -47,10 +59,12 @@ eraser.on('start', (e) => {
47
59
  eraser.on('end', async (e) => {
48
60
  // prevent from committing erasing to the tree
49
61
  e.preventDefault();
50
- const isErased = e.targets.includes(circle);
62
+
63
+ const { path, targets } = e.detail;
64
+ const isErased = targets.includes(circle);
51
65
 
52
66
  // commit erasing manually
53
- const pathPerObjectMap = await eraser.commit(e.detail);
67
+ const pathPerObjectMap = await eraser.commit({ path, targets });
54
68
 
55
69
  const committedEraser = circle.clipPath instanceof ClippingGroup;
56
70
  });
@@ -59,6 +73,40 @@ canvas.freeDrawingBrush = eraser;
59
73
  canvas.isDrawingMode = true;
60
74
  ```
61
75
 
76
+ Refer to the [example app](../app/pages/index.tsx) for in depth usage.
77
+
78
+ ## Sponsors
79
+
80
+ <table>
81
+ <tr>
82
+ <td>
83
+ <a
84
+ href="https://rembg.com/?utm_source=erase2d&utm_medium=github_readme&utm_campaign=sponsorship"
85
+ >
86
+ <img
87
+ width="120px"
88
+ height="120px"
89
+ alt="RemBG.com Logo"
90
+ src="https://github.com/user-attachments/assets/25433a27-5758-4c02-8375-649acde37556"
91
+ />
92
+ </a>
93
+ </td>
94
+ <td>
95
+ <b>RemBG Remove Background API</b>
96
+ <br />
97
+ <a
98
+ href="https://rembg.com/?utm_source=erase2d&utm_medium=github_readme&utm_campaign=sponsorship"
99
+ >https://rembg.com</a
100
+ >
101
+ <br />
102
+ <p width="200px">
103
+ Accurate and affordable background remover API
104
+ <br />
105
+ </p>
106
+ </td>
107
+ </tr>
108
+ </table>
109
+
62
110
  ## Migrating from fabric@5
63
111
 
64
112
  The logic has been reworked from the bottom.