fabric 6.0.0-beta10 → 6.0.0-beta11

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.
Files changed (209) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/CONTRIBUTING.md +25 -16
  3. package/README.md +0 -2
  4. package/dist/fabric.d.ts +25 -3
  5. package/dist/index.js +1993 -2668
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.min.js +1 -1
  8. package/dist/index.mjs +1993 -2669
  9. package/dist/index.mjs.map +1 -1
  10. package/dist/index.node.cjs +1993 -2668
  11. package/dist/index.node.cjs.map +1 -1
  12. package/dist/index.node.mjs +1993 -2669
  13. package/dist/index.node.mjs.map +1 -1
  14. package/dist/src/Collection.d.ts +27 -27
  15. package/dist/src/EventTypeDefs.d.ts +22 -26
  16. package/dist/src/Observable.d.ts +6 -6
  17. package/dist/src/brushes/PatternBrush.d.ts +1 -1
  18. package/dist/src/canvas/Canvas.d.ts +5 -9
  19. package/dist/src/canvas/CanvasOptions.d.ts +232 -0
  20. package/dist/src/canvas/SelectableCanvas.d.ts +4 -217
  21. package/dist/src/canvas/StaticCanvas.d.ts +43 -177
  22. package/dist/src/canvas/StaticCanvasOptions.d.ts +153 -0
  23. package/dist/src/env/types.d.ts +2 -1
  24. package/dist/src/filters/BaseFilter.d.ts +1 -1
  25. package/dist/src/filters/BlendColor.d.ts +1 -2
  26. package/dist/src/filters/ColorMatrixFilters.d.ts +16 -16
  27. package/dist/src/filters/Resize.d.ts +31 -15
  28. package/dist/src/filters/WebGLFilterBackend.d.ts +2 -1
  29. package/dist/src/filters/filters.d.ts +2 -0
  30. package/dist/src/filters/typedefs.d.ts +1 -0
  31. package/dist/src/gradient/Gradient.d.ts +2 -2
  32. package/dist/src/parser/applyViewboxTransform.d.ts +9 -1
  33. package/dist/src/parser/constants.d.ts +0 -12
  34. package/dist/src/parser/elementById.d.ts +2 -1
  35. package/dist/src/parser/elements_parser.d.ts +32 -2
  36. package/dist/src/parser/getCSSRules.d.ts +3 -2
  37. package/dist/src/parser/getGlobalStylesForElement.d.ts +2 -1
  38. package/dist/src/parser/getGradientDefs.d.ts +1 -1
  39. package/dist/src/parser/getMultipleNodes.d.ts +1 -1
  40. package/dist/src/parser/hasInvalidAncestor.d.ts +2 -0
  41. package/dist/src/parser/normalizeAttr.d.ts +2 -1
  42. package/dist/src/parser/normalizeValue.d.ts +1 -1
  43. package/dist/src/parser/parseAttributes.d.ts +2 -1
  44. package/dist/src/parser/parseFontDeclaration.d.ts +1 -1
  45. package/dist/src/parser/parsePointsAttribute.d.ts +2 -4
  46. package/dist/src/parser/parseSVGDocument.d.ts +2 -3
  47. package/dist/src/parser/parseStyleAttribute.d.ts +1 -1
  48. package/dist/src/parser/parseStyleObject.d.ts +7 -1
  49. package/dist/src/parser/parseStyleString.d.ts +7 -1
  50. package/dist/src/parser/parseUseDirectives.d.ts +1 -1
  51. package/dist/src/parser/recursivelyParseGradientsXlink.d.ts +1 -1
  52. package/dist/src/parser/setStrokeFillOpacity.d.ts +1 -1
  53. package/dist/src/parser/typedefs.d.ts +2 -1
  54. package/dist/src/shapes/ActiveSelection.d.ts +8 -2
  55. package/dist/src/shapes/Circle.d.ts +8 -7
  56. package/dist/src/shapes/Ellipse.d.ts +7 -6
  57. package/dist/src/shapes/Group.d.ts +27 -26
  58. package/dist/src/shapes/IText/IText.d.ts +3 -3
  59. package/dist/src/shapes/IText/ITextBehavior.d.ts +4 -4
  60. package/dist/src/shapes/IText/ITextClickBehavior.d.ts +2 -2
  61. package/dist/src/shapes/IText/ITextKeyBehavior.d.ts +32 -29
  62. package/dist/src/shapes/IText/constants.d.ts +2 -2
  63. package/dist/src/shapes/Image.d.ts +21 -16
  64. package/dist/src/shapes/Line.d.ts +7 -6
  65. package/dist/src/shapes/Object/FabricObjectSVGExportMixin.d.ts +20 -22
  66. package/dist/src/shapes/Object/InteractiveObject.d.ts +5 -5
  67. package/dist/src/shapes/Object/Object.d.ts +4 -5
  68. package/dist/src/shapes/Object/types/index.d.ts +2 -2
  69. package/dist/src/shapes/Path.d.ts +9 -8
  70. package/dist/src/shapes/Polyline.d.ts +15 -8
  71. package/dist/src/shapes/Rect.d.ts +7 -5
  72. package/dist/src/shapes/Text/StyledText.d.ts +4 -3
  73. package/dist/src/shapes/Text/Text.d.ts +36 -25
  74. package/dist/src/shapes/Text/TextSVGExportMixin.d.ts +19 -4
  75. package/dist/src/shapes/Textbox.d.ts +41 -25
  76. package/dist/src/shapes/Triangle.d.ts +3 -2
  77. package/dist/src/typedefs.d.ts +5 -4
  78. package/dist/src/util/dom_event.d.ts +3 -2
  79. package/dist/src/util/dom_misc.d.ts +1 -1
  80. package/dist/src/util/dom_style.d.ts +1 -1
  81. package/dist/src/util/index.d.ts +3 -2
  82. package/dist/src/util/{dom_request.d.ts → internals/dom_request.d.ts} +6 -4
  83. package/dist/src/util/internals/findRight.d.ts +2 -0
  84. package/dist/src/util/internals/index.d.ts +4 -3
  85. package/dist/src/util/misc/groupSVGElements.d.ts +1 -1
  86. package/dist/src/util/misc/matrix.d.ts +3 -3
  87. package/dist/src/util/misc/objectEnlive.d.ts +5 -3
  88. package/dist/src/util/misc/projectStroke/StrokeLineJoinProjections.d.ts +15 -7
  89. package/dist/src/util/misc/projectStroke/StrokeProjectionsBase.d.ts +2 -1
  90. package/dist/src/util/misc/projectStroke/index.d.ts +1 -1
  91. package/dist/src/util/misc/projectStroke/types.d.ts +3 -3
  92. package/dist/src/util/misc/vectors.d.ts +24 -10
  93. package/dist/src/util/typeAssertions.d.ts +4 -2
  94. package/fabric.ts +62 -2
  95. package/jest.config.js +8 -7
  96. package/package.json +12 -9
  97. package/playwright.config.ts +19 -6
  98. package/playwright.setup.ts +16 -0
  99. package/rollup.config.mjs +2 -1
  100. package/src/Collection.ts +26 -26
  101. package/src/CommonMethods.ts +3 -4
  102. package/src/EventTypeDefs.ts +36 -38
  103. package/src/Observable.ts +25 -35
  104. package/src/canvas/Canvas.ts +4 -8
  105. package/src/canvas/CanvasOptions.ts +301 -0
  106. package/src/canvas/SelectableCanvas.ts +30 -247
  107. package/src/canvas/StaticCanvas.ts +47 -178
  108. package/src/canvas/StaticCanvasOptions.ts +199 -0
  109. package/src/env/node.ts +1 -1
  110. package/src/env/types.ts +2 -1
  111. package/src/filters/BaseFilter.ts +1 -1
  112. package/src/filters/BlendColor.ts +1 -1
  113. package/src/filters/ColorMatrixFilters.ts +0 -4
  114. package/src/filters/Resize.ts +72 -41
  115. package/src/filters/WebGLFilterBackend.ts +14 -7
  116. package/src/filters/filters.ts +2 -0
  117. package/src/filters/typedefs.ts +1 -0
  118. package/src/gradient/Gradient.ts +11 -18
  119. package/src/mixins/eraser_brush.mixin.ts +2 -1
  120. package/src/parser/applyViewboxTransform.ts +39 -23
  121. package/src/parser/constants.ts +0 -17
  122. package/src/parser/elementById.ts +7 -10
  123. package/src/parser/elements_parser.ts +95 -55
  124. package/src/parser/getCSSRules.ts +35 -33
  125. package/src/parser/getGlobalStylesForElement.ts +11 -8
  126. package/src/parser/getGradientDefs.ts +9 -7
  127. package/src/parser/getMultipleNodes.ts +10 -6
  128. package/src/parser/hasInvalidAncestor.ts +19 -0
  129. package/src/parser/loadSVGFromString.ts +1 -1
  130. package/src/parser/loadSVGFromURL.ts +4 -5
  131. package/src/parser/normalizeAttr.ts +3 -8
  132. package/src/parser/normalizeValue.ts +25 -19
  133. package/src/parser/parseAttributes.ts +39 -37
  134. package/src/parser/parseFontDeclaration.ts +4 -2
  135. package/src/parser/parsePointsAttribute.ts +7 -8
  136. package/src/parser/parseSVGDocument.ts +24 -48
  137. package/src/parser/parseStyleAttribute.ts +2 -3
  138. package/src/parser/parseStyleObject.ts +15 -13
  139. package/src/parser/parseStyleString.ts +13 -11
  140. package/src/parser/parseUseDirectives.ts +23 -20
  141. package/src/parser/recursivelyParseGradientsXlink.ts +18 -18
  142. package/src/parser/setStrokeFillOpacity.ts +16 -15
  143. package/src/parser/typedefs.ts +3 -1
  144. package/src/shapes/ActiveSelection.ts +10 -3
  145. package/src/shapes/Circle.ts +18 -13
  146. package/src/shapes/Ellipse.ts +17 -17
  147. package/src/shapes/Group.spec.ts +15 -0
  148. package/src/shapes/Group.ts +26 -24
  149. package/src/shapes/IText/DraggableTextDelegate.ts +5 -1
  150. package/src/shapes/IText/IText.ts +6 -4
  151. package/src/shapes/IText/ITextBehavior.test.ts +93 -0
  152. package/src/shapes/IText/ITextBehavior.ts +6 -6
  153. package/src/shapes/IText/ITextClickBehavior.ts +4 -4
  154. package/src/shapes/IText/ITextKeyBehavior.ts +58 -50
  155. package/src/shapes/IText/__snapshots__/ITextBehavior.test.ts.snap +810 -0
  156. package/src/shapes/IText/constants.ts +20 -8
  157. package/src/shapes/Image.ts +94 -82
  158. package/src/shapes/Line.ts +12 -11
  159. package/src/shapes/Object/FabricObjectSVGExportMixin.ts +47 -71
  160. package/src/shapes/Object/InteractiveObject.ts +11 -6
  161. package/src/shapes/Object/Object.ts +6 -6
  162. package/src/shapes/Object/types/index.ts +2 -3
  163. package/src/shapes/Path.ts +20 -13
  164. package/src/shapes/Polyline.ts +93 -46
  165. package/src/shapes/Rect.ts +9 -12
  166. package/src/shapes/Text/StyledText.ts +4 -7
  167. package/src/shapes/Text/Text.spec.ts +73 -0
  168. package/src/shapes/Text/Text.ts +75 -51
  169. package/src/shapes/Text/TextSVGExportMixin.ts +99 -23
  170. package/src/shapes/Text/__snapshots__/Text.spec.ts.snap +214 -0
  171. package/src/shapes/Textbox.spec.ts +89 -0
  172. package/src/shapes/Textbox.ts +75 -33
  173. package/src/shapes/Triangle.ts +3 -6
  174. package/src/shapes/__snapshots__/Textbox.spec.ts.snap +164 -0
  175. package/src/typedefs.ts +14 -9
  176. package/src/util/dom_event.ts +9 -8
  177. package/src/util/dom_misc.ts +7 -4
  178. package/src/util/dom_style.ts +4 -2
  179. package/src/util/index.ts +14 -2
  180. package/src/util/{dom_request.ts → internals/dom_request.ts} +12 -24
  181. package/src/util/internals/findRight.ts +11 -0
  182. package/src/util/internals/index.ts +4 -3
  183. package/src/util/misc/matrix.ts +3 -2
  184. package/src/util/misc/objectEnlive.ts +20 -13
  185. package/src/util/misc/projectStroke/StrokeLineCapProjections.ts +56 -21
  186. package/src/util/misc/projectStroke/StrokeLineJoinProjections.ts +152 -65
  187. package/src/util/misc/projectStroke/StrokeProjectionsBase.ts +3 -13
  188. package/src/util/misc/projectStroke/index.ts +30 -4
  189. package/src/util/misc/projectStroke/types.ts +3 -3
  190. package/src/util/misc/vectors.ts +40 -23
  191. package/src/util/path/__snapshots__/index.spec.ts.snap +55 -0
  192. package/src/util/path/index.spec.ts +17 -0
  193. package/src/util/path/index.ts +2 -2
  194. package/src/util/typeAssertions.ts +7 -0
  195. package/toMatchRoundedSnapshot.ts +66 -0
  196. package/tsconfig.json +1 -1
  197. package/dist/src/brushes/CircleBrush.test.d.ts +0 -2
  198. package/dist/src/canvas/DOMManagers/util.spec.d.ts +0 -2
  199. package/dist/src/gradient/parser/index.d.ts +0 -4
  200. package/dist/src/parser/hasAncestorWithNodeName.d.ts +0 -2
  201. package/dist/src/parser/index.d.ts +0 -9
  202. package/dist/src/util/internals/cleanupSvgAttribute.test.d.ts +0 -2
  203. package/dist/src/util/internals/cloneDeep.test.d.ts +0 -2
  204. package/dist/src/util/internals/getRandomInt.test.d.ts +0 -2
  205. package/e2e/site/index.html +0 -25
  206. package/e2e/utils/objects.ts +0 -36
  207. package/src/gradient/parser/index.ts +0 -3
  208. package/src/parser/hasAncestorWithNodeName.ts +0 -14
  209. package/src/parser/index.ts +0 -8
