- Linting (ESLint): Apply new rules ("fixme"->"todo"; prefer regex literals; defaults at end)

- Optimization: Image size
- npm: Bump devDeps (Babel/eslint/rollup-related; imageoptim, testcafe)
master
Brett Zamir 2019-09-20 12:40:31 +08:00
parent cdacae8be3
commit 404911827e
46 changed files with 1879 additions and 1547 deletions

12
dist/canvg.js vendored
View File

@ -243,6 +243,10 @@ var canvg = (function (exports) {
} }
function _iterableToArrayLimit(arr, i) { function _iterableToArrayLimit(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;
@ -278,7 +282,7 @@ var canvg = (function (exports) {
function _wrapRegExp(re, groups) { function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) { _wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups); return new BabelRegExp(re, undefined, groups);
}; };
var _RegExp = _wrapNativeSuper(RegExp); var _RegExp = _wrapNativeSuper(RegExp);
@ -287,10 +291,10 @@ var canvg = (function (exports) {
var _groups = new WeakMap(); var _groups = new WeakMap();
function BabelRegExp(re, groups) { function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re); var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups); _groups.set(_this, groups || _groups.get(re));
return _this; return _this;
} }

View File

@ -138,7 +138,7 @@ var svgEditorExtension_arrows = (function () {
function _wrapRegExp(re, groups) { function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) { _wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups); return new BabelRegExp(re, undefined, groups);
}; };
var _RegExp = _wrapNativeSuper(RegExp); var _RegExp = _wrapNativeSuper(RegExp);
@ -147,10 +147,10 @@ var svgEditorExtension_arrows = (function () {
var _groups = new WeakMap(); var _groups = new WeakMap();
function BabelRegExp(re, groups) { function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re); var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups); _groups.set(_this, groups || _groups.get(re));
return _this; return _this;
} }

View File

@ -46,6 +46,10 @@ var svgEditorExtension_helloworld = (function () {
} }
function _iterableToArrayLimit(arr, i) { function _iterableToArrayLimit(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;

View File

@ -18,17 +18,17 @@ var svgEditorExtensionLocale_imagelib_de = (function () {
name: 'IAN Symbol Libraries', name: 'IAN Symbol Libraries',
url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3', url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3',
description: 'Free library of illustrations' description: 'Free library of illustrations'
/* }
// See message in "en" locale for further details /*
, // See message in "en" locale for further details
{ ,
name: 'Openclipart', {
url: 'https://openclipart.org/svgedit', name: 'Openclipart',
description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' url: 'https://openclipart.org/svgedit',
} description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.'
*/ }
*/
}] ]
}; };
return de; return de;

View File

@ -17,23 +17,23 @@ var svgEditorExtensionLocale_imagelib_en = (function () {
}, { }, {
name: 'IAN Symbol Libraries', name: 'IAN Symbol Libraries',
url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3', url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3',
description: 'Free library of illustrations' // The site is no longer using our API, and they have added an description: 'Free library of illustrations'
// `X-Frame-Options` header which prevents our usage cross-origin: } // The site is no longer using our API, and they have added an
// Getting messages like this in console: // `X-Frame-Options` header which prevents our usage cross-origin:
// Refused to display 'https://openclipart.org/detail/307176/sign-bike' in a frame // Getting messages like this in console:
// because it set 'X-Frame-Options' to 'sameorigin'. // Refused to display 'https://openclipart.org/detail/307176/sign-bike' in a frame
// url: 'https://openclipart.org/svgedit', // because it set 'X-Frame-Options' to 'sameorigin'.
// However, they do have a custom API which we are using here: // url: 'https://openclipart.org/svgedit',
// However, they do have a custom API which we are using here:
/* /*
{ {
name: 'Openclipart', name: 'Openclipart',
url: '{path}imagelib/openclipart{modularVersion}.html', url: '{path}imagelib/openclipart{modularVersion}.html',
description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.'
} }
*/ */
]
}]
}; };
return en; return en;

View File

@ -18,17 +18,17 @@ var svgEditorExtensionLocale_imagelib_fr = (function () {
name: 'IAN Symbol Libraries', name: 'IAN Symbol Libraries',
url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3', url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3',
description: 'Free library of illustrations' description: 'Free library of illustrations'
/* }
// See message in "en" locale for further details /*
, // See message in "en" locale for further details
{ ,
name: 'Openclipart', {
url: 'https://openclipart.org/svgedit', name: 'Openclipart',
description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' url: 'https://openclipart.org/svgedit',
} description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.'
*/ }
*/
}] ]
}; };
return fr; return fr;

View File

@ -18,17 +18,17 @@ var svgEditorExtensionLocale_imagelib_pl = (function () {
name: 'IAN Symbol Libraries', name: 'IAN Symbol Libraries',
url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3', url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3',
description: 'Free library of illustrations' description: 'Free library of illustrations'
/* }
// See message in "en" locale for further details /*
, // See message in "en" locale for further details
{ ,
name: 'Openclipart', {
url: 'https://openclipart.org/svgedit', name: 'Openclipart',
description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' url: 'https://openclipart.org/svgedit',
} description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.'
*/ }
*/
}] ]
}; };
return pl; return pl;

View File

@ -18,17 +18,17 @@ var svgEditorExtensionLocale_imagelib_pt_BR = (function () {
name: 'IAN Symbol Libraries', name: 'IAN Symbol Libraries',
url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3', url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3',
description: 'Free library of illustrations' description: 'Free library of illustrations'
/* }
// See message in "en" locale for further details /*
, // See message in "en" locale for further details
{ ,
name: 'Openclipart', {
url: 'https://openclipart.org/svgedit', name: 'Openclipart',
description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' url: 'https://openclipart.org/svgedit',
} description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.'
*/ }
*/
}] ]
}; };
return ptBR; return ptBR;

View File

@ -18,17 +18,17 @@ var svgEditorExtensionLocale_imagelib_ro = (function () {
name: 'IAN Symbol Libraries', name: 'IAN Symbol Libraries',
url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3', url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3',
description: 'Free library of illustrations' description: 'Free library of illustrations'
/* }
// See message in "en" locale for further details /*
, // See message in "en" locale for further details
{ ,
name: 'Openclipart', {
url: 'https://openclipart.org/svgedit', name: 'Openclipart',
description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' url: 'https://openclipart.org/svgedit',
} description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.'
*/ }
*/
}] ]
}; };
return ro; return ro;

View File

@ -18,17 +18,17 @@ var svgEditorExtensionLocale_imagelib_sk = (function () {
name: 'IAN Symbol Libraries', name: 'IAN Symbol Libraries',
url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3', url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3',
description: 'Free library of illustrations' description: 'Free library of illustrations'
/* }
// See message in "en" locale for further details /*
, // See message in "en" locale for further details
{ ,
name: 'Openclipart', {
url: 'https://openclipart.org/svgedit', name: 'Openclipart',
description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' url: 'https://openclipart.org/svgedit',
} description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.'
*/ }
*/
}] ]
}; };
return sk; return sk;

View File

@ -18,17 +18,17 @@ var svgEditorExtensionLocale_imagelib_sl = (function () {
name: 'IAN Symbol Libraries', name: 'IAN Symbol Libraries',
url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3', url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3',
description: 'Free library of illustrations' description: 'Free library of illustrations'
/* }
// See message in "en" locale for further details /*
, // See message in "en" locale for further details
{ ,
name: 'Openclipart', {
url: 'https://openclipart.org/svgedit', name: 'Openclipart',
description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' url: 'https://openclipart.org/svgedit',
} description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.'
*/ }
*/
}] ]
}; };
return sl; return sl;

View File

@ -18,17 +18,17 @@ var svgEditorExtensionLocale_imagelib_zh_CN = (function () {
name: 'IAN Symbol Libraries', name: 'IAN Symbol Libraries',
url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3', url: 'https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3',
description: 'Free library of illustrations' description: 'Free library of illustrations'
/* }
// See message in "en" locale for further details /*
, // See message in "en" locale for further details
{ ,
name: 'Openclipart', {
url: 'https://openclipart.org/svgedit', name: 'Openclipart',
description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.' url: 'https://openclipart.org/svgedit',
} description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.'
*/ }
*/
}] ]
}; };
return zhCN; return zhCN;

View File

@ -138,7 +138,7 @@ var svgEditorExtension_markers = (function () {
function _wrapRegExp(re, groups) { function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) { _wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups); return new BabelRegExp(re, undefined, groups);
}; };
var _RegExp = _wrapNativeSuper(RegExp); var _RegExp = _wrapNativeSuper(RegExp);
@ -147,10 +147,10 @@ var svgEditorExtension_markers = (function () {
var _groups = new WeakMap(); var _groups = new WeakMap();
function BabelRegExp(re, groups) { function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re); var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups); _groups.set(_this, groups || _groups.get(re));
return _this; return _this;
} }

View File

@ -145,6 +145,10 @@ var svgEditorExtension_placemark = (function () {
} }
function _iterableToArrayLimit(arr, i) { function _iterableToArrayLimit(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;
@ -176,7 +180,7 @@ var svgEditorExtension_placemark = (function () {
function _wrapRegExp(re, groups) { function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) { _wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups); return new BabelRegExp(re, undefined, groups);
}; };
var _RegExp = _wrapNativeSuper(RegExp); var _RegExp = _wrapNativeSuper(RegExp);
@ -185,10 +189,10 @@ var svgEditorExtension_placemark = (function () {
var _groups = new WeakMap(); var _groups = new WeakMap();
function BabelRegExp(re, groups) { function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re); var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups); _groups.set(_this, groups || _groups.get(re));
return _this; return _this;
} }

View File

@ -243,6 +243,10 @@ var svgEditorExtension_server_moinsave = (function () {
} }
function _iterableToArrayLimit(arr, i) { function _iterableToArrayLimit(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;
@ -278,7 +282,7 @@ var svgEditorExtension_server_moinsave = (function () {
function _wrapRegExp(re, groups) { function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) { _wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups); return new BabelRegExp(re, undefined, groups);
}; };
var _RegExp = _wrapNativeSuper(RegExp); var _RegExp = _wrapNativeSuper(RegExp);
@ -287,10 +291,10 @@ var svgEditorExtension_server_moinsave = (function () {
var _groups = new WeakMap(); var _groups = new WeakMap();
function BabelRegExp(re, groups) { function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re); var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups); _groups.set(_this, groups || _groups.get(re));
return _this; return _this;
} }

View File

@ -243,6 +243,10 @@ var svgEditorExtension_server_opensave = (function () {
} }
function _iterableToArrayLimit(arr, i) { function _iterableToArrayLimit(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;
@ -278,7 +282,7 @@ var svgEditorExtension_server_opensave = (function () {
function _wrapRegExp(re, groups) { function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) { _wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups); return new BabelRegExp(re, undefined, groups);
}; };
var _RegExp = _wrapNativeSuper(RegExp); var _RegExp = _wrapNativeSuper(RegExp);
@ -287,10 +291,10 @@ var svgEditorExtension_server_opensave = (function () {
var _groups = new WeakMap(); var _groups = new WeakMap();
function BabelRegExp(re, groups) { function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re); var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups); _groups.set(_this, groups || _groups.get(re));
return _this; return _this;
} }

View File

@ -46,6 +46,10 @@ var svgEditorExtension_shapes = (function () {
} }
function _iterableToArrayLimit(arr, i) { function _iterableToArrayLimit(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;

View File

@ -145,6 +145,10 @@ var svgEditorExtension_storage = (function () {
} }
function _iterableToArrayLimit(arr, i) { function _iterableToArrayLimit(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;
@ -176,7 +180,7 @@ var svgEditorExtension_storage = (function () {
function _wrapRegExp(re, groups) { function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) { _wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups); return new BabelRegExp(re, undefined, groups);
}; };
var _RegExp = _wrapNativeSuper(RegExp); var _RegExp = _wrapNativeSuper(RegExp);
@ -185,10 +189,10 @@ var svgEditorExtension_storage = (function () {
var _groups = new WeakMap(); var _groups = new WeakMap();
function BabelRegExp(re, groups) { function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re); var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups); _groups.set(_this, groups || _groups.get(re));
return _this; return _this;
} }

View File

@ -87,8 +87,8 @@ var svgEditorExtension_webappfind = (function () {
if (origin !== location.origin || // We are only interested in a message sent as though within this URL by our browser add-on if (origin !== location.origin || // We are only interested in a message sent as though within this URL by our browser add-on
excludedMessages.includes(type) // Avoid our post below (other messages might be possible in the future which may also need to be excluded if your subsequent code makes assumptions on the type of message this is) excludedMessages.includes(type) // Avoid our post below (other messages might be possible in the future which may also need to be excluded if your subsequent code makes assumptions on the type of message this is)
) { ) {
return; return;
} }
} catch (err) { } catch (err) {
return; return;
} }

View File

@ -215,6 +215,10 @@
} }
function _iterableToArrayLimit(arr, i) { function _iterableToArrayLimit(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;

365
dist/index-es.js vendored
View File

@ -228,6 +228,10 @@ function _iterableToArray(iter) {
} }
function _iterableToArrayLimit(arr, i) { function _iterableToArrayLimit(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;
@ -263,7 +267,7 @@ function _nonIterableRest() {
function _wrapRegExp(re, groups) { function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) { _wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups); return new BabelRegExp(re, undefined, groups);
}; };
var _RegExp = _wrapNativeSuper(RegExp); var _RegExp = _wrapNativeSuper(RegExp);
@ -272,10 +276,10 @@ function _wrapRegExp(re, groups) {
var _groups = new WeakMap(); var _groups = new WeakMap();
function BabelRegExp(re, groups) { function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re); var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups); _groups.set(_this, groups || _groups.get(re));
return _this; return _this;
} }
@ -2736,7 +2740,7 @@ var getReverseNS = function getReverseNS() {
}, },
enumerable: true enumerable: true
}, },
// FIXME: The following are not implemented and simply return SVGPathElement.pathSegList. // TODO: The following are not implemented and simply return SVGPathElement.pathSegList.
normalizedPathSegList: { normalizedPathSegList: {
get: function get() { get: function get() {
return this.pathSegList; return this.pathSegList;
@ -4692,7 +4696,7 @@ function () {
}, { }, {
key: "addCommandToHistory", key: "addCommandToHistory",
value: function addCommandToHistory(cmd) { value: function addCommandToHistory(cmd) {
// FIXME: we MUST compress consecutive text changes to the same element // TODO: we MUST compress consecutive text changes to the same element
// (right now each keystroke is saved as a separate command that includes the // (right now each keystroke is saved as a separate command that includes the
// entire text contents of the text element) // entire text contents of the text element)
// TODO: consider limiting the history that we store here (need to do some slicing) // TODO: consider limiting the history that we store here (need to do some slicing)
@ -8381,7 +8385,7 @@ var walkTree = function walkTree(elem, cbFn) {
/** /**
* Walks the tree and executes the callback on each element in a depth-first fashion. * Walks the tree and executes the callback on each element in a depth-first fashion.
* @function module:utilities.walkTreePost * @function module:utilities.walkTreePost
* @todo FIXME: Shouldn't this be calling walkTreePost? * @todo Shouldn't this be calling walkTreePost?
* @param {Element} elem - DOM element to traverse * @param {Element} elem - DOM element to traverse
* @param {module:utilities.TreeWalker} cbFn - Callback function to run on each element * @param {module:utilities.TreeWalker} cbFn - Callback function to run on each element
* @returns {void} * @returns {void}
@ -9361,8 +9365,8 @@ var snapToGrid = function snapToGrid(value) {
*/ */
var regexEscape = function regexEscape(str) { var regexEscape = function regexEscape(str) {
// From: http://phpjs.org/functions // Originally from: http://phpjs.org/functions
return String(str).replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\-]', 'g'), '\\$&'); return String(str).replace(/[.\\+*?[^\]$(){}=!<>|:-]/g, '\\$&');
}; };
/** /**
* Prevents default browser click behaviour on the given element. * Prevents default browser click behaviour on the given element.
@ -11824,7 +11828,7 @@ var sanitizeSvg = function sanitizeSvg(node) {
} else { } else {
// remove all children from this node and insert them before this node // remove all children from this node and insert them before this node
// FIXME: in the case of animation elements this will hardly ever be correct // TODO: in the case of animation elements this will hardly ever be correct
var children = []; var children = [];
while (node.hasChildNodes()) { while (node.hasChildNodes()) {
@ -12504,7 +12508,7 @@ var recalculateDimensions = function recalculateDimensions(selected) {
if (Math.abs(a) > 1.0e-10) { if (Math.abs(a) > 1.0e-10) {
s = Math.sin(a) / (1 - Math.cos(a)); s = Math.sin(a) / (1 - Math.cos(a));
} else { } else {
// FIXME: This blows up if the angle is exactly 0! // TODO: This blows up if the angle is exactly 0!
s = 2 / a; s = 2 / a;
} }
@ -12865,7 +12869,7 @@ var recalculateDimensions = function recalculateDimensions(selected) {
} // else, it's a non-group } // else, it's a non-group
} else { } else {
// FIXME: box might be null for some elements (<metadata> etc), need to handle this // TODO: box might be null for some elements (<metadata> etc), need to handle this
var _box = getBBox(selected); // Paths (and possbly other shapes) will have no BBox while still in <defs>, var _box = getBBox(selected); // Paths (and possbly other shapes) will have no BBox while still in <defs>,
// but we still may need to recalculate them (see issue 595). // but we still may need to recalculate them (see issue 595).
// TODO: Figure out how to get BBox from these elements in case they // TODO: Figure out how to get BBox from these elements in case they
@ -12889,7 +12893,7 @@ var recalculateDimensions = function recalculateDimensions(selected) {
var _a = _angle * Math.PI / 180; var _a = _angle * Math.PI / 180;
var _s = Math.abs(_a) > 1.0e-10 ? Math.sin(_a) / (1 - Math.cos(_a)) // FIXME: This blows up if the angle is exactly 0! var _s = Math.abs(_a) > 1.0e-10 ? Math.sin(_a) / (1 - Math.cos(_a)) // TODO: This blows up if the angle is exactly 0!
: 2 / _a; : 2 / _a;
for (var _i2 = 0; _i2 < tlist.numberOfItems; ++_i2) { for (var _i2 = 0; _i2 < tlist.numberOfItems; ++_i2) {
@ -15608,19 +15612,38 @@ function SvgCanvas(container, config) {
if (!rightClick) { if (!rightClick) {
// insert a dummy transform so if the element(s) are moved it will have // insert a dummy transform so if the element(s) are moved it will have
// a transform to use for its translate // a transform to use for its translate
for (var _i2 = 0, _selectedElements = selectedElements; _i2 < _selectedElements.length; _i2++) { var _iteratorNormalCompletion = true;
var selectedElement = _selectedElements[_i2]; var _didIteratorError = false;
var _iteratorError = undefined;
if (isNullish(selectedElement)) { try {
continue; for (var _iterator = selectedElements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var selectedElement = _step.value;
if (isNullish(selectedElement)) {
continue;
}
var slist = getTransformList(selectedElement);
if (slist.numberOfItems) {
slist.insertItemBefore(svgroot.createSVGTransform(), 0);
} else {
slist.appendItem(svgroot.createSVGTransform());
}
} }
} catch (err) {
var slist = getTransformList(selectedElement); _didIteratorError = true;
_iteratorError = err;
if (slist.numberOfItems) { } finally {
slist.insertItemBefore(svgroot.createSVGTransform(), 0); try {
} else { if (!_iteratorNormalCompletion && _iterator["return"] != null) {
slist.appendItem(svgroot.createSVGTransform()); _iterator["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
} }
} }
} }
@ -15784,7 +15807,7 @@ function SvgCanvas(container, config) {
break; break;
} }
case 'square': // FIXME: once we create the rect, we lose information that this was a square case 'square': // TODO: once we create the rect, we lose information that this was a square
// (for resizing purposes this could be important) // (for resizing purposes this could be important)
// Fallthrough // Fallthrough
@ -17726,11 +17749,11 @@ function SvgCanvas(container, config) {
} }
}); });
}); });
var _i3 = attrs.length; var _i2 = attrs.length;
var attrNames = ['width', 'height', 'xmlns', 'x', 'y', 'viewBox', 'id', 'overflow']; var attrNames = ['width', 'height', 'xmlns', 'x', 'y', 'viewBox', 'id', 'overflow'];
while (_i3--) { while (_i2--) {
var attr = attrs[_i3]; var attr = attrs[_i2];
var attrVal = toXml(attr.value); // Namespaces have already been dealt with, so skip var attrVal = toXml(attr.value); // Namespaces have already been dealt with, so skip
if (attr.nodeName.startsWith('xmlns:')) { if (attr.nodeName.startsWith('xmlns:')) {
@ -17756,8 +17779,8 @@ function SvgCanvas(container, config) {
var mozAttrs = ['-moz-math-font-style', '_moz-math-font-style']; var mozAttrs = ['-moz-math-font-style', '_moz-math-font-style'];
for (var _i4 = attrs.length - 1; _i4 >= 0; _i4--) { for (var _i3 = attrs.length - 1; _i3 >= 0; _i3--) {
var _attr = attrs[_i4]; var _attr = attrs[_i3];
var _attrVal = toXml(_attr.value); // remove bogus attributes added by Gecko var _attrVal = toXml(_attr.value); // remove bogus attributes added by Gecko
@ -17813,14 +17836,14 @@ function SvgCanvas(container, config) {
indent++; indent++;
var bOneLine = false; var bOneLine = false;
for (var _i5 = 0; _i5 < childs.length; _i5++) { for (var _i4 = 0; _i4 < childs.length; _i4++) {
var child = childs.item(_i5); var child = childs.item(_i4);
switch (child.nodeType) { switch (child.nodeType) {
case 1: case 1:
// element node // element node
out.push('\n'); out.push('\n');
out.push(this.svgToString(childs.item(_i5), indent)); out.push(this.svgToString(childs.item(_i4), indent));
break; break;
case 3: case 3:
@ -17862,7 +17885,7 @@ function SvgCanvas(container, config) {
if (!bOneLine) { if (!bOneLine) {
out.push('\n'); out.push('\n');
for (var _i6 = 0; _i6 < indent; _i6++) { for (var _i5 = 0; _i5 < indent; _i5++) {
out.push(' '); out.push(' ');
} }
} }
@ -18938,27 +18961,27 @@ function SvgCanvas(container, config) {
} }
var attrs = svg.attributes; var attrs = svg.attributes;
var _iteratorNormalCompletion = true; var _iteratorNormalCompletion2 = true;
var _didIteratorError = false; var _didIteratorError2 = false;
var _iteratorError = undefined; var _iteratorError2 = undefined;
try { try {
for (var _iterator = attrs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { for (var _iterator2 = attrs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var attr = _step.value; var attr = _step2.value;
// Ok for `NamedNodeMap` // Ok for `NamedNodeMap`
symbol.setAttribute(attr.nodeName, attr.value); symbol.setAttribute(attr.nodeName, attr.value);
} }
} catch (err) { } catch (err) {
_didIteratorError = true; _didIteratorError2 = true;
_iteratorError = err; _iteratorError2 = err;
} finally { } finally {
try { try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) { if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator["return"](); _iterator2["return"]();
} }
} finally { } finally {
if (_didIteratorError) { if (_didIteratorError2) {
throw _iteratorError; throw _iteratorError2;
} }
} }
} }
@ -19183,29 +19206,29 @@ function SvgCanvas(container, config) {
elem = $$9(elem).data('gsvg') || $$9(elem).data('symbol') || elem; elem = $$9(elem).data('gsvg') || $$9(elem).data('symbol') || elem;
var childs = elem.childNodes; var childs = elem.childNodes;
var _iteratorNormalCompletion2 = true; var _iteratorNormalCompletion3 = true;
var _didIteratorError2 = false; var _didIteratorError3 = false;
var _iteratorError2 = undefined; var _iteratorError3 = undefined;
try { try {
for (var _iterator2 = childs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
var child = _step2.value; var child = _step3.value;
if (child.nodeName === 'title') { if (child.nodeName === 'title') {
return child.textContent; return child.textContent;
} }
} }
} catch (err) { } catch (err) {
_didIteratorError2 = true; _didIteratorError3 = true;
_iteratorError2 = err; _iteratorError3 = err;
} finally { } finally {
try { try {
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) { if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) {
_iterator2["return"](); _iterator3["return"]();
} }
} finally { } finally {
if (_didIteratorError2) { if (_didIteratorError3) {
throw _iteratorError2; throw _iteratorError3;
} }
} }
} }
@ -19273,13 +19296,13 @@ function SvgCanvas(container, config) {
var docTitle = false, var docTitle = false,
oldTitle = ''; oldTitle = '';
var batchCmd = new BatchCommand$1('Change Image Title'); var batchCmd = new BatchCommand$1('Change Image Title');
var _iteratorNormalCompletion3 = true; var _iteratorNormalCompletion4 = true;
var _didIteratorError3 = false; var _didIteratorError4 = false;
var _iteratorError3 = undefined; var _iteratorError4 = undefined;
try { try {
for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { for (var _iterator4 = childs[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
var child = _step3.value; var child = _step4.value;
if (child.nodeName === 'title') { if (child.nodeName === 'title') {
docTitle = child; docTitle = child;
@ -19288,16 +19311,16 @@ function SvgCanvas(container, config) {
} }
} }
} catch (err) { } catch (err) {
_didIteratorError3 = true; _didIteratorError4 = true;
_iteratorError3 = err; _iteratorError4 = err;
} finally { } finally {
try { try {
if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) { if (!_iteratorNormalCompletion4 && _iterator4["return"] != null) {
_iterator3["return"](); _iterator4["return"]();
} }
} finally { } finally {
if (_didIteratorError3) { if (_didIteratorError4) {
throw _iteratorError3; throw _iteratorError4;
} }
} }
} }
@ -20606,7 +20629,7 @@ function SvgCanvas(container, config) {
canvas.moveSelectedElements(diffX * currentZoom, diffY * currentZoom, true); canvas.moveSelectedElements(diffX * currentZoom, diffY * currentZoom, true);
return "continue"; return "continue";
} // only allow the transform/opacity/filter attribute to change on <g> elements, slightly hacky } // only allow the transform/opacity/filter attribute to change on <g> elements, slightly hacky
// TODO: FIXME: Missing statement body // TODO: Missing statement body
// if (elem.tagName === 'g' && goodGAttrs.includes(attr)) {} // if (elem.tagName === 'g' && goodGAttrs.includes(attr)) {}
@ -21285,9 +21308,9 @@ function SvgCanvas(container, config) {
this.moveToTopSelectedElement = function () { this.moveToTopSelectedElement = function () {
var _selectedElements2 = selectedElements, var _selectedElements = selectedElements,
_selectedElements3 = _slicedToArray(_selectedElements2, 1), _selectedElements2 = _slicedToArray(_selectedElements, 1),
selected = _selectedElements3[0]; selected = _selectedElements2[0];
if (!isNullish(selected)) { if (!isNullish(selected)) {
var t = selected; var t = selected;
@ -21312,9 +21335,9 @@ function SvgCanvas(container, config) {
this.moveToBottomSelectedElement = function () { this.moveToBottomSelectedElement = function () {
var _selectedElements4 = selectedElements, var _selectedElements3 = selectedElements,
_selectedElements5 = _slicedToArray(_selectedElements4, 1), _selectedElements4 = _slicedToArray(_selectedElements3, 1),
selected = _selectedElements5[0]; selected = _selectedElements4[0];
if (!isNullish(selected)) { if (!isNullish(selected)) {
var t = selected; var t = selected;
@ -21622,45 +21645,45 @@ function SvgCanvas(container, config) {
var dx = new Array(len); var dx = new Array(len);
var dy = new Array(len); var dy = new Array(len);
for (var _i7 = 0; _i7 < len; ++_i7) { for (var _i6 = 0; _i6 < len; ++_i6) {
if (isNullish(selectedElements[_i7])) { if (isNullish(selectedElements[_i6])) {
break; break;
} // const elem = selectedElements[i]; } // const elem = selectedElements[i];
var bbox = bboxes[_i7]; var bbox = bboxes[_i6];
dx[_i7] = 0; dx[_i6] = 0;
dy[_i7] = 0; dy[_i6] = 0;
switch (type) { switch (type) {
case 'l': case 'l':
// left (horizontal) // left (horizontal)
dx[_i7] = minx - bbox.x; dx[_i6] = minx - bbox.x;
break; break;
case 'c': case 'c':
// center (horizontal) // center (horizontal)
dx[_i7] = (minx + maxx) / 2 - (bbox.x + bbox.width / 2); dx[_i6] = (minx + maxx) / 2 - (bbox.x + bbox.width / 2);
break; break;
case 'r': case 'r':
// right (horizontal) // right (horizontal)
dx[_i7] = maxx - (bbox.x + bbox.width); dx[_i6] = maxx - (bbox.x + bbox.width);
break; break;
case 't': case 't':
// top (vertical) // top (vertical)
dy[_i7] = miny - bbox.y; dy[_i6] = miny - bbox.y;
break; break;
case 'm': case 'm':
// middle (vertical) // middle (vertical)
dy[_i7] = (miny + maxy) / 2 - (bbox.y + bbox.height / 2); dy[_i6] = (miny + maxy) / 2 - (bbox.y + bbox.height / 2);
break; break;
case 'b': case 'b':
// bottom (vertical) // bottom (vertical)
dy[_i7] = maxy - (bbox.y + bbox.height); dy[_i6] = maxy - (bbox.y + bbox.height);
break; break;
} }
} }
@ -22826,14 +22849,14 @@ function jQueryPluginSVGIcons($) {
/** /**
* *
* @param {boolean} [toImage] * @param {boolean} [toImage]
* @param {external:jQuery.svgIcons.Fallback} [fallback] * @param {external:jQuery.svgIcons.Fallback} [fallback=false]
* @returns {void} * @returns {void}
*/ */
function makeIcons() { function makeIcons() {
var toImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var toImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
var fallback = arguments.length > 1 ? arguments[1] : undefined; var fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
if (iconsMade) return; if (iconsMade) return;
if (opts.no_img) toImage = false; if (opts.no_img) toImage = false;
var tempHolder; var tempHolder;
@ -30168,90 +30191,90 @@ editor.init = function () {
}, },
'div#workarea': { 'div#workarea': {
left: 38, left: 38,
top: 74 // '#tools_bottom': { top: 74
// left: {s: '27px', l: '46px', xl: '65px'}, } // '#tools_bottom': {
// height: {s: '58px', l: '98px', xl: '145px'} // left: {s: '27px', l: '46px', xl: '65px'},
// }, // height: {s: '58px', l: '98px', xl: '145px'}
// '#color_tools': { // },
// 'border-spacing': {s: '0 1px'}, // '#color_tools': {
// 'margin-top': {s: '-1px'} // 'border-spacing': {s: '0 1px'},
// }, // 'margin-top': {s: '-1px'}
// '#color_tools .icon_label': { // },
// width: {l:'43px', xl: '60px'} // '#color_tools .icon_label': {
// }, // width: {l:'43px', xl: '60px'}
// '.color_tool': { // },
// height: {s: '20px'} // '.color_tool': {
// }, // height: {s: '20px'}
// '#tool_opacity': { // },
// top: {s: '1px'}, // '#tool_opacity': {
// height: {s: 'auto', l:'auto', xl:'auto'} // top: {s: '1px'},
// }, // height: {s: 'auto', l:'auto', xl:'auto'}
// '#tools_top input, #tools_bottom input': { // },
// 'margin-top': {s: '2px', l: '4px', xl: '5px'}, // '#tools_top input, #tools_bottom input': {
// height: {s: 'auto', l: 'auto', xl: 'auto'}, // 'margin-top': {s: '2px', l: '4px', xl: '5px'},
// border: {s: '1px solid #555', l: 'auto', xl: 'auto'}, // height: {s: 'auto', l: 'auto', xl: 'auto'},
// 'font-size': {s: '.9em', l: '1.2em', xl: '1.4em'} // border: {s: '1px solid #555', l: 'auto', xl: 'auto'},
// }, // 'font-size': {s: '.9em', l: '1.2em', xl: '1.4em'}
// '#zoom_panel': { // },
// 'margin-top': {s: '3px', l: '4px', xl: '5px'} // '#zoom_panel': {
// }, // 'margin-top': {s: '3px', l: '4px', xl: '5px'}
// '#copyright, #tools_bottom .label': { // },
// 'font-size': {l: '1.5em', xl: '2em'}, // '#copyright, #tools_bottom .label': {
// 'line-height': {s: '15px'} // 'font-size': {l: '1.5em', xl: '2em'},
// }, // 'line-height': {s: '15px'}
// '#tools_bottom_2': { // },
// width: {l: '295px', xl: '355px'}, // '#tools_bottom_2': {
// top: {s: '4px'} // width: {l: '295px', xl: '355px'},
// }, // top: {s: '4px'}
// '#tools_top > div, #tools_top': { // },
// 'line-height': {s: '17px', l: '34px', xl: '50px'} // '#tools_top > div, #tools_top': {
// }, // 'line-height': {s: '17px', l: '34px', xl: '50px'}
// '.dropdown button': { // },
// height: {s: '18px', l: '34px', xl: '40px'}, // '.dropdown button': {
// 'line-height': {s: '18px', l: '34px', xl: '40px'}, // height: {s: '18px', l: '34px', xl: '40px'},
// 'margin-top': {s: '3px'} // 'line-height': {s: '18px', l: '34px', xl: '40px'},
// }, // 'margin-top': {s: '3px'}
// '#tools_top label, #tools_bottom label': { // },
// 'font-size': {s: '1em', l: '1.5em', xl: '2em'}, // '#tools_top label, #tools_bottom label': {
// height: {s: '25px', l: '42px', xl: '64px'} // 'font-size': {s: '1em', l: '1.5em', xl: '2em'},
// }, // height: {s: '25px', l: '42px', xl: '64px'}
// 'div.toolset': { // },
// height: {s: '25px', l: '42px', xl: '64px'} // 'div.toolset': {
// }, // height: {s: '25px', l: '42px', xl: '64px'}
// '#tool_bold, #tool_italic': { // },
// 'font-size': {s: '1.5em', l: '3em', xl: '4.5em'} // '#tool_bold, #tool_italic': {
// }, // 'font-size': {s: '1.5em', l: '3em', xl: '4.5em'}
// '#sidepanels': { // },
// top: {s: '50px', l: '88px', xl: '125px'}, // '#sidepanels': {
// bottom: {s: '51px', l: '68px', xl: '65px'} // top: {s: '50px', l: '88px', xl: '125px'},
// }, // bottom: {s: '51px', l: '68px', xl: '65px'}
// '#layerbuttons': { // },
// width: {l: '130px', xl: '175px'}, // '#layerbuttons': {
// height: {l: '24px', xl: '30px'} // width: {l: '130px', xl: '175px'},
// }, // height: {l: '24px', xl: '30px'}
// '#layerlist': { // },
// width: {l: '128px', xl: '150px'} // '#layerlist': {
// }, // width: {l: '128px', xl: '150px'}
// '.layer_button': { // },
// width: {l: '19px', xl: '28px'}, // '.layer_button': {
// height: {l: '19px', xl: '28px'} // width: {l: '19px', xl: '28px'},
// }, // height: {l: '19px', xl: '28px'}
// 'input.spin-button': { // },
// 'background-image': {l: 'url('images/spinbtn_updn_big.png')', xl: 'url('images/spinbtn_updn_big.png')'}, // 'input.spin-button': {
// 'background-position': {l: '100% -5px', xl: '100% -2px'}, // 'background-image': {l: 'url('images/spinbtn_updn_big.png')', xl: 'url('images/spinbtn_updn_big.png')'},
// 'padding-right': {l: '24px', xl: '24px' } // 'background-position': {l: '100% -5px', xl: '100% -2px'},
// }, // 'padding-right': {l: '24px', xl: '24px' }
// 'input.spin-button.up': { // },
// 'background-position': {l: '100% -45px', xl: '100% -42px'} // 'input.spin-button.up': {
// }, // 'background-position': {l: '100% -45px', xl: '100% -42px'}
// 'input.spin-button.down': { // },
// 'background-position': {l: '100% -85px', xl: '100% -82px'} // 'input.spin-button.down': {
// }, // 'background-position': {l: '100% -85px', xl: '100% -82px'}
// '#position_opts': { // },
// width: {all: (size_num*4) +'px'} // '#position_opts': {
// } // width: {all: (size_num*4) +'px'}
// }
}
}; };
var ruleElem = $$b('#tool_size_rules'); var ruleElem = $$b('#tool_size_rules');
@ -30755,7 +30778,7 @@ editor.init = function () {
var num = 5 - $$b('#layerlist tr.layer').size(); var num = 5 - $$b('#layerlist tr.layer').size();
while (num-- > 0) { while (num-- > 0) {
// FIXME: there must a better way to do this // TODO: there must a better way to do this
layerlist.append('<tr><td style="color:white">_</td><td/></tr>'); layerlist.append('<tr><td style="color:white">_</td><td/></tr>');
} }
}; };

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

365
dist/index-umd.js vendored
View File

@ -234,6 +234,10 @@
} }
function _iterableToArrayLimit(arr, i) { function _iterableToArrayLimit(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;
@ -269,7 +273,7 @@
function _wrapRegExp(re, groups) { function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) { _wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups); return new BabelRegExp(re, undefined, groups);
}; };
var _RegExp = _wrapNativeSuper(RegExp); var _RegExp = _wrapNativeSuper(RegExp);
@ -278,10 +282,10 @@
var _groups = new WeakMap(); var _groups = new WeakMap();
function BabelRegExp(re, groups) { function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re); var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups); _groups.set(_this, groups || _groups.get(re));
return _this; return _this;
} }
@ -2742,7 +2746,7 @@
}, },
enumerable: true enumerable: true
}, },
// FIXME: The following are not implemented and simply return SVGPathElement.pathSegList. // TODO: The following are not implemented and simply return SVGPathElement.pathSegList.
normalizedPathSegList: { normalizedPathSegList: {
get: function get() { get: function get() {
return this.pathSegList; return this.pathSegList;
@ -4698,7 +4702,7 @@
}, { }, {
key: "addCommandToHistory", key: "addCommandToHistory",
value: function addCommandToHistory(cmd) { value: function addCommandToHistory(cmd) {
// FIXME: we MUST compress consecutive text changes to the same element // TODO: we MUST compress consecutive text changes to the same element
// (right now each keystroke is saved as a separate command that includes the // (right now each keystroke is saved as a separate command that includes the
// entire text contents of the text element) // entire text contents of the text element)
// TODO: consider limiting the history that we store here (need to do some slicing) // TODO: consider limiting the history that we store here (need to do some slicing)
@ -8387,7 +8391,7 @@
/** /**
* Walks the tree and executes the callback on each element in a depth-first fashion. * Walks the tree and executes the callback on each element in a depth-first fashion.
* @function module:utilities.walkTreePost * @function module:utilities.walkTreePost
* @todo FIXME: Shouldn't this be calling walkTreePost? * @todo Shouldn't this be calling walkTreePost?
* @param {Element} elem - DOM element to traverse * @param {Element} elem - DOM element to traverse
* @param {module:utilities.TreeWalker} cbFn - Callback function to run on each element * @param {module:utilities.TreeWalker} cbFn - Callback function to run on each element
* @returns {void} * @returns {void}
@ -9367,8 +9371,8 @@
*/ */
var regexEscape = function regexEscape(str) { var regexEscape = function regexEscape(str) {
// From: http://phpjs.org/functions // Originally from: http://phpjs.org/functions
return String(str).replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\-]', 'g'), '\\$&'); return String(str).replace(/[.\\+*?[^\]$(){}=!<>|:-]/g, '\\$&');
}; };
/** /**
* Prevents default browser click behaviour on the given element. * Prevents default browser click behaviour on the given element.
@ -11830,7 +11834,7 @@
} else { } else {
// remove all children from this node and insert them before this node // remove all children from this node and insert them before this node
// FIXME: in the case of animation elements this will hardly ever be correct // TODO: in the case of animation elements this will hardly ever be correct
var children = []; var children = [];
while (node.hasChildNodes()) { while (node.hasChildNodes()) {
@ -12510,7 +12514,7 @@
if (Math.abs(a) > 1.0e-10) { if (Math.abs(a) > 1.0e-10) {
s = Math.sin(a) / (1 - Math.cos(a)); s = Math.sin(a) / (1 - Math.cos(a));
} else { } else {
// FIXME: This blows up if the angle is exactly 0! // TODO: This blows up if the angle is exactly 0!
s = 2 / a; s = 2 / a;
} }
@ -12871,7 +12875,7 @@
} // else, it's a non-group } // else, it's a non-group
} else { } else {
// FIXME: box might be null for some elements (<metadata> etc), need to handle this // TODO: box might be null for some elements (<metadata> etc), need to handle this
var _box = getBBox(selected); // Paths (and possbly other shapes) will have no BBox while still in <defs>, var _box = getBBox(selected); // Paths (and possbly other shapes) will have no BBox while still in <defs>,
// but we still may need to recalculate them (see issue 595). // but we still may need to recalculate them (see issue 595).
// TODO: Figure out how to get BBox from these elements in case they // TODO: Figure out how to get BBox from these elements in case they
@ -12895,7 +12899,7 @@
var _a = _angle * Math.PI / 180; var _a = _angle * Math.PI / 180;
var _s = Math.abs(_a) > 1.0e-10 ? Math.sin(_a) / (1 - Math.cos(_a)) // FIXME: This blows up if the angle is exactly 0! var _s = Math.abs(_a) > 1.0e-10 ? Math.sin(_a) / (1 - Math.cos(_a)) // TODO: This blows up if the angle is exactly 0!
: 2 / _a; : 2 / _a;
for (var _i2 = 0; _i2 < tlist.numberOfItems; ++_i2) { for (var _i2 = 0; _i2 < tlist.numberOfItems; ++_i2) {
@ -15614,19 +15618,38 @@
if (!rightClick) { if (!rightClick) {
// insert a dummy transform so if the element(s) are moved it will have // insert a dummy transform so if the element(s) are moved it will have
// a transform to use for its translate // a transform to use for its translate
for (var _i2 = 0, _selectedElements = selectedElements; _i2 < _selectedElements.length; _i2++) { var _iteratorNormalCompletion = true;
var selectedElement = _selectedElements[_i2]; var _didIteratorError = false;
var _iteratorError = undefined;
if (isNullish(selectedElement)) { try {
continue; for (var _iterator = selectedElements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var selectedElement = _step.value;
if (isNullish(selectedElement)) {
continue;
}
var slist = getTransformList(selectedElement);
if (slist.numberOfItems) {
slist.insertItemBefore(svgroot.createSVGTransform(), 0);
} else {
slist.appendItem(svgroot.createSVGTransform());
}
} }
} catch (err) {
var slist = getTransformList(selectedElement); _didIteratorError = true;
_iteratorError = err;
if (slist.numberOfItems) { } finally {
slist.insertItemBefore(svgroot.createSVGTransform(), 0); try {
} else { if (!_iteratorNormalCompletion && _iterator["return"] != null) {
slist.appendItem(svgroot.createSVGTransform()); _iterator["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
} }
} }
} }
@ -15790,7 +15813,7 @@
break; break;
} }
case 'square': // FIXME: once we create the rect, we lose information that this was a square case 'square': // TODO: once we create the rect, we lose information that this was a square
// (for resizing purposes this could be important) // (for resizing purposes this could be important)
// Fallthrough // Fallthrough
@ -17732,11 +17755,11 @@
} }
}); });
}); });
var _i3 = attrs.length; var _i2 = attrs.length;
var attrNames = ['width', 'height', 'xmlns', 'x', 'y', 'viewBox', 'id', 'overflow']; var attrNames = ['width', 'height', 'xmlns', 'x', 'y', 'viewBox', 'id', 'overflow'];
while (_i3--) { while (_i2--) {
var attr = attrs[_i3]; var attr = attrs[_i2];
var attrVal = toXml(attr.value); // Namespaces have already been dealt with, so skip var attrVal = toXml(attr.value); // Namespaces have already been dealt with, so skip
if (attr.nodeName.startsWith('xmlns:')) { if (attr.nodeName.startsWith('xmlns:')) {
@ -17762,8 +17785,8 @@
var mozAttrs = ['-moz-math-font-style', '_moz-math-font-style']; var mozAttrs = ['-moz-math-font-style', '_moz-math-font-style'];
for (var _i4 = attrs.length - 1; _i4 >= 0; _i4--) { for (var _i3 = attrs.length - 1; _i3 >= 0; _i3--) {
var _attr = attrs[_i4]; var _attr = attrs[_i3];
var _attrVal = toXml(_attr.value); // remove bogus attributes added by Gecko var _attrVal = toXml(_attr.value); // remove bogus attributes added by Gecko
@ -17819,14 +17842,14 @@
indent++; indent++;
var bOneLine = false; var bOneLine = false;
for (var _i5 = 0; _i5 < childs.length; _i5++) { for (var _i4 = 0; _i4 < childs.length; _i4++) {
var child = childs.item(_i5); var child = childs.item(_i4);
switch (child.nodeType) { switch (child.nodeType) {
case 1: case 1:
// element node // element node
out.push('\n'); out.push('\n');
out.push(this.svgToString(childs.item(_i5), indent)); out.push(this.svgToString(childs.item(_i4), indent));
break; break;
case 3: case 3:
@ -17868,7 +17891,7 @@
if (!bOneLine) { if (!bOneLine) {
out.push('\n'); out.push('\n');
for (var _i6 = 0; _i6 < indent; _i6++) { for (var _i5 = 0; _i5 < indent; _i5++) {
out.push(' '); out.push(' ');
} }
} }
@ -18944,27 +18967,27 @@
} }
var attrs = svg.attributes; var attrs = svg.attributes;
var _iteratorNormalCompletion = true; var _iteratorNormalCompletion2 = true;
var _didIteratorError = false; var _didIteratorError2 = false;
var _iteratorError = undefined; var _iteratorError2 = undefined;
try { try {
for (var _iterator = attrs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { for (var _iterator2 = attrs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var attr = _step.value; var attr = _step2.value;
// Ok for `NamedNodeMap` // Ok for `NamedNodeMap`
symbol.setAttribute(attr.nodeName, attr.value); symbol.setAttribute(attr.nodeName, attr.value);
} }
} catch (err) { } catch (err) {
_didIteratorError = true; _didIteratorError2 = true;
_iteratorError = err; _iteratorError2 = err;
} finally { } finally {
try { try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) { if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator["return"](); _iterator2["return"]();
} }
} finally { } finally {
if (_didIteratorError) { if (_didIteratorError2) {
throw _iteratorError; throw _iteratorError2;
} }
} }
} }
@ -19189,29 +19212,29 @@
elem = $$9(elem).data('gsvg') || $$9(elem).data('symbol') || elem; elem = $$9(elem).data('gsvg') || $$9(elem).data('symbol') || elem;
var childs = elem.childNodes; var childs = elem.childNodes;
var _iteratorNormalCompletion2 = true; var _iteratorNormalCompletion3 = true;
var _didIteratorError2 = false; var _didIteratorError3 = false;
var _iteratorError2 = undefined; var _iteratorError3 = undefined;
try { try {
for (var _iterator2 = childs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
var child = _step2.value; var child = _step3.value;
if (child.nodeName === 'title') { if (child.nodeName === 'title') {
return child.textContent; return child.textContent;
} }
} }
} catch (err) { } catch (err) {
_didIteratorError2 = true; _didIteratorError3 = true;
_iteratorError2 = err; _iteratorError3 = err;
} finally { } finally {
try { try {
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) { if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) {
_iterator2["return"](); _iterator3["return"]();
} }
} finally { } finally {
if (_didIteratorError2) { if (_didIteratorError3) {
throw _iteratorError2; throw _iteratorError3;
} }
} }
} }
@ -19279,13 +19302,13 @@
var docTitle = false, var docTitle = false,
oldTitle = ''; oldTitle = '';
var batchCmd = new BatchCommand$1('Change Image Title'); var batchCmd = new BatchCommand$1('Change Image Title');
var _iteratorNormalCompletion3 = true; var _iteratorNormalCompletion4 = true;
var _didIteratorError3 = false; var _didIteratorError4 = false;
var _iteratorError3 = undefined; var _iteratorError4 = undefined;
try { try {
for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { for (var _iterator4 = childs[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
var child = _step3.value; var child = _step4.value;
if (child.nodeName === 'title') { if (child.nodeName === 'title') {
docTitle = child; docTitle = child;
@ -19294,16 +19317,16 @@
} }
} }
} catch (err) { } catch (err) {
_didIteratorError3 = true; _didIteratorError4 = true;
_iteratorError3 = err; _iteratorError4 = err;
} finally { } finally {
try { try {
if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) { if (!_iteratorNormalCompletion4 && _iterator4["return"] != null) {
_iterator3["return"](); _iterator4["return"]();
} }
} finally { } finally {
if (_didIteratorError3) { if (_didIteratorError4) {
throw _iteratorError3; throw _iteratorError4;
} }
} }
} }
@ -20612,7 +20635,7 @@
canvas.moveSelectedElements(diffX * currentZoom, diffY * currentZoom, true); canvas.moveSelectedElements(diffX * currentZoom, diffY * currentZoom, true);
return "continue"; return "continue";
} // only allow the transform/opacity/filter attribute to change on <g> elements, slightly hacky } // only allow the transform/opacity/filter attribute to change on <g> elements, slightly hacky
// TODO: FIXME: Missing statement body // TODO: Missing statement body
// if (elem.tagName === 'g' && goodGAttrs.includes(attr)) {} // if (elem.tagName === 'g' && goodGAttrs.includes(attr)) {}
@ -21291,9 +21314,9 @@
this.moveToTopSelectedElement = function () { this.moveToTopSelectedElement = function () {
var _selectedElements2 = selectedElements, var _selectedElements = selectedElements,
_selectedElements3 = _slicedToArray(_selectedElements2, 1), _selectedElements2 = _slicedToArray(_selectedElements, 1),
selected = _selectedElements3[0]; selected = _selectedElements2[0];
if (!isNullish(selected)) { if (!isNullish(selected)) {
var t = selected; var t = selected;
@ -21318,9 +21341,9 @@
this.moveToBottomSelectedElement = function () { this.moveToBottomSelectedElement = function () {
var _selectedElements4 = selectedElements, var _selectedElements3 = selectedElements,
_selectedElements5 = _slicedToArray(_selectedElements4, 1), _selectedElements4 = _slicedToArray(_selectedElements3, 1),
selected = _selectedElements5[0]; selected = _selectedElements4[0];
if (!isNullish(selected)) { if (!isNullish(selected)) {
var t = selected; var t = selected;
@ -21628,45 +21651,45 @@
var dx = new Array(len); var dx = new Array(len);
var dy = new Array(len); var dy = new Array(len);
for (var _i7 = 0; _i7 < len; ++_i7) { for (var _i6 = 0; _i6 < len; ++_i6) {
if (isNullish(selectedElements[_i7])) { if (isNullish(selectedElements[_i6])) {
break; break;
} // const elem = selectedElements[i]; } // const elem = selectedElements[i];
var bbox = bboxes[_i7]; var bbox = bboxes[_i6];
dx[_i7] = 0; dx[_i6] = 0;
dy[_i7] = 0; dy[_i6] = 0;
switch (type) { switch (type) {
case 'l': case 'l':
// left (horizontal) // left (horizontal)
dx[_i7] = minx - bbox.x; dx[_i6] = minx - bbox.x;
break; break;
case 'c': case 'c':
// center (horizontal) // center (horizontal)
dx[_i7] = (minx + maxx) / 2 - (bbox.x + bbox.width / 2); dx[_i6] = (minx + maxx) / 2 - (bbox.x + bbox.width / 2);
break; break;
case 'r': case 'r':
// right (horizontal) // right (horizontal)
dx[_i7] = maxx - (bbox.x + bbox.width); dx[_i6] = maxx - (bbox.x + bbox.width);
break; break;
case 't': case 't':
// top (vertical) // top (vertical)
dy[_i7] = miny - bbox.y; dy[_i6] = miny - bbox.y;
break; break;
case 'm': case 'm':
// middle (vertical) // middle (vertical)
dy[_i7] = (miny + maxy) / 2 - (bbox.y + bbox.height / 2); dy[_i6] = (miny + maxy) / 2 - (bbox.y + bbox.height / 2);
break; break;
case 'b': case 'b':
// bottom (vertical) // bottom (vertical)
dy[_i7] = maxy - (bbox.y + bbox.height); dy[_i6] = maxy - (bbox.y + bbox.height);
break; break;
} }
} }
@ -22832,14 +22855,14 @@
/** /**
* *
* @param {boolean} [toImage] * @param {boolean} [toImage]
* @param {external:jQuery.svgIcons.Fallback} [fallback] * @param {external:jQuery.svgIcons.Fallback} [fallback=false]
* @returns {void} * @returns {void}
*/ */
function makeIcons() { function makeIcons() {
var toImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var toImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
var fallback = arguments.length > 1 ? arguments[1] : undefined; var fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
if (iconsMade) return; if (iconsMade) return;
if (opts.no_img) toImage = false; if (opts.no_img) toImage = false;
var tempHolder; var tempHolder;
@ -30174,90 +30197,90 @@
}, },
'div#workarea': { 'div#workarea': {
left: 38, left: 38,
top: 74 // '#tools_bottom': { top: 74
// left: {s: '27px', l: '46px', xl: '65px'}, } // '#tools_bottom': {
// height: {s: '58px', l: '98px', xl: '145px'} // left: {s: '27px', l: '46px', xl: '65px'},
// }, // height: {s: '58px', l: '98px', xl: '145px'}
// '#color_tools': { // },
// 'border-spacing': {s: '0 1px'}, // '#color_tools': {
// 'margin-top': {s: '-1px'} // 'border-spacing': {s: '0 1px'},
// }, // 'margin-top': {s: '-1px'}
// '#color_tools .icon_label': { // },
// width: {l:'43px', xl: '60px'} // '#color_tools .icon_label': {
// }, // width: {l:'43px', xl: '60px'}
// '.color_tool': { // },
// height: {s: '20px'} // '.color_tool': {
// }, // height: {s: '20px'}
// '#tool_opacity': { // },
// top: {s: '1px'}, // '#tool_opacity': {
// height: {s: 'auto', l:'auto', xl:'auto'} // top: {s: '1px'},
// }, // height: {s: 'auto', l:'auto', xl:'auto'}
// '#tools_top input, #tools_bottom input': { // },
// 'margin-top': {s: '2px', l: '4px', xl: '5px'}, // '#tools_top input, #tools_bottom input': {
// height: {s: 'auto', l: 'auto', xl: 'auto'}, // 'margin-top': {s: '2px', l: '4px', xl: '5px'},
// border: {s: '1px solid #555', l: 'auto', xl: 'auto'}, // height: {s: 'auto', l: 'auto', xl: 'auto'},
// 'font-size': {s: '.9em', l: '1.2em', xl: '1.4em'} // border: {s: '1px solid #555', l: 'auto', xl: 'auto'},
// }, // 'font-size': {s: '.9em', l: '1.2em', xl: '1.4em'}
// '#zoom_panel': { // },
// 'margin-top': {s: '3px', l: '4px', xl: '5px'} // '#zoom_panel': {
// }, // 'margin-top': {s: '3px', l: '4px', xl: '5px'}
// '#copyright, #tools_bottom .label': { // },
// 'font-size': {l: '1.5em', xl: '2em'}, // '#copyright, #tools_bottom .label': {
// 'line-height': {s: '15px'} // 'font-size': {l: '1.5em', xl: '2em'},
// }, // 'line-height': {s: '15px'}
// '#tools_bottom_2': { // },
// width: {l: '295px', xl: '355px'}, // '#tools_bottom_2': {
// top: {s: '4px'} // width: {l: '295px', xl: '355px'},
// }, // top: {s: '4px'}
// '#tools_top > div, #tools_top': { // },
// 'line-height': {s: '17px', l: '34px', xl: '50px'} // '#tools_top > div, #tools_top': {
// }, // 'line-height': {s: '17px', l: '34px', xl: '50px'}
// '.dropdown button': { // },
// height: {s: '18px', l: '34px', xl: '40px'}, // '.dropdown button': {
// 'line-height': {s: '18px', l: '34px', xl: '40px'}, // height: {s: '18px', l: '34px', xl: '40px'},
// 'margin-top': {s: '3px'} // 'line-height': {s: '18px', l: '34px', xl: '40px'},
// }, // 'margin-top': {s: '3px'}
// '#tools_top label, #tools_bottom label': { // },
// 'font-size': {s: '1em', l: '1.5em', xl: '2em'}, // '#tools_top label, #tools_bottom label': {
// height: {s: '25px', l: '42px', xl: '64px'} // 'font-size': {s: '1em', l: '1.5em', xl: '2em'},
// }, // height: {s: '25px', l: '42px', xl: '64px'}
// 'div.toolset': { // },
// height: {s: '25px', l: '42px', xl: '64px'} // 'div.toolset': {
// }, // height: {s: '25px', l: '42px', xl: '64px'}
// '#tool_bold, #tool_italic': { // },
// 'font-size': {s: '1.5em', l: '3em', xl: '4.5em'} // '#tool_bold, #tool_italic': {
// }, // 'font-size': {s: '1.5em', l: '3em', xl: '4.5em'}
// '#sidepanels': { // },
// top: {s: '50px', l: '88px', xl: '125px'}, // '#sidepanels': {
// bottom: {s: '51px', l: '68px', xl: '65px'} // top: {s: '50px', l: '88px', xl: '125px'},
// }, // bottom: {s: '51px', l: '68px', xl: '65px'}
// '#layerbuttons': { // },
// width: {l: '130px', xl: '175px'}, // '#layerbuttons': {
// height: {l: '24px', xl: '30px'} // width: {l: '130px', xl: '175px'},
// }, // height: {l: '24px', xl: '30px'}
// '#layerlist': { // },
// width: {l: '128px', xl: '150px'} // '#layerlist': {
// }, // width: {l: '128px', xl: '150px'}
// '.layer_button': { // },
// width: {l: '19px', xl: '28px'}, // '.layer_button': {
// height: {l: '19px', xl: '28px'} // width: {l: '19px', xl: '28px'},
// }, // height: {l: '19px', xl: '28px'}
// 'input.spin-button': { // },
// 'background-image': {l: 'url('images/spinbtn_updn_big.png')', xl: 'url('images/spinbtn_updn_big.png')'}, // 'input.spin-button': {
// 'background-position': {l: '100% -5px', xl: '100% -2px'}, // 'background-image': {l: 'url('images/spinbtn_updn_big.png')', xl: 'url('images/spinbtn_updn_big.png')'},
// 'padding-right': {l: '24px', xl: '24px' } // 'background-position': {l: '100% -5px', xl: '100% -2px'},
// }, // 'padding-right': {l: '24px', xl: '24px' }
// 'input.spin-button.up': { // },
// 'background-position': {l: '100% -45px', xl: '100% -42px'} // 'input.spin-button.up': {
// }, // 'background-position': {l: '100% -45px', xl: '100% -42px'}
// 'input.spin-button.down': { // },
// 'background-position': {l: '100% -85px', xl: '100% -82px'} // 'input.spin-button.down': {
// }, // 'background-position': {l: '100% -85px', xl: '100% -82px'}
// '#position_opts': { // },
// width: {all: (size_num*4) +'px'} // '#position_opts': {
// } // width: {all: (size_num*4) +'px'}
// }
}
}; };
var ruleElem = $$b('#tool_size_rules'); var ruleElem = $$b('#tool_size_rules');
@ -30761,7 +30784,7 @@
var num = 5 - $$b('#layerlist tr.layer').size(); var num = 5 - $$b('#layerlist tr.layer').size();
while (num-- > 0) { while (num-- > 0) {
// FIXME: there must a better way to do this // TODO: there must a better way to do this
layerlist.append('<tr><td style="color:white">_</td><td/></tr>'); layerlist.append('<tr><td style="color:white">_</td><td/></tr>');
} }
}; };

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -147,6 +147,10 @@
} }
function _iterableToArrayLimit(arr, i) { function _iterableToArrayLimit(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;
@ -182,7 +186,7 @@
function _wrapRegExp(re, groups) { function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) { _wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups); return new BabelRegExp(re, undefined, groups);
}; };
var _RegExp = _wrapNativeSuper(RegExp); var _RegExp = _wrapNativeSuper(RegExp);
@ -191,10 +195,10 @@
var _groups = new WeakMap(); var _groups = new WeakMap();
function BabelRegExp(re, groups) { function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re); var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups); _groups.set(_this, groups || _groups.get(re));
return _this; return _this;
} }
@ -820,7 +824,7 @@
} }
return box.width; return box.width;
}; // FIXME: use more accurate positioning!! }; // TODO: use more accurate positioning!!
var x, var x,

View File

@ -2387,7 +2387,7 @@
}, },
enumerable: true enumerable: true
}, },
// FIXME: The following are not implemented and simply return SVGPathElement.pathSegList. // TODO: The following are not implemented and simply return SVGPathElement.pathSegList.
normalizedPathSegList: { normalizedPathSegList: {
get: function get() { get: function get() {
return this.pathSegList; return this.pathSegList;
@ -2451,8 +2451,6 @@
var _navigator = navigator, var _navigator = navigator,
userAgent = _navigator.userAgent; userAgent = _navigator.userAgent;
var svg = document.createElementNS(NS.SVG, 'svg'); // Note: Browser sniffing should only be used if no other detection method is possible var svg = document.createElementNS(NS.SVG, 'svg'); // Note: Browser sniffing should only be used if no other detection method is possible
var isOpera_ = Boolean(window.opera);
var isWebkit_ = userAgent.includes('AppleWebKit'); var isWebkit_ = userAgent.includes('AppleWebKit');
var isGecko_ = userAgent.includes('Gecko/'); var isGecko_ = userAgent.includes('Gecko/');
var isIE_ = userAgent.includes('MSIE'); var isIE_ = userAgent.includes('MSIE');
@ -2464,10 +2462,6 @@
return Boolean(svg.querySelector); return Boolean(svg.querySelector);
}(); }();
var supportsXpath_ = function () {
return Boolean(document.evaluate);
}(); // segList functions (for FF1.5 and 2.0)
var supportsPathReplaceItem_ = function () { var supportsPathReplaceItem_ = function () {
var path = document.createElementNS(NS.SVG, 'path'); var path = document.createElementNS(NS.SVG, 'path');

189
dist/svgcanvas-iife.js vendored
View File

@ -213,6 +213,10 @@ var SvgCanvas = (function () {
} }
function _iterableToArrayLimit(arr, i) { function _iterableToArrayLimit(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;
@ -248,7 +252,7 @@ var SvgCanvas = (function () {
function _wrapRegExp(re, groups) { function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) { _wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups); return new BabelRegExp(re, undefined, groups);
}; };
var _RegExp = _wrapNativeSuper(RegExp); var _RegExp = _wrapNativeSuper(RegExp);
@ -257,10 +261,10 @@ var SvgCanvas = (function () {
var _groups = new WeakMap(); var _groups = new WeakMap();
function BabelRegExp(re, groups) { function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re); var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups); _groups.set(_this, groups || _groups.get(re));
return _this; return _this;
} }
@ -2614,7 +2618,7 @@ var SvgCanvas = (function () {
}, },
enumerable: true enumerable: true
}, },
// FIXME: The following are not implemented and simply return SVGPathElement.pathSegList. // TODO: The following are not implemented and simply return SVGPathElement.pathSegList.
normalizedPathSegList: { normalizedPathSegList: {
get: function get() { get: function get() {
return this.pathSegList; return this.pathSegList;
@ -4764,7 +4768,7 @@ var SvgCanvas = (function () {
}, { }, {
key: "addCommandToHistory", key: "addCommandToHistory",
value: function addCommandToHistory(cmd) { value: function addCommandToHistory(cmd) {
// FIXME: we MUST compress consecutive text changes to the same element // TODO: we MUST compress consecutive text changes to the same element
// (right now each keystroke is saved as a separate command that includes the // (right now each keystroke is saved as a separate command that includes the
// entire text contents of the text element) // entire text contents of the text element)
// TODO: consider limiting the history that we store here (need to do some slicing) // TODO: consider limiting the history that we store here (need to do some slicing)
@ -8453,7 +8457,7 @@ var SvgCanvas = (function () {
/** /**
* Walks the tree and executes the callback on each element in a depth-first fashion. * Walks the tree and executes the callback on each element in a depth-first fashion.
* @function module:utilities.walkTreePost * @function module:utilities.walkTreePost
* @todo FIXME: Shouldn't this be calling walkTreePost? * @todo Shouldn't this be calling walkTreePost?
* @param {Element} elem - DOM element to traverse * @param {Element} elem - DOM element to traverse
* @param {module:utilities.TreeWalker} cbFn - Callback function to run on each element * @param {module:utilities.TreeWalker} cbFn - Callback function to run on each element
* @returns {void} * @returns {void}
@ -11391,7 +11395,7 @@ var SvgCanvas = (function () {
} else { } else {
// remove all children from this node and insert them before this node // remove all children from this node and insert them before this node
// FIXME: in the case of animation elements this will hardly ever be correct // TODO: in the case of animation elements this will hardly ever be correct
var children = []; var children = [];
while (node.hasChildNodes()) { while (node.hasChildNodes()) {
@ -12282,7 +12286,7 @@ var SvgCanvas = (function () {
if (Math.abs(a) > 1.0e-10) { if (Math.abs(a) > 1.0e-10) {
s = Math.sin(a) / (1 - Math.cos(a)); s = Math.sin(a) / (1 - Math.cos(a));
} else { } else {
// FIXME: This blows up if the angle is exactly 0! // TODO: This blows up if the angle is exactly 0!
s = 2 / a; s = 2 / a;
} }
@ -12643,7 +12647,7 @@ var SvgCanvas = (function () {
} // else, it's a non-group } // else, it's a non-group
} else { } else {
// FIXME: box might be null for some elements (<metadata> etc), need to handle this // TODO: box might be null for some elements (<metadata> etc), need to handle this
var _box = getBBox(selected); // Paths (and possbly other shapes) will have no BBox while still in <defs>, var _box = getBBox(selected); // Paths (and possbly other shapes) will have no BBox while still in <defs>,
// but we still may need to recalculate them (see issue 595). // but we still may need to recalculate them (see issue 595).
// TODO: Figure out how to get BBox from these elements in case they // TODO: Figure out how to get BBox from these elements in case they
@ -12667,7 +12671,7 @@ var SvgCanvas = (function () {
var _a = _angle * Math.PI / 180; var _a = _angle * Math.PI / 180;
var _s = Math.abs(_a) > 1.0e-10 ? Math.sin(_a) / (1 - Math.cos(_a)) // FIXME: This blows up if the angle is exactly 0! var _s = Math.abs(_a) > 1.0e-10 ? Math.sin(_a) / (1 - Math.cos(_a)) // TODO: This blows up if the angle is exactly 0!
: 2 / _a; : 2 / _a;
for (var _i2 = 0; _i2 < tlist.numberOfItems; ++_i2) { for (var _i2 = 0; _i2 < tlist.numberOfItems; ++_i2) {
@ -15386,19 +15390,38 @@ var SvgCanvas = (function () {
if (!rightClick) { if (!rightClick) {
// insert a dummy transform so if the element(s) are moved it will have // insert a dummy transform so if the element(s) are moved it will have
// a transform to use for its translate // a transform to use for its translate
for (var _i2 = 0, _selectedElements = selectedElements; _i2 < _selectedElements.length; _i2++) { var _iteratorNormalCompletion = true;
var selectedElement = _selectedElements[_i2]; var _didIteratorError = false;
var _iteratorError = undefined;
if (isNullish(selectedElement)) { try {
continue; for (var _iterator = selectedElements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var selectedElement = _step.value;
if (isNullish(selectedElement)) {
continue;
}
var slist = getTransformList(selectedElement);
if (slist.numberOfItems) {
slist.insertItemBefore(svgroot.createSVGTransform(), 0);
} else {
slist.appendItem(svgroot.createSVGTransform());
}
} }
} catch (err) {
var slist = getTransformList(selectedElement); _didIteratorError = true;
_iteratorError = err;
if (slist.numberOfItems) { } finally {
slist.insertItemBefore(svgroot.createSVGTransform(), 0); try {
} else { if (!_iteratorNormalCompletion && _iterator["return"] != null) {
slist.appendItem(svgroot.createSVGTransform()); _iterator["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
} }
} }
} }
@ -15562,7 +15585,7 @@ var SvgCanvas = (function () {
break; break;
} }
case 'square': // FIXME: once we create the rect, we lose information that this was a square case 'square': // TODO: once we create the rect, we lose information that this was a square
// (for resizing purposes this could be important) // (for resizing purposes this could be important)
// Fallthrough // Fallthrough
@ -17504,11 +17527,11 @@ var SvgCanvas = (function () {
} }
}); });
}); });
var _i3 = attrs.length; var _i2 = attrs.length;
var attrNames = ['width', 'height', 'xmlns', 'x', 'y', 'viewBox', 'id', 'overflow']; var attrNames = ['width', 'height', 'xmlns', 'x', 'y', 'viewBox', 'id', 'overflow'];
while (_i3--) { while (_i2--) {
var attr = attrs[_i3]; var attr = attrs[_i2];
var attrVal = toXml(attr.value); // Namespaces have already been dealt with, so skip var attrVal = toXml(attr.value); // Namespaces have already been dealt with, so skip
if (attr.nodeName.startsWith('xmlns:')) { if (attr.nodeName.startsWith('xmlns:')) {
@ -17534,8 +17557,8 @@ var SvgCanvas = (function () {
var mozAttrs = ['-moz-math-font-style', '_moz-math-font-style']; var mozAttrs = ['-moz-math-font-style', '_moz-math-font-style'];
for (var _i4 = attrs.length - 1; _i4 >= 0; _i4--) { for (var _i3 = attrs.length - 1; _i3 >= 0; _i3--) {
var _attr = attrs[_i4]; var _attr = attrs[_i3];
var _attrVal = toXml(_attr.value); // remove bogus attributes added by Gecko var _attrVal = toXml(_attr.value); // remove bogus attributes added by Gecko
@ -17591,14 +17614,14 @@ var SvgCanvas = (function () {
indent++; indent++;
var bOneLine = false; var bOneLine = false;
for (var _i5 = 0; _i5 < childs.length; _i5++) { for (var _i4 = 0; _i4 < childs.length; _i4++) {
var child = childs.item(_i5); var child = childs.item(_i4);
switch (child.nodeType) { switch (child.nodeType) {
case 1: case 1:
// element node // element node
out.push('\n'); out.push('\n');
out.push(this.svgToString(childs.item(_i5), indent)); out.push(this.svgToString(childs.item(_i4), indent));
break; break;
case 3: case 3:
@ -17640,7 +17663,7 @@ var SvgCanvas = (function () {
if (!bOneLine) { if (!bOneLine) {
out.push('\n'); out.push('\n');
for (var _i6 = 0; _i6 < indent; _i6++) { for (var _i5 = 0; _i5 < indent; _i5++) {
out.push(' '); out.push(' ');
} }
} }
@ -18716,27 +18739,27 @@ var SvgCanvas = (function () {
} }
var attrs = svg.attributes; var attrs = svg.attributes;
var _iteratorNormalCompletion = true; var _iteratorNormalCompletion2 = true;
var _didIteratorError = false; var _didIteratorError2 = false;
var _iteratorError = undefined; var _iteratorError2 = undefined;
try { try {
for (var _iterator = attrs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { for (var _iterator2 = attrs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var attr = _step.value; var attr = _step2.value;
// Ok for `NamedNodeMap` // Ok for `NamedNodeMap`
symbol.setAttribute(attr.nodeName, attr.value); symbol.setAttribute(attr.nodeName, attr.value);
} }
} catch (err) { } catch (err) {
_didIteratorError = true; _didIteratorError2 = true;
_iteratorError = err; _iteratorError2 = err;
} finally { } finally {
try { try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) { if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator["return"](); _iterator2["return"]();
} }
} finally { } finally {
if (_didIteratorError) { if (_didIteratorError2) {
throw _iteratorError; throw _iteratorError2;
} }
} }
} }
@ -18961,29 +18984,29 @@ var SvgCanvas = (function () {
elem = $$8(elem).data('gsvg') || $$8(elem).data('symbol') || elem; elem = $$8(elem).data('gsvg') || $$8(elem).data('symbol') || elem;
var childs = elem.childNodes; var childs = elem.childNodes;
var _iteratorNormalCompletion2 = true; var _iteratorNormalCompletion3 = true;
var _didIteratorError2 = false; var _didIteratorError3 = false;
var _iteratorError2 = undefined; var _iteratorError3 = undefined;
try { try {
for (var _iterator2 = childs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
var child = _step2.value; var child = _step3.value;
if (child.nodeName === 'title') { if (child.nodeName === 'title') {
return child.textContent; return child.textContent;
} }
} }
} catch (err) { } catch (err) {
_didIteratorError2 = true; _didIteratorError3 = true;
_iteratorError2 = err; _iteratorError3 = err;
} finally { } finally {
try { try {
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) { if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) {
_iterator2["return"](); _iterator3["return"]();
} }
} finally { } finally {
if (_didIteratorError2) { if (_didIteratorError3) {
throw _iteratorError2; throw _iteratorError3;
} }
} }
} }
@ -19051,13 +19074,13 @@ var SvgCanvas = (function () {
var docTitle = false, var docTitle = false,
oldTitle = ''; oldTitle = '';
var batchCmd = new BatchCommand$1('Change Image Title'); var batchCmd = new BatchCommand$1('Change Image Title');
var _iteratorNormalCompletion3 = true; var _iteratorNormalCompletion4 = true;
var _didIteratorError3 = false; var _didIteratorError4 = false;
var _iteratorError3 = undefined; var _iteratorError4 = undefined;
try { try {
for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { for (var _iterator4 = childs[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
var child = _step3.value; var child = _step4.value;
if (child.nodeName === 'title') { if (child.nodeName === 'title') {
docTitle = child; docTitle = child;
@ -19066,16 +19089,16 @@ var SvgCanvas = (function () {
} }
} }
} catch (err) { } catch (err) {
_didIteratorError3 = true; _didIteratorError4 = true;
_iteratorError3 = err; _iteratorError4 = err;
} finally { } finally {
try { try {
if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) { if (!_iteratorNormalCompletion4 && _iterator4["return"] != null) {
_iterator3["return"](); _iterator4["return"]();
} }
} finally { } finally {
if (_didIteratorError3) { if (_didIteratorError4) {
throw _iteratorError3; throw _iteratorError4;
} }
} }
} }
@ -20384,7 +20407,7 @@ var SvgCanvas = (function () {
canvas.moveSelectedElements(diffX * currentZoom, diffY * currentZoom, true); canvas.moveSelectedElements(diffX * currentZoom, diffY * currentZoom, true);
return "continue"; return "continue";
} // only allow the transform/opacity/filter attribute to change on <g> elements, slightly hacky } // only allow the transform/opacity/filter attribute to change on <g> elements, slightly hacky
// TODO: FIXME: Missing statement body // TODO: Missing statement body
// if (elem.tagName === 'g' && goodGAttrs.includes(attr)) {} // if (elem.tagName === 'g' && goodGAttrs.includes(attr)) {}
@ -21063,9 +21086,9 @@ var SvgCanvas = (function () {
this.moveToTopSelectedElement = function () { this.moveToTopSelectedElement = function () {
var _selectedElements2 = selectedElements, var _selectedElements = selectedElements,
_selectedElements3 = _slicedToArray(_selectedElements2, 1), _selectedElements2 = _slicedToArray(_selectedElements, 1),
selected = _selectedElements3[0]; selected = _selectedElements2[0];
if (!isNullish(selected)) { if (!isNullish(selected)) {
var t = selected; var t = selected;
@ -21090,9 +21113,9 @@ var SvgCanvas = (function () {
this.moveToBottomSelectedElement = function () { this.moveToBottomSelectedElement = function () {
var _selectedElements4 = selectedElements, var _selectedElements3 = selectedElements,
_selectedElements5 = _slicedToArray(_selectedElements4, 1), _selectedElements4 = _slicedToArray(_selectedElements3, 1),
selected = _selectedElements5[0]; selected = _selectedElements4[0];
if (!isNullish(selected)) { if (!isNullish(selected)) {
var t = selected; var t = selected;
@ -21400,45 +21423,45 @@ var SvgCanvas = (function () {
var dx = new Array(len); var dx = new Array(len);
var dy = new Array(len); var dy = new Array(len);
for (var _i7 = 0; _i7 < len; ++_i7) { for (var _i6 = 0; _i6 < len; ++_i6) {
if (isNullish(selectedElements[_i7])) { if (isNullish(selectedElements[_i6])) {
break; break;
} // const elem = selectedElements[i]; } // const elem = selectedElements[i];
var bbox = bboxes[_i7]; var bbox = bboxes[_i6];
dx[_i7] = 0; dx[_i6] = 0;
dy[_i7] = 0; dy[_i6] = 0;
switch (type) { switch (type) {
case 'l': case 'l':
// left (horizontal) // left (horizontal)
dx[_i7] = minx - bbox.x; dx[_i6] = minx - bbox.x;
break; break;
case 'c': case 'c':
// center (horizontal) // center (horizontal)
dx[_i7] = (minx + maxx) / 2 - (bbox.x + bbox.width / 2); dx[_i6] = (minx + maxx) / 2 - (bbox.x + bbox.width / 2);
break; break;
case 'r': case 'r':
// right (horizontal) // right (horizontal)
dx[_i7] = maxx - (bbox.x + bbox.width); dx[_i6] = maxx - (bbox.x + bbox.width);
break; break;
case 't': case 't':
// top (vertical) // top (vertical)
dy[_i7] = miny - bbox.y; dy[_i6] = miny - bbox.y;
break; break;
case 'm': case 'm':
// middle (vertical) // middle (vertical)
dy[_i7] = (miny + maxy) / 2 - (bbox.y + bbox.height / 2); dy[_i6] = (miny + maxy) / 2 - (bbox.y + bbox.height / 2);
break; break;
case 'b': case 'b':
// bottom (vertical) // bottom (vertical)
dy[_i7] = maxy - (bbox.y + bbox.height); dy[_i6] = maxy - (bbox.y + bbox.height);
break; break;
} }
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -636,7 +636,7 @@ export class UndoManager {
* @returns {void} * @returns {void}
*/ */
addCommandToHistory (cmd) { addCommandToHistory (cmd) {
// FIXME: we MUST compress consecutive text changes to the same element // TODO: we MUST compress consecutive text changes to the same element
// (right now each keystroke is saved as a separate command that includes the // (right now each keystroke is saved as a separate command that includes the
// entire text contents of the text element) // entire text contents of the text element)
// TODO: consider limiting the history that we store here (need to do some slicing) // TODO: consider limiting the history that we store here (need to do some slicing)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 392 B

After

Width:  |  Height:  |  Size: 389 B

View File

@ -243,7 +243,7 @@ const svgElementToPdf = function (element, pdf, options) {
} }
return box.width; return box.width;
}; };
// FIXME: use more accurate positioning!! // TODO: use more accurate positioning!!
let x, y, xOffset = 0; let x, y, xOffset = 0;
if (node.hasAttribute('text-anchor')) { if (node.hasAttribute('text-anchor')) {
switch (node.getAttribute('text-anchor')) { switch (node.getAttribute('text-anchor')) {

View File

@ -273,7 +273,7 @@ export const recalculateDimensions = function (selected) {
if (Math.abs(a) > (1.0e-10)) { if (Math.abs(a) > (1.0e-10)) {
s = Math.sin(a) / (1 - Math.cos(a)); s = Math.sin(a) / (1 - Math.cos(a));
} else { } else {
// FIXME: This blows up if the angle is exactly 0! // TODO: This blows up if the angle is exactly 0!
s = 2 / a; s = 2 / a;
} }
for (let i = 0; i < tlist.numberOfItems; ++i) { for (let i = 0; i < tlist.numberOfItems; ++i) {
@ -599,7 +599,7 @@ export const recalculateDimensions = function (selected) {
} }
// else, it's a non-group // else, it's a non-group
} else { } else {
// FIXME: box might be null for some elements (<metadata> etc), need to handle this // TODO: box might be null for some elements (<metadata> etc), need to handle this
const box = getBBox(selected); const box = getBBox(selected);
// Paths (and possbly other shapes) will have no BBox while still in <defs>, // Paths (and possbly other shapes) will have no BBox while still in <defs>,
@ -623,7 +623,7 @@ export const recalculateDimensions = function (selected) {
const a = angle * Math.PI / 180; const a = angle * Math.PI / 180;
const s = (Math.abs(a) > (1.0e-10)) const s = (Math.abs(a) > (1.0e-10))
? Math.sin(a) / (1 - Math.cos(a)) ? Math.sin(a) / (1 - Math.cos(a))
// FIXME: This blows up if the angle is exactly 0! // TODO: This blows up if the angle is exactly 0!
: 2 / a; : 2 / a;
for (let i = 0; i < tlist.numberOfItems; ++i) { for (let i = 0; i < tlist.numberOfItems; ++i) {

View File

@ -233,7 +233,7 @@ export const sanitizeSvg = function (node) {
// else (element not supported), remove it // else (element not supported), remove it
} else { } else {
// remove all children from this node and insert them before this node // remove all children from this node and insert them before this node
// FIXME: in the case of animation elements this will hardly ever be correct // TODO: in the case of animation elements this will hardly ever be correct
const children = []; const children = [];
while (node.hasChildNodes()) { while (node.hasChildNodes()) {
children.push(parent.insertBefore(node.firstChild, node)); children.push(parent.insertBefore(node.firstChild, node));

View File

@ -1626,7 +1626,7 @@ editor.init = function () {
// if there were too few rows, let's add a few to make it not so lonely // if there were too few rows, let's add a few to make it not so lonely
let num = 5 - $('#layerlist tr.layer').size(); let num = 5 - $('#layerlist tr.layer').size();
while (num-- > 0) { while (num-- > 0) {
// FIXME: there must a better way to do this // TODO: there must a better way to do this
layerlist.append('<tr><td style="color:white">_</td><td/></tr>'); layerlist.append('<tr><td style="color:white">_</td><td/></tr>');
} }
}; };

View File

@ -1955,7 +1955,7 @@ const mouseDown = function (evt) {
preventClickDefault(newImage); preventClickDefault(newImage);
break; break;
} case 'square': } case 'square':
// FIXME: once we create the rect, we lose information that this was a square // TODO: once we create the rect, we lose information that this was a square
// (for resizing purposes this could be important) // (for resizing purposes this could be important)
// Fallthrough // Fallthrough
case 'rect': case 'rect':
@ -6169,7 +6169,7 @@ const changeSelectedAttributeNoUndo = function (attr, newValue, elems) {
} }
// only allow the transform/opacity/filter attribute to change on <g> elements, slightly hacky // only allow the transform/opacity/filter attribute to change on <g> elements, slightly hacky
// TODO: FIXME: Missing statement body // TODO: Missing statement body
// if (elem.tagName === 'g' && goodGAttrs.includes(attr)) {} // if (elem.tagName === 'g' && goodGAttrs.includes(attr)) {}
let oldval = attr === '#text' ? elem.textContent : elem.getAttribute(attr); let oldval = attr === '#text' ? elem.textContent : elem.getAttribute(attr);
if (isNullish(oldval)) { oldval = ''; } if (isNullish(oldval)) { oldval = ''; }

View File

@ -361,10 +361,10 @@ export default function jQueryPluginSVGIcons ($) {
/** /**
* *
* @param {boolean} [toImage] * @param {boolean} [toImage]
* @param {external:jQuery.svgIcons.Fallback} [fallback] * @param {external:jQuery.svgIcons.Fallback} [fallback=false]
* @returns {void} * @returns {void}
*/ */
function makeIcons (toImage = false, fallback) { function makeIcons (toImage = false, fallback = false) {
if (iconsMade) return; if (iconsMade) return;
if (opts.no_img) toImage = false; if (opts.no_img) toImage = false;

View File

@ -961,7 +961,7 @@ if (!('SVGPathSegList' in window) || !('appendItem' in window.SVGPathSegList.pro
}, },
enumerable: true enumerable: true
}, },
// FIXME: The following are not implemented and simply return SVGPathElement.pathSegList. // TODO: The following are not implemented and simply return SVGPathElement.pathSegList.
normalizedPathSegList: {get () { return this.pathSegList; }, enumerable: true}, normalizedPathSegList: {get () { return this.pathSegList; }, enumerable: true},
animatedPathSegList: {get () { return this.pathSegList; }, enumerable: true}, animatedPathSegList: {get () { return this.pathSegList; }, enumerable: true},
animatedNormalizedPathSegList: {get () { return this.pathSegList; }, enumerable: true} animatedNormalizedPathSegList: {get () { return this.pathSegList; }, enumerable: true}

View File

@ -395,7 +395,7 @@ export const walkTree = function (elem, cbFn) {
/** /**
* Walks the tree and executes the callback on each element in a depth-first fashion. * Walks the tree and executes the callback on each element in a depth-first fashion.
* @function module:utilities.walkTreePost * @function module:utilities.walkTreePost
* @todo FIXME: Shouldn't this be calling walkTreePost? * @todo Shouldn't this be calling walkTreePost?
* @param {Element} elem - DOM element to traverse * @param {Element} elem - DOM element to traverse
* @param {module:utilities.TreeWalker} cbFn - Callback function to run on each element * @param {module:utilities.TreeWalker} cbFn - Callback function to run on each element
* @returns {void} * @returns {void}
@ -1300,8 +1300,8 @@ export const snapToGrid = function (value) {
* @returns {string} * @returns {string}
*/ */
export const regexEscape = function (str) { export const regexEscape = function (str) {
// From: http://phpjs.org/functions // Originally from: http://phpjs.org/functions
return String(str).replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\-]', 'g'), '\\$&'); return String(str).replace(/[.\\+*?[^\]$(){}=!<>|:-]/g, '\\$&');
}; };
/** /**

View File

@ -231,6 +231,10 @@
} }
function _iterableToArrayLimit(arr, i) { function _iterableToArrayLimit(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;
@ -266,7 +270,7 @@
function _wrapRegExp(re, groups) { function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) { _wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups); return new BabelRegExp(re, undefined, groups);
}; };
var _RegExp = _wrapNativeSuper(RegExp); var _RegExp = _wrapNativeSuper(RegExp);
@ -275,10 +279,10 @@
var _groups = new WeakMap(); var _groups = new WeakMap();
function BabelRegExp(re, groups) { function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re); var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups); _groups.set(_this, groups || _groups.get(re));
return _this; return _this;
} }
@ -2739,7 +2743,7 @@
}, },
enumerable: true enumerable: true
}, },
// FIXME: The following are not implemented and simply return SVGPathElement.pathSegList. // TODO: The following are not implemented and simply return SVGPathElement.pathSegList.
normalizedPathSegList: { normalizedPathSegList: {
get: function get() { get: function get() {
return this.pathSegList; return this.pathSegList;
@ -4695,7 +4699,7 @@
}, { }, {
key: "addCommandToHistory", key: "addCommandToHistory",
value: function addCommandToHistory(cmd) { value: function addCommandToHistory(cmd) {
// FIXME: we MUST compress consecutive text changes to the same element // TODO: we MUST compress consecutive text changes to the same element
// (right now each keystroke is saved as a separate command that includes the // (right now each keystroke is saved as a separate command that includes the
// entire text contents of the text element) // entire text contents of the text element)
// TODO: consider limiting the history that we store here (need to do some slicing) // TODO: consider limiting the history that we store here (need to do some slicing)
@ -8384,7 +8388,7 @@
/** /**
* Walks the tree and executes the callback on each element in a depth-first fashion. * Walks the tree and executes the callback on each element in a depth-first fashion.
* @function module:utilities.walkTreePost * @function module:utilities.walkTreePost
* @todo FIXME: Shouldn't this be calling walkTreePost? * @todo Shouldn't this be calling walkTreePost?
* @param {Element} elem - DOM element to traverse * @param {Element} elem - DOM element to traverse
* @param {module:utilities.TreeWalker} cbFn - Callback function to run on each element * @param {module:utilities.TreeWalker} cbFn - Callback function to run on each element
* @returns {void} * @returns {void}
@ -9364,8 +9368,8 @@
*/ */
var regexEscape = function regexEscape(str) { var regexEscape = function regexEscape(str) {
// From: http://phpjs.org/functions // Originally from: http://phpjs.org/functions
return String(str).replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\-]', 'g'), '\\$&'); return String(str).replace(/[.\\+*?[^\]$(){}=!<>|:-]/g, '\\$&');
}; };
/** /**
* Prevents default browser click behaviour on the given element. * Prevents default browser click behaviour on the given element.
@ -11827,7 +11831,7 @@
} else { } else {
// remove all children from this node and insert them before this node // remove all children from this node and insert them before this node
// FIXME: in the case of animation elements this will hardly ever be correct // TODO: in the case of animation elements this will hardly ever be correct
var children = []; var children = [];
while (node.hasChildNodes()) { while (node.hasChildNodes()) {
@ -12507,7 +12511,7 @@
if (Math.abs(a) > 1.0e-10) { if (Math.abs(a) > 1.0e-10) {
s = Math.sin(a) / (1 - Math.cos(a)); s = Math.sin(a) / (1 - Math.cos(a));
} else { } else {
// FIXME: This blows up if the angle is exactly 0! // TODO: This blows up if the angle is exactly 0!
s = 2 / a; s = 2 / a;
} }
@ -12868,7 +12872,7 @@
} // else, it's a non-group } // else, it's a non-group
} else { } else {
// FIXME: box might be null for some elements (<metadata> etc), need to handle this // TODO: box might be null for some elements (<metadata> etc), need to handle this
var _box = getBBox(selected); // Paths (and possbly other shapes) will have no BBox while still in <defs>, var _box = getBBox(selected); // Paths (and possbly other shapes) will have no BBox while still in <defs>,
// but we still may need to recalculate them (see issue 595). // but we still may need to recalculate them (see issue 595).
// TODO: Figure out how to get BBox from these elements in case they // TODO: Figure out how to get BBox from these elements in case they
@ -12892,7 +12896,7 @@
var _a = _angle * Math.PI / 180; var _a = _angle * Math.PI / 180;
var _s = Math.abs(_a) > 1.0e-10 ? Math.sin(_a) / (1 - Math.cos(_a)) // FIXME: This blows up if the angle is exactly 0! var _s = Math.abs(_a) > 1.0e-10 ? Math.sin(_a) / (1 - Math.cos(_a)) // TODO: This blows up if the angle is exactly 0!
: 2 / _a; : 2 / _a;
for (var _i2 = 0; _i2 < tlist.numberOfItems; ++_i2) { for (var _i2 = 0; _i2 < tlist.numberOfItems; ++_i2) {
@ -15611,19 +15615,38 @@
if (!rightClick) { if (!rightClick) {
// insert a dummy transform so if the element(s) are moved it will have // insert a dummy transform so if the element(s) are moved it will have
// a transform to use for its translate // a transform to use for its translate
for (var _i2 = 0, _selectedElements = selectedElements; _i2 < _selectedElements.length; _i2++) { var _iteratorNormalCompletion = true;
var selectedElement = _selectedElements[_i2]; var _didIteratorError = false;
var _iteratorError = undefined;
if (isNullish(selectedElement)) { try {
continue; for (var _iterator = selectedElements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var selectedElement = _step.value;
if (isNullish(selectedElement)) {
continue;
}
var slist = getTransformList(selectedElement);
if (slist.numberOfItems) {
slist.insertItemBefore(svgroot.createSVGTransform(), 0);
} else {
slist.appendItem(svgroot.createSVGTransform());
}
} }
} catch (err) {
var slist = getTransformList(selectedElement); _didIteratorError = true;
_iteratorError = err;
if (slist.numberOfItems) { } finally {
slist.insertItemBefore(svgroot.createSVGTransform(), 0); try {
} else { if (!_iteratorNormalCompletion && _iterator["return"] != null) {
slist.appendItem(svgroot.createSVGTransform()); _iterator["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
} }
} }
} }
@ -15787,7 +15810,7 @@
break; break;
} }
case 'square': // FIXME: once we create the rect, we lose information that this was a square case 'square': // TODO: once we create the rect, we lose information that this was a square
// (for resizing purposes this could be important) // (for resizing purposes this could be important)
// Fallthrough // Fallthrough
@ -17729,11 +17752,11 @@
} }
}); });
}); });
var _i3 = attrs.length; var _i2 = attrs.length;
var attrNames = ['width', 'height', 'xmlns', 'x', 'y', 'viewBox', 'id', 'overflow']; var attrNames = ['width', 'height', 'xmlns', 'x', 'y', 'viewBox', 'id', 'overflow'];
while (_i3--) { while (_i2--) {
var attr = attrs[_i3]; var attr = attrs[_i2];
var attrVal = toXml(attr.value); // Namespaces have already been dealt with, so skip var attrVal = toXml(attr.value); // Namespaces have already been dealt with, so skip
if (attr.nodeName.startsWith('xmlns:')) { if (attr.nodeName.startsWith('xmlns:')) {
@ -17759,8 +17782,8 @@
var mozAttrs = ['-moz-math-font-style', '_moz-math-font-style']; var mozAttrs = ['-moz-math-font-style', '_moz-math-font-style'];
for (var _i4 = attrs.length - 1; _i4 >= 0; _i4--) { for (var _i3 = attrs.length - 1; _i3 >= 0; _i3--) {
var _attr = attrs[_i4]; var _attr = attrs[_i3];
var _attrVal = toXml(_attr.value); // remove bogus attributes added by Gecko var _attrVal = toXml(_attr.value); // remove bogus attributes added by Gecko
@ -17816,14 +17839,14 @@
indent++; indent++;
var bOneLine = false; var bOneLine = false;
for (var _i5 = 0; _i5 < childs.length; _i5++) { for (var _i4 = 0; _i4 < childs.length; _i4++) {
var child = childs.item(_i5); var child = childs.item(_i4);
switch (child.nodeType) { switch (child.nodeType) {
case 1: case 1:
// element node // element node
out.push('\n'); out.push('\n');
out.push(this.svgToString(childs.item(_i5), indent)); out.push(this.svgToString(childs.item(_i4), indent));
break; break;
case 3: case 3:
@ -17865,7 +17888,7 @@
if (!bOneLine) { if (!bOneLine) {
out.push('\n'); out.push('\n');
for (var _i6 = 0; _i6 < indent; _i6++) { for (var _i5 = 0; _i5 < indent; _i5++) {
out.push(' '); out.push(' ');
} }
} }
@ -18941,27 +18964,27 @@
} }
var attrs = svg.attributes; var attrs = svg.attributes;
var _iteratorNormalCompletion = true; var _iteratorNormalCompletion2 = true;
var _didIteratorError = false; var _didIteratorError2 = false;
var _iteratorError = undefined; var _iteratorError2 = undefined;
try { try {
for (var _iterator = attrs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { for (var _iterator2 = attrs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var attr = _step.value; var attr = _step2.value;
// Ok for `NamedNodeMap` // Ok for `NamedNodeMap`
symbol.setAttribute(attr.nodeName, attr.value); symbol.setAttribute(attr.nodeName, attr.value);
} }
} catch (err) { } catch (err) {
_didIteratorError = true; _didIteratorError2 = true;
_iteratorError = err; _iteratorError2 = err;
} finally { } finally {
try { try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) { if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator["return"](); _iterator2["return"]();
} }
} finally { } finally {
if (_didIteratorError) { if (_didIteratorError2) {
throw _iteratorError; throw _iteratorError2;
} }
} }
} }
@ -19186,29 +19209,29 @@
elem = $$9(elem).data('gsvg') || $$9(elem).data('symbol') || elem; elem = $$9(elem).data('gsvg') || $$9(elem).data('symbol') || elem;
var childs = elem.childNodes; var childs = elem.childNodes;
var _iteratorNormalCompletion2 = true; var _iteratorNormalCompletion3 = true;
var _didIteratorError2 = false; var _didIteratorError3 = false;
var _iteratorError2 = undefined; var _iteratorError3 = undefined;
try { try {
for (var _iterator2 = childs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
var child = _step2.value; var child = _step3.value;
if (child.nodeName === 'title') { if (child.nodeName === 'title') {
return child.textContent; return child.textContent;
} }
} }
} catch (err) { } catch (err) {
_didIteratorError2 = true; _didIteratorError3 = true;
_iteratorError2 = err; _iteratorError3 = err;
} finally { } finally {
try { try {
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) { if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) {
_iterator2["return"](); _iterator3["return"]();
} }
} finally { } finally {
if (_didIteratorError2) { if (_didIteratorError3) {
throw _iteratorError2; throw _iteratorError3;
} }
} }
} }
@ -19276,13 +19299,13 @@
var docTitle = false, var docTitle = false,
oldTitle = ''; oldTitle = '';
var batchCmd = new BatchCommand$1('Change Image Title'); var batchCmd = new BatchCommand$1('Change Image Title');
var _iteratorNormalCompletion3 = true; var _iteratorNormalCompletion4 = true;
var _didIteratorError3 = false; var _didIteratorError4 = false;
var _iteratorError3 = undefined; var _iteratorError4 = undefined;
try { try {
for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { for (var _iterator4 = childs[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
var child = _step3.value; var child = _step4.value;
if (child.nodeName === 'title') { if (child.nodeName === 'title') {
docTitle = child; docTitle = child;
@ -19291,16 +19314,16 @@
} }
} }
} catch (err) { } catch (err) {
_didIteratorError3 = true; _didIteratorError4 = true;
_iteratorError3 = err; _iteratorError4 = err;
} finally { } finally {
try { try {
if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) { if (!_iteratorNormalCompletion4 && _iterator4["return"] != null) {
_iterator3["return"](); _iterator4["return"]();
} }
} finally { } finally {
if (_didIteratorError3) { if (_didIteratorError4) {
throw _iteratorError3; throw _iteratorError4;
} }
} }
} }
@ -20609,7 +20632,7 @@
canvas.moveSelectedElements(diffX * currentZoom, diffY * currentZoom, true); canvas.moveSelectedElements(diffX * currentZoom, diffY * currentZoom, true);
return "continue"; return "continue";
} // only allow the transform/opacity/filter attribute to change on <g> elements, slightly hacky } // only allow the transform/opacity/filter attribute to change on <g> elements, slightly hacky
// TODO: FIXME: Missing statement body // TODO: Missing statement body
// if (elem.tagName === 'g' && goodGAttrs.includes(attr)) {} // if (elem.tagName === 'g' && goodGAttrs.includes(attr)) {}
@ -21288,9 +21311,9 @@
this.moveToTopSelectedElement = function () { this.moveToTopSelectedElement = function () {
var _selectedElements2 = selectedElements, var _selectedElements = selectedElements,
_selectedElements3 = _slicedToArray(_selectedElements2, 1), _selectedElements2 = _slicedToArray(_selectedElements, 1),
selected = _selectedElements3[0]; selected = _selectedElements2[0];
if (!isNullish(selected)) { if (!isNullish(selected)) {
var t = selected; var t = selected;
@ -21315,9 +21338,9 @@
this.moveToBottomSelectedElement = function () { this.moveToBottomSelectedElement = function () {
var _selectedElements4 = selectedElements, var _selectedElements3 = selectedElements,
_selectedElements5 = _slicedToArray(_selectedElements4, 1), _selectedElements4 = _slicedToArray(_selectedElements3, 1),
selected = _selectedElements5[0]; selected = _selectedElements4[0];
if (!isNullish(selected)) { if (!isNullish(selected)) {
var t = selected; var t = selected;
@ -21625,45 +21648,45 @@
var dx = new Array(len); var dx = new Array(len);
var dy = new Array(len); var dy = new Array(len);
for (var _i7 = 0; _i7 < len; ++_i7) { for (var _i6 = 0; _i6 < len; ++_i6) {
if (isNullish(selectedElements[_i7])) { if (isNullish(selectedElements[_i6])) {
break; break;
} // const elem = selectedElements[i]; } // const elem = selectedElements[i];
var bbox = bboxes[_i7]; var bbox = bboxes[_i6];
dx[_i7] = 0; dx[_i6] = 0;
dy[_i7] = 0; dy[_i6] = 0;
switch (type) { switch (type) {
case 'l': case 'l':
// left (horizontal) // left (horizontal)
dx[_i7] = minx - bbox.x; dx[_i6] = minx - bbox.x;
break; break;
case 'c': case 'c':
// center (horizontal) // center (horizontal)
dx[_i7] = (minx + maxx) / 2 - (bbox.x + bbox.width / 2); dx[_i6] = (minx + maxx) / 2 - (bbox.x + bbox.width / 2);
break; break;
case 'r': case 'r':
// right (horizontal) // right (horizontal)
dx[_i7] = maxx - (bbox.x + bbox.width); dx[_i6] = maxx - (bbox.x + bbox.width);
break; break;
case 't': case 't':
// top (vertical) // top (vertical)
dy[_i7] = miny - bbox.y; dy[_i6] = miny - bbox.y;
break; break;
case 'm': case 'm':
// middle (vertical) // middle (vertical)
dy[_i7] = (miny + maxy) / 2 - (bbox.y + bbox.height / 2); dy[_i6] = (miny + maxy) / 2 - (bbox.y + bbox.height / 2);
break; break;
case 'b': case 'b':
// bottom (vertical) // bottom (vertical)
dy[_i7] = maxy - (bbox.y + bbox.height); dy[_i6] = maxy - (bbox.y + bbox.height);
break; break;
} }
} }
@ -22829,14 +22852,14 @@
/** /**
* *
* @param {boolean} [toImage] * @param {boolean} [toImage]
* @param {external:jQuery.svgIcons.Fallback} [fallback] * @param {external:jQuery.svgIcons.Fallback} [fallback=false]
* @returns {void} * @returns {void}
*/ */
function makeIcons() { function makeIcons() {
var toImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var toImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
var fallback = arguments.length > 1 ? arguments[1] : undefined; var fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
if (iconsMade) return; if (iconsMade) return;
if (opts.no_img) toImage = false; if (opts.no_img) toImage = false;
var tempHolder; var tempHolder;
@ -30171,90 +30194,90 @@
}, },
'div#workarea': { 'div#workarea': {
left: 38, left: 38,
top: 74 // '#tools_bottom': { top: 74
// left: {s: '27px', l: '46px', xl: '65px'}, } // '#tools_bottom': {
// height: {s: '58px', l: '98px', xl: '145px'} // left: {s: '27px', l: '46px', xl: '65px'},
// }, // height: {s: '58px', l: '98px', xl: '145px'}
// '#color_tools': { // },
// 'border-spacing': {s: '0 1px'}, // '#color_tools': {
// 'margin-top': {s: '-1px'} // 'border-spacing': {s: '0 1px'},
// }, // 'margin-top': {s: '-1px'}
// '#color_tools .icon_label': { // },
// width: {l:'43px', xl: '60px'} // '#color_tools .icon_label': {
// }, // width: {l:'43px', xl: '60px'}
// '.color_tool': { // },
// height: {s: '20px'} // '.color_tool': {
// }, // height: {s: '20px'}
// '#tool_opacity': { // },
// top: {s: '1px'}, // '#tool_opacity': {
// height: {s: 'auto', l:'auto', xl:'auto'} // top: {s: '1px'},
// }, // height: {s: 'auto', l:'auto', xl:'auto'}
// '#tools_top input, #tools_bottom input': { // },
// 'margin-top': {s: '2px', l: '4px', xl: '5px'}, // '#tools_top input, #tools_bottom input': {
// height: {s: 'auto', l: 'auto', xl: 'auto'}, // 'margin-top': {s: '2px', l: '4px', xl: '5px'},
// border: {s: '1px solid #555', l: 'auto', xl: 'auto'}, // height: {s: 'auto', l: 'auto', xl: 'auto'},
// 'font-size': {s: '.9em', l: '1.2em', xl: '1.4em'} // border: {s: '1px solid #555', l: 'auto', xl: 'auto'},
// }, // 'font-size': {s: '.9em', l: '1.2em', xl: '1.4em'}
// '#zoom_panel': { // },
// 'margin-top': {s: '3px', l: '4px', xl: '5px'} // '#zoom_panel': {
// }, // 'margin-top': {s: '3px', l: '4px', xl: '5px'}
// '#copyright, #tools_bottom .label': { // },
// 'font-size': {l: '1.5em', xl: '2em'}, // '#copyright, #tools_bottom .label': {
// 'line-height': {s: '15px'} // 'font-size': {l: '1.5em', xl: '2em'},
// }, // 'line-height': {s: '15px'}
// '#tools_bottom_2': { // },
// width: {l: '295px', xl: '355px'}, // '#tools_bottom_2': {
// top: {s: '4px'} // width: {l: '295px', xl: '355px'},
// }, // top: {s: '4px'}
// '#tools_top > div, #tools_top': { // },
// 'line-height': {s: '17px', l: '34px', xl: '50px'} // '#tools_top > div, #tools_top': {
// }, // 'line-height': {s: '17px', l: '34px', xl: '50px'}
// '.dropdown button': { // },
// height: {s: '18px', l: '34px', xl: '40px'}, // '.dropdown button': {
// 'line-height': {s: '18px', l: '34px', xl: '40px'}, // height: {s: '18px', l: '34px', xl: '40px'},
// 'margin-top': {s: '3px'} // 'line-height': {s: '18px', l: '34px', xl: '40px'},
// }, // 'margin-top': {s: '3px'}
// '#tools_top label, #tools_bottom label': { // },
// 'font-size': {s: '1em', l: '1.5em', xl: '2em'}, // '#tools_top label, #tools_bottom label': {
// height: {s: '25px', l: '42px', xl: '64px'} // 'font-size': {s: '1em', l: '1.5em', xl: '2em'},
// }, // height: {s: '25px', l: '42px', xl: '64px'}
// 'div.toolset': { // },
// height: {s: '25px', l: '42px', xl: '64px'} // 'div.toolset': {
// }, // height: {s: '25px', l: '42px', xl: '64px'}
// '#tool_bold, #tool_italic': { // },
// 'font-size': {s: '1.5em', l: '3em', xl: '4.5em'} // '#tool_bold, #tool_italic': {
// }, // 'font-size': {s: '1.5em', l: '3em', xl: '4.5em'}
// '#sidepanels': { // },
// top: {s: '50px', l: '88px', xl: '125px'}, // '#sidepanels': {
// bottom: {s: '51px', l: '68px', xl: '65px'} // top: {s: '50px', l: '88px', xl: '125px'},
// }, // bottom: {s: '51px', l: '68px', xl: '65px'}
// '#layerbuttons': { // },
// width: {l: '130px', xl: '175px'}, // '#layerbuttons': {
// height: {l: '24px', xl: '30px'} // width: {l: '130px', xl: '175px'},
// }, // height: {l: '24px', xl: '30px'}
// '#layerlist': { // },
// width: {l: '128px', xl: '150px'} // '#layerlist': {
// }, // width: {l: '128px', xl: '150px'}
// '.layer_button': { // },
// width: {l: '19px', xl: '28px'}, // '.layer_button': {
// height: {l: '19px', xl: '28px'} // width: {l: '19px', xl: '28px'},
// }, // height: {l: '19px', xl: '28px'}
// 'input.spin-button': { // },
// 'background-image': {l: 'url('images/spinbtn_updn_big.png')', xl: 'url('images/spinbtn_updn_big.png')'}, // 'input.spin-button': {
// 'background-position': {l: '100% -5px', xl: '100% -2px'}, // 'background-image': {l: 'url('images/spinbtn_updn_big.png')', xl: 'url('images/spinbtn_updn_big.png')'},
// 'padding-right': {l: '24px', xl: '24px' } // 'background-position': {l: '100% -5px', xl: '100% -2px'},
// }, // 'padding-right': {l: '24px', xl: '24px' }
// 'input.spin-button.up': { // },
// 'background-position': {l: '100% -45px', xl: '100% -42px'} // 'input.spin-button.up': {
// }, // 'background-position': {l: '100% -45px', xl: '100% -42px'}
// 'input.spin-button.down': { // },
// 'background-position': {l: '100% -85px', xl: '100% -82px'} // 'input.spin-button.down': {
// }, // 'background-position': {l: '100% -85px', xl: '100% -82px'}
// '#position_opts': { // },
// width: {all: (size_num*4) +'px'} // '#position_opts': {
// } // width: {all: (size_num*4) +'px'}
// }
}
}; };
var ruleElem = $$b('#tool_size_rules'); var ruleElem = $$b('#tool_size_rules');
@ -30758,7 +30781,7 @@
var num = 5 - $$b('#layerlist tr.layer').size(); var num = 5 - $$b('#layerlist tr.layer').size();
while (num-- > 0) { while (num-- > 0) {
// FIXME: there must a better way to do this // TODO: there must a better way to do this
layerlist.append('<tr><td style="color:white">_</td><td/></tr>'); layerlist.append('<tr><td style="color:white">_</td><td/></tr>');
} }
}; };

1383
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -76,25 +76,25 @@
], ],
"dependencies": {}, "dependencies": {},
"devDependencies": { "devDependencies": {
"@babel/core": "^7.5.5", "@babel/core": "^7.6.0",
"@babel/node": "^7.5.5", "@babel/node": "^7.6.1",
"@babel/plugin-transform-modules-commonjs": "^7.5.0", "@babel/plugin-transform-modules-commonjs": "^7.6.0",
"@babel/plugin-transform-named-capturing-groups-regex": "^7.4.5", "@babel/plugin-transform-named-capturing-groups-regex": "^7.6.0",
"@babel/preset-env": "^7.5.5", "@babel/preset-env": "^7.6.0",
"@mysticatea/eslint-plugin": "^11.0.0", "@mysticatea/eslint-plugin": "^12.0.0",
"axe-core": "^3.3.2", "axe-core": "^3.3.2",
"axe-testcafe": "^3.0.0", "axe-testcafe": "^3.0.0",
"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.2.1", "core-js-bundle": "^3.2.1",
"eslint": "6.3.0", "eslint": "6.4.0",
"eslint-config-ash-nazg": "8.9.0", "eslint-config-ash-nazg": "9.0.1",
"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": "^15.9.1", "eslint-plugin-jsdoc": "^15.9.2",
"eslint-plugin-markdown": "^1.0.0", "eslint-plugin-markdown": "^1.0.0",
"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",
@ -103,8 +103,8 @@
"eslint-plugin-sonarjs": "^0.4.0", "eslint-plugin-sonarjs": "^0.4.0",
"eslint-plugin-standard": "4.0.1", "eslint-plugin-standard": "4.0.1",
"eslint-plugin-testcafe": "^0.2.1", "eslint-plugin-testcafe": "^0.2.1",
"eslint-plugin-unicorn": "^10.0.0", "eslint-plugin-unicorn": "^11.0.1",
"imageoptim-cli": "^2.3.9", "imageoptim-cli": "^3.0.0",
"jamilih": "^0.45.0", "jamilih": "^0.45.0",
"jsdoc": "^3.6.3", "jsdoc": "^3.6.3",
"load-stylesheets": "^0.8.0", "load-stylesheets": "^0.8.0",
@ -117,13 +117,13 @@
"regenerator-runtime": "^0.13.3", "regenerator-runtime": "^0.13.3",
"remark-cli": "^7.0.0", "remark-cli": "^7.0.0",
"remark-lint-ordered-list-marker-value": "^1.0.3", "remark-lint-ordered-list-marker-value": "^1.0.3",
"rollup": "1.20.3", "rollup": "1.21.4",
"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.1", "rollup-plugin-terser": "^5.1.2",
"sinon": "^7.4.2", "sinon": "^7.4.2",
"sinon-test": "^2.4.0", "sinon-test": "^2.4.0",
"stackblur-canvas": "^2.2.0", "stackblur-canvas": "^2.2.0",
"testcafe": "^1.4.3" "testcafe": "^1.5.0"
} }
} }

View File

@ -231,6 +231,10 @@
} }
function _iterableToArrayLimit(arr, i) { function _iterableToArrayLimit(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;
@ -266,7 +270,7 @@
function _wrapRegExp(re, groups) { function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) { _wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups); return new BabelRegExp(re, undefined, groups);
}; };
var _RegExp = _wrapNativeSuper(RegExp); var _RegExp = _wrapNativeSuper(RegExp);
@ -275,10 +279,10 @@
var _groups = new WeakMap(); var _groups = new WeakMap();
function BabelRegExp(re, groups) { function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re); var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups); _groups.set(_this, groups || _groups.get(re));
return _this; return _this;
} }
@ -2739,7 +2743,7 @@
}, },
enumerable: true enumerable: true
}, },
// FIXME: The following are not implemented and simply return SVGPathElement.pathSegList. // TODO: The following are not implemented and simply return SVGPathElement.pathSegList.
normalizedPathSegList: { normalizedPathSegList: {
get: function get() { get: function get() {
return this.pathSegList; return this.pathSegList;
@ -4695,7 +4699,7 @@
}, { }, {
key: "addCommandToHistory", key: "addCommandToHistory",
value: function addCommandToHistory(cmd) { value: function addCommandToHistory(cmd) {
// FIXME: we MUST compress consecutive text changes to the same element // TODO: we MUST compress consecutive text changes to the same element
// (right now each keystroke is saved as a separate command that includes the // (right now each keystroke is saved as a separate command that includes the
// entire text contents of the text element) // entire text contents of the text element)
// TODO: consider limiting the history that we store here (need to do some slicing) // TODO: consider limiting the history that we store here (need to do some slicing)
@ -8384,7 +8388,7 @@
/** /**
* Walks the tree and executes the callback on each element in a depth-first fashion. * Walks the tree and executes the callback on each element in a depth-first fashion.
* @function module:utilities.walkTreePost * @function module:utilities.walkTreePost
* @todo FIXME: Shouldn't this be calling walkTreePost? * @todo Shouldn't this be calling walkTreePost?
* @param {Element} elem - DOM element to traverse * @param {Element} elem - DOM element to traverse
* @param {module:utilities.TreeWalker} cbFn - Callback function to run on each element * @param {module:utilities.TreeWalker} cbFn - Callback function to run on each element
* @returns {void} * @returns {void}
@ -9364,8 +9368,8 @@
*/ */
var regexEscape = function regexEscape(str) { var regexEscape = function regexEscape(str) {
// From: http://phpjs.org/functions // Originally from: http://phpjs.org/functions
return String(str).replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\-]', 'g'), '\\$&'); return String(str).replace(/[.\\+*?[^\]$(){}=!<>|:-]/g, '\\$&');
}; };
/** /**
* Prevents default browser click behaviour on the given element. * Prevents default browser click behaviour on the given element.
@ -11827,7 +11831,7 @@
} else { } else {
// remove all children from this node and insert them before this node // remove all children from this node and insert them before this node
// FIXME: in the case of animation elements this will hardly ever be correct // TODO: in the case of animation elements this will hardly ever be correct
var children = []; var children = [];
while (node.hasChildNodes()) { while (node.hasChildNodes()) {
@ -12507,7 +12511,7 @@
if (Math.abs(a) > 1.0e-10) { if (Math.abs(a) > 1.0e-10) {
s = Math.sin(a) / (1 - Math.cos(a)); s = Math.sin(a) / (1 - Math.cos(a));
} else { } else {
// FIXME: This blows up if the angle is exactly 0! // TODO: This blows up if the angle is exactly 0!
s = 2 / a; s = 2 / a;
} }
@ -12868,7 +12872,7 @@
} // else, it's a non-group } // else, it's a non-group
} else { } else {
// FIXME: box might be null for some elements (<metadata> etc), need to handle this // TODO: box might be null for some elements (<metadata> etc), need to handle this
var _box = getBBox(selected); // Paths (and possbly other shapes) will have no BBox while still in <defs>, var _box = getBBox(selected); // Paths (and possbly other shapes) will have no BBox while still in <defs>,
// but we still may need to recalculate them (see issue 595). // but we still may need to recalculate them (see issue 595).
// TODO: Figure out how to get BBox from these elements in case they // TODO: Figure out how to get BBox from these elements in case they
@ -12892,7 +12896,7 @@
var _a = _angle * Math.PI / 180; var _a = _angle * Math.PI / 180;
var _s = Math.abs(_a) > 1.0e-10 ? Math.sin(_a) / (1 - Math.cos(_a)) // FIXME: This blows up if the angle is exactly 0! var _s = Math.abs(_a) > 1.0e-10 ? Math.sin(_a) / (1 - Math.cos(_a)) // TODO: This blows up if the angle is exactly 0!
: 2 / _a; : 2 / _a;
for (var _i2 = 0; _i2 < tlist.numberOfItems; ++_i2) { for (var _i2 = 0; _i2 < tlist.numberOfItems; ++_i2) {
@ -15611,19 +15615,38 @@
if (!rightClick) { if (!rightClick) {
// insert a dummy transform so if the element(s) are moved it will have // insert a dummy transform so if the element(s) are moved it will have
// a transform to use for its translate // a transform to use for its translate
for (var _i2 = 0, _selectedElements = selectedElements; _i2 < _selectedElements.length; _i2++) { var _iteratorNormalCompletion = true;
var selectedElement = _selectedElements[_i2]; var _didIteratorError = false;
var _iteratorError = undefined;
if (isNullish(selectedElement)) { try {
continue; for (var _iterator = selectedElements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var selectedElement = _step.value;
if (isNullish(selectedElement)) {
continue;
}
var slist = getTransformList(selectedElement);
if (slist.numberOfItems) {
slist.insertItemBefore(svgroot.createSVGTransform(), 0);
} else {
slist.appendItem(svgroot.createSVGTransform());
}
} }
} catch (err) {
var slist = getTransformList(selectedElement); _didIteratorError = true;
_iteratorError = err;
if (slist.numberOfItems) { } finally {
slist.insertItemBefore(svgroot.createSVGTransform(), 0); try {
} else { if (!_iteratorNormalCompletion && _iterator["return"] != null) {
slist.appendItem(svgroot.createSVGTransform()); _iterator["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
} }
} }
} }
@ -15787,7 +15810,7 @@
break; break;
} }
case 'square': // FIXME: once we create the rect, we lose information that this was a square case 'square': // TODO: once we create the rect, we lose information that this was a square
// (for resizing purposes this could be important) // (for resizing purposes this could be important)
// Fallthrough // Fallthrough
@ -17729,11 +17752,11 @@
} }
}); });
}); });
var _i3 = attrs.length; var _i2 = attrs.length;
var attrNames = ['width', 'height', 'xmlns', 'x', 'y', 'viewBox', 'id', 'overflow']; var attrNames = ['width', 'height', 'xmlns', 'x', 'y', 'viewBox', 'id', 'overflow'];
while (_i3--) { while (_i2--) {
var attr = attrs[_i3]; var attr = attrs[_i2];
var attrVal = toXml(attr.value); // Namespaces have already been dealt with, so skip var attrVal = toXml(attr.value); // Namespaces have already been dealt with, so skip
if (attr.nodeName.startsWith('xmlns:')) { if (attr.nodeName.startsWith('xmlns:')) {
@ -17759,8 +17782,8 @@
var mozAttrs = ['-moz-math-font-style', '_moz-math-font-style']; var mozAttrs = ['-moz-math-font-style', '_moz-math-font-style'];
for (var _i4 = attrs.length - 1; _i4 >= 0; _i4--) { for (var _i3 = attrs.length - 1; _i3 >= 0; _i3--) {
var _attr = attrs[_i4]; var _attr = attrs[_i3];
var _attrVal = toXml(_attr.value); // remove bogus attributes added by Gecko var _attrVal = toXml(_attr.value); // remove bogus attributes added by Gecko
@ -17816,14 +17839,14 @@
indent++; indent++;
var bOneLine = false; var bOneLine = false;
for (var _i5 = 0; _i5 < childs.length; _i5++) { for (var _i4 = 0; _i4 < childs.length; _i4++) {
var child = childs.item(_i5); var child = childs.item(_i4);
switch (child.nodeType) { switch (child.nodeType) {
case 1: case 1:
// element node // element node
out.push('\n'); out.push('\n');
out.push(this.svgToString(childs.item(_i5), indent)); out.push(this.svgToString(childs.item(_i4), indent));
break; break;
case 3: case 3:
@ -17865,7 +17888,7 @@
if (!bOneLine) { if (!bOneLine) {
out.push('\n'); out.push('\n');
for (var _i6 = 0; _i6 < indent; _i6++) { for (var _i5 = 0; _i5 < indent; _i5++) {
out.push(' '); out.push(' ');
} }
} }
@ -18941,27 +18964,27 @@
} }
var attrs = svg.attributes; var attrs = svg.attributes;
var _iteratorNormalCompletion = true; var _iteratorNormalCompletion2 = true;
var _didIteratorError = false; var _didIteratorError2 = false;
var _iteratorError = undefined; var _iteratorError2 = undefined;
try { try {
for (var _iterator = attrs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { for (var _iterator2 = attrs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var attr = _step.value; var attr = _step2.value;
// Ok for `NamedNodeMap` // Ok for `NamedNodeMap`
symbol.setAttribute(attr.nodeName, attr.value); symbol.setAttribute(attr.nodeName, attr.value);
} }
} catch (err) { } catch (err) {
_didIteratorError = true; _didIteratorError2 = true;
_iteratorError = err; _iteratorError2 = err;
} finally { } finally {
try { try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) { if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator["return"](); _iterator2["return"]();
} }
} finally { } finally {
if (_didIteratorError) { if (_didIteratorError2) {
throw _iteratorError; throw _iteratorError2;
} }
} }
} }
@ -19186,29 +19209,29 @@
elem = $$9(elem).data('gsvg') || $$9(elem).data('symbol') || elem; elem = $$9(elem).data('gsvg') || $$9(elem).data('symbol') || elem;
var childs = elem.childNodes; var childs = elem.childNodes;
var _iteratorNormalCompletion2 = true; var _iteratorNormalCompletion3 = true;
var _didIteratorError2 = false; var _didIteratorError3 = false;
var _iteratorError2 = undefined; var _iteratorError3 = undefined;
try { try {
for (var _iterator2 = childs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
var child = _step2.value; var child = _step3.value;
if (child.nodeName === 'title') { if (child.nodeName === 'title') {
return child.textContent; return child.textContent;
} }
} }
} catch (err) { } catch (err) {
_didIteratorError2 = true; _didIteratorError3 = true;
_iteratorError2 = err; _iteratorError3 = err;
} finally { } finally {
try { try {
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) { if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) {
_iterator2["return"](); _iterator3["return"]();
} }
} finally { } finally {
if (_didIteratorError2) { if (_didIteratorError3) {
throw _iteratorError2; throw _iteratorError3;
} }
} }
} }
@ -19276,13 +19299,13 @@
var docTitle = false, var docTitle = false,
oldTitle = ''; oldTitle = '';
var batchCmd = new BatchCommand$1('Change Image Title'); var batchCmd = new BatchCommand$1('Change Image Title');
var _iteratorNormalCompletion3 = true; var _iteratorNormalCompletion4 = true;
var _didIteratorError3 = false; var _didIteratorError4 = false;
var _iteratorError3 = undefined; var _iteratorError4 = undefined;
try { try {
for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { for (var _iterator4 = childs[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
var child = _step3.value; var child = _step4.value;
if (child.nodeName === 'title') { if (child.nodeName === 'title') {
docTitle = child; docTitle = child;
@ -19291,16 +19314,16 @@
} }
} }
} catch (err) { } catch (err) {
_didIteratorError3 = true; _didIteratorError4 = true;
_iteratorError3 = err; _iteratorError4 = err;
} finally { } finally {
try { try {
if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) { if (!_iteratorNormalCompletion4 && _iterator4["return"] != null) {
_iterator3["return"](); _iterator4["return"]();
} }
} finally { } finally {
if (_didIteratorError3) { if (_didIteratorError4) {
throw _iteratorError3; throw _iteratorError4;
} }
} }
} }
@ -20609,7 +20632,7 @@
canvas.moveSelectedElements(diffX * currentZoom, diffY * currentZoom, true); canvas.moveSelectedElements(diffX * currentZoom, diffY * currentZoom, true);
return "continue"; return "continue";
} // only allow the transform/opacity/filter attribute to change on <g> elements, slightly hacky } // only allow the transform/opacity/filter attribute to change on <g> elements, slightly hacky
// TODO: FIXME: Missing statement body // TODO: Missing statement body
// if (elem.tagName === 'g' && goodGAttrs.includes(attr)) {} // if (elem.tagName === 'g' && goodGAttrs.includes(attr)) {}
@ -21288,9 +21311,9 @@
this.moveToTopSelectedElement = function () { this.moveToTopSelectedElement = function () {
var _selectedElements2 = selectedElements, var _selectedElements = selectedElements,
_selectedElements3 = _slicedToArray(_selectedElements2, 1), _selectedElements2 = _slicedToArray(_selectedElements, 1),
selected = _selectedElements3[0]; selected = _selectedElements2[0];
if (!isNullish(selected)) { if (!isNullish(selected)) {
var t = selected; var t = selected;
@ -21315,9 +21338,9 @@
this.moveToBottomSelectedElement = function () { this.moveToBottomSelectedElement = function () {
var _selectedElements4 = selectedElements, var _selectedElements3 = selectedElements,
_selectedElements5 = _slicedToArray(_selectedElements4, 1), _selectedElements4 = _slicedToArray(_selectedElements3, 1),
selected = _selectedElements5[0]; selected = _selectedElements4[0];
if (!isNullish(selected)) { if (!isNullish(selected)) {
var t = selected; var t = selected;
@ -21625,45 +21648,45 @@
var dx = new Array(len); var dx = new Array(len);
var dy = new Array(len); var dy = new Array(len);
for (var _i7 = 0; _i7 < len; ++_i7) { for (var _i6 = 0; _i6 < len; ++_i6) {
if (isNullish(selectedElements[_i7])) { if (isNullish(selectedElements[_i6])) {
break; break;
} // const elem = selectedElements[i]; } // const elem = selectedElements[i];
var bbox = bboxes[_i7]; var bbox = bboxes[_i6];
dx[_i7] = 0; dx[_i6] = 0;
dy[_i7] = 0; dy[_i6] = 0;
switch (type) { switch (type) {
case 'l': case 'l':
// left (horizontal) // left (horizontal)
dx[_i7] = minx - bbox.x; dx[_i6] = minx - bbox.x;
break; break;
case 'c': case 'c':
// center (horizontal) // center (horizontal)
dx[_i7] = (minx + maxx) / 2 - (bbox.x + bbox.width / 2); dx[_i6] = (minx + maxx) / 2 - (bbox.x + bbox.width / 2);
break; break;
case 'r': case 'r':
// right (horizontal) // right (horizontal)
dx[_i7] = maxx - (bbox.x + bbox.width); dx[_i6] = maxx - (bbox.x + bbox.width);
break; break;
case 't': case 't':
// top (vertical) // top (vertical)
dy[_i7] = miny - bbox.y; dy[_i6] = miny - bbox.y;
break; break;
case 'm': case 'm':
// middle (vertical) // middle (vertical)
dy[_i7] = (miny + maxy) / 2 - (bbox.y + bbox.height / 2); dy[_i6] = (miny + maxy) / 2 - (bbox.y + bbox.height / 2);
break; break;
case 'b': case 'b':
// bottom (vertical) // bottom (vertical)
dy[_i7] = maxy - (bbox.y + bbox.height); dy[_i6] = maxy - (bbox.y + bbox.height);
break; break;
} }
} }
@ -22829,14 +22852,14 @@
/** /**
* *
* @param {boolean} [toImage] * @param {boolean} [toImage]
* @param {external:jQuery.svgIcons.Fallback} [fallback] * @param {external:jQuery.svgIcons.Fallback} [fallback=false]
* @returns {void} * @returns {void}
*/ */
function makeIcons() { function makeIcons() {
var toImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var toImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
var fallback = arguments.length > 1 ? arguments[1] : undefined; var fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
if (iconsMade) return; if (iconsMade) return;
if (opts.no_img) toImage = false; if (opts.no_img) toImage = false;
var tempHolder; var tempHolder;
@ -30171,90 +30194,90 @@
}, },
'div#workarea': { 'div#workarea': {
left: 38, left: 38,
top: 74 // '#tools_bottom': { top: 74
// left: {s: '27px', l: '46px', xl: '65px'}, } // '#tools_bottom': {
// height: {s: '58px', l: '98px', xl: '145px'} // left: {s: '27px', l: '46px', xl: '65px'},
// }, // height: {s: '58px', l: '98px', xl: '145px'}
// '#color_tools': { // },
// 'border-spacing': {s: '0 1px'}, // '#color_tools': {
// 'margin-top': {s: '-1px'} // 'border-spacing': {s: '0 1px'},
// }, // 'margin-top': {s: '-1px'}
// '#color_tools .icon_label': { // },
// width: {l:'43px', xl: '60px'} // '#color_tools .icon_label': {
// }, // width: {l:'43px', xl: '60px'}
// '.color_tool': { // },
// height: {s: '20px'} // '.color_tool': {
// }, // height: {s: '20px'}
// '#tool_opacity': { // },
// top: {s: '1px'}, // '#tool_opacity': {
// height: {s: 'auto', l:'auto', xl:'auto'} // top: {s: '1px'},
// }, // height: {s: 'auto', l:'auto', xl:'auto'}
// '#tools_top input, #tools_bottom input': { // },
// 'margin-top': {s: '2px', l: '4px', xl: '5px'}, // '#tools_top input, #tools_bottom input': {
// height: {s: 'auto', l: 'auto', xl: 'auto'}, // 'margin-top': {s: '2px', l: '4px', xl: '5px'},
// border: {s: '1px solid #555', l: 'auto', xl: 'auto'}, // height: {s: 'auto', l: 'auto', xl: 'auto'},
// 'font-size': {s: '.9em', l: '1.2em', xl: '1.4em'} // border: {s: '1px solid #555', l: 'auto', xl: 'auto'},
// }, // 'font-size': {s: '.9em', l: '1.2em', xl: '1.4em'}
// '#zoom_panel': { // },
// 'margin-top': {s: '3px', l: '4px', xl: '5px'} // '#zoom_panel': {
// }, // 'margin-top': {s: '3px', l: '4px', xl: '5px'}
// '#copyright, #tools_bottom .label': { // },
// 'font-size': {l: '1.5em', xl: '2em'}, // '#copyright, #tools_bottom .label': {
// 'line-height': {s: '15px'} // 'font-size': {l: '1.5em', xl: '2em'},
// }, // 'line-height': {s: '15px'}
// '#tools_bottom_2': { // },
// width: {l: '295px', xl: '355px'}, // '#tools_bottom_2': {
// top: {s: '4px'} // width: {l: '295px', xl: '355px'},
// }, // top: {s: '4px'}
// '#tools_top > div, #tools_top': { // },
// 'line-height': {s: '17px', l: '34px', xl: '50px'} // '#tools_top > div, #tools_top': {
// }, // 'line-height': {s: '17px', l: '34px', xl: '50px'}
// '.dropdown button': { // },
// height: {s: '18px', l: '34px', xl: '40px'}, // '.dropdown button': {
// 'line-height': {s: '18px', l: '34px', xl: '40px'}, // height: {s: '18px', l: '34px', xl: '40px'},
// 'margin-top': {s: '3px'} // 'line-height': {s: '18px', l: '34px', xl: '40px'},
// }, // 'margin-top': {s: '3px'}
// '#tools_top label, #tools_bottom label': { // },
// 'font-size': {s: '1em', l: '1.5em', xl: '2em'}, // '#tools_top label, #tools_bottom label': {
// height: {s: '25px', l: '42px', xl: '64px'} // 'font-size': {s: '1em', l: '1.5em', xl: '2em'},
// }, // height: {s: '25px', l: '42px', xl: '64px'}
// 'div.toolset': { // },
// height: {s: '25px', l: '42px', xl: '64px'} // 'div.toolset': {
// }, // height: {s: '25px', l: '42px', xl: '64px'}
// '#tool_bold, #tool_italic': { // },
// 'font-size': {s: '1.5em', l: '3em', xl: '4.5em'} // '#tool_bold, #tool_italic': {
// }, // 'font-size': {s: '1.5em', l: '3em', xl: '4.5em'}
// '#sidepanels': { // },
// top: {s: '50px', l: '88px', xl: '125px'}, // '#sidepanels': {
// bottom: {s: '51px', l: '68px', xl: '65px'} // top: {s: '50px', l: '88px', xl: '125px'},
// }, // bottom: {s: '51px', l: '68px', xl: '65px'}
// '#layerbuttons': { // },
// width: {l: '130px', xl: '175px'}, // '#layerbuttons': {
// height: {l: '24px', xl: '30px'} // width: {l: '130px', xl: '175px'},
// }, // height: {l: '24px', xl: '30px'}
// '#layerlist': { // },
// width: {l: '128px', xl: '150px'} // '#layerlist': {
// }, // width: {l: '128px', xl: '150px'}
// '.layer_button': { // },
// width: {l: '19px', xl: '28px'}, // '.layer_button': {
// height: {l: '19px', xl: '28px'} // width: {l: '19px', xl: '28px'},
// }, // height: {l: '19px', xl: '28px'}
// 'input.spin-button': { // },
// 'background-image': {l: 'url('images/spinbtn_updn_big.png')', xl: 'url('images/spinbtn_updn_big.png')'}, // 'input.spin-button': {
// 'background-position': {l: '100% -5px', xl: '100% -2px'}, // 'background-image': {l: 'url('images/spinbtn_updn_big.png')', xl: 'url('images/spinbtn_updn_big.png')'},
// 'padding-right': {l: '24px', xl: '24px' } // 'background-position': {l: '100% -5px', xl: '100% -2px'},
// }, // 'padding-right': {l: '24px', xl: '24px' }
// 'input.spin-button.up': { // },
// 'background-position': {l: '100% -45px', xl: '100% -42px'} // 'input.spin-button.up': {
// }, // 'background-position': {l: '100% -45px', xl: '100% -42px'}
// 'input.spin-button.down': { // },
// 'background-position': {l: '100% -85px', xl: '100% -82px'} // 'input.spin-button.down': {
// }, // 'background-position': {l: '100% -85px', xl: '100% -82px'}
// '#position_opts': { // },
// width: {all: (size_num*4) +'px'} // '#position_opts': {
// } // width: {all: (size_num*4) +'px'}
// }
}
}; };
var ruleElem = $$b('#tool_size_rules'); var ruleElem = $$b('#tool_size_rules');
@ -30758,7 +30781,7 @@
var num = 5 - $$b('#layerlist tr.layer').size(); var num = 5 - $$b('#layerlist tr.layer').size();
while (num-- > 0) { while (num-- > 0) {
// FIXME: there must a better way to do this // TODO: there must a better way to do this
layerlist.append('<tr><td style="color:white">_</td><td/></tr>'); layerlist.append('<tr><td style="color:white">_</td><td/></tr>');
} }
}; };

View File

@ -256,7 +256,7 @@ QUnit.test('Test getPathDFromElement', function (assert) {
attr: {id: 'roundrect', x: '0', y: '1', rx: '2', ry: '3', width: '10', height: '11'} attr: {id: 'roundrect', x: '0', y: '1', rx: '2', ry: '3', width: '10', height: '11'}
}); });
svgroot.append(elem); svgroot.append(elem);
const closeEnough = new RegExp('M0,4 C0,2.3\\d* 0.9\\d*,1 2,1 L8,1 C9.0\\d*,1 10,2.3\\d* 10,4 L10,9 C10,10.6\\d* 9.08675799086758,12 8,12 L2,12 C0.9\\d*,12 0,10.6\\d* 0,9 L0,4 Z'); const closeEnough = /M0,4 C0,2.3\d* 0.9\d*,1 2,1 L8,1 C9.0\d*,1 10,2.3\d* 10,4 L10,9 C10,10.6\d* 9.08675799086758,12 8,12 L2,12 C0.9\d*,12 0,10.6\d* 0,9 L0,4 Z/;
assert.equal(closeEnough.test(getPathDFromElement(elem)), true); assert.equal(closeEnough.test(getPathDFromElement(elem)), true);
elem.remove(); elem.remove();