- Linting (ESLint): As per latest ash-nazg

- npm: Update devDeps
This commit is contained in:
Brett Zamir
2020-02-01 20:44:13 +08:00
parent f9f359b98f
commit 33c84d89b8
37 changed files with 1254 additions and 953 deletions

2
dist/canvg.js vendored
View File

@@ -2,6 +2,8 @@ var canvg = (function (exports) {
'use strict';
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;

View File

@@ -2,6 +2,8 @@
'use strict';
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;

View File

@@ -47,10 +47,12 @@ var svgEditorExtension_arrows = (function () {
*/
var extArrows = {
name: 'arrows',
init: function () {
var _init = _asyncToGenerator(
init: function init(S) {
var _this = this;
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee2(S) {
regeneratorRuntime.mark(function _callee2() {
var strings, svgEditor, svgCanvas, addElem, nonce, $, prefix, selElems, arrowprefix, randomizeIds, setArrowNonce, unsetArrowNonce, pathdata, getLinked, showPanel, resetMarker, addMarker, setArrow, colorChanged, contextTools;
return regeneratorRuntime.wrap(function _callee2$(_context2) {
while (1) {
@@ -266,7 +268,7 @@ var svgEditorExtension_arrows = (function () {
case 10:
strings = _context2.sent;
svgEditor = this;
svgEditor = _this;
svgCanvas = svgEditor.canvas;
// {svgcontent} = S,
addElem = svgCanvas.addSVGElementFromJson, nonce = S.nonce, $ = S.$, prefix = 'se_arrow_';
@@ -324,41 +326,36 @@ var svgEditorExtension_arrows = (function () {
$('#arrow_list option')[0].id = 'connector_no_arrow';
},
addLangData: function () {
var _addLangData = _asyncToGenerator(
addLangData: function addLangData(_ref) {
var lang = _ref.lang,
importLocale = _ref.importLocale;
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(_ref) {
var lang, importLocale, _ref2, langList;
regeneratorRuntime.mark(function _callee() {
var _ref2, langList;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
lang = _ref.lang, importLocale = _ref.importLocale;
_context.next = 3;
_context.next = 2;
return importLocale();
case 3:
case 2:
_ref2 = _context.sent;
langList = _ref2.langList;
return _context.abrupt("return", {
data: langList
});
case 6:
case 5:
case "end":
return _context.stop();
}
}
}, _callee);
}));
function addLangData(_x2) {
return _addLangData.apply(this, arguments);
}
return addLangData;
}(),
}))();
},
selectedChanged: function selectedChanged(opts) {
// Use this to update the current selected elements
selElems = opts.elems;
@@ -397,15 +394,9 @@ var svgEditorExtension_arrows = (function () {
return _context2.stop();
}
}
}, _callee2, this);
}));
function init(_x) {
return _init.apply(this, arguments);
}
return init;
}()
}, _callee2);
}))();
}
};
return extArrows;

View File

@@ -49,22 +49,25 @@ var svgEditorExtension_closepath = (function () {
// The button toggles whether the path is open or closed
var extClosepath = {
name: 'closepath',
init: function () {
var _init = _asyncToGenerator(
init: function init(_ref) {
var _this = this;
var importLocale = _ref.importLocale,
$ = _ref.$;
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(_ref) {
var importLocale, $, strings, svgEditor, selElems, updateButton, showPanel, toggleClosed, buttons;
regeneratorRuntime.mark(function _callee() {
var strings, svgEditor, selElems, updateButton, showPanel, toggleClosed, buttons;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
importLocale = _ref.importLocale, $ = _ref.$;
_context.next = 3;
_context.next = 2;
return importLocale();
case 3:
case 2:
strings = _context.sent;
svgEditor = this;
svgEditor = _this;
updateButton = function updateButton(path) {
var seglist = path.pathSegList,
@@ -154,20 +157,14 @@ var svgEditorExtension_closepath = (function () {
}
});
case 10:
case 9:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));
function init(_x) {
return _init.apply(this, arguments);
}
return init;
}()
}, _callee);
}))();
}
};
return extClosepath;

View File

@@ -49,10 +49,12 @@ var svgEditorExtension_connector = (function () {
*/
var extConnector = {
name: 'connector',
init: function () {
var _init = _asyncToGenerator(
init: function init(S) {
var _this = this;
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(S) {
regeneratorRuntime.mark(function _callee() {
var svgEditor, svgCanvas, getElem, $, svgroot, importLocale, addElem, selManager, connSel, elData, strings, startX, startY, curLine, startElem, endElem, seNs, svgcontent, started, connections, selElems, getBBintersect, getOffset, showPanel, setPoint, updateLine, findConnectors, updateConnectors, init, buttons;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
@@ -298,7 +300,7 @@ var svgEditorExtension_connector = (function () {
};
};
svgEditor = this;
svgEditor = _this;
svgCanvas = svgEditor.canvas;
getElem = svgCanvas.getElem;
$ = S.$, svgroot = S.svgroot, importLocale = S.importLocale, addElem = svgCanvas.addSVGElementFromJson, selManager = S.selectorManager, connSel = '.se_connector', elData = $.data;
@@ -683,15 +685,9 @@ var svgEditorExtension_connector = (function () {
return _context.stop();
}
}
}, _callee, this);
}));
function init(_x) {
return _init.apply(this, arguments);
}
return init;
}()
}, _callee);
}))();
}
};
return extConnector;

View File

@@ -47,10 +47,12 @@ var svgEditorExtension_eyedropper = (function () {
*/
var extEyedropper = {
name: 'eyedropper',
init: function () {
var _init = _asyncToGenerator(
init: function init(S) {
var _this = this;
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(S) {
regeneratorRuntime.mark(function _callee() {
var strings, svgEditor, $, ChangeElementCommand, svgCanvas, addToHistory, currentStyle, getStyle, buttons;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
@@ -91,7 +93,7 @@ var svgEditorExtension_eyedropper = (function () {
case 3:
strings = _context.sent;
svgEditor = this;
svgEditor = _this;
$ = S.$, ChangeElementCommand = S.ChangeElementCommand, svgCanvas = svgEditor.canvas, addToHistory = function addToHistory(cmd) {
svgCanvas.undoMgr.addCommandToHistory(cmd);
}, currentStyle = {
@@ -192,15 +194,9 @@ var svgEditorExtension_eyedropper = (function () {
return _context.stop();
}
}
}, _callee, this);
}));
function init(_x) {
return _init.apply(this, arguments);
}
return init;
}()
}, _callee);
}))();
}
};
return extEyedropper;

View File

@@ -47,10 +47,12 @@ var svgEditorExtension_foreignobject = (function () {
*/
var extForeignobject = {
name: 'foreignobject',
init: function () {
var _init = _asyncToGenerator(
init: function init(S) {
var _this = this;
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee2(S) {
regeneratorRuntime.mark(function _callee2() {
var svgEditor, $, text2xml, NS, importLocale, svgCanvas, svgdoc, strings, properlySourceSizeTextArea, showPanel, toggleSourceButtons, selElems, started, newFO, editingforeign, setForeignString, showForeignEditor, setAttr, buttons, contextTools;
return regeneratorRuntime.wrap(function _callee2$(_context2) {
while (1) {
@@ -115,7 +117,7 @@ var svgEditorExtension_foreignobject = (function () {
$('#foreignObject_panel').toggle(on);
};
svgEditor = this;
svgEditor = _this;
$ = S.$, text2xml = S.text2xml, NS = S.NS, importLocale = S.importLocale;
svgCanvas = svgEditor.canvas;
svgdoc = S.svgroot.parentNode.ownerDocument;
@@ -357,15 +359,9 @@ var svgEditorExtension_foreignobject = (function () {
return _context2.stop();
}
}
}, _callee2, this);
}));
function init(_x) {
return _init.apply(this, arguments);
}
return init;
}()
}, _callee2);
}))();
}
};
return extForeignobject;

View File

