Skip to content

Commit

Permalink
Merge branch 'master' into ts-canvas-patch-init
Browse files Browse the repository at this point in the history
  • Loading branch information
asturur authored Jan 14, 2023
2 parents 15c8bf7 + c976302 commit a3caeac
Show file tree
Hide file tree
Showing 113 changed files with 6,132 additions and 12,420 deletions.
11 changes: 11 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"presets": [
"@babel/env",
[
"@babel/typescript",
{
"allowDeclareFields": true
}
]
]
}
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
size: { fabric: { minified: fs.statSync('dist/fabric.min.js').size, bundled: fs.statSync('dist/fabric.js').size } }
});
- name: checkout src files
run: git checkout origin/master -- src index.js
run: git checkout origin/master -- src index.ts
- name: upstream build stats
run: npm run build -- -s
- name: persist
Expand Down
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
"markdown.validate.ignoredLinks": [
// github links
"../../**"
]
],
"editor.formatOnSave": true,
"editor.formatOnPaste": true
}
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@
## [next]

- chore(TS): refactor canvas init, fix `_initRetinaScaling` regression #8520
- fix(): `_initRetinaScaling` initializaing the scaling regardless of settings in Canvas. [#8565](https://github.com/fabricjs/fabric.js/pull/8565)
- fix(): regression of canvas migration with pointer and sendPointToPlane [#8563](https://github.com/fabricjs/fabric.js/pull/8563)
- chore(TS): remove all remaining empty declarations [#8593](https://github.com/fabricjs/fabric.js/pull/8593)
- refactor(IText): modernize IText cursor animation based on animation API changes (and fix minor regression) plus leftovers from #8547 [#8583](https://github.com/fabricjs/fabric.js/pull/8583)
- refactor(Canvas, IText): Handle cross instance text editing states to an EditingManager class [#8543](https://github.com/fabricjs/fabric.js/pull/8543)
- chore(TS): move to export, babel, new rollup, change import statement for fabric. [#8585](https://github.com/fabricjs/fabric.js/pull/8585);
- chore(TS): Add declare in front of properties that are type definitions. [#8574](https://github.com/fabricjs/fabric.js/pull/8574)
- refactor(Animation): BREAKING: Animation api reduction and semplification (byValue is removed, '+=' syntax is removed, callbacks fired 100%) [#8547](https://github.com/fabricjs/fabric.js/pull/8547)
- feat(PolyControl): modify the shape of a poly with control points [#8556](https://github.com/fabricjs/fabric.js/pull/8556)
- BREAKING: remove Object.stateful and Object.statefulCache [#8573](https://github.com/fabricjs/fabric.js/pull/8573)
- fix(IText): refactor clearing context top logic of itext to align with brush pattern, using the canvas rendering cycle in order to guard from edge cases #8560
- fix(Canvas): `_initRetinaScaling` initializaing the scaling regardless of settings in Canvas. [#8565](https://github.com/fabricjs/fabric.js/pull/8565)
- fix(Canvas): regression of canvas migration with pointer and sendPointToPlane [#8563](https://github.com/fabricjs/fabric.js/pull/8563)
- chore(TS): Use exports from files to build fabricJS, get rid of HEADER.js [#8549](https://github.com/fabricjs/fabric.js/pull/8549)
- chore(): rm `fabric.filterBackend` => `getFilterBackend` [#8487](https://github.com/fabricjs/fabric.js/pull/8487)
- chore(TS): migrate text SVG export mixin [#8486](https://github.com/fabricjs/fabric.js/pull/8486)
Expand Down
23 changes: 9 additions & 14 deletions index.js → index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,18 @@ import {
} from './src/util/dom_misc';
import { isTransparent } from './src/util/misc/isTransparent';
import { mergeClipPaths } from './src/util/misc/mergeClipPaths';
import { animate, animateColor } from './src/util/animation/animate';
import * as ease from './src/util/animation/easing';
import {
animate,
animateColor,
ease,
requestAnimFrame,
cancelAnimFrame,
} from './src/util/animation';
} from './src/util/animation/AnimationFrameProvider';
import { classRegistry } from './src/util/class_registry';
import { removeFromArray } from './src/util/internals/removeFromArray';
import { getRandomInt } from './src/util/internals/getRandomInt';
import { wrapElement } from './src/util/dom_misc';
import { request } from './src/util/dom_request';
import { removeTransformMatrixForSvgParsing } from './src/util/transform_matrix_removal';
import { parseFontDeclaration } from './src/parser/parseFontDeclaration';

const util = {
Expand Down Expand Up @@ -254,6 +254,8 @@ const util = {
requestAnimFrame,
cancelAnimFrame,
classRegistry,
// for test compatibility. We don't want to export it.
removeTransformMatrixForSvgParsing,
};

// CONTROLS UTILS
Expand All @@ -264,6 +266,7 @@ import {
renderSquareControl,
} from './src/controls/controls.render';
import { dragHandler } from './src/controls/drag';
import { createPolyControls } from './src/controls/polyControl';
import {
rotationStyleHandler,
rotationWithSnapping,
Expand Down Expand Up @@ -306,6 +309,7 @@ const controlsUtils = {
skewHandlerX,
skewHandlerY,
dragHandler,
createPolyControls,
scaleOrSkewActionName,
rotationStyleHandler,
wrapWithFixedAnchor,
Expand Down Expand Up @@ -427,13 +431,4 @@ const fabric = {
getCSSRules,
};

if (typeof exports !== 'undefined') {
exports.fabric = fabric;
} else if (typeof define === 'function' && define.amd) {
/* _AMD_START_ */
define([], function () {
return fabric;
});
} else if (typeof window !== 'undefined') {
window.fabric = fabric;
}
export default fabric;
Loading

0 comments on commit a3caeac

Please sign in to comment.