-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 升级 rollup 以及相关 plugins 版本,用于解决 build:umd 时 souceMap 失败的问题 - 增加 visualizer 包用于分析打包产物 - 修复 model 中 width/height/radius 等 properties 传 0 无效的 bug - docs 中 global.ts 中依赖加载通过 import 引入,之前通过 require 引入会导致 tree-shaking 失效
- Loading branch information
1 parent
8cd2e37
commit 1c5d956
Showing
11 changed files
with
1,552 additions
and
689 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ lib | |
es | ||
dist | ||
output | ||
stats.html | ||
|
||
coverage | ||
types/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,51 @@ | ||
/** | ||
* 挂载到全局 | ||
*/ | ||
const asyncImport = async () => { | ||
const LogicFlow = await import('@logicflow/core'); | ||
const Extension = await import('@logicflow/extension'); | ||
const ReactNodeRegistry = await import('@logicflow/react-node-registry'); | ||
|
||
(window as any).react = await import('react'); | ||
(window as any).reactDom = await import('react-dom'); | ||
(window as any).createRoot = await import('react-dom/client').then( | ||
(m) => m.createRoot, | ||
); | ||
|
||
(window as any).insertCSS = await import('insert-css'); | ||
(window as any).antd = await import('antd'); | ||
(window as any).DownOutlined = await import('@ant-design/icons').then( | ||
(m) => m.DownOutlined, | ||
); | ||
|
||
(window as any).LogicFlow = LogicFlow.default; | ||
(window as any).Extension = Extension; | ||
|
||
(window as any).BaseNode = LogicFlow.BaseNode; | ||
(window as any).BaseNodeModel = LogicFlow.BaseNodeModel; | ||
(window as any).CircleNodeModel = LogicFlow.CircleNodeModel; | ||
(window as any).CircleNode = LogicFlow.CircleNode; | ||
(window as any).h = LogicFlow.h; | ||
(window as any).RectNode = LogicFlow.RectNode; | ||
(window as any).RectNodeModel = LogicFlow.RectNodeModel; | ||
(window as any).PolygonNode = LogicFlow.PolygonNode; | ||
(window as any).PolygonNodeModel = LogicFlow.PolygonNodeModel; | ||
(window as any).HtmlNode = LogicFlow.HtmlNode; | ||
(window as any).EllipseNode = LogicFlow.EllipseNode; | ||
(window as any).EllipseNodeModel = LogicFlow.EllipseNodeModel; | ||
(window as any).HtmlNodeModel = LogicFlow.HtmlNodeModel; | ||
(window as any).PolylineEdge = LogicFlow.PolylineEdge; | ||
(window as any).PolylineEdgeModel = LogicFlow.PolylineEdgeModel; | ||
(window as any).BezierEdgeModel = LogicFlow.BezierEdgeModel; | ||
(window as any).BezierEdge = LogicFlow.BezierEdge; | ||
(window as any).GraphModel = LogicFlow.GraphModel; | ||
|
||
(window as any).CurvedEdge = Extension.CurvedEdge; | ||
(window as any).CurvedEdgeModel = Extension.CurvedEdgeModel; | ||
(window as any).register = ReactNodeRegistry.register; | ||
(window as any).Portal = ReactNodeRegistry.Portal; | ||
}; | ||
|
||
if (window) { | ||
(window as any).react = require('react'); | ||
(window as any).reactDom = require('react-dom'); | ||
(window as any).createRoot = require('react-dom/client').createRoot; | ||
(window as any).antd = require('antd'); | ||
(window as any).insertCSS = require('insert-css'); | ||
(window as any).LogicFlow = require('@logicflow/core').default; | ||
(window as any).Extension = require('@logicflow/extension'); | ||
(window as any).BaseNode = require('@logicflow/core').BaseNode; | ||
(window as any).BaseNodeModel = require('@logicflow/core').BaseNodeModel; | ||
(window as any).CircleNodeModel = require('@logicflow/core').CircleNodeModel; | ||
(window as any).CircleNode = require('@logicflow/core').CircleNode; | ||
(window as any).h = require('@logicflow/core').h; | ||
(window as any).RectNode = require('@logicflow/core').RectNode; | ||
(window as any).RectNodeModel = require('@logicflow/core').RectNodeModel; | ||
(window as any).PolygonNode = require('@logicflow/core').PolygonNode; | ||
(window as any).PolygonNodeModel = | ||
require('@logicflow/core').PolygonNodeModel; | ||
(window as any).HtmlNode = require('@logicflow/core').HtmlNode; | ||
(window as any).EllipseNode = require('@logicflow/core').EllipseNode; | ||
(window as any).EllipseNodeModel = | ||
require('@logicflow/core').EllipseNodeModel; | ||
(window as any).HtmlNodeModel = require('@logicflow/core').HtmlNodeModel; | ||
(window as any).PolylineEdge = require('@logicflow/core').PolylineEdge; | ||
(window as any).PolylineEdgeModel = | ||
require('@logicflow/core').PolylineEdgeModel; | ||
(window as any).BezierEdgeModel = require('@logicflow/core').BezierEdgeModel; | ||
(window as any).BezierEdge = require('@logicflow/core').BezierEdge; | ||
(window as any).GraphModel = require('@logicflow/core').GraphModel; | ||
(window as any).DownOutlined = require('@ant-design/icons').DownOutlined; | ||
(window as any).CurvedEdge = require('@logicflow/extension').CurvedEdge; | ||
(window as any).CurvedEdgeModel = | ||
require('@logicflow/extension').CurvedEdgeModel; | ||
(window as any).register = require('@logicflow/react-node-registry').register; | ||
(window as any).Portal = require('@logicflow/react-node-registry').Portal; | ||
asyncImport(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters