- Linting (ESLint): Apply coding standards

- Testing (Refactoring): Abstract out to helper file functions for approving local storage and opening the main menu
- Docs (CHANGES): Update
- npm: Update devDeps; update nested deps for security audit
master
Brett Zamir 2019-03-16 12:30:23 +08:00
parent 5691b7b1e7
commit dade2a7b37
28 changed files with 521 additions and 537 deletions

View File

@ -5,9 +5,12 @@
- Fix: Delay icon setting until locales available (fixes #323)
- Fix: Extension with no `placement` to be added to end;
for #326 (@sjernigan)
- Fix: Error on dragging control point of arc; fixes #268 (@cuixiping)
- Optimization fix: Properly run code conditionally on browser check;
fixes #312 (@ianli-sc)
- Enhancement: Add CAD Placemark extension (@NeiroNx)
- Testing (UI Refactoring): Abstract out to helper file functions
- npm: Update devDeps; update nested deps for security audit
## 4.2.0

2
dist/canvg.js vendored
View File

@ -4579,7 +4579,7 @@ var canvg = (function (exports) {
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
return function (_x2, _x3) {

View File

@ -349,7 +349,7 @@ var svgEditorExtension_arrows = (function () {
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
function addLangData(_x2) {

View File

@ -267,7 +267,7 @@ var svgEditorExtension_foreignobject = (function () {
return _context.stop();
}
}
}, _callee, this);
}, _callee);
})));
/* const cancel = */

View File

