update packages and remove circular dependancies

development
Dave Morrissey 2021-11-27 17:17:08 +11:00
parent 74b67a60a4
commit c9753a2691
13 changed files with 84646 additions and 29198 deletions

1
.gitignore vendored
View File

@ -4,6 +4,7 @@ javascript/dist
javascript/examples/**/dist javascript/examples/**/dist
.idea/ .idea/
dist dist
package-lock.json
# dependencies # dependencies
/node_modules /node_modules

12956
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -22,22 +22,22 @@
"postinstall": "lerna bootstrap" "postinstall": "lerna bootstrap"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.13.15", "@babel/core": "^7.16.0",
"@babel/plugin-proposal-class-properties": "^7.13.0", "@babel/plugin-proposal-class-properties": "^7.16.0",
"@babel/preset-env": "^7.13.15", "@babel/preset-env": "^7.16.4",
"@babel/preset-react": "^7.13.13", "@babel/preset-react": "^7.16.0",
"@babel/preset-typescript": "^7.13.0", "@babel/preset-typescript": "^7.16.0",
"@lerna/filter-options": "4.0.0", "@lerna/filter-options": "^4.0.0",
"babel-loader": "^8.2.2", "babel-loader": "^8.2.3",
"css-loader": "^5.2.1", "css-loader": "^6.5.1",
"file-loader": "^6.2.0", "file-loader": "^6.2.0",
"lerna": "^4.0.0", "lerna": "^4.0.0",
"prettier": "^2.2.1", "prettier": "^2.5.0",
"style-loader": "^2.0.0", "style-loader": "^3.3.1",
"typescript": "^4.2.4", "typescript": "^4.5.2",
"url-loader": "^4.1.1", "url-loader": "^4.1.1",
"webpack": "^5.32.0", "webpack": "^5.64.4",
"webpack-cli": "^4.6.0", "webpack-cli": "^4.9.1",
"webpack-merge": "^5.7.3" "webpack-merge": "^5.8.0"
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,6 @@
*/ */
import { getFunctionName } from './StringUtils'; import { getFunctionName } from './StringUtils';
import { isNullish } from './Utils';
const FIELD_NAME = 'mxObjectId'; const FIELD_NAME = 'mxObjectId';
@ -46,7 +45,7 @@ class ObjectIdentity {
*/ */
static get(obj: IdentityObject | IdentityFunction | null) { static get(obj: IdentityObject | IdentityFunction | null) {
if (obj) { if (obj) {
if (isNullish(obj[FIELD_NAME])) { if (obj[FIELD_NAME] === null || obj[FIELD_NAME] === undefined) {
if (typeof obj === 'object') { if (typeof obj === 'object') {
const ctor = getFunctionName(obj.constructor); const ctor = getFunctionName(obj.constructor);
obj[FIELD_NAME] = `${ctor}#${ObjectIdentity.counter++}`; obj[FIELD_NAME] = `${ctor}#${ObjectIdentity.counter++}`;

View File

@ -21,48 +21,6 @@ export const createXmlDocument = () => {
return doc; 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 * Function: getViewXml
*/ */

View File

@ -33,7 +33,7 @@ import {
} from '../Constants'; } from '../Constants';
import Rectangle from '../../view/geometry/Rectangle'; import Rectangle from '../../view/geometry/Rectangle';
import AbstractCanvas2D from './AbstractCanvas2D'; import AbstractCanvas2D from './AbstractCanvas2D';
import { getXml, parseXml } from '../XmlUtils'; import { getXml } from '../XmlUtils';
import { importNodeImplementation, isNode, write } from '../DomUtils'; import { importNodeImplementation, isNode, write } from '../DomUtils';
import { htmlEntities, trim } from '../StringUtils'; import { htmlEntities, trim } from '../StringUtils';
import { import {
@ -1184,7 +1184,7 @@ class SvgCanvas2D extends AbstractCanvas2D {
val = `<div xmlns="http://www.w3.org/1999/xhtml">${val}</div>`; val = `<div xmlns="http://www.w3.org/1999/xhtml">${val}</div>`;
// NOTE: FF 3.6 crashes if content CSS contains "height:100%" // NOTE: FF 3.6 crashes if content CSS contains "height:100%"
return parseXml(val).documentElement; return new DOMParser().parseFromString(val, 'text/xml').documentElement;
} }
/** /**

View File

@ -3,7 +3,6 @@
* Copyright (c) 2006-2020, draw.io AG * Copyright (c) 2006-2020, draw.io AG
*/ */
import { write } from '../DomUtils'; import { write } from '../DomUtils';
import { parseXml } from '../XmlUtils';
/** /**
* XML HTTP request wrapper. See also: {@link mxUtils.get}, {@link mxUtils.post} and * 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 // document. This happens in IE9 standards mode and with XML user
// objects only, as they are used directly as values in cells. // objects only, as they are used directly as values in cells.
if (xml == null || xml.documentElement == null) { if (xml == null || xml.documentElement == null) {
xml = parseXml(this.request.responseText); xml = new DOMParser().parseFromString(this.request.responseText, 'text/xml');
} }
return xml; return xml;

View File

@ -12,19 +12,9 @@ import Cell from '../../view/cell/datatypes/Cell';
import mxLog from '../gui/mxLog'; import mxLog from '../gui/mxLog';
import { getFunctionName } from '../StringUtils'; import { getFunctionName } from '../StringUtils';
import { importNode, isNode } from '../DomUtils'; import { importNode, isNode } from '../DomUtils';
import { createMsXmlDocument } from '../XmlUtils';
const createXmlDocument = () => { const createXmlDocument = () => {
// Put here from '../util/mxXmlUtils' to eliminate circular dependency return document.implementation.createDocument('', '', null);
let doc = null;
if (document.implementation && document.implementation.createDocument) {
doc = document.implementation.createDocument('', '', null);
} else if ('ActiveXObject' in window) {
doc = createMsXmlDocument();
}
return doc;
}; };
/** /**

File diff suppressed because it is too large Load Diff

View File

@ -12,16 +12,16 @@
"@maxgraph/core": "*" "@maxgraph/core": "*"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.13.15", "@babel/core": "^7.16.0",
"@storybook/addon-actions": "^6.2.7", "@storybook/addon-actions": "^6.4.0",
"@storybook/addon-essentials": "^6.2.7", "@storybook/addon-essentials": "^6.4.0",
"@storybook/addon-links": "^6.2.7", "@storybook/addon-links": "^6.4.0",
"@storybook/html": "^6.2.7", "@storybook/html": "^6.4.0",
"babel-loader": "^8.2.2", "babel-loader": "^8.2.3",
"html-webpack-plugin": "^5.3.1", "html-webpack-plugin": "^5.5.0",
"typescript": "^4.2.4", "typescript": "^4.5.2",
"webpack": "^5.31.2", "webpack": "^5.64.4",
"webpack-cli": "^4.6.0", "webpack-cli": "^4.9.1",
"webpack-merge": "^5.7.3" "webpack-merge": "^5.8.0"
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -13,11 +13,11 @@
"react-dom": "^17.0.2" "react-dom": "^17.0.2"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.13.15", "@babel/core": "^7.16.0",
"@storybook/addon-actions": "^6.2.7", "@storybook/addon-actions": "^6.4.0",
"@storybook/addon-essentials": "^6.2.7", "@storybook/addon-essentials": "^6.4.0",
"@storybook/addon-links": "^6.2.7", "@storybook/addon-links": "^6.4.0",
"@storybook/react": "^6.2.7", "@storybook/react": "^6.4.0",
"babel-loader": "^8.2.2" "babel-loader": "^8.2.3"
} }
} }