package/CHANGELOG.md CHANGED
@@ -2,6 +2,40 @@
2
2
 
3
3
  ## [next]
4
4
 
5
+ ## [6.0.0-beta11]
6
+
7
+ - patch(): Avoid unwanted mutation to passed objects array to Group constructor [#9151](https://github.com/fabricjs/fabric.js/pull/9151)
8
+ - patch(): ActiveSelection initialization + types [#9143](https://github.com/fabricjs/fabric.js/pull/9143)
9
+ - chore(TS): BREAKING remove canvas.interactive, added typings for canvas options [#9140](https://github.com/fabricjs/fabric.js/pull/9140)
10
+ - chore(TS): BREAKING PREVIOUS BETA mv + rename `TProps` => `TOptions` [#9139](https://github.com/fabricjs/fabric.js/pull/9139)
11
+ - test(playwright): Use embedded eval from playwright [#9133](https://github.com/fabricjs/fabric.js/pull/9133)
12
+ - chore(TS): Fix event types and .once this binding [#9119](https://github.com/fabricjs/fabric.js/pull/9130)
13
+ - docs(): rm `canvas2pdf` [#9135](https://github.com/fabricjs/fabric.js/pull/9135)
14
+ - chore(TS): export types [#9129](https://github.com/fabricjs/fabric.js/pull/9129)
15
+ - ci(e2e): support relative imports [#9108](https://github.com/fabricjs/fabric.js/pull/9108)
16
+ - chore(TS): complete type check [#9119](https://github.com/fabricjs/fabric.js/pull/9119)
17
+ - chore(TS): Add type-checking to files excluded with ts-nocheck [#9097](https://github.com/fabricjs/fabric.js/pull/9097)
18
+ - chore(TS): Add type-checking to files excluded with ts-nocheck ( Parser mostly ) [#9085](https://github.com/fabricjs/fabric.js/pull/9085)
19
+ - docs(): revise test section [#9114](https://github.com/fabricjs/fabric.js/pull/9114)
20
+ - fix(): #8344 stroke projection [#8374](https://github.com/fabricjs/fabric.js/pull/8374)
21
+ - fix(Filters) Removing type from the options passed in the constructor [#9089](https://github.com/fabricjs/fabric.js/pull/9089)
22
+ - feat(InteractiveObject): add `getActiveControl()` to expose `__corner` [#9102](https://github.com/fabricjs/fabric.js/pull/9102)
23
+ - ci(sandbox): bump next.js [#9100](https://github.com/fabricjs/fabric.js/pull/9100)
24
+ - test(playwright): add snapshots, refactor utils, coverage [#9078](https://github.com/fabricjs/fabric.js/pull/9078)
25
+ - test(Text): Add some tests for text in Jest [#9083](https://github.com/fabricjs/fabric.js/pull/9083)
26
+ - ci(): Install system deps only when necessary [#9086](https://github.com/fabricjs/fabric.js/pull/9086)
27
+ - fix(util, Path): path distance measurement fix for M cmd [#9076](https://github.com/fabricjs/fabric.js/pull/9076)
28
+ - chore(TS): Image class type checks, BREAKING change to FromURL static method [#9036](https://github.com/fabricjs/fabric.js/pull/9036)
29
+ - ci(): properly checkout head for stats [#9080](https://github.com/fabricjs/fabric.js/pull/9080)
30
+ - fix(Text): `_getFontDeclaration` wasn't considering fontFamily from the style object [#9082](https://github.com/fabricjs/fabric.js/pull/9082)
31
+ - chore(TS): Fix ITextBehaviour enterEditing type [#9075](https://github.com/fabricjs/fabric.js/pull/9075)
32
+ - chore(TS): export FabricObjectProps and GroupProps [#9025](https://github.com/fabricjs/fabric.js/pull/9025)
33
+ - chore(TS): Replace BaseFabricObject with FabricObject [#9016](https://github.com/fabricjs/fabric.js/pull/9016)
34
+ - refactor(svgImport): remove the css/gradient/clipPath global definitions [#9030](https://github.com/fabricjs/fabric.js/pull/9030)
35
+ - fix(): tweaks to type getter [#9022](https://github.com/fabricjs/fabric.js/pull/9022)
36
+ - ci() Refactor GHA actions for caching and reuse [#9029](https://github.com/fabricjs/fabric.js/pull/9029)
37
+ - ci(): install dev deps types [#9039](https://github.com/fabricjs/fabric.js/pull/9039)
38
+
5
39
  ## [6.0.0-beta10]
6
40
 
7
41
  - chore(TS): Remove @ts-nocheck from Text class. [#9018](https://github.com/fabricjs/fabric.js/pull/9018)
package/CONTRIBUTING.md CHANGED
@@ -64,6 +64,8 @@ Answering questions and addressing issues, as well as fixing and adding types (s
64
64
 
65
65
  ### 🎮 Adding a DEMO (currently not possible)
66
66
 
67
+ **New website is under construction. Contributions are welcome.**
68
+
67
69
  Take a look at an existing [demo file][demo_file].\
68
70
  Create a new file in the same directory (`posts/demos/_posts`) and follow [**developing the website**](#fabricjscom-deprecated).
69
71
 
@@ -104,11 +106,12 @@ Fabric is an open source project 🦄 and as such depends on the **genuine effor
104
106
  Do not reorder imports. Irrelevant changes in a PR that are not created by prettier aren't needed nor welcome.
105
107
  - **Tests** \
106
108
  PRs must be backed with relevant tests, follow [TESTING](#-testing). If you never wrote a test or you find our tests unclear to extend, just ask for help.
109
+ Aim to cover 100% of the changes.
107
110
  - **Docs** \
108
111
  Add relevant comments to your code if necessary using [JSDoc 3][jsdoc] and update relevant guides.\
109
112
  The generated documentation can be found at [fabricjs.com][docs], see [DOCS](#-improving-docs).
110
113
  - **Changelog**\
111
- Add a concise listing to the [**CHANGELOG**](CHANGELOG.md) describing what has changed.
114
+ Add a concise listing to the [**CHANGELOG**](CHANGELOG.md) describing what has changed or let github actions add the PR title for you.
112
115
  - **1️⃣ PR per feature/bug** \
113
116
  Create a new branch for every pull request.\
114
117
  If you want to do more than one thing, create multiple pull requests 💪.
@@ -125,19 +128,33 @@ It is more than likely you will be requested to change stuff and refine your wor
125
128
  [![🧪](../../actions/workflows/tests.yml/badge.svg)](../../actions/workflows/tests.yml)
126
129
  [![CodeQL](../../actions/workflows/codeql-analysis.yml/badge.svg)](../../actions/workflows/codeql-analysis.yml)
127
130
 
128
- Test suites use [`QUnit`][qunit] for assertions and [`testem`][testem] for serving the browser tests
131
+ | Suite | unit (node) | e2e (browser) |
132
+ | ---------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
133
+ | Framework | [`jest`][jest] | [`playwright`][playwright] |
134
+ | Setup | | <pre>npm run build -- -f -w</pre> |
135
+ | Running Tests<br><br><br><br><br><pre>\<test cmd\> -- [filter] [watch]</pre> | <pre>npm run test:jest -- [filters] [-w]</pre><br><br><br>It is advised to use filters to save time.<br> | <pre>npm run test:e2e -- [filters] [--ui]</pre><br>In some machines babel is flaky and doesn't build the test files. In that is the case, try running the command using `npx` directly, see [`playwright.setup.ts`](./playwright.setup.ts). |
136
+ | Writing Tests | Add/update `src/*.(spec\|test).ts` files | - Update tests in `e2e/tests`<br>- Create a new test based on `e2e/template` |
137
+ | Test Gen | | <pre>npm start vanilla<br>npx playwright codegen http://localhost:1234</pre> |
138
+ | Test Spec | | - `index.ts`: built and loaded into the web app<br> - `index.spec.ts`: test spec<br> |
139
+ | Outputs | Snapshots next to the test file | - Snapshots next to the test file <br>- `e2e/test-report`<br>- `e2e/test-results` |
140
+
141
+ ### Legacy Test Suite
142
+
143
+ We **discourage** writing new tests in the legacy suite and **encourage** migrating failing tests to the new suite.
144
+ However, it is not carved in stone.
145
+
146
+ The test suites use [`QUnit`][qunit] for assertions and [`testem`][testem] for serving the browser tests.
129
147
 
130
148
  - `unit` tests: test logic and state
131
149
  - `visual` tests: test visual outcome against image refs located at `test/visual/golden`
132
- - `UI` tests: testing with playwright
133
150
 
134
- ### Getting Started
151
+ #### Getting Started
135
152
 
136
153
  - Build and watch for changes
137
154
  ```bash
138
155
  npm run build -- -f -w
139
156
  ```
140
- - Run the entire test suite on `chrome` (many tests are skipped on `node`)
157
+ - Run the _legacy_ test suite on `chrome` (many tests are skipped on `node`)
141
158
  ```bash
142
159
  npm test -- -a -c chrome
143
160
  ```
@@ -172,17 +189,7 @@ Test suites use [`QUnit`][qunit] for assertions and [`testem`][testem] for servi
172
189
  npm test -- -h
173
190
  ```
174
191
 
175
- ## UI tests
176
-
177
- Run UI tests with Playwright in parallel in Chrome (headed mode).
178
-
179
- ```bash
180
- $ npm run test:e2e
181
- ```
182
-
183
- ### Adding Tests
184
-
185
- Backing a PR with tests that cover the changes that were made is a **MUST**. Aim to cover 100% of the cases.
192
+ #### Adding Tests
186
193
 
187
194
  Add tests to relevant files or add new files when necessary under `test/unit` or `test/visual`.
188
195
 
@@ -256,6 +263,8 @@ Don't forget to unlink the package once you're done.
256
263
  [prettier_extension]: https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
257
264
  [eslint]: https://eslint.org/
258
265
  [jsdoc]: https://jsdoc.app/
266
+ [playwright]: https://playwright.dev/
267
+ [jest]: https://jestjs.io/
259
268
  [qunit]: https://qunitjs.com/
260
269
  [testem]: https://github.com/testem/testem
261
270
  [unit_test]: https://github.com/fabricjs/fabric.js/blob/93dd2dcca705a4b481fbc9982da4952ef5b4ed1d/test/unit/point.js#L227-L237
package/README.md CHANGED
@@ -202,7 +202,6 @@ See our ready to use [templates](./.codesandbox/templates/).
202
202
  | [Three.js][three.js] | 3D graphics |
203
203
  | [PixiJS][pixijs] | WebGL renderer |
204
204
  | [Konva][konva] | Similar features | ❌ |
205
- | [Canvas2PDF][canvas2pdf] | PDF renderer |
206
205
  | [html-to-image][html-to-image] | HTML to image/canvas |
207
206
 
208
207
  ## More Resources
@@ -230,7 +229,6 @@ See our ready to use [templates](./.codesandbox/templates/).
230
229
 
231
230
  [asturur]: https://github.com/asturur
232
231
  [asturur_twitter]: https://twitter.com/AndreaBogazzi
233
- [canvas2pdf]: https://github.com/joshua-gould/canvas2pdf
234
232
  [cdnjs]: https://cdnjs.com/libraries/fabric.js
235
233
  [code_triage]: https://www.codetriage.com/kangax/fabric.js
236
234
  [codepens]: https://codepen.io/tag/fabricjs
package/dist/fabric.d.ts CHANGED
@@ -7,8 +7,11 @@ export { runningAnimations } from './src/util/animation/AnimationRegistry';
7
7
  export * from './src/typedefs';
8
8
  export * from './src/EventTypeDefs';
9
9
  export { Observable } from './src/Observable';
10
+ export type { TCanvasSizeOptions, TSVGExportOptions, } from './src/canvas/StaticCanvas';
11
+ export type { StaticCanvasOptions } from './src/canvas/StaticCanvasOptions';
10
12
  export { StaticCanvas } from './src/canvas/StaticCanvas';
11
13
  export { Canvas } from './src/canvas/Canvas';
14
+ export type { CanvasOptions } from './src/canvas/CanvasOptions';
12
15
  export { CanvasDOMManager } from './src/canvas/DOMManagers/CanvasDOMManager';
13
16
  export { StaticCanvasDOMManager } from './src/canvas/DOMManagers/StaticCanvasDOMManager';
14
17
  export type { XY } from './src/Point';
@@ -28,26 +31,45 @@ export { CircleBrush } from './src/brushes/CircleBrush';
28
31
  export { SprayBrush } from './src/brushes/SprayBrush';
29
32
  export { PatternBrush } from './src/brushes/PatternBrush';
30
33
  export { FabricObject as Object } from './src/shapes/Object/FabricObject';
31
- export type { TProps } from './src/shapes/Object/types';
34
+ export type { TFabricObjectProps, FabricObjectProps, SerializedObjectProps, } from './src/shapes/Object/types';
35
+ export type { SerializedLineProps } from './src/shapes/Line';
32
36
  export { Line } from './src/shapes/Line';
37
+ export type { CircleProps, SerializedCircleProps } from './src/shapes/Circle';
33
38
  export { Circle } from './src/shapes/Circle';
34
39
  export { Triangle } from './src/shapes/Triangle';
40
+ export type { EllipseProps, SerializedEllipseProps, } from './src/shapes/Ellipse';
35
41
  export { Ellipse } from './src/shapes/Ellipse';
42
+ export type { RectProps, SerializedRectProps } from './src/shapes/Rect';
36
43
  export { Rect } from './src/shapes/Rect';
44
+ export type { PathProps, SerializedPathProps } from './src/shapes/Path';
37
45
  export { Path } from './src/shapes/Path';
46
+ export type { SerializedPolylineProps } from './src/shapes/Polyline';
38
47
  export { Polyline } from './src/shapes/Polyline';
39
48
  export { Polygon } from './src/shapes/Polygon';
49
+ export type { GraphemeBBox, SerializedTextProps, TPathAlign, TPathSide, TextProps, } from './src/shapes/Text/Text';
40
50
  export { Text } from './src/shapes/Text/Text';
51
+ export type { ITextProps, SerializedITextProps, } from './src/shapes/IText/IText';
41
52
  export { IText } from './src/shapes/IText/IText';
53
+ export type { GraphemeData, SerializedTextboxProps, TextboxProps, } from './src/shapes/Textbox';
42
54
  export { Textbox } from './src/shapes/Textbox';
43
- export type { TextStyleDeclaration, TextStyle, } from './src/shapes/Text/StyledText';
55
+ export type { CompleteTextStyleDeclaration, TextStyleDeclaration, TextStyle, } from './src/shapes/Text/StyledText';
56
+ export type { GroupEvents, GroupProps, LayoutContext, GroupOwnProps, LayoutContextType, LayoutResult, LayoutStrategy, SerializedGroupProps, } from './src/shapes/Group';
44
57
  export { Group } from './src/shapes/Group';
58
+ export type { ActiveSelectionOptions, MultiSelectionStacking, } from './src/shapes/ActiveSelection';
45
59
  export { ActiveSelection } from './src/shapes/ActiveSelection';
46
60
  export { Image } from './src/shapes/Image';
47
61
  export type { ImageSource, SerializedImageProps, ImageProps, } from './src/shapes/Image';
48
62
  export { createCollectionMixin } from './src/Collection';
49
63
  export * as util from './src/util';
50
- export * from './src/parser';
64
+ export { loadSVGFromString } from './src/parser/loadSVGFromString';
65
+ export { loadSVGFromURL } from './src/parser/loadSVGFromURL';
66
+ export { parseSVGDocument } from './src/parser/parseSVGDocument';
67
+ export { parseAttributes } from './src/parser/parseAttributes';
68
+ export { parseStyleAttribute } from './src/parser/parseStyleAttribute';
69
+ export { parsePointsAttribute } from './src/parser/parsePointsAttribute';
70
+ export { parseTransformAttribute } from './src/parser/parseTransformAttribute';
71
+ export { getCSSRules } from './src/parser/getCSSRules';
72
+ export { parseFontDeclaration } from './src/parser/parseFontDeclaration';
51
73
  export { Control } from './src/controls/Control';
52
74
  export * as controlsUtils from './src/controls';
53
75
  export * from './src/filters';