@ -533,7 +533,7 @@ var svgEditorExtension_imagelib = (function () {
return _context.stop();
}
}
}, _callee, this, [[3, 20]]);
}, _callee, null, [[3, 20]]);
}));
return function (_x2) {

View File

@ -212,7 +212,7 @@ var svgEditorExtension_markers = (function () {
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
return _showTextPrompt.apply(this, arguments);
};

View File

@ -306,7 +306,7 @@ var svgEditorExtension_mathjax = (function () {
return _context.stop();
}
}
}, _callee, this, [[7, 13]]);
}, _callee, null, [[7, 13]]);
}));
function click() {

View File

@ -4579,7 +4579,7 @@ var svgEditorExtension_server_moinsave = (function () {
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
return function (_x2, _x3) {
@ -4935,7 +4935,7 @@ var svgEditorExtension_server_moinsave = (function () {
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
function save(_x2, _x3) {

View File

@ -4579,7 +4579,7 @@ var svgEditorExtension_server_opensave = (function () {
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
return function (_x2, _x3) {
@ -4909,7 +4909,7 @@ var svgEditorExtension_server_opensave = (function () {
return _context4.stop();
}
}
}, _callee4, this);
}, _callee4);
}));
return _submit.apply(this, arguments);
}
@ -4948,7 +4948,7 @@ var svgEditorExtension_server_opensave = (function () {
return _context2.stop();
}
}
}, _callee2, this);
}, _callee2);
})));
} else {
inp.change(
@ -4968,7 +4968,7 @@ var svgEditorExtension_server_opensave = (function () {
return _context3.stop();
}
}
}, _callee3, this);
}, _callee3);
})));
}
};
@ -5114,7 +5114,7 @@ var svgEditorExtension_server_opensave = (function () {
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
function exportImage(_x2, _x3) {

View File

@ -412,7 +412,7 @@ var svgEditorExtension_storage = (function () {
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
function langReady(_x) {

View File

@ -3220,7 +3220,7 @@
return _context3.stop();
}
}
}, _callee3, this);
}, _callee3);
}));
return _processResults.apply(this, arguments);
}
@ -3253,7 +3253,7 @@
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
function $submit() {

53
dist/index-es.js vendored
View File

@ -5714,7 +5714,8 @@ function () {
value: function move(dx, dy) {
var item = this.item;
var 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];
replacePathSeg(this.type, this.index, curPts);
replacePathSeg(this.type, this.index, // type 10 means ARC
this.type === 10 ? ptObjToArr(this.type, item) : curPts);
if (this.next && this.next.ctrlpts) {
var next = this.next.item;
@ -9445,7 +9446,7 @@ function _importSetGlobal() {
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
return _importSetGlobal.apply(this, arguments);
}
@ -14727,7 +14728,7 @@ function SvgCanvas(container, config) {
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
return function (_x, _x2, _x3) {
@ -28299,7 +28300,7 @@ function () {
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
return function readLang(_x) {
@ -28372,7 +28373,7 @@ function () {
return _context2.stop();
}
}
}, _callee2, this);
}, _callee2);
}));
return function putLocale(_x2, _x3, _x4) {
@ -28867,7 +28868,7 @@ function _loadSvgString() {
return _context23.stop();
}
}
}, _callee23, this);
}, _callee23);
}));
return _loadSvgString.apply(this, arguments);
}
@ -28926,7 +28927,7 @@ function getImportLocale(_ref) {
return _context.stop();
}
}
}, _callee, this, [[2, 8]]);
}, _callee, null, [[2, 8]]);
}));
function importLocaleDefaulting() {
@ -29489,7 +29490,7 @@ editor.init = function () {
return _context2.stop();
}
}
}, _callee2, this, [[4, 13]]);
}, _callee2, null, [[4, 13]]);
}));
return function (_x2) {
@ -29541,7 +29542,7 @@ editor.init = function () {
return _context3.stop();
}
}
}, _callee3, this, [[10, 17]]);
}, _callee3, null, [[10, 17]]);
}));
return function extAndLocaleFunc() {
@ -30132,7 +30133,7 @@ editor.init = function () {
return _context4.stop();
}
}
}, _callee4, this);
}, _callee4);
}));
function callback(_x3) {
@ -30639,7 +30640,7 @@ editor.init = function () {
return _context18.stop();
}
}
}, _callee18, this);
}, _callee18);
}));
return _promptImgURL.apply(this, arguments);
}
@ -32356,7 +32357,7 @@ editor.init = function () {
return _context5.stop();
}
}
}, _callee5, this);
}, _callee5);
}));
return function extAdded(_x4, _x5) {
@ -33346,7 +33347,7 @@ editor.init = function () {
return _context7.stop();
}
}
}, _callee7, this);
}, _callee7);
}));
return function makeHyperlink() {
@ -33512,7 +33513,7 @@ editor.init = function () {
return _context8.stop();
}
}
}, _callee8, this);
}, _callee8);
}));
return function clickClear() {
@ -33660,7 +33661,7 @@ editor.init = function () {
return _context9.stop();
}
}
}, _callee9, this);
}, _callee9);
}));
return function clickExport() {
@ -33917,7 +33918,7 @@ editor.init = function () {
return _context10.stop();
}
}
}, _callee10, this);
}, _callee10);
}));
return function saveSourceEditor() {
@ -34059,7 +34060,7 @@ editor.init = function () {
return _context11.stop();
}
}
}, _callee11, this);
}, _callee11);
}));
var resetScrollPos = $$b.noop;
@ -34138,7 +34139,7 @@ editor.init = function () {
return _context12.stop();
}
}
}, _callee12, this);
}, _callee12);
}));
return function cancelOverlays() {
@ -34560,7 +34561,7 @@ editor.init = function () {
return _context13.stop();
}
}
}, _callee13, this);
}, _callee13);
})));
/**
*
@ -34636,7 +34637,7 @@ editor.init = function () {
return _context19.stop();
}
}
}, _callee19, this);
}, _callee19);
}));
return _cloneLayer.apply(this, arguments);
}
@ -34718,7 +34719,7 @@ editor.init = function () {
return _context14.stop();
}
}
}, _callee14, this);
}, _callee14);
})));
var SIDEPANEL_MAXWIDTH = 300;
var SIDEPANEL_OPENWIDTH = 150;
@ -35967,7 +35968,7 @@ editor.init = function () {
return _context15.stop();
}
}
}, _callee15, this);
}, _callee15);
}));
return function (_x6) {
@ -36106,7 +36107,7 @@ editor.init = function () {
return _context17.stop();
}
}
}, _callee17, this);
}, _callee17);
}));
return function (_x7, _x8) {
@ -36240,7 +36241,7 @@ regeneratorRuntime.mark(function _callee20() {
return _context20.stop();
}
}
}, _callee20, this, [[0, 5]]);
}, _callee20, null, [[0, 5]]);
}));
/**
* @param {string} str The SVG string to load
@ -36288,7 +36289,7 @@ editor.loadFromString = function (str) {
return _context21.stop();
}
}
}, _callee21, this, [[0, 5]]);
}, _callee21, null, [[0, 5]]);
})));
};
/**
@ -36478,7 +36479,7 @@ regeneratorRuntime.mark(function _callee22() {
return _context22.stop();
}
}
}, _callee22, this, [[0, 6]]);
}, _callee22, null, [[0, 6]]);
}))();
export default editor;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

53
dist/index-umd.js vendored
View File

@ -5720,7 +5720,8 @@
value: function move(dx, dy) {
var item = this.item;
var 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];
replacePathSeg(this.type, this.index, curPts);
replacePathSeg(this.type, this.index, // type 10 means ARC
this.type === 10 ? ptObjToArr(this.type, item) : curPts);
if (this.next && this.next.ctrlpts) {
var next = this.next.item;
@ -9451,7 +9452,7 @@
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
return _importSetGlobal.apply(this, arguments);
}
@ -14733,7 +14734,7 @@
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
return function (_x, _x2, _x3) {
@ -28305,7 +28306,7 @@
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
return function readLang(_x) {
@ -28378,7 +28379,7 @@
return _context2.stop();
}
}
}, _callee2, this);
}, _callee2);
}));
return function putLocale(_x2, _x3, _x4) {
@ -28873,7 +28874,7 @@
return _context23.stop();
}
}
}, _callee23, this);
}, _callee23);
}));
return _loadSvgString.apply(this, arguments);
}
@ -28932,7 +28933,7 @@
return _context.stop();
}
}
}, _callee, this, [[2, 8]]);
}, _callee, null, [[2, 8]]);
}));
function importLocaleDefaulting() {
@ -29495,7 +29496,7 @@
return _context2.stop();
}
}
}, _callee2, this, [[4, 13]]);
}, _callee2, null, [[4, 13]]);
}));
return function (_x2) {
@ -29547,7 +29548,7 @@
return _context3.stop();
}
}
}, _callee3, this, [[10, 17]]);
}, _callee3, null, [[10, 17]]);
}));
return function extAndLocaleFunc() {
@ -30138,7 +30139,7 @@
return _context4.stop();
}
}
}, _callee4, this);
}, _callee4);
}));
function callback(_x3) {
@ -30645,7 +30646,7 @@
return _context18.stop();
}
}
}, _callee18, this);
}, _callee18);
}));
return _promptImgURL.apply(this, arguments);
}
@ -32362,7 +32363,7 @@
return _context5.stop();
}
}
}, _callee5, this);
}, _callee5);
}));
return function extAdded(_x4, _x5) {
@ -33352,7 +33353,7 @@
return _context7.stop();
}
}
}, _callee7, this);
}, _callee7);
}));
return function makeHyperlink() {
@ -33518,7 +33519,7 @@
return _context8.stop();
}
}
}, _callee8, this);
}, _callee8);
}));
return function clickClear() {
@ -33666,7 +33667,7 @@
return _context9.stop();
}
}
}, _callee9, this);
}, _callee9);
}));
return function clickExport() {
@ -33923,7 +33924,7 @@
return _context10.stop();
}
}
}, _callee10, this);
}, _callee10);
}));
return function saveSourceEditor() {
@ -34065,7 +34066,7 @@
return _context11.stop();
}
}
}, _callee11, this);
}, _callee11);
}));
var resetScrollPos = $$b.noop;
@ -34144,7 +34145,7 @@
return _context12.stop();
}
}
}, _callee12, this);
}, _callee12);
}));
return function cancelOverlays() {
@ -34566,7 +34567,7 @@
return _context13.stop();
}
}
}, _callee13, this);
}, _callee13);
})));
/**
*
@ -34642,7 +34643,7 @@
return _context19.stop();
}
}
}, _callee19, this);
}, _callee19);
}));
return _cloneLayer.apply(this, arguments);
}
@ -34724,7 +34725,7 @@
return _context14.stop();
}
}
}, _callee14, this);
}, _callee14);
})));
var SIDEPANEL_MAXWIDTH = 300;
var SIDEPANEL_OPENWIDTH = 150;
@ -35973,7 +35974,7 @@
return _context15.stop();
}
}
}, _callee15, this);
}, _callee15);
}));
return function (_x6) {
@ -36112,7 +36113,7 @@
return _context17.stop();
}
}
}, _callee17, this);
}, _callee17);
}));
return function (_x7, _x8) {
@ -36246,7 +36247,7 @@
return _context20.stop();
}
}
}, _callee20, this, [[0, 5]]);
}, _callee20, null, [[0, 5]]);
}));
/**
* @param {string} str The SVG string to load
@ -36294,7 +36295,7 @@
return _context21.stop();
}
}
}, _callee21, this, [[0, 5]]);
}, _callee21, null, [[0, 5]]);
})));
};
/**
@ -36484,7 +36485,7 @@
return _context22.stop();
}
}
}, _callee22, this, [[0, 6]]);
}, _callee22, null, [[0, 6]]);
}))();
return editor;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -5776,7 +5776,8 @@ var SvgCanvas = (function () {
value: function move(dx, dy) {
var item = this.item;
var 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];
replacePathSeg(this.type, this.index, curPts);
replacePathSeg(this.type, this.index, // type 10 means ARC
this.type === 10 ? ptObjToArr(this.type, item) : curPts);
if (this.next && this.next.ctrlpts) {
var next = this.next.item;
@ -11299,7 +11300,7 @@ var SvgCanvas = (function () {
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
return _importSetGlobal.apply(this, arguments);
}
@ -14505,7 +14506,7 @@ var SvgCanvas = (function () {
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
return function (_x, _x2, _x3) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
/* eslint-disable new-cap, class-methods-use-this, @mysticatea/no-use-ignored-vars */
/* eslint-disable new-cap, class-methods-use-this */
// Todo: Compare with latest canvg (add any improvements of ours) and add full JSDocs (denoting links to standard APIs and which are custom): https://github.com/canvg/canvg
/**
* canvg.js - Javascript SVG parser and renderer on Canvas

View File

@ -785,7 +785,12 @@ export class Segment {
]
: [item.x += dx, item.y += dy];
replacePathSeg(this.type, this.index, this.type === 10 ? ptObjToArr(this.type, item) : curPts); //type 10 means ARC
replacePathSeg(
this.type,
this.index,
// type 10 means ARC
this.type === 10 ? ptObjToArr(this.type, item) : curPts
);
if (this.next && this.next.ctrlpts) {
const next = this.next.item;

View File

@ -5717,7 +5717,8 @@
value: function move(dx, dy) {
var item = this.item;
var 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];
replacePathSeg(this.type, this.index, curPts);
replacePathSeg(this.type, this.index, // type 10 means ARC
this.type === 10 ? ptObjToArr(this.type, item) : curPts);
if (this.next && this.next.ctrlpts) {
var next = this.next.item;
@ -9448,7 +9449,7 @@
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
return _importSetGlobal.apply(this, arguments);
}
@ -14730,7 +14731,7 @@
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
return function (_x, _x2, _x3) {
@ -28302,7 +28303,7 @@
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
return function readLang(_x) {
@ -28375,7 +28376,7 @@
return _context2.stop();
}
}
}, _callee2, this);
}, _callee2);
}));
return function putLocale(_x2, _x3, _x4) {
@ -28870,7 +28871,7 @@
return _context23.stop();
}
}
}, _callee23, this);
}, _callee23);
}));
return _loadSvgString.apply(this, arguments);
}
@ -28929,7 +28930,7 @@
return _context.stop();
}
}
}, _callee, this, [[2, 8]]);
}, _callee, null, [[2, 8]]);
}));
function importLocaleDefaulting() {
@ -29492,7 +29493,7 @@
return _context2.stop();
}
}
}, _callee2, this, [[4, 13]]);
}, _callee2, null, [[4, 13]]);
}));
return function (_x2) {
@ -29544,7 +29545,7 @@
return _context3.stop();
}
}
}, _callee3, this, [[10, 17]]);
}, _callee3, null, [[10, 17]]);
}));
return function extAndLocaleFunc() {
@ -30135,7 +30136,7 @@
return _context4.stop();
}
}
}, _callee4, this);
}, _callee4);
}));
function callback(_x3) {
@ -30642,7 +30643,7 @@
return _context18.stop();
}
}
}, _callee18, this);
}, _callee18);
}));
return _promptImgURL.apply(this, arguments);
}
@ -32359,7 +32360,7 @@
return _context5.stop();
}
}
}, _callee5, this);
}, _callee5);
}));
return function extAdded(_x4, _x5) {
@ -33349,7 +33350,7 @@
return _context7.stop();
}
}
}, _callee7, this);
}, _callee7);
}));
return function makeHyperlink() {
@ -33515,7 +33516,7 @@
return _context8.stop();
}
}
}, _callee8, this);
}, _callee8);
}));
return function clickClear() {
@ -33663,7 +33664,7 @@
return _context9.stop();
}
}
}, _callee9, this);
}, _callee9);
}));
return function clickExport() {
@ -33920,7 +33921,7 @@
return _context10.stop();
}
}
}, _callee10, this);
}, _callee10);
}));
return function saveSourceEditor() {
@ -34062,7 +34063,7 @@
return _context11.stop();
}
}
}, _callee11, this);
}, _callee11);
}));
var resetScrollPos = $$b.noop;
@ -34141,7 +34142,7 @@
return _context12.stop();
}
}
}, _callee12, this);
}, _callee12);
}));
return function cancelOverlays() {
@ -34563,7 +34564,7 @@
return _context13.stop();
}
}
}, _callee13, this);
}, _callee13);
})));
/**
*
@ -34639,7 +34640,7 @@
return _context19.stop();
}
}
}, _callee19, this);
}, _callee19);
}));
return _cloneLayer.apply(this, arguments);
}
@ -34721,7 +34722,7 @@
return _context14.stop();
}
}
}, _callee14, this);
}, _callee14);
})));
var SIDEPANEL_MAXWIDTH = 300;
var SIDEPANEL_OPENWIDTH = 150;
@ -35970,7 +35971,7 @@
return _context15.stop();
}
}
}, _callee15, this);
}, _callee15);
}));
return function (_x6) {
@ -36109,7 +36110,7 @@
return _context17.stop();
}
}
}, _callee17, this);
}, _callee17);
}));
return function (_x7, _x8) {
@ -36243,7 +36244,7 @@
return _context20.stop();
}
}
}, _callee20, this, [[0, 5]]);
}, _callee20, null, [[0, 5]]);
}));
/**
* @param {string} str The SVG string to load
@ -36291,7 +36292,7 @@
return _context21.stop();
}
}
}, _callee21, this, [[0, 5]]);
}, _callee21, null, [[0, 5]]);
})));
};
/**
@ -36481,7 +36482,7 @@
return _context22.stop();
}
}
}, _callee22, this, [[0, 6]]);
}, _callee22, null, [[0, 6]]);
}))();
window.svgEditor = editor;

731
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -76,21 +76,21 @@
],
"dependencies": {},
"devDependencies": {
"@babel/core": "^7.3.3",
"@babel/core": "^7.3.4",
"@babel/node": "^7.2.2",
"@babel/plugin-transform-modules-commonjs": "^7.2.0",
"@babel/polyfill": "^7.2.5",
"@babel/preset-env": "^7.3.1",
"@babel/preset-env": "^7.3.4",
"@mysticatea/eslint-plugin": "^9.0.1",
"axe-testcafe": "^1.1.0",
"babel-plugin-transform-object-rest-spread": "^7.0.0-beta.3",
"eslint": "5.14.1",
"eslint-config-ash-nazg": "0.4.4",
"eslint": "5.15.2",
"eslint-config-ash-nazg": "0.5.0",
"eslint-config-standard": "12.0.0",
"eslint-plugin-compat": "2.7.0",
"eslint-plugin-compat": "^2.7.0",
"eslint-plugin-eslint-comments": "^3.1.1",
"eslint-plugin-import": "2.16.0",
"eslint-plugin-jsdoc": "^4.1.0",
"eslint-plugin-jsdoc": "^4.4.2",
"eslint-plugin-markdown": "^1.0.0",
"eslint-plugin-no-use-extend-native": "^0.4.0",
"eslint-plugin-node": "8.0.1",
@ -106,23 +106,23 @@
"load-stylesheets": "^0.7.0",
"node-static": "^0.7.11",
"opn-cli": "^4.0.0",
"promise-fs": "^2.0.1",
"promise-fs": "^2.1.0",
"qr-manipulation": "https://github.com/brettz9/qr-manipulation",
"query-result": "https://github.com/WebReflection/query-result",
"qunit": "^2.9.1",
"qunit": "^2.9.2",
"remark-cli": "^6.0.1",
"remark-lint-ordered-list-marker-value": "^1.0.2",
"rollup": "1.2.2",
"rollup": "1.6.0",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-commonjs": "^9.2.1",
"rollup-plugin-json": "^3.1.0",
"rollup-plugin-node-builtins": "^2.1.2",
"rollup-plugin-node-resolve": "^4.0.0",
"rollup-plugin-node-resolve": "^4.0.1",
"rollup-plugin-re": "^1.0.7",
"rollup-plugin-terser": "^4.0.4",
"sinon": "^7.2.4",
"sinon": "^7.2.7",
"sinon-test": "^2.4.0",
"stackblur-canvas": "^2.2.0",
"testcafe": "^1.0.1"
"testcafe": "^1.1.0"
}
}

View File

@ -5717,7 +5717,8 @@
value: function move(dx, dy) {
var item = this.item;
var 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];
replacePathSeg(this.type, this.index, curPts);
replacePathSeg(this.type, this.index, // type 10 means ARC
this.type === 10 ? ptObjToArr(this.type, item) : curPts);
if (this.next && this.next.ctrlpts) {
var next = this.next.item;
@ -9448,7 +9449,7 @@
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
return _importSetGlobal.apply(this, arguments);
}
@ -14730,7 +14731,7 @@
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
return function (_x, _x2, _x3) {
@ -28302,7 +28303,7 @@
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
return function readLang(_x) {
@ -28375,7 +28376,7 @@
return _context2.stop();
}
}
}, _callee2, this);
}, _callee2);
}));
return function putLocale(_x2, _x3, _x4) {
@ -28870,7 +28871,7 @@
return _context23.stop();
}
}
}, _callee23, this);
}, _callee23);
}));
return _loadSvgString.apply(this, arguments);
}
@ -28929,7 +28930,7 @@
return _context.stop();
}
}
}, _callee, this, [[2, 8]]);
}, _callee, null, [[2, 8]]);
}));
function importLocaleDefaulting() {
@ -29492,7 +29493,7 @@
return _context2.stop();
}
}
}, _callee2, this, [[4, 13]]);
}, _callee2, null, [[4, 13]]);
}));
return function (_x2) {
@ -29544,7 +29545,7 @@
return _context3.stop();
}
}
}, _callee3, this, [[10, 17]]);
}, _callee3, null, [[10, 17]]);
}));
return function extAndLocaleFunc() {
@ -30135,7 +30136,7 @@
return _context4.stop();
}
}
}, _callee4, this);
}, _callee4);
}));
function callback(_x3) {
@ -30642,7 +30643,7 @@
return _context18.stop();
}
}
}, _callee18, this);
}, _callee18);
}));
return _promptImgURL.apply(this, arguments);
}
@ -32359,7 +32360,7 @@
return _context5.stop();
}
}
}, _callee5, this);
}, _callee5);
}));
return function extAdded(_x4, _x5) {
@ -33349,7 +33350,7 @@
return _context7.stop();
}
}
}, _callee7, this);
}, _callee7);
}));
return function makeHyperlink() {
@ -33515,7 +33516,7 @@
return _context8.stop();
}
}
}, _callee8, this);
}, _callee8);
}));
return function clickClear() {
@ -33663,7 +33664,7 @@
return _context9.stop();
}
}
}, _callee9, this);
}, _callee9);
}));
return function clickExport() {
@ -33920,7 +33921,7 @@
return _context10.stop();
}
}
}, _callee10, this);
}, _callee10);
}));
return function saveSourceEditor() {
@ -34062,7 +34063,7 @@
return _context11.stop();
}
}
}, _callee11, this);
}, _callee11);
}));
var resetScrollPos = $$b.noop;
@ -34141,7 +34142,7 @@
return _context12.stop();
}
}
}, _callee12, this);
}, _callee12);
}));
return function cancelOverlays() {
@ -34563,7 +34564,7 @@
return _context13.stop();
}
}
}, _callee13, this);
}, _callee13);
})));
/**
*
@ -34639,7 +34640,7 @@
return _context19.stop();
}
}
}, _callee19, this);
}, _callee19);
}));
return _cloneLayer.apply(this, arguments);
}
@ -34721,7 +34722,7 @@
return _context14.stop();
}
}
}, _callee14, this);
}, _callee14);
})));
var SIDEPANEL_MAXWIDTH = 300;
var SIDEPANEL_OPENWIDTH = 150;
@ -35970,7 +35971,7 @@
return _context15.stop();
}
}
}, _callee15, this);
}, _callee15);
}));
return function (_x6) {
@ -36109,7 +36110,7 @@
return _context17.stop();
}
}
}, _callee17, this);
}, _callee17);
}));
return function (_x7, _x8) {
@ -36243,7 +36244,7 @@
return _context20.stop();
}
}
}, _callee20, this, [[0, 5]]);
}, _callee20, null, [[0, 5]]);
}));
/**
* @param {string} str The SVG string to load
@ -36291,7 +36292,7 @@
return _context21.stop();
}
}
}, _callee21, this, [[0, 5]]);
}, _callee21, null, [[0, 5]]);
})));
};
/**
@ -36481,7 +36482,7 @@
return _context22.stop();
}
}
}, _callee22, this, [[0, 6]]);
}, _callee22, null, [[0, 6]]);
}))();
// TO BUILD AN IIFE VERSION OF THIS FILE (AS CAN WORK ON OLDER BROWSERS),

8
test/ui-test-helper.js Normal file
View File

@ -0,0 +1,8 @@
export const approveStorage = (t) => {
return t
.click('#dialog_buttons > input[type=button][value=OK]');
};
export const approveStorageAndOpenMainMenu = (t) => {
return approveStorage(t).click('#main_icon');
};

View File

@ -2,29 +2,27 @@
// https://devexpress.github.io/testcafe/documentation/test-api/
// https://github.com/helen-dikareva/axe-testcafe
import {Selector} from 'testcafe';
import {
approveStorage, approveStorageAndOpenMainMenu
} from '../ui-test-helper.js';
fixture`TestCafe UI tests`
.page`http://localhost:8000/editor/svg-editor.html`;
test('Editor - No parameters: Export button', async (t) => {
await t
.click('#dialog_buttons > input[type=button][value=OK]')
.click('#main_icon')
await approveStorageAndOpenMainMenu(t)
.expect(Selector('#tool_export')).ok('Has open button');
});
test('Editor - No parameters: Export button clicking', async (t) => {
await t
.click('#dialog_buttons > input[type=button][value=OK]')
.click('#main_icon')
await approveStorageAndOpenMainMenu(t)
.click('#tool_export')
.expect(Selector('#dialog_content select')).ok('Export dialog opens');
});
test('Editor - No parameters: Drag control point of arc path', async (t) => {
const randomOffset = () => Math.round(10 + Math.random() * 40);
await t
.click('#dialog_buttons > input[type=button][value=OK]')
await approveStorage(t)
.click('#tool_source')
.selectTextAreaContent('#svg_source_textarea')
.typeText('#svg_source_textarea', `<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg">
@ -36,7 +34,7 @@ test('Editor - No parameters: Drag control point of arc path', async (t) => {
.click('#tool_source_save')
.click('#svg_1')
.click('#svg_1')
.drag('#pathpointgrip_0', randomOffset(), randomOffset(), { offsetX: 2, offsetY: 2 })
.drag('#pathpointgrip_1', randomOffset(), randomOffset(), { offsetX: 2, offsetY: 2 })
.drag('#pathpointgrip_0', randomOffset(), randomOffset(), {offsetX: 2, offsetY: 2})
.drag('#pathpointgrip_1', randomOffset(), randomOffset(), {offsetX: 2, offsetY: 2})
.expect(Selector('#svg_1').getAttribute('d')).notContains('NaN');
});