@logicflow/core 2.2.0 → 2.2.1
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/dist/index.css +3 -2
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/es/LogicFlow.d.ts +9 -0
- package/es/LogicFlow.js +0 -1
- package/es/constant/index.d.ts +1 -1
- package/es/constant/index.js +1 -1
- package/es/constant/theme.d.ts +136 -0
- package/es/constant/theme.js +680 -0
- package/es/index.css +3 -2
- package/es/model/GraphModel.d.ts +10 -2
- package/es/model/GraphModel.js +48 -14
- package/es/model/TransformModel.js +9 -9
- package/es/model/edge/BaseEdgeModel.js +7 -2
- package/es/model/edge/PolylineEdgeModel.d.ts +7 -0
- package/es/model/edge/PolylineEdgeModel.js +136 -7
- package/es/model/node/BaseNodeModel.d.ts +12 -1
- package/es/model/node/BaseNodeModel.js +9 -2
- package/es/model/node/HtmlNodeModel.d.ts +12 -0
- package/es/model/node/HtmlNodeModel.js +19 -0
- package/es/model/node/PolygonNodeModel.js +3 -3
- package/es/options.d.ts +4 -2
- package/es/style/index.css +3 -2
- package/es/style/index.less +3 -2
- package/es/style/raw.d.ts +1 -1
- package/es/style/raw.js +1 -1
- package/es/tool/MultipleSelectTool.js +10 -5
- package/es/util/drag.js +0 -1
- package/es/util/edge.d.ts +40 -1
- package/es/util/edge.js +43 -9
- package/es/util/geometry.d.ts +8 -0
- package/es/util/geometry.js +79 -0
- package/es/util/theme.d.ts +2 -65
- package/es/util/theme.js +4 -281
- package/es/view/Anchor.d.ts +1 -0
- package/es/view/Anchor.js +24 -21
- package/es/view/Control.d.ts +5 -0
- package/es/view/Control.js +44 -57
- package/es/view/edge/BaseEdge.js +9 -0
- package/es/view/edge/PolylineEdge.js +13 -2
- package/es/view/node/BaseNode.d.ts +1 -0
- package/es/view/node/BaseNode.js +23 -11
- package/es/view/node/HtmlNode.js +2 -4
- package/es/view/overlay/CanvasOverlay.js +5 -2
- package/es/view/overlay/Grid.d.ts +12 -1
- package/es/view/overlay/Grid.js +85 -23
- package/es/view/overlay/OutlineOverlay.d.ts +1 -0
- package/es/view/overlay/OutlineOverlay.js +18 -17
- package/es/view/overlay/gridConfig.d.ts +46 -0
- package/es/view/overlay/gridConfig.js +99 -0
- package/es/view/shape/Polygon.d.ts +0 -7
- package/es/view/shape/Polygon.js +12 -43
- package/lib/LogicFlow.d.ts +9 -0
- package/lib/LogicFlow.js +0 -1
- package/lib/constant/index.d.ts +1 -1
- package/lib/constant/index.js +16 -2
- package/lib/constant/theme.d.ts +136 -0
- package/lib/constant/theme.js +683 -0
- package/lib/index.css +3 -2
- package/lib/model/GraphModel.d.ts +10 -2
- package/lib/model/GraphModel.js +49 -15
- package/lib/model/TransformModel.js +9 -9
- package/lib/model/edge/BaseEdgeModel.js +7 -2
- package/lib/model/edge/PolylineEdgeModel.d.ts +7 -0
- package/lib/model/edge/PolylineEdgeModel.js +136 -7
- package/lib/model/node/BaseNodeModel.d.ts +12 -1
- package/lib/model/node/BaseNodeModel.js +9 -2
- package/lib/model/node/HtmlNodeModel.d.ts +12 -0
- package/lib/model/node/HtmlNodeModel.js +19 -0
- package/lib/model/node/PolygonNodeModel.js +3 -3
- package/lib/options.d.ts +4 -2
- package/lib/style/index.css +3 -2
- package/lib/style/index.less +3 -2
- package/lib/style/raw.d.ts +1 -1
- package/lib/style/raw.js +1 -1
- package/lib/tool/MultipleSelectTool.js +10 -5
- package/lib/util/drag.js +0 -1
- package/lib/util/edge.d.ts +40 -1
- package/lib/util/edge.js +43 -9
- package/lib/util/geometry.d.ts +8 -0
- package/lib/util/geometry.js +81 -1
- package/lib/util/theme.d.ts +2 -65
- package/lib/util/theme.js +15 -292
- package/lib/view/Anchor.d.ts +1 -0
- package/lib/view/Anchor.js +24 -21
- package/lib/view/Control.d.ts +5 -0
- package/lib/view/Control.js +44 -57
- package/lib/view/edge/BaseEdge.js +9 -0
- package/lib/view/edge/PolylineEdge.js +13 -2
- package/lib/view/node/BaseNode.d.ts +1 -0
- package/lib/view/node/BaseNode.js +22 -10
- package/lib/view/node/HtmlNode.js +1 -3
- package/lib/view/overlay/CanvasOverlay.js +5 -2
- package/lib/view/overlay/Grid.d.ts +12 -1
- package/lib/view/overlay/Grid.js +83 -21
- package/lib/view/overlay/OutlineOverlay.d.ts +1 -0
- package/lib/view/overlay/OutlineOverlay.js +18 -17
- package/lib/view/overlay/gridConfig.d.ts +46 -0
- package/lib/view/overlay/gridConfig.js +104 -0
- package/lib/view/shape/Polygon.d.ts +0 -7
- package/lib/view/shape/Polygon.js +13 -45
- package/package.json +6 -1
- package/.turbo/turbo-build$colon$dev.log +0 -10
- package/.turbo/turbo-build.log +0 -33
- package/CHANGELOG.md +0 -1849
- package/__tests__/algorithm/egde.test.ts +0 -131
- package/__tests__/algorithm/index.test.ts +0 -74
- package/__tests__/algorithm/outline.test.ts +0 -43
- package/__tests__/bugs/1545-spec.test.ts +0 -42
- package/__tests__/event/event.test.ts +0 -22
- package/__tests__/history/history.test.ts +0 -28
- package/__tests__/logicflow.test.ts +0 -575
- package/__tests__/model/graphmodel.test.ts +0 -87
- package/__tests__/util/compatible.test.ts +0 -48
- package/__tests__/util/edge.test.ts +0 -224
- package/__tests__/util/geometry.test.ts +0 -14
- package/__tests__/util/graph.test.ts +0 -16
- package/__tests__/util/matrix.test.ts +0 -41
- package/__tests__/util/node.test.ts +0 -68
- package/__tests__/util/sampling.test.ts +0 -12
- package/__tests__/util/vector.test.ts +0 -50
- package/__tests__/util/zIndex.test.ts +0 -10
- package/src/LogicFlow.tsx +0 -2008
- package/src/algorithm/edge.ts +0 -67
- package/src/algorithm/index.ts +0 -70
- package/src/algorithm/outline.ts +0 -77
- package/src/algorithm/rotate.ts +0 -55
- package/src/common/drag.ts +0 -219
- package/src/common/history.ts +0 -108
- package/src/common/index.ts +0 -6
- package/src/common/keyboard.ts +0 -108
- package/src/common/matrix.ts +0 -122
- package/src/common/vector.ts +0 -93
- package/src/constant/index.ts +0 -179
- package/src/event/event.md +0 -66
- package/src/event/eventArgs.ts +0 -643
- package/src/event/eventEmitter.ts +0 -156
- package/src/history/index.ts +0 -119
- package/src/index.less +0 -1
- package/src/index.ts +0 -26
- package/src/keyboard/index.ts +0 -112
- package/src/keyboard/shortcut.ts +0 -200
- package/src/model/BaseModel.ts +0 -250
- package/src/model/EditConfigModel.ts +0 -334
- package/src/model/GraphModel.ts +0 -1788
- package/src/model/NestedTransformModel.ts +0 -121
- package/src/model/SnaplineModel.ts +0 -256
- package/src/model/TransformModel.ts +0 -258
- package/src/model/edge/BaseEdgeModel.ts +0 -777
- package/src/model/edge/BezierEdgeModel.ts +0 -197
- package/src/model/edge/LineEdgeModel.ts +0 -36
- package/src/model/edge/PolylineEdgeModel.ts +0 -672
- package/src/model/edge/index.ts +0 -4
- package/src/model/index.ts +0 -9
- package/src/model/node/BaseNodeModel.ts +0 -949
- package/src/model/node/CircleNodeModel.ts +0 -91
- package/src/model/node/DiamondNodeModel.ts +0 -132
- package/src/model/node/EllipseNodeModel.ts +0 -98
- package/src/model/node/HtmlNodeModel.ts +0 -50
- package/src/model/node/PolygonNodeModel.ts +0 -150
- package/src/model/node/RectNodeModel.ts +0 -69
- package/src/model/node/TextNodeModel.ts +0 -54
- package/src/model/node/index.ts +0 -8
- package/src/options.ts +0 -145
- package/src/style/index.less +0 -261
- package/src/style/raw.ts +0 -220
- package/src/tool/MultipleSelectTool.tsx +0 -132
- package/src/tool/TextEditTool.tsx +0 -193
- package/src/tool/index.ts +0 -101
- package/src/typings.d.ts +0 -5
- package/src/util/animation.ts +0 -29
- package/src/util/browser.ts +0 -4
- package/src/util/compatible.ts +0 -15
- package/src/util/drag.ts +0 -220
- package/src/util/edge.ts +0 -1060
- package/src/util/geometry.ts +0 -55
- package/src/util/graph.ts +0 -46
- package/src/util/index.ts +0 -17
- package/src/util/matrix.ts +0 -129
- package/src/util/mobx.ts +0 -23
- package/src/util/node.ts +0 -543
- package/src/util/raf.ts +0 -28
- package/src/util/resize.ts +0 -606
- package/src/util/sampling.ts +0 -85
- package/src/util/theme.ts +0 -375
- package/src/util/uuid.ts +0 -26
- package/src/util/vector.ts +0 -93
- package/src/util/zIndex.ts +0 -6
- package/src/view/Anchor.tsx +0 -445
- package/src/view/Control.tsx +0 -512
- package/src/view/Graph.tsx +0 -141
- package/src/view/Rotate.tsx +0 -113
- package/src/view/behavior/dnd.ts +0 -162
- package/src/view/behavior/index.ts +0 -2
- package/src/view/behavior/snapline.ts +0 -16
- package/src/view/edge/AdjustPoint.tsx +0 -425
- package/src/view/edge/Arrow.tsx +0 -54
- package/src/view/edge/BaseEdge.tsx +0 -650
- package/src/view/edge/BezierEdge.tsx +0 -101
- package/src/view/edge/LineEdge.tsx +0 -81
- package/src/view/edge/PolylineEdge.tsx +0 -299
- package/src/view/edge/index.ts +0 -6
- package/src/view/index.ts +0 -8
- package/src/view/node/BaseNode.tsx +0 -571
- package/src/view/node/CircleNode.tsx +0 -21
- package/src/view/node/DiamondNode.tsx +0 -24
- package/src/view/node/EllipseNode.tsx +0 -22
- package/src/view/node/HtmlNode.tsx +0 -95
- package/src/view/node/PolygonNode.tsx +0 -28
- package/src/view/node/RectNode.tsx +0 -30
- package/src/view/node/TextNode.tsx +0 -39
- package/src/view/node/index.ts +0 -8
- package/src/view/overlay/BackgroundOverlay.tsx +0 -34
- package/src/view/overlay/BezierAdjustOverlay.tsx +0 -150
- package/src/view/overlay/CanvasOverlay.tsx +0 -288
- package/src/view/overlay/Grid.tsx +0 -162
- package/src/view/overlay/ModificationOverlay.tsx +0 -31
- package/src/view/overlay/OutlineOverlay.tsx +0 -170
- package/src/view/overlay/SnaplineOverlay.tsx +0 -44
- package/src/view/overlay/ToolOverlay.tsx +0 -65
- package/src/view/overlay/getTransformHoc.tsx +0 -50
- package/src/view/overlay/index.ts +0 -8
- package/src/view/shape/Circle.tsx +0 -41
- package/src/view/shape/Ellipse.tsx +0 -42
- package/src/view/shape/Line.tsx +0 -39
- package/src/view/shape/Path.tsx +0 -22
- package/src/view/shape/Polygon.tsx +0 -91
- package/src/view/shape/Polyline.tsx +0 -31
- package/src/view/shape/Rect.tsx +0 -44
- package/src/view/shape/Text.tsx +0 -169
- package/src/view/shape/index.ts +0 -8
- package/src/view/text/BaseText.tsx +0 -134
- package/src/view/text/LineText.tsx +0 -168
- package/src/view/text/index.ts +0 -2
- package/stats.html +0 -4842
- package/tsconfig.json +0 -18
package/src/options.ts
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import type { TransformModel } from './model'
|
|
2
|
-
|
|
3
|
-
import { assign } from 'lodash-es'
|
|
4
|
-
import { createElement as h } from 'preact/compat'
|
|
5
|
-
import LogicFlow from './LogicFlow'
|
|
6
|
-
import { KeyboardDef } from './keyboard'
|
|
7
|
-
import { OverlapMode, TextMode } from './constant'
|
|
8
|
-
import { Grid } from './view/overlay'
|
|
9
|
-
|
|
10
|
-
import GridOptions = Grid.GridOptions
|
|
11
|
-
|
|
12
|
-
export namespace Options {
|
|
13
|
-
import NodeData = LogicFlow.NodeData
|
|
14
|
-
import EdgeData = LogicFlow.EdgeData
|
|
15
|
-
import GraphData = LogicFlow.GraphData
|
|
16
|
-
import ExtensionType = LogicFlow.ExtensionType
|
|
17
|
-
export type EdgeType = 'line' | 'polyline' | 'bezier' | string
|
|
18
|
-
export type BackgroundConfig = {
|
|
19
|
-
// 背景图片地址
|
|
20
|
-
backgroundImage?: string
|
|
21
|
-
// CSS background-repeat 属性
|
|
22
|
-
backgroundRepeat?:
|
|
23
|
-
| 'repeat'
|
|
24
|
-
| 'repeat-x'
|
|
25
|
-
| 'repeat-y'
|
|
26
|
-
| 'no-repeat'
|
|
27
|
-
| 'initial'
|
|
28
|
-
| 'inherit'
|
|
29
|
-
// TODO: 根据具体情况添加各种自定义样式
|
|
30
|
-
[key: string]: any
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export type AnimationConfig = {
|
|
34
|
-
node: boolean
|
|
35
|
-
edge: boolean
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export type EdgeGeneratorType = (
|
|
39
|
-
sourceNode: LogicFlow.NodeData,
|
|
40
|
-
targetNode: LogicFlow.NodeData,
|
|
41
|
-
currentEdge?: Partial<LogicFlow.EdgeConfig>,
|
|
42
|
-
) => any
|
|
43
|
-
|
|
44
|
-
export interface CustomAnchorLineProps {
|
|
45
|
-
sourcePoint: LogicFlow.Point
|
|
46
|
-
targetPoint: LogicFlow.Point
|
|
47
|
-
|
|
48
|
-
[key: string]: any
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface GuardsConfig {
|
|
52
|
-
beforeClone?: (data: NodeData | GraphData) => boolean
|
|
53
|
-
beforeDelete?: (data: NodeData | EdgeData) => boolean
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export interface Common {
|
|
57
|
-
container: HTMLElement
|
|
58
|
-
// REMIND: 注意,当在 SSR 框架(比如 Next.js Nuxt.js)项目中使用 LogicFlow 时,在初始化时需要设置宽高
|
|
59
|
-
width?: number
|
|
60
|
-
height?: number
|
|
61
|
-
background?: false | BackgroundConfig
|
|
62
|
-
/**
|
|
63
|
-
* Grid 网格配置
|
|
64
|
-
*/
|
|
65
|
-
grid?: number | boolean | GridOptions
|
|
66
|
-
|
|
67
|
-
partial?: boolean
|
|
68
|
-
keyboard?: KeyboardDef
|
|
69
|
-
style?: Partial<LogicFlow.Theme> // 主题配置
|
|
70
|
-
edgeType?: EdgeType
|
|
71
|
-
adjustEdge?: boolean
|
|
72
|
-
|
|
73
|
-
// 元素文本类型:text or label
|
|
74
|
-
textMode?: TextMode
|
|
75
|
-
edgeTextMode?: TextMode
|
|
76
|
-
nodeTextMode?: TextMode
|
|
77
|
-
|
|
78
|
-
allowRotate?: boolean // 允许节点旋转
|
|
79
|
-
allowResize?: boolean // 是否允许缩放
|
|
80
|
-
|
|
81
|
-
isSilentMode?: boolean // 是否为静默模式:可以简单理解为“只读”模式,这种模式下,画布中的节点和边不可移动,不可进行文案修改,没有锚点。
|
|
82
|
-
stopScrollGraph?: boolean
|
|
83
|
-
stopZoomGraph?: boolean
|
|
84
|
-
stopMoveGraph?:
|
|
85
|
-
| boolean
|
|
86
|
-
| 'vertical'
|
|
87
|
-
| 'horizontal'
|
|
88
|
-
| [number, number, number, number]
|
|
89
|
-
animation?: boolean | Partial<AnimationConfig>
|
|
90
|
-
history?: boolean
|
|
91
|
-
outline?: boolean
|
|
92
|
-
snapline?: boolean
|
|
93
|
-
snaplineEpsilon?: number
|
|
94
|
-
textEdit?: boolean
|
|
95
|
-
|
|
96
|
-
guards?: GuardsConfig
|
|
97
|
-
overlapMode?: OverlapMode
|
|
98
|
-
|
|
99
|
-
plugins?: ExtensionType[]
|
|
100
|
-
pluginsOptions?: Record<string, any>
|
|
101
|
-
disabledPlugins?: string[]
|
|
102
|
-
disabledTools?: string[]
|
|
103
|
-
|
|
104
|
-
idGenerator?: (type?: string) => string
|
|
105
|
-
edgeGenerator?: EdgeGeneratorType
|
|
106
|
-
|
|
107
|
-
customTrajectory?: (props: CustomAnchorLineProps) => h.JSX.Element
|
|
108
|
-
themeMode?: 'radius' | 'dark' | 'colorful' // 主题模式
|
|
109
|
-
|
|
110
|
-
parentTransform?: TransformModel // 父级变换模型,用于嵌套变换
|
|
111
|
-
|
|
112
|
-
[key: string]: unknown
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export interface ManualBooleans {}
|
|
116
|
-
|
|
117
|
-
export interface Manual extends Partial<Common>, Partial<ManualBooleans> {}
|
|
118
|
-
|
|
119
|
-
export interface Definition extends Common {}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export namespace Options {
|
|
123
|
-
export function get(options: Partial<Manual>) {
|
|
124
|
-
const { ...others } = options
|
|
125
|
-
const container = options.container
|
|
126
|
-
if (!container) {
|
|
127
|
-
throw new Error(
|
|
128
|
-
'Ensure the container of LogicFlow is specified and valid.',
|
|
129
|
-
)
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
return assign({}, defaults, others) as Options.Definition
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export namespace Options {
|
|
137
|
-
export const defaults: Partial<Definition> = {
|
|
138
|
-
background: false,
|
|
139
|
-
grid: false,
|
|
140
|
-
textEdit: true,
|
|
141
|
-
snapline: true,
|
|
142
|
-
outline: false,
|
|
143
|
-
disabledTools: [],
|
|
144
|
-
}
|
|
145
|
-
}
|
package/src/style/index.less
DELETED
|
@@ -1,261 +0,0 @@
|
|
|
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
|
-
|
|
10
|
-
.lf-element-text {
|
|
11
|
-
cursor: text;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.lf-text-disabled {
|
|
15
|
-
pointer-events: none;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.lf-text-draggable {
|
|
19
|
-
cursor: move;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// 在元素focus时浏览器会给元素outline设置一个5像素宽的默认样式,这里先全局禁用一下,后续再根据需要再做调整
|
|
23
|
-
*:focus {
|
|
24
|
-
outline: none;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.lf-node-anchor {
|
|
28
|
-
cursor: crosshair;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.lf-node-anchor-hover {
|
|
32
|
-
visibility: hidden;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.lf-anchor:hover .lf-node-anchor-hover {
|
|
36
|
-
visibility: visible;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.lf-edge.pointer-none {
|
|
40
|
-
pointer-events: none;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.lf-edge-append {
|
|
44
|
-
cursor: pointer;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.lf-edge-animation {
|
|
48
|
-
stroke-dashoffset: 100%;
|
|
49
|
-
animation: lf_animate_dash 5s linear infinite;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
@keyframes lf_animate_dash {
|
|
53
|
-
to {
|
|
54
|
-
stroke-dashoffset: 0;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/* node */
|
|
59
|
-
.lf-node-not-allow {
|
|
60
|
-
cursor: not-allowed;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.lf-polyline-append-ns-resize {
|
|
64
|
-
cursor: ns-resize;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.lf-polyline-append-ew-resize {
|
|
68
|
-
cursor: ew-resize;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.lf-dragging {
|
|
72
|
-
cursor: move;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.lf-dragging .lf-element-text {
|
|
76
|
-
cursor: move;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.lf-draggable {
|
|
80
|
-
cursor: default;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.lf-bezier-adjust-anchor {
|
|
84
|
-
cursor: pointer;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/* background */
|
|
88
|
-
.lf-background,
|
|
89
|
-
.lf-grid {
|
|
90
|
-
position: absolute;
|
|
91
|
-
inset: 0;
|
|
92
|
-
z-index: -1;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.lf-background-area {
|
|
96
|
-
width: 100%;
|
|
97
|
-
height: 100%;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/* html-overlay */
|
|
101
|
-
.lf-html-overlay {
|
|
102
|
-
position: absolute;
|
|
103
|
-
inset: 0;
|
|
104
|
-
z-index: 1;
|
|
105
|
-
overflow: hidden;
|
|
106
|
-
user-select: none;
|
|
107
|
-
pointer-events: none;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.lf-html-overlay__transform > * {
|
|
111
|
-
pointer-events: all;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.lf-text-editable {
|
|
115
|
-
pointer-events: all;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.lf-text-input {
|
|
119
|
-
position: absolute;
|
|
120
|
-
box-sizing: border-box;
|
|
121
|
-
min-width: 100px;
|
|
122
|
-
min-height: 20px;
|
|
123
|
-
padding: 5px;
|
|
124
|
-
line-height: 1.2;
|
|
125
|
-
white-space: pre;
|
|
126
|
-
text-align: center;
|
|
127
|
-
background: #fff;
|
|
128
|
-
border: 1px solid #edefed;
|
|
129
|
-
border-radius: 3px;
|
|
130
|
-
outline: none;
|
|
131
|
-
transform: translate(-50%, -50%);
|
|
132
|
-
resize: none;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.lf-get-text-height {
|
|
136
|
-
display: inline-block;
|
|
137
|
-
box-sizing: border-box;
|
|
138
|
-
word-break: break-all;
|
|
139
|
-
/* 为了跟输入效果保持一致,设置透明边框占位 */
|
|
140
|
-
border: 1px solid transparent;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.lf-node-text-auto-wrap {
|
|
144
|
-
display: flex;
|
|
145
|
-
align-items: center;
|
|
146
|
-
justify-content: center;
|
|
147
|
-
box-sizing: border-box;
|
|
148
|
-
/* border: 1px solid transparent; */
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.lf-node-text-auto-wrap-content {
|
|
152
|
-
width: 100%;
|
|
153
|
-
line-height: 1.2;
|
|
154
|
-
text-align: center;
|
|
155
|
-
word-break: break-all;
|
|
156
|
-
background: transparent;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.lf-node-text-ellipsis-content {
|
|
160
|
-
width: 100%;
|
|
161
|
-
line-height: 1.2;
|
|
162
|
-
white-space: nowrap;
|
|
163
|
-
text-align: center;
|
|
164
|
-
background: transparent;
|
|
165
|
-
/* overflow: hidden;
|
|
166
|
-
text-overflow: ellipsis; */
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
.lf-node-text-ellipsis-content > div {
|
|
170
|
-
overflow: hidden;
|
|
171
|
-
text-overflow: ellipsis;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/* tool-overlay */
|
|
175
|
-
.lf-tool-overlay {
|
|
176
|
-
position: absolute;
|
|
177
|
-
inset: 0;
|
|
178
|
-
z-index: 2;
|
|
179
|
-
overflow: hidden;
|
|
180
|
-
pointer-events: none;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.lf-tool-overlay > * {
|
|
184
|
-
pointer-events: all;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/* modification-overlay */
|
|
188
|
-
.modification-overlay {
|
|
189
|
-
position: absolute;
|
|
190
|
-
inset: 0;
|
|
191
|
-
z-index: 1;
|
|
192
|
-
overflow: hidden;
|
|
193
|
-
pointer-events: none;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.modification-overlay > * {
|
|
197
|
-
pointer-events: all;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.lf-outline,
|
|
201
|
-
.lf-snapline {
|
|
202
|
-
pointer-events: none;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
.lf-keyboard-tips {
|
|
206
|
-
float: right;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
.lf-node-select-decorate {
|
|
210
|
-
position: absolute;
|
|
211
|
-
border: 1px dashed #343435;
|
|
212
|
-
transform: translate(-50%, -50%);
|
|
213
|
-
pointer-events: none;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
.lf-multiple-select {
|
|
217
|
-
position: absolute;
|
|
218
|
-
border: 2px dashed #187dffcc;
|
|
219
|
-
box-shadow: 0 0 3px 0 #187dff80;
|
|
220
|
-
cursor: move;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
.lf-edge-adjust-point {
|
|
224
|
-
cursor: move;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
.lf-rotate-control {
|
|
228
|
-
cursor: grabbing;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.lf-resize-control-nw {
|
|
232
|
-
cursor: nw-resize;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
.lf-resize-control-n {
|
|
236
|
-
cursor: n-resize;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
.lf-resize-control-ne {
|
|
240
|
-
cursor: ne-resize;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
.lf-resize-control-e {
|
|
244
|
-
cursor: e-resize;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
.lf-resize-control-se {
|
|
248
|
-
cursor: se-resize;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
.lf-resize-control-s {
|
|
252
|
-
cursor: s-resize;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
.lf-resize-control-sw {
|
|
256
|
-
cursor: sw-resize;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
.lf-resize-control-w {
|
|
260
|
-
cursor: w-resize;
|
|
261
|
-
}
|
package/src/style/raw.ts
DELETED
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Auto generated file, do not modify it!
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export const content = `.lf-graph {
|
|
8
|
-
position: relative;
|
|
9
|
-
z-index: 0;
|
|
10
|
-
width: 100%;
|
|
11
|
-
height: 100%;
|
|
12
|
-
background: #fff;
|
|
13
|
-
user-select: none;
|
|
14
|
-
}
|
|
15
|
-
.lf-element-text {
|
|
16
|
-
cursor: text;
|
|
17
|
-
}
|
|
18
|
-
.lf-text-disabled {
|
|
19
|
-
pointer-events: none;
|
|
20
|
-
}
|
|
21
|
-
.lf-text-draggable {
|
|
22
|
-
cursor: move;
|
|
23
|
-
}
|
|
24
|
-
*:focus {
|
|
25
|
-
outline: none;
|
|
26
|
-
}
|
|
27
|
-
.lf-node-anchor {
|
|
28
|
-
cursor: crosshair;
|
|
29
|
-
}
|
|
30
|
-
.lf-node-anchor-hover {
|
|
31
|
-
visibility: hidden;
|
|
32
|
-
}
|
|
33
|
-
.lf-anchor:hover .lf-node-anchor-hover {
|
|
34
|
-
visibility: visible;
|
|
35
|
-
}
|
|
36
|
-
.lf-edge.pointer-none {
|
|
37
|
-
pointer-events: none;
|
|
38
|
-
}
|
|
39
|
-
.lf-edge-append {
|
|
40
|
-
cursor: pointer;
|
|
41
|
-
}
|
|
42
|
-
.lf-edge-animation {
|
|
43
|
-
stroke-dashoffset: 100%;
|
|
44
|
-
animation: lf_animate_dash 5s linear infinite;
|
|
45
|
-
}
|
|
46
|
-
@keyframes lf_animate_dash {
|
|
47
|
-
to {
|
|
48
|
-
stroke-dashoffset: 0;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/* node */
|
|
52
|
-
.lf-node-not-allow {
|
|
53
|
-
cursor: not-allowed;
|
|
54
|
-
}
|
|
55
|
-
.lf-polyline-append-ns-resize {
|
|
56
|
-
cursor: ns-resize;
|
|
57
|
-
}
|
|
58
|
-
.lf-polyline-append-ew-resize {
|
|
59
|
-
cursor: ew-resize;
|
|
60
|
-
}
|
|
61
|
-
.lf-dragging {
|
|
62
|
-
cursor: move;
|
|
63
|
-
}
|
|
64
|
-
.lf-dragging .lf-element-text {
|
|
65
|
-
cursor: move;
|
|
66
|
-
}
|
|
67
|
-
.lf-draggable {
|
|
68
|
-
cursor: default;
|
|
69
|
-
}
|
|
70
|
-
.lf-bezier-adjust-anchor {
|
|
71
|
-
cursor: pointer;
|
|
72
|
-
}
|
|
73
|
-
/* background */
|
|
74
|
-
.lf-background,
|
|
75
|
-
.lf-grid {
|
|
76
|
-
position: absolute;
|
|
77
|
-
inset: 0;
|
|
78
|
-
z-index: -1;
|
|
79
|
-
}
|
|
80
|
-
.lf-background-area {
|
|
81
|
-
width: 100%;
|
|
82
|
-
height: 100%;
|
|
83
|
-
}
|
|
84
|
-
/* html-overlay */
|
|
85
|
-
.lf-html-overlay {
|
|
86
|
-
position: absolute;
|
|
87
|
-
inset: 0;
|
|
88
|
-
z-index: 1;
|
|
89
|
-
overflow: hidden;
|
|
90
|
-
user-select: none;
|
|
91
|
-
pointer-events: none;
|
|
92
|
-
}
|
|
93
|
-
.lf-html-overlay__transform > * {
|
|
94
|
-
pointer-events: all;
|
|
95
|
-
}
|
|
96
|
-
.lf-text-editable {
|
|
97
|
-
pointer-events: all;
|
|
98
|
-
}
|
|
99
|
-
.lf-text-input {
|
|
100
|
-
position: absolute;
|
|
101
|
-
box-sizing: border-box;
|
|
102
|
-
min-width: 100px;
|
|
103
|
-
min-height: 20px;
|
|
104
|
-
padding: 5px;
|
|
105
|
-
line-height: 1.2;
|
|
106
|
-
white-space: pre;
|
|
107
|
-
text-align: center;
|
|
108
|
-
background: #fff;
|
|
109
|
-
border: 1px solid #edefed;
|
|
110
|
-
border-radius: 3px;
|
|
111
|
-
outline: none;
|
|
112
|
-
transform: translate(-50%, -50%);
|
|
113
|
-
resize: none;
|
|
114
|
-
}
|
|
115
|
-
.lf-get-text-height {
|
|
116
|
-
display: inline-block;
|
|
117
|
-
box-sizing: border-box;
|
|
118
|
-
word-break: break-all;
|
|
119
|
-
/* 为了跟输入效果保持一致,设置透明边框占位 */
|
|
120
|
-
border: 1px solid transparent;
|
|
121
|
-
}
|
|
122
|
-
.lf-node-text-auto-wrap {
|
|
123
|
-
display: flex;
|
|
124
|
-
align-items: center;
|
|
125
|
-
justify-content: center;
|
|
126
|
-
box-sizing: border-box;
|
|
127
|
-
/* border: 1px solid transparent; */
|
|
128
|
-
}
|
|
129
|
-
.lf-node-text-auto-wrap-content {
|
|
130
|
-
width: 100%;
|
|
131
|
-
line-height: 1.2;
|
|
132
|
-
text-align: center;
|
|
133
|
-
word-break: break-all;
|
|
134
|
-
background: transparent;
|
|
135
|
-
}
|
|
136
|
-
.lf-node-text-ellipsis-content {
|
|
137
|
-
width: 100%;
|
|
138
|
-
line-height: 1.2;
|
|
139
|
-
white-space: nowrap;
|
|
140
|
-
text-align: center;
|
|
141
|
-
background: transparent;
|
|
142
|
-
/* overflow: hidden;
|
|
143
|
-
text-overflow: ellipsis; */
|
|
144
|
-
}
|
|
145
|
-
.lf-node-text-ellipsis-content > div {
|
|
146
|
-
overflow: hidden;
|
|
147
|
-
text-overflow: ellipsis;
|
|
148
|
-
}
|
|
149
|
-
/* tool-overlay */
|
|
150
|
-
.lf-tool-overlay {
|
|
151
|
-
position: absolute;
|
|
152
|
-
inset: 0;
|
|
153
|
-
z-index: 2;
|
|
154
|
-
overflow: hidden;
|
|
155
|
-
pointer-events: none;
|
|
156
|
-
}
|
|
157
|
-
.lf-tool-overlay > * {
|
|
158
|
-
pointer-events: all;
|
|
159
|
-
}
|
|
160
|
-
/* modification-overlay */
|
|
161
|
-
.modification-overlay {
|
|
162
|
-
position: absolute;
|
|
163
|
-
inset: 0;
|
|
164
|
-
z-index: 1;
|
|
165
|
-
overflow: hidden;
|
|
166
|
-
pointer-events: none;
|
|
167
|
-
}
|
|
168
|
-
.modification-overlay > * {
|
|
169
|
-
pointer-events: all;
|
|
170
|
-
}
|
|
171
|
-
.lf-outline,
|
|
172
|
-
.lf-snapline {
|
|
173
|
-
pointer-events: none;
|
|
174
|
-
}
|
|
175
|
-
.lf-keyboard-tips {
|
|
176
|
-
float: right;
|
|
177
|
-
}
|
|
178
|
-
.lf-node-select-decorate {
|
|
179
|
-
position: absolute;
|
|
180
|
-
border: 1px dashed #343435;
|
|
181
|
-
transform: translate(-50%, -50%);
|
|
182
|
-
pointer-events: none;
|
|
183
|
-
}
|
|
184
|
-
.lf-multiple-select {
|
|
185
|
-
position: absolute;
|
|
186
|
-
border: 2px dashed #187dffcc;
|
|
187
|
-
box-shadow: 0 0 3px 0 #187dff80;
|
|
188
|
-
cursor: move;
|
|
189
|
-
}
|
|
190
|
-
.lf-edge-adjust-point {
|
|
191
|
-
cursor: move;
|
|
192
|
-
}
|
|
193
|
-
.lf-rotate-control {
|
|
194
|
-
cursor: grabbing;
|
|
195
|
-
}
|
|
196
|
-
.lf-resize-control-nw {
|
|
197
|
-
cursor: nw-resize;
|
|
198
|
-
}
|
|
199
|
-
.lf-resize-control-n {
|
|
200
|
-
cursor: n-resize;
|
|
201
|
-
}
|
|
202
|
-
.lf-resize-control-ne {
|
|
203
|
-
cursor: ne-resize;
|
|
204
|
-
}
|
|
205
|
-
.lf-resize-control-e {
|
|
206
|
-
cursor: e-resize;
|
|
207
|
-
}
|
|
208
|
-
.lf-resize-control-se {
|
|
209
|
-
cursor: se-resize;
|
|
210
|
-
}
|
|
211
|
-
.lf-resize-control-s {
|
|
212
|
-
cursor: s-resize;
|
|
213
|
-
}
|
|
214
|
-
.lf-resize-control-sw {
|
|
215
|
-
cursor: sw-resize;
|
|
216
|
-
}
|
|
217
|
-
.lf-resize-control-w {
|
|
218
|
-
cursor: w-resize;
|
|
219
|
-
}
|
|
220
|
-
`
|