- Linting (ESLint): Remove now unneeded config and add per new update

- Refactoring: Prefer for-of, event.key (newly enforced linting)
- Refactoring: Better var. names
- npm: Update devDeps and update local copies
master
Brett Zamir 2019-05-24 20:17:17 +08:00
parent f6b5360a58
commit 4177146acd
38 changed files with 2450 additions and 1476 deletions

View File

@ -50,12 +50,7 @@ module.exports = {
// In case we need to extend
customTags: []
},
allowOverrideWithoutParam: true,
allowImplementsWithoutParam: true,
allowAugmentsExtendsWithoutParam: true,
// For `jsdoc/check-examples` in `ash-nazg`
matchingFileName: "dummy.md",
rejectExampleCodeRegex: "^`",
augmentsExtendsReplacesDocs: true,
// Todo: Figure out why this is not working and why seem to have to
// disable for all Markdown:
/*
@ -65,34 +60,6 @@ module.exports = {
}
}
*/
// Todo: Remove after ash-nazg update
forceRequireReturn: true,
// Todo: Remove if ash-nazg has sufficiently merged
preferredTypes: {
"*": {
message: "Use a more precise type or if necessary use `{{preferredType}}` or `ArbitraryCallbackResult`",
replacement: "Any"
},
any: {
message: "Use a more precise type or if necessary use `{{preferredType}}` or `ArbitraryCallbackResult`",
replacement: "Any"
},
number: {
message: "Use `Integer` or `Float`"
},
Function: {
message: "Point to a `@callback` namepath or `{{preferredType}}` if truly arbitrary in form",
replacement: "GenericCallback"
},
object: {
message: "Use the specific object type or `{{preferredType}}` (or `ArbitraryObject` or `ArbitraryModule`) if truly arbitrary",
replacement: "PlainObject"
},
Array: {
message: "Use `{{preferredType}}` (or `ArgumentsArray`) if it is truly arbitrary.",
replacement: "GenericArray"
}
}
}
},
overrides: [
@ -173,7 +140,7 @@ module.exports = {
// Node files
files: [
"docs/jsdoc-config.js",
"build-html.js", "jsdoc-check-overly-generic-types.js",
"build-html.js",
"rollup.config.js", "rollup-config.config.js"
],
env: {
@ -216,13 +183,6 @@ module.exports = {
}],
"unicorn/prefer-query-selector": "off",
"unicorn/prefer-node-append": "off",
"unicorn/no-zero-fractions": "off",
// Todo: Remove when ash-nazg removes
"valid-jsdoc": "off",
// Todo: Remove when ash-nazg adds (then also remove
// jsdoc-check-overly-generic-types.js file and npm script)
"jsdoc/require-returns-check": ["error"],
"jsdoc/match-description": ["error"],
"unicorn/no-zero-fractions": "off"
}
};

View File

@ -4,5 +4,4 @@ test
.github/ISSUE_TEMPLATE/bug_report.md
build
jsdoc-check-overly-generic-types.js
lgtm.yml

View File

@ -7,6 +7,7 @@
- Enhancement: Added `avoidClientSideOpen` config for
`ext-server_opensave.js`
- Refactoring: Use `static` keyword for classes
- Build: Remove `types-docs` script as being handled in ESLint
- npm: Update devDeps (including switching from deprecate opn-cli
package to open-cli)

2
dist/canvg.js vendored
View File

