fabric 6.0.0-beta14 → 6.0.0-beta15
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 +6 -1
- package/dist/fabric.d.ts +36 -3
- package/dist/index.js +11 -49
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.mjs +9 -47
- package/dist/index.mjs.map +1 -1
- package/dist/index.node.cjs +11 -49
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs +9 -47
- package/dist/index.node.mjs.map +1 -1
- package/dist/src/shapes/Image.d.ts +0 -8
- package/dist/src/shapes/Object/FabricObject.d.ts +0 -8
- package/dist/src/shapes/Text/Text.d.ts +0 -8
- package/fabric.ts +41 -3
- package/package.json +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/Image.ts +0 -8
- package/src/shapes/Object/FabricObject.ts +0 -8
- package/src/shapes/Text/Text.ts +0 -8
- package/dist/src/parser/elementById.d.ts +0 -7
- package/src/parser/elementById.ts +0 -18
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## [next]
|
|
4
4
|
|
|
5
|
-
## [6.0.0-
|
|
5
|
+
## [6.0.0-beta14]
|
|
6
|
+
|
|
7
|
+
- Fix(SVGParser) ignore missing xlink target issue on svg parsing (#9427) [#9109](https://github.com/fabricjs/fabric.js/issues/9109)
|
|
8
|
+
- fix(#9172): dep export `Object`, `Text`, `Image` [#9433](https://github.com/fabricjs/fabric.js/pull/9433)
|
|
9
|
+
|
|
10
|
+
## [6.0.0-beta14]
|
|
6
11
|
|
|
7
12
|
- fix(Object): fixes centeredScaling prop type [#9401](https://github.com/fabricjs/fabric.js/pull/9401)
|
|
8
13
|
- 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,7 +58,18 @@ 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';
|
|
@@ -57,7 +79,18 @@ export type { GroupEvents, GroupProps, LayoutContext, GroupOwnProps, LayoutConte
|
|
|
57
79
|
export { Group } from './src/shapes/Group';
|
|
58
80
|
export type { ActiveSelectionOptions, MultiSelectionStacking, } from './src/shapes/ActiveSelection';
|
|
59
81
|
export { ActiveSelection } from './src/shapes/ActiveSelection';
|
|
60
|
-
export {
|
|
82
|
+
export { FabricImage,
|
|
83
|
+
/**
|
|
84
|
+
* @deprecated Due to a naming conflict with the
|
|
85
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/Image Web API},
|
|
86
|
+
* `fabric.Image` has been renamed to `FabricImage`
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* import { Image } from 'fabric'; // deprecated
|
|
90
|
+
* import { FabricImage } from 'fabric'; // migration path
|
|
91
|
+
*
|
|
92
|
+
*/
|
|
93
|
+
FabricImage as Image, } from './src/shapes/Image';
|
|
61
94
|
export type { ImageSource, SerializedImageProps, ImageProps, } from './src/shapes/Image';
|
|
62
95
|
export { createCollectionMixin } from './src/Collection';
|
|
63
96
|
export * as util from './src/util';
|
package/dist/index.js
CHANGED
|
@@ -419,7 +419,7 @@
|
|
|
419
419
|
}
|
|
420
420
|
const cache = new Cache();
|
|
421
421
|
|
|
422
|
-
var version = "6.0.0-
|
|
422
|
+
var version = "6.0.0-beta15";
|
|
423
423
|
|
|
424
424
|
// use this syntax so babel plugin see this import here
|
|
425
425
|
const VERSION = version;
|
|
@@ -9758,14 +9758,6 @@
|
|
|
9758
9758
|
classRegistry.setClass(FabricObject);
|
|
9759
9759
|
classRegistry.setClass(FabricObject, 'object');
|
|
9760
9760
|
|
|
9761
|
-
/**
|
|
9762
|
-
* @deprecated The old fabric.Object class can't be imported as Object because of conflict with the JS api
|
|
9763
|
-
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
9764
|
-
* For this reason it has been renamed to FabricObject.
|
|
9765
|
-
* Please use `import { FabricObject }` in place of `import { Object as FabricObject }`
|
|
9766
|
-
*/
|
|
9767
|
-
class _Object extends FabricObject {}
|
|
9768
|
-
|
|
9769
9761
|
/**
|
|
9770
9762
|
* Returns true if context has transparent pixel
|
|
9771
9763
|
* at specified location (taking tolerance into account)
|
|
@@ -20135,14 +20127,6 @@
|
|
|
20135
20127
|
classRegistry.setClass(FabricText);
|
|
20136
20128
|
classRegistry.setSVGClass(FabricText);
|
|
20137
20129
|
|
|
20138
|
-
/**
|
|
20139
|
-
* @deprecated The old fabric.Text class can't be imported as Text because of conflict with Web API.
|
|
20140
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/Text/Text
|
|
20141
|
-
* For this reason it has been renamed to FabricText.
|
|
20142
|
-
* Please use `import { FabricText }` in place of `import { Text as FabricText }`
|
|
20143
|
-
*/
|
|
20144
|
-
class Text extends FabricText {}
|
|
20145
|
-
|
|
20146
20130
|
/**
|
|
20147
20131
|
* #### Dragging IText/Textbox Lifecycle
|
|
20148
20132
|
* - {@link start} is called from `mousedown` {@link IText#_mouseDownHandler} and determines if dragging should start by testing {@link isPointerOverSelection}
|
|
@@ -24351,14 +24335,6 @@
|
|
|
24351
24335
|
classRegistry.setClass(FabricImage);
|
|
24352
24336
|
classRegistry.setSVGClass(FabricImage);
|
|
24353
24337
|
|
|
24354
|
-
/**
|
|
24355
|
-
* @deprecated The old fabric.Image class can't be imported as Image because of conflict with Web API.
|
|
24356
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/Image
|
|
24357
|
-
* For this reason it has been renamed to FabricImage.
|
|
24358
|
-
* Please use `import { FabricImage }` in place of `import { Image as FabricImage }`
|
|
24359
|
-
*/
|
|
24360
|
-
class Image extends FabricImage {}
|
|
24361
|
-
|
|
24362
24338
|
/**
|
|
24363
24339
|
* Add a <g> element that envelop all child elements and makes the viewbox transformMatrix descend on all elements
|
|
24364
24340
|
*/
|
|
@@ -24493,25 +24469,6 @@
|
|
|
24493
24469
|
return false;
|
|
24494
24470
|
}
|
|
24495
24471
|
|
|
24496
|
-
/**
|
|
24497
|
-
* @private
|
|
24498
|
-
* TODO: verify if this is still needed
|
|
24499
|
-
* to support IE8 missing getElementById on SVGdocument and on node xmlDOM
|
|
24500
|
-
*/
|
|
24501
|
-
function elementById(doc, id) {
|
|
24502
|
-
if (doc.getElementById) {
|
|
24503
|
-
return doc.getElementById(id);
|
|
24504
|
-
}
|
|
24505
|
-
const nodelist = doc.getElementsByTagName('*');
|
|
24506
|
-
for (let i = 0, len = nodelist.length; i < len; i++) {
|
|
24507
|
-
const node = nodelist[i];
|
|
24508
|
-
if (id === node.getAttribute('id')) {
|
|
24509
|
-
return node;
|
|
24510
|
-
}
|
|
24511
|
-
}
|
|
24512
|
-
return null;
|
|
24513
|
-
}
|
|
24514
|
-
|
|
24515
24472
|
function getMultipleNodes(doc, nodeNames) {
|
|
24516
24473
|
let nodeName,
|
|
24517
24474
|
nodeArray = [],
|
|
@@ -24538,7 +24495,12 @@
|
|
|
24538
24495
|
const xlink = xlinkAttribute.slice(1);
|
|
24539
24496
|
const x = el.getAttribute('x') || 0;
|
|
24540
24497
|
const y = el.getAttribute('y') || 0;
|
|
24541
|
-
|
|
24498
|
+
const el2Orig = doc.getElementById(xlink);
|
|
24499
|
+
if (el2Orig === null) {
|
|
24500
|
+
// if we can't find the target of the xlink, consider this use tag bad, similar to no xlink
|
|
24501
|
+
return;
|
|
24502
|
+
}
|
|
24503
|
+
let el2 = el2Orig.cloneNode(true);
|
|
24542
24504
|
let currentTrans = (el2.getAttribute('transform') || '') + ' translate(' + x + ', ' + y + ')';
|
|
24543
24505
|
const oldLength = nodelist.length;
|
|
24544
24506
|
const namespace = svgNS;
|
|
@@ -24590,7 +24552,7 @@
|
|
|
24590
24552
|
function recursivelyParseGradientsXlink(doc, gradient) {
|
|
24591
24553
|
var _gradient$getAttribut;
|
|
24592
24554
|
const xLink = ((_gradient$getAttribut = gradient.getAttribute(xlinkAttr)) === null || _gradient$getAttribut === void 0 ? void 0 : _gradient$getAttribut.slice(1)) || '',
|
|
24593
|
-
referencedGradient =
|
|
24555
|
+
referencedGradient = doc.getElementById(xLink);
|
|
24594
24556
|
if (referencedGradient && referencedGradient.getAttribute(xlinkAttr)) {
|
|
24595
24557
|
recursivelyParseGradientsXlink(doc, referencedGradient);
|
|
24596
24558
|
}
|
|
@@ -27686,10 +27648,10 @@
|
|
|
27686
27648
|
exports.Gradient = Gradient;
|
|
27687
27649
|
exports.Group = Group;
|
|
27688
27650
|
exports.IText = IText;
|
|
27689
|
-
exports.Image =
|
|
27651
|
+
exports.Image = FabricImage;
|
|
27690
27652
|
exports.Intersection = Intersection;
|
|
27691
27653
|
exports.Line = Line;
|
|
27692
|
-
exports.Object =
|
|
27654
|
+
exports.Object = FabricObject;
|
|
27693
27655
|
exports.Observable = Observable;
|
|
27694
27656
|
exports.Path = Path;
|
|
27695
27657
|
exports.Pattern = Pattern;
|
|
@@ -27703,7 +27665,7 @@
|
|
|
27703
27665
|
exports.SprayBrush = SprayBrush;
|
|
27704
27666
|
exports.StaticCanvas = StaticCanvas;
|
|
27705
27667
|
exports.StaticCanvasDOMManager = StaticCanvasDOMManager;
|
|
27706
|
-
exports.Text =
|
|
27668
|
+
exports.Text = FabricText;
|
|
27707
27669
|
exports.Textbox = Textbox;
|
|
27708
27670
|
exports.Triangle = Triangle;
|
|
27709
27671
|
exports.WebGLFilterBackend = WebGLFilterBackend;
|