@@ -47,11 +47,17 @@ var svgEditorExtension_grid = (function () {
*/
var extGrid = {
name: 'grid',
init: function () {
var _init = _asyncToGenerator(
init: function init(_ref) {
var _this = this;
var $ = _ref.$,
NS = _ref.NS,
getTypeMap = _ref.getTypeMap,
importLocale = _ref.importLocale;
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(_ref) {
var $, NS, getTypeMap, importLocale, strings, svgEditor, svgCanvas, svgdoc, assignAttributes, hcanvas, canvBG, units, intervals, showGrid, canvasGrid, gridDefs, gridPattern, gridimg, gridBox, updateGrid, gridUpdate, buttons;
regeneratorRuntime.mark(function _callee() {
var strings, svgEditor, svgCanvas, svgdoc, assignAttributes, hcanvas, canvBG, units, intervals, showGrid, canvasGrid, gridDefs, gridPattern, gridimg, gridBox, updateGrid, gridUpdate, buttons;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
@@ -113,13 +119,12 @@ var svgEditorExtension_grid = (function () {
svgCanvas.setHref(gridimg, datauri);
};
$ = _ref.$, NS = _ref.NS, getTypeMap = _ref.getTypeMap, importLocale = _ref.importLocale;
_context.next = 5;
_context.next = 4;
return importLocale();
case 5:
case 4:
strings = _context.sent;
svgEditor = this;
svgEditor = _this;
svgCanvas = svgEditor.canvas;
svgdoc = document.getElementById('svgcanvas').ownerDocument, assignAttributes = svgCanvas.assignAttributes, hcanvas = document.createElement('canvas'), canvBG = $('#canvasBackground'), units = getTypeMap(), intervals = [0.01, 0.1, 1, 10, 100, 1000];
showGrid = svgEditor.curConfig.showGrid || false;
@@ -207,20 +212,14 @@ var svgEditorExtension_grid = (function () {
})
});
case 27:
case 26:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));
function init(_x) {
return _init.apply(this, arguments);
}
return init;
}()
}, _callee);
}))();
}
};
return extGrid;

View File

@@ -95,22 +95,25 @@ var svgEditorExtension_helloworld = (function () {
*/
var extHelloworld = {
name: 'helloworld',
init: function () {
var _init = _asyncToGenerator(
init: function init(_ref) {
var _this = this;
var $ = _ref.$,
importLocale = _ref.importLocale;
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(_ref) {
var $, importLocale, strings, svgEditor, svgCanvas;
regeneratorRuntime.mark(function _callee() {
var strings, svgEditor, svgCanvas;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
$ = _ref.$, importLocale = _ref.importLocale;
_context.next = 3;
_context.next = 2;
return importLocale();
case 3:
case 2:
strings = _context.sent;
svgEditor = this;
svgEditor = _this;
svgCanvas = svgEditor.canvas;
return _context.abrupt("return", {
name: strings.name,
@@ -176,20 +179,14 @@ var svgEditorExtension_helloworld = (function () {
}
});
case 7:
case 6:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));
function init(_x) {
return _init.apply(this, arguments);
}
return init;
}()
}, _callee);
}))();
}
};
return extHelloworld;

View File