@ -924,7 +924,7 @@ var canvg = (function (exports) {
* @param {HTMLCanvasElement|string} target canvas element or the id of a canvas element
* @param {string|XMLDocument} s - svg string, url to svg file, or xml document
* @param {module:canvg.CanvgOptions} [opts] Optional hash of options
* @returns {Promise} All the function after the first render is completed with dom
* @returns {Promise<XMLDocument|XMLDocument[]>} All the function after the first render is completed with dom
*/

View File

@ -40,7 +40,7 @@ var svgEditorExtension_mathjax = (function () {
/**
* Add any of the whitelisted attributes to the script tag.
* @param {HTMLScriptElement} script
* @param {PlainObject.<string, string>} atts
* @param {PlainObject<string, string>} atts
* @returns {void}
*/

View File

@ -924,7 +924,7 @@ var svgEditorExtension_server_moinsave = (function () {
* @param {HTMLCanvasElement|string} target canvas element or the id of a canvas element
* @param {string|XMLDocument} s - svg string, url to svg file, or xml document
* @param {module:canvg.CanvgOptions} [opts] Optional hash of options
* @returns {Promise} All the function after the first render is completed with dom
* @returns {Promise<XMLDocument|XMLDocument[]>} All the function after the first render is completed with dom
*/

View File

@ -924,7 +924,7 @@ var svgEditorExtension_server_opensave = (function () {
* @param {HTMLCanvasElement|string} target canvas element or the id of a canvas element
* @param {string|XMLDocument} s - svg string, url to svg file, or xml document
* @param {module:canvg.CanvgOptions} [opts] Optional hash of options
* @returns {Promise} All the function after the first render is completed with dom
* @returns {Promise<XMLDocument|XMLDocument[]>} All the function after the first render is completed with dom
*/

File diff suppressed because it is too large Load Diff

265
dist/index-es.js vendored
View File

@ -2927,7 +2927,7 @@ function jQueryPluginSVG($) {
/**
* @function external:jQuery.fn.attr
* @param {string|string[]|PlainObject.<string, string>} key
* @param {string|string[]|PlainObject<string, string>} key
* @param {string} value
* @returns {external:jQuery|module:jQueryAttr.Attributes}
*/
@ -3134,6 +3134,7 @@ function () {
/**
* @param {Element} elem
* @returns {SVGTransformList}
*/
function SVGTransformList(elem) {
_classCallCheck(this, SVGTransformList);
@ -3242,7 +3243,7 @@ function () {
}
/**
* @param {SVGTransform} newItem
* @returns {SVGTransform}
* @returns {void}
*/
}, {
@ -5379,7 +5380,7 @@ var getPointGrip = function getPointGrip(seg, update) {
/**
* @function module:path.getControlPoints
* @param {Segment} seg
* @returns {PlainObject.<string, SVGLineElement|SVGCircleElement>}
* @returns {PlainObject<string, SVGLineElement|SVGCircleElement>}
*/
var getControlPoints = function getControlPoints(seg) {
@ -7124,7 +7125,7 @@ var pathActions = function () {
width: 0,
height: 0,
display: 'inline'
}, 100);
});
}
return undefined;
@ -8682,7 +8683,7 @@ var getPathDFromElement = function getPathDFromElement(elem) {
* Get a set of attributes from an element that is useful for convertToPath.
* @function module:utilities.getExtraAttributesForConvertToPath
* @param {Element} elem - The element to be probed
* @returns {PlainObject.<"marker-start"|"marker-end"|"marker-mid"|"filter"|"clip-path", string>} An object with attributes.
* @returns {PlainObject<"marker-start"|"marker-end"|"marker-mid"|"filter"|"clip-path", string>} An object with attributes.
*/
var getExtraAttributesForConvertToPath = function getExtraAttributesForConvertToPath(elem) {
@ -9107,7 +9108,7 @@ var getElem = supportsSelectors() ? function (id) {
* Assigns multiple attributes to an element.
* @function module:utilities.assignAttributes
* @param {Element} elem - DOM element to apply new attribute values to
* @param {PlainObject.<string, string>} attrs - Object with attribute keys/values
* @param {PlainObject<string, string>} attrs - Object with attribute keys/values
* @param {Integer} [suspendLength] - Milliseconds to suspend redraw
* @param {boolean} [unitCheck=false] - Boolean to indicate the need to use units.setUnitAttr
* @returns {void}
@ -9357,7 +9358,7 @@ function toAbsoluteURL(url) {
/**
* Add any of the whitelisted attributes to the script tag.
* @param {HTMLScriptElement} script
* @param {PlainObject.<string, string>} atts
* @param {PlainObject<string, string>} atts
* @returns {void}
*/
@ -9378,9 +9379,9 @@ function addScriptAtts(script, atts) {
/**
* @function module:importModule.importSetGlobalDefault
* @param {string|string[]} url
* @param {string|GenericArray<Any>} url
* @param {module:importModule.ImportConfig} config
* @returns {Promise<*>} The value to which it resolves depends on the export of the targeted module.
* @returns {Promise<Any>} The value to which it resolves depends on the export of the targeted module.
*/
@ -9501,7 +9502,7 @@ function importScript(url) {
* @param {PlainObject} [atts={}]
* @param {PlainObject} opts
* @param {boolean} [opts.returnDefault=false} = {}]
* @returns {Promise<*>} Resolves to value of loading module or rejects with
* @returns {Promise<Any>} Resolves to value of loading module or rejects with
* `Error` upon a script loading error.
*/
@ -9607,7 +9608,7 @@ function jQueryPluginDBox($) {
* types without checkboxes, it resolves to `true`. For checkboxes, it resolves
* to an object with the `response` key containing the same value as the previous
* mentioned (string or `true`) and a `checked` (boolean) property.
* @typedef {Promise<boolean|string|module:jQueryPluginDBox.PromiseResultObject>} module:jQueryPluginDBox.PromiseResult
* @typedef {Promise<boolean|string|module:jQueryPluginDBox.PromiseResultObject>} module:jQueryPluginDBox.ResultPromise
*/
/**
@ -9641,7 +9642,7 @@ function jQueryPluginDBox($) {
* @param {module:jQueryPluginDBox.SelectOption[]} [opts]
* @param {module:jQueryPluginDBox.SelectChangeListener} [changeListener]
* @param {module:jQueryPluginDBox.CheckboxInfo} [checkbox]
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
function dbox(type, msg, defaultVal, opts, changeListener, checkbox) {
@ -9729,7 +9730,7 @@ function jQueryPluginDBox($) {
}
/**
* @param {string} msg Message to alert
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
@ -9738,7 +9739,7 @@ function jQueryPluginDBox($) {
};
/**
* @param {string} msg Message for which to ask confirmation
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
@ -9747,7 +9748,7 @@ function jQueryPluginDBox($) {
};
/**
* @param {string} msg Message to indicate upon cancelable indicator
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
@ -9757,7 +9758,7 @@ function jQueryPluginDBox($) {
/**
* @param {string} msg Message to accompany the prompt
* @param {string} [defaultText=''] The default text to show for the prompt
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
@ -9930,8 +9931,28 @@ function () {
}, {
key: "appendChildren",
value: function appendChildren(children) {
for (var i = 0; i < children.length; ++i) {
this.group_.append(children[i]);
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var child = _step.value;
this.group_.append(child);
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
_iterator["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
}
/**
@ -13778,10 +13799,10 @@ function SvgCanvas(container, config) {
'fill-opacity': curShape.fill_opacity,
opacity: curShape.opacity / 2,
style: 'pointer-events:inherit'
}, 100);
});
}
assignAttributes(shape, data.attr, 100);
assignAttributes(shape, data.attr);
cleanupElement(shape); // Children
if (data.children) {
@ -14510,7 +14531,7 @@ function SvgCanvas(container, config) {
* @param {module:svgcanvas.SvgCanvas#event:ext_mouseDown|module:svgcanvas.SvgCanvas#event:ext_mouseMove|module:svgcanvas.SvgCanvas#event:ext_mouseUp|module:svgcanvas.SvgCanvas#event:ext_zoomChanged|module:svgcanvas.SvgCanvas#event:ext_IDsUpdated|module:svgcanvas.SvgCanvas#event:ext_canvasUpdated|module:svgcanvas.SvgCanvas#event:ext_toolButtonStateUpdate|module:svgcanvas.SvgCanvas#event:ext_selectedChanged|module:svgcanvas.SvgCanvas#event:ext_elementTransition|module:svgcanvas.SvgCanvas#event:ext_elementChanged|module:svgcanvas.SvgCanvas#event:ext_langReady|module:svgcanvas.SvgCanvas#event:ext_langChanged|module:svgcanvas.SvgCanvas#event:ext_addLangData|module:svgcanvas.SvgCanvas#event:ext_onNewDocument|module:svgcanvas.SvgCanvas#event:ext_workareaResized|module:svgcanvas.ExtensionVarBuilder} [vars]
* @param {boolean} [returnArray]
* @param {module:svgcanvas.ExtensionNameFilter} nameFilter
* @returns {GenericArray.<module:svgcanvas.ExtensionStatus>|module:svgcanvas.ExtensionStatus|false} See {@tutorial ExtensionDocs} on the ExtensionStatus.
* @returns {GenericArray<module:svgcanvas.ExtensionStatus>|module:svgcanvas.ExtensionStatus|false} See {@tutorial ExtensionDocs} on the ExtensionStatus.
*/
@ -15435,12 +15456,14 @@ 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 i = 0; i < selectedElements.length; ++i) {
if (isNullish(selectedElements[i])) {
for (var _i2 = 0, _selectedElements = selectedElements; _i2 < _selectedElements.length; _i2++) {
var selectedElement = _selectedElements[_i2];
if (isNullish(selectedElement)) {
continue;
}
var slist = getTransformList(selectedElements[i]);
var slist = getTransformList(selectedElement);
if (slist.numberOfItems) {
slist.insertItemBefore(svgroot.createSVGTransform(), 0);
@ -15469,7 +15492,7 @@ function SvgCanvas(container, config) {
width: 0,
height: 0,
display: 'inline'
}, 100);
});
}
break;
@ -15487,7 +15510,7 @@ function SvgCanvas(container, config) {
width: 0,
height: 0,
display: 'inline'
}, 100);
});
break;
case 'resize':
@ -15544,16 +15567,16 @@ function SvgCanvas(container, config) {
var all = mouseTarget.getElementsByTagName('*'),
len = all.length;
for (var _i2 = 0; _i2 < len; _i2++) {
if (!all[_i2].style) {
for (var i = 0; i < len; i++) {
if (!all[i].style) {
// mathML
continue;
}
all[_i2].style.vectorEffect = 'non-scaling-stroke';
all[i].style.vectorEffect = 'non-scaling-stroke';
if (iswebkit) {
delayedStroke(all[_i2]);
delayedStroke(all[i]);
}
}
}
@ -15884,7 +15907,7 @@ function SvgCanvas(container, config) {
y: Math.min(rStartY, realY),
width: Math.abs(realX - rStartX),
height: Math.abs(realY - rStartY)
}, 100); // for each selected:
}); // for each selected:
// - if newList contains selected, do nothing
// - if newList doesn't contain selected, remove it from selected
// - for any newList that was not in selectedElements, add it to selected
@ -16032,7 +16055,7 @@ function SvgCanvas(container, config) {
y: Math.min(rStartY * currentZoom, realY),
width: Math.abs(realX - rStartX * currentZoom),
height: Math.abs(realY - rStartY * currentZoom)
}, 100);
});
break;
}
@ -16041,7 +16064,7 @@ function SvgCanvas(container, config) {
assignAttributes(shape, {
x: x,
y: y
}, 1000);
});
break;
}
@ -16100,7 +16123,7 @@ function SvgCanvas(container, config) {
height: h,
x: newX,
y: newY
}, 1000);
});
break;
}
@ -16232,7 +16255,7 @@ function SvgCanvas(container, config) {
y: Math.min(rStartY * currentZoom, realY),
width: Math.abs(realX - rStartX * currentZoom),
height: Math.abs(realY - rStartY * currentZoom)
}, 100);
});
}
pathActions$1.mouseMove(x, y);
@ -19006,10 +19029,30 @@ 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;
for (var i = 0; i < childs.length; i++) {
if (childs[i].nodeName === 'title') {
return childs[i].textContent;
try {
for (var _iterator2 = childs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var child = _step2.value;
if (child.nodeName === 'title') {
return child.textContent;
}
}
} catch (err) {
_didIteratorError2 = true;
_iteratorError2 = err;
} finally {
try {
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator2["return"]();
}
} finally {
if (_didIteratorError2) {
throw _iteratorError2;
}
}
}
@ -19076,12 +19119,32 @@ 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;
for (var i = 0; i < childs.length; i++) {
if (childs[i].nodeName === 'title') {
docTitle = childs[i];
oldTitle = docTitle.textContent;
break;
try {
for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
var child = _step3.value;
if (child.nodeName === 'title') {
docTitle = child;
oldTitle = docTitle.textContent;
break;
}
}
} catch (err) {
_didIteratorError3 = true;
_iteratorError3 = err;
} finally {
try {
if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) {
_iterator3["return"]();
}
} finally {
if (_didIteratorError3) {
throw _iteratorError3;
}
}
}
@ -19922,7 +19985,7 @@ function SvgCanvas(container, config) {
y: '-50%',
width: '200%',
height: '200%'
}, 100); // Removing these attributes hides text in Chrome (see Issue 579)
}); // Removing these attributes hides text in Chrome (see Issue 579)
} else if (!isWebkit()) {
filterElem.removeAttribute('x');
filterElem.removeAttribute('y');
@ -21068,9 +21131,9 @@ function SvgCanvas(container, config) {
this.moveToTopSelectedElement = function () {
var _selectedElements = selectedElements,
_selectedElements2 = _slicedToArray(_selectedElements, 1),
selected = _selectedElements2[0];
var _selectedElements2 = selectedElements,
_selectedElements3 = _slicedToArray(_selectedElements2, 1),
selected = _selectedElements3[0];
if (!isNullish(selected)) {
var t = selected;
@ -21095,9 +21158,9 @@ function SvgCanvas(container, config) {
this.moveToBottomSelectedElement = function () {
var _selectedElements3 = selectedElements,
_selectedElements4 = _slicedToArray(_selectedElements3, 1),
selected = _selectedElements4[0];
var _selectedElements4 = selectedElements,
_selectedElements5 = _slicedToArray(_selectedElements4, 1),
selected = _selectedElements5[0];
if (!isNullish(selected)) {
var t = selected;
@ -22352,10 +22415,10 @@ function jQueryPluginSVGIcons($) {
* listed under "fallback"
* @param {boolean} [opts.replace] If set to `true`, HTML elements will
* be replaced by, rather than include the SVG icon.
* @param {PlainObject.<string, string>} [opts.placement] Map with selectors
* @param {PlainObject<string, string>} [opts.placement] Map with selectors
* for keys and SVG icon ids as values. This provides a custom method of
* adding icons.
* @param {PlainObject.<string, module:jQuerySVGIcons.Size>} [opts.resize] Map
* @param {PlainObject<string, module:jQuerySVGIcons.Size>} [opts.resize] Map
* with selectors for keys and numbers as values. This allows an easy way to
* resize specific icons.
* @param {module:jQuerySVGIcons.SVGIconsLoadedCallback} [opts.callback] A
@ -22777,7 +22840,7 @@ function jQueryPluginSVGIcons($) {
/**
* @function external:jQuery.resizeSvgIcons
* @param {PlainObject.<string, module:jQuerySVGIcons.Size>} obj Object with
* @param {PlainObject<string, module:jQuerySVGIcons.Size>} obj Object with
* selectors as keys. The values are sizes.
* @returns {void}
*/
@ -24682,9 +24745,28 @@ function jQueryContextMenu($) {
$(this).each(function () {
if (o !== undefined) {
var d = o.split(',');
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
for (var i = 0; i < d.length; i++) {
$(this).find('A[href="' + d[i] + '"]').parent().addClass('disabled');
try {
for (var _iterator = d[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var href = _step.value;
$(this).find('A[href="' + href + '"]').parent().addClass('disabled');
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
_iterator["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
}
});
@ -24707,9 +24789,28 @@ function jQueryContextMenu($) {
$(this).each(function () {
if (o !== undefined) {
var d = o.split(',');
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
for (var i = 0; i < d.length; i++) {
$(this).find('A[href="' + d[i] + '"]').parent().removeClass('disabled');
try {
for (var _iterator2 = d[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var href = _step2.value;
$(this).find('A[href="' + href + '"]').parent().removeClass('disabled');
}
} catch (err) {
_didIteratorError2 = true;
_iteratorError2 = err;
} finally {
try {
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator2["return"]();
}
} finally {
if (_didIteratorError2) {
throw _iteratorError2;
}
}
}
}
});
@ -28518,6 +28619,44 @@ function () {
};
}();
function _slicedToArray$1(arr, i) {
return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _nonIterableRest$1();
}
function _arrayWithHoles$1(arr) {
if (Array.isArray(arr)) return arr;
}
function _iterableToArrayLimit$1(arr, i) {
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"] != null) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
function _nonIterableRest$1() {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}
function loadStylesheets(stylesheets) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
beforeDefault = _ref.before,
@ -28536,7 +28675,7 @@ function loadStylesheets(stylesheets) {
if (Array.isArray(stylesheetURL)) {
var _stylesheetURL = stylesheetURL;
var _stylesheetURL2 = _slicedToArray(_stylesheetURL, 2);
var _stylesheetURL2 = _slicedToArray$1(_stylesheetURL, 2);
stylesheetURL = _stylesheetURL2[0];
var _stylesheetURL2$ = _stylesheetURL2[1];
@ -29998,7 +30137,7 @@ editor.init = function () {
setFlyoutPositions();
};
/**
* Setup SVG icons
* Setup SVG icons.
* @returns {void}
*/
@ -30381,7 +30520,7 @@ editor.init = function () {
}
/**
* This function highlights the layer passed in (by fading out the other layers).
* If no layer is passed in, this function restores the other layers
* If no layer is passed in, this function restores the other layers.
* @param {string} [layerNameToHighlight]
* @returns {void}
*/
@ -31757,7 +31896,7 @@ editor.init = function () {
var allHolders = {};
/**
* @param {PlainObject.<string, module:SVGEditor.ToolButton>} holders Key is a selector
* @param {PlainObject<string, module:SVGEditor.ToolButton>} holders Key is a selector
* @returns {void}
*/
@ -35826,7 +35965,7 @@ editor.init = function () {
}
});
/**
* Implements {@see module:jQueryContextMenu.jQueryContextMenuListener}
* Implements {@see module:jQueryContextMenu.jQueryContextMenuListener}.
* @param {"dupe"|"delete"|"merge_down"|"merge_all"} action
* @param {external:jQuery} el
* @param {{x: Float, y: Float, docX: Float, docY: Float}} pos
@ -36024,7 +36163,7 @@ editor.init = function () {
var result = _ref27.target.result;
/**
* Insert the new image until we know its dimensions
* Insert the new image until we know its dimensions.
* @param {Float} width
* @param {Float} height
* @returns {void}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

265
dist/index-umd.js vendored
View File

@ -2933,7 +2933,7 @@
/**
* @function external:jQuery.fn.attr
* @param {string|string[]|PlainObject.<string, string>} key
* @param {string|string[]|PlainObject<string, string>} key
* @param {string} value
* @returns {external:jQuery|module:jQueryAttr.Attributes}
*/
@ -3140,6 +3140,7 @@
/**
* @param {Element} elem
* @returns {SVGTransformList}
*/
function SVGTransformList(elem) {
_classCallCheck(this, SVGTransformList);
@ -3248,7 +3249,7 @@
}
/**
* @param {SVGTransform} newItem
* @returns {SVGTransform}
* @returns {void}
*/
}, {
@ -5385,7 +5386,7 @@
/**
* @function module:path.getControlPoints
* @param {Segment} seg
* @returns {PlainObject.<string, SVGLineElement|SVGCircleElement>}
* @returns {PlainObject<string, SVGLineElement|SVGCircleElement>}
*/
var getControlPoints = function getControlPoints(seg) {
@ -7130,7 +7131,7 @@
width: 0,
height: 0,
display: 'inline'
}, 100);
});
}
return undefined;
@ -8688,7 +8689,7 @@
* Get a set of attributes from an element that is useful for convertToPath.
* @function module:utilities.getExtraAttributesForConvertToPath
* @param {Element} elem - The element to be probed
* @returns {PlainObject.<"marker-start"|"marker-end"|"marker-mid"|"filter"|"clip-path", string>} An object with attributes.
* @returns {PlainObject<"marker-start"|"marker-end"|"marker-mid"|"filter"|"clip-path", string>} An object with attributes.
*/
var getExtraAttributesForConvertToPath = function getExtraAttributesForConvertToPath(elem) {
@ -9113,7 +9114,7 @@
* Assigns multiple attributes to an element.
* @function module:utilities.assignAttributes
* @param {Element} elem - DOM element to apply new attribute values to
* @param {PlainObject.<string, string>} attrs - Object with attribute keys/values
* @param {PlainObject<string, string>} attrs - Object with attribute keys/values
* @param {Integer} [suspendLength] - Milliseconds to suspend redraw
* @param {boolean} [unitCheck=false] - Boolean to indicate the need to use units.setUnitAttr
* @returns {void}
@ -9363,7 +9364,7 @@
/**
* Add any of the whitelisted attributes to the script tag.
* @param {HTMLScriptElement} script
* @param {PlainObject.<string, string>} atts
* @param {PlainObject<string, string>} atts
* @returns {void}
*/
@ -9384,9 +9385,9 @@
/**
* @function module:importModule.importSetGlobalDefault
* @param {string|string[]} url
* @param {string|GenericArray<Any>} url
* @param {module:importModule.ImportConfig} config
* @returns {Promise<*>} The value to which it resolves depends on the export of the targeted module.
* @returns {Promise<Any>} The value to which it resolves depends on the export of the targeted module.
*/
@ -9507,7 +9508,7 @@
* @param {PlainObject} [atts={}]
* @param {PlainObject} opts
* @param {boolean} [opts.returnDefault=false} = {}]
* @returns {Promise<*>} Resolves to value of loading module or rejects with
* @returns {Promise<Any>} Resolves to value of loading module or rejects with
* `Error` upon a script loading error.
*/
@ -9613,7 +9614,7 @@
* types without checkboxes, it resolves to `true`. For checkboxes, it resolves
* to an object with the `response` key containing the same value as the previous
* mentioned (string or `true`) and a `checked` (boolean) property.
* @typedef {Promise<boolean|string|module:jQueryPluginDBox.PromiseResultObject>} module:jQueryPluginDBox.PromiseResult
* @typedef {Promise<boolean|string|module:jQueryPluginDBox.PromiseResultObject>} module:jQueryPluginDBox.ResultPromise
*/
/**
@ -9647,7 +9648,7 @@
* @param {module:jQueryPluginDBox.SelectOption[]} [opts]
* @param {module:jQueryPluginDBox.SelectChangeListener} [changeListener]
* @param {module:jQueryPluginDBox.CheckboxInfo} [checkbox]
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
function dbox(type, msg, defaultVal, opts, changeListener, checkbox) {
@ -9735,7 +9736,7 @@
}
/**
* @param {string} msg Message to alert
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
@ -9744,7 +9745,7 @@
};
/**
* @param {string} msg Message for which to ask confirmation
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
@ -9753,7 +9754,7 @@
};
/**
* @param {string} msg Message to indicate upon cancelable indicator
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
@ -9763,7 +9764,7 @@
/**
* @param {string} msg Message to accompany the prompt
* @param {string} [defaultText=''] The default text to show for the prompt
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
@ -9936,8 +9937,28 @@
}, {
key: "appendChildren",
value: function appendChildren(children) {
for (var i = 0; i < children.length; ++i) {
this.group_.append(children[i]);
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var child = _step.value;
this.group_.append(child);
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
_iterator["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
}
/**
@ -13784,10 +13805,10 @@
'fill-opacity': curShape.fill_opacity,
opacity: curShape.opacity / 2,
style: 'pointer-events:inherit'
}, 100);
});
}
assignAttributes(shape, data.attr, 100);
assignAttributes(shape, data.attr);
cleanupElement(shape); // Children
if (data.children) {
@ -14516,7 +14537,7 @@
* @param {module:svgcanvas.SvgCanvas#event:ext_mouseDown|module:svgcanvas.SvgCanvas#event:ext_mouseMove|module:svgcanvas.SvgCanvas#event:ext_mouseUp|module:svgcanvas.SvgCanvas#event:ext_zoomChanged|module:svgcanvas.SvgCanvas#event:ext_IDsUpdated|module:svgcanvas.SvgCanvas#event:ext_canvasUpdated|module:svgcanvas.SvgCanvas#event:ext_toolButtonStateUpdate|module:svgcanvas.SvgCanvas#event:ext_selectedChanged|module:svgcanvas.SvgCanvas#event:ext_elementTransition|module:svgcanvas.SvgCanvas#event:ext_elementChanged|module:svgcanvas.SvgCanvas#event:ext_langReady|module:svgcanvas.SvgCanvas#event:ext_langChanged|module:svgcanvas.SvgCanvas#event:ext_addLangData|module:svgcanvas.SvgCanvas#event:ext_onNewDocument|module:svgcanvas.SvgCanvas#event:ext_workareaResized|module:svgcanvas.ExtensionVarBuilder} [vars]
* @param {boolean} [returnArray]
* @param {module:svgcanvas.ExtensionNameFilter} nameFilter
* @returns {GenericArray.<module:svgcanvas.ExtensionStatus>|module:svgcanvas.ExtensionStatus|false} See {@tutorial ExtensionDocs} on the ExtensionStatus.
* @returns {GenericArray<module:svgcanvas.ExtensionStatus>|module:svgcanvas.ExtensionStatus|false} See {@tutorial ExtensionDocs} on the ExtensionStatus.
*/
@ -15441,12 +15462,14 @@
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 i = 0; i < selectedElements.length; ++i) {
if (isNullish(selectedElements[i])) {
for (var _i2 = 0, _selectedElements = selectedElements; _i2 < _selectedElements.length; _i2++) {
var selectedElement = _selectedElements[_i2];
if (isNullish(selectedElement)) {
continue;
}
var slist = getTransformList(selectedElements[i]);
var slist = getTransformList(selectedElement);
if (slist.numberOfItems) {
slist.insertItemBefore(svgroot.createSVGTransform(), 0);
@ -15475,7 +15498,7 @@
width: 0,
height: 0,
display: 'inline'
}, 100);
});
}
break;
@ -15493,7 +15516,7 @@
width: 0,
height: 0,
display: 'inline'
}, 100);
});
break;
case 'resize':
@ -15550,16 +15573,16 @@
var all = mouseTarget.getElementsByTagName('*'),
len = all.length;
for (var _i2 = 0; _i2 < len; _i2++) {
if (!all[_i2].style) {
for (var i = 0; i < len; i++) {
if (!all[i].style) {
// mathML
continue;
}
all[_i2].style.vectorEffect = 'non-scaling-stroke';
all[i].style.vectorEffect = 'non-scaling-stroke';
if (iswebkit) {
delayedStroke(all[_i2]);
delayedStroke(all[i]);
}
}
}
@ -15890,7 +15913,7 @@
y: Math.min(rStartY, realY),
width: Math.abs(realX - rStartX),
height: Math.abs(realY - rStartY)
}, 100); // for each selected:
}); // for each selected:
// - if newList contains selected, do nothing
// - if newList doesn't contain selected, remove it from selected
// - for any newList that was not in selectedElements, add it to selected
@ -16038,7 +16061,7 @@
y: Math.min(rStartY * currentZoom, realY),
width: Math.abs(realX - rStartX * currentZoom),
height: Math.abs(realY - rStartY * currentZoom)
}, 100);
});
break;
}
@ -16047,7 +16070,7 @@
assignAttributes(shape, {
x: x,
y: y
}, 1000);
});
break;
}
@ -16106,7 +16129,7 @@
height: h,
x: newX,
y: newY
}, 1000);
});
break;
}
@ -16238,7 +16261,7 @@
y: Math.min(rStartY * currentZoom, realY),
width: Math.abs(realX - rStartX * currentZoom),
height: Math.abs(realY - rStartY * currentZoom)
}, 100);
});
}
pathActions$1.mouseMove(x, y);
@ -19012,10 +19035,30 @@
elem = $$9(elem).data('gsvg') || $$9(elem).data('symbol') || elem;
var childs = elem.childNodes;
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
for (var i = 0; i < childs.length; i++) {
if (childs[i].nodeName === 'title') {
return childs[i].textContent;
try {
for (var _iterator2 = childs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var child = _step2.value;
if (child.nodeName === 'title') {
return child.textContent;
}
}
} catch (err) {
_didIteratorError2 = true;
_iteratorError2 = err;
} finally {
try {
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator2["return"]();
}
} finally {
if (_didIteratorError2) {
throw _iteratorError2;
}
}
}
@ -19082,12 +19125,32 @@
var docTitle = false,
oldTitle = '';
var batchCmd = new BatchCommand$1('Change Image Title');
var _iteratorNormalCompletion3 = true;
var _didIteratorError3 = false;
var _iteratorError3 = undefined;
for (var i = 0; i < childs.length; i++) {
if (childs[i].nodeName === 'title') {
docTitle = childs[i];
oldTitle = docTitle.textContent;
break;
try {
for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
var child = _step3.value;
if (child.nodeName === 'title') {
docTitle = child;
oldTitle = docTitle.textContent;
break;
}
}
} catch (err) {
_didIteratorError3 = true;
_iteratorError3 = err;
} finally {
try {
if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) {
_iterator3["return"]();
}
} finally {
if (_didIteratorError3) {
throw _iteratorError3;
}
}
}
@ -19928,7 +19991,7 @@
y: '-50%',
width: '200%',
height: '200%'
}, 100); // Removing these attributes hides text in Chrome (see Issue 579)
}); // Removing these attributes hides text in Chrome (see Issue 579)
} else if (!isWebkit()) {
filterElem.removeAttribute('x');
filterElem.removeAttribute('y');
@ -21074,9 +21137,9 @@
this.moveToTopSelectedElement = function () {
var _selectedElements = selectedElements,
_selectedElements2 = _slicedToArray(_selectedElements, 1),
selected = _selectedElements2[0];
var _selectedElements2 = selectedElements,
_selectedElements3 = _slicedToArray(_selectedElements2, 1),
selected = _selectedElements3[0];
if (!isNullish(selected)) {
var t = selected;
@ -21101,9 +21164,9 @@
this.moveToBottomSelectedElement = function () {
var _selectedElements3 = selectedElements,
_selectedElements4 = _slicedToArray(_selectedElements3, 1),
selected = _selectedElements4[0];
var _selectedElements4 = selectedElements,
_selectedElements5 = _slicedToArray(_selectedElements4, 1),
selected = _selectedElements5[0];
if (!isNullish(selected)) {
var t = selected;
@ -22358,10 +22421,10 @@
* listed under "fallback"
* @param {boolean} [opts.replace] If set to `true`, HTML elements will
* be replaced by, rather than include the SVG icon.
* @param {PlainObject.<string, string>} [opts.placement] Map with selectors
* @param {PlainObject<string, string>} [opts.placement] Map with selectors
* for keys and SVG icon ids as values. This provides a custom method of
* adding icons.
* @param {PlainObject.<string, module:jQuerySVGIcons.Size>} [opts.resize] Map
* @param {PlainObject<string, module:jQuerySVGIcons.Size>} [opts.resize] Map
* with selectors for keys and numbers as values. This allows an easy way to
* resize specific icons.
* @param {module:jQuerySVGIcons.SVGIconsLoadedCallback} [opts.callback] A
@ -22783,7 +22846,7 @@
/**
* @function external:jQuery.resizeSvgIcons
* @param {PlainObject.<string, module:jQuerySVGIcons.Size>} obj Object with
* @param {PlainObject<string, module:jQuerySVGIcons.Size>} obj Object with
* selectors as keys. The values are sizes.
* @returns {void}
*/
@ -24688,9 +24751,28 @@
$(this).each(function () {
if (o !== undefined) {
var d = o.split(',');
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
for (var i = 0; i < d.length; i++) {
$(this).find('A[href="' + d[i] + '"]').parent().addClass('disabled');
try {
for (var _iterator = d[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var href = _step.value;
$(this).find('A[href="' + href + '"]').parent().addClass('disabled');
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
_iterator["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
}
});
@ -24713,9 +24795,28 @@
$(this).each(function () {
if (o !== undefined) {
var d = o.split(',');
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
for (var i = 0; i < d.length; i++) {
$(this).find('A[href="' + d[i] + '"]').parent().removeClass('disabled');
try {
for (var _iterator2 = d[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var href = _step2.value;
$(this).find('A[href="' + href + '"]').parent().removeClass('disabled');
}
} catch (err) {
_didIteratorError2 = true;
_iteratorError2 = err;
} finally {
try {
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator2["return"]();
}
} finally {
if (_didIteratorError2) {
throw _iteratorError2;
}
}
}
}
});
@ -28524,6 +28625,44 @@
};
}();
function _slicedToArray$1(arr, i) {
return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _nonIterableRest$1();
}
function _arrayWithHoles$1(arr) {
if (Array.isArray(arr)) return arr;
}
function _iterableToArrayLimit$1(arr, i) {
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"] != null) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
function _nonIterableRest$1() {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}
function loadStylesheets(stylesheets) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
beforeDefault = _ref.before,
@ -28542,7 +28681,7 @@
if (Array.isArray(stylesheetURL)) {
var _stylesheetURL = stylesheetURL;
var _stylesheetURL2 = _slicedToArray(_stylesheetURL, 2);
var _stylesheetURL2 = _slicedToArray$1(_stylesheetURL, 2);
stylesheetURL = _stylesheetURL2[0];
var _stylesheetURL2$ = _stylesheetURL2[1];
@ -30004,7 +30143,7 @@
setFlyoutPositions();
};
/**
* Setup SVG icons
* Setup SVG icons.
* @returns {void}
*/
@ -30387,7 +30526,7 @@
}
/**
* This function highlights the layer passed in (by fading out the other layers).
* If no layer is passed in, this function restores the other layers
* If no layer is passed in, this function restores the other layers.
* @param {string} [layerNameToHighlight]
* @returns {void}
*/
@ -31763,7 +31902,7 @@
var allHolders = {};
/**
* @param {PlainObject.<string, module:SVGEditor.ToolButton>} holders Key is a selector
* @param {PlainObject<string, module:SVGEditor.ToolButton>} holders Key is a selector
* @returns {void}
*/
@ -35832,7 +35971,7 @@
}
});
/**
* Implements {@see module:jQueryContextMenu.jQueryContextMenuListener}
* Implements {@see module:jQueryContextMenu.jQueryContextMenuListener}.
* @param {"dupe"|"delete"|"merge_down"|"merge_all"} action
* @param {external:jQuery} el
* @param {{x: Float, y: Float, docX: Float, docY: Float}} pos
@ -36030,7 +36169,7 @@
var result = _ref27.target.result;
/**
* Insert the new image until we know its dimensions
* Insert the new image until we know its dimensions.
* @param {Float} width
* @param {Float} height
* @returns {void}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

159
dist/svgcanvas-iife.js vendored
View File

@ -2534,7 +2534,7 @@ var SvgCanvas = (function () {
/**
* @function external:jQuery.fn.attr
* @param {string|string[]|PlainObject.<string, string>} key
* @param {string|string[]|PlainObject<string, string>} key
* @param {string} value
* @returns {external:jQuery|module:jQueryAttr.Attributes}
*/
@ -2642,7 +2642,7 @@ var SvgCanvas = (function () {
* types without checkboxes, it resolves to `true`. For checkboxes, it resolves
* to an object with the `response` key containing the same value as the previous
* mentioned (string or `true`) and a `checked` (boolean) property.
* @typedef {Promise<boolean|string|module:jQueryPluginDBox.PromiseResultObject>} module:jQueryPluginDBox.PromiseResult
* @typedef {Promise<boolean|string|module:jQueryPluginDBox.PromiseResultObject>} module:jQueryPluginDBox.ResultPromise
*/
/**
@ -2676,7 +2676,7 @@ var SvgCanvas = (function () {
* @param {module:jQueryPluginDBox.SelectOption[]} [opts]
* @param {module:jQueryPluginDBox.SelectChangeListener} [changeListener]
* @param {module:jQueryPluginDBox.CheckboxInfo} [checkbox]
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
function dbox(type, msg, defaultVal, opts, changeListener, checkbox) {
@ -2764,7 +2764,7 @@ var SvgCanvas = (function () {
}
/**
* @param {string} msg Message to alert
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
@ -2773,7 +2773,7 @@ var SvgCanvas = (function () {
};
/**
* @param {string} msg Message for which to ask confirmation
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
@ -2782,7 +2782,7 @@ var SvgCanvas = (function () {
};
/**
* @param {string} msg Message to indicate upon cancelable indicator
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
@ -2792,7 +2792,7 @@ var SvgCanvas = (function () {
/**
* @param {string} msg Message to accompany the prompt
* @param {string} [defaultText=''] The default text to show for the prompt
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
@ -3249,6 +3249,7 @@ var SvgCanvas = (function () {
/**
* @param {Element} elem
* @returns {SVGTransformList}
*/
function SVGTransformList(elem) {
_classCallCheck(this, SVGTransformList);
@ -3357,7 +3358,7 @@ var SvgCanvas = (function () {
}
/**
* @param {SVGTransform} newItem
* @returns {SVGTransform}
* @returns {void}
*/
}, {
@ -5451,7 +5452,7 @@ var SvgCanvas = (function () {
/**
* @function module:path.getControlPoints
* @param {Segment} seg
* @returns {PlainObject.<string, SVGLineElement|SVGCircleElement>}
* @returns {PlainObject<string, SVGLineElement|SVGCircleElement>}
*/
var getControlPoints = function getControlPoints(seg) {
@ -7196,7 +7197,7 @@ var SvgCanvas = (function () {
width: 0,
height: 0,
display: 'inline'
}, 100);
});
}
return undefined;
@ -8754,7 +8755,7 @@ var SvgCanvas = (function () {
* Get a set of attributes from an element that is useful for convertToPath.
* @function module:utilities.getExtraAttributesForConvertToPath
* @param {Element} elem - The element to be probed
* @returns {PlainObject.<"marker-start"|"marker-end"|"marker-mid"|"filter"|"clip-path", string>} An object with attributes.
* @returns {PlainObject<"marker-start"|"marker-end"|"marker-mid"|"filter"|"clip-path", string>} An object with attributes.
*/
var getExtraAttributesForConvertToPath = function getExtraAttributesForConvertToPath(elem) {
@ -9179,7 +9180,7 @@ var SvgCanvas = (function () {
* Assigns multiple attributes to an element.
* @function module:utilities.assignAttributes
* @param {Element} elem - DOM element to apply new attribute values to
* @param {PlainObject.<string, string>} attrs - Object with attribute keys/values
* @param {PlainObject<string, string>} attrs - Object with attribute keys/values
* @param {Integer} [suspendLength] - Milliseconds to suspend redraw
* @param {boolean} [unitCheck=false] - Boolean to indicate the need to use units.setUnitAttr
* @returns {void}
@ -9497,8 +9498,28 @@ var SvgCanvas = (function () {
}, {
key: "appendChildren",
value: function appendChildren(children) {
for (var i = 0; i < children.length; ++i) {
this.group_.append(children[i]);
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var child = _step.value;
this.group_.append(child);
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
_iterator["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
}
/**
@ -11241,7 +11262,7 @@ var SvgCanvas = (function () {
/**
* Add any of the whitelisted attributes to the script tag.
* @param {HTMLScriptElement} script
* @param {PlainObject.<string, string>} atts
* @param {PlainObject<string, string>} atts
* @returns {void}
*/
@ -11365,7 +11386,7 @@ var SvgCanvas = (function () {
* @param {PlainObject} [atts={}]
* @param {PlainObject} opts
* @param {boolean} [opts.returnDefault=false} = {}]
* @returns {Promise<*>} Resolves to value of loading module or rejects with
* @returns {Promise<Any>} Resolves to value of loading module or rejects with
* `Error` upon a script loading error.
*/
@ -13556,10 +13577,10 @@ var SvgCanvas = (function () {
'fill-opacity': curShape.fill_opacity,
opacity: curShape.opacity / 2,
style: 'pointer-events:inherit'
}, 100);
});
}
assignAttributes(shape, data.attr, 100);
assignAttributes(shape, data.attr);
cleanupElement(shape); // Children
if (data.children) {
@ -14288,7 +14309,7 @@ var SvgCanvas = (function () {
* @param {module:svgcanvas.SvgCanvas#event:ext_mouseDown|module:svgcanvas.SvgCanvas#event:ext_mouseMove|module:svgcanvas.SvgCanvas#event:ext_mouseUp|module:svgcanvas.SvgCanvas#event:ext_zoomChanged|module:svgcanvas.SvgCanvas#event:ext_IDsUpdated|module:svgcanvas.SvgCanvas#event:ext_canvasUpdated|module:svgcanvas.SvgCanvas#event:ext_toolButtonStateUpdate|module:svgcanvas.SvgCanvas#event:ext_selectedChanged|module:svgcanvas.SvgCanvas#event:ext_elementTransition|module:svgcanvas.SvgCanvas#event:ext_elementChanged|module:svgcanvas.SvgCanvas#event:ext_langReady|module:svgcanvas.SvgCanvas#event:ext_langChanged|module:svgcanvas.SvgCanvas#event:ext_addLangData|module:svgcanvas.SvgCanvas#event:ext_onNewDocument|module:svgcanvas.SvgCanvas#event:ext_workareaResized|module:svgcanvas.ExtensionVarBuilder} [vars]
* @param {boolean} [returnArray]
* @param {module:svgcanvas.ExtensionNameFilter} nameFilter
* @returns {GenericArray.<module:svgcanvas.ExtensionStatus>|module:svgcanvas.ExtensionStatus|false} See {@tutorial ExtensionDocs} on the ExtensionStatus.
* @returns {GenericArray<module:svgcanvas.ExtensionStatus>|module:svgcanvas.ExtensionStatus|false} See {@tutorial ExtensionDocs} on the ExtensionStatus.
*/
@ -15213,12 +15234,14 @@ 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 i = 0; i < selectedElements.length; ++i) {
if (isNullish(selectedElements[i])) {
for (var _i2 = 0, _selectedElements = selectedElements; _i2 < _selectedElements.length; _i2++) {
var selectedElement = _selectedElements[_i2];
if (isNullish(selectedElement)) {
continue;
}
var slist = getTransformList(selectedElements[i]);
var slist = getTransformList(selectedElement);
if (slist.numberOfItems) {
slist.insertItemBefore(svgroot.createSVGTransform(), 0);
@ -15247,7 +15270,7 @@ var SvgCanvas = (function () {
width: 0,
height: 0,
display: 'inline'
}, 100);
});
}
break;
@ -15265,7 +15288,7 @@ var SvgCanvas = (function () {
width: 0,
height: 0,
display: 'inline'
}, 100);
});
break;
case 'resize':
@ -15322,16 +15345,16 @@ var SvgCanvas = (function () {
var all = mouseTarget.getElementsByTagName('*'),
len = all.length;
for (var _i2 = 0; _i2 < len; _i2++) {
if (!all[_i2].style) {
for (var i = 0; i < len; i++) {
if (!all[i].style) {
// mathML
continue;
}
all[_i2].style.vectorEffect = 'non-scaling-stroke';
all[i].style.vectorEffect = 'non-scaling-stroke';
if (iswebkit) {
delayedStroke(all[_i2]);
delayedStroke(all[i]);
}
}
}
@ -15662,7 +15685,7 @@ var SvgCanvas = (function () {
y: Math.min(rStartY, realY),
width: Math.abs(realX - rStartX),
height: Math.abs(realY - rStartY)
}, 100); // for each selected:
}); // for each selected:
// - if newList contains selected, do nothing
// - if newList doesn't contain selected, remove it from selected
// - for any newList that was not in selectedElements, add it to selected
@ -15810,7 +15833,7 @@ var SvgCanvas = (function () {
y: Math.min(rStartY * currentZoom, realY),
width: Math.abs(realX - rStartX * currentZoom),
height: Math.abs(realY - rStartY * currentZoom)
}, 100);
});
break;
}
@ -15819,7 +15842,7 @@ var SvgCanvas = (function () {
assignAttributes(shape, {
x: x,
y: y
}, 1000);
});
break;
}
@ -15878,7 +15901,7 @@ var SvgCanvas = (function () {
height: h,
x: newX,
y: newY
}, 1000);
});
break;
}
@ -16010,7 +16033,7 @@ var SvgCanvas = (function () {
y: Math.min(rStartY * currentZoom, realY),
width: Math.abs(realX - rStartX * currentZoom),
height: Math.abs(realY - rStartY * currentZoom)
}, 100);
});
}
pathActions$1.mouseMove(x, y);
@ -18784,10 +18807,30 @@ 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;
for (var i = 0; i < childs.length; i++) {
if (childs[i].nodeName === 'title') {
return childs[i].textContent;
try {
for (var _iterator2 = childs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var child = _step2.value;
if (child.nodeName === 'title') {
return child.textContent;
}
}
} catch (err) {
_didIteratorError2 = true;
_iteratorError2 = err;
} finally {
try {
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator2["return"]();
}
} finally {
if (_didIteratorError2) {
throw _iteratorError2;
}
}
}
@ -18854,12 +18897,32 @@ var SvgCanvas = (function () {
var docTitle = false,
oldTitle = '';
var batchCmd = new BatchCommand$1('Change Image Title');
var _iteratorNormalCompletion3 = true;
var _didIteratorError3 = false;
var _iteratorError3 = undefined;
for (var i = 0; i < childs.length; i++) {
if (childs[i].nodeName === 'title') {
docTitle = childs[i];
oldTitle = docTitle.textContent;
break;
try {
for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
var child = _step3.value;
if (child.nodeName === 'title') {
docTitle = child;
oldTitle = docTitle.textContent;
break;
}
}
} catch (err) {
_didIteratorError3 = true;
_iteratorError3 = err;
} finally {
try {
if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) {
_iterator3["return"]();
}
} finally {
if (_didIteratorError3) {
throw _iteratorError3;
}
}
}
@ -19700,7 +19763,7 @@ var SvgCanvas = (function () {
y: '-50%',
width: '200%',
height: '200%'
}, 100); // Removing these attributes hides text in Chrome (see Issue 579)
}); // Removing these attributes hides text in Chrome (see Issue 579)
} else if (!isWebkit()) {
filterElem.removeAttribute('x');
filterElem.removeAttribute('y');
@ -20846,9 +20909,9 @@ var SvgCanvas = (function () {
this.moveToTopSelectedElement = function () {
var _selectedElements = selectedElements,
_selectedElements2 = _slicedToArray(_selectedElements, 1),
selected = _selectedElements2[0];
var _selectedElements2 = selectedElements,
_selectedElements3 = _slicedToArray(_selectedElements2, 1),
selected = _selectedElements3[0];
if (!isNullish(selected)) {
var t = selected;
@ -20873,9 +20936,9 @@ var SvgCanvas = (function () {
this.moveToBottomSelectedElement = function () {
var _selectedElements3 = selectedElements,
_selectedElements4 = _slicedToArray(_selectedElements3, 1),
selected = _selectedElements4[0];
var _selectedElements4 = selectedElements,
_selectedElements5 = _slicedToArray(_selectedElements4, 1),
selected = _selectedElements5[0];
if (!isNullish(selected)) {
var t = selected;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -8,14 +8,6 @@
1. `npm run build-docs` - Ensure JSDoc can build and is available for site
build (though not added to `master`, will be copied over in `gh-pages`
steps and used in `npm publish` step).
1. `npm run types-docs` - For JSDoc, we ensure that a minimum of generic types
have been added (e.g., "number" should instead be "Float" or "Array",
and "object", "function", or "array" should be replaced by more specific
`@interface`s, `@typdef`s, or `@callback`. Deriving types can use
`PlainObject` or `GenericArray` to indicate the simple base type was
intentional. `*` should also be checked. The script reports all failing
matches within `editor`. There should be none (there is currently one
due to our needing to move the file to its own module).
1. `npm pack --dry-run` to preview which files will be included once
published and taking into account `.npmignore`.

View File

@ -90,14 +90,12 @@ export const canvg = function (target, s, opts) {
return svg.load(ctx, s);
};
/* eslint-disable jsdoc/check-types */
/**
* @param {module:canvg.CanvgOptions} opts
* @returns {object}
* @todo Flesh out exactly what object is returned here (after updating to latest and reincluding our changes here and those of StackBlur)
*/
function build (opts) {
/* eslint-enable jsdoc/check-types */
const svg = {opts};
svg.FRAMERATE = 30;

View File

@ -192,8 +192,8 @@ function jQueryContextMenu ($) {
$(this).each(function () {
if (o !== undefined) {
const d = o.split(',');
for (let i = 0; i < d.length; i++) {
$(this).find('A[href="' + d[i] + '"]').parent().addClass('disabled');
for (const href of d) {
$(this).find('A[href="' + href + '"]').parent().addClass('disabled');
}
}
});
@ -215,8 +215,8 @@ function jQueryContextMenu ($) {
$(this).each(function () {
if (o !== undefined) {
const d = o.split(',');
for (let i = 0; i < d.length; i++) {
$(this).find('A[href="' + d[i] + '"]').parent().removeClass('disabled');
for (const href of d) {
$(this).find('A[href="' + href + '"]').parent().removeClass('disabled');
}
}
});

View File

@ -35,7 +35,7 @@ export default function jQueryPluginDBox ($, strings = {ok: 'Ok', cancel: 'Cance
* types without checkboxes, it resolves to `true`. For checkboxes, it resolves
* to an object with the `response` key containing the same value as the previous
* mentioned (string or `true`) and a `checked` (boolean) property.
* @typedef {Promise<boolean|string|module:jQueryPluginDBox.PromiseResultObject>} module:jQueryPluginDBox.PromiseResult
* @typedef {Promise<boolean|string|module:jQueryPluginDBox.PromiseResultObject>} module:jQueryPluginDBox.ResultPromise
*/
/**
* @typedef {PlainObject} module:jQueryPluginDBox.SelectOption
@ -65,7 +65,7 @@ export default function jQueryPluginDBox ($, strings = {ok: 'Ok', cancel: 'Cance
* @param {module:jQueryPluginDBox.SelectOption[]} [opts]
* @param {module:jQueryPluginDBox.SelectChangeListener} [changeListener]
* @param {module:jQueryPluginDBox.CheckboxInfo} [checkbox]
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
function dbox (type, msg, defaultVal, opts, changeListener, checkbox) {
dialogContent.html('<p>' + msg.replace(/\n/g, '</p><p>') + '</p>')
@ -141,21 +141,21 @@ export default function jQueryPluginDBox ($, strings = {ok: 'Ok', cancel: 'Cance
/**
* @param {string} msg Message to alert
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
$.alert = function (msg) {
return dbox('alert', msg);
};
/**
* @param {string} msg Message for which to ask confirmation
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
$.confirm = function (msg) {
return dbox('confirm', msg);
};
/**
* @param {string} msg Message to indicate upon cancelable indicator
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
$.process_cancel = function (msg) {
return dbox('process', msg);
@ -163,7 +163,7 @@ export default function jQueryPluginDBox ($, strings = {ok: 'Ok', cancel: 'Cance
/**
* @param {string} msg Message to accompany the prompt
* @param {string} [defaultText=''] The default text to show for the prompt
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
$.prompt = function (msg, defaultText = '') {
return dbox('prompt', msg, defaultText);

View File

@ -314,19 +314,17 @@ class EmbeddedSVGEdit {
];
// TODO: rewrite the following, it's pretty scary.
for (let i = 0; i < functions.length; i++) {
this[functions[i]] = getCallbackSetter(functions[i]);
for (const func of functions) {
this[func] = getCallbackSetter(func);
}
// Older IE may need a polyfill for addEventListener, but so it would for SVG
window.addEventListener('message', getMessageListener(this));
window.addEventListener('keydown', (e) => {
const {key, keyCode, charCode, which} = e;
if (e.key === 'Backspace') {
const {type, key} = e;
if (key === 'Backspace') {
e.preventDefault();
const keyboardEvent = new KeyboardEvent(e.type, {
key, keyCode, charCode, which
});
const keyboardEvent = new KeyboardEvent(type, {key});
that.frame.contentDocument.dispatchEvent(keyboardEvent);
}
});

File diff suppressed because one or more lines are too long

View File

@ -19,7 +19,7 @@ function toAbsoluteURL (url) {
/**
* Add any of the whitelisted attributes to the script tag.
* @param {HTMLScriptElement} script
* @param {PlainObject.<string, string>} atts
* @param {PlainObject<string, string>} atts
* @returns {void}
*/
function addScriptAtts (script, atts) {
@ -36,15 +36,14 @@ function addScriptAtts (script, atts) {
* @property {string} global The variable name to set on `window` (when not using the modular version)
* @property {boolean} [returnDefault=false]
*/
/* eslint-disable jsdoc/check-types */
/**
* @function module:importModule.importSetGlobalDefault
* @param {string|string[]} url
* @param {string|GenericArray<Any>} url
* @param {module:importModule.ImportConfig} config
* @returns {Promise<*>} The value to which it resolves depends on the export of the targeted module.
* @returns {Promise<Any>} The value to which it resolves depends on the export of the targeted module.
*/
export function importSetGlobalDefault (url, config) {
/* eslint-enable jsdoc/check-types */
return importSetGlobal(url, {...config, returnDefault: true});
}
/**
@ -113,18 +112,16 @@ export function importScript (url, atts = {}) {
});
}
/* eslint-disable jsdoc/check-types */
/**
*
* @param {string|string[]} url
* @param {PlainObject} [atts={}]
* @param {PlainObject} opts
* @param {boolean} [opts.returnDefault=false} = {}]
* @returns {Promise<*>} Resolves to value of loading module or rejects with
* @returns {Promise<Any>} Resolves to value of loading module or rejects with
* `Error` upon a script loading error.
*/
export function importModule (url, atts = {}, {returnDefault = false} = {}) {
/* eslint-enable jsdoc/check-types */
if (Array.isArray(url)) {
return Promise.all(url.map((u) => {
return importModule(u, atts);

File diff suppressed because it is too large Load Diff

View File

@ -1,87 +1,154 @@
function loadStylesheets(stylesheets, {
before: beforeDefault, after: afterDefault, favicon: faviconDefault,
canvas: canvasDefault, image: imageDefault = true,
acceptErrors
} = {}) {
stylesheets = Array.isArray(stylesheets) ? stylesheets : [stylesheets];
function _slicedToArray(arr, i) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
}
function setupLink(stylesheetURL) {
let options = {};
if (Array.isArray(stylesheetURL)) {
[stylesheetURL, options = {}] = stylesheetURL;
}
let { favicon = faviconDefault } = options;
const {
before = beforeDefault,
after = afterDefault,
canvas = canvasDefault,
image = imageDefault
} = options;
function addLink() {
if (before) {
before.before(link);
} else if (after) {
after.after(link);
} else {
document.head.appendChild(link);
}
}
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
const link = document.createElement('link');
return new Promise((resolve, reject) => {
let rej = reject;
if (acceptErrors) {
rej = typeof acceptErrors === 'function' ? error => {
acceptErrors({ error, stylesheetURL, options, resolve, reject });
} : resolve;
}
if (stylesheetURL.endsWith('.css')) {
favicon = false;
} else if (stylesheetURL.endsWith('.ico')) {
favicon = true;
}
if (favicon) {
link.rel = 'shortcut icon';
link.type = 'image/x-icon';
function _iterableToArrayLimit(arr, i) {
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
if (image === false) {
link.href = stylesheetURL;
addLink();
resolve(link);
return;
}
try {
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
const cnv = document.createElement('canvas');
cnv.width = 16;
cnv.height = 16;
const context = cnv.getContext('2d');
const img = document.createElement('img');
img.addEventListener('error', error => {
reject(error);
});
img.addEventListener('load', () => {
context.drawImage(img, 0, 0);
link.href = canvas ? cnv.toDataURL('image/x-icon') : stylesheetURL;
addLink();
resolve(link);
});
img.src = stylesheetURL;
return;
}
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = stylesheetURL;
addLink();
link.addEventListener('error', error => {
rej(error);
});
link.addEventListener('load', () => {
resolve(link);
});
});
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"] != null) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}
function loadStylesheets(stylesheets) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
beforeDefault = _ref.before,
afterDefault = _ref.after,
faviconDefault = _ref.favicon,
canvasDefault = _ref.canvas,
_ref$image = _ref.image,
imageDefault = _ref$image === void 0 ? true : _ref$image,
acceptErrors = _ref.acceptErrors;
stylesheets = Array.isArray(stylesheets) ? stylesheets : [stylesheets];
function setupLink(stylesheetURL) {
var options = {};
if (Array.isArray(stylesheetURL)) {
var _stylesheetURL = stylesheetURL;
var _stylesheetURL2 = _slicedToArray(_stylesheetURL, 2);
stylesheetURL = _stylesheetURL2[0];
var _stylesheetURL2$ = _stylesheetURL2[1];
options = _stylesheetURL2$ === void 0 ? {} : _stylesheetURL2$;
}
return Promise.all(stylesheets.map(setupLink));
var _options = options,
_options$favicon = _options.favicon,
favicon = _options$favicon === void 0 ? faviconDefault : _options$favicon;
var _options2 = options,
_options2$before = _options2.before,
before = _options2$before === void 0 ? beforeDefault : _options2$before,
_options2$after = _options2.after,
after = _options2$after === void 0 ? afterDefault : _options2$after,
_options2$canvas = _options2.canvas,
canvas = _options2$canvas === void 0 ? canvasDefault : _options2$canvas,
_options2$image = _options2.image,
image = _options2$image === void 0 ? imageDefault : _options2$image;
function addLink() {
if (before) {
before.before(link);
} else if (after) {
after.after(link);
} else {
document.head.appendChild(link);
}
}
var link = document.createElement('link');
return new Promise(function (resolve, reject) {
var rej = reject;
if (acceptErrors) {
rej = typeof acceptErrors === 'function' ? function (error) {
acceptErrors({
error: error,
stylesheetURL: stylesheetURL,
options: options,
resolve: resolve,
reject: reject
});
} : resolve;
}
if (stylesheetURL.endsWith('.css')) {
favicon = false;
} else if (stylesheetURL.endsWith('.ico')) {
favicon = true;
}
if (favicon) {
link.rel = 'shortcut icon';
link.type = 'image/x-icon';
if (image === false) {
link.href = stylesheetURL;
addLink();
resolve(link);
return;
}
var cnv = document.createElement('canvas');
cnv.width = 16;
cnv.height = 16;
var context = cnv.getContext('2d');
var img = document.createElement('img');
img.addEventListener('error', function (error) {
reject(error);
});
img.addEventListener('load', function () {
context.drawImage(img, 0, 0);
link.href = canvas ? cnv.toDataURL('image/x-icon') : stylesheetURL;
addLink();
resolve(link);
});
img.src = stylesheetURL;
return;
}
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = stylesheetURL;
addLink();
link.addEventListener('error', function (error) {
rej(error);
});
link.addEventListener('load', function () {
resolve(link);
});
});
}
return Promise.all(stylesheets.map(setupLink));
}
export default loadStylesheets;

View File

@ -26,7 +26,7 @@ export default function jQueryPluginSVG ($) {
*/
/**
* @function external:jQuery.fn.attr
* @param {string|string[]|PlainObject.<string, string>} key
* @param {string|string[]|PlainObject<string, string>} key
* @param {string} value
* @returns {external:jQuery|module:jQueryAttr.Attributes}
*/

View File

@ -141,8 +141,8 @@ class Layer {
* @returns {void}
*/
appendChildren (children) {
for (let i = 0; i < children.length; ++i) {
this.group_.append(children[i]);
for (const child of children) {
this.group_.append(child);
}
}

View File

@ -484,7 +484,7 @@ export const getPointGrip = function (seg, update) {
/**
* @function module:path.getControlPoints
* @param {Segment} seg
* @returns {PlainObject.<string, SVGLineElement|SVGCircleElement>}
* @returns {PlainObject<string, SVGLineElement|SVGCircleElement>}
*/
export const getControlPoints = function (seg) {
const {item, index} = seg;

View File

@ -2830,7 +2830,7 @@ editor.init = function () {
const allHolders = {};
/**
* @param {PlainObject.<string, module:SVGEditor.ToolButton>} holders Key is a selector
* @param {PlainObject<string, module:SVGEditor.ToolButton>} holders Key is a selector
* @returns {void}
*/
const setupFlyouts = function (holders) {

View File

@ -1021,7 +1021,7 @@ this.runExtension = function (name, action, vars) {
* @param {module:svgcanvas.SvgCanvas#event:ext_mouseDown|module:svgcanvas.SvgCanvas#event:ext_mouseMove|module:svgcanvas.SvgCanvas#event:ext_mouseUp|module:svgcanvas.SvgCanvas#event:ext_zoomChanged|module:svgcanvas.SvgCanvas#event:ext_IDsUpdated|module:svgcanvas.SvgCanvas#event:ext_canvasUpdated|module:svgcanvas.SvgCanvas#event:ext_toolButtonStateUpdate|module:svgcanvas.SvgCanvas#event:ext_selectedChanged|module:svgcanvas.SvgCanvas#event:ext_elementTransition|module:svgcanvas.SvgCanvas#event:ext_elementChanged|module:svgcanvas.SvgCanvas#event:ext_langReady|module:svgcanvas.SvgCanvas#event:ext_langChanged|module:svgcanvas.SvgCanvas#event:ext_addLangData|module:svgcanvas.SvgCanvas#event:ext_onNewDocument|module:svgcanvas.SvgCanvas#event:ext_workareaResized|module:svgcanvas.ExtensionVarBuilder} [vars]
* @param {boolean} [returnArray]
* @param {module:svgcanvas.ExtensionNameFilter} nameFilter
* @returns {GenericArray.<module:svgcanvas.ExtensionStatus>|module:svgcanvas.ExtensionStatus|false} See {@tutorial ExtensionDocs} on the ExtensionStatus.
* @returns {GenericArray<module:svgcanvas.ExtensionStatus>|module:svgcanvas.ExtensionStatus|false} See {@tutorial ExtensionDocs} on the ExtensionStatus.
*/
const runExtensions = this.runExtensions = function (action, vars, returnArray, nameFilter) {
let result = returnArray ? [] : false;
@ -1822,9 +1822,9 @@ const mouseDown = function (evt) {
if (!rightClick) {
// insert a dummy transform so if the element(s) are moved it will have
// a transform to use for its translate
for (let i = 0; i < selectedElements.length; ++i) {
if (isNullish(selectedElements[i])) { continue; }
const slist = getTransformList(selectedElements[i]);
for (const selectedElement of selectedElements) {
if (isNullish(selectedElement)) { continue; }
const slist = getTransformList(selectedElement);
if (slist.numberOfItems) {
slist.insertItemBefore(svgroot.createSVGTransform(), 0);
} else {
@ -4957,9 +4957,9 @@ this.getTitle = function (elem) {
if (!elem) { return undefined; }
elem = $(elem).data('gsvg') || $(elem).data('symbol') || elem;
const childs = elem.childNodes;
for (let i = 0; i < childs.length; i++) {
if (childs[i].nodeName === 'title') {
return childs[i].textContent;
for (const child of childs) {
if (child.nodeName === 'title') {
return child.textContent;
}
}
return '';
@ -5023,9 +5023,9 @@ this.setDocumentTitle = function (newTitle) {
const batchCmd = new BatchCommand('Change Image Title');
for (let i = 0; i < childs.length; i++) {
if (childs[i].nodeName === 'title') {
docTitle = childs[i];
for (const child of childs) {
if (child.nodeName === 'title') {
docTitle = child;
oldTitle = docTitle.textContent;
break;
}

View File

@ -123,10 +123,10 @@ export default function jQueryPluginSVGIcons ($) {
* listed under "fallback"
* @param {boolean} [opts.replace] If set to `true`, HTML elements will
* be replaced by, rather than include the SVG icon.
* @param {PlainObject.<string, string>} [opts.placement] Map with selectors
* @param {PlainObject<string, string>} [opts.placement] Map with selectors
* for keys and SVG icon ids as values. This provides a custom method of
* adding icons.
* @param {PlainObject.<string, module:jQuerySVGIcons.Size>} [opts.resize] Map
* @param {PlainObject<string, module:jQuerySVGIcons.Size>} [opts.resize] Map
* with selectors for keys and numbers as values. This allows an easy way to
* resize specific icons.
* @param {module:jQuerySVGIcons.SVGIconsLoadedCallback} [opts.callback] A
@ -517,7 +517,7 @@ export default function jQueryPluginSVGIcons ($) {
/**
* @function external:jQuery.resizeSvgIcons
* @param {PlainObject.<string, module:jQuerySVGIcons.Size>} obj Object with
* @param {PlainObject<string, module:jQuerySVGIcons.Size>} obj Object with
* selectors as keys. The values are sizes.
* @returns {void}
*/

View File

@ -808,7 +808,7 @@ export const getPathDFromElement = function (elem) {
* Get a set of attributes from an element that is useful for convertToPath.
* @function module:utilities.getExtraAttributesForConvertToPath
* @param {Element} elem - The element to be probed
* @returns {PlainObject.<"marker-start"|"marker-end"|"marker-mid"|"filter"|"clip-path", string>} An object with attributes.
* @returns {PlainObject<"marker-start"|"marker-end"|"marker-mid"|"filter"|"clip-path", string>} An object with attributes.
*/
export const getExtraAttributesForConvertToPath = function (elem) {
const attrs = {};
@ -1219,7 +1219,7 @@ export const getElem = (supportsSelectors())
* Assigns multiple attributes to an element.
* @function module:utilities.assignAttributes
* @param {Element} elem - DOM element to apply new attribute values to
* @param {PlainObject.<string, string>} attrs - Object with attribute keys/values
* @param {PlainObject<string, string>} attrs - Object with attribute keys/values
* @param {Integer} [suspendLength] - Milliseconds to suspend redraw
* @param {boolean} [unitCheck=false] - Boolean to indicate the need to use units.setUnitAttr
* @returns {void}

View File

@ -2930,7 +2930,7 @@
/**
* @function external:jQuery.fn.attr
* @param {string|string[]|PlainObject.<string, string>} key
* @param {string|string[]|PlainObject<string, string>} key
* @param {string} value
* @returns {external:jQuery|module:jQueryAttr.Attributes}
*/
@ -3137,6 +3137,7 @@
/**
* @param {Element} elem
* @returns {SVGTransformList}
*/
function SVGTransformList(elem) {
_classCallCheck(this, SVGTransformList);
@ -3245,7 +3246,7 @@
}
/**
* @param {SVGTransform} newItem
* @returns {SVGTransform}
* @returns {void}
*/
}, {
@ -5382,7 +5383,7 @@
/**
* @function module:path.getControlPoints
* @param {Segment} seg
* @returns {PlainObject.<string, SVGLineElement|SVGCircleElement>}
* @returns {PlainObject<string, SVGLineElement|SVGCircleElement>}
*/
var getControlPoints = function getControlPoints(seg) {
@ -7127,7 +7128,7 @@
width: 0,
height: 0,
display: 'inline'
}, 100);
});
}
return undefined;
@ -8685,7 +8686,7 @@
* Get a set of attributes from an element that is useful for convertToPath.
* @function module:utilities.getExtraAttributesForConvertToPath
* @param {Element} elem - The element to be probed
* @returns {PlainObject.<"marker-start"|"marker-end"|"marker-mid"|"filter"|"clip-path", string>} An object with attributes.
* @returns {PlainObject<"marker-start"|"marker-end"|"marker-mid"|"filter"|"clip-path", string>} An object with attributes.
*/
var getExtraAttributesForConvertToPath = function getExtraAttributesForConvertToPath(elem) {
@ -9110,7 +9111,7 @@
* Assigns multiple attributes to an element.
* @function module:utilities.assignAttributes
* @param {Element} elem - DOM element to apply new attribute values to
* @param {PlainObject.<string, string>} attrs - Object with attribute keys/values
* @param {PlainObject<string, string>} attrs - Object with attribute keys/values
* @param {Integer} [suspendLength] - Milliseconds to suspend redraw
* @param {boolean} [unitCheck=false] - Boolean to indicate the need to use units.setUnitAttr
* @returns {void}
@ -9360,7 +9361,7 @@
/**
* Add any of the whitelisted attributes to the script tag.
* @param {HTMLScriptElement} script
* @param {PlainObject.<string, string>} atts
* @param {PlainObject<string, string>} atts
* @returns {void}
*/
@ -9381,9 +9382,9 @@
/**
* @function module:importModule.importSetGlobalDefault
* @param {string|string[]} url
* @param {string|GenericArray<Any>} url
* @param {module:importModule.ImportConfig} config
* @returns {Promise<*>} The value to which it resolves depends on the export of the targeted module.
* @returns {Promise<Any>} The value to which it resolves depends on the export of the targeted module.
*/
@ -9504,7 +9505,7 @@
* @param {PlainObject} [atts={}]
* @param {PlainObject} opts
* @param {boolean} [opts.returnDefault=false} = {}]
* @returns {Promise<*>} Resolves to value of loading module or rejects with
* @returns {Promise<Any>} Resolves to value of loading module or rejects with
* `Error` upon a script loading error.
*/
@ -9610,7 +9611,7 @@
* types without checkboxes, it resolves to `true`. For checkboxes, it resolves
* to an object with the `response` key containing the same value as the previous
* mentioned (string or `true`) and a `checked` (boolean) property.
* @typedef {Promise<boolean|string|module:jQueryPluginDBox.PromiseResultObject>} module:jQueryPluginDBox.PromiseResult
* @typedef {Promise<boolean|string|module:jQueryPluginDBox.PromiseResultObject>} module:jQueryPluginDBox.ResultPromise
*/
/**
@ -9644,7 +9645,7 @@
* @param {module:jQueryPluginDBox.SelectOption[]} [opts]
* @param {module:jQueryPluginDBox.SelectChangeListener} [changeListener]
* @param {module:jQueryPluginDBox.CheckboxInfo} [checkbox]
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
function dbox(type, msg, defaultVal, opts, changeListener, checkbox) {
@ -9732,7 +9733,7 @@
}
/**
* @param {string} msg Message to alert
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
@ -9741,7 +9742,7 @@
};
/**
* @param {string} msg Message for which to ask confirmation
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
@ -9750,7 +9751,7 @@
};
/**
* @param {string} msg Message to indicate upon cancelable indicator
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
@ -9760,7 +9761,7 @@
/**
* @param {string} msg Message to accompany the prompt
* @param {string} [defaultText=''] The default text to show for the prompt
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
@ -9933,8 +9934,28 @@
}, {
key: "appendChildren",
value: function appendChildren(children) {
for (var i = 0; i < children.length; ++i) {
this.group_.append(children[i]);
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var child = _step.value;
this.group_.append(child);
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
_iterator["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
}
/**
@ -13781,10 +13802,10 @@
'fill-opacity': curShape.fill_opacity,
opacity: curShape.opacity / 2,
style: 'pointer-events:inherit'
}, 100);
});
}
assignAttributes(shape, data.attr, 100);
assignAttributes(shape, data.attr);
cleanupElement(shape); // Children
if (data.children) {
@ -14513,7 +14534,7 @@
* @param {module:svgcanvas.SvgCanvas#event:ext_mouseDown|module:svgcanvas.SvgCanvas#event:ext_mouseMove|module:svgcanvas.SvgCanvas#event:ext_mouseUp|module:svgcanvas.SvgCanvas#event:ext_zoomChanged|module:svgcanvas.SvgCanvas#event:ext_IDsUpdated|module:svgcanvas.SvgCanvas#event:ext_canvasUpdated|module:svgcanvas.SvgCanvas#event:ext_toolButtonStateUpdate|module:svgcanvas.SvgCanvas#event:ext_selectedChanged|module:svgcanvas.SvgCanvas#event:ext_elementTransition|module:svgcanvas.SvgCanvas#event:ext_elementChanged|module:svgcanvas.SvgCanvas#event:ext_langReady|module:svgcanvas.SvgCanvas#event:ext_langChanged|module:svgcanvas.SvgCanvas#event:ext_addLangData|module:svgcanvas.SvgCanvas#event:ext_onNewDocument|module:svgcanvas.SvgCanvas#event:ext_workareaResized|module:svgcanvas.ExtensionVarBuilder} [vars]
* @param {boolean} [returnArray]
* @param {module:svgcanvas.ExtensionNameFilter} nameFilter
* @returns {GenericArray.<module:svgcanvas.ExtensionStatus>|module:svgcanvas.ExtensionStatus|false} See {@tutorial ExtensionDocs} on the ExtensionStatus.
* @returns {GenericArray<module:svgcanvas.ExtensionStatus>|module:svgcanvas.ExtensionStatus|false} See {@tutorial ExtensionDocs} on the ExtensionStatus.
*/
@ -15438,12 +15459,14 @@
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 i = 0; i < selectedElements.length; ++i) {
if (isNullish(selectedElements[i])) {
for (var _i2 = 0, _selectedElements = selectedElements; _i2 < _selectedElements.length; _i2++) {
var selectedElement = _selectedElements[_i2];
if (isNullish(selectedElement)) {
continue;
}
var slist = getTransformList(selectedElements[i]);
var slist = getTransformList(selectedElement);
if (slist.numberOfItems) {
slist.insertItemBefore(svgroot.createSVGTransform(), 0);
@ -15472,7 +15495,7 @@
width: 0,
height: 0,
display: 'inline'
}, 100);
});
}
break;
@ -15490,7 +15513,7 @@
width: 0,
height: 0,
display: 'inline'
}, 100);
});
break;
case 'resize':
@ -15547,16 +15570,16 @@
var all = mouseTarget.getElementsByTagName('*'),
len = all.length;
for (var _i2 = 0; _i2 < len; _i2++) {
if (!all[_i2].style) {
for (var i = 0; i < len; i++) {
if (!all[i].style) {
// mathML
continue;
}
all[_i2].style.vectorEffect = 'non-scaling-stroke';
all[i].style.vectorEffect = 'non-scaling-stroke';
if (iswebkit) {
delayedStroke(all[_i2]);
delayedStroke(all[i]);
}
}
}
@ -15887,7 +15910,7 @@
y: Math.min(rStartY, realY),
width: Math.abs(realX - rStartX),
height: Math.abs(realY - rStartY)
}, 100); // for each selected:
}); // for each selected:
// - if newList contains selected, do nothing
// - if newList doesn't contain selected, remove it from selected
// - for any newList that was not in selectedElements, add it to selected
@ -16035,7 +16058,7 @@
y: Math.min(rStartY * currentZoom, realY),
width: Math.abs(realX - rStartX * currentZoom),
height: Math.abs(realY - rStartY * currentZoom)
}, 100);
});
break;
}
@ -16044,7 +16067,7 @@
assignAttributes(shape, {
x: x,
y: y
}, 1000);
});
break;
}
@ -16103,7 +16126,7 @@
height: h,
x: newX,
y: newY
}, 1000);
});
break;
}
@ -16235,7 +16258,7 @@
y: Math.min(rStartY * currentZoom, realY),
width: Math.abs(realX - rStartX * currentZoom),
height: Math.abs(realY - rStartY * currentZoom)
}, 100);
});
}
pathActions$1.mouseMove(x, y);
@ -19009,10 +19032,30 @@
elem = $$9(elem).data('gsvg') || $$9(elem).data('symbol') || elem;
var childs = elem.childNodes;
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
for (var i = 0; i < childs.length; i++) {
if (childs[i].nodeName === 'title') {
return childs[i].textContent;
try {
for (var _iterator2 = childs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var child = _step2.value;
if (child.nodeName === 'title') {
return child.textContent;
}
}
} catch (err) {
_didIteratorError2 = true;
_iteratorError2 = err;
} finally {
try {
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator2["return"]();
}
} finally {
if (_didIteratorError2) {
throw _iteratorError2;
}
}
}
@ -19079,12 +19122,32 @@
var docTitle = false,
oldTitle = '';
var batchCmd = new BatchCommand$1('Change Image Title');
var _iteratorNormalCompletion3 = true;
var _didIteratorError3 = false;
var _iteratorError3 = undefined;
for (var i = 0; i < childs.length; i++) {
if (childs[i].nodeName === 'title') {
docTitle = childs[i];
oldTitle = docTitle.textContent;
break;
try {
for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
var child = _step3.value;
if (child.nodeName === 'title') {
docTitle = child;
oldTitle = docTitle.textContent;
break;
}
}
} catch (err) {
_didIteratorError3 = true;
_iteratorError3 = err;
} finally {
try {
if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) {
_iterator3["return"]();
}
} finally {
if (_didIteratorError3) {
throw _iteratorError3;
}
}
}
@ -19925,7 +19988,7 @@
y: '-50%',
width: '200%',
height: '200%'
}, 100); // Removing these attributes hides text in Chrome (see Issue 579)
}); // Removing these attributes hides text in Chrome (see Issue 579)
} else if (!isWebkit()) {
filterElem.removeAttribute('x');
filterElem.removeAttribute('y');
@ -21071,9 +21134,9 @@
this.moveToTopSelectedElement = function () {
var _selectedElements = selectedElements,
_selectedElements2 = _slicedToArray(_selectedElements, 1),
selected = _selectedElements2[0];
var _selectedElements2 = selectedElements,
_selectedElements3 = _slicedToArray(_selectedElements2, 1),
selected = _selectedElements3[0];
if (!isNullish(selected)) {
var t = selected;
@ -21098,9 +21161,9 @@
this.moveToBottomSelectedElement = function () {
var _selectedElements3 = selectedElements,
_selectedElements4 = _slicedToArray(_selectedElements3, 1),
selected = _selectedElements4[0];
var _selectedElements4 = selectedElements,
_selectedElements5 = _slicedToArray(_selectedElements4, 1),
selected = _selectedElements5[0];
if (!isNullish(selected)) {
var t = selected;
@ -22355,10 +22418,10 @@
* listed under "fallback"
* @param {boolean} [opts.replace] If set to `true`, HTML elements will
* be replaced by, rather than include the SVG icon.
* @param {PlainObject.<string, string>} [opts.placement] Map with selectors
* @param {PlainObject<string, string>} [opts.placement] Map with selectors
* for keys and SVG icon ids as values. This provides a custom method of
* adding icons.
* @param {PlainObject.<string, module:jQuerySVGIcons.Size>} [opts.resize] Map
* @param {PlainObject<string, module:jQuerySVGIcons.Size>} [opts.resize] Map
* with selectors for keys and numbers as values. This allows an easy way to
* resize specific icons.
* @param {module:jQuerySVGIcons.SVGIconsLoadedCallback} [opts.callback] A
@ -22780,7 +22843,7 @@
/**
* @function external:jQuery.resizeSvgIcons
* @param {PlainObject.<string, module:jQuerySVGIcons.Size>} obj Object with
* @param {PlainObject<string, module:jQuerySVGIcons.Size>} obj Object with
* selectors as keys. The values are sizes.
* @returns {void}
*/
@ -24685,9 +24748,28 @@
$(this).each(function () {
if (o !== undefined) {
var d = o.split(',');
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
for (var i = 0; i < d.length; i++) {
$(this).find('A[href="' + d[i] + '"]').parent().addClass('disabled');
try {
for (var _iterator = d[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var href = _step.value;
$(this).find('A[href="' + href + '"]').parent().addClass('disabled');
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
_iterator["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
}
});
@ -24710,9 +24792,28 @@
$(this).each(function () {
if (o !== undefined) {
var d = o.split(',');
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
for (var i = 0; i < d.length; i++) {
$(this).find('A[href="' + d[i] + '"]').parent().removeClass('disabled');
try {
for (var _iterator2 = d[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var href = _step2.value;
$(this).find('A[href="' + href + '"]').parent().removeClass('disabled');
}
} catch (err) {
_didIteratorError2 = true;
_iteratorError2 = err;
} finally {
try {
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator2["return"]();
}
} finally {
if (_didIteratorError2) {
throw _iteratorError2;
}
}
}
}
});
@ -28521,6 +28622,44 @@
};
}();
function _slicedToArray$1(arr, i) {
return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _nonIterableRest$1();
}
function _arrayWithHoles$1(arr) {
if (Array.isArray(arr)) return arr;
}
function _iterableToArrayLimit$1(arr, i) {
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"] != null) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
function _nonIterableRest$1() {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}
function loadStylesheets(stylesheets) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
beforeDefault = _ref.before,
@ -28539,7 +28678,7 @@
if (Array.isArray(stylesheetURL)) {
var _stylesheetURL = stylesheetURL;
var _stylesheetURL2 = _slicedToArray(_stylesheetURL, 2);
var _stylesheetURL2 = _slicedToArray$1(_stylesheetURL, 2);
stylesheetURL = _stylesheetURL2[0];
var _stylesheetURL2$ = _stylesheetURL2[1];
@ -30001,7 +30140,7 @@
setFlyoutPositions();
};
/**
* Setup SVG icons
* Setup SVG icons.
* @returns {void}
*/
@ -30384,7 +30523,7 @@
}
/**
* This function highlights the layer passed in (by fading out the other layers).
* If no layer is passed in, this function restores the other layers
* If no layer is passed in, this function restores the other layers.
* @param {string} [layerNameToHighlight]
* @returns {void}
*/
@ -31760,7 +31899,7 @@
var allHolders = {};
/**
* @param {PlainObject.<string, module:SVGEditor.ToolButton>} holders Key is a selector
* @param {PlainObject<string, module:SVGEditor.ToolButton>} holders Key is a selector
* @returns {void}
*/
@ -35829,7 +35968,7 @@
}
});
/**
* Implements {@see module:jQueryContextMenu.jQueryContextMenuListener}
* Implements {@see module:jQueryContextMenu.jQueryContextMenuListener}.
* @param {"dupe"|"delete"|"merge_down"|"merge_all"} action
* @param {external:jQuery} el
* @param {{x: Float, y: Float, docX: Float, docY: Float}} pos
@ -36027,7 +36166,7 @@
var result = _ref27.target.result;
/**
* Insert the new image until we know its dimensions
* Insert the new image until we know its dimensions.
* @param {Float} width
* @param {Float} height
* @returns {void}

View File

@ -1,104 +0,0 @@
/* eslint-env node */
/**
* @todo Fork find-in-files to get ignore pattern support
*/
import fif from 'find-in-files';
(async () => {
/**
* @typedef {PlainObject} FileResult
* @property {string[]} matches
* @property {Integer} count
* @property {string[]} line
*/
const fileMatchPatterns = ['editor'];
/**
* Keys are file name strings
* @type {Object.<string, FileResult>}
*/
let results = await Promise.all(fileMatchPatterns.map((fileMatchPattern) => {
return fif.find(
{
// We grab to the end of the line as the `line` result for `find-in-files`
// only grabs from the beginning of the file to the end of the match.
term: `(@[^{\\n]*{[^}\\n]*(\\bobject|Promise(?!<|Result)|\\barray\\b|[^.]function|\\bnumber|\\*)[^}\\n]*}|@.*{} ).*`,
flags: 'gi'
},
fileMatchPattern,
'([^n]|[^i]n|[^m]in|[^.]min).js$'
);
}));
results = Object.assign(...results);
let total = 0;
let output = '';
Object.entries(results).forEach(([file, res]) => {
reduceFalseMatches(file, res);
if (!res.line.length) {
return;
}
output += `\nFound ${res.count} potentially overly generic JSDoc expression${res.count === 1 ? '' : 's'} in file ${file}:\n`;
res.line.forEach((line) => {
output += line + '\n';
});
total += res.line.length;
/*
res.matches.forEach((match) => {
console.log(match);
});
*/
});
console.log(`${output}\nTotal failures found: ${total}.\n`); // eslint-disable-line no-console
/**
* @external FindInFilesResult
* @type {PlainObject}
* @property {string[]} matches The matched strings
* @property {Integer} count The number of matches
* @property {string[]} line The lines that were matched. The docs mistakenly indicate the property is named `lines`; see {@link https://github.com/kaesetoast/find-in-files/pull/19}.
*/
/**
* Eliminates known false matches against overly generic types.
* @param {string} file
* @param {external:FindInFilesResult} res
* @returns {void}
*/
function reduceFalseMatches (file, res) {
switch (file) {
case 'editor/external/core-js-bundle/minified.js':
case 'editor/external/jamilih/jml-es.js':
case 'editor/xdomain-svgedit-config-iife.js': // Ignore
res.line = [];
break;
case 'editor/embedapi.js':
res.line = res.line.filter((line) => {
return ![
'* @param {...*} args Signature dependent on the function'
].includes(line);
});
break;
case 'editor/external/dynamic-import-polyfill/importModule.js':
res.line = res.line.filter((line) => {
return ![
'* @returns {Promise<*>} The value to which it resolves depends on the export of the targeted module.',
'* @returns {Promise<*>} Resolves to value of loading module or rejects with'
].includes(line);
});
break;
case 'editor/typedefs.js':
res.line = res.line.filter((line) => {
return ![
'* @typedef {number} Float',
'* @typedef {*} ArbitraryCallbackResult',
'* @typedef {object} ArbitraryObject',
'* @typedef {object} ArbitraryModule',
'* @typedef {Array} GenericArray',
'* @typedef {*} Any',
'* @param {...*} args Signature dependent on the function'
].includes(line);
});
break;
}
res.count = res.line.length;
}
})();

315
package-lock.json generated
View File

@ -1417,15 +1417,15 @@
"dev": true
},
"@types/lodash": {
"version": "4.14.130",
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.130.tgz",
"integrity": "sha512-H++wk0tbneBsRVfLkgAAd0IIpmpVr2Bj4T0HncoOsQf3/xrJexRYQK2Tqo0Ej3pFslM8GkMgdis9bu6xIb1ycw==",
"version": "4.14.134",
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.134.tgz",
"integrity": "sha512-2/O0khFUCFeDlbi7sZ7ZFRCcT812fAeOLm7Ev4KbwASkZ575TDrDcY7YyaoHdTOzKcNbfiwLYZqPmoC4wadrsw==",
"dev": true
},
"@types/node": {
"version": "12.0.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.2.tgz",
"integrity": "sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA==",
"version": "12.0.7",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.7.tgz",
"integrity": "sha512-1YKeT4JitGgE4SOzyB9eMwO0nGVNkNEsm9qlIt1Lqm/tG2QEiSMTD4kS3aO6L+w5SClLVxALmIBESK6Mk5wX0A==",
"dev": true
},
"@typescript-eslint/eslint-plugin": {
@ -1484,9 +1484,9 @@
"dev": true
},
"acorn-globals": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.0.tgz",
"integrity": "sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw==",
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.2.tgz",
"integrity": "sha512-BbzvZhVtZP+Bs1J1HcwrQe8ycfO0wStkSGxuul3He3GkHOIZ6eTqOkPuw9IP1X3+IkOo4wiJmwkobzXYz4wewQ==",
"dev": true,
"requires": {
"acorn": "^6.0.1",
@ -2659,16 +2659,6 @@
"source-map-support": "^0.4.15"
},
"dependencies": {
"home-or-tmp": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz",
"integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=",
"dev": true,
"requires": {
"os-homedir": "^1.0.0",
"os-tmpdir": "^1.0.1"
}
},
"source-map-support": {
"version": "0.4.18",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz",
@ -3049,9 +3039,9 @@
"dev": true
},
"caniuse-lite": {
"version": "1.0.30000963",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000963.tgz",
"integrity": "sha512-n4HUiullc7Lw0LyzpeLa2ffP8KxFBGdxqD/8G3bSL6oB758hZ2UE2CVK+tQN958tJIi0/tfpjAc67aAtoHgnrQ==",
"version": "1.0.30000974",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000974.tgz",
"integrity": "sha512-xc3rkNS/Zc3CmpMKuczWEdY2sZgx09BkAxfvkxlAEBTqcMHeL8QnPqhKse+5sRTi3nrw2pJwToD2WvKn1Uhvww==",
"dev": true
},
"caseless": {
@ -3295,9 +3285,9 @@
"dev": true
},
"combined-stream": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz",
"integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==",
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"dev": true,
"requires": {
"delayed-stream": "~1.0.0"
@ -3373,9 +3363,9 @@
"dev": true
},
"core-js-bundle": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/core-js-bundle/-/core-js-bundle-3.1.2.tgz",
"integrity": "sha512-aCCJ++1ye48FGbJGTqD1Zx+N2WVbfwP1DxKEqVRX3b0lMxLdH4C+eAMtSQAMojiOhw2tkZJIWHP+APRFW/mNiw==",
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/core-js-bundle/-/core-js-bundle-3.1.3.tgz",
"integrity": "sha512-Tz3QeRfnSOeFu07mVAUqTydtgk5XIdQIw/w2Vi7LUqPcaniaBBpgPipXDmlwe/VFQoyZyMS6SpAO+QUPxjZsxQ==",
"dev": true
},
"core-js-compat": {
@ -3498,9 +3488,9 @@
"dev": true
},
"cssstyle": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.2.1.tgz",
"integrity": "sha512-7DYm8qe+gPx/h77QlCyFmX80+fGaE/6A/Ekl0zaszYOubvySO2saYFdQ78P29D0UsULxFKCetDGNaNRUdSF+2A==",
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.2.2.tgz",
"integrity": "sha512-43wY3kl1CVQSvL7wUY1qXkxVGkStjpkDmVjiIKX8R97uhajy8Bybay78uOtqvh7Q5GK75dNPfW0geWjE6qQQow==",
"dev": true,
"requires": {
"cssom": "0.3.x"
@ -3770,9 +3760,9 @@
}
},
"electron-to-chromium": {
"version": "1.3.127",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.127.tgz",
"integrity": "sha512-1o25iFRf/dbgauTWalEzmD1EmRN3a2CzP/K7UVpYLEBduk96LF0FyUdCcf4Ry2mAWJ1VxyblFjC93q6qlLwA2A==",
"version": "1.3.155",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.155.tgz",
"integrity": "sha512-/ci/XgZG8jkLYOgOe3mpJY1onxPPTDY17y7scldhnSjjZqV6VvREG/LvwhRuV7BJbnENFfuDWZkSqlTh4x9ZjQ==",
"dev": true
},
"elegant-spinner": {
@ -4009,9 +3999,9 @@
}
},
"eslint-config-ash-nazg": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/eslint-config-ash-nazg/-/eslint-config-ash-nazg-4.0.0.tgz",
"integrity": "sha512-LUroSU/VqempjeWSIgMDu3byW8iWKfwj4aqEGm0W8oqHe4HCP87Ny0MVChOXjSoz9lDEC2PjXmnxL2Zt03Mfog==",
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/eslint-config-ash-nazg/-/eslint-config-ash-nazg-7.0.1.tgz",
"integrity": "sha512-ehn/qLall1uvXzyQlaU0qDlIMQNdP4n8HjnGDA10W4srGyvSw8D7FcWLWVhqYVXuLf6XvUqEQJ4kduv2Y2yCjA==",
"dev": true
},
"eslint-config-standard": {
@ -4123,9 +4113,9 @@
"dev": true
},
"eslint-plugin-import": {
"version": "2.17.2",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.17.2.tgz",
"integrity": "sha512-m+cSVxM7oLsIpmwNn2WXTJoReOF9f/CtLMo7qOVmKd1KntBy0hEcuNZ3erTmWjx+DxRO0Zcrm5KwAvI9wHcV5g==",
"version": "2.17.3",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.17.3.tgz",
"integrity": "sha512-qeVf/UwXFJbeyLbxuY8RgqDyEKCkqV7YC+E5S5uOjAp4tOc8zj01JP3ucoBM8JcEqd1qRasJSg6LLlisirfy0Q==",
"dev": true,
"requires": {
"array-includes": "^3.0.3",
@ -4138,7 +4128,7 @@
"lodash": "^4.17.11",
"minimatch": "^3.0.4",
"read-pkg-up": "^2.0.0",
"resolve": "^1.10.0"
"resolve": "^1.11.0"
},
"dependencies": {
"debug": {
@ -4167,9 +4157,9 @@
"dev": true
},
"resolve": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz",
"integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==",
"version": "1.11.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.0.tgz",
"integrity": "sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==",
"dev": true,
"requires": {
"path-parse": "^1.0.6"
@ -4178,13 +4168,13 @@
}
},
"eslint-plugin-jsdoc": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-7.0.0.tgz",
"integrity": "sha512-Yu9nfWDG5zJWK1l65MYu7GjHPltPdhZz8m6oqD/h2jDxNgSltgqH5irR5kS38F3eTb4zhS7+FaHE8bz1ph7omQ==",
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-8.0.0.tgz",
"integrity": "sha512-9y2HYDDS5xBVjnZZaiGYyAN48cpEPjZMgqMQq4a/PWY9B1pwyRdZZU199IwTVhzs9azc1rF4F6noXAi5o++6DQ==",
"dev": true,
"requires": {
"comment-parser": "^0.5.4",
"jsdoctypeparser": "3.1.0",
"jsdoctypeparser": "4.0.0",
"lodash": "^4.17.11"
}
},
@ -4333,9 +4323,9 @@
"dev": true
},
"eslint-plugin-unicorn": {
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-8.0.2.tgz",
"integrity": "sha512-Ik2/Bt/PvPnf1lZgUnNFK2310XoRn/4LYiP5gkEPVDa4w9HCoii7I6SeKh2X5Rdp2WLy4eUiLcYtiBUp+q2IRw==",
"version": "9.1.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-9.1.0.tgz",
"integrity": "sha512-OknjtY1daSxHd60KsXBxP9d2LExA3JZ2XuPOtqSZbLjwGaKjZXYMCaPI2xg70Qc791rXoi0pW4UEzVCnwlRi+Q==",
"dev": true,
"requires": {
"clean-regexp": "^1.0.0",
@ -4347,6 +4337,7 @@
"lodash.snakecase": "^4.0.1",
"lodash.topairs": "^4.3.0",
"lodash.upperfirst": "^4.2.0",
"regexpp": "^2.0.1",
"reserved-words": "^0.1.2",
"safe-regex": "^2.0.1"
},
@ -4714,15 +4705,6 @@
}
}
},
"find": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/find/-/find-0.1.7.tgz",
"integrity": "sha1-yGyHrxqxjyIrvjjeyGy8dg0Wpvs=",
"dev": true,
"requires": {
"traverse-chain": "~0.1.0"
}
},
"find-cache-dir": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz",
@ -4804,16 +4786,6 @@
}
}
},
"find-in-files": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/find-in-files/-/find-in-files-0.5.0.tgz",
"integrity": "sha512-VraTc6HdtdSHmAp0yJpAy20yPttGKzyBWc7b7FPnnsX9TOgmKx0g9xajizpF/iuu4IvNK4TP0SpyBT9zAlwG+g==",
"dev": true,
"requires": {
"find": "^0.1.5",
"q": "^1.0.1"
}
},
"find-up": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
@ -5684,6 +5656,16 @@
}
}
},
"home-or-tmp": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz",
"integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=",
"dev": true,
"requires": {
"os-homedir": "^1.0.0",
"os-tmpdir": "^1.0.1"
}
},
"homedir-polyfill": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz",
@ -5905,6 +5887,12 @@
"integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=",
"dev": true
},
"ip-regex": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz",
"integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=",
"dev": true
},
"is-accessor-descriptor": {
"version": "0.1.6",
"resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
@ -6310,13 +6298,13 @@
"dev": true
},
"jamilih": {
"version": "0.44.0",
"resolved": "https://registry.npmjs.org/jamilih/-/jamilih-0.44.0.tgz",
"integrity": "sha512-MiYNr9CqA3ynQVVt61cl+SEAffOP0/Pz0AJDsDXTQCQOZ4oarD/T0OhcGIl19LSXO1bMsJyEWqqw9R8ipH/Ggw==",
"version": "0.45.0",
"resolved": "https://registry.npmjs.org/jamilih/-/jamilih-0.45.0.tgz",
"integrity": "sha512-m/rm52xnxtbFuaejVK8nMsYQRxMYrFZylTPhYR1T0mWIfOLjbYdQI1OXuwBgIZJ6XLABeEz1pLAVCxHmeSbQPw==",
"dev": true,
"requires": {
"@babel/polyfill": "^7.0.0",
"jsdom": "13.0.0"
"jsdom": "15.1.1",
"request": "^2.88.0"
}
},
"jest-worker": {
@ -6432,43 +6420,51 @@
}
},
"jsdoctypeparser": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-3.1.0.tgz",
"integrity": "sha512-JNbkKpDFqbYjg+IU3FNo7qjX7Opy7CwjHywT32zgAcz/d4lX6Umn5jOHVETUdnNNgGrMk0nEx1gvP0F4M0hzlQ==",
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-4.0.0.tgz",
"integrity": "sha512-Bh6AW8eJ1bVdofhYUuqgFOVo0FE9qII+a+Go+juEnAfaDS5lZAiIqBAFm9gDu80OqBcQ1UI3v/8cP+3D5IGVww==",
"dev": true
},
"jsdom": {
"version": "13.0.0",
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-13.0.0.tgz",
"integrity": "sha512-Kmq4ASMNkgpY+YufE322EnIKoiz0UWY2DRkKlU7d5YrIW4xiVRhWFrZV1fr6w/ZNxQ50wGAH5gGRzydgnmkkvw==",
"version": "15.1.1",
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-15.1.1.tgz",
"integrity": "sha512-cQZRBB33arrDAeCrAEWn1U3SvrvC8XysBua9Oqg1yWrsY/gYcusloJC3RZJXuY5eehSCmws8f2YeliCqGSkrtQ==",
"dev": true,
"requires": {
"abab": "^2.0.0",
"acorn": "^6.0.2",
"acorn-globals": "^4.3.0",
"acorn": "^6.1.1",
"acorn-globals": "^4.3.2",
"array-equal": "^1.0.0",
"cssom": "^0.3.4",
"cssstyle": "^1.1.1",
"data-urls": "^1.0.1",
"cssom": "^0.3.6",
"cssstyle": "^1.2.2",
"data-urls": "^1.1.0",
"domexception": "^1.0.1",
"escodegen": "^1.11.0",
"escodegen": "^1.11.1",
"html-encoding-sniffer": "^1.0.2",
"nwsapi": "^2.0.9",
"nwsapi": "^2.1.4",
"parse5": "5.1.0",
"pn": "^1.1.0",
"request": "^2.88.0",
"request-promise-native": "^1.0.5",
"saxes": "^3.1.3",
"request-promise-native": "^1.0.7",
"saxes": "^3.1.9",
"symbol-tree": "^3.2.2",
"tough-cookie": "^2.4.3",
"tough-cookie": "^3.0.1",
"w3c-hr-time": "^1.0.1",
"w3c-xmlserializer": "^1.0.0",
"w3c-xmlserializer": "^1.1.2",
"webidl-conversions": "^4.0.2",
"whatwg-encoding": "^1.0.5",
"whatwg-mimetype": "^2.2.0",
"whatwg-mimetype": "^2.3.0",
"whatwg-url": "^7.0.0",
"ws": "^6.1.0",
"ws": "^7.0.0",
"xml-name-validator": "^3.0.0"
},
"dependencies": {
"acorn": {
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz",
"integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==",
"dev": true
}
}
},
"jsesc": {
@ -6625,9 +6621,9 @@
}
},
"load-stylesheets": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/load-stylesheets/-/load-stylesheets-0.7.0.tgz",
"integrity": "sha512-GmNY6qV8uLCwgOC/U5UyeTxAh3Os//eTX+Y4644lcryBh81SPxNBA5GLVDB9rxUhXh8Oz0zT3mSCC1Wf4PP1oQ==",
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/load-stylesheets/-/load-stylesheets-0.8.0.tgz",
"integrity": "sha512-hMqRlPEaFb2aRHUPGuxTpNRM5e92s/95d++8T/Pg1nfL3D6LTtpCtnLY7Z6E4TDQMlSKIkoU8ECGSWxGqRDSlA==",
"dev": true
},
"locate-path": {
@ -7023,18 +7019,18 @@
"dev": true
},
"mime-db": {
"version": "1.38.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz",
"integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==",
"version": "1.40.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz",
"integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==",
"dev": true
},
"mime-types": {
"version": "2.1.22",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz",
"integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==",
"version": "2.1.24",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz",
"integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==",
"dev": true,
"requires": {
"mime-db": "~1.38.0"
"mime-db": "1.40.0"
}
},
"mimic-fn": {
@ -7297,9 +7293,9 @@
"dev": true
},
"nwsapi": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.1.0.tgz",
"integrity": "sha512-ZG3bLAvdHmhIjaQ/Db1qvBxsGvFMLIRpQszyqbg31VJ53UP++uZX1/gf3Ut96pdwN9AuDwlMqIYLm0UPCdUeHg==",
"version": "2.1.4",
"resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.1.4.tgz",
"integrity": "sha512-iGfd9Y6SFdTNldEy2L0GUhcarIutFmk+MPWIn9dmj8NMIup03G08uUF2KGbbmv/Ux4RT0VZJoP/sVbWA6d/VIw==",
"dev": true
},
"oauth-sign": {
@ -7793,9 +7789,9 @@
"dev": true
},
"psl": {
"version": "1.1.31",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz",
"integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==",
"version": "1.1.32",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.1.32.tgz",
"integrity": "sha512-MHACAkHpihU/REGGPLj4sEfc/XKW2bheigvHO1dUqjaKigMp1C8+WLQYRGgeKFMsw5PMfegZcaN8IDXK/cD0+g==",
"dev": true
},
"pump": {
@ -7814,12 +7810,6 @@
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
"dev": true
},
"q": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz",
"integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=",
"dev": true
},
"qr-manipulation": {
"version": "git+https://github.com/brettz9/qr-manipulation.git#832651199b675ae6c5abfc3f49f1a2f4238812b1",
"from": "git+https://github.com/brettz9/qr-manipulation.git",
@ -8005,9 +7995,9 @@
}
},
"regexp-tree": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.5.tgz",
"integrity": "sha512-nUmxvfJyAODw+0B13hj8CFVAxhe7fDEAgJgaotBu3nnR+IgGgZq59YedJP5VYTlkEfqjuK6TuRpnymKdatLZfQ==",
"version": "0.1.10",
"resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.10.tgz",
"integrity": "sha512-K1qVSbcedffwuIslMwpe6vGlj+ZXRnGkvjAtFHfDZZZuEdA/h0dxljAPu9vhUo6Rrx2U2AwJ+nSQ6hK+lrP5MQ==",
"dev": true
},
"regexpp": {
@ -8235,6 +8225,18 @@
"request-promise-core": "1.1.2",
"stealthy-require": "^1.1.1",
"tough-cookie": "^2.3.3"
},
"dependencies": {
"tough-cookie": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz",
"integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==",
"dev": true,
"requires": {
"psl": "^1.1.28",
"punycode": "^2.1.1"
}
}
}
},
"requireindex": {
@ -8322,13 +8324,13 @@
}
},
"rollup": {
"version": "1.12.3",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-1.12.3.tgz",
"integrity": "sha512-ueWhPijWN+GaPgD3l77hXih/gcDXmYph6sWeQegwBYtaqAE834e8u+MC2wT6FKIUsz1DBOyOXAQXUZB+rjWDoQ==",
"version": "1.15.0",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-1.15.0.tgz",
"integrity": "sha512-IeZwWTqJHkZpU3zXtY3rtWkeoZc299DN8MOyNtkzlm2PpsZZLmLGlffW5giTRe7z5mhgBYvQKKpFtnnzyDOySw==",
"dev": true,
"requires": {
"@types/estree": "0.0.39",
"@types/node": "^12.0.2",
"@types/node": "^12.0.7",
"acorn": "^6.1.1"
},
"dependencies": {
@ -8442,9 +8444,9 @@
}
},
"saxes": {
"version": "3.1.6",
"resolved": "https://registry.npmjs.org/saxes/-/saxes-3.1.6.tgz",
"integrity": "sha512-LAYs+lChg1v5uKNzPtsgTxSS5hLo8aIhSMCJt1WMpefAxm3D1RTpMwSpb6ebdL31cubiLTnhokVktBW+cv9Y9w==",
"version": "3.1.9",
"resolved": "https://registry.npmjs.org/saxes/-/saxes-3.1.9.tgz",
"integrity": "sha512-FZeKhJglhJHk7eWG5YM0z46VHmI3KJpMBAQm3xa9meDvd+wevB5GuBB0wc0exPInZiBBHqi00DbS8AcvCGCFMw==",
"dev": true,
"requires": {
"xmlchars": "^1.3.1"
@ -9023,9 +9025,9 @@
}
},
"testcafe": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/testcafe/-/testcafe-1.1.4.tgz",
"integrity": "sha512-2c0erAxmRd8o018e0sQ1SVVyX1JlTXwUHlRIITF3u7bPAe40IFINhPGBA8KhDYwWDSaOUZp4ft6bxDef2g8Zgg==",
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/testcafe/-/testcafe-1.2.1.tgz",
"integrity": "sha512-kLlrtujAPabG8mh2JNLFIUmhZSHgfeQlT1TO9PikkjBhduirK2OCL6ye8pvyw9rOQVqwIl214wCv5DgAJcaC0w==",
"dev": true,
"requires": {
"@types/node": "^10.12.19",
@ -9088,7 +9090,7 @@
"source-map-support": "^0.5.5",
"strip-bom": "^2.0.0",
"testcafe-browser-tools": "1.6.8",
"testcafe-hammerhead": "14.6.3",
"testcafe-hammerhead": "14.6.8",
"testcafe-legacy-api": "3.1.11",
"testcafe-reporter-json": "^2.1.0",
"testcafe-reporter-list": "^2.1.0",
@ -9103,9 +9105,9 @@
},
"dependencies": {
"@types/node": {
"version": "10.14.7",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.7.tgz",
"integrity": "sha512-on4MmIDgHXiuJDELPk1NFaKVUxxCFr37tm8E9yN6rAiF5Pzp/9bBfBHkoexqRiY+hk/Z04EJU9kKEb59YqJ82A==",
"version": "10.14.8",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.8.tgz",
"integrity": "sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw==",
"dev": true
},
"ansi-regex": {
@ -9317,9 +9319,9 @@
}
},
"testcafe-hammerhead": {
"version": "14.6.3",
"resolved": "https://registry.npmjs.org/testcafe-hammerhead/-/testcafe-hammerhead-14.6.3.tgz",
"integrity": "sha512-vMQGfO7d6Vy0wkyzAdBUQ4Rin7vLqJGrBvgjlvBaj2ec1oH+RX0IlOwCB3HFMA/JljM7BpVD7y97Jq9Ebcgs4g==",
"version": "14.6.8",
"resolved": "https://registry.npmjs.org/testcafe-hammerhead/-/testcafe-hammerhead-14.6.8.tgz",
"integrity": "sha512-Ep/eBmIBli/utdtzczl1NFRO9Gl/WHzyLTh0kifkbV/xm5EM8FBnSEb72kNrTlPLngvFXAqJccAUaU4DALA+Jg==",
"dev": true,
"requires": {
"acorn-hammerhead": "^0.2.0",
@ -9337,7 +9339,7 @@
"mustache": "^2.1.1",
"nanoid": "^0.2.2",
"os-family": "^1.0.0",
"parse5": "^1.5.0",
"parse5": "2.2.3",
"pify": "^2.3.0",
"pinkie": "1.0.0",
"read-file-relative": "^1.2.0",
@ -9366,9 +9368,9 @@
"dev": true
},
"parse5": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/parse5/-/parse5-1.5.1.tgz",
"integrity": "sha1-m387DeMr543CQBsXVzzK8Pb1nZQ=",
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/parse5/-/parse5-2.2.3.tgz",
"integrity": "sha1-DE/EHBAAxea5PUiwP4CDg3g06fY=",
"dev": true
},
"pinkie": {
@ -9583,11 +9585,12 @@
}
},
"tough-cookie": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz",
"integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==",
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz",
"integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==",
"dev": true,
"requires": {
"ip-regex": "^2.1.0",
"psl": "^1.1.28",
"punycode": "^2.1.1"
}
@ -9601,12 +9604,6 @@
"punycode": "^2.1.0"
}
},
"traverse-chain": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/traverse-chain/-/traverse-chain-0.1.0.tgz",
"integrity": "sha1-YdvC1Ttp/2CRoSoWj9fUMxB+QPE=",
"dev": true
},
"tree-kill": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.1.tgz",
@ -9704,9 +9701,9 @@
"dev": true
},
"typescript": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.5.tgz",
"integrity": "sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw==",
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.1.tgz",
"integrity": "sha512-64HkdiRv1yYZsSe4xC1WVgamNigVYjlssIoaH2HcZF0+ijsk5YK2g0G34w9wJkze8+5ow4STd22AynfO6ZYYLw==",
"dev": true
},
"uc.micro": {
@ -10232,9 +10229,9 @@
}
},
"w3c-xmlserializer": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-1.0.1.tgz",
"integrity": "sha512-XZGI1OH/OLQr/NaJhhPmzhngwcAnZDLytsvXnRmlYeRkmbb0I7sqFFA22erq4WQR0sUu17ZSQOAV9mFwCqKRNg==",
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-1.1.2.tgz",
"integrity": "sha512-p10l/ayESzrBMYWRID6xbuCKh2Fp77+sA0doRuGn4tTIMrrZVeqfpKjXHY+oDh3K4nLdPgNwMTVP6Vp4pvqbNg==",
"dev": true,
"requires": {
"domexception": "^1.0.1",
@ -10404,12 +10401,12 @@
}
},
"ws": {
"version": "6.1.4",
"resolved": "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz",
"integrity": "sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA==",
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.0.0.tgz",
"integrity": "sha512-cknCal4k0EAOrh1SHHPPWWh4qm93g1IuGGGwBjWkXmCG7LsDtL8w9w+YVfaF+KSVwiHQKDIMsSLBVftKf9d1pg==",
"dev": true,
"requires": {
"async-limiter": "~1.0.0"
"async-limiter": "^1.0.0"
}
},
"x-is-string": {

View File

@ -15,7 +15,6 @@
"scripts": {
"prepublishOnly": "npm run test-prep",
"build-config": "rollup -c rollup-config.config.js",
"types-docs": "npx babel-node --plugins @babel/plugin-transform-modules-commonjs jsdoc-check-overly-generic-types.js",
"open-es-allext": "open-cli http://localhost:8000/editor/svg-editor-es.html?extensions=ext-arrows.js,ext-closepath.js,ext-foreignobject.js,ext-helloworld.js,ext-mathjax.js,ext-php_savefile.js,ext-server_moinsave.js,ext-server_opensave.js,ext-webappfind.js,ext-xdomain-messaging.js",
"build-docs": "rm -rf docs/jsdoc/*;jsdoc --pedantic -c docs/jsdoc-config.js editor",
"open-docs": "open-cli http://localhost:8000/docs/jsdoc/ && npm start",
@ -84,14 +83,14 @@
"@mysticatea/eslint-plugin": "^10.0.3",
"axe-testcafe": "^1.1.0",
"babel-plugin-transform-object-rest-spread": "^7.0.0-beta.3",
"core-js-bundle": "^3.1.2",
"core-js-bundle": "^3.1.3",
"eslint": "5.16.0",
"eslint-config-ash-nazg": "4.0.0",
"eslint-config-ash-nazg": "7.0.1",
"eslint-config-standard": "12.0.0",
"eslint-plugin-compat": "^3.1.1",
"eslint-plugin-eslint-comments": "^3.1.1",
"eslint-plugin-import": "2.17.2",
"eslint-plugin-jsdoc": "^7.0.0",
"eslint-plugin-import": "2.17.3",
"eslint-plugin-jsdoc": "^8.0.0",
"eslint-plugin-markdown": "^1.0.0",
"eslint-plugin-no-use-extend-native": "^0.4.0",
"eslint-plugin-node": "9.1.0",
@ -99,12 +98,11 @@
"eslint-plugin-qunit": "^4.0.0",
"eslint-plugin-standard": "4.0.0",
"eslint-plugin-testcafe": "^0.2.1",
"eslint-plugin-unicorn": "^8.0.2",
"find-in-files": "^0.5.0",
"eslint-plugin-unicorn": "^9.1.0",
"imageoptim-cli": "^2.3.5",
"jamilih": "^0.44.0",
"jamilih": "^0.45.0",
"jsdoc": "^3.6.2",
"load-stylesheets": "^0.7.0",
"load-stylesheets": "^0.8.0",
"node-static": "^0.7.11",
"open-cli": "^5.0.0",
"promise-fs": "^2.1.0",
@ -114,13 +112,13 @@
"regenerator-runtime": "^0.13.2",
"remark-cli": "^6.0.1",
"remark-lint-ordered-list-marker-value": "^1.0.2",
"rollup": "1.12.3",
"rollup": "1.15.0",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-re": "^1.0.7",
"rollup-plugin-terser": "^5.0.0",
"sinon": "^7.3.2",
"sinon-test": "^2.4.0",
"stackblur-canvas": "^2.2.0",
"testcafe": "^1.1.4"
"testcafe": "^1.2.1"
}
}

