- Linting (JSDoc): Reenable jsdoc/valid-jsdoc as fixed; notes re: `valid-jsdoc` replacement; use same namepath

- npm: Update devDep
master
Brett Zamir 2019-04-17 19:12:55 +08:00
parent 4289d131a2
commit 1d56d75837
33 changed files with 2688 additions and 2596 deletions

View File

@ -63,8 +63,9 @@ module.exports = {
}
},
overrides: [
// Remove this rule when fully migrated to eslint-plugin-jsdoc: https://github.com/gajus/eslint-plugin-jsdoc/issues/107
// These would otherwise currently break because of these issues:
// 1. `event:` https://github.com/eslint/doctrine/issues/221 and https://github.com/Kuniwak/jsdoctypeparser/pull/49 with https://github.com/Kuniwak/jsdoctypeparser/issues/47
// 1. `event:` https://github.com/eslint/doctrine/issues/221
// 1. `@implements`/`@augments`/`@extends`/`@override`: https://github.com/eslint/doctrine/issues/222
{
files: [
@ -73,7 +74,6 @@ module.exports = {
"editor/extensions/ext-eyedropper.js", "editor/extensions/ext-webappfind.js"
],
rules: {
"jsdoc/valid-types": "off",
"valid-jsdoc": "off"
}
},

View File

@ -6,7 +6,8 @@
`loadFromString`, `loadFromDataURI` so known when ready and set
- Refactoring: Destructuring, templates, label Unicode code point
- Linting (JSDoc): Update per newly enforced `require-returns`; avoid
Closure syntax
Closure syntax; reenable `jsdoc/valid-jsdoc` as fixed; notes
re: valid-jsdoc replacement; use same namepath
- Docs (Refactoring): Formally specify `Promise` resolve type;
add `typedef` for dialog result object; add an
`ArbitraryCallbackResult` type; prefer `void`

4
dist/canvg.js vendored
View File

@ -4358,7 +4358,7 @@ var canvg = (function (exports) {
* @param {Float} width
* @param {Float} height
* @param {Integer} rgba
* @returns {undefined}
* @returns {void}
*/
@ -4373,7 +4373,7 @@ var canvg = (function (exports) {
* @param {Float} height
* @param {Integer} rgba
* @param {Float} val
* @returns {undefined}
* @returns {void}
*/

View File

@ -25,7 +25,7 @@
*
* @param {Node} o
* @param {module:DOMPolyfill~ParentNode|module:DOMPolyfill~ChildNode} ps
* @returns {undefined}
* @returns {void}
*/
function mixin(o, ps) {
if (!o) return;

View File

@ -273,7 +273,7 @@ var svgEditorExtension_arrows = (function () {
/**
* @param {Window} win
* @param {!(string|Integer)} n
* @returns {undefined}
* @returns {void}
*/
svgCanvas.bind('setnonce', setArrowNonce);

View File

@ -135,7 +135,7 @@ var svgEditorExtension_connector = (function () {
var addThis;
/**
*
* @returns {undefined}
* @returns {void}
*/
function add() {
@ -347,7 +347,7 @@ var svgEditorExtension_connector = (function () {
})();
/**
* Do on reset.
* @returns {undefined}
* @returns {void}
*/

View File

@ -107,8 +107,8 @@ var svgEditorExtension_eyedropper = (function () {
};
/**
*
* @param {module:svgcanvas.SvgCanvas#event:ext-selectedChanged|module:svgcanvas.SvgCanvas#event:ext-elementChanged} opts
* @returns {undefined}
* @param {module:svgcanvas.SvgCanvas#event:ext_selectedChanged|module:svgcanvas.SvgCanvas#event:ext_elementChanged} opts
* @returns {void}
*/
buttons = [{

View File

@ -132,7 +132,7 @@ var svgEditorExtension_foreignobject = (function () {
};
/**
* @param {boolean} on
* @returns {undefined}
* @returns {void}
*/

View File

@ -174,7 +174,7 @@ var svgEditorExtension_grid = (function () {
/**
*
* @param {Float} zoom
* @returns {undefined}
* @returns {void}
*/
buttons = [{

View File

@ -237,7 +237,7 @@ var svgEditorExtension_imagelib = (function () {
});
/**
*
* @returns {undefined}
* @returns {void}
*/
pending = {};
@ -542,7 +542,7 @@ var svgEditorExtension_imagelib = (function () {
}(), true);
/**
* @param {boolean} show
* @returns {undefined}
* @returns {void}
*/
buttons = [{

View File

@ -41,7 +41,7 @@ var svgEditorExtension_mathjax = (function () {
* Add any of the whitelisted attributes to the script tag.
* @param {HTMLScriptElement} script
* @param {PlainObject.<string, string>} atts
* @returns {undefined}
* @returns {void}
*/
@ -67,7 +67,7 @@ var svgEditorExtension_mathjax = (function () {
var script = document.createElement('script');
/**
*
* @returns {undefined}
* @returns {void}
*/
function scriptOnError() {
@ -76,7 +76,7 @@ var svgEditorExtension_mathjax = (function () {
}
/**
*
* @returns {undefined}
* @returns {void}
*/
@ -214,7 +214,7 @@ var svgEditorExtension_mathjax = (function () {
});
/**
*
* @returns {undefined}
* @returns {void}
*/
buttons = [{

View File

@ -416,7 +416,7 @@ var svgEditorExtension_placemark = (function () {
/**
*
* @param {boolean} on
* @returns {undefined}
* @returns {void}
*/
buttons = [{

View File

@ -4358,7 +4358,7 @@ var svgEditorExtension_server_moinsave = (function () {
* @param {Float} width
* @param {Float} height
* @param {Integer} rgba
* @returns {undefined}
* @returns {void}
*/
@ -4373,7 +4373,7 @@ var svgEditorExtension_server_moinsave = (function () {
* @param {Float} height
* @param {Integer} rgba
* @param {Float} val
* @returns {undefined}
* @returns {void}
*/

View File

@ -4358,7 +4358,7 @@ var svgEditorExtension_server_opensave = (function () {
* @param {Float} width
* @param {Float} height
* @param {Integer} rgba
* @returns {undefined}
* @returns {void}
*/
@ -4373,7 +4373,7 @@ var svgEditorExtension_server_opensave = (function () {
* @param {Float} height
* @param {Integer} rgba
* @param {Float} val
* @returns {undefined}
* @returns {void}
*/
@ -4879,7 +4879,7 @@ var svgEditorExtension_server_opensave = (function () {
/**
* Submit the form, empty its contents for reuse and show
* uploading message.
* @returns {undefined}
* @returns {void}
*/
function submit() {
@ -5188,7 +5188,7 @@ var svgEditorExtension_server_opensave = (function () {
/**
*
* @param {external:jQuery} form
* @returns {undefined}
* @returns {void}
*/
// Create the input elements

View File

@ -205,7 +205,7 @@ var svgEditorExtension_shapes = (function () {
curLib = library.basic;
/**
*
* @returns {undefined}
* @returns {void}
*/
buttons = [{

View File

@ -117,7 +117,7 @@ var svgEditorExtension_storage = (function () {
/**
* Replace `storagePrompt` parameter within URL.
* @param {string} val
* @returns {undefined}
* @returns {void}
*/
function replaceStoragePrompt(val) {
@ -136,7 +136,7 @@ var svgEditorExtension_storage = (function () {
* Sets SVG content as a string with "svgedit-" and the current
* canvas name as namespace.
* @param {string} val
* @returns {undefined}
* @returns {void}
*/
@ -154,7 +154,7 @@ var svgEditorExtension_storage = (function () {
/**
* Set the cookie to expire.
* @param {string} cookie
* @returns {undefined}
* @returns {void}
*/
@ -163,7 +163,7 @@ var svgEditorExtension_storage = (function () {
}
/**
* Expire the storage cookie.
* @returns {undefined}
* @returns {void}
*/
@ -172,7 +172,7 @@ var svgEditorExtension_storage = (function () {
}
/**
* Empties storage for each of the current preferences.
* @returns {undefined}
* @returns {void}
*/
@ -196,7 +196,7 @@ var svgEditorExtension_storage = (function () {
* content into storage)
* 2. Use localStorage to set SVG contents (potentially too large to allow in cookies)
* 3. Use localStorage (where available) or cookies to set preferences.
* @returns {undefined}
* @returns {void}
*/

View File

@ -68,7 +68,7 @@ var svgEditorExtension_webappfind = (function () {
* @param {module:svgcanvas.SvgCanvas#event:message} data
* @listens module:svgcanvas.SvgCanvas#event:message
* @throws {Error} Unexpected event type
* @returns {undefined}
* @returns {void}
*/
function (win, _ref2) {
var data = _ref2.data,

View File

@ -3009,7 +3009,7 @@
/**
* Shows results after query submission.
* @param {string} url
* @returns {undefined}
* @returns {void}
*/
function processResults(_x) {

1103
dist/index-es.js vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

1103
dist/index-umd.js vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

645
dist/svgcanvas-iife.js vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -158,7 +158,7 @@ In addition to your own extension's locale strings,
[`langReady`]{@link module:svgcanvas.ExtensionInitResponse#langReady}
also has access to the global internationalization strings through the
`uiStrings` property on the object passed to it (see
[event:ext-langReady]{@link module:svgcanvas.SvgCanvas#event:ext-langReady}).
[event:ext_langReady]{@link module:svgcanvas.SvgCanvas#event:ext_langReady}).
See also [LocaleDocs]{@tutorial LocaleDocs}, including for information on
formatting of locale strings (the current lack of any standard beyond a

View File

@ -42,7 +42,7 @@ let editorContext_ = null;
/**
* @function module:coords.init
* @param {module:coords.EditorContext} editorContext
* @param {module:svgcanvas.SvgCanvas#event:pointsAdded} editorContext
* @returns {void}
*/
export const init = function (editorContext) {

View File

@ -27,7 +27,7 @@ export default {
/**
*
* @param {module:svgcanvas.SvgCanvas#event:ext-selectedChanged|module:svgcanvas.SvgCanvas#event:ext-elementChanged} opts
* @param {module:svgcanvas.SvgCanvas#event:ext_selectedChanged|module:svgcanvas.SvgCanvas#event:ext_elementChanged} opts
* @returns {void}
*/
function getStyle (opts) {

View File

@ -126,7 +126,7 @@ export const init = (editor) => {
/**
* @function module:locale.readLang
* @param {module:locale.LocaleStrings} langData See {@tutorial LocaleDocs}
* @fires module:svgcanvas.SvgCanvas#event:ext-addLangData
* @fires module:svgcanvas.SvgCanvas#event:ext_addLangData
* @returns {Promise<module:locale.LangAndData>} Resolves to [`LangAndData`]{@link module:locale.LangAndData}
*/
export const readLang = async function (langData) {
@ -363,9 +363,9 @@ export const readLang = async function (langData) {
* @param {string} givenParam
* @param {string[]} goodLangs
* @param {{langPath: string}} conf
* @fires module:svgcanvas.SvgCanvas#event:ext-addLangData
* @fires module:svgcanvas.SvgCanvas#event:ext-langReady
* @fires module:svgcanvas.SvgCanvas#event:ext-langChanged
* @fires module:svgcanvas.SvgCanvas#event:ext_addLangData
* @fires module:svgcanvas.SvgCanvas#event:ext_langReady
* @fires module:svgcanvas.SvgCanvas#event:ext_langChanged
* @returns {Promise<module:locale.LangAndData>} Resolves to result of {@link module:locale.readLang}
*/
export const putLocale = async function (givenParam, goodLangs, conf) {

View File

@ -794,9 +794,9 @@ editor.init = function () {
};
/**
* @fires module:svgcanvas.SvgCanvas#event:ext-addLangData
* @fires module:svgcanvas.SvgCanvas#event:ext-langReady
* @fires module:svgcanvas.SvgCanvas#event:ext-langChanged
* @fires module:svgcanvas.SvgCanvas#event:ext_addLangData
* @fires module:svgcanvas.SvgCanvas#event:ext_langReady
* @fires module:svgcanvas.SvgCanvas#event:ext_langChanged
* @fires module:svgcanvas.SvgCanvas#event:extensions_added
* @returns {Promise<module:locale.LangAndData>} Resolves to result of {@link module:locale.readLang}
*/
@ -2145,7 +2145,7 @@ editor.init = function () {
};
/**
* @fires module:svgcanvas.SvgCanvas#event:ext-toolButtonStateUpdate
* @fires module:svgcanvas.SvgCanvas#event:ext_toolButtonStateUpdate
* @returns {void}
*/
const updateToolButtonState = function () {
@ -2185,7 +2185,7 @@ editor.init = function () {
svgCanvas.runExtensions(
'toolButtonStateUpdate',
/** @type {module:svgcanvas.SvgCanvas#event:ext-toolButtonStateUpdate} */ {
/** @type {module:svgcanvas.SvgCanvas#event:ext_toolButtonStateUpdate} */ {
nofill: bNoFill,
nostroke: bNoStroke
}
@ -2536,7 +2536,7 @@ editor.init = function () {
* @param {external:Window} win
* @param {module:svgcanvas.SvgCanvas#event:selected} elems Array of elements that were selected
* @listens module:svgcanvas.SvgCanvas#event:selected
* @fires module:svgcanvas.SvgCanvas#event:ext-selectedChanged
* @fires module:svgcanvas.SvgCanvas#event:ext_selectedChanged
* @returns {void}
*/
const selectedChanged = function (win, elems) {
@ -2561,7 +2561,7 @@ editor.init = function () {
// Deal with pathedit mode
togglePathEditMode(isNode, elems);
updateContextPanel();
svgCanvas.runExtensions('selectedChanged', /** @type {module:svgcanvas.SvgCanvas#event:ext-selectedChanged} */ {
svgCanvas.runExtensions('selectedChanged', /** @type {module:svgcanvas.SvgCanvas#event:ext_selectedChanged} */ {
elems,
selectedElement,
multiselected
@ -2574,7 +2574,7 @@ editor.init = function () {
* @param {external:Window} win
* @param {module:svgcanvas.SvgCanvas#event:transition} elems
* @listens module:svgcanvas.SvgCanvas#event:transition
* @fires module:svgcanvas.SvgCanvas#event:ext-elementTransition
* @fires module:svgcanvas.SvgCanvas#event:ext_elementTransition
* @returns {void}
*/
const elementTransition = function (win, elems) {
@ -2603,7 +2603,7 @@ editor.init = function () {
}
}
}
svgCanvas.runExtensions('elementTransition', /** @type {module:svgcanvas.SvgCanvas#event:ext-elementTransition} */ {
svgCanvas.runExtensions('elementTransition', /** @type {module:svgcanvas.SvgCanvas#event:ext_elementTransition} */ {
elems
});
};
@ -2622,7 +2622,7 @@ editor.init = function () {
* @param {external:Window} win
* @param {module:svgcanvas.SvgCanvas#event:changed} elems
* @listens module:svgcanvas.SvgCanvas#event:changed
* @fires module:svgcanvas.SvgCanvas#event:ext-elementChanged
* @fires module:svgcanvas.SvgCanvas#event:ext_elementChanged
* @returns {void}
*/
const elementChanged = function (win, elems) {
@ -2664,7 +2664,7 @@ editor.init = function () {
paintBox.stroke.update();
}
svgCanvas.runExtensions('elementChanged', /** @type {module:svgcanvas.SvgCanvas#event:ext-elementChanged} */ {
svgCanvas.runExtensions('elementChanged', /** @type {module:svgcanvas.SvgCanvas#event:ext_elementChanged} */ {
elems
});
};
@ -4432,7 +4432,7 @@ editor.init = function () {
};
/**
* @fires module:svgcanvas.SvgCanvas#event:ext-onNewDocument
* @fires module:svgcanvas.SvgCanvas#event:ext_onNewDocument
* @returns {Promise<void>} Resolves to `undefined`
*/
const clickClear = async function () {
@ -5361,7 +5361,7 @@ editor.init = function () {
/**
* @param {Float} delta
* @fires module:svgcanvas.SvgCanvas#event:ext-workareaResized
* @fires module:svgcanvas.SvgCanvas#event:ext_workareaResized
* @returns {void}
*/
const changeSidePanelWidth = function (delta) {
@ -6214,8 +6214,8 @@ editor.init = function () {
* @function module:SVGEditor.setLang
* @param {string} lang The language code
* @param {module:locale.LocaleStrings} allStrings See {@tutorial LocaleDocs}
* @fires module:svgcanvas.SvgCanvas#event:ext-langReady
* @fires module:svgcanvas.SvgCanvas#event:ext-langChanged
* @fires module:svgcanvas.SvgCanvas#event:ext_langReady
* @fires module:svgcanvas.SvgCanvas#event:ext_langChanged
* @returns {Promise<void>} A Promise which resolves to `undefined`
*/
const setLang = editor.setLang = async function (lang, allStrings) {
@ -6262,13 +6262,13 @@ editor.init = function () {
svgCanvas.runExtension(
loadedExtensionName,
'langReady',
/** @type {module:svgcanvas.SvgCanvas#event:ext-langReady} */ {
/** @type {module:svgcanvas.SvgCanvas#event:ext_langReady} */ {
lang, uiStrings, importLocale: getImportLocale({defaultLang: lang, defaultName: loadedExtensionName})
}
);
});
}
svgCanvas.runExtensions('langChanged', /** @type {module:svgcanvas.SvgCanvas#event:ext-langChanged} */ lang);
svgCanvas.runExtensions('langChanged', /** @type {module:svgcanvas.SvgCanvas#event:ext_langChanged} */ lang);
// Update flyout tooltips
setFlyoutTitles();
@ -6300,7 +6300,7 @@ editor.init = function () {
* returning an object with a `data` property set to its locales (to be
* merged with regular locales).
* @param {string} langParam
* @fires module:svgcanvas.SvgCanvas#event:ext-addLangData
* @fires module:svgcanvas.SvgCanvas#event:ext_addLangData
* @todo Can we forego this in favor of `langReady` (or forego `langReady`)?
* @returns {module:locale.AddLangExtensionLocaleData[]}
*/
@ -6311,7 +6311,7 @@ editor.init = function () {
* @function
* @type {module:svgcanvas.ExtensionVarBuilder}
* @param {string} name
* @returns {module:svgcanvas.SvgCanvas#event:ext-addLangData}
* @returns {module:svgcanvas.SvgCanvas#event:ext_addLangData}
*/
(name) => { // We pass in a function as we don't know the extension name here when defining this `addLangData` method
return {

View File

@ -1006,7 +1006,7 @@ this.runExtension = function (name, action, vars) {
/**
* @callback module:svgcanvas.ExtensionVarBuilder
* @param {string} name The name of the extension
* @returns {module:svgcanvas.SvgCanvas#event:ext-addLangData}
* @returns {module:svgcanvas.SvgCanvas#event:ext_addLangData}
*/
/**
* @callback module:svgcanvas.ExtensionNameFilter
@ -1018,7 +1018,7 @@ this.runExtension = function (name, action, vars) {
* @todo Would be easier to document if passing in object with key of action and vars as value; could then define an interface which tied both together
* @function module:svgcanvas.SvgCanvas#runExtensions
* @param {"mouseDown"|"mouseMove"|"mouseUp"|"zoomChanged"|"IDsUpdated"|"canvasUpdated"|"toolButtonStateUpdate"|"selectedChanged"|"elementTransition"|"elementChanged"|"langReady"|"langChanged"|"addLangData"|"onNewDocument"|"workareaResized"} action
* @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 {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.
@ -1066,83 +1066,83 @@ const runExtensions = this.runExtensions = function (action, vars, returnArray,
*/
/**
* @function module:svgcanvas.ExtensionInitResponse#mouseDown
* @param {module:svgcanvas.SvgCanvas#event:ext-mouseDown} arg
* @param {module:svgcanvas.SvgCanvas#event:ext_mouseDown} arg
* @returns {void|module:svgcanvas.ExtensionMouseDownStatus}
*/
/**
* @function module:svgcanvas.ExtensionInitResponse#mouseMove
* @param {module:svgcanvas.SvgCanvas#event:ext-mouseMove} arg
* @param {module:svgcanvas.SvgCanvas#event:ext_mouseMove} arg
* @returns {void}
*/
/**
* @function module:svgcanvas.ExtensionInitResponse#mouseUp
* @param {module:svgcanvas.SvgCanvas#event:ext-mouseUp} arg
* @param {module:svgcanvas.SvgCanvas#event:ext_mouseUp} arg
* @returns {module:svgcanvas.ExtensionMouseUpStatus}
*/
/**
* @function module:svgcanvas.ExtensionInitResponse#zoomChanged
* @param {module:svgcanvas.SvgCanvas#event:ext-zoomChanged} arg
* @param {module:svgcanvas.SvgCanvas#event:ext_zoomChanged} arg
* @returns {void}
*/
/**
* @function module:svgcanvas.ExtensionInitResponse#IDsUpdated
* @param {module:svgcanvas.SvgCanvas#event:ext-IDsUpdated} arg
* @param {module:svgcanvas.SvgCanvas#event:ext_IDsUpdated} arg
* @returns {module:svgcanvas.ExtensionIDsUpdatedStatus}
*/
/**
* @function module:svgcanvas.ExtensionInitResponse#canvasUpdated
* @param {module:svgcanvas.SvgCanvas#event:ext-canvasUpdated} arg
* @param {module:svgcanvas.SvgCanvas#event:ext_canvasUpdated} arg
* @returns {void}
*/
/**
* @function module:svgcanvas.ExtensionInitResponse#toolButtonStateUpdate
* @param {module:svgcanvas.SvgCanvas#event:ext-toolButtonStateUpdate} arg
* @param {module:svgcanvas.SvgCanvas#event:ext_toolButtonStateUpdate} arg
* @returns {void}
*/
/**
* @function module:svgcanvas.ExtensionInitResponse#selectedChanged
* @param {module:svgcanvas.SvgCanvas#event:ext-selectedChanged} arg
* @param {module:svgcanvas.SvgCanvas#event:ext_selectedChanged} arg
* @returns {void}
*/
/**
* @function module:svgcanvas.ExtensionInitResponse#elementTransition
* @param {module:svgcanvas.SvgCanvas#event:ext-elementTransition} arg
* @param {module:svgcanvas.SvgCanvas#event:ext_elementTransition} arg
* @returns {void}
*/
/**
* @function module:svgcanvas.ExtensionInitResponse#elementChanged
* @param {module:svgcanvas.SvgCanvas#event:ext-elementChanged} arg
* @param {module:svgcanvas.SvgCanvas#event:ext_elementChanged} arg
* @returns {void}
*/
/**
* @function module:svgcanvas.ExtensionInitResponse#langReady
* @param {module:svgcanvas.SvgCanvas#event:ext-langReady} arg
* @param {module:svgcanvas.SvgCanvas#event:ext_langReady} arg
* @returns {void}
*/
/**
* @function module:svgcanvas.ExtensionInitResponse#langChanged
* @param {module:svgcanvas.SvgCanvas#event:ext-langChanged} arg
* @param {module:svgcanvas.SvgCanvas#event:ext_langChanged} arg
* @returns {void}
*/
/**
* @function module:svgcanvas.ExtensionInitResponse#addLangData
* @param {module:svgcanvas.SvgCanvas#event:ext-addLangData} arg
* @param {module:svgcanvas.SvgCanvas#event:ext_addLangData} arg
* @returns {Promise<module:locale.ExtensionLocaleData>} Resolves to {@link module:locale.ExtensionLocaleData}
*/
/**
* @function module:svgcanvas.ExtensionInitResponse#onNewDocument
* @param {module:svgcanvas.SvgCanvas#event:ext-onNewDocument} arg
* @param {module:svgcanvas.SvgCanvas#event:ext_onNewDocument} arg
* @returns {void}
*/
/**
* @function module:svgcanvas.ExtensionInitResponse#workareaResized
* @param {module:svgcanvas.SvgCanvas#event:ext-workareaResized} arg
* @param {module:svgcanvas.SvgCanvas#event:ext_workareaResized} arg
* @returns {void}
*/
/**
* @function module:svgcanvas.ExtensionInitResponse#callback
* @this module:SVGEditor
* @param {module:svgcanvas.SvgCanvas#event:ext-callback} arg
* @param {module:svgcanvas.SvgCanvas#event:ext_callback} arg
* @returns {void}
*/
@ -1727,7 +1727,7 @@ const getBsplinePoint = function (t) {
* - When we are in select mode, select the element, remember the position
* and do nothing else.
* @param {MouseEvent} evt
* @fires module:svgcanvas.SvgCanvas#event:ext-mouseDown
* @fires module:svgcanvas.SvgCanvas#event:ext_mouseDown
* @returns {void}
*/
const mouseDown = function (evt) {
@ -2088,14 +2088,14 @@ const mouseDown = function (evt) {
/**
* The main (left) mouse button is held down on the canvas area
* @event module:svgcanvas.SvgCanvas#event:ext-mouseDown
* @event module:svgcanvas.SvgCanvas#event:ext_mouseDown
* @type {PlainObject}
* @property {MouseEvent} event The event object
* @property {Float} start_x x coordinate on canvas
* @property {Float} start_y y coordinate on canvas
* @property {Element[]} selectedElements An array of the selected Elements
*/
const extResult = runExtensions('mouseDown', /** @type {module:svgcanvas.SvgCanvas#event:ext-mouseDown} */ {
const extResult = runExtensions('mouseDown', /** @type {module:svgcanvas.SvgCanvas#event:ext_mouseDown} */ {
event: evt,
start_x: startX,
start_y: startY,
@ -2115,7 +2115,7 @@ const mouseDown = function (evt) {
*
* @param {MouseEvent} evt
* @fires module:svgcanvas.SvgCanvas#event:transition
* @fires module:svgcanvas.SvgCanvas#event:ext-mouseMove
* @fires module:svgcanvas.SvgCanvas#event:ext_mouseMove
* @returns {void}
*/
const mouseMove = function (evt) {
@ -2540,14 +2540,14 @@ const mouseMove = function (evt) {
/**
* The mouse has moved on the canvas area
* @event module:svgcanvas.SvgCanvas#event:ext-mouseMove
* @event module:svgcanvas.SvgCanvas#event:ext_mouseMove
* @type {PlainObject}
* @property {MouseEvent} event The event object
* @property {Float} mouse_x x coordinate on canvas
* @property {Float} mouse_y y coordinate on canvas
* @property {Element} selected Refers to the first selected element
*/
runExtensions('mouseMove', /** @type {module:svgcanvas.SvgCanvas#event:ext-mouseMove} */ {
runExtensions('mouseMove', /** @type {module:svgcanvas.SvgCanvas#event:ext_mouseMove} */ {
event: evt,
mouse_x: mouseX,
mouse_y: mouseY,
@ -2565,7 +2565,7 @@ const mouseMove = function (evt) {
* @param {MouseEvent} evt
* @fires module:svgcanvas.SvgCanvas#event:zoomed
* @fires module:svgcanvas.SvgCanvas#event:changed
* @fires module:svgcanvas.SvgCanvas#event:ext-mouseUp
* @fires module:svgcanvas.SvgCanvas#event:ext_mouseUp
* @returns {void}
*/
const mouseUp = function (evt) {
@ -2802,13 +2802,13 @@ const mouseUp = function (evt) {
/**
* The main (left) mouse button is released (anywhere)
* @event module:svgcanvas.SvgCanvas#event:ext-mouseUp
* @event module:svgcanvas.SvgCanvas#event:ext_mouseUp
* @type {PlainObject}
* @property {MouseEvent} event The event object
* @property {Float} mouse_x x coordinate on canvas
* @property {Float} mouse_y y coordinate on canvas
*/
const extResult = runExtensions('mouseUp', /** @type {module:svgcanvas.SvgCanvas#event:ext-mouseUp} */ {
const extResult = runExtensions('mouseUp', /** @type {module:svgcanvas.SvgCanvas#event:ext_mouseUp} */ {
event: evt,
mouse_x: mouseX,
mouse_y: mouseY
@ -5202,19 +5202,19 @@ this.setBBoxZoom = function (val, editorW, editorH) {
/**
* The zoom level has changed. Supplies the new zoom level as a number (not percentage).
* @event module:svgcanvas.SvgCanvas#event:ext-zoomChanged
* @event module:svgcanvas.SvgCanvas#event:ext_zoomChanged
* @type {Float}
*/
/**
* The bottom panel was updated
* @event module:svgcanvas.SvgCanvas#event:ext-toolButtonStateUpdate
* @event module:svgcanvas.SvgCanvas#event:ext_toolButtonStateUpdate
* @type {PlainObject}
* @property {boolean} nofill Indicates fill is disabled
* @property {boolean} nostroke Indicates stroke is disabled
*/
/**
* The element selection has changed (elements were added/removed from selection)
* @event module:svgcanvas.SvgCanvas#event:ext-selectedChanged
* @event module:svgcanvas.SvgCanvas#event:ext_selectedChanged
* @type {PlainObject}
* @property {Element[]} elems Array of the newly selected elements
* @property {Element|null} selectedElement The single selected element
@ -5223,19 +5223,19 @@ this.setBBoxZoom = function (val, editorW, editorH) {
/**
* Called when part of element is in process of changing, generally on
* mousemove actions like rotate, move, etc.
* @event module:svgcanvas.SvgCanvas#event:ext-elementTransition
* @event module:svgcanvas.SvgCanvas#event:ext_elementTransition
* @type {PlainObject}
* @property {Element[]} elems Array of transitioning elements
*/
/**
* One or more elements were changed
* @event module:svgcanvas.SvgCanvas#event:ext-elementChanged
* @event module:svgcanvas.SvgCanvas#event:ext_elementChanged
* @type {PlainObject}
* @property {Element[]} elems Array of the affected elements
*/
/**
* Invoked as soon as the locale is ready
* @event module:svgcanvas.SvgCanvas#event:ext-langReady
* @event module:svgcanvas.SvgCanvas#event:ext_langReady
* @type {PlainObject}
* @property {string} lang The two-letter language code
* @property {module:SVGEditor.uiStrings} uiStrings
@ -5243,30 +5243,30 @@ this.setBBoxZoom = function (val, editorW, editorH) {
*/
/**
* The language was changed. Two-letter code of the new language.
* @event module:svgcanvas.SvgCanvas#event:ext-langChanged
* @event module:svgcanvas.SvgCanvas#event:ext_langChanged
* @type {string}
*/
/**
* Means for an extension to add locale data. The two-letter language code.
* @event module:svgcanvas.SvgCanvas#event:ext-addLangData
* @event module:svgcanvas.SvgCanvas#event:ext_addLangData
* @type {PlainObject}
* @property {string} lang
* @property {module:SVGEditor~ImportLocale} importLocale
*/
/**
* Called when new image is created
* @event module:svgcanvas.SvgCanvas#event:ext-onNewDocument
* @event module:svgcanvas.SvgCanvas#event:ext_onNewDocument
* @type {void}
*/
/**
* Called when sidepanel is resized or toggled
* @event module:svgcanvas.SvgCanvas#event:ext-workareaResized
* @event module:svgcanvas.SvgCanvas#event:ext_workareaResized
* @type {void}
*/
/**
* Called upon addition of the extension, or, if svgicons are set,
* after the icons are ready when extension SVG icons have loaded.
* @event module:svgcanvas.SvgCanvas#event:ext-callback
* @event module:svgcanvas.SvgCanvas#event:ext_callback
* @type {void}
*/
@ -5274,7 +5274,7 @@ this.setBBoxZoom = function (val, editorW, editorH) {
* Sets the zoom to the given level.
* @function module:svgcanvas.SvgCanvas#setZoom
* @param {Float} zoomLevel - Float indicating the zoom level to change to
* @fires module:svgcanvas.SvgCanvas#event:ext-zoomChanged
* @fires module:svgcanvas.SvgCanvas#event:ext_zoomChanged
* @returns {void}
*/
this.setZoom = function (zoomLevel) {
@ -5286,7 +5286,7 @@ this.setZoom = function (zoomLevel) {
selectorManager.requestSelector(elem).resize();
});
pathActions.zoomChange();
runExtensions('zoomChanged', /** @type {module:svgcanvas.SvgCanvas#event:ext-zoomChanged} */ zoomLevel);
runExtensions('zoomChanged', /** @type {module:svgcanvas.SvgCanvas#event:ext_zoomChanged} */ zoomLevel);
};
/**
@ -6368,7 +6368,7 @@ this.copySelectedElements = function () {
* @param {Integer|void} x Expected if type is "point"
* @param {Integer|void} y Expected if type is "point"
* @fires module:svgcanvas.SvgCanvas#event:changed
* @fires module:svgcanvas.SvgCanvas#event:ext-IDsUpdated
* @fires module:svgcanvas.SvgCanvas#event:ext_IDsUpdated
* @returns {void}
*/
this.pasteElements = function (type, x, y) {
@ -6405,14 +6405,14 @@ this.pasteElements = function (type, x, y) {
// Give extensions like the connector extension a chance to reflect new IDs and remove invalid elements
/**
* Triggered when `pasteElements` is called from a paste action (context menu or key)
* @event module:svgcanvas.SvgCanvas#event:ext-IDsUpdated
* @event module:svgcanvas.SvgCanvas#event:ext_IDsUpdated
* @type {PlainObject}
* @property {module:svgcanvas.SVGAsJSON[]} elems
* @property {module:svgcanvas.ChangedIDs} changes Maps past ID (on attribute) to current ID
*/
runExtensions(
'IDsUpdated',
/** @type {module:svgcanvas.SvgCanvas#event:ext-IDsUpdated} */
/** @type {module:svgcanvas.SvgCanvas#event:ext_IDsUpdated} */
{elems: clipb, changes: changedIDs},
true
).forEach(function (extChanges) {
@ -7130,7 +7130,7 @@ this.contentH = getResolution().h;
* @function module:svgcanvas.SvgCanvas#updateCanvas
* @param {Float} w - Float with the new width
* @param {Float} h - Float with the new height
* @fires module:svgcanvas.SvgCanvas#event:ext-canvasUpdated
* @fires module:svgcanvas.SvgCanvas#event:ext_canvasUpdated
* @returns {module:svgcanvas.CanvasInfo}
*/
this.updateCanvas = function (w, h) {
@ -7169,7 +7169,7 @@ this.updateCanvas = function (w, h) {
/**
* Invoked upon updates to the canvas.
* @event module:svgcanvas.SvgCanvas#event:ext-canvasUpdated
* @event module:svgcanvas.SvgCanvas#event:ext_canvasUpdated
* @type {PlainObject}
* @property {Integer} new_x
* @property {Integer} new_y
@ -7181,7 +7181,7 @@ this.updateCanvas = function (w, h) {
runExtensions(
'canvasUpdated',
/**
* @type {module:svgcanvas.SvgCanvas#event:ext-canvasUpdated}
* @type {module:svgcanvas.SvgCanvas#event:ext_canvasUpdated}
*/
{new_x: x, new_y: y, old_x: oldX, old_y: oldY, d_x: x - oldX, d_y: y - oldY}
);

File diff suppressed because it is too large Load Diff

6
package-lock.json generated
View File

@ -4358,9 +4358,9 @@
"dev": true
},
"eslint-plugin-import": {
"version": "2.17.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.17.1.tgz",
"integrity": "sha512-lzD9uvRvW4MsHzIOMJEDSb5MOV9LzgxRPBaovvOhJqzgxRHYfGy9QOrMuwHIh5ehKFJ7Z3DcrcGKDQ0IbP0EdQ==",
"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==",
"dev": true,
"requires": {
"array-includes": "^3.0.3",

File diff suppressed because it is too large Load Diff