- 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) {
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
return;
}
var _arr = [];
var _n = true;
var _d = false;
@ -278,7 +282,7 @@ var canvg = (function (exports) {
function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups);
return new BabelRegExp(re, undefined, groups);
};
var _RegExp = _wrapNativeSuper(RegExp);
@ -287,10 +291,10 @@ var canvg = (function (exports) {
var _groups = new WeakMap();
function BabelRegExp(re, groups) {
var _this = _RegExp.call(this, re);
function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups);
_groups.set(_this, groups || _groups.get(re));
return _this;
}

View File

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

View File

@ -46,6 +46,10 @@ var svgEditorExtension_helloworld = (function () {
}
function _iterableToArrayLimit(arr, i) {
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
return;
}
var _arr = [];
var _n = true;
var _d = false;

View File

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

View File

@ -17,7 +17,8 @@ var svgEditorExtensionLocale_imagelib_en = (function () {
}, {
name: 'IAN Symbol Libraries',
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'
} // The site is no longer using our API, and they have added an
// `X-Frame-Options` header which prevents our usage cross-origin:
// Getting messages like this in console:
// Refused to display 'https://openclipart.org/detail/307176/sign-bike' in a frame
@ -32,8 +33,7 @@ var svgEditorExtensionLocale_imagelib_en = (function () {
description: 'Share and Use Images. Over 100,000 Public Domain SVG Images and Growing.'
}
*/
}]
]
};
return en;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -145,6 +145,10 @@ var svgEditorExtension_placemark = (function () {
}
function _iterableToArrayLimit(arr, i) {
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
return;
}
var _arr = [];
var _n = true;
var _d = false;
@ -176,7 +180,7 @@ var svgEditorExtension_placemark = (function () {
function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups);
return new BabelRegExp(re, undefined, groups);
};
var _RegExp = _wrapNativeSuper(RegExp);
@ -185,10 +189,10 @@ var svgEditorExtension_placemark = (function () {
var _groups = new WeakMap();
function BabelRegExp(re, groups) {
var _this = _RegExp.call(this, re);
function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups);
_groups.set(_this, groups || _groups.get(re));
return _this;
}

View File

@ -243,6 +243,10 @@ var svgEditorExtension_server_moinsave = (function () {
}
function _iterableToArrayLimit(arr, i) {
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
return;
}
var _arr = [];
var _n = true;
var _d = false;
@ -278,7 +282,7 @@ var svgEditorExtension_server_moinsave = (function () {
function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups);
return new BabelRegExp(re, undefined, groups);
};
var _RegExp = _wrapNativeSuper(RegExp);
@ -287,10 +291,10 @@ var svgEditorExtension_server_moinsave = (function () {
var _groups = new WeakMap();
function BabelRegExp(re, groups) {
var _this = _RegExp.call(this, re);
function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups);
_groups.set(_this, groups || _groups.get(re));
return _this;
}

View File

@ -243,6 +243,10 @@ var svgEditorExtension_server_opensave = (function () {
}
function _iterableToArrayLimit(arr, i) {
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
return;
}
var _arr = [];
var _n = true;
var _d = false;
@ -278,7 +282,7 @@ var svgEditorExtension_server_opensave = (function () {
function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups);
return new BabelRegExp(re, undefined, groups);
};
var _RegExp = _wrapNativeSuper(RegExp);
@ -287,10 +291,10 @@ var svgEditorExtension_server_opensave = (function () {
var _groups = new WeakMap();
function BabelRegExp(re, groups) {
var _this = _RegExp.call(this, re);
function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups);
_groups.set(_this, groups || _groups.get(re));
return _this;
}

View File

@ -46,6 +46,10 @@ var svgEditorExtension_shapes = (function () {
}
function _iterableToArrayLimit(arr, i) {
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
return;
}
var _arr = [];
var _n = true;
var _d = false;

View File

@ -145,6 +145,10 @@ var svgEditorExtension_storage = (function () {
}
function _iterableToArrayLimit(arr, i) {
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
return;
}
var _arr = [];
var _n = true;
var _d = false;
@ -176,7 +180,7 @@ var svgEditorExtension_storage = (function () {
function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups);
return new BabelRegExp(re, undefined, groups);
};
var _RegExp = _wrapNativeSuper(RegExp);
@ -185,10 +189,10 @@ var svgEditorExtension_storage = (function () {
var _groups = new WeakMap();
function BabelRegExp(re, groups) {
var _this = _RegExp.call(this, re);
function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups);
_groups.set(_this, groups || _groups.get(re));
return _this;
}

View File

@ -215,6 +215,10 @@
}
function _iterableToArrayLimit(arr, i) {
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
return;
}
var _arr = [];
var _n = true;
var _d = false;

185
dist/index-es.js vendored
View File

@ -228,6 +228,10 @@ function _iterableToArray(iter) {
}
function _iterableToArrayLimit(arr, i) {
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
return;
}
var _arr = [];
var _n = true;
var _d = false;
@ -263,7 +267,7 @@ function _nonIterableRest() {
function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups);
return new BabelRegExp(re, undefined, groups);
};
var _RegExp = _wrapNativeSuper(RegExp);
@ -272,10 +276,10 @@ function _wrapRegExp(re, groups) {
var _groups = new WeakMap();
function BabelRegExp(re, groups) {
var _this = _RegExp.call(this, re);
function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups);
_groups.set(_this, groups || _groups.get(re));
return _this;
}
@ -2736,7 +2740,7 @@ var getReverseNS = function getReverseNS() {
},
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: function get() {
return this.pathSegList;
@ -4692,7 +4696,7 @@ function () {
}, {
key: "addCommandToHistory",
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
// entire text contents of the text element)
// 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.
* @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 {module:utilities.TreeWalker} cbFn - Callback function to run on each element
* @returns {void}
@ -9361,8 +9365,8 @@ var snapToGrid = function snapToGrid(value) {
*/
var regexEscape = function regexEscape(str) {
// From: http://phpjs.org/functions
return String(str).replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\-]', 'g'), '\\$&');
// Originally from: http://phpjs.org/functions
return String(str).replace(/[.\\+*?[^\]$(){}=!<>|:-]/g, '\\$&');
};
/**
* Prevents default browser click behaviour on the given element.
@ -11824,7 +11828,7 @@ var sanitizeSvg = function sanitizeSvg(node) {
} else {
// 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 = [];
while (node.hasChildNodes()) {
@ -12504,7 +12508,7 @@ var recalculateDimensions = function recalculateDimensions(selected) {
if (Math.abs(a) > 1.0e-10) {
s = Math.sin(a) / (1 - Math.cos(a));
} else {
// FIXME: This blows up if the angle is exactly 0!
// TODO: This blows up if the angle is exactly 0!
s = 2 / a;
}
@ -12865,7 +12869,7 @@ var recalculateDimensions = function recalculateDimensions(selected) {
} // else, it's a non-group
} 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>,
// but we still may need to recalculate them (see issue 595).
// 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 _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;
for (var _i2 = 0; _i2 < tlist.numberOfItems; ++_i2) {
@ -15608,8 +15612,13 @@ function SvgCanvas(container, config) {
if (!rightClick) {
// insert a dummy transform so if the element(s) are moved it will have
// a transform to use for its translate
for (var _i2 = 0, _selectedElements = selectedElements; _i2 < _selectedElements.length; _i2++) {
var selectedElement = _selectedElements[_i2];
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = selectedElements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var selectedElement = _step.value;
if (isNullish(selectedElement)) {
continue;
@ -15623,6 +15632,20 @@ function SvgCanvas(container, config) {
slist.appendItem(svgroot.createSVGTransform());
}
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
_iterator["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
}
} else if (!rightClick) {
clearSelection();
@ -15784,7 +15807,7 @@ function SvgCanvas(container, config) {
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)
// 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'];
while (_i3--) {
var attr = attrs[_i3];
while (_i2--) {
var attr = attrs[_i2];
var attrVal = toXml(attr.value); // Namespaces have already been dealt with, so skip
if (attr.nodeName.startsWith('xmlns:')) {
@ -17756,8 +17779,8 @@ function SvgCanvas(container, config) {
var mozAttrs = ['-moz-math-font-style', '_moz-math-font-style'];
for (var _i4 = attrs.length - 1; _i4 >= 0; _i4--) {
var _attr = attrs[_i4];
for (var _i3 = attrs.length - 1; _i3 >= 0; _i3--) {
var _attr = attrs[_i3];
var _attrVal = toXml(_attr.value); // remove bogus attributes added by Gecko
@ -17813,14 +17836,14 @@ function SvgCanvas(container, config) {
indent++;
var bOneLine = false;
for (var _i5 = 0; _i5 < childs.length; _i5++) {
var child = childs.item(_i5);
for (var _i4 = 0; _i4 < childs.length; _i4++) {
var child = childs.item(_i4);
switch (child.nodeType) {
case 1:
// element node
out.push('\n');
out.push(this.svgToString(childs.item(_i5), indent));
out.push(this.svgToString(childs.item(_i4), indent));
break;
case 3:
@ -17862,7 +17885,7 @@ function SvgCanvas(container, config) {
if (!bOneLine) {
out.push('\n');
for (var _i6 = 0; _i6 < indent; _i6++) {
for (var _i5 = 0; _i5 < indent; _i5++) {
out.push(' ');
}
}
@ -18938,27 +18961,27 @@ function SvgCanvas(container, config) {
}
var attrs = svg.attributes;
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
try {
for (var _iterator = attrs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var attr = _step.value;
for (var _iterator2 = attrs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var attr = _step2.value;
// Ok for `NamedNodeMap`
symbol.setAttribute(attr.nodeName, attr.value);
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
_didIteratorError2 = true;
_iteratorError2 = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
_iterator["return"]();
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator2["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
if (_didIteratorError2) {
throw _iteratorError2;
}
}
}
@ -19183,29 +19206,29 @@ function SvgCanvas(container, config) {
elem = $$9(elem).data('gsvg') || $$9(elem).data('symbol') || elem;
var childs = elem.childNodes;
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
var _iteratorNormalCompletion3 = true;
var _didIteratorError3 = false;
var _iteratorError3 = undefined;
try {
for (var _iterator2 = childs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var child = _step2.value;
for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
var child = _step3.value;
if (child.nodeName === 'title') {
return child.textContent;
}
}
} catch (err) {
_didIteratorError2 = true;
_iteratorError2 = err;
_didIteratorError3 = true;
_iteratorError3 = err;
} finally {
try {
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator2["return"]();
if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) {
_iterator3["return"]();
}
} finally {
if (_didIteratorError2) {
throw _iteratorError2;
if (_didIteratorError3) {
throw _iteratorError3;
}
}
}
@ -19273,13 +19296,13 @@ function SvgCanvas(container, config) {
var docTitle = false,
oldTitle = '';
var batchCmd = new BatchCommand$1('Change Image Title');
var _iteratorNormalCompletion3 = true;
var _didIteratorError3 = false;
var _iteratorError3 = undefined;
var _iteratorNormalCompletion4 = true;
var _didIteratorError4 = false;
var _iteratorError4 = undefined;
try {
for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
var child = _step3.value;
for (var _iterator4 = childs[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
var child = _step4.value;
if (child.nodeName === 'title') {
docTitle = child;
@ -19288,16 +19311,16 @@ function SvgCanvas(container, config) {
}
}
} catch (err) {
_didIteratorError3 = true;
_iteratorError3 = err;
_didIteratorError4 = true;
_iteratorError4 = err;
} finally {
try {
if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) {
_iterator3["return"]();
if (!_iteratorNormalCompletion4 && _iterator4["return"] != null) {
_iterator4["return"]();
}
} finally {
if (_didIteratorError3) {
throw _iteratorError3;
if (_didIteratorError4) {
throw _iteratorError4;
}
}
}
@ -20606,7 +20629,7 @@ function SvgCanvas(container, config) {
canvas.moveSelectedElements(diffX * currentZoom, diffY * currentZoom, true);
return "continue";
} // 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)) {}
@ -21285,9 +21308,9 @@ function SvgCanvas(container, config) {
this.moveToTopSelectedElement = function () {
var _selectedElements2 = selectedElements,
_selectedElements3 = _slicedToArray(_selectedElements2, 1),
selected = _selectedElements3[0];
var _selectedElements = selectedElements,
_selectedElements2 = _slicedToArray(_selectedElements, 1),
selected = _selectedElements2[0];
if (!isNullish(selected)) {
var t = selected;
@ -21312,9 +21335,9 @@ function SvgCanvas(container, config) {
this.moveToBottomSelectedElement = function () {
var _selectedElements4 = selectedElements,
_selectedElements5 = _slicedToArray(_selectedElements4, 1),
selected = _selectedElements5[0];
var _selectedElements3 = selectedElements,
_selectedElements4 = _slicedToArray(_selectedElements3, 1),
selected = _selectedElements4[0];
if (!isNullish(selected)) {
var t = selected;
@ -21622,45 +21645,45 @@ function SvgCanvas(container, config) {
var dx = new Array(len);
var dy = new Array(len);
for (var _i7 = 0; _i7 < len; ++_i7) {
if (isNullish(selectedElements[_i7])) {
for (var _i6 = 0; _i6 < len; ++_i6) {
if (isNullish(selectedElements[_i6])) {
break;
} // const elem = selectedElements[i];
var bbox = bboxes[_i7];
dx[_i7] = 0;
dy[_i7] = 0;
var bbox = bboxes[_i6];
dx[_i6] = 0;
dy[_i6] = 0;
switch (type) {
case 'l':
// left (horizontal)
dx[_i7] = minx - bbox.x;
dx[_i6] = minx - bbox.x;
break;
case 'c':
// center (horizontal)
dx[_i7] = (minx + maxx) / 2 - (bbox.x + bbox.width / 2);
dx[_i6] = (minx + maxx) / 2 - (bbox.x + bbox.width / 2);
break;
case 'r':
// right (horizontal)
dx[_i7] = maxx - (bbox.x + bbox.width);
dx[_i6] = maxx - (bbox.x + bbox.width);
break;
case 't':
// top (vertical)
dy[_i7] = miny - bbox.y;
dy[_i6] = miny - bbox.y;
break;
case 'm':
// middle (vertical)
dy[_i7] = (miny + maxy) / 2 - (bbox.y + bbox.height / 2);
dy[_i6] = (miny + maxy) / 2 - (bbox.y + bbox.height / 2);
break;
case 'b':
// bottom (vertical)
dy[_i7] = maxy - (bbox.y + bbox.height);
dy[_i6] = maxy - (bbox.y + bbox.height);
break;
}
}
@ -22826,14 +22849,14 @@ function jQueryPluginSVGIcons($) {
/**
*
* @param {boolean} [toImage]
* @param {external:jQuery.svgIcons.Fallback} [fallback]
* @param {external:jQuery.svgIcons.Fallback} [fallback=false]
* @returns {void}
*/
function makeIcons() {
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 (opts.no_img) toImage = false;
var tempHolder;
@ -30168,7 +30191,8 @@ editor.init = function () {
},
'div#workarea': {
left: 38,
top: 74 // '#tools_bottom': {
top: 74
} // '#tools_bottom': {
// left: {s: '27px', l: '46px', xl: '65px'},
// height: {s: '58px', l: '98px', xl: '145px'}
// },
@ -30251,7 +30275,6 @@ editor.init = function () {
// width: {all: (size_num*4) +'px'}
// }
}
};
var ruleElem = $$b('#tool_size_rules');
@ -30755,7 +30778,7 @@ editor.init = function () {
var num = 5 - $$b('#layerlist tr.layer').size();
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>');
}
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

185
dist/index-umd.js vendored
View File

@ -234,6 +234,10 @@
}
function _iterableToArrayLimit(arr, i) {
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
return;
}
var _arr = [];
var _n = true;
var _d = false;
@ -269,7 +273,7 @@
function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups);
return new BabelRegExp(re, undefined, groups);
};
var _RegExp = _wrapNativeSuper(RegExp);
@ -278,10 +282,10 @@
var _groups = new WeakMap();
function BabelRegExp(re, groups) {
var _this = _RegExp.call(this, re);
function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups);
_groups.set(_this, groups || _groups.get(re));
return _this;
}
@ -2742,7 +2746,7 @@
},
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: function get() {
return this.pathSegList;
@ -4698,7 +4702,7 @@
}, {
key: "addCommandToHistory",
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
// entire text contents of the text element)
// 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.
* @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 {module:utilities.TreeWalker} cbFn - Callback function to run on each element
* @returns {void}
@ -9367,8 +9371,8 @@
*/
var regexEscape = function regexEscape(str) {
// From: http://phpjs.org/functions
return String(str).replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\-]', 'g'), '\\$&');
// Originally from: http://phpjs.org/functions
return String(str).replace(/[.\\+*?[^\]$(){}=!<>|:-]/g, '\\$&');
};
/**
* Prevents default browser click behaviour on the given element.
@ -11830,7 +11834,7 @@
} else {
// 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 = [];
while (node.hasChildNodes()) {
@ -12510,7 +12514,7 @@
if (Math.abs(a) > 1.0e-10) {
s = Math.sin(a) / (1 - Math.cos(a));
} else {
// FIXME: This blows up if the angle is exactly 0!
// TODO: This blows up if the angle is exactly 0!
s = 2 / a;
}
@ -12871,7 +12875,7 @@
} // else, it's a non-group
} 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>,
// but we still may need to recalculate them (see issue 595).
// TODO: Figure out how to get BBox from these elements in case they
@ -12895,7 +12899,7 @@
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;
for (var _i2 = 0; _i2 < tlist.numberOfItems; ++_i2) {
@ -15614,8 +15618,13 @@
if (!rightClick) {
// insert a dummy transform so if the element(s) are moved it will have
// a transform to use for its translate
for (var _i2 = 0, _selectedElements = selectedElements; _i2 < _selectedElements.length; _i2++) {
var selectedElement = _selectedElements[_i2];
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = selectedElements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var selectedElement = _step.value;
if (isNullish(selectedElement)) {
continue;
@ -15629,6 +15638,20 @@
slist.appendItem(svgroot.createSVGTransform());
}
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
_iterator["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
}
} else if (!rightClick) {
clearSelection();
@ -15790,7 +15813,7 @@
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)
// Fallthrough
@ -17732,11 +17755,11 @@
}
});
});
var _i3 = attrs.length;
var _i2 = attrs.length;
var attrNames = ['width', 'height', 'xmlns', 'x', 'y', 'viewBox', 'id', 'overflow'];
while (_i3--) {
var attr = attrs[_i3];
while (_i2--) {
var attr = attrs[_i2];
var attrVal = toXml(attr.value); // Namespaces have already been dealt with, so skip
if (attr.nodeName.startsWith('xmlns:')) {
@ -17762,8 +17785,8 @@
var mozAttrs = ['-moz-math-font-style', '_moz-math-font-style'];
for (var _i4 = attrs.length - 1; _i4 >= 0; _i4--) {
var _attr = attrs[_i4];
for (var _i3 = attrs.length - 1; _i3 >= 0; _i3--) {
var _attr = attrs[_i3];
var _attrVal = toXml(_attr.value); // remove bogus attributes added by Gecko
@ -17819,14 +17842,14 @@
indent++;
var bOneLine = false;
for (var _i5 = 0; _i5 < childs.length; _i5++) {
var child = childs.item(_i5);
for (var _i4 = 0; _i4 < childs.length; _i4++) {
var child = childs.item(_i4);
switch (child.nodeType) {
case 1:
// element node
out.push('\n');
out.push(this.svgToString(childs.item(_i5), indent));
out.push(this.svgToString(childs.item(_i4), indent));
break;
case 3:
@ -17868,7 +17891,7 @@
if (!bOneLine) {
out.push('\n');
for (var _i6 = 0; _i6 < indent; _i6++) {
for (var _i5 = 0; _i5 < indent; _i5++) {
out.push(' ');
}
}
@ -18944,27 +18967,27 @@
}
var attrs = svg.attributes;
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
try {
for (var _iterator = attrs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var attr = _step.value;
for (var _iterator2 = attrs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var attr = _step2.value;
// Ok for `NamedNodeMap`
symbol.setAttribute(attr.nodeName, attr.value);
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
_didIteratorError2 = true;
_iteratorError2 = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
_iterator["return"]();
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator2["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
if (_didIteratorError2) {
throw _iteratorError2;
}
}
}
@ -19189,29 +19212,29 @@
elem = $$9(elem).data('gsvg') || $$9(elem).data('symbol') || elem;
var childs = elem.childNodes;
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
var _iteratorNormalCompletion3 = true;
var _didIteratorError3 = false;
var _iteratorError3 = undefined;
try {
for (var _iterator2 = childs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var child = _step2.value;
for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
var child = _step3.value;
if (child.nodeName === 'title') {
return child.textContent;
}
}
} catch (err) {
_didIteratorError2 = true;
_iteratorError2 = err;
_didIteratorError3 = true;
_iteratorError3 = err;
} finally {
try {
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator2["return"]();
if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) {
_iterator3["return"]();
}
} finally {
if (_didIteratorError2) {
throw _iteratorError2;
if (_didIteratorError3) {
throw _iteratorError3;
}
}
}
@ -19279,13 +19302,13 @@
var docTitle = false,
oldTitle = '';
var batchCmd = new BatchCommand$1('Change Image Title');
var _iteratorNormalCompletion3 = true;
var _didIteratorError3 = false;
var _iteratorError3 = undefined;
var _iteratorNormalCompletion4 = true;
var _didIteratorError4 = false;
var _iteratorError4 = undefined;
try {
for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
var child = _step3.value;
for (var _iterator4 = childs[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
var child = _step4.value;
if (child.nodeName === 'title') {
docTitle = child;
@ -19294,16 +19317,16 @@
}
}
} catch (err) {
_didIteratorError3 = true;
_iteratorError3 = err;
_didIteratorError4 = true;
_iteratorError4 = err;
} finally {
try {
if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) {
_iterator3["return"]();
if (!_iteratorNormalCompletion4 && _iterator4["return"] != null) {
_iterator4["return"]();
}
} finally {
if (_didIteratorError3) {
throw _iteratorError3;
if (_didIteratorError4) {
throw _iteratorError4;
}
}
}
@ -20612,7 +20635,7 @@
canvas.moveSelectedElements(diffX * currentZoom, diffY * currentZoom, true);
return "continue";
} // 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)) {}
@ -21291,9 +21314,9 @@
this.moveToTopSelectedElement = function () {
var _selectedElements2 = selectedElements,
_selectedElements3 = _slicedToArray(_selectedElements2, 1),
selected = _selectedElements3[0];
var _selectedElements = selectedElements,
_selectedElements2 = _slicedToArray(_selectedElements, 1),
selected = _selectedElements2[0];
if (!isNullish(selected)) {
var t = selected;
@ -21318,9 +21341,9 @@
this.moveToBottomSelectedElement = function () {
var _selectedElements4 = selectedElements,
_selectedElements5 = _slicedToArray(_selectedElements4, 1),
selected = _selectedElements5[0];
var _selectedElements3 = selectedElements,
_selectedElements4 = _slicedToArray(_selectedElements3, 1),
selected = _selectedElements4[0];
if (!isNullish(selected)) {
var t = selected;
@ -21628,45 +21651,45 @@
var dx = new Array(len);
var dy = new Array(len);
for (var _i7 = 0; _i7 < len; ++_i7) {
if (isNullish(selectedElements[_i7])) {
for (var _i6 = 0; _i6 < len; ++_i6) {
if (isNullish(selectedElements[_i6])) {
break;
} // const elem = selectedElements[i];
var bbox = bboxes[_i7];
dx[_i7] = 0;
dy[_i7] = 0;
var bbox = bboxes[_i6];
dx[_i6] = 0;
dy[_i6] = 0;
switch (type) {
case 'l':
// left (horizontal)
dx[_i7] = minx - bbox.x;
dx[_i6] = minx - bbox.x;
break;
case 'c':
// center (horizontal)
dx[_i7] = (minx + maxx) / 2 - (bbox.x + bbox.width / 2);
dx[_i6] = (minx + maxx) / 2 - (bbox.x + bbox.width / 2);
break;
case 'r':
// right (horizontal)
dx[_i7] = maxx - (bbox.x + bbox.width);
dx[_i6] = maxx - (bbox.x + bbox.width);
break;
case 't':
// top (vertical)
dy[_i7] = miny - bbox.y;
dy[_i6] = miny - bbox.y;
break;
case 'm':
// middle (vertical)
dy[_i7] = (miny + maxy) / 2 - (bbox.y + bbox.height / 2);
dy[_i6] = (miny + maxy) / 2 - (bbox.y + bbox.height / 2);
break;
case 'b':
// bottom (vertical)
dy[_i7] = maxy - (bbox.y + bbox.height);
dy[_i6] = maxy - (bbox.y + bbox.height);
break;
}
}
@ -22832,14 +22855,14 @@
/**
*
* @param {boolean} [toImage]
* @param {external:jQuery.svgIcons.Fallback} [fallback]
* @param {external:jQuery.svgIcons.Fallback} [fallback=false]
* @returns {void}
*/
function makeIcons() {
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 (opts.no_img) toImage = false;
var tempHolder;
@ -30174,7 +30197,8 @@
},
'div#workarea': {
left: 38,
top: 74 // '#tools_bottom': {
top: 74
} // '#tools_bottom': {
// left: {s: '27px', l: '46px', xl: '65px'},
// height: {s: '58px', l: '98px', xl: '145px'}
// },
@ -30257,7 +30281,6 @@
// width: {all: (size_num*4) +'px'}
// }
}
};
var ruleElem = $$b('#tool_size_rules');
@ -30761,7 +30784,7 @@
var num = 5 - $$b('#layerlist tr.layer').size();
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>');
}
};

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) {
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
return;
}
var _arr = [];
var _n = true;
var _d = false;
@ -182,7 +186,7 @@
function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups);
return new BabelRegExp(re, undefined, groups);
};
var _RegExp = _wrapNativeSuper(RegExp);
@ -191,10 +195,10 @@
var _groups = new WeakMap();
function BabelRegExp(re, groups) {
var _this = _RegExp.call(this, re);
function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups);
_groups.set(_this, groups || _groups.get(re));
return _this;
}
@ -820,7 +824,7 @@
}
return box.width;
}; // FIXME: use more accurate positioning!!
}; // TODO: use more accurate positioning!!
var x,

