react-design-editor 0.0.58 → 0.0.60
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.
|
@@ -198591,19 +198591,20 @@ var Svg = fabric["fabric"].util.createClass(fabric["fabric"].Group, {
|
|
|
198591
198591
|
var _this2 = this;
|
|
198592
198592
|
|
|
198593
198593
|
var src = option.src,
|
|
198594
|
+
svg = option.svg,
|
|
198594
198595
|
loadType = option.loadType,
|
|
198595
198596
|
fill = option.fill,
|
|
198596
198597
|
stroke = option.stroke;
|
|
198597
198598
|
return new Promise(function (resolve) {
|
|
198598
198599
|
if (loadType === 'svg') {
|
|
198599
|
-
fabric["fabric"].loadSVGFromString(src, function (objects, options) {
|
|
198600
|
+
fabric["fabric"].loadSVGFromString(svg || src, function (objects, options) {
|
|
198600
198601
|
resolve(_this2.addSvgElements(objects, Svg_objectSpread(Svg_objectSpread({}, options), {}, {
|
|
198601
198602
|
fill: fill,
|
|
198602
198603
|
stroke: stroke
|
|
198603
198604
|
})));
|
|
198604
198605
|
});
|
|
198605
198606
|
} else {
|
|
198606
|
-
fabric["fabric"].loadSVGFromURL(src, function (objects, options) {
|
|
198607
|
+
fabric["fabric"].loadSVGFromURL(svg || src, function (objects, options) {
|
|
198607
198608
|
resolve(_this2.addSvgElements(objects, Svg_objectSpread(Svg_objectSpread({}, options), {}, {
|
|
198608
198609
|
fill: fill,
|
|
198609
198610
|
stroke: stroke
|
|
@@ -202252,7 +202253,7 @@ var Handler_Handler = /*#__PURE__*/function () {
|
|
|
202252
202253
|
return Promise.resolve(_this.setImage(findObject, source, keepSize));
|
|
202253
202254
|
};
|
|
202254
202255
|
|
|
202255
|
-
this.setSvg = function (obj, source,
|
|
202256
|
+
this.setSvg = function (obj, source, keepSize, xmlString) {
|
|
202256
202257
|
return new Promise(function (resolve) {
|
|
202257
202258
|
if (!source) {
|
|
202258
202259
|
resolve(obj.loadSvg({
|
|
@@ -202276,7 +202277,7 @@ var Handler_Handler = /*#__PURE__*/function () {
|
|
|
202276
202277
|
} else {
|
|
202277
202278
|
resolve(obj.loadSvg({
|
|
202278
202279
|
src: source,
|
|
202279
|
-
loadType:
|
|
202280
|
+
loadType: xmlString ? 'svg' : 'file',
|
|
202280
202281
|
keepSize: keepSize
|
|
202281
202282
|
}));
|
|
202282
202283
|
}
|