- Linting: Add `ignore` folder to ignore file; ensure license versions are valid semver

- npm: Update devDeps
master
Brett Zamir 2019-11-13 14:16:06 +08:00
parent d808cc22de
commit a09c47283e
37 changed files with 12859 additions and 15105 deletions

View File

@ -1,4 +1,5 @@
node_modules node_modules
ignore
dist dist
docs/jsdoc docs/jsdoc

68
dist/canvg.js vendored
View File

@ -15,42 +15,6 @@ var canvg = (function (exports) {
return _typeof(obj); return _typeof(obj);
} }
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
function _classCallCheck(instance, Constructor) { function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) { if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function"); throw new TypeError("Cannot call a class as a function");
@ -4684,19 +4648,14 @@ var canvg = (function (exports) {
}; // load from url }; // load from url
svg.load = svg.load = function _callee(ctx, url) {
/*#__PURE__*/
function () {
var _ref12 = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(ctx, url) {
var dom; var dom;
return regeneratorRuntime.wrap(function _callee$(_context) { return regeneratorRuntime.async(function _callee$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
_context.next = 2; _context.next = 2;
return svg.ajax(url, true); return regeneratorRuntime.awrap(svg.ajax(url, true));
case 2: case 2:
dom = _context.sent; dom = _context.sent;
@ -4707,13 +4666,8 @@ var canvg = (function (exports) {
return _context.stop(); return _context.stop();
} }
} }
}, _callee); });
})); }; // load from xml
return function (_x2, _x3) {
return _ref12.apply(this, arguments);
};
}(); // load from xml
svg.loadXml = function (ctx, xml) { svg.loadXml = function (ctx, xml) {
@ -4934,9 +4888,9 @@ var canvg = (function (exports) {
checkPath: function checkPath(element, ctx) { checkPath: function checkPath(element, ctx) {
var _this26 = this; var _this26 = this;
this.events.forEach(function (_ref13, i) { this.events.forEach(function (_ref12, i) {
var x = _ref13.x, var x = _ref12.x,
y = _ref13.y; y = _ref12.y;
if (ctx.isPointInPath && ctx.isPointInPath(x, y)) { if (ctx.isPointInPath && ctx.isPointInPath(x, y)) {
_this26.eventElements[i] = element; _this26.eventElements[i] = element;
@ -4946,9 +4900,9 @@ var canvg = (function (exports) {
checkBoundingBox: function checkBoundingBox(element, bb) { checkBoundingBox: function checkBoundingBox(element, bb) {
var _this27 = this; var _this27 = this;
this.events.forEach(function (_ref14, i) { this.events.forEach(function (_ref13, i) {
var x = _ref14.x, var x = _ref13.x,
y = _ref14.y; y = _ref13.y;
if (bb.isPointInBox(x, y)) { if (bb.isPointInBox(x, y)) {
_this27.eventElements[i] = element; _this27.eventElements[i] = element;

View File

@ -1,42 +1,6 @@
var svgEditorExtension_arrows = (function () { var svgEditorExtension_arrows = (function () {
'use strict'; 'use strict';
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
function _inherits(subClass, superClass) { function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) { if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function"); throw new TypeError("Super expression must either be null or a function");
@ -211,12 +175,9 @@ var svgEditorExtension_arrows = (function () {
*/ */
var extArrows = { var extArrows = {
name: 'arrows', name: 'arrows',
init: function () { init: function init(S) {
var _init = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee2(S) {
var strings, svgEditor, svgCanvas, addElem, nonce, $, prefix, selElems, arrowprefix, randomizeIds, setArrowNonce, unsetArrowNonce, pathdata, getLinked, showPanel, resetMarker, addMarker, setArrow, colorChanged, contextTools; 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) { return regeneratorRuntime.async(function init$(_context2) {
while (1) { while (1) {
switch (_context2.prev = _context2.next) { switch (_context2.prev = _context2.next) {
case 0: case 0:
@ -427,7 +388,7 @@ var svgEditorExtension_arrows = (function () {
}; };
_context2.next = 10; _context2.next = 10;
return S.importLocale(); return regeneratorRuntime.awrap(S.importLocale());
case 10: case 10:
strings = _context2.sent; strings = _context2.sent;
@ -489,19 +450,16 @@ var svgEditorExtension_arrows = (function () {
$('#arrow_list option')[0].id = 'connector_no_arrow'; $('#arrow_list option')[0].id = 'connector_no_arrow';
}, },
addLangData: function () { addLangData: function addLangData(_ref) {
var _addLangData = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(_ref) {
var lang, importLocale, _ref2, langList; var lang, importLocale, _ref2, langList;
return regeneratorRuntime.wrap(function _callee$(_context) { return regeneratorRuntime.async(function addLangData$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
lang = _ref.lang, importLocale = _ref.importLocale; lang = _ref.lang, importLocale = _ref.importLocale;
_context.next = 3; _context.next = 3;
return importLocale(); return regeneratorRuntime.awrap(importLocale());
case 3: case 3:
_ref2 = _context.sent; _ref2 = _context.sent;
@ -515,15 +473,8 @@ var svgEditorExtension_arrows = (function () {
return _context.stop(); return _context.stop();
} }
} }
}, _callee); });
})); },
function addLangData(_x2) {
return _addLangData.apply(this, arguments);
}
return addLangData;
}(),
selectedChanged: function selectedChanged(opts) { selectedChanged: function selectedChanged(opts) {
// Use this to update the current selected elements // Use this to update the current selected elements
selElems = opts.elems; selElems = opts.elems;
@ -562,15 +513,8 @@ var svgEditorExtension_arrows = (function () {
return _context2.stop(); return _context2.stop();
} }
} }
}, _callee2, this); }, null, this);
}));
function init(_x) {
return _init.apply(this, arguments);
} }
return init;
}()
}; };
return extArrows; return extArrows;

View File

@ -1,42 +1,6 @@
var svgEditorExtension_closepath = (function () { var svgEditorExtension_closepath = (function () {
'use strict'; 'use strict';
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
/** /**
* ext-closepath.js * ext-closepath.js
* *
@ -49,18 +13,15 @@ var svgEditorExtension_closepath = (function () {
// The button toggles whether the path is open or closed // The button toggles whether the path is open or closed
var extClosepath = { var extClosepath = {
name: 'closepath', name: 'closepath',
init: function () { init: function init(_ref) {
var _init = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(_ref) {
var importLocale, $, strings, svgEditor, selElems, updateButton, showPanel, toggleClosed, buttons; var importLocale, $, strings, svgEditor, selElems, updateButton, showPanel, toggleClosed, buttons;
return regeneratorRuntime.wrap(function _callee$(_context) { return regeneratorRuntime.async(function init$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
importLocale = _ref.importLocale, $ = _ref.$; importLocale = _ref.importLocale, $ = _ref.$;
_context.next = 3; _context.next = 3;
return importLocale(); return regeneratorRuntime.awrap(importLocale());
case 3: case 3:
strings = _context.sent; strings = _context.sent;
@ -159,15 +120,8 @@ var svgEditorExtension_closepath = (function () {
return _context.stop(); return _context.stop();
} }
} }
}, _callee, this); }, null, this);
}));
function init(_x) {
return _init.apply(this, arguments);
} }
return init;
}()
}; };
return extClosepath; return extClosepath;

View File

@ -1,42 +1,6 @@
var svgEditorExtension_connector = (function () { var svgEditorExtension_connector = (function () {
'use strict'; 'use strict';
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
/* eslint-disable unicorn/no-fn-reference-in-iterator */ /* eslint-disable unicorn/no-fn-reference-in-iterator */
/** /**
@ -49,12 +13,9 @@ var svgEditorExtension_connector = (function () {
*/ */
var extConnector = { var extConnector = {
name: 'connector', name: 'connector',
init: function () { init: function init(S) {
var _init = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(S) {
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; 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) { return regeneratorRuntime.async(function init$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
@ -303,7 +264,7 @@ var svgEditorExtension_connector = (function () {
getElem = svgCanvas.getElem; getElem = svgCanvas.getElem;
$ = S.$, svgroot = S.svgroot, importLocale = S.importLocale, addElem = svgCanvas.addSVGElementFromJson, selManager = S.selectorManager, connSel = '.se_connector', elData = $.data; $ = S.$, svgroot = S.svgroot, importLocale = S.importLocale, addElem = svgCanvas.addSVGElementFromJson, selManager = S.selectorManager, connSel = '.se_connector', elData = $.data;
_context.next = 14; _context.next = 14;
return importLocale(); return regeneratorRuntime.awrap(importLocale());
case 14: case 14:
strings = _context.sent; strings = _context.sent;
@ -683,15 +644,8 @@ var svgEditorExtension_connector = (function () {
return _context.stop(); return _context.stop();
} }
} }
}, _callee, this); }, null, this);
}));
function init(_x) {
return _init.apply(this, arguments);
} }
return init;
}()
}; };
return extConnector; return extConnector;

View File

@ -1,42 +1,6 @@
var svgEditorExtension_eyedropper = (function () { var svgEditorExtension_eyedropper = (function () {
'use strict'; 'use strict';
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
/** /**
* ext-eyedropper.js * ext-eyedropper.js
* *
@ -47,12 +11,9 @@ var svgEditorExtension_eyedropper = (function () {
*/ */
var extEyedropper = { var extEyedropper = {
name: 'eyedropper', name: 'eyedropper',
init: function () { init: function init(S) {
var _init = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(S) {
var strings, svgEditor, $, ChangeElementCommand, svgCanvas, addToHistory, currentStyle, getStyle, buttons; var strings, svgEditor, $, ChangeElementCommand, svgCanvas, addToHistory, currentStyle, getStyle, buttons;
return regeneratorRuntime.wrap(function _callee$(_context) { return regeneratorRuntime.async(function init$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
@ -87,7 +48,7 @@ var svgEditorExtension_eyedropper = (function () {
}; };
_context.next = 3; _context.next = 3;
return S.importLocale(); return regeneratorRuntime.awrap(S.importLocale());
case 3: case 3:
strings = _context.sent; strings = _context.sent;
@ -192,15 +153,8 @@ var svgEditorExtension_eyedropper = (function () {
return _context.stop(); return _context.stop();
} }
} }
}, _callee, this); }, null, this);
}));
function init(_x) {
return _init.apply(this, arguments);
} }
return init;
}()
}; };
return extEyedropper; return extEyedropper;

View File

@ -1,42 +1,6 @@
var svgEditorExtension_foreignobject = (function () { var svgEditorExtension_foreignobject = (function () {
'use strict'; 'use strict';
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
/** /**
* ext-foreignobject.js * ext-foreignobject.js
* *
@ -47,21 +11,18 @@ var svgEditorExtension_foreignobject = (function () {
*/ */
var extForeignobject = { var extForeignobject = {
name: 'foreignobject', name: 'foreignobject',
init: function () { init: function init(S) {
var _init = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee2(S) {
var svgEditor, $, text2xml, NS, importLocale, svgCanvas, svgdoc, strings, properlySourceSizeTextArea, showPanel, toggleSourceButtons, selElems, started, newFO, editingforeign, setForeignString, showForeignEditor, setAttr, buttons, contextTools; 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) { return regeneratorRuntime.async(function init$(_context2) {
while (1) { while (1) {
switch (_context2.prev = _context2.next) { switch (_context2.prev = _context2.next) {
case 0: case 0:
setAttr = function _ref6(attr, val) { setAttr = function _ref5(attr, val) {
svgCanvas.changeSelectedAttribute(attr, val); svgCanvas.changeSelectedAttribute(attr, val);
svgCanvas.call('changed', selElems); svgCanvas.call('changed', selElems);
}; };
showForeignEditor = function _ref5() { showForeignEditor = function _ref4() {
var elt = selElems[0]; var elt = selElems[0];
if (!elt || editingforeign) { if (!elt || editingforeign) {
@ -78,7 +39,7 @@ var svgEditorExtension_foreignobject = (function () {
$('#svg_source_textarea').focus(); $('#svg_source_textarea').focus();
}; };
setForeignString = function _ref4(xmlString) { setForeignString = function _ref3(xmlString) {
var elt = selElems[0]; // The parent `Element` to append to var elt = selElems[0]; // The parent `Element` to append to
try { try {
@ -99,12 +60,12 @@ var svgEditorExtension_foreignobject = (function () {
return true; return true;
}; };
toggleSourceButtons = function _ref3(on) { toggleSourceButtons = function _ref2(on) {
$('#tool_source_save, #tool_source_cancel').toggle(!on); $('#tool_source_save, #tool_source_cancel').toggle(!on);
$('#foreign_save, #foreign_cancel').toggle(on); $('#foreign_save, #foreign_cancel').toggle(on);
}; };
showPanel = function _ref2(on) { showPanel = function _ref(on) {
var fcRules = $('#fc_rules'); var fcRules = $('#fc_rules');
if (!fcRules.length) { if (!fcRules.length) {
@ -120,7 +81,7 @@ var svgEditorExtension_foreignobject = (function () {
svgCanvas = svgEditor.canvas; svgCanvas = svgEditor.canvas;
svgdoc = S.svgroot.parentNode.ownerDocument; svgdoc = S.svgroot.parentNode.ownerDocument;
_context2.next = 11; _context2.next = 11;
return importLocale(); return regeneratorRuntime.awrap(importLocale());
case 11: case 11:
strings = _context2.sent; strings = _context2.sent;
@ -218,13 +179,9 @@ var svgEditorExtension_foreignobject = (function () {
// Create source save/cancel buttons // Create source save/cancel buttons
/* const save = */ /* const save = */
$('#tool_source_save').clone().hide().attr('id', 'foreign_save').unbind().appendTo('#tool_source_back').click( $('#tool_source_save').clone().hide().attr('id', 'foreign_save').unbind().appendTo('#tool_source_back').click(function _callee() {
/*#__PURE__*/
_asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee() {
var ok; var ok;
return regeneratorRuntime.wrap(function _callee$(_context) { return regeneratorRuntime.async(function _callee$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
@ -242,7 +199,7 @@ var svgEditorExtension_foreignobject = (function () {
} }
_context.next = 5; _context.next = 5;
return $.confirm('Errors found. Revert to original?'); return regeneratorRuntime.awrap($.confirm('Errors found. Revert to original?'));
case 5: case 5:
ok = _context.sent; ok = _context.sent;
@ -267,8 +224,8 @@ var svgEditorExtension_foreignobject = (function () {
return _context.stop(); return _context.stop();
} }
} }
}, _callee); });
}))); });
/* const cancel = */ /* const cancel = */
$('#tool_source_cancel').clone().hide().attr('id', 'foreign_cancel').unbind().appendTo('#tool_source_back').click(function () { $('#tool_source_cancel').clone().hide().attr('id', 'foreign_cancel').unbind().appendTo('#tool_source_back').click(function () {
@ -357,15 +314,8 @@ var svgEditorExtension_foreignobject = (function () {
return _context2.stop(); return _context2.stop();
} }
} }
}, _callee2, this); }, null, this);
}));
function init(_x) {
return _init.apply(this, arguments);
} }
return init;
}()
}; };
return extForeignobject; return extForeignobject;

View File

@ -1,42 +1,6 @@
var svgEditorExtension_grid = (function () { var svgEditorExtension_grid = (function () {
'use strict'; 'use strict';
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
/** /**
* ext-grid.js * ext-grid.js
* *
@ -47,12 +11,9 @@ var svgEditorExtension_grid = (function () {
*/ */
var extGrid = { var extGrid = {
name: 'grid', name: 'grid',
init: function () { init: function init(_ref) {
var _init = _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; var $, NS, getTypeMap, importLocale, strings, svgEditor, svgCanvas, svgdoc, assignAttributes, hcanvas, canvBG, units, intervals, showGrid, canvasGrid, gridDefs, gridPattern, gridimg, gridBox, updateGrid, gridUpdate, buttons;
return regeneratorRuntime.wrap(function _callee$(_context) { return regeneratorRuntime.async(function init$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
@ -115,7 +76,7 @@ var svgEditorExtension_grid = (function () {
$ = _ref.$, NS = _ref.NS, getTypeMap = _ref.getTypeMap, importLocale = _ref.importLocale; $ = _ref.$, NS = _ref.NS, getTypeMap = _ref.getTypeMap, importLocale = _ref.importLocale;
_context.next = 5; _context.next = 5;
return importLocale(); return regeneratorRuntime.awrap(importLocale());
case 5: case 5:
strings = _context.sent; strings = _context.sent;
@ -212,15 +173,8 @@ var svgEditorExtension_grid = (function () {
return _context.stop(); return _context.stop();
} }
} }
}, _callee, this); }, null, this);
}));
function init(_x) {
return _init.apply(this, arguments);
} }
return init;
}()
}; };
return extGrid; return extGrid;

View File

@ -1,42 +1,6 @@
var svgEditorExtension_helloworld = (function () { var svgEditorExtension_helloworld = (function () {
'use strict'; 'use strict';
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
function _slicedToArray(arr, i) { function _slicedToArray(arr, i) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
} }
@ -95,18 +59,15 @@ var svgEditorExtension_helloworld = (function () {
*/ */
var extHelloworld = { var extHelloworld = {
name: 'helloworld', name: 'helloworld',
init: function () { init: function init(_ref) {
var _init = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(_ref) {
var $, importLocale, strings, svgEditor, svgCanvas; var $, importLocale, strings, svgEditor, svgCanvas;
return regeneratorRuntime.wrap(function _callee$(_context) { return regeneratorRuntime.async(function init$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
$ = _ref.$, importLocale = _ref.importLocale; $ = _ref.$, importLocale = _ref.importLocale;
_context.next = 3; _context.next = 3;
return importLocale(); return regeneratorRuntime.awrap(importLocale());
case 3: case 3:
strings = _context.sent; strings = _context.sent;
@ -181,15 +142,8 @@ var svgEditorExtension_helloworld = (function () {
return _context.stop(); return _context.stop();
} }
} }
}, _callee, this); }, null, this);
}));
function init(_x) {
return _init.apply(this, arguments);
} }
return init;
}()
}; };
return extHelloworld; return extHelloworld;

View File

@ -15,42 +15,6 @@ var svgEditorExtension_imagelib = (function () {
return _typeof(obj); return _typeof(obj);
} }
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
/** /**
* ext-imagelib.js * ext-imagelib.js
* *
@ -61,16 +25,13 @@ var svgEditorExtension_imagelib = (function () {
*/ */
var extImagelib = { var extImagelib = {
name: 'imagelib', name: 'imagelib',
init: function () { init: function init(_ref) {
var _init = _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, toggleMulti, showBrowser, buttons; var $, decode64, importLocale, dropXMLInternalSubset, imagelibStrings, modularVersion, svgEditor, uiStrings, svgCanvas, extIconsPath, allowedImageLibOrigins, closeBrowser, importImage, pending, mode, multiArr, transferStopped, preview, submit, toggleMulti, showBrowser, buttons;
return regeneratorRuntime.wrap(function _callee2$(_context2) { return regeneratorRuntime.async(function init$(_context2) {
while (1) { while (1) {
switch (_context2.prev = _context2.next) { switch (_context2.prev = _context2.next) {
case 0: case 0:
showBrowser = function _ref10() { showBrowser = function _ref9() {
var browser = $('#imgbrowse'); var browser = $('#imgbrowse');
if (!browser.length) { if (!browser.length) {
@ -126,10 +87,10 @@ var svgEditorExtension_imagelib = (function () {
}); });
cancel.prepend($.getSvgIcon('cancel', true)); cancel.prepend($.getSvgIcon('cancel', true));
back.prepend($.getSvgIcon('tool_imagelib', true)); back.prepend($.getSvgIcon('tool_imagelib', true));
imagelibStrings.imgLibs.forEach(function (_ref6) { imagelibStrings.imgLibs.forEach(function (_ref5) {
var name = _ref6.name, var name = _ref5.name,
url = _ref6.url, url = _ref5.url,
description = _ref6.description; description = _ref5.description;
$('<li>').appendTo(libOpts).text(name).on('click touchend', function () { $('<li>').appendTo(libOpts).text(name).on('click touchend', function () {
frame.attr('src', url).show(); frame.attr('src', url).show();
header.text(name); header.text(name);
@ -142,7 +103,7 @@ var svgEditorExtension_imagelib = (function () {
} }
}; };
toggleMulti = function _ref9(show) { toggleMulti = function _ref8(show) {
$('#lib_framewrap, #imglib_opts').css({ $('#lib_framewrap, #imglib_opts').css({
right: show ? 200 : 10 right: show ? 200 : 10
}); });
@ -184,7 +145,7 @@ var svgEditorExtension_imagelib = (function () {
submit.toggle(show); submit.toggle(show);
}; };
importImage = function _ref8(url) { importImage = function _ref7(url) {
var newImage = svgCanvas.addSVGElementFromJson({ var newImage = svgCanvas.addSVGElementFromJson({
element: 'image', element: 'image',
attr: { attr: {
@ -201,13 +162,13 @@ var svgEditorExtension_imagelib = (function () {
svgCanvas.setImageURL(url); svgCanvas.setImageURL(url);
}; };
closeBrowser = function _ref7() { closeBrowser = function _ref6() {
$('#imgbrowse_holder').hide(); $('#imgbrowse_holder').hide();
}; };
$ = _ref.$, decode64 = _ref.decode64, importLocale = _ref.importLocale, dropXMLInternalSubset = _ref.dropXMLInternalSubset; $ = _ref.$, decode64 = _ref.decode64, importLocale = _ref.importLocale, dropXMLInternalSubset = _ref.dropXMLInternalSubset;
_context2.next = 7; _context2.next = 7;
return importLocale(); return regeneratorRuntime.awrap(importLocale());
case 7: case 7:
imagelibStrings = _context2.sent; imagelibStrings = _context2.sent;
@ -245,14 +206,9 @@ var svgEditorExtension_imagelib = (function () {
multiArr = []; multiArr = [];
transferStopped = false; transferStopped = false;
// Receive `postMessage` data // Receive `postMessage` data
window.addEventListener('message', window.addEventListener('message', function _callee(_ref4) {
/*#__PURE__*/
function () {
var _ref5 = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(_ref4) {
var origin, response, id, type, hasName, hasHref, char1, secondpos, entry, curMeta, svgStr, imgStr, name, message, pre, src, title, xml, ok; 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) { return regeneratorRuntime.async(function _callee$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
@ -362,7 +318,7 @@ var svgEditorExtension_imagelib = (function () {
} }
_context.next = 39; _context.next = 39;
return $.process_cancel(message); return regeneratorRuntime.awrap($.process_cancel(message));
case 39: case 39:
// eslint-disable-next-line require-atomic-updates // eslint-disable-next-line require-atomic-updates
@ -511,7 +467,7 @@ var svgEditorExtension_imagelib = (function () {
case 74: case 74:
closeBrowser(); closeBrowser();
_context.next = 77; _context.next = 77;
return svgEditor.openPrep(); return regeneratorRuntime.awrap(svgEditor.openPrep());
case 77: case 77:
ok = _context.sent; ok = _context.sent;
@ -534,13 +490,8 @@ var svgEditorExtension_imagelib = (function () {
return _context.stop(); return _context.stop();
} }
} }
}, _callee, null, [[3, 20]]); }, null, null, [[3, 20]]);
})); }, true);
return function (_x2) {
return _ref5.apply(this, arguments);
};
}(), true);
/** /**
* @param {boolean} show * @param {boolean} show
* @returns {void} * @returns {void}
@ -571,15 +522,8 @@ var svgEditorExtension_imagelib = (function () {
return _context2.stop(); return _context2.stop();
} }
} }
}, _callee2, this); }, null, this);
}));
function init(_x) {
return _init.apply(this, arguments);
} }
return init;
}()
}; };
return extImagelib; return extImagelib;

View File

@ -1,42 +1,6 @@
var svgEditorExtension_markers = (function () { var svgEditorExtension_markers = (function () {
'use strict'; 'use strict';
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
function _inherits(subClass, superClass) { function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) { if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function"); throw new TypeError("Super expression must either be null or a function");
@ -233,17 +197,13 @@ var svgEditorExtension_markers = (function () {
*/ */
var extMarkers = { var extMarkers = {
name: 'markers', name: 'markers',
init: function () { init: function init(S) {
var _init = _asyncToGenerator( var strings, svgEditor, $, svgCanvas, addElem, mtypes, markerPrefix, idPrefix, markerTypes, getLinked, setIcon, selElems, showPanel, addMarker, convertline, setMarker, colorChanged, updateReferences, triggerTextEntry, showTextPrompt, setArrowFromButton, getTitle, buildButtonList, contextTools;
/*#__PURE__*/ return regeneratorRuntime.async(function init$(_context3) {
regeneratorRuntime.mark(function _callee3(S) {
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) {
while (1) { while (1) {
switch (_context3.prev = _context3.next) { switch (_context3.prev = _context3.next) {
case 0: case 0:
buildButtonList = function _ref16() { buildButtonList = function _ref14() {
var buttons = []; // const i = 0; var buttons = []; // const i = 0;
/* /*
@ -294,7 +254,7 @@ var svgEditorExtension_markers = (function () {
return buttons; return buttons;
}; };
getTitle = function _ref15(id) { getTitle = function _ref13(id) {
var langList = strings.langList; var langList = strings.langList;
var item = langList.find(function (itm) { var item = langList.find(function (itm) {
return itm.id === id; return itm.id === id;
@ -302,12 +262,9 @@ var svgEditorExtension_markers = (function () {
return item ? item.title : id; return item ? item.title : id;
}; };
_setArrowFromButton = function _ref14() { setArrowFromButton = function _ref12(ev) {
_setArrowFromButton = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee2(ev) {
var parts, pos, val; var parts, pos, val;
return regeneratorRuntime.wrap(function _callee2$(_context2) { return regeneratorRuntime.async(function setArrowFromButton$(_context2) {
while (1) { while (1) {
switch (_context2.prev = _context2.next) { switch (_context2.prev = _context2.next) {
case 0: case 0:
@ -330,28 +287,19 @@ var svgEditorExtension_markers = (function () {
case 8: case 8:
_context2.next = 10; _context2.next = 10;
return showTextPrompt(pos); return regeneratorRuntime.awrap(showTextPrompt(pos));
case 10: case 10:
case "end": case "end":
return _context2.stop(); return _context2.stop();
} }
} }
}, _callee2, this); }, null, this);
}));
return _setArrowFromButton.apply(this, arguments);
}; };
setArrowFromButton = function _ref13(_x3) { showTextPrompt = function _ref11(pos) {
return _setArrowFromButton.apply(this, arguments);
};
_showTextPrompt = function _ref12() {
_showTextPrompt = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(pos) {
var def, txt; var def, txt;
return regeneratorRuntime.wrap(function _callee$(_context) { return regeneratorRuntime.async(function showTextPrompt$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
@ -362,7 +310,7 @@ var svgEditorExtension_markers = (function () {
} }
_context.next = 4; _context.next = 4;
return $.prompt('Enter text for ' + pos + ' marker', def); return regeneratorRuntime.awrap($.prompt('Enter text for ' + pos + ' marker', def));
case 4: case 4:
txt = _context.sent; txt = _context.sent;
@ -376,13 +324,7 @@ var svgEditorExtension_markers = (function () {
return _context.stop(); return _context.stop();
} }
} }
}, _callee); });
}));
return _showTextPrompt.apply(this, arguments);
};
showTextPrompt = function _ref11(_x2) {
return _showTextPrompt.apply(this, arguments);
}; };
triggerTextEntry = function _ref10(pos, val) { triggerTextEntry = function _ref10(pos, val) {
@ -710,10 +652,10 @@ var svgEditorExtension_markers = (function () {
return svgCanvas.getElem(m.groups.id); return svgCanvas.getElem(m.groups.id);
}; };
_context3.next = 17; _context3.next = 15;
return S.importLocale(); return regeneratorRuntime.awrap(S.importLocale());
case 17: case 15:
strings = _context3.sent; strings = _context3.sent;
svgEditor = this; svgEditor = this;
$ = S.$; $ = S.$;
@ -917,20 +859,13 @@ var svgEditorExtension_markers = (function () {
}) })
}); });
case 29: case 27:
case "end": case "end":
return _context3.stop(); return _context3.stop();
} }
} }
}, _callee3, this); }, null, this);
}));
function init(_x) {
return _init.apply(this, arguments);
} }
return init;
}()
}; };
return extMarkers; return extMarkers;

View File

@ -1,42 +1,6 @@
var svgEditorExtension_mathjax = (function () { var svgEditorExtension_mathjax = (function () {
'use strict'; 'use strict';
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
/** /**
* Add any of the whitelisted attributes to the script tag. * Add any of the whitelisted attributes to the script tag.
* @param {HTMLScriptElement} script * @param {HTMLScriptElement} script
@ -52,6 +16,14 @@ var svgEditorExtension_mathjax = (function () {
} }
}); });
} // Additions by Brett } // Additions by Brett
/**
*
* @author Brett Zamir (other items are from `dynamic-import-polyfill`)
* @param {string|string[]} url
* @param {PlainObject} [atts={}]
* @returns {Promise<void|Error>} Resolves to `undefined` or rejects with an `Error` upon a
* script loading error
*/
function importScript(url) { function importScript(url) {
var atts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var atts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@ -101,14 +73,12 @@ var svgEditorExtension_mathjax = (function () {
}); });
} }
/* globals MathJax */
var extMathjax = { var extMathjax = {
name: 'mathjax', name: 'mathjax',
init: function () { init: function init(_ref) {
var _init = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee2(_ref) {
var $, importLocale, strings, svgEditor, svgCanvas, mathjaxSrcSecure, uiStrings, math, locationX, locationY, mathjaxLoaded, saveMath, buttons; var $, importLocale, strings, svgEditor, svgCanvas, mathjaxSrcSecure, uiStrings, math, locationX, locationY, mathjaxLoaded, saveMath, buttons;
return regeneratorRuntime.wrap(function _callee2$(_context2) { return regeneratorRuntime.async(function init$(_context2) {
while (1) { while (1) {
switch (_context2.prev = _context2.next) { switch (_context2.prev = _context2.next) {
case 0: case 0:
@ -166,7 +136,7 @@ var svgEditorExtension_mathjax = (function () {
$ = _ref.$, importLocale = _ref.importLocale; $ = _ref.$, importLocale = _ref.importLocale;
_context2.next = 4; _context2.next = 4;
return importLocale(); return regeneratorRuntime.awrap(importLocale());
case 4: case 4:
strings = _context2.sent; strings = _context2.sent;
@ -222,11 +192,8 @@ var svgEditorExtension_mathjax = (function () {
type: 'mode', type: 'mode',
icon: svgEditor.curConfig.extIconsPath + 'mathjax.png', icon: svgEditor.curConfig.extIconsPath + 'mathjax.png',
events: { events: {
click: function () { click: function click() {
var _click = _asyncToGenerator( return regeneratorRuntime.async(function click$(_context) {
/*#__PURE__*/
regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
@ -280,7 +247,7 @@ var svgEditorExtension_mathjax = (function () {
_context.prev = 7; _context.prev = 7;
_context.next = 10; _context.next = 10;
return importScript(svgEditor.curConfig.extIconsPath + mathjaxSrcSecure); return regeneratorRuntime.awrap(importScript(svgEditor.curConfig.extIconsPath + mathjaxSrcSecure));
case 10: case 10:
// When MathJax is loaded get the div where the math will be rendered. // When MathJax is loaded get the div where the math will be rendered.
@ -306,15 +273,8 @@ var svgEditorExtension_mathjax = (function () {
return _context.stop(); return _context.stop();
} }
} }
}, _callee, null, [[7, 13]]); }, null, null, [[7, 13]]);
}));
function click() {
return _click.apply(this, arguments);
} }
return click;
}()
} }
}]; }];
return _context2.abrupt("return", { return _context2.abrupt("return", {
@ -358,15 +318,8 @@ var svgEditorExtension_mathjax = (function () {
return _context2.stop(); return _context2.stop();
} }
} }
}, _callee2, this); }, null, this);
}));
function init(_x) {
return _init.apply(this, arguments);
} }
return init;
}()
}; };
return extMathjax; return extMathjax;

View File

@ -1,42 +1,6 @@
var svgEditorExtension_panning = (function () { var svgEditorExtension_panning = (function () {
'use strict'; 'use strict';
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
/** /**
* ext-panning.js * ext-panning.js
* *
@ -51,18 +15,15 @@ var svgEditorExtension_panning = (function () {
*/ */
var extPanning = { var extPanning = {
name: 'panning', name: 'panning',
init: function () { init: function init(_ref) {
var _init = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(_ref) {
var importLocale, strings, svgEditor, svgCanvas, buttons; var importLocale, strings, svgEditor, svgCanvas, buttons;
return regeneratorRuntime.wrap(function _callee$(_context) { return regeneratorRuntime.async(function init$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
importLocale = _ref.importLocale; importLocale = _ref.importLocale;
_context.next = 3; _context.next = 3;
return importLocale(); return regeneratorRuntime.awrap(importLocale());
case 3: case 3:
strings = _context.sent; strings = _context.sent;
@ -112,15 +73,8 @@ var svgEditorExtension_panning = (function () {
return _context.stop(); return _context.stop();
} }
} }
}, _callee, this); }, null, this);
}));
function init(_x) {
return _init.apply(this, arguments);
} }
return init;
}()
}; };
return extPanning; return extPanning;

View File

@ -1,42 +1,6 @@
var svgEditorExtension_placemark = (function () { var svgEditorExtension_placemark = (function () {
'use strict'; 'use strict';
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
function _inherits(subClass, superClass) { function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) { if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function"); throw new TypeError("Super expression must either be null or a function");
@ -252,12 +216,9 @@ var svgEditorExtension_placemark = (function () {
*/ */
var extPlacemark = { var extPlacemark = {
name: 'placemark', name: 'placemark',
init: function () { init: function init(S) {
var _init = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(S) {
var svgEditor, svgCanvas, addElem, $, importLocale, selElems, started, newPM, strings, markerTypes, showPanel, getLinked, updateText, updateFont, addMarker, setMarker, colorChanged, updateReferences, setArrowFromButton, getTitle, addMarkerButtons, buttons, contextTools; 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) { return regeneratorRuntime.async(function init$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
@ -510,7 +471,7 @@ var svgEditorExtension_placemark = (function () {
$ = S.$, importLocale = S.importLocale; // {svgcontent}, $ = S.$, importLocale = S.importLocale; // {svgcontent},
_context.next = 17; _context.next = 17;
return importLocale(); return regeneratorRuntime.awrap(importLocale());
case 17: case 17:
strings = _context.sent; strings = _context.sent;
@ -864,15 +825,8 @@ var svgEditorExtension_placemark = (function () {
return _context.stop(); return _context.stop();
} }
} }
}, _callee, this); }, null, this);
}));
function init(_x) {
return _init.apply(this, arguments);
} }
return init;
}()
}; };
return extPlacemark; return extPlacemark;

View File

@ -1,42 +1,6 @@
var svgEditorExtension_polygon = (function () { var svgEditorExtension_polygon = (function () {
'use strict'; 'use strict';
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
/** /**
* ext-polygon.js * ext-polygon.js
* *
@ -46,12 +10,9 @@ var svgEditorExtension_polygon = (function () {
*/ */
var extPolygon = { var extPolygon = {
name: 'polygon', name: 'polygon',
init: function () { init: function init(S) {
var _init = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(S) {
var svgEditor, svgCanvas, $, importLocale, editingitex, strings, selElems, started, newFO, showPanel, setAttr, cot, sec, buttons, contextTools; var svgEditor, svgCanvas, $, importLocale, editingitex, strings, selElems, started, newFO, showPanel, setAttr, cot, sec, buttons, contextTools;
return regeneratorRuntime.wrap(function _callee$(_context) { return regeneratorRuntime.async(function init$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
@ -83,7 +44,7 @@ var svgEditorExtension_polygon = (function () {
svgCanvas = svgEditor.canvas; svgCanvas = svgEditor.canvas;
$ = S.$, importLocale = S.importLocale, editingitex = false; $ = S.$, importLocale = S.importLocale, editingitex = false;
_context.next = 9; _context.next = 9;
return importLocale(); return regeneratorRuntime.awrap(importLocale());
case 9: case 9:
strings = _context.sent; strings = _context.sent;
@ -299,15 +260,8 @@ var svgEditorExtension_polygon = (function () {
return _context.stop(); return _context.stop();
} }
} }
}, _callee, this); }, null, this);
}));
function init(_x) {
return _init.apply(this, arguments);
} }
return init;
}()
}; };
return extPolygon; return extPolygon;

View File

@ -15,42 +15,6 @@ var svgEditorExtension_server_moinsave = (function () {
return _typeof(obj); return _typeof(obj);
} }
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
function _classCallCheck(instance, Constructor) { function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) { if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function"); throw new TypeError("Cannot call a class as a function");
@ -4684,19 +4648,14 @@ var svgEditorExtension_server_moinsave = (function () {
}; // load from url }; // load from url
svg.load = svg.load = function _callee(ctx, url) {
/*#__PURE__*/
function () {
var _ref12 = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(ctx, url) {
var dom; var dom;
return regeneratorRuntime.wrap(function _callee$(_context) { return regeneratorRuntime.async(function _callee$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
_context.next = 2; _context.next = 2;
return svg.ajax(url, true); return regeneratorRuntime.awrap(svg.ajax(url, true));
case 2: case 2:
dom = _context.sent; dom = _context.sent;
@ -4707,13 +4666,8 @@ var svgEditorExtension_server_moinsave = (function () {
return _context.stop(); return _context.stop();
} }
} }
}, _callee); });
})); }; // load from xml
return function (_x2, _x3) {
return _ref12.apply(this, arguments);
};
}(); // load from xml
svg.loadXml = function (ctx, xml) { svg.loadXml = function (ctx, xml) {
@ -4934,9 +4888,9 @@ var svgEditorExtension_server_moinsave = (function () {
checkPath: function checkPath(element, ctx) { checkPath: function checkPath(element, ctx) {
var _this26 = this; var _this26 = this;
this.events.forEach(function (_ref13, i) { this.events.forEach(function (_ref12, i) {
var x = _ref13.x, var x = _ref12.x,
y = _ref13.y; y = _ref12.y;
if (ctx.isPointInPath && ctx.isPointInPath(x, y)) { if (ctx.isPointInPath && ctx.isPointInPath(x, y)) {
_this26.eventElements[i] = element; _this26.eventElements[i] = element;
@ -4946,9 +4900,9 @@ var svgEditorExtension_server_moinsave = (function () {
checkBoundingBox: function checkBoundingBox(element, bb) { checkBoundingBox: function checkBoundingBox(element, bb) {
var _this27 = this; var _this27 = this;
this.events.forEach(function (_ref14, i) { this.events.forEach(function (_ref13, i) {
var x = _ref14.x, var x = _ref13.x,
y = _ref14.y; y = _ref13.y;
if (bb.isPointInBox(x, y)) { if (bb.isPointInBox(x, y)) {
_this27.eventElements[i] = element; _this27.eventElements[i] = element;
@ -4992,18 +4946,15 @@ var svgEditorExtension_server_moinsave = (function () {
var extServer_moinsave = { var extServer_moinsave = {
name: 'server_moinsave', name: 'server_moinsave',
init: function () { init: function init(_ref) {
var _init = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee2(_ref) {
var $, encode64, importLocale, strings, svgEditor, svgCanvas, saveSvgAction; var $, encode64, importLocale, strings, svgEditor, svgCanvas, saveSvgAction;
return regeneratorRuntime.wrap(function _callee2$(_context2) { return regeneratorRuntime.async(function init$(_context2) {
while (1) { while (1) {
switch (_context2.prev = _context2.next) { switch (_context2.prev = _context2.next) {
case 0: case 0:
$ = _ref.$, encode64 = _ref.encode64, importLocale = _ref.importLocale; $ = _ref.$, encode64 = _ref.encode64, importLocale = _ref.importLocale;
_context2.next = 3; _context2.next = 3;
return importLocale(); return regeneratorRuntime.awrap(importLocale());
case 3: case 3:
strings = _context2.sent; strings = _context2.sent;
@ -5017,13 +4968,10 @@ var svgEditorExtension_server_moinsave = (function () {
$("<iframe name=\"output_frame\" title=\"".concat(strings.hiddenframe, "\"\n style=\"width: 0; height: 0;\" src=\"#\"/>")).appendTo('body'); $("<iframe name=\"output_frame\" title=\"".concat(strings.hiddenframe, "\"\n style=\"width: 0; height: 0;\" src=\"#\"/>")).appendTo('body');
svgEditor.setCustomHandlers({ svgEditor.setCustomHandlers({
save: function () { save: function save(win, data) {
var _save = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(win, data) {
var svg, qstr, _qstr$substr$split, _qstr$substr$split2, name, svgData, c, datauri, pngData; var svg, qstr, _qstr$substr$split, _qstr$substr$split2, name, svgData, c, datauri, pngData;
return regeneratorRuntime.wrap(function _callee$(_context) { return regeneratorRuntime.async(function save$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
@ -5042,7 +4990,7 @@ var svgEditorExtension_server_moinsave = (function () {
c.width = svgCanvas.contentW; c.width = svgCanvas.contentW;
c.height = svgCanvas.contentH; c.height = svgCanvas.contentH;
_context.next = 10; _context.next = 10;
return canvg(c, svg); return regeneratorRuntime.awrap(canvg(c, svg));
case 10: case 10:
datauri = c.toDataURL('image/png'); // const {uiStrings} = svgEditor; datauri = c.toDataURL('image/png'); // const {uiStrings} = svgEditor;
@ -5064,15 +5012,8 @@ var svgEditorExtension_server_moinsave = (function () {
return _context.stop(); return _context.stop();
} }
} }
}, _callee); });
}));
function save(_x2, _x3) {
return _save.apply(this, arguments);
} }
return save;
}()
}); });
case 9: case 9:
@ -5080,15 +5021,8 @@ var svgEditorExtension_server_moinsave = (function () {
return _context2.stop(); return _context2.stop();
} }
} }
}, _callee2, this); }, null, this);
}));
function init(_x) {
return _init.apply(this, arguments);
} }
return init;
}()
}; };
return extServer_moinsave; return extServer_moinsave;

View File

@ -15,42 +15,6 @@ var svgEditorExtension_server_opensave = (function () {
return _typeof(obj); return _typeof(obj);
} }
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
function _classCallCheck(instance, Constructor) { function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) { if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function"); throw new TypeError("Cannot call a class as a function");
@ -4684,19 +4648,14 @@ var svgEditorExtension_server_opensave = (function () {
}; // load from url }; // load from url
svg.load = svg.load = function _callee(ctx, url) {
/*#__PURE__*/
function () {
var _ref12 = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(ctx, url) {
var dom; var dom;
return regeneratorRuntime.wrap(function _callee$(_context) { return regeneratorRuntime.async(function _callee$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
_context.next = 2; _context.next = 2;
return svg.ajax(url, true); return regeneratorRuntime.awrap(svg.ajax(url, true));
case 2: case 2:
dom = _context.sent; dom = _context.sent;
@ -4707,13 +4666,8 @@ var svgEditorExtension_server_opensave = (function () {
return _context.stop(); return _context.stop();
} }
} }
}, _callee); });
})); }; // load from xml
return function (_x2, _x3) {
return _ref12.apply(this, arguments);
};
}(); // load from xml
svg.loadXml = function (ctx, xml) { svg.loadXml = function (ctx, xml) {
@ -4934,9 +4888,9 @@ var svgEditorExtension_server_opensave = (function () {
checkPath: function checkPath(element, ctx) { checkPath: function checkPath(element, ctx) {
var _this26 = this; var _this26 = this;
this.events.forEach(function (_ref13, i) { this.events.forEach(function (_ref12, i) {
var x = _ref13.x, var x = _ref12.x,
y = _ref13.y; y = _ref12.y;
if (ctx.isPointInPath && ctx.isPointInPath(x, y)) { if (ctx.isPointInPath && ctx.isPointInPath(x, y)) {
_this26.eventElements[i] = element; _this26.eventElements[i] = element;
@ -4946,9 +4900,9 @@ var svgEditorExtension_server_opensave = (function () {
checkBoundingBox: function checkBoundingBox(element, bb) { checkBoundingBox: function checkBoundingBox(element, bb) {
var _this27 = this; var _this27 = this;
this.events.forEach(function (_ref14, i) { this.events.forEach(function (_ref13, i) {
var x = _ref14.x, var x = _ref13.x,
y = _ref14.y; y = _ref13.y;
if (bb.isPointInBox(x, y)) { if (bb.isPointInBox(x, y)) {
_this27.eventElements[i] = element; _this27.eventElements[i] = element;
@ -4990,19 +4944,24 @@ var svgEditorExtension_server_opensave = (function () {
}; };
} }
/**
* ext-server_opensave.js
*
* @license MIT
*
* @copyright 2010 Alexis Deveria
*
*/
var extServer_opensave = { var extServer_opensave = {
name: 'server_opensave', name: 'server_opensave',
init: function () { init: function init(_ref) {
var _init = _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; 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;
return regeneratorRuntime.wrap(function _callee5$(_context5) { return regeneratorRuntime.async(function init$(_context5) {
while (1) { while (1) {
switch (_context5.prev = _context5.next) { switch (_context5.prev = _context5.next) {
case 0: case 0:
rebuildInput = function _ref7(form) { rebuildInput = function _ref5(form) {
form.empty(); form.empty();
var inp = $('<input type="file" name="svg_file">').appendTo(form); var inp = $('<input type="file" name="svg_file">').appendTo(form);
/** /**
@ -5012,97 +4971,80 @@ var svgEditorExtension_server_opensave = (function () {
*/ */
function submit() { function submit() {
return _submit.apply(this, arguments); return regeneratorRuntime.async(function submit$(_context2) {
}
function _submit() {
_submit = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee4() {
return regeneratorRuntime.wrap(function _callee4$(_context4) {
while (1) { while (1) {
switch (_context4.prev = _context4.next) { switch (_context2.prev = _context2.next) {
case 0: case 0:
// This submits the form, which returns the file data using `svgEditor.processFile()` // This submits the form, which returns the file data using `svgEditor.processFile()`
form.submit(); form.submit();
rebuildInput(form); rebuildInput(form);
_context4.next = 4; _context2.next = 4;
return $.process_cancel(strings.uploading); return regeneratorRuntime.awrap($.process_cancel(strings.uploading));
case 4: case 4:
cancelled = true; cancelled = true;
$('#dialog_box').hide(); $('#dialog_box').hide();
case 6: case 6:
case "end":
return _context4.stop();
}
}
}, _callee4);
}));
return _submit.apply(this, arguments);
}
if (form[0] === openSvgForm[0]) {
inp.change(
/*#__PURE__*/
_asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee2() {
var ok;
return regeneratorRuntime.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return svgEditor.openPrep();
case 2:
ok = _context2.sent;
if (ok) {
_context2.next = 6;
break;
}
rebuildInput(form);
return _context2.abrupt("return");
case 6:
_context2.next = 8;
return submit();
case 8:
case "end": case "end":
return _context2.stop(); return _context2.stop();
} }
} }
}, _callee2); });
}))); }
} else {
inp.change( if (form[0] === openSvgForm[0]) {
/*#__PURE__*/ inp.change(function _callee() {
_asyncToGenerator( var ok;
/*#__PURE__*/ return regeneratorRuntime.async(function _callee$(_context3) {
regeneratorRuntime.mark(function _callee3() {
return regeneratorRuntime.wrap(function _callee3$(_context3) {
while (1) { while (1) {
switch (_context3.prev = _context3.next) { switch (_context3.prev = _context3.next) {
case 0: case 0:
_context3.next = 2; _context3.next = 2;
return submit(); return regeneratorRuntime.awrap(svgEditor.openPrep());
case 2: case 2:
ok = _context3.sent;
if (ok) {
_context3.next = 6;
break;
}
rebuildInput(form);
return _context3.abrupt("return");
case 6:
_context3.next = 8;
return regeneratorRuntime.awrap(submit());
case 8:
case "end": case "end":
return _context3.stop(); return _context3.stop();
} }
} }
}, _callee3); });
}))); });
} else {
inp.change(function _callee2() {
return regeneratorRuntime.async(function _callee2$(_context4) {
while (1) {
switch (_context4.prev = _context4.next) {
case 0:
_context4.next = 2;
return regeneratorRuntime.awrap(submit());
case 2:
case "end":
return _context4.stop();
}
}
});
});
} }
}; };
clientDownloadSupport = function _ref6(filename, suffix, uri) { clientDownloadSupport = function _ref4(filename, suffix, uri) {
if (avoidClientSide || avoidClientSideDownload) { if (avoidClientSide || avoidClientSideDownload) {
return false; return false;
} }
@ -5122,11 +5064,11 @@ var svgEditorExtension_server_opensave = (function () {
return false; return false;
}; };
xhtmlEscape = function _ref5(str) { xhtmlEscape = function _ref3(str) {
return str.replace(/&(?!amp;)/g, '&amp;').replace(/"/g, '&quot;').replace(/</g, '&lt;'); // < is actually disallowed above anyways return str.replace(/&(?!amp;)/g, '&amp;').replace(/"/g, '&quot;').replace(/</g, '&lt;'); // < is actually disallowed above anyways
}; };
getFileNameFromTitle = function _ref4() { getFileNameFromTitle = function _ref2() {
var title = svgCanvas.getDocumentTitle(); // We convert (to underscore) only those disallowed Win7 file name characters var title = svgCanvas.getDocumentTitle(); // We convert (to underscore) only those disallowed Win7 file name characters
return title.trim().replace(/[/\\:*?"<>|]/g, '_'); return title.trim().replace(/[/\\:*?"<>|]/g, '_');
@ -5134,7 +5076,7 @@ var svgEditorExtension_server_opensave = (function () {
$ = _ref.$, decode64 = _ref.decode64, encode64 = _ref.encode64, importLocale = _ref.importLocale; $ = _ref.$, decode64 = _ref.decode64, encode64 = _ref.encode64, importLocale = _ref.importLocale;
_context5.next = 7; _context5.next = 7;
return importLocale(); return regeneratorRuntime.awrap(importLocale());
case 7: case 7:
strings = _context5.sent; strings = _context5.sent;
@ -5182,12 +5124,9 @@ 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(); }).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" // Todo: Integrate this extension with a new built-in exportWindowType, "download"
exportImage: function () { exportImage: function exportImage(win, data) {
var _exportImage = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(win, data) {
var issues, mimeType, quality, c, datauri, pre, note, filename, suffix; var issues, mimeType, quality, c, datauri, pre, note, filename, suffix;
return regeneratorRuntime.wrap(function _callee$(_context) { return regeneratorRuntime.async(function exportImage$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
@ -5203,7 +5142,7 @@ var svgEditorExtension_server_opensave = (function () {
c.width = svgCanvas.contentW; c.width = svgCanvas.contentW;
c.height = svgCanvas.contentH; c.height = svgCanvas.contentH;
_context.next = 7; _context.next = 7;
return canvg(c, data.svg); return regeneratorRuntime.awrap(canvg(c, data.svg));
case 7: case 7:
datauri = quality ? c.toDataURL(mimeType, quality) : c.toDataURL(mimeType); // {uiStrings} = svgEditor; datauri = quality ? c.toDataURL(mimeType, quality) : c.toDataURL(mimeType); // {uiStrings} = svgEditor;
@ -5223,7 +5162,7 @@ var svgEditorExtension_server_opensave = (function () {
} }
_context.next = 13; _context.next = 13;
return $.alert(note); return regeneratorRuntime.awrap($.alert(note));
case 13: case 13:
filename = getFileNameFromTitle(); filename = getFileNameFromTitle();
@ -5248,15 +5187,8 @@ var svgEditorExtension_server_opensave = (function () {
return _context.stop(); return _context.stop();
} }
} }
}, _callee); });
}));
function exportImage(_x2, _x3) {
return _exportImage.apply(this, arguments);
} }
return exportImage;
}()
}); // Do nothing if client support is found }); // Do nothing if client support is found
if (!(window.FileReader && !avoidClientSideOpen)) { if (!(window.FileReader && !avoidClientSideOpen)) {
@ -5338,15 +5270,8 @@ var svgEditorExtension_server_opensave = (function () {
return _context5.stop(); return _context5.stop();
} }
} }
}, _callee5, this); }, null, this);
}));
function init(_x) {
return _init.apply(this, arguments);
} }
return init;
}()
}; };
return extServer_opensave; return extServer_opensave;

View File

@ -1,42 +1,6 @@
var svgEditorExtension_shapes = (function () { var svgEditorExtension_shapes = (function () {
'use strict'; 'use strict';
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
function _slicedToArray(arr, i) { function _slicedToArray(arr, i) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
} }
@ -89,12 +53,9 @@ var svgEditorExtension_shapes = (function () {
*/ */
var extShapes = { var extShapes = {
name: 'shapes', name: 'shapes',
init: function () { init: function init(_ref) {
var _init = _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; var $, importLocale, 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) { return regeneratorRuntime.async(function init$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
@ -159,7 +120,7 @@ var svgEditorExtension_shapes = (function () {
$ = _ref.$, importLocale = _ref.importLocale; $ = _ref.$, importLocale = _ref.importLocale;
_context.next = 6; _context.next = 6;
return importLocale(); return regeneratorRuntime.awrap(importLocale());
case 6: case 6:
strings = _context.sent; strings = _context.sent;
@ -413,15 +374,8 @@ var svgEditorExtension_shapes = (function () {
return _context.stop(); return _context.stop();
} }
} }
}, _callee, this); }, null, this);
}));
function init(_x) {
return _init.apply(this, arguments);
} }
return init;
}()
}; };
return extShapes; return extShapes;

View File

@ -1,42 +1,6 @@
var svgEditorExtension_star = (function () { var svgEditorExtension_star = (function () {
'use strict'; 'use strict';
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
/** /**
* ext-star.js * ext-star.js
* *
@ -46,12 +10,9 @@ var svgEditorExtension_star = (function () {
*/ */
var extStar = { var extStar = {
name: 'star', name: 'star',
init: function () { init: function init(S) {
var _init = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(S) {
var svgEditor, svgCanvas, $, importLocale, selElems, started, newFO, strings, showPanel, setAttr, buttons, contextTools; var svgEditor, svgCanvas, $, importLocale, selElems, started, newFO, strings, showPanel, setAttr, buttons, contextTools;
return regeneratorRuntime.wrap(function _callee$(_context) { return regeneratorRuntime.async(function init$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
@ -76,7 +37,7 @@ var svgEditorExtension_star = (function () {
$ = S.$, importLocale = S.importLocale; // {svgcontent}, $ = S.$, importLocale = S.importLocale; // {svgcontent},
_context.next = 7; _context.next = 7;
return importLocale(); return regeneratorRuntime.awrap(importLocale());
case 7: case 7:
strings = _context.sent; strings = _context.sent;
@ -284,15 +245,8 @@ var svgEditorExtension_star = (function () {
return _context.stop(); return _context.stop();
} }
} }
}, _callee, this); }, null, this);
}));
function init(_x) {
return _init.apply(this, arguments);
} }
return init;
}()
}; };
return extStar; return extStar;

View File

@ -1,42 +1,6 @@
var svgEditorExtension_storage = (function () { var svgEditorExtension_storage = (function () {
'use strict'; 'use strict';
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
function _inherits(subClass, superClass) { function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) { if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function"); throw new TypeError("Super expression must either be null or a function");
@ -415,20 +379,17 @@ var svgEditorExtension_storage = (function () {
var loaded = false; var loaded = false;
return { return {
name: 'storage', name: 'storage',
langReady: function () { langReady: function langReady(_ref4) {
var _langReady = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(_ref4) {
var importLocale, _$$deparam$querystrin, storagePrompt, confirmSetStorage, message, storagePrefsAndContent, storagePrefsOnly, storagePrefs, storageNoPrefsOrContent, storageNoPrefs, rememberLabel, rememberTooltip, options, oldContainerWidth, oldContainerMarginLeft, oldContentHeight, oldContainerHeight, _ref5, pref, checked; var importLocale, _$$deparam$querystrin, storagePrompt, confirmSetStorage, message, storagePrefsAndContent, storagePrefsOnly, storagePrefs, storageNoPrefsOrContent, storageNoPrefs, rememberLabel, rememberTooltip, options, oldContainerWidth, oldContainerMarginLeft, oldContentHeight, oldContainerHeight, _ref5, pref, checked;
return regeneratorRuntime.wrap(function _callee$(_context) { return regeneratorRuntime.async(function langReady$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
importLocale = _ref4.importLocale; importLocale = _ref4.importLocale;
_$$deparam$querystrin = $.deparam.querystring(true), storagePrompt = _$$deparam$querystrin.storagePrompt; _$$deparam$querystrin = $.deparam.querystring(true), storagePrompt = _$$deparam$querystrin.storagePrompt;
_context.next = 4; _context.next = 4;
return importLocale(); return regeneratorRuntime.awrap(importLocale());
case 4: case 4:
confirmSetStorage = _context.sent; confirmSetStorage = _context.sent;
@ -495,11 +456,11 @@ var svgEditorExtension_storage = (function () {
svgEditor.storagePromptState = 'waiting'; svgEditor.storagePromptState = 'waiting';
_context.next = 20; _context.next = 20;
return $.select(message, options, null, null, { return regeneratorRuntime.awrap($.select(message, options, null, null, {
label: rememberLabel, label: rememberLabel,
checked: true, checked: true,
tooltip: rememberTooltip tooltip: rememberTooltip
}); }));
case 20: case 20:
_ref5 = _context.sent; _ref5 = _context.sent;
@ -584,15 +545,8 @@ var svgEditorExtension_storage = (function () {
return _context.stop(); return _context.stop();
} }
} }
}, _callee); });
}));
function langReady(_x) {
return _langReady.apply(this, arguments);
} }
return langReady;
}()
}; };
} }
}; };

View File

@ -1,42 +1,6 @@
var svgEditorExtension_webappfind = (function () { var svgEditorExtension_webappfind = (function () {
'use strict'; 'use strict';
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
/** /**
* Depends on Firefox add-on and executables from {@link https://github.com/brettz9/webappfind} * Depends on Firefox add-on and executables from {@link https://github.com/brettz9/webappfind}
* @author Brett Zamir * @author Brett Zamir
@ -45,18 +9,15 @@ var svgEditorExtension_webappfind = (function () {
*/ */
var extWebappfind = { var extWebappfind = {
name: 'webappfind', name: 'webappfind',
init: function () { init: function init(_ref) {
var _init = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(_ref) {
var importLocale, $, strings, svgEditor, saveMessage, readMessage, excludedMessages, pathID, buttons; var importLocale, $, strings, svgEditor, saveMessage, readMessage, excludedMessages, pathID, buttons;
return regeneratorRuntime.wrap(function _callee$(_context) { return regeneratorRuntime.async(function init$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
importLocale = _ref.importLocale, $ = _ref.$; importLocale = _ref.importLocale, $ = _ref.$;
_context.next = 3; _context.next = 3;
return importLocale(); return regeneratorRuntime.awrap(importLocale());
case 3: case 3:
strings = _context.sent; strings = _context.sent;
@ -163,15 +124,8 @@ var svgEditorExtension_webappfind = (function () {
return _context.stop(); return _context.stop();
} }
} }
}, _callee, this); }, null, this);
}));
function init(_x) {
return _init.apply(this, arguments);
} }
return init;
}()
}; };
return extWebappfind; return extWebappfind;

View File

@ -15,42 +15,6 @@
return _typeof(obj); return _typeof(obj);
} }
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
function _classCallCheck(instance, Constructor) { function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) { if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function"); throw new TypeError("Cannot call a class as a function");
@ -303,20 +267,35 @@
return obj; return obj;
} }
function _objectSpread(target) { function ownKeys(object, enumerableOnly) {
for (var i = 1; i < arguments.length; i++) { var keys = Object.keys(object);
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === 'function') { if (Object.getOwnPropertySymbols) {
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { var symbols = Object.getOwnPropertySymbols(object);
return Object.getOwnPropertyDescriptor(source, sym).enumerable; if (enumerableOnly) symbols = symbols.filter(function (sym) {
})); return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
} }
ownKeys.forEach(function (key) { return keys;
}
function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(source, true).forEach(function (key) {
_defineProperty(target, key, source[key]); _defineProperty(target, key, source[key]);
}); });
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(source).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
} }
return target; return target;
@ -494,6 +473,10 @@
} }
function _iterableToArrayLimit$1(arr, i) { function _iterableToArrayLimit$1(arr, i) {
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
return;
}
var _arr = []; var _arr = [];
var _n = true; var _n = true;
var _d = false; var _d = false;
@ -683,7 +666,7 @@
* @static * @static
* @param {Element} el DOM element to which to attach the event * @param {Element} el DOM element to which to attach the event
* @param {string} type The DOM event (without 'on') to attach to the element * @param {string} type The DOM event (without 'on') to attach to the element
* @param {Function} handler The event handler to attach to the element * @param {EventListener} handler The event handler to attach to the element
* @param {boolean} [capturing] Whether or not the event should be * @param {boolean} [capturing] Whether or not the event should be
* capturing (W3C-browsers only); default is false; NOT IN USE * capturing (W3C-browsers only); default is false; NOT IN USE
* @returns {void} * @returns {void}
@ -725,7 +708,7 @@
} // Todo: Make as public utility } // Todo: Make as public utility
/** /**
* @param {*} o * @param {any} o
* @returns {boolean} * @returns {boolean}
*/ */
@ -737,7 +720,7 @@
/** /**
* @private * @private
* @static * @static
* @param {string|object|Array|Element|DocumentFragment} item * @param {string|JamilihAttributes|JamilihArray|Element|DocumentFragment} item
* @returns {"string"|"null"|"array"|"element"|"fragment"|"object"} * @returns {"string"|"null"|"array"|"element"|"fragment"|"object"}
*/ */
@ -833,7 +816,7 @@
return jml(arg); return jml(arg);
} }
/** /**
* @typedef {Array} AttributeArray * @typedef {JamilihAttributes} AttributeArray
* @property {string} 0 The key * @property {string} 0 The key
* @property {string} 1 The value * @property {string} 1 The value
*/ */
@ -932,12 +915,16 @@
* @typedef {Element|DocumentFragment} JamilihReturn * @typedef {Element|DocumentFragment} JamilihReturn
*/ */
/**
* @typedef {PlainObject} JamilihAttributes
*/
/** /**
* @typedef {GenericArray} JamilihArray * @typedef {GenericArray} JamilihArray
* @property {string} 0 The element to create (by lower-case name) * @property {string} 0 The element to create (by lower-case name)
* @property {Object} [1] Attributes to add with the key as the attribute name * @property {JamilihAttributes} [1] Attributes to add with the key as the
* and value as the attribute value; important for IE where the input * attribute name and value as the attribute value; important for IE where
* element's type cannot be added later after already added to the page * the input element's type cannot be added later after already added to the page
* @param {Element[]} [children] The optional children of this element * @param {Element[]} [children] The optional children of this element
* (but raw DOM elements required to be specified within arrays since * (but raw DOM elements required to be specified within arrays since
* could not otherwise be distinguished from siblings being added) * could not otherwise be distinguished from siblings being added)
@ -1569,8 +1556,6 @@
obj = dataVal[1] || defaultMap[1]; obj = dataVal[1] || defaultMap[1];
} // Map } // Map
/* eslint-disable-next-line unicorn/no-unsafe-regex */
} else if (/^\[object (?:Weak)?Map\]$/.test([].toString.call(dataVal))) { } else if (/^\[object (?:Weak)?Map\]$/.test([].toString.call(dataVal))) {
map = dataVal; map = dataVal;
obj = defaultMap[1]; // Non-map data object obj = defaultMap[1]; // Non-map data object
@ -1823,11 +1808,11 @@
/** /**
* Converts a DOM object or a string of HTML into a Jamilih object (or string). * Converts a DOM object or a string of HTML into a Jamilih object (or string).
* @param {string|HTMLElement} [dom=document.documentElement] Defaults to converting the current document. * @param {string|HTMLElement} [dom=document.documentElement] Defaults to converting the current document.
* @param {object} [config={stringOutput:false}] Configuration object * @param {PlainObject} [config] Configuration object
* @param {boolean} [config.stringOutput=false] Whether to output the Jamilih object as a string. * @param {boolean} [config.stringOutput=false] Whether to output the Jamilih object as a string.
* @returns {Array|string} Array containing the elements which represent a Jamilih object, or, * @returns {JamilihArray|string} Array containing the elements which represent
if `stringOutput` is true, it will be the stringified version of * a Jamilih object, or, if `stringOutput` is true, it will be the stringified
such an object * version of such an object
*/ */
@ -1890,7 +1875,7 @@
} }
/** /**
* *
* @param {*} val * @param {any} val
* @returns {void} * @returns {void}
*/ */
@ -1942,7 +1927,7 @@
} }
*/ */
var type = 'nodeType' in node ? node.nodeType : null; var type = 'nodeType' in node ? node.nodeType : null;
namespaces = _objectSpread({}, namespaces); namespaces = _objectSpread2({}, namespaces);
var xmlChars = /([\t\n\r -\uD7FF\uE000-\uFFFD]|(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF]))(?:(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))*$/; // eslint-disable-line no-control-regex var xmlChars = /([\t\n\r -\uD7FF\uE000-\uFFFD]|(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF]))(?:(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))*$/; // eslint-disable-line no-control-regex
if ([2, 3, 4, 7, 8].includes(type) && !xmlChars.test(node.nodeValue)) { if ([2, 3, 4, 7, 8].includes(type) && !xmlChars.test(node.nodeValue)) {
@ -2018,7 +2003,7 @@
break; break;
} }
case undefined: // Treat as attribute node until this is fixed: https://github.com/tmpvar/jsdom/issues/1641 / https://github.com/tmpvar/jsdom/pull/1822 case undefined: // Treat as attribute node until this is fixed: https://github.com/jsdom/jsdom/issues/1641 / https://github.com/jsdom/jsdom/pull/1822
case 2: case 2:
// ATTRIBUTE (should only get here if passing in an attribute node) // ATTRIBUTE (should only get here if passing in an attribute node)
@ -3235,21 +3220,14 @@
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
function processResults(_x) { function processResults(url) {
return _processResults.apply(this, arguments);
}
function _processResults() {
_processResults = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee3(url) {
var queryLink, r, json, payload, _json$info, numResults, pages, currentPage, semiColonSep; var queryLink, r, json, payload, _json$info, numResults, pages, currentPage, semiColonSep;
return regeneratorRuntime.wrap(function _callee3$(_context3) { return regeneratorRuntime.async(function processResults$(_context2) {
while (1) { while (1) {
switch (_context3.prev = _context3.next) { switch (_context2.prev = _context2.next) {
case 0: case 0:
queryLink = function _ref4(query) { queryLink = function _ref2(query) {
return ['a', { return ['a', {
href: jsVoid, href: jsVoid,
dataset: { dataset: {
@ -3266,26 +3244,26 @@
}, [query]]; }, [query]];
}; };
_context3.next = 3; _context2.next = 3;
return fetch(url); return regeneratorRuntime.awrap(fetch(url));
case 3: case 3:
r = _context3.sent; r = _context2.sent;
_context3.next = 6; _context2.next = 6;
return r.json(); return regeneratorRuntime.awrap(r.json());
case 6: case 6:
json = _context3.sent; json = _context2.sent;
if (!(!json || json.msg !== 'success')) { if (!(!json || json.msg !== 'success')) {
_context3.next = 10; _context2.next = 10;
break; break;
} }
// Todo: This could use a generic alert library instead // Todo: This could use a generic alert library instead
alert('There was a problem downloading the results'); // eslint-disable-line no-alert alert('There was a problem downloading the results'); // eslint-disable-line no-alert
return _context3.abrupt("return"); return _context2.abrupt("return");
case 10: case 10:
payload = json.payload, _json$info = json.info, numResults = _json$info.results, pages = _json$info.pages, currentPage = _json$info.current_page; // $('#page')[0].value = currentPage; payload = json.payload, _json$info = json.info, numResults = _json$info.results, pages = _json$info.pages, currentPage = _json$info.current_page; // $('#page')[0].value = currentPage;
@ -3300,17 +3278,17 @@
// - `svg`'s: `png_thumb`, `png_full_lossy`, `png_2400px` // - `svg`'s: `png_thumb`, `png_full_lossy`, `png_2400px`
semiColonSep = '; ' + nbsp; semiColonSep = '; ' + nbsp;
$$1('#results').jml('div', [['span', ['Number of results: ', numResults]], semiColonSep, ['span', ['page ', currentPage, ' out of ', pages]]].concat(_toConsumableArray(payload.map(function (_ref3) { $$1('#results').jml('div', [['span', ['Number of results: ', numResults]], semiColonSep, ['span', ['page ', currentPage, ' out of ', pages]]].concat(_toConsumableArray(payload.map(function (_ref) {
var title = _ref3.title, var title = _ref.title,
description = _ref3.description, description = _ref.description,
id = _ref3.id, id = _ref.id,
uploader = _ref3.uploader, uploader = _ref.uploader,
created = _ref3.created, created = _ref.created,
svgURL = _ref3.svg.url, svgURL = _ref.svg.url,
detailLink = _ref3.detail_link, detailLink = _ref.detail_link,
tagsArray = _ref3.tags_array, tagsArray = _ref.tags_array,
downloadedBy = _ref3.downloaded_by, downloadedBy = _ref.downloaded_by,
totalFavorites = _ref3.total_favorites; totalFavorites = _ref.total_favorites;
var imgHW = '100px'; var imgHW = '100px';
var colonSep = ': ' + nbsp; var colonSep = ': ' + nbsp;
return ['div', [['button', { return ['div', [['button', {
@ -3320,14 +3298,11 @@
value: svgURL value: svgURL
}, },
$on: { $on: {
click: function () { click: function click(e) {
var _click = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee2(e) {
var svgurl, post, result, svg; var svgurl, post, result, svg;
return regeneratorRuntime.wrap(function _callee2$(_context2) { return regeneratorRuntime.async(function click$(_context) {
while (1) { while (1) {
switch (_context2.prev = _context2.next) { switch (_context.prev = _context.next) {
case 0: case 0:
e.preventDefault(); e.preventDefault();
svgurl = this.dataset.value; // console.log('this', id, svgurl); svgurl = this.dataset.value; // console.log('this', id, svgurl);
@ -3345,16 +3320,16 @@
name: title, name: title,
id: svgurl id: svgurl
}); });
_context2.next = 6; _context.next = 6;
return fetch(svgurl); return regeneratorRuntime.awrap(fetch(svgurl));
case 6: case 6:
result = _context2.sent; result = _context.sent;
_context2.next = 9; _context.next = 9;
return result.text(); return regeneratorRuntime.awrap(result.text());
case 9: case 9:
svg = _context2.sent; svg = _context.sent;
// console.log('url and svg', svgurl, svg); // console.log('url and svg', svgurl, svg);
post({ post({
href: svgurl, href: svgurl,
@ -3363,18 +3338,11 @@
case 11: case 11:
case "end": case "end":
return _context2.stop(); return _context.stop();
} }
} }
}, _callee2, this); }, null, this);
}));
function click(_x2) {
return _click.apply(this, arguments);
} }
return click;
}()
} }
}, [// If we wanted interactive versions despite security risk: }, [// If we wanted interactive versions despite security risk:
// ['object', {data: svgURL, type: 'image/svg+xml'}] // ['object', {data: svgURL, type: 'image/svg+xml'}]
@ -3440,25 +3408,20 @@
case 13: case 13:
case "end": case "end":
return _context3.stop(); return _context2.stop();
} }
} }
}, _callee3); });
}));
return _processResults.apply(this, arguments);
} }
jml('div', [['style', [".control {\n padding-top: 10px;\n }"]], ['form', { jml('div', [['style', [".control {\n padding-top: 10px;\n }"]], ['form', {
id: 'openclipart', id: 'openclipart',
$custom: { $custom: {
$submit: function () { $submit: function $submit() {
var _$submit = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee() {
var url; var url;
return regeneratorRuntime.wrap(function _callee$(_context) { return regeneratorRuntime.async(function $submit$(_context3) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context3.prev = _context3.next) {
case 0: case 0:
url = new URL(baseAPIURL); url = new URL(baseAPIURL);
['query', 'sort', 'amount', 'page', 'byids'].forEach(function (prop) { ['query', 'sort', 'amount', 'page', 'byids'].forEach(function (prop) {
@ -3468,23 +3431,16 @@
url.searchParams.set(prop, value); url.searchParams.set(prop, value);
} }
}); });
_context.next = 4; _context3.next = 4;
return processResults(url); return regeneratorRuntime.awrap(processResults(url));
case 4: case 4:
case "end": case "end":
return _context.stop(); return _context3.stop();
} }
} }
}, _callee); });
}));
function $submit() {
return _$submit.apply(this, arguments);
} }
return $submit;
}()
}, },
$on: { $on: {
submit: function submit(e) { submit: function submit(e) {
@ -3532,11 +3488,11 @@
}, [['label', ['Sort by: ', ['select', { }, [['label', ['Sort by: ', ['select', {
id: 'sort' id: 'sort'
}, [// Todo: i18nize first values }, [// Todo: i18nize first values
['Date', 'date'], ['Downloads', 'downloads'], ['Favorited', 'favorites']].map(function (_ref) { ['Date', 'date'], ['Downloads', 'downloads'], ['Favorited', 'favorites']].map(function (_ref3) {
var _ref2 = _slicedToArray(_ref, 2), var _ref4 = _slicedToArray(_ref3, 2),
text = _ref2[0], text = _ref4[0],
_ref2$ = _ref2[1], _ref4$ = _ref4[1],
value = _ref2$ === void 0 ? text : _ref2$; value = _ref4$ === void 0 ? text : _ref4$;
return ['option', { return ['option', {
value: value value: value

1225
dist/index-es.js vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1225
dist/index-umd.js vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

163
dist/svgcanvas-iife.js vendored
View File

@ -15,42 +15,6 @@ var SvgCanvas = (function () {
return _typeof(obj); return _typeof(obj);
} }
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
function _classCallCheck(instance, Constructor) { function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) { if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function"); throw new TypeError("Cannot call a class as a function");
@ -11449,24 +11413,9 @@ var SvgCanvas = (function () {
* any other value depends on the export of the targeted module. * any other value depends on the export of the targeted module.
*/ */
function importSetGlobal(_x, _x2) { function importSetGlobal(url, _ref) {
return _importSetGlobal.apply(this, arguments);
}
/**
*
* @author Brett Zamir (other items are from `dynamic-import-polyfill`)
* @param {string|string[]} url
* @param {PlainObject} [atts={}]
* @returns {Promise<void|Error>} Resolves to `undefined` or rejects with an `Error` upon a
* script loading error
*/
function _importSetGlobal() {
_importSetGlobal = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(url, _ref) {
var glob, returnDefault, modularVersion; var glob, returnDefault, modularVersion;
return regeneratorRuntime.wrap(function _callee$(_context) { return regeneratorRuntime.async(function importSetGlobal$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
@ -11485,7 +11434,7 @@ var SvgCanvas = (function () {
case 4: case 4:
_context.next = 6; _context.next = 6;
return importScript(url); return regeneratorRuntime.awrap(importScript(url));
case 6: case 6:
return _context.abrupt("return", window[glob]); return _context.abrupt("return", window[glob]);
@ -11495,10 +11444,16 @@ var SvgCanvas = (function () {
return _context.stop(); return _context.stop();
} }
} }
}, _callee); });
}));
return _importSetGlobal.apply(this, arguments);
} }
/**
*
* @author Brett Zamir (other items are from `dynamic-import-polyfill`)
* @param {string|string[]} url
* @param {PlainObject} [atts={}]
* @returns {Promise<void|Error>} Resolves to `undefined` or rejects with an `Error` upon a
* script loading error
*/
function importScript(url) { function importScript(url) {
var atts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var atts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@ -12351,16 +12306,16 @@ var SvgCanvas = (function () {
// } // }
var angle = getRotationAngle(child); var angle = getRotationAngle(child);
oldStartTransform = context_.getStartTransform(); oldStartTransform = context_.getStartTransform(); // const childxforms = [];
var childxforms = [];
context_.setStartTransform(child.getAttribute('transform')); context_.setStartTransform(child.getAttribute('transform'));
if (angle || hasMatrixTransform(childTlist)) { if (angle || hasMatrixTransform(childTlist)) {
var e2t = svgroot.createSVGTransform(); var e2t = svgroot.createSVGTransform();
e2t.setMatrix(matrixMultiply(tm, sm, tmn, _m)); e2t.setMatrix(matrixMultiply(tm, sm, tmn, _m));
childTlist.clear(); childTlist.clear();
childTlist.appendItem(e2t); childTlist.appendItem(e2t); // childxforms.push(e2t);
childxforms.push(e2t); // if not rotated or skewed, push the [T][S][-T] down to the child // if not rotated or skewed, push the [T][S][-T] down to the child
} else { } else {
// update the transform list with translate,scale,translate // update the transform list with translate,scale,translate
// slide the [T][S][-T] from the front to the back // slide the [T][S][-T] from the front to the back
@ -12384,10 +12339,10 @@ var SvgCanvas = (function () {
translateBack.setTranslate(t2.e, t2.f); translateBack.setTranslate(t2.e, t2.f);
childTlist.appendItem(translateBack); childTlist.appendItem(translateBack);
childTlist.appendItem(scale); childTlist.appendItem(scale);
childTlist.appendItem(translateOrigin); childTlist.appendItem(translateOrigin); // childxforms.push(translateBack);
childxforms.push(translateBack); // childxforms.push(scale);
childxforms.push(scale); // childxforms.push(translateOrigin);
childxforms.push(translateOrigin); // logMatrix(translateBack.matrix); // logMatrix(translateBack.matrix);
// logMatrix(scale.matrix); // logMatrix(scale.matrix);
} // not rotated } // not rotated
@ -14628,14 +14583,9 @@ var SvgCanvas = (function () {
*/ */
this.addExtension = this.addExtension = function _callee(name, extInitFunc, _ref3) {
/*#__PURE__*/
function () {
var _ref4 = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(name, extInitFunc, _ref3) {
var jq, importLocale, argObj, extObj; var jq, importLocale, argObj, extObj;
return regeneratorRuntime.wrap(function _callee$(_context) { return regeneratorRuntime.async(function _callee$(_context) {
while (1) { while (1) {
switch (_context.prev = _context.next) { switch (_context.prev = _context.next) {
case 0: case 0:
@ -14681,7 +14631,7 @@ var SvgCanvas = (function () {
selectorManager: selectorManager selectorManager: selectorManager
}); });
_context.next = 8; _context.next = 8;
return extInitFunc(argObj); return regeneratorRuntime.awrap(extInitFunc(argObj));
case 8: case 8:
extObj = _context.sent; extObj = _context.sent;
@ -14699,13 +14649,8 @@ var SvgCanvas = (function () {
return _context.stop(); return _context.stop();
} }
} }
}, _callee); });
}));
return function (_x, _x2, _x3) {
return _ref4.apply(this, arguments);
}; };
}();
/** /**
* This method sends back an array or a NodeList full of elements that * This method sends back an array or a NodeList full of elements that
* intersect the multi-select rubber-band-box on the currentLayer only. * intersect the multi-select rubber-band-box on the currentLayer only.
@ -17826,12 +17771,7 @@ var SvgCanvas = (function () {
* @returns {Promise<module:svgcanvas.ImageExportedResults>} Resolves to {@link module:svgcanvas.ImageExportedResults} * @returns {Promise<module:svgcanvas.ImageExportedResults>} Resolves to {@link module:svgcanvas.ImageExportedResults}
*/ */
this.rasterExport = this.rasterExport = function _callee2(imgType, quality, exportWindowName) {
/*#__PURE__*/
function () {
var _ref5 = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee2(imgType, quality, exportWindowName) {
var opts, var opts,
type, type,
mimeType, mimeType,
@ -17839,11 +17779,11 @@ var SvgCanvas = (function () {
issues, issues,
issueCodes, issueCodes,
svg, svg,
_ref6, _ref4,
c, c,
_args2 = arguments; _args2 = arguments;
return regeneratorRuntime.wrap(function _callee2$(_context2) { return regeneratorRuntime.async(function _callee2$(_context2) {
while (1) { while (1) {
switch (_context2.prev = _context2.next) { switch (_context2.prev = _context2.next) {
case 0: case 0:
@ -17859,13 +17799,13 @@ var SvgCanvas = (function () {
} }
_context2.next = 8; _context2.next = 8;
return importSetGlobal(curConfig.canvgPath + 'canvg.js', { return regeneratorRuntime.awrap(importSetGlobal(curConfig.canvgPath + 'canvg.js', {
global: 'canvg' global: 'canvg'
}); }));
case 8: case 8:
_ref6 = _context2.sent; _ref4 = _context2.sent;
canvg = _ref6.canvg; canvg = _ref4.canvg;
case 10: case 10:
if (!$$8('#export_canvas').length) { if (!$$8('#export_canvas').length) {
@ -17878,7 +17818,7 @@ var SvgCanvas = (function () {
c.width = canvas.contentW; c.width = canvas.contentW;
c.height = canvas.contentH; c.height = canvas.contentH;
_context2.next = 16; _context2.next = 16;
return canvg(c, svg); return regeneratorRuntime.awrap(canvg(c, svg));
case 16: case 16:
return _context2.abrupt("return", new Promise(function (resolve, reject) { return _context2.abrupt("return", new Promise(function (resolve, reject) {
@ -17928,13 +17868,8 @@ var SvgCanvas = (function () {
return _context2.stop(); return _context2.stop();
} }
} }
}, _callee2, this); }, null, this);
}));
return function (_x4, _x5, _x6) {
return _ref5.apply(this, arguments);
}; };
}();
/** /**
* @external jsPDF * @external jsPDF
*/ */
@ -17974,12 +17909,7 @@ var SvgCanvas = (function () {
*/ */
this.exportPDF = this.exportPDF = function _callee3(exportWindowName) {
/*#__PURE__*/
function () {
var _ref7 = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee3(exportWindowName) {
var outputType, var outputType,
modularVersion, modularVersion,
res, res,
@ -17994,7 +17924,7 @@ var SvgCanvas = (function () {
obj, obj,
_args3 = arguments; _args3 = arguments;
return regeneratorRuntime.wrap(function _callee3$(_context3) { return regeneratorRuntime.async(function _callee3$(_context3) {
while (1) { while (1) {
switch (_context3.prev = _context3.next) { switch (_context3.prev = _context3.next) {
case 0: case 0:
@ -18006,17 +17936,17 @@ var SvgCanvas = (function () {
} }
_context3.next = 4; _context3.next = 4;
return importScript([// We do not currently have these paths configurable as they are return regeneratorRuntime.awrap(importScript([// We do not currently have these paths configurable as they are
// currently global-only, so not Rolled-up // currently global-only, so not Rolled-up
'jspdf/underscore-min.js', 'jspdf/jspdf.min.js']); 'jspdf/underscore-min.js', 'jspdf/jspdf.min.js']));
case 4: case 4:
modularVersion = !('svgEditor' in window) || !window.svgEditor || window.svgEditor.modules !== false; // Todo: Switch to `import()` when widely supported and available (also allow customization of path) modularVersion = !('svgEditor' in window) || !window.svgEditor || window.svgEditor.modules !== false; // Todo: Switch to `import()` when widely supported and available (also allow customization of path)
_context3.next = 7; _context3.next = 7;
return importScript(curConfig.jspdfPath + 'jspdf.plugin.svgToPdf.js', { return regeneratorRuntime.awrap(importScript(curConfig.jspdfPath + 'jspdf.plugin.svgToPdf.js', {
type: modularVersion ? 'module' : 'text/javascript' type: modularVersion ? 'module' : 'text/javascript'
}); }));
case 7: case 7:
res = getResolution(); res = getResolution();
@ -18064,13 +17994,8 @@ var SvgCanvas = (function () {
return _context3.stop(); return _context3.stop();
} }
} }
}, _callee3, this); }, null, this);
}));
return function (_x7) {
return _ref7.apply(this, arguments);
}; };
}();
/** /**
* Returns the current drawing as raw SVG XML text. * Returns the current drawing as raw SVG XML text.
* @function module:svgcanvas.SvgCanvas#getSvgString * @function module:svgcanvas.SvgCanvas#getSvgString
@ -18798,10 +18723,10 @@ var SvgCanvas = (function () {
leaveContext: leaveContext, leaveContext: leaveContext,
setContext: setContext setContext: setContext
}; };
Object.entries(dr).forEach(function (_ref8) { Object.entries(dr).forEach(function (_ref5) {
var _ref9 = _slicedToArray(_ref8, 2), var _ref6 = _slicedToArray(_ref5, 2),
prop = _ref9[0], prop = _ref6[0],
propVal = _ref9[1]; propVal = _ref6[1];
canvas[prop] = propVal; canvas[prop] = propVal;
}); });

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -8,10 +8,9 @@
* *
* @module jQueryContextMenu * @module jQueryContextMenu
* @todo Update to latest version and adapt (and needs jQuery update as well): {@link https://github.com/swisnl/jQuery-contextMenu} * @todo Update to latest version and adapt (and needs jQuery update as well): {@link https://github.com/swisnl/jQuery-contextMenu}
* @version 1.01 * @version 1.0.1
* *
* @license * @license (GPL-2.0-or-later OR MIT)
* Terms of Use
* *
* This plugin is dual-licensed under the GNU General Public License * This plugin is dual-licensed under the GNU General Public License
* and the MIT License and is copyright A Beautiful Site, LLC. * and the MIT License and is copyright A Beautiful Site, LLC.

View File

@ -2,7 +2,7 @@
/** /**
* ext-mathjax.js * ext-mathjax.js
* *
* @license Apache * @license Apache-2.0
* *
* @copyright 2013 Jo Segaert * @copyright 2013 Jo Segaert
* *

File diff suppressed because it is too large Load Diff

38
package-lock.json generated
View File

@ -4011,9 +4011,9 @@
} }
}, },
"eslint-config-ash-nazg": { "eslint-config-ash-nazg": {
"version": "11.3.0", "version": "11.4.0",
"resolved": "https://registry.npmjs.org/eslint-config-ash-nazg/-/eslint-config-ash-nazg-11.3.0.tgz", "resolved": "https://registry.npmjs.org/eslint-config-ash-nazg/-/eslint-config-ash-nazg-11.4.0.tgz",
"integrity": "sha512-mQ6yQXBCxSy2nVk0LRNfyJWxUGMwXRhtOJyQJjF3lIHyjUdjYd2IMDpPBg7Ie/tftkkk6zEzQ+TBuUsHVHEtfg==", "integrity": "sha512-5HvR9GtShur4y1+QFzpF6v3aB4juRtAA8vi+cQA1gIPd6/rq3zSVwKgjefsU1DY3LttnE68DTLgfoYPnvDgPiA==",
"dev": true "dev": true
}, },
"eslint-config-standard": { "eslint-config-standard": {
@ -4229,17 +4229,27 @@
} }
}, },
"eslint-plugin-jsdoc": { "eslint-plugin-jsdoc": {
"version": "17.1.1", "version": "18.0.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-17.1.1.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-18.0.1.tgz",
"integrity": "sha512-astLOTsj87UIzvDyiuAKbkgQgtChutazTDVxdG254tAtcvIVlWnPmlN7/dLnMYld/aHBhB4SWiUalMuKwTaynQ==", "integrity": "sha512-ofNW3JmuZD9Gqn+qp/M6vPUfyaWHtfiNdmuoYmjyBcf5Xh2SMe1dnFa+gTGpfZLrjvBCdIbjxryRiF2QdqlQ0g==",
"dev": true, "dev": true,
"requires": { "requires": {
"comment-parser": "^0.7.0", "comment-parser": "^0.7.0",
"debug": "^4.1.1", "debug": "^4.1.1",
"jsdoctypeparser": "^5.1.1", "jsdoctypeparser": "^6.0.0",
"lodash": "^4.17.15", "lodash": "^4.17.15",
"object.entries-ponyfill": "^1.0.1", "object.entries-ponyfill": "^1.0.1",
"regextras": "^0.6.1" "regextras": "^0.6.1",
"semver": "^6.3.0",
"spdx-expression-parse": "^3.0.0"
},
"dependencies": {
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"dev": true
}
} }
}, },
"eslint-plugin-markdown": { "eslint-plugin-markdown": {
@ -5942,9 +5952,9 @@
} }
}, },
"jsdoctypeparser": { "jsdoctypeparser": {
"version": "5.1.1", "version": "6.0.0",
"resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-5.1.1.tgz", "resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-6.0.0.tgz",
"integrity": "sha512-APGygIJrT5bbz5lsVt8vyLJC0miEbQf/z9ZBfTr4RYvdia8AhWMRlYgivvwHG5zKD/VW3d6qpChCy64hpQET3A==", "integrity": "sha512-61VtBXLkHfOFSIdp/VDVNMksxK0ID0cPTNvxDR92tPA6K7r2AX0OcJegYxhJIwtpWKU4p3D9L3U02hhlP1kQLQ==",
"dev": true "dev": true
}, },
"jsdom": { "jsdom": {
@ -8042,9 +8052,9 @@
} }
}, },
"rollup": { "rollup": {
"version": "1.26.5", "version": "1.27.0",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-1.26.5.tgz", "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.27.0.tgz",
"integrity": "sha512-c6Pv0yWzjYNpy2DIhLFUnyP6e1UTGownr4IfpJcPY/k186RJjpaGGPRwKQ62KCauctG6dgtHt88pw1EGrPRkuA==", "integrity": "sha512-yaMna4MJ8LLEHhHl1ilgHakylf0LKeQctDxhngZLQ+W57GnXa5vtH7XKaK8zlAhNEhlWiH5YFVFt+QCDPUmNkw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/estree": "*", "@types/estree": "*",

View File

@ -88,14 +88,14 @@
"babel-plugin-transform-object-rest-spread": "^7.0.0-beta.3", "babel-plugin-transform-object-rest-spread": "^7.0.0-beta.3",
"core-js-bundle": "^3.4.1", "core-js-bundle": "^3.4.1",
"eslint": "6.6.0", "eslint": "6.6.0",
"eslint-config-ash-nazg": "11.3.0", "eslint-config-ash-nazg": "11.4.0",
"eslint-config-standard": "14.1.0", "eslint-config-standard": "14.1.0",
"eslint-plugin-array-func": "^3.1.3", "eslint-plugin-array-func": "^3.1.3",
"eslint-plugin-compat": "^3.3.0", "eslint-plugin-compat": "^3.3.0",
"eslint-plugin-eslint-comments": "^3.1.2", "eslint-plugin-eslint-comments": "^3.1.2",
"eslint-plugin-html": "^6.0.0", "eslint-plugin-html": "^6.0.0",
"eslint-plugin-import": "2.18.2", "eslint-plugin-import": "2.18.2",
"eslint-plugin-jsdoc": "^17.1.1", "eslint-plugin-jsdoc": "^18.0.1",
"eslint-plugin-markdown": "^1.0.1", "eslint-plugin-markdown": "^1.0.1",
"eslint-plugin-no-use-extend-native": "^0.4.1", "eslint-plugin-no-use-extend-native": "^0.4.1",
"eslint-plugin-node": "10.0.0", "eslint-plugin-node": "10.0.0",
@ -118,7 +118,7 @@
"regenerator-runtime": "^0.13.3", "regenerator-runtime": "^0.13.3",
"remark-cli": "^7.0.1", "remark-cli": "^7.0.1",
"remark-lint-ordered-list-marker-value": "^1.0.3", "remark-lint-ordered-list-marker-value": "^1.0.3",
"rollup": "1.26.5", "rollup": "1.27.0",
"rollup-plugin-babel": "^4.3.3", "rollup-plugin-babel": "^4.3.3",
"rollup-plugin-re": "^1.0.7", "rollup-plugin-re": "^1.0.7",
"rollup-plugin-terser": "^5.1.2", "rollup-plugin-terser": "^5.1.2",

File diff suppressed because it is too large Load Diff