@@ -2,6 +2,8 @@ var svgEditorExtension_imagelib = (function () {
'use strict';
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
@@ -61,11 +63,17 @@ var svgEditorExtension_imagelib = (function () {
*/
var extImagelib = {
name: 'imagelib',
init: function () {
var _init = _asyncToGenerator(
init: function init(_ref) {
var _this = this;
var $ = _ref.$,
decode64 = _ref.decode64,
importLocale = _ref.importLocale,
dropXMLInternalSubset = _ref.dropXMLInternalSubset;
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee2(_ref) {
var $, decode64, importLocale, dropXMLInternalSubset, imagelibStrings, modularVersion, svgEditor, uiStrings, svgCanvas, extIconsPath, allowedImageLibOrigins, closeBrowser, importImage, pending, mode, multiArr, transferStopped, preview, submit, onMessage, _onMessage, toggleMulti, showBrowser, buttons;
regeneratorRuntime.mark(function _callee2() {
var imagelibStrings, modularVersion, svgEditor, uiStrings, svgCanvas, extIconsPath, allowedImageLibOrigins, closeBrowser, importImage, pending, mode, multiArr, transferStopped, preview, submit, onMessage, _onMessage, toggleMulti, showBrowser, buttons;
return regeneratorRuntime.wrap(function _callee2$(_context2) {
while (1) {
@@ -127,10 +135,10 @@ var svgEditorExtension_imagelib = (function () {
});
cancel.prepend($.getSvgIcon('cancel', true));
back.prepend($.getSvgIcon('tool_imagelib', true));
imagelibStrings.imgLibs.forEach(function (_ref5) {
var name = _ref5.name,
url = _ref5.url,
description = _ref5.description;
imagelibStrings.imgLibs.forEach(function (_ref4) {
var name = _ref4.name,
url = _ref4.url,
description = _ref4.description;
$('<li>').appendTo(libOpts).text(name).on('click touchend', function () {
frame.attr('src', url).show();
header.text(name);
@@ -188,13 +196,13 @@ var svgEditorExtension_imagelib = (function () {
_onMessage = function _ref9() {
_onMessage = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(_ref4) {
regeneratorRuntime.mark(function _callee(_ref5) {
var origin, response, id, type, hasName, hasHref, char1, secondpos, entry, curMeta, svgStr, imgStr, name, message, pre, src, title, xml, ok;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
origin = _ref4.origin, response = _ref4.data;
origin = _ref5.origin, response = _ref5.data;
if (!(!response || !['string', 'object'].includes(_typeof(response)))) {
_context.next = 3;
@@ -473,7 +481,7 @@ var svgEditorExtension_imagelib = (function () {
return _onMessage.apply(this, arguments);
};
onMessage = function _ref8(_x2) {
onMessage = function _ref8(_x) {
return _onMessage.apply(this, arguments);
};
@@ -498,14 +506,13 @@ var svgEditorExtension_imagelib = (function () {
$('#imgbrowse_holder').hide();
};
$ = _ref.$, decode64 = _ref.decode64, importLocale = _ref.importLocale, dropXMLInternalSubset = _ref.dropXMLInternalSubset;
_context2.next = 9;
_context2.next = 8;
return importLocale();
case 9:
case 8:
imagelibStrings = _context2.sent;
modularVersion = !('svgEditor' in window) || !window.svgEditor || window.svgEditor.modules !== false;
svgEditor = this;
svgEditor = _this;
uiStrings = svgEditor.uiStrings, svgCanvas = svgEditor.canvas, extIconsPath = svgEditor.curConfig.extIconsPath;
imagelibStrings.imgLibs = imagelibStrings.imgLibs.map(function (_ref2) {
var name = _ref2.name,
@@ -564,20 +571,14 @@ var svgEditorExtension_imagelib = (function () {
}
});
case 22:
case 21:
case "end":
return _context2.stop();
}
}
}, _callee2, this);
}));
function init(_x) {
return _init.apply(this, arguments);
}
return init;
}()
}, _callee2);
}))();
}
};
return extImagelib;

View File

@@ -69,10 +69,12 @@ var svgEditorExtension_markers = (function () {
*/
var extMarkers = {
name: 'markers',
init: function () {
var _init = _asyncToGenerator(
init: function init(S) {
var _this = this;
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee3(S) {
regeneratorRuntime.mark(function _callee3() {
var strings, svgEditor, $, svgCanvas, addElem, mtypes, markerPrefix, idPrefix, markerTypes, getLinked, setIcon, selElems, showPanel, addMarker, convertline, setMarker, colorChanged, updateReferences, triggerTextEntry, showTextPrompt, _showTextPrompt, setArrowFromButton, _setArrowFromButton, getTitle, buildButtonList, contextTools;
return regeneratorRuntime.wrap(function _callee3$(_context3) {
@@ -178,7 +180,7 @@ var svgEditorExtension_markers = (function () {
return _setArrowFromButton.apply(this, arguments);
};
setArrowFromButton = function _ref13(_x3) {
setArrowFromButton = function _ref13(_x2) {
return _setArrowFromButton.apply(this, arguments);
};
@@ -217,7 +219,7 @@ var svgEditorExtension_markers = (function () {
return _showTextPrompt.apply(this, arguments);
};
showTextPrompt = function _ref11(_x2) {
showTextPrompt = function _ref11(_x) {
return _showTextPrompt.apply(this, arguments);
};
@@ -550,7 +552,7 @@ var svgEditorExtension_markers = (function () {
case 17:
strings = _context3.sent;
svgEditor = this;
svgEditor = _this;
$ = S.$;
svgCanvas = svgEditor.canvas;
addElem = svgCanvas.addSVGElementFromJson;
@@ -757,15 +759,9 @@ var svgEditorExtension_markers = (function () {
return _context3.stop();
}
}
}, _callee3, this);
}));
function init(_x) {
return _init.apply(this, arguments);
}
return init;
}()
}, _callee3);
}))();
}
};
return extMarkers;

View File

@@ -103,11 +103,15 @@ var svgEditorExtension_mathjax = (function () {
var extMathjax = {
name: 'mathjax',
init: function () {
var _init = _asyncToGenerator(
init: function init(_ref) {
var _this = this;
var $ = _ref.$,
importLocale = _ref.importLocale;
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee2(_ref) {
var $, importLocale, strings, svgEditor, svgCanvas, mathjaxSrcSecure, uiStrings, math, locationX, locationY, mathjaxLoaded, saveMath, buttons;
regeneratorRuntime.mark(function _callee2() {
var strings, svgEditor, svgCanvas, mathjaxSrcSecure, uiStrings, math, locationX, locationY, mathjaxLoaded, saveMath, buttons;
return regeneratorRuntime.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
@@ -164,13 +168,12 @@ var svgEditorExtension_mathjax = (function () {
});
};
$ = _ref.$, importLocale = _ref.importLocale;
_context2.next = 4;
_context2.next = 3;
return importLocale();
case 4:
case 3:
strings = _context2.sent;
svgEditor = this;
svgEditor = _this;
svgCanvas = svgEditor.canvas; // Configuration of the MathJax extention.
// This will be added to the head tag before MathJax is loaded.
@@ -222,8 +225,8 @@ var svgEditorExtension_mathjax = (function () {
type: 'mode',
icon: svgEditor.curConfig.extIconsPath + 'mathjax.png',
events: {
click: function () {
var _click = _asyncToGenerator(
click: function click() {
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_context) {
@@ -307,14 +310,8 @@ var svgEditorExtension_mathjax = (function () {
}
}
}, _callee, null, [[7, 13]]);
}));
function click() {
return _click.apply(this, arguments);
}
return click;
}()
}))();
}
}
}];
return _context2.abrupt("return", {
@@ -353,20 +350,14 @@ var svgEditorExtension_mathjax = (function () {
}
});
case 12:
case 11:
case "end":
return _context2.stop();
}
}
}, _callee2, this);
}));
function init(_x) {
return _init.apply(this, arguments);
}
return init;
}()
}, _callee2);
}))();
}
};
return extMathjax;

View File

@@ -51,22 +51,24 @@ var svgEditorExtension_panning = (function () {
*/
var extPanning = {
name: 'panning',
init: function () {
var _init = _asyncToGenerator(
init: function init(_ref) {
var _this = this;
var importLocale = _ref.importLocale;
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(_ref) {
var importLocale, strings, svgEditor, svgCanvas, buttons;
regeneratorRuntime.mark(function _callee() {
var strings, svgEditor, svgCanvas, buttons;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
importLocale = _ref.importLocale;
_context.next = 3;
_context.next = 2;
return importLocale();
case 3:
case 2:
strings = _context.sent;
svgEditor = this;
svgEditor = _this;
svgCanvas = svgEditor.canvas;
buttons = [{
id: 'ext-panning',
@@ -107,20 +109,14 @@ var svgEditorExtension_panning = (function () {
}
});
case 8:
case 7:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));
function init(_x) {
return _init.apply(this, arguments);
}
return init;
}()
}, _callee);
}))();
}
};
return extPanning;

View File

@@ -88,10 +88,12 @@ var svgEditorExtension_placemark = (function () {
*/
var extPlacemark = {
name: 'placemark',
init: function () {
var _init = _asyncToGenerator(
init: function init(S) {
var _this = this;
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(S) {
regeneratorRuntime.mark(function _callee() {
var svgEditor, svgCanvas, addElem, $, importLocale, selElems, started, newPM, strings, markerTypes, showPanel, getLinked, updateText, updateFont, addMarker, setMarker, colorChanged, updateReferences, setArrowFromButton, getTitle, addMarkerButtons, buttons, contextTools;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
@@ -340,7 +342,7 @@ var svgEditorExtension_placemark = (function () {
$('#placemark_panel').toggle(on);
};
svgEditor = this;
svgEditor = _this;
svgCanvas = svgEditor.canvas;
addElem = svgCanvas.addSVGElementFromJson;
$ = S.$, importLocale = S.importLocale; // {svgcontent},
@@ -700,15 +702,9 @@ var svgEditorExtension_placemark = (function () {
return _context.stop();
}
}
}, _callee, this);
}));
function init(_x) {
return _init.apply(this, arguments);
}
return init;
}()
}, _callee);
}))();
}
};
return extPlacemark;

View File

@@ -46,10 +46,12 @@ var svgEditorExtension_polygon = (function () {
*/
var extPolygon = {
name: 'polygon',
init: function () {
var _init = _asyncToGenerator(
init: function init(S) {
var _this = this;
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(S) {
regeneratorRuntime.mark(function _callee() {
var svgEditor, svgCanvas, $, importLocale, editingitex, strings, selElems, started, newFO, showPanel, setAttr, cot, sec, buttons, contextTools;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
@@ -79,7 +81,7 @@ var svgEditorExtension_polygon = (function () {
$('#polygon_panel').toggle(on);
};
svgEditor = this;
svgEditor = _this;
svgCanvas = svgEditor.canvas;
$ = S.$, importLocale = S.importLocale, editingitex = false;
_context.next = 9;
@@ -299,15 +301,9 @@ var svgEditorExtension_polygon = (function () {
return _context.stop();
}
}
}, _callee, this);
}));
function init(_x) {
return _init.apply(this, arguments);
}
return init;
}()
}, _callee);
}))();
}
};
return extPolygon;

View File

@@ -2,6 +2,8 @@ var svgEditorExtension_server_moinsave = (function () {
'use strict';
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
@@ -4880,22 +4882,26 @@ var svgEditorExtension_server_moinsave = (function () {
var extServer_moinsave = {
name: 'server_moinsave',
init: function () {
var _init = _asyncToGenerator(
init: function init(_ref) {
var _this = this;
var $ = _ref.$,
encode64 = _ref.encode64,
importLocale = _ref.importLocale;
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee2(_ref) {
var $, encode64, importLocale, strings, svgEditor, svgCanvas, saveSvgAction;
regeneratorRuntime.mark(function _callee2() {
var strings, svgEditor, svgCanvas, saveSvgAction;
return regeneratorRuntime.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
$ = _ref.$, encode64 = _ref.encode64, importLocale = _ref.importLocale;
_context2.next = 3;
_context2.next = 2;
return importLocale();
case 3:
case 2:
strings = _context2.sent;
svgEditor = this;
svgEditor = _this;
svgCanvas = svgEditor.canvas;
saveSvgAction = '/+modify'; // Create upload target (hidden iframe)
// Hiding by size instead of display to avoid FF console errors
@@ -4905,10 +4911,10 @@ var svgEditorExtension_server_moinsave = (function () {
$("<iframe name=\"output_frame\" title=\"".concat(strings.hiddenframe, "\"\n style=\"width: 0; height: 0;\" src=\"data:text/html;base64,PGh0bWw+PC9odG1sPg==\"/>")).appendTo('body');
svgEditor.setCustomHandlers({
save: function () {
var _save = _asyncToGenerator(
save: function save(win, data) {
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(win, data) {
regeneratorRuntime.mark(function _callee() {
var svg, _ref2, pathname, name, svgData, c, datauri, pngData;
return regeneratorRuntime.wrap(function _callee$(_context) {
@@ -4953,30 +4959,18 @@ var svgEditorExtension_server_moinsave = (function () {
}
}
}, _callee);
}));
function save(_x2, _x3) {
return _save.apply(this, arguments);
}
return save;
}()
}))();
}
});
case 9:
case 8:
case "end":
return _context2.stop();
}
}
}, _callee2, this);
}));
function init(_x) {
return _init.apply(this, arguments);
}
return init;
}()
}, _callee2);
}))();
}
};
return extServer_moinsave;

View File

@@ -2,6 +2,8 @@ var svgEditorExtension_server_opensave = (function () {
'use strict';
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
@@ -4880,11 +4882,17 @@ var svgEditorExtension_server_opensave = (function () {
var extServer_opensave = {
name: 'server_opensave',
init: function () {
var _init = _asyncToGenerator(
init: function init(_ref) {
var _this = this;
var $ = _ref.$,
decode64 = _ref.decode64,
encode64 = _ref.encode64,
importLocale = _ref.importLocale;
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee5(_ref) {
var $, decode64, encode64, importLocale, strings, svgEditor, _svgEditor$curConfig, extPath, avoidClientSide, avoidClientSideDownload, avoidClientSideOpen, svgCanvas, getFileNameFromTitle, xhtmlEscape, clientDownloadSupport, saveSvgAction, saveImgAction, cancelled, openSvgAction, importSvgAction, importImgAction, openSvgForm, importSvgForm, importImgForm, rebuildInput;
regeneratorRuntime.mark(function _callee5() {
var strings, svgEditor, _svgEditor$curConfig, extPath, avoidClientSide, avoidClientSideDownload, avoidClientSideOpen, svgCanvas, getFileNameFromTitle, xhtmlEscape, clientDownloadSupport, saveSvgAction, saveImgAction, cancelled, openSvgAction, importSvgAction, importImgAction, openSvgForm, importSvgForm, importImgForm, rebuildInput;
return regeneratorRuntime.wrap(function _callee5$(_context5) {
while (1) {
@@ -5020,13 +5028,12 @@ var svgEditorExtension_server_opensave = (function () {
return title.trim().replace(/[/\\:*?"<>|]/g, '_');
};
$ = _ref.$, decode64 = _ref.decode64, encode64 = _ref.encode64, importLocale = _ref.importLocale;
_context5.next = 7;
_context5.next = 6;
return importLocale();
case 7:
case 6:
strings = _context5.sent;
svgEditor = this;
svgEditor = _this;
_svgEditor$curConfig = svgEditor.curConfig, extPath = _svgEditor$curConfig.extPath, avoidClientSide = _svgEditor$curConfig.avoidClientSide, avoidClientSideDownload = _svgEditor$curConfig.avoidClientSideDownload, avoidClientSideOpen = _svgEditor$curConfig.avoidClientSideOpen, svgCanvas = svgEditor.canvas;
/**
*
@@ -5070,10 +5077,10 @@ var svgEditorExtension_server_opensave = (function () {
}).append("\n <input type=\"hidden\" name=\"output_img\" value=\"".concat(datauri, "\">\n <input type=\"hidden\" name=\"mime\" value=\"application/pdf\">\n <input type=\"hidden\" name=\"filename\" value=\"").concat(xhtmlEscape(filename), "\">\n ")).appendTo('body').submit().remove();
},
// Todo: Integrate this extension with a new built-in exportWindowType, "download"
exportImage: function () {
var _exportImage = _asyncToGenerator(
exportImage: function exportImage(win, data) {
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(win, data) {
regeneratorRuntime.mark(function _callee() {
var issues, mimeType, quality, c, datauri, pre, note, filename, suffix;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
@@ -5137,24 +5144,18 @@ var svgEditorExtension_server_opensave = (function () {
}
}
}, _callee);
}));
function exportImage(_x2, _x3) {
return _exportImage.apply(this, arguments);
}
return exportImage;
}()
}))();
}
}); // Do nothing if client support is found
if (!(window.FileReader && !avoidClientSideOpen)) {
_context5.next = 16;
_context5.next = 15;
break;
}
return _context5.abrupt("return");
case 16:
case 15:
// Change these to appropriate script file
openSvgAction = extPath + 'fileopen.php?type=load_svg';
importSvgAction = extPath + 'fileopen.php?type=import_svg';
@@ -5221,20 +5222,14 @@ var svgEditorExtension_server_opensave = (function () {
$('#tool_import').show().prepend(importSvgForm);
$('#tool_image').prepend(importImgForm);
case 30:
case 29:
case "end":
return _context5.stop();
}
}
}, _callee5, this);
}));
function init(_x) {
return _init.apply(this, arguments);
}
return init;
}()
}, _callee5);
}))();
}
};
return extServer_opensave;

View File

@@ -89,11 +89,15 @@ var svgEditorExtension_shapes = (function () {
*/
var extShapes = {
name: 'shapes',
init: function () {
var _init = _asyncToGenerator(
init: function init(_ref) {
var _this = this;
var $ = _ref.$,
importLocale = _ref.importLocale;
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(_ref) {
var $, importLocale, strings, svgEditor, canv, svgroot, lastBBox, categories, library, modeId, startClientPos, currentD, curShapeId, curShape, startX, startY, curLib, loadIcons, makeButtons, loadLibrary, buttons;
regeneratorRuntime.mark(function _callee() {
var strings, svgEditor, canv, svgroot, lastBBox, categories, library, modeId, startClientPos, currentD, curShapeId, curShape, startX, startY, curLib, loadIcons, makeButtons, loadLibrary, buttons;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
@@ -157,13 +161,12 @@ var svgEditorExtension_shapes = (function () {
$('#shape_buttons').empty().append(curLib.buttons);
};
$ = _ref.$, importLocale = _ref.importLocale;
_context.next = 6;
_context.next = 5;
return importLocale();
case 6:
case 5:
strings = _context.sent;
svgEditor = this;
svgEditor = _this;
canv = svgEditor.canvas;
svgroot = canv.getRootElem();
lastBBox = {}; // This populates the category list
@@ -408,20 +411,14 @@ var svgEditorExtension_shapes = (function () {
}
});
case 18:
case 17:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));
function init(_x) {
return _init.apply(this, arguments);
}
return init;
}()
}, _callee);
}))();
}
};
return extShapes;

View File

@@ -46,10 +46,12 @@ var svgEditorExtension_star = (function () {
*/
var extStar = {
name: 'star',
init: function () {
var _init = _asyncToGenerator(
init: function init(S) {
var _this = this;
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(S) {
regeneratorRuntime.mark(function _callee() {
var svgEditor, svgCanvas, $, importLocale, selElems, started, newFO, strings, showPanel, setAttr, buttons, contextTools;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
@@ -71,7 +73,7 @@ var svgEditorExtension_star = (function () {
$('#star_panel').toggle(on);
};
svgEditor = this;
svgEditor = _this;
svgCanvas = svgEditor.canvas;
$ = S.$, importLocale = S.importLocale; // {svgcontent},
@@ -284,15 +286,9 @@ var svgEditorExtension_star = (function () {
return _context.stop();
}
}
}, _callee, this);
}));
function init(_x) {
return _init.apply(this, arguments);
}
return init;
}()
}, _callee);
}))();
}
};
return extStar;

View File

@@ -252,34 +252,34 @@ var svgEditorExtension_storage = (function () {
var loaded = false;
return {
name: 'storage',
langReady: function () {
var _langReady = _asyncToGenerator(
langReady: function langReady(_ref4) {
var importLocale = _ref4.importLocale;
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(_ref4) {
var importLocale, storagePrompt, confirmSetStorage, message, storagePrefsAndContent, storagePrefsOnly, storagePrefs, storageNoPrefsOrContent, storageNoPrefs, rememberLabel, rememberTooltip, options, oldContainerWidth, oldContainerMarginLeft, oldContentHeight, oldContainerHeight, _ref5, pref, checked;
regeneratorRuntime.mark(function _callee() {
var storagePrompt, confirmSetStorage, message, storagePrefsAndContent, storagePrefsOnly, storagePrefs, storageNoPrefsOrContent, storageNoPrefs, rememberLabel, rememberTooltip, options, oldContainerWidth, oldContainerMarginLeft, oldContentHeight, oldContainerHeight, _ref5, pref, checked;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
importLocale = _ref4.importLocale;
storagePrompt = new URL(top.location).searchParams.get('storagePrompt');
_context.next = 4;
_context.next = 3;
return importLocale();
case 4:
case 3:
confirmSetStorage = _context.sent;
message = confirmSetStorage.message, storagePrefsAndContent = confirmSetStorage.storagePrefsAndContent, storagePrefsOnly = confirmSetStorage.storagePrefsOnly, storagePrefs = confirmSetStorage.storagePrefs, storageNoPrefsOrContent = confirmSetStorage.storageNoPrefsOrContent, storageNoPrefs = confirmSetStorage.storageNoPrefs, rememberLabel = confirmSetStorage.rememberLabel, rememberTooltip = confirmSetStorage.rememberTooltip; // No need to run this one-time dialog again just because the user
// changes the language
if (!loaded) {
_context.next = 8;
_context.next = 7;
break;
}
return _context.abrupt("return");
case 8:
case 7:
loaded = true; // Note that the following can load even if "noStorageOnLoad" is
// set to false; to avoid any chance of storage, avoid this
// extension! (and to avoid using any prior storage, set the
@@ -295,7 +295,7 @@ var svgEditorExtension_storage = (function () {
storagePrompt !== 'false' && // ...and this user hasn't previously indicated a desire for storage
!document.cookie.match(/(?:^|;\s*)svgeditstore=(?:prefsAndContent|prefsOnly)/) // ...then show the storage prompt.
))) {
_context.next = 44;
_context.next = 43;
break;
}
@@ -331,20 +331,20 @@ var svgEditorExtension_storage = (function () {
// From svg-editor.js
svgEditor.storagePromptState = 'waiting';
_context.next = 20;
_context.next = 19;
return $.select(message, options, null, null, {
label: rememberLabel,
checked: true,
tooltip: rememberTooltip
});
case 20:
case 19:
_ref5 = _context.sent;
pref = _ref5.response;
checked = _ref5.checked;
if (!(pref && pref !== 'noPrefsOrContent')) {
_context.next = 30;
_context.next = 29;
break;
}
@@ -361,18 +361,18 @@ var svgEditorExtension_storage = (function () {
// them instead to a URL which does not always prompt
if (!(storagePrompt === 'true' && checked)) {
_context.next = 28;
_context.next = 27;
break;
}
replaceStoragePrompt();
return _context.abrupt("return");
case 28:
_context.next = 35;
case 27:
_context.next = 34;
break;
case 30:
case 29:
// The user does not wish storage (or cancelled, which we treat equivalently)
removeStoragePrefCookie();
@@ -382,7 +382,7 @@ var svgEditorExtension_storage = (function () {
}
if (!(pref && checked)) {
_context.next = 35;
_context.next = 34;
break;
}
@@ -390,7 +390,7 @@ var svgEditorExtension_storage = (function () {
replaceStoragePrompt('false');
return _context.abrupt("return");
case 35:
case 34:
// Reset width/height of dialog (e.g., for use by Export)
$('#dialog_container')[0].style.width = oldContainerWidth;
$('#dialog_container')[0].style.marginLeft = oldContainerMarginLeft;
@@ -407,28 +407,22 @@ var svgEditorExtension_storage = (function () {
setupBeforeUnloadListener();
svgEditor.storagePromptState = 'closed';
updateCanvas(true);
_context.next = 45;
_context.next = 44;
break;
case 44:
case 43:
if (!noStorageOnLoad || forceStorage) {
setupBeforeUnloadListener();
}
case 45:
case 44:
case "end":
return _context.stop();
}
}
}, _callee);
}));
function langReady(_x) {
return _langReady.apply(this, arguments);
}
return langReady;
}()
}))();
}
};
}
};

View File

@@ -46,24 +46,28 @@ var svgEditorExtension_webappfind = (function () {
*/
var extWebappfind = {
name: 'webappfind',
init: function () {
var _init = _asyncToGenerator(
init: function init(_ref) {
var _this = this;
var importLocale = _ref.importLocale,
$ = _ref.$;
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(_ref) {
var importLocale, $, strings, svgEditor, saveMessage, readMessage, excludedMessages, pathID, buttons;
regeneratorRuntime.mark(function _callee() {
var strings, svgEditor, saveMessage, readMessage, excludedMessages, pathID, buttons;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
importLocale = _ref.importLocale, $ = _ref.$;
_context.next = 3;
_context.next = 2;
return importLocale();
case 3:
case 2:
strings = _context.sent;
svgEditor = this;
svgEditor = _this;
saveMessage = 'save', readMessage = 'read', excludedMessages = [readMessage, saveMessage];
this.canvas.bind('message',
_this.canvas.bind('message',
/**
* @param {external:Window} win
* @param {module:svgcanvas.SvgCanvas#event:message} data
@@ -125,6 +129,7 @@ var svgEditorExtension_webappfind = (function () {
);
*/
buttons = [{
id: 'webappfind_save',
//
@@ -159,20 +164,14 @@ var svgEditorExtension_webappfind = (function () {
})
});
case 9:
case 8:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));
function init(_x) {
return _init.apply(this, arguments);
}
return init;
}()
}, _callee);
}))();
}
};
return extWebappfind;

View File

@@ -2,6 +2,8 @@ var svgEditorExtension_xdomain_messaging = (function () {
'use strict';
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;

View File

@@ -2,6 +2,8 @@
'use strict';
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
@@ -609,6 +611,7 @@
// to avoid setting through nullish value
var NULLABLES = ['dir', // HTMLElement
'integrity', // script, link
'lang', // HTMLElement
'max', 'min', 'title' // HTMLElement
];
@@ -959,6 +962,52 @@
* should be returned
*/
/**
* @typedef {PlainObject} JamilihOptions
* @property {"root"|"attributeValue"|"fragment"|"children"|"fragmentChildren"} $state
*/
/**
* @param {Element} elem
* @param {string} att
* @param {string} attVal
* @param {JamilihOptions} opts
* @returns {void}
*/
function checkPluginValue(elem, att, attVal, opts) {
opts.$state = 'attributeValue';
if (attVal && _typeof$1(attVal) === 'object') {
var matchingPlugin = getMatchingPlugin(opts, Object.keys(attVal)[0]);
if (matchingPlugin) {
return matchingPlugin.set({
opts: opts,
element: elem,
attribute: {
name: att,
value: attVal
}
});
}
}
return attVal;
}
/**
* @param {JamilihOptions} opts
* @param {string} item
* @returns {JamilihPlugin}
*/
function getMatchingPlugin(opts, item) {
return opts.$plugins && opts.$plugins.find(function (p) {
return p.name === item;
});
}
/**
* Creates an XHTML or HTML element (XHTML is preferred, but only in browsers
* that support); any element after element can be omitted, and any subsequent
@@ -982,7 +1031,7 @@
*/
function _checkAtts(atts) {
var _loop = function _loop() {
for (var _i2 = 0, _Object$entries2 = Object.entries(atts); _i2 < _Object$entries2.length; _i2++) {
var _Object$entries2$_i = _slicedToArray$1(_Object$entries2[_i2], 2),
att = _Object$entries2$_i[0],
attVal = _Object$entries2$_i[1];
@@ -990,14 +1039,17 @@
att = att in ATTR_MAP ? ATTR_MAP[att] : att;
if (NULLABLES.includes(att)) {
attVal = checkPluginValue(elem, att, attVal, opts);
if (!_isNullish(attVal)) {
elem[att] = attVal;
}
return "continue";
continue;
} else if (ATTR_DOM.includes(att)) {
attVal = checkPluginValue(elem, att, attVal, opts);
elem[att] = attVal;
return "continue";
continue;
}
switch (att) {
@@ -1021,10 +1073,12 @@
case '$shadow':
{
var open = attVal.open,
closed = attVal.closed;
var content = attVal.content,
template = attVal.template;
var _attVal = attVal,
open = _attVal.open,
closed = _attVal.closed;
var _attVal2 = attVal,
content = _attVal2.content,
template = _attVal2.template;
var shadowRoot = elem.attachShadow({
mode: closed || open === false ? 'closed' : 'open'
});
@@ -1085,140 +1139,159 @@
case '$define':
{
var localName = elem.localName.toLowerCase(); // Note: customized built-ins sadly not working yet
var _ret = function () {
var localName = elem.localName.toLowerCase(); // Note: customized built-ins sadly not working yet
var customizedBuiltIn = !localName.includes('-'); // We check attribute in case this is a preexisting DOM element
// const {is} = atts;
var customizedBuiltIn = !localName.includes('-'); // We check attribute in case this is a preexisting DOM element
// const {is} = atts;
var is;
var is = void 0;
if (customizedBuiltIn) {
is = elem.getAttribute('is');
if (customizedBuiltIn) {
is = elem.getAttribute('is');
if (!is) {
if (!{}.hasOwnProperty.call(atts, 'is')) {
throw new TypeError('Expected `is` with `$define` on built-in');
}
if (!is) {
if (!{}.hasOwnProperty.call(atts, 'is')) {
throw new TypeError('Expected `is` with `$define` on built-in');
}
opts.$state = 'attributeValue';
elem.setAttribute('is', atts.is);
is = atts.is;
}
}
var def = customizedBuiltIn ? is : localName;
if (customElements.get(def)) {
break;
}
var getConstructor = function getConstructor(cnstrct) {
var baseClass = options && options["extends"] ? doc.createElement(options["extends"]).constructor : customizedBuiltIn ? doc.createElement(localName).constructor : HTMLElement;
return cnstrct ?
/*#__PURE__*/
function (_baseClass) {
_inherits$1(_class, _baseClass);
function _class() {
var _this;
_classCallCheck$1(this, _class);
_this = _possibleConstructorReturn$1(this, _getPrototypeOf$1(_class).call(this));
cnstrct.call(_assertThisInitialized$1(_this));
return _this;
}
return _class;
}(baseClass) :
/*#__PURE__*/
function (_baseClass2) {
_inherits$1(_class2, _baseClass2);
function _class2() {
_classCallCheck$1(this, _class2);
return _possibleConstructorReturn$1(this, _getPrototypeOf$1(_class2).apply(this, arguments));
}
return _class2;
}(baseClass);
};
var cnstrctr, options, mixin;
if (Array.isArray(attVal)) {
if (attVal.length <= 2) {
var _attVal = _slicedToArray$1(attVal, 2);
cnstrctr = _attVal[0];
options = _attVal[1];
if (typeof options === 'string') {
// Todo: Allow creating a definition without using it;
// that may be the only reason to have a string here which
// differs from the `localName` anyways
options = {
"extends": options
};
} else if (options && !{}.hasOwnProperty.call(options, 'extends')) {
mixin = options;
}
if (_typeof$1(cnstrctr) === 'object') {
mixin = cnstrctr;
cnstrctr = getConstructor();
}
} else {
var _attVal2 = _slicedToArray$1(attVal, 3);
cnstrctr = _attVal2[0];
mixin = _attVal2[1];
options = _attVal2[2];
if (typeof options === 'string') {
options = {
"extends": options
};
atts.is = checkPluginValue(elem, 'is', atts.is, opts);
elem.setAttribute('is', atts.is);
is = atts.is;
}
}
} else if (typeof attVal === 'function') {
cnstrctr = attVal;
} else {
mixin = attVal;
cnstrctr = getConstructor();
}
if (!cnstrctr.toString().startsWith('class')) {
cnstrctr = getConstructor(cnstrctr);
}
var def = customizedBuiltIn ? is : localName;
if (!options && customizedBuiltIn) {
options = {
"extends": localName
if (customElements.get(def)) {
return "break";
}
var getConstructor = function getConstructor(cnstrct) {
var baseClass = options && options["extends"] ? doc.createElement(options["extends"]).constructor : customizedBuiltIn ? doc.createElement(localName).constructor : HTMLElement;
/**
* Class wrapping base class.
*/
return cnstrct ?
/*#__PURE__*/
function (_baseClass) {
_inherits$1(_class, _baseClass);
/**
* Calls user constructor.
*/
function _class() {
var _this;
_classCallCheck$1(this, _class);
_this = _possibleConstructorReturn$1(this, _getPrototypeOf$1(_class).call(this));
cnstrct.call(_assertThisInitialized$1(_this));
return _this;
}
return _class;
}(baseClass) :
/*#__PURE__*/
function (_baseClass2) {
_inherits$1(_class2, _baseClass2);
function _class2() {
_classCallCheck$1(this, _class2);
return _possibleConstructorReturn$1(this, _getPrototypeOf$1(_class2).apply(this, arguments));
}
return _class2;
}(baseClass);
};
}
if (mixin) {
Object.entries(mixin).forEach(function (_ref) {
var _ref2 = _slicedToArray$1(_ref, 2),
methodName = _ref2[0],
method = _ref2[1];
var cnstrctr = void 0,
options = void 0,
mixin = void 0;
cnstrctr.prototype[methodName] = method;
});
} // console.log('def', def, '::', typeof options === 'object' ? options : undefined);
if (Array.isArray(attVal)) {
if (attVal.length <= 2) {
var _attVal3 = attVal;
var _attVal4 = _slicedToArray$1(_attVal3, 2);
cnstrctr = _attVal4[0];
options = _attVal4[1];
if (typeof options === 'string') {
// Todo: Allow creating a definition without using it;
// that may be the only reason to have a string here which
// differs from the `localName` anyways
options = {
"extends": options
};
} else if (options && !{}.hasOwnProperty.call(options, 'extends')) {
mixin = options;
}
if (_typeof$1(cnstrctr) === 'object') {
mixin = cnstrctr;
cnstrctr = getConstructor();
}
} else {
var _attVal5 = attVal;
var _attVal6 = _slicedToArray$1(_attVal5, 3);
cnstrctr = _attVal6[0];
mixin = _attVal6[1];
options = _attVal6[2];
if (typeof options === 'string') {
options = {
"extends": options
};
}
}
} else if (typeof attVal === 'function') {
cnstrctr = attVal;
} else {
mixin = attVal;
cnstrctr = getConstructor();
}
if (!cnstrctr.toString().startsWith('class')) {
cnstrctr = getConstructor(cnstrctr);
}
if (!options && customizedBuiltIn) {
options = {
"extends": localName
};
}
if (mixin) {
Object.entries(mixin).forEach(function (_ref) {
var _ref2 = _slicedToArray$1(_ref, 2),
methodName = _ref2[0],
method = _ref2[1];
cnstrctr.prototype[methodName] = method;
});
} // console.log('def', def, '::', typeof options === 'object' ? options : undefined);
customElements.define(def, cnstrctr, _typeof$1(options) === 'object' ? options : undefined);
break;
customElements.define(def, cnstrctr, _typeof$1(options) === 'object' ? options : undefined);
return "break";
}();
if (_ret === "break") break;
}
case '$symbol':
{
var _attVal3 = _slicedToArray$1(attVal, 2),
symbol = _attVal3[0],
func = _attVal3[1];
var _attVal7 = attVal,
_attVal8 = _slicedToArray$1(_attVal7, 2),
symbol = _attVal8[0],
func = _attVal8[1];
if (typeof func === 'function') {
var funcBound = func.bind(elem);
@@ -1354,6 +1427,8 @@
case 'className':
case 'class':
attVal = checkPluginValue(elem, att, attVal, opts);
if (!_isNullish(attVal)) {
elem.className = attVal;
}
@@ -1362,34 +1437,38 @@
case 'dataset':
{
// Map can be keyed with hyphenated or camel-cased properties
var recurse = function recurse(atVal, startProp) {
var prop = '';
var pastInitialProp = startProp !== '';
Object.keys(atVal).forEach(function (key) {
var value = atVal[key];
var _ret2 = function () {
// Map can be keyed with hyphenated or camel-cased properties
var recurse = function recurse(atVal, startProp) {
var prop = '';
var pastInitialProp = startProp !== '';
Object.keys(atVal).forEach(function (key) {
var value = atVal[key];
if (pastInitialProp) {
prop = startProp + key.replace(hyphenForCamelCase, _upperCase).replace(/^([a-z])/, _upperCase);
} else {
prop = startProp + key.replace(hyphenForCamelCase, _upperCase);
}
if (value === null || _typeof$1(value) !== 'object') {
if (!_isNullish(value)) {
elem.dataset[prop] = value;
if (pastInitialProp) {
prop = startProp + key.replace(hyphenForCamelCase, _upperCase).replace(/^([a-z])/, _upperCase);
} else {
prop = startProp + key.replace(hyphenForCamelCase, _upperCase);
}
prop = startProp;
return;
}
if (value === null || _typeof$1(value) !== 'object') {
if (!_isNullish(value)) {
elem.dataset[prop] = value;
}
recurse(value, prop);
});
};
prop = startProp;
return;
}
recurse(attVal, '');
break; // Todo: Disable this by default unless configuration explicitly allows (for security)
recurse(value, prop);
});
};
recurse(attVal, '');
return "break"; // Todo: Disable this by default unless configuration explicitly allows (for security)
}();
if (_ret2 === "break") break;
}
// #if IS_REMOVE
// Don't remove this `if` block (for sake of no-innerHTML build)
@@ -1406,6 +1485,8 @@
case 'htmlFor':
case 'for':
if (elStr === 'label') {
attVal = checkPluginValue(elem, att, attVal, opts);
if (!_isNullish(attVal)) {
elem.htmlFor = attVal;
}
@@ -1413,7 +1494,7 @@
break;
}
opts.$state = 'attributeValue';
attVal = checkPluginValue(elem, att, attVal, opts);
elem.setAttribute(att, attVal);
break;
@@ -1424,12 +1505,15 @@
default:
{
if (att.startsWith('on')) {
attVal = checkPluginValue(elem, att, attVal, opts);
elem[att] = attVal; // _addEvent(elem, att.slice(2), attVal, false); // This worked, but perhaps the user wishes only one event
break;
}
if (att === 'style') {
attVal = checkPluginValue(elem, att, attVal, opts);
if (_isNullish(attVal)) {
break;
}
@@ -1455,7 +1539,6 @@
} // setAttribute unfortunately erases any existing styles
opts.$state = 'attributeValue';
elem.setAttribute(att, attVal);
/*
// The following reorders which is troublesome for serialization, e.g., as used in our testing
@@ -1469,9 +1552,7 @@
break;
}
var matchingPlugin = opts.$plugins && opts.$plugins.find(function (p) {
return p.name === att;
});
var matchingPlugin = getMatchingPlugin(opts, att);
if (matchingPlugin) {
matchingPlugin.set({
@@ -1485,17 +1566,11 @@
break;
}
opts.$state = 'attributeValue';
attVal = checkPluginValue(elem, att, attVal, opts);
elem.setAttribute(att, attVal);
break;
}
}
};
for (var _i2 = 0, _Object$entries2 = Object.entries(atts); _i2 < _Object$entries2.length; _i2++) {
var _ret = _loop();
if (_ret === "continue") continue;
}
}
@@ -1673,7 +1748,8 @@
break;
case '':
nodes[nodes.length] = elem = doc.createDocumentFragment();
nodes[nodes.length] = elem = doc.createDocumentFragment(); // Todo: Report to plugins
opts.$state = 'fragment';
break;
@@ -1701,7 +1777,8 @@
elem = doc.createElementNS(NS_HTML, elStr);
} else {
elem = doc.createElement(elStr);
}
} // Todo: Report to plugins
opts.$state = 'element';
nodes[nodes.length] = elem; // Add to parent
@@ -1733,7 +1810,8 @@
elem = nodes[nodes.length - 1] = new win.DOMParser().parseFromString(new win.XMLSerializer().serializeToString(elem) // Mozilla adds XHTML namespace
.replace(' xmlns="' + NS_HTML + '"', replacer), 'application/xml').documentElement;
.replace(' xmlns="' + NS_HTML + '"', replacer), 'application/xml').documentElement; // Todo: Report to plugins
opts.$state = 'element'; // }catch(e) {alert(elem.outerHTML);throw e;}
}
@@ -1751,7 +1829,8 @@
*/
if (i === 0) {
// Allow wrapping of element, fragment, or document
elem = arg;
elem = arg; // Todo: Report to plugins
opts.$state = 'element';
}
@@ -1810,7 +1889,9 @@
_appendNode(elem, jml(opts, childContent['#']));
} else {
// Single DOM element children
_appendNode(elem, childContent);
var newChildContent = checkPluginValue(elem, null, childContent, opts);
_appendNode(elem, newChildContent);
}
break;
@@ -1867,11 +1948,23 @@
function invalidStateError(msg) {
// These are probably only necessary if working with text/html
// eslint-disable-next-line no-shadow, unicorn/custom-error-definition
/* eslint-disable no-shadow, unicorn/custom-error-definition */
/**
* Polyfill for `DOMException`.
*/
var DOMException =
/*#__PURE__*/
function (_Error) {
_inherits$1(DOMException, _Error);
/* eslint-enable no-shadow, unicorn/custom-error-definition */
/**
* @param {string} message
* @param {string} name
*/
function DOMException(message, name) {
var _this2;
@@ -2267,6 +2360,10 @@
// Alias for jml.toXML for parity with jml.toJMLString
return jml.toXML.apply(jml, arguments);
};
/**
* Element-aware wrapper for `Map`.
*/
var JamilihMap =
/*#__PURE__*/
@@ -2281,16 +2378,34 @@
_createClass(JamilihMap, [{
key: "get",
/**
* @param {string|Element} elem
* @returns {any}
*/
value: function get(elem) {
elem = typeof elem === 'string' ? $(elem) : elem;
return _get(_getPrototypeOf$1(JamilihMap.prototype), "get", this).call(this, elem);
}
/**
* @param {string|Element} elem
* @param {any} value
* @returns {any}
*/
}, {
key: "set",
value: function set(elem, value) {
elem = typeof elem === 'string' ? $(elem) : elem;
return _get(_getPrototypeOf$1(JamilihMap.prototype), "set", this).call(this, elem, value);
}
/**
* @param {string|Element} elem
* @param {string} methodName
* @param {...any} args
* @returns {any}
*/
}, {
key: "invoke",
value: function invoke(elem, methodName) {
@@ -2308,6 +2423,10 @@
return JamilihMap;
}(_wrapNativeSuper$1(Map));
/**
* Element-aware wrapper for `WeakMap`.
*/
var JamilihWeakMap =
/*#__PURE__*/
@@ -2322,16 +2441,34 @@
_createClass(JamilihWeakMap, [{
key: "get",
/**
* @param {string|Element} elem
* @returns {any}
*/
value: function get(elem) {
elem = typeof elem === 'string' ? $(elem) : elem;
return _get(_getPrototypeOf$1(JamilihWeakMap.prototype), "get", this).call(this, elem);
}
/**
* @param {string|Element} elem
* @param {any} value
* @returns {any}
*/
}, {
key: "set",
value: function set(elem, value) {
elem = typeof elem === 'string' ? $(elem) : elem;
return _get(_getPrototypeOf$1(JamilihWeakMap.prototype), "set", this).call(this, elem, value);
}
/**
* @param {string|Element} elem
* @param {string} methodName
* @param {...any} args
* @returns {any}
*/
}, {
key: "invoke",
value: function invoke(elem, methodName) {
@@ -3298,17 +3435,19 @@
value: svgURL
},
$on: {
click: function () {
var _click = _asyncToGenerator(
click: function click(e) {
var _this = this;
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee2(e) {
regeneratorRuntime.mark(function _callee2() {
var svgurl, post, result, svg;
return regeneratorRuntime.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
e.preventDefault();
svgurl = this.dataset.value; // console.log('this', id, svgurl);
svgurl = _this.dataset.value; // console.log('this', id, svgurl);
post = function post(message) {
// Todo: Make origin customizable as set by opening window
@@ -3344,15 +3483,9 @@
return _context2.stop();
}
}
}, _callee2, this);
}));
function click(_x2) {
return _click.apply(this, arguments);
}
return click;
}()
}, _callee2);
}))();
}
}
}, [// If we wanted interactive versions despite security risk:
// ['object', {data: svgURL, type: 'image/svg+xml'}]
@@ -3429,8 +3562,8 @@
jml('div', [['style', [".control {\n padding-top: 10px;\n }"]], ['form', {
id: 'openclipart',
$custom: {
$submit: function () {
var _$submit = _asyncToGenerator(
$submit: function $submit() {
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee() {
var url;
@@ -3455,14 +3588,8 @@
}
}
}, _callee);
}));
function $submit() {
return _$submit.apply(this, arguments);
}
return $submit;
}()
}))();
}
},
$on: {
submit: function submit(e) {

54
dist/index-es.js vendored
View File

@@ -1,4 +1,6 @@
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
@@ -9493,13 +9495,13 @@ function importSetGlobal(_x, _x2) {
function _importSetGlobal() {
_importSetGlobal = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(url, _ref) {
regeneratorRuntime.mark(function _callee(url, _ref2) {
var glob, returnDefault, modularVersion;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
glob = _ref.global, returnDefault = _ref.returnDefault;
glob = _ref2.global, returnDefault = _ref2.returnDefault;
// Todo: Replace calls to this function with `import()` when supported
modularVersion = !('svgEditor' in window) || !window.svgEditor || window.svgEditor.modules !== false;
@@ -9589,9 +9591,9 @@ function importScript(url) {
function importModule(url) {
var atts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
_ref2$returnDefault = _ref2.returnDefault,
returnDefault = _ref2$returnDefault === void 0 ? false : _ref2$returnDefault;
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
_ref$returnDefault = _ref.returnDefault,
returnDefault = _ref$returnDefault === void 0 ? false : _ref$returnDefault;
if (Array.isArray(url)) {
return Promise.all(url.map(function (u) {
@@ -14862,15 +14864,15 @@ function SvgCanvas(container, config) {
this.addExtension =
/*#__PURE__*/
function () {
var _ref4 = _asyncToGenerator(
var _ref3 = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(name, extInitFunc, _ref3) {
regeneratorRuntime.mark(function _callee(name, extInitFunc, _ref4) {
var jq, importLocale, argObj, extObj;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
jq = _ref3.$, importLocale = _ref3.importLocale;
jq = _ref4.$, importLocale = _ref4.importLocale;
if (!(typeof extInitFunc !== 'function')) {
_context.next = 3;
@@ -14933,7 +14935,7 @@ function SvgCanvas(container, config) {
}));
return function (_x, _x2, _x3) {
return _ref4.apply(this, arguments);
return _ref3.apply(this, arguments);
};
}();
/**
@@ -30186,10 +30188,10 @@ editor.init = function () {
'.stroke_tool div div .svg_icon': 20,
'#tools_bottom label .svg_icon': 18
},
callback: function () {
var _callback = _asyncToGenerator(
callback: function callback(icons) {
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee4(icons) {
regeneratorRuntime.mark(function _callee4() {
var tleft, minHeight, size, getStylesheetPriority, stylesheets, idx, _stylesheets;
return regeneratorRuntime.wrap(function _callee4$(_context4) {
@@ -30296,14 +30298,8 @@ editor.init = function () {
}
}
}, _callee4);
}));
function callback(_x3) {
return _callback.apply(this, arguments);
}
return callback;
}()
}))();
}
});
}
/**
@@ -30385,7 +30381,7 @@ editor.init = function () {
var rIntervals = [];
for (var i = 0.1; i < 1E5; i *= 10) {
for (var i = 0.1; i < 1e5; i *= 10) {
rIntervals.push(i);
rIntervals.push(2 * i);
rIntervals.push(5 * i);
@@ -32519,7 +32515,7 @@ editor.init = function () {
}, _callee5);
}));
return function extAdded(_x4, _x5) {
return function extAdded(_x3, _x4) {
return _ref16.apply(this, arguments);
};
}();
@@ -36158,15 +36154,15 @@ editor.init = function () {
reader.onloadend =
/*#__PURE__*/
function () {
var _ref33 = _asyncToGenerator(
var _ref32 = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee15(_ref32) {
regeneratorRuntime.mark(function _callee15(_ref33) {
var target;
return regeneratorRuntime.wrap(function _callee15$(_context15) {
while (1) {
switch (_context15.prev = _context15.next) {
case 0:
target = _ref32.target;
target = _ref33.target;
_context15.next = 3;
return loadSvgString(target.result);
@@ -36181,8 +36177,8 @@ editor.init = function () {
}, _callee15);
}));
return function (_x7) {
return _ref33.apply(this, arguments);
return function (_x6) {
return _ref32.apply(this, arguments);
};
}();
@@ -36197,7 +36193,7 @@ editor.init = function () {
}, _callee16, this);
}));
return function (_x6) {
return function (_x5) {
return _ref31.apply(this, arguments);
};
}());
@@ -36336,7 +36332,7 @@ editor.init = function () {
}, _callee17);
}));
return function (_x8, _x9) {
return function (_x7, _x8) {
return _ref34.apply(this, arguments);
};
}();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

54
dist/index-umd.js vendored
View File

@@ -5,6 +5,8 @@
}(this, (function () { 'use strict';
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
@@ -9499,13 +9501,13 @@
function _importSetGlobal() {
_importSetGlobal = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(url, _ref) {
regeneratorRuntime.mark(function _callee(url, _ref2) {
var glob, returnDefault, modularVersion;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
glob = _ref.global, returnDefault = _ref.returnDefault;
glob = _ref2.global, returnDefault = _ref2.returnDefault;
// Todo: Replace calls to this function with `import()` when supported
modularVersion = !('svgEditor' in window) || !window.svgEditor || window.svgEditor.modules !== false;
@@ -9595,9 +9597,9 @@
function importModule(url) {
var atts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
_ref2$returnDefault = _ref2.returnDefault,
returnDefault = _ref2$returnDefault === void 0 ? false : _ref2$returnDefault;
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
_ref$returnDefault = _ref.returnDefault,
returnDefault = _ref$returnDefault === void 0 ? false : _ref$returnDefault;
if (Array.isArray(url)) {
return Promise.all(url.map(function (u) {
@@ -14868,15 +14870,15 @@
this.addExtension =
/*#__PURE__*/
function () {
var _ref4 = _asyncToGenerator(
var _ref3 = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(name, extInitFunc, _ref3) {
regeneratorRuntime.mark(function _callee(name, extInitFunc, _ref4) {
var jq, importLocale, argObj, extObj;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
jq = _ref3.$, importLocale = _ref3.importLocale;
jq = _ref4.$, importLocale = _ref4.importLocale;
if (!(typeof extInitFunc !== 'function')) {
_context.next = 3;
@@ -14939,7 +14941,7 @@
}));
return function (_x, _x2, _x3) {
return _ref4.apply(this, arguments);
return _ref3.apply(this, arguments);
};
}();
/**
@@ -30192,10 +30194,10 @@
'.stroke_tool div div .svg_icon': 20,
'#tools_bottom label .svg_icon': 18
},
callback: function () {
var _callback = _asyncToGenerator(
callback: function callback(icons) {
return _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee4(icons) {
regeneratorRuntime.mark(function _callee4() {
var tleft, minHeight, size, getStylesheetPriority, stylesheets, idx, _stylesheets;
return regeneratorRuntime.wrap(function _callee4$(_context4) {
@@ -30302,14 +30304,8 @@
}
}
}, _callee4);
}));
function callback(_x3) {
return _callback.apply(this, arguments);
}
return callback;
}()
}))();
}
});
}
/**
@@ -30391,7 +30387,7 @@
var rIntervals = [];
for (var i = 0.1; i < 1E5; i *= 10) {
for (var i = 0.1; i < 1e5; i *= 10) {
rIntervals.push(i);
rIntervals.push(2 * i);
rIntervals.push(5 * i);
@@ -32525,7 +32521,7 @@
}, _callee5);
}));
return function extAdded(_x4, _x5) {
return function extAdded(_x3, _x4) {
return _ref16.apply(this, arguments);
};
}();
@@ -36164,15 +36160,15 @@
reader.onloadend =
/*#__PURE__*/
function () {
var _ref33 = _asyncToGenerator(
var _ref32 = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee15(_ref32) {
regeneratorRuntime.mark(function _callee15(_ref33) {
var target;
return regeneratorRuntime.wrap(function _callee15$(_context15) {
while (1) {
switch (_context15.prev = _context15.next) {
case 0:
target = _ref32.target;
target = _ref33.target;
_context15.next = 3;
return loadSvgString(target.result);
@@ -36187,8 +36183,8 @@
}, _callee15);
}));
return function (_x7) {
return _ref33.apply(this, arguments);
return function (_x6) {
return _ref32.apply(this, arguments);
};
}();
@@ -36203,7 +36199,7 @@
}, _callee16, this);
}));
return function (_x6) {
return function (_x5) {
return _ref31.apply(this, arguments);
};
}());
@@ -36342,7 +36338,7 @@
}, _callee17);
}));
return function (_x8, _x9) {
return function (_x7, _x8) {
return _ref34.apply(this, arguments);
};
}();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -2,6 +2,8 @@
'use strict';
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;

View File

@@ -2,6 +2,8 @@ var SvgCanvas = (function () {
'use strict';
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
@@ -11378,13 +11380,13 @@ var SvgCanvas = (function () {
function _importSetGlobal() {
_importSetGlobal = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(url, _ref) {
regeneratorRuntime.mark(function _callee(url, _ref2) {
var glob, returnDefault, modularVersion;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
glob = _ref.global, returnDefault = _ref.returnDefault;
glob = _ref2.global, returnDefault = _ref2.returnDefault;
// Todo: Replace calls to this function with `import()` when supported
modularVersion = !('svgEditor' in window) || !window.svgEditor || window.svgEditor.modules !== false;
@@ -11474,9 +11476,9 @@ var SvgCanvas = (function () {
function importModule(url) {
var atts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
_ref2$returnDefault = _ref2.returnDefault,
returnDefault = _ref2$returnDefault === void 0 ? false : _ref2$returnDefault;
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
_ref$returnDefault = _ref.returnDefault,
returnDefault = _ref$returnDefault === void 0 ? false : _ref$returnDefault;
if (Array.isArray(url)) {
return Promise.all(url.map(function (u) {
@@ -14552,15 +14554,15 @@ var SvgCanvas = (function () {
this.addExtension =
/*#__PURE__*/
function () {
var _ref4 = _asyncToGenerator(
var _ref3 = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(name, extInitFunc, _ref3) {
regeneratorRuntime.mark(function _callee(name, extInitFunc, _ref4) {
var jq, importLocale, argObj, extObj;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
jq = _ref3.$, importLocale = _ref3.importLocale;
jq = _ref4.$, importLocale = _ref4.importLocale;
if (!(typeof extInitFunc !== 'function')) {
_context.next = 3;
@@ -14623,7 +14625,7 @@ var SvgCanvas = (function () {
}));
return function (_x, _x2, _x3) {
return _ref4.apply(this, arguments);
return _ref3.apply(this, arguments);
};
}();
/**