#97 update from master svgedit
This commit is contained in:
@@ -1,10 +1,15 @@
|
|||||||
node_modules
|
node_modules
|
||||||
|
ignore
|
||||||
|
|
||||||
coverage
|
coverage
|
||||||
instrumented
|
instrumented
|
||||||
dist
|
dist
|
||||||
|
docs/jsdoc
|
||||||
archive
|
archive
|
||||||
|
|
||||||
|
jsconfig.json
|
||||||
mochawesome-report
|
mochawesome-report
|
||||||
|
releases
|
||||||
!.eslintrc.js
|
!.eslintrc.js
|
||||||
!.ncurc.js
|
!.ncurc.js
|
||||||
|
|
||||||
@@ -15,7 +20,17 @@ svgedit-custom.css
|
|||||||
|
|
||||||
# Vendor/minified files
|
# Vendor/minified files
|
||||||
src/editor/jquery.min.js
|
src/editor/jquery.min.js
|
||||||
|
src/editor/jquery-ui
|
||||||
|
|
||||||
|
# Previously minified though exporting
|
||||||
|
src/editor/js-hotkeys
|
||||||
|
|
||||||
|
src/editor/jspdf/jspdf.min.js
|
||||||
|
src/editor/jspdf/underscore-min.js
|
||||||
|
|
||||||
src/editor/extensions/ext-mathjax/mathjax
|
src/editor/extensions/ext-mathjax/mathjax
|
||||||
|
|
||||||
|
# jquery files
|
||||||
|
src/editor/svgicons/jQuery.svgIcons.js
|
||||||
|
src/editor/jgraduate/jQuery.jPicker.js
|
||||||
|
|
||||||
|
|||||||
9
.idea/svgedit.iml
generated
9
.idea/svgedit.iml
generated
@@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$" />
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
||||||
@@ -105,22 +105,4 @@ describe('use various parts of svg-edit', function () {
|
|||||||
.trigger('mouseup', { force: true });
|
.trigger('mouseup', { force: true });
|
||||||
testSnapshot();
|
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();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -34,28 +34,6 @@ describe('select', function () {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
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;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements {module:select.SVGFactory}
|
* @implements {module:select.SVGFactory}
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ describe('Basic Module', function () {
|
|||||||
workarea.append(svgcanvas);
|
workarea.append(svgcanvas);
|
||||||
const toolsLeft = document.createElement('div');
|
const toolsLeft = document.createElement('div');
|
||||||
toolsLeft.id = 'tools_left';
|
toolsLeft.id = 'tools_left';
|
||||||
|
|
||||||
svgEditor.append(workarea, toolsLeft);
|
svgEditor.append(workarea, toolsLeft);
|
||||||
document.body.append(svgEditor);
|
document.body.append(svgEditor);
|
||||||
|
|
||||||
|
|||||||
@@ -23,9 +23,3 @@
|
|||||||
command = "echo 'branch release-v5.1.0 already built'"
|
command = "echo 'branch release-v5.1.0 already built'"
|
||||||
|
|
||||||
|
|
||||||
# Production context: all deploys from the Production branch set in your site's
|
|
||||||
# deploy contexts will inherit these settings.
|
|
||||||
[context."V7-preview"]
|
|
||||||
publish = "/"
|
|
||||||
command = "npm run build"
|
|
||||||
|
|
||||||
|
|||||||
44
package-lock.json
generated
44
package-lock.json
generated
@@ -4253,6 +4253,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"anymatch": "~3.1.1",
|
"anymatch": "~3.1.1",
|
||||||
"braces": "~3.0.2",
|
"braces": "~3.0.2",
|
||||||
|
"fsevents": "~2.3.1",
|
||||||
"glob-parent": "~5.1.0",
|
"glob-parent": "~5.1.0",
|
||||||
"is-binary-path": "~2.1.0",
|
"is-binary-path": "~2.1.0",
|
||||||
"is-glob": "~4.0.1",
|
"is-glob": "~4.0.1",
|
||||||
@@ -7350,6 +7351,7 @@
|
|||||||
"anymatch": "^2.0.0",
|
"anymatch": "^2.0.0",
|
||||||
"async-each": "^1.0.1",
|
"async-each": "^1.0.1",
|
||||||
"braces": "^2.3.2",
|
"braces": "^2.3.2",
|
||||||
|
"fsevents": "^1.2.7",
|
||||||
"glob-parent": "^3.1.0",
|
"glob-parent": "^3.1.0",
|
||||||
"inherits": "^2.0.3",
|
"inherits": "^2.0.3",
|
||||||
"is-binary-path": "^1.0.0",
|
"is-binary-path": "^1.0.0",
|
||||||
@@ -9942,7 +9944,8 @@
|
|||||||
"esprima": "^4.0.1",
|
"esprima": "^4.0.1",
|
||||||
"estraverse": "^4.2.0",
|
"estraverse": "^4.2.0",
|
||||||
"esutils": "^2.0.2",
|
"esutils": "^2.0.2",
|
||||||
"optionator": "^0.8.1"
|
"optionator": "^0.8.1",
|
||||||
|
"source-map": "~0.6.1"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"escodegen": "bin/escodegen.js",
|
"escodegen": "bin/escodegen.js",
|
||||||
@@ -14726,7 +14729,8 @@
|
|||||||
"canvg": "^3.0.6",
|
"canvg": "^3.0.6",
|
||||||
"core-js": "^3.6.0",
|
"core-js": "^3.6.0",
|
||||||
"dompurify": "^2.2.0",
|
"dompurify": "^2.2.0",
|
||||||
"fflate": "^0.4.8"
|
"fflate": "^0.4.8",
|
||||||
|
"html2canvas": "^1.0.0-rc.5"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"html2canvas": "^1.0.0-rc.5"
|
"html2canvas": "^1.0.0-rc.5"
|
||||||
@@ -16285,6 +16289,7 @@
|
|||||||
"integrity": "sha512-akCrLDWfbdAWkMLBxJEeWTdNsjML+dt5YgOI4gJ53vuO0vrmYQkUPxa6j6V65s9CcePIr2SSWqjT2EcrNseryQ==",
|
"integrity": "sha512-akCrLDWfbdAWkMLBxJEeWTdNsjML+dt5YgOI4gJ53vuO0vrmYQkUPxa6j6V65s9CcePIr2SSWqjT2EcrNseryQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"encoding": "^0.1.12",
|
||||||
"minipass": "^3.1.0",
|
"minipass": "^3.1.0",
|
||||||
"minipass-sized": "^1.0.3",
|
"minipass-sized": "^1.0.3",
|
||||||
"minizlib": "^2.0.0"
|
"minizlib": "^2.0.0"
|
||||||
@@ -16526,6 +16531,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"anymatch": "~3.1.1",
|
"anymatch": "~3.1.1",
|
||||||
"braces": "~3.0.2",
|
"braces": "~3.0.2",
|
||||||
|
"fsevents": "~2.3.1",
|
||||||
"glob-parent": "~5.1.0",
|
"glob-parent": "~5.1.0",
|
||||||
"is-binary-path": "~2.1.0",
|
"is-binary-path": "~2.1.0",
|
||||||
"is-glob": "~4.0.1",
|
"is-glob": "~4.0.1",
|
||||||
@@ -20278,6 +20284,9 @@
|
|||||||
"version": "2.47.0",
|
"version": "2.47.0",
|
||||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.47.0.tgz",
|
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.47.0.tgz",
|
||||||
"integrity": "sha512-rqBjgq9hQfW0vRmz+0S062ORRNJXvwRpzxhFXORvar/maZqY6za3rgQ/p1Glg+j1hnc1GtYyQCPiAei95uTElg==",
|
"integrity": "sha512-rqBjgq9hQfW0vRmz+0S062ORRNJXvwRpzxhFXORvar/maZqY6za3rgQ/p1Glg+j1hnc1GtYyQCPiAei95uTElg==",
|
||||||
|
"dependencies": {
|
||||||
|
"fsevents": "~2.3.1"
|
||||||
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"rollup": "dist/bin/rollup"
|
"rollup": "dist/bin/rollup"
|
||||||
},
|
},
|
||||||
@@ -22853,6 +22862,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"anymatch": "~3.1.1",
|
"anymatch": "~3.1.1",
|
||||||
"braces": "~3.0.2",
|
"braces": "~3.0.2",
|
||||||
|
"fsevents": "~2.1.2",
|
||||||
"glob-parent": "~5.1.0",
|
"glob-parent": "~5.1.0",
|
||||||
"is-binary-path": "~2.1.0",
|
"is-binary-path": "~2.1.0",
|
||||||
"is-glob": "~4.0.1",
|
"is-glob": "~4.0.1",
|
||||||
@@ -31575,12 +31585,6 @@
|
|||||||
"camelcase": "^5.0.0",
|
"camelcase": "^5.0.0",
|
||||||
"decamelize": "^1.2.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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -32410,7 +32414,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz",
|
||||||
"integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==",
|
"integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"bn.js": "^4.1.0",
|
"bn.js": "^4.1.0",
|
||||||
"miller-rabin": "^4.0.0",
|
"miller-rabin": "^4.0.0",
|
||||||
@@ -33076,23 +33079,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"esquery": {
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"estraverse": {
|
|
||||||
"version": "5.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
|
|
||||||
"integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
|
|
||||||
"dev": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"esrecurse": {
|
"esrecurse": {
|
||||||
"version": "4.3.0",
|
"version": "4.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
|
||||||
@@ -33830,12 +33816,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"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
|
|
||||||
},
|
|
||||||
"find-up": {
|
"find-up": {
|
||||||
"version": "4.1.0",
|
"version": "4.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ class Editor extends EditorStartup {
|
|||||||
* @type {"ignore"|"waiting"|"closed"}
|
* @type {"ignore"|"waiting"|"closed"}
|
||||||
*/
|
*/
|
||||||
this.storagePromptState = 'ignore';
|
this.storagePromptState = 'ignore';
|
||||||
|
|
||||||
this.svgCanvas = null;
|
this.svgCanvas = null;
|
||||||
this.isReady = false;
|
this.isReady = false;
|
||||||
this.customExportImage = false;
|
this.customExportImage = false;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
|
|
||||||
|
|
||||||
const template = document.createElement('template');
|
const template = document.createElement('template');
|
||||||
template.innerHTML = `
|
template.innerHTML = `
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -228,6 +228,7 @@ export default {
|
|||||||
openSvgForm.method = 'post';
|
openSvgForm.method = 'post';
|
||||||
openSvgForm.target = 'output_frame';
|
openSvgForm.target = 'output_frame';
|
||||||
|
|
||||||
|
|
||||||
// Create import form
|
// Create import form
|
||||||
const importSvgForm = openSvgForm.cloneNode(true);
|
const importSvgForm = openSvgForm.cloneNode(true);
|
||||||
importSvgForm.action = importSvgAction;
|
importSvgForm.action = importSvgAction;
|
||||||
|
|||||||
Reference in New Issue
Block a user