@logicflow/core 1.2.27 → 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,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
29
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
30
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
31
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
32
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
exports.OutlineOverlay = void 0;
|
|
36
|
+
var jsx_runtime_1 = require("preact/jsx-runtime");
|
|
37
|
+
var compat_1 = require("preact/compat");
|
|
38
|
+
var shape_1 = require("../shape");
|
|
39
|
+
var __1 = require("../..");
|
|
40
|
+
var constant_1 = require("../../constant");
|
|
41
|
+
var util_1 = require("../../util");
|
|
42
|
+
var OutlineOverlay = /** @class */ (function (_super) {
|
|
43
|
+
__extends(OutlineOverlay, _super);
|
|
44
|
+
function OutlineOverlay() {
|
|
45
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
46
|
+
}
|
|
47
|
+
// 节点outline
|
|
48
|
+
OutlineOverlay.prototype.getNodesOutline = function () {
|
|
49
|
+
var graphModel = this.props.graphModel;
|
|
50
|
+
var nodes = graphModel.nodes, _a = graphModel.editConfigModel, hoverOutline = _a.hoverOutline, nodeSelectedOutline = _a.nodeSelectedOutline;
|
|
51
|
+
var nodeOutline = [];
|
|
52
|
+
nodes.forEach(function (element) {
|
|
53
|
+
if (element.isHovered || element.isSelected) {
|
|
54
|
+
var isHovered = element.isHovered, isSelected = element.isSelected, x = element.x, y = element.y, width = element.width, height = element.height;
|
|
55
|
+
if ((nodeSelectedOutline && isSelected) ||
|
|
56
|
+
(hoverOutline && isHovered)) {
|
|
57
|
+
var style_1 = element.getOutlineStyle();
|
|
58
|
+
var attributes_1 = {};
|
|
59
|
+
Object.keys(style_1).forEach(function (key) {
|
|
60
|
+
if (key !== 'hover') {
|
|
61
|
+
attributes_1[key] = style_1[key];
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
if (isHovered) {
|
|
65
|
+
var hoverStyle = style_1.hover;
|
|
66
|
+
attributes_1 = __assign(__assign({}, attributes_1), hoverStyle);
|
|
67
|
+
}
|
|
68
|
+
nodeOutline.push((0, jsx_runtime_1.jsx)(shape_1.Rect, __assign({ transform: element.transform, className: "lf-outline-node", x: x, y: y,
|
|
69
|
+
// width: width + 10,
|
|
70
|
+
// height: height + 10,
|
|
71
|
+
width: width + 10,
|
|
72
|
+
height: height + 10 }, attributes_1)));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
return nodeOutline;
|
|
77
|
+
};
|
|
78
|
+
// 边的outline
|
|
79
|
+
OutlineOverlay.prototype.getEdgeOutline = function () {
|
|
80
|
+
var _a = this.props.graphModel, edgeList = _a.edges, _b = _a.editConfigModel, edgeSelectedOutline = _b.edgeSelectedOutline, hoverOutline = _b.hoverOutline;
|
|
81
|
+
var edgeOutline = [];
|
|
82
|
+
for (var i = 0; i < edgeList.length; i++) {
|
|
83
|
+
var edge = edgeList[i];
|
|
84
|
+
if ((edgeSelectedOutline && edge.isSelected) ||
|
|
85
|
+
(hoverOutline && edge.isHovered)) {
|
|
86
|
+
if (edge.modelType === constant_1.ModelType.LINE_EDGE) {
|
|
87
|
+
edgeOutline.push(this.getLineOutline(edge));
|
|
88
|
+
}
|
|
89
|
+
else if (edge.modelType === constant_1.ModelType.POLYLINE_EDGE) {
|
|
90
|
+
edgeOutline.push(this.getPolylineOutline(edge));
|
|
91
|
+
}
|
|
92
|
+
else if (edge.modelType === constant_1.ModelType.BEZIER_EDGE) {
|
|
93
|
+
edgeOutline.push(this.getBezierOutline(edge));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return edgeOutline;
|
|
98
|
+
};
|
|
99
|
+
// 直线outline
|
|
100
|
+
OutlineOverlay.prototype.getLineOutline = function (line) {
|
|
101
|
+
var startPoint = line.startPoint, endPoint = line.endPoint;
|
|
102
|
+
var x = (startPoint.x + endPoint.x) / 2;
|
|
103
|
+
var y = (startPoint.y + endPoint.y) / 2;
|
|
104
|
+
var width = Math.abs(startPoint.x - endPoint.x) + 10;
|
|
105
|
+
var height = Math.abs(startPoint.y - endPoint.y) + 10;
|
|
106
|
+
var style = line.getOutlineStyle();
|
|
107
|
+
return ((0, jsx_runtime_1.jsx)(shape_1.Rect, __assign({ className: "lf-outline-edge", x: x, y: y, width: width, height: height }, style)));
|
|
108
|
+
};
|
|
109
|
+
// 折线outline
|
|
110
|
+
OutlineOverlay.prototype.getPolylineOutline = function (polyline) {
|
|
111
|
+
var points = polyline.points;
|
|
112
|
+
var pointsList = (0, util_1.points2PointsList)(points);
|
|
113
|
+
var bbox = (0, util_1.getBBoxOfPoints)(pointsList, 8);
|
|
114
|
+
var x = bbox.x, y = bbox.y, width = bbox.width, height = bbox.height;
|
|
115
|
+
var style = polyline.getOutlineStyle();
|
|
116
|
+
return ((0, jsx_runtime_1.jsx)(shape_1.Rect, __assign({ className: "lf-outline", x: x, y: y, width: width, height: height }, style)));
|
|
117
|
+
};
|
|
118
|
+
// 曲线outline
|
|
119
|
+
OutlineOverlay.prototype.getBezierOutline = function (bezier) {
|
|
120
|
+
var path = bezier.path;
|
|
121
|
+
var pointsList = (0, util_1.getBezierPoints)(path);
|
|
122
|
+
var bbox = (0, util_1.getBBoxOfPoints)(pointsList, 8);
|
|
123
|
+
var x = bbox.x, y = bbox.y, width = bbox.width, height = bbox.height;
|
|
124
|
+
var style = bezier.getOutlineStyle();
|
|
125
|
+
return ((0, jsx_runtime_1.jsx)(shape_1.Rect, __assign({ className: "lf-outline", x: x, y: y, width: width, height: height }, style)));
|
|
126
|
+
};
|
|
127
|
+
OutlineOverlay.prototype.render = function () {
|
|
128
|
+
return ((0, jsx_runtime_1.jsxs)("g", { className: "lf-outline", children: [this.getNodesOutline(), this.getEdgeOutline()] }));
|
|
129
|
+
};
|
|
130
|
+
OutlineOverlay = __decorate([
|
|
131
|
+
__1.observer
|
|
132
|
+
], OutlineOverlay);
|
|
133
|
+
return OutlineOverlay;
|
|
134
|
+
}(compat_1.Component));
|
|
135
|
+
exports.OutlineOverlay = OutlineOverlay;
|
|
136
|
+
exports.default = OutlineOverlay;
|
|
137
|
+
//# sourceMappingURL=OutlineOverlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OutlineOverlay.js","sourceRoot":"","sources":["../../../src/view/overlay/OutlineOverlay.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAAyC;AACzC,kCAA+B;AAC/B,2BAAgC;AAChC,2CAA0C;AAO1C,mCAAgF;AAOhF;IAAoC,kCAAiB;IAArD;;IAsJA,CAAC;IArJC,YAAY;IACZ,wCAAe,GAAf;QACU,IAAA,UAAU,GAAK,IAAI,CAAC,KAAK,WAAf,CAAe;QAE/B,IAAA,KAAK,GAEH,UAAU,MAFP,EACL,KACE,UAAU,gBAD0C,EAAnC,YAAY,kBAAA,EAAE,mBAAmB,yBAAE,CAC1C;QACd,IAAM,WAAW,GAAQ,EAAE,CAAA;QAC3B,KAAK,CAAC,OAAO,CAAC,UAAC,OAAO;YACpB,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;gBACpC,IAAA,SAAS,GAAsC,OAAO,UAA7C,EAAE,UAAU,GAA0B,OAAO,WAAjC,EAAE,CAAC,GAAuB,OAAO,EAA9B,EAAE,CAAC,GAAoB,OAAO,EAA3B,EAAE,KAAK,GAAa,OAAO,MAApB,EAAE,MAAM,GAAK,OAAO,OAAZ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OAAO,CACL,uBAAC,YAAI,aACH,SAAS,EAAC,YAAY,EAEpB,CAAC,GAAA,EACD,CAAC,GAAA,EACD,KAAK,OAAA,EACL,MAAM,QAAA,IAEJ,KAAK,EACT,CACH,CAAA;IACH,CAAC;IAED,+BAAM,GAAN;QACE,OAAO,CACL,+BAAG,SAAS,EAAC,YAAY,aACtB,IAAI,CAAC,eAAe,EAAE,EACtB,IAAI,CAAC,cAAc,EAAE,IACpB,CACL,CAAA;IACH,CAAC;IArJU,cAAc;QAD1B,YAAQ;OACI,cAAc,CAsJ1B;IAAD,qBAAC;CAAA,AAtJD,CAAoC,kBAAS,GAsJ5C;AAtJY,wCAAc;AAwJ3B,kBAAe,cAAc,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Component } from 'preact/compat';
|
|
2
|
+
import SnaplineModel from '../../model/SnaplineModel';
|
|
3
|
+
import OutlineOverlay from './OutlineOverlay';
|
|
4
|
+
type IProps = {
|
|
5
|
+
snaplineModel?: SnaplineModel;
|
|
6
|
+
};
|
|
7
|
+
export declare class SnaplineOverlay extends Component<IProps> {
|
|
8
|
+
render(): import("preact/compat").JSX.Element;
|
|
9
|
+
}
|
|
10
|
+
export default OutlineOverlay;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
29
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
30
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
31
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
32
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
33
|
+
};
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.SnaplineOverlay = void 0;
|
|
39
|
+
var jsx_runtime_1 = require("preact/jsx-runtime");
|
|
40
|
+
var compat_1 = require("preact/compat");
|
|
41
|
+
var Line_1 = __importDefault(require("../shape/Line"));
|
|
42
|
+
var __1 = require("../..");
|
|
43
|
+
var OutlineOverlay_1 = __importDefault(require("./OutlineOverlay"));
|
|
44
|
+
var SnaplineOverlay = /** @class */ (function (_super) {
|
|
45
|
+
__extends(SnaplineOverlay, _super);
|
|
46
|
+
function SnaplineOverlay() {
|
|
47
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
48
|
+
}
|
|
49
|
+
SnaplineOverlay.prototype.render = function () {
|
|
50
|
+
var snaplineModel = this.props.snaplineModel;
|
|
51
|
+
var _a = snaplineModel !== null && snaplineModel !== void 0 ? snaplineModel : {}, position = _a.position, isShowHorizontal = _a.isShowHorizontal, isShowVertical = _a.isShowVertical;
|
|
52
|
+
var style = snaplineModel === null || snaplineModel === void 0 ? void 0 : snaplineModel.getStyle();
|
|
53
|
+
var _b = position !== null && position !== void 0 ? position : {}, _c = _b.x, x = _c === void 0 ? 0 : _c, _d = _b.y, y = _d === void 0 ? 0 : _d;
|
|
54
|
+
// 展示横向,纵向默认-100000,100000 减少计算量
|
|
55
|
+
var horizontalLine = __assign(__assign({ x1: -100000, y1: y, x2: 100000, y2: y }, style), { stroke: isShowHorizontal ? style === null || style === void 0 ? void 0 : style.stroke : 'none' });
|
|
56
|
+
var verticalLine = __assign(__assign({ x1: x, y1: -100000, x2: x, y2: 100000 }, style), { stroke: isShowVertical ? style === null || style === void 0 ? void 0 : style.stroke : 'none' });
|
|
57
|
+
return ((0, jsx_runtime_1.jsxs)("g", { className: "lf-snapline", children: [(0, jsx_runtime_1.jsx)(Line_1.default, __assign({}, horizontalLine)), (0, jsx_runtime_1.jsx)(Line_1.default, __assign({}, verticalLine))] }));
|
|
58
|
+
};
|
|
59
|
+
SnaplineOverlay = __decorate([
|
|
60
|
+
__1.observer
|
|
61
|
+
], SnaplineOverlay);
|
|
62
|
+
return SnaplineOverlay;
|
|
63
|
+
}(compat_1.Component));
|
|
64
|
+
exports.SnaplineOverlay = SnaplineOverlay;
|
|
65
|
+
exports.default = OutlineOverlay_1.default;
|
|
66
|
+
//# sourceMappingURL=SnaplineOverlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SnaplineOverlay.js","sourceRoot":"","sources":["../../../src/view/overlay/SnaplineOverlay.tsx"],"names":[],"mappings":";;;;;;;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AA;IACH,CAAC;IA7BU,eAAe;QAD3B,YAAQ;OACI,eAAe,CA8B3B;IAAD,sBAAC;CAAA,AA9BD,CAAqC,kBAAS,GA8B7C;AA9BY,0CAAe;AAgC5B,kBAAe,wBAAc,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createElement as h, Component } from 'preact/compat';
|
|
2
|
+
import { OutlineOverlay } from '.';
|
|
3
|
+
import { GraphModel } from '../../model';
|
|
4
|
+
import { Tool } from '../../tool';
|
|
5
|
+
type IProps = {
|
|
6
|
+
graphModel: GraphModel;
|
|
7
|
+
tool: Tool;
|
|
8
|
+
};
|
|
9
|
+
export declare class ToolOverlay extends Component<IProps> {
|
|
10
|
+
componentDidMount(): void;
|
|
11
|
+
componentDidUpdate(): void;
|
|
12
|
+
/**
|
|
13
|
+
* 外部传入的一般是HTMLElement
|
|
14
|
+
*/
|
|
15
|
+
getTools(): import("preact").VNode<import("../../tool").IToolProps>[];
|
|
16
|
+
triggerToolRender(): void;
|
|
17
|
+
render(): h.JSX.Element;
|
|
18
|
+
}
|
|
19
|
+
export default OutlineOverlay;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.ToolOverlay = void 0;
|
|
25
|
+
var jsx_runtime_1 = require("preact/jsx-runtime");
|
|
26
|
+
var compat_1 = require("preact/compat");
|
|
27
|
+
var _1 = require(".");
|
|
28
|
+
var __1 = require("../..");
|
|
29
|
+
var ToolOverlay = /** @class */ (function (_super) {
|
|
30
|
+
__extends(ToolOverlay, _super);
|
|
31
|
+
function ToolOverlay() {
|
|
32
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
33
|
+
}
|
|
34
|
+
// 在react严格模式下,useEffect会执行两次,但是在LogicFlow内部,则只会触发一次componentDidMount和componentDidUpdate。
|
|
35
|
+
// 其中第一次componentDidMount对应的graphModel为被丢弃的graphModel, 所以不应该生效。
|
|
36
|
+
// 在非react环境下,只会触发一次componentDidMount,不会触发componentDidUpdate。
|
|
37
|
+
// 所以这里采用componentDidUpdate和componentDidMount都去触发插件的render方法。
|
|
38
|
+
ToolOverlay.prototype.componentDidMount = function () {
|
|
39
|
+
this.triggerToolRender();
|
|
40
|
+
};
|
|
41
|
+
ToolOverlay.prototype.componentDidUpdate = function () {
|
|
42
|
+
this.triggerToolRender();
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* 外部传入的一般是HTMLElement
|
|
46
|
+
*/
|
|
47
|
+
ToolOverlay.prototype.getTools = function () {
|
|
48
|
+
var _a = this.props, tool = _a.tool, graphModel = _a.graphModel;
|
|
49
|
+
var textEditElement = graphModel.textEditElement;
|
|
50
|
+
var tools = tool.getTools();
|
|
51
|
+
var components = tools.map(function (t) {
|
|
52
|
+
return (0, compat_1.createElement)(t, {
|
|
53
|
+
textEditElement: textEditElement,
|
|
54
|
+
graphModel: graphModel,
|
|
55
|
+
logicFlow: tool.instance,
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
tool.components = components;
|
|
59
|
+
return components;
|
|
60
|
+
};
|
|
61
|
+
ToolOverlay.prototype.triggerToolRender = function () {
|
|
62
|
+
var _a = this.props, tool = _a.tool, graphModel = _a.graphModel;
|
|
63
|
+
var ToolOverlayElement = document.querySelector("#ToolOverlay_".concat(graphModel.flowId));
|
|
64
|
+
var lf = tool.getInstance();
|
|
65
|
+
lf.components.forEach(function (render) { return render(lf, ToolOverlayElement); });
|
|
66
|
+
lf.components = []; // 保证extension组件的render只执行一次
|
|
67
|
+
};
|
|
68
|
+
ToolOverlay.prototype.render = function () {
|
|
69
|
+
var graphModel = this.props.graphModel;
|
|
70
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "lf-tool-overlay", id: "ToolOverlay_".concat(graphModel.flowId), children: this.getTools() }));
|
|
71
|
+
};
|
|
72
|
+
ToolOverlay = __decorate([
|
|
73
|
+
__1.observer
|
|
74
|
+
], ToolOverlay);
|
|
75
|
+
return ToolOverlay;
|
|
76
|
+
}(compat_1.Component));
|
|
77
|
+
exports.ToolOverlay = ToolOverlay;
|
|
78
|
+
exports.default = _1.OutlineOverlay;
|
|
79
|
+
//# sourceMappingURL=ToolOverlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolOverlay.js","sourceRoot":"","sources":["../../../src/view/overlay/ToolOverlay.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAA6D;AAC7D,sBAAkC;AAClC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GAAN;QACU,IAAA,UAAU,GAAK,IAAI,CAAC,KAAK,WAAf,CAAe;QACjC,OAAO,CACL,gCAAK,SAAS,EAAC,iBAAiB,EAAC,EAAE,EAAE,sBAAe,UAAU,CAAC,MAAM,CAAE,YACpE,IAAI,CAAC,QAAQ,EAAE,GACZ,CACP,CAAA;IACH,CAAC;IAhDU,WAAW;QADvB,YAAQ;OACI,WAAW,CAiDvB;IAAD,kBAAC;CAAA,AAjDD,CAAiC,kBAAS,GAiDzC;AAjDY,kCAAW;AAmDxB,kBAAe,iBAAc,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ComponentType } from 'preact';
|
|
2
|
+
import GraphModel from '../../model/GraphModel';
|
|
3
|
+
type IProps = {
|
|
4
|
+
graphModel: GraphModel;
|
|
5
|
+
};
|
|
6
|
+
export type GraphTransform = {
|
|
7
|
+
transform: string;
|
|
8
|
+
transformOrigin: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function getTransform<P>(WrappedComponent: ComponentType<P>): {
|
|
11
|
+
new (props?: (IProps & P) | undefined, context?: any): {
|
|
12
|
+
getMatrixString(): GraphTransform;
|
|
13
|
+
render(): import("preact").JSX.Element;
|
|
14
|
+
componentWillMount?(): void;
|
|
15
|
+
componentDidMount?(): void;
|
|
16
|
+
componentWillUnmount?(): void;
|
|
17
|
+
getChildContext?(): object;
|
|
18
|
+
componentWillReceiveProps?(nextProps: Readonly<IProps & P>, nextContext: any): void;
|
|
19
|
+
shouldComponentUpdate?(nextProps: Readonly<IProps & P>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
20
|
+
componentWillUpdate?(nextProps: Readonly<IProps & P>, nextState: Readonly<{}>, nextContext: any): void;
|
|
21
|
+
getSnapshotBeforeUpdate?(oldProps: Readonly<IProps & P>, oldState: Readonly<{}>): any;
|
|
22
|
+
componentDidUpdate?(previousProps: Readonly<IProps & P>, previousState: Readonly<{}>, snapshot: any): void;
|
|
23
|
+
componentDidCatch?(error: any, errorInfo: import("preact").ErrorInfo): void;
|
|
24
|
+
state: Readonly<{}>;
|
|
25
|
+
props: import("preact").RenderableProps<IProps & P, any>;
|
|
26
|
+
context: any;
|
|
27
|
+
base?: Element | Text | undefined;
|
|
28
|
+
setState<K extends never>(state: Partial<{}> | ((prevState: Readonly<{}>, props: Readonly<IProps & P>) => Partial<{}> | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
29
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
30
|
+
};
|
|
31
|
+
displayName?: string | undefined;
|
|
32
|
+
defaultProps?: any;
|
|
33
|
+
contextType?: import("preact").Context<any> | undefined;
|
|
34
|
+
getDerivedStateFromProps?(props: object, state: object): object | null;
|
|
35
|
+
getDerivedStateFromError?(error: any): object | null;
|
|
36
|
+
};
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.getTransform = void 0;
|
|
30
|
+
var jsx_runtime_1 = require("preact/jsx-runtime");
|
|
31
|
+
var preact_1 = require("preact");
|
|
32
|
+
function getTransform(WrappedComponent) {
|
|
33
|
+
return /** @class */ (function (_super) {
|
|
34
|
+
__extends(class_1, _super);
|
|
35
|
+
function class_1() {
|
|
36
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
37
|
+
}
|
|
38
|
+
class_1.prototype.getMatrixString = function () {
|
|
39
|
+
var graphModel = this.props.graphModel;
|
|
40
|
+
var _a = graphModel.transformModel, SCALE_X = _a.SCALE_X, SKEW_Y = _a.SKEW_Y, SKEW_X = _a.SKEW_X, SCALE_Y = _a.SCALE_Y, TRANSLATE_X = _a.TRANSLATE_X, TRANSLATE_Y = _a.TRANSLATE_Y;
|
|
41
|
+
var matrixString = [
|
|
42
|
+
SCALE_X,
|
|
43
|
+
SKEW_Y,
|
|
44
|
+
SKEW_X,
|
|
45
|
+
SCALE_Y,
|
|
46
|
+
TRANSLATE_X,
|
|
47
|
+
TRANSLATE_Y,
|
|
48
|
+
].join(',');
|
|
49
|
+
return {
|
|
50
|
+
transform: "matrix(".concat(matrixString, ")"),
|
|
51
|
+
transformOrigin: 'left top',
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
class_1.prototype.render = function () {
|
|
55
|
+
return ((0, jsx_runtime_1.jsx)(WrappedComponent, __assign({}, this.props, { transformStyle: this.getMatrixString() })));
|
|
56
|
+
};
|
|
57
|
+
return class_1;
|
|
58
|
+
}(preact_1.Component));
|
|
59
|
+
}
|
|
60
|
+
exports.getTransform = getTransform;
|
|
61
|
+
//# sourceMappingURL=getTransformHoc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTransformHoc.js","sourceRoot":"","sources":["../../../src/view/overlay/getTransformHoc.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAiD;AAYjD,SAAgB,YAAY,CAAI,gBAAkC;IAChE;QAAqB,2BAAqB;QAAnC;;QAmCP,CAAC;QAlCC,iCAAe,GAAf;YACU,IAAA,UAAU,GAAK,IAAI,CAAC,KAAK,WAAf,CAAe;YAE/B,IAAA,KAQE,UAAU,eADX,EANC,OAAO,aAAA,EACP,MAAM,YAAA,EACN,MAAM,YAAA,EACN,OAAO,aAAA,EACP,WAAW,iBAAA,EACX,WAAW,iBACZ,CACW;YACd,IAAM,YAAY,GAAG;gBACnB,OAAO;gBACP,MAAM;gBACN,MAAM;gBACN,OAAO;gBACP,WAAW;gBACX,WAAW;aACZ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACX,OAAO;gBACL,SAAS,EAAE,iBAAU,YAAY,MAAG;gBACpC,eAAe,EAAE,UAAU;aAC5B,CAAA;QACH,CAAC;QAED,wBAAM,GAAN;YACE,OAAO,CACL,uBAAC,gBAAgB,eACV,IAAI,CAAC,KAAW,IACrB,cAAc,EAAE,IAAI,CAAC,eAAe,EAAE,IACtC,CACH,CAAA;QACH,CAAC;QACH,cAAC;IAAD,CAAC,AAnCM,CAAc,kBAAS,GAmC7B;AACH,CAAC;AArCD,oCAqCC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './CanvasOverlay';
|
|
2
|
+
export * from './BezierAdjustOverlay';
|
|
3
|
+
export * from './BackgroundOverlay';
|
|
4
|
+
export * from './Grid';
|
|
5
|
+
export * from './ModificationOverlay';
|
|
6
|
+
export * from './OutlineOverlay';
|
|
7
|
+
export * from './SnaplineOverlay';
|
|
8
|
+
export * from './ToolOverlay';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./CanvasOverlay"), exports);
|
|
18
|
+
__exportStar(require("./BezierAdjustOverlay"), exports);
|
|
19
|
+
__exportStar(require("./BackgroundOverlay"), exports);
|
|
20
|
+
__exportStar(require("./Grid"), exports);
|
|
21
|
+
__exportStar(require("./ModificationOverlay"), exports);
|
|
22
|
+
__exportStar(require("./OutlineOverlay"), exports);
|
|
23
|
+
__exportStar(require("./SnaplineOverlay"), exports);
|
|
24
|
+
__exportStar(require("./ToolOverlay"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/view/overlay/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA+B;AAC/B,wDAAqC;AACrC,sDAAmC;AACnC,yCAAsB;AACtB,wDAAqC;AACrC,mDAAgC;AAChC,oDAAiC;AACjC,gDAA6B"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
14
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
|
+
if (!m) return o;
|
|
16
|
+
var i = m.call(o), r, ar = [], e;
|
|
17
|
+
try {
|
|
18
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
19
|
+
}
|
|
20
|
+
catch (error) { e = { error: error }; }
|
|
21
|
+
finally {
|
|
22
|
+
try {
|
|
23
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
24
|
+
}
|
|
25
|
+
finally { if (e) throw e.error; }
|
|
26
|
+
}
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.Circle = void 0;
|
|
31
|
+
var jsx_runtime_1 = require("preact/jsx-runtime");
|
|
32
|
+
function Circle(props) {
|
|
33
|
+
var _a = props.x, x = _a === void 0 ? 0 : _a, _b = props.y, y = _b === void 0 ? 0 : _b, _c = props.r, r = _c === void 0 ? 4 : _c, className = props.className;
|
|
34
|
+
var attrs = {
|
|
35
|
+
cx: x,
|
|
36
|
+
cy: y,
|
|
37
|
+
r: r,
|
|
38
|
+
fill: 'transparent',
|
|
39
|
+
fillOpacity: 1,
|
|
40
|
+
strokeWidth: '1',
|
|
41
|
+
stroke: '#000',
|
|
42
|
+
strokeOpacity: 1,
|
|
43
|
+
};
|
|
44
|
+
Object.entries(props).forEach(function (_a) {
|
|
45
|
+
var _b = __read(_a, 2), k = _b[0], v = _b[1];
|
|
46
|
+
var valueType = typeof v;
|
|
47
|
+
if (valueType !== 'object') {
|
|
48
|
+
attrs[k] = v;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
if (className) {
|
|
52
|
+
attrs.className = "lf-basic-shape ".concat(className);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
attrs.className = 'lf-shape';
|
|
56
|
+
}
|
|
57
|
+
return (0, jsx_runtime_1.jsx)("circle", __assign({}, attrs));
|
|
58
|
+
}
|
|
59
|
+
exports.Circle = Circle;
|
|
60
|
+
exports.default = Circle;
|
|
61
|
+
//# sourceMappingURL=Circle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Circle.js","sourceRoot":"","sources":["../../../src/view/shape/Circle.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,MAAM,CAAC,KAAK;IAClB,IAAA,KAAmC,KAAK,EAAnC,EAAL,CAAC,mBAAG,CAAC,KAAA,EAAE,KAA4B,KAAK,EAA5B,EAAL,CAAC,mBAAG,CAAC,KAAA,EAAE,KAAqB,KAAK,EAArB,EAAL,CAAC,mBAAG,CAAC,KAAA,EAAE,SAAS,GAAK,KAAK,UAAV,CAAU;IAChD,IAAM,KAAK,GAAwB;QACjC,EAAE,EAAE,CAAC;QACL,EAAE,EAAE,CAAC;QACL,CAAC,GAAA;QACD,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,GAAG;QAChB,MAAM,EAAE,MAAM;QACd,aAAa,EAAE,CAAC;KACjB,CAAA;IACD,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,UAAC,EAAM;YAAN,KAAA,aAAM,EAAL,CAAC,QAAA,EAAE,CAAC,QAAA;QAClC,IAAM,SAAS,GAAG,OAAO,CAAC,CAAA;QAC1B,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;YAC3B,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;QACd,CAAC;IACH,CAAC,CAAC,CAAA;IACF,IAAI,SAAS,EAAE,CAAC;QACd,KAAK,CAAC,SAAS,GAAG,yBAAkB,SAAS,CAAE,CAAA;IACjD,CAAC;SAAM,CAAC;QACN,KAAK,CAAC,SAAS,GAAG,UAAU,CAAA;IAC9B,CAAC;IACD,OAAO,8CAAY,KAAK,EAAI,CAAA;AAC9B,CAAC;AAxBD,wBAwBC;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
14
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
|
+
if (!m) return o;
|
|
16
|
+
var i = m.call(o), r, ar = [], e;
|
|
17
|
+
try {
|
|
18
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
19
|
+
}
|
|
20
|
+
catch (error) { e = { error: error }; }
|
|
21
|
+
finally {
|
|
22
|
+
try {
|
|
23
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
24
|
+
}
|
|
25
|
+
finally { if (e) throw e.error; }
|
|
26
|
+
}
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.Ellipse = void 0;
|
|
31
|
+
var jsx_runtime_1 = require("preact/jsx-runtime");
|
|
32
|
+
function Ellipse(props) {
|
|
33
|
+
var _a = props.x, x = _a === void 0 ? 0 : _a, _b = props.y, y = _b === void 0 ? 0 : _b, _c = props.rx, rx = _c === void 0 ? 4 : _c, _d = props.ry, ry = _d === void 0 ? 4 : _d, className = props.className;
|
|
34
|
+
var attrs = {
|
|
35
|
+
cx: x,
|
|
36
|
+
cy: y,
|
|
37
|
+
rx: rx,
|
|
38
|
+
ry: ry,
|
|
39
|
+
fill: 'transparent',
|
|
40
|
+
fillOpacity: 1,
|
|
41
|
+
strokeWidth: '1',
|
|
42
|
+
stroke: '#000',
|
|
43
|
+
strokeOpacity: 1,
|
|
44
|
+
};
|
|
45
|
+
Object.entries(props).forEach(function (_a) {
|
|
46
|
+
var _b = __read(_a, 2), k = _b[0], v = _b[1];
|
|
47
|
+
var valueType = typeof v;
|
|
48
|
+
if (valueType !== 'object') {
|
|
49
|
+
attrs[k] = v;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
if (className) {
|
|
53
|
+
attrs.className = "lf-basic-shape ".concat(className);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
attrs.className = 'lf-shape';
|
|
57
|
+
}
|
|
58
|
+
return (0, jsx_runtime_1.jsx)("ellipse", __assign({}, attrs));
|
|
59
|
+
}
|
|
60
|
+
exports.Ellipse = Ellipse;
|
|
61
|
+
exports.default = Ellipse;
|
|
62
|
+
//# sourceMappingURL=Ellipse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Ellipse.js","sourceRoot":"","sources":["../../../src/view/shape/Ellipse.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,OAAO,CAAC,KAAK;IACnB,IAAA,KAA4C,KAAK,EAA5C,EAAL,CAAC,mBAAG,CAAC,KAAA,EAAE,KAAqC,KAAK,EAArC,EAAL,CAAC,mBAAG,CAAC,KAAA,EAAE,KAA8B,KAAK,GAA7B,EAAN,EAAE,mBAAG,CAAC,KAAA,EAAE,KAAsB,KA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