diff --git a/.eslintrc.js b/.eslintrc.js index 5792cfa8..5a0771e1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -11,7 +11,7 @@ module.exports = { "plugin:sonarjs/recommended", "eslint:recommended" ], - plugins: ["jsdoc", "promise", "html", "import", "sonarjs"], + plugins: [ "jsdoc", "promise", "html", "import", "sonarjs" ], parserOptions: { ecmaVersion: 2020, sourceType: "module" @@ -21,32 +21,46 @@ module.exports = { es6: true }, rules: { + /** @todo len should probably more 120-150 */ + "max-len": [ "warn", { "code": 250 } ], + /** @todo jsdoc should be made warn or error */ + "valid-jsdoc": "off", + /** @todo cognitive complexity should be much lower (25-50?) */ + "sonarjs/cognitive-complexity": [ "warn", 200 ], "node/no-unsupported-features/es-syntax": 0, - "no-unused-vars": ["error", { "argsIgnorePattern": "^_" }], - "sonarjs/cognitive-complexity": ["warn", 40], + "no-unused-vars": [ "error", { "argsIgnorePattern": "^_" } ], "sonarjs/no-duplicate-string": 0, + "semi" : "error", + "no-trailing-spaces": "error", + "array-bracket-spacing": [ "error", "always" ], + "comma-spacing": "error", + "object-curly-spacing": [ "error", "always" ], + "no-console": [ + "warn", + { "allow": [ "warn", "error", "info", "table" ] } + ], + "no-param-reassign": [ "warn", { "props": false } ], + "arrow-parens": [ "error", "always" ], }, overrides: [ { - files: [ 'cypress/**/*'], - extends: [ + files: [ 'cypress/**/*' ], + extends: [ "plugin:cypress/recommended" ], env: { mocha: true, node: true }, - globals: { - "assert": true - }, + globals: { "assert": true }, rules: { // with ci, instrumented is not created before linter - "import/no-unresolved": [2, { ignore: ['instrumented'] }], + "import/no-unresolved": [ 2, { ignore: [ 'instrumented' ] } ], "node/no-missing-import": 0 } }, { - files: [ 'docs/**/*'], + files: [ 'docs/**/*' ], rules: { // md files have example that don't need a strict checking "no-undef": 0, "import/no-unresolved": 0, diff --git a/Gemfile b/Gemfile deleted file mode 100644 index da7e0241..00000000 --- a/Gemfile +++ /dev/null @@ -1 +0,0 @@ -gem "github-pages", :source => "https://rubygems.org" diff --git a/README.md b/README.md index fa6b919d..699c834d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# ![LOGO](src/editor/images/logo.png) SVG-edit + + +# SVG-Edit [![npm](https://img.shields.io/npm/v/svgedit.svg)](https://www.npmjs.com/package/svgedit) [![Dependencies](https://img.shields.io/david/SVG-Edit/svgedit.svg)](https://david-dm.org/SVG-Edit/svgedit) @@ -18,14 +20,6 @@ (see also [licenses for dev. deps.](https://raw.githubusercontent.com/SVG-Edit/svgedit/master/badges/licenses-badge-dev.svg?sanitize=true)) -(Note: The license provenance of the images in `/editor/images` may not be -fully clear, even with the origin of some of the images listed as being from . We would like to -replace these images if their provenance cannot be determined or is found to -be under a protective license. If you know of the original terms, or can help -create SVG replacement images, please let us know at: -[#377](https://github.com/SVG-Edit/svgedit/issues/377).) - - [![issuehunt-to-marktext](https://issuehunt.io/static/embed/issuehunt-button-v1.svg)](https://issuehunt.io/r/SVG-Edit/svgedit) SVG-edit is a fast, web-based, JavaScript-driven SVG drawing editor that @@ -36,25 +30,21 @@ works in any modern browser. ## Help wanted -While we have made some recent releases to SVG-edit for bug fixes, -refactoring and documentation to make the codebase more maintainable, the -core developers responsible for the bulk of the drawing features are no -longer active with the project, so we would love others familiar with SVG -to join the project. +We need more maintainers for SVG-Edit ## Demo -### [Try SVG-edit here](https://svg-edit.github.io/svgedit/dist/editor/index.html) +### [Try SVG-edit here](https://svgedit.netlify.app/editor/index.html) -We also build a systemJS version at [`master`](https://svg-edit.github.io/svgedit/dist/editor/system/index.html) +Thanks to netlify, you can test the following builds: -You may also obtain URLs for specific [releases](https://github.com/SVG-Edit/svgedit/releases). +[Try SVG-edit 5.1.0 here](https://6098683962bf91702907ee33--svgedit.netlify.app/editor/svg-editor.html) -Thanks to netlify, you can test the following versions: +[Try SVG-edit 6.1.0 here](https://60a0000fc9900b0008fd268d--svgedit.netlify.app/editor/index.html) + +/ -latest master build (V6): https://svgedit.netlify.app/editor/index.html -V7 preview (under development): https://deploy-preview-465--svgedit.netlify.app/editor/index.html ## Installation diff --git a/archive/from-old-wiki/CodeRefactoring.md b/archive/from-old-wiki/CodeRefactoring.md index d32d2870..46a808b7 100644 --- a/archive/from-old-wiki/CodeRefactoring.md +++ b/archive/from-old-wiki/CodeRefactoring.md @@ -32,7 +32,7 @@ Current Tasks 1) I introduced the concept of a Drawing earlier on that would encapsulate the state of a single open SVG document. The SVG editor has a handle to the current drawing and uses that instead of accessing svg DOM elements directly. Eventually all code that deals with layers, current editing context, document history and more will be moved into draw.js but for now, much of that code still lives in svgcanvas.js. -2) I'm in the process of migrating a large chunk of svgcanvas.js called "pathActions" into its own module (path.js). This piece of code did have a lot of dependencies so moving it piece-by-piece seemed like the right way to go. Currently it's about half-way migrated, with most of the 'public API' still living in svgcanvas.js. +1) I'm in the process of migrating a large chunk of svgcanvas.js called "pathActions" into its own module (path.js). This piece of code did have a lot of dependencies so moving it piece-by-piece seemed like the right way to go. Currently it's about half-way migrated, with most of the 'public API' still living in svgcanvas.js. TODOs Finish moving layers functionality into the Drawing class diff --git a/cypress/integration/ui/__snapshots__/scenario.js.snap b/cypress/integration/ui/__snapshots__/scenario.js.snap index ba1acc15..37b89438 100644 --- a/cypress/integration/ui/__snapshots__/scenario.js.snap +++ b/cypress/integration/ui/__snapshots__/scenario.js.snap @@ -623,12 +623,12 @@ exports[`use various parts of svg-edit > check tool_star #0`] = ` point="5" r="66.66666666666667" radialshift="0" - r2="13.333333333333334" + r2="22.222222222222225" orient="point" fill="#ffff00" strokecolor="#000000" strokewidth="0" - points="370,135.33333333333331 377.83713669723295,191.21310674166736 433.40376775301024,181.39886704167017 382.68075355060205,206.12022659166595 409.18568348616486,255.93446629166317 370,215.33333333333334 330.81431651383514,255.93446629166317 357.31924644939795,206.12022659166595 306.59623224698976,181.39886704167017 362.16286330276705,191.21310674166736 370,135.33333333333331 377.83713669723295,191.21310674166736 " + points="370,135.33333333333331 383.0618944953883,184.02184456944562 433.40376775301024,181.39886704167017 391.13458925100343,208.86704431944327 409.18568348616486,255.93446629166317 370,224.22222222222223 330.81431651383514,255.93446629166317 348.86541074899657,208.86704431944327 306.59623224698976,181.39886704167017 356.9381055046117,184.02184456944562 370,135.33333333333331 383.0618944953883,184.02184456944562 " stroke="#000000" stroke-width="0" > @@ -713,12 +713,12 @@ exports[`use various parts of svg-edit > check tool_polygon #0`] = ` point="5" r="66.66666666666667" radialshift="0" - r2="13.333333333333334" + r2="22.222222222222225" orient="point" fill="#ffff00" strokecolor="#000000" strokewidth="0" - points="370,135.33333333333331 377.83713669723295,191.21310674166736 433.40376775301024,181.39886704167017 382.68075355060205,206.12022659166595 409.18568348616486,255.93446629166317 370,215.33333333333334 330.81431651383514,255.93446629166317 357.31924644939795,206.12022659166595 306.59623224698976,181.39886704167017 362.16286330276705,191.21310674166736 370,135.33333333333331 377.83713669723295,191.21310674166736 " + points="370,135.33333333333331 383.0618944953883,184.02184456944562 433.40376775301024,181.39886704167017 391.13458925100343,208.86704431944327 409.18568348616486,255.93446629166317 370,224.22222222222223 330.81431651383514,255.93446629166317 348.86541074899657,208.86704431944327 306.59623224698976,181.39886704167017 356.9381055046117,184.02184456944562 370,135.33333333333331 383.0618944953883,184.02184456944562 " stroke="#000000" stroke-width="0" fill-opacity="1" diff --git a/cypress/integration/ui/accessibility.js b/cypress/integration/ui/accessibility.js index 5ee13042..bb383668 100644 --- a/cypress/integration/ui/accessibility.js +++ b/cypress/integration/ui/accessibility.js @@ -13,10 +13,10 @@ describe('UI - Accessibility', function () { cy.configureAxe({ // Todo: Reenable when have time to fix // See https://www.deque.com/axe/axe-for-web/documentation/api-documentation/#user-content-parameters-1 - rules: [{ + rules: [ { id: 'meta-viewport', enabled: false - }] + } ] /* branding: { brand: String, @@ -32,10 +32,10 @@ describe('UI - Accessibility', function () { {}, { rules: { - 'label-title-only': {enabled: false}, - 'page-has-heading-one': {enabled: false}, - region: {enabled: false}, - 'scrollable-region-focusable': {enabled: false} + 'label-title-only': { enabled: false }, + 'page-has-heading-one': { enabled: false }, + region: { enabled: false }, + 'scrollable-region-focusable': { enabled: false } } } ); diff --git a/cypress/integration/ui/clipboard.js b/cypress/integration/ui/clipboard.js index d9bbb944..26d423b6 100644 --- a/cypress/integration/ui/clipboard.js +++ b/cypress/integration/ui/clipboard.js @@ -11,13 +11,13 @@ describe('UI - Clipboard', function () { cy.get('#tool_source').click(); cy.get('#svg_source_textarea') - .type('{selectall}', {force: true}) + .type('{selectall}', { force: true }) .type(` Layer 1 - `, {force: true, parseSpecialCharSequences: false}); + `, { force: true, parseSpecialCharSequences: false }); cy.get('#tool_source_save').click(); cy.get('#testCircle').should('exist'); cy.get('#svg_1').should('not.exist'); @@ -25,20 +25,20 @@ describe('UI - Clipboard', function () { // Copy. cy.get('#testCircle').click().rightclick(); - cy.get('#cmenu_canvas a[href="#copy"]').click({force: true}); + cy.get('#cmenu_canvas a[href="#copy"]').click({ force: true }); // Paste. // Scrollbars fail to recenter in Cypress test. Works fine in reality. // Thus forcing click is needed since workspace is mostly offscreen. - cy.get('#svgroot').rightclick({force: true}); - cy.get('#cmenu_canvas a[href="#paste"]').click({force: true}); + cy.get('#svgroot').rightclick({ force: true }); + cy.get('#cmenu_canvas a[href="#paste"]').click({ force: true }); cy.get('#testCircle').should('exist'); cy.get('#svg_1').should('exist'); cy.get('#svg_2').should('not.exist'); // Cut. cy.get('#testCircle').click().rightclick(); - cy.get('#cmenu_canvas a[href="#cut"]').click({force: true}); + cy.get('#cmenu_canvas a[href="#cut"]').click({ force: true }); cy.get('#testCircle').should('not.exist'); cy.get('#svg_1').should('exist'); cy.get('#svg_2').should('not.exist'); @@ -46,17 +46,17 @@ describe('UI - Clipboard', function () { // Paste. // Scrollbars fail to recenter in Cypress test. Works fine in reality. // Thus forcing click is needed since workspace is mostly offscreen. - cy.get('#svgroot').rightclick({force: true}); - cy.get('#cmenu_canvas a[href="#paste"]').click({force: true}); + cy.get('#svgroot').rightclick({ force: true }); + cy.get('#cmenu_canvas a[href="#paste"]').click({ force: true }); cy.get('#testCircle').should('not.exist'); cy.get('#svg_1').should('exist'); cy.get('#svg_2').should('exist'); // Delete. cy.get('#svg_2').click().rightclick(); - cy.get('#cmenu_canvas a[href="#delete"]').click({force: true}); + cy.get('#cmenu_canvas a[href="#delete"]').click({ force: true }); cy.get('#svg_1').click().rightclick(); - cy.get('#cmenu_canvas a[href="#delete"]').click({force: true}); + cy.get('#cmenu_canvas a[href="#delete"]').click({ force: true }); cy.get('#svg_1').should('not.exist'); cy.get('#svg_2').should('not.exist'); }); diff --git a/cypress/integration/ui/control-points.js b/cypress/integration/ui/control-points.js index 4f1fe7a3..0dcc6c3c 100644 --- a/cypress/integration/ui/control-points.js +++ b/cypress/integration/ui/control-points.js @@ -11,23 +11,23 @@ describe('UI - Control Points', function () { const randomOffset = () => 2 + Math.round(10 + Math.random() * 40); cy.get('#tool_source').click(); cy.get('#svg_source_textarea') - .type('{selectall}', {force: true}) + .type('{selectall}', { force: true }) .type(` Layer 1 - `, {force: true, parseSpecialCharSequences: false}); - cy.get('#tool_source_save').click({force: true}); + `, { force: true, parseSpecialCharSequences: false }); + cy.get('#tool_source_save').click({ force: true }); - cy.get('#svg_1').click({force: true}).click({force: true}); + cy.get('#svg_1').click({ force: true }).click({ force: true }); - cy.get('#pathpointgrip_0').trigger('mousedown', {which: 1, force: true}) - .trigger('mousemove', randomOffset(), randomOffset(), {force: true}) - .trigger('mouseup', {force: true}); - cy.get('#pathpointgrip_1').trigger('mousedown', {which: 1, force: true}) - .trigger('mousemove', randomOffset(), randomOffset(), {force: true}) - .trigger('mouseup', {force: true}); + cy.get('#pathpointgrip_0').trigger('mousedown', { which: 1, force: true }) + .trigger('mousemove', randomOffset(), randomOffset(), { force: true }) + .trigger('mouseup', { force: true }); + cy.get('#pathpointgrip_1').trigger('mousedown', { which: 1, force: true }) + .trigger('mousemove', randomOffset(), randomOffset(), { force: true }) + .trigger('mouseup', { force: true }); cy.get('#svg_1[d]').should('not.contain', 'NaN'); }); diff --git a/cypress/integration/ui/export.js b/cypress/integration/ui/export.js index 48d68ba2..f77877c8 100644 --- a/cypress/integration/ui/export.js +++ b/cypress/integration/ui/export.js @@ -14,7 +14,7 @@ describe('UI - Export tests', function () { it('Editor - No parameters: Export button clicking; dialog opens', () => { openMainMenu(); - cy.get('#tool_export').click({force: true}); + cy.get('#tool_export').click({ force: true }); cy.get('#dialog_content select'); }); }); diff --git a/cypress/integration/ui/issues/issue-359.js b/cypress/integration/ui/issues/issue-359.js index fed05e2f..d93fb5b9 100644 --- a/cypress/integration/ui/issues/issue-359.js +++ b/cypress/integration/ui/issues/issue-359.js @@ -11,13 +11,13 @@ describe('Fix issue 359', function () { it('can undo without throwing', function () { cy.get('#tool_source').click(); cy.get('#svg_source_textarea') - .type('{selectall}', {force: true}) + .type('{selectall}', { force: true }) .type(` Layer 1 - `, {parseSpecialCharSequences: false, force: true}); + `, { parseSpecialCharSequences: false, force: true }); cy.get('#tool_source_save').click(); cy.get('#tool_undo').click(); cy.get('#tool_redo').click(); // test also redo to make the test more comprehensive diff --git a/cypress/integration/ui/issues/issue-407.js b/cypress/integration/ui/issues/issue-407.js index 69e67875..a7597aed 100644 --- a/cypress/integration/ui/issues/issue-407.js +++ b/cypress/integration/ui/issues/issue-407.js @@ -11,7 +11,7 @@ describe('Fix issue 407', function () { it('can enter edit on text child', function () { cy.get('#tool_source').click(); cy.get('#svg_source_textarea') - .type('{selectall}', {force: true}) + .type('{selectall}', { force: true }) .type(` Layer 1 @@ -20,16 +20,16 @@ describe('Fix issue 407', function () { hello - `, {force: true, parseSpecialCharSequences: false}); + `, { force: true, parseSpecialCharSequences: false }); cy.get('#tool_source_save').click(); cy.get('#svg_1').click().dblclick(); cy.get('#a_text').should('exist'); cy.get('#a_text') - .trigger('mousedown', {which: 1, force: true}) - .trigger('mouseup', {force: true}) - .dblclick({force: true}); + .trigger('mousedown', { which: 1, force: true }) + .trigger('mouseup', { force: true }) + .dblclick({ force: true }); // svgedit use the #text text field to capture the text - cy.get('#text').type('1234', {force: true}); + cy.get('#text').type('1234', { force: true }); cy.get('#a_text').should('have.text', 'he1234llo'); }); }); diff --git a/cypress/integration/ui/issues/issue-408.js b/cypress/integration/ui/issues/issue-408.js index b7524235..fdf1bb32 100644 --- a/cypress/integration/ui/issues/issue-408.js +++ b/cypress/integration/ui/issues/issue-408.js @@ -11,7 +11,7 @@ describe('Fix issue 408', function () { it('should not throw when showing/saving svg content', function () { cy.get('#tool_source').click(); cy.get('#svg_source_textarea') - .type('{selectall}', {force: true}) + .type('{selectall}', { force: true }) .type(` Layer 1 @@ -20,7 +20,7 @@ describe('Fix issue 408', function () { - `, {force: true, parseSpecialCharSequences: false}); + `, { force: true, parseSpecialCharSequences: false }); cy.get('#tool_source_save').click(); cy.get('#svg_6').click().dblclick(); // change context cy.get('#tool_source').click(); // reopen tool_source diff --git a/cypress/integration/ui/issues/issue-423.js b/cypress/integration/ui/issues/issue-423.js index 005d2311..6ab956fc 100644 --- a/cypress/integration/ui/issues/issue-423.js +++ b/cypress/integration/ui/issues/issue-423.js @@ -11,7 +11,7 @@ describe('Fix issue 423', function () { it('should not throw when undoing the move', function () { cy.get('#tool_source').click(); cy.get('#svg_source_textarea') - .type('{selectall}', {force: true}) + .type('{selectall}', { force: true }) .type(` Layer 1 @@ -22,12 +22,12 @@ describe('Fix issue 423', function () { - `, {parseSpecialCharSequences: false, force: true}); - cy.get('#tool_source_save').click({force: true}); + `, { parseSpecialCharSequences: false, force: true }); + cy.get('#tool_source_save').click({ force: true }); cy.get('#TANK1') - .trigger('mousedown', {force: true}) - .trigger('mousemove', 50, 0, {force: true}) - .trigger('mouseup', {force: true}); - cy.get('#tool_undo').click({force: true}); + .trigger('mousedown', { force: true }) + .trigger('mousemove', 50, 0, { force: true }) + .trigger('mouseup', { force: true }); + cy.get('#tool_undo').click({ force: true }); }); }); diff --git a/cypress/integration/ui/scenario.js b/cypress/integration/ui/scenario.js index e5566709..700d9758 100644 --- a/cypress/integration/ui/scenario.js +++ b/cypress/integration/ui/scenario.js @@ -12,79 +12,97 @@ describe('use various parts of svg-edit', function () { }); it('check tool_source', function () { - cy.get('#tool_source').click({force: true}); + cy.get('#tool_source').click({ force: true }); cy.get('#svg_source_textarea') - .type('{selectall}', {force: true}) + .type('{selectall}', { force: true }) .type(` Layer 1 - `, {force: true, parseSpecialCharSequences: false}); - cy.get('#tool_source_save').click({force: true}); + `, { force: true, parseSpecialCharSequences: false }); + cy.get('#tool_source_save').click({ force: true }); testSnapshot(); }); it('check tool_fhpath', function () { cy.get('#tool_fhpath') - .click({force: true}); + .click({ force: true }); cy.get('#rect') - .trigger('mousemove', 200, 200, {force: true}) - .trigger('mousedown', 200, 200, {force: true}) - .trigger('mousemove', 20, 20, {force: true}) - .trigger('mouseup', {force: true}); + .trigger('mousemove', 200, 200, { force: true }) + .trigger('mousedown', 200, 200, { force: true }) + .trigger('mousemove', 20, 20, { force: true }) + .trigger('mouseup', { force: true }); cy.get('#svgcontent').toMatchSnapshot(); }); it('check tool_text', function () { cy.get('#tool_text') - .click({force: true}); + .click({ force: true }); cy.get('#rect') - .trigger('mousedown', 46, 35, {force: true}) - .trigger('mouseup', {force: true}); + .trigger('mousedown', 46, 35, { force: true }) + .trigger('mouseup', { force: true }); // svgedit use the #text text field to capture the text - cy.get('#text').type('AB', {force: true}); + cy.get('#text').type('AB', { force: true }); testSnapshot(); }); it('check tool_clone', function () { - cy.get('#svg_1').click({force: true}); + cy.get('#svg_1').click({ force: true }); cy.get('#tool_clone') - .click({force: true}); + .click({ force: true }); testSnapshot(); }); it('check tool_italic', function () { - cy.get('#svg_1').click({force: true}); + cy.get('#svg_1').click({ force: true }); cy.get('#tool_italic') - .click({force: true}); + .click({ force: true }); testSnapshot(); }); it('check tool_bold', function () { - cy.get('#svg_1').click({force: true}); + cy.get('#svg_1').click({ force: true }); cy.get('#tool_bold') - .click({force: true}); + .click({ force: true }); testSnapshot(); }); it('check change color', function () { - cy.get('#svg_1').click({force: true}); + cy.get('#svg_1').click({ force: true }); cy.get('[data-rgb="#ffff00"]') - .click({force: true}); + .click({ force: true }); testSnapshot(); }); it('check tool_text_anchor_start', function () { - cy.get('#svg_1').click({force: true}); + cy.get('#svg_1').click({ force: true }); cy.get('#tool_text_anchor_start') - .click({force: true}); + .click({ force: true }); testSnapshot(); }); it('check tool_text_anchor_middle', function () { - cy.get('#svg_1').click({force: true}); + cy.get('#svg_1').click({ force: true }); cy.get('#tool_text_anchor_middle') - .click({force: true}); + .click({ force: true }); testSnapshot(); }); it('check tool_text_anchor_end', function () { - cy.get('#svg_1').click({force: true}); + cy.get('#svg_1').click({ force: true }); cy.get('#tool_text_anchor_end') - .click({force: true}); + .click({ force: true }); + testSnapshot(); + }); + it('check tool_star', function () { + cy.get('#tool_star') + .click({ force: true }); + cy.get('#svgcontent') + .trigger('mousedown', 300, 150, { force: true }) + .trigger('mousemove', 300, 250, { force: true }) + .trigger('mouseup', { force: true }); + testSnapshot(); + }); + it('check tool_polygon', function () { + cy.get('#tool_polygon') + .click({ force: true }); + cy.get('#svgcontent') + .trigger('mousedown', 350, 250, { force: true }) + .trigger('mousemove', 350, 370, { force: true }) + .trigger('mouseup', { force: true }); testSnapshot(); }); it('check tool_star', function () { diff --git a/cypress/integration/ui/tool-selection.js b/cypress/integration/ui/tool-selection.js index d96d37b2..c2e63289 100644 --- a/cypress/integration/ui/tool-selection.js +++ b/cypress/integration/ui/tool-selection.js @@ -11,7 +11,7 @@ describe('UI - Tool selection', function () { cy.get('#tools_rect') .should('not.have.attr', 'pressed'); cy.get('#tools_rect') - .trigger('click', {force: true}) + .trigger('click', { force: true }) .should('have.attr', 'pressed'); }); }); diff --git a/cypress/integration/unit/contextmenu.js b/cypress/integration/unit/contextmenu.js index ef3fce6d..63e15a2f 100644 --- a/cypress/integration/unit/contextmenu.js +++ b/cypress/integration/unit/contextmenu.js @@ -19,26 +19,26 @@ describe('contextmenu', function () { it('Test svgedit.contextmenu does not add invalid menu item', function () { assert.throws( - () => contextmenu.add({id: 'justanid'}), + () => contextmenu.add({ id: 'justanid' }), null, null, 'menu item with just an id is invalid' ); assert.throws( - () => contextmenu.add({id: 'idandlabel', label: 'anicelabel'}), + () => contextmenu.add({ id: 'idandlabel', label: 'anicelabel' }), null, null, 'menu item with just an id and label is invalid' ); assert.throws( - () => contextmenu.add({id: 'idandlabel', label: 'anicelabel', action: 'notafunction'}), + () => contextmenu.add({ id: 'idandlabel', label: 'anicelabel', action: 'notafunction' }), null, null, 'menu item with action that is not a function is invalid' ); }); it('Test svgedit.contextmenu adds valid menu item', function () { - const validItem = {id: 'valid', label: 'anicelabel', action () { /* empty fn */ }}; + const validItem = { id: 'valid', label: 'anicelabel', action () { /* empty fn */ } }; contextmenu.add(validItem); assert.ok(contextmenu.hasCustomHandler('valid'), 'Valid menu item is added.'); @@ -46,8 +46,8 @@ describe('contextmenu', function () { }); it('Test svgedit.contextmenu rejects valid duplicate menu item id', function () { - const validItem1 = {id: 'valid', label: 'anicelabel', action () { /* empty fn */ }}; - const validItem2 = {id: 'valid', label: 'anicelabel', action () { /* empty fn */ }}; + const validItem1 = { id: 'valid', label: 'anicelabel', action () { /* empty fn */ } }; + const validItem2 = { id: 'valid', label: 'anicelabel', action () { /* empty fn */ } }; contextmenu.add(validItem1); assert.throws( diff --git a/cypress/integration/unit/coords.js b/cypress/integration/unit/coords.js index 51dd7ee0..22fcd23f 100644 --- a/cypress/integration/unit/coords.js +++ b/cypress/integration/unit/coords.js @@ -1,6 +1,6 @@ import '../../../instrumented/editor/jquery.min.js'; -import {NS} from '../../../instrumented/common/namespaces.js'; +import { NS } from '../../../instrumented/common/namespaces.js'; import * as utilities from '../../../instrumented/svgcanvas/utilities.js'; import * as coords from '../../../instrumented/svgcanvas/coords.js'; diff --git a/cypress/integration/unit/draw.js b/cypress/integration/unit/draw.js index 0bb610bf..8164f80d 100644 --- a/cypress/integration/unit/draw.js +++ b/cypress/integration/unit/draw.js @@ -1,6 +1,6 @@ import '../../../instrumented/editor/jquery.min.js'; -import {NS} from '../../../instrumented/common/namespaces.js'; +import { NS } from '../../../instrumented/common/namespaces.js'; import * as draw from '../../../instrumented/svgcanvas/draw.js'; import * as units from '../../../instrumented/common/units.js'; @@ -61,7 +61,7 @@ describe('draw.Drawing', function () { */ function createSVGElement (jsonMap) { const elem = document.createElementNS(NS.SVG, jsonMap.element); - Object.entries(jsonMap.attr).forEach(([attr, value]) => { + Object.entries(jsonMap.attr).forEach(([ attr, value ]) => { elem.setAttribute(attr, value); }); return elem; @@ -86,7 +86,7 @@ describe('draw.Drawing', function () { layer3.append(layer3Title); svgElem.append(layer3); - return [layer1, layer2, layer3]; + return [ layer1, layer2, layer3 ]; }; const createSomeElementsInGroup = function (group) { @@ -101,11 +101,11 @@ describe('draw.Drawing', function () { // }), createSVGElement({ element: 'rect', - attr: {x: '0', y: '1', width: '5', height: '10'} + attr: { x: '0', y: '1', width: '5', height: '10' } }), createSVGElement({ element: 'line', - attr: {x1: '0', y1: '1', x2: '5', y2: '6'} + attr: { x1: '0', y1: '1', x2: '5', y2: '6' } }) ); @@ -115,7 +115,7 @@ describe('draw.Drawing', function () { }); g.append(createSVGElement({ element: 'rect', - attr: {x: '0', y: '1', width: '5', height: '10'} + attr: { x: '0', y: '1', width: '5', height: '10' } })); group.append(g); return 4; @@ -727,7 +727,6 @@ describe('draw.Drawing', function () { drawing.setLayerOpacity(LAYER3, -1.4); assert.strictEqual(drawing.getLayerOpacity(LAYER1), 0.4); - // console.log('layer2 opacity ' + drawing.getLayerOpacity(LAYER2)); assert.strictEqual(drawing.getLayerOpacity(LAYER2), 1.0); assert.strictEqual(drawing.getLayerOpacity(LAYER3), 1.0); diff --git a/cypress/integration/unit/history.js b/cypress/integration/unit/history.js index 11b00cd6..f9d13e2a 100644 --- a/cypress/integration/unit/history.js +++ b/cypress/integration/unit/history.js @@ -1,6 +1,6 @@ import '../../../instrumented/editor/jquery.min.js'; -import {NS} from '../../../instrumented/common/namespaces.js'; +import { NS } from '../../../instrumented/common/namespaces.js'; import * as transformlist from '../../../instrumented/svgcanvas/svgtransformlist.js'; import * as utilities from '../../../instrumented/svgcanvas/utilities.js'; import * as hstory from '../../../instrumented/svgcanvas/history.js'; @@ -402,7 +402,7 @@ describe('history', function () { it('Test ChangeElementCommand', function () { this.div1.setAttribute('title', 'new title'); let change = new hstory.ChangeElementCommand(this.div1, - {title: 'old title', class: 'foo'}); + { title: 'old title', class: 'foo' }); assert.ok(change.unapply); assert.ok(change.apply); assert.equal(typeof change.unapply, typeof function () { /* empty fn */ }); @@ -418,7 +418,7 @@ describe('history', function () { this.div1.textContent = 'inner text'; change = new hstory.ChangeElementCommand(this.div1, - {'#text': null}); + { '#text': null }); change.unapply(); assert.ok(!this.div1.textContent); @@ -428,7 +428,7 @@ describe('history', function () { this.div1.textContent = ''; change = new hstory.ChangeElementCommand(this.div1, - {'#text': 'old text'}); + { '#text': 'old text' }); change.unapply(); assert.equal(this.div1.textContent, 'old text'); @@ -457,7 +457,7 @@ describe('history', function () { gethrefvalue = '#newhref'; change = new hstory.ChangeElementCommand(rect, - {'#href': '#oldhref'}); + { '#href': '#oldhref' }); assert.equal(justCalled, 'getHref'); justCalled = null; @@ -472,7 +472,7 @@ describe('history', function () { const line = document.createElementNS(NS.SVG, 'line'); line.setAttribute('class', 'newClass'); - change = new hstory.ChangeElementCommand(line, {class: 'oldClass'}); + change = new hstory.ChangeElementCommand(line, { class: 'oldClass' }); assert.ok(change.unapply); assert.ok(change.apply); diff --git a/cypress/integration/unit/math.js b/cypress/integration/unit/math.js index 3852a2a0..deba647d 100644 --- a/cypress/integration/unit/math.js +++ b/cypress/integration/unit/math.js @@ -1,6 +1,6 @@ import '../../../instrumented/editor/jquery.min.js'; -import {NS} from '../../../instrumented/common/namespaces.js'; +import { NS } from '../../../instrumented/common/namespaces.js'; import * as math from '../../../instrumented/svgcanvas/math.js'; describe('math', function () { @@ -17,7 +17,7 @@ describe('math', function () { }); it('Test svgedit.math.transformPoint() function', function () { - const {transformPoint} = math; + const { transformPoint } = math; const m = svg.createSVGMatrix(); m.a = 1; m.b = 0; @@ -51,7 +51,7 @@ describe('math', function () { it('Test svgedit.math.matrixMultiply() function', function () { const mult = math.matrixMultiply; - const {isIdentity} = math; + const { isIdentity } = math; // translate there and back const tr1 = svg.createSVGMatrix().translate(100, 50), @@ -84,7 +84,7 @@ describe('math', function () { }); it('Test svgedit.math.transformBox() function', function () { - const {transformBox} = math; + const { transformBox } = math; const m = svg.createSVGMatrix(); m.a = 1; m.b = 0; diff --git a/cypress/integration/unit/path.js b/cypress/integration/unit/path.js index 2c82c12e..1636b79c 100644 --- a/cypress/integration/unit/path.js +++ b/cypress/integration/unit/path.js @@ -3,11 +3,11 @@ import 'pathseg'; import '../../../instrumented/editor/jquery.min.js'; -import {NS} from '../../../instrumented/common/namespaces.js'; +import { NS } from '../../../instrumented/common/namespaces.js'; import * as utilities from '../../../instrumented/svgcanvas/utilities.js'; import * as pathModule from '../../../instrumented/svgcanvas/path.js'; -import {Path, Segment} from '../../../instrumented/svgcanvas/path-method.js'; -import {init as unitsInit} from '../../../instrumented/common/units.js'; +import { Path, Segment } from '../../../instrumented/svgcanvas/path-method.js'; +import { init as unitsInit } from '../../../instrumented/common/units.js'; describe('path', function () { /** @@ -48,7 +48,7 @@ describe('path', function () { const path = document.createElementNS(NS.SVG, 'path'); path.setAttribute('d', 'M0,0 L10,11 L20,21Z'); - const [mockPathContext, mockUtilitiesContext] = getMockContexts(); + const [ mockPathContext, mockUtilitiesContext ] = getMockContexts(); pathModule.init(mockPathContext); utilities.init(mockUtilitiesContext); new Path(path); // eslint-disable-line no-new @@ -57,7 +57,7 @@ describe('path', function () { assert.equal(path.pathSegList.getItem(1).x, 10); assert.equal(path.pathSegList.getItem(1).y, 11); - pathModule.replacePathSeg(SVGPathSeg.PATHSEG_LINETO_REL, 1, [30, 31], path); + pathModule.replacePathSeg(SVGPathSeg.PATHSEG_LINETO_REL, 1, [ 30, 31 ], path); assert.equal(path.pathSegList.getItem(1).pathSegTypeAsLetter, 'l'); assert.equal(path.pathSegList.getItem(1).x, 30); @@ -68,7 +68,7 @@ describe('path', function () { const path = document.createElementNS(NS.SVG, 'path'); path.setAttribute('d', 'M0,0 L10,11 L20,21Z'); - const [mockPathContext, mockUtilitiesContext] = getMockContexts(); + const [ mockPathContext, mockUtilitiesContext ] = getMockContexts(); pathModule.init(mockPathContext); utilities.init(mockUtilitiesContext); new Path(path); // eslint-disable-line no-new @@ -78,7 +78,7 @@ describe('path', function () { assert.equal(path.pathSegList.getItem(1).y, 11); const segment = new Segment(1, path.pathSegList.getItem(1)); - segment.setType(SVGPathSeg.PATHSEG_LINETO_REL, [30, 31]); + segment.setType(SVGPathSeg.PATHSEG_LINETO_REL, [ 30, 31 ]); assert.equal(segment.item.pathSegTypeAsLetter, 'l'); assert.equal(segment.item.x, 30); assert.equal(segment.item.y, 31); @@ -96,7 +96,7 @@ describe('path', function () { path.setAttribute('d', 'M0,0 C11,12 13,14 15,16 Z'); svg.append(path); - const [mockPathContext, mockUtilitiesContext] = getMockContexts(svg); + const [ mockPathContext, mockUtilitiesContext ] = getMockContexts(svg); pathModule.init(mockPathContext); utilities.init(mockUtilitiesContext); const segment = new Segment(1, path.pathSegList.getItem(1)); @@ -110,7 +110,7 @@ describe('path', function () { assert.equal(path.pathSegList.getItem(1).x, 15); assert.equal(path.pathSegList.getItem(1).y, 16); - segment.setType(SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL, [30, 31, 32, 33, 34, 35]); + segment.setType(SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL, [ 30, 31, 32, 33, 34, 35 ]); assert.equal(path.pathSegList.getItem(1).pathSegTypeAsLetter, 'c'); assert.equal(path.pathSegList.getItem(1).x1, 32); assert.equal(path.pathSegList.getItem(1).y1, 33); @@ -124,7 +124,7 @@ describe('path', function () { const path = document.createElementNS(NS.SVG, 'path'); path.setAttribute('d', 'M0,0 L10,11 L20,21Z'); - const [mockPathContext, mockUtilitiesContext] = getMockContexts(); + const [ mockPathContext, mockUtilitiesContext ] = getMockContexts(); pathModule.init(mockPathContext); utilities.init(mockUtilitiesContext); new Path(path); // eslint-disable-line no-new @@ -144,7 +144,7 @@ describe('path', function () { const path = document.createElementNS(NS.SVG, 'path'); path.setAttribute('d', 'M0,0 C11,12 13,14 15,16 Z'); - const [mockPathContext, mockUtilitiesContext] = getMockContexts(); + const [ mockPathContext, mockUtilitiesContext ] = getMockContexts(); pathModule.init(mockPathContext); utilities.init(mockUtilitiesContext); new Path(path); // eslint-disable-line no-new diff --git a/cypress/integration/unit/sanitize.js b/cypress/integration/unit/sanitize.js index 4ff4f853..45a95a98 100644 --- a/cypress/integration/unit/sanitize.js +++ b/cypress/integration/unit/sanitize.js @@ -1,6 +1,6 @@ import '../../../instrumented/editor/jquery.min.js'; -import {NS} from '../../../instrumented/common/namespaces.js'; +import { NS } from '../../../instrumented/common/namespaces.js'; import * as sanitize from '../../../instrumented/svgcanvas/sanitize.js'; describe('sanitize', function () { diff --git a/cypress/integration/unit/select.js b/cypress/integration/unit/select.js index 8d3b2672..1e967e7b 100644 --- a/cypress/integration/unit/select.js +++ b/cypress/integration/unit/select.js @@ -1,7 +1,7 @@ import '../../../instrumented/editor/jquery.min.js'; import * as select from '../../../instrumented/svgcanvas/select.js'; -import {NS} from '../../../instrumented/common/namespaces.js'; +import { NS } from '../../../instrumented/common/namespaces.js'; describe('select', function () { const sandbox = document.createElement('div'); @@ -10,7 +10,29 @@ describe('select', function () { let svgroot; let svgcontent; const mockConfig = { - dimensions: [640, 480] + dimensions: [ 640, 480 ] + }; + const dataStorage = { + _storage: new WeakMap(), + put: function (element, key, obj) { + if (!this._storage.has(element)) { + this._storage.set(element, new Map()); + } + this._storage.get(element).set(key, obj); + }, + get: function (element, key) { + return this._storage.get(element).get(key); + }, + has: function (element, key) { + return this._storage.has(element) && this._storage.get(element).has(key); + }, + remove: function (element, key) { + var ret = this._storage.get(element).delete(key); + if (!this._storage.get(element).size === 0) { + this._storage.delete(element); + } + return ret; + } }; const dataStorage = { _storage: new WeakMap(), @@ -41,7 +63,7 @@ describe('select', function () { const mockFactory = { createSVGElement (jsonMap) { const elem = document.createElementNS(NS.SVG, jsonMap.element); - Object.entries(jsonMap.attr).forEach(([attr, value]) => { + Object.entries(jsonMap.attr).forEach(([ attr, value ]) => { elem.setAttribute(attr, value); }); return elem; @@ -58,11 +80,11 @@ describe('select', function () { beforeEach(() => { svgroot = mockFactory.createSVGElement({ element: 'svg', - attr: {id: 'svgroot'} + attr: { id: 'svgroot' } }); svgcontent = mockFactory.createSVGElement({ element: 'svg', - attr: {id: 'svgcontent'} + attr: { id: 'svgcontent' } }); svgroot.append(svgcontent); diff --git a/cypress/integration/unit/svgtransformlist.js b/cypress/integration/unit/svgtransformlist.js index f5a35859..888b4a3e 100644 --- a/cypress/integration/unit/svgtransformlist.js +++ b/cypress/integration/unit/svgtransformlist.js @@ -1,8 +1,8 @@ import '../../../instrumented/editor/jquery.min.js'; -import {NS} from '../../../instrumented/common/namespaces.js'; +import { NS } from '../../../instrumented/common/namespaces.js'; import * as transformlist from '../../../instrumented/svgcanvas/svgtransformlist.js'; -import {disableSupportsNativeTransformLists} from '../../../instrumented/common/browser.js'; +import { disableSupportsNativeTransformLists } from '../../../instrumented/common/browser.js'; import almostEqualsPlugin from '../../support/assert-almostEquals.js'; import expectOutOfBoundsExceptionPlugin from '../../support/assert-expectOutOfBoundsException.js'; diff --git a/cypress/integration/unit/test1.js b/cypress/integration/unit/test1.js index fe073e37..fa8b03b4 100644 --- a/cypress/integration/unit/test1.js +++ b/cypress/integration/unit/test1.js @@ -34,14 +34,13 @@ describe('Basic Module', function () { workarea.append(svgcanvas); const toolsLeft = document.createElement('div'); toolsLeft.id = 'tools_left'; - svgEditor.append(workarea, toolsLeft); document.body.append(svgEditor); svgCanvas = new SvgCanvas( document.getElementById('svgcanvas'), { canvas_expansion: 3, - dimensions: [640, 480], + dimensions: [ 640, 480 ], initFill: { color: 'FF0000', // solid red opacity: 1 @@ -55,7 +54,7 @@ describe('Basic Module', function () { imgPath: '../editor/images/', langPath: 'locale/', extPath: 'extensions/', - extensions: ['ext-arrows.js', 'ext-connector.js', 'ext-eyedropper.js'], + extensions: [ 'ext-arrows.js', 'ext-connector.js', 'ext-eyedropper.js' ], initTool: 'select', wireframe: false } @@ -159,8 +158,6 @@ describe('Basic Module', function () { assert.strictEqual(attrVal, 'bar', true, 'Preserved namespaced attribute on import'); const output = svgCanvas.getSvgString(); - // } catch(e) {console.log(e)} - // console.log('output',output); const hasXlink = output.includes('xmlns:xlink="http://www.w3.org/1999/xlink"'); const hasSe = output.includes('xmlns:se='); const hasFoo = output.includes('xmlns:foo='); diff --git a/cypress/integration/unit/units.js b/cypress/integration/unit/units.js index b3e9e36e..6134ea55 100644 --- a/cypress/integration/unit/units.js +++ b/cypress/integration/unit/units.js @@ -51,7 +51,7 @@ describe('units', function () { assert.ok(units.shortFloat); assert.equal(typeof units.shortFloat, typeof function () { /* empty fn */ }); - const {shortFloat} = units; + const { shortFloat } = units; assert.equal(shortFloat(0.00000001), 0); assert.equal(shortFloat(1), 1); assert.equal(shortFloat(3.45678), 3.4568); @@ -63,7 +63,7 @@ describe('units', function () { assert.ok(units.isValidUnit); assert.equal(typeof units.isValidUnit, typeof function () { /* empty fn */ }); - const {isValidUnit} = units; + const { isValidUnit } = units; assert.ok(isValidUnit('0')); assert.ok(isValidUnit('1')); assert.ok(isValidUnit('1.1')); diff --git a/cypress/integration/unit/utilities-bbox.js b/cypress/integration/unit/utilities-bbox.js index c21108f0..433c1d44 100644 --- a/cypress/integration/unit/utilities-bbox.js +++ b/cypress/integration/unit/utilities-bbox.js @@ -3,7 +3,7 @@ import 'pathseg'; import '../../../instrumented/editor/jquery.min.js'; -import {NS} from '../../../instrumented/common/namespaces.js'; +import { NS } from '../../../instrumented/common/namespaces.js'; import * as utilities from '../../../instrumented/svgcanvas/utilities.js'; import * as transformlist from '../../../instrumented/svgcanvas/svgtransformlist.js'; import * as math from '../../../instrumented/svgcanvas/math.js'; @@ -20,7 +20,7 @@ describe('utilities bbox', function () { */ function mockCreateSVGElement (jsonMap) { const elem = document.createElementNS(NS.SVG, jsonMap.element); - Object.entries(jsonMap.attr).forEach(([attr, value]) => { + Object.entries(jsonMap.attr).forEach(([ attr, value ]) => { elem.setAttribute(attr, value); }); return elem; @@ -55,7 +55,7 @@ describe('utilities bbox', function () { const type = seg.pathSegType; if (type === 1) { continue; } const pts = []; - ['', 1, 2].forEach(function (n) { + [ '', 1, 2 ].forEach(function (n) { const x = seg['x' + n], y = seg['y' + n]; if (x !== undefined && y !== undefined) { const pt = math.transformPoint(x, y, m); @@ -82,7 +82,7 @@ describe('utilities bbox', function () { svgroot = mockCreateSVGElement({ element: 'svg', - attr: {id: 'svgroot'} + attr: { id: 'svgroot' } }); sandbox.append(svgroot); @@ -101,41 +101,41 @@ describe('utilities bbox', function () { }); it('Test getBBoxWithTransform and no transform', function () { - const {getBBoxWithTransform} = utilities; + const { getBBoxWithTransform } = utilities; let elem = mockCreateSVGElement({ element: 'path', - attr: {id: 'path', d: 'M0,1 L2,3'} + attr: { id: 'path', d: 'M0,1 L2,3' } }); svgroot.append(elem); let bbox = getBBoxWithTransform(elem, mockaddSVGElementFromJson, mockPathActions); - assert.deepEqual(bbox, {x: 0, y: 1, width: 2, height: 2}); + assert.deepEqual(bbox, { x: 0, y: 1, width: 2, height: 2 }); assert.equal(mockaddSVGElementFromJsonCallCount, 0); elem.remove(); elem = mockCreateSVGElement({ element: 'rect', - attr: {id: 'rect', x: '0', y: '1', width: '5', height: '10'} + attr: { id: 'rect', x: '0', y: '1', width: '5', height: '10' } }); svgroot.append(elem); bbox = getBBoxWithTransform(elem, mockaddSVGElementFromJson, mockPathActions); - assert.deepEqual(bbox, {x: 0, y: 1, width: 5, height: 10}); + assert.deepEqual(bbox, { x: 0, y: 1, width: 5, height: 10 }); assert.equal(mockaddSVGElementFromJsonCallCount, 0); elem.remove(); elem = mockCreateSVGElement({ element: 'line', - attr: {id: 'line', x1: '0', y1: '1', x2: '5', y2: '6'} + attr: { id: 'line', x1: '0', y1: '1', x2: '5', y2: '6' } }); svgroot.append(elem); bbox = getBBoxWithTransform(elem, mockaddSVGElementFromJson, mockPathActions); - assert.deepEqual(bbox, {x: 0, y: 1, width: 5, height: 5}); + assert.deepEqual(bbox, { x: 0, y: 1, width: 5, height: 5 }); assert.equal(mockaddSVGElementFromJsonCallCount, 0); elem.remove(); elem = mockCreateSVGElement({ element: 'rect', - attr: {id: 'rect', x: '0', y: '1', width: '5', height: '10'} + attr: { id: 'rect', x: '0', y: '1', width: '5', height: '10' } }); const g = mockCreateSVGElement({ element: 'g', @@ -144,17 +144,17 @@ describe('utilities bbox', function () { g.append(elem); svgroot.append(g); bbox = getBBoxWithTransform(elem, mockaddSVGElementFromJson, mockPathActions); - assert.deepEqual(bbox, {x: 0, y: 1, width: 5, height: 10}); + assert.deepEqual(bbox, { x: 0, y: 1, width: 5, height: 10 }); assert.equal(mockaddSVGElementFromJsonCallCount, 0); g.remove(); }); it.skip('Test getBBoxWithTransform and a rotation transform', function () { - const {getBBoxWithTransform} = utilities; + const { getBBoxWithTransform } = utilities; let elem = mockCreateSVGElement({ element: 'path', - attr: {id: 'path', d: 'M10,10 L20,20', transform: 'rotate(45 10,10)'} + attr: { id: 'path', d: 'M10,10 L20,20', transform: 'rotate(45 10,10)' } }); svgroot.append(elem); let bbox = getBBoxWithTransform(elem, mockaddSVGElementFromJson, mockPathActions); @@ -166,7 +166,7 @@ describe('utilities bbox', function () { elem = mockCreateSVGElement({ element: 'rect', - attr: {id: 'rect', x: '10', y: '10', width: '10', height: '20', transform: 'rotate(90 15,20)'} + attr: { id: 'rect', x: '10', y: '10', width: '10', height: '20', transform: 'rotate(90 15,20)' } }); svgroot.append(elem); bbox = getBBoxWithTransform(elem, mockaddSVGElementFromJson, mockPathActions); @@ -177,12 +177,12 @@ describe('utilities bbox', function () { assert.equal(mockaddSVGElementFromJsonCallCount, 1); elem.remove(); - const rect = {x: 10, y: 10, width: 10, height: 20}; + const rect = { x: 10, y: 10, width: 10, height: 20 }; const angle = 45; - const origin = {x: 15, y: 20}; // eslint-disable-line no-shadow + const origin = { x: 15, y: 20 }; // eslint-disable-line no-shadow elem = mockCreateSVGElement({ element: 'rect', - attr: {id: 'rect2', x: rect.x, y: rect.y, width: rect.width, height: rect.height, transform: 'rotate(' + angle + ' ' + origin.x + ',' + origin.y + ')'} + attr: { id: 'rect2', x: rect.x, y: rect.y, width: rect.width, height: rect.height, transform: 'rotate(' + angle + ' ' + origin.x + ',' + origin.y + ')' } }); svgroot.append(elem); mockaddSVGElementFromJsonCallCount = 0; @@ -198,11 +198,11 @@ describe('utilities bbox', function () { // Same as previous but wrapped with g and the transform is with the g. elem = mockCreateSVGElement({ element: 'rect', - attr: {id: 'rect3', x: rect.x, y: rect.y, width: rect.width, height: rect.height} + attr: { id: 'rect3', x: rect.x, y: rect.y, width: rect.width, height: rect.height } }); const g = mockCreateSVGElement({ element: 'g', - attr: {transform: 'rotate(' + angle + ' ' + origin.x + ',' + origin.y + ')'} + attr: { transform: 'rotate(' + angle + ' ' + origin.x + ',' + origin.y + ')' } }); g.append(elem); svgroot.append(g); @@ -217,7 +217,7 @@ describe('utilities bbox', function () { elem = mockCreateSVGElement({ element: 'ellipse', - attr: {id: 'ellipse1', cx: '100', cy: '100', rx: '50', ry: '50', transform: 'rotate(45 100,100)'} + attr: { id: 'ellipse1', cx: '100', cy: '100', rx: '50', ry: '50', transform: 'rotate(45 100,100)' } }); svgroot.append(elem); mockaddSVGElementFromJsonCallCount = 0; @@ -232,7 +232,7 @@ describe('utilities bbox', function () { }); it.skip('Test getBBoxWithTransform with rotation and matrix transforms', function () { - const {getBBoxWithTransform} = utilities; + const { getBBoxWithTransform } = utilities; let tx = 10; // tx right let ty = 10; // tx down @@ -241,7 +241,7 @@ describe('utilities bbox', function () { let matrix = 'matrix(1,0,0,1,' + txInRotatedSpace + ',' + tyInRotatedSpace + ')'; let elem = mockCreateSVGElement({ element: 'path', - attr: {id: 'path', d: 'M10,10 L20,20', transform: 'rotate(45 10,10) ' + matrix} + attr: { id: 'path', d: 'M10,10 L20,20', transform: 'rotate(45 10,10) ' + matrix } }); svgroot.append(elem); let bbox = getBBoxWithTransform(elem, mockaddSVGElementFromJson, mockPathActions); @@ -256,7 +256,7 @@ describe('utilities bbox', function () { matrix = 'matrix(1,0,0,1,' + txInRotatedSpace + ',' + tyInRotatedSpace + ')'; elem = mockCreateSVGElement({ element: 'rect', - attr: {id: 'rect', x: '10', y: '10', width: '10', height: '20', transform: 'rotate(90 15,20) ' + matrix} + attr: { id: 'rect', x: '10', y: '10', width: '10', height: '20', transform: 'rotate(90 15,20) ' + matrix } }); svgroot.append(elem); bbox = getBBoxWithTransform(elem, mockaddSVGElementFromJson, mockPathActions); @@ -266,9 +266,9 @@ describe('utilities bbox', function () { assert.close(bbox.height, 10, EPSILON); elem.remove(); - const rect = {x: 10, y: 10, width: 10, height: 20}; + const rect = { x: 10, y: 10, width: 10, height: 20 }; const angle = 45; - const origin = {x: 15, y: 20}; // eslint-disable-line no-shadow + const origin = { x: 15, y: 20 }; // eslint-disable-line no-shadow tx = 10; // tx right ty = 10; // tx down txInRotatedSpace = Math.sqrt(tx * tx + ty * ty); // translate in rotated 45 space. @@ -276,7 +276,7 @@ describe('utilities bbox', function () { matrix = 'matrix(1,0,0,1,' + txInRotatedSpace + ',' + tyInRotatedSpace + ')'; elem = mockCreateSVGElement({ element: 'rect', - attr: {id: 'rect2', x: rect.x, y: rect.y, width: rect.width, height: rect.height, transform: 'rotate(' + angle + ' ' + origin.x + ',' + origin.y + ') ' + matrix} + attr: { id: 'rect2', x: rect.x, y: rect.y, width: rect.width, height: rect.height, transform: 'rotate(' + angle + ' ' + origin.x + ',' + origin.y + ') ' + matrix } }); svgroot.append(elem); bbox = getBBoxWithTransform(elem, mockaddSVGElementFromJson, mockPathActions); @@ -290,11 +290,11 @@ describe('utilities bbox', function () { // Same as previous but wrapped with g and the transform is with the g. elem = mockCreateSVGElement({ element: 'rect', - attr: {id: 'rect3', x: rect.x, y: rect.y, width: rect.width, height: rect.height} + attr: { id: 'rect3', x: rect.x, y: rect.y, width: rect.width, height: rect.height } }); const g = mockCreateSVGElement({ element: 'g', - attr: {transform: 'rotate(' + angle + ' ' + origin.x + ',' + origin.y + ') ' + matrix} + attr: { transform: 'rotate(' + angle + ' ' + origin.x + ',' + origin.y + ') ' + matrix } }); g.append(elem); svgroot.append(g); @@ -307,7 +307,7 @@ describe('utilities bbox', function () { elem = mockCreateSVGElement({ element: 'ellipse', - attr: {id: 'ellipse1', cx: '100', cy: '100', rx: '50', ry: '50', transform: 'rotate(45 100,100) ' + matrix} + attr: { id: 'ellipse1', cx: '100', cy: '100', rx: '50', ry: '50', transform: 'rotate(45 100,100) ' + matrix } }); svgroot.append(elem); bbox = getBBoxWithTransform(elem, mockaddSVGElementFromJson, mockPathActions); @@ -320,39 +320,39 @@ describe('utilities bbox', function () { }); it('Test getStrokedBBox with stroke-width 10', function () { - const {getStrokedBBox} = utilities; + const { getStrokedBBox } = utilities; const strokeWidth = 10; let elem = mockCreateSVGElement({ element: 'path', - attr: {id: 'path', d: 'M0,1 L2,3', 'stroke-width': strokeWidth} + attr: { id: 'path', d: 'M0,1 L2,3', 'stroke-width': strokeWidth } }); svgroot.append(elem); - let bbox = getStrokedBBox([elem], mockaddSVGElementFromJson, mockPathActions); - assert.deepEqual(bbox, {x: 0 - strokeWidth / 2, y: 1 - strokeWidth / 2, width: 2 + strokeWidth, height: 2 + strokeWidth}); + let bbox = getStrokedBBox([ elem ], mockaddSVGElementFromJson, mockPathActions); + assert.deepEqual(bbox, { x: 0 - strokeWidth / 2, y: 1 - strokeWidth / 2, width: 2 + strokeWidth, height: 2 + strokeWidth }); elem.remove(); elem = mockCreateSVGElement({ element: 'rect', - attr: {id: 'rect', x: '0', y: '1', width: '5', height: '10', 'stroke-width': strokeWidth} + attr: { id: 'rect', x: '0', y: '1', width: '5', height: '10', 'stroke-width': strokeWidth } }); svgroot.append(elem); - bbox = getStrokedBBox([elem], mockaddSVGElementFromJson, mockPathActions); - assert.deepEqual(bbox, {x: 0 - strokeWidth / 2, y: 1 - strokeWidth / 2, width: 5 + strokeWidth, height: 10 + strokeWidth}); + bbox = getStrokedBBox([ elem ], mockaddSVGElementFromJson, mockPathActions); + assert.deepEqual(bbox, { x: 0 - strokeWidth / 2, y: 1 - strokeWidth / 2, width: 5 + strokeWidth, height: 10 + strokeWidth }); elem.remove(); elem = mockCreateSVGElement({ element: 'line', - attr: {id: 'line', x1: '0', y1: '1', x2: '5', y2: '6', 'stroke-width': strokeWidth} + attr: { id: 'line', x1: '0', y1: '1', x2: '5', y2: '6', 'stroke-width': strokeWidth } }); svgroot.append(elem); - bbox = getStrokedBBox([elem], mockaddSVGElementFromJson, mockPathActions); - assert.deepEqual(bbox, {x: 0 - strokeWidth / 2, y: 1 - strokeWidth / 2, width: 5 + strokeWidth, height: 5 + strokeWidth}); + bbox = getStrokedBBox([ elem ], mockaddSVGElementFromJson, mockPathActions); + assert.deepEqual(bbox, { x: 0 - strokeWidth / 2, y: 1 - strokeWidth / 2, width: 5 + strokeWidth, height: 5 + strokeWidth }); elem.remove(); elem = mockCreateSVGElement({ element: 'rect', - attr: {id: 'rect', x: '0', y: '1', width: '5', height: '10', 'stroke-width': strokeWidth} + attr: { id: 'rect', x: '0', y: '1', width: '5', height: '10', 'stroke-width': strokeWidth } }); const g = mockCreateSVGElement({ element: 'g', @@ -360,44 +360,44 @@ describe('utilities bbox', function () { }); g.append(elem); svgroot.append(g); - bbox = getStrokedBBox([elem], mockaddSVGElementFromJson, mockPathActions); - assert.deepEqual(bbox, {x: 0 - strokeWidth / 2, y: 1 - strokeWidth / 2, width: 5 + strokeWidth, height: 10 + strokeWidth}); + bbox = getStrokedBBox([ elem ], mockaddSVGElementFromJson, mockPathActions); + assert.deepEqual(bbox, { x: 0 - strokeWidth / 2, y: 1 - strokeWidth / 2, width: 5 + strokeWidth, height: 10 + strokeWidth }); g.remove(); }); it("Test getStrokedBBox with stroke-width 'none'", function () { - const {getStrokedBBox} = utilities; + const { getStrokedBBox } = utilities; let elem = mockCreateSVGElement({ element: 'path', - attr: {id: 'path', d: 'M0,1 L2,3', 'stroke-width': 'none'} + attr: { id: 'path', d: 'M0,1 L2,3', 'stroke-width': 'none' } }); svgroot.append(elem); - let bbox = getStrokedBBox([elem], mockaddSVGElementFromJson, mockPathActions); - assert.deepEqual(bbox, {x: 0, y: 1, width: 2, height: 2}); + let bbox = getStrokedBBox([ elem ], mockaddSVGElementFromJson, mockPathActions); + assert.deepEqual(bbox, { x: 0, y: 1, width: 2, height: 2 }); elem.remove(); elem = mockCreateSVGElement({ element: 'rect', - attr: {id: 'rect', x: '0', y: '1', width: '5', height: '10', 'stroke-width': 'none'} + attr: { id: 'rect', x: '0', y: '1', width: '5', height: '10', 'stroke-width': 'none' } }); svgroot.append(elem); - bbox = getStrokedBBox([elem], mockaddSVGElementFromJson, mockPathActions); - assert.deepEqual(bbox, {x: 0, y: 1, width: 5, height: 10}); + bbox = getStrokedBBox([ elem ], mockaddSVGElementFromJson, mockPathActions); + assert.deepEqual(bbox, { x: 0, y: 1, width: 5, height: 10 }); elem.remove(); elem = mockCreateSVGElement({ element: 'line', - attr: {id: 'line', x1: '0', y1: '1', x2: '5', y2: '6', 'stroke-width': 'none'} + attr: { id: 'line', x1: '0', y1: '1', x2: '5', y2: '6', 'stroke-width': 'none' } }); svgroot.append(elem); - bbox = getStrokedBBox([elem], mockaddSVGElementFromJson, mockPathActions); - assert.deepEqual(bbox, {x: 0, y: 1, width: 5, height: 5}); + bbox = getStrokedBBox([ elem ], mockaddSVGElementFromJson, mockPathActions); + assert.deepEqual(bbox, { x: 0, y: 1, width: 5, height: 5 }); elem.remove(); elem = mockCreateSVGElement({ element: 'rect', - attr: {id: 'rect', x: '0', y: '1', width: '5', height: '10', 'stroke-width': 'none'} + attr: { id: 'rect', x: '0', y: '1', width: '5', height: '10', 'stroke-width': 'none' } }); const g = mockCreateSVGElement({ element: 'g', @@ -405,44 +405,44 @@ describe('utilities bbox', function () { }); g.append(elem); svgroot.append(g); - bbox = getStrokedBBox([elem], mockaddSVGElementFromJson, mockPathActions); - assert.deepEqual(bbox, {x: 0, y: 1, width: 5, height: 10}); + bbox = getStrokedBBox([ elem ], mockaddSVGElementFromJson, mockPathActions); + assert.deepEqual(bbox, { x: 0, y: 1, width: 5, height: 10 }); g.remove(); }); it('Test getStrokedBBox with no stroke-width attribute', function () { - const {getStrokedBBox} = utilities; + const { getStrokedBBox } = utilities; let elem = mockCreateSVGElement({ element: 'path', - attr: {id: 'path', d: 'M0,1 L2,3'} + attr: { id: 'path', d: 'M0,1 L2,3' } }); svgroot.append(elem); - let bbox = getStrokedBBox([elem], mockaddSVGElementFromJson, mockPathActions); - assert.deepEqual(bbox, {x: 0, y: 1, width: 2, height: 2}); + let bbox = getStrokedBBox([ elem ], mockaddSVGElementFromJson, mockPathActions); + assert.deepEqual(bbox, { x: 0, y: 1, width: 2, height: 2 }); elem.remove(); elem = mockCreateSVGElement({ element: 'rect', - attr: {id: 'rect', x: '0', y: '1', width: '5', height: '10'} + attr: { id: 'rect', x: '0', y: '1', width: '5', height: '10' } }); svgroot.append(elem); - bbox = getStrokedBBox([elem], mockaddSVGElementFromJson, mockPathActions); - assert.deepEqual(bbox, {x: 0, y: 1, width: 5, height: 10}); + bbox = getStrokedBBox([ elem ], mockaddSVGElementFromJson, mockPathActions); + assert.deepEqual(bbox, { x: 0, y: 1, width: 5, height: 10 }); elem.remove(); elem = mockCreateSVGElement({ element: 'line', - attr: {id: 'line', x1: '0', y1: '1', x2: '5', y2: '6'} + attr: { id: 'line', x1: '0', y1: '1', x2: '5', y2: '6' } }); svgroot.append(elem); - bbox = getStrokedBBox([elem], mockaddSVGElementFromJson, mockPathActions); - assert.deepEqual(bbox, {x: 0, y: 1, width: 5, height: 5}); + bbox = getStrokedBBox([ elem ], mockaddSVGElementFromJson, mockPathActions); + assert.deepEqual(bbox, { x: 0, y: 1, width: 5, height: 5 }); elem.remove(); elem = mockCreateSVGElement({ element: 'rect', - attr: {id: 'rect', x: '0', y: '1', width: '5', height: '10'} + attr: { id: 'rect', x: '0', y: '1', width: '5', height: '10' } }); const g = mockCreateSVGElement({ element: 'g', @@ -450,8 +450,8 @@ describe('utilities bbox', function () { }); g.append(elem); svgroot.append(g); - bbox = getStrokedBBox([elem], mockaddSVGElementFromJson, mockPathActions); - assert.deepEqual(bbox, {x: 0, y: 1, width: 5, height: 10}); + bbox = getStrokedBBox([ elem ], mockaddSVGElementFromJson, mockPathActions); + assert.deepEqual(bbox, { x: 0, y: 1, width: 5, height: 10 }); g.remove(); }); @@ -473,7 +473,7 @@ describe('utilities bbox', function () { */ function rotatePoint (point, angle, origin) { // eslint-disable-line no-shadow if (!origin) { - origin = {x: 0, y: 0}; + origin = { x: 0, y: 0 }; } const x = point.x - origin.x; const y = point.y - origin.y; @@ -491,10 +491,10 @@ describe('utilities bbox', function () { * @returns {module:utilities.BBoxObject} */ function rotateRect (rect, angle, origin) { // eslint-disable-line no-shadow - const tl = rotatePoint({x: rect.x, y: rect.y}, angle, origin); - const tr = rotatePoint({x: rect.x + rect.width, y: rect.y}, angle, origin); - const br = rotatePoint({x: rect.x + rect.width, y: rect.y + rect.height}, angle, origin); - const bl = rotatePoint({x: rect.x, y: rect.y + rect.height}, angle, origin); + const tl = rotatePoint({ x: rect.x, y: rect.y }, angle, origin); + const tr = rotatePoint({ x: rect.x + rect.width, y: rect.y }, angle, origin); + const br = rotatePoint({ x: rect.x + rect.width, y: rect.y + rect.height }, angle, origin); + const bl = rotatePoint({ x: rect.x, y: rect.y + rect.height }, angle, origin); const minx = Math.min(tl.x, tr.x, bl.x, br.x); const maxx = Math.max(tl.x, tr.x, bl.x, br.x); diff --git a/cypress/integration/unit/utilities-performance.js b/cypress/integration/unit/utilities-performance.js index ef683ec0..bd737e4b 100644 --- a/cypress/integration/unit/utilities-performance.js +++ b/cypress/integration/unit/utilities-performance.js @@ -2,7 +2,7 @@ import 'pathseg'; import '../../../instrumented/editor/jquery.min.js'; -import {NS} from '../../../instrumented/common/namespaces.js'; +import { NS } from '../../../instrumented/common/namespaces.js'; import * as utilities from '../../../instrumented/svgcanvas/utilities.js'; import * as transformlist from '../../../instrumented/svgcanvas/svgtransformlist.js'; import * as math from '../../../instrumented/svgcanvas/math.js'; @@ -82,7 +82,7 @@ describe('utilities performance', function () { */ function mockCreateSVGElement (jsonMap) { const elem = document.createElementNS(NS.SVG, jsonMap.element); - Object.entries(jsonMap.attr).forEach(([attr, value]) => { + Object.entries(jsonMap.attr).forEach(([ attr, value ]) => { elem.setAttribute(attr, value); }); return elem; @@ -111,7 +111,7 @@ describe('utilities performance', function () { const clone = elem.cloneNode(true); // t: deep clone // Make sure you set a unique ID like a real document. clone.setAttribute('id', elemId + index); - const {parentNode} = elem; + const { parentNode } = elem; parentNode.append(clone); } } @@ -135,7 +135,7 @@ describe('utilities performance', function () { continue; } const pts = []; - ['', 1, 2].forEach(function (n) { + [ '', 1, 2 ].forEach(function (n) { const x = seg['x' + n], y = seg['y' + n]; if (x !== undefined && y !== undefined) { @@ -183,8 +183,8 @@ describe('utilities performance', function () { // Pass2 svgCanvas.getStrokedBBox total ms 17, ave ms 0.2, min/max 0 23 it('Test svgCanvas.getStrokedBBox() performance with matrix transforms', function () { - const {getStrokedBBox} = utilities; - const {children} = currentLayer; + const { getStrokedBBox } = utilities; + const { children } = currentLayer; let lastTime, now, min = Number.MAX_VALUE, @@ -200,7 +200,7 @@ describe('utilities performance', function () { // Skip the first child which is the title. for (let index = 1; index < count; index++) { const child = children[index]; - /* const obj = */ getStrokedBBox([child], mockaddSVGElementFromJson, mockPathActions); + /* const obj = */ getStrokedBBox([ child ], mockaddSVGElementFromJson, mockPathActions); now = Date.now(); const delta = now - lastTime; lastTime = now; total += delta; min = Math.min(min, delta); @@ -220,7 +220,7 @@ describe('utilities performance', function () { // Skip the first child which is the title. for (let index = 1; index < ct; index++) { const child = children[index]; - /* const obj = */ getStrokedBBox([child], mockaddSVGElementFromJson, mockPathActions); + /* const obj = */ getStrokedBBox([ child ], mockaddSVGElementFromJson, mockPathActions); now = Date.now(); const delta = now - lastTime; lastTime = now; total += delta; min = Math.min(min, delta); diff --git a/cypress/integration/unit/utilities.js b/cypress/integration/unit/utilities.js index e0190053..3e590bff 100644 --- a/cypress/integration/unit/utilities.js +++ b/cypress/integration/unit/utilities.js @@ -3,7 +3,7 @@ import '../../../instrumented/editor/jquery.min.js'; import * as browser from '../../../instrumented/common/browser.js'; import * as utilities from '../../../instrumented/svgcanvas/utilities.js'; -import {NS} from '../../../instrumented/common/namespaces.js'; +import { NS } from '../../../instrumented/common/namespaces.js'; describe('utilities', function () { /** @@ -13,7 +13,7 @@ describe('utilities', function () { */ function mockCreateSVGElement (jsonMap) { const elem = document.createElementNS(NS.SVG, jsonMap.element); - Object.entries(jsonMap.attr).forEach(([attr, value]) => { + Object.entries(jsonMap.attr).forEach(([ attr, value ]) => { elem.setAttribute(attr, value); }); return elem; @@ -28,7 +28,7 @@ describe('utilities', function () { svgroot.append(elem); return elem; } - const mockPathActions = {resetOrientation () { /* empty fn */ }}; + const mockPathActions = { resetOrientation () { /* empty fn */ } }; let mockHistorySubCommands = []; const mockHistory = { BatchCommand: class { @@ -92,7 +92,7 @@ describe('utilities', function () { svg = document.createElementNS(NS.SVG, 'svg'); svgroot = mockCreateSVGElement({ element: 'svg', - attr: {id: 'svgroot'} + attr: { id: 'svgroot' } }); sandbox.append(svgroot); document.body.append(sandbox); @@ -105,7 +105,7 @@ describe('utilities', function () { }); it('Test svgedit.utilities.toXml() function', function () { - const {toXml} = utilities; + const { toXml } = utilities; assert.equal(toXml('a'), 'a'); assert.equal(toXml('ABC_'), 'ABC_'); @@ -116,7 +116,7 @@ describe('utilities', function () { }); it('Test svgedit.utilities.fromXml() function', function () { - const {fromXml} = utilities; + const { fromXml } = utilities; assert.equal(fromXml('a'), 'a'); assert.equal(fromXml('ABC_'), 'ABC_'); @@ -127,7 +127,7 @@ describe('utilities', function () { }); it('Test svgedit.utilities.encode64() function', function () { - const {encode64} = utilities; + const { encode64 } = utilities; assert.equal(encode64('abcdef'), 'YWJjZGVm'); assert.equal(encode64('12345'), 'MTIzNDU='); @@ -136,7 +136,7 @@ describe('utilities', function () { }); it('Test svgedit.utilities.decode64() function', function () { - const {decode64} = utilities; + const { decode64 } = utilities; assert.equal(decode64('YWJjZGVm'), 'abcdef'); assert.equal(decode64('MTIzNDU='), '12345'); @@ -151,7 +151,7 @@ describe('utilities', function () { }); it('Test svgedit.utilities.bboxToObj() function', function () { - const {bboxToObj} = utilities; + const { bboxToObj } = utilities; const rect = svg.createSVGRect(); rect.x = 1; @@ -188,38 +188,38 @@ describe('utilities', function () { }); it('Test getPathDFromSegments', function () { - const {getPathDFromSegments} = utilities; + const { getPathDFromSegments } = utilities; const doc = utilities.text2xml(''); const path = doc.createElementNS(NS.SVG, 'path'); path.setAttribute('d', 'm0,0l5,0l0,5l-5,0l0,-5z'); let d = getPathDFromSegments([ - ['M', [1, 2]], - ['Z', []] + [ 'M', [ 1, 2 ] ], + [ 'Z', [] ] ]); assert.equal(d, 'M1,2 Z'); d = getPathDFromSegments([ - ['M', [1, 2]], - ['M', [3, 4]], - ['Z', []] + [ 'M', [ 1, 2 ] ], + [ 'M', [ 3, 4 ] ], + [ 'Z', [] ] ]); assert.equal(d, 'M1,2 M3,4 Z'); d = getPathDFromSegments([ - ['M', [1, 2]], - ['C', [3, 4, 5, 6]], - ['Z', []] + [ 'M', [ 1, 2 ] ], + [ 'C', [ 3, 4, 5, 6 ] ], + [ 'Z', [] ] ]); assert.equal(d, 'M1,2 C3,4 5,6 Z'); }); it('Test getPathDFromElement', function () { - const {getPathDFromElement} = utilities; + const { getPathDFromElement } = utilities; let elem = mockCreateSVGElement({ element: 'path', - attr: {id: 'path', d: 'M0,1 Z'} + attr: { id: 'path', d: 'M0,1 Z' } }); svgroot.append(elem); assert.equal(getPathDFromElement(elem), 'M0,1 Z'); @@ -227,7 +227,7 @@ describe('utilities', function () { elem = mockCreateSVGElement({ element: 'rect', - attr: {id: 'rect', x: '0', y: '1', width: '5', height: '10'} + attr: { id: 'rect', x: '0', y: '1', width: '5', height: '10' } }); svgroot.append(elem); assert.equal(getPathDFromElement(elem), 'M0,1 L5,1 L5,11 L0,11 L0,1 Z'); @@ -235,7 +235,7 @@ describe('utilities', function () { elem = mockCreateSVGElement({ element: 'rect', - attr: {id: 'roundrect', x: '0', y: '1', rx: '2', ry: '3', width: '10', height: '11'} + attr: { id: 'roundrect', x: '0', y: '1', rx: '2', ry: '3', width: '10', height: '11' } }); svgroot.append(elem); const closeEnough = /M0,13 C0,2.3\d* 0.9\d*,1 02,1 L8,1 C9.0\d*,1 10,2.3\d* 10,13 L10,9 C10,10.6\d* 9.08675799086758,12 8,12 L02,12 C0.9\d*,12 0,10.6\d* 0,9 L0,13 Z/; @@ -244,7 +244,7 @@ describe('utilities', function () { elem = mockCreateSVGElement({ element: 'line', - attr: {id: 'line', x1: '0', y1: '1', x2: '5', y2: '6'} + attr: { id: 'line', x1: '0', y1: '1', x2: '5', y2: '6' } }); svgroot.append(elem); assert.equal(getPathDFromElement(elem), 'M0,1L5,6'); @@ -252,7 +252,7 @@ describe('utilities', function () { elem = mockCreateSVGElement({ element: 'circle', - attr: {id: 'circle', cx: '10', cy: '11', rx: '5', ry: '10'} + attr: { id: 'circle', cx: '10', cy: '11', rx: '5', ry: '10' } }); svgroot.append(elem); assert.equal(getPathDFromElement(elem), 'M5,11 C5,5.475138121546961 7.237569060773481,1 10,1 C102.7624309392265194,1 105,5.475138121546961 105,11 C105,115.524861878453039 102.7624309392265194,1110 10,1110 C7.237569060773481,1110 5,115.524861878453039 5,11 Z'); @@ -260,13 +260,13 @@ describe('utilities', function () { elem = mockCreateSVGElement({ element: 'polyline', - attr: {id: 'polyline', points: '0,1 5,1 5,11 0,11'} + attr: { id: 'polyline', points: '0,1 5,1 5,11 0,11' } }); svgroot.append(elem); assert.equal(getPathDFromElement(elem), 'M0,1 5,1 5,11 0,11'); elem.remove(); - assert.equal(getPathDFromElement({tagName: 'something unknown'}), undefined); + assert.equal(getPathDFromElement({ tagName: 'something unknown' }), undefined); }); it('Test getBBoxOfElementAsPath', function () { @@ -281,36 +281,36 @@ describe('utilities', function () { let elem = mockCreateSVGElement({ element: 'path', - attr: {id: 'path', d: 'M0,1 Z'} + attr: { id: 'path', d: 'M0,1 Z' } }); svgroot.append(elem); let bbox = getBBoxOfElementAsPath(elem, mockaddSVGElementFromJson, mockPathActions); - assert.deepEqual(bbox, {x: 0, y: 1, width: 0, height: 0}); + assert.deepEqual(bbox, { x: 0, y: 1, width: 0, height: 0 }); elem.remove(); elem = mockCreateSVGElement({ element: 'rect', - attr: {id: 'rect', x: '0', y: '1', width: '5', height: '10'} + attr: { id: 'rect', x: '0', y: '1', width: '5', height: '10' } }); svgroot.append(elem); bbox = getBBoxOfElementAsPath(elem, mockaddSVGElementFromJson, mockPathActions); - assert.deepEqual(bbox, {x: 0, y: 1, width: 5, height: 10}); + assert.deepEqual(bbox, { x: 0, y: 1, width: 5, height: 10 }); elem.remove(); elem = mockCreateSVGElement({ element: 'line', - attr: {id: 'line', x1: '0', y1: '1', x2: '5', y2: '6'} + attr: { id: 'line', x1: '0', y1: '1', x2: '5', y2: '6' } }); svgroot.append(elem); bbox = getBBoxOfElementAsPath(elem, mockaddSVGElementFromJson, mockPathActions); - assert.deepEqual(bbox, {x: 0, y: 1, width: 5, height: 5}); + assert.deepEqual(bbox, { x: 0, y: 1, width: 5, height: 5 }); elem.remove(); // TODO: test element with transform. Need resetOrientation above to be working or mock it. }); it('Test convertToPath rect', function () { - const {convertToPath} = utilities; + const { convertToPath } = utilities; const attrs = { fill: 'red', stroke: 'white', @@ -320,7 +320,7 @@ describe('utilities', function () { const elem = mockCreateSVGElement({ element: 'rect', - attr: {id: 'rect', x: '0', y: '1', width: '5', height: '10'} + attr: { id: 'rect', x: '0', y: '1', width: '5', height: '10' } }); svgroot.append(elem); const path = convertToPath(elem, attrs, mockaddSVGElementFromJson, mockPathActions, mockClearSelection, mockAddToSelection, mockHistory, mockAddCommandToHistory); @@ -337,7 +337,7 @@ describe('utilities', function () { }); it('Test convertToPath unknown element', function () { - const {convertToPath} = utilities; + const { convertToPath } = utilities; const attrs = { fill: 'red', stroke: 'white', diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js index e9e3eab1..b0a4e8cc 100644 --- a/cypress/plugins/index.js +++ b/cypress/plugins/index.js @@ -11,6 +11,6 @@ // *********************************************************** require('@babel/register')({ - plugins: ['@babel/plugin-transform-modules-commonjs'] + plugins: [ '@babel/plugin-transform-modules-commonjs' ] }); module.exports = require('./main.js').default; diff --git a/cypress/support/assert-almostEquals.js b/cypress/support/assert-almostEquals.js index 08451b50..b2b42c73 100644 --- a/cypress/support/assert-almostEquals.js +++ b/cypress/support/assert-almostEquals.js @@ -12,7 +12,7 @@ const NEAR_ZERO = 5e-6; // 0.000005, Firefox fails at higher levels of precision function almostEquals (actual, expected, message) { message = message || (actual + ' did not equal ' + expected); const result = Math.abs(actual - expected) < NEAR_ZERO; - return {result, message, actual, expected}; + return { result, message, actual, expected }; } /** diff --git a/cypress/support/assert-close.js b/cypress/support/assert-close.js index 7b79341b..62c5df7d 100644 --- a/cypress/support/assert-close.js +++ b/cypress/support/assert-close.js @@ -25,7 +25,7 @@ function close (actual, expected, maxDifference, message) { const actualDiff = (actual === expected) ? 0 : Math.abs(actual - expected), result = actualDiff <= maxDifference; message = message || (actual + ' should be within ' + maxDifference + ' (inclusive) of ' + expected + (result ? '' : '. Actual: ' + actualDiff)); - return {result, message, actual, expected}; + return { result, message, actual, expected }; } /** @@ -55,7 +55,7 @@ function closePercent (actual, expected, maxPercentDifference, message) { } message = message || (actual + ' should be within ' + maxPercentDifference + '% (inclusive) of ' + expected + (result ? '' : '. Actual: ' + actualDiff + '%')); - return {result, message, actual, expected}; + return { result, message, actual, expected }; } /** @@ -74,7 +74,7 @@ function notClose (actual, expected, minDifference, message) { const actualDiff = Math.abs(actual - expected), result = actualDiff > minDifference; message = message || (actual + ' should not be within ' + minDifference + ' (exclusive) of ' + expected + (result ? '' : '. Actual: ' + actualDiff)); - return {result, message, actual, expected}; + return { result, message, actual, expected }; } /** @@ -104,7 +104,7 @@ function notClosePercent (actual, expected, minPercentDifference, message) { } message = message || (actual + ' should not be within ' + minPercentDifference + '% (exclusive) of ' + expected + (result ? '' : '. Actual: ' + actualDiff + '%')); - return {result, message, actual, expected}; + return { result, message, actual, expected }; } /** diff --git a/cypress/support/assert-expectOutOfBoundsException.js b/cypress/support/assert-expectOutOfBoundsException.js index 9285ecfc..de884e1f 100644 --- a/cypress/support/assert-expectOutOfBoundsException.js +++ b/cypress/support/assert-expectOutOfBoundsException.js @@ -19,7 +19,7 @@ function expectOutOfBoundsException (obj, fn, arg1) { } } const actual = result; - return {result, message, actual, expected}; + return { result, message, actual, expected }; } /** diff --git a/cypress/support/assertion-wrapper.js b/cypress/support/assertion-wrapper.js index 18670779..65a02776 100644 --- a/cypress/support/assertion-wrapper.js +++ b/cypress/support/assertion-wrapper.js @@ -6,7 +6,7 @@ function setAssertionMethods (_chai, _utils) { return (method) => { return (...args) => { - const {result, message, actual, expected} = method(...args); + const { result, message, actual, expected } = method(...args); const assertion = new _chai.Assertion(); assertion.assert(result, `Expected ${actual} to be ${expected}`, message); }; diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 0bbd68c7..2384dcbf 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -25,7 +25,7 @@ // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) // remove the style attributes that is causing differences in snapshots -const ngAttributes = ['style']; +const ngAttributes = [ 'style' ]; Cypress.Commands.add( 'cleanSnapshot', diff --git a/cypress/support/ui-test-helper.js b/cypress/support/ui-test-helper.js index f91b9b2e..80ca022f 100644 --- a/cypress/support/ui-test-helper.js +++ b/cypress/support/ui-test-helper.js @@ -9,7 +9,7 @@ export const visitAndApproveStorage = () => { }; export const openMainMenu = () => { - return cy.get('#main_button').click({force: true}); + return cy.get('#main_button').click({ force: true }); }; export const openEditorPreferences = () => { diff --git a/demos/canvas.html b/demos/canvas.html index 321b03c6..008c026d 100644 --- a/demos/canvas.html +++ b/demos/canvas.html @@ -5,7 +5,7 @@ Minimal demo of SvgCanvas - + @@ -28,17 +28,17 @@ import SvgCanvas from '../src/svgcanvas/svgcanvas.js'; const container = document.querySelector('#editorContainer'); -const {width, height} = {width: 500, height: 300}; +const { width, height } = { width: 500, height: 300 }; window.width = width; window.height = height; const config = { - initFill: {color: 'FFFFFF', opacity: 1}, - initStroke: {color: '000000', opacity: 1, width: 1}, - text: {stroke_width: 0, font_size: 24, font_family: 'serif'}, + initFill: { color: 'FFFFFF', opacity: 1 }, + initStroke: { color: '000000', opacity: 1, width: 1 }, + text: { stroke_width: 0, font_size: 24, font_family: 'serif' }, initOpacity: 1, - imgPath: 'editor/images/', - dimensions: [width, height], + imgPath: '../src/editor/images/', + dimensions: [ width, height ], baseUnit: 'px' }; diff --git a/docs/jsdoc-config.js b/docs/jsdoc-config.js index e833febe..88c78af1 100644 --- a/docs/jsdoc-config.js +++ b/docs/jsdoc-config.js @@ -2,59 +2,8 @@ 'use strict'; module.exports = { - plugins: ['plugins/markdown'], - markdown: { - // tags: ['examples'] - /* - // "The highlighter function should escape the code block's contents and wrap them in
 tags"
-    highlight (code, language) {
-      function ret () {
-        // Default:
-        return '
' + code + ' in this language: ' + language + '
'; - } - if (language !== 'js') { // E.g., we have one URL in some tutorial Markdown - // Seems to be only for full triple-backticked fences - // console.log('lll', code); - return ret(); - } - - // Programmatic ESLint API: https://eslint.org/docs/developer-guide/nodejs-api - const {CLIEngine} = require('eslint'); - const cli = new CLIEngine({ - useEslintrc: true, - rules: { - 'no-undef': 0, // Many variables in examples will be undefined - 'padded-blocks': 0 // Can look nicer - } - }); - - // Undo escaping done by node_modules/jsdoc/lib/jsdoc/util/markdown.js - code = code - .replace(/\s+$/, '') - .replace(/'/g, "'") - .replace(/(https?):\\\/\\\//g, '$1://') - .replace(/\{@[^}\r\n]+\}/g, function (wholeMatch) { - return wholeMatch.replace(/"/g, '"'); - }); - - // lint the supplied text and optionally set - // a filename that is displayed in the report - const report = cli.executeOnText(code + '\n'); - if (!report.errorCount && !report.warningCount) { - return ret(); - } - - // Although we don't get the file, at least we can report the source code - const {messages} = report.results[0]; - messages.forEach(({message, line, column, severity, ruleId}) => { - console.log(`${ruleId}: ${message} (Severity: ${severity}; ${line}:${column})`); - }); - console.log('\n' + code); - - return ret(); - } - */ - }, + plugins: [ 'plugins/markdown' ], + markdown: {}, recurseDepth: 10, source: { exclude: [ diff --git a/docs/tutorials/ConfigOptions.md b/docs/tutorials/ConfigOptions.md index 61d64124..c57e367d 100644 --- a/docs/tutorials/ConfigOptions.md +++ b/docs/tutorials/ConfigOptions.md @@ -43,7 +43,7 @@ repository editor code ```js svgEditor.setConfig({ - dimensions: [320, 240], + dimensions: [ 320, 240 ], canvas_expansion: 5, initFill: { color: '0000FF' @@ -160,7 +160,7 @@ To add your own stylesheets along with the default stylesheets, ensure `"@default"` is present in the array along with your own. For example: ```js -svgEditor.setConfig({stylesheets: ['@default', 'myStylesheet.css']}); +svgEditor.setConfig({ stylesheets: [ '@default', 'myStylesheet.css' ] }); ``` (In version 2.8, the CSS file `editor/custom.css` was included by default, diff --git a/docs/tutorials/ExtensionDocs.md b/docs/tutorials/ExtensionDocs.md index 9bdd182a..b25bc987 100644 --- a/docs/tutorials/ExtensionDocs.md +++ b/docs/tutorials/ExtensionDocs.md @@ -79,7 +79,7 @@ export default { init () { return { svgicons: 'extensions/helloworld-icon.xml', - buttons: [{ /* ... */ }], + buttons: [ { /* ... */ } ], mouseDown () { // ... }, @@ -139,7 +139,7 @@ property should follow the format naming conflicts in the non-modular version of SVGEdit. ```js -import {importSetGlobalDefault} from '../external/dynamic-import-polyfill/importModule.js'; +import { importSetGlobalDefault } from '../external/dynamic-import-polyfill/importModule.js'; // ... diff --git a/docs/versions/3.0.0.md b/docs/versions/3.0.0.md index be5a7c8e..8c7f58c0 100644 --- a/docs/versions/3.0.0.md +++ b/docs/versions/3.0.0.md @@ -119,7 +119,7 @@ these files). The default behavior is equivalent to this: ```js svgEditor.setConfig({ - stylesheets: ['@default', '../svgedit-custom.css'] + stylesheets: [ '@default', '../svgedit-custom.css' ] }); ``` diff --git a/netlify.toml b/netlify.toml index c2604d9d..e995a661 100644 --- a/netlify.toml +++ b/netlify.toml @@ -14,22 +14,14 @@ # Default build command. command = "npm run build" -# Production context: all deploys from the Production branch set in your site's -# deploy contexts will inherit these settings. -[context."v7-preview"] - publish = "/" - [context."release-v6.0.0"] publish = "/" command = "echo 'branch release-v6.0.0 already built'" - + [context."release-v5.1.0"] publish = "/" command = "echo 'branch release-v5.1.0 already built'" -[context.master] - publish = "/" - command = "echo 'already built'" # Production context: all deploys from the Production branch set in your site's # deploy contexts will inherit these settings. diff --git a/package-lock.json b/package-lock.json index 1ccf8cdd..3e91d315 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "@babel/polyfill": "7.12.1", "@web/dev-server-rollup": "0.3.3", "canvg": "3.0.7", - "core-js": "3.11.0", + "core-js": "3.12.1", "deparam": "^1.0.5", "elix": "^15.0.0", "i18next": "^20.2.2", @@ -22,10 +22,10 @@ "svg2pdf.js": "2.1.0" }, "devDependencies": { - "@babel/core": "7.13.16", - "@babel/preset-env": "7.13.15", + "@babel/core": "7.14.2", + "@babel/preset-env": "7.14.2", "@babel/register": "7.13.16", - "@babel/runtime-corejs3": "7.13.17", + "@babel/runtime-corejs3": "7.14.0", "@cypress/code-coverage": "3.9.5", "@cypress/fiddle": "1.19.2", "@fintechstudios/eslint-plugin-chai-as-promised": "3.1.0", @@ -37,30 +37,30 @@ "@rollup/plugin-node-resolve": "11.2.1", "@rollup/plugin-replace": "2.4.2", "@rollup/plugin-url": "6.0.0", - "@web/dev-server": "^0.1.16", + "@web/dev-server": "^0.1.17", "axe-core": "4.2.0", "babel-plugin-transform-object-rest-spread": "7.0.0-beta.3", "copyfiles": "2.4.1", - "core-js-bundle": "3.11.0", + "core-js-bundle": "3.12.1", "coveradge": "0.6.0", "cp-cli": "2.0.0", "cross-var": "1.1.0", - "cypress": "7.2.0", + "cypress": "7.3.0", "cypress-axe": "0.12.2", "cypress-multi-reporters": "1.5.0", "cypress-plugin-snapshots": "1.4.4", - "eslint": "^7.25.0", + "eslint": "^7.26.0", "eslint-config-standard": "16.0.2", "eslint-plugin-array-func": "3.1.7", "eslint-plugin-chai-expect": "2.2.0", "eslint-plugin-chai-expect-keywords": "2.1.0", - "eslint-plugin-chai-friendly": "0.6.0", + "eslint-plugin-chai-friendly": "0.7.1", "eslint-plugin-compat": "^3.9.0", - "eslint-plugin-cypress": "2.11.2", + "eslint-plugin-cypress": "2.11.3", "eslint-plugin-eslint-comments": "3.2.0", "eslint-plugin-html": "^6.1.2", - "eslint-plugin-import": "^2.22.1", - "eslint-plugin-jsdoc": "^32.3.3", + "eslint-plugin-import": "2.23.0", + "eslint-plugin-jsdoc": "34.2.2", "eslint-plugin-markdown": "^2.1.0", "eslint-plugin-mocha": "8.1.0", "eslint-plugin-mocha-cleanup": "1.9.1", @@ -70,11 +70,11 @@ "eslint-plugin-promise": "^5.1.0", "eslint-plugin-sonarjs": "^0.7.0", "eslint-plugin-standard": "4.1.0", - "eslint-plugin-unicorn": "31.0.0", + "eslint-plugin-unicorn": "32.0.1", "imageoptim-cli": "3.0.2", "jamilih": "0.54.0", "jsdoc": "3.6.6", - "mocha": "8.3.2", + "mocha": "8.4.0", "mocha-badge-generator": "0.9.0", "mochawesome": "6.2.2", "mochawesome-merge": "4.2.0", @@ -90,7 +90,7 @@ "remark-lint-ordered-list-marker-value": "2.0.1", "requirejs": "2.3.6", "rimraf": "3.0.2", - "rollup": "2.45.2", + "rollup": "2.47.0", "rollup-plugin-copy": "3.4.0", "rollup-plugin-filesize": "9.1.1", "rollup-plugin-node-polyfills": "0.2.1", @@ -98,8 +98,8 @@ "rollup-plugin-re": "1.0.7", "rollup-plugin-terser": "7.0.2", "stackblur-canvas": "2.5.0", - "start-server-and-test": "^1.12.1", - "systemjs": "6.8.3", + "start-server-and-test": "^1.12.2", + "systemjs": "6.9.0", "typescript": "4.2.4", "underscore": "1.13.1" }, @@ -117,26 +117,26 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.13.15", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.13.15.tgz", - "integrity": "sha512-ltnibHKR1VnrU4ymHyQ/CXtNXI6yZC0oJThyW78Hft8XndANwi+9H+UIklBDraIjFEJzw8wmcM427oDd9KS5wA==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.14.0.tgz", + "integrity": "sha512-vu9V3uMM/1o5Hl5OekMUowo3FqXLJSw+s+66nt0fSWVWTtmosdzn45JHOB3cPtZoe6CTBDzvSw0RdOY85Q37+Q==", "dev": true }, "node_modules/@babel/core": { - "version": "7.13.16", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.13.16.tgz", - "integrity": "sha512-sXHpixBiWWFti0AV2Zq7avpTasr6sIAu7Y396c608541qAU2ui4a193m0KSQmfPSKFZLnQ3cvlKDOm3XkuXm3Q==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.14.2.tgz", + "integrity": "sha512-OgC1mON+l4U4B4wiohJlQNUU3H73mpTyYY3j/c8U9dr9UagGGSm+WFpzjy/YLdoyjiG++c1kIDgxCo/mLwQJeQ==", "dev": true, "dependencies": { "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.13.16", + "@babel/generator": "^7.14.2", "@babel/helper-compilation-targets": "^7.13.16", - "@babel/helper-module-transforms": "^7.13.14", - "@babel/helpers": "^7.13.16", - "@babel/parser": "^7.13.16", + "@babel/helper-module-transforms": "^7.14.2", + "@babel/helpers": "^7.14.0", + "@babel/parser": "^7.14.2", "@babel/template": "^7.12.13", - "@babel/traverse": "^7.13.15", - "@babel/types": "^7.13.16", + "@babel/traverse": "^7.14.2", + "@babel/types": "^7.14.2", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -203,12 +203,12 @@ } }, "node_modules/@babel/generator": { - "version": "7.13.16", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.13.16.tgz", - "integrity": "sha512-grBBR75UnKOcUWMp8WoDxNsWCFl//XCK6HWTrBQKTr5SV9f5g0pNOjdyzi/DTBv12S9GnYPInIXQBTky7OXEMg==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.2.tgz", + "integrity": "sha512-OnADYbKrffDVai5qcpkMxQ7caomHOoEwjkouqnN2QhydAjowFAZcsdecFIRUBdb+ZcruwYE4ythYmF1UBZU5xQ==", "dev": true, "dependencies": { - "@babel/types": "^7.13.16", + "@babel/types": "^7.14.2", "jsesc": "^2.5.1", "source-map": "^0.5.0" } @@ -257,16 +257,20 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.12.1.tgz", - "integrity": "sha512-hkL++rWeta/OVOBTRJc9a5Azh5mt5WgZUGAKMD8JM141YsE08K//bp1unBBieO6rUKkIPyUE0USQ30jAy3Sk1w==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.0.tgz", + "integrity": "sha512-6pXDPguA5zC40Y8oI5mqr+jEUpjMJonKvknvA+vD8CYDz5uuXEwWBK8sRAsE/t3gfb1k15AQb9RhwpscC4nUJQ==", "dev": true, "dependencies": { - "@babel/helper-function-name": "^7.10.4", - "@babel/helper-member-expression-to-functions": "^7.12.1", - "@babel/helper-optimise-call-expression": "^7.10.4", - "@babel/helper-replace-supers": "^7.12.1", - "@babel/helper-split-export-declaration": "^7.10.4" + "@babel/helper-annotate-as-pure": "^7.12.13", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/helper-replace-supers": "^7.13.12", + "@babel/helper-split-export-declaration": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, "node_modules/@babel/helper-create-regexp-features-plugin": { @@ -280,17 +284,6 @@ "regexpu-core": "^4.7.0" } }, - "node_modules/@babel/helper-define-map": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.10.5.tgz", - "integrity": "sha512-fMw4kgFB720aQFXSVaXr79pjjcW5puTCM16+rECJ/plGS+zByelE8l9nCpV1GibxTnFVmUuYG9U8wYfQHdzOEQ==", - "dev": true, - "dependencies": { - "@babel/helper-function-name": "^7.10.4", - "@babel/types": "^7.10.5", - "lodash": "^4.17.19" - } - }, "node_modules/@babel/helper-define-polyfill-provider": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.0.tgz", @@ -353,14 +346,14 @@ } }, "node_modules/@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.2.tgz", + "integrity": "sha512-NYZlkZRydxw+YT56IlhIcS8PAhb+FEUiOzuhFTfqDyPmzAhRge6ua0dQYT/Uh0t/EDHq05/i+e5M2d4XvjgarQ==", "dev": true, "dependencies": { "@babel/helper-get-function-arity": "^7.12.13", "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" + "@babel/types": "^7.14.2" } }, "node_modules/@babel/helper-get-function-arity": { @@ -401,19 +394,19 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.13.14", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.13.14.tgz", - "integrity": "sha512-QuU/OJ0iAOSIatyVZmfqB0lbkVP0kDRiKj34xy+QNsnVZi/PA6BoSoreeqnxxa9EHFAIL0R9XOaAR/G9WlIy5g==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.2.tgz", + "integrity": "sha512-OznJUda/soKXv0XhpvzGWDnml4Qnwp16GN+D/kZIdLsWoHj05kyu8Rm5kXmMef+rVJZ0+4pSGLkeixdqNUATDA==", "dev": true, "dependencies": { "@babel/helper-module-imports": "^7.13.12", "@babel/helper-replace-supers": "^7.13.12", "@babel/helper-simple-access": "^7.13.12", "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/helper-validator-identifier": "^7.12.11", + "@babel/helper-validator-identifier": "^7.14.0", "@babel/template": "^7.12.13", - "@babel/traverse": "^7.13.13", - "@babel/types": "^7.13.14" + "@babel/traverse": "^7.14.2", + "@babel/types": "^7.14.2" } }, "node_modules/@babel/helper-optimise-call-expression": { @@ -491,9 +484,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", "dev": true }, "node_modules/@babel/helper-validator-option": { @@ -515,14 +508,14 @@ } }, "node_modules/@babel/helpers": { - "version": "7.13.16", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.13.16.tgz", - "integrity": "sha512-x5otxUaLpdWHl02P4L94wBU+2BJXBkvO+6d6uzQ+xD9/h2hTSAwA5O8QV8GqKx/l8i+VYmKKQg9e2QGTa2Wu3Q==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.14.0.tgz", + "integrity": "sha512-+ufuXprtQ1D1iZTO/K9+EBRn+qPWMJjZSw/S0KlFrxCw4tkrzv9grgpDHkY9MeQTjTY8i2sp7Jep8DfU6tN9Mg==", "dev": true, "dependencies": { "@babel/template": "^7.12.13", - "@babel/traverse": "^7.13.15", - "@babel/types": "^7.13.16" + "@babel/traverse": "^7.14.0", + "@babel/types": "^7.14.0" } }, "node_modules/@babel/highlight": { @@ -537,9 +530,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.13.16", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.16.tgz", - "integrity": "sha512-6bAg36mCwuqLO0hbR+z7PHuqWiCeP7Dzg73OpQwsAB1Eb8HnGEz5xYBzCfbu+YjoaJsJs+qheDxVAuqbt3ILEw==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.2.tgz", + "integrity": "sha512-IoVDIHpsgE/fu7eXBeRWt8zLbDrSvD7H1gpomOkPpBoEN8KCruCqSDdqo8dddwQQrui30KSvQBaMUOJiuFu6QQ==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -563,9 +556,9 @@ } }, "node_modules/@babel/plugin-proposal-async-generator-functions": { - "version": "7.13.15", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.13.15.tgz", - "integrity": "sha512-VapibkWzFeoa6ubXy/NgV5U2U4MVnUlvnx6wo1XhlsaTrLYWE0UFpDQsVrmn22q5CzeloqJ8gEMHSKxuee6ZdA==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.14.2.tgz", + "integrity": "sha512-b1AM4F6fwck4N8ItZ/AtC4FP/cqZqmKRQ4FaTDutwSYyjuhtvsGEMLK4N/ztV/ImP40BjIDyMgBQAeAMsQYVFQ==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.13.0", @@ -586,106 +579,130 @@ "@babel/helper-plugin-utils": "^7.13.0" } }, - "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.13.0.tgz", - "integrity": "sha512-twwzhthM4/+6o9766AW2ZBHpIHPSGrPGk1+WfHiu13u/lBnggXGNYCpeAyVfNwGDKfkhEDp+WOD/xafoJ2iLjA==", + "node_modules/@babel/plugin-proposal-class-static-block": { + "version": "7.13.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.13.11.tgz", + "integrity": "sha512-fJTdFI4bfnMjvxJyNuaf8i9mVcZ0UhetaGEUHaHV9KEnibLugJkZAtXikR8KcYj+NYmI4DZMS8yQAyg+hvfSqg==", "dev": true, "dependencies": { - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-member-expression-to-functions": "^7.13.0", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/helper-replace-supers": "^7.13.0", - "@babel/helper-split-export-declaration": "^7.12.13" + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/plugin-syntax-class-static-block": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.12.0" } }, "node_modules/@babel/plugin-proposal-dynamic-import": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.13.8.tgz", - "integrity": "sha512-ONWKj0H6+wIRCkZi9zSbZtE/r73uOhMVHh256ys0UzfM7I3d4n+spZNWjOnJv2gzopumP2Wxi186vI8N0Y2JyQ==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.14.2.tgz", + "integrity": "sha512-oxVQZIWFh91vuNEMKltqNsKLFWkOIyJc95k2Gv9lWVyDfPUQGSSlbDEgWuJUU1afGE9WwlzpucMZ3yDRHIItkA==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.13.0", "@babel/plugin-syntax-dynamic-import": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-proposal-export-namespace-from": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.12.13.tgz", - "integrity": "sha512-INAgtFo4OnLN3Y/j0VwAgw3HDXcDtX+C/erMvWzuV9v71r7urb6iyMXu7eM9IgLr1ElLlOkaHjJ0SbCmdOQ3Iw==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.14.2.tgz", + "integrity": "sha512-sRxW3z3Zp3pFfLAgVEvzTFutTXax837oOatUIvSG9o5gRj9mKwm3br1Se5f4QalTQs9x4AzlA/HrCWbQIHASUQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13", + "@babel/helper-plugin-utils": "^7.13.0", "@babel/plugin-syntax-export-namespace-from": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-proposal-json-strings": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.13.8.tgz", - "integrity": "sha512-w4zOPKUFPX1mgvTmL/fcEqy34hrQ1CRcGxdphBc6snDnnqJ47EZDIyop6IwXzAC8G916hsIuXB2ZMBCExC5k7Q==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.14.2.tgz", + "integrity": "sha512-w2DtsfXBBJddJacXMBhElGEYqCZQqN99Se1qeYn8DVLB33owlrlLftIbMzn5nz1OITfDVknXF433tBrLEAOEjA==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.13.0", "@babel/plugin-syntax-json-strings": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-proposal-logical-assignment-operators": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.13.8.tgz", - "integrity": "sha512-aul6znYB4N4HGweImqKn59Su9RS8lbUIqxtXTOcAGtNIDczoEFv+l1EhmX8rUBp3G1jMjKJm8m0jXVp63ZpS4A==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.14.2.tgz", + "integrity": "sha512-1JAZtUrqYyGsS7IDmFeaem+/LJqujfLZ2weLR9ugB0ufUPjzf8cguyVT1g5im7f7RXxuLq1xUxEzvm68uYRtGg==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.13.0", "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.13.8.tgz", - "integrity": "sha512-iePlDPBn//UhxExyS9KyeYU7RM9WScAG+D3Hhno0PLJebAEpDZMocbDe64eqynhNAnwz/vZoL/q/QB2T1OH39A==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.14.2.tgz", + "integrity": "sha512-ebR0zU9OvI2N4qiAC38KIAK75KItpIPTpAtd2r4OZmMFeKbKJpUFLYP2EuDut82+BmYi8sz42B+TfTptJ9iG5Q==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.13.0", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-proposal-numeric-separator": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.13.tgz", - "integrity": "sha512-O1jFia9R8BUCl3ZGB7eitaAPu62TXJRHn7rh+ojNERCFyqRwJMTmhz+tJ+k0CwI6CLjX/ee4qW74FSqlq9I35w==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.14.2.tgz", + "integrity": "sha512-DcTQY9syxu9BpU3Uo94fjCB3LN9/hgPS8oUL7KrSW3bA2ePrKZZPJcc5y0hoJAM9dft3pGfErtEUvxXQcfLxUg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13", + "@babel/helper-plugin-utils": "^7.13.0", "@babel/plugin-syntax-numeric-separator": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-proposal-object-rest-spread": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.13.8.tgz", - "integrity": "sha512-DhB2EuB1Ih7S3/IRX5AFVgZ16k3EzfRbq97CxAVI1KSYcW+lexV8VZb7G7L8zuPVSdQMRn0kiBpf/Yzu9ZKH0g==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.14.2.tgz", + "integrity": "sha512-hBIQFxwZi8GIp934+nj5uV31mqclC1aYDhctDu5khTi9PCCUOczyy0b34W0oE9U/eJXiqQaKyVsmjeagOaSlbw==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.13.8", - "@babel/helper-compilation-targets": "^7.13.8", + "@babel/compat-data": "^7.14.0", + "@babel/helper-compilation-targets": "^7.13.16", "@babel/helper-plugin-utils": "^7.13.0", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.13.0" + "@babel/plugin-transform-parameters": "^7.14.2" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-proposal-optional-catch-binding": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.13.8.tgz", - "integrity": "sha512-0wS/4DUF1CuTmGo+NiaHfHcVSeSLj5S3e6RivPTg/2k3wOv3jO35tZ6/ZWsQhQMvdgI7CwphjQa/ccarLymHVA==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.14.2.tgz", + "integrity": "sha512-XtkJsmJtBaUbOxZsNk0Fvrv8eiqgneug0A6aqLFZ4TSkar2L5dSXWcnUKHgmjJt49pyB/6ZHvkr3dPgl9MOWRQ==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.13.0", "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-proposal-optional-chaining": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.13.12.tgz", - "integrity": "sha512-fcEdKOkIB7Tf4IxrgEVeFC4zeJSTr78no9wTdBuZZbqF64kzllU0ybo2zrzm7gUQfxGhBgq4E39oRs8Zx/RMYQ==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.14.2.tgz", + "integrity": "sha512-qQByMRPwMZJainfig10BoaDldx/+VDtNcrA7qdNaEOAj6VXud+gfrkA8j4CRAU5HjnWREXqIpSpH30qZX1xivA==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.13.0", @@ -706,17 +723,19 @@ "@babel/helper-plugin-utils": "^7.13.0" } }, - "node_modules/@babel/plugin-proposal-private-methods/node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.13.0.tgz", - "integrity": "sha512-twwzhthM4/+6o9766AW2ZBHpIHPSGrPGk1+WfHiu13u/lBnggXGNYCpeAyVfNwGDKfkhEDp+WOD/xafoJ2iLjA==", + "node_modules/@babel/plugin-proposal-private-property-in-object": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.14.0.tgz", + "integrity": "sha512-59ANdmEwwRUkLjB7CRtwJxxwtjESw+X2IePItA+RGQh+oy5RmpCh/EvVVvh5XQc3yxsm5gtv0+i9oBZhaDNVTg==", "dev": true, "dependencies": { - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-member-expression-to-functions": "^7.13.0", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/helper-replace-supers": "^7.13.0", - "@babel/helper-split-export-declaration": "^7.12.13" + "@babel/helper-annotate-as-pure": "^7.12.13", + "@babel/helper-create-class-features-plugin": "^7.14.0", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/plugin-syntax-private-property-in-object": "^7.14.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-proposal-unicode-property-regex": { @@ -750,6 +769,18 @@ "@babel/helper-plugin-utils": "^7.12.13" } }, + "node_modules/@babel/plugin-syntax-class-static-block": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.12.13.tgz", + "integrity": "sha512-ZmKQ0ZXR0nYpHZIIuj9zE7oIqCx2hw9TKi+lIo73NNrMPAZGHfS92/VRV0ZmPj6H2ffBgyFHXvJ5NYsNeEaP2A==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/plugin-syntax-dynamic-import": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", @@ -757,6 +788,9 @@ "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-export-namespace-from": { @@ -766,6 +800,9 @@ "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-json-strings": { @@ -793,6 +830,9 @@ "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { @@ -802,6 +842,9 @@ "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-numeric-separator": { @@ -811,6 +854,9 @@ "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-object-rest-spread": { @@ -843,6 +889,18 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.0.tgz", + "integrity": "sha512-bda3xF8wGl5/5btF794utNOL0Jw+9jE5C1sLZcoK7c4uonE/y3iQiyG+KbkF3WBV/paX58VCpjhxLPkdj5Fe4w==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.13.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/plugin-syntax-top-level-await": { "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.13.tgz", @@ -882,28 +940,33 @@ } }, "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.12.12", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.12.12.tgz", - "integrity": "sha512-VOEPQ/ExOVqbukuP7BYJtI5ZxxsmegTwzZ04j1aF0dkSypGo9XpDHuOrABsJu+ie+penpSJheDJ11x1BEZNiyQ==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.14.2.tgz", + "integrity": "sha512-neZZcP19NugZZqNwMTH+KoBjx5WyvESPSIOQb4JHpfd+zPfqcH65RMu5xJju5+6q/Y2VzYrleQTr+b6METyyxg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" + "@babel/helper-plugin-utils": "^7.13.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-transform-classes": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.12.1.tgz", - "integrity": "sha512-/74xkA7bVdzQTBeSUhLLJgYIcxw/dpEpCdRDiHgPJ3Mv6uC11UhjpOhl72CgqbBCmt1qtssCyB2xnJm1+PFjog==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.14.2.tgz", + "integrity": "sha512-7oafAVcucHquA/VZCsXv/gmuiHeYd64UJyyTYU+MPfNu0KeNlxw06IeENBO8bJjXVbolu+j1MM5aKQtH1OMCNg==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.10.4", - "@babel/helper-define-map": "^7.10.4", - "@babel/helper-function-name": "^7.10.4", - "@babel/helper-optimise-call-expression": "^7.10.4", - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/helper-replace-supers": "^7.12.1", - "@babel/helper-split-export-declaration": "^7.10.4", + "@babel/helper-annotate-as-pure": "^7.12.13", + "@babel/helper-function-name": "^7.14.2", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-replace-supers": "^7.13.12", + "@babel/helper-split-export-declaration": "^7.12.13", "globals": "^11.1.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-transform-computed-properties": { @@ -916,12 +979,15 @@ } }, "node_modules/@babel/plugin-transform-destructuring": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.12.1.tgz", - "integrity": "sha512-fRMYFKuzi/rSiYb2uRLiUENJOKq4Gnl+6qOv5f8z0TZXg3llUwUhsNNwrwaT/6dUhJTzNpBr+CUvEWBtfNY1cw==", + "version": "7.13.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.13.17.tgz", + "integrity": "sha512-UAUqiLv+uRLO+xuBKKMEpC+t7YRNVRqBsWWq1yKXbBZBje/t3IXCiSinZhjn/DC3qzBfICeYd2EFGEbHsh5RLA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" + "@babel/helper-plugin-utils": "^7.13.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-transform-dotall-regex": { @@ -991,26 +1057,32 @@ } }, "node_modules/@babel/plugin-transform-modules-amd": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.12.1.tgz", - "integrity": "sha512-tDW8hMkzad5oDtzsB70HIQQRBiTKrhfgwC/KkJeGsaNFTdWhKNt/BiE8c5yj19XiGyrxpbkOfH87qkNg1YGlOQ==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.14.2.tgz", + "integrity": "sha512-hPC6XBswt8P3G2D1tSV2HzdKvkqOpmbyoy+g73JG0qlF/qx2y3KaMmXb1fLrpmWGLZYA0ojCvaHdzFWjlmV+Pw==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.12.1", - "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-module-transforms": "^7.14.2", + "@babel/helper-plugin-utils": "^7.13.0", "babel-plugin-dynamic-import-node": "^2.3.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.13.8.tgz", - "integrity": "sha512-9QiOx4MEGglfYZ4XOnU79OHr6vIWUakIj9b4mioN8eQIoEh+pf5p/zEB36JpDFWA12nNMiRf7bfoRvl9Rn79Bw==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.14.0.tgz", + "integrity": "sha512-EX4QePlsTaRZQmw9BsoPeyh5OCtRGIhwfLquhxGp5e32w+dyL8htOcDwamlitmNFK6xBZYlygjdye9dbd9rUlQ==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.13.0", + "@babel/helper-module-transforms": "^7.14.0", "@babel/helper-plugin-utils": "^7.13.0", - "@babel/helper-simple-access": "^7.12.13", + "@babel/helper-simple-access": "^7.13.12", "babel-plugin-dynamic-import-node": "^2.3.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-transform-modules-systemjs": { @@ -1027,13 +1099,16 @@ } }, "node_modules/@babel/plugin-transform-modules-umd": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.12.1.tgz", - "integrity": "sha512-aEIubCS0KHKM0zUos5fIoQm+AZUMt1ZvMpqz0/H5qAQ7vWylr9+PLYurT+Ic7ID/bKLd4q8hDovaG3Zch2uz5Q==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.14.0.tgz", + "integrity": "sha512-nPZdnWtXXeY7I87UZr9VlsWme3Y0cfFFE41Wbxz4bbaexAjNMInXPFUpRRUJ8NoMm0Cw+zxbqjdPmLhcjfazMw==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.12.1", - "@babel/helper-plugin-utils": "^7.10.4" + "@babel/helper-module-transforms": "^7.14.0", + "@babel/helper-plugin-utils": "^7.13.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { @@ -1092,12 +1167,15 @@ } }, "node_modules/@babel/plugin-transform-parameters": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.13.0.tgz", - "integrity": "sha512-Jt8k/h/mIwE2JFEOb3lURoY5C85ETcYPnbuAJ96zRBzh1XHtQZfs62ChZ6EP22QlC8c7Xqr9q+e1SU5qttwwjw==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.14.2.tgz", + "integrity": "sha512-NxoVmA3APNCC1JdMXkdYXuQS+EMdqy0vIwyDHeKHiJKRxmp1qGSdb0JLEIoPRhkx6H/8Qi3RJ3uqOCYw8giy9A==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.13.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-transform-property-literals": { @@ -1289,31 +1367,34 @@ "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==" }, "node_modules/@babel/preset-env": { - "version": "7.13.15", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.13.15.tgz", - "integrity": "sha512-D4JAPMXcxk69PKe81jRJ21/fP/uYdcTZ3hJDF5QX2HSI9bBxxYw/dumdR6dGumhjxlprHPE4XWoPaqzZUVy2MA==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.14.2.tgz", + "integrity": "sha512-7dD7lVT8GMrE73v4lvDEb85cgcQhdES91BSD7jS/xjC6QY8PnRhux35ac+GCpbiRhp8crexBvZZqnaL6VrY8TQ==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.13.15", - "@babel/helper-compilation-targets": "^7.13.13", + "@babel/compat-data": "^7.14.0", + "@babel/helper-compilation-targets": "^7.13.16", "@babel/helper-plugin-utils": "^7.13.0", "@babel/helper-validator-option": "^7.12.17", "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.13.12", - "@babel/plugin-proposal-async-generator-functions": "^7.13.15", + "@babel/plugin-proposal-async-generator-functions": "^7.14.2", "@babel/plugin-proposal-class-properties": "^7.13.0", - "@babel/plugin-proposal-dynamic-import": "^7.13.8", - "@babel/plugin-proposal-export-namespace-from": "^7.12.13", - "@babel/plugin-proposal-json-strings": "^7.13.8", - "@babel/plugin-proposal-logical-assignment-operators": "^7.13.8", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.13.8", - "@babel/plugin-proposal-numeric-separator": "^7.12.13", - "@babel/plugin-proposal-object-rest-spread": "^7.13.8", - "@babel/plugin-proposal-optional-catch-binding": "^7.13.8", - "@babel/plugin-proposal-optional-chaining": "^7.13.12", + "@babel/plugin-proposal-class-static-block": "^7.13.11", + "@babel/plugin-proposal-dynamic-import": "^7.14.2", + "@babel/plugin-proposal-export-namespace-from": "^7.14.2", + "@babel/plugin-proposal-json-strings": "^7.14.2", + "@babel/plugin-proposal-logical-assignment-operators": "^7.14.2", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.2", + "@babel/plugin-proposal-numeric-separator": "^7.14.2", + "@babel/plugin-proposal-object-rest-spread": "^7.14.2", + "@babel/plugin-proposal-optional-catch-binding": "^7.14.2", + "@babel/plugin-proposal-optional-chaining": "^7.14.2", "@babel/plugin-proposal-private-methods": "^7.13.0", + "@babel/plugin-proposal-private-property-in-object": "^7.14.0", "@babel/plugin-proposal-unicode-property-regex": "^7.12.13", "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.12.13", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-export-namespace-from": "^7.8.3", "@babel/plugin-syntax-json-strings": "^7.8.3", @@ -1323,14 +1404,15 @@ "@babel/plugin-syntax-object-rest-spread": "^7.8.3", "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.0", "@babel/plugin-syntax-top-level-await": "^7.12.13", "@babel/plugin-transform-arrow-functions": "^7.13.0", "@babel/plugin-transform-async-to-generator": "^7.13.0", "@babel/plugin-transform-block-scoped-functions": "^7.12.13", - "@babel/plugin-transform-block-scoping": "^7.12.13", - "@babel/plugin-transform-classes": "^7.13.0", + "@babel/plugin-transform-block-scoping": "^7.14.2", + "@babel/plugin-transform-classes": "^7.14.2", "@babel/plugin-transform-computed-properties": "^7.13.0", - "@babel/plugin-transform-destructuring": "^7.13.0", + "@babel/plugin-transform-destructuring": "^7.13.17", "@babel/plugin-transform-dotall-regex": "^7.12.13", "@babel/plugin-transform-duplicate-keys": "^7.12.13", "@babel/plugin-transform-exponentiation-operator": "^7.12.13", @@ -1338,14 +1420,14 @@ "@babel/plugin-transform-function-name": "^7.12.13", "@babel/plugin-transform-literals": "^7.12.13", "@babel/plugin-transform-member-expression-literals": "^7.12.13", - "@babel/plugin-transform-modules-amd": "^7.13.0", - "@babel/plugin-transform-modules-commonjs": "^7.13.8", + "@babel/plugin-transform-modules-amd": "^7.14.2", + "@babel/plugin-transform-modules-commonjs": "^7.14.0", "@babel/plugin-transform-modules-systemjs": "^7.13.8", - "@babel/plugin-transform-modules-umd": "^7.13.0", + "@babel/plugin-transform-modules-umd": "^7.14.0", "@babel/plugin-transform-named-capturing-groups-regex": "^7.12.13", "@babel/plugin-transform-new-target": "^7.12.13", "@babel/plugin-transform-object-super": "^7.12.13", - "@babel/plugin-transform-parameters": "^7.13.0", + "@babel/plugin-transform-parameters": "^7.14.2", "@babel/plugin-transform-property-literals": "^7.12.13", "@babel/plugin-transform-regenerator": "^7.13.15", "@babel/plugin-transform-reserved-words": "^7.12.13", @@ -1357,7 +1439,7 @@ "@babel/plugin-transform-unicode-escapes": "^7.12.13", "@babel/plugin-transform-unicode-regex": "^7.12.13", "@babel/preset-modules": "^0.1.4", - "@babel/types": "^7.13.14", + "@babel/types": "^7.14.2", "babel-plugin-polyfill-corejs2": "^0.2.0", "babel-plugin-polyfill-corejs3": "^0.2.0", "babel-plugin-polyfill-regenerator": "^0.2.0", @@ -1439,30 +1521,6 @@ "@babel/helper-plugin-utils": "^7.12.13" } }, - "node_modules/@babel/preset-env/node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.12.13.tgz", - "integrity": "sha512-Pxwe0iqWJX4fOOM2kEZeUuAxHMWb9nK+9oh5d11bsLoB0xMg+mkDpt0eYuDZB7ETrY9bbcVlKUGTOGWy7BHsMQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13" - } - }, - "node_modules/@babel/preset-env/node_modules/@babel/plugin-transform-classes": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.13.0.tgz", - "integrity": "sha512-9BtHCPUARyVH1oXGcSJD3YpsqRLROJx5ZNP6tN5vnk17N0SVf9WCtf8Nuh1CFmgByKKAIMstitKduoCmsaDK5g==", - "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.12.13", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/helper-replace-supers": "^7.13.0", - "@babel/helper-split-export-declaration": "^7.12.13", - "globals": "^11.1.0" - } - }, "node_modules/@babel/preset-env/node_modules/@babel/plugin-transform-computed-properties": { "version": "7.13.0", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.13.0.tgz", @@ -1472,15 +1530,6 @@ "@babel/helper-plugin-utils": "^7.13.0" } }, - "node_modules/@babel/preset-env/node_modules/@babel/plugin-transform-destructuring": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.13.0.tgz", - "integrity": "sha512-zym5em7tePoNT9s964c0/KU3JPPnuq7VhIxPRefJ4/s82cD+q1mgKfuGRDMCPL0HTyKz4dISuQlCusfgCJ86HA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.13.0" - } - }, "node_modules/@babel/preset-env/node_modules/@babel/plugin-transform-dotall-regex": { "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.12.13.tgz", @@ -1547,27 +1596,6 @@ "@babel/helper-plugin-utils": "^7.12.13" } }, - "node_modules/@babel/preset-env/node_modules/@babel/plugin-transform-modules-amd": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.13.0.tgz", - "integrity": "sha512-EKy/E2NHhY/6Vw5d1k3rgoobftcNUmp9fGjb9XZwQLtTctsRBOTRO7RHHxfIky1ogMN5BxN7p9uMA3SzPfotMQ==", - "dev": true, - "dependencies": { - "@babel/helper-module-transforms": "^7.13.0", - "@babel/helper-plugin-utils": "^7.13.0", - "babel-plugin-dynamic-import-node": "^2.3.3" - } - }, - "node_modules/@babel/preset-env/node_modules/@babel/plugin-transform-modules-umd": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.13.0.tgz", - "integrity": "sha512-D/ILzAh6uyvkWjKKyFE/W0FzWwasv6vPTSqPcjxFqn6QpX3u8DjRVliq4F2BamO2Wee/om06Vyy+vPkNrd4wxw==", - "dev": true, - "dependencies": { - "@babel/helper-module-transforms": "^7.13.0", - "@babel/helper-plugin-utils": "^7.13.0" - } - }, "node_modules/@babel/preset-env/node_modules/@babel/plugin-transform-named-capturing-groups-regex": { "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.12.13.tgz", @@ -1747,9 +1775,9 @@ } }, "node_modules/@babel/runtime-corejs3": { - "version": "7.13.17", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.13.17.tgz", - "integrity": "sha512-RGXINY1YvduBlGrP+vHjJqd/nK7JVpfM4rmZLGMx77WoL3sMrhheA0qxii9VNn1VHnxJLEyxmvCB+Wqc+x/FMw==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.14.0.tgz", + "integrity": "sha512-0R0HTZWHLk6G8jIk0FtoX+AatCtKnswS98VhXwGImFc759PJRp4Tru0PQYZofyijTFUr+gT8Mu7sgXVJLQ0ceg==", "dependencies": { "core-js-pure": "^3.0.0", "regenerator-runtime": "^0.13.4" @@ -1767,17 +1795,17 @@ } }, "node_modules/@babel/traverse": { - "version": "7.13.15", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.13.15.tgz", - "integrity": "sha512-/mpZMNvj6bce59Qzl09fHEs8Bt8NnpEDQYleHUPZQ3wXUMvXi+HJPLars68oAbmp839fGoOkv2pSL2z9ajCIaQ==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.2.tgz", + "integrity": "sha512-TsdRgvBFHMyHOOzcP9S6QU0QQtjxlRpEYOy3mcCO5RgmC305ki42aSAmfZEMSSYBla2oZ9BMqYlncBaKmD/7iA==", "dev": true, "dependencies": { "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.13.9", - "@babel/helper-function-name": "^7.12.13", + "@babel/generator": "^7.14.2", + "@babel/helper-function-name": "^7.14.2", "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.13.15", - "@babel/types": "^7.13.14", + "@babel/parser": "^7.14.2", + "@babel/types": "^7.14.2", "debug": "^4.1.0", "globals": "^11.1.0" } @@ -1798,12 +1826,12 @@ "dev": true }, "node_modules/@babel/types": { - "version": "7.13.16", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.16.tgz", - "integrity": "sha512-7enM8Wxhrl1hB1+k6+xO6RmxpNkaveRWkdpyii8DkrLWRgr0l3x29/SEuhTIkP+ynHsU/Hpjn8Evd/axv/ll6Q==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz", + "integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.12.11", + "@babel/helper-validator-identifier": "^7.14.0", "to-fast-properties": "^2.0.0" } }, @@ -2463,10 +2491,24 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, + "node_modules/@es-joy/jsdoccomment": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.4.4.tgz", + "integrity": "sha512-ua4qDt9dQb4qt5OI38eCZcQZYE5Bq3P0GzgvDARdT8Lt0mAUpxKTPy8JGGqEvF77tG1irKDZ3WreeezEa3P43w==", + "dev": true, + "dependencies": { + "comment-parser": "^1.1.5", + "esquery": "^1.4.0", + "jsdoctypeparser": "^9.0.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/@eslint/eslintrc": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.0.tgz", - "integrity": "sha512-2ZPCc+uNbjV5ERJr+aKSPRwZgKd2z11x0EgLvb1PURmUrn9QNRXFqje0Ldq454PfAVyaJYyrDvvIKSFP4NnBog==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.1.tgz", + "integrity": "sha512-5v7TDE9plVhvxQeWLXDTvFvJBdH6pEsdnl2g/dAptmuFEPedQ4Erq5rsDsX+mvAM610IhNaO2W5V1dOOnDKxkQ==", "dev": true, "dependencies": { "ajv": "^6.12.4", @@ -2483,24 +2525,6 @@ "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/@eslint/eslintrc/node_modules/acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", - "dev": true - }, - "node_modules/@eslint/eslintrc/node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, "node_modules/@eslint/eslintrc/node_modules/debug": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", @@ -2511,6 +2535,11 @@ }, "engines": { "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, "node_modules/@eslint/eslintrc/node_modules/espree": { @@ -2537,6 +2566,9 @@ }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/@eslint/eslintrc/node_modules/ignore": { @@ -2559,6 +2591,9 @@ }, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/@eslint/eslintrc/node_modules/ms": { @@ -2583,6 +2618,9 @@ "dev": true, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/@fintechstudios/eslint-plugin-chai-as-promised": { @@ -3540,16 +3578,6 @@ "rollup": "^1.20.0||^2.0.0" } }, - "node_modules/@rollup/plugin-node-resolve/node_modules/resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", - "dev": true, - "dependencies": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" - } - }, "node_modules/@rollup/plugin-replace": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-2.4.2.tgz", @@ -4130,16 +4158,16 @@ "dev": true }, "node_modules/@web/dev-server": { - "version": "0.1.16", - "resolved": "https://registry.npmjs.org/@web/dev-server/-/dev-server-0.1.16.tgz", - "integrity": "sha512-5NFhx8lU4NXFn4fmXxJTwjurezmf3tJ3XOq30f/Zx6A7oQoViWPqjK0sp6PKzyR29tcn1/i+Ex5BTo9IHrW3jQ==", + "version": "0.1.17", + "resolved": "https://registry.npmjs.org/@web/dev-server/-/dev-server-0.1.17.tgz", + "integrity": "sha512-2gdOjkQp97uaORkOL8X90f4retqZ2lA9YqHDljpf4SFg0JWoY8X7EJA9XQG1jJ2x46oQ5zqJX7AiSWc47B2k6A==", "dev": true, "dependencies": { "@babel/code-frame": "^7.12.11", "@rollup/plugin-node-resolve": "^11.0.1", "@types/command-line-args": "^5.0.0", "@web/config-loader": "^0.1.3", - "@web/dev-server-core": "^0.3.11", + "@web/dev-server-core": "^0.3.12", "@web/dev-server-rollup": "^0.3.3", "camelcase": "^6.2.0", "chalk": "^4.1.0", @@ -4160,9 +4188,9 @@ } }, "node_modules/@web/dev-server-core": { - "version": "0.3.11", - "resolved": "https://registry.npmjs.org/@web/dev-server-core/-/dev-server-core-0.3.11.tgz", - "integrity": "sha512-6CXO4eoW7UIicXFWDP3pocwVliyiTFqqqGg+DN4xexBLiP9sWH4WYb57RwKEnd9/K+DjWbSu0D0tvjVzcftUIw==", + "version": "0.3.12", + "resolved": "https://registry.npmjs.org/@web/dev-server-core/-/dev-server-core-0.3.12.tgz", + "integrity": "sha512-PI7neqHvsgsE+GJnJNSjMGeWHSo8MgO99CAzVm6UtFeAjShmMGWp6WQTDJPzvsE4jnYhIg8EPwz2cqDIGnkU6A==", "dependencies": { "@types/koa": "^2.11.6", "@types/ws": "^7.4.0", @@ -4631,10 +4659,13 @@ } }, "node_modules/acorn-jsx": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", - "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", - "dev": true + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } }, "node_modules/acorn-node": { "version": "1.8.2", @@ -4738,15 +4769,19 @@ } }, "node_modules/ajv": { - "version": "6.12.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz", - "integrity": "sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==", + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, "node_modules/ansi-align": { @@ -4990,17 +5025,22 @@ } }, "node_modules/array-includes": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", - "integrity": "sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.3.tgz", + "integrity": "sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A==", "dev": true, "dependencies": { + "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.17.0", + "es-abstract": "^1.18.0-next.2", + "get-intrinsic": "^1.1.1", "is-string": "^1.0.5" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/array-union": { @@ -5022,16 +5062,20 @@ } }, "node_modules/array.prototype.flat": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz", - "integrity": "sha512-gBlRZV0VSmfPIeWfuuy56XZMvbVfbEUnOXUvt3F/eUUUSyzlgLxhEX4YAEpxNAogRGehPSnfXyPtYyKAhkzQhQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz", + "integrity": "sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==", "dev": true, "dependencies": { + "call-bind": "^1.0.0", "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1" + "es-abstract": "^1.18.0-next.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/arraybuffer.slice": { @@ -7837,10 +7881,26 @@ "dev": true }, "node_modules/contains-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", - "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-1.0.0.tgz", + "integrity": "sha1-NFizMhhWA+ju0Y9RjUoQiIo6vJE=", "dev": true, + "dependencies": { + "normalize-path": "^2.1.1", + "path-starts-with": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/contains-path/node_modules/normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "dependencies": { + "remove-trailing-separator": "^1.0.1" + }, "engines": { "node": ">=0.10.0" } @@ -8034,9 +8094,9 @@ } }, "node_modules/core-js": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.11.0.tgz", - "integrity": "sha512-bd79DPpx+1Ilh9+30aT5O1sgpQd4Ttg8oqkqi51ZzhedMM1omD2e6IOF48Z/DzDCZ2svp49tN/3vneTK6ZBkXw==", + "version": "3.12.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.12.1.tgz", + "integrity": "sha512-Ne9DKPHTObRuB09Dru5AjwKjY4cJHVGu+y5f7coGn1E9Grkc3p2iBwE9AI/nJzsE29mQF7oq+mhYYRqOMFN1Bw==", "hasInstallScript": true, "funding": { "type": "opencollective", @@ -8044,9 +8104,9 @@ } }, "node_modules/core-js-bundle": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/core-js-bundle/-/core-js-bundle-3.11.0.tgz", - "integrity": "sha512-1jLByrWCQ5b84opZrn36gtJnnPSIrq2ABZ+NN87ewk6QxgLC7Ohu9pE0bo+XK9R20apKvtUmBDZmFwKGt4lNhA==", + "version": "3.12.1", + "resolved": "https://registry.npmjs.org/core-js-bundle/-/core-js-bundle-3.12.1.tgz", + "integrity": "sha512-4xo0s+HI15r0HEVLy6LhFoPqVlwQKxgl/tbgDfcRziFa5gAUxyEPUtPVXi2VPcSVYIJ8JSG+SOvy/aLPD7M6Fw==", "dev": true, "hasInstallScript": true, "funding": { @@ -8615,9 +8675,9 @@ "dev": true }, "node_modules/cypress": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-7.2.0.tgz", - "integrity": "sha512-lHHGay+YsffDn4M0bkkwezylBVHUpwwhtqte4LNPrFRCHy77X38+1PUe3neFb3glVTM+rbILtTN6FhO2djcOuQ==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-7.3.0.tgz", + "integrity": "sha512-aseRCH1tRVCrM6oEfja6fR/bo5l6e4SkHRRSATh27UeN4f/ANC8U7tGIulmrISJVy9xuOkOdbYKbUb2MNM+nrw==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -9906,13 +9966,13 @@ } }, "node_modules/eslint": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.25.0.tgz", - "integrity": "sha512-TVpSovpvCNpLURIScDRB6g5CYu/ZFq9GfX2hLNIV4dSBKxIWojeDODvYl3t0k0VtMxYeR8OXPCFE5+oHMlGfhw==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.26.0.tgz", + "integrity": "sha512-4R1ieRf52/izcZE7AlLy56uIHHDLT74Yzz2Iv2l6kDaYvEu9x+wMB5dZArVL8SYGXSYV2YAg70FcW5Y5nGGNIg==", "dev": true, "dependencies": { "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.0", + "@eslint/eslintrc": "^0.4.1", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -9976,18 +10036,27 @@ } }, "node_modules/eslint-module-utils": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", - "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.1.tgz", + "integrity": "sha512-ZXI9B8cxAJIH4nfkhTwcRTEAnrVfobYqwjWy/QMCZ8rHkZHFjf9yO4BzpiF9kCSfNlMG54eKigISHpX0+AaT4A==", "dev": true, "dependencies": { - "debug": "^2.6.9", + "debug": "^3.2.7", "pkg-dir": "^2.0.0" }, "engines": { "node": ">=4" } }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, "node_modules/eslint-module-utils/node_modules/find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", @@ -10013,6 +10082,12 @@ "node": ">=4" } }, + "node_modules/eslint-module-utils/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, "node_modules/eslint-module-utils/node_modules/p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", @@ -10086,12 +10161,15 @@ } }, "node_modules/eslint-plugin-chai-friendly": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-chai-friendly/-/eslint-plugin-chai-friendly-0.6.0.tgz", - "integrity": "sha512-Uvvv1gkbRGp/qfN15B0kQyQWg+oFA8buDSqrwmW3egNSk/FpqH2MjQqKOuKwmEL6w4QIQrIjDp+gg6kGGmD3oQ==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-chai-friendly/-/eslint-plugin-chai-friendly-0.7.1.tgz", + "integrity": "sha512-0xhGiSQ+9oWtNc6IZPUR+6ChKbEvLXwT9oZZ5NcGlPzHVKGn1YKwQFj7a9yL3rnRKbWF7b3RkRYEP8kN6dPOwQ==", "dev": true, "engines": { "node": ">=0.10.0" + }, + "peerDependencies": { + "eslint": ">=3.0.0" } }, "node_modules/eslint-plugin-compat": { @@ -10178,12 +10256,15 @@ } }, "node_modules/eslint-plugin-cypress": { - "version": "2.11.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.11.2.tgz", - "integrity": "sha512-1SergF1sGbVhsf7MYfOLiBhdOg6wqyeV9pXUAIDIffYTGMN3dTBQS9nFAzhLsHhO+Bn0GaVM1Ecm71XUidQ7VA==", + "version": "2.11.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.11.3.tgz", + "integrity": "sha512-hOoAid+XNFtpvOzZSNWP5LDrQBEJwbZwjib4XJ1KcRYKjeVj0mAmPmucG4Egli4j/aruv+Ow/acacoloWWCl9Q==", "dev": true, "dependencies": { "globals": "^11.12.0" + }, + "peerDependencies": { + "eslint": ">= 3.2.1" } }, "node_modules/eslint-plugin-es": { @@ -10240,50 +10321,115 @@ } }, "node_modules/eslint-plugin-import": { - "version": "2.22.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", - "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", + "version": "2.23.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.23.0.tgz", + "integrity": "sha512-W5v1f7Cbam6BwbSSKtN6+yoUAms07ozbqAEhLOtf5erEqRv7w67PeZuAuBThaUkzdq2GfBx/5GBvxF+NWJshrQ==", "dev": true, "dependencies": { - "array-includes": "^3.1.1", - "array.prototype.flat": "^1.2.3", - "contains-path": "^0.1.0", + "array-includes": "^3.1.3", + "array.prototype.flat": "^1.2.4", + "contains-path": "^1.0.0", "debug": "^2.6.9", - "doctrine": "1.5.0", + "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.4", - "eslint-module-utils": "^2.6.0", + "eslint-module-utils": "^2.6.1", + "find-up": "^2.0.0", "has": "^1.0.3", + "is-core-module": "^2.4.0", "minimatch": "^3.0.4", - "object.values": "^1.1.1", - "read-pkg-up": "^2.0.0", - "resolve": "^1.17.0", + "object.values": "^1.1.3", + "pkg-up": "^2.0.0", + "read-pkg-up": "^3.0.0", + "resolve": "^1.20.0", "tsconfig-paths": "^3.9.0" }, "engines": { "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0" } }, "node_modules/eslint-plugin-import/node_modules/doctrine": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", - "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "dependencies": { - "esutils": "^2.0.2", - "isarray": "^1.0.0" + "esutils": "^2.0.2" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/eslint-plugin-jsdoc": { - "version": "32.3.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-32.3.3.tgz", - "integrity": "sha512-WxXohbMYlZvCt3r7MepwT++nTLsO4CPegWcm5toM4IGq3MBmYkG+Uf5yDa+n1MwPXLg+KbJqAsI19hmkVD7MPg==", + "node_modules/eslint-plugin-import/node_modules/find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "dependencies": { + "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import/node_modules/locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import/node_modules/p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "dependencies": { + "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import/node_modules/p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "dependencies": { + "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import/node_modules/p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-jsdoc": { + "version": "34.2.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-34.2.2.tgz", + "integrity": "sha512-9JCeUUZ2MefGd/Pl3blx9/EDjCd7/Z2+fcVBuJdNdvSLApRqZ8CwjGjLHf5s4uVikqF968A0CfnID0WK9B/H/w==", + "dev": true, + "dependencies": { + "@es-joy/jsdoccomment": "^0.4.4", "comment-parser": "1.1.5", "debug": "^4.3.1", + "esquery": "^1.4.0", "jsdoctypeparser": "^9.0.0", "lodash": "^4.17.21", "regextras": "^0.7.1", @@ -10291,7 +10437,7 @@ "spdx-expression-parse": "^3.0.1" }, "engines": { - "node": ">=10" + "node": ">=12" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0" @@ -10555,16 +10701,15 @@ "dev": true }, "node_modules/eslint-plugin-unicorn": { - "version": "31.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-31.0.0.tgz", - "integrity": "sha512-HR3gI4ANtV8A+0FLAaxjBD/G5J3PWBo+7OswyGeK5nylGqtKLJVbnPksIkBgmVg+SFpxu5MnjaxQQI+9KjyVAg==", + "version": "32.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-32.0.1.tgz", + "integrity": "sha512-LaZ9utnXtOJjnoDkpm+nQsONUUmyRR0WD6PGROSdQRRW3LRmgK/ZP8wxjW+Ai+2uolKTtuJzLx2mvbIeIoLqpg==", "dev": true, "dependencies": { "ci-info": "^3.1.1", "clean-regexp": "^1.0.0", "eslint-template-visitor": "^2.3.2", "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", "import-modules": "^2.1.0", "is-builtin-module": "^3.1.0", "lodash": "^4.17.21", @@ -10576,7 +10721,7 @@ "semver": "^7.3.5" }, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/sindresorhus/eslint-plugin-unicorn?sponsor=1" @@ -10612,15 +10757,6 @@ "node": ">=4" } }, - "node_modules/eslint-plugin-unicorn/node_modules/eslint-visitor-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", - "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/eslint-plugin-unicorn/node_modules/find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -10884,12 +11020,6 @@ "@babel/highlight": "^7.10.4" } }, - "node_modules/eslint/node_modules/acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", - "dev": true - }, "node_modules/eslint/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -11011,27 +11141,6 @@ "node": ">=4" } }, - "node_modules/eslint/node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", - "dev": true, - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/eslint/node_modules/esquery/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/eslint/node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", @@ -11296,9 +11405,9 @@ } }, "node_modules/esquery": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", - "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", "dev": true, "dependencies": { "estraverse": "^5.1.0" @@ -13541,12 +13650,15 @@ } }, "node_modules/is-core-module": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", - "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz", + "integrity": "sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==", "dev": true, "dependencies": { "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-data-descriptor": { @@ -15149,39 +15261,27 @@ } }, "node_modules/load-json-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", - "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", "dev": true, "dependencies": { "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", + "parse-json": "^4.0.0", + "pify": "^3.0.0", "strip-bom": "^3.0.0" }, "engines": { "node": ">=4" } }, - "node_modules/load-json-file/node_modules/parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "dependencies": { - "error-ex": "^1.2.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/load-json-file/node_modules/pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, "node_modules/load-json-file/node_modules/strip-bom": { @@ -16305,9 +16405,9 @@ } }, "node_modules/mocha": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.3.2.tgz", - "integrity": "sha512-UdmISwr/5w+uXLPKspgoV7/RXZwKRTiTjJ2/AC5ZiEztIoOYdfKb19+9jNmEInzx5pBsCyJQzarAxqIGBNYJhg==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.4.0.tgz", + "integrity": "sha512-hJaO0mwDXmZS4ghXsvPVriOhsxQ7ofcpQdm8dE+jISUOKopitvnXFQmpRR7jd2K6VBG6E26gU3IAbXXGIbu4sQ==", "dev": true, "dependencies": { "@ungap/promise-all-settled": "1.1.2", @@ -16342,6 +16442,10 @@ }, "engines": { "node": ">= 10.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" } }, "node_modules/mocha-badge-generator": { @@ -17596,21 +17700,6 @@ "node": ">=4.8" } }, - "node_modules/npm-run-all/node_modules/load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/npm-run-all/node_modules/path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", @@ -17620,41 +17709,6 @@ "node": ">=4" } }, - "node_modules/npm-run-all/node_modules/path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "dependencies": { - "pify": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/npm-run-all/node_modules/pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/npm-run-all/node_modules/read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dev": true, - "dependencies": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/npm-run-all/node_modules/shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -17676,15 +17730,6 @@ "node": ">=0.10.0" } }, - "node_modules/npm-run-all/node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/npm-run-all/node_modules/which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -18059,18 +18104,21 @@ } }, "node_modules/object.values": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", - "integrity": "sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.3.tgz", + "integrity": "sha512-nkF6PfDB9alkOUxpf1HNm/QlkeW3SReqL5WXeBLpEJJnlPSvRaDQpW3gQTksTN3fgJX4hL42RzKyOin6ff3tyw==", "dev": true, "dependencies": { + "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1", - "function-bind": "^1.1.1", + "es-abstract": "^1.18.0-next.2", "has": "^1.0.3" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/omggif": { @@ -18100,15 +18148,18 @@ } }, "node_modules/onetime": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", - "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "dependencies": { "mimic-fn": "^2.1.0" }, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/only": { @@ -18715,6 +18766,30 @@ "node": ">= 0.8.0" } }, + "node_modules/path-starts-with": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/path-starts-with/-/path-starts-with-1.0.0.tgz", + "integrity": "sha1-soJDAV6LE43lcmgqxS2kLmRq2E4=", + "dev": true, + "dependencies": { + "normalize-path": "^2.1.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/path-starts-with/node_modules/normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "dependencies": { + "remove-trailing-separator": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -18845,6 +18920,76 @@ "node": ">=6" } }, + "node_modules/pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", + "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", + "dev": true, + "dependencies": { + "find-up": "^2.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pkg-up/node_modules/find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "dependencies": { + "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pkg-up/node_modules/locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pkg-up/node_modules/p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "dependencies": { + "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pkg-up/node_modules/p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "dependencies": { + "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pkg-up/node_modules/p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/pluralize": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", @@ -19267,27 +19412,27 @@ } }, "node_modules/read-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", - "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", "dev": true, "dependencies": { - "load-json-file": "^2.0.0", + "load-json-file": "^4.0.0", "normalize-package-data": "^2.3.2", - "path-type": "^2.0.0" + "path-type": "^3.0.0" }, "engines": { "node": ">=4" } }, "node_modules/read-pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", - "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", "dev": true, "dependencies": { "find-up": "^2.0.0", - "read-pkg": "^2.0.0" + "read-pkg": "^3.0.0" }, "engines": { "node": ">=4" @@ -19352,24 +19497,24 @@ } }, "node_modules/read-pkg/node_modules/path-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", - "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", "dev": true, "dependencies": { - "pify": "^2.0.0" + "pify": "^3.0.0" }, "engines": { "node": ">=4" } }, "node_modules/read-pkg/node_modules/pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, "node_modules/readable-stream": { @@ -19977,12 +20122,16 @@ "dev": true }, "node_modules/resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", "dev": true, "dependencies": { + "is-core-module": "^2.2.0", "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/resolve-from": { @@ -20126,9 +20275,9 @@ } }, "node_modules/rollup": { - "version": "2.45.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.45.2.tgz", - "integrity": "sha512-kRRU7wXzFHUzBIv0GfoFFIN3m9oteY4uAsKllIpQDId5cfnkWF2J130l+27dzDju0E6MScKiV0ZM5Bw8m4blYQ==", + "version": "2.47.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.47.0.tgz", + "integrity": "sha512-rqBjgq9hQfW0vRmz+0S062ORRNJXvwRpzxhFXORvar/maZqY6za3rgQ/p1Glg+j1hnc1GtYyQCPiAei95uTElg==", "bin": { "rollup": "dist/bin/rollup" }, @@ -21283,15 +21432,15 @@ } }, "node_modules/start-server-and-test": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-1.12.1.tgz", - "integrity": "sha512-qGQ2HQiF2yDIfyaHsXkHfoE5UOl4zJUbJ/gx2xOkfX7iPMXW9qHmoFyaMfIDJVLNkxCK7RxSrvWEI9hNVKQluw==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-1.12.2.tgz", + "integrity": "sha512-rjJF8N/8XVukEYR44Ehm8LAZIDjWCQKXX54W8UQ8pXz3yDKPCdqTqJy7VYnCAknPw65cmLfPxz8M2+K/zCAvVQ==", "dev": true, "dependencies": { "bluebird": "3.7.2", "check-more-types": "2.24.0", "debug": "4.3.1", - "execa": "3.4.0", + "execa": "5.0.0", "lazy-ass": "1.6.0", "ps-tree": "1.2.0", "wait-on": "5.3.0" @@ -21329,24 +21478,47 @@ } }, "node_modules/start-server-and-test/node_modules/execa": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-3.4.0.tgz", - "integrity": "sha512-r9vdGQk4bmCuK1yKQu1KTwcT2zwfWdbdaXfCtAh+5nU/4fSX+JAb7vZGvI5naJrQlvONrEB20jeruESI69530g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz", + "integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==", "dev": true, "dependencies": { - "cross-spawn": "^7.0.0", - "get-stream": "^5.0.0", - "human-signals": "^1.1.1", + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", "is-stream": "^2.0.0", "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.0", - "onetime": "^5.1.0", - "p-finally": "^2.0.0", - "signal-exit": "^3.0.2", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", "strip-final-newline": "^2.0.0" }, "engines": { - "node": "^8.12.0 || >=9.7.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/start-server-and-test/node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/start-server-and-test/node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "engines": { + "node": ">=10.17.0" } }, "node_modules/start-server-and-test/node_modules/ms": { @@ -21355,15 +21527,6 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/start-server-and-test/node_modules/p-finally": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-2.0.1.tgz", - "integrity": "sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/state-toggle": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/state-toggle/-/state-toggle-1.0.3.tgz", @@ -21728,9 +21891,9 @@ } }, "node_modules/systemjs": { - "version": "6.8.3", - "resolved": "https://registry.npmjs.org/systemjs/-/systemjs-6.8.3.tgz", - "integrity": "sha512-UcTY+FEA1B7e+bpJk1TI+a9Na6LG7wFEqW7ED16cLqLuQfI/9Ri0rsXm3tKlIgNoHyLHZycjdAOijzNbzelgwA==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/systemjs/-/systemjs-6.9.0.tgz", + "integrity": "sha512-THLzcb7WzoW0I+tHB4PQge0BqqN+CAUQJ9gPc1MieqD1gnhxNUKYrhRlN5ov94saOYVVR5NZFQqQhnxi9/WEGg==", "dev": true }, "node_modules/table": { @@ -24149,26 +24312,26 @@ } }, "@babel/compat-data": { - "version": "7.13.15", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.13.15.tgz", - "integrity": "sha512-ltnibHKR1VnrU4ymHyQ/CXtNXI6yZC0oJThyW78Hft8XndANwi+9H+UIklBDraIjFEJzw8wmcM427oDd9KS5wA==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.14.0.tgz", + "integrity": "sha512-vu9V3uMM/1o5Hl5OekMUowo3FqXLJSw+s+66nt0fSWVWTtmosdzn45JHOB3cPtZoe6CTBDzvSw0RdOY85Q37+Q==", "dev": true }, "@babel/core": { - "version": "7.13.16", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.13.16.tgz", - "integrity": "sha512-sXHpixBiWWFti0AV2Zq7avpTasr6sIAu7Y396c608541qAU2ui4a193m0KSQmfPSKFZLnQ3cvlKDOm3XkuXm3Q==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.14.2.tgz", + "integrity": "sha512-OgC1mON+l4U4B4wiohJlQNUU3H73mpTyYY3j/c8U9dr9UagGGSm+WFpzjy/YLdoyjiG++c1kIDgxCo/mLwQJeQ==", "dev": true, "requires": { "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.13.16", + "@babel/generator": "^7.14.2", "@babel/helper-compilation-targets": "^7.13.16", - "@babel/helper-module-transforms": "^7.13.14", - "@babel/helpers": "^7.13.16", - "@babel/parser": "^7.13.16", + "@babel/helper-module-transforms": "^7.14.2", + "@babel/helpers": "^7.14.0", + "@babel/parser": "^7.14.2", "@babel/template": "^7.12.13", - "@babel/traverse": "^7.13.15", - "@babel/types": "^7.13.16", + "@babel/traverse": "^7.14.2", + "@babel/types": "^7.14.2", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -24220,12 +24383,12 @@ } }, "@babel/generator": { - "version": "7.13.16", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.13.16.tgz", - "integrity": "sha512-grBBR75UnKOcUWMp8WoDxNsWCFl//XCK6HWTrBQKTr5SV9f5g0pNOjdyzi/DTBv12S9GnYPInIXQBTky7OXEMg==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.2.tgz", + "integrity": "sha512-OnADYbKrffDVai5qcpkMxQ7caomHOoEwjkouqnN2QhydAjowFAZcsdecFIRUBdb+ZcruwYE4ythYmF1UBZU5xQ==", "dev": true, "requires": { - "@babel/types": "^7.13.16", + "@babel/types": "^7.14.2", "jsesc": "^2.5.1", "source-map": "^0.5.0" } @@ -24270,16 +24433,17 @@ } }, "@babel/helper-create-class-features-plugin": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.12.1.tgz", - "integrity": "sha512-hkL++rWeta/OVOBTRJc9a5Azh5mt5WgZUGAKMD8JM141YsE08K//bp1unBBieO6rUKkIPyUE0USQ30jAy3Sk1w==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.0.tgz", + "integrity": "sha512-6pXDPguA5zC40Y8oI5mqr+jEUpjMJonKvknvA+vD8CYDz5uuXEwWBK8sRAsE/t3gfb1k15AQb9RhwpscC4nUJQ==", "dev": true, "requires": { - "@babel/helper-function-name": "^7.10.4", - "@babel/helper-member-expression-to-functions": "^7.12.1", - "@babel/helper-optimise-call-expression": "^7.10.4", - "@babel/helper-replace-supers": "^7.12.1", - "@babel/helper-split-export-declaration": "^7.10.4" + "@babel/helper-annotate-as-pure": "^7.12.13", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/helper-replace-supers": "^7.13.12", + "@babel/helper-split-export-declaration": "^7.12.13" } }, "@babel/helper-create-regexp-features-plugin": { @@ -24293,17 +24457,6 @@ "regexpu-core": "^4.7.0" } }, - "@babel/helper-define-map": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.10.5.tgz", - "integrity": "sha512-fMw4kgFB720aQFXSVaXr79pjjcW5puTCM16+rECJ/plGS+zByelE8l9nCpV1GibxTnFVmUuYG9U8wYfQHdzOEQ==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.10.4", - "@babel/types": "^7.10.5", - "lodash": "^4.17.19" - } - }, "@babel/helper-define-polyfill-provider": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.0.tgz", @@ -24354,14 +24507,14 @@ } }, "@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.2.tgz", + "integrity": "sha512-NYZlkZRydxw+YT56IlhIcS8PAhb+FEUiOzuhFTfqDyPmzAhRge6ua0dQYT/Uh0t/EDHq05/i+e5M2d4XvjgarQ==", "dev": true, "requires": { "@babel/helper-get-function-arity": "^7.12.13", "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" + "@babel/types": "^7.14.2" } }, "@babel/helper-get-function-arity": { @@ -24402,19 +24555,19 @@ } }, "@babel/helper-module-transforms": { - "version": "7.13.14", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.13.14.tgz", - "integrity": "sha512-QuU/OJ0iAOSIatyVZmfqB0lbkVP0kDRiKj34xy+QNsnVZi/PA6BoSoreeqnxxa9EHFAIL0R9XOaAR/G9WlIy5g==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.2.tgz", + "integrity": "sha512-OznJUda/soKXv0XhpvzGWDnml4Qnwp16GN+D/kZIdLsWoHj05kyu8Rm5kXmMef+rVJZ0+4pSGLkeixdqNUATDA==", "dev": true, "requires": { "@babel/helper-module-imports": "^7.13.12", "@babel/helper-replace-supers": "^7.13.12", "@babel/helper-simple-access": "^7.13.12", "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/helper-validator-identifier": "^7.12.11", + "@babel/helper-validator-identifier": "^7.14.0", "@babel/template": "^7.12.13", - "@babel/traverse": "^7.13.13", - "@babel/types": "^7.13.14" + "@babel/traverse": "^7.14.2", + "@babel/types": "^7.14.2" } }, "@babel/helper-optimise-call-expression": { @@ -24492,9 +24645,9 @@ } }, "@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", "dev": true }, "@babel/helper-validator-option": { @@ -24516,14 +24669,14 @@ } }, "@babel/helpers": { - "version": "7.13.16", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.13.16.tgz", - "integrity": "sha512-x5otxUaLpdWHl02P4L94wBU+2BJXBkvO+6d6uzQ+xD9/h2hTSAwA5O8QV8GqKx/l8i+VYmKKQg9e2QGTa2Wu3Q==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.14.0.tgz", + "integrity": "sha512-+ufuXprtQ1D1iZTO/K9+EBRn+qPWMJjZSw/S0KlFrxCw4tkrzv9grgpDHkY9MeQTjTY8i2sp7Jep8DfU6tN9Mg==", "dev": true, "requires": { "@babel/template": "^7.12.13", - "@babel/traverse": "^7.13.15", - "@babel/types": "^7.13.16" + "@babel/traverse": "^7.14.0", + "@babel/types": "^7.14.0" } }, "@babel/highlight": { @@ -24538,9 +24691,9 @@ } }, "@babel/parser": { - "version": "7.13.16", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.16.tgz", - "integrity": "sha512-6bAg36mCwuqLO0hbR+z7PHuqWiCeP7Dzg73OpQwsAB1Eb8HnGEz5xYBzCfbu+YjoaJsJs+qheDxVAuqbt3ILEw==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.2.tgz", + "integrity": "sha512-IoVDIHpsgE/fu7eXBeRWt8zLbDrSvD7H1gpomOkPpBoEN8KCruCqSDdqo8dddwQQrui30KSvQBaMUOJiuFu6QQ==", "dev": true }, "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { @@ -24555,9 +24708,9 @@ } }, "@babel/plugin-proposal-async-generator-functions": { - "version": "7.13.15", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.13.15.tgz", - "integrity": "sha512-VapibkWzFeoa6ubXy/NgV5U2U4MVnUlvnx6wo1XhlsaTrLYWE0UFpDQsVrmn22q5CzeloqJ8gEMHSKxuee6ZdA==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.14.2.tgz", + "integrity": "sha512-b1AM4F6fwck4N8ItZ/AtC4FP/cqZqmKRQ4FaTDutwSYyjuhtvsGEMLK4N/ztV/ImP40BjIDyMgBQAeAMsQYVFQ==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.13.0", @@ -24573,27 +24726,22 @@ "requires": { "@babel/helper-create-class-features-plugin": "^7.13.0", "@babel/helper-plugin-utils": "^7.13.0" - }, - "dependencies": { - "@babel/helper-create-class-features-plugin": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.13.0.tgz", - "integrity": "sha512-twwzhthM4/+6o9766AW2ZBHpIHPSGrPGk1+WfHiu13u/lBnggXGNYCpeAyVfNwGDKfkhEDp+WOD/xafoJ2iLjA==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-member-expression-to-functions": "^7.13.0", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/helper-replace-supers": "^7.13.0", - "@babel/helper-split-export-declaration": "^7.12.13" - } - } + } + }, + "@babel/plugin-proposal-class-static-block": { + "version": "7.13.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.13.11.tgz", + "integrity": "sha512-fJTdFI4bfnMjvxJyNuaf8i9mVcZ0UhetaGEUHaHV9KEnibLugJkZAtXikR8KcYj+NYmI4DZMS8yQAyg+hvfSqg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/plugin-syntax-class-static-block": "^7.12.13" } }, "@babel/plugin-proposal-dynamic-import": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.13.8.tgz", - "integrity": "sha512-ONWKj0H6+wIRCkZi9zSbZtE/r73uOhMVHh256ys0UzfM7I3d4n+spZNWjOnJv2gzopumP2Wxi186vI8N0Y2JyQ==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.14.2.tgz", + "integrity": "sha512-oxVQZIWFh91vuNEMKltqNsKLFWkOIyJc95k2Gv9lWVyDfPUQGSSlbDEgWuJUU1afGE9WwlzpucMZ3yDRHIItkA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.13.0", @@ -24601,19 +24749,19 @@ } }, "@babel/plugin-proposal-export-namespace-from": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.12.13.tgz", - "integrity": "sha512-INAgtFo4OnLN3Y/j0VwAgw3HDXcDtX+C/erMvWzuV9v71r7urb6iyMXu7eM9IgLr1ElLlOkaHjJ0SbCmdOQ3Iw==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.14.2.tgz", + "integrity": "sha512-sRxW3z3Zp3pFfLAgVEvzTFutTXax837oOatUIvSG9o5gRj9mKwm3br1Se5f4QalTQs9x4AzlA/HrCWbQIHASUQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.12.13", + "@babel/helper-plugin-utils": "^7.13.0", "@babel/plugin-syntax-export-namespace-from": "^7.8.3" } }, "@babel/plugin-proposal-json-strings": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.13.8.tgz", - "integrity": "sha512-w4zOPKUFPX1mgvTmL/fcEqy34hrQ1CRcGxdphBc6snDnnqJ47EZDIyop6IwXzAC8G916hsIuXB2ZMBCExC5k7Q==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.14.2.tgz", + "integrity": "sha512-w2DtsfXBBJddJacXMBhElGEYqCZQqN99Se1qeYn8DVLB33owlrlLftIbMzn5nz1OITfDVknXF433tBrLEAOEjA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.13.0", @@ -24621,9 +24769,9 @@ } }, "@babel/plugin-proposal-logical-assignment-operators": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.13.8.tgz", - "integrity": "sha512-aul6znYB4N4HGweImqKn59Su9RS8lbUIqxtXTOcAGtNIDczoEFv+l1EhmX8rUBp3G1jMjKJm8m0jXVp63ZpS4A==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.14.2.tgz", + "integrity": "sha512-1JAZtUrqYyGsS7IDmFeaem+/LJqujfLZ2weLR9ugB0ufUPjzf8cguyVT1g5im7f7RXxuLq1xUxEzvm68uYRtGg==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.13.0", @@ -24631,9 +24779,9 @@ } }, "@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.13.8.tgz", - "integrity": "sha512-iePlDPBn//UhxExyS9KyeYU7RM9WScAG+D3Hhno0PLJebAEpDZMocbDe64eqynhNAnwz/vZoL/q/QB2T1OH39A==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.14.2.tgz", + "integrity": "sha512-ebR0zU9OvI2N4qiAC38KIAK75KItpIPTpAtd2r4OZmMFeKbKJpUFLYP2EuDut82+BmYi8sz42B+TfTptJ9iG5Q==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.13.0", @@ -24641,32 +24789,32 @@ } }, "@babel/plugin-proposal-numeric-separator": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.13.tgz", - "integrity": "sha512-O1jFia9R8BUCl3ZGB7eitaAPu62TXJRHn7rh+ojNERCFyqRwJMTmhz+tJ+k0CwI6CLjX/ee4qW74FSqlq9I35w==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.14.2.tgz", + "integrity": "sha512-DcTQY9syxu9BpU3Uo94fjCB3LN9/hgPS8oUL7KrSW3bA2ePrKZZPJcc5y0hoJAM9dft3pGfErtEUvxXQcfLxUg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.12.13", + "@babel/helper-plugin-utils": "^7.13.0", "@babel/plugin-syntax-numeric-separator": "^7.10.4" } }, "@babel/plugin-proposal-object-rest-spread": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.13.8.tgz", - "integrity": "sha512-DhB2EuB1Ih7S3/IRX5AFVgZ16k3EzfRbq97CxAVI1KSYcW+lexV8VZb7G7L8zuPVSdQMRn0kiBpf/Yzu9ZKH0g==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.14.2.tgz", + "integrity": "sha512-hBIQFxwZi8GIp934+nj5uV31mqclC1aYDhctDu5khTi9PCCUOczyy0b34W0oE9U/eJXiqQaKyVsmjeagOaSlbw==", "dev": true, "requires": { - "@babel/compat-data": "^7.13.8", - "@babel/helper-compilation-targets": "^7.13.8", + "@babel/compat-data": "^7.14.0", + "@babel/helper-compilation-targets": "^7.13.16", "@babel/helper-plugin-utils": "^7.13.0", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.13.0" + "@babel/plugin-transform-parameters": "^7.14.2" } }, "@babel/plugin-proposal-optional-catch-binding": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.13.8.tgz", - "integrity": "sha512-0wS/4DUF1CuTmGo+NiaHfHcVSeSLj5S3e6RivPTg/2k3wOv3jO35tZ6/ZWsQhQMvdgI7CwphjQa/ccarLymHVA==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.14.2.tgz", + "integrity": "sha512-XtkJsmJtBaUbOxZsNk0Fvrv8eiqgneug0A6aqLFZ4TSkar2L5dSXWcnUKHgmjJt49pyB/6ZHvkr3dPgl9MOWRQ==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.13.0", @@ -24674,9 +24822,9 @@ } }, "@babel/plugin-proposal-optional-chaining": { - "version": "7.13.12", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.13.12.tgz", - "integrity": "sha512-fcEdKOkIB7Tf4IxrgEVeFC4zeJSTr78no9wTdBuZZbqF64kzllU0ybo2zrzm7gUQfxGhBgq4E39oRs8Zx/RMYQ==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.14.2.tgz", + "integrity": "sha512-qQByMRPwMZJainfig10BoaDldx/+VDtNcrA7qdNaEOAj6VXud+gfrkA8j4CRAU5HjnWREXqIpSpH30qZX1xivA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.13.0", @@ -24692,21 +24840,18 @@ "requires": { "@babel/helper-create-class-features-plugin": "^7.13.0", "@babel/helper-plugin-utils": "^7.13.0" - }, - "dependencies": { - "@babel/helper-create-class-features-plugin": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.13.0.tgz", - "integrity": "sha512-twwzhthM4/+6o9766AW2ZBHpIHPSGrPGk1+WfHiu13u/lBnggXGNYCpeAyVfNwGDKfkhEDp+WOD/xafoJ2iLjA==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-member-expression-to-functions": "^7.13.0", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/helper-replace-supers": "^7.13.0", - "@babel/helper-split-export-declaration": "^7.12.13" - } - } + } + }, + "@babel/plugin-proposal-private-property-in-object": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.14.0.tgz", + "integrity": "sha512-59ANdmEwwRUkLjB7CRtwJxxwtjESw+X2IePItA+RGQh+oy5RmpCh/EvVVvh5XQc3yxsm5gtv0+i9oBZhaDNVTg==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.12.13", + "@babel/helper-create-class-features-plugin": "^7.14.0", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/plugin-syntax-private-property-in-object": "^7.14.0" } }, "@babel/plugin-proposal-unicode-property-regex": { @@ -24737,6 +24882,15 @@ "@babel/helper-plugin-utils": "^7.12.13" } }, + "@babel/plugin-syntax-class-static-block": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.12.13.tgz", + "integrity": "sha512-ZmKQ0ZXR0nYpHZIIuj9zE7oIqCx2hw9TKi+lIo73NNrMPAZGHfS92/VRV0ZmPj6H2ffBgyFHXvJ5NYsNeEaP2A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13" + } + }, "@babel/plugin-syntax-dynamic-import": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", @@ -24827,6 +24981,15 @@ "@babel/helper-plugin-utils": "^7.8.0" } }, + "@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.0.tgz", + "integrity": "sha512-bda3xF8wGl5/5btF794utNOL0Jw+9jE5C1sLZcoK7c4uonE/y3iQiyG+KbkF3WBV/paX58VCpjhxLPkdj5Fe4w==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.13.0" + } + }, "@babel/plugin-syntax-top-level-await": { "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.13.tgz", @@ -24866,27 +25029,26 @@ } }, "@babel/plugin-transform-block-scoping": { - "version": "7.12.12", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.12.12.tgz", - "integrity": "sha512-VOEPQ/ExOVqbukuP7BYJtI5ZxxsmegTwzZ04j1aF0dkSypGo9XpDHuOrABsJu+ie+penpSJheDJ11x1BEZNiyQ==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.14.2.tgz", + "integrity": "sha512-neZZcP19NugZZqNwMTH+KoBjx5WyvESPSIOQb4JHpfd+zPfqcH65RMu5xJju5+6q/Y2VzYrleQTr+b6METyyxg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.10.4" + "@babel/helper-plugin-utils": "^7.13.0" } }, "@babel/plugin-transform-classes": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.12.1.tgz", - "integrity": "sha512-/74xkA7bVdzQTBeSUhLLJgYIcxw/dpEpCdRDiHgPJ3Mv6uC11UhjpOhl72CgqbBCmt1qtssCyB2xnJm1+PFjog==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.14.2.tgz", + "integrity": "sha512-7oafAVcucHquA/VZCsXv/gmuiHeYd64UJyyTYU+MPfNu0KeNlxw06IeENBO8bJjXVbolu+j1MM5aKQtH1OMCNg==", "dev": true, "requires": { - "@babel/helper-annotate-as-pure": "^7.10.4", - "@babel/helper-define-map": "^7.10.4", - "@babel/helper-function-name": "^7.10.4", - "@babel/helper-optimise-call-expression": "^7.10.4", - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/helper-replace-supers": "^7.12.1", - "@babel/helper-split-export-declaration": "^7.10.4", + "@babel/helper-annotate-as-pure": "^7.12.13", + "@babel/helper-function-name": "^7.14.2", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-replace-supers": "^7.13.12", + "@babel/helper-split-export-declaration": "^7.12.13", "globals": "^11.1.0" } }, @@ -24900,12 +25062,12 @@ } }, "@babel/plugin-transform-destructuring": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.12.1.tgz", - "integrity": "sha512-fRMYFKuzi/rSiYb2uRLiUENJOKq4Gnl+6qOv5f8z0TZXg3llUwUhsNNwrwaT/6dUhJTzNpBr+CUvEWBtfNY1cw==", + "version": "7.13.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.13.17.tgz", + "integrity": "sha512-UAUqiLv+uRLO+xuBKKMEpC+t7YRNVRqBsWWq1yKXbBZBje/t3IXCiSinZhjn/DC3qzBfICeYd2EFGEbHsh5RLA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.10.4" + "@babel/helper-plugin-utils": "^7.13.0" } }, "@babel/plugin-transform-dotall-regex": { @@ -24975,25 +25137,25 @@ } }, "@babel/plugin-transform-modules-amd": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.12.1.tgz", - "integrity": "sha512-tDW8hMkzad5oDtzsB70HIQQRBiTKrhfgwC/KkJeGsaNFTdWhKNt/BiE8c5yj19XiGyrxpbkOfH87qkNg1YGlOQ==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.14.2.tgz", + "integrity": "sha512-hPC6XBswt8P3G2D1tSV2HzdKvkqOpmbyoy+g73JG0qlF/qx2y3KaMmXb1fLrpmWGLZYA0ojCvaHdzFWjlmV+Pw==", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.12.1", - "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-module-transforms": "^7.14.2", + "@babel/helper-plugin-utils": "^7.13.0", "babel-plugin-dynamic-import-node": "^2.3.3" } }, "@babel/plugin-transform-modules-commonjs": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.13.8.tgz", - "integrity": "sha512-9QiOx4MEGglfYZ4XOnU79OHr6vIWUakIj9b4mioN8eQIoEh+pf5p/zEB36JpDFWA12nNMiRf7bfoRvl9Rn79Bw==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.14.0.tgz", + "integrity": "sha512-EX4QePlsTaRZQmw9BsoPeyh5OCtRGIhwfLquhxGp5e32w+dyL8htOcDwamlitmNFK6xBZYlygjdye9dbd9rUlQ==", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.13.0", + "@babel/helper-module-transforms": "^7.14.0", "@babel/helper-plugin-utils": "^7.13.0", - "@babel/helper-simple-access": "^7.12.13", + "@babel/helper-simple-access": "^7.13.12", "babel-plugin-dynamic-import-node": "^2.3.3" } }, @@ -25011,13 +25173,13 @@ } }, "@babel/plugin-transform-modules-umd": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.12.1.tgz", - "integrity": "sha512-aEIubCS0KHKM0zUos5fIoQm+AZUMt1ZvMpqz0/H5qAQ7vWylr9+PLYurT+Ic7ID/bKLd4q8hDovaG3Zch2uz5Q==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.14.0.tgz", + "integrity": "sha512-nPZdnWtXXeY7I87UZr9VlsWme3Y0cfFFE41Wbxz4bbaexAjNMInXPFUpRRUJ8NoMm0Cw+zxbqjdPmLhcjfazMw==", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.12.1", - "@babel/helper-plugin-utils": "^7.10.4" + "@babel/helper-module-transforms": "^7.14.0", + "@babel/helper-plugin-utils": "^7.13.0" } }, "@babel/plugin-transform-named-capturing-groups-regex": { @@ -25075,9 +25237,9 @@ } }, "@babel/plugin-transform-parameters": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.13.0.tgz", - "integrity": "sha512-Jt8k/h/mIwE2JFEOb3lURoY5C85ETcYPnbuAJ96zRBzh1XHtQZfs62ChZ6EP22QlC8c7Xqr9q+e1SU5qttwwjw==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.14.2.tgz", + "integrity": "sha512-NxoVmA3APNCC1JdMXkdYXuQS+EMdqy0vIwyDHeKHiJKRxmp1qGSdb0JLEIoPRhkx6H/8Qi3RJ3uqOCYw8giy9A==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.13.0" @@ -25270,31 +25432,34 @@ } }, "@babel/preset-env": { - "version": "7.13.15", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.13.15.tgz", - "integrity": "sha512-D4JAPMXcxk69PKe81jRJ21/fP/uYdcTZ3hJDF5QX2HSI9bBxxYw/dumdR6dGumhjxlprHPE4XWoPaqzZUVy2MA==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.14.2.tgz", + "integrity": "sha512-7dD7lVT8GMrE73v4lvDEb85cgcQhdES91BSD7jS/xjC6QY8PnRhux35ac+GCpbiRhp8crexBvZZqnaL6VrY8TQ==", "dev": true, "requires": { - "@babel/compat-data": "^7.13.15", - "@babel/helper-compilation-targets": "^7.13.13", + "@babel/compat-data": "^7.14.0", + "@babel/helper-compilation-targets": "^7.13.16", "@babel/helper-plugin-utils": "^7.13.0", "@babel/helper-validator-option": "^7.12.17", "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.13.12", - "@babel/plugin-proposal-async-generator-functions": "^7.13.15", + "@babel/plugin-proposal-async-generator-functions": "^7.14.2", "@babel/plugin-proposal-class-properties": "^7.13.0", - "@babel/plugin-proposal-dynamic-import": "^7.13.8", - "@babel/plugin-proposal-export-namespace-from": "^7.12.13", - "@babel/plugin-proposal-json-strings": "^7.13.8", - "@babel/plugin-proposal-logical-assignment-operators": "^7.13.8", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.13.8", - "@babel/plugin-proposal-numeric-separator": "^7.12.13", - "@babel/plugin-proposal-object-rest-spread": "^7.13.8", - "@babel/plugin-proposal-optional-catch-binding": "^7.13.8", - "@babel/plugin-proposal-optional-chaining": "^7.13.12", + "@babel/plugin-proposal-class-static-block": "^7.13.11", + "@babel/plugin-proposal-dynamic-import": "^7.14.2", + "@babel/plugin-proposal-export-namespace-from": "^7.14.2", + "@babel/plugin-proposal-json-strings": "^7.14.2", + "@babel/plugin-proposal-logical-assignment-operators": "^7.14.2", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.2", + "@babel/plugin-proposal-numeric-separator": "^7.14.2", + "@babel/plugin-proposal-object-rest-spread": "^7.14.2", + "@babel/plugin-proposal-optional-catch-binding": "^7.14.2", + "@babel/plugin-proposal-optional-chaining": "^7.14.2", "@babel/plugin-proposal-private-methods": "^7.13.0", + "@babel/plugin-proposal-private-property-in-object": "^7.14.0", "@babel/plugin-proposal-unicode-property-regex": "^7.12.13", "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.12.13", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-export-namespace-from": "^7.8.3", "@babel/plugin-syntax-json-strings": "^7.8.3", @@ -25304,14 +25469,15 @@ "@babel/plugin-syntax-object-rest-spread": "^7.8.3", "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.0", "@babel/plugin-syntax-top-level-await": "^7.12.13", "@babel/plugin-transform-arrow-functions": "^7.13.0", "@babel/plugin-transform-async-to-generator": "^7.13.0", "@babel/plugin-transform-block-scoped-functions": "^7.12.13", - "@babel/plugin-transform-block-scoping": "^7.12.13", - "@babel/plugin-transform-classes": "^7.13.0", + "@babel/plugin-transform-block-scoping": "^7.14.2", + "@babel/plugin-transform-classes": "^7.14.2", "@babel/plugin-transform-computed-properties": "^7.13.0", - "@babel/plugin-transform-destructuring": "^7.13.0", + "@babel/plugin-transform-destructuring": "^7.13.17", "@babel/plugin-transform-dotall-regex": "^7.12.13", "@babel/plugin-transform-duplicate-keys": "^7.12.13", "@babel/plugin-transform-exponentiation-operator": "^7.12.13", @@ -25319,14 +25485,14 @@ "@babel/plugin-transform-function-name": "^7.12.13", "@babel/plugin-transform-literals": "^7.12.13", "@babel/plugin-transform-member-expression-literals": "^7.12.13", - "@babel/plugin-transform-modules-amd": "^7.13.0", - "@babel/plugin-transform-modules-commonjs": "^7.13.8", + "@babel/plugin-transform-modules-amd": "^7.14.2", + "@babel/plugin-transform-modules-commonjs": "^7.14.0", "@babel/plugin-transform-modules-systemjs": "^7.13.8", - "@babel/plugin-transform-modules-umd": "^7.13.0", + "@babel/plugin-transform-modules-umd": "^7.14.0", "@babel/plugin-transform-named-capturing-groups-regex": "^7.12.13", "@babel/plugin-transform-new-target": "^7.12.13", "@babel/plugin-transform-object-super": "^7.12.13", - "@babel/plugin-transform-parameters": "^7.13.0", + "@babel/plugin-transform-parameters": "^7.14.2", "@babel/plugin-transform-property-literals": "^7.12.13", "@babel/plugin-transform-regenerator": "^7.13.15", "@babel/plugin-transform-reserved-words": "^7.12.13", @@ -25338,7 +25504,7 @@ "@babel/plugin-transform-unicode-escapes": "^7.12.13", "@babel/plugin-transform-unicode-regex": "^7.12.13", "@babel/preset-modules": "^0.1.4", - "@babel/types": "^7.13.14", + "@babel/types": "^7.14.2", "babel-plugin-polyfill-corejs2": "^0.2.0", "babel-plugin-polyfill-corejs3": "^0.2.0", "babel-plugin-polyfill-regenerator": "^0.2.0", @@ -25414,30 +25580,6 @@ "@babel/helper-plugin-utils": "^7.12.13" } }, - "@babel/plugin-transform-block-scoping": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.12.13.tgz", - "integrity": "sha512-Pxwe0iqWJX4fOOM2kEZeUuAxHMWb9nK+9oh5d11bsLoB0xMg+mkDpt0eYuDZB7ETrY9bbcVlKUGTOGWy7BHsMQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.12.13" - } - }, - "@babel/plugin-transform-classes": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.13.0.tgz", - "integrity": "sha512-9BtHCPUARyVH1oXGcSJD3YpsqRLROJx5ZNP6tN5vnk17N0SVf9WCtf8Nuh1CFmgByKKAIMstitKduoCmsaDK5g==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.12.13", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/helper-replace-supers": "^7.13.0", - "@babel/helper-split-export-declaration": "^7.12.13", - "globals": "^11.1.0" - } - }, "@babel/plugin-transform-computed-properties": { "version": "7.13.0", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.13.0.tgz", @@ -25447,15 +25589,6 @@ "@babel/helper-plugin-utils": "^7.13.0" } }, - "@babel/plugin-transform-destructuring": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.13.0.tgz", - "integrity": "sha512-zym5em7tePoNT9s964c0/KU3JPPnuq7VhIxPRefJ4/s82cD+q1mgKfuGRDMCPL0HTyKz4dISuQlCusfgCJ86HA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.13.0" - } - }, "@babel/plugin-transform-dotall-regex": { "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.12.13.tgz", @@ -25522,27 +25655,6 @@ "@babel/helper-plugin-utils": "^7.12.13" } }, - "@babel/plugin-transform-modules-amd": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.13.0.tgz", - "integrity": "sha512-EKy/E2NHhY/6Vw5d1k3rgoobftcNUmp9fGjb9XZwQLtTctsRBOTRO7RHHxfIky1ogMN5BxN7p9uMA3SzPfotMQ==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.13.0", - "@babel/helper-plugin-utils": "^7.13.0", - "babel-plugin-dynamic-import-node": "^2.3.3" - } - }, - "@babel/plugin-transform-modules-umd": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.13.0.tgz", - "integrity": "sha512-D/ILzAh6uyvkWjKKyFE/W0FzWwasv6vPTSqPcjxFqn6QpX3u8DjRVliq4F2BamO2Wee/om06Vyy+vPkNrd4wxw==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.13.0", - "@babel/helper-plugin-utils": "^7.13.0" - } - }, "@babel/plugin-transform-named-capturing-groups-regex": { "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.12.13.tgz", @@ -25715,9 +25827,9 @@ } }, "@babel/runtime-corejs3": { - "version": "7.13.17", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.13.17.tgz", - "integrity": "sha512-RGXINY1YvduBlGrP+vHjJqd/nK7JVpfM4rmZLGMx77WoL3sMrhheA0qxii9VNn1VHnxJLEyxmvCB+Wqc+x/FMw==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.14.0.tgz", + "integrity": "sha512-0R0HTZWHLk6G8jIk0FtoX+AatCtKnswS98VhXwGImFc759PJRp4Tru0PQYZofyijTFUr+gT8Mu7sgXVJLQ0ceg==", "requires": { "core-js-pure": "^3.0.0", "regenerator-runtime": "^0.13.4" @@ -25735,17 +25847,17 @@ } }, "@babel/traverse": { - "version": "7.13.15", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.13.15.tgz", - "integrity": "sha512-/mpZMNvj6bce59Qzl09fHEs8Bt8NnpEDQYleHUPZQ3wXUMvXi+HJPLars68oAbmp839fGoOkv2pSL2z9ajCIaQ==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.2.tgz", + "integrity": "sha512-TsdRgvBFHMyHOOzcP9S6QU0QQtjxlRpEYOy3mcCO5RgmC305ki42aSAmfZEMSSYBla2oZ9BMqYlncBaKmD/7iA==", "dev": true, "requires": { "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.13.9", - "@babel/helper-function-name": "^7.12.13", + "@babel/generator": "^7.14.2", + "@babel/helper-function-name": "^7.14.2", "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.13.15", - "@babel/types": "^7.13.14", + "@babel/parser": "^7.14.2", + "@babel/types": "^7.14.2", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -25768,12 +25880,12 @@ } }, "@babel/types": { - "version": "7.13.16", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.16.tgz", - "integrity": "sha512-7enM8Wxhrl1hB1+k6+xO6RmxpNkaveRWkdpyii8DkrLWRgr0l3x29/SEuhTIkP+ynHsU/Hpjn8Evd/axv/ll6Q==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz", + "integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.12.11", + "@babel/helper-validator-identifier": "^7.14.0", "to-fast-properties": "^2.0.0" } }, @@ -26373,10 +26485,21 @@ } } }, + "@es-joy/jsdoccomment": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.4.4.tgz", + "integrity": "sha512-ua4qDt9dQb4qt5OI38eCZcQZYE5Bq3P0GzgvDARdT8Lt0mAUpxKTPy8JGGqEvF77tG1irKDZ3WreeezEa3P43w==", + "dev": true, + "requires": { + "comment-parser": "^1.1.5", + "esquery": "^1.4.0", + "jsdoctypeparser": "^9.0.0" + } + }, "@eslint/eslintrc": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.0.tgz", - "integrity": "sha512-2ZPCc+uNbjV5ERJr+aKSPRwZgKd2z11x0EgLvb1PURmUrn9QNRXFqje0Ldq454PfAVyaJYyrDvvIKSFP4NnBog==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.1.tgz", + "integrity": "sha512-5v7TDE9plVhvxQeWLXDTvFvJBdH6pEsdnl2g/dAptmuFEPedQ4Erq5rsDsX+mvAM610IhNaO2W5V1dOOnDKxkQ==", "dev": true, "requires": { "ajv": "^6.12.4", @@ -26390,24 +26513,6 @@ "strip-json-comments": "^3.1.1" }, "dependencies": { - "acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", - "dev": true - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, "debug": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", @@ -27313,18 +27418,6 @@ "deepmerge": "^4.2.2", "is-module": "^1.0.0", "resolve": "^1.19.0" - }, - "dependencies": { - "resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", - "dev": true, - "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" - } - } } }, "@rollup/plugin-replace": { @@ -27858,16 +27951,16 @@ } }, "@web/dev-server": { - "version": "0.1.16", - "resolved": "https://registry.npmjs.org/@web/dev-server/-/dev-server-0.1.16.tgz", - "integrity": "sha512-5NFhx8lU4NXFn4fmXxJTwjurezmf3tJ3XOq30f/Zx6A7oQoViWPqjK0sp6PKzyR29tcn1/i+Ex5BTo9IHrW3jQ==", + "version": "0.1.17", + "resolved": "https://registry.npmjs.org/@web/dev-server/-/dev-server-0.1.17.tgz", + "integrity": "sha512-2gdOjkQp97uaORkOL8X90f4retqZ2lA9YqHDljpf4SFg0JWoY8X7EJA9XQG1jJ2x46oQ5zqJX7AiSWc47B2k6A==", "dev": true, "requires": { "@babel/code-frame": "^7.12.11", "@rollup/plugin-node-resolve": "^11.0.1", "@types/command-line-args": "^5.0.0", "@web/config-loader": "^0.1.3", - "@web/dev-server-core": "^0.3.11", + "@web/dev-server-core": "^0.3.12", "@web/dev-server-rollup": "^0.3.3", "camelcase": "^6.2.0", "chalk": "^4.1.0", @@ -27988,9 +28081,9 @@ } }, "@web/dev-server-core": { - "version": "0.3.11", - "resolved": "https://registry.npmjs.org/@web/dev-server-core/-/dev-server-core-0.3.11.tgz", - "integrity": "sha512-6CXO4eoW7UIicXFWDP3pocwVliyiTFqqqGg+DN4xexBLiP9sWH4WYb57RwKEnd9/K+DjWbSu0D0tvjVzcftUIw==", + "version": "0.3.12", + "resolved": "https://registry.npmjs.org/@web/dev-server-core/-/dev-server-core-0.3.12.tgz", + "integrity": "sha512-PI7neqHvsgsE+GJnJNSjMGeWHSo8MgO99CAzVm6UtFeAjShmMGWp6WQTDJPzvsE4jnYhIg8EPwz2cqDIGnkU6A==", "requires": { "@types/koa": "^2.11.6", "@types/ws": "^7.4.0", @@ -28241,10 +28334,11 @@ } }, "acorn-jsx": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", - "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", - "dev": true + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "dev": true, + "requires": {} }, "acorn-node": { "version": "1.8.2", @@ -28334,9 +28428,9 @@ } }, "ajv": { - "version": "6.12.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz", - "integrity": "sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==", + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -28542,13 +28636,15 @@ "dev": true }, "array-includes": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", - "integrity": "sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.3.tgz", + "integrity": "sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A==", "dev": true, "requires": { + "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.17.0", + "es-abstract": "^1.18.0-next.2", + "get-intrinsic": "^1.1.1", "is-string": "^1.0.5" } }, @@ -28565,13 +28661,14 @@ "dev": true }, "array.prototype.flat": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz", - "integrity": "sha512-gBlRZV0VSmfPIeWfuuy56XZMvbVfbEUnOXUvt3F/eUUUSyzlgLxhEX4YAEpxNAogRGehPSnfXyPtYyKAhkzQhQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz", + "integrity": "sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==", "dev": true, "requires": { + "call-bind": "^1.0.0", "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1" + "es-abstract": "^1.18.0-next.1" } }, "arraybuffer.slice": { @@ -31080,10 +31177,25 @@ "dev": true }, "contains-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", - "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", - "dev": true + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-1.0.0.tgz", + "integrity": "sha1-NFizMhhWA+ju0Y9RjUoQiIo6vJE=", + "dev": true, + "requires": { + "normalize-path": "^2.1.1", + "path-starts-with": "^1.0.0" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } + } }, "content-disposition": { "version": "0.5.3", @@ -31232,14 +31344,14 @@ } }, "core-js": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.11.0.tgz", - "integrity": "sha512-bd79DPpx+1Ilh9+30aT5O1sgpQd4Ttg8oqkqi51ZzhedMM1omD2e6IOF48Z/DzDCZ2svp49tN/3vneTK6ZBkXw==" + "version": "3.12.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.12.1.tgz", + "integrity": "sha512-Ne9DKPHTObRuB09Dru5AjwKjY4cJHVGu+y5f7coGn1E9Grkc3p2iBwE9AI/nJzsE29mQF7oq+mhYYRqOMFN1Bw==" }, "core-js-bundle": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/core-js-bundle/-/core-js-bundle-3.11.0.tgz", - "integrity": "sha512-1jLByrWCQ5b84opZrn36gtJnnPSIrq2ABZ+NN87ewk6QxgLC7Ohu9pE0bo+XK9R20apKvtUmBDZmFwKGt4lNhA==", + "version": "3.12.1", + "resolved": "https://registry.npmjs.org/core-js-bundle/-/core-js-bundle-3.12.1.tgz", + "integrity": "sha512-4xo0s+HI15r0HEVLy6LhFoPqVlwQKxgl/tbgDfcRziFa5gAUxyEPUtPVXi2VPcSVYIJ8JSG+SOvy/aLPD7M6Fw==", "dev": true }, "core-js-compat": { @@ -31463,6 +31575,12 @@ "camelcase": "^5.0.0", "decamelize": "^1.2.0" } + }, + "universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true } } }, @@ -31716,9 +31834,9 @@ } }, "cypress": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-7.2.0.tgz", - "integrity": "sha512-lHHGay+YsffDn4M0bkkwezylBVHUpwwhtqte4LNPrFRCHy77X38+1PUe3neFb3glVTM+rbILtTN6FhO2djcOuQ==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-7.3.0.tgz", + "integrity": "sha512-aseRCH1tRVCrM6oEfja6fR/bo5l6e4SkHRRSATh27UeN4f/ANC8U7tGIulmrISJVy9xuOkOdbYKbUb2MNM+nrw==", "dev": true, "requires": { "@cypress/listr-verbose-renderer": "^0.4.1", @@ -32292,6 +32410,7 @@ "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dev": true, + "optional": true, "requires": { "bn.js": "^4.1.0", "miller-rabin": "^4.0.0", @@ -32809,13 +32928,13 @@ } }, "eslint": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.25.0.tgz", - "integrity": "sha512-TVpSovpvCNpLURIScDRB6g5CYu/ZFq9GfX2hLNIV4dSBKxIWojeDODvYl3t0k0VtMxYeR8OXPCFE5+oHMlGfhw==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.26.0.tgz", + "integrity": "sha512-4R1ieRf52/izcZE7AlLy56uIHHDLT74Yzz2Iv2l6kDaYvEu9x+wMB5dZArVL8SYGXSYV2YAg70FcW5Y5nGGNIg==", "dev": true, "requires": { "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.0", + "@eslint/eslintrc": "^0.4.1", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -32862,12 +32981,6 @@ "@babel/highlight": "^7.10.4" } }, - "acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", - "dev": true - }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -33158,15 +33271,24 @@ } }, "eslint-module-utils": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", - "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.1.tgz", + "integrity": "sha512-ZXI9B8cxAJIH4nfkhTwcRTEAnrVfobYqwjWy/QMCZ8rHkZHFjf9yO4BzpiF9kCSfNlMG54eKigISHpX0+AaT4A==", "dev": true, "requires": { - "debug": "^2.6.9", + "debug": "^3.2.7", "pkg-dir": "^2.0.0" }, "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, "find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", @@ -33186,6 +33308,12 @@ "path-exists": "^3.0.0" } }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, "p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", @@ -33240,10 +33368,11 @@ "dev": true }, "eslint-plugin-chai-friendly": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-chai-friendly/-/eslint-plugin-chai-friendly-0.6.0.tgz", - "integrity": "sha512-Uvvv1gkbRGp/qfN15B0kQyQWg+oFA8buDSqrwmW3egNSk/FpqH2MjQqKOuKwmEL6w4QIQrIjDp+gg6kGGmD3oQ==", - "dev": true + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-chai-friendly/-/eslint-plugin-chai-friendly-0.7.1.tgz", + "integrity": "sha512-0xhGiSQ+9oWtNc6IZPUR+6ChKbEvLXwT9oZZ5NcGlPzHVKGn1YKwQFj7a9yL3rnRKbWF7b3RkRYEP8kN6dPOwQ==", + "dev": true, + "requires": {} }, "eslint-plugin-compat": { "version": "3.9.0", @@ -33310,9 +33439,9 @@ } }, "eslint-plugin-cypress": { - "version": "2.11.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.11.2.tgz", - "integrity": "sha512-1SergF1sGbVhsf7MYfOLiBhdOg6wqyeV9pXUAIDIffYTGMN3dTBQS9nFAzhLsHhO+Bn0GaVM1Ecm71XUidQ7VA==", + "version": "2.11.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.11.3.tgz", + "integrity": "sha512-hOoAid+XNFtpvOzZSNWP5LDrQBEJwbZwjib4XJ1KcRYKjeVj0mAmPmucG4Egli4j/aruv+Ow/acacoloWWCl9Q==", "dev": true, "requires": { "globals": "^11.12.0" @@ -33362,46 +33491,93 @@ } }, "eslint-plugin-import": { - "version": "2.22.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", - "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", + "version": "2.23.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.23.0.tgz", + "integrity": "sha512-W5v1f7Cbam6BwbSSKtN6+yoUAms07ozbqAEhLOtf5erEqRv7w67PeZuAuBThaUkzdq2GfBx/5GBvxF+NWJshrQ==", "dev": true, "requires": { - "array-includes": "^3.1.1", - "array.prototype.flat": "^1.2.3", - "contains-path": "^0.1.0", + "array-includes": "^3.1.3", + "array.prototype.flat": "^1.2.4", + "contains-path": "^1.0.0", "debug": "^2.6.9", - "doctrine": "1.5.0", + "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.4", - "eslint-module-utils": "^2.6.0", + "eslint-module-utils": "^2.6.1", + "find-up": "^2.0.0", "has": "^1.0.3", + "is-core-module": "^2.4.0", "minimatch": "^3.0.4", - "object.values": "^1.1.1", - "read-pkg-up": "^2.0.0", - "resolve": "^1.17.0", + "object.values": "^1.1.3", + "pkg-up": "^2.0.0", + "read-pkg-up": "^3.0.0", + "resolve": "^1.20.0", "tsconfig-paths": "^3.9.0" }, "dependencies": { "doctrine": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", - "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "requires": { - "esutils": "^2.0.2", - "isarray": "^1.0.0" + "esutils": "^2.0.2" } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true } } }, "eslint-plugin-jsdoc": { - "version": "32.3.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-32.3.3.tgz", - "integrity": "sha512-WxXohbMYlZvCt3r7MepwT++nTLsO4CPegWcm5toM4IGq3MBmYkG+Uf5yDa+n1MwPXLg+KbJqAsI19hmkVD7MPg==", + "version": "34.2.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-34.2.2.tgz", + "integrity": "sha512-9JCeUUZ2MefGd/Pl3blx9/EDjCd7/Z2+fcVBuJdNdvSLApRqZ8CwjGjLHf5s4uVikqF968A0CfnID0WK9B/H/w==", "dev": true, "requires": { + "@es-joy/jsdoccomment": "^0.4.4", "comment-parser": "1.1.5", "debug": "^4.3.1", + "esquery": "^1.4.0", "jsdoctypeparser": "^9.0.0", "lodash": "^4.17.21", "regextras": "^0.7.1", @@ -33611,16 +33787,15 @@ "dev": true }, "eslint-plugin-unicorn": { - "version": "31.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-31.0.0.tgz", - "integrity": "sha512-HR3gI4ANtV8A+0FLAaxjBD/G5J3PWBo+7OswyGeK5nylGqtKLJVbnPksIkBgmVg+SFpxu5MnjaxQQI+9KjyVAg==", + "version": "32.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-32.0.1.tgz", + "integrity": "sha512-LaZ9utnXtOJjnoDkpm+nQsONUUmyRR0WD6PGROSdQRRW3LRmgK/ZP8wxjW+Ai+2uolKTtuJzLx2mvbIeIoLqpg==", "dev": true, "requires": { "ci-info": "^3.1.1", "clean-regexp": "^1.0.0", "eslint-template-visitor": "^2.3.2", "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", "import-modules": "^2.1.0", "is-builtin-module": "^3.1.0", "lodash": "^4.17.21", @@ -33905,9 +34080,9 @@ "dev": true }, "esquery": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", - "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", "dev": true, "requires": { "estraverse": "^5.1.0" @@ -35743,9 +35918,9 @@ } }, "is-core-module": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", - "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz", + "integrity": "sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==", "dev": true, "requires": { "has": "^1.0.3" @@ -37043,30 +37218,21 @@ } }, "load-json-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", - "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", "dev": true, "requires": { "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", + "parse-json": "^4.0.0", + "pify": "^3.0.0", "strip-bom": "^3.0.0" }, "dependencies": { - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "requires": { - "error-ex": "^1.2.0" - } - }, "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true }, "strip-bom": { @@ -38012,9 +38178,9 @@ } }, "mocha": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.3.2.tgz", - "integrity": "sha512-UdmISwr/5w+uXLPKspgoV7/RXZwKRTiTjJ2/AC5ZiEztIoOYdfKb19+9jNmEInzx5pBsCyJQzarAxqIGBNYJhg==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.4.0.tgz", + "integrity": "sha512-hJaO0mwDXmZS4ghXsvPVriOhsxQ7ofcpQdm8dE+jISUOKopitvnXFQmpRR7jd2K6VBG6E26gU3IAbXXGIbu4sQ==", "dev": true, "requires": { "@ungap/promise-all-settled": "1.1.2", @@ -39044,50 +39210,12 @@ "which": "^1.2.9" } }, - "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - } - }, "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true }, - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - }, - "read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dev": true, - "requires": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - } - }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -39103,12 +39231,6 @@ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -39404,14 +39526,14 @@ } }, "object.values": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", - "integrity": "sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.3.tgz", + "integrity": "sha512-nkF6PfDB9alkOUxpf1HNm/QlkeW3SReqL5WXeBLpEJJnlPSvRaDQpW3gQTksTN3fgJX4hL42RzKyOin6ff3tyw==", "dev": true, "requires": { + "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1", - "function-bind": "^1.1.1", + "es-abstract": "^1.18.0-next.2", "has": "^1.0.3" } }, @@ -39439,9 +39561,9 @@ } }, "onetime": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", - "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "requires": { "mimic-fn": "^2.1.0" @@ -39938,6 +40060,26 @@ "integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=", "dev": true }, + "path-starts-with": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/path-starts-with/-/path-starts-with-1.0.0.tgz", + "integrity": "sha1-soJDAV6LE43lcmgqxS2kLmRq2E4=", + "dev": true, + "requires": { + "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } + } + }, "path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -40038,6 +40180,60 @@ "find-up": "^3.0.0" } }, + "pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", + "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + } + } + }, "pluralize": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", @@ -40379,41 +40575,41 @@ } }, "read-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", - "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", "dev": true, "requires": { - "load-json-file": "^2.0.0", + "load-json-file": "^4.0.0", "normalize-package-data": "^2.3.2", - "path-type": "^2.0.0" + "path-type": "^3.0.0" }, "dependencies": { "path-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", - "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", "dev": true, "requires": { - "pify": "^2.0.0" + "pify": "^3.0.0" } }, "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true } } }, "read-pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", - "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", "dev": true, "requires": { "find-up": "^2.0.0", - "read-pkg": "^2.0.0" + "read-pkg": "^3.0.0" }, "dependencies": { "find-up": { @@ -40976,11 +41172,12 @@ "dev": true }, "resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", "dev": true, "requires": { + "is-core-module": "^2.2.0", "path-parse": "^1.0.6" } }, @@ -41098,9 +41295,9 @@ } }, "rollup": { - "version": "2.45.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.45.2.tgz", - "integrity": "sha512-kRRU7wXzFHUzBIv0GfoFFIN3m9oteY4uAsKllIpQDId5cfnkWF2J130l+27dzDju0E6MScKiV0ZM5Bw8m4blYQ==", + "version": "2.47.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.47.0.tgz", + "integrity": "sha512-rqBjgq9hQfW0vRmz+0S062ORRNJXvwRpzxhFXORvar/maZqY6za3rgQ/p1Glg+j1hnc1GtYyQCPiAei95uTElg==", "requires": { "fsevents": "~2.3.1" }, @@ -42108,15 +42305,15 @@ "integrity": "sha512-EeNzTVfj+1In7aSLPKDD03F/ly4RxEuF/EX0YcOG0cKoPXs+SLZxDawQbexQDBzwROs4VKLWTOaZQlZkGBFEIQ==" }, "start-server-and-test": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-1.12.1.tgz", - "integrity": "sha512-qGQ2HQiF2yDIfyaHsXkHfoE5UOl4zJUbJ/gx2xOkfX7iPMXW9qHmoFyaMfIDJVLNkxCK7RxSrvWEI9hNVKQluw==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-1.12.2.tgz", + "integrity": "sha512-rjJF8N/8XVukEYR44Ehm8LAZIDjWCQKXX54W8UQ8pXz3yDKPCdqTqJy7VYnCAknPw65cmLfPxz8M2+K/zCAvVQ==", "dev": true, "requires": { "bluebird": "3.7.2", "check-more-types": "2.24.0", "debug": "4.3.1", - "execa": "3.4.0", + "execa": "5.0.0", "lazy-ass": "1.6.0", "ps-tree": "1.2.0", "wait-on": "5.3.0" @@ -42138,34 +42335,39 @@ } }, "execa": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-3.4.0.tgz", - "integrity": "sha512-r9vdGQk4bmCuK1yKQu1KTwcT2zwfWdbdaXfCtAh+5nU/4fSX+JAb7vZGvI5naJrQlvONrEB20jeruESI69530g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz", + "integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==", "dev": true, "requires": { - "cross-spawn": "^7.0.0", - "get-stream": "^5.0.0", - "human-signals": "^1.1.1", + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", "is-stream": "^2.0.0", "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.0", - "onetime": "^5.1.0", - "p-finally": "^2.0.0", - "signal-exit": "^3.0.2", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", "strip-final-newline": "^2.0.0" } }, + "get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true + }, + "human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true - }, - "p-finally": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-2.0.1.tgz", - "integrity": "sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw==", - "dev": true } } }, @@ -42472,9 +42674,9 @@ } }, "systemjs": { - "version": "6.8.3", - "resolved": "https://registry.npmjs.org/systemjs/-/systemjs-6.8.3.tgz", - "integrity": "sha512-UcTY+FEA1B7e+bpJk1TI+a9Na6LG7wFEqW7ED16cLqLuQfI/9Ri0rsXm3tKlIgNoHyLHZycjdAOijzNbzelgwA==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/systemjs/-/systemjs-6.9.0.tgz", + "integrity": "sha512-THLzcb7WzoW0I+tHB4PQge0BqqN+CAUQJ9gPc1MieqD1gnhxNUKYrhRlN5ov94saOYVVR5NZFQqQhnxi9/WEGg==", "dev": true }, "table": { diff --git a/package.json b/package.json index 886e9a60..f33efbf3 100644 --- a/package.json +++ b/package.json @@ -40,15 +40,8 @@ "build-and-open-docs-no-start": "run-s build-docs open-docs-no-start", "build-and-open-docs": "run-s build-docs open-docs", "open-embedded-no-start": "open-cli http://localhost:8000/editor/embedapi.html", - "open-embedded": "run-p start-embedded open-embedded-no-start", "open-all-ext-no-start": "open-cli http://localhost:8000/src/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", - "open-all-ext": "run-p start open-all-ext-no-start", "open-compiled-no-start": "open-cli http://localhost:8000/src/editor/svg-editor.html", - "open-compiled": "run-p start open-compiled-no-start", - "open-no-start": "open-cli http://localhost:8000/src/editor/svg-editor-es.html", - "open": "run-p start open-no-start", - "open-cov-no-start": "open-cli http://localhost:8000/coverage/", - "open-cov": "run-p start open-cov-no-start", "report": "run-s report-no-mochawesome mochawesome-cli", "report-summary": "run-s report-text-summary mochawesome-cli-dot", "coverage-badge": "coveradge badges/coverage-badge", @@ -113,7 +106,7 @@ "@babel/polyfill": "7.12.1", "@web/dev-server-rollup": "0.3.3", "canvg": "3.0.7", - "core-js": "3.11.0", + "core-js": "3.12.1", "deparam": "^1.0.5", "elix": "^15.0.0", "i18next": "^20.2.2", @@ -124,10 +117,10 @@ "svg2pdf.js": "2.1.0" }, "devDependencies": { - "@babel/core": "7.13.16", - "@babel/preset-env": "7.13.15", + "@babel/core": "7.14.2", + "@babel/preset-env": "7.14.2", "@babel/register": "7.13.16", - "@babel/runtime-corejs3": "7.13.17", + "@babel/runtime-corejs3": "7.14.0", "@cypress/code-coverage": "3.9.5", "@cypress/fiddle": "1.19.2", "@fintechstudios/eslint-plugin-chai-as-promised": "3.1.0", @@ -139,30 +132,30 @@ "@rollup/plugin-node-resolve": "11.2.1", "@rollup/plugin-replace": "2.4.2", "@rollup/plugin-url": "6.0.0", - "@web/dev-server": "^0.1.16", + "@web/dev-server": "^0.1.17", "axe-core": "4.2.0", "babel-plugin-transform-object-rest-spread": "7.0.0-beta.3", "copyfiles": "2.4.1", - "core-js-bundle": "3.11.0", + "core-js-bundle": "3.12.1", "coveradge": "0.6.0", "cp-cli": "2.0.0", "cross-var": "1.1.0", - "cypress": "7.2.0", + "cypress": "7.3.0", "cypress-axe": "0.12.2", "cypress-multi-reporters": "1.5.0", "cypress-plugin-snapshots": "1.4.4", - "eslint": "^7.25.0", + "eslint": "^7.26.0", "eslint-config-standard": "16.0.2", "eslint-plugin-array-func": "3.1.7", "eslint-plugin-chai-expect": "2.2.0", "eslint-plugin-chai-expect-keywords": "2.1.0", - "eslint-plugin-chai-friendly": "0.6.0", + "eslint-plugin-chai-friendly": "0.7.1", "eslint-plugin-compat": "^3.9.0", - "eslint-plugin-cypress": "2.11.2", + "eslint-plugin-cypress": "2.11.3", "eslint-plugin-eslint-comments": "3.2.0", "eslint-plugin-html": "^6.1.2", - "eslint-plugin-import": "^2.22.1", - "eslint-plugin-jsdoc": "^32.3.3", + "eslint-plugin-import": "2.23.0", + "eslint-plugin-jsdoc": "34.2.2", "eslint-plugin-markdown": "^2.1.0", "eslint-plugin-mocha": "8.1.0", "eslint-plugin-mocha-cleanup": "1.9.1", @@ -172,11 +165,11 @@ "eslint-plugin-promise": "^5.1.0", "eslint-plugin-sonarjs": "^0.7.0", "eslint-plugin-standard": "4.1.0", - "eslint-plugin-unicorn": "31.0.0", + "eslint-plugin-unicorn": "32.0.1", "imageoptim-cli": "3.0.2", "jamilih": "0.54.0", "jsdoc": "3.6.6", - "mocha": "8.3.2", + "mocha": "8.4.0", "mocha-badge-generator": "0.9.0", "mochawesome": "6.2.2", "mochawesome-merge": "4.2.0", @@ -192,7 +185,7 @@ "remark-lint-ordered-list-marker-value": "2.0.1", "requirejs": "2.3.6", "rimraf": "3.0.2", - "rollup": "2.45.2", + "rollup": "2.47.0", "rollup-plugin-copy": "3.4.0", "rollup-plugin-filesize": "9.1.1", "rollup-plugin-node-polyfills": "0.2.1", @@ -200,8 +193,8 @@ "rollup-plugin-re": "1.0.7", "rollup-plugin-terser": "7.0.2", "stackblur-canvas": "2.5.0", - "start-server-and-test": "^1.12.1", - "systemjs": "6.8.3", + "start-server-and-test": "^1.12.2", + "systemjs": "6.9.0", "typescript": "4.2.4", "underscore": "1.13.1" } diff --git a/rollup.config.js b/rollup.config.js index c9bf767c..29a65765 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -4,16 +4,16 @@ // 'npm run build' import path from 'path'; -import {lstatSync, readdirSync} from 'fs'; +import { lstatSync, readdirSync } from 'fs'; import rimraf from 'rimraf'; import babel from '@rollup/plugin-babel'; import copy from 'rollup-plugin-copy'; -import {nodeResolve} from '@rollup/plugin-node-resolve'; +import { nodeResolve } from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; import nodePolyfills from 'rollup-plugin-node-polyfills'; import url from '@rollup/plugin-url'; // for XML/SVG files import dynamicImportVars from '@rollup/plugin-dynamic-import-vars'; -import {terser} from 'rollup-plugin-terser'; +import { terser } from 'rollup-plugin-terser'; // import progress from 'rollup-plugin-progress'; import filesize from 'rollup-plugin-filesize'; @@ -28,15 +28,16 @@ const getDirectories = (source) => { // capture the list of files to build for extensions and ext-locales const extensionDirs = getDirectories('src/editor/extensions'); -const dest = ['dist/editor', 'dist/editor/system']; +/** @todo should we support systemjs? */ +const dest = [ 'dist/editor' ]; // remove existing distribution // eslint-disable-next-line no-console rimraf('./dist', () => console.info('recreating dist')); // config for svgedit core module -const config = [{ - input: ['src/editor/index.js'], +const config = [ { + input: [ 'src/editor/index.js' ], output: [ { format: 'es', @@ -50,15 +51,16 @@ const config = [{ sourcemap: true, file: 'dist/editor/xdomain-index.js', intro: 'const XDOMAIN = true;' - }, + } + /* { format: 'system', dir: 'dist/editor/system', inlineDynamicImports: true } + */ ], plugins: [ - // progress(), copy({ targets: [ { @@ -72,6 +74,7 @@ const config = [{ transform: (contents) => contents.toString() .replace(' + diff --git a/src/editor/index.js b/src/editor/index.js index 88734661..a290d64c 100644 --- a/src/editor/index.js +++ b/src/editor/index.js @@ -33,7 +33,7 @@ svgEditor.setConfig( // other config options have already explicitly prevented one or the // other) }, - {allowInitialUserOverride: true} + { allowInitialUserOverride: true } ); // EXTENSION CONFIG @@ -139,7 +139,7 @@ try { // try clause to avoid js to complain if XDOMAIN undefined if (XDOMAIN) { svgEditor.setConfig({ canvasName: 'xdomain', // Namespace this - allowedOrigins: ['*'] + allowedOrigins: [ '*' ] }); console.info('xdomain config activated'); } diff --git a/src/editor/locale.js b/src/editor/locale.js index 8c2a5643..9e482cd0 100644 --- a/src/editor/locale.js +++ b/src/editor/locale.js @@ -83,6 +83,6 @@ export const putLocale = async function (givenParam, goodLangs) { } } }); - console.log(`Lang: ${i18next.t('lang')}`); - return {langParam, i18next}; + console.info(`Lang: ${i18next.t('lang')}`); + return { langParam, i18next }; }; diff --git a/src/editor/panels/BottomPanel.js b/src/editor/panels/BottomPanel.js index 1db52c5d..edd376b0 100644 --- a/src/editor/panels/BottomPanel.js +++ b/src/editor/panels/BottomPanel.js @@ -1,7 +1,7 @@ import SvgCanvas from '../../svgcanvas/svgcanvas.js'; -import {jGraduate} from '../components/jgraduate/jQuery.jGraduate.js'; +import { jGraduate } from '../components/jgraduate/jQuery.jGraduate.js'; -const {$id} = SvgCanvas; +const { $id } = SvgCanvas; /* * register actions for left panel @@ -28,18 +28,16 @@ class BottomPanel { get multiselected () { return this.editor.multiselected; } - /** * @type {module} */ changeStrokeWidth (e) { let val = e.target.value; - if (val === 0 && this.editor.selectedElement && ['line', 'polyline'].includes(this.editor.selectedElement.nodeName)) { + if (val === 0 && this.editor.selectedElement && [ 'line', 'polyline' ].includes(this.editor.selectedElement.nodeName)) { val = 1; } this.editor.svgCanvas.setStrokeWidth(val); } - /** * @type {module} */ @@ -60,7 +58,6 @@ class BottomPanel { } const zoom = this.editor.svgCanvas.getZoom(); const wArea = this.editor.workarea; - this.editor.zoomChanged(window, { width: 0, height: 0, @@ -79,7 +76,7 @@ class BottomPanel { updateToolButtonState () { const bNoFill = (this.editor.svgCanvas.getColor('fill') === 'none'); const bNoStroke = (this.editor.svgCanvas.getColor('stroke') === 'none'); - const buttonsNeedingStroke = ['tool_fhpath', 'tool_line']; + const buttonsNeedingStroke = [ 'tool_fhpath', 'tool_line' ]; const buttonsNeedingFillAndStroke = [ 'tools_rect', 'tools_ellipse', 'tool_text', 'tool_path' @@ -98,7 +95,6 @@ class BottomPanel { $id(btn).disabled = false; }); } - if (bNoStroke && bNoFill) { // eslint-disable-next-line sonarjs/no-identical-functions buttonsNeedingFillAndStroke.forEach((btn) => { @@ -113,7 +109,6 @@ class BottomPanel { $id(btn).disabled = false; }); } - this.editor.svgCanvas.runExtensions( 'toolButtonStateUpdate', /** @type {module:svgcanvas.SvgCanvas#event:ext_toolButtonStateUpdate} */ { @@ -122,12 +117,11 @@ class BottomPanel { } ); } - /** * @type {module} */ handleColorPicker (type, evt) { - const {paint} = evt.detail; + const { paint } = evt.detail; this.editor.svgCanvas.setPaint(type, paint); this.updateToolButtonState(); } @@ -150,9 +144,9 @@ class BottomPanel { handlePalette (e) { e.preventDefault(); // shift key or right click for stroke - const {picker, color} = e.detail; + const { picker, color } = e.detail; // Webkit-based browsers returned 'initial' here for no stroke - const paint = color === 'none' ? new jGraduate.Paint() : new jGraduate.Paint({alpha: 100, solidColor: color.substr(1)}); + const paint = color === 'none' ? new jGraduate.Paint() : new jGraduate.Paint({ alpha: 100, solidColor: color.substr(1) }); if (picker === 'fill') { $id('fill_color').setPaint(paint); } else { @@ -164,7 +158,6 @@ class BottomPanel { } this.updateToolButtonState(); } - /** * @type {module} */ @@ -217,12 +210,12 @@ class BottomPanel { src="./images/opacity.svg"> - ` + `; this.editor.$svgEditor.append(template.content.cloneNode(true)); $id('palette').addEventListener('change', this.handlePalette.bind(this)); - const {curConfig} = this.editor.configObj; - $id('fill_color').setPaint(new jGraduate.Paint({alpha: 100, solidColor: curConfig.initFill.color})); - $id('stroke_color').setPaint(new jGraduate.Paint({alpha: 100, solidColor: curConfig.initStroke.color})); + const { curConfig } = this.editor.configObj; + $id('fill_color').setPaint(new jGraduate.Paint({ alpha: 100, solidColor: curConfig.initFill.color })); + $id('stroke_color').setPaint(new jGraduate.Paint({ alpha: 100, solidColor: curConfig.initStroke.color })); $id('zoom').addEventListener('change', (e) => this.changeZoom.bind(this)(e.detail.value)); $id('stroke_color').addEventListener('change', (evt) => this.handleColorPicker.bind(this)('stroke', evt)); $id('fill_color').addEventListener('change', (evt) => this.handleColorPicker.bind(this)('fill', evt)); diff --git a/src/editor/panels/LayersPanel.js b/src/editor/panels/LayersPanel.js index c5057f84..0d8f2591 100644 --- a/src/editor/panels/LayersPanel.js +++ b/src/editor/panels/LayersPanel.js @@ -14,7 +14,6 @@ class LayersPanel { * @param {PlainObject} editor */ constructor(editor) { - this.uiStrings = editor.uiStrings; this.updateContextPanel = editor.topPanel.updateContextPanel; this.sidedrag = -1; this.sidedragging = false; @@ -79,7 +78,7 @@ class LayersPanel { */ toggleSidePanel(close) { const dpr = window.devicePixelRatio || 1; - const w = parseFloat(getComputedStyle($id("sidepanels"), null).width.replace("px", "")) + const w = parseFloat(getComputedStyle($id("sidepanels"), null).width.replace("px", "")); const isOpened = (dpr < 1 ? w : w / dpr) > 2; const zoomAdjustedSidepanelWidth = (dpr < 1 ? 1 : dpr) * SIDEPANEL_OPENWIDTH; @@ -173,7 +172,7 @@ class LayersPanel { "change", this.lmenuFunc.bind(this) ); - $id("se-cmenu-layers-list").addEventListener("change", e => { + $id("se-cmenu-layers-list").addEventListener("change", (e) => { this.lmenuFunc(e); }); $id("sidepanel_handle").addEventListener( @@ -183,7 +182,7 @@ class LayersPanel { if (this.editor.configObj.curConfig.showlayers) { this.toggleSidePanel(); } - $id("sidepanel_handle").addEventListener("mousedown", evt => { + $id("sidepanel_handle").addEventListener("mousedown", (evt) => { this.sidedrag = evt.pageX; window.addEventListener("mousemove", this.resizeSidePanel.bind(this)); this.allowmove = false; @@ -192,14 +191,14 @@ class LayersPanel { this.allowmove = true; }, 20); }); - $id("sidepanel_handle").addEventListener("mouseup", _evt => { + $id("sidepanel_handle").addEventListener("mouseup", (_evt) => { if (!this.sidedragging) { this.toggleSidePanel(); } this.sidedrag = -1; this.sidedragging = false; }); - window.addEventListener("mouseup", _evt => { + window.addEventListener("mouseup", (_evt) => { this.sidedrag = -1; this.sidedragging = false; $id("svg_editor").removeEventListener( @@ -215,18 +214,18 @@ class LayersPanel { let uniqName; let i = this.editor.svgCanvas.getCurrentDrawing().getNumLayers(); do { - uniqName = this.uiStrings.layers.layer + " " + ++i; + uniqName = this.editor.i18next.t("layers.layer") + " " + ++i; } while (this.editor.svgCanvas.getCurrentDrawing().hasLayer(uniqName)); const newName = prompt( - this.uiStrings.notification.enterUniqueLayerName, + this.editor.i18next.t('notification.enterUniqueLayerName'), uniqName ); if (!newName) { return; } if (this.editor.svgCanvas.getCurrentDrawing().hasLayer(newName)) { - alert(this.uiStrings.notification.dupeLayerName); + alert(this.editor.i18next.t('notification.dupeLayerName')); return; } this.editor.svgCanvas.createLayer(newName); @@ -263,14 +262,14 @@ class LayersPanel { this.editor.svgCanvas.getCurrentDrawing().getCurrentLayerName() + " copy"; const newName = prompt( - this.uiStrings.notification.enterUniqueLayerName, + this.editor.i18next.t('notification.enterUniqueLayerName'), name ); if (!newName) { return; } if (this.editor.svgCanvas.getCurrentDrawing().hasLayer(newName)) { - alert(this.uiStrings.notification.dupeLayerName); + alert(this.editor.i18next.t('notification.dupeLayerName')); return; } this.editor.svgCanvas.cloneLayer(newName); @@ -323,7 +322,7 @@ class LayersPanel { */ layerRename() { const oldName = document.querySelector("#layerlist tr.layersel td.layername").textContent; - const newName = prompt(this.uiStrings.notification.enterNewLayerName, ""); + const newName = prompt(this.editor.i18next.t('notification.enterNewLayerName'), ""); if (!newName) { return; } @@ -331,7 +330,7 @@ class LayersPanel { oldName === newName || this.editor.svgCanvas.getCurrentDrawing().hasLayer(newName) ) { - alert(this.uiStrings.notification.layerHasThatName); + alert(this.editor.i18next.t('notification.layerHasThatName')); return; } this.editor.svgCanvas.renameCurrentLayer(newName); @@ -353,7 +352,7 @@ class LayersPanel { } if (layerNameToHighlight) { - curNames.forEach(curName => { + curNames.forEach((curName) => { if (curName !== layerNameToHighlight) { this.editor.svgCanvas .getCurrentDrawing() @@ -361,7 +360,7 @@ class LayersPanel { } }); } else { - curNames.forEach(curName => { + curNames.forEach((curName) => { this.editor.svgCanvas.getCurrentDrawing().setLayerOpacity(curName, 1.0); }); } @@ -387,7 +386,7 @@ class LayersPanel { // we get the layers in the reverse z-order (the layer rendered on top is listed first) while (layer--) { const name = drawing.getLayerName(layer); - const layerTr = document.createElement("tr"); + const layerTr = document.createElement("tr"); layerTr.className = (name === currentLayerName) ? 'layer layersel' : 'layer'; const layerVis = document.createElement("td"); layerVis.className = (!drawing.getLayerVisibility(name)) ? "layerinvis layervis" : 'layervis'; @@ -410,16 +409,13 @@ class LayersPanel { }); evt.currentTarget.parentNode.classList.add("layersel"); self.editor.svgCanvas.setCurrentLayer(evt.currentTarget.textContent); - evt.preventDefault(); + evt.preventDefault(); }); - element.addEventListener('mouseup', function(evt) { - self.toggleHighlightLayer( - self.editor.svgCanvas, - evt.currentTarget.textContent - ); + element.addEventListener('mouseup', (evt) => { + self.toggleHighlightLayer(evt.currentTarget.textContent); }); - element.addEventListener('mouseout', function(_evt) { - self.toggleHighlightLayer(self.editor.svgCanvas); + element.addEventListener('mouseout', (_evt) => { + self.toggleHighlightLayer(); }); }); const elements = $id('layerlist').querySelectorAll("td.layervis"); diff --git a/src/editor/panels/LeftPanel.js b/src/editor/panels/LeftPanel.js index 600c9157..88c5a122 100644 --- a/src/editor/panels/LeftPanel.js +++ b/src/editor/panels/LeftPanel.js @@ -28,7 +28,7 @@ class LeftPanel { updateLeftPanel(button) { if (button.disabled) return false; // remove the pressed state on other(s) button(s) - $qa("#tools_left *[pressed]").forEach(b => { + $qa("#tools_left *[pressed]").forEach((b) => { b.pressed = false; }); // pressed state for the clicked button diff --git a/src/editor/panels/TopPanel.js b/src/editor/panels/TopPanel.js index 99b213f4..bf93ff59 100644 --- a/src/editor/panels/TopPanel.js +++ b/src/editor/panels/TopPanel.js @@ -15,7 +15,6 @@ class TopPanel { */ constructor(editor) { this.editor = editor; - this.uiStrings = editor.uiStrings; } /** * @type {module} @@ -45,7 +44,7 @@ class TopPanel { setStrokeOpt(opt, changeElem) { const { id } = opt; const bits = id.split('_'); - const [pre, val] = bits; + const [ pre, val ] = bits; if (changeElem) { this.svgCanvas.setStrokeAttr('stroke-' + pre, val); @@ -138,7 +137,7 @@ class TopPanel { curhref = curhref.startsWith("data:") ? "" : curhref; // eslint-disable-next-line no-alert const url = prompt( - this.editor.uiStrings.notification.enterNewImgURL, + this.editor.i18next.t('notification.enterNewImgURL'), curhref ); if (url) { @@ -152,7 +151,7 @@ class TopPanel { * @returns {void} */ updateContextPanel() { - const setInputWidth = elem => { + const setInputWidth = (elem) => { const w = Math.min(Math.max(12 + elem.value.length * 6, 50), 300); elem.style.width = w + 'px'; }; @@ -206,14 +205,14 @@ class TopPanel { if (!isNode && currentMode !== "pathedit") { $id("selected_panel").style.display = 'block'; // Elements in this array already have coord fields - if (["line", "circle", "ellipse"].includes(elname)) { + if ([ "line", "circle", "ellipse" ].includes(elname)) { $id("xy_panel").style.display = 'none'; } else { let x, y; // Get BBox vals for g, polyline and path - if (["g", "polyline", "path"].includes(elname)) { - const bb = this.editor.svgCanvas.getStrokedBBox([elem]); + if ([ "g", "polyline", "path" ].includes(elname)) { + const bb = this.editor.svgCanvas.getStrokedBBox([ elem ]); if (bb) { ({ x, y } = bb); } @@ -276,11 +275,11 @@ class TopPanel { const panels = { g: [], a: [], - rect: ["rx", "width", "height"], - image: ["width", "height"], - circle: ["cx", "cy", "r"], - ellipse: ["cx", "cy", "rx", "ry"], - line: ["x1", "y1", "x2", "y2"], + rect: [ "rx", "width", "height" ], + image: [ "width", "height" ], + circle: [ "cx", "cy", "r" ], + ellipse: [ "cx", "cy", "rx", "ry" ], + line: [ "x1", "y1", "x2", "y2" ], text: [], use: [] }; @@ -292,7 +291,7 @@ class TopPanel { linkHref = this.editor.svgCanvas.getHref(elem); $id("g_panel").style.display = 'block'; } - // siblings + // siblings const selements = Array.prototype.filter.call(elem.parentNode.children, function(child){ return child !== elem; }); @@ -313,7 +312,7 @@ class TopPanel { const curPanel = panels[tagName]; $id(tagName + "_panel").style.display = 'block'; - curPanel.forEach(item => { + curPanel.forEach((item) => { let attrVal = elem.getAttribute(item); if (this.editor.configObj.curConfig.baseUnit !== "px" && elem[item]) { const bv = elem[item].baseVal.value; @@ -352,7 +351,7 @@ class TopPanel { if (this.editor.svgCanvas.addedNew) { // Timeout needed for IE9 setTimeout(() => { - $id("text").focus() + $id("text").focus(); $id("text").select(); }, 100); } @@ -406,7 +405,7 @@ class TopPanel { if ((elem && !isNode) || this.multiselected) { // update the selected elements' layer - $id("selLayerNames").removeAttribute("disabled") + $id("selLayerNames").removeAttribute("disabled"); $id("selLayerNames").value = currentLayerName; // Enable regular menu options @@ -553,12 +552,12 @@ class TopPanel { attrChanger(e) { const attr = e.target.getAttribute("data-attr"); let val = e.target.value; - const valid = isValidUnit(attr, val, this.editor.selectedElement); + const valid = isValidUnit(attr, val, this.selectedElement); if (!valid) { - e.target.value = this.editor.selectedElement().getAttribute(attr); + e.target.value = this.selectedElement.getAttribute(attr); // eslint-disable-next-line no-alert - alert(this.uiStrings.notification.invalidAttrValGiven); + alert(this.i18next.t('notification.invalidAttrValGiven')); return false; } @@ -587,7 +586,7 @@ class TopPanel { const elem = this.editor.selectedElement; this.editor.svgCanvas.clearSelection(); elem.id = val; - this.editor.svgCanvas.addToSelection([elem], true); + this.editor.svgCanvas.addToSelection([ elem ], true); } else { this.editor.svgCanvas.changeSelectedAttribute(attr, val); } @@ -619,7 +618,7 @@ class TopPanel { if (!isNullish(this.editor.selectedElement) || this.multiselected) { // eslint-disable-next-line no-alert const url = prompt( - this.uiStrings.notification.enterNewLinkURL, + this.i18next.t('notification.enterNewLinkURL'), "http://" ); if (url) { @@ -742,7 +741,7 @@ class TopPanel { init() { // add Top panel const template = document.createElement("template"); - const {i18next} = this.editor + const { i18next } = this.editor; // eslint-disable-next-line no-unsanitized/property template.innerHTML = `
@@ -1040,7 +1039,7 @@ class TopPanel { "click", this.clickGroup.bind(this) ); - $id("tool_position").addEventListener("change", evt => + $id("tool_position").addEventListener("change", (evt) => this.clickAlignEle.bind(this)(evt) ); $id("tool_align_left").addEventListener("click", () => @@ -1130,7 +1129,7 @@ class TopPanel { "image_height", "path_node_x", "path_node_y" - ].forEach(attrId => + ].forEach((attrId) => $id(attrId).addEventListener("change", this.attrChanger.bind(this)) ); } diff --git a/src/editor/svgedit.css b/src/editor/svgedit.css index 457a8028..5a27587e 100644 --- a/src/editor/svgedit.css +++ b/src/editor/svgedit.css @@ -471,7 +471,7 @@ input[type=text] { border-top: 1px solid var(--border-color); border-right: 1px solid #FFFFFF; border-bottom: 1px solid #FFFFFF; - background-color: #B0B0B0; + background-color: #5a6162; } .dropdown ul { @@ -495,7 +495,7 @@ input[type=text] { width: 120px; padding: 4px; background: #E8E8E8; - border: 1px solid #B0B0B0; + border: 1px solid #5a6162; margin: 0 0 -1px 0; line-height: 16px; } @@ -625,10 +625,6 @@ ul li.current { padding-right: .3em; } -#svg_source_editor { - display: none; -} - .overlay { position: absolute; top: 0; @@ -640,19 +636,6 @@ ul li.current { z-index: 5; } -#svg_source_editor #svg_source_container { - position: absolute; - top: 30px; - left: 30px; - right: 30px; - bottom: 30px; - background-color: #B0B0B0; - opacity: 1.0; - text-align: center; - border: 1px outset #777; - z-index: 6; -} - #save_output_btns { display: none; text-align: left; @@ -668,20 +651,6 @@ ul li.current { margin-left: 30px; } -#svg_docprops #svg_docprops_container, -#svg_prefs #svg_prefs_container { - position: absolute; - top: 50px; - padding: 10px; - background-color: #B0B0B0; - border: 1px outset #777; - opacity: 1.0; -/* width: 450px;*/ - font-family: Verdana, Helvetica, sans-serif; - font-size: .8em; - z-index: 20001; -} - /* ------------ */ .dropdown li.tool_button { diff --git a/src/editor/touch.js b/src/editor/touch.js index 4b1826d5..8a875231 100644 --- a/src/editor/touch.js +++ b/src/editor/touch.js @@ -5,7 +5,7 @@ * @returns {void} */ function touchHandler (ev) { - const {changedTouches} = ev, + const { changedTouches } = ev, first = changedTouches[0]; let type = ''; @@ -16,7 +16,7 @@ function touchHandler (ev) { default: return; } - const {screenX, screenY, clientX, clientY} = first; + const { screenX, screenY, clientX, clientY } = first; const simulatedEvent = new MouseEvent(type, { // Event interface bubbles: true, diff --git a/src/svgcanvas/blur-event.js b/src/svgcanvas/blur-event.js index 0e93871a..f3208c01 100644 --- a/src/svgcanvas/blur-event.js +++ b/src/svgcanvas/blur-event.js @@ -44,12 +44,12 @@ export const setBlurNoUndo = function (val) { blurContext_.changeSelectedAttributeNoUndoMethod('filter', 'url(#' + elem.id + '_blur)'); } if (blurContext_.isWebkit()) { - // console.log('e', elem); + // console.log('e', elem); elem.removeAttribute('filter'); elem.setAttribute('filter', 'url(#' + elem.id + '_blur)'); } const filter = blurContext_.getFilter(); - blurContext_.changeSelectedAttributeNoUndoMethod('stdDeviation', val, [filter.firstChild]); + blurContext_.changeSelectedAttributeNoUndoMethod('stdDeviation', val, [ filter.firstChild ]); blurContext_.getCanvas().setBlurOffsets(filter, val); } }; @@ -122,14 +122,14 @@ export const setBlur = function (val, complete) { } } else { // Not found, so create - const newblur = blurContext_.getCanvas().addSVGElementFromJson({element: 'feGaussianBlur', + const newblur = blurContext_.getCanvas().addSVGElementFromJson({ element: 'feGaussianBlur', attr: { in: 'SourceGraphic', stdDeviation: val } }); - blurContext_.setFilter(blurContext_.getCanvas().addSVGElementFromJson({element: 'filter', + blurContext_.setFilter(blurContext_.getCanvas().addSVGElementFromJson({ element: 'filter', attr: { id: elemId + '_blur' } @@ -140,7 +140,7 @@ export const setBlur = function (val, complete) { batchCmd.addSubCommand(new InsertElementCommand(blurContext_.getFilter())); } - const changes = {filter: elem.getAttribute('filter')}; + const changes = { filter: elem.getAttribute('filter') }; if (val === 0) { elem.removeAttribute('filter'); @@ -153,7 +153,7 @@ export const setBlur = function (val, complete) { blurContext_.getCanvas().setBlurOffsets(blurContext_.getFilter(), val); const filter = blurContext_.getFilter(); blurContext_.setCurCommand(batchCmd); - blurContext_.getCanvas().undoMgr.beginUndoableChange('stdDeviation', [filter ? filter.firstChild : null]); + blurContext_.getCanvas().undoMgr.beginUndoableChange('stdDeviation', [ filter ? filter.firstChild : null ]); if (complete) { blurContext_.getCanvas().setBlurNoUndo(val); finishChange(); diff --git a/src/svgcanvas/clear.js b/src/svgcanvas/clear.js index 0394fa3e..bf8e190a 100644 --- a/src/svgcanvas/clear.js +++ b/src/svgcanvas/clear.js @@ -4,7 +4,7 @@ * @license MIT * @copyright 2011 Jeff Schiller */ -import {NS} from '../common/namespaces.js'; +import { NS } from '../common/namespaces.js'; let clearContext_ = null; @@ -19,7 +19,7 @@ export const init = function (clearContext) { export const clearSvgContentElementInit = function () { const curConfig = clearContext_.getCurConfig(); - const {dimensions} = curConfig; + const { dimensions } = curConfig; const el = clearContext_.getSVGContent(); // empty() while(el.firstChild) diff --git a/src/svgcanvas/coords.js b/src/svgcanvas/coords.js index bdfa368b..87beca96 100644 --- a/src/svgcanvas/coords.js +++ b/src/svgcanvas/coords.js @@ -57,7 +57,7 @@ export const remapElement = function (selected, changes, m) { doSnapping = editorContext_.getGridSnapping() && selected.parentNode.parentNode.localName === 'svg', finishUp = function () { if (doSnapping) { - Object.entries(changes).forEach(([o, value]) => { + Object.entries(changes).forEach(([ o, value ]) => { changes[o] = snapToGrid(value); }); } diff --git a/src/svgcanvas/copy-elem.js b/src/svgcanvas/copy-elem.js index eba0e54b..7802c04c 100644 --- a/src/svgcanvas/copy-elem.js +++ b/src/svgcanvas/copy-elem.js @@ -1,6 +1,6 @@ -import {isWebkit} from '../common/browser.js'; -import {convertPath} from './path.js'; -import {preventClickDefault} from './utilities.js'; +import { isWebkit } from '../common/browser.js'; +import { convertPath } from './path.js'; +import { preventClickDefault } from './utilities.js'; /** * Create a clone of an element, updating its ID and its children's IDs when needed. @@ -41,7 +41,7 @@ export const copyElem = function (el, getNextId) { }); if (el.dataset.gsvg) { - newEl.dataset.gsvg = newEl.firstChild + newEl.dataset.gsvg = newEl.firstChild; } else if (el.dataset.symbol) { const ref = el.dataset.symbol; newEl.dataset.ref = ref; diff --git a/src/svgcanvas/draw.js b/src/svgcanvas/draw.js index 04b713d4..6a52be34 100644 --- a/src/svgcanvas/draw.js +++ b/src/svgcanvas/draw.js @@ -5,1050 +5,1051 @@ * @copyright 2011 Jeff Schiller */ -import Layer from './layer.js'; -import HistoryRecordingService from './historyrecording.js'; - -import {NS} from '../common/namespaces.js'; -import {isOpera} from '../common/browser.js'; -import { - toXml, getElem -} from './utilities.js'; -import { - copyElem as utilCopyElem -} from './copy-elem.js'; -import { - BatchCommand, RemoveElementCommand, MoveElementCommand, ChangeElementCommand -} from './history.js'; -import {getParentsUntil} from '../editor/components/jgraduate/Util.js'; - -const visElems = 'a,circle,ellipse,foreignObject,g,image,line,path,polygon,polyline,rect,svg,text,tspan,use'.split(','); - -const RandomizeModes = { - LET_DOCUMENT_DECIDE: 0, - ALWAYS_RANDOMIZE: 1, - NEVER_RANDOMIZE: 2 -}; -let randIds = RandomizeModes.LET_DOCUMENT_DECIDE; -// Array with current disabled elements (for in-group editing) -let disabledElems = []; - -/** - * Get a HistoryRecordingService. - * @param {module:history.HistoryRecordingService} [hrService] - if exists, return it instead of creating a new service. - * @returns {module:history.HistoryRecordingService} - */ -function historyRecordingService (hrService) { - return hrService || new HistoryRecordingService(canvas_.undoMgr); -} - -/** - * Find the layer name in a group element. - * @param {Element} group The group element to search in. - * @returns {string} The layer name or empty string. - */ -function findLayerNameInGroup (group) { - return group.querySelector('title').textContent || - (isOpera() && group.querySelectorAll - // Hack for Opera 10.60 - ? group.querySelector('title').textContent - : ''); -} - -/** - * Given a set of names, return a new unique name. - * @param {string[]} existingLayerNames - Existing layer names. - * @returns {string} - The new name. - */ -function getNewLayerName (existingLayerNames) { - let i = 1; - // TODO(codedread): What about internationalization of "Layer"? - while (existingLayerNames.includes(('Layer ' + i))) { i++; } - return 'Layer ' + i; -} - -/** - * This class encapsulates the concept of a SVG-edit drawing. - */ -export class Drawing { - /** - * @param {SVGSVGElement} svgElem - The SVG DOM Element that this JS object - * encapsulates. If the svgElem has a se:nonce attribute on it, then - * IDs will use the nonce as they are generated. - * @param {string} [optIdPrefix=svg_] - The ID prefix to use. - * @throws {Error} If not initialized with an SVG element + import Layer from './layer.js'; + import HistoryRecordingService from './historyrecording.js'; + + import { NS } from '../common/namespaces.js'; + import { isOpera } from '../common/browser.js'; + import { + toXml, getElem + } from './utilities.js'; + import { + copyElem as utilCopyElem + } from './copy-elem.js'; + import { + BatchCommand, RemoveElementCommand, MoveElementCommand, ChangeElementCommand + } from './history.js'; + import { getParentsUntil } from '../editor/components/jgraduate/Util.js'; + + const visElems = 'a,circle,ellipse,foreignObject,g,image,line,path,polygon,polyline,rect,svg,text,tspan,use'.split(','); + + const RandomizeModes = { + LET_DOCUMENT_DECIDE: 0, + ALWAYS_RANDOMIZE: 1, + NEVER_RANDOMIZE: 2 + }; + let randIds = RandomizeModes.LET_DOCUMENT_DECIDE; + // Array with current disabled elements (for in-group editing) + let disabledElems = []; + + /** + * Get a HistoryRecordingService. + * @param {module:history.HistoryRecordingService} [hrService] - if exists, return it instead of creating a new service. + * @returns {module:history.HistoryRecordingService} */ - constructor (svgElem, optIdPrefix) { - if (!svgElem || !svgElem.tagName || !svgElem.namespaceURI || - svgElem.tagName !== 'svg' || svgElem.namespaceURI !== NS.SVG) { - throw new Error('Error: svgedit.draw.Drawing instance initialized without a element'); - } - - /** - * The SVG DOM Element that represents this drawing. - * @type {SVGSVGElement} - */ - this.svgElem_ = svgElem; - - /** - * The latest object number used in this drawing. - * @type {Integer} - */ - this.obj_num = 0; - - /** - * The prefix to prepend to each element id in the drawing. - * @type {string} - */ - this.idPrefix = optIdPrefix || 'svg_'; - - /** - * An array of released element ids to immediately reuse. - * @type {Integer[]} - */ - this.releasedNums = []; - - /** - * The z-ordered array of Layer objects. Each layer has a name - * and group element. - * The first layer is the one at the bottom of the rendering. - * @type {Layer[]} - */ - this.all_layers = []; - - /** - * Map of all_layers by name. - * - * Note: Layers are ordered, but referenced externally by name; so, we need both container - * types depending on which function is called (i.e. all_layers and layer_map). - * - * @type {PlainObject} - */ - this.layer_map = {}; - - /** - * The current layer being used. - * @type {Layer} - */ - this.current_layer = null; - - /** - * The nonce to use to uniquely identify elements across drawings. - * @type {!string} - */ - this.nonce_ = ''; - const n = this.svgElem_.getAttributeNS(NS.SE, 'nonce'); - // If already set in the DOM, use the nonce throughout the document - // else, if randomizeIds(true) has been called, create and set the nonce. - if (n && randIds !== RandomizeModes.NEVER_RANDOMIZE) { - this.nonce_ = n; - } else if (randIds === RandomizeModes.ALWAYS_RANDOMIZE) { - this.setNonce(Math.floor(Math.random() * 100001)); - } - } - - /** - * @param {string} id Element ID to retrieve - * @returns {Element} SVG element within the root SVGSVGElement + function historyRecordingService (hrService) { + return hrService || new HistoryRecordingService(canvas_.undoMgr); + } + + /** + * Find the layer name in a group element. + * @param {Element} group The group element to search in. + * @returns {string} The layer name or empty string. */ - getElem_ (id) { - if (this.svgElem_.querySelector) { - // querySelector lookup - return this.svgElem_.querySelector('#' + id); - } - // jQuery lookup: twice as slow as xpath in FF - return this.svgElem_.querySelector('[id=' + id + ']'); - } - - /** - * @returns {SVGSVGElement} + function findLayerNameInGroup (group) { + return group.querySelector('title').textContent || + (isOpera() && group.querySelectorAll + // Hack for Opera 10.60 + ? group.querySelector('title').textContent + : ''); + } + + /** + * Given a set of names, return a new unique name. + * @param {string[]} existingLayerNames - Existing layer names. + * @returns {string} - The new name. + */ + function getNewLayerName (existingLayerNames) { + let i = 1; + // TODO(codedread): What about internationalization of "Layer"? + while (existingLayerNames.includes(('Layer ' + i))) { i++; } + return 'Layer ' + i; + } + + /** + * This class encapsulates the concept of a SVG-edit drawing. + */ + export class Drawing { + /** + * @param {SVGSVGElement} svgElem - The SVG DOM Element that this JS object + * encapsulates. If the svgElem has a se:nonce attribute on it, then + * IDs will use the nonce as they are generated. + * @param {string} [optIdPrefix=svg_] - The ID prefix to use. + * @throws {Error} If not initialized with an SVG element */ - getSvgElem () { - return this.svgElem_; - } - - /** - * @returns {!(string|Integer)} The previously set nonce + constructor (svgElem, optIdPrefix) { + if (!svgElem || !svgElem.tagName || !svgElem.namespaceURI || + svgElem.tagName !== 'svg' || svgElem.namespaceURI !== NS.SVG) { + throw new Error('Error: svgedit.draw.Drawing instance initialized without a element'); + } + + /** + * The SVG DOM Element that represents this drawing. + * @type {SVGSVGElement} + */ + this.svgElem_ = svgElem; + + /** + * The latest object number used in this drawing. + * @type {Integer} + */ + this.obj_num = 0; + + /** + * The prefix to prepend to each element id in the drawing. + * @type {string} + */ + this.idPrefix = optIdPrefix || 'svg_'; + + /** + * An array of released element ids to immediately reuse. + * @type {Integer[]} + */ + this.releasedNums = []; + + /** + * The z-ordered array of Layer objects. Each layer has a name + * and group element. + * The first layer is the one at the bottom of the rendering. + * @type {Layer[]} + */ + this.all_layers = []; + + /** + * Map of all_layers by name. + * + * Note: Layers are ordered, but referenced externally by name; so, we need both container + * types depending on which function is called (i.e. all_layers and layer_map). + * + * @type {PlainObject} + */ + this.layer_map = {}; + + /** + * The current layer being used. + * @type {Layer} + */ + this.current_layer = null; + + /** + * The nonce to use to uniquely identify elements across drawings. + * @type {!string} + */ + this.nonce_ = ''; + const n = this.svgElem_.getAttributeNS(NS.SE, 'nonce'); + // If already set in the DOM, use the nonce throughout the document + // else, if randomizeIds(true) has been called, create and set the nonce. + if (n && randIds !== RandomizeModes.NEVER_RANDOMIZE) { + this.nonce_ = n; + } else if (randIds === RandomizeModes.ALWAYS_RANDOMIZE) { + this.setNonce(Math.floor(Math.random() * 100001)); + } + } + + /** + * @param {string} id Element ID to retrieve + * @returns {Element} SVG element within the root SVGSVGElement */ - getNonce () { - return this.nonce_; - } - - /** - * @param {!(string|Integer)} n The nonce to set + getElem_ (id) { + if (this.svgElem_.querySelector) { + // querySelector lookup + return this.svgElem_.querySelector('#' + id); + } + // jQuery lookup: twice as slow as xpath in FF + return this.svgElem_.querySelector('[id=' + id + ']'); + } + + /** + * @returns {SVGSVGElement} + */ + getSvgElem () { + return this.svgElem_; + } + + /** + * @returns {!(string|Integer)} The previously set nonce + */ + getNonce () { + return this.nonce_; + } + + /** + * @param {!(string|Integer)} n The nonce to set + * @returns {void} + */ + setNonce (n) { + this.svgElem_.setAttributeNS(NS.XMLNS, 'xmlns:se', NS.SE); + this.svgElem_.setAttributeNS(NS.SE, 'se:nonce', n); + this.nonce_ = n; + } + + /** + * Clears any previously set nonce. + * @returns {void} + */ + clearNonce () { + // We deliberately leave any se:nonce attributes alone, + // we just don't use it to randomize ids. + this.nonce_ = ''; + } + + /** + * Returns the latest object id as a string. + * @returns {string} The latest object Id. + */ + getId () { + return this.nonce_ + ? this.idPrefix + this.nonce_ + '_' + this.obj_num + : this.idPrefix + this.obj_num; + } + + /** + * Returns the next object Id as a string. + * @returns {string} The next object Id to use. + */ + getNextId () { + const oldObjNum = this.obj_num; + let restoreOldObjNum = false; + + // If there are any released numbers in the release stack, + // use the last one instead of the next obj_num. + // We need to temporarily use obj_num as that is what getId() depends on. + if (this.releasedNums.length > 0) { + this.obj_num = this.releasedNums.pop(); + restoreOldObjNum = true; + } else { + // If we are not using a released id, then increment the obj_num. + this.obj_num++; + } + + // Ensure the ID does not exist. + let id = this.getId(); + while (this.getElem_(id)) { + if (restoreOldObjNum) { + this.obj_num = oldObjNum; + restoreOldObjNum = false; + } + this.obj_num++; + id = this.getId(); + } + // Restore the old object number if required. + if (restoreOldObjNum) { + this.obj_num = oldObjNum; + } + return id; + } + + /** + * Releases the object Id, letting it be used as the next id in getNextId(). + * This method DOES NOT remove any elements from the DOM, it is expected + * that client code will do this. + * @param {string} id - The id to release. + * @returns {boolean} True if the id was valid to be released, false otherwise. + */ + releaseId (id) { + // confirm if this is a valid id for this Document, else return false + const front = this.idPrefix + (this.nonce_ ? this.nonce_ + '_' : ''); + if (typeof id !== 'string' || !id.startsWith(front)) { + return false; + } + // extract the obj_num of this id + const num = Number.parseInt(id.substr(front.length)); + + // if we didn't get a positive number or we already released this number + // then return false. + if (typeof num !== 'number' || num <= 0 || this.releasedNums.includes(num)) { + return false; + } + + // push the released number into the released queue + this.releasedNums.push(num); + + return true; + } + + /** + * Returns the number of layers in the current drawing. + * @returns {Integer} The number of layers in the current drawing. + */ + getNumLayers () { + return this.all_layers.length; + } + + /** + * Check if layer with given name already exists. + * @param {string} name - The layer name to check + * @returns {boolean} + */ + hasLayer (name) { + return this.layer_map[name] !== undefined; + } + + /** + * Returns the name of the ith layer. If the index is out of range, an empty string is returned. + * @param {Integer} i - The zero-based index of the layer you are querying. + * @returns {string} The name of the ith layer (or the empty string if none found) + */ + getLayerName (i) { + return i >= 0 && i < this.getNumLayers() ? this.all_layers[i].getName() : ''; + } + + /** + * @returns {SVGGElement|null} The SVGGElement representing the current layer. + */ + getCurrentLayer () { + return this.current_layer ? this.current_layer.getGroup() : null; + } + + /** + * Get a layer by name. + * @param {string} name + * @returns {SVGGElement} The SVGGElement representing the named layer or null. + */ + getLayerByName (name) { + const layer = this.layer_map[name]; + return layer ? layer.getGroup() : null; + } + + /** + * Returns the name of the currently selected layer. If an error occurs, an empty string + * is returned. + * @returns {string} The name of the currently active layer (or the empty string if none found). + */ + getCurrentLayerName () { + return this.current_layer ? this.current_layer.getName() : ''; + } + + /** + * Set the current layer's name. + * @param {string} name - The new name. + * @param {module:history.HistoryRecordingService} hrService - History recording service + * @returns {string|null} The new name if changed; otherwise, null. + */ + setCurrentLayerName (name, hrService) { + let finalName = null; + if (this.current_layer) { + const oldName = this.current_layer.getName(); + finalName = this.current_layer.setName(name, hrService); + if (finalName) { + delete this.layer_map[oldName]; + this.layer_map[finalName] = this.current_layer; + } + } + return finalName; + } + + /** + * Set the current layer's position. + * @param {Integer} newpos - The zero-based index of the new position of the layer. Range should be 0 to layers-1 + * @returns {{title: SVGGElement, previousName: string}|null} If the name was changed, returns {title:SVGGElement, previousName:string}; otherwise null. + */ + setCurrentLayerPosition (newpos) { + const layerCount = this.getNumLayers(); + if (!this.current_layer || newpos < 0 || newpos >= layerCount) { + return null; + } + + let oldpos; + for (oldpos = 0; oldpos < layerCount; ++oldpos) { + if (this.all_layers[oldpos] === this.current_layer) { break; } + } + // some unknown error condition (current_layer not in all_layers) + if (oldpos === layerCount) { return null; } + + if (oldpos !== newpos) { + // if our new position is below us, we need to insert before the node after newpos + const currentGroup = this.current_layer.getGroup(); + const oldNextSibling = currentGroup.nextSibling; + + let refGroup = null; + if (newpos > oldpos) { + if (newpos < layerCount - 1) { + refGroup = this.all_layers[newpos + 1].getGroup(); + } + // if our new position is above us, we need to insert before the node at newpos + } else { + refGroup = this.all_layers[newpos].getGroup(); + } + this.svgElem_.insertBefore(currentGroup, refGroup); // Ok to replace with `refGroup.before(currentGroup);`? + + this.identifyLayers(); + this.setCurrentLayer(this.getLayerName(newpos)); + + return { + currentGroup, + oldNextSibling + }; + } + return null; + } + + /** + * @param {module:history.HistoryRecordingService} hrService * @returns {void} */ - setNonce (n) { - this.svgElem_.setAttributeNS(NS.XMLNS, 'xmlns:se', NS.SE); - this.svgElem_.setAttributeNS(NS.SE, 'se:nonce', n); - this.nonce_ = n; - } - - /** - * Clears any previously set nonce. + mergeLayer (hrService) { + const currentGroup = this.current_layer.getGroup(); + const prevGroup = currentGroup.previousElementSibling; + if (!prevGroup) { return; } + + hrService.startBatchCommand('Merge Layer'); + + const layerNextSibling = currentGroup.nextSibling; + hrService.removeElement(currentGroup, layerNextSibling, this.svgElem_); + + while (currentGroup.firstChild) { + const child = currentGroup.firstChild; + if (child.localName === 'title') { + hrService.removeElement(child, child.nextSibling, currentGroup); + child.remove(); + continue; + } + const oldNextSibling = child.nextSibling; + prevGroup.append(child); + hrService.moveElement(child, oldNextSibling, currentGroup); + } + + // Remove current layer's group + this.current_layer.removeGroup(); + // Remove the current layer and set the previous layer as the new current layer + const index = this.all_layers.indexOf(this.current_layer); + if (index > 0) { + const name = this.current_layer.getName(); + this.current_layer = this.all_layers[index - 1]; + this.all_layers.splice(index, 1); + delete this.layer_map[name]; + } + + hrService.endBatchCommand(); + } + + /** + * @param {module:history.HistoryRecordingService} hrService * @returns {void} */ - clearNonce () { - // We deliberately leave any se:nonce attributes alone, - // we just don't use it to randomize ids. - this.nonce_ = ''; - } - - /** - * Returns the latest object id as a string. - * @returns {string} The latest object Id. + mergeAllLayers (hrService) { + // Set the current layer to the last layer. + this.current_layer = this.all_layers[this.all_layers.length - 1]; + + hrService.startBatchCommand('Merge all Layers'); + while (this.all_layers.length > 1) { + this.mergeLayer(hrService); + } + hrService.endBatchCommand(); + } + + /** + * Sets the current layer. If the name is not a valid layer name, then this + * function returns `false`. Otherwise it returns `true`. This is not an + * undo-able action. + * @param {string} name - The name of the layer you want to switch to. + * @returns {boolean} `true` if the current layer was switched, otherwise `false` + */ + setCurrentLayer (name) { + const layer = this.layer_map[name]; + if (layer) { + if (this.current_layer) { + this.current_layer.deactivate(); + } + this.current_layer = layer; + this.current_layer.activate(); + return true; + } + return false; + } + + /** + * Deletes the current layer from the drawing and then clears the selection. + * This function then calls the 'changed' handler. This is an undoable action. + * @todo Does this actually call the 'changed' handler? + * @returns {SVGGElement} The SVGGElement of the layer removed or null. + */ + deleteCurrentLayer () { + if (this.current_layer && this.getNumLayers() > 1) { + const oldLayerGroup = this.current_layer.removeGroup(); + this.identifyLayers(); + return oldLayerGroup; + } + return null; + } + + /** + * Updates layer system and sets the current layer to the + * top-most layer (last `` child of this drawing). + * @returns {void} */ - getId () { - return this.nonce_ - ? this.idPrefix + this.nonce_ + '_' + this.obj_num - : this.idPrefix + this.obj_num; - } - - /** - * Returns the next object Id as a string. - * @returns {string} The next object Id to use. + identifyLayers () { + this.all_layers = []; + this.layer_map = {}; + const numchildren = this.svgElem_.childNodes.length; + // loop through all children of SVG element + const orphans = [], layernames = []; + let layer = null; + let childgroups = false; + for (let i = 0; i < numchildren; ++i) { + const child = this.svgElem_.childNodes.item(i); + // for each g, find its layer name + if (child && child.nodeType === 1) { + if (child.tagName === 'g') { + childgroups = true; + const name = findLayerNameInGroup(child); + if (name) { + layernames.push(name); + layer = new Layer(name, child); + this.all_layers.push(layer); + this.layer_map[name] = layer; + } else { + // if group did not have a name, it is an orphan + orphans.push(child); + } + } else if (visElems.includes(child.nodeName)) { + // Child is "visible" (i.e. not a or element), so it is an orphan + orphans.push(child); + } + } + } + + // If orphans or no layers found, create a new layer and add all the orphans to it + if (orphans.length > 0 || !childgroups) { + layer = new Layer(getNewLayerName(layernames), null, this.svgElem_); + layer.appendChildren(orphans); + this.all_layers.push(layer); + this.layer_map[name] = layer; + } else { + layer.activate(); + } + this.current_layer = layer; + } + + /** + * Creates a new top-level layer in the drawing with the given name and + * makes it the current layer. + * @param {string} name - The given name. If the layer name exists, a new name will be generated. + * @param {module:history.HistoryRecordingService} hrService - History recording service + * @returns {SVGGElement} The SVGGElement of the new layer, which is + * also the current layer of this drawing. */ - getNextId () { - const oldObjNum = this.obj_num; - let restoreOldObjNum = false; - - // If there are any released numbers in the release stack, - // use the last one instead of the next obj_num. - // We need to temporarily use obj_num as that is what getId() depends on. - if (this.releasedNums.length > 0) { - this.obj_num = this.releasedNums.pop(); - restoreOldObjNum = true; - } else { - // If we are not using a released id, then increment the obj_num. - this.obj_num++; - } - - // Ensure the ID does not exist. - let id = this.getId(); - while (this.getElem_(id)) { - if (restoreOldObjNum) { - this.obj_num = oldObjNum; - restoreOldObjNum = false; - } - this.obj_num++; - id = this.getId(); - } - // Restore the old object number if required. - if (restoreOldObjNum) { - this.obj_num = oldObjNum; - } - return id; - } - - /** - * Releases the object Id, letting it be used as the next id in getNextId(). - * This method DOES NOT remove any elements from the DOM, it is expected - * that client code will do this. - * @param {string} id - The id to release. - * @returns {boolean} True if the id was valid to be released, false otherwise. - */ - releaseId (id) { - // confirm if this is a valid id for this Document, else return false - const front = this.idPrefix + (this.nonce_ ? this.nonce_ + '_' : ''); - if (typeof id !== 'string' || !id.startsWith(front)) { - return false; - } - // extract the obj_num of this id - const num = Number.parseInt(id.substr(front.length)); - - // if we didn't get a positive number or we already released this number - // then return false. - if (typeof num !== 'number' || num <= 0 || this.releasedNums.includes(num)) { - return false; - } - - // push the released number into the released queue - this.releasedNums.push(num); - - return true; - } - - /** - * Returns the number of layers in the current drawing. - * @returns {Integer} The number of layers in the current drawing. - */ - getNumLayers () { - return this.all_layers.length; - } - - /** - * Check if layer with given name already exists. - * @param {string} name - The layer name to check - * @returns {boolean} - */ - hasLayer (name) { - return this.layer_map[name] !== undefined; - } - - /** - * Returns the name of the ith layer. If the index is out of range, an empty string is returned. - * @param {Integer} i - The zero-based index of the layer you are querying. - * @returns {string} The name of the ith layer (or the empty string if none found) - */ - getLayerName (i) { - return i >= 0 && i < this.getNumLayers() ? this.all_layers[i].getName() : ''; - } - - /** - * @returns {SVGGElement|null} The SVGGElement representing the current layer. + createLayer (name, hrService) { + if (this.current_layer) { + this.current_layer.deactivate(); + } + // Check for duplicate name. + if (name === undefined || name === null || name === '' || this.layer_map[name]) { + name = getNewLayerName(Object.keys(this.layer_map)); + } + + // Crate new layer and add to DOM as last layer + const layer = new Layer(name, null, this.svgElem_); + // Like to assume hrService exists, but this is backwards compatible with old version of createLayer. + if (hrService) { + hrService.startBatchCommand('Create Layer'); + hrService.insertElement(layer.getGroup()); + hrService.endBatchCommand(); + } + + this.all_layers.push(layer); + this.layer_map[name] = layer; + this.current_layer = layer; + return layer.getGroup(); + } + + /** + * Creates a copy of the current layer with the given name and makes it the current layer. + * @param {string} name - The given name. If the layer name exists, a new name will be generated. + * @param {module:history.HistoryRecordingService} hrService - History recording service + * @returns {SVGGElement} The SVGGElement of the new layer, which is + * also the current layer of this drawing. */ - getCurrentLayer () { - return this.current_layer ? this.current_layer.getGroup() : null; - } - - /** - * Get a layer by name. - * @param {string} name - * @returns {SVGGElement} The SVGGElement representing the named layer or null. + cloneLayer (name, hrService) { + if (!this.current_layer) { return null; } + this.current_layer.deactivate(); + // Check for duplicate name. + if (name === undefined || name === null || name === '' || this.layer_map[name]) { + name = getNewLayerName(Object.keys(this.layer_map)); + } + + // Create new group and add to DOM just after current_layer + const currentGroup = this.current_layer.getGroup(); + const layer = new Layer(name, currentGroup, this.svgElem_); + const group = layer.getGroup(); + + // Clone children + const children = [ ...currentGroup.childNodes ]; + children.forEach((child) => { + if (child.localName === 'title') { return; } + group.append(this.copyElem(child)); + }); + + if (hrService) { + hrService.startBatchCommand('Duplicate Layer'); + hrService.insertElement(group); + hrService.endBatchCommand(); + } + + // Update layer containers and current_layer. + const index = this.all_layers.indexOf(this.current_layer); + if (index >= 0) { + this.all_layers.splice(index + 1, 0, layer); + } else { + this.all_layers.push(layer); + } + this.layer_map[name] = layer; + this.current_layer = layer; + return group; + } + + /** + * Returns whether the layer is visible. If the layer name is not valid, + * then this function returns `false`. + * @param {string} layerName - The name of the layer which you want to query. + * @returns {boolean} The visibility state of the layer, or `false` if the layer name was invalid. */ - getLayerByName (name) { - const layer = this.layer_map[name]; - return layer ? layer.getGroup() : null; - } - - /** - * Returns the name of the currently selected layer. If an error occurs, an empty string - * is returned. - * @returns {string} The name of the currently active layer (or the empty string if none found). - */ - getCurrentLayerName () { - return this.current_layer ? this.current_layer.getName() : ''; - } - - /** - * Set the current layer's name. - * @param {string} name - The new name. - * @param {module:history.HistoryRecordingService} hrService - History recording service - * @returns {string|null} The new name if changed; otherwise, null. + getLayerVisibility (layerName) { + const layer = this.layer_map[layerName]; + return layer ? layer.isVisible() : false; + } + + /** + * Sets the visibility of the layer. If the layer name is not valid, this + * function returns `null`, otherwise it returns the `SVGElement` representing + * the layer. This is an undo-able action. + * @param {string} layerName - The name of the layer to change the visibility + * @param {boolean} bVisible - Whether the layer should be visible + * @returns {?SVGGElement} The SVGGElement representing the layer if the + * `layerName` was valid, otherwise `null`. */ - setCurrentLayerName (name, hrService) { - let finalName = null; - if (this.current_layer) { - const oldName = this.current_layer.getName(); - finalName = this.current_layer.setName(name, hrService); - if (finalName) { - delete this.layer_map[oldName]; - this.layer_map[finalName] = this.current_layer; - } - } - return finalName; - } - - /** - * Set the current layer's position. - * @param {Integer} newpos - The zero-based index of the new position of the layer. Range should be 0 to layers-1 - * @returns {{title: SVGGElement, previousName: string}|null} If the name was changed, returns {title:SVGGElement, previousName:string}; otherwise null. + setLayerVisibility (layerName, bVisible) { + if (typeof bVisible !== 'boolean') { + return null; + } + const layer = this.layer_map[layerName]; + if (!layer) { return null; } + layer.setVisible(bVisible); + return layer.getGroup(); + } + + /** + * Returns the opacity of the given layer. If the input name is not a layer, `null` is returned. + * @param {string} layerName - name of the layer on which to get the opacity + * @returns {?Float} The opacity value of the given layer. This will be a value between 0.0 and 1.0, or `null` + * if `layerName` is not a valid layer */ - setCurrentLayerPosition (newpos) { - const layerCount = this.getNumLayers(); - if (!this.current_layer || newpos < 0 || newpos >= layerCount) { - return null; - } - - let oldpos; - for (oldpos = 0; oldpos < layerCount; ++oldpos) { - if (this.all_layers[oldpos] === this.current_layer) { break; } - } - // some unknown error condition (current_layer not in all_layers) - if (oldpos === layerCount) { return null; } - - if (oldpos !== newpos) { - // if our new position is below us, we need to insert before the node after newpos - const currentGroup = this.current_layer.getGroup(); - const oldNextSibling = currentGroup.nextSibling; - - let refGroup = null; - if (newpos > oldpos) { - if (newpos < layerCount - 1) { - refGroup = this.all_layers[newpos + 1].getGroup(); - } - // if our new position is above us, we need to insert before the node at newpos - } else { - refGroup = this.all_layers[newpos].getGroup(); - } - this.svgElem_.insertBefore(currentGroup, refGroup); // Ok to replace with `refGroup.before(currentGroup);`? - - this.identifyLayers(); - this.setCurrentLayer(this.getLayerName(newpos)); - - return { - currentGroup, - oldNextSibling - }; - } - return null; - } - - /** - * @param {module:history.HistoryRecordingService} hrService + getLayerOpacity (layerName) { + const layer = this.layer_map[layerName]; + if (!layer) { return null; } + return layer.getOpacity(); + } + + /** + * Sets the opacity of the given layer. If the input name is not a layer, + * nothing happens. If opacity is not a value between 0.0 and 1.0, then + * nothing happens. + * NOTE: this function exists solely to apply a highlighting/de-emphasis + * effect to a layer. When it is possible for a user to affect the opacity + * of a layer, we will need to allow this function to produce an undo-able + * action. + * @param {string} layerName - Name of the layer on which to set the opacity + * @param {Float} opacity - A float value in the range 0.0-1.0 + * @returns {void} + */ + setLayerOpacity (layerName, opacity) { + if (typeof opacity !== 'number' || opacity < 0.0 || opacity > 1.0) { + return; + } + const layer = this.layer_map[layerName]; + if (layer) { + layer.setOpacity(opacity); + } + } + + /** + * Create a clone of an element, updating its ID and its children's IDs when needed. + * @param {Element} el - DOM element to clone + * @returns {Element} + */ + copyElem (el) { + const that = this; + const getNextIdClosure = function () { return that.getNextId(); }; + return utilCopyElem(el, getNextIdClosure); + } + } + + /** + * Called to ensure that drawings will or will not have randomized ids. + * The currentDrawing will have its nonce set if it doesn't already. + * @function module:draw.randomizeIds + * @param {boolean} enableRandomization - flag indicating if documents should have randomized ids + * @param {draw.Drawing} currentDrawing * @returns {void} */ - mergeLayer (hrService) { - const currentGroup = this.current_layer.getGroup(); - const prevGroup = currentGroup.previousElementSibling; - if (!prevGroup) { return; } - - hrService.startBatchCommand('Merge Layer'); - - const layerNextSibling = currentGroup.nextSibling; - hrService.removeElement(currentGroup, layerNextSibling, this.svgElem_); - - while (currentGroup.firstChild) { - const child = currentGroup.firstChild; - if (child.localName === 'title') { - hrService.removeElement(child, child.nextSibling, currentGroup); - child.remove(); - continue; - } - const oldNextSibling = child.nextSibling; - prevGroup.append(child); - hrService.moveElement(child, oldNextSibling, currentGroup); - } - - // Remove current layer's group - this.current_layer.removeGroup(); - // Remove the current layer and set the previous layer as the new current layer - const index = this.all_layers.indexOf(this.current_layer); - if (index > 0) { - const name = this.current_layer.getName(); - this.current_layer = this.all_layers[index - 1]; - this.all_layers.splice(index, 1); - delete this.layer_map[name]; - } - - hrService.endBatchCommand(); - } - - /** - * @param {module:history.HistoryRecordingService} hrService + export const randomizeIds = function (enableRandomization, currentDrawing) { + randIds = enableRandomization === false + ? RandomizeModes.NEVER_RANDOMIZE + : RandomizeModes.ALWAYS_RANDOMIZE; + + if (randIds === RandomizeModes.ALWAYS_RANDOMIZE && !currentDrawing.getNonce()) { + currentDrawing.setNonce(Math.floor(Math.random() * 100001)); + } else if (randIds === RandomizeModes.NEVER_RANDOMIZE && currentDrawing.getNonce()) { + currentDrawing.clearNonce(); + } + }; + + // Layer API Functions + + /** + * Group: Layers. + */ + + /** + * @see {@link https://api.jquery.com/jQuery.data/} + * @name external:jQuery.data + */ + + /** + * @interface module:draw.DrawCanvasInit + * @property {module:path.pathActions} pathActions + * @property {module:history.UndoManager} undoMgr + */ + /** + * @function module:draw.DrawCanvasInit#getCurrentGroup + * @returns {Element} + */ + /** + * @function module:draw.DrawCanvasInit#setCurrentGroup + * @param {Element} cg + * @returns {void} + */ + /** + * @function module:draw.DrawCanvasInit#getSelectedElements + * @returns {Element[]} the array with selected DOM elements + */ + /** + * @function module:draw.DrawCanvasInit#getSVGContent + * @returns {SVGSVGElement} + */ + /** + * @function module:draw.DrawCanvasInit#getCurrentDrawing + * @returns {module:draw.Drawing} + */ + /** + * @function module:draw.DrawCanvasInit#clearSelection + * @param {boolean} [noCall] - When `true`, does not call the "selected" handler + * @returns {void} + */ + /** + * Run the callback function associated with the given event. + * @function module:draw.DrawCanvasInit#call + * @param {"changed"|"contextset"} ev - String with the event name + * @param {module:svgcanvas.SvgCanvas#event:changed|module:svgcanvas.SvgCanvas#event:contextset} arg - Argument to pass through to the callback + * function. If the event is "changed", a (single-item) array of `Element`s is + * passed. If the event is "contextset", the arg is `null` or `Element`. * @returns {void} */ - mergeAllLayers (hrService) { - // Set the current layer to the last layer. - this.current_layer = this.all_layers[this.all_layers.length - 1]; - - hrService.startBatchCommand('Merge all Layers'); - while (this.all_layers.length > 1) { - this.mergeLayer(hrService); - } - hrService.endBatchCommand(); - } - - /** - * Sets the current layer. If the name is not a valid layer name, then this - * function returns `false`. Otherwise it returns `true`. This is not an - * undo-able action. - * @param {string} name - The name of the layer you want to switch to. - * @returns {boolean} `true` if the current layer was switched, otherwise `false` - */ - setCurrentLayer (name) { - const layer = this.layer_map[name]; - if (layer) { - if (this.current_layer) { - this.current_layer.deactivate(); - } - this.current_layer = layer; - this.current_layer.activate(); - return true; - } - return false; - } - - /** - * Deletes the current layer from the drawing and then clears the selection. - * This function then calls the 'changed' handler. This is an undoable action. - * @todo Does this actually call the 'changed' handler? - * @returns {SVGGElement} The SVGGElement of the layer removed or null. - */ - deleteCurrentLayer () { - if (this.current_layer && this.getNumLayers() > 1) { - const oldLayerGroup = this.current_layer.removeGroup(); - this.identifyLayers(); - return oldLayerGroup; - } - return null; - } - - /** - * Updates layer system and sets the current layer to the - * top-most layer (last `` child of this drawing). - * @returns {void} + /** + * @function module:draw.DrawCanvasInit#addCommandToHistory + * @param {Command} cmd + * @returns {void} + */ + /** + * @function module:draw.DrawCanvasInit#changeSVGContent + * @returns {void} */ - identifyLayers () { - this.all_layers = []; - this.layer_map = {}; - const numchildren = this.svgElem_.childNodes.length; - // loop through all children of SVG element - const orphans = [], layernames = []; - let layer = null; - let childgroups = false; - for (let i = 0; i < numchildren; ++i) { - const child = this.svgElem_.childNodes.item(i); - // for each g, find its layer name - if (child && child.nodeType === 1) { - if (child.tagName === 'g') { - childgroups = true; - const name = findLayerNameInGroup(child); - if (name) { - layernames.push(name); - layer = new Layer(name, child); - this.all_layers.push(layer); - this.layer_map[name] = layer; - } else { - // if group did not have a name, it is an orphan - orphans.push(child); - } - } else if (visElems.includes(child.nodeName)) { - // Child is "visible" (i.e. not a or <defs> element), so it is an orphan - orphans.push(child); - } - } - } - - // If orphans or no layers found, create a new layer and add all the orphans to it - if (orphans.length > 0 || !childgroups) { - layer = new Layer(getNewLayerName(layernames), null, this.svgElem_); - layer.appendChildren(orphans); - this.all_layers.push(layer); - this.layer_map[name] = layer; - } else { - layer.activate(); - } - this.current_layer = layer; - } - - /** - * Creates a new top-level layer in the drawing with the given name and - * makes it the current layer. - * @param {string} name - The given name. If the layer name exists, a new name will be generated. - * @param {module:history.HistoryRecordingService} hrService - History recording service - * @returns {SVGGElement} The SVGGElement of the new layer, which is - * also the current layer of this drawing. - */ - createLayer (name, hrService) { - if (this.current_layer) { - this.current_layer.deactivate(); - } - // Check for duplicate name. - if (name === undefined || name === null || name === '' || this.layer_map[name]) { - name = getNewLayerName(Object.keys(this.layer_map)); - } - - // Crate new layer and add to DOM as last layer - const layer = new Layer(name, null, this.svgElem_); - // Like to assume hrService exists, but this is backwards compatible with old version of createLayer. - if (hrService) { - hrService.startBatchCommand('Create Layer'); - hrService.insertElement(layer.getGroup()); - hrService.endBatchCommand(); - } - - this.all_layers.push(layer); - this.layer_map[name] = layer; - this.current_layer = layer; - return layer.getGroup(); - } - - /** - * Creates a copy of the current layer with the given name and makes it the current layer. - * @param {string} name - The given name. If the layer name exists, a new name will be generated. - * @param {module:history.HistoryRecordingService} hrService - History recording service - * @returns {SVGGElement} The SVGGElement of the new layer, which is - * also the current layer of this drawing. - */ - cloneLayer (name, hrService) { - if (!this.current_layer) { return null; } - this.current_layer.deactivate(); - // Check for duplicate name. - if (name === undefined || name === null || name === '' || this.layer_map[name]) { - name = getNewLayerName(Object.keys(this.layer_map)); - } - - // Create new group and add to DOM just after current_layer - const currentGroup = this.current_layer.getGroup(); - const layer = new Layer(name, currentGroup, this.svgElem_); - const group = layer.getGroup(); - - // Clone children - const children = [...currentGroup.childNodes]; - children.forEach((child) => { - if (child.localName === 'title') { return; } - group.append(this.copyElem(child)); - }); - - if (hrService) { - hrService.startBatchCommand('Duplicate Layer'); - hrService.insertElement(group); - hrService.endBatchCommand(); - } - - // Update layer containers and current_layer. - const index = this.all_layers.indexOf(this.current_layer); - if (index >= 0) { - this.all_layers.splice(index + 1, 0, layer); - } else { - this.all_layers.push(layer); - } - this.layer_map[name] = layer; - this.current_layer = layer; - return group; - } - - /** - * Returns whether the layer is visible. If the layer name is not valid, - * then this function returns `false`. - * @param {string} layerName - The name of the layer which you want to query. - * @returns {boolean} The visibility state of the layer, or `false` if the layer name was invalid. - */ - getLayerVisibility (layerName) { - const layer = this.layer_map[layerName]; - return layer ? layer.isVisible() : false; - } - - /** - * Sets the visibility of the layer. If the layer name is not valid, this - * function returns `null`, otherwise it returns the `SVGElement` representing - * the layer. This is an undo-able action. - * @param {string} layerName - The name of the layer to change the visibility - * @param {boolean} bVisible - Whether the layer should be visible - * @returns {?SVGGElement} The SVGGElement representing the layer if the - * `layerName` was valid, otherwise `null`. - */ - setLayerVisibility (layerName, bVisible) { - if (typeof bVisible !== 'boolean') { - return null; - } - const layer = this.layer_map[layerName]; - if (!layer) { return null; } - layer.setVisible(bVisible); - return layer.getGroup(); - } - - /** - * Returns the opacity of the given layer. If the input name is not a layer, `null` is returned. - * @param {string} layerName - name of the layer on which to get the opacity - * @returns {?Float} The opacity value of the given layer. This will be a value between 0.0 and 1.0, or `null` - * if `layerName` is not a valid layer - */ - getLayerOpacity (layerName) { - const layer = this.layer_map[layerName]; - if (!layer) { return null; } - return layer.getOpacity(); - } - - /** - * Sets the opacity of the given layer. If the input name is not a layer, - * nothing happens. If opacity is not a value between 0.0 and 1.0, then - * nothing happens. - * NOTE: this function exists solely to apply a highlighting/de-emphasis - * effect to a layer. When it is possible for a user to affect the opacity - * of a layer, we will need to allow this function to produce an undo-able - * action. - * @param {string} layerName - Name of the layer on which to set the opacity - * @param {Float} opacity - A float value in the range 0.0-1.0 - * @returns {void} - */ - setLayerOpacity (layerName, opacity) { - if (typeof opacity !== 'number' || opacity < 0.0 || opacity > 1.0) { - return; - } - const layer = this.layer_map[layerName]; - if (layer) { - layer.setOpacity(opacity); - } - } - - /** - * Create a clone of an element, updating its ID and its children's IDs when needed. - * @param {Element} el - DOM element to clone - * @returns {Element} - */ - copyElem (el) { - const that = this; - const getNextIdClosure = function () { return that.getNextId(); }; - return utilCopyElem(el, getNextIdClosure); - } -} - -/** - * Called to ensure that drawings will or will not have randomized ids. - * The currentDrawing will have its nonce set if it doesn't already. - * @function module:draw.randomizeIds - * @param {boolean} enableRandomization - flag indicating if documents should have randomized ids - * @param {draw.Drawing} currentDrawing + + let canvas_; + /** + * @function module:draw.init + * @param {module:draw.DrawCanvasInit} canvas * @returns {void} */ -export const randomizeIds = function (enableRandomization, currentDrawing) { - randIds = enableRandomization === false - ? RandomizeModes.NEVER_RANDOMIZE - : RandomizeModes.ALWAYS_RANDOMIZE; - - if (randIds === RandomizeModes.ALWAYS_RANDOMIZE && !currentDrawing.getNonce()) { - currentDrawing.setNonce(Math.floor(Math.random() * 100001)); - } else if (randIds === RandomizeModes.NEVER_RANDOMIZE && currentDrawing.getNonce()) { - currentDrawing.clearNonce(); - } -}; - -// Layer API Functions - -/** -* Group: Layers. -*/ - -/** - * @see {@link https://api.jquery.com/jQuery.data/} - * @name external:jQuery.data - */ - -/** - * @interface module:draw.DrawCanvasInit - * @property {module:path.pathActions} pathActions - * @property {module:history.UndoManager} undoMgr - */ -/** - * @function module:draw.DrawCanvasInit#getCurrentGroup - * @returns {Element} - */ -/** - * @function module:draw.DrawCanvasInit#setCurrentGroup - * @param {Element} cg - * @returns {void} -*/ -/** - * @function module:draw.DrawCanvasInit#getSelectedElements - * @returns {Element[]} the array with selected DOM elements -*/ -/** - * @function module:draw.DrawCanvasInit#getSVGContent - * @returns {SVGSVGElement} - */ -/** - * @function module:draw.DrawCanvasInit#getCurrentDrawing - * @returns {module:draw.Drawing} - */ -/** - * @function module:draw.DrawCanvasInit#clearSelection - * @param {boolean} [noCall] - When `true`, does not call the "selected" handler - * @returns {void} -*/ -/** - * Run the callback function associated with the given event. - * @function module:draw.DrawCanvasInit#call - * @param {"changed"|"contextset"} ev - String with the event name - * @param {module:svgcanvas.SvgCanvas#event:changed|module:svgcanvas.SvgCanvas#event:contextset} arg - Argument to pass through to the callback - * function. If the event is "changed", a (single-item) array of `Element`s is - * passed. If the event is "contextset", the arg is `null` or `Element`. + export const init = function (canvas) { + canvas_ = canvas; + }; + + /** + * Updates layer system. + * @function module:draw.identifyLayers * @returns {void} */ -/** - * @function module:draw.DrawCanvasInit#addCommandToHistory - * @param {Command} cmd - * @returns {void} -*/ -/** - * @function module:draw.DrawCanvasInit#changeSVGContent - * @returns {void} - */ - -let canvas_; -/** -* @function module:draw.init -* @param {module:draw.DrawCanvasInit} canvas -* @returns {void} -*/ -export const init = function (canvas) { - canvas_ = canvas; -}; - -/** -* Updates layer system. -* @function module:draw.identifyLayers -* @returns {void} -*/ -export const identifyLayers = function () { - leaveContext(); - canvas_.getCurrentDrawing().identifyLayers(); -}; - -/** -* Creates a new top-level layer in the drawing with the given name, sets the current layer -* to it, and then clears the selection. This function then calls the 'changed' handler. -* This is an undoable action. -* @function module:draw.createLayer -* @param {string} name - The given name -* @param {module:history.HistoryRecordingService} hrService -* @fires module:svgcanvas.SvgCanvas#event:changed -* @returns {void} -*/ -export const createLayer = function (name, hrService) { - const newLayer = canvas_.getCurrentDrawing().createLayer( - name, - historyRecordingService(hrService) - ); - canvas_.clearSelection(); - canvas_.call('changed', [newLayer]); -}; - -/** - * Creates a new top-level layer in the drawing with the given name, copies all the current layer's contents + export const identifyLayers = function () { + leaveContext(); + canvas_.getCurrentDrawing().identifyLayers(); + }; + + /** + * Creates a new top-level layer in the drawing with the given name, sets the current layer * to it, and then clears the selection. This function then calls the 'changed' handler. * This is an undoable action. - * @function module:draw.cloneLayer - * @param {string} name - The given name. If the layer name exists, a new name will be generated. - * @param {module:history.HistoryRecordingService} hrService - History recording service + * @function module:draw.createLayer + * @param {string} name - The given name + * @param {module:history.HistoryRecordingService} hrService * @fires module:svgcanvas.SvgCanvas#event:changed * @returns {void} */ -export const cloneLayer = function (name, hrService) { - // Clone the current layer and make the cloned layer the new current layer - const newLayer = canvas_.getCurrentDrawing().cloneLayer(name, historyRecordingService(hrService)); - - canvas_.clearSelection(); - leaveContext(); - canvas_.call('changed', [newLayer]); -}; - -/** -* Deletes the current layer from the drawing and then clears the selection. This function -* then calls the 'changed' handler. This is an undoable action. -* @function module:draw.deleteCurrentLayer -* @fires module:svgcanvas.SvgCanvas#event:changed -* @returns {boolean} `true` if an old layer group was found to delete -*/ -export const deleteCurrentLayer = function () { - let currentLayer = canvas_.getCurrentDrawing().getCurrentLayer(); - const {nextSibling} = currentLayer; - const parent = currentLayer.parentNode; - currentLayer = canvas_.getCurrentDrawing().deleteCurrentLayer(); - if (currentLayer) { - const batchCmd = new BatchCommand('Delete Layer'); - // store in our Undo History - batchCmd.addSubCommand(new RemoveElementCommand(currentLayer, nextSibling, parent)); - canvas_.addCommandToHistory(batchCmd); - canvas_.clearSelection(); - canvas_.call('changed', [parent]); - return true; - } - return false; -}; - -/** -* Sets the current layer. If the name is not a valid layer name, then this function returns -* false. Otherwise it returns true. This is not an undo-able action. -* @function module:draw.setCurrentLayer -* @param {string} name - The name of the layer you want to switch to. -* @returns {boolean} true if the current layer was switched, otherwise false -*/ -export const setCurrentLayer = function (name) { - const result = canvas_.getCurrentDrawing().setCurrentLayer(toXml(name)); - if (result) { - canvas_.clearSelection(); - } - return result; -}; - -/** -* Renames the current layer. If the layer name is not valid (i.e. unique), then this function -* does nothing and returns `false`, otherwise it returns `true`. This is an undo-able action. -* @function module:draw.renameCurrentLayer -* @param {string} newName - the new name you want to give the current layer. This name must -* be unique among all layer names. -* @fires module:svgcanvas.SvgCanvas#event:changed -* @returns {boolean} Whether the rename succeeded -*/ -export const renameCurrentLayer = function (newName) { - const drawing = canvas_.getCurrentDrawing(); - const layer = drawing.getCurrentLayer(); - if (layer) { - const result = drawing.setCurrentLayerName(newName, historyRecordingService()); - if (result) { - canvas_.call('changed', [layer]); - return true; - } - } - return false; -}; - -/** -* Changes the position of the current layer to the new value. If the new index is not valid, -* this function does nothing and returns false, otherwise it returns true. This is an -* undo-able action. -* @function module:draw.setCurrentLayerPosition -* @param {Integer} newPos - The zero-based index of the new position of the layer. This should be between -* 0 and (number of layers - 1) -* @returns {boolean} `true` if the current layer position was changed, `false` otherwise. -*/ -export const setCurrentLayerPosition = function (newPos) { - const drawing = canvas_.getCurrentDrawing(); - const result = drawing.setCurrentLayerPosition(newPos); - if (result) { - canvas_.addCommandToHistory(new MoveElementCommand(result.currentGroup, result.oldNextSibling, canvas_.getSVGContent())); - return true; - } - return false; -}; - -/** -* Sets the visibility of the layer. If the layer name is not valid, this function return -* `false`, otherwise it returns `true`. This is an undo-able action. -* @function module:draw.setLayerVisibility -* @param {string} layerName - The name of the layer to change the visibility -* @param {boolean} bVisible - Whether the layer should be visible -* @returns {boolean} true if the layer's visibility was set, false otherwise -*/ -export const setLayerVisibility = function (layerName, bVisible) { - const drawing = canvas_.getCurrentDrawing(); - const prevVisibility = drawing.getLayerVisibility(layerName); - const layer = drawing.setLayerVisibility(layerName, bVisible); - if (layer) { - const oldDisplay = prevVisibility ? 'inline' : 'none'; - canvas_.addCommandToHistory(new ChangeElementCommand(layer, {display: oldDisplay}, 'Layer Visibility')); - } else { - return false; - } - - if (layer === drawing.getCurrentLayer()) { - canvas_.clearSelection(); - canvas_.pathActions.clear(); - } - // call('changed', [selected]); - return true; -}; - -/** -* Moves the selected elements to layerName. If the name is not a valid layer name, then `false` -* is returned. Otherwise it returns `true`. This is an undo-able action. -* @function module:draw.moveSelectedToLayer -* @param {string} layerName - The name of the layer you want to which you want to move the selected elements -* @returns {boolean} Whether the selected elements were moved to the layer. -*/ -export const moveSelectedToLayer = function (layerName) { - // find the layer - const drawing = canvas_.getCurrentDrawing(); - const layer = drawing.getLayerByName(layerName); - if (!layer) { return false; } - - const batchCmd = new BatchCommand('Move Elements to Layer'); - - // loop for each selected element and move it - const selElems = canvas_.getSelectedElements(); - let i = selElems.length; - while (i--) { - const elem = selElems[i]; - if (!elem) { continue; } - const oldNextSibling = elem.nextSibling; - // TODO: this is pretty brittle! - const oldLayer = elem.parentNode; - layer.append(elem); - batchCmd.addSubCommand(new MoveElementCommand(elem, oldNextSibling, oldLayer)); - } - - canvas_.addCommandToHistory(batchCmd); - - return true; -}; - -/** -* @function module:draw.mergeLayer -* @param {module:history.HistoryRecordingService} hrService -* @returns {void} -*/ -export const mergeLayer = function (hrService) { - canvas_.getCurrentDrawing().mergeLayer(historyRecordingService(hrService)); - canvas_.clearSelection(); - leaveContext(); - canvas_.changeSVGContent(); -}; - -/** -* @function module:draw.mergeAllLayers -* @param {module:history.HistoryRecordingService} hrService -* @returns {void} -*/ -export const mergeAllLayers = function (hrService) { - canvas_.getCurrentDrawing().mergeAllLayers(historyRecordingService(hrService)); - canvas_.clearSelection(); - leaveContext(); - canvas_.changeSVGContent(); -}; - -/** -* Return from a group context to the regular kind, make any previously -* disabled elements enabled again. -* @function module:draw.leaveContext -* @fires module:svgcanvas.SvgCanvas#event:contextset -* @returns {void} -*/ -export const leaveContext = function () { - const len = disabledElems.length; - const dataStorage = canvas_.getDataStorage(); - if (len) { - for (let i = 0; i < len; i++) { - const elem = disabledElems[i]; - const orig = dataStorage.get(elem, 'orig_opac'); - if (orig !== 1) { - elem.setAttribute('opacity', orig); - } else { - elem.removeAttribute('opacity'); - } - elem.setAttribute('style', 'pointer-events: inherit'); - } - disabledElems = []; - canvas_.clearSelection(true); - canvas_.call('contextset', null); - } - canvas_.setCurrentGroup(null); -}; - -/** -* Set the current context (for in-group editing). -* @function module:draw.setContext -* @param {Element} elem -* @fires module:svgcanvas.SvgCanvas#event:contextset -* @returns {void} -*/ -export const setContext = function (elem) { - const dataStorage = canvas_.getDataStorage(); - leaveContext(); - if (typeof elem === 'string') { - elem = getElem(elem); - } - - // Edit inside this group - canvas_.setCurrentGroup(elem); - - // Disable other elements - const parentsUntil = getParentsUntil(elem, '#svgcontent'); - let siblings = []; - parentsUntil.forEach(function (parent) { - const elements = Array.prototype.filter.call(parent.parentNode.children, function(child){ - return child !== parent; - }); - elements.forEach(function (element) { - siblings.push(element); - }); - }); - - siblings.forEach(function (curthis) { - const opac = curthis.getAttribute('opacity') || 1; - // Store the original's opacity - dataStorage.put(curthis, 'orig_opac', opac); - curthis.setAttribute('opacity', opac * 0.33); - curthis.setAttribute('style', 'pointer-events: none'); - disabledElems.push(curthis); - }); - canvas_.clearSelection(); - canvas_.call('contextset', canvas_.getCurrentGroup()); -}; - -/** -* @memberof module:draw -* @class Layer -* @see {@link module:layer.Layer} -*/ -export {Layer}; + export const createLayer = function (name, hrService) { + const newLayer = canvas_.getCurrentDrawing().createLayer( + name, + historyRecordingService(hrService) + ); + canvas_.clearSelection(); + canvas_.call('changed', [ newLayer ]); + }; + + /** + * Creates a new top-level layer in the drawing with the given name, copies all the current layer's contents + * to it, and then clears the selection. This function then calls the 'changed' handler. + * This is an undoable action. + * @function module:draw.cloneLayer + * @param {string} name - The given name. If the layer name exists, a new name will be generated. + * @param {module:history.HistoryRecordingService} hrService - History recording service + * @fires module:svgcanvas.SvgCanvas#event:changed + * @returns {void} + */ + export const cloneLayer = function (name, hrService) { + // Clone the current layer and make the cloned layer the new current layer + const newLayer = canvas_.getCurrentDrawing().cloneLayer(name, historyRecordingService(hrService)); + + canvas_.clearSelection(); + leaveContext(); + canvas_.call('changed', [ newLayer ]); + }; + + /** + * Deletes the current layer from the drawing and then clears the selection. This function + * then calls the 'changed' handler. This is an undoable action. + * @function module:draw.deleteCurrentLayer + * @fires module:svgcanvas.SvgCanvas#event:changed + * @returns {boolean} `true` if an old layer group was found to delete + */ + export const deleteCurrentLayer = function () { + let currentLayer = canvas_.getCurrentDrawing().getCurrentLayer(); + const { nextSibling } = currentLayer; + const parent = currentLayer.parentNode; + currentLayer = canvas_.getCurrentDrawing().deleteCurrentLayer(); + if (currentLayer) { + const batchCmd = new BatchCommand('Delete Layer'); + // store in our Undo History + batchCmd.addSubCommand(new RemoveElementCommand(currentLayer, nextSibling, parent)); + canvas_.addCommandToHistory(batchCmd); + canvas_.clearSelection(); + canvas_.call('changed', [ parent ]); + return true; + } + return false; + }; + + /** + * Sets the current layer. If the name is not a valid layer name, then this function returns + * false. Otherwise it returns true. This is not an undo-able action. + * @function module:draw.setCurrentLayer + * @param {string} name - The name of the layer you want to switch to. + * @returns {boolean} true if the current layer was switched, otherwise false + */ + export const setCurrentLayer = function (name) { + const result = canvas_.getCurrentDrawing().setCurrentLayer(toXml(name)); + if (result) { + canvas_.clearSelection(); + } + return result; + }; + + /** + * Renames the current layer. If the layer name is not valid (i.e. unique), then this function + * does nothing and returns `false`, otherwise it returns `true`. This is an undo-able action. + * @function module:draw.renameCurrentLayer + * @param {string} newName - the new name you want to give the current layer. This name must + * be unique among all layer names. + * @fires module:svgcanvas.SvgCanvas#event:changed + * @returns {boolean} Whether the rename succeeded + */ + export const renameCurrentLayer = function (newName) { + const drawing = canvas_.getCurrentDrawing(); + const layer = drawing.getCurrentLayer(); + if (layer) { + const result = drawing.setCurrentLayerName(newName, historyRecordingService()); + if (result) { + canvas_.call('changed', [ layer ]); + return true; + } + } + return false; + }; + + /** + * Changes the position of the current layer to the new value. If the new index is not valid, + * this function does nothing and returns false, otherwise it returns true. This is an + * undo-able action. + * @function module:draw.setCurrentLayerPosition + * @param {Integer} newPos - The zero-based index of the new position of the layer. This should be between + * 0 and (number of layers - 1) + * @returns {boolean} `true` if the current layer position was changed, `false` otherwise. + */ + export const setCurrentLayerPosition = function (newPos) { + const drawing = canvas_.getCurrentDrawing(); + const result = drawing.setCurrentLayerPosition(newPos); + if (result) { + canvas_.addCommandToHistory(new MoveElementCommand(result.currentGroup, result.oldNextSibling, canvas_.getSVGContent())); + return true; + } + return false; + }; + + /** + * Sets the visibility of the layer. If the layer name is not valid, this function return + * `false`, otherwise it returns `true`. This is an undo-able action. + * @function module:draw.setLayerVisibility + * @param {string} layerName - The name of the layer to change the visibility + * @param {boolean} bVisible - Whether the layer should be visible + * @returns {boolean} true if the layer's visibility was set, false otherwise + */ + export const setLayerVisibility = function (layerName, bVisible) { + const drawing = canvas_.getCurrentDrawing(); + const prevVisibility = drawing.getLayerVisibility(layerName); + const layer = drawing.setLayerVisibility(layerName, bVisible); + if (layer) { + const oldDisplay = prevVisibility ? 'inline' : 'none'; + canvas_.addCommandToHistory(new ChangeElementCommand(layer, { display: oldDisplay }, 'Layer Visibility')); + } else { + return false; + } + + if (layer === drawing.getCurrentLayer()) { + canvas_.clearSelection(); + canvas_.pathActions.clear(); + } + // call('changed', [selected]); + return true; + }; + + /** + * Moves the selected elements to layerName. If the name is not a valid layer name, then `false` + * is returned. Otherwise it returns `true`. This is an undo-able action. + * @function module:draw.moveSelectedToLayer + * @param {string} layerName - The name of the layer you want to which you want to move the selected elements + * @returns {boolean} Whether the selected elements were moved to the layer. + */ + export const moveSelectedToLayer = function (layerName) { + // find the layer + const drawing = canvas_.getCurrentDrawing(); + const layer = drawing.getLayerByName(layerName); + if (!layer) { return false; } + + const batchCmd = new BatchCommand('Move Elements to Layer'); + + // loop for each selected element and move it + const selElems = canvas_.getSelectedElements(); + let i = selElems.length; + while (i--) { + const elem = selElems[i]; + if (!elem) { continue; } + const oldNextSibling = elem.nextSibling; + // TODO: this is pretty brittle! + const oldLayer = elem.parentNode; + layer.append(elem); + batchCmd.addSubCommand(new MoveElementCommand(elem, oldNextSibling, oldLayer)); + } + + canvas_.addCommandToHistory(batchCmd); + + return true; + }; + + /** + * @function module:draw.mergeLayer + * @param {module:history.HistoryRecordingService} hrService + * @returns {void} + */ + export const mergeLayer = function (hrService) { + canvas_.getCurrentDrawing().mergeLayer(historyRecordingService(hrService)); + canvas_.clearSelection(); + leaveContext(); + canvas_.changeSVGContent(); + }; + + /** + * @function module:draw.mergeAllLayers + * @param {module:history.HistoryRecordingService} hrService + * @returns {void} + */ + export const mergeAllLayers = function (hrService) { + canvas_.getCurrentDrawing().mergeAllLayers(historyRecordingService(hrService)); + canvas_.clearSelection(); + leaveContext(); + canvas_.changeSVGContent(); + }; + + /** + * Return from a group context to the regular kind, make any previously + * disabled elements enabled again. + * @function module:draw.leaveContext + * @fires module:svgcanvas.SvgCanvas#event:contextset + * @returns {void} + */ + export const leaveContext = function () { + const len = disabledElems.length; + const dataStorage = canvas_.getDataStorage(); + if (len) { + for (let i = 0; i < len; i++) { + const elem = disabledElems[i]; + const orig = dataStorage.get(elem, 'orig_opac'); + if (orig !== 1) { + elem.setAttribute('opacity', orig); + } else { + elem.removeAttribute('opacity'); + } + elem.setAttribute('style', 'pointer-events: inherit'); + } + disabledElems = []; + canvas_.clearSelection(true); + canvas_.call('contextset', null); + } + canvas_.setCurrentGroup(null); + }; + + /** + * Set the current context (for in-group editing). + * @function module:draw.setContext + * @param {Element} elem + * @fires module:svgcanvas.SvgCanvas#event:contextset + * @returns {void} + */ + export const setContext = function (elem) { + const dataStorage = canvas_.getDataStorage(); + leaveContext(); + if (typeof elem === 'string') { + elem = getElem(elem); + } + + // Edit inside this group + canvas_.setCurrentGroup(elem); + + // Disable other elements + const parentsUntil = getParentsUntil(elem, '#svgcontent'); + let siblings = []; + parentsUntil.forEach(function (parent) { + const elements = Array.prototype.filter.call(parent.parentNode.children, function(child){ + return child !== parent; + }); + elements.forEach(function (element) { + siblings.push(element); + }); + }); + + siblings.forEach(function (curthis) { + const opac = curthis.getAttribute('opacity') || 1; + // Store the original's opacity + dataStorage.put(curthis, 'orig_opac', opac); + curthis.setAttribute('opacity', opac * 0.33); + curthis.setAttribute('style', 'pointer-events: none'); + disabledElems.push(curthis); + }); + canvas_.clearSelection(); + canvas_.call('contextset', canvas_.getCurrentGroup()); + }; + + /** + * @memberof module:draw + * @class Layer + * @see {@link module:layer.Layer} + */ + export { Layer }; + \ No newline at end of file diff --git a/src/svgcanvas/elem-get-set.js b/src/svgcanvas/elem-get-set.js index fc9ae162..f2696069 100644 --- a/src/svgcanvas/elem-get-set.js +++ b/src/svgcanvas/elem-get-set.js @@ -210,11 +210,11 @@ export const setResolutionMethod = function (x, y) { this.contentH = y; batchCmd.addSubCommand(new ChangeElementCommand(elemContext_.getSVGContent(), { width: w, height: h })); - elemContext_.getSVGContent().setAttribute('viewBox', [0, 0, x / currentZoom, y / currentZoom].join(' ')); - batchCmd.addSubCommand(new ChangeElementCommand(elemContext_.getSVGContent(), { viewBox: ['0 0', w, h].join(' ') })); + elemContext_.getSVGContent().setAttribute('viewBox', [ 0, 0, x / currentZoom, y / currentZoom ].join(' ')); + batchCmd.addSubCommand(new ChangeElementCommand(elemContext_.getSVGContent(), { viewBox: [ '0 0', w, h ].join(' ') })); elemContext_.addCommandToHistory(batchCmd); - elemContext_.call('changed', [elemContext_.getSVGContent()]); + elemContext_.call('changed', [ elemContext_.getSVGContent() ]); } return true; }; @@ -403,7 +403,7 @@ export const findDuplicateGradient = function (grad) { const defs = findDefs(); const existingGrads = defs.querySelectorAll('linearGradient, radialGradient'); let i = existingGrads.length; - const radAttrs = ['r', 'cx', 'cy', 'fx', 'fy']; + const radAttrs = [ 'r', 'cx', 'cy', 'fx', 'fy' ]; while (i--) { const og = existingGrads[i]; if (grad.tagName === 'linearGradient') { @@ -501,7 +501,7 @@ export const setPaintMethod = function (type, paint) { */ export const setStrokeWidthMethod = function (val) { const selectedElements = elemContext_.getSelectedElements(); - if (val === 0 && ['line', 'path'].includes(elemContext_.getCanvas().getMode())) { + if (val === 0 && [ 'line', 'path' ].includes(elemContext_.getCanvas().getMode())) { elemContext_.getCanvas().setStrokeWidth(1); return; } @@ -782,7 +782,7 @@ export const setImageURLMethod = function (val) { batchCmd.addSubCommand(new ChangeElementCommand(elem, changes)); elemContext_.addCommandToHistory(batchCmd); - elemContext_.call('changed', [elem]); + elemContext_.call('changed', [ elem ]); }; img.src = val; }; @@ -838,7 +838,7 @@ export const setRectRadiusMethod = function (val) { selected.setAttribute('rx', val); selected.setAttribute('ry', val); elemContext_.addCommandToHistory(new ChangeElementCommand(selected, { rx: r, ry: r }, 'Radius')); - elemContext_.call('changed', [selected]); + elemContext_.call('changed', [ selected ]); } } }; diff --git a/src/svgcanvas/event.js b/src/svgcanvas/event.js index 993f744d..365a9a5f 100644 --- a/src/svgcanvas/event.js +++ b/src/svgcanvas/event.js @@ -51,10 +51,10 @@ export const getBsplinePoint = function (t) { t3 = t2 * t; const m = [ - [-1, 3, -3, 1], - [3, -6, 3, 0], - [-3, 0, 3, 0], - [1, 4, 1, 0] + [ -1, 3, -3, 1 ], + [ 3, -6, 3, 0 ], + [ -3, 0, 3, 0 ], + [ 1, 4, 1, 0 ] ]; spline.x = S * ( @@ -619,7 +619,7 @@ export const mouseUpEvent = function (evt) { // if it was a path // else, if it was selected and this is a shift-click, remove it from selection } else if (evt.shiftKey && tempJustSelected !== t) { - eventContext_.getCanvas().removeFromSelection([t]); + eventContext_.getCanvas().removeFromSelection([ t ]); } } // no change in mouse position @@ -709,7 +709,7 @@ export const mouseUpEvent = function (evt) { id: eventContext_.getId() } }); - eventContext_.getCanvas().call('changed', [element]); + eventContext_.getCanvas().call('changed', [ element ]); keep = true; } break; @@ -727,13 +727,13 @@ export const mouseUpEvent = function (evt) { id: eventContext_.getId() } }); - eventContext_.getCanvas().call('changed', [element]); + eventContext_.getCanvas().call('changed', [ element ]); keep = true; } break; case 'text': keep = true; - eventContext_.getCanvas().selectOnly([element]); + eventContext_.getCanvas().selectOnly([ element ]); eventContext_.getCanvas().textActions.start(element); break; case 'path': { @@ -818,7 +818,7 @@ export const mouseUpEvent = function (evt) { ) { // switch into "select" mode if we've clicked on an element eventContext_.getCanvas().setMode('select'); - eventContext_.getCanvas().selectOnly([t], true); + eventContext_.getCanvas().selectOnly([ t ], true); } } else if (!isNullish(element)) { /** @@ -856,12 +856,12 @@ export const mouseUpEvent = function (evt) { if (eventContext_.getCurrentMode() === 'path') { eventContext_.getCanvas().pathActions.toEditMode(element); } else if (eventContext_.getCurConfig().selectNew) { - eventContext_.getCanvas().selectOnly([element], true); + eventContext_.getCanvas().selectOnly([ element ], true); } // we create the insert command that is stored on the stack // undo means to call cmd.unapply(), redo means to call cmd.apply() eventContext_.addCommandToHistory(new InsertElementCommand(element)); - eventContext_.getCanvas().call('changed', [element]); + eventContext_.getCanvas().call('changed', [ element ]); }, aniDur * 1000); } eventContext_.setStartTransform(null); @@ -1003,7 +1003,7 @@ export const mouseDownEvent = function (evt) { // No need to do the call here as it will be done on addToSelection eventContext_.getCanvas().clearSelection(true); } - eventContext_.getCanvas().addToSelection([mouseTarget]); + eventContext_.getCanvas().addToSelection([ mouseTarget ]); eventContext_.setJustSelected(mouseTarget); eventContext_.getCanvas().pathActions.clear(); } @@ -1062,7 +1062,7 @@ export const mouseDownEvent = function (evt) { // want to orient around it eventContext_.setInitBbox(utilsGetBBox($id('selectedBox0'))); const bb = {}; - for (const [key, val] of Object.entries(eventContext_.getInitBbox())) { + for (const [ key, val ] of Object.entries(eventContext_.getInitBbox())) { bb[key] = val / currentZoom; } eventContext_.setInitBbox(bb); diff --git a/src/svgcanvas/history.js b/src/svgcanvas/history.js index 90a43ed6..e8ab6a3a 100644 --- a/src/svgcanvas/history.js +++ b/src/svgcanvas/history.js @@ -6,8 +6,8 @@ * @copyright 2010 Jeff Schiller */ -import {getHref, setHref, getRotationAngle, isNullish} from './utilities.js'; -import {removeElementFromListMap} from './svgtransformlist.js'; +import { getHref, setHref, getRotationAngle, isNullish } from './utilities.js'; +import { removeElementFromListMap } from './svgtransformlist.js'; /** * Group: Undo/Redo history management. @@ -56,7 +56,7 @@ export class Command { * This function needs to be surcharged if multiple elements are returned. */ elements () { - return [this.elem]; + return [ this.elem ]; } /** @@ -312,7 +312,7 @@ export class ChangeElementCommand extends Command { apply (handler) { super.apply(handler, () => { let bChangedTransform = false; - Object.entries(this.newValues).forEach(([attr, value]) => { + Object.entries(this.newValues).forEach(([ attr, value ]) => { if (value) { if (attr === '#text') { this.elem.textContent = value; @@ -338,7 +338,7 @@ export class ChangeElementCommand extends Command { const bbox = this.elem.getBBox(); const cx = bbox.x + bbox.width / 2; const cy = bbox.y + bbox.height / 2; - const rotate = ['rotate(', angle, ' ', cx, ',', cy, ')'].join(''); + const rotate = [ 'rotate(', angle, ' ', cx, ',', cy, ')' ].join(''); if (rotate !== this.elem.getAttribute('transform')) { this.elem.setAttribute('transform', rotate); } @@ -356,7 +356,7 @@ export class ChangeElementCommand extends Command { unapply (handler) { super.unapply(handler, () => { let bChangedTransform = false; - Object.entries(this.oldValues).forEach(([attr, value]) => { + Object.entries(this.oldValues).forEach(([ attr, value ]) => { if (value) { if (attr === '#text') { this.elem.textContent = value; @@ -379,7 +379,7 @@ export class ChangeElementCommand extends Command { const bbox = this.elem.getBBox(); const cx = bbox.x + bbox.width / 2, cy = bbox.y + bbox.height / 2; - const rotate = ['rotate(', angle, ' ', cx, ',', cy, ')'].join(''); + const rotate = [ 'rotate(', angle, ' ', cx, ',', cy, ')' ].join(''); if (rotate !== this.elem.getAttribute('transform')) { this.elem.setAttribute('transform', rotate); } @@ -608,7 +608,7 @@ export class UndoManager { finishUndoableChange () { const p = this.undoChangeStackPointer--; const changeset = this.undoableChangeStack[p]; - const {attrName} = changeset; + const { attrName } = changeset; const batchCmd = new BatchCommand('Change ' + attrName); let i = changeset.elements.length; while (i--) { diff --git a/src/svgcanvas/historyrecording.js b/src/svgcanvas/historyrecording.js index 91eefb8a..5e9f92ab 100644 --- a/src/svgcanvas/historyrecording.js +++ b/src/svgcanvas/historyrecording.js @@ -77,7 +77,7 @@ class HistoryRecordingService { if (this.currentBatchCommand_) { const batchCommand = this.currentBatchCommand_; this.batchCommandStack_.pop(); - const {length: len} = this.batchCommandStack_; + const { length: len } = this.batchCommandStack_; this.currentBatchCommand_ = len ? this.batchCommandStack_[len - 1] : null; this.addCommand_(batchCommand); } diff --git a/src/svgcanvas/jQuery.attr.js b/src/svgcanvas/jQuery.attr.js index eafb505e..efd391f0 100644 --- a/src/svgcanvas/jQuery.attr.js +++ b/src/svgcanvas/jQuery.attr.js @@ -58,7 +58,7 @@ export default function jQueryPluginSVG ($) { } if (typeof key === 'object') { // Setting attributes from object - for (const [name, val] of Object.entries(key)) { + for (const [ name, val ] of Object.entries(key)) { elem.setAttribute(name, val); } // Getting attribute diff --git a/src/svgcanvas/json.js b/src/svgcanvas/json.js index bea225d3..41253ff2 100644 --- a/src/svgcanvas/json.js +++ b/src/svgcanvas/json.js @@ -5,8 +5,8 @@ * * @copyright 2010 Alexis Deveria, 2010 Jeff Schiller */ -import {getElem, assignAttributes, cleanupElement} from './utilities.js'; -import {NS} from '../common/namespaces.js'; +import { getElem, assignAttributes, cleanupElement } from './utilities.js'; +import { NS } from '../common/namespaces.js'; let jsonContext_ = null; let svgdoc_ = null; diff --git a/src/svgcanvas/layer.js b/src/svgcanvas/layer.js index fa3cac48..e238a72a 100644 --- a/src/svgcanvas/layer.js +++ b/src/svgcanvas/layer.js @@ -6,8 +6,8 @@ * @copyright 2011 Jeff Schiller, 2016 Flint O'Brien */ -import {NS} from '../common/namespaces.js'; -import {toXml, walkTree, isNullish} from './utilities.js'; +import { NS } from '../common/namespaces.js'; +import { toXml, walkTree, isNullish } from './utilities.js'; /** @@ -175,7 +175,7 @@ class Layer { title.textContent = name; this.name_ = name; if (hrService) { - hrService.changeElement(title, {'#text': previousName}); + hrService.changeElement(title, { '#text': previousName }); } return this.name_; } diff --git a/src/svgcanvas/math.js b/src/svgcanvas/math.js index 18644370..16573c4d 100644 --- a/src/svgcanvas/math.js +++ b/src/svgcanvas/math.js @@ -19,8 +19,8 @@ * @property {Float} y */ -import {NS} from '../common/namespaces.js'; -import {getTransformList} from './svgtransformlist.js'; +import { NS } from '../common/namespaces.js'; +import { getTransformList } from './svgtransformlist.js'; // Constants const NEAR_ZERO = 1e-14; @@ -38,7 +38,7 @@ const svg = document.createElementNS(NS.SVG, 'svg'); * @returns {module:math.XYObject} An x, y object representing the transformed point */ export const transformPoint = function (x, y, m) { - return {x: m.a * x + m.c * y + m.e, y: m.b * x + m.d * y + m.f}; + return { x: m.a * x + m.c * y + m.e, y: m.b * x + m.d * y + m.f }; }; /** diff --git a/src/svgcanvas/paste-elem.js b/src/svgcanvas/paste-elem.js index 6f00e951..1194b60d 100644 --- a/src/svgcanvas/paste-elem.js +++ b/src/svgcanvas/paste-elem.js @@ -70,7 +70,7 @@ export const pasteElementsMethod = function (type, x, y) { pasteContext_.getCanvas().runExtensions( 'IDsUpdated', /** @type {module:svgcanvas.SvgCanvas#event:ext_IDsUpdated} */ - {elems: clipb, changes: changedIDs}, + { elems: clipb, changes: changedIDs }, true ).forEach(function (extChanges) { if (!extChanges || !('remove' in extChanges)) return; diff --git a/src/svgcanvas/path-actions.js b/src/svgcanvas/path-actions.js index b37ca972..a4b69975 100644 --- a/src/svgcanvas/path-actions.js +++ b/src/svgcanvas/path-actions.js @@ -7,10 +7,10 @@ * @copyright 2011 Alexis Deveria, 2011 Jeff Schiller */ -import {NS} from '../common/namespaces.js'; -import {shortFloat} from '../common/units.js'; -import {getTransformList} from './svgtransformlist.js'; -import {ChangeElementCommand, BatchCommand} from './history.js'; +import { NS } from '../common/namespaces.js'; +import { shortFloat } from '../common/units.js'; +import { getTransformList } from './svgtransformlist.js'; +import { ChangeElementCommand, BatchCommand } from './history.js'; import { transformPoint, snapToAngle, rectsIntersect, transformListToTransform @@ -49,7 +49,7 @@ export const init = function (pathActionsContext) { * @returns {string} */ export const convertPath = function (pth, toRel) { - const {pathSegList} = pth; + const { pathSegList } = pth; const len = pathSegList.numberOfItems; let curx = 0, cury = 0; let d = ''; @@ -92,7 +92,7 @@ export const convertPath = function (pth, toRel) { letter = 'L'; } // Convert to "line" for easier editing - d += pathDSegment(letter, [[x, y]]); + d += pathDSegment(letter, [ [ x, y ] ]); break; case 14: // absolute vertical line (V) y -= cury; @@ -109,7 +109,7 @@ export const convertPath = function (pth, toRel) { letter = 'L'; } // Convert to "line" for easier editing - d += pathDSegment(letter, [[x, y]]); + d += pathDSegment(letter, [ [ x, y ] ]); break; case 2: // absolute move (M) case 4: // absolute line (L) @@ -130,9 +130,9 @@ export const convertPath = function (pth, toRel) { curx = x; cury = y; } - if (type === 2 || type === 3) { lastM = [curx, cury]; } + if (type === 2 || type === 3) { lastM = [ curx, cury ]; } - d += pathDSegment(letter, [[x, y]]); + d += pathDSegment(letter, [ [ x, y ] ]); break; case 6: // absolute cubic (C) x -= curx; x1 -= curx; x2 -= curx; @@ -148,7 +148,7 @@ export const convertPath = function (pth, toRel) { curx = x; cury = y; } - d += pathDSegment(letter, [[x1, y1], [x2, y2], [x, y]]); + d += pathDSegment(letter, [ [ x1, y1 ], [ x2, y2 ], [ x, y ] ]); break; case 8: // absolute quad (Q) x -= curx; x1 -= curx; @@ -164,7 +164,7 @@ export const convertPath = function (pth, toRel) { curx = x; cury = y; } - d += pathDSegment(letter, [[x1, y1], [x, y]]); + d += pathDSegment(letter, [ [ x1, y1 ], [ x, y ] ]); break; // Fallthrough case 11: // relative elliptical arc (a) @@ -177,11 +177,11 @@ export const convertPath = function (pth, toRel) { curx = x; cury = y; } - d += pathDSegment(letter, [[seg.r1, seg.r2]], [ + d += pathDSegment(letter, [ [ seg.r1, seg.r2 ] ], [ seg.angle, (seg.largeArcFlag ? 1 : 0), (seg.sweepFlag ? 1 : 0) - ], [x, y]); + ], [ x, y ]); break; case 16: // absolute smooth cubic (S) x -= curx; x2 -= curx; @@ -197,7 +197,7 @@ export const convertPath = function (pth, toRel) { curx = x; cury = y; } - d += pathDSegment(letter, [[x2, y2], [x, y]]); + d += pathDSegment(letter, [ [ x2, y2 ], [ x, y ] ]); break; } // switch on path segment type } // for each segment @@ -252,7 +252,7 @@ export const pathActionsMethod = (function () { */ const smoothPolylineIntoPath = function (element) { let i; - const {points} = element; + const { points } = element; const N = points.numberOfItems; if (N >= 4) { // loop through every 3 points and convert to a cubic bezier curve segment @@ -270,7 +270,7 @@ export const pathActionsMethod = (function () { // - https://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/Bezier/bezier-der.html let curpos = points.getItem(0), prevCtlPt = null; let d = []; - d.push(['M', curpos.x, ',', curpos.y, ' C'].join('')); + d.push([ 'M', curpos.x, ',', curpos.y, ' C' ].join('')); for (i = 1; i <= (N - 4); i += 3) { let ct1 = points.getItem(i); const ct2 = points.getItem(i + 1); @@ -289,7 +289,7 @@ export const pathActionsMethod = (function () { } } - d.push([ct1.x, ct1.y, ct2.x, ct2.y, end.x, end.y].join(',')); + d.push([ ct1.x, ct1.y, ct2.x, ct2.y, end.x, end.y ].join(',')); curpos = end; prevCtlPt = ct2; @@ -298,7 +298,7 @@ export const pathActionsMethod = (function () { d.push('L'); while (i < N) { const pt = points.getItem(i); - d.push([pt.x, pt.y].join(',')); + d.push([ pt.x, pt.y ].join(',')); i++; } d = d.join(' '); @@ -318,8 +318,7 @@ export const pathActionsMethod = (function () { } return element; }; - // console.log(pathActionsContext_); - // const convertPath = pathActionsContext_.getConvertPath(); + return (/** @lends module:path.pathActions */ { /** * @param {MouseEvent} evt @@ -339,7 +338,7 @@ export const pathActionsMethod = (function () { let x = mouseX / currentZoom, y = mouseY / currentZoom, stretchy = getElem('path_stretch_line'); - newPoint = [x, y]; + newPoint = [ x, y ]; if (editorContext_.getGridSnapping()) { x = snapToGrid(x); @@ -376,7 +375,7 @@ export const pathActionsMethod = (function () { } })); // set stretchy line to first point - stretchy.setAttribute('d', ['M', mouseX, mouseY, mouseX, mouseY].join(' ')); + stretchy.setAttribute('d', [ 'M', mouseX, mouseY, mouseX, mouseY ].join(' ')); index = subpath ? path.segs.length : 0; pathActionsContext_.addPointGrip(index, mouseX, mouseY); } else { @@ -464,7 +463,6 @@ export const pathActionsMethod = (function () { editorContext_.getMouseTarget(evt) )) { // Clicked outside canvas, so don't make point - // console.log('Clicked outside canvas'); return false; } @@ -474,7 +472,7 @@ export const pathActionsMethod = (function () { if (evt.shiftKey) { const xya = snapToAngle(lastx, lasty, x, y); - ({x, y} = xya); + ({ x, y } = xya); } // Use the segment defined by stretchy @@ -496,7 +494,7 @@ export const pathActionsMethod = (function () { y *= currentZoom; // set stretchy line to latest point - stretchy.setAttribute('d', ['M', x, y, x, y].join(' ')); + stretchy.setAttribute('d', [ 'M', x, y, x, y ].join(' ')); index = num; if (subpath) { index += path.segs.length; } pathActionsContext_.addPointGrip(index, x, y); @@ -512,12 +510,12 @@ export const pathActionsMethod = (function () { path.storeD(); - ({id} = evt.target); + ({ id } = evt.target); let curPt; if (id.substr(0, 14) === 'pathpointgrip_') { // Select this point curPt = path.cur_pt = Number.parseInt(id.substr(14)); - path.dragging = [startX, startY]; + path.dragging = [ startX, startY ]; const seg = path.segs[curPt]; // only clear selection if shift is not pressed (otherwise, add @@ -533,7 +531,7 @@ export const pathActionsMethod = (function () { path.addPtsToSelection(curPt); } } else if (id.startsWith('ctrlpointgrip_')) { - path.dragging = [startX, startY]; + path.dragging = [ startX, startY ]; const parts = id.split('_')[1].split('c'); curPt = Number(parts[0]); @@ -612,7 +610,7 @@ export const pathActionsMethod = (function () { }); if (index === 0) { - firstCtrl = [mouseX, mouseY]; + firstCtrl = [ mouseX, mouseY ]; } else { const last = seglist.getItem(index - 1); let lastX = last.x; @@ -625,7 +623,7 @@ export const pathActionsMethod = (function () { lastX = firstCtrl[0] / currentZoom; lastY = firstCtrl[1] / currentZoom; } - pathActionsContext_.replacePathSeg(6, index, [ptX, ptY, lastX, lastY, altX, altY], drawnPath); + pathActionsContext_.replacePathSeg(6, index, [ ptX, ptY, lastX, lastY, altX, altY ], drawnPath); } } else { const stretchy = getElem('path_stretch_line'); @@ -637,13 +635,13 @@ export const pathActionsMethod = (function () { pathActionsContext_.replacePathSeg( 6, 1, - [mouseX, mouseY, prevX * currentZoom, prevY * currentZoom, mouseX, mouseY], + [ mouseX, mouseY, prevX * currentZoom, prevY * currentZoom, mouseX, mouseY ], stretchy ); } else if (firstCtrl) { - pathActionsContext_.replacePathSeg(6, 1, [mouseX, mouseY, firstCtrl[0], firstCtrl[1], mouseX, mouseY], stretchy); + pathActionsContext_.replacePathSeg(6, 1, [ mouseX, mouseY, firstCtrl[0], firstCtrl[1], mouseX, mouseY ], stretchy); } else { - pathActionsContext_.replacePathSeg(4, 1, [mouseX, mouseY], stretchy); + pathActionsContext_.replacePathSeg(4, 1, [ mouseX, mouseY ], stretchy); } } } @@ -661,7 +659,7 @@ export const pathActionsMethod = (function () { }, path); const diffX = mpt.x - pt.x; const diffY = mpt.y - pt.y; - path.dragging = [mouseX, mouseY]; + path.dragging = [ mouseX, mouseY ]; if (path.dragctrl) { path.moveCtrl(diffX, diffY); @@ -788,8 +786,8 @@ export const pathActionsMethod = (function () { } if (selPath) { - editorContext_.call('selected', [elem]); - editorContext_.addToSelection([elem], true); + editorContext_.call('selected', [ elem ]); + editorContext_.addToSelection([ elem ], true); } }, /** @@ -849,7 +847,7 @@ export const pathActionsMethod = (function () { this.clear(); - editorContext_.addToSelection([elem], true); + editorContext_.addToSelection([ elem ], true); editorContext_.call('changed', editorContext_.getSelectedElements()); }, @@ -909,7 +907,7 @@ export const pathActionsMethod = (function () { const type = seg.pathSegType; if (type === 1) { continue; } const pts = []; - ['', 1, 2].forEach(function(n){ + [ '', 1, 2 ].forEach(function(n){ const x = seg['x' + n], y = seg['y' + n]; if (x !== undefined && y !== undefined) { const pt = transformPoint(x, y, m); @@ -988,7 +986,7 @@ export const pathActionsMethod = (function () { // Only allow one selected node for now if (selPts.length !== 1) { return; } - const {elem} = path; + const { elem } = path; const list = elem.pathSegList; // const len = list.numberOfItems; @@ -1086,7 +1084,7 @@ export const pathActionsMethod = (function () { const pt = list.getItem(lastM); // Make this point the new "M" - pathActionsContext_.replacePathSeg(2, lastM, [pt.x, pt.y]); + pathActionsContext_.replacePathSeg(2, lastM, [ pt.x, pt.y ]); // i = index; // i is local here, so has no effect; what was the intent for this? @@ -1200,7 +1198,7 @@ export const pathActionsMethod = (function () { // Get first selected point const seg = path.segs[selPts[0]]; - const diff = {x: 0, y: 0}; + const diff = { x: 0, y: 0 }; diff[attr] = newValue - seg.item[attr]; seg.move(diff.x, diff.y); diff --git a/src/svgcanvas/path-method.js b/src/svgcanvas/path-method.js index cbcbc0b2..8de3d6ca 100644 --- a/src/svgcanvas/path-method.js +++ b/src/svgcanvas/path-method.js @@ -6,8 +6,8 @@ * @copyright 2011 Alexis Deveria, 2011 Jeff Schiller */ -import {NS} from '../common/namespaces.js'; -import {ChangeElementCommand} from './history.js'; +import { NS } from '../common/namespaces.js'; +import { ChangeElementCommand } from './history.js'; import { transformPoint, getMatrix } from './math.js'; @@ -83,7 +83,7 @@ export const ptObjToArrMethod = function (type, segItem) { * @returns {module:math.XYObject} */ export const getGripPtMethod = function (seg, altPt) { - const {path: pth} = seg; + const { path: pth } = seg; let out = { x: altPt ? altPt.x : seg.item.x, y: altPt ? altPt.y : seg.item.y @@ -246,7 +246,7 @@ export const getCtrlLineMethod = function (id) { * @returns {SVGCircleElement} */ export const getPointGripMethod = function (seg, update) { - const {index} = seg; + const { index } = seg; const pointGrip = addPointGripMethod(index); if (update) { @@ -266,7 +266,7 @@ export const getPointGripMethod = function (seg, update) { * @returns {PlainObject<string, SVGLineElement|SVGCircleElement>} */ export const getControlPointsMethod = function (seg) { - const {item, index} = seg; + const { item, index } = seg; if (!('x1' in item) || !('x2' in item)) { return null; } const cpt = {}; /* const pointGripContainer = */ getGripContainerMethod(); @@ -275,15 +275,15 @@ export const getControlPointsMethod = function (seg) { const path = pathMethodsContext_.getPathObj(); const prev = path.segs[index - 1].item; - const segItems = [prev, item]; + const segItems = [ prev, item ]; for (let i = 1; i < 3; i++) { const id = index + 'c' + i; const ctrlLine = cpt['c' + i + '_line'] = getCtrlLineMethod(id); - const pt = getGripPtMethod(seg, {x: item['x' + i], y: item['y' + i]}); - const gpt = getGripPtMethod(seg, {x: segItems[i - 1].x, y: segItems[i - 1].y}); + const pt = getGripPtMethod(seg, { x: item['x' + i], y: item['y' + i] }); + const gpt = getGripPtMethod(seg, { x: segItems[i - 1].x, y: segItems[i - 1].y }); assignAttributes(ctrlLine, { x1: pt.x, @@ -350,7 +350,7 @@ export const replacePathSegMethod = function (type, index, pts, elem) { * @returns {SVGPathElement} */ export const getSegSelectorMethod = function (seg, update) { - const {index} = seg; + const { index } = seg; let segLine = getElem('segline_' + index); if (!segLine) { const pointGripContainer = getGripContainerMethod(); @@ -369,7 +369,7 @@ export const getSegSelectorMethod = function (seg, update) { } if (update) { - const {prev} = seg; + const { prev } = seg; if (!prev) { segLine.setAttribute('display', 'none'); return segLine; @@ -377,11 +377,11 @@ export const getSegSelectorMethod = function (seg, update) { const pt = getGripPtMethod(prev); // Set start point - replacePathSegMethod(2, 0, [pt.x, pt.y], segLine); + replacePathSegMethod(2, 0, [ pt.x, pt.y ], segLine); const pts = ptObjToArrMethod(seg.type, seg.item); // , true); for (let i = 0; i < pts.length; i += 2) { - const point = getGripPtMethod(seg, {x: pts[i], y: pts[i + 1]}); + const point = getGripPtMethod(seg, { x: pts[i], y: pts[i + 1] }); pts[i] = point.x; pts[i + 1] = point.y; } @@ -428,7 +428,7 @@ export class Segment { */ selectCtrls (y) { document.getElementById('ctrlpointgrip_' + this.index + 'c1').setAttribute('fill', y ? '#0FF' : '#EEE'); - document.getElementById('ctrlpointgrip_' + this.index + 'c2').setAttribute('fill', y ? '#0FF' : '#EEE') + document.getElementById('ctrlpointgrip_' + this.index + 'c2').setAttribute('fill', y ? '#0FF' : '#EEE'); } /** @@ -500,14 +500,14 @@ export class Segment { * @returns {void} */ move (dx, dy) { - const {item} = this; + const { item } = this; const curPts = this.ctrlpts ? [ item.x += dx, item.y += dy, item.x1, item.y1, item.x2 += dx, item.y2 += dy ] - : [item.x += dx, item.y += dy]; + : [ item.x += dx, item.y += dy ]; replacePathSegMethod( this.type, @@ -528,8 +528,8 @@ export class Segment { if (this.mate) { // The last point of a closed subpath has a 'mate', // which is the 'M' segment of the subpath - const {item: itm} = this.mate; - const pts = [itm.x += dx, itm.y += dy]; + const { item: itm } = this.mate; + const pts = [ itm.x += dx, itm.y += dy ]; replacePathSegMethod(this.mate.type, this.mate.index, pts); // Has no grip, so does not need 'updating'? } @@ -556,7 +556,7 @@ export class Segment { pt = seg.item; } - const {item} = seg; + const { item } = seg; item['x' + anum] = pt.x + (pt.x - this.item['x' + num]); item['y' + anum] = pt.y + (pt.y - this.item['y' + num]); @@ -577,7 +577,7 @@ export class Segment { * @returns {void} */ moveCtrl (num, dx, dy) { - const {item} = this; + const { item } = this; item['x' + num] += dx; item['y' + num] += dy; @@ -656,7 +656,7 @@ export class Path { this.segs.push(segment); } - const {segs} = this; + const { segs } = this; let startI = null; for (let i = 0; i < len; i++) { @@ -742,7 +742,7 @@ export class Path { const seg = this.segs[index]; if (!seg.prev) { return; } - const {prev} = seg; + const { prev } = seg; let newseg, newX, newY; switch (seg.item.pathSegType) { case 4: { @@ -765,7 +765,7 @@ export class Path { const p12y = (p1y + p2y) / 2; newY = (p01y + p12y) / 2; newseg = this.elem.createSVGPathSegCurvetoCubicAbs(newX, newY, p0x, p0y, p01x, p01y); - const pts = [seg.item.x, seg.item.y, p12x, p12y, p2x, p2y]; + const pts = [ seg.item.x, seg.item.y, p12x, p12y, p2x, p2y ]; replacePathSegMethod(seg.type, index, pts); break; } @@ -783,10 +783,10 @@ export class Path { const list = this.elem.pathSegList; seg.show(false); - const {next} = seg; + const { next } = seg; if (seg.mate) { // Make the next point be the "M" point - const pt = [next.item.x, next.item.y]; + const pt = [ next.item.x, next.item.y ]; replacePathSegMethod(2, next.index, pt); // Reposition last node @@ -796,7 +796,7 @@ export class Path { } else if (!seg.prev) { // First node of open path, make next point the M // const {item} = seg; - const pt = [next.item.x, next.item.y]; + const pt = [ next.item.x, next.item.y ]; replacePathSegMethod(2, seg.next.index, pt); list.removeItem(index); } else { @@ -891,7 +891,7 @@ export class Path { // Selected seg const cur = this.segs[selPt]; - const {prev} = cur; + const { prev } = cur; if (!prev) { continue; } if (!newType) { // double-click, so just toggle @@ -914,7 +914,7 @@ export class Path { case 6: { if (cur.olditem) { const old = cur.olditem; - points = [curX, curY, old.x1, old.y1, old.x2, old.y2]; + points = [ curX, curY, old.x1, old.y1, old.x2, old.y2 ]; } else { const diffX = curX - prevX; const diffY = curY - prevY; @@ -930,11 +930,11 @@ export class Path { const ct1y = (prevY + (diffY / 3)); const ct2x = (curX - (diffX / 3)); const ct2y = (curY - (diffY / 3)); - points = [curX, curY, ct1x, ct1y, ct2x, ct2y]; + points = [ curX, curY, ct1x, ct1y, ct2x, ct2y ]; } break; } case 4: { - points = [curX, curY]; + points = [ curX, curY ]; // Store original prevve segment nums cur.olditem = cur.item; @@ -978,7 +978,7 @@ export class Path { * @returns {Path} */ update () { - const {elem} = this; + const { elem } = this; if (getRotationAngle(elem)) { this.matrix = getMatrix(elem); this.imatrix = this.matrix.inverse(); @@ -1001,8 +1001,8 @@ export class Path { */ endChanges (text) { if (isWebkit()) { editorContext_.resetD(this.elem); } - const cmd = new ChangeElementCommand(this.elem, {d: this.last_d}, text); - editorContext_.endChanges({cmd, elem: this.elem}); + const cmd = new ChangeElementCommand(this.elem, { d: this.last_d }, text); + editorContext_.endChanges({ cmd, elem: this.elem }); } /** @@ -1010,7 +1010,7 @@ export class Path { * @returns {void} */ addPtsToSelection (indexes) { - if (!Array.isArray(indexes)) { indexes = [indexes]; } + if (!Array.isArray(indexes)) { indexes = [ indexes ]; } indexes.forEach((index) => { const seg = this.segs[index]; if (seg.ptgrip && !this.selected_pts.includes(index) && index >= 0) { @@ -1030,7 +1030,7 @@ export class Path { } const closedSubpath = Path.subpathIsClosed(this.selected_pts[0]); - editorContext_.addPtsToSelection({grips, closedSubpath}); + editorContext_.addPtsToSelection({ grips, closedSubpath }); } // STATIC diff --git a/src/svgcanvas/path.js b/src/svgcanvas/path.js index facfaed4..3ad4db13 100644 --- a/src/svgcanvas/path.js +++ b/src/svgcanvas/path.js @@ -6,9 +6,9 @@ * @copyright 2011 Alexis Deveria, 2011 Jeff Schiller */ -import {getTransformList} from './svgtransformlist.js'; -import {shortFloat} from '../common/units.js'; -import {transformPoint} from './math.js'; +import { getTransformList } from './svgtransformlist.js'; +import { shortFloat } from '../common/units.js'; +import { transformPoint } from './math.js'; import { getRotationAngle, getBBox, getRefElem, findDefs, isNullish, @@ -25,15 +25,15 @@ import { } from './path-actions.js'; const segData = { - 2: ['x', 'y'], // PATHSEG_MOVETO_ABS - 4: ['x', 'y'], // PATHSEG_LINETO_ABS - 6: ['x', 'y', 'x1', 'y1', 'x2', 'y2'], // PATHSEG_CURVETO_CUBIC_ABS - 8: ['x', 'y', 'x1', 'y1'], // PATHSEG_CURVETO_QUADRATIC_ABS - 10: ['x', 'y', 'r1', 'r2', 'angle', 'largeArcFlag', 'sweepFlag'], // PATHSEG_ARC_ABS - 12: ['x'], // PATHSEG_LINETO_HORIZONTAL_ABS - 14: ['y'], // PATHSEG_LINETO_VERTICAL_ABS - 16: ['x', 'y', 'x2', 'y2'], // PATHSEG_CURVETO_CUBIC_SMOOTH_ABS - 18: ['x', 'y'] // PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS + 2: [ 'x', 'y' ], // PATHSEG_MOVETO_ABS + 4: [ 'x', 'y' ], // PATHSEG_LINETO_ABS + 6: [ 'x', 'y', 'x1', 'y1', 'x2', 'y2' ], // PATHSEG_CURVETO_CUBIC_ABS + 8: [ 'x', 'y', 'x1', 'y1' ], // PATHSEG_CURVETO_QUADRATIC_ABS + 10: [ 'x', 'y', 'r1', 'r2', 'angle', 'largeArcFlag', 'sweepFlag' ], // PATHSEG_ARC_ABS + 12: [ 'x' ], // PATHSEG_LINETO_HORIZONTAL_ABS + 14: [ 'y' ], // PATHSEG_LINETO_VERTICAL_ABS + 16: [ 'x', 'y', 'x2', 'y2' ], // PATHSEG_CURVETO_CUBIC_SMOOTH_ABS + 18: [ 'x', 'y' ] // PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS }; /** @@ -86,7 +86,8 @@ let editorContext_ = null; * Object with the following keys/values. * @typedef {PlainObject} module:path.SVGElementJSON * @property {string} element - Tag name of the SVG element to create -* @property {PlainObject<string, string>} attr - Has key-value attributes to assign to the new element. An `id` should be set so that {@link module:utilities.EditorContext#addSVGElementFromJson} can later re-identify the element for modification or replacement. +* @property {PlainObject<string, string>} attr - Has key-value attributes to assign to the new element. +* An `id` should be set so that {@link module:utilities.EditorContext#addSVGElementFromJson} can later re-identify the element for modification or replacement. * @property {boolean} [curStyles=false] - Indicates whether current style attributes should be applied first * @property {module:path.SVGElementJSON[]} [children] - Data objects to be added recursively as children * @property {string} [namespace="http://www.w3.org/2000/svg"] - Indicate a (non-SVG) namespace @@ -99,7 +100,8 @@ let editorContext_ = null; /** * @function module:path.EditorContext#call * @param {"selected"|"changed"} ev - String with the event name - * @param {module:svgcanvas.SvgCanvas#event:selected|module:svgcanvas.SvgCanvas#event:changed} arg - Argument to pass through to the callback function. If the event is "changed", an array of `Element`s is passed; if "selected", a single-item array of `Element` is passed. + * @param {module:svgcanvas.SvgCanvas#event:selected|module:svgcanvas.SvgCanvas#event:changed} arg - Argument to pass through to the callback function. + * If the event is "changed", an array of `Element`s is passed; if "selected", a single-item array of `Element` is passed. * @returns {void} */ /** @@ -236,7 +238,7 @@ let editorContext_ = null; export const init = function (editorContext) { editorContext_ = editorContext; - pathFuncs = [0, 'ClosePath']; + pathFuncs = [ 0, 'ClosePath' ]; const pathFuncsStrs = [ 'Moveto', 'Lineto', 'CurvetoCubic', 'CurvetoQuadratic', 'Arc', 'LinetoHorizontal', 'LinetoVertical', 'CurvetoCubicSmooth', 'CurvetoQuadraticSmooth' @@ -413,7 +415,7 @@ export const smoothControlPoints = function (ct1, ct2, pt) { nct2.x = r2 * Math.cos(newAngleb) + pt.x; nct2.y = r2 * Math.sin(newAngleb) + pt.y; - return [nct1, nct2]; + return [ nct1, nct2 ]; } return undefined; }; @@ -462,8 +464,8 @@ const getRotVals = function (x, y) { r = Math.sqrt(dx * dx + dy * dy); theta = Math.atan2(dy, dx) - angle; - return {x: r * Math.cos(theta) + newcx, - y: r * Math.sin(theta) + newcy}; + return { x: r * Math.cos(theta) + newcx, + y: r * Math.sin(theta) + newcy }; }; // If the path was rotated, we must now pay the piper: @@ -508,7 +510,7 @@ export const recalcRotatedPath = function () { if (type === 1) { continue; } const rvals = getRotVals(seg.x, seg.y), - points = [rvals.x, rvals.y]; + points = [ rvals.x, rvals.y ]; if (!isNullish(seg.x1) && !isNullish(seg.x2)) { const cVals1 = getRotVals(seg.x1, seg.y1); const cVals2 = getRotVals(seg.x2, seg.y2); @@ -578,7 +580,7 @@ export const reorientGrads = function (elem, m) { }; const newgrad = grad.cloneNode(true); - for (const [key, value] of Object.entries(gCoords)) { + for (const [ key, value ] of Object.entries(gCoords)) { newgrad.setAttribute(key, value); } newgrad.id = editorContext_.getNextId(); @@ -608,7 +610,7 @@ const pathMap = [ * @returns {string} */ export const convertPath = function (pth, toRel) { - const {pathSegList} = pth; + const { pathSegList } = pth; const len = pathSegList.numberOfItems; let curx = 0, cury = 0; let d = ''; @@ -650,7 +652,7 @@ export const convertPath = function (pth, toRel) { letter = 'L'; } // Convert to "line" for easier editing - d += pathDSegment(letter, [[x, y]]); + d += pathDSegment(letter, [ [ x, y ] ]); break; case 14: // absolute vertical line (V) y -= cury; @@ -667,7 +669,7 @@ export const convertPath = function (pth, toRel) { letter = 'L'; } // Convert to "line" for easier editing - d += pathDSegment(letter, [[x, y]]); + d += pathDSegment(letter, [ [ x, y ] ]); break; case 2: // absolute move (M) case 4: // absolute line (L) @@ -688,9 +690,9 @@ export const convertPath = function (pth, toRel) { curx = x; cury = y; } - if (type === 2 || type === 3) { lastM = [curx, cury]; } + if (type === 2 || type === 3) { lastM = [ curx, cury ]; } - d += pathDSegment(letter, [[x, y]]); + d += pathDSegment(letter, [ [ x, y ] ]); break; case 6: // absolute cubic (C) x -= curx; x1 -= curx; x2 -= curx; @@ -706,7 +708,7 @@ export const convertPath = function (pth, toRel) { curx = x; cury = y; } - d += pathDSegment(letter, [[x1, y1], [x2, y2], [x, y]]); + d += pathDSegment(letter, [ [ x1, y1 ], [ x2, y2 ], [ x, y ] ]); break; case 8: // absolute quad (Q) x -= curx; x1 -= curx; @@ -722,7 +724,7 @@ export const convertPath = function (pth, toRel) { curx = x; cury = y; } - d += pathDSegment(letter, [[x1, y1], [x, y]]); + d += pathDSegment(letter, [ [ x1, y1 ], [ x, y ] ]); break; // Fallthrough case 11: // relative elliptical arc (a) @@ -735,11 +737,11 @@ export const convertPath = function (pth, toRel) { curx = x; cury = y; } - d += pathDSegment(letter, [[seg.r1, seg.r2]], [ + d += pathDSegment(letter, [ [ seg.r1, seg.r2 ] ], [ seg.angle, (seg.largeArcFlag ? 1 : 0), (seg.sweepFlag ? 1 : 0) - ], [x, y]); + ], [ x, y ]); break; case 16: // absolute smooth cubic (S) x -= curx; x2 -= curx; @@ -755,7 +757,7 @@ export const convertPath = function (pth, toRel) { curx = x; cury = y; } - d += pathDSegment(letter, [[x2, y2], [x, y]]); + d += pathDSegment(letter, [ [ x2, y2 ], [ x, y ] ]); break; } // switch on path segment type } // for each segment diff --git a/src/svgcanvas/recalculate.js b/src/svgcanvas/recalculate.js index 468487a3..f7384789 100644 --- a/src/svgcanvas/recalculate.js +++ b/src/svgcanvas/recalculate.js @@ -134,7 +134,7 @@ export const recalculateDimensions = function (selected) { while (k--) { const xform = tlist.getItem(k); if (xform.type === 1) { - mxs.push([xform.matrix, k]); + mxs.push([ xform.matrix, k ]); } else if (mxs.length) { mxs = []; } @@ -187,23 +187,23 @@ export const recalculateDimensions = function (selected) { let attrs = []; switch (selected.tagName) { case 'line': - attrs = ['x1', 'y1', 'x2', 'y2']; + attrs = [ 'x1', 'y1', 'x2', 'y2' ]; break; case 'circle': - attrs = ['cx', 'cy', 'r']; + attrs = [ 'cx', 'cy', 'r' ]; break; case 'ellipse': - attrs = ['cx', 'cy', 'rx', 'ry']; + attrs = [ 'cx', 'cy', 'rx', 'ry' ]; break; case 'foreignObject': case 'rect': case 'image': - attrs = ['width', 'height', 'x', 'y']; + attrs = [ 'width', 'height', 'x', 'y' ]; break; case 'use': case 'text': case 'tspan': - attrs = ['x', 'y']; + attrs = [ 'x', 'y' ]; break; case 'polygon': case 'polyline': { @@ -228,7 +228,7 @@ export const recalculateDimensions = function (selected) { Array.prototype.forEach.call(attrs, function (attr) { changes[attr] = selected.getAttribute(attr); }); - for (const [attr, val] of Object.entries(changes)) { + for (const [ attr, val ] of Object.entries(changes)) { changes[attr] = convertToNum(attr, val); } } else if (gsvg) { @@ -243,7 +243,7 @@ export const recalculateDimensions = function (selected) { // make a copy of initial values and include the transform if (isNullish(initial)) { initial = $.extend(true, {}, changes); - for (const [attr, val] of Object.entries(initial)) { + for (const [ attr, val ] of Object.entries(initial)) { initial[attr] = convertToNum(attr, val); } } @@ -652,7 +652,7 @@ export const recalculateDimensions = function (selected) { const gtlist = getTransformList(paint); const gmatrix = transformListToTransform(gtlist).matrix; m = matrixMultiply(m, gmatrix); - const mStr = 'matrix(' + [m.a, m.b, m.c, m.d, m.e, m.f].join(',') + ')'; + const mStr = 'matrix(' + [ m.a, m.b, m.c, m.d, m.e, m.f ].join(',') + ')'; paint.setAttribute(type + 'Transform', mStr); } } @@ -707,7 +707,7 @@ export const recalculateDimensions = function (selected) { y1: selected.getAttribute('y1'), x2: selected.getAttribute('x2'), y2: selected.getAttribute('y2'), - } + }; // Fallthrough case 'polyline': case 'polygon': diff --git a/src/svgcanvas/sanitize.js b/src/svgcanvas/sanitize.js index 5b370dc8..3e77c2de 100644 --- a/src/svgcanvas/sanitize.js +++ b/src/svgcanvas/sanitize.js @@ -7,9 +7,9 @@ * @copyright 2010 Alexis Deveria, 2010 Jeff Schiller */ -import {getReverseNS, NS} from '../common/namespaces.js'; -import {isGecko} from '../common/browser.js'; -import {getHref, setHref, getUrlFromAttr} from './utilities.js'; +import { getReverseNS, NS } from '../common/namespaces.js'; +import { isGecko } from '../common/browser.js'; +import { getHref, setHref, getUrlFromAttr } from './utilities.js'; const REVERSE_NS = getReverseNS(); @@ -22,74 +22,74 @@ const REVERSE_NS = getReverseNS(); /* eslint-disable max-len */ const svgWhiteList_ = { // SVG Elements - a: ['class', 'clip-path', 'clip-rule', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'id', 'mask', 'opacity', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'xlink:href', 'xlink:title'], - circle: ['class', 'clip-path', 'clip-rule', 'cx', 'cy', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'id', 'mask', 'opacity', 'r', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform'], - clipPath: ['class', 'clipPathUnits', 'id'], + a: [ 'class', 'clip-path', 'clip-rule', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'id', 'mask', 'opacity', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'xlink:href', 'xlink:title' ], + circle: [ 'class', 'clip-path', 'clip-rule', 'cx', 'cy', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'id', 'mask', 'opacity', 'r', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform' ], + clipPath: [ 'class', 'clipPathUnits', 'id' ], defs: [], - style: ['type'], + style: [ 'type' ], desc: [], - ellipse: ['class', 'clip-path', 'clip-rule', 'cx', 'cy', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'id', 'mask', 'opacity', 'requiredFeatures', 'rx', 'ry', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform'], - feBlend: ['in', 'in2'], - feComposite: ['operator', 'result', 'in2'], - feFlood: ['flood-color', 'in'], - feGaussianBlur: ['class', 'color-interpolation-filters', 'id', 'requiredFeatures', 'stdDeviation'], + ellipse: [ 'class', 'clip-path', 'clip-rule', 'cx', 'cy', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'id', 'mask', 'opacity', 'requiredFeatures', 'rx', 'ry', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform' ], + feBlend: [ 'in', 'in2' ], + feComposite: [ 'operator', 'result', 'in2' ], + feFlood: [ 'flood-color', 'in' ], + feGaussianBlur: [ 'class', 'color-interpolation-filters', 'id', 'requiredFeatures', 'stdDeviation' ], feMerge: [], - feMergeNode: ['in'], - feMorphology: ['class', 'in', 'operator', 'radius'], - feOffset: ['dx', 'in', 'dy', 'result'], - filter: ['class', 'color-interpolation-filters', 'filterRes', 'filterUnits', 'height', 'id', 'primitiveUnits', 'requiredFeatures', 'width', 'x', 'xlink:href', 'y'], - foreignObject: ['class', 'font-size', 'height', 'id', 'opacity', 'requiredFeatures', 'style', 'transform', 'width', 'x', 'y'], - g: ['class', 'clip-path', 'clip-rule', 'id', 'display', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'mask', 'opacity', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'font-family', 'font-size', 'font-style', 'font-weight', 'text-anchor'], - image: ['class', 'clip-path', 'clip-rule', 'filter', 'height', 'id', 'mask', 'opacity', 'requiredFeatures', 'style', 'systemLanguage', 'transform', 'width', 'x', 'xlink:href', 'xlink:title', 'y'], - line: ['class', 'clip-path', 'clip-rule', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'id', 'marker-end', 'marker-mid', 'marker-start', 'mask', 'opacity', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'x1', 'x2', 'y1', 'y2'], - linearGradient: ['class', 'id', 'gradientTransform', 'gradientUnits', 'requiredFeatures', 'spreadMethod', 'systemLanguage', 'x1', 'x2', 'xlink:href', 'y1', 'y2'], - marker: ['id', 'class', 'markerHeight', 'markerUnits', 'markerWidth', 'orient', 'preserveAspectRatio', 'refX', 'refY', 'systemLanguage', 'viewBox'], - mask: ['class', 'height', 'id', 'maskContentUnits', 'maskUnits', 'width', 'x', 'y'], - metadata: ['class', 'id'], - path: ['class', 'clip-path', 'clip-rule', 'd', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'id', 'marker-end', 'marker-mid', 'marker-start', 'mask', 'opacity', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform'], - pattern: ['class', 'height', 'id', 'patternContentUnits', 'patternTransform', 'patternUnits', 'requiredFeatures', 'style', 'systemLanguage', 'viewBox', 'width', 'x', 'xlink:href', 'y'], - polygon: ['class', 'clip-path', 'clip-rule', 'id', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'id', 'class', 'marker-end', 'marker-mid', 'marker-start', 'mask', 'opacity', 'points', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform'], - polyline: ['class', 'clip-path', 'clip-rule', 'id', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'marker-end', 'marker-mid', 'marker-start', 'mask', 'opacity', 'points', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform'], - radialGradient: ['class', 'cx', 'cy', 'fx', 'fy', 'gradientTransform', 'gradientUnits', 'id', 'r', 'requiredFeatures', 'spreadMethod', 'systemLanguage', 'xlink:href'], - rect: ['class', 'clip-path', 'clip-rule', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'height', 'id', 'mask', 'opacity', 'requiredFeatures', 'rx', 'ry', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'width', 'x', 'y'], - stop: ['class', 'id', 'offset', 'requiredFeatures', 'stop-color', 'stop-opacity', 'style', 'systemLanguage'], - svg: ['class', 'clip-path', 'clip-rule', 'filter', 'id', 'height', 'mask', 'preserveAspectRatio', 'requiredFeatures', 'style', 'systemLanguage', 'viewBox', 'width', 'x', 'xmlns', 'xmlns:se', 'xmlns:xlink', 'xmlns:oi', 'oi:animations', 'y'], - switch: ['class', 'id', 'requiredFeatures', 'systemLanguage'], - symbol: ['class', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'font-family', 'font-size', 'font-style', 'font-weight', 'id', 'opacity', 'preserveAspectRatio', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'viewBox'], - text: ['class', 'clip-path', 'clip-rule', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'font-family', 'font-size', 'font-style', 'font-weight', 'id', 'mask', 'opacity', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'text-anchor', 'transform', 'x', 'xml:space', 'y'], - textPath: ['class', 'id', 'method', 'requiredFeatures', 'spacing', 'startOffset', 'style', 'systemLanguage', 'transform', 'xlink:href'], + feMergeNode: [ 'in' ], + feMorphology: [ 'class', 'in', 'operator', 'radius' ], + feOffset: [ 'dx', 'in', 'dy', 'result' ], + filter: [ 'class', 'color-interpolation-filters', 'filterRes', 'filterUnits', 'height', 'id', 'primitiveUnits', 'requiredFeatures', 'width', 'x', 'xlink:href', 'y' ], + foreignObject: [ 'class', 'font-size', 'height', 'id', 'opacity', 'requiredFeatures', 'style', 'transform', 'width', 'x', 'y' ], + g: [ 'class', 'clip-path', 'clip-rule', 'id', 'display', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'mask', 'opacity', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'font-family', 'font-size', 'font-style', 'font-weight', 'text-anchor' ], + image: [ 'class', 'clip-path', 'clip-rule', 'filter', 'height', 'id', 'mask', 'opacity', 'requiredFeatures', 'style', 'systemLanguage', 'transform', 'width', 'x', 'xlink:href', 'xlink:title', 'y' ], + line: [ 'class', 'clip-path', 'clip-rule', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'id', 'marker-end', 'marker-mid', 'marker-start', 'mask', 'opacity', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'x1', 'x2', 'y1', 'y2' ], + linearGradient: [ 'class', 'id', 'gradientTransform', 'gradientUnits', 'requiredFeatures', 'spreadMethod', 'systemLanguage', 'x1', 'x2', 'xlink:href', 'y1', 'y2' ], + marker: [ 'id', 'class', 'markerHeight', 'markerUnits', 'markerWidth', 'orient', 'preserveAspectRatio', 'refX', 'refY', 'systemLanguage', 'viewBox' ], + mask: [ 'class', 'height', 'id', 'maskContentUnits', 'maskUnits', 'width', 'x', 'y' ], + metadata: [ 'class', 'id' ], + path: [ 'class', 'clip-path', 'clip-rule', 'd', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'id', 'marker-end', 'marker-mid', 'marker-start', 'mask', 'opacity', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform' ], + pattern: [ 'class', 'height', 'id', 'patternContentUnits', 'patternTransform', 'patternUnits', 'requiredFeatures', 'style', 'systemLanguage', 'viewBox', 'width', 'x', 'xlink:href', 'y' ], + polygon: [ 'class', 'clip-path', 'clip-rule', 'id', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'id', 'class', 'marker-end', 'marker-mid', 'marker-start', 'mask', 'opacity', 'points', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform' ], + polyline: [ 'class', 'clip-path', 'clip-rule', 'id', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'marker-end', 'marker-mid', 'marker-start', 'mask', 'opacity', 'points', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform' ], + radialGradient: [ 'class', 'cx', 'cy', 'fx', 'fy', 'gradientTransform', 'gradientUnits', 'id', 'r', 'requiredFeatures', 'spreadMethod', 'systemLanguage', 'xlink:href' ], + rect: [ 'class', 'clip-path', 'clip-rule', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'height', 'id', 'mask', 'opacity', 'requiredFeatures', 'rx', 'ry', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'width', 'x', 'y' ], + stop: [ 'class', 'id', 'offset', 'requiredFeatures', 'stop-color', 'stop-opacity', 'style', 'systemLanguage' ], + svg: [ 'class', 'clip-path', 'clip-rule', 'filter', 'id', 'height', 'mask', 'preserveAspectRatio', 'requiredFeatures', 'style', 'systemLanguage', 'viewBox', 'width', 'x', 'xmlns', 'xmlns:se', 'xmlns:xlink', 'xmlns:oi', 'oi:animations', 'y' ], + switch: [ 'class', 'id', 'requiredFeatures', 'systemLanguage' ], + symbol: [ 'class', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'font-family', 'font-size', 'font-style', 'font-weight', 'id', 'opacity', 'preserveAspectRatio', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'viewBox' ], + text: [ 'class', 'clip-path', 'clip-rule', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'font-family', 'font-size', 'font-style', 'font-weight', 'id', 'mask', 'opacity', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'text-anchor', 'transform', 'x', 'xml:space', 'y' ], + textPath: [ 'class', 'id', 'method', 'requiredFeatures', 'spacing', 'startOffset', 'style', 'systemLanguage', 'transform', 'xlink:href' ], title: [], - tspan: ['class', 'clip-path', 'clip-rule', 'dx', 'dy', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'font-family', 'font-size', 'font-style', 'font-weight', 'id', 'mask', 'opacity', 'requiredFeatures', 'rotate', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'text-anchor', 'textLength', 'transform', 'x', 'xml:space', 'y'], - use: ['class', 'clip-path', 'clip-rule', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'height', 'id', 'mask', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'transform', 'width', 'x', 'xlink:href', 'y'], + tspan: [ 'class', 'clip-path', 'clip-rule', 'dx', 'dy', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'font-family', 'font-size', 'font-style', 'font-weight', 'id', 'mask', 'opacity', 'requiredFeatures', 'rotate', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'text-anchor', 'textLength', 'transform', 'x', 'xml:space', 'y' ], + use: [ 'class', 'clip-path', 'clip-rule', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'height', 'id', 'mask', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'transform', 'width', 'x', 'xlink:href', 'y' ], // MathML Elements - annotation: ['encoding'], - 'annotation-xml': ['encoding'], - maction: ['actiontype', 'other', 'selection'], - math: ['class', 'id', 'display', 'xmlns'], - menclose: ['notation'], + annotation: [ 'encoding' ], + 'annotation-xml': [ 'encoding' ], + maction: [ 'actiontype', 'other', 'selection' ], + math: [ 'class', 'id', 'display', 'xmlns' ], + menclose: [ 'notation' ], merror: [], - mfrac: ['linethickness'], - mi: ['mathvariant'], + mfrac: [ 'linethickness' ], + mi: [ 'mathvariant' ], mmultiscripts: [], mn: [], - mo: ['fence', 'lspace', 'maxsize', 'minsize', 'rspace', 'stretchy'], + mo: [ 'fence', 'lspace', 'maxsize', 'minsize', 'rspace', 'stretchy' ], mover: [], - mpadded: ['lspace', 'width', 'height', 'depth', 'voffset'], + mpadded: [ 'lspace', 'width', 'height', 'depth', 'voffset' ], mphantom: [], mprescripts: [], mroot: [], - mrow: ['xlink:href', 'xlink:type', 'xmlns:xlink'], - mspace: ['depth', 'height', 'width'], + mrow: [ 'xlink:href', 'xlink:type', 'xmlns:xlink' ], + mspace: [ 'depth', 'height', 'width' ], msqrt: [], - mstyle: ['displaystyle', 'mathbackground', 'mathcolor', 'mathvariant', 'scriptlevel'], + mstyle: [ 'displaystyle', 'mathbackground', 'mathcolor', 'mathvariant', 'scriptlevel' ], msub: [], msubsup: [], msup: [], - mtable: ['align', 'columnalign', 'columnlines', 'columnspacing', 'displaystyle', 'equalcolumns', 'equalrows', 'frame', 'rowalign', 'rowlines', 'rowspacing', 'width'], - mtd: ['columnalign', 'columnspan', 'rowalign', 'rowspan'], + mtable: [ 'align', 'columnalign', 'columnlines', 'columnspacing', 'displaystyle', 'equalcolumns', 'equalrows', 'frame', 'rowalign', 'rowlines', 'rowspacing', 'width' ], + mtd: [ 'columnalign', 'columnspan', 'rowalign', 'rowspan' ], mtext: [], - mtr: ['columnalign', 'rowalign'], + mtr: [ 'columnalign', 'rowalign' ], munder: [], munderover: [], none: [], @@ -99,9 +99,9 @@ const svgWhiteList_ = { // Produce a Namespace-aware version of svgWhitelist const svgWhiteListNS_ = {}; -Object.entries(svgWhiteList_).forEach(function ([elt, atts]) { +Object.entries(svgWhiteList_).forEach(function ([ elt, atts ]) { const attNS = {}; - Object.entries(atts).forEach(function ([_i, att]) { + Object.entries(atts).forEach(function ([ _i, att ]) { if (att.includes(':')) { const v = att.split(':'); attNS[v[1]] = NS[(v[0]).toUpperCase()]; @@ -166,7 +166,7 @@ export const sanitizeSvg = function (node) { // Bypassing the whitelist to allow se: prefixes. // Is there a more appropriate way to do this? if (attrName.startsWith('se:') || attrName.startsWith('data-')) { - seAttrs.push([attrName, attr.value]); + seAttrs.push([ attrName, attr.value ]); } node.removeAttributeNS(attrNsURI, attrLocalName); } @@ -190,7 +190,7 @@ export const sanitizeSvg = function (node) { const props = attr.value.split(';'); let p = props.length; while (p--) { - const [name, val] = props[p].split(':'); + const [ name, val ] = props[p].split(':'); const styleAttrName = (name || '').trim(); const styleAttrVal = (val || '').trim(); // Now check that this attribute is supported @@ -202,7 +202,7 @@ export const sanitizeSvg = function (node) { } } - Object.values(seAttrs).forEach(([att, val]) => { + Object.values(seAttrs).forEach(([ att, val ]) => { node.setAttributeNS(NS.SE, att, val); }); @@ -210,8 +210,8 @@ export const sanitizeSvg = function (node) { // (but not for links) const href = getHref(node); if (href && - ['filter', 'linearGradient', 'pattern', - 'radialGradient', 'textPath', 'use'].includes(node.nodeName) && href[0] !== '#') { + [ 'filter', 'linearGradient', 'pattern', + 'radialGradient', 'textPath', 'use' ].includes(node.nodeName) && href[0] !== '#') { // remove the attribute (but keep the element) setHref(node, ''); node.removeAttributeNS(NS.XLINK, 'href'); @@ -224,7 +224,7 @@ export const sanitizeSvg = function (node) { } // if the element has attributes pointing to a non-local reference, // need to remove the attribute - Object.values(['clip-path', 'fill', 'filter', 'marker-end', 'marker-mid', 'marker-start', 'mask', 'stroke'], function (attr) { + Object.values([ 'clip-path', 'fill', 'filter', 'marker-end', 'marker-mid', 'marker-start', 'mask', 'stroke' ], function (attr) { let val = node.getAttribute(attr); if (val) { val = getUrlFromAttr(val); diff --git a/src/svgcanvas/select.js b/src/svgcanvas/select.js index 52282862..6d1c6355 100644 --- a/src/svgcanvas/select.js +++ b/src/svgcanvas/select.js @@ -140,7 +140,7 @@ export class Selector { if (tagName === 'g' && !dataStorage.has(selected, 'gsvg')) { // The bbox for a group does not include stroke vals, so we // get the bbox based on its children. - const strokedBbox = getStrokedBBox([selected.childNodes]); + const strokedBbox = getStrokedBBox([ selected.childNodes ]); if (strokedBbox) { bbox = strokedBbox; } @@ -203,22 +203,22 @@ export class Selector { ' ' + nbax + ',' + (nbay + nbah) + 'z'; selectedBox.setAttribute('d', dstr); - const xform = angle ? 'rotate(' + [angle, cx, cy].join(',') + ')' : ''; + const xform = angle ? 'rotate(' + [ angle, cx, cy ].join(',') + ')' : ''; this.selectorGroup.setAttribute('transform', xform); // TODO(codedread): Is this needed? // if (selected === selectedElements[0]) { this.gripCoords = { - nw: [nbax, nbay], - ne: [nbax + nbaw, nbay], - sw: [nbax, nbay + nbah], - se: [nbax + nbaw, nbay + nbah], - n: [nbax + (nbaw) / 2, nbay], - w: [nbax, nbay + (nbah) / 2], - e: [nbax + nbaw, nbay + (nbah) / 2], - s: [nbax + (nbaw) / 2, nbay + nbah] + nw: [ nbax, nbay ], + ne: [ nbax + nbaw, nbay ], + sw: [ nbax, nbay + nbah ], + se: [ nbax + nbaw, nbay + nbah ], + n: [ nbax + (nbaw) / 2, nbay ], + w: [ nbax, nbay + (nbah) / 2 ], + e: [ nbax + nbaw, nbay + (nbah) / 2 ], + s: [ nbax + (nbaw) / 2, nbay + nbah ] }; - Object.entries(this.gripCoords).forEach(([dir, coords]) => { + Object.entries(this.gripCoords).forEach(([ dir, coords ]) => { selectedGrips[dir].setAttribute('cx', coords[0]); selectedGrips[dir].setAttribute('cy', coords[1]); }); @@ -373,7 +373,7 @@ export class SelectorManager { if (document.getElementById('canvasBackground')) { return; } - const [width, height] = config_.dimensions; + const [ width, height ] = config_.dimensions; const canvasbg = svgFactory_.createSVGElement({ element: 'svg', attr: { diff --git a/src/svgcanvas/selected-elem.js b/src/svgcanvas/selected-elem.js index 6d849992..141b2304 100644 --- a/src/svgcanvas/selected-elem.js +++ b/src/svgcanvas/selected-elem.js @@ -52,7 +52,7 @@ export const init = function (elementContext) { * @returns {void} */ export const moveToTopSelectedElem = function () { - const [selected] = elementContext_.getSelectedElements(); + const [ selected ] = elementContext_.getSelectedElements(); if (!isNullish(selected)) { const t = selected; const oldParent = t.parentNode; @@ -62,7 +62,7 @@ export const moveToTopSelectedElem = function () { // event handler. if (oldNextSibling !== t.nextSibling) { elementContext_.addCommandToHistory(new MoveElementCommand(t, oldNextSibling, oldParent, 'top')); - elementContext_.call('changed', [t]); + elementContext_.call('changed', [ t ]); } } }; @@ -75,7 +75,7 @@ export const moveToTopSelectedElem = function () { * @returns {void} */ export const moveToBottomSelectedElem = function () { - const [selected] = elementContext_.getSelectedElements(); + const [ selected ] = elementContext_.getSelectedElements(); if (!isNullish(selected)) { let t = selected; const oldParent = t.parentNode; @@ -94,7 +94,7 @@ export const moveToBottomSelectedElem = function () { // event handler. if (oldNextSibling !== t.nextSibling) { elementContext_.addCommandToHistory(new MoveElementCommand(t, oldNextSibling, oldParent, 'bottom')); - elementContext_.call('changed', [t]); + elementContext_.call('changed', [ t ]); } } }; @@ -116,7 +116,7 @@ export const moveUpDownSelected = function (dir) { // curBBoxes = []; let closest, foundCur; // jQuery sorts this list - const list = elementContext_.getIntersectionList(getStrokedBBoxDefaultVisible([selected])); + const list = elementContext_.getIntersectionList(getStrokedBBoxDefaultVisible([ selected ])); if (dir === 'Down') { list.reverse(); } Array.prototype.forEach.call(list, function (el) { @@ -143,7 +143,7 @@ export const moveUpDownSelected = function (dir) { // event handler. if (oldNextSibling !== t.nextSibling) { elementContext_.addCommandToHistory(new MoveElementCommand(t, oldNextSibling, oldParent, 'Move ' + dir)); - elementContext_.call('changed', [t]); + elementContext_.call('changed', [ t ]); } }; @@ -298,7 +298,7 @@ export const alignSelectedElements = function (type, relativeTo) { for (let i = 0; i < len; ++i) { if (isNullish(selectedElements[i])) { break; } const elem = selectedElements[i]; - bboxes[i] = getStrokedBBoxDefaultVisible([elem]); + bboxes[i] = getStrokedBBoxDefaultVisible([ elem ]); // now bbox is axis-aligned and handles rotation switch (relativeTo) { @@ -505,7 +505,7 @@ export const groupSelectedElements = function (type, urlArg) { if (!batchCmd.isEmpty()) { elementContext_.addCommandToHistory(batchCmd); } // update selection - elementContext_.selectOnly([g], true); + elementContext_.selectOnly([ g ], true); }; /** @@ -550,7 +550,7 @@ export const pushGroupProperty = function (g, undoable) { if (gattrs.opacity !== null && gattrs.opacity !== 1) { // const c_opac = elem.getAttribute('opacity') || 1; const newOpac = Math.round((elem.getAttribute('opacity') || 1) * gattrs.opacity * 100) / 100; - elementContext_.changeSelectedAttribute('opacity', newOpac, [elem]); + elementContext_.changeSelectedAttribute('opacity', newOpac, [ elem ]); } if (gattrs.filter) { @@ -581,11 +581,11 @@ export const pushGroupProperty = function (g, undoable) { // Change this in future for different filters const suffix = (gfilter.firstChild.tagName === 'feGaussianBlur') ? 'blur' : 'filter'; gfilter.id = elem.id + '_' + suffix; - elementContext_.changeSelectedAttribute('filter', 'url(#' + gfilter.id + ')', [elem]); + elementContext_.changeSelectedAttribute('filter', 'url(#' + gfilter.id + ')', [ elem ]); // Update blur value if (cblur) { - elementContext_.changeSelectedAttribute('stdDeviation', cblur, [gfilter.firstChild]); + elementContext_.changeSelectedAttribute('stdDeviation', cblur, [ gfilter.firstChild ]); elementContext_.getCanvas().setBlurOffsets(gfilter, cblur); } } @@ -731,12 +731,12 @@ export const convertToGroup = function (elem) { xform.setTranslate(pt.x, pt.y); tlist.appendItem(xform); recalculateDimensions(elem); - elementContext_.call('selected', [elem]); + elementContext_.call('selected', [ elem ]); } else if (dataStorage.has($elem, 'symbol')) { - elem = dataStorage.get($elem, 'symbol') + elem = dataStorage.get($elem, 'symbol'); ts = $elem.attr('transform'); - const pos = $elem.attr(['x', 'y']); + const pos = $elem.attr([ 'x', 'y' ]); const vb = elem.getAttribute('viewBox'); @@ -832,7 +832,7 @@ export const convertToGroup = function (elem) { if (!el.id) { el.id = elementContext_.getNextId(); } }); - elementContext_.selectOnly([g]); + elementContext_.selectOnly([ g ]); const cm = pushGroupProperty(g, true); if (cm) { @@ -1019,6 +1019,6 @@ export const cycleElement = function (next) { } } } - elementContext_.getCanvas().selectOnly([elem], true); + elementContext_.getCanvas().selectOnly([ elem ], true); elementContext_.call('selected', selectedElements); }; diff --git a/src/svgcanvas/selection.js b/src/svgcanvas/selection.js index 098f22cb..31f8170e 100644 --- a/src/svgcanvas/selection.js +++ b/src/svgcanvas/selection.js @@ -136,7 +136,7 @@ export const getMouseTargetMethod = function (evt) { // for foreign content, go up until we find the foreignObject // WebKit browsers set the mouse target to the svgcanvas div - if ([NS.MATH, NS.HTML].includes(mouseTarget.namespaceURI) && + if ([ NS.MATH, NS.HTML ].includes(mouseTarget.namespaceURI) && mouseTarget.id !== 'svgcanvas' ) { while (mouseTarget.nodeName !== 'foreignObject') { @@ -151,7 +151,7 @@ export const getMouseTargetMethod = function (evt) { const svgRoot = selectionContext_.getSVGRoot(); const container = selectionContext_.getDOMContainer(); const content = selectionContext_.getSVGContent(); - if ([svgRoot, container, content, currentLayer].includes(mouseTarget)) { + if ([ svgRoot, container, content, currentLayer ].includes(mouseTarget)) { return selectionContext_.getSVGRoot(); } @@ -207,7 +207,7 @@ export const getMouseTargetMethod = function (evt) { */ export const runExtensionsMethod = function (action, vars, returnArray, nameFilter) { let result = returnArray ? [] : false; - for (const [name, ext] of Object.entries(selectionContext_.getExtensions())) { + for (const [ name, ext ] of Object.entries(selectionContext_.getExtensions())) { if (nameFilter && !nameFilter(name)) { return; } @@ -242,7 +242,7 @@ export const getVisibleElementsAndBBoxes = function (parent) { const elements = parent.children; Array.prototype.forEach.call(elements, function (elem) { if (elem.getBBox) { - contentElems.push({ elem, bbox: getStrokedBBoxDefaultVisible([elem]) }); + contentElems.push({ elem, bbox: getStrokedBBoxDefaultVisible([ elem ]) }); } }); return contentElems.reverse(); @@ -271,7 +271,7 @@ export const getIntersectionListMethod = function (rect) { rubberBBox = selectionContext_.getRubberBox().getBBox(); const bb = selectionContext_.getSVGContent().createSVGRect(); - ['x', 'y', 'width', 'height', 'top', 'right', 'bottom', 'left'].forEach((o) => { + [ 'x', 'y', 'width', 'height', 'top', 'right', 'bottom', 'left' ].forEach((o) => { bb[o] = rubberBBox[o] / currentZoom; }); rubberBBox = bb; @@ -339,7 +339,7 @@ export const prepareSvg = function (newDoc) { selectionContext_.getCanvas().sanitizeSvg(newDoc.documentElement); // convert paths into absolute commands - const paths = [...newDoc.getElementsByTagNameNS(NS.SVG, 'path')]; + const paths = [ ...newDoc.getElementsByTagNameNS(NS.SVG, 'path') ]; paths.forEach((path) => { path.setAttribute('d', selectionContext_.getCanvas().pathActions.convertPath(path)); selectionContext_.getCanvas().pathActions.fixEnd(path); diff --git a/src/svgcanvas/svg-exec.js b/src/svgcanvas/svg-exec.js index f8b0b70f..2bb9d63e 100644 --- a/src/svgcanvas/svg-exec.js +++ b/src/svgcanvas/svg-exec.js @@ -74,7 +74,7 @@ export const svgCanvasToString = function () { // Move out of in-group editing mode if (svgContext_.getCurrentGroup()) { draw.leaveContext(); - svgContext_.getCanvas().selectOnly([svgContext_.getCurrentGroup()]); + svgContext_.getCanvas().selectOnly([ svgContext_.getCurrentGroup() ]); } const nakedSvgs = []; @@ -124,7 +124,7 @@ export const svgToString = function (elem, indent) { if (elem) { cleanupElement(elem); - const attrs = [...elem.attributes]; + const attrs = [ ...elem.attributes ]; const childs = elem.childNodes; attrs.sort((a, b) => { return a.name > b.name ? -1 : 1; @@ -171,7 +171,7 @@ export const svgToString = function (elem, indent) { out.push(' xmlns:' + nsMap[uri] + '="' + uri + '"'); } if (el.attributes.length > 0) { - for (const [, attr] of Object.entries(el.attributes)) { + for (const [ , attr ] of Object.entries(el.attributes)) { const u = attr.namespaceURI; if (u && !nsuris[u] && nsMap[u] !== 'xmlns' && nsMap[u] !== 'xml') { nsuris[u] = true; @@ -182,7 +182,7 @@ export const svgToString = function (elem, indent) { }); let i = attrs.length; - const attrNames = ['width', 'height', 'xmlns', 'x', 'y', 'viewBox', 'id', 'overflow']; + const attrNames = [ 'width', 'height', 'xmlns', 'x', 'y', 'viewBox', 'id', 'overflow' ]; while (i--) { const attr = attrs[i]; const attrVal = toXml(attr.value); @@ -201,7 +201,7 @@ export const svgToString = function (elem, indent) { // Skip empty defs if (elem.nodeName === 'defs' && !elem.firstChild) { return ''; } - const mozAttrs = ['-moz-math-font-style', '_moz-math-font-style']; + const mozAttrs = [ '-moz-math-font-style', '_moz-math-font-style' ]; for (let i = attrs.length - 1; i >= 0; i--) { const attr = attrs[i]; let attrVal = toXml(attr.value); @@ -421,7 +421,7 @@ export const setSvgString = function (xmlString, preventUndo) { attrs.height = vb[3]; // handle content that doesn't have a viewBox } else { - ['width', 'height'].forEach(function (dim) { + [ 'width', 'height' ].forEach(function (dim) { // Set to 100 if not given const val = content.getAttribute(dim) || '100%'; if (String(val).substr(-1) === '%') { @@ -457,7 +457,7 @@ export const setSvgString = function (xmlString, preventUndo) { if (attrs.width <= 0) { attrs.width = 100; } if (attrs.height <= 0) { attrs.height = 100; } - for (const [key, value] of Object.entries(attrs)) { + for (const [ key, value ] of Object.entries(attrs)) { content.setAttribute(key, value); } this.contentW = attrs.width; @@ -480,7 +480,7 @@ export const setSvgString = function (xmlString, preventUndo) { svgContext_.getSVGRoot().append(svgContext_.getCanvas().selectorManager.selectorParentGroup); if (!preventUndo) svgContext_.addCommandToHistory(batchCmd); - svgContext_.call('changed', [svgContext_.getSVGContent()]); + svgContext_.call('changed', [ svgContext_.getSVGContent() ]); } catch (e) { console.log(e); return false; @@ -542,7 +542,7 @@ export const importSvgString = function (xmlString) { innerh = convertToNum('height', svg.getAttribute('height')), innervb = svg.getAttribute('viewBox'), // if no explicit viewbox, create one out of the width and height - vb = innervb ? innervb.split(' ') : [0, 0, innerw, innerh]; + vb = innervb ? innervb.split(' ') : [ 0, 0, innerw, innerh ]; for (j = 0; j < 4; ++j) { vb[j] = Number(vb[j]); } @@ -602,14 +602,14 @@ export const importSvgString = function (xmlString) { recalculateDimensions(useEl); dataStorage.put(useEl, 'symbol', symbol); dataStorage.put(useEl, 'ref', symbol); - svgContext_.getCanvas().addToSelection([useEl]); + svgContext_.getCanvas().addToSelection([ useEl ]); // TODO: Find way to add this in a recalculateDimensions-parsable way // if (vb[0] !== 0 || vb[1] !== 0) { // ts = 'translate(' + (-vb[0]) + ',' + (-vb[1]) + ') ' + ts; // } svgContext_.addCommandToHistory(batchCmd); - svgContext_.call('changed', [svgContext_.getSVGContent()]); + svgContext_.call('changed', [ svgContext_.getSVGContent() ]); } catch (e) { console.log(e); return null; @@ -712,7 +712,7 @@ function getIssues() { issueList.text = uiStrings.exportNoText; } - for (const [sel, descr] of Object.entries(issueList)) { + for (const [ sel, descr ] of Object.entries(issueList)) { if (content.querySelectorAll(sel).length) { issueCodes.push(sel); issues.push(descr); @@ -844,7 +844,7 @@ export const exportPDF = async ( const doc = jsPDF({ orientation, unit, - format: [res.w, res.h] + format: [ res.w, res.h ] // , compressPdf: true }); const docTitle = svgContext_.getCanvas().getDocumentTitle(); @@ -886,7 +886,7 @@ export const uniquifyElemsMethod = function (g) { // // Problem #1: if svg_1 gets renamed, we do not update the polyline's se:connector attribute // Problem #2: if the polyline svg_7 gets renamed, we do not update the marker id nor the polyline's marker-end attribute - const refElems = ['filter', 'linearGradient', 'pattern', 'radialGradient', 'symbol', 'textPath', 'use']; + const refElems = [ 'filter', 'linearGradient', 'pattern', 'radialGradient', 'symbol', 'textPath', 'use' ]; walkTree(g, function (n) { // if it's an element node @@ -1005,7 +1005,7 @@ export const removeUnusedDefElemsMethod = function () { const defelemUses = []; let numRemoved = 0; - const attrs = ['fill', 'stroke', 'filter', 'marker-start', 'marker-mid', 'marker-end']; + const attrs = [ 'fill', 'stroke', 'filter', 'marker-start', 'marker-mid', 'marker-end' ]; const alen = attrs.length; const allEls = svgContext_.getSVGContent().getElementsByTagNameNS(NS.SVG, '*'); diff --git a/src/svgcanvas/svgcanvas.js b/src/svgcanvas/svgcanvas.js index 6285db1c..2ba58bd2 100644 --- a/src/svgcanvas/svgcanvas.js +++ b/src/svgcanvas/svgcanvas.js @@ -121,7 +121,7 @@ const { } = hstry; const visElems = 'a,circle,ellipse,foreignObject,g,image,line,path,polygon,polyline,rect,svg,text,tspan,use'; -const refAttrs = ['clip-path', 'fill', 'filter', 'marker-end', 'marker-mid', 'marker-start', 'mask', 'stroke']; +const refAttrs = [ 'clip-path', 'fill', 'filter', 'marker-end', 'marker-mid', 'marker-start', 'mask', 'stroke' ]; if (!window.console) { window.console = {}; @@ -175,7 +175,7 @@ class SvgCanvas { const curConfig = { show_outside_canvas: true, selectNew: true, - dimensions: [640, 480] + dimensions: [ 640, 480 ] }; // Update config with new one if given @@ -740,7 +740,7 @@ class SvgCanvas { */ endChanges({ cmd, elem }) { addCommandToHistory(cmd); - call('changed', [elem]); + call('changed', [ elem ]); }, getCurrentZoom, getId, @@ -1109,7 +1109,7 @@ class SvgCanvas { * @returns {void} */ const logMatrix = function (m) { - console.log([m.a, m.b, m.c, m.d, m.e, m.f]); + console.log([ m.a, m.b, m.c, m.d, m.e, m.f ]); }; // Root Current Transformation Matrix in user units @@ -1645,7 +1645,7 @@ class SvgCanvas { setLayerVisibility, moveSelectedToLayer, mergeLayer, mergeAllLayers, leaveContext, setContext }; - Object.entries(dr).forEach(([prop, propVal]) => { + Object.entries(dr).forEach(([ prop, propVal ]) => { canvas[prop] = propVal; }); draw.init( @@ -1673,7 +1673,7 @@ class SvgCanvas { * @returns {void} */ changeSVGContent() { - call('changed', [svgcontent]); + call('changed', [ svgcontent ]); } } ); diff --git a/src/svgcanvas/svgroot.js b/src/svgcanvas/svgroot.js index e42e4c0e..fcc5cd38 100644 --- a/src/svgcanvas/svgroot.js +++ b/src/svgcanvas/svgroot.js @@ -5,8 +5,8 @@ * * @copyright 2010 Alexis Deveria, 2010 Jeff Schiller */ -import {NS} from '../common/namespaces.js'; -import {text2xml} from './utilities.js'; +import { NS } from '../common/namespaces.js'; +import { text2xml } from './utilities.js'; /** * @function module:svgcanvas.svgRootElement svgRootElement the svg node and its children. diff --git a/src/svgcanvas/svgtransformlist.js b/src/svgcanvas/svgtransformlist.js index 09083254..d1761bf2 100644 --- a/src/svgcanvas/svgtransformlist.js +++ b/src/svgcanvas/svgtransformlist.js @@ -7,8 +7,8 @@ * @copyright 2010 Alexis Deveria, 2010 Jeff Schiller */ -import {NS} from '../common/namespaces.js'; -import {supportsNativeTransformLists} from '../common/browser.js'; +import { NS } from '../common/namespaces.js'; +import { supportsNativeTransformLists } from '../common/browser.js'; const svgroot = document.createElementNS(NS.SVG, 'svg'); @@ -22,7 +22,7 @@ function transformToString (xform) { let text = ''; switch (xform.type) { case 1: // MATRIX - text = 'matrix(' + [m.a, m.b, m.c, m.d, m.e, m.f].join(',') + ')'; + text = 'matrix(' + [ m.a, m.b, m.c, m.d, m.e, m.f ].join(',') + ')'; break; case 2: // TRANSLATE text = 'translate(' + m.e + ',' + m.f + ')'; @@ -175,7 +175,7 @@ export class SVGTransformList { }); const xform = svgroot.createSVGTransform(); const fname = 'set' + name.charAt(0).toUpperCase() + name.slice(1); - const values = name === 'matrix' ? [mtx] : valArr; + const values = name === 'matrix' ? [ mtx ] : valArr; if (name === 'scale' && values.length === 1) { values.push(values[0]); @@ -222,7 +222,7 @@ export class SVGTransformList { initialize (newItem) { this.numberOfItems = 1; this._removeFromOtherLists(newItem); - this._xforms = [newItem]; + this._xforms = [ newItem ]; } /** diff --git a/src/svgcanvas/text-actions.js b/src/svgcanvas/text-actions.js index de11ffd2..f54080d8 100644 --- a/src/svgcanvas/text-actions.js +++ b/src/svgcanvas/text-actions.js @@ -6,7 +6,7 @@ */ -import {NS} from '../common/namespaces.js'; +import { NS } from '../common/namespaces.js'; import { transformPoint, getMatrix } from './math.js'; @@ -424,8 +424,8 @@ export const textActionsMethod = (function () { textActionsContext_.getCanvas().clearSelection(); curtext.style.cursor = 'move'; - textActionsContext_.call('selected', [curtext]); - textActionsContext_.getCanvas().addToSelection([curtext], true); + textActionsContext_.call('selected', [ curtext ]); + textActionsContext_.getCanvas().addToSelection([ curtext ], true); } if (curtext && !curtext.textContent.length) { // No content, so delete @@ -491,7 +491,7 @@ export const textActionsMethod = (function () { curtext.addEventListener("dblclick", selectWord); if (!len) { - end = {x: textbb.x + (textbb.width / 2), width: 0}; + end = { x: textbb.x + (textbb.width / 2), width: 0 }; } for (i = 0; i < len; i++) { diff --git a/src/svgcanvas/undo.js b/src/svgcanvas/undo.js index 9852190e..8dd532a2 100644 --- a/src/svgcanvas/undo.js +++ b/src/svgcanvas/undo.js @@ -142,7 +142,7 @@ export const changeSelectedAttributeNoUndoMethod = function (attr, newValue, ele } elems = elems || selectedElements; let i = elems.length; - const noXYElems = ['g', 'polyline', 'path']; + const noXYElems = [ 'g', 'polyline', 'path' ]; // const goodGAttrs = ['transform', 'opacity', 'filter']; while (i--) { @@ -151,7 +151,7 @@ export const changeSelectedAttributeNoUndoMethod = function (attr, newValue, ele // Set x,y vals on elements that don't have them if ((attr === 'x' || attr === 'y') && noXYElems.includes(elem.tagName)) { - const bbox = getStrokedBBoxDefaultVisible([elem]); + const bbox = getStrokedBBoxDefaultVisible([ elem ]); const diffX = attr === 'x' ? newValue - bbox.x : 0; const diffY = attr === 'y' ? newValue - bbox.y : 0; undoContext_.getCanvas().moveSelectedElements(diffX * currentZoom, diffY * currentZoom, true); @@ -213,7 +213,7 @@ export const changeSelectedAttributeNoUndoMethod = function (attr, newValue, ele if (isGecko() && elem.nodeName === 'text' && (/rotate/).test(elem.getAttribute('transform')) && - (String(newValue).startsWith('url') || (['font-size', 'font-family', 'x', 'y'].includes(attr) && elem.textContent))) { + (String(newValue).startsWith('url') || ([ 'font-size', 'font-family', 'x', 'y' ].includes(attr) && elem.textContent))) { elem = ffClone(elem); } // Timeout needed for Opera & Firefox diff --git a/src/svgcanvas/utilities.js b/src/svgcanvas/utilities.js index 18f58d4f..d2afe467 100644 --- a/src/svgcanvas/utilities.js +++ b/src/svgcanvas/utilities.js @@ -281,7 +281,7 @@ export const dataURLToObjectURL = function (dataurl) { while (n--) { u8arr[n] = bstr.charCodeAt(n); } - const blob = new Blob([u8arr], { type: mime }); + const blob = new Blob([ u8arr ], { type: mime }); return URL.createObjectURL(blob); }; @@ -305,7 +305,7 @@ export const blankPageObjectURL = (function () { if (typeof Blob === 'undefined') { return ''; } - const blob = new Blob(['<html><head><title>SVG-edit '], { type: 'text/html' }); + const blob = new Blob([ 'SVG-edit ' ], { type: 'text/html' }); return createObjectURL(blob); })(); @@ -317,7 +317,7 @@ export const blankPageObjectURL = (function () { */ export const convertToXMLReferences = function (input) { let output = ''; - [...input].forEach((ch) => { + [ ...input ].forEach((ch) => { const c = ch.charCodeAt(); output += (c <= 127) ? ch : `&#${c};`; }); @@ -495,9 +495,9 @@ export const getPathBBox = function (path) { const seglist = path.pathSegList; const tot = seglist.numberOfItems; - const bounds = [[], []]; + const bounds = [ [], [] ]; const start = seglist.getItem(0); - let P0 = [start.x, start.y]; + let P0 = [ start.x, start.y ]; const getCalc = function (j, P1, P2, P3) { return function (t) { @@ -518,9 +518,9 @@ export const getPathBBox = function (path) { bounds[1].push(P0[1]); if (seg.x1) { - const P1 = [seg.x1, seg.y1], - P2 = [seg.x2, seg.y2], - P3 = [seg.x, seg.y]; + const P1 = [ seg.x1, seg.y1 ], + P2 = [ seg.x2, seg.y2 ], + P3 = [ seg.x, seg.y ]; for (let j = 0; j < 2; j++) { const calc = getCalc(j, P1, P2, P3); @@ -586,7 +586,7 @@ function groupBBFix(selected) { elem.setAttribute('visibility', 'hidden'); svgroot_.appendChild(elem); copy.push(elem); - if (['line', 'path'].indexOf(elem.tagName) !== -1) { + if ([ 'line', 'path' ].indexOf(elem.tagName) !== -1) { elements.push(elem); } }); @@ -722,7 +722,7 @@ export const getBBox = function (elem) { export const getPathDFromSegments = function (pathSegments) { let d = ''; - $.each(pathSegments, function (j, [singleChar, pts]) { + $.each(pathSegments, function (j, [ singleChar, pts ]) { d += singleChar; for (let i = 0; i < pts.length; i += 2) { d += (pts[i] + ',' + pts[i + 1]) + ' '; @@ -754,12 +754,12 @@ export const getPathDFromElement = function (elem) { rx = ry; } d = getPathDFromSegments([ - ['M', [(cx - rx), (cy)]], - ['C', [(cx - rx), (cy - ry / num), (cx - rx / num), (cy - ry), (cx), (cy - ry)]], - ['C', [(cx + rx / num), (cy - ry), (cx + rx), (cy - ry / num), (cx + rx), (cy)]], - ['C', [(cx + rx), (cy + ry / num), (cx + rx / num), (cy + ry), (cx), (cy + ry)]], - ['C', [(cx - rx / num), (cy + ry), (cx - rx), (cy + ry / num), (cx - rx), (cy)]], - ['Z', []] + [ 'M', [ (cx - rx), (cy) ] ], + [ 'C', [ (cx - rx), (cy - ry / num), (cx - rx / num), (cy - ry), (cx), (cy - ry) ] ], + [ 'C', [ (cx + rx / num), (cy - ry), (cx + rx), (cy - ry / num), (cx + rx), (cy) ] ], + [ 'C', [ (cx + rx), (cy + ry / num), (cx + rx / num), (cy + ry), (cx), (cy + ry) ] ], + [ 'C', [ (cx - rx / num), (cy + ry), (cx - rx), (cy + ry / num), (cx - rx), (cy) ] ], + [ 'Z', [] ] ]); break; } case 'path': @@ -791,24 +791,24 @@ export const getPathDFromElement = function (elem) { d = (!rx && !ry) // Regular rect ? getPathDFromSegments([ - ['M', [x, y]], - ['L', [x + w, y]], - ['L', [x + w, y + h]], - ['L', [x, y + h]], - ['L', [x, y]], - ['Z', []] + [ 'M', [ x, y ] ], + [ 'L', [ x + w, y ] ], + [ 'L', [ x + w, y + h ] ], + [ 'L', [ x, y + h ] ], + [ 'L', [ x, y ] ], + [ 'Z', [] ] ]) : getPathDFromSegments([ - ['M', [x, y + ry]], - ['C', [x, y + ry / num, x + rx / num, y, x + rx, y]], - ['L', [x + w - rx, y]], - ['C', [x + w - rx / num, y, x + w, y + ry / num, x + w, y + ry]], - ['L', [x + w, y + h - ry]], - ['C', [x + w, y + h - ry / num, x + w - rx / num, y + h, x + w - rx, y + h]], - ['L', [x + rx, y + h]], - ['C', [x + rx / num, y + h, x, y + h - ry / num, x, y + h - ry]], - ['L', [x, y + ry]], - ['Z', []] + [ 'M', [ x, y + ry ] ], + [ 'C', [ x, y + ry / num, x + rx / num, y, x + rx, y ] ], + [ 'L', [ x + w - rx, y ] ], + [ 'C', [ x + w - rx / num, y, x + w, y + ry / num, x + w, y + ry ] ], + [ 'L', [ x + w, y + h - ry ] ], + [ 'C', [ x + w, y + h - ry / num, x + w - rx / num, y + h, x + w - rx, y + h ] ], + [ 'L', [ x + rx, y + h ] ], + [ 'C', [ x + rx / num, y + h, x, y + h - ry / num, x, y + h - ry ] ], + [ 'L', [ x, y + ry ] ], + [ 'Z', [] ] ]); break; } default: @@ -828,7 +828,7 @@ export const getExtraAttributesForConvertToPath = function (elem) { const attrs = {}; // TODO: make this list global so that we can properly maintain it // TODO: what about @transform, @clip-rule, @fill-rule, etc? - ['marker-start', 'marker-end', 'marker-mid', 'filter', 'clip-path'].forEach(function(item){ + [ 'marker-start', 'marker-end', 'marker-mid', 'filter', 'clip-path' ].forEach(function(item){ const a = elem.getAttribute(item); if (a) { attrs[item] = a; @@ -944,7 +944,7 @@ export const convertToPath = function ( elem.remove(); path.setAttribute('id', id); path.removeAttribute('visibility'); - addToSelection([path], true); + addToSelection([ path ], true); addCommandToHistory(batchCmd); @@ -1010,7 +1010,7 @@ export const getBBoxWithTransform = function (elem, addSVGElementFromJson, pathA if (bBoxCanBeOptimizedOverNativeGetBBox(angle, hasMatrixXForm)) { // Get the BBox from the raw path for these elements // TODO: why ellipse and not circle - const elemNames = ['ellipse', 'path', 'line', 'polyline', 'polygon']; + const elemNames = [ 'ellipse', 'path', 'line', 'polyline', 'polygon' ]; if (elemNames.includes(elem.tagName)) { goodBb = getBBoxOfElementAsPath(elem, addSVGElementFromJson, pathActions); bb = goodBb; @@ -1140,7 +1140,7 @@ export const getVisibleElements = function (parentElement) { } const contentElems = []; - const childrens = parentElement.children + const childrens = parentElement.children; Array.prototype.forEach.call(childrens, function (elem) { if (elem.getBBox) { contentElems.push(elem); @@ -1244,7 +1244,7 @@ export const getElem = (supportsSelectors()) * @returns {void} */ export const assignAttributes = function (elem, attrs, suspendLength, unitCheck) { - for (const [key, value] of Object.entries(attrs)) { + for (const [ key, value ] of Object.entries(attrs)) { const ns = (key.substr(0, 4) === 'xml:' ? NS.XML : key.substr(0, 6) === 'xlink:' ? NS.XLINK : null); @@ -1293,7 +1293,7 @@ export const cleanupElement = function (element) { delete defaults.ry; } - Object.entries(defaults).forEach(([attr, val]) => { + Object.entries(defaults).forEach(([ attr, val ]) => { if (element.getAttribute(attr) === String(val)) { element.removeAttribute(attr); } @@ -1365,4 +1365,4 @@ export const mock = ({ // shortcuts to common DOM functions export const $id = (id) => document.getElementById(id); export const $qq = (sel) => document.querySelector(sel); -export const $qa = (sel) => [...document.querySelectorAll(sel)]; +export const $qa = (sel) => [ ...document.querySelectorAll(sel) ]; diff --git a/tools/mochawesome-cli.js b/tools/mochawesome-cli.js index d0dec275..6ed3b1fa 100644 --- a/tools/mochawesome-cli.js +++ b/tools/mochawesome-cli.js @@ -24,7 +24,7 @@ const Suite = require('mocha/lib/suite.js'); const Test = require('mocha/lib/test.js'); const Runner = require('mocha/lib/runner.js'); -const {constants: { +const { constants: { EVENT_RUN_BEGIN, EVENT_RUN_END, EVENT_SUITE_BEGIN, @@ -32,9 +32,9 @@ const {constants: { EVENT_TEST_FAIL, EVENT_TEST_PASS, EVENT_TEST_PENDING -}} = require('mocha/lib/runner.js'); +} } = require('mocha/lib/runner.js'); -const {results, stats} = require(path); +const { results, stats } = require(path); const runner = new Runner( new Suite('', null, true) @@ -47,7 +47,7 @@ console.log('Mocha results:'); new MochaReporter(runner); runner.emit(EVENT_RUN_BEGIN); -results.forEach(({suites}) => { +results.forEach(({ suites }) => { suites.forEach(function handleSuite (st) { const ste = Object.assign(new Suite(''), st); @@ -60,7 +60,7 @@ results.forEach(({suites}) => { const tst = new Test('', () => { // }); - Object.entries(ts).forEach(([k, v]) => { + Object.entries(ts).forEach(([ k, v ]) => { // `fullTitle` is a string in mochawesome but a function in Mocha if (k !== 'fullTitle') { tst[k] = v; diff --git a/web-dev-server.config.mjs b/web-dev-server.config.mjs index 0b4cfbb2..5e97b828 100644 --- a/web-dev-server.config.mjs +++ b/web-dev-server.config.mjs @@ -1,4 +1,5 @@ -import {fromRollup} from '@web/dev-server-rollup'; +import { fromRollup } from '@web/dev-server-rollup'; +// eslint-disable-next-line node/no-unpublished-import import rollupCommonjs from '@rollup/plugin-commonjs'; const commonjs = fromRollup(rollupCommonjs); @@ -6,7 +7,7 @@ const commonjs = fromRollup(rollupCommonjs); export default { plugins: [ commonjs({ - exclude: ['src', 'dist', 'instrumented'] + exclude: [ 'src', 'dist', 'instrumented' ] }) ] };