View File

@ -2930,7 +2930,7 @@
/**
* @function external:jQuery.fn.attr
* @param {string|string[]|PlainObject.<string, string>} key
* @param {string|string[]|PlainObject<string, string>} key
* @param {string} value
* @returns {external:jQuery|module:jQueryAttr.Attributes}
*/
@ -3137,6 +3137,7 @@
/**
* @param {Element} elem
* @returns {SVGTransformList}
*/
function SVGTransformList(elem) {
_classCallCheck(this, SVGTransformList);
@ -3245,7 +3246,7 @@
}
/**
* @param {SVGTransform} newItem
* @returns {SVGTransform}
* @returns {void}
*/
}, {
@ -5382,7 +5383,7 @@
/**
* @function module:path.getControlPoints
* @param {Segment} seg
* @returns {PlainObject.<string, SVGLineElement|SVGCircleElement>}
* @returns {PlainObject<string, SVGLineElement|SVGCircleElement>}
*/
var getControlPoints = function getControlPoints(seg) {
@ -7127,7 +7128,7 @@
width: 0,
height: 0,
display: 'inline'
}, 100);
});
}
return undefined;
@ -8685,7 +8686,7 @@
* Get a set of attributes from an element that is useful for convertToPath.
* @function module:utilities.getExtraAttributesForConvertToPath
* @param {Element} elem - The element to be probed
* @returns {PlainObject.<"marker-start"|"marker-end"|"marker-mid"|"filter"|"clip-path", string>} An object with attributes.
* @returns {PlainObject<"marker-start"|"marker-end"|"marker-mid"|"filter"|"clip-path", string>} An object with attributes.
*/
var getExtraAttributesForConvertToPath = function getExtraAttributesForConvertToPath(elem) {
@ -9110,7 +9111,7 @@
* Assigns multiple attributes to an element.
* @function module:utilities.assignAttributes
* @param {Element} elem - DOM element to apply new attribute values to
* @param {PlainObject.<string, string>} attrs - Object with attribute keys/values
* @param {PlainObject<string, string>} attrs - Object with attribute keys/values
* @param {Integer} [suspendLength] - Milliseconds to suspend redraw
* @param {boolean} [unitCheck=false] - Boolean to indicate the need to use units.setUnitAttr
* @returns {void}
@ -9360,7 +9361,7 @@
/**
* Add any of the whitelisted attributes to the script tag.
* @param {HTMLScriptElement} script
* @param {PlainObject.<string, string>} atts
* @param {PlainObject<string, string>} atts
* @returns {void}
*/
@ -9381,9 +9382,9 @@
/**
* @function module:importModule.importSetGlobalDefault
* @param {string|string[]} url
* @param {string|GenericArray<Any>} url
* @param {module:importModule.ImportConfig} config
* @returns {Promise<*>} The value to which it resolves depends on the export of the targeted module.
* @returns {Promise<Any>} The value to which it resolves depends on the export of the targeted module.
*/
@ -9504,7 +9505,7 @@
* @param {PlainObject} [atts={}]
* @param {PlainObject} opts
* @param {boolean} [opts.returnDefault=false} = {}]
* @returns {Promise<*>} Resolves to value of loading module or rejects with
* @returns {Promise<Any>} Resolves to value of loading module or rejects with
* `Error` upon a script loading error.
*/
@ -9610,7 +9611,7 @@
* types without checkboxes, it resolves to `true`. For checkboxes, it resolves
* to an object with the `response` key containing the same value as the previous
* mentioned (string or `true`) and a `checked` (boolean) property.
* @typedef {Promise<boolean|string|module:jQueryPluginDBox.PromiseResultObject>} module:jQueryPluginDBox.PromiseResult
* @typedef {Promise<boolean|string|module:jQueryPluginDBox.PromiseResultObject>} module:jQueryPluginDBox.ResultPromise
*/
/**
@ -9644,7 +9645,7 @@
* @param {module:jQueryPluginDBox.SelectOption[]} [opts]
* @param {module:jQueryPluginDBox.SelectChangeListener} [changeListener]
* @param {module:jQueryPluginDBox.CheckboxInfo} [checkbox]
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
function dbox(type, msg, defaultVal, opts, changeListener, checkbox) {
@ -9732,7 +9733,7 @@
}
/**
* @param {string} msg Message to alert
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
@ -9741,7 +9742,7 @@
};
/**
* @param {string} msg Message for which to ask confirmation
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
@ -9750,7 +9751,7 @@
};
/**
* @param {string} msg Message to indicate upon cancelable indicator
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
@ -9760,7 +9761,7 @@
/**
* @param {string} msg Message to accompany the prompt
* @param {string} [defaultText=''] The default text to show for the prompt
* @returns {jQueryPluginDBox.PromiseResult}
* @returns {jQueryPluginDBox.ResultPromise}
*/
@ -9933,8 +9934,28 @@
}, {
key: "appendChildren",
value: function appendChildren(children) {
for (var i = 0; i < children.length; ++i) {
this.group_.append(children[i]);
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var child = _step.value;
this.group_.append(child);
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
_iterator["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
}
/**
@ -13781,10 +13802,10 @@
'fill-opacity': curShape.fill_opacity,
opacity: curShape.opacity / 2,
style: 'pointer-events:inherit'
}, 100);
});
}
assignAttributes(shape, data.attr, 100);
assignAttributes(shape, data.attr);
cleanupElement(shape); // Children
if (data.children) {
@ -14513,7 +14534,7 @@
* @param {module:svgcanvas.SvgCanvas#event:ext_mouseDown|module:svgcanvas.SvgCanvas#event:ext_mouseMove|module:svgcanvas.SvgCanvas#event:ext_mouseUp|module:svgcanvas.SvgCanvas#event:ext_zoomChanged|module:svgcanvas.SvgCanvas#event:ext_IDsUpdated|module:svgcanvas.SvgCanvas#event:ext_canvasUpdated|module:svgcanvas.SvgCanvas#event:ext_toolButtonStateUpdate|module:svgcanvas.SvgCanvas#event:ext_selectedChanged|module:svgcanvas.SvgCanvas#event:ext_elementTransition|module:svgcanvas.SvgCanvas#event:ext_elementChanged|module:svgcanvas.SvgCanvas#event:ext_langReady|module:svgcanvas.SvgCanvas#event:ext_langChanged|module:svgcanvas.SvgCanvas#event:ext_addLangData|module:svgcanvas.SvgCanvas#event:ext_onNewDocument|module:svgcanvas.SvgCanvas#event:ext_workareaResized|module:svgcanvas.ExtensionVarBuilder} [vars]
* @param {boolean} [returnArray]
* @param {module:svgcanvas.ExtensionNameFilter} nameFilter
* @returns {GenericArray.<module:svgcanvas.ExtensionStatus>|module:svgcanvas.ExtensionStatus|false} See {@tutorial ExtensionDocs} on the ExtensionStatus.
* @returns {GenericArray<module:svgcanvas.ExtensionStatus>|module:svgcanvas.ExtensionStatus|false} See {@tutorial ExtensionDocs} on the ExtensionStatus.
*/
@ -15438,12 +15459,14 @@
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 i = 0; i < selectedElements.length; ++i) {
if (isNullish(selectedElements[i])) {
for (var _i2 = 0, _selectedElements = selectedElements; _i2 < _selectedElements.length; _i2++) {
var selectedElement = _selectedElements[_i2];
if (isNullish(selectedElement)) {
continue;
}
var slist = getTransformList(selectedElements[i]);
var slist = getTransformList(selectedElement);
if (slist.numberOfItems) {
slist.insertItemBefore(svgroot.createSVGTransform(), 0);
@ -15472,7 +15495,7 @@
width: 0,
height: 0,
display: 'inline'
}, 100);
});
}
break;
@ -15490,7 +15513,7 @@
width: 0,
height: 0,
display: 'inline'
}, 100);
});
break;
case 'resize':
@ -15547,16 +15570,16 @@
var all = mouseTarget.getElementsByTagName('*'),
len = all.length;
for (var _i2 = 0; _i2 < len; _i2++) {
if (!all[_i2].style) {
for (var i = 0; i < len; i++) {
if (!all[i].style) {
// mathML
continue;
}
all[_i2].style.vectorEffect = 'non-scaling-stroke';
all[i].style.vectorEffect = 'non-scaling-stroke';
if (iswebkit) {
delayedStroke(all[_i2]);
delayedStroke(all[i]);
}
}
}
@ -15887,7 +15910,7 @@
y: Math.min(rStartY, realY),
width: Math.abs(realX - rStartX),
height: Math.abs(realY - rStartY)
}, 100); // for each selected:
}); // for each selected:
// - if newList contains selected, do nothing
// - if newList doesn't contain selected, remove it from selected
// - for any newList that was not in selectedElements, add it to selected
@ -16035,7 +16058,7 @@
y: Math.min(rStartY * currentZoom, realY),
width: Math.abs(realX - rStartX * currentZoom),
height: Math.abs(realY - rStartY * currentZoom)
}, 100);
});
break;
}
@ -16044,7 +16067,7 @@
assignAttributes(shape, {
x: x,
y: y
}, 1000);
});
break;
}
@ -16103,7 +16126,7 @@
height: h,
x: newX,
y: newY
}, 1000);
});
break;
}
@ -16235,7 +16258,7 @@
y: Math.min(rStartY * currentZoom, realY),
width: Math.abs(realX - rStartX * currentZoom),
height: Math.abs(realY - rStartY * currentZoom)
}, 100);
});
}
pathActions$1.mouseMove(x, y);
@ -19009,10 +19032,30 @@
elem = $$9(elem).data('gsvg') || $$9(elem).data('symbol') || elem;
var childs = elem.childNodes;
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
for (var i = 0; i < childs.length; i++) {
if (childs[i].nodeName === 'title') {
return childs[i].textContent;
try {
for (var _iterator2 = childs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var child = _step2.value;
if (child.nodeName === 'title') {
return child.textContent;
}
}
} catch (err) {
_didIteratorError2 = true;
_iteratorError2 = err;
} finally {
try {
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator2["return"]();
}
} finally {
if (_didIteratorError2) {
throw _iteratorError2;
}
}
}
@ -19079,12 +19122,32 @@
var docTitle = false,
oldTitle = '';
var batchCmd = new BatchCommand$1('Change Image Title');
var _iteratorNormalCompletion3 = true;
var _didIteratorError3 = false;
var _iteratorError3 = undefined;
for (var i = 0; i < childs.length; i++) {
if (childs[i].nodeName === 'title') {
docTitle = childs[i];
oldTitle = docTitle.textContent;
break;
try {
for (var _iterator3 = childs[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
var child = _step3.value;
if (child.nodeName === 'title') {
docTitle = child;
oldTitle = docTitle.textContent;
break;
}
}
} catch (err) {
_didIteratorError3 = true;
_iteratorError3 = err;
} finally {
try {
if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) {
_iterator3["return"]();
}
} finally {
if (_didIteratorError3) {
throw _iteratorError3;
}
}
}
@ -19925,7 +19988,7 @@
y: '-50%',
width: '200%',
height: '200%'
}, 100); // Removing these attributes hides text in Chrome (see Issue 579)
}); // Removing these attributes hides text in Chrome (see Issue 579)
} else if (!isWebkit()) {
filterElem.removeAttribute('x');
filterElem.removeAttribute('y');
@ -21071,9 +21134,9 @@
this.moveToTopSelectedElement = function () {
var _selectedElements = selectedElements,
_selectedElements2 = _slicedToArray(_selectedElements, 1),
selected = _selectedElements2[0];
var _selectedElements2 = selectedElements,
_selectedElements3 = _slicedToArray(_selectedElements2, 1),
selected = _selectedElements3[0];
if (!isNullish(selected)) {
var t = selected;
@ -21098,9 +21161,9 @@
this.moveToBottomSelectedElement = function () {
var _selectedElements3 = selectedElements,
_selectedElements4 = _slicedToArray(_selectedElements3, 1),
selected = _selectedElements4[0];
var _selectedElements4 = selectedElements,
_selectedElements5 = _slicedToArray(_selectedElements4, 1),
selected = _selectedElements5[0];
if (!isNullish(selected)) {
var t = selected;
@ -22355,10 +22418,10 @@
* listed under "fallback"
* @param {boolean} [opts.replace] If set to `true`, HTML elements will
* be replaced by, rather than include the SVG icon.
* @param {PlainObject.<string, string>} [opts.placement] Map with selectors
* @param {PlainObject<string, string>} [opts.placement] Map with selectors
* for keys and SVG icon ids as values. This provides a custom method of
* adding icons.
* @param {PlainObject.<string, module:jQuerySVGIcons.Size>} [opts.resize] Map
* @param {PlainObject<string, module:jQuerySVGIcons.Size>} [opts.resize] Map
* with selectors for keys and numbers as values. This allows an easy way to
* resize specific icons.
* @param {module:jQuerySVGIcons.SVGIconsLoadedCallback} [opts.callback] A
@ -22780,7 +22843,7 @@
/**
* @function external:jQuery.resizeSvgIcons
* @param {PlainObject.<string, module:jQuerySVGIcons.Size>} obj Object with
* @param {PlainObject<string, module:jQuerySVGIcons.Size>} obj Object with
* selectors as keys. The values are sizes.
* @returns {void}
*/
@ -24685,9 +24748,28 @@
$(this).each(function () {
if (o !== undefined) {
var d = o.split(',');
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
for (var i = 0; i < d.length; i++) {
$(this).find('A[href="' + d[i] + '"]').parent().addClass('disabled');
try {
for (var _iterator = d[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var href = _step.value;
$(this).find('A[href="' + href + '"]').parent().addClass('disabled');
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
_iterator["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
}
});
@ -24710,9 +24792,28 @@
$(this).each(function () {
if (o !== undefined) {
var d = o.split(',');
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
for (var i = 0; i < d.length; i++) {
$(this).find('A[href="' + d[i] + '"]').parent().removeClass('disabled');
try {
for (var _iterator2 = d[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var href = _step2.value;
$(this).find('A[href="' + href + '"]').parent().removeClass('disabled');
}
} catch (err) {
_didIteratorError2 = true;
_iteratorError2 = err;
} finally {
try {
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
_iterator2["return"]();
}
} finally {
if (_didIteratorError2) {
throw _iteratorError2;
}
}
}
}
});
@ -28521,6 +28622,44 @@
};
}();
function _slicedToArray$1(arr, i) {
return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _nonIterableRest$1();
}
function _arrayWithHoles$1(arr) {
if (Array.isArray(arr)) return arr;
}
function _iterableToArrayLimit$1(arr, i) {
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"] != null) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
function _nonIterableRest$1() {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}
function loadStylesheets(stylesheets) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
beforeDefault = _ref.before,
@ -28539,7 +28678,7 @@
if (Array.isArray(stylesheetURL)) {
var _stylesheetURL = stylesheetURL;
var _stylesheetURL2 = _slicedToArray(_stylesheetURL, 2);
var _stylesheetURL2 = _slicedToArray$1(_stylesheetURL, 2);
stylesheetURL = _stylesheetURL2[0];
var _stylesheetURL2$ = _stylesheetURL2[1];
@ -30001,7 +30140,7 @@
setFlyoutPositions();
};
/**
* Setup SVG icons
* Setup SVG icons.
* @returns {void}
*/
@ -30384,7 +30523,7 @@
}
/**
* This function highlights the layer passed in (by fading out the other layers).
* If no layer is passed in, this function restores the other layers
* If no layer is passed in, this function restores the other layers.
* @param {string} [layerNameToHighlight]
* @returns {void}
*/
@ -31760,7 +31899,7 @@
var allHolders = {};
/**
* @param {PlainObject.<string, module:SVGEditor.ToolButton>} holders Key is a selector
* @param {PlainObject<string, module:SVGEditor.ToolButton>} holders Key is a selector
* @returns {void}
*/
@ -35829,7 +35968,7 @@
}
});
/**
* Implements {@see module:jQueryContextMenu.jQueryContextMenuListener}
* Implements {@see module:jQueryContextMenu.jQueryContextMenuListener}.
* @param {"dupe"|"delete"|"merge_down"|"merge_all"} action
* @param {external:jQuery} el
* @param {{x: Float, y: Float, docX: Float, docY: Float}} pos
@ -36027,7 +36166,7 @@
var result = _ref27.target.result;
/**
* Insert the new image until we know its dimensions
* Insert the new image until we know its dimensions.
* @param {Float} width
* @param {Float} height
* @returns {void}