View File

@ -2387,7 +2387,7 @@
},
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: function get() {
return this.pathSegList;
@ -2451,8 +2451,6 @@
var _navigator = navigator,
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 isOpera_ = Boolean(window.opera);
var isWebkit_ = userAgent.includes('AppleWebKit');
var isGecko_ = userAgent.includes('Gecko/');
var isIE_ = userAgent.includes('MSIE');
@ -2464,10 +2462,6 @@
return Boolean(svg.querySelector);
}();
var supportsXpath_ = function () {
return Boolean(document.evaluate);
}(); // segList functions (for FF1.5 and 2.0)
var supportsPathReplaceItem_ = function () {
var path = document.createElementNS(NS.SVG, 'path');

171
dist/svgcanvas-iife.js vendored
View File

@ -213,6 +213,10 @@ var SvgCanvas = (function () {
}
function _iterableToArrayLimit(arr, i) {
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
return;
}
var _arr = [];
var _n = true;
var _d = false;
@ -248,7 +252,7 @@ var SvgCanvas = (function () {
function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups);
return new BabelRegExp(re, undefined, groups);
};
var _RegExp = _wrapNativeSuper(RegExp);
@ -257,10 +261,10 @@ var SvgCanvas = (function () {
var _groups = new WeakMap();
function BabelRegExp(re, groups) {
var _this = _RegExp.call(this, re);
function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups);
_groups.set(_this, groups || _groups.get(re));
return _this;
}
@ -2614,7 +2618,7 @@ var SvgCanvas = (function () {
},
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: function get() {
return this.pathSegList;
@ -4764,7 +4768,7 @@ var SvgCanvas = (function () {
}, {
key: "addCommandToHistory",
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
// entire text contents of the text element)
// 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.
* @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 {module:utilities.TreeWalker} cbFn - Callback function to run on each element
* @returns {void}
@ -11391,7 +11395,7 @@ var SvgCanvas = (function () {
} else {
// 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 = [];
while (node.hasChildNodes()) {
@ -12282,7 +12286,7 @@ var SvgCanvas = (function () {
if (Math.abs(a) > 1.0e-10) {
s = Math.sin(a) / (1 - Math.cos(a));
} else {
// FIXME: This blows up if the angle is exactly 0!
// TODO: This blows up if the angle is exactly 0!
s = 2 / a;
}
@ -12643,7 +12647,7 @@ var SvgCanvas = (function () {
} // else, it's a non-group
} 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>,
// but we still may need to recalculate them (see issue 595).
// 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 _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;
for (var _i2 = 0; _i2 < tlist.numberOfItems; ++_i2) {
@ -15386,8 +15390,13 @@ var SvgCanvas = (function () {
if (!rightClick) {
// insert a dummy transform so if the element(s) are moved it will have
// a transform to use for its translate
for (var _i2 = 0, _selectedElements = selectedElements; _i2 < _selectedElements.length; _i2++) {
var selectedElement = _selectedElements[_i2];
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = selectedElements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var selectedElement = _step.value;
if (isNullish(selectedElement)) {
continue;
@ -15401,6 +15410,20 @@ var SvgCanvas = (function () {
slist.appendItem(svgroot.createSVGTransform());
}
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
_iterator["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
}
} else if (!rightClick) {
clearSelection();
@ -15562,7 +15585,7 @@ var SvgCanvas = (function () {
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)
// 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'];
while (_i3--) {
var attr = attrs[_i3];
while (_i2--) {
var attr = attrs[_i2];
var attrVal = toXml(attr.value); // Namespaces have already been dealt with, so skip
if (attr.nodeName.startsWith('xmlns:')) {
@ -17534,8 +17557,8 @@ var SvgCanvas = (function () {
var mozAttrs = ['-moz-math-font-style', '_moz-math-font-style'];
for (var _i4 = attrs.length - 1; _i4 >= 0; _i4--) {
var _attr = attrs[_i4];
for (var _i3 = attrs.length - 1; _i3 >= 0; _i3--) {
var _attr = attrs[_i3];
var _attrVal = toXml(_attr.value); // remove bogus attributes added by Gecko
@ -17591,14 +17614,14 @@ var SvgCanvas = (function () {
indent++;
var bOneLine = false;
for (var _i5 = 0; _i5 < childs.length; _i5++) {
var child = childs.item(_i5);
for (var _i4 = 0; _i4 < childs.length; _i4++) {
var child = childs.item(_i4);
switch (child.nodeType) {
case 1:
// element node
out.push('\n');
out.push(this.svgToString(childs.item(_i5), indent));
out.push(this.svgToString(childs.item(_i4), indent));
break;
case 3:
@ -17640,7 +17663,7 @@ var SvgCanvas = (function () {
if (!bOneLine) {
out.push('\n');
for (var _i6 = 0; _i6 < indent; _i6++) {
for (var _i5 = 0; _i5 < indent; _i5++) {
out.push(' ');
}
}
@ -18716,27 +18739,27 @@ var SvgCanvas = (function () {
}
var attrs = svg.attributes;
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
try {
for (var _iterator = attrs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var attr = _step.value;
for (var _iterator2 = attrs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var attr = _step2.value;
// Ok for `NamedNodeMap`
symbol.setAttribute(attr.nodeName, attr.value);
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
_didIteratorError2 = true;
_iteratorError2 = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
_iterator["return"]();
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator2["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
if (_didIteratorError2) {
throw _iteratorError2;
}
}
}
@ -18961,29 +18984,29 @@ var SvgCanvas = (function () {
elem = $$8(elem).data('gsvg') || $$8(elem).data('symbol') || elem;
var childs = elem.childNodes;
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
var _iteratorNormalCompletion3 = true;
var _didIteratorError3 = false;
var _iteratorError3 = undefined;
try {
for (var _iterator2 = childs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var child = _step2.value;
for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
var child = _step3.value;
if (child.nodeName === 'title') {
return child.textContent;
}
}
} catch (err) {
_didIteratorError2 = true;
_iteratorError2 = err;
_didIteratorError3 = true;
_iteratorError3 = err;
} finally {
try {
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator2["return"]();
if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) {
_iterator3["return"]();
}
} finally {
if (_didIteratorError2) {
throw _iteratorError2;
if (_didIteratorError3) {
throw _iteratorError3;
}
}
}
@ -19051,13 +19074,13 @@ var SvgCanvas = (function () {
var docTitle = false,
oldTitle = '';
var batchCmd = new BatchCommand$1('Change Image Title');
var _iteratorNormalCompletion3 = true;
var _didIteratorError3 = false;
var _iteratorError3 = undefined;
var _iteratorNormalCompletion4 = true;
var _didIteratorError4 = false;
var _iteratorError4 = undefined;
try {
for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
var child = _step3.value;
for (var _iterator4 = childs[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
var child = _step4.value;
if (child.nodeName === 'title') {
docTitle = child;
@ -19066,16 +19089,16 @@ var SvgCanvas = (function () {
}
}
} catch (err) {
_didIteratorError3 = true;
_iteratorError3 = err;
_didIteratorError4 = true;
_iteratorError4 = err;
} finally {
try {
if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) {
_iterator3["return"]();
if (!_iteratorNormalCompletion4 && _iterator4["return"] != null) {
_iterator4["return"]();
}
} finally {
if (_didIteratorError3) {
throw _iteratorError3;
if (_didIteratorError4) {
throw _iteratorError4;
}
}
}
@ -20384,7 +20407,7 @@ var SvgCanvas = (function () {
canvas.moveSelectedElements(diffX * currentZoom, diffY * currentZoom, true);
return "continue";
} // 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)) {}
@ -21063,9 +21086,9 @@ var SvgCanvas = (function () {
this.moveToTopSelectedElement = function () {
var _selectedElements2 = selectedElements,
_selectedElements3 = _slicedToArray(_selectedElements2, 1),
selected = _selectedElements3[0];
var _selectedElements = selectedElements,
_selectedElements2 = _slicedToArray(_selectedElements, 1),
selected = _selectedElements2[0];
if (!isNullish(selected)) {
var t = selected;
@ -21090,9 +21113,9 @@ var SvgCanvas = (function () {
this.moveToBottomSelectedElement = function () {
var _selectedElements4 = selectedElements,
_selectedElements5 = _slicedToArray(_selectedElements4, 1),
selected = _selectedElements5[0];
var _selectedElements3 = selectedElements,
_selectedElements4 = _slicedToArray(_selectedElements3, 1),
selected = _selectedElements4[0];
if (!isNullish(selected)) {
var t = selected;
@ -21400,45 +21423,45 @@ var SvgCanvas = (function () {
var dx = new Array(len);
var dy = new Array(len);
for (var _i7 = 0; _i7 < len; ++_i7) {
if (isNullish(selectedElements[_i7])) {
for (var _i6 = 0; _i6 < len; ++_i6) {
if (isNullish(selectedElements[_i6])) {
break;
} // const elem = selectedElements[i];
var bbox = bboxes[_i7];
dx[_i7] = 0;
dy[_i7] = 0;
var bbox = bboxes[_i6];
dx[_i6] = 0;
dy[_i6] = 0;
switch (type) {
case 'l':
// left (horizontal)
dx[_i7] = minx - bbox.x;
dx[_i6] = minx - bbox.x;
break;
case 'c':
// center (horizontal)
dx[_i7] = (minx + maxx) / 2 - (bbox.x + bbox.width / 2);
dx[_i6] = (minx + maxx) / 2 - (bbox.x + bbox.width / 2);
break;
case 'r':
// right (horizontal)
dx[_i7] = maxx - (bbox.x + bbox.width);
dx[_i6] = maxx - (bbox.x + bbox.width);
break;
case 't':
// top (vertical)
dy[_i7] = miny - bbox.y;
dy[_i6] = miny - bbox.y;
break;
case 'm':
// middle (vertical)
dy[_i7] = (miny + maxy) / 2 - (bbox.y + bbox.height / 2);
dy[_i6] = (miny + maxy) / 2 - (bbox.y + bbox.height / 2);
break;
case 'b':
// bottom (vertical)
dy[_i7] = maxy - (bbox.y + bbox.height);
dy[_i6] = maxy - (bbox.y + bbox.height);
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}
*/
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
// entire text contents of the text element)
// 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;
};
// FIXME: use more accurate positioning!!
// TODO: use more accurate positioning!!
let x, y, xOffset = 0;
if (node.hasAttribute('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)) {
s = Math.sin(a) / (1 - Math.cos(a));
} else {
// FIXME: This blows up if the angle is exactly 0!
// TODO: This blows up if the angle is exactly 0!
s = 2 / a;
}
for (let i = 0; i < tlist.numberOfItems; ++i) {
@ -599,7 +599,7 @@ export const recalculateDimensions = function (selected) {
}
// else, it's a non-group
} 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);
// 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 s = (Math.abs(a) > (1.0e-10))
? 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;
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 {
// 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 = [];
while (node.hasChildNodes()) {
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
let num = 5 - $('#layerlist tr.layer').size();
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>');
}
};

View File

@ -1955,7 +1955,7 @@ const mouseDown = function (evt) {
preventClickDefault(newImage);
break;
} 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)
// Fallthrough
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
// TODO: FIXME: Missing statement body
// TODO: Missing statement body
// if (elem.tagName === 'g' && goodGAttrs.includes(attr)) {}
let oldval = attr === '#text' ? elem.textContent : elem.getAttribute(attr);
if (isNullish(oldval)) { oldval = ''; }

View File

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

View File

@ -961,7 +961,7 @@ if (!('SVGPathSegList' in window) || !('appendItem' in window.SVGPathSegList.pro
},
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},
animatedPathSegList: {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.
* @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 {module:utilities.TreeWalker} cbFn - Callback function to run on each element
* @returns {void}
@ -1300,8 +1300,8 @@ export const snapToGrid = function (value) {
* @returns {string}
*/
export const regexEscape = function (str) {
// From: http://phpjs.org/functions
return String(str).replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\-]', 'g'), '\\$&');
// Originally from: http://phpjs.org/functions
return String(str).replace(/[.\\+*?[^\]$(){}=!<>|:-]/g, '\\$&');
};
/**

View File

@ -231,6 +231,10 @@
}
function _iterableToArrayLimit(arr, i) {
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
return;
}
var _arr = [];
var _n = true;
var _d = false;
@ -266,7 +270,7 @@
function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups);
return new BabelRegExp(re, undefined, groups);
};
var _RegExp = _wrapNativeSuper(RegExp);
@ -275,10 +279,10 @@
var _groups = new WeakMap();
function BabelRegExp(re, groups) {
var _this = _RegExp.call(this, re);
function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups);
_groups.set(_this, groups || _groups.get(re));
return _this;
}
@ -2739,7 +2743,7 @@
},
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: function get() {
return this.pathSegList;
@ -4695,7 +4699,7 @@
}, {
key: "addCommandToHistory",
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
// entire text contents of the text element)
// 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.
* @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 {module:utilities.TreeWalker} cbFn - Callback function to run on each element
* @returns {void}
@ -9364,8 +9368,8 @@
*/
var regexEscape = function regexEscape(str) {
// From: http://phpjs.org/functions
return String(str).replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\-]', 'g'), '\\$&');
// Originally from: http://phpjs.org/functions
return String(str).replace(/[.\\+*?[^\]$(){}=!<>|:-]/g, '\\$&');
};
/**
* Prevents default browser click behaviour on the given element.
@ -11827,7 +11831,7 @@
} else {
// 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 = [];
while (node.hasChildNodes()) {
@ -12507,7 +12511,7 @@
if (Math.abs(a) > 1.0e-10) {
s = Math.sin(a) / (1 - Math.cos(a));
} else {
// FIXME: This blows up if the angle is exactly 0!
// TODO: This blows up if the angle is exactly 0!
s = 2 / a;
}
@ -12868,7 +12872,7 @@
} // else, it's a non-group
} 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>,
// but we still may need to recalculate them (see issue 595).
// TODO: Figure out how to get BBox from these elements in case they
@ -12892,7 +12896,7 @@
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;
for (var _i2 = 0; _i2 < tlist.numberOfItems; ++_i2) {
@ -15611,8 +15615,13 @@
if (!rightClick) {
// insert a dummy transform so if the element(s) are moved it will have
// a transform to use for its translate
for (var _i2 = 0, _selectedElements = selectedElements; _i2 < _selectedElements.length; _i2++) {
var selectedElement = _selectedElements[_i2];
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = selectedElements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var selectedElement = _step.value;
if (isNullish(selectedElement)) {
continue;
@ -15626,6 +15635,20 @@
slist.appendItem(svgroot.createSVGTransform());
}
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
_iterator["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
}
} else if (!rightClick) {
clearSelection();
@ -15787,7 +15810,7 @@
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)
// Fallthrough
@ -17729,11 +17752,11 @@
}
});
});
var _i3 = attrs.length;
var _i2 = attrs.length;
var attrNames = ['width', 'height', 'xmlns', 'x', 'y', 'viewBox', 'id', 'overflow'];
while (_i3--) {
var attr = attrs[_i3];
while (_i2--) {
var attr = attrs[_i2];
var attrVal = toXml(attr.value); // Namespaces have already been dealt with, so skip
if (attr.nodeName.startsWith('xmlns:')) {
@ -17759,8 +17782,8 @@
var mozAttrs = ['-moz-math-font-style', '_moz-math-font-style'];
for (var _i4 = attrs.length - 1; _i4 >= 0; _i4--) {
var _attr = attrs[_i4];
for (var _i3 = attrs.length - 1; _i3 >= 0; _i3--) {
var _attr = attrs[_i3];
var _attrVal = toXml(_attr.value); // remove bogus attributes added by Gecko
@ -17816,14 +17839,14 @@
indent++;
var bOneLine = false;
for (var _i5 = 0; _i5 < childs.length; _i5++) {
var child = childs.item(_i5);
for (var _i4 = 0; _i4 < childs.length; _i4++) {
var child = childs.item(_i4);
switch (child.nodeType) {
case 1:
// element node
out.push('\n');
out.push(this.svgToString(childs.item(_i5), indent));
out.push(this.svgToString(childs.item(_i4), indent));
break;
case 3:
@ -17865,7 +17888,7 @@
if (!bOneLine) {
out.push('\n');
for (var _i6 = 0; _i6 < indent; _i6++) {
for (var _i5 = 0; _i5 < indent; _i5++) {
out.push(' ');
}
}
@ -18941,27 +18964,27 @@
}
var attrs = svg.attributes;
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
try {
for (var _iterator = attrs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var attr = _step.value;
for (var _iterator2 = attrs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var attr = _step2.value;
// Ok for `NamedNodeMap`
symbol.setAttribute(attr.nodeName, attr.value);
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
_didIteratorError2 = true;
_iteratorError2 = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
_iterator["return"]();
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator2["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
if (_didIteratorError2) {
throw _iteratorError2;
}
}
}
@ -19186,29 +19209,29 @@
elem = $$9(elem).data('gsvg') || $$9(elem).data('symbol') || elem;
var childs = elem.childNodes;
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
var _iteratorNormalCompletion3 = true;
var _didIteratorError3 = false;
var _iteratorError3 = undefined;
try {
for (var _iterator2 = childs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var child = _step2.value;
for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
var child = _step3.value;
if (child.nodeName === 'title') {
return child.textContent;
}
}
} catch (err) {
_didIteratorError2 = true;
_iteratorError2 = err;
_didIteratorError3 = true;
_iteratorError3 = err;
} finally {
try {
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator2["return"]();
if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) {
_iterator3["return"]();
}
} finally {
if (_didIteratorError2) {
throw _iteratorError2;
if (_didIteratorError3) {
throw _iteratorError3;
}
}
}
@ -19276,13 +19299,13 @@
var docTitle = false,
oldTitle = '';
var batchCmd = new BatchCommand$1('Change Image Title');
var _iteratorNormalCompletion3 = true;
var _didIteratorError3 = false;
var _iteratorError3 = undefined;
var _iteratorNormalCompletion4 = true;
var _didIteratorError4 = false;
var _iteratorError4 = undefined;
try {
for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
var child = _step3.value;
for (var _iterator4 = childs[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
var child = _step4.value;
if (child.nodeName === 'title') {
docTitle = child;
@ -19291,16 +19314,16 @@
}
}
} catch (err) {
_didIteratorError3 = true;
_iteratorError3 = err;
_didIteratorError4 = true;
_iteratorError4 = err;
} finally {
try {
if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) {
_iterator3["return"]();
if (!_iteratorNormalCompletion4 && _iterator4["return"] != null) {
_iterator4["return"]();
}
} finally {
if (_didIteratorError3) {
throw _iteratorError3;
if (_didIteratorError4) {
throw _iteratorError4;
}
}
}
@ -20609,7 +20632,7 @@
canvas.moveSelectedElements(diffX * currentZoom, diffY * currentZoom, true);
return "continue";
} // 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)) {}
@ -21288,9 +21311,9 @@
this.moveToTopSelectedElement = function () {
var _selectedElements2 = selectedElements,
_selectedElements3 = _slicedToArray(_selectedElements2, 1),
selected = _selectedElements3[0];
var _selectedElements = selectedElements,
_selectedElements2 = _slicedToArray(_selectedElements, 1),
selected = _selectedElements2[0];
if (!isNullish(selected)) {
var t = selected;
@ -21315,9 +21338,9 @@
this.moveToBottomSelectedElement = function () {
var _selectedElements4 = selectedElements,
_selectedElements5 = _slicedToArray(_selectedElements4, 1),
selected = _selectedElements5[0];
var _selectedElements3 = selectedElements,
_selectedElements4 = _slicedToArray(_selectedElements3, 1),
selected = _selectedElements4[0];
if (!isNullish(selected)) {
var t = selected;
@ -21625,45 +21648,45 @@
var dx = new Array(len);
var dy = new Array(len);
for (var _i7 = 0; _i7 < len; ++_i7) {
if (isNullish(selectedElements[_i7])) {
for (var _i6 = 0; _i6 < len; ++_i6) {
if (isNullish(selectedElements[_i6])) {
break;
} // const elem = selectedElements[i];
var bbox = bboxes[_i7];
dx[_i7] = 0;
dy[_i7] = 0;
var bbox = bboxes[_i6];
dx[_i6] = 0;
dy[_i6] = 0;
switch (type) {
case 'l':
// left (horizontal)
dx[_i7] = minx - bbox.x;
dx[_i6] = minx - bbox.x;
break;
case 'c':
// center (horizontal)
dx[_i7] = (minx + maxx) / 2 - (bbox.x + bbox.width / 2);
dx[_i6] = (minx + maxx) / 2 - (bbox.x + bbox.width / 2);
break;
case 'r':
// right (horizontal)
dx[_i7] = maxx - (bbox.x + bbox.width);
dx[_i6] = maxx - (bbox.x + bbox.width);
break;
case 't':
// top (vertical)
dy[_i7] = miny - bbox.y;
dy[_i6] = miny - bbox.y;
break;
case 'm':
// middle (vertical)
dy[_i7] = (miny + maxy) / 2 - (bbox.y + bbox.height / 2);
dy[_i6] = (miny + maxy) / 2 - (bbox.y + bbox.height / 2);
break;
case 'b':
// bottom (vertical)
dy[_i7] = maxy - (bbox.y + bbox.height);
dy[_i6] = maxy - (bbox.y + bbox.height);
break;
}
}
@ -22829,14 +22852,14 @@
/**
*
* @param {boolean} [toImage]
* @param {external:jQuery.svgIcons.Fallback} [fallback]
* @param {external:jQuery.svgIcons.Fallback} [fallback=false]
* @returns {void}
*/
function makeIcons() {
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 (opts.no_img) toImage = false;
var tempHolder;
@ -30171,7 +30194,8 @@
},
'div#workarea': {
left: 38,
top: 74 // '#tools_bottom': {
top: 74
} // '#tools_bottom': {
// left: {s: '27px', l: '46px', xl: '65px'},
// height: {s: '58px', l: '98px', xl: '145px'}
// },
@ -30254,7 +30278,6 @@
// width: {all: (size_num*4) +'px'}
// }
}
};
var ruleElem = $$b('#tool_size_rules');
@ -30758,7 +30781,7 @@
var num = 5 - $$b('#layerlist tr.layer').size();
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>');
}
};

1395
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -76,25 +76,25 @@
],
"dependencies": {},
"devDependencies": {
"@babel/core": "^7.5.5",
"@babel/node": "^7.5.5",
"@babel/plugin-transform-modules-commonjs": "^7.5.0",
"@babel/plugin-transform-named-capturing-groups-regex": "^7.4.5",
"@babel/preset-env": "^7.5.5",
"@mysticatea/eslint-plugin": "^11.0.0",
"@babel/core": "^7.6.0",
"@babel/node": "^7.6.1",
"@babel/plugin-transform-modules-commonjs": "^7.6.0",
"@babel/plugin-transform-named-capturing-groups-regex": "^7.6.0",
"@babel/preset-env": "^7.6.0",
"@mysticatea/eslint-plugin": "^12.0.0",
"axe-core": "^3.3.2",
"axe-testcafe": "^3.0.0",
"babel-plugin-transform-object-rest-spread": "^7.0.0-beta.3",
"core-js-bundle": "^3.2.1",
"eslint": "6.3.0",
"eslint-config-ash-nazg": "8.9.0",
"eslint": "6.4.0",
"eslint-config-ash-nazg": "9.0.1",
"eslint-config-standard": "14.1.0",
"eslint-plugin-array-func": "^3.1.3",
"eslint-plugin-compat": "^3.3.0",
"eslint-plugin-eslint-comments": "^3.1.2",
"eslint-plugin-html": "^6.0.0",
"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-no-use-extend-native": "^0.4.1",
"eslint-plugin-node": "10.0.0",
@ -103,8 +103,8 @@
"eslint-plugin-sonarjs": "^0.4.0",
"eslint-plugin-standard": "4.0.1",
"eslint-plugin-testcafe": "^0.2.1",
"eslint-plugin-unicorn": "^10.0.0",
"imageoptim-cli": "^2.3.9",
"eslint-plugin-unicorn": "^11.0.1",
"imageoptim-cli": "^3.0.0",
"jamilih": "^0.45.0",
"jsdoc": "^3.6.3",
"load-stylesheets": "^0.8.0",
@ -117,13 +117,13 @@
"regenerator-runtime": "^0.13.3",
"remark-cli": "^7.0.0",
"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-re": "^1.0.7",
"rollup-plugin-terser": "^5.1.1",
"rollup-plugin-terser": "^5.1.2",
"sinon": "^7.4.2",
"sinon-test": "^2.4.0",
"stackblur-canvas": "^2.2.0",
"testcafe": "^1.4.3"
"testcafe": "^1.5.0"
}
}

View File

@ -231,6 +231,10 @@
}
function _iterableToArrayLimit(arr, i) {
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
return;
}
var _arr = [];
var _n = true;
var _d = false;
@ -266,7 +270,7 @@
function _wrapRegExp(re, groups) {
_wrapRegExp = function (re, groups) {
return new BabelRegExp(re, groups);
return new BabelRegExp(re, undefined, groups);
};
var _RegExp = _wrapNativeSuper(RegExp);
@ -275,10 +279,10 @@
var _groups = new WeakMap();
function BabelRegExp(re, groups) {
var _this = _RegExp.call(this, re);
function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re, flags);
_groups.set(_this, groups);
_groups.set(_this, groups || _groups.get(re));
return _this;
}
@ -2739,7 +2743,7 @@
},
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: function get() {
return this.pathSegList;
@ -4695,7 +4699,7 @@
}, {
key: "addCommandToHistory",
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
// entire text contents of the text element)
// 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.
* @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 {module:utilities.TreeWalker} cbFn - Callback function to run on each element
* @returns {void}
@ -9364,8 +9368,8 @@
*/
var regexEscape = function regexEscape(str) {
// From: http://phpjs.org/functions
return String(str).replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\-]', 'g'), '\\$&');
// Originally from: http://phpjs.org/functions
return String(str).replace(/[.\\+*?[^\]$(){}=!<>|:-]/g, '\\$&');
};
/**
* Prevents default browser click behaviour on the given element.
@ -11827,7 +11831,7 @@
} else {
// 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 = [];
while (node.hasChildNodes()) {
@ -12507,7 +12511,7 @@
if (Math.abs(a) > 1.0e-10) {
s = Math.sin(a) / (1 - Math.cos(a));
} else {
// FIXME: This blows up if the angle is exactly 0!
// TODO: This blows up if the angle is exactly 0!
s = 2 / a;
}
@ -12868,7 +12872,7 @@
} // else, it's a non-group
} 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>,
// but we still may need to recalculate them (see issue 595).
// TODO: Figure out how to get BBox from these elements in case they
@ -12892,7 +12896,7 @@
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;
for (var _i2 = 0; _i2 < tlist.numberOfItems; ++_i2) {
@ -15611,8 +15615,13 @@
if (!rightClick) {
// insert a dummy transform so if the element(s) are moved it will have
// a transform to use for its translate
for (var _i2 = 0, _selectedElements = selectedElements; _i2 < _selectedElements.length; _i2++) {
var selectedElement = _selectedElements[_i2];
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = selectedElements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var selectedElement = _step.value;
if (isNullish(selectedElement)) {
continue;
@ -15626,6 +15635,20 @@
slist.appendItem(svgroot.createSVGTransform());
}
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
_iterator["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
}
} else if (!rightClick) {
clearSelection();
@ -15787,7 +15810,7 @@
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)
// Fallthrough
@ -17729,11 +17752,11 @@
}
});
});
var _i3 = attrs.length;
var _i2 = attrs.length;
var attrNames = ['width', 'height', 'xmlns', 'x', 'y', 'viewBox', 'id', 'overflow'];
while (_i3--) {
var attr = attrs[_i3];
while (_i2--) {
var attr = attrs[_i2];
var attrVal = toXml(attr.value); // Namespaces have already been dealt with, so skip
if (attr.nodeName.startsWith('xmlns:')) {
@ -17759,8 +17782,8 @@
var mozAttrs = ['-moz-math-font-style', '_moz-math-font-style'];
for (var _i4 = attrs.length - 1; _i4 >= 0; _i4--) {
var _attr = attrs[_i4];
for (var _i3 = attrs.length - 1; _i3 >= 0; _i3--) {
var _attr = attrs[_i3];
var _attrVal = toXml(_attr.value); // remove bogus attributes added by Gecko
@ -17816,14 +17839,14 @@
indent++;
var bOneLine = false;
for (var _i5 = 0; _i5 < childs.length; _i5++) {
var child = childs.item(_i5);
for (var _i4 = 0; _i4 < childs.length; _i4++) {
var child = childs.item(_i4);
switch (child.nodeType) {
case 1:
// element node
out.push('\n');
out.push(this.svgToString(childs.item(_i5), indent));
out.push(this.svgToString(childs.item(_i4), indent));
break;
case 3:
@ -17865,7 +17888,7 @@
if (!bOneLine) {
out.push('\n');
for (var _i6 = 0; _i6 < indent; _i6++) {
for (var _i5 = 0; _i5 < indent; _i5++) {
out.push(' ');
}
}
@ -18941,27 +18964,27 @@
}
var attrs = svg.attributes;
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
try {
for (var _iterator = attrs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var attr = _step.value;
for (var _iterator2 = attrs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var attr = _step2.value;
// Ok for `NamedNodeMap`
symbol.setAttribute(attr.nodeName, attr.value);
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
_didIteratorError2 = true;
_iteratorError2 = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
_iterator["return"]();
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator2["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
if (_didIteratorError2) {
throw _iteratorError2;
}
}
}
@ -19186,29 +19209,29 @@
elem = $$9(elem).data('gsvg') || $$9(elem).data('symbol') || elem;
var childs = elem.childNodes;
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
var _iteratorNormalCompletion3 = true;
var _didIteratorError3 = false;
var _iteratorError3 = undefined;
try {
for (var _iterator2 = childs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var child = _step2.value;
for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
var child = _step3.value;
if (child.nodeName === 'title') {
return child.textContent;
}
}
} catch (err) {
_didIteratorError2 = true;
_iteratorError2 = err;
_didIteratorError3 = true;
_iteratorError3 = err;
} finally {
try {
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator2["return"]();
if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) {
_iterator3["return"]();
}
} finally {
if (_didIteratorError2) {
throw _iteratorError2;
if (_didIteratorError3) {
throw _iteratorError3;
}
}
}
@ -19276,13 +19299,13 @@
var docTitle = false,
oldTitle = '';
var batchCmd = new BatchCommand$1('Change Image Title');
var _iteratorNormalCompletion3 = true;
var _didIteratorError3 = false;
var _iteratorError3 = undefined;
var _iteratorNormalCompletion4 = true;
var _didIteratorError4 = false;
var _iteratorError4 = undefined;
try {
for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
var child = _step3.value;
for (var _iterator4 = childs[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
var child = _step4.value;
if (child.nodeName === 'title') {
docTitle = child;
@ -19291,16 +19314,16 @@
}
}
} catch (err) {
_didIteratorError3 = true;
_iteratorError3 = err;
_didIteratorError4 = true;
_iteratorError4 = err;
} finally {
try {
if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) {
_iterator3["return"]();
if (!_iteratorNormalCompletion4 && _iterator4["return"] != null) {
_iterator4["return"]();
}
} finally {
if (_didIteratorError3) {
throw _iteratorError3;
if (_didIteratorError4) {
throw _iteratorError4;
}
}
}
@ -20609,7 +20632,7 @@
canvas.moveSelectedElements(diffX * currentZoom, diffY * currentZoom, true);
return "continue";
} // 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)) {}
@ -21288,9 +21311,9 @@
this.moveToTopSelectedElement = function () {
var _selectedElements2 = selectedElements,
_selectedElements3 = _slicedToArray(_selectedElements2, 1),
selected = _selectedElements3[0];
var _selectedElements = selectedElements,
_selectedElements2 = _slicedToArray(_selectedElements, 1),
selected = _selectedElements2[0];
if (!isNullish(selected)) {
var t = selected;
@ -21315,9 +21338,9 @@
this.moveToBottomSelectedElement = function () {
var _selectedElements4 = selectedElements,
_selectedElements5 = _slicedToArray(_selectedElements4, 1),
selected = _selectedElements5[0];
var _selectedElements3 = selectedElements,
_selectedElements4 = _slicedToArray(_selectedElements3, 1),
selected = _selectedElements4[0];
if (!isNullish(selected)) {
var t = selected;
@ -21625,45 +21648,45 @@
var dx = new Array(len);
var dy = new Array(len);
for (var _i7 = 0; _i7 < len; ++_i7) {
if (isNullish(selectedElements[_i7])) {
for (var _i6 = 0; _i6 < len; ++_i6) {
if (isNullish(selectedElements[_i6])) {
break;
} // const elem = selectedElements[i];
var bbox = bboxes[_i7];
dx[_i7] = 0;
dy[_i7] = 0;
var bbox = bboxes[_i6];
dx[_i6] = 0;
dy[_i6] = 0;
switch (type) {
case 'l':
// left (horizontal)
dx[_i7] = minx - bbox.x;
dx[_i6] = minx - bbox.x;
break;
case 'c':
// center (horizontal)
dx[_i7] = (minx + maxx) / 2 - (bbox.x + bbox.width / 2);
dx[_i6] = (minx + maxx) / 2 - (bbox.x + bbox.width / 2);
break;
case 'r':
// right (horizontal)
dx[_i7] = maxx - (bbox.x + bbox.width);
dx[_i6] = maxx - (bbox.x + bbox.width);
break;
case 't':
// top (vertical)
dy[_i7] = miny - bbox.y;
dy[_i6] = miny - bbox.y;
break;
case 'm':
// middle (vertical)
dy[_i7] = (miny + maxy) / 2 - (bbox.y + bbox.height / 2);
dy[_i6] = (miny + maxy) / 2 - (bbox.y + bbox.height / 2);
break;
case 'b':
// bottom (vertical)
dy[_i7] = maxy - (bbox.y + bbox.height);
dy[_i6] = maxy - (bbox.y + bbox.height);
break;
}
}
@ -22829,14 +22852,14 @@
/**
*
* @param {boolean} [toImage]
* @param {external:jQuery.svgIcons.Fallback} [fallback]
* @param {external:jQuery.svgIcons.Fallback} [fallback=false]
* @returns {void}
*/
function makeIcons() {
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 (opts.no_img) toImage = false;
var tempHolder;
@ -30171,7 +30194,8 @@
},
'div#workarea': {
left: 38,
top: 74 // '#tools_bottom': {
top: 74
} // '#tools_bottom': {
// left: {s: '27px', l: '46px', xl: '65px'},
// height: {s: '58px', l: '98px', xl: '145px'}
// },
@ -30254,7 +30278,6 @@
// width: {all: (size_num*4) +'px'}
// }
}
};
var ruleElem = $$b('#tool_size_rules');
@ -30758,7 +30781,7 @@
var num = 5 - $$b('#layerlist tr.layer').size();
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>');
}
};

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'}
});
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);
elem.remove();