fabric 6.0.0-beta14 → 6.0.0-beta16
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 +28 -1
- package/dist/fabric.d.ts +38 -4
- package/dist/index.js +917 -995
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.mjs +910 -993
- package/dist/index.mjs.map +1 -1
- package/dist/index.node.cjs +917 -995
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs +910 -993
- package/dist/index.node.mjs.map +1 -1
- package/dist/src/Collection.d.ts +5 -0
- package/dist/src/EventTypeDefs.d.ts +39 -8
- package/dist/src/LayoutManager/LayoutManager.d.ts +35 -0
- package/dist/src/LayoutManager/LayoutStrategies/ClipPathLayout.d.ts +13 -0
- package/dist/src/LayoutManager/LayoutStrategies/FitContentLayout.d.ts +14 -0
- package/dist/src/LayoutManager/LayoutStrategies/FixedLayout.d.ts +14 -0
- package/dist/src/LayoutManager/LayoutStrategies/LayoutStrategy.d.ts +32 -0
- package/dist/src/LayoutManager/LayoutStrategies/utils.d.ts +10 -0
- package/dist/src/LayoutManager/constants.d.ts +7 -0
- package/dist/src/LayoutManager/index.d.ts +7 -0
- package/dist/src/LayoutManager/types.d.ts +107 -0
- package/dist/src/Point.d.ts +2 -1
- package/dist/src/canvas/Canvas.d.ts +5 -10
- package/dist/src/canvas/SelectableCanvas.d.ts +47 -24
- package/dist/src/canvas/StaticCanvas.d.ts +2 -10
- package/dist/src/constants.d.ts +0 -3
- package/dist/src/controls/polyControl.d.ts +1 -1
- package/dist/src/shapes/ActiveSelection.d.ts +4 -5
- package/dist/src/shapes/Group.d.ts +17 -141
- package/dist/src/shapes/IText/ITextClickBehavior.d.ts +2 -3
- package/dist/src/shapes/Image.d.ts +1 -9
- package/dist/src/shapes/Object/FabricObject.d.ts +0 -8
- package/dist/src/shapes/Object/InteractiveObject.d.ts +18 -20
- package/dist/src/shapes/Object/ObjectGeometry.d.ts +22 -90
- package/dist/src/shapes/Object/ObjectOrigin.d.ts +1 -0
- package/dist/src/shapes/Object/StackedObject.d.ts +1 -6
- package/dist/src/shapes/Text/Text.d.ts +0 -8
- package/dist/src/util/index.d.ts +1 -1
- package/dist/src/util/misc/groupSVGElements.d.ts +3 -1
- package/dist/src/util/misc/matrix.d.ts +1 -0
- package/dist/src/util/misc/objectTransforms.d.ts +3 -9
- package/dist/src/util/misc/planeChange.d.ts +2 -19
- package/dist/src/util/typeAssertions.d.ts +1 -11
- package/fabric.ts +42 -7
- package/jest.extend.ts +16 -0
- package/package.json +3 -3
- package/src/Collection.ts +14 -4
- package/src/EventTypeDefs.ts +42 -8
- package/src/LayoutManager/LayoutManager.spec.ts +813 -0
- package/src/LayoutManager/LayoutManager.ts +303 -0
- package/src/LayoutManager/LayoutStrategies/ClipPathLayout.ts +70 -0
- package/src/LayoutManager/LayoutStrategies/FitContentLayout.ts +18 -0
- package/src/LayoutManager/LayoutStrategies/FixedLayout.ts +24 -0
- package/src/LayoutManager/LayoutStrategies/LayoutStrategy.ts +123 -0
- package/src/LayoutManager/LayoutStrategies/utils.ts +53 -0
- package/src/LayoutManager/README.md +87 -0
- package/src/LayoutManager/__snapshots__/LayoutManager.spec.ts.snap +106 -0
- package/src/LayoutManager/constants.ts +6 -0
- package/src/LayoutManager/index.ts +6 -0
- package/src/LayoutManager/types.ts +146 -0
- package/src/Point.ts +3 -3
- package/src/benchmarks/raycasting.mjs +4 -6
- package/src/brushes/SprayBrush.ts +0 -1
- package/src/canvas/Canvas.ts +97 -132
- package/src/canvas/SelectableCanvas.spec.ts +305 -0
- package/src/canvas/SelectableCanvas.ts +99 -39
- package/src/canvas/StaticCanvas.ts +5 -17
- package/src/canvas/TextEditingManager.ts +3 -5
- package/src/canvas/__tests__/__snapshots__/eventData.test.ts.snap +229 -51
- package/src/canvas/__tests__/eventData.test.ts +30 -3
- package/src/constants.ts +2 -4
- package/src/controls/polyControl.spec.ts +44 -0
- package/src/controls/polyControl.ts +8 -2
- package/src/controls/util.ts +1 -1
- package/src/parser/loadSVGFromString.test.ts +36 -0
- package/src/parser/parseUseDirectives.ts +6 -2
- package/src/parser/recursivelyParseGradientsXlink.ts +1 -3
- package/src/shapes/ActiveSelection.spec.ts +72 -6
- package/src/shapes/ActiveSelection.ts +28 -43
- package/src/shapes/Group.spec.ts +58 -0
- package/src/shapes/Group.ts +94 -532
- package/src/shapes/IText/DraggableTextDelegate.ts +2 -2
- package/src/shapes/IText/ITextClickBehavior.ts +14 -20
- package/src/shapes/Image.ts +1 -9
- package/src/shapes/Object/FabricObject.ts +0 -8
- package/src/shapes/Object/InteractiveObject.spec.ts +5 -1
- package/src/shapes/Object/InteractiveObject.ts +30 -24
- package/src/shapes/Object/Object.spec.ts +42 -0
- package/src/shapes/Object/Object.ts +3 -3
- package/src/shapes/Object/ObjectGeometry.ts +55 -203
- package/src/shapes/Object/ObjectOrigin.ts +7 -2
- package/src/shapes/Object/StackedObject.ts +9 -18
- package/src/shapes/Object/__snapshots__/InteractiveObject.spec.ts.snap +81 -0
- package/src/shapes/Text/Text.ts +0 -8
- package/src/shapes/__snapshots__/ActiveSelection.spec.ts.snap +0 -21
- package/src/util/index.ts +1 -1
- package/src/util/misc/groupSVGElements.ts +8 -3
- package/src/util/misc/matrix.ts +4 -1
- package/src/util/misc/objectTransforms.ts +4 -12
- package/src/util/misc/planeChange.spec.ts +100 -0
- package/src/util/misc/planeChange.ts +6 -42
- package/src/util/typeAssertions.ts +1 -47
- package/typedoc.json +1 -0
- package/dist/src/parser/elementById.d.ts +0 -7
- package/src/parser/elementById.ts +0 -18
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
## [next]
|
|
4
4
|
|
|
5
|
-
## [6.0.0-
|
|
5
|
+
## [6.0.0-beta16]
|
|
6
|
+
|
|
7
|
+
- fix(): block `enterEditing` after `endCurrentTransform` [#9513](https://github.com/fabricjs/fabric.js/pull/9513)
|
|
8
|
+
- fix(): transferring object between active selections, expose `FabricObject#parent`, rm `isActiveSelection` [#8951](https://github.com/fabricjs/fabric.js/pull/8951)
|
|
9
|
+
**BREAKING beta**:
|
|
10
|
+
- rm(): `getParent` => `FabricObject#parent`
|
|
11
|
+
- refactor(): Layout Manager [#9152](https://github.com/fabricjs/fabric.js/pull/9152)
|
|
12
|
+
- refactor(): transferring object between active selections, expose `FabricObject#parent`, rm `isActiveSelection` [#8951](https://github.com/fabricjs/fabric.js/pull/8951)
|
|
13
|
+
- refactor(): **BREAKING beta** `getParent` => `FabricObject#parent` [#8951](https://github.com/fabricjs/fabric.js/pull/8951)
|
|
14
|
+
- fix(): fire Poly control events [#9504](https://github.com/fabricjs/fabric.js/pull/9504)
|
|
15
|
+
- test(FabricObject): add a snapshot of the default values so that reordering and shuffling is verified. [#9492](https://github.com/fabricjs/fabric.js/pull/9492)
|
|
16
|
+
- feat(FabricObject, Canvas) BREAKING: remove calculate true/false from the api. [#9483](https://github.com/fabricjs/fabric.js/pull/9483)
|
|
17
|
+
- chore(): remove some Type assertions [#8950](https://github.com/fabricjs/fabric.js/pull/8950)
|
|
18
|
+
- chore(): expose `sendVectorToPlane` [#9479](https://github.com/fabricjs/fabric.js/pull/9479)
|
|
19
|
+
- feat(FabricObject, Canvas) BREAKING: remove absolute true/false from the api. [#9395](https://github.com/fabricjs/fabric.js/pull/9395)
|
|
20
|
+
- refactor(Canvas): BREAKING deprecate `getPointer`, add new getScenePoint and getViewportPoint methods, removed `restorePointerVpt`, extended mouse events data [#9175](https://github.com/fabricjs/fabric.js/pull/9175)
|
|
21
|
+
- chore(): rm isClick artifacts leftovers from #9434 [#9478](https://github.com/fabricjs/fabric.js/pull/9478)
|
|
22
|
+
- fix(Object): Fix detection of falsy shadows in Object.needsItsOwnCache method [#9469](https://github.com/fabricjs/fabric.js/pull/9469)
|
|
23
|
+
- feat(util): expose `calcPlaneRotation` [#9419](https://github.com/fabricjs/fabric.js/pull/9419)
|
|
24
|
+
- refactor(Canvas): BREAKING remove button from mouse events, delegate to event.button property [#9449](https://github.com/fabricjs/fabric.js/pull/9449)
|
|
25
|
+
- patch(Canvas): move event mouse:up:before earlier in the logic for more control [#9434](https://github.com/fabricjs/fabric.js/pull/9434)
|
|
26
|
+
|
|
27
|
+
## [6.0.0-beta15]
|
|
28
|
+
|
|
29
|
+
- Fix(SVGParser) ignore missing xlink target issue on svg parsing (#9427) [#9109](https://github.com/fabricjs/fabric.js/issues/9109)
|
|
30
|
+
- fix(#9172): dep export `Object`, `Text`, `Image` [#9433](https://github.com/fabricjs/fabric.js/pull/9433)
|
|
31
|
+
|
|
32
|
+
## [6.0.0-beta14]
|
|
6
33
|
|
|
7
34
|
- fix(Object): fixes centeredScaling prop type [#9401](https://github.com/fabricjs/fabric.js/pull/9401)
|
|
8
35
|
- CI(): fix build caching + tests when merging to master [#9404](https://github.com/fabricjs/fabric.js/pull/9404)
|
package/dist/fabric.d.ts
CHANGED
|
@@ -30,7 +30,18 @@ export { PencilBrush } from './src/brushes/PencilBrush';
|
|
|
30
30
|
export { CircleBrush } from './src/brushes/CircleBrush';
|
|
31
31
|
export { SprayBrush } from './src/brushes/SprayBrush';
|
|
32
32
|
export { PatternBrush } from './src/brushes/PatternBrush';
|
|
33
|
-
export { FabricObject,
|
|
33
|
+
export { FabricObject,
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated Due to a naming conflict with the
|
|
36
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object JS API},
|
|
37
|
+
* `fabric.Object` has been renamed to `FabricObject`
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* import { Object } from 'fabric'; // deprecated
|
|
41
|
+
* import { FabricObject } from 'fabric'; // migration path
|
|
42
|
+
*
|
|
43
|
+
*/
|
|
44
|
+
FabricObject as Object, } from './src/shapes/Object/FabricObject';
|
|
34
45
|
export type { TFabricObjectProps, FabricObjectProps, SerializedObjectProps, } from './src/shapes/Object/types';
|
|
35
46
|
export type { SerializedLineProps } from './src/shapes/Line';
|
|
36
47
|
export { Line } from './src/shapes/Line';
|
|
@@ -47,17 +58,40 @@ export type { SerializedPolylineProps } from './src/shapes/Polyline';
|
|
|
47
58
|
export { Polyline } from './src/shapes/Polyline';
|
|
48
59
|
export { Polygon } from './src/shapes/Polygon';
|
|
49
60
|
export type { GraphemeBBox, SerializedTextProps, TPathAlign, TPathSide, TextProps, } from './src/shapes/Text/Text';
|
|
50
|
-
export {
|
|
61
|
+
export { FabricText,
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated Due to a naming conflict with the
|
|
64
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/API/Text/Text Web API},
|
|
65
|
+
* `fabric.Text` has been renamed to `FabricText`
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* import { Text } from 'fabric'; // deprecated
|
|
69
|
+
* import { FabricText } from 'fabric'; // migration path
|
|
70
|
+
*
|
|
71
|
+
*/
|
|
72
|
+
FabricText as Text, } from './src/shapes/Text/Text';
|
|
51
73
|
export type { ITextProps, SerializedITextProps, } from './src/shapes/IText/IText';
|
|
52
74
|
export { IText } from './src/shapes/IText/IText';
|
|
53
75
|
export type { GraphemeData, SerializedTextboxProps, TextboxProps, } from './src/shapes/Textbox';
|
|
54
76
|
export { Textbox } from './src/shapes/Textbox';
|
|
55
77
|
export type { CompleteTextStyleDeclaration, TextStyleDeclaration, TextStyle, } from './src/shapes/Text/StyledText';
|
|
56
|
-
export type { GroupEvents, GroupProps,
|
|
78
|
+
export type { GroupEvents, GroupProps, GroupOwnProps, SerializedGroupProps, } from './src/shapes/Group';
|
|
57
79
|
export { Group } from './src/shapes/Group';
|
|
80
|
+
export * from './src/LayoutManager';
|
|
58
81
|
export type { ActiveSelectionOptions, MultiSelectionStacking, } from './src/shapes/ActiveSelection';
|
|
59
82
|
export { ActiveSelection } from './src/shapes/ActiveSelection';
|
|
60
|
-
export {
|
|
83
|
+
export { FabricImage,
|
|
84
|
+
/**
|
|
85
|
+
* @deprecated Due to a naming conflict with the
|
|
86
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/Image Web API},
|
|
87
|
+
* `fabric.Image` has been renamed to `FabricImage`
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* import { Image } from 'fabric'; // deprecated
|
|
91
|
+
* import { FabricImage } from 'fabric'; // migration path
|
|
92
|
+
*
|
|
93
|
+
*/
|
|
94
|
+
FabricImage as Image, } from './src/shapes/Image';
|
|
61
95
|
export type { ImageSource, SerializedImageProps, ImageProps, } from './src/shapes/Image';
|
|
62
96
|
export { createCollectionMixin } from './src/Collection';
|
|
63
97
|
export * as util from './src/util';
|