mirror of
https://github.com/projectstorm/react-diagrams.git
synced 2026-03-13 09:50:09 +08:00
project updates
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,3 +6,4 @@ dist
|
||||
.env
|
||||
node_modules
|
||||
yarn-error.log
|
||||
tsconfig.tsbuildinfo
|
||||
|
||||
89
package.json
89
package.json
@@ -21,81 +21,80 @@
|
||||
"nodes"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "yarn build:clean && lerna run build --stream",
|
||||
"build:es": "lerna run build:es --stream",
|
||||
"build:prod": "yarn build:clean && lerna run build:prod --stream",
|
||||
"clean": "tsc --build --clean && lerna run clean --stream",
|
||||
"build": "tsc --build && lerna run build --stream",
|
||||
"build:prod": "yarn build:clean && tsc --build && lerna run build:prod --stream",
|
||||
"watch": "yarn build:clean && lerna run watch --stream",
|
||||
"publish:dev": "yarn build:prod && lerna publish --force-publish --dist-tag=next",
|
||||
"publish:prod": "yarn build:prod && lerna publish --force-publish",
|
||||
"publish:storybook": "cd packages/diagrams-demo-gallery && yarn storybook:build && ../../node_modules/.bin/storybook-to-ghpages --existing-output-dir .out",
|
||||
"build:clean": "lerna run clean --stream",
|
||||
"test:ci": "lerna run test --stream -- --runInBand --ci ",
|
||||
"pretty": "prettier --write \"packages/**/*.{ts,tsx,scss,js,jsx}\""
|
||||
},
|
||||
"peerDependencies": {
|
||||
"closest": "^0.0.1",
|
||||
"emotion": "10.*",
|
||||
"emotion": "11.*",
|
||||
"lodash": "4.*",
|
||||
"pathfinding": "^0.4.18",
|
||||
"paths-js": "^0.4.11",
|
||||
"react": "16.*"
|
||||
"react": "17.*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.11.6",
|
||||
"@babel/preset-react": "^7.10.4",
|
||||
"@emotion/core": "^10.0.35",
|
||||
"@emotion/styled": "^10.0.27",
|
||||
"@storybook/addon-actions": "^6.0.21",
|
||||
"@babel/core": "^7.13.10",
|
||||
"@babel/preset-react": "^7.12.13",
|
||||
"@emotion/react": "^11.1.5",
|
||||
"@emotion/styled": "^11.1.5",
|
||||
"@storybook/addon-actions": "^6.1.21",
|
||||
"@storybook/addon-options": "^5.3.21",
|
||||
"@storybook/addons": "^6.0.21",
|
||||
"@storybook/react": "^6.0.21",
|
||||
"@storybook/storybook-deployer": "^2.8.6",
|
||||
"@storybook/theming": "^6.0.21",
|
||||
"@storybook/addons": "^6.1.21",
|
||||
"@storybook/react": "^6.1.21",
|
||||
"@storybook/storybook-deployer": "^2.8.7",
|
||||
"@storybook/theming": "^6.1.21",
|
||||
"@types/dagre": "^0.7.44",
|
||||
"@types/jest": "^26.0.14",
|
||||
"@types/jest-environment-puppeteer": "^4.3.2",
|
||||
"@types/lodash": "^4.14.161",
|
||||
"@types/node": "^14.11.2",
|
||||
"@types/jest": "^26.0.20",
|
||||
"@types/jest-environment-puppeteer": "^4.4.1",
|
||||
"@types/lodash": "^4.14.168",
|
||||
"@types/node": "^14.14.34",
|
||||
"@types/promise": "^7.1.30",
|
||||
"@types/puppeteer": "^3.0.2",
|
||||
"@types/react": "^16.9.49",
|
||||
"babel-loader": "^8.1.0",
|
||||
"@types/puppeteer": "^5.4.3",
|
||||
"@types/react": "^17.0.3",
|
||||
"babel-loader": "^8.2.2",
|
||||
"closest": "^0.0.1",
|
||||
"cross-env": "^7.0.2",
|
||||
"css-loader": "^4.3.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"css-loader": "^5.1.2",
|
||||
"dagre": "^0.8.5",
|
||||
"enzyme": "^3.11.0",
|
||||
"file-loader": "^6.1.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"glob": "^7.1.6",
|
||||
"jest": "^26.4.2",
|
||||
"jest-cli": "^26.4.2",
|
||||
"jest": "^26.6.3",
|
||||
"jest-cli": "^26.6.3",
|
||||
"jest-puppeteer": "^4.4.0",
|
||||
"json-beautify": "^1.1.1",
|
||||
"lerna": "^3.22.1",
|
||||
"lerna": "^4.0.0",
|
||||
"lodash": "4.*",
|
||||
"pathfinding": "^0.4.18",
|
||||
"paths-js": "^0.4.11",
|
||||
"prettier": "^2.1.2",
|
||||
"puppeteer": "^5.3.1",
|
||||
"prettier": "^2.2.1",
|
||||
"puppeteer": "^8.0.0",
|
||||
"raf": "^3.4.1",
|
||||
"raw-loader": "^4.0.1",
|
||||
"raw-loader": "^4.0.2",
|
||||
"react": "^16.8.6",
|
||||
"react-dom": "^16.13.1",
|
||||
"react-test-renderer": "^16.13.1",
|
||||
"react-dom": "^17.0.1",
|
||||
"react-test-renderer": "^17.0.1",
|
||||
"resize-observer-polyfill": "^1.5.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"source-map-loader": "^1.1.0",
|
||||
"storybook-host": "^5.1.0",
|
||||
"storybook-readme": "^5.0.8",
|
||||
"style-loader": "^1.2.1",
|
||||
"terser-webpack-plugin": "^4.2.2",
|
||||
"ts-jest": "^26.4.0",
|
||||
"ts-loader": "^8.0.4",
|
||||
"typescript": "^4.0.3",
|
||||
"val-loader": "^2.1.1",
|
||||
"webpack": "^4.44.2",
|
||||
"webpack-cli": "^3.3.12",
|
||||
"webpack-dev-server": "^3.11.0",
|
||||
"source-map-loader": "^2.0.1",
|
||||
"storybook-host": "^5.2.0",
|
||||
"storybook-readme": "^5.0.9",
|
||||
"style-loader": "^2.0.0",
|
||||
"terser-webpack-plugin": "^5.1.1",
|
||||
"ts-jest": "^26.5.3",
|
||||
"ts-loader": "^8.0.18",
|
||||
"typescript": "^4.2.3",
|
||||
"val-loader": "^3.1.0",
|
||||
"webpack": "^5.25.0",
|
||||
"webpack-cli": "^4.5.0",
|
||||
"webpack-dev-server": "^3.11.2",
|
||||
"webpack-node-externals": "^2.5.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig",
|
||||
"extends": "../../tsconfig.base",
|
||||
"include": [
|
||||
"./demos"
|
||||
]
|
||||
|
||||
@@ -9,9 +9,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./dist",
|
||||
"build": "../../node_modules/.bin/webpack",
|
||||
"build:es": "../../node_modules/.bin/tsc",
|
||||
"build:prod": "NODE_ENV=production ../../node_modules/.bin/webpack && NODE_ENV=production ../../node_modules/.bin/tsc"
|
||||
"build": "../../node_modules/.bin/webpack"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
@@ -27,8 +25,8 @@
|
||||
"links",
|
||||
"nodes"
|
||||
],
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/es/index.js",
|
||||
"main": "./dist/index.umd.js",
|
||||
"module": "./dist/index.js",
|
||||
"typings": "./dist/@types/index",
|
||||
"gitHead": "bb878657ba0c2f81764f32901fd96158a0f8352e"
|
||||
}
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
{
|
||||
"extends": "../../tsconfig",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"outDir": "dist/es/",
|
||||
"outDir": "dist",
|
||||
"rootDir": "src",
|
||||
"declarationDir": "dist/@types"
|
||||
},
|
||||
"include": [
|
||||
"./src"
|
||||
],
|
||||
"exclude": [
|
||||
"./dist"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
"links",
|
||||
"nodes"
|
||||
],
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/es/index.js",
|
||||
"main": "./dist/index.umd.js",
|
||||
"module": "./dist/index.js",
|
||||
"typings": "./dist/@types/index",
|
||||
"dependencies": {
|
||||
"@projectstorm/geometry": "^6.3.0"
|
||||
|
||||
@@ -148,7 +148,7 @@ export class CanvasEngine<
|
||||
}
|
||||
|
||||
if (promise) {
|
||||
return new Promise((resolve) => {
|
||||
return new Promise<void>((resolve) => {
|
||||
const l = this.registerListener({
|
||||
rendered: () => {
|
||||
resolve();
|
||||
|
||||
@@ -16,7 +16,8 @@ export interface BasePositionModelGenerics extends BaseModelGenerics {
|
||||
OPTIONS: BasePositionModelOptions;
|
||||
}
|
||||
|
||||
export class BasePositionModel<G extends BasePositionModelGenerics = BasePositionModelGenerics> extends BaseModel<G>
|
||||
export class BasePositionModel<G extends BasePositionModelGenerics = BasePositionModelGenerics>
|
||||
extends BaseModel<G>
|
||||
implements ModelGeometryInterface {
|
||||
protected position: Point;
|
||||
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
{
|
||||
"extends": "../../tsconfig",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"outDir": "dist/es/",
|
||||
"outDir": "dist",
|
||||
"rootDir": "src",
|
||||
"declarationDir": "dist/@types"
|
||||
},
|
||||
"include": [
|
||||
"./src"
|
||||
],
|
||||
"exclude": [
|
||||
"./dist"
|
||||
"references": [
|
||||
{
|
||||
"path": "../geometry"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
"links",
|
||||
"nodes"
|
||||
],
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/es/index.js",
|
||||
"main": "./dist/index.umd.js",
|
||||
"module": "./dist/index.js",
|
||||
"typings": "./dist/@types/index",
|
||||
"dependencies": {
|
||||
"@projectstorm/geometry": "^6.3.0",
|
||||
|
||||
@@ -25,7 +25,8 @@ export interface LinkModelGenerics extends BaseModelGenerics {
|
||||
PARENT: DiagramModel;
|
||||
}
|
||||
|
||||
export class LinkModel<G extends LinkModelGenerics = LinkModelGenerics> extends BaseModel<G>
|
||||
export class LinkModel<G extends LinkModelGenerics = LinkModelGenerics>
|
||||
extends BaseModel<G>
|
||||
implements ModelGeometryInterface {
|
||||
protected sourcePort: PortModel | null;
|
||||
protected targetPort: PortModel | null;
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
{
|
||||
"extends": "../../tsconfig",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"outDir": "dist/es/",
|
||||
"outDir": "dist",
|
||||
"rootDir": "src",
|
||||
"declarationDir": "dist/@types"
|
||||
},
|
||||
"include": [
|
||||
"./src"
|
||||
],
|
||||
"exclude": [
|
||||
"./dist"
|
||||
"references": [
|
||||
{
|
||||
"path": "../react-canvas-core"
|
||||
},
|
||||
{
|
||||
"path": "../geometry"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
"links",
|
||||
"nodes"
|
||||
],
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/es/index.js",
|
||||
"main": "./dist/index.umd.js",
|
||||
"module": "./dist/index.js",
|
||||
"typings": "./dist/@types/index",
|
||||
"dependencies": {
|
||||
"@projectstorm/react-diagrams-core": "^6.3.0"
|
||||
|
||||
@@ -4,7 +4,6 @@ import { DiagramEngine } from '@projectstorm/react-diagrams-core';
|
||||
import { DefaultNodeModel } from './DefaultNodeModel';
|
||||
import { DefaultPortLabel } from '../port/DefaultPortLabelWidget';
|
||||
import styled from '@emotion/styled';
|
||||
import { css } from '@emotion/core';
|
||||
|
||||
namespace S {
|
||||
export const Node = styled.div<{ background: string; selected: boolean }>`
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
{
|
||||
"extends": "../../tsconfig",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"outDir": "dist/es/",
|
||||
"outDir": "dist",
|
||||
"rootDir": "src",
|
||||
"declarationDir": "dist/@types"
|
||||
},
|
||||
"include": [
|
||||
"./src"
|
||||
],
|
||||
"exclude": [
|
||||
"./dist"
|
||||
"references": [
|
||||
{
|
||||
"path": "../react-diagrams-core"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
"links",
|
||||
"nodes"
|
||||
],
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/es/index.js",
|
||||
"main": "./dist/index.umd.js",
|
||||
"module": "./dist/index.js",
|
||||
"typings": "./dist/@types/index",
|
||||
"dependencies": {
|
||||
"@projectstorm/geometry": "^6.3.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import PathFinding from '../src/engine/PathFinding';
|
||||
|
||||
describe('calculating start and end points', function() {
|
||||
describe('calculating start and end points', function () {
|
||||
beforeEach(() => {
|
||||
this.pathFinding = new PathFinding(null);
|
||||
});
|
||||
|
||||
@@ -1,14 +1,22 @@
|
||||
{
|
||||
"extends": "../../tsconfig",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"outDir": "dist/es/",
|
||||
"outDir": "dist",
|
||||
"rootDir": "src",
|
||||
"declarationDir": "dist/@types"
|
||||
},
|
||||
"include": [
|
||||
"./src"
|
||||
],
|
||||
"exclude": [
|
||||
"./dist"
|
||||
"references": [
|
||||
{
|
||||
"path": "../geometry"
|
||||
},
|
||||
{
|
||||
"path": "../react-canvas-core"
|
||||
},
|
||||
{
|
||||
"path": "../react-diagrams-defaults"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
"links",
|
||||
"nodes"
|
||||
],
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/es/index.js",
|
||||
"main": "./dist/index.umd.js",
|
||||
"module": "./dist/index.js",
|
||||
"typings": "./dist/@types/index",
|
||||
"dependencies": {
|
||||
"@projectstorm/react-diagrams-core": "^6.3.0",
|
||||
|
||||
@@ -1,14 +1,22 @@
|
||||
{
|
||||
"extends": "../../tsconfig",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"outDir": "dist/es/",
|
||||
"outDir": "dist",
|
||||
"rootDir": "src",
|
||||
"declarationDir": "dist/@types"
|
||||
},
|
||||
"include": [
|
||||
"src/index.ts"
|
||||
"./src"
|
||||
],
|
||||
"exclude": [
|
||||
"./dist"
|
||||
"references": [
|
||||
{
|
||||
"path": "../react-canvas-core"
|
||||
},
|
||||
{
|
||||
"path": "../react-diagrams-defaults"
|
||||
},
|
||||
{
|
||||
"path": "../react-diagrams-routing"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
20
tsconfig.base.json
Normal file
20
tsconfig.base.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"compileOnSave": false,
|
||||
"compilerOptions": {
|
||||
"suppressExcessPropertyErrors": true,
|
||||
"declaration": true,
|
||||
"composite": true,
|
||||
"incremental": true,
|
||||
"strictNullChecks": false,
|
||||
"sourceMap": true,
|
||||
"skipLibCheck": true,
|
||||
"jsx": "react",
|
||||
"target": "ES6",
|
||||
"module": "commonjs",
|
||||
"strict": false,
|
||||
"lib": [
|
||||
"DOM",
|
||||
"ES6"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,26 +1,23 @@
|
||||
{
|
||||
"compileOnSave": false,
|
||||
"compilerOptions": {
|
||||
"suppressExcessPropertyErrors": true,
|
||||
"declaration": false,
|
||||
"strictNullChecks": false,
|
||||
"sourceMap": true,
|
||||
"skipLibCheck": true,
|
||||
"jsx": "react",
|
||||
"target": "ES6",
|
||||
"module": "commonjs",
|
||||
"strict": false,
|
||||
"lib": [
|
||||
"DOM",
|
||||
"ES6"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"./src"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"**/*.spec.ts",
|
||||
"./dist"
|
||||
"files": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./packages/geometry"
|
||||
},
|
||||
{
|
||||
"path": "./packages/react-canvas-core"
|
||||
},
|
||||
{
|
||||
"path": "./packages/react-diagrams"
|
||||
},
|
||||
{
|
||||
"path": "./packages/react-diagrams-core"
|
||||
},
|
||||
{
|
||||
"path": "./packages/react-diagrams-defaults"
|
||||
},
|
||||
{
|
||||
"path": "./packages/react-diagrams-routing"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ module.exports = (directory) => {
|
||||
return {
|
||||
entry: path.join(directory, './src/index.ts'),
|
||||
output: {
|
||||
filename: "index.js",
|
||||
filename: "index.umd.js",
|
||||
path: path.join(directory, 'dist'),
|
||||
libraryTarget: "umd",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user