update packages and remove circular dependancies
parent
74b67a60a4
commit
c9753a2691
|
@ -4,6 +4,7 @@ javascript/dist
|
|||
javascript/examples/**/dist
|
||||
.idea/
|
||||
dist
|
||||
package-lock.json
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
|
|
File diff suppressed because it is too large
Load Diff
28
package.json
28
package.json
|
@ -22,22 +22,22 @@
|
|||
"postinstall": "lerna bootstrap"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.13.15",
|
||||
"@babel/plugin-proposal-class-properties": "^7.13.0",
|
||||
"@babel/preset-env": "^7.13.15",
|
||||
"@babel/preset-react": "^7.13.13",
|
||||
"@babel/preset-typescript": "^7.13.0",
|
||||
"@lerna/filter-options": "4.0.0",
|
||||
"babel-loader": "^8.2.2",
|
||||
"css-loader": "^5.2.1",
|
||||
"@babel/core": "^7.16.0",
|
||||
"@babel/plugin-proposal-class-properties": "^7.16.0",
|
||||
"@babel/preset-env": "^7.16.4",
|
||||
"@babel/preset-react": "^7.16.0",
|
||||
"@babel/preset-typescript": "^7.16.0",
|
||||
"@lerna/filter-options": "^4.0.0",
|
||||
"babel-loader": "^8.2.3",
|
||||
"css-loader": "^6.5.1",
|
||||
"file-loader": "^6.2.0",
|
||||
"lerna": "^4.0.0",
|
||||
"prettier": "^2.2.1",
|
||||
"style-loader": "^2.0.0",
|
||||
"typescript": "^4.2.4",
|
||||
"prettier": "^2.5.0",
|
||||
"style-loader": "^3.3.1",
|
||||
"typescript": "^4.5.2",
|
||||
"url-loader": "^4.1.1",
|
||||
"webpack": "^5.32.0",
|
||||
"webpack-cli": "^4.6.0",
|
||||
"webpack-merge": "^5.7.3"
|
||||
"webpack": "^5.64.4",
|
||||
"webpack-cli": "^4.9.1",
|
||||
"webpack-merge": "^5.8.0"
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -6,7 +6,6 @@
|
|||
*/
|
||||
|
||||
import { getFunctionName } from './StringUtils';
|
||||
import { isNullish } from './Utils';
|
||||
|
||||
const FIELD_NAME = 'mxObjectId';
|
||||
|
||||
|
@ -46,7 +45,7 @@ class ObjectIdentity {
|
|||
*/
|
||||
static get(obj: IdentityObject | IdentityFunction | null) {
|
||||
if (obj) {
|
||||
if (isNullish(obj[FIELD_NAME])) {
|
||||
if (obj[FIELD_NAME] === null || obj[FIELD_NAME] === undefined) {
|
||||
if (typeof obj === 'object') {
|
||||
const ctor = getFunctionName(obj.constructor);
|
||||
obj[FIELD_NAME] = `${ctor}#${ObjectIdentity.counter++}`;
|
||||
|
|
|
@ -21,48 +21,6 @@ export const createXmlDocument = () => {
|
|||
return doc;
|
||||
};
|
||||
|
||||
/**
|
||||
* Function: createMsXmlDocument
|
||||
*
|
||||
* Returns a new, empty Microsoft.XMLDOM document using ActiveXObject.
|
||||
*/
|
||||
export const createMsXmlDocument = () => {
|
||||
const doc = new ActiveXObject('Microsoft.XMLDOM');
|
||||
doc.async = false;
|
||||
|
||||
// Workaround for parsing errors with SVG DTD
|
||||
doc.validateOnParse = false;
|
||||
doc.resolveExternals = false;
|
||||
|
||||
return doc;
|
||||
};
|
||||
|
||||
/**
|
||||
* Function: parseXml
|
||||
*
|
||||
* Parses the specified XML string into a new XML document and returns the
|
||||
* new document.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* (code)
|
||||
* let doc = mxUtils.parseXml(
|
||||
* '<Transactions><root><MyDiagram id="0"><mxCell/></MyDiagram>'+
|
||||
* '<MyLayer id="1"><mxCell parent="0" /></MyLayer><MyObject id="2">'+
|
||||
* '<mxCell style="strokeColor=blue;fillColor=red" parent="1" vertex="1">'+
|
||||
* '<mxGeometry x="10" y="10" width="80" height="30" as="geometry"/>'+
|
||||
* '</mxCell></MyObject></root></Transactions>');
|
||||
* (end)
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* xml - String that contains the XML data.
|
||||
*/
|
||||
export const parseXml = (xml) => {
|
||||
const parser = new DOMParser();
|
||||
return parser.parseFromString(xml, 'text/xml');
|
||||
};
|
||||
|
||||
/**
|
||||
* Function: getViewXml
|
||||
*/
|
||||
|
|
|
@ -33,7 +33,7 @@ import {
|
|||
} from '../Constants';
|
||||
import Rectangle from '../../view/geometry/Rectangle';
|
||||
import AbstractCanvas2D from './AbstractCanvas2D';
|
||||
import { getXml, parseXml } from '../XmlUtils';
|
||||
import { getXml } from '../XmlUtils';
|
||||
import { importNodeImplementation, isNode, write } from '../DomUtils';
|
||||
import { htmlEntities, trim } from '../StringUtils';
|
||||
import {
|
||||
|
@ -1184,7 +1184,7 @@ class SvgCanvas2D extends AbstractCanvas2D {
|
|||
val = `<div xmlns="http://www.w3.org/1999/xhtml">${val}</div>`;
|
||||
|
||||
// NOTE: FF 3.6 crashes if content CSS contains "height:100%"
|
||||
return parseXml(val).documentElement;
|
||||
return new DOMParser().parseFromString(val, 'text/xml').documentElement;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
* Copyright (c) 2006-2020, draw.io AG
|
||||
*/
|
||||
import { write } from '../DomUtils';
|
||||
import { parseXml } from '../XmlUtils';
|
||||
|
||||
/**
|
||||
* XML HTTP request wrapper. See also: {@link mxUtils.get}, {@link mxUtils.post} and
|
||||
|
@ -216,7 +215,7 @@ class mxXmlRequest {
|
|||
// document. This happens in IE9 standards mode and with XML user
|
||||
// objects only, as they are used directly as values in cells.
|
||||
if (xml == null || xml.documentElement == null) {
|
||||
xml = parseXml(this.request.responseText);
|
||||
xml = new DOMParser().parseFromString(this.request.responseText, 'text/xml');
|
||||
}
|
||||
|
||||
return xml;
|
||||
|
|
|
@ -12,19 +12,9 @@ import Cell from '../../view/cell/datatypes/Cell';
|
|||
import mxLog from '../gui/mxLog';
|
||||
import { getFunctionName } from '../StringUtils';
|
||||
import { importNode, isNode } from '../DomUtils';
|
||||
import { createMsXmlDocument } from '../XmlUtils';
|
||||
|
||||
const createXmlDocument = () => {
|
||||
// Put here from '../util/mxXmlUtils' to eliminate circular dependency
|
||||
let doc = null;
|
||||
|
||||
if (document.implementation && document.implementation.createDocument) {
|
||||
doc = document.implementation.createDocument('', '', null);
|
||||
} else if ('ActiveXObject' in window) {
|
||||
doc = createMsXmlDocument();
|
||||
}
|
||||
|
||||
return doc;
|
||||
return document.implementation.createDocument('', '', null);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -12,16 +12,16 @@
|
|||
"@maxgraph/core": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.13.15",
|
||||
"@storybook/addon-actions": "^6.2.7",
|
||||
"@storybook/addon-essentials": "^6.2.7",
|
||||
"@storybook/addon-links": "^6.2.7",
|
||||
"@storybook/html": "^6.2.7",
|
||||
"babel-loader": "^8.2.2",
|
||||
"html-webpack-plugin": "^5.3.1",
|
||||
"typescript": "^4.2.4",
|
||||
"webpack": "^5.31.2",
|
||||
"webpack-cli": "^4.6.0",
|
||||
"webpack-merge": "^5.7.3"
|
||||
"@babel/core": "^7.16.0",
|
||||
"@storybook/addon-actions": "^6.4.0",
|
||||
"@storybook/addon-essentials": "^6.4.0",
|
||||
"@storybook/addon-links": "^6.4.0",
|
||||
"@storybook/html": "^6.4.0",
|
||||
"babel-loader": "^8.2.3",
|
||||
"html-webpack-plugin": "^5.5.0",
|
||||
"typescript": "^4.5.2",
|
||||
"webpack": "^5.64.4",
|
||||
"webpack-cli": "^4.9.1",
|
||||
"webpack-merge": "^5.8.0"
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -13,11 +13,11 @@
|
|||
"react-dom": "^17.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.13.15",
|
||||
"@storybook/addon-actions": "^6.2.7",
|
||||
"@storybook/addon-essentials": "^6.2.7",
|
||||
"@storybook/addon-links": "^6.2.7",
|
||||
"@storybook/react": "^6.2.7",
|
||||
"babel-loader": "^8.2.2"
|
||||
"@babel/core": "^7.16.0",
|
||||
"@storybook/addon-actions": "^6.4.0",
|
||||
"@storybook/addon-essentials": "^6.4.0",
|
||||
"@storybook/addon-links": "^6.4.0",
|
||||
"@storybook/react": "^6.4.0",
|
||||
"babel-loader": "^8.2.3"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue