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.
- package/CHANGELOG.md +34 -0
- package/CONTRIBUTING.md +25 -16
- package/README.md +0 -2
- package/dist/fabric.d.ts +25 -3
- package/dist/index.js +1993 -2668
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.mjs +1993 -2669
- package/dist/index.mjs.map +1 -1
- package/dist/index.node.cjs +1993 -2668
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs +1993 -2669
- package/dist/index.node.mjs.map +1 -1
- package/dist/src/Collection.d.ts +27 -27
- package/dist/src/EventTypeDefs.d.ts +22 -26
- package/dist/src/Observable.d.ts +6 -6
- package/dist/src/brushes/PatternBrush.d.ts +1 -1
- package/dist/src/canvas/Canvas.d.ts +5 -9
- package/dist/src/canvas/CanvasOptions.d.ts +232 -0
- package/dist/src/canvas/SelectableCanvas.d.ts +4 -217
- package/dist/src/canvas/StaticCanvas.d.ts +43 -177
- package/dist/src/canvas/StaticCanvasOptions.d.ts +153 -0
- package/dist/src/env/types.d.ts +2 -1
- package/dist/src/filters/BaseFilter.d.ts +1 -1
- package/dist/src/filters/BlendColor.d.ts +1 -2
- package/dist/src/filters/ColorMatrixFilters.d.ts +16 -16
- package/dist/src/filters/Resize.d.ts +31 -15
- package/dist/src/filters/WebGLFilterBackend.d.ts +2 -1
- package/dist/src/filters/filters.d.ts +2 -0
- package/dist/src/filters/typedefs.d.ts +1 -0
- package/dist/src/gradient/Gradient.d.ts +2 -2
- package/dist/src/parser/applyViewboxTransform.d.ts +9 -1
- package/dist/src/parser/constants.d.ts +0 -12
- package/dist/src/parser/elementById.d.ts +2 -1
- package/dist/src/parser/elements_parser.d.ts +32 -2
- package/dist/src/parser/getCSSRules.d.ts +3 -2
- package/dist/src/parser/getGlobalStylesForElement.d.ts +2 -1
- package/dist/src/parser/getGradientDefs.d.ts +1 -1
- package/dist/src/parser/getMultipleNodes.d.ts +1 -1
- package/dist/src/parser/hasInvalidAncestor.d.ts +2 -0
- package/dist/src/parser/normalizeAttr.d.ts +2 -1
- package/dist/src/parser/normalizeValue.d.ts +1 -1
- package/dist/src/parser/parseAttributes.d.ts +2 -1
- package/dist/src/parser/parseFontDeclaration.d.ts +1 -1
- package/dist/src/parser/parsePointsAttribute.d.ts +2 -4
- package/dist/src/parser/parseSVGDocument.d.ts +2 -3
- package/dist/src/parser/parseStyleAttribute.d.ts +1 -1
- package/dist/src/parser/parseStyleObject.d.ts +7 -1
- package/dist/src/parser/parseStyleString.d.ts +7 -1
- package/dist/src/parser/parseUseDirectives.d.ts +1 -1
- package/dist/src/parser/recursivelyParseGradientsXlink.d.ts +1 -1
- package/dist/src/parser/setStrokeFillOpacity.d.ts +1 -1
- package/dist/src/parser/typedefs.d.ts +2 -1
- package/dist/src/shapes/ActiveSelection.d.ts +8 -2
- package/dist/src/shapes/Circle.d.ts +8 -7
- package/dist/src/shapes/Ellipse.d.ts +7 -6
- package/dist/src/shapes/Group.d.ts +27 -26
- package/dist/src/shapes/IText/IText.d.ts +3 -3
- package/dist/src/shapes/IText/ITextBehavior.d.ts +4 -4
- package/dist/src/shapes/IText/ITextClickBehavior.d.ts +2 -2
- package/dist/src/shapes/IText/ITextKeyBehavior.d.ts +32 -29
- package/dist/src/shapes/IText/constants.d.ts +2 -2
- package/dist/src/shapes/Image.d.ts +21 -16
- package/dist/src/shapes/Line.d.ts +7 -6
- package/dist/src/shapes/Object/FabricObjectSVGExportMixin.d.ts +20 -22
- package/dist/src/shapes/Object/InteractiveObject.d.ts +5 -5
- package/dist/src/shapes/Object/Object.d.ts +4 -5
- package/dist/src/shapes/Object/types/index.d.ts +2 -2
- package/dist/src/shapes/Path.d.ts +9 -8
- package/dist/src/shapes/Polyline.d.ts +15 -8
- package/dist/src/shapes/Rect.d.ts +7 -5
- package/dist/src/shapes/Text/StyledText.d.ts +4 -3
- package/dist/src/shapes/Text/Text.d.ts +36 -25
- package/dist/src/shapes/Text/TextSVGExportMixin.d.ts +19 -4
- package/dist/src/shapes/Textbox.d.ts +41 -25
- package/dist/src/shapes/Triangle.d.ts +3 -2
- package/dist/src/typedefs.d.ts +5 -4
- package/dist/src/util/dom_event.d.ts +3 -2
- package/dist/src/util/dom_misc.d.ts +1 -1
- package/dist/src/util/dom_style.d.ts +1 -1
- package/dist/src/util/index.d.ts +3 -2
- package/dist/src/util/{dom_request.d.ts → internals/dom_request.d.ts} +6 -4
- package/dist/src/util/internals/findRight.d.ts +2 -0
- package/dist/src/util/internals/index.d.ts +4 -3
- package/dist/src/util/misc/groupSVGElements.d.ts +1 -1
- package/dist/src/util/misc/matrix.d.ts +3 -3
- package/dist/src/util/misc/objectEnlive.d.ts +5 -3
- package/dist/src/util/misc/projectStroke/StrokeLineJoinProjections.d.ts +15 -7
- package/dist/src/util/misc/projectStroke/StrokeProjectionsBase.d.ts +2 -1
- package/dist/src/util/misc/projectStroke/index.d.ts +1 -1
- package/dist/src/util/misc/projectStroke/types.d.ts +3 -3
- package/dist/src/util/misc/vectors.d.ts +24 -10
- package/dist/src/util/typeAssertions.d.ts +4 -2
- package/fabric.ts +62 -2
- package/jest.config.js +8 -7
- package/package.json +12 -9
- package/playwright.config.ts +19 -6
- package/playwright.setup.ts +16 -0
- package/rollup.config.mjs +2 -1
- package/src/Collection.ts +26 -26
- package/src/CommonMethods.ts +3 -4
- package/src/EventTypeDefs.ts +36 -38
- package/src/Observable.ts +25 -35
- package/src/canvas/Canvas.ts +4 -8
- package/src/canvas/CanvasOptions.ts +301 -0
- package/src/canvas/SelectableCanvas.ts +30 -247
- package/src/canvas/StaticCanvas.ts +47 -178
- package/src/canvas/StaticCanvasOptions.ts +199 -0
- package/src/env/node.ts +1 -1
- package/src/env/types.ts +2 -1
- package/src/filters/BaseFilter.ts +1 -1
- package/src/filters/BlendColor.ts +1 -1
- package/src/filters/ColorMatrixFilters.ts +0 -4
- package/src/filters/Resize.ts +72 -41
- package/src/filters/WebGLFilterBackend.ts +14 -7
- package/src/filters/filters.ts +2 -0
- package/src/filters/typedefs.ts +1 -0
- package/src/gradient/Gradient.ts +11 -18
- package/src/mixins/eraser_brush.mixin.ts +2 -1
- package/src/parser/applyViewboxTransform.ts +39 -23
- package/src/parser/constants.ts +0 -17
- package/src/parser/elementById.ts +7 -10
- package/src/parser/elements_parser.ts +95 -55
- package/src/parser/getCSSRules.ts +35 -33
- package/src/parser/getGlobalStylesForElement.ts +11 -8
- package/src/parser/getGradientDefs.ts +9 -7
- package/src/parser/getMultipleNodes.ts +10 -6
- package/src/parser/hasInvalidAncestor.ts +19 -0
- package/src/parser/loadSVGFromString.ts +1 -1
- package/src/parser/loadSVGFromURL.ts +4 -5
- package/src/parser/normalizeAttr.ts +3 -8
- package/src/parser/normalizeValue.ts +25 -19
- package/src/parser/parseAttributes.ts +39 -37
- package/src/parser/parseFontDeclaration.ts +4 -2
- package/src/parser/parsePointsAttribute.ts +7 -8
- package/src/parser/parseSVGDocument.ts +24 -48
- package/src/parser/parseStyleAttribute.ts +2 -3
- package/src/parser/parseStyleObject.ts +15 -13
- package/src/parser/parseStyleString.ts +13 -11
- package/src/parser/parseUseDirectives.ts +23 -20
- package/src/parser/recursivelyParseGradientsXlink.ts +18 -18
- package/src/parser/setStrokeFillOpacity.ts +16 -15
- package/src/parser/typedefs.ts +3 -1
- package/src/shapes/ActiveSelection.ts +10 -3
- package/src/shapes/Circle.ts +18 -13
- package/src/shapes/Ellipse.ts +17 -17
- package/src/shapes/Group.spec.ts +15 -0
- package/src/shapes/Group.ts +26 -24
- package/src/shapes/IText/DraggableTextDelegate.ts +5 -1
- package/src/shapes/IText/IText.ts +6 -4
- package/src/shapes/IText/ITextBehavior.test.ts +93 -0
- package/src/shapes/IText/ITextBehavior.ts +6 -6
- package/src/shapes/IText/ITextClickBehavior.ts +4 -4
- package/src/shapes/IText/ITextKeyBehavior.ts +58 -50
- package/src/shapes/IText/__snapshots__/ITextBehavior.test.ts.snap +810 -0
- package/src/shapes/IText/constants.ts +20 -8
- package/src/shapes/Image.ts +94 -82
- package/src/shapes/Line.ts +12 -11
- package/src/shapes/Object/FabricObjectSVGExportMixin.ts +47 -71
- package/src/shapes/Object/InteractiveObject.ts +11 -6
- package/src/shapes/Object/Object.ts +6 -6
- package/src/shapes/Object/types/index.ts +2 -3
- package/src/shapes/Path.ts +20 -13
- package/src/shapes/Polyline.ts +93 -46
- package/src/shapes/Rect.ts +9 -12
- package/src/shapes/Text/StyledText.ts +4 -7
- package/src/shapes/Text/Text.spec.ts +73 -0
- package/src/shapes/Text/Text.ts +75 -51
- package/src/shapes/Text/TextSVGExportMixin.ts +99 -23
- package/src/shapes/Text/__snapshots__/Text.spec.ts.snap +214 -0
- package/src/shapes/Textbox.spec.ts +89 -0
- package/src/shapes/Textbox.ts +75 -33
- package/src/shapes/Triangle.ts +3 -6
- package/src/shapes/__snapshots__/Textbox.spec.ts.snap +164 -0
- package/src/typedefs.ts +14 -9
- package/src/util/dom_event.ts +9 -8
- package/src/util/dom_misc.ts +7 -4
- package/src/util/dom_style.ts +4 -2
- package/src/util/index.ts +14 -2
- package/src/util/{dom_request.ts → internals/dom_request.ts} +12 -24
- package/src/util/internals/findRight.ts +11 -0
- package/src/util/internals/index.ts +4 -3
- package/src/util/misc/matrix.ts +3 -2
- package/src/util/misc/objectEnlive.ts +20 -13
- package/src/util/misc/projectStroke/StrokeLineCapProjections.ts +56 -21
- package/src/util/misc/projectStroke/StrokeLineJoinProjections.ts +152 -65
- package/src/util/misc/projectStroke/StrokeProjectionsBase.ts +3 -13
- package/src/util/misc/projectStroke/index.ts +30 -4
- package/src/util/misc/projectStroke/types.ts +3 -3
- package/src/util/misc/vectors.ts +40 -23
- package/src/util/path/__snapshots__/index.spec.ts.snap +55 -0
- package/src/util/path/index.spec.ts +17 -0
- package/src/util/path/index.ts +2 -2
- package/src/util/typeAssertions.ts +7 -0
- package/toMatchRoundedSnapshot.ts +66 -0
- package/tsconfig.json +1 -1
- package/dist/src/brushes/CircleBrush.test.d.ts +0 -2
- package/dist/src/canvas/DOMManagers/util.spec.d.ts +0 -2
- package/dist/src/gradient/parser/index.d.ts +0 -4
- package/dist/src/parser/hasAncestorWithNodeName.d.ts +0 -2
- package/dist/src/parser/index.d.ts +0 -9
- package/dist/src/util/internals/cleanupSvgAttribute.test.d.ts +0 -2
- package/dist/src/util/internals/cloneDeep.test.d.ts +0 -2
- package/dist/src/util/internals/getRandomInt.test.d.ts +0 -2
- package/e2e/site/index.html +0 -25
- package/e2e/utils/objects.ts +0 -36
- package/src/gradient/parser/index.ts +0 -3
- package/src/parser/hasAncestorWithNodeName.ts +0 -14
- 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)
|
|
126
129
|
[](../../actions/workflows/codeql-analysis.yml)
|
|
127
130
|
|
|
128
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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 {
|
|
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
|
|
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';
|