@logicflow/core 2.2.0-alpha.7 → 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.
Files changed (137) hide show
  1. package/package.json +6 -1
  2. package/.turbo/turbo-build$colon$dev.log +0 -10
  3. package/.turbo/turbo-build.log +0 -33
  4. package/CHANGELOG.md +0 -1901
  5. package/__tests__/algorithm/egde.test.ts +0 -131
  6. package/__tests__/algorithm/index.test.ts +0 -74
  7. package/__tests__/algorithm/outline.test.ts +0 -43
  8. package/__tests__/bugs/1545-spec.test.ts +0 -42
  9. package/__tests__/event/event.test.ts +0 -22
  10. package/__tests__/history/history.test.ts +0 -28
  11. package/__tests__/logicflow.test.ts +0 -575
  12. package/__tests__/model/graphmodel.test.ts +0 -87
  13. package/__tests__/util/compatible.test.ts +0 -48
  14. package/__tests__/util/edge.test.ts +0 -224
  15. package/__tests__/util/geometry.test.ts +0 -14
  16. package/__tests__/util/graph.test.ts +0 -16
  17. package/__tests__/util/matrix.test.ts +0 -41
  18. package/__tests__/util/node.test.ts +0 -68
  19. package/__tests__/util/sampling.test.ts +0 -12
  20. package/__tests__/util/vector.test.ts +0 -50
  21. package/__tests__/util/zIndex.test.ts +0 -10
  22. package/src/LogicFlow.tsx +0 -2017
  23. package/src/algorithm/edge.ts +0 -67
  24. package/src/algorithm/index.ts +0 -70
  25. package/src/algorithm/outline.ts +0 -77
  26. package/src/algorithm/rotate.ts +0 -55
  27. package/src/common/drag.ts +0 -219
  28. package/src/common/history.ts +0 -108
  29. package/src/common/index.ts +0 -6
  30. package/src/common/keyboard.ts +0 -108
  31. package/src/common/matrix.ts +0 -122
  32. package/src/common/vector.ts +0 -93
  33. package/src/constant/index.ts +0 -179
  34. package/src/constant/theme.ts +0 -708
  35. package/src/event/event.md +0 -66
  36. package/src/event/eventArgs.ts +0 -643
  37. package/src/event/eventEmitter.ts +0 -156
  38. package/src/history/index.ts +0 -119
  39. package/src/index.less +0 -1
  40. package/src/index.ts +0 -26
  41. package/src/keyboard/index.ts +0 -112
  42. package/src/keyboard/shortcut.ts +0 -200
  43. package/src/model/BaseModel.ts +0 -250
  44. package/src/model/EditConfigModel.ts +0 -334
  45. package/src/model/GraphModel.ts +0 -1824
  46. package/src/model/NestedTransformModel.ts +0 -121
  47. package/src/model/SnaplineModel.ts +0 -256
  48. package/src/model/TransformModel.ts +0 -258
  49. package/src/model/edge/BaseEdgeModel.ts +0 -785
  50. package/src/model/edge/BezierEdgeModel.ts +0 -197
  51. package/src/model/edge/LineEdgeModel.ts +0 -36
  52. package/src/model/edge/PolylineEdgeModel.ts +0 -817
  53. package/src/model/edge/index.ts +0 -4
  54. package/src/model/index.ts +0 -9
  55. package/src/model/node/BaseNodeModel.ts +0 -959
  56. package/src/model/node/CircleNodeModel.ts +0 -91
  57. package/src/model/node/DiamondNodeModel.ts +0 -132
  58. package/src/model/node/EllipseNodeModel.ts +0 -98
  59. package/src/model/node/HtmlNodeModel.ts +0 -64
  60. package/src/model/node/PolygonNodeModel.ts +0 -152
  61. package/src/model/node/RectNodeModel.ts +0 -69
  62. package/src/model/node/TextNodeModel.ts +0 -54
  63. package/src/model/node/index.ts +0 -8
  64. package/src/options.ts +0 -150
  65. package/src/style/index.less +0 -262
  66. package/src/style/raw.ts +0 -221
  67. package/src/tool/MultipleSelectTool.tsx +0 -140
  68. package/src/tool/TextEditTool.tsx +0 -193
  69. package/src/tool/index.ts +0 -101
  70. package/src/typings.d.ts +0 -5
  71. package/src/util/animation.ts +0 -29
  72. package/src/util/browser.ts +0 -4
  73. package/src/util/compatible.ts +0 -15
  74. package/src/util/drag.ts +0 -219
  75. package/src/util/edge.ts +0 -1094
  76. package/src/util/geometry.ts +0 -154
  77. package/src/util/graph.ts +0 -46
  78. package/src/util/index.ts +0 -17
  79. package/src/util/matrix.ts +0 -129
  80. package/src/util/mobx.ts +0 -23
  81. package/src/util/node.ts +0 -543
  82. package/src/util/raf.ts +0 -28
  83. package/src/util/resize.ts +0 -606
  84. package/src/util/sampling.ts +0 -85
  85. package/src/util/theme.ts +0 -84
  86. package/src/util/uuid.ts +0 -26
  87. package/src/util/vector.ts +0 -93
  88. package/src/util/zIndex.ts +0 -6
  89. package/src/view/Anchor.tsx +0 -462
  90. package/src/view/Control.tsx +0 -510
  91. package/src/view/Graph.tsx +0 -141
  92. package/src/view/Rotate.tsx +0 -113
  93. package/src/view/behavior/dnd.ts +0 -162
  94. package/src/view/behavior/index.ts +0 -2
  95. package/src/view/behavior/snapline.ts +0 -16
  96. package/src/view/edge/AdjustPoint.tsx +0 -425
  97. package/src/view/edge/Arrow.tsx +0 -54
  98. package/src/view/edge/BaseEdge.tsx +0 -660
  99. package/src/view/edge/BezierEdge.tsx +0 -101
  100. package/src/view/edge/LineEdge.tsx +0 -81
  101. package/src/view/edge/PolylineEdge.tsx +0 -311
  102. package/src/view/edge/index.ts +0 -6
  103. package/src/view/index.ts +0 -8
  104. package/src/view/node/BaseNode.tsx +0 -585
  105. package/src/view/node/CircleNode.tsx +0 -21
  106. package/src/view/node/DiamondNode.tsx +0 -24
  107. package/src/view/node/EllipseNode.tsx +0 -22
  108. package/src/view/node/HtmlNode.tsx +0 -112
  109. package/src/view/node/PolygonNode.tsx +0 -28
  110. package/src/view/node/RectNode.tsx +0 -30
  111. package/src/view/node/TextNode.tsx +0 -39
  112. package/src/view/node/index.ts +0 -8
  113. package/src/view/overlay/BackgroundOverlay.tsx +0 -34
  114. package/src/view/overlay/BezierAdjustOverlay.tsx +0 -150
  115. package/src/view/overlay/CanvasOverlay.tsx +0 -290
  116. package/src/view/overlay/Grid.tsx +0 -319
  117. package/src/view/overlay/ModificationOverlay.tsx +0 -31
  118. package/src/view/overlay/OutlineOverlay.tsx +0 -158
  119. package/src/view/overlay/SnaplineOverlay.tsx +0 -44
  120. package/src/view/overlay/ToolOverlay.tsx +0 -65
  121. package/src/view/overlay/getTransformHoc.tsx +0 -50
  122. package/src/view/overlay/gridConfig.ts +0 -103
  123. package/src/view/overlay/index.ts +0 -8
  124. package/src/view/shape/Circle.tsx +0 -41
  125. package/src/view/shape/Ellipse.tsx +0 -42
  126. package/src/view/shape/Line.tsx +0 -39
  127. package/src/view/shape/Path.tsx +0 -22
  128. package/src/view/shape/Polygon.tsx +0 -54
  129. package/src/view/shape/Polyline.tsx +0 -31
  130. package/src/view/shape/Rect.tsx +0 -44
  131. package/src/view/shape/Text.tsx +0 -168
  132. package/src/view/shape/index.ts +0 -8
  133. package/src/view/text/BaseText.tsx +0 -134
  134. package/src/view/text/LineText.tsx +0 -168
  135. package/src/view/text/index.ts +0 -2
  136. package/stats.html +0 -4842
  137. package/tsconfig.json +0 -18
@@ -1,108 +0,0 @@
1
- import Mousetrap, { MousetrapInstance } from 'mousetrap'
2
- import { forEach, isArray } from 'lodash-es'
3
- import LogicFlow from '..'
4
-
5
- export class Keyboard {
6
- private target: HTMLElement
7
- readonly mousetrap: MousetrapInstance
8
- options: Required<Keyboard.Options>
9
-
10
- constructor(options: Keyboard.Options) {
11
- const { lf } = options
12
- if (!options.keyboard) {
13
- options.keyboard = { enabled: false }
14
- }
15
- this.options = options as Required<Keyboard.Options>
16
- this.target = lf.container
17
- this.mousetrap = new Mousetrap(this.target)
18
-
19
- if (options.keyboard?.enabled) {
20
- this.enable(true)
21
- }
22
- }
23
-
24
- protected formatKey(key: string) {
25
- return key
26
- .toLowerCase()
27
- .replace(/\s/g, '')
28
- .replace('delete', 'del')
29
- .replace('cmd', 'command')
30
- }
31
-
32
- private getKeys(keys: string | string[]) {
33
- return (isArray(keys) ? keys : [keys]).map((key) => this.formatKey(key))
34
- }
35
-
36
- get disabled() {
37
- return this.options.keyboard?.enabled !== true
38
- }
39
-
40
- on(
41
- keys: string | string[],
42
- callback: Keyboard.HandlerFunc,
43
- action?: Keyboard.ActionType,
44
- ) {
45
- this.mousetrap.bind(this.getKeys(keys), callback, action)
46
- }
47
-
48
- off(keys: string | string[], action?: Keyboard.ActionType) {
49
- this.mousetrap.unbind(this.getKeys(keys), action)
50
- }
51
-
52
- enable(force: boolean) {
53
- if (this.disabled || force) {
54
- this.options.keyboard.enabled = true
55
- if (this.target instanceof HTMLElement) {
56
- this.target.setAttribute('tabindex', '-1')
57
- // 去掉节点被选中时 container 出现的边框
58
- this.target.style.outline = 'none'
59
- }
60
- }
61
- }
62
-
63
- disable() {
64
- if (!this.disabled) {
65
- this.options.keyboard.enabled = false
66
- if (this.target instanceof HTMLElement) {
67
- this.target.removeAttribute('tabindex')
68
- }
69
- }
70
- }
71
-
72
- initShortcuts() {
73
- const { shortcuts } = this.options.keyboard
74
- if (shortcuts) {
75
- if (isArray(shortcuts)) {
76
- forEach(shortcuts, ({ keys, callback, action }) => {
77
- this.on(keys, callback, action)
78
- })
79
- } else {
80
- const { keys, callback, action } = shortcuts
81
- this.on(keys, callback, action)
82
- }
83
- }
84
- }
85
- }
86
-
87
- export namespace Keyboard {
88
- export type ActionType = 'keypress' | 'keydown' | 'keyup'
89
- export type HandlerFunc = (e: KeyboardEvent) => void
90
-
91
- export interface Shortcut {
92
- keys: string | string[]
93
- callback: HandlerFunc
94
- action?: ActionType
95
- }
96
-
97
- export interface KeyboardDef {
98
- enabled: boolean
99
- shortcuts?: Shortcut | Shortcut[]
100
- }
101
-
102
- export interface Options {
103
- lf: LogicFlow
104
- keyboard?: KeyboardDef
105
- }
106
- }
107
-
108
- export default Keyboard
@@ -1,122 +0,0 @@
1
- import { Vector } from './vector'
2
-
3
- export class Matrix extends Array {
4
- rows: number
5
- columns: number
6
-
7
- constructor(...vectors: any[]) {
8
- super(vectors.length)
9
- this.fill(new Array(3))
10
- vectors.forEach((v: any, index: number) => {
11
- this[index] = v
12
- })
13
- this.columns = vectors[0].length
14
- this.rows = vectors.length
15
- Object.setPrototypeOf(this, Matrix.prototype)
16
- }
17
-
18
- getRow(index: number) {
19
- return this[index]
20
- }
21
-
22
- getColumn(index: number) {
23
- return [...this.map((row: number[]) => row[index])]
24
- }
25
-
26
- // 转置
27
- transpose() {
28
- const rows: any[] = []
29
- for (let i = 0; i < this.columns; i++) {
30
- rows.push(this.getColumn(i))
31
- }
32
- return new Matrix(...rows)
33
- }
34
-
35
- // 叉乘
36
- cross(m1: Matrix) {
37
- const arr = new Array(this.rows).fill('').map((): any => [])
38
- if (this.columns === m1.rows) {
39
- for (let i = 0; i < this.rows; i++) {
40
- const row = this.getRow(i)
41
- for (let j = 0; j < m1.columns; j++) {
42
- const column = m1.getColumn(j)
43
- arr[i][j] = row.reduce(
44
- (prev: number, r: number, index: number) =>
45
- prev + r * column[index],
46
- 0,
47
- )
48
- }
49
- }
50
- }
51
- return new Matrix(...arr)
52
- }
53
-
54
- // 返回二维坐标(降维)
55
- to2D() {
56
- return this.map((item: any) => [item[0], item[1]])
57
- }
58
-
59
- toString(): string {
60
- const [[a, b], [c, d], [e, f]] = this
61
- return `matrix(${a} ${b} ${c} ${d} ${e} ${f})`
62
- }
63
-
64
- translate(tx: number, ty: number): Matrix {
65
- return this.cross(new TranslateMatrix(tx, ty))
66
- }
67
-
68
- rotate(angle: number): Matrix {
69
- return this.cross(new RotateMatrix(angle))
70
- }
71
-
72
- scale(sx: number, sy: number): Matrix {
73
- return this.cross(new ScaleMatrix(sx, sy))
74
- }
75
- }
76
-
77
- export class RotateMatrix extends Matrix {
78
- constructor(theta: number) {
79
- super(
80
- new Vector(+Math.cos(theta).toFixed(2), +Math.sin(theta).toFixed(2), 0),
81
- new Vector(-Math.sin(theta).toFixed(2), +Math.cos(theta).toFixed(2), 0),
82
- new Vector(0, 0, 1),
83
- )
84
- Object.setPrototypeOf(this, RotateMatrix.prototype)
85
- }
86
-
87
- inverse() {
88
- return this.transpose()
89
- }
90
- }
91
-
92
- export class ScaleMatrix extends Matrix {
93
- private readonly sx: number
94
- private readonly sy: number
95
-
96
- constructor(sx: number, sy: number) {
97
- super(new Vector(sx, 0, 0), new Vector(0, sy, 0), new Vector(0, 0, 1))
98
- this.sx = sx
99
- this.sy = sy
100
- Object.setPrototypeOf(this, ScaleMatrix.prototype)
101
- }
102
-
103
- inverse() {
104
- return new ScaleMatrix(1 / this.sx, 1 / this.sy)
105
- }
106
- }
107
-
108
- export class TranslateMatrix extends Matrix {
109
- private readonly tx: number
110
- private readonly ty: number
111
-
112
- constructor(tx: number, ty: number) {
113
- super(new Vector(1, 0, 0), new Vector(0, 1, 0), new Vector(tx, ty, 1))
114
- this.tx = tx
115
- this.ty = ty
116
- Object.setPrototypeOf(this, TranslateMatrix.prototype)
117
- }
118
-
119
- inverse() {
120
- return new TranslateMatrix(-this.tx, -this.ty)
121
- }
122
- }
@@ -1,93 +0,0 @@
1
- function isVector(a1: any, a2: any): boolean {
2
- return a1 instanceof Vector && a2 instanceof Vector
3
- }
4
-
5
- class Base extends Array {
6
- x: number
7
- y: number
8
- z: number
9
-
10
- constructor(x: number, y: number, z: number) {
11
- super(3)
12
- this[0] = x
13
- this[1] = y
14
- this[2] = z
15
- this.x = x
16
- this.y = y
17
- this.z = z
18
- Object.setPrototypeOf(this, Base.prototype)
19
- }
20
-
21
- add(v1: Vector | Point): Vector | Point {
22
- if (isVector(this, v1)) {
23
- return new Vector(this.x + v1.x, this.y + v1.y)
24
- }
25
- const z = this.z + v1.z
26
- return new Point((this.x + v1.x) / z, (this.y + v1.y) / z)
27
- }
28
-
29
- subtract(v1: Vector | Point): Vector | Point {
30
- if (isVector(this, v1)) {
31
- return new Vector(this.x - v1.x, this.y - v1.y)
32
- }
33
- const z = this.z - v1.z
34
- return z === 0
35
- ? new Vector(this.x - v1.x, this.y - v1.y)
36
- : new Point((this.x - v1.x) / z, (this.y - v1.y) / z)
37
- }
38
- }
39
-
40
- class Vector extends Base {
41
- constructor(x: number, y: number, z?: number) {
42
- super(x, y, z ?? 0)
43
- Object.setPrototypeOf(this, Vector.prototype)
44
- }
45
-
46
- toString(): string {
47
- return 'Vector'
48
- }
49
-
50
- dot(v1: Vector) {
51
- return v1.reduce((prev, cur, index) => prev + cur * this[index])
52
- }
53
-
54
- cross(v1: Vector) {
55
- return new Vector(
56
- this.y * v1.z - this.z * v1.y,
57
- this.z * v1.x - this.x * v1.z,
58
- this.x * v1.y - this.y * v1.x,
59
- )
60
- }
61
-
62
- getLength() {
63
- return Math.hypot(this.x, this.y)
64
- }
65
-
66
- normalize() {
67
- const len = this.getLength()
68
- return new Vector(this.x / len, this.y / len)
69
- }
70
-
71
- crossZ(v1: Vector) {
72
- return this.x * v1.y - this.y * v1.x
73
- }
74
-
75
- angle(v1: Vector) {
76
- const negative = this.crossZ(v1)
77
- const r = Math.acos(this.normalize().dot(v1.normalize()))
78
- return negative >= 0 ? r : -r
79
- }
80
- }
81
-
82
- class Point extends Base {
83
- constructor(x: number, y: number) {
84
- super(x, y, 1)
85
- Object.setPrototypeOf(this, Point.prototype)
86
- }
87
-
88
- toString(): string {
89
- return 'Point'
90
- }
91
- }
92
-
93
- export { Vector, Point }
@@ -1,179 +0,0 @@
1
- export const DEFAULT_VISIBLE_SPACE = 200
2
- export const ELEMENT_MAX_Z_INDEX = 9999
3
-
4
- export enum ElementState {
5
- DEFAULT = 1, // 默认显示
6
- TEXT_EDIT, // 此元素正在进行文本编辑
7
- SHOW_MENU, // 显示菜单,废弃请使用菜单插件
8
- ALLOW_CONNECT, // 此元素允许作为当前边的目标节点
9
- NOT_ALLOW_CONNECT, // 此元素不允许作为当前边的目标节点
10
- }
11
-
12
- export enum ElementType {
13
- NODE = 'node',
14
- EDGE = 'edge',
15
- GRAPH = 'graph',
16
- }
17
-
18
- export enum ModelType {
19
- NODE = 'node',
20
- CIRCLE_NODE = 'circle-node',
21
- POLYGON_NODE = 'polygon-node',
22
- RECT_NODE = 'rect-node',
23
- TEXT_NODE = 'text-node',
24
- ELLIPSE_NODE = 'ellipse-node',
25
- DIAMOND_NODE = 'diamond-node',
26
- HTML_NODE = 'html-node',
27
- CUSTOM_HTML_NODE = 'custom-html-node',
28
- EDGE = 'edge',
29
- LINE_EDGE = 'line-edge',
30
- POLYLINE_EDGE = 'polyline-edge',
31
- BEZIER_EDGE = 'bezier-edge',
32
- GRAPH = 'graph',
33
- }
34
-
35
- export enum EventType {
36
- ELEMENT_CLICK = 'element:click', // 是 node:click & edge:click 的并集
37
-
38
- // Node events
39
- NODE_ADD = 'node:add',
40
- NODE_DELETE = 'node:delete',
41
- NODE_CLICK = 'node:click',
42
- NODE_DBCLICK = 'node:dbclick',
43
-
44
- NODE_GROUP_COPY = 'node:group-copy-add',
45
- NODE_DND_ADD = 'node:dnd-add',
46
- NODE_DND_DRAG = 'node:dnd-drag',
47
- NODE_MOUSEDOWN = 'node:mousedown',
48
- NODE_DRAGSTART = 'node:dragstart',
49
- NODE_DRAG = 'node:drag',
50
- NODE_DROP = 'node:drop',
51
- NODE_MOUSEUP = 'node:mouseup',
52
- NODE_MOUSEMOVE = 'node:mousemove',
53
- NODE_MOUSEENTER = 'node:mouseenter',
54
- NODE_MOUSELEAVE = 'node:mouseleave',
55
- NODE_CONTEXTMENU = 'node:contextmenu',
56
- NODE_ROTATE = 'node:rotate',
57
- NODE_RESIZE = 'node:resize',
58
- NODE_FOCUS = 'node:focus',
59
- NODE_BLUR = 'node:blur',
60
-
61
- // 节点 properties 变化事件
62
- NODE_PROPERTIES_CHANGE = 'node:properties-change',
63
- NODE_PROPERTIES_DELETE = 'node:properties-delete',
64
-
65
- // Edge events
66
- EDGE_ADD = 'edge:add',
67
- EDGE_DELETE = 'edge:delete',
68
- EDGE_CLICK = 'edge:click',
69
- EDGE_DBCLICK = 'edge:dbclick',
70
- EDGE_FOCUS = 'edge:focus',
71
- EDGE_BLUR = 'edge:blur',
72
-
73
- EDGE_MOUSEENTER = 'edge:mouseenter',
74
- EDGE_MOUSELEAVE = 'edge:mouseleave',
75
- EDGE_CONTEXTMENU = 'edge:contextmenu',
76
- EDGE_ADJUST = 'edge:adjust',
77
- EDGE_EXCHANGE_NODE = 'edge:exchange-node',
78
-
79
- // Anchor events
80
- ANCHOR_CLICK = 'anchor:click',
81
- ANCHOR_MOUSEDOWN = 'anchor:mousedown',
82
- ANCHOR_DRAGSTART = 'anchor:dragstart',
83
- ANCHOR_DRAG = 'anchor:drag',
84
- ANCHOR_DROP = 'anchor:drop',
85
- ANCHOR_DRAGEND = 'anchor:dragend',
86
-
87
- // Adjust point events
88
- ADJUST_POINT_MOUSEDOWN = 'adjustPoint:mousedown',
89
- ADJUST_POINT_MOUSEUP = 'adjustPoint:mouseup',
90
- ADJUST_POINT_MOUSEMOVE = 'adjustPoint:mousemove',
91
- ADJUST_POINT_DRAGSTART = 'adjustPoint:dragstart',
92
- ADJUST_POINT_DRAG = 'adjustPoint:drag',
93
- ADJUST_POINT_DROP = 'adjustPoint:drop',
94
- ADJUST_POINT_DRAGEND = 'adjustPoint:dragend',
95
-
96
- // Blank events
97
- BLANK_MOUSEDOWN = 'blank:mousedown',
98
- BLANK_DRAGSTART = 'blank:dragstart',
99
- BLANK_DRAG = 'blank:drag',
100
- BLANK_DROP = 'blank:drop',
101
- BLANK_MOUSEMOVE = 'blank:mousemove',
102
- BLANK_CANVAS_MOUSEMOVE = 'blank:canvas-mousemove',
103
- BLANK_MOUSEUP = 'blank:mouseup',
104
- BLANK_CLICK = 'blank:click',
105
- BLANK_CONTEXTMENU = 'blank:contextmenu',
106
-
107
- // Selection events
108
- SELECTION_MOUSEDOWN = 'selection:mousedown',
109
- SELECTION_DRAGSTART = 'selection:dragstart',
110
- SELECTION_DRAG = 'selection:drag',
111
- SELECTION_DROP = 'selection:drop',
112
- SELECTION_MOUSEMOVE = 'selection:mousemove',
113
- SELECTION_MOUSEUP = 'selection:mouseup',
114
- SELECTION_CONTEXTMENU = 'selection:contextmenu',
115
- CONNECTION_NOT_ALLOWED = 'connection:not-allowed',
116
-
117
- // Text events
118
- TEXT_MOUSEDOWN = 'text:mousedown',
119
- TEXT_DRAGSTART = 'text:dragstart',
120
- TEXT_DRAG = 'text:drag',
121
- TEXT_DROP = 'text:drop',
122
- TEXT_CLICK = 'text:click',
123
- TEXT_DBCLICK = 'text:dbclick',
124
- TEXT_BLUR = 'text:blur',
125
- TEXT_MOUSEMOVE = 'text:mousemove',
126
- TEXT_MOUSEUP = 'text:mouseup',
127
- TEXT_FOCUS = 'text:focus',
128
- TEXT_ADD = 'text:add',
129
- TEXT_UPDATE = 'text:update',
130
- TEXT_CLEAR = 'text:clear',
131
-
132
- // label events
133
- LABEL_MOUSEDOWN = 'label:mousedown',
134
- LABEL_DRAGSTART = 'label:dragstart',
135
- LABEL_DRAG = 'label:drag',
136
- LABEL_DROP = 'label:drop',
137
- LABEL_CLICK = 'label:click',
138
- LABEL_DBCLICK = 'label:dbclick',
139
- LABEL_BLUR = 'label:blur',
140
- LABEL_MOUSEMOVE = 'label:mousemove',
141
- LABEL_MOUSEUP = 'label:mouseup',
142
- LABEL_FOCUS = 'label:focus',
143
- LABEL_ADD = 'label:add',
144
- LABEL_UPDATE = 'label:update',
145
- LABEL_CLEAR = 'label:clear',
146
- LABEL_DELETE = 'label:delete',
147
- LABEL_SHOULD_ADD = 'label:should-add',
148
- LABEL_BATCH_ADD = 'label:batch-add',
149
- LABEL_SHOULD_UPDATE = 'label:should-update',
150
- LABEL_SHOULD_DELETE = 'label:should-delete',
151
- LABEL_BATCH_DELETE = 'label:batch-delete',
152
- LABEL_NOT_ALLOWED_ADD = 'label:not-allowed-add',
153
-
154
- // Other events
155
- HISTORY_CHANGE = 'history:change',
156
- GRAPH_TRANSFORM = 'graph:transform',
157
- GRAPH_RENDERED = 'graph:rendered',
158
- GRAPH_UPDATED = 'graph:updated',
159
- EDIT_CONFIG_CHANGED = 'editConfig:changed',
160
- }
161
-
162
- export enum OverlapMode {
163
- STATIC = -1, // 静态(元素层级不随点击变化)
164
- DEFAULT = 0, // 默认
165
- INCREASE = 1, // 递增
166
- EDGE_TOP = 2, // 边固定在顶部
167
- }
168
-
169
- export enum SegmentDirection {
170
- HORIZONTAL = 'horizontal',
171
- VERTICAL = 'vertical',
172
- }
173
-
174
- export enum TextMode {
175
- TEXT = 'text',
176
- LABEL = 'label',
177
- }
178
-
179
- export * from './theme'