move files to adequate folders and fix imports
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 500 B After Width: | Height: | Size: 500 B |
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
@ -6644,15 +6644,6 @@
|
|||
"sha.js": "^2.4.8"
|
||||
}
|
||||
},
|
||||
"cross-env": {
|
||||
"version": "7.0.2",
|
||||
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.2.tgz",
|
||||
"integrity": "sha512-KZP/bMEOJEDCkDQAyRhu3RL2ZO/SUVrxQVI0G3YEQ+OLbRA3c6zgixe8Mq8a/z7+HKlNEjo8oiLUs8iRijY2Rw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"cross-spawn": "^7.0.1"
|
||||
}
|
||||
},
|
||||
"cross-spawn": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||
|
|
18
package.json
|
@ -121,23 +121,7 @@
|
|||
},
|
||||
"homepage": "https://github.com/SVG-Edit/svgedit#readme",
|
||||
"browserslist": [
|
||||
"cover 100%",
|
||||
"last 3 Chrome versions",
|
||||
"last 3 Firefox versions",
|
||||
"last 3 Edge versions",
|
||||
"last 3 Safari versions",
|
||||
"last 3 ios_saf versions",
|
||||
"last 3 Android versions",
|
||||
"last 3 Opera versions",
|
||||
"last 3 IE versions",
|
||||
"last 3 op_mini versions",
|
||||
"last 3 bb versions",
|
||||
"last 3 op_mob versions",
|
||||
"last 3 and_chr versions",
|
||||
"last 3 and_ff versions",
|
||||
"last 3 ie_mob versions",
|
||||
"last 3 and_uc versions",
|
||||
"last 3 Samsung versions"
|
||||
"> 2%"
|
||||
],
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable node/no-unsupported-features/node-builtins */
|
||||
/* globals jQuery */
|
||||
/**
|
||||
* Miscellaneous utilities.
|
||||
|
@ -12,7 +13,6 @@ import jQueryPluginSVG from './jQuery.attr.js'; // Needed for SVG attribute sett
|
|||
import {NS} from './namespaces.js';
|
||||
import {getTransformList} from './svgtransformlist.js';
|
||||
import {setUnitAttr, getTypeMap} from './units.js';
|
||||
import {convertPath} from './path.js';
|
||||
import {
|
||||
hasMatrixTransform, transformListToTransform, transformBox
|
||||
} from './math.js';
|
||||
|
@ -1331,57 +1331,6 @@ export const preventClickDefault = function (img) {
|
|||
* @callback module:utilities.GetNextID
|
||||
* @returns {string} The ID
|
||||
*/
|
||||
/**
|
||||
* Create a clone of an element, updating its ID and its children's IDs when needed.
|
||||
* @function module:utilities.copyElem
|
||||
* @param {Element} el - DOM element to clone
|
||||
* @param {module:utilities.GetNextID} getNextId - The getter of the next unique ID.
|
||||
* @returns {Element} The cloned element
|
||||
*/
|
||||
export const copyElem = function (el, getNextId) {
|
||||
// manually create a copy of the element
|
||||
const newEl = document.createElementNS(el.namespaceURI, el.nodeName);
|
||||
$.each(el.attributes, function (i, attr) {
|
||||
if (attr.localName !== '-moz-math-font-style') {
|
||||
newEl.setAttributeNS(attr.namespaceURI, attr.nodeName, attr.value);
|
||||
}
|
||||
});
|
||||
// set the copied element's new id
|
||||
newEl.removeAttribute('id');
|
||||
newEl.id = getNextId();
|
||||
|
||||
// Opera's "d" value needs to be reset for Opera/Win/non-EN
|
||||
// Also needed for webkit (else does not keep curved segments on clone)
|
||||
if (isWebkit() && el.nodeName === 'path') {
|
||||
const fixedD = convertPath(el);
|
||||
newEl.setAttribute('d', fixedD);
|
||||
}
|
||||
|
||||
// now create copies of all children
|
||||
$.each(el.childNodes, function (i, child) {
|
||||
switch (child.nodeType) {
|
||||
case 1: // element node
|
||||
newEl.append(copyElem(child, getNextId));
|
||||
break;
|
||||
case 3: // text node
|
||||
newEl.textContent = child.nodeValue;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
if ($(el).data('gsvg')) {
|
||||
$(newEl).data('gsvg', newEl.firstChild);
|
||||
} else if ($(el).data('symbol')) {
|
||||
const ref = $(el).data('symbol');
|
||||
$(newEl).data('ref', ref).data('symbol', ref);
|
||||
} else if (newEl.tagName === 'image') {
|
||||
preventClickDefault(newEl);
|
||||
}
|
||||
|
||||
return newEl;
|
||||
};
|
||||
|
||||
/**
|
||||
* Whether a value is `null` or `undefined`.
|
|
@ -16,7 +16,7 @@
|
|||
* and the MIT License and is copyright A Beautiful Site, LLC.
|
||||
*
|
||||
*/
|
||||
import {isMac} from '../browser.js';
|
||||
import {isMac} from '../../common/browser.js';
|
||||
|
||||
/**
|
||||
* @callback module:jQueryContextMenu.jQueryContextMenuListener
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 789 B After Width: | Height: | Size: 789 B |