react-design-editor 0.0.59 → 0.0.61

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.
@@ -868,6 +868,7 @@ class Handler {
868
868
  type: obj.type,
869
869
  nodeClazz: obj.nodeClazz,
870
870
  configuration: obj.configuration,
871
+ descriptor: obj.descriptor,
871
872
  properties: {
872
873
  left: activeObject.left + activeObject.width / 2 + obj.left || 0,
873
874
  top: activeObject.top + activeObject.height / 2 + obj.top || 0,
@@ -892,6 +893,7 @@ class Handler {
892
893
  type: cloned.type,
893
894
  nodeClazz: cloned.nodeClazz,
894
895
  configuration: cloned.configuration,
896
+ descriptor: cloned.descriptor,
895
897
  properties: {
896
898
  left: cloned.left || 0,
897
899
  top: cloned.top || 0,
@@ -6,6 +6,12 @@ export type SvgObject = (FabricGroup | FabricObject) & {
6
6
  };
7
7
  export interface SvgOption extends FabricObjectOption {
8
8
  src?: string;
9
+ /**
10
+ *
11
+ * @deprecated
12
+ * @type {*}
13
+ */
14
+ svg?: any;
9
15
  loadType?: 'file' | 'svg';
10
16
  keepSize?: boolean;
11
17
  }
@@ -56,15 +56,15 @@ const Svg = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
56
56
  return this;
57
57
  },
58
58
  loadSvg(option) {
59
- const { src, loadType, fill, stroke } = option;
59
+ const { src, svg, loadType, fill, stroke } = option;
60
60
  return new Promise(resolve => {
61
61
  if (loadType === 'svg') {
62
- fabric_1.fabric.loadSVGFromString(src, (objects, options) => {
62
+ fabric_1.fabric.loadSVGFromString(svg || src, (objects, options) => {
63
63
  resolve(this.addSvgElements(objects, { ...options, fill, stroke }));
64
64
  });
65
65
  }
66
66
  else {
67
- fabric_1.fabric.loadSVGFromURL(src, (objects, options) => {
67
+ fabric_1.fabric.loadSVGFromURL(svg || src, (objects, options) => {
68
68
  resolve(this.addSvgElements(objects, { ...options, fill, stroke }));
69
69
  });
70
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-design-editor",
3
- "version": "0.0.59",
3
+ "version": "0.0.61",
4
4
  "description": "Design Editor Tools with React.js + ant.design + fabric.js",
5
5
  "main": "dist/react-design-editor.min.js",
6
6
  "typings": "lib/index.d.ts",