@logicflow/core 1.2.26 → 2.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build$colon$dev.log +10 -0
- package/.turbo/turbo-build.log +42 -0
- package/CHANGELOG.md +2114 -0
- package/LICENSE +206 -0
- package/__tests__/algorithm/egde.test.ts +118 -0
- package/__tests__/algorithm/index.test.ts +69 -0
- package/__tests__/algorithm/outline.test.ts +43 -0
- package/__tests__/bugs/1545-spec.test.ts +38 -0
- package/__tests__/event/event.test.ts +22 -0
- package/__tests__/history/history.test.ts +28 -0
- package/__tests__/logicflow.test.ts +567 -0
- package/__tests__/model/graphmodel.test.ts +67 -0
- package/__tests__/util/compatible.test.ts +48 -0
- package/__tests__/util/edge.test.ts +224 -0
- package/__tests__/util/geometry.test.ts +14 -0
- package/__tests__/util/graph.test.ts +16 -0
- package/__tests__/util/matrix.test.ts +41 -0
- package/__tests__/util/node.test.ts +68 -0
- package/__tests__/util/sampling.test.ts +16 -0
- package/__tests__/util/vector.test.ts +50 -0
- package/__tests__/util/zIndex.test.ts +10 -0
- package/dist/{style/index.css → index.css} +64 -52
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/es/LogicFlow.d.ts +966 -0
- package/es/LogicFlow.js +1174 -0
- package/es/LogicFlow.js.map +1 -0
- package/es/algorithm/edge.d.ts +15 -0
- package/es/algorithm/edge.js +57 -0
- package/es/algorithm/edge.js.map +1 -0
- package/es/algorithm/index.js +71 -0
- package/es/algorithm/index.js.map +1 -0
- package/es/algorithm/outline.d.ts +7 -0
- package/es/algorithm/outline.js +61 -0
- package/es/algorithm/outline.js.map +1 -0
- package/{types/constant/constant.d.ts → es/constant/index.d.ts} +23 -22
- package/es/constant/index.js +117 -0
- package/es/constant/index.js.map +1 -0
- package/es/event/eventArgs.d.ts +428 -0
- package/es/event/eventArgs.js +2 -0
- package/es/event/eventArgs.js.map +1 -0
- package/es/event/eventEmitter.d.ts +48 -0
- package/es/event/eventEmitter.js +92 -0
- package/es/event/eventEmitter.js.map +1 -0
- package/es/history/index.d.ts +23 -0
- package/es/history/index.js +111 -0
- package/es/history/index.js.map +1 -0
- package/es/index.css +210 -0
- package/{types → es}/index.d.ts +4 -6
- package/es/index.js +16 -0
- package/es/index.js.map +1 -0
- package/es/index.less +1 -0
- package/{types → es}/keyboard/index.d.ts +7 -8
- package/es/keyboard/index.js +87 -0
- package/es/keyboard/index.js.map +1 -0
- package/es/keyboard/shortcut.js +116 -0
- package/es/keyboard/shortcut.js.map +1 -0
- package/es/model/BaseModel.d.ts +181 -0
- package/es/model/BaseModel.js +2 -0
- package/es/model/BaseModel.js.map +1 -0
- package/{types → es}/model/EditConfigModel.d.ts +13 -8
- package/es/model/EditConfigModel.js +192 -0
- package/es/model/EditConfigModel.js.map +1 -0
- package/{types → es}/model/GraphModel.d.ts +118 -178
- package/es/model/GraphModel.js +1473 -0
- package/es/model/GraphModel.js.map +1 -0
- package/es/model/SnaplineModel.d.ts +34 -0
- package/es/model/SnaplineModel.js +217 -0
- package/es/model/SnaplineModel.js.map +1 -0
- package/{types → es}/model/TransformModel.d.ts +21 -11
- package/es/model/TransformModel.js +240 -0
- package/es/model/TransformModel.js.map +1 -0
- package/{types → es}/model/edge/BaseEdgeModel.d.ts +82 -63
- package/es/model/edge/BaseEdgeModel.js +739 -0
- package/es/model/edge/BaseEdgeModel.js.map +1 -0
- package/es/model/edge/BezierEdgeModel.d.ts +63 -0
- package/es/model/edge/BezierEdgeModel.js +244 -0
- package/es/model/edge/BezierEdgeModel.js.map +1 -0
- package/es/model/edge/LineEdgeModel.d.ts +19 -0
- package/es/model/edge/LineEdgeModel.js +77 -0
- package/es/model/edge/LineEdgeModel.js.map +1 -0
- package/es/model/edge/PolylineEdgeModel.d.ts +85 -0
- package/es/model/edge/PolylineEdgeModel.js +593 -0
- package/es/model/edge/PolylineEdgeModel.js.map +1 -0
- package/es/model/edge/index.js +5 -0
- package/es/model/edge/index.js.map +1 -0
- package/es/model/index.js +8 -0
- package/es/model/index.js.map +1 -0
- package/es/model/node/BaseNodeModel.d.ts +260 -0
- package/es/model/node/BaseNodeModel.js +883 -0
- package/es/model/node/BaseNodeModel.js.map +1 -0
- package/es/model/node/CircleNodeModel.d.ts +40 -0
- package/es/model/node/CircleNodeModel.js +110 -0
- package/es/model/node/CircleNodeModel.js.map +1 -0
- package/es/model/node/DiamondNodeModel.d.ts +46 -0
- package/es/model/node/DiamondNodeModel.js +187 -0
- package/es/model/node/DiamondNodeModel.js.map +1 -0
- package/es/model/node/EllipseNodeModel.d.ts +42 -0
- package/es/model/node/EllipseNodeModel.js +118 -0
- package/es/model/node/EllipseNodeModel.js.map +1 -0
- package/es/model/node/HtmlNodeModel.d.ts +21 -0
- package/es/model/node/HtmlNodeModel.js +59 -0
- package/es/model/node/HtmlNodeModel.js.map +1 -0
- package/es/model/node/PolygonNodeModel.d.ts +50 -0
- package/es/model/node/PolygonNodeModel.js +196 -0
- package/es/model/node/PolygonNodeModel.js.map +1 -0
- package/es/model/node/RectNodeModel.d.ts +34 -0
- package/es/model/node/RectNodeModel.js +80 -0
- package/es/model/node/RectNodeModel.js.map +1 -0
- package/es/model/node/TextNodeModel.d.ts +27 -0
- package/es/model/node/TextNodeModel.js +113 -0
- package/es/model/node/TextNodeModel.js.map +1 -0
- package/es/model/node/index.js +9 -0
- package/es/model/node/index.js.map +1 -0
- package/es/options.d.ts +86 -0
- package/es/options.js +74 -0
- package/es/options.js.map +1 -0
- package/es/style/index.css +210 -0
- package/es/style/index.less +256 -0
- package/es/style/raw.d.ts +4 -0
- package/es/style/raw.js +6 -0
- package/es/style/raw.js.map +1 -0
- package/es/tool/MultipleSelectTool.d.ts +13 -0
- package/es/tool/MultipleSelectTool.js +159 -0
- package/es/tool/MultipleSelectTool.js.map +1 -0
- package/es/tool/TextEditTool.d.ts +26 -0
- package/es/tool/TextEditTool.js +187 -0
- package/es/tool/TextEditTool.js.map +1 -0
- package/es/tool/index.d.ts +2 -0
- package/es/tool/index.js +3 -0
- package/es/tool/index.js.map +1 -0
- package/{types/tool/SnaplineTool.d.ts → es/tool/snapline.d.ts} +1 -1
- package/es/tool/snapline.js +13 -0
- package/es/tool/snapline.js.map +1 -0
- package/es/tool/tool.d.ts +22 -0
- package/es/tool/tool.js +43 -0
- package/es/tool/tool.js.map +1 -0
- package/es/util/animation.d.ts +12 -0
- package/es/util/animation.js +20 -0
- package/es/util/animation.js.map +1 -0
- package/es/util/browser.js +3 -0
- package/es/util/browser.js.map +1 -0
- package/es/util/compatible.d.ts +6 -0
- package/es/util/compatible.js +17 -0
- package/es/util/compatible.js.map +1 -0
- package/es/util/drag.d.ts +47 -0
- package/es/util/drag.js +139 -0
- package/es/util/drag.js.map +1 -0
- package/es/util/edge.d.ts +94 -0
- package/es/util/edge.js +833 -0
- package/es/util/edge.js.map +1 -0
- package/es/util/geometry.d.ts +11 -0
- package/es/util/geometry.js +72 -0
- package/es/util/geometry.js.map +1 -0
- package/{types → es}/util/graph.d.ts +4 -3
- package/es/util/graph.js +54 -0
- package/es/util/graph.js.map +1 -0
- package/es/util/index.d.ts +16 -0
- package/es/util/index.js +17 -0
- package/es/util/index.js.map +1 -0
- package/{types → es}/util/matrix.d.ts +1 -1
- package/es/util/matrix.js +161 -0
- package/es/util/matrix.js.map +1 -0
- package/es/util/mobx.js +4 -0
- package/es/util/mobx.js.map +1 -0
- package/es/util/node.d.ts +69 -0
- package/es/util/node.js +402 -0
- package/es/util/node.js.map +1 -0
- package/es/util/raf.d.ts +2 -0
- package/es/util/raf.js +24 -0
- package/es/util/raf.js.map +1 -0
- package/{types → es}/util/sampling.d.ts +4 -2
- package/es/util/sampling.js +66 -0
- package/es/util/sampling.js.map +1 -0
- package/es/util/theme.d.ts +4 -0
- package/es/util/theme.js +156 -0
- package/es/util/theme.js.map +1 -0
- package/es/util/uuid.d.ts +7 -0
- package/es/util/uuid.js +20 -0
- package/es/util/uuid.js.map +1 -0
- package/{types → es}/util/vector.d.ts +2 -2
- package/es/util/vector.js +97 -0
- package/es/util/vector.js.map +1 -0
- package/es/util/zIndex.js +5 -0
- package/es/util/zIndex.js.map +1 -0
- package/es/view/Anchor.d.ts +47 -0
- package/es/view/Anchor.js +315 -0
- package/es/view/Anchor.js.map +1 -0
- package/es/view/Control.d.ts +100 -0
- package/es/view/Control.js +324 -0
- package/es/view/Control.js.map +1 -0
- package/es/view/Graph.d.ts +18 -0
- package/es/view/Graph.js +77 -0
- package/es/view/Graph.js.map +1 -0
- package/{types → es}/view/Rotate.d.ts +9 -9
- package/es/view/Rotate.js +108 -0
- package/es/view/Rotate.js.map +1 -0
- package/es/view/behavior/dnd.d.ts +27 -0
- package/es/view/behavior/dnd.js +110 -0
- package/es/view/behavior/dnd.js.map +1 -0
- package/es/view/edge/AdjustPoint.d.ts +50 -0
- package/es/view/edge/AdjustPoint.js +368 -0
- package/es/view/edge/AdjustPoint.js.map +1 -0
- package/es/view/edge/Arrow.d.ts +25 -0
- package/es/view/edge/Arrow.js +60 -0
- package/es/view/edge/Arrow.js.map +1 -0
- package/{types → es}/view/edge/BaseEdge.d.ts +25 -17
- package/es/view/edge/BaseEdge.js +381 -0
- package/es/view/edge/BaseEdge.js.map +1 -0
- package/es/view/edge/BezierEdge.d.ts +26 -0
- package/es/view/edge/BezierEdge.js +118 -0
- package/es/view/edge/BezierEdge.js.map +1 -0
- package/{types → es}/view/edge/LineEdge.d.ts +9 -4
- package/es/view/edge/LineEdge.js +78 -0
- package/es/view/edge/LineEdge.js.map +1 -0
- package/{types → es}/view/edge/PolylineEdge.d.ts +18 -8
- package/es/view/edge/PolylineEdge.js +274 -0
- package/es/view/edge/PolylineEdge.js.map +1 -0
- package/es/view/edge/index.d.ts +6 -0
- package/es/view/edge/index.js +7 -0
- package/es/view/edge/index.js.map +1 -0
- package/es/view/index.d.ts +7 -0
- package/es/view/index.js +8 -0
- package/es/view/index.js.map +1 -0
- package/es/view/node/BaseNode.d.ts +49 -0
- package/es/view/node/BaseNode.js +420 -0
- package/es/view/node/BaseNode.js.map +1 -0
- package/es/view/node/CircleNode.d.ts +10 -0
- package/es/view/node/CircleNode.js +45 -0
- package/es/view/node/CircleNode.js.map +1 -0
- package/es/view/node/DiamondNode.d.ts +10 -0
- package/es/view/node/DiamondNode.js +44 -0
- package/es/view/node/DiamondNode.js.map +1 -0
- package/es/view/node/EllipseNode.d.ts +10 -0
- package/es/view/node/EllipseNode.js +44 -0
- package/es/view/node/EllipseNode.js.map +1 -0
- package/{types → es}/view/node/HtmlNode.d.ts +15 -9
- package/es/view/node/HtmlNode.js +129 -0
- package/es/view/node/HtmlNode.js.map +1 -0
- package/es/view/node/PolygonNode.d.ts +10 -0
- package/es/view/node/PolygonNode.js +48 -0
- package/es/view/node/PolygonNode.js.map +1 -0
- package/es/view/node/RectNode.d.ts +11 -0
- package/es/view/node/RectNode.js +44 -0
- package/es/view/node/RectNode.js.map +1 -0
- package/es/view/node/TextNode.d.ts +12 -0
- package/es/view/node/TextNode.js +55 -0
- package/es/view/node/TextNode.js.map +1 -0
- package/es/view/node/index.d.ts +8 -0
- package/es/view/node/index.js +9 -0
- package/es/view/node/index.js.map +1 -0
- package/{types → es}/view/overlay/BackgroundOverlay.d.ts +7 -7
- package/es/view/overlay/BackgroundOverlay.js +31 -0
- package/es/view/overlay/BackgroundOverlay.js.map +1 -0
- package/es/view/overlay/BezierAdjustOverlay.d.ts +31 -0
- package/es/view/overlay/BezierAdjustOverlay.js +142 -0
- package/es/view/overlay/BezierAdjustOverlay.js.map +1 -0
- package/{types → es}/view/overlay/CanvasOverlay.d.ts +8 -11
- package/es/view/overlay/CanvasOverlay.js +172 -0
- package/es/view/overlay/CanvasOverlay.js.map +1 -0
- package/es/view/overlay/Grid.d.ts +30 -0
- package/es/view/overlay/Grid.js +118 -0
- package/es/view/overlay/Grid.js.map +1 -0
- package/es/view/overlay/ModificationOverlay.d.ts +9 -0
- package/es/view/overlay/ModificationOverlay.js +43 -0
- package/es/view/overlay/ModificationOverlay.js.map +1 -0
- package/es/view/overlay/OutlineOverlay.d.ts +14 -0
- package/es/view/overlay/OutlineOverlay.js +134 -0
- package/es/view/overlay/OutlineOverlay.js.map +1 -0
- package/es/view/overlay/SnaplineOverlay.d.ts +10 -0
- package/es/view/overlay/SnaplineOverlay.js +60 -0
- package/es/view/overlay/SnaplineOverlay.js.map +1 -0
- package/es/view/overlay/ToolOverlay.d.ts +19 -0
- package/es/view/overlay/ToolOverlay.js +76 -0
- package/es/view/overlay/ToolOverlay.js.map +1 -0
- package/{types → es}/view/overlay/getTransformHoc.d.ts +17 -14
- package/es/view/overlay/getTransformHoc.js +57 -0
- package/es/view/overlay/getTransformHoc.js.map +1 -0
- package/es/view/overlay/index.d.ts +8 -0
- package/es/view/overlay/index.js +9 -0
- package/es/view/overlay/index.js.map +1 -0
- package/es/view/shape/Circle.d.ts +2 -0
- package/es/view/shape/Circle.js +57 -0
- package/es/view/shape/Circle.js.map +1 -0
- package/es/view/shape/Ellipse.d.ts +2 -0
- package/es/view/shape/Ellipse.js +58 -0
- package/es/view/shape/Ellipse.js.map +1 -0
- package/es/view/shape/Line.d.ts +2 -0
- package/es/view/shape/Line.js +54 -0
- package/es/view/shape/Line.js.map +1 -0
- package/es/view/shape/Path.d.ts +6 -0
- package/es/view/shape/Path.js +43 -0
- package/es/view/shape/Path.js.map +1 -0
- package/es/view/shape/Polygon.d.ts +8 -0
- package/es/view/shape/Polygon.js +56 -0
- package/es/view/shape/Polygon.js.map +1 -0
- package/es/view/shape/Polyline.d.ts +2 -0
- package/es/view/shape/Polyline.js +49 -0
- package/es/view/shape/Polyline.js.map +1 -0
- package/es/view/shape/Rect.d.ts +15 -0
- package/es/view/shape/Rect.js +60 -0
- package/es/view/shape/Rect.js.map +1 -0
- package/es/view/shape/Text.d.ts +2 -0
- package/es/view/shape/Text.js +110 -0
- package/es/view/shape/Text.js.map +1 -0
- package/es/view/shape/index.d.ts +8 -0
- package/es/view/shape/index.js +9 -0
- package/es/view/shape/index.js.map +1 -0
- package/es/view/text/BaseText.d.ts +25 -0
- package/es/view/text/BaseText.js +114 -0
- package/es/view/text/BaseText.js.map +1 -0
- package/es/view/text/LineText.d.ts +9 -0
- package/es/view/text/LineText.js +149 -0
- package/es/view/text/LineText.js.map +1 -0
- package/es/view/text/index.d.ts +2 -0
- package/es/view/text/index.js +3 -0
- package/es/view/text/index.js.map +1 -0
- package/lib/LogicFlow.d.ts +966 -0
- package/lib/LogicFlow.js +1203 -0
- package/lib/LogicFlow.js.map +1 -0
- package/lib/algorithm/edge.d.ts +15 -0
- package/lib/algorithm/edge.js +62 -0
- package/lib/algorithm/edge.js.map +1 -0
- package/lib/algorithm/index.d.ts +6 -0
- package/lib/algorithm/index.js +75 -0
- package/lib/algorithm/index.js.map +1 -0
- package/lib/algorithm/outline.d.ts +7 -0
- package/lib/algorithm/outline.js +69 -0
- package/lib/algorithm/outline.js.map +1 -0
- package/lib/constant/index.d.ts +102 -0
- package/lib/constant/index.js +120 -0
- package/lib/constant/index.js.map +1 -0
- package/lib/event/eventArgs.d.ts +428 -0
- package/lib/event/eventArgs.js +3 -0
- package/lib/event/eventArgs.js.map +1 -0
- package/lib/event/eventEmitter.d.ts +48 -0
- package/lib/event/eventEmitter.js +95 -0
- package/lib/event/eventEmitter.js.map +1 -0
- package/lib/history/index.d.ts +23 -0
- package/lib/history/index.js +114 -0
- package/lib/history/index.js.map +1 -0
- package/lib/index.css +210 -0
- package/lib/index.d.ts +12 -0
- package/lib/index.js +58 -0
- package/lib/index.js.map +1 -0
- package/lib/index.less +1 -0
- package/lib/keyboard/index.d.ts +31 -0
- package/lib/keyboard/index.js +93 -0
- package/lib/keyboard/index.js.map +1 -0
- package/lib/keyboard/shortcut.d.ts +3 -0
- package/lib/keyboard/shortcut.js +120 -0
- package/lib/keyboard/shortcut.js.map +1 -0
- package/lib/model/BaseModel.d.ts +181 -0
- package/lib/model/BaseModel.js +3 -0
- package/lib/model/BaseModel.js.map +1 -0
- package/lib/model/EditConfigModel.d.ts +114 -0
- package/lib/model/EditConfigModel.js +195 -0
- package/lib/model/EditConfigModel.js.map +1 -0
- package/lib/model/GraphModel.d.ts +426 -0
- package/lib/model/GraphModel.js +1479 -0
- package/lib/model/GraphModel.js.map +1 -0
- package/lib/model/SnaplineModel.d.ts +34 -0
- package/lib/model/SnaplineModel.js +220 -0
- package/lib/model/SnaplineModel.js.map +1 -0
- package/lib/model/TransformModel.d.ts +101 -0
- package/lib/model/TransformModel.js +243 -0
- package/lib/model/TransformModel.js.map +1 -0
- package/lib/model/edge/BaseEdgeModel.d.ts +270 -0
- package/lib/model/edge/BaseEdgeModel.js +742 -0
- package/lib/model/edge/BaseEdgeModel.js.map +1 -0
- package/lib/model/edge/BezierEdgeModel.d.ts +63 -0
- package/lib/model/edge/BezierEdgeModel.js +250 -0
- package/lib/model/edge/BezierEdgeModel.js.map +1 -0
- package/lib/model/edge/LineEdgeModel.d.ts +19 -0
- package/lib/model/edge/LineEdgeModel.js +83 -0
- package/lib/model/edge/LineEdgeModel.js.map +1 -0
- package/lib/model/edge/PolylineEdgeModel.d.ts +85 -0
- package/lib/model/edge/PolylineEdgeModel.js +596 -0
- package/lib/model/edge/PolylineEdgeModel.js.map +1 -0
- package/lib/model/edge/index.d.ts +4 -0
- package/lib/model/edge/index.js +21 -0
- package/lib/model/edge/index.js.map +1 -0
- package/lib/model/index.d.ts +7 -0
- package/lib/model/index.js +24 -0
- package/lib/model/index.js.map +1 -0
- package/lib/model/node/BaseNodeModel.d.ts +260 -0
- package/lib/model/node/BaseNodeModel.js +886 -0
- package/lib/model/node/BaseNodeModel.js.map +1 -0
- package/lib/model/node/CircleNodeModel.d.ts +40 -0
- package/lib/model/node/CircleNodeModel.js +116 -0
- package/lib/model/node/CircleNodeModel.js.map +1 -0
- package/lib/model/node/DiamondNodeModel.d.ts +46 -0
- package/lib/model/node/DiamondNodeModel.js +193 -0
- package/lib/model/node/DiamondNodeModel.js.map +1 -0
- package/lib/model/node/EllipseNodeModel.d.ts +42 -0
- package/lib/model/node/EllipseNodeModel.js +124 -0
- package/lib/model/node/EllipseNodeModel.js.map +1 -0
- package/lib/model/node/HtmlNodeModel.d.ts +21 -0
- package/lib/model/node/HtmlNodeModel.js +65 -0
- package/lib/model/node/HtmlNodeModel.js.map +1 -0
- package/lib/model/node/PolygonNodeModel.d.ts +50 -0
- package/lib/model/node/PolygonNodeModel.js +202 -0
- package/lib/model/node/PolygonNodeModel.js.map +1 -0
- package/lib/model/node/RectNodeModel.d.ts +34 -0
- package/lib/model/node/RectNodeModel.js +86 -0
- package/lib/model/node/RectNodeModel.js.map +1 -0
- package/lib/model/node/TextNodeModel.d.ts +27 -0
- package/lib/model/node/TextNodeModel.js +119 -0
- package/lib/model/node/TextNodeModel.js.map +1 -0
- package/lib/model/node/index.d.ts +8 -0
- package/lib/model/node/index.js +25 -0
- package/lib/model/node/index.js.map +1 -0
- package/lib/options.d.ts +86 -0
- package/lib/options.js +77 -0
- package/lib/options.js.map +1 -0
- package/lib/style/index.css +210 -0
- package/lib/style/index.less +256 -0
- package/lib/style/raw.d.ts +4 -0
- package/lib/style/raw.js +9 -0
- package/lib/style/raw.js.map +1 -0
- package/lib/tool/MultipleSelectTool.d.ts +13 -0
- package/lib/tool/MultipleSelectTool.js +161 -0
- package/lib/tool/MultipleSelectTool.js.map +1 -0
- package/lib/tool/TextEditTool.d.ts +26 -0
- package/lib/tool/TextEditTool.js +190 -0
- package/lib/tool/TextEditTool.js.map +1 -0
- package/lib/tool/index.d.ts +2 -0
- package/lib/tool/index.js +19 -0
- package/lib/tool/index.js.map +1 -0
- package/lib/tool/snapline.d.ts +3 -0
- package/lib/tool/snapline.js +17 -0
- package/lib/tool/snapline.js.map +1 -0
- package/lib/tool/tool.d.ts +22 -0
- package/lib/tool/tool.js +49 -0
- package/lib/tool/tool.js.map +1 -0
- package/lib/util/animation.d.ts +12 -0
- package/lib/util/animation.js +24 -0
- package/lib/util/animation.js.map +1 -0
- package/lib/util/browser.d.ts +1 -0
- package/lib/util/browser.js +6 -0
- package/lib/util/browser.js.map +1 -0
- package/lib/util/compatible.d.ts +6 -0
- package/lib/util/compatible.js +21 -0
- package/lib/util/compatible.js.map +1 -0
- package/lib/util/drag.d.ts +47 -0
- package/lib/util/drag.js +142 -0
- package/lib/util/drag.js.map +1 -0
- package/lib/util/edge.d.ts +94 -0
- package/lib/util/edge.js +879 -0
- package/lib/util/edge.js.map +1 -0
- package/lib/util/geometry.d.ts +11 -0
- package/lib/util/geometry.js +78 -0
- package/lib/util/geometry.js.map +1 -0
- package/lib/util/graph.d.ts +13 -0
- package/lib/util/graph.js +59 -0
- package/lib/util/graph.js.map +1 -0
- package/lib/util/index.d.ts +16 -0
- package/lib/util/index.js +33 -0
- package/lib/util/index.js.map +1 -0
- package/lib/util/matrix.d.ts +32 -0
- package/lib/util/matrix.js +164 -0
- package/lib/util/matrix.js.map +1 -0
- package/lib/util/mobx.d.ts +2 -0
- package/lib/util/mobx.js +13 -0
- package/lib/util/mobx.js.map +1 -0
- package/lib/util/node.d.ts +69 -0
- package/lib/util/node.js +424 -0
- package/lib/util/node.js.map +1 -0
- package/lib/util/raf.d.ts +2 -0
- package/lib/util/raf.js +29 -0
- package/lib/util/raf.js.map +1 -0
- package/lib/util/sampling.d.ts +6 -0
- package/lib/util/sampling.js +72 -0
- package/lib/util/sampling.js.map +1 -0
- package/lib/util/theme.d.ts +4 -0
- package/lib/util/theme.js +160 -0
- package/lib/util/theme.js.map +1 -0
- package/lib/util/uuid.d.ts +7 -0
- package/lib/util/uuid.js +25 -0
- package/lib/util/uuid.js.map +1 -0
- package/lib/util/vector.d.ts +23 -0
- package/lib/util/vector.js +101 -0
- package/lib/util/vector.js.map +1 -0
- package/lib/util/zIndex.d.ts +2 -0
- package/lib/util/zIndex.js +10 -0
- package/lib/util/zIndex.js.map +1 -0
- package/lib/view/Anchor.d.ts +47 -0
- package/lib/view/Anchor.js +317 -0
- package/lib/view/Anchor.js.map +1 -0
- package/lib/view/Control.d.ts +100 -0
- package/lib/view/Control.js +327 -0
- package/lib/view/Control.js.map +1 -0
- package/lib/view/Graph.d.ts +18 -0
- package/lib/view/Graph.js +79 -0
- package/lib/view/Graph.js.map +1 -0
- package/lib/view/Rotate.d.ts +21 -0
- package/lib/view/Rotate.js +113 -0
- package/lib/view/Rotate.js.map +1 -0
- package/lib/view/behavior/dnd.d.ts +27 -0
- package/lib/view/behavior/dnd.js +113 -0
- package/lib/view/behavior/dnd.js.map +1 -0
- package/lib/view/edge/AdjustPoint.d.ts +50 -0
- package/lib/view/edge/AdjustPoint.js +371 -0
- package/lib/view/edge/AdjustPoint.js.map +1 -0
- package/lib/view/edge/Arrow.d.ts +25 -0
- package/lib/view/edge/Arrow.js +63 -0
- package/lib/view/edge/Arrow.js.map +1 -0
- package/lib/view/edge/BaseEdge.d.ts +148 -0
- package/lib/view/edge/BaseEdge.js +407 -0
- package/lib/view/edge/BaseEdge.js.map +1 -0
- package/lib/view/edge/BezierEdge.d.ts +26 -0
- package/lib/view/edge/BezierEdge.js +124 -0
- package/lib/view/edge/BezierEdge.js.map +1 -0
- package/{types/view/edge/BezierEdge.d.ts → lib/view/edge/LineEdge.d.ts} +9 -10
- package/lib/view/edge/LineEdge.js +84 -0
- package/lib/view/edge/LineEdge.js.map +1 -0
- package/lib/view/edge/PolylineEdge.d.ts +55 -0
- package/lib/view/edge/PolylineEdge.js +280 -0
- package/lib/view/edge/PolylineEdge.js.map +1 -0
- package/lib/view/edge/index.d.ts +6 -0
- package/lib/view/edge/index.js +23 -0
- package/lib/view/edge/index.js.map +1 -0
- package/lib/view/index.d.ts +7 -0
- package/lib/view/index.js +24 -0
- package/lib/view/index.js.map +1 -0
- package/lib/view/node/BaseNode.d.ts +49 -0
- package/lib/view/node/BaseNode.js +424 -0
- package/lib/view/node/BaseNode.js.map +1 -0
- package/lib/view/node/CircleNode.d.ts +10 -0
- package/lib/view/node/CircleNode.js +51 -0
- package/lib/view/node/CircleNode.js.map +1 -0
- package/lib/view/node/DiamondNode.d.ts +10 -0
- package/lib/view/node/DiamondNode.js +50 -0
- package/lib/view/node/DiamondNode.js.map +1 -0
- package/lib/view/node/EllipseNode.d.ts +10 -0
- package/lib/view/node/EllipseNode.js +50 -0
- package/lib/view/node/EllipseNode.js.map +1 -0
- package/lib/view/node/HtmlNode.d.ts +38 -0
- package/lib/view/node/HtmlNode.js +135 -0
- package/lib/view/node/HtmlNode.js.map +1 -0
- package/lib/view/node/PolygonNode.d.ts +10 -0
- package/lib/view/node/PolygonNode.js +54 -0
- package/lib/view/node/PolygonNode.js.map +1 -0
- package/lib/view/node/RectNode.d.ts +11 -0
- package/lib/view/node/RectNode.js +50 -0
- package/lib/view/node/RectNode.js.map +1 -0
- package/lib/view/node/TextNode.d.ts +12 -0
- package/lib/view/node/TextNode.js +61 -0
- package/lib/view/node/TextNode.js.map +1 -0
- package/lib/view/node/index.d.ts +8 -0
- package/lib/view/node/index.js +25 -0
- package/lib/view/node/index.js.map +1 -0
- package/lib/view/overlay/BackgroundOverlay.d.ts +28 -0
- package/lib/view/overlay/BackgroundOverlay.js +34 -0
- package/lib/view/overlay/BackgroundOverlay.js.map +1 -0
- package/lib/view/overlay/BezierAdjustOverlay.d.ts +31 -0
- package/lib/view/overlay/BezierAdjustOverlay.js +145 -0
- package/lib/view/overlay/BezierAdjustOverlay.js.map +1 -0
- package/lib/view/overlay/CanvasOverlay.d.ts +25 -0
- package/lib/view/overlay/CanvasOverlay.js +175 -0
- package/lib/view/overlay/CanvasOverlay.js.map +1 -0
- package/lib/view/overlay/Grid.d.ts +30 -0
- package/lib/view/overlay/Grid.js +121 -0
- package/lib/view/overlay/Grid.js.map +1 -0
- package/lib/view/overlay/ModificationOverlay.d.ts +9 -0
- package/lib/view/overlay/ModificationOverlay.js +46 -0
- package/lib/view/overlay/ModificationOverlay.js.map +1 -0
- package/lib/view/overlay/OutlineOverlay.d.ts +14 -0
- package/lib/view/overlay/OutlineOverlay.js +137 -0
- package/lib/view/overlay/OutlineOverlay.js.map +1 -0
- package/lib/view/overlay/SnaplineOverlay.d.ts +10 -0
- package/lib/view/overlay/SnaplineOverlay.js +66 -0
- package/lib/view/overlay/SnaplineOverlay.js.map +1 -0
- package/lib/view/overlay/ToolOverlay.d.ts +19 -0
- package/lib/view/overlay/ToolOverlay.js +79 -0
- package/lib/view/overlay/ToolOverlay.js.map +1 -0
- package/lib/view/overlay/getTransformHoc.d.ts +37 -0
- package/lib/view/overlay/getTransformHoc.js +61 -0
- package/lib/view/overlay/getTransformHoc.js.map +1 -0
- package/lib/view/overlay/index.d.ts +8 -0
- package/lib/view/overlay/index.js +25 -0
- package/lib/view/overlay/index.js.map +1 -0
- package/lib/view/shape/Circle.d.ts +2 -0
- package/lib/view/shape/Circle.js +61 -0
- package/lib/view/shape/Circle.js.map +1 -0
- package/lib/view/shape/Ellipse.d.ts +2 -0
- package/lib/view/shape/Ellipse.js +62 -0
- package/lib/view/shape/Ellipse.js.map +1 -0
- package/lib/view/shape/Line.d.ts +2 -0
- package/lib/view/shape/Line.js +58 -0
- package/lib/view/shape/Line.js.map +1 -0
- package/lib/view/shape/Path.d.ts +6 -0
- package/lib/view/shape/Path.js +47 -0
- package/lib/view/shape/Path.js.map +1 -0
- package/lib/view/shape/Polygon.d.ts +8 -0
- package/lib/view/shape/Polygon.js +60 -0
- package/lib/view/shape/Polygon.js.map +1 -0
- package/lib/view/shape/Polyline.d.ts +2 -0
- package/lib/view/shape/Polyline.js +53 -0
- package/lib/view/shape/Polyline.js.map +1 -0
- package/lib/view/shape/Rect.d.ts +15 -0
- package/lib/view/shape/Rect.js +64 -0
- package/lib/view/shape/Rect.js.map +1 -0
- package/lib/view/shape/Text.d.ts +2 -0
- package/lib/view/shape/Text.js +114 -0
- package/lib/view/shape/Text.js.map +1 -0
- package/lib/view/shape/index.d.ts +8 -0
- package/lib/view/shape/index.js +25 -0
- package/lib/view/shape/index.js.map +1 -0
- package/lib/view/text/BaseText.d.ts +25 -0
- package/lib/view/text/BaseText.js +117 -0
- package/lib/view/text/BaseText.js.map +1 -0
- package/lib/view/text/LineText.d.ts +9 -0
- package/lib/view/text/LineText.js +155 -0
- package/lib/view/text/LineText.js.map +1 -0
- package/lib/view/text/index.d.ts +2 -0
- package/lib/view/text/index.js +19 -0
- package/lib/view/text/index.js.map +1 -0
- package/package.json +41 -88
- package/rollup.config.js +15 -0
- package/src/LogicFlow.tsx +1831 -0
- package/src/algorithm/edge.ts +68 -0
- package/src/algorithm/index.ts +68 -0
- package/src/algorithm/outline.ts +77 -0
- package/src/constant/index.ts +127 -0
- package/src/event/event.md +66 -0
- package/src/event/eventArgs.ts +476 -0
- package/src/event/eventEmitter.ts +153 -0
- package/src/history/index.ts +112 -0
- package/src/index.less +1 -0
- package/src/index.ts +21 -0
- package/src/keyboard/index.ts +106 -0
- package/src/keyboard/shortcut.ts +123 -0
- package/src/model/BaseModel.ts +223 -0
- package/src/model/EditConfigModel.ts +215 -0
- package/src/model/GraphModel.ts +1516 -0
- package/src/model/SnaplineModel.ts +238 -0
- package/src/model/TransformModel.ts +258 -0
- package/src/model/edge/BaseEdgeModel.ts +688 -0
- package/src/model/edge/BezierEdgeModel.ts +196 -0
- package/src/model/edge/LineEdgeModel.ts +26 -0
- package/src/model/edge/PolylineEdgeModel.ts +656 -0
- package/src/model/edge/index.ts +4 -0
- package/src/model/index.ts +8 -0
- package/src/model/node/BaseNodeModel.ts +839 -0
- package/src/model/node/CircleNodeModel.ts +89 -0
- package/src/model/node/DiamondNodeModel.ts +128 -0
- package/src/model/node/EllipseNodeModel.ts +94 -0
- package/src/model/node/HtmlNodeModel.ts +49 -0
- package/src/model/node/PolygonNodeModel.ts +147 -0
- package/src/model/node/RectNodeModel.ts +57 -0
- package/src/model/node/TextNodeModel.ts +41 -0
- package/src/model/node/index.ts +8 -0
- package/src/options.ts +173 -0
- package/src/style/index.less +256 -0
- package/src/style/raw.ts +217 -0
- package/src/tool/MultipleSelectTool.tsx +132 -0
- package/src/tool/TextEditTool.tsx +193 -0
- package/src/tool/index.ts +2 -0
- package/src/tool/snapline.ts +17 -0
- package/src/tool/tool.ts +66 -0
- package/src/typings.d.ts +5 -0
- package/src/util/animation.ts +29 -0
- package/src/util/browser.ts +4 -0
- package/src/util/compatible.ts +15 -0
- package/src/util/drag.ts +186 -0
- package/src/util/edge.ts +1034 -0
- package/src/util/geometry.ts +53 -0
- package/src/util/graph.ts +46 -0
- package/src/util/index.ts +16 -0
- package/src/util/matrix.ts +129 -0
- package/src/util/mobx.ts +23 -0
- package/src/util/node.ts +519 -0
- package/src/util/raf.ts +28 -0
- package/src/util/sampling.ts +85 -0
- package/src/util/theme.ts +180 -0
- package/src/util/uuid.ts +26 -0
- package/src/util/vector.ts +93 -0
- package/src/util/zIndex.ts +6 -0
- package/src/view/Anchor.tsx +407 -0
- package/src/view/Control.tsx +446 -0
- package/src/view/Graph.tsx +104 -0
- package/src/view/Rotate.tsx +112 -0
- package/src/view/behavior/dnd.ts +116 -0
- package/src/view/edge/AdjustPoint.tsx +439 -0
- package/src/view/edge/Arrow.tsx +54 -0
- package/src/view/edge/BaseEdge.tsx +489 -0
- package/src/view/edge/BezierEdge.tsx +101 -0
- package/src/view/edge/LineEdge.tsx +81 -0
- package/src/view/edge/PolylineEdge.tsx +299 -0
- package/src/view/edge/index.ts +6 -0
- package/src/view/index.ts +8 -0
- package/src/view/node/BaseNode.tsx +494 -0
- package/src/view/node/CircleNode.tsx +19 -0
- package/src/view/node/DiamondNode.tsx +22 -0
- package/src/view/node/EllipseNode.tsx +20 -0
- package/src/view/node/HtmlNode.tsx +92 -0
- package/src/view/node/PolygonNode.tsx +26 -0
- package/src/view/node/RectNode.tsx +28 -0
- package/src/view/node/TextNode.tsx +37 -0
- package/src/view/node/index.ts +8 -0
- package/src/view/overlay/BackgroundOverlay.tsx +39 -0
- package/src/view/overlay/BezierAdjustOverlay.tsx +150 -0
- package/src/view/overlay/CanvasOverlay.tsx +180 -0
- package/src/view/overlay/Grid.tsx +135 -0
- package/src/view/overlay/ModificationOverlay.tsx +31 -0
- package/src/view/overlay/OutlineOverlay.tsx +170 -0
- package/src/view/overlay/SnaplineOverlay.tsx +44 -0
- package/src/view/overlay/ToolOverlay.tsx +65 -0
- package/src/view/overlay/getTransformHoc.tsx +50 -0
- package/src/view/overlay/index.ts +8 -0
- package/src/view/shape/Circle.tsx +27 -0
- package/src/view/shape/Ellipse.tsx +28 -0
- package/src/view/shape/Line.tsx +24 -0
- package/src/view/shape/Path.tsx +19 -0
- package/src/view/shape/Polygon.tsx +36 -0
- package/src/view/shape/Polyline.tsx +19 -0
- package/src/view/shape/Rect.tsx +44 -0
- package/src/view/shape/Text.tsx +138 -0
- package/src/view/shape/index.ts +8 -0
- package/src/view/text/BaseText.tsx +96 -0
- package/src/view/text/LineText.tsx +154 -0
- package/src/view/text/index.ts +2 -0
- package/tsconfig.json +18 -0
- package/dist/entry.js +0 -7
- package/dist/logic-flow.js +0 -23
- package/dist/logic-flow.min.js +0 -23
- package/types/LogicFlow.d.ts +0 -581
- package/types/algorithm/edge.d.ts +0 -6
- package/types/algorithm/outline.d.ts +0 -35
- package/types/constant/DefaultAnimation.d.ts +0 -12
- package/types/constant/DefaultTheme.d.ts +0 -270
- package/types/event/eventEmitter.d.ts +0 -36
- package/types/history/History.d.ts +0 -20
- package/types/model/BaseModel.d.ts +0 -99
- package/types/model/SnaplineModel.d.ts +0 -33
- package/types/model/edge/BezierEdgeModel.d.ts +0 -51
- package/types/model/edge/LineEdgeModel.d.ts +0 -14
- package/types/model/edge/PolylineEdgeModel.d.ts +0 -63
- package/types/model/node/BaseNodeModel.d.ts +0 -232
- package/types/model/node/CircleNodeModel.d.ts +0 -21
- package/types/model/node/DiamondNodeModel.d.ts +0 -25
- package/types/model/node/EllipseNodeModel.d.ts +0 -22
- package/types/model/node/HtmlNodeModel.d.ts +0 -12
- package/types/model/node/PolygonNodeModel.d.ts +0 -28
- package/types/model/node/RectNodeModel.d.ts +0 -19
- package/types/model/node/TextNodeModel.d.ts +0 -19
- package/types/options.d.ts +0 -240
- package/types/tool/MultipleSelectTool.d.ts +0 -20
- package/types/tool/TextEditTool.d.ts +0 -34
- package/types/tool/index.d.ts +0 -13
- package/types/type/index.d.ts +0 -429
- package/types/util/animation.d.ts +0 -2
- package/types/util/compatible.d.ts +0 -1
- package/types/util/drag.d.ts +0 -38
- package/types/util/edge.d.ts +0 -108
- package/types/util/geometry.d.ts +0 -2
- package/types/util/index.d.ts +0 -7
- package/types/util/node.d.ts +0 -66
- package/types/util/raf.d.ts +0 -2
- package/types/util/theme.d.ts +0 -2
- package/types/util/uuid.d.ts +0 -6
- package/types/view/Anchor.d.ts +0 -54
- package/types/view/Graph.d.ts +0 -21
- package/types/view/basic-shape/Circle.d.ts +0 -2
- package/types/view/basic-shape/Ellipse.d.ts +0 -2
- package/types/view/basic-shape/Line.d.ts +0 -3
- package/types/view/basic-shape/LinearGradient.d.ts +0 -1
- package/types/view/basic-shape/Path.d.ts +0 -7
- package/types/view/basic-shape/Polygon.d.ts +0 -2
- package/types/view/basic-shape/Polyline.d.ts +0 -3
- package/types/view/basic-shape/Rect.d.ts +0 -14
- package/types/view/basic-shape/Text.d.ts +0 -2
- package/types/view/behavior/DnD.d.ts +0 -35
- package/types/view/behavior/Transform.d.ts +0 -4
- package/types/view/edge/AdjustPoint.d.ts +0 -56
- package/types/view/edge/Arrow.d.ts +0 -24
- package/types/view/edge/index.d.ts +0 -6
- package/types/view/index.d.ts +0 -2
- package/types/view/node/BaseNode.d.ts +0 -57
- package/types/view/node/CircleNode.d.ts +0 -5
- package/types/view/node/DiamondNode.d.ts +0 -5
- package/types/view/node/EllipseNode.d.ts +0 -5
- package/types/view/node/PolygonNode.d.ts +0 -5
- package/types/view/node/RectNode.d.ts +0 -5
- package/types/view/node/TextNode.d.ts +0 -6
- package/types/view/node/index.d.ts +0 -9
- package/types/view/overlay/BezierAdjustOverlay.d.ts +0 -12
- package/types/view/overlay/Grid.d.ts +0 -30
- package/types/view/overlay/HtmlOverlay.d.ts +0 -15
- package/types/view/overlay/ModificationOverlay.d.ts +0 -9
- package/types/view/overlay/OutlineOverlay.d.ts +0 -17
- package/types/view/overlay/SnaplineOverlay.d.ts +0 -9
- package/types/view/overlay/ToolOverlay.d.ts +0 -17
- package/types/view/text/BaseText.d.ts +0 -29
- package/types/view/text/LineText.d.ts +0 -9
- /package/{types → es}/algorithm/index.d.ts +0 -0
- /package/{types → es}/keyboard/shortcut.d.ts +0 -0
- /package/{types → es}/model/edge/index.d.ts +0 -0
- /package/{types → es}/model/index.d.ts +0 -0
- /package/{types → es}/model/node/index.d.ts +0 -0
- /package/{types → es}/util/browser.d.ts +0 -0
- /package/{types → es}/util/mobx.d.ts +0 -0
- /package/{types → es}/util/zIndex.d.ts +0 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { debounce, isEqual, last, cloneDeep } from 'lodash-es';
|
|
13
|
+
import { deepObserve } from 'mobx-utils';
|
|
14
|
+
import { EventType } from '../constant';
|
|
15
|
+
var History = /** @class */ (function () {
|
|
16
|
+
function History(eventCenter) {
|
|
17
|
+
this.undos = [];
|
|
18
|
+
this.redos = [];
|
|
19
|
+
this.callbacks = [];
|
|
20
|
+
this.stopWatch = null;
|
|
21
|
+
this.curData = null;
|
|
22
|
+
this.maxSize = 50;
|
|
23
|
+
// 发生数据变化后,最多再等500ms,把距离上次的数据变更存储起来。
|
|
24
|
+
// 所以waitTime值越小,History对数据变化越敏感,存的undos就越细。
|
|
25
|
+
this.waitTime = 100;
|
|
26
|
+
this.eventCenter = eventCenter;
|
|
27
|
+
}
|
|
28
|
+
History.prototype.add = function (data) {
|
|
29
|
+
if (isEqual(last(this.undos), data))
|
|
30
|
+
return;
|
|
31
|
+
this.undos.push(data);
|
|
32
|
+
// 因为undo的时候,会触发add.
|
|
33
|
+
// 所以需要区分这个add是undo触发的,还是用户正常操作触发的。
|
|
34
|
+
// 如果是用户正常操作触发的,需要清空redos
|
|
35
|
+
if (!isEqual(this.curData, data)) {
|
|
36
|
+
this.redos = [];
|
|
37
|
+
}
|
|
38
|
+
this.eventCenter.emit(EventType.HISTORY_CHANGE, {
|
|
39
|
+
data: {
|
|
40
|
+
undos: this.undos,
|
|
41
|
+
redos: this.redos,
|
|
42
|
+
undoAble: this.undoAble(),
|
|
43
|
+
redoAble: this.redoAble(),
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
if (this.undos.length > this.maxSize) {
|
|
47
|
+
this.undos.shift();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
History.prototype.undoAble = function () {
|
|
51
|
+
// undos栈顶就是当前图渲染出来的数据。
|
|
52
|
+
return this.undos.length > 1;
|
|
53
|
+
};
|
|
54
|
+
// 1) undo方法触发
|
|
55
|
+
// 2) graphModel重新渲染nodes和edges
|
|
56
|
+
// 3) graphModel发生变化,触发watch
|
|
57
|
+
// 4) watch触发add
|
|
58
|
+
History.prototype.undo = function () {
|
|
59
|
+
if (!this.undoAble())
|
|
60
|
+
return;
|
|
61
|
+
var preData = this.undos.pop();
|
|
62
|
+
this.redos.push(preData);
|
|
63
|
+
var curData = this.undos.pop();
|
|
64
|
+
this.curData = cloneDeep(curData);
|
|
65
|
+
return curData;
|
|
66
|
+
};
|
|
67
|
+
History.prototype.redoAble = function () {
|
|
68
|
+
return this.redos.length > 0;
|
|
69
|
+
};
|
|
70
|
+
History.prototype.redo = function () {
|
|
71
|
+
if (!this.redoAble())
|
|
72
|
+
return;
|
|
73
|
+
var curData = this.redos.pop();
|
|
74
|
+
this.curData = cloneDeep(curData);
|
|
75
|
+
return curData;
|
|
76
|
+
};
|
|
77
|
+
History.prototype.watch = function (model) {
|
|
78
|
+
var _this = this;
|
|
79
|
+
this.stopWatch && this.stopWatch();
|
|
80
|
+
// 把当前watch的model转换一下数据存起来,无需清空redos。
|
|
81
|
+
this.undos.push(model.modelToGraphData());
|
|
82
|
+
this.stopWatch = deepObserve(
|
|
83
|
+
// TODO:避免用户触发「The same observable object cannot appear twice in the same tree」 错误
|
|
84
|
+
// 例如:在自定义节点的 setAttributes 方法中,将 nodeModel 属性赋值给另一个 observable 属性
|
|
85
|
+
// eg:
|
|
86
|
+
// setAttributes() {
|
|
87
|
+
// this.width = 120
|
|
88
|
+
// this.height = 50
|
|
89
|
+
//
|
|
90
|
+
// if (this.text) {
|
|
91
|
+
// this.properties.text = this.text;
|
|
92
|
+
// this.text.value = '';
|
|
93
|
+
// }
|
|
94
|
+
// }
|
|
95
|
+
// 解决方案:使用 cloneDeep 方法,将 observable 对象克隆一份。需要测试下面操作是否会造成其它问题
|
|
96
|
+
// https://stackoverflow.com/questions/55328504/a-node-cannot-exists-twice-in-the-state-tree-mobx-state-tree
|
|
97
|
+
// cloneDeep(model),
|
|
98
|
+
model, debounce(function () {
|
|
99
|
+
// 数据变更后,把最新的当前model数据存起来,并清空 redos。
|
|
100
|
+
// 因为这个回调函数的触发,一般是用户交互而引起的,所以按正常逻辑需要清空 redos。
|
|
101
|
+
var data = model.modelToHistoryData();
|
|
102
|
+
if (data) {
|
|
103
|
+
_this.add(__assign({}, data));
|
|
104
|
+
}
|
|
105
|
+
}, this.waitTime));
|
|
106
|
+
};
|
|
107
|
+
return History;
|
|
108
|
+
}());
|
|
109
|
+
export { History };
|
|
110
|
+
export default History;
|
|
111
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/history/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE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AAwC;QACxC,4BAA4B;QAC5B,MAAM;QACN,IAAI;QACJ,6DAA6D;QAC7D,4GAA4G;QAC5G,oBAAoB;QACpB,KAAK,EACL,QAAQ,CAAC;YACP,oCAAoC;YACpC,6CAA6C;YAC7C,IAAM,IAAI,GAAG,KAAK,CAAC,kBAAkB,EAAE,CAAA;YACvC,IAAI,IAAI,EAAE,CAAC;gBACT,KAAI,CAAC,GAAG,cAAM,IAAI,EAAG,CAAA;YACvB,CAAC;QACH,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAClB,CAAA;IACH,CAAC;IACH,cAAC;AAAD,CAAC,AApGD,IAoGC;;AAED,eAAe,OAAO,CAAA"}
|
package/es/index.css
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
.lf-graph {
|
|
2
|
+
position: relative;
|
|
3
|
+
z-index: 0;
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
background: #fff;
|
|
7
|
+
user-select: none;
|
|
8
|
+
}
|
|
9
|
+
.lf-element-text {
|
|
10
|
+
cursor: text;
|
|
11
|
+
}
|
|
12
|
+
.lf-text-disabled {
|
|
13
|
+
pointer-events: none;
|
|
14
|
+
}
|
|
15
|
+
.lf-text-draggable {
|
|
16
|
+
cursor: move;
|
|
17
|
+
}
|
|
18
|
+
.lf-node-anchor {
|
|
19
|
+
cursor: crosshair;
|
|
20
|
+
}
|
|
21
|
+
.lf-node-anchor-hover {
|
|
22
|
+
visibility: hidden;
|
|
23
|
+
}
|
|
24
|
+
.lf-anchor:hover .lf-node-anchor-hover {
|
|
25
|
+
visibility: visible;
|
|
26
|
+
}
|
|
27
|
+
.lf-edge.pointer-none {
|
|
28
|
+
pointer-events: none;
|
|
29
|
+
}
|
|
30
|
+
.lf-edge-append {
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
}
|
|
33
|
+
.lf-edge-animation {
|
|
34
|
+
stroke-dashoffset: 100%;
|
|
35
|
+
animation: lf_animate_dash 5s linear infinite;
|
|
36
|
+
}
|
|
37
|
+
@keyframes lf_animate_dash {
|
|
38
|
+
to {
|
|
39
|
+
stroke-dashoffset: 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/* node */
|
|
43
|
+
.lf-node-not-allow {
|
|
44
|
+
cursor: not-allowed;
|
|
45
|
+
}
|
|
46
|
+
.lf-polyline-append-ns-resize {
|
|
47
|
+
cursor: ns-resize;
|
|
48
|
+
}
|
|
49
|
+
.lf-polyline-append-ew-resize {
|
|
50
|
+
cursor: ew-resize;
|
|
51
|
+
}
|
|
52
|
+
.lf-dragging {
|
|
53
|
+
cursor: move;
|
|
54
|
+
}
|
|
55
|
+
.lf-dragging .lf-element-text {
|
|
56
|
+
cursor: move;
|
|
57
|
+
}
|
|
58
|
+
.lf-draggable {
|
|
59
|
+
cursor: default;
|
|
60
|
+
}
|
|
61
|
+
.lf-bezier-adjust-anchor {
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
}
|
|
64
|
+
/* background */
|
|
65
|
+
.lf-background,
|
|
66
|
+
.lf-grid {
|
|
67
|
+
position: absolute;
|
|
68
|
+
inset: 0;
|
|
69
|
+
z-index: -1;
|
|
70
|
+
}
|
|
71
|
+
.lf-background-area {
|
|
72
|
+
width: 100%;
|
|
73
|
+
height: 100%;
|
|
74
|
+
}
|
|
75
|
+
/* html-overlay */
|
|
76
|
+
.lf-html-overlay {
|
|
77
|
+
position: absolute;
|
|
78
|
+
inset: 0;
|
|
79
|
+
z-index: 1;
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
user-select: none;
|
|
82
|
+
pointer-events: none;
|
|
83
|
+
}
|
|
84
|
+
.lf-html-overlay__transform > * {
|
|
85
|
+
pointer-events: all;
|
|
86
|
+
}
|
|
87
|
+
.lf-text-editable {
|
|
88
|
+
pointer-events: all;
|
|
89
|
+
}
|
|
90
|
+
.lf-text-input {
|
|
91
|
+
position: absolute;
|
|
92
|
+
box-sizing: border-box;
|
|
93
|
+
min-width: 100px;
|
|
94
|
+
min-height: 20px;
|
|
95
|
+
padding: 5px;
|
|
96
|
+
line-height: 1.2;
|
|
97
|
+
white-space: pre;
|
|
98
|
+
text-align: center;
|
|
99
|
+
background: #fff;
|
|
100
|
+
border: 1px solid #edefed;
|
|
101
|
+
border-radius: 3px;
|
|
102
|
+
outline: none;
|
|
103
|
+
transform: translate(-50%, -50%);
|
|
104
|
+
resize: none;
|
|
105
|
+
}
|
|
106
|
+
.lf-get-text-height {
|
|
107
|
+
display: inline-block;
|
|
108
|
+
box-sizing: border-box;
|
|
109
|
+
word-break: break-all;
|
|
110
|
+
/* 为了跟输入效果保持一致,设置透明边框占位 */
|
|
111
|
+
border: 1px solid transparent;
|
|
112
|
+
}
|
|
113
|
+
.lf-node-text-auto-wrap {
|
|
114
|
+
display: flex;
|
|
115
|
+
align-items: center;
|
|
116
|
+
justify-content: center;
|
|
117
|
+
box-sizing: border-box;
|
|
118
|
+
/* border: 1px solid transparent; */
|
|
119
|
+
}
|
|
120
|
+
.lf-node-text-auto-wrap-content {
|
|
121
|
+
width: 100%;
|
|
122
|
+
line-height: 1.2;
|
|
123
|
+
text-align: center;
|
|
124
|
+
word-break: break-all;
|
|
125
|
+
background: transparent;
|
|
126
|
+
}
|
|
127
|
+
.lf-node-text-ellipsis-content {
|
|
128
|
+
width: 100%;
|
|
129
|
+
line-height: 1.2;
|
|
130
|
+
white-space: nowrap;
|
|
131
|
+
text-align: center;
|
|
132
|
+
background: transparent;
|
|
133
|
+
/* overflow: hidden;
|
|
134
|
+
text-overflow: ellipsis; */
|
|
135
|
+
}
|
|
136
|
+
.lf-node-text-ellipsis-content > div {
|
|
137
|
+
overflow: hidden;
|
|
138
|
+
text-overflow: ellipsis;
|
|
139
|
+
}
|
|
140
|
+
/* tool-overlay */
|
|
141
|
+
.lf-tool-overlay {
|
|
142
|
+
position: absolute;
|
|
143
|
+
inset: 0;
|
|
144
|
+
z-index: 2;
|
|
145
|
+
overflow: hidden;
|
|
146
|
+
pointer-events: none;
|
|
147
|
+
}
|
|
148
|
+
.lf-tool-overlay > * {
|
|
149
|
+
pointer-events: all;
|
|
150
|
+
}
|
|
151
|
+
/* modification-overlay */
|
|
152
|
+
.modification-overlay {
|
|
153
|
+
position: absolute;
|
|
154
|
+
inset: 0;
|
|
155
|
+
z-index: 1;
|
|
156
|
+
overflow: hidden;
|
|
157
|
+
pointer-events: none;
|
|
158
|
+
}
|
|
159
|
+
.modification-overlay > * {
|
|
160
|
+
pointer-events: all;
|
|
161
|
+
}
|
|
162
|
+
.lf-outline,
|
|
163
|
+
.lf-snapline {
|
|
164
|
+
pointer-events: none;
|
|
165
|
+
}
|
|
166
|
+
.lf-keyboard-tips {
|
|
167
|
+
float: right;
|
|
168
|
+
}
|
|
169
|
+
.lf-node-select-decorate {
|
|
170
|
+
position: absolute;
|
|
171
|
+
border: 1px dashed #343435;
|
|
172
|
+
transform: translate(-50%, -50%);
|
|
173
|
+
pointer-events: none;
|
|
174
|
+
}
|
|
175
|
+
.lf-multiple-select {
|
|
176
|
+
position: absolute;
|
|
177
|
+
border: 2px dashed #187dffcc;
|
|
178
|
+
box-shadow: 0 0 3px 0 #187dff80;
|
|
179
|
+
cursor: move;
|
|
180
|
+
}
|
|
181
|
+
.lf-edge-adjust-point {
|
|
182
|
+
cursor: move;
|
|
183
|
+
}
|
|
184
|
+
.lf-rotate-control {
|
|
185
|
+
cursor: grabbing;
|
|
186
|
+
}
|
|
187
|
+
.lf-resize-control-nw {
|
|
188
|
+
cursor: nw-resize;
|
|
189
|
+
}
|
|
190
|
+
.lf-resize-control-n {
|
|
191
|
+
cursor: n-resize;
|
|
192
|
+
}
|
|
193
|
+
.lf-resize-control-ne {
|
|
194
|
+
cursor: ne-resize;
|
|
195
|
+
}
|
|
196
|
+
.lf-resize-control-e {
|
|
197
|
+
cursor: e-resize;
|
|
198
|
+
}
|
|
199
|
+
.lf-resize-control-se {
|
|
200
|
+
cursor: se-resize;
|
|
201
|
+
}
|
|
202
|
+
.lf-resize-control-s {
|
|
203
|
+
cursor: s-resize;
|
|
204
|
+
}
|
|
205
|
+
.lf-resize-control-sw {
|
|
206
|
+
cursor: sw-resize;
|
|
207
|
+
}
|
|
208
|
+
.lf-resize-control-w {
|
|
209
|
+
cursor: w-resize;
|
|
210
|
+
}
|
package/{types → es}/index.d.ts
RENAMED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { h } from 'preact';
|
|
1
|
+
import { createElement as h, createRef, Component } from 'preact/compat';
|
|
2
2
|
import LogicFlow from './LogicFlow';
|
|
3
3
|
import * as LogicFlowUtil from './util';
|
|
4
4
|
export declare function observer<P>(props: P): any;
|
|
5
|
-
export { LogicFlow, h };
|
|
6
|
-
export { LogicFlowUtil };
|
|
7
|
-
export * from './type/index';
|
|
5
|
+
export { LogicFlow, h, createRef, Component, LogicFlowUtil };
|
|
8
6
|
export * from './view';
|
|
9
7
|
export * from './model';
|
|
10
|
-
export * from './keyboard';
|
|
11
8
|
export * from './options';
|
|
12
|
-
export
|
|
9
|
+
export * from './keyboard';
|
|
10
|
+
export { ElementState, ModelType, ElementType, EventType } from './constant';
|
|
13
11
|
export { formateAnchorConnectValidateData } from './util/node';
|
|
14
12
|
export default LogicFlow;
|
package/es/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { observer as mobxObserver } from 'mobx-preact';
|
|
2
|
+
import { createElement as h, createRef, Component } from 'preact/compat';
|
|
3
|
+
import LogicFlow from './LogicFlow';
|
|
4
|
+
import * as LogicFlowUtil from './util';
|
|
5
|
+
export function observer(props) {
|
|
6
|
+
return mobxObserver(props);
|
|
7
|
+
}
|
|
8
|
+
export { LogicFlow, h, createRef, Component, LogicFlowUtil };
|
|
9
|
+
export * from './view';
|
|
10
|
+
export * from './model';
|
|
11
|
+
export * from './options';
|
|
12
|
+
export * from './keyboard';
|
|
13
|
+
export { ElementState, ModelType, ElementType, EventType } from './constant';
|
|
14
|
+
export { formateAnchorConnectValidateData } from './util/node';
|
|
15
|
+
export default LogicFlow;
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
package/es/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,aAAa,IAAI,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACxE,OAAO,SAAS,MAAM,aAAa,CAAA;AAEnC,OAAO,KAAK,aAAa,MAAM,QAAQ,CAAA;AAEvC,MAAM,UAAU,QAAQ,CAAI,KAAQ;IAClC,OAAO,YAAY,CAAC,KAAY,CAAC,CAAA;AACnC,CAAC;AAED,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,CAAA;AAE5D,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE5E,OAAO,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAA;AAE9D,eAAe,SAAS,CAAA"}
|
package/es/index.less
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import url('./style/index');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MousetrapInstance } from 'mousetrap';
|
|
2
2
|
import LogicFlow from '../LogicFlow';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type Action = 'keypress' | 'keydown' | 'keyup';
|
|
4
|
+
export type Handler = (e: KeyboardEvent) => void;
|
|
5
5
|
export interface KeyboardDef {
|
|
6
6
|
enabled: boolean;
|
|
7
7
|
shortcuts?: Array<{
|
|
@@ -10,15 +10,15 @@ export interface KeyboardDef {
|
|
|
10
10
|
action?: Action;
|
|
11
11
|
}>;
|
|
12
12
|
}
|
|
13
|
-
export interface
|
|
13
|
+
export interface KeyboardOptions {
|
|
14
14
|
lf: LogicFlow;
|
|
15
15
|
keyboard?: KeyboardDef;
|
|
16
16
|
}
|
|
17
|
-
declare class Keyboard {
|
|
17
|
+
export declare class Keyboard {
|
|
18
18
|
readonly mousetrap: MousetrapInstance;
|
|
19
|
-
options:
|
|
20
|
-
private target;
|
|
21
|
-
constructor(options:
|
|
19
|
+
options: KeyboardOptions;
|
|
20
|
+
private readonly target;
|
|
21
|
+
constructor(options: KeyboardOptions);
|
|
22
22
|
initShortcuts(): void;
|
|
23
23
|
on(keys: string | string[], callback: Handler, action?: Action): void;
|
|
24
24
|
get disabled(): boolean;
|
|
@@ -28,5 +28,4 @@ declare class Keyboard {
|
|
|
28
28
|
private getKeys;
|
|
29
29
|
protected formatKey(key: string): string;
|
|
30
30
|
}
|
|
31
|
-
export { Keyboard };
|
|
32
31
|
export default Keyboard;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { isArray } from 'lodash-es';
|
|
2
|
+
import Mousetrap from 'mousetrap';
|
|
3
|
+
var Keyboard = /** @class */ (function () {
|
|
4
|
+
function Keyboard(options) {
|
|
5
|
+
if (!options.keyboard) {
|
|
6
|
+
options.keyboard = { enabled: false };
|
|
7
|
+
}
|
|
8
|
+
this.options = options;
|
|
9
|
+
var lf = options.lf;
|
|
10
|
+
this.target = lf.container;
|
|
11
|
+
this.mousetrap = new Mousetrap(this.target);
|
|
12
|
+
// 默认开启快捷键,且不是静默模式时enable
|
|
13
|
+
if (options.keyboard.enabled && !lf.options.isSilentMode) {
|
|
14
|
+
this.enable(true);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
Keyboard.prototype.initShortcuts = function () {
|
|
18
|
+
var _this = this;
|
|
19
|
+
var _a;
|
|
20
|
+
var shortcuts = ((_a = this.options.keyboard) !== null && _a !== void 0 ? _a : {}).shortcuts;
|
|
21
|
+
if (shortcuts) {
|
|
22
|
+
if (isArray(shortcuts)) {
|
|
23
|
+
shortcuts.forEach(function (_a) {
|
|
24
|
+
var keys = _a.keys, callback = _a.callback, action = _a.action;
|
|
25
|
+
return _this.on(keys, callback, action);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
var keys = shortcuts.keys, callback = shortcuts.callback, action = shortcuts.action;
|
|
30
|
+
this.on(keys, callback, action);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
Keyboard.prototype.on = function (keys, callback, action) {
|
|
35
|
+
this.mousetrap.bind(this.getKeys(keys), callback, action);
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(Keyboard.prototype, "disabled", {
|
|
38
|
+
get: function () {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
return ((_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.keyboard) === null || _b === void 0 ? void 0 : _b.enabled) !== true;
|
|
41
|
+
},
|
|
42
|
+
enumerable: false,
|
|
43
|
+
configurable: true
|
|
44
|
+
});
|
|
45
|
+
Keyboard.prototype.off = function (keys, action) {
|
|
46
|
+
this.mousetrap.unbind(this.getKeys(keys), action);
|
|
47
|
+
};
|
|
48
|
+
Keyboard.prototype.enable = function (force) {
|
|
49
|
+
if (this.disabled || force) {
|
|
50
|
+
if (this.options.keyboard) {
|
|
51
|
+
this.options.keyboard.enabled = true;
|
|
52
|
+
}
|
|
53
|
+
if (this.target instanceof HTMLElement) {
|
|
54
|
+
this.target.setAttribute('tabindex', '-1');
|
|
55
|
+
// 去掉节点被选中时container出现的边框
|
|
56
|
+
this.target.style.outline = 'none';
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
Keyboard.prototype.disable = function () {
|
|
61
|
+
if (!this.disabled) {
|
|
62
|
+
if (this.options.keyboard) {
|
|
63
|
+
this.options.keyboard.enabled = false;
|
|
64
|
+
}
|
|
65
|
+
if (this.target instanceof HTMLElement) {
|
|
66
|
+
this.target.removeAttribute('tabindex');
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
Keyboard.prototype.getKeys = function (keys) {
|
|
71
|
+
var _this = this;
|
|
72
|
+
return (Array.isArray(keys) ? keys : [keys]).map(function (key) {
|
|
73
|
+
return _this.formatKey(key);
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
Keyboard.prototype.formatKey = function (key) {
|
|
77
|
+
return key
|
|
78
|
+
.toLowerCase()
|
|
79
|
+
.replace(/\s/g, '')
|
|
80
|
+
.replace('delete', 'del')
|
|
81
|
+
.replace('cmd', 'command');
|
|
82
|
+
};
|
|
83
|
+
return Keyboard;
|
|
84
|
+
}());
|
|
85
|
+
export { Keyboard };
|
|
86
|
+
export default Keyboard;
|
|
87
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/keyboard/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,SAAgC,MAAM,WAAW,CAAA;AAoBxD;IAKE,kBAAY,OAAwB;QAClC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YACtB,OAAO,CAAC,QAAQ,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,CAAA;QACvC,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACd,IAAA,EAAE,GAAK,OAAO,GAAZ,CAAY;QACtB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,SAAS,CAAA;QAC1B,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC3C,yBAAyB;QACzB,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;YACzD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QACn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A;IAC9B,CAAC;IACH,eAAC;AAAD,CAAC,AAlFD,IAkFC;;AAED,eAAe,QAAQ,CAAA"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
var selected = null;
|
|
2
|
+
function translationNodeData(nodeData, distance) {
|
|
3
|
+
nodeData.x += distance;
|
|
4
|
+
nodeData.y += distance;
|
|
5
|
+
if (nodeData.text) {
|
|
6
|
+
nodeData.text.x += distance;
|
|
7
|
+
nodeData.text.y += distance;
|
|
8
|
+
}
|
|
9
|
+
return nodeData;
|
|
10
|
+
}
|
|
11
|
+
function translationEdgeData(edgeData, distance) {
|
|
12
|
+
if (edgeData.startPoint) {
|
|
13
|
+
edgeData.startPoint.x += distance;
|
|
14
|
+
edgeData.startPoint.y += distance;
|
|
15
|
+
}
|
|
16
|
+
if (edgeData.endPoint) {
|
|
17
|
+
edgeData.endPoint.x += distance;
|
|
18
|
+
edgeData.endPoint.y += distance;
|
|
19
|
+
}
|
|
20
|
+
if (edgeData.pointsList && edgeData.pointsList.length > 0) {
|
|
21
|
+
edgeData.pointsList.forEach(function (point) {
|
|
22
|
+
point.x += distance;
|
|
23
|
+
point.y += distance;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
if (edgeData.text) {
|
|
27
|
+
edgeData.text.x += distance;
|
|
28
|
+
edgeData.text.y += distance;
|
|
29
|
+
}
|
|
30
|
+
return edgeData;
|
|
31
|
+
}
|
|
32
|
+
var TRANSLATION_DISTANCE = 40;
|
|
33
|
+
var CHILDREN_TRANSLATION_DISTANCE = 40;
|
|
34
|
+
export function initDefaultShortcut(lf, graph) {
|
|
35
|
+
var keyboard = lf.keyboard;
|
|
36
|
+
var keyboardOptions = keyboard.options.keyboard;
|
|
37
|
+
// 复制
|
|
38
|
+
keyboard.on(['cmd + c', 'ctrl + c'], function () {
|
|
39
|
+
CHILDREN_TRANSLATION_DISTANCE = TRANSLATION_DISTANCE;
|
|
40
|
+
if (!(keyboardOptions === null || keyboardOptions === void 0 ? void 0 : keyboardOptions.enabled))
|
|
41
|
+
return true;
|
|
42
|
+
if (graph.textEditElement)
|
|
43
|
+
return true;
|
|
44
|
+
var guards = lf.options.guards;
|
|
45
|
+
var elements = graph.getSelectElements(false);
|
|
46
|
+
var enabledClone = guards && guards.beforeClone ? guards.beforeClone(elements) : true;
|
|
47
|
+
if (!enabledClone ||
|
|
48
|
+
(elements.nodes.length === 0 && elements.edges.length === 0)) {
|
|
49
|
+
selected = null;
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
selected = elements;
|
|
53
|
+
selected.nodes.forEach(function (node) {
|
|
54
|
+
return translationNodeData(node, TRANSLATION_DISTANCE);
|
|
55
|
+
});
|
|
56
|
+
selected.edges.forEach(function (edge) {
|
|
57
|
+
return translationEdgeData(edge, TRANSLATION_DISTANCE);
|
|
58
|
+
});
|
|
59
|
+
return false;
|
|
60
|
+
});
|
|
61
|
+
// 粘贴
|
|
62
|
+
keyboard.on(['cmd + v', 'ctrl + v'], function () {
|
|
63
|
+
if (!(keyboardOptions === null || keyboardOptions === void 0 ? void 0 : keyboardOptions.enabled))
|
|
64
|
+
return true;
|
|
65
|
+
if (graph.textEditElement)
|
|
66
|
+
return true;
|
|
67
|
+
if (selected && (selected.nodes || selected.edges)) {
|
|
68
|
+
lf.clearSelectElements();
|
|
69
|
+
var addElements = lf.addElements(selected, CHILDREN_TRANSLATION_DISTANCE);
|
|
70
|
+
if (!addElements)
|
|
71
|
+
return true;
|
|
72
|
+
addElements.nodes.forEach(function (node) { return lf.selectElementById(node.id, true); });
|
|
73
|
+
addElements.edges.forEach(function (edge) { return lf.selectElementById(edge.id, true); });
|
|
74
|
+
selected.nodes.forEach(function (node) {
|
|
75
|
+
return translationNodeData(node, TRANSLATION_DISTANCE);
|
|
76
|
+
});
|
|
77
|
+
selected.edges.forEach(function (edge) {
|
|
78
|
+
return translationEdgeData(edge, TRANSLATION_DISTANCE);
|
|
79
|
+
});
|
|
80
|
+
CHILDREN_TRANSLATION_DISTANCE =
|
|
81
|
+
CHILDREN_TRANSLATION_DISTANCE + TRANSLATION_DISTANCE;
|
|
82
|
+
}
|
|
83
|
+
return false;
|
|
84
|
+
});
|
|
85
|
+
// undo
|
|
86
|
+
keyboard.on(['cmd + z', 'ctrl + z'], function () {
|
|
87
|
+
if (!(keyboardOptions === null || keyboardOptions === void 0 ? void 0 : keyboardOptions.enabled))
|
|
88
|
+
return true;
|
|
89
|
+
if (graph.textEditElement)
|
|
90
|
+
return true;
|
|
91
|
+
lf.undo();
|
|
92
|
+
return false;
|
|
93
|
+
});
|
|
94
|
+
// redo
|
|
95
|
+
keyboard.on(['cmd + y', 'ctrl + y'], function () {
|
|
96
|
+
if (!(keyboardOptions === null || keyboardOptions === void 0 ? void 0 : keyboardOptions.enabled))
|
|
97
|
+
return true;
|
|
98
|
+
if (graph.textEditElement)
|
|
99
|
+
return true;
|
|
100
|
+
lf.redo();
|
|
101
|
+
return false;
|
|
102
|
+
});
|
|
103
|
+
// delete
|
|
104
|
+
keyboard.on(['backspace'], function () {
|
|
105
|
+
if (!(keyboardOptions === null || keyboardOptions === void 0 ? void 0 : keyboardOptions.enabled))
|
|
106
|
+
return true;
|
|
107
|
+
if (graph.textEditElement)
|
|
108
|
+
return true;
|
|
109
|
+
var elements = graph.getSelectElements(true);
|
|
110
|
+
lf.clearSelectElements();
|
|
111
|
+
elements.edges.forEach(function (edge) { return edge.id && lf.deleteEdge(edge.id); });
|
|
112
|
+
elements.nodes.forEach(function (node) { return node.id && lf.deleteNode(node.id); });
|
|
113
|
+
return false;
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=shortcut.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shortcut.js","sourceRoot":"","sources":["../../src/keyboard/shortcut.ts"],"names":[],"mappings":"AAMA,IAAI,QAAQ,GAA+B,IAAI,CAAA;AAE/C,SAAS,mBAAmB,CAAC,QAAkB,EAAE,QAAgB;IAC/D,QAAQ,CA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