@logicflow/extension 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.
- package/README.md +16 -0
- package/package.json +10 -7
- package/.turbo/turbo-build.log +0 -38
- package/CHANGELOG.md +0 -1829
- package/__test__/bpmn-adapter.test.js +0 -227
- package/es/materials/curved-edge/__test__/curved-edge.test.d.ts +0 -1
- package/es/materials/curved-edge/__test__/curved-edge.test.js +0 -18
- package/jest.config.js +0 -198
- package/lib/materials/curved-edge/__test__/curved-edge.test.d.ts +0 -1
- package/lib/materials/curved-edge/__test__/curved-edge.test.js +0 -20
- package/rollup.config.js +0 -52
- package/src/NodeResize/BasicShape/Ellipse.tsx +0 -22
- package/src/NodeResize/BasicShape/Polygon.tsx +0 -24
- package/src/NodeResize/BasicShape/Rect.tsx +0 -44
- package/src/NodeResize/control/Control.tsx +0 -537
- package/src/NodeResize/control/ControlGroup.tsx +0 -76
- package/src/NodeResize/control/Util.ts +0 -206
- package/src/NodeResize/index.ts +0 -26
- package/src/NodeResize/node/DiamondResize.tsx +0 -149
- package/src/NodeResize/node/EllipseResize.tsx +0 -140
- package/src/NodeResize/node/HtmlResize.tsx +0 -125
- package/src/NodeResize/node/RectResize.tsx +0 -126
- package/src/NodeResize/node/index.ts +0 -4
- package/src/bpmn/constant.ts +0 -56
- package/src/bpmn/events/EndEvent.ts +0 -73
- package/src/bpmn/events/StartEvent.ts +0 -52
- package/src/bpmn/events/index.ts +0 -2
- package/src/bpmn/flow/SequenceFlow.ts +0 -25
- package/src/bpmn/flow/index.ts +0 -1
- package/src/bpmn/gateways/ExclusiveGateway.ts +0 -71
- package/src/bpmn/gateways/index.ts +0 -1
- package/src/bpmn/getBpmnId.ts +0 -31
- package/src/bpmn/index.ts +0 -60
- package/src/bpmn/tasks/ServiceTask.ts +0 -63
- package/src/bpmn/tasks/UserTask.ts +0 -64
- package/src/bpmn/tasks/index.ts +0 -2
- package/src/bpmn-adapter/bpmnIds.ts +0 -31
- package/src/bpmn-adapter/index.ts +0 -835
- package/src/bpmn-adapter/json2xml.ts +0 -127
- package/src/bpmn-adapter/xml2json.ts +0 -544
- package/src/bpmn-elements/README.md +0 -223
- package/src/bpmn-elements/__tests__/definition.test.js +0 -72
- package/src/bpmn-elements/index.d.ts +0 -26
- package/src/bpmn-elements/index.ts +0 -107
- package/src/bpmn-elements/presets/Event/EndEventFactory.ts +0 -114
- package/src/bpmn-elements/presets/Event/IntermediateCatchEvent.ts +0 -108
- package/src/bpmn-elements/presets/Event/IntermediateThrowEvent.ts +0 -109
- package/src/bpmn-elements/presets/Event/StartEventFactory.ts +0 -114
- package/src/bpmn-elements/presets/Event/boundaryEventFactory.ts +0 -117
- package/src/bpmn-elements/presets/Event/index.ts +0 -14
- package/src/bpmn-elements/presets/Flow/flow.d.ts +0 -6
- package/src/bpmn-elements/presets/Flow/index.ts +0 -8
- package/src/bpmn-elements/presets/Flow/manhattan.ts +0 -691
- package/src/bpmn-elements/presets/Flow/sequenceFlow.ts +0 -65
- package/src/bpmn-elements/presets/Gateway/gateway.ts +0 -107
- package/src/bpmn-elements/presets/Gateway/index.ts +0 -23
- package/src/bpmn-elements/presets/Pool/Lane.ts +0 -211
- package/src/bpmn-elements/presets/Pool/Pool.ts +0 -284
- package/src/bpmn-elements/presets/Pool/index.ts +0 -89
- package/src/bpmn-elements/presets/Task/index.ts +0 -122
- package/src/bpmn-elements/presets/Task/subProcess.ts +0 -189
- package/src/bpmn-elements/presets/Task/task.ts +0 -193
- package/src/bpmn-elements/presets/icons.ts +0 -155
- package/src/bpmn-elements/utils.ts +0 -52
- package/src/bpmn-elements-adapter/README.md +0 -293
- package/src/bpmn-elements-adapter/__tests__/adapter_in.test.js +0 -528
- package/src/bpmn-elements-adapter/__tests__/adapter_out.test.js +0 -569
- package/src/bpmn-elements-adapter/constant.ts +0 -76
- package/src/bpmn-elements-adapter/index.ts +0 -1134
- package/src/bpmn-elements-adapter/json2xml.ts +0 -105
- package/src/bpmn-elements-adapter/xml2json.ts +0 -542
- package/src/components/context-menu/index.ts +0 -253
- package/src/components/control/index.ts +0 -155
- package/src/components/dnd-panel/index.ts +0 -137
- package/src/components/highlight/index.ts +0 -227
- package/src/components/menu/index.ts +0 -748
- package/src/components/mini-map/index.ts +0 -686
- package/src/components/selection-select/index.ts +0 -387
- package/src/dynamic-group/index.ts +0 -774
- package/src/dynamic-group/model.ts +0 -580
- package/src/dynamic-group/node.ts +0 -288
- package/src/dynamic-group/utils.ts +0 -46
- package/src/index.less +0 -1
- package/src/index.ts +0 -47
- package/src/insert-node-in-polyline/edge.ts +0 -175
- package/src/insert-node-in-polyline/index.ts +0 -193
- package/src/materials/curved-edge/__test__/curved-edge.test.ts +0 -46
- package/src/materials/curved-edge/index.ts +0 -217
- package/src/materials/group/GroupNode.ts +0 -437
- package/src/materials/group/index.ts +0 -542
- package/src/materials/node-selection/index.ts +0 -380
- package/src/mindmap/fakerRoot.ts +0 -19
- package/src/mindmap/index.ts +0 -328
- package/src/mindmap/markContent.ts +0 -81
- package/src/mindmap/markContentOption.ts +0 -81
- package/src/mindmap/markEntity.ts +0 -82
- package/src/mindmap/markRoot.ts +0 -83
- package/src/mindmap/theme.ts +0 -11
- package/src/pool/LaneModel.ts +0 -226
- package/src/pool/LaneView.ts +0 -220
- package/src/pool/PoolModel.ts +0 -631
- package/src/pool/PoolView.ts +0 -75
- package/src/pool/constant.ts +0 -19
- package/src/pool/index.ts +0 -621
- package/src/pool/utils.ts +0 -46
- package/src/rect-label-node/RectLabelNodeView.ts +0 -33
- package/src/rect-label-node/index.ts +0 -15
- package/src/style/index.less +0 -381
- package/src/style/raw.ts +0 -328
- package/src/tools/auto-layout/index.ts +0 -282
- package/src/tools/flow-path/index.ts +0 -233
- package/src/tools/label/Label.tsx +0 -357
- package/src/tools/label/LabelModel.ts +0 -83
- package/src/tools/label/LabelOverlay.tsx +0 -162
- package/src/tools/label/algorithm.ts +0 -42
- package/src/tools/label/index.ts +0 -479
- package/src/tools/label/mediumEditor.ts +0 -121
- package/src/tools/label/utils.ts +0 -395
- package/src/tools/proximity-connect/index.ts +0 -435
- package/src/tools/snapshot/README.md +0 -145
- package/src/tools/snapshot/index.ts +0 -701
- package/src/tools/snapshot/utils.ts +0 -163
- package/src/turbo-adapter/index.ts +0 -212
- package/stats.html +0 -4842
- package/tsconfig.json +0 -18
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
h,
|
|
3
|
-
CircleNode,
|
|
4
|
-
CircleNodeModel,
|
|
5
|
-
GraphModel,
|
|
6
|
-
LogicFlow,
|
|
7
|
-
} from '@logicflow/core'
|
|
8
|
-
import { genBpmnId, groupRule } from '../../utils'
|
|
9
|
-
|
|
10
|
-
import NodeConfig = LogicFlow.NodeConfig
|
|
11
|
-
|
|
12
|
-
export function IntermediateThrowEventFactory(lf: any): {
|
|
13
|
-
type: string
|
|
14
|
-
model: any
|
|
15
|
-
view: any
|
|
16
|
-
} {
|
|
17
|
-
const [definition] = lf.useDefinition()
|
|
18
|
-
|
|
19
|
-
class view extends CircleNode {
|
|
20
|
-
getAnchorStyle() {
|
|
21
|
-
return {
|
|
22
|
-
visibility: 'hidden',
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
getShape() {
|
|
27
|
-
// @ts-ignore
|
|
28
|
-
const { model } = this.props
|
|
29
|
-
const style = model.getNodeStyle()
|
|
30
|
-
const { x, y, r, width, height, properties } = model as CircleNodeModel
|
|
31
|
-
const { definitionType } = properties
|
|
32
|
-
const { icon } =
|
|
33
|
-
definition.intermediateThrowEvent?.get(definitionType) || {}
|
|
34
|
-
|
|
35
|
-
const i = Array.isArray(icon)
|
|
36
|
-
? h(
|
|
37
|
-
'g',
|
|
38
|
-
{
|
|
39
|
-
transform: `matrix(1 0 0 1 ${x - width / 2} ${y - height / 2})`,
|
|
40
|
-
},
|
|
41
|
-
...icon,
|
|
42
|
-
)
|
|
43
|
-
: h('path', {
|
|
44
|
-
transform: `matrix(1 0 0 1 ${x - width / 2} ${y - height / 2})`,
|
|
45
|
-
d: icon,
|
|
46
|
-
style: 'fill: black',
|
|
47
|
-
})
|
|
48
|
-
return h(
|
|
49
|
-
'g',
|
|
50
|
-
{},
|
|
51
|
-
h('circle', {
|
|
52
|
-
...style,
|
|
53
|
-
cx: x,
|
|
54
|
-
cy: y,
|
|
55
|
-
r,
|
|
56
|
-
strokeWidth: 1.5,
|
|
57
|
-
}),
|
|
58
|
-
h('circle', {
|
|
59
|
-
...style,
|
|
60
|
-
cx: x,
|
|
61
|
-
cy: y,
|
|
62
|
-
r: r - 3,
|
|
63
|
-
strokeWidth: 1.5,
|
|
64
|
-
}),
|
|
65
|
-
i,
|
|
66
|
-
)
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
class model extends CircleNodeModel {
|
|
71
|
-
constructor(data: NodeConfig, graphModel: GraphModel) {
|
|
72
|
-
if (!data.id) {
|
|
73
|
-
data.id = `Event_${genBpmnId()}`
|
|
74
|
-
}
|
|
75
|
-
if (!data.text) {
|
|
76
|
-
data.text = ''
|
|
77
|
-
}
|
|
78
|
-
if (data.text && typeof data.text === 'string') {
|
|
79
|
-
data.text = {
|
|
80
|
-
value: data.text,
|
|
81
|
-
x: data.x,
|
|
82
|
-
y: data.y + 40,
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
const { properties = {} } =
|
|
86
|
-
definition.intermediateThrowEvent?.get(
|
|
87
|
-
data.properties?.definitionType,
|
|
88
|
-
) || {}
|
|
89
|
-
data.properties = {
|
|
90
|
-
...properties,
|
|
91
|
-
...data.properties,
|
|
92
|
-
}
|
|
93
|
-
data.properties?.definitionType &&
|
|
94
|
-
(data.properties!.definitionId = `Definition_${genBpmnId()}`)
|
|
95
|
-
super(data, graphModel)
|
|
96
|
-
groupRule.call(this)
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
setAttributes(): void {
|
|
100
|
-
this.r = 18
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
return {
|
|
105
|
-
type: 'bpmn:intermediateThrowEvent',
|
|
106
|
-
view,
|
|
107
|
-
model,
|
|
108
|
-
}
|
|
109
|
-
}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
|
-
import {
|
|
3
|
-
h,
|
|
4
|
-
CircleNode,
|
|
5
|
-
CircleNodeModel,
|
|
6
|
-
GraphModel,
|
|
7
|
-
LogicFlow,
|
|
8
|
-
} from '@logicflow/core'
|
|
9
|
-
import { genBpmnId } from '../../utils'
|
|
10
|
-
import NodeConfig = LogicFlow.NodeConfig
|
|
11
|
-
|
|
12
|
-
export function StartEventFactory(lf: any): {
|
|
13
|
-
type: string
|
|
14
|
-
model: any
|
|
15
|
-
view: any
|
|
16
|
-
} {
|
|
17
|
-
const [definition] = lf.useDefinition()
|
|
18
|
-
|
|
19
|
-
class view extends CircleNode {
|
|
20
|
-
getAnchorStyle() {
|
|
21
|
-
return {
|
|
22
|
-
visibility: 'hidden',
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
getShape() {
|
|
27
|
-
// @ts-ignore
|
|
28
|
-
const { model } = this.props
|
|
29
|
-
const style = model.getNodeStyle()
|
|
30
|
-
const { x, y, r, width, height, properties } = model as CircleNodeModel
|
|
31
|
-
const { definitionType, isInterrupting } = properties
|
|
32
|
-
const { icon } = definition.startEvent?.get(definitionType) || {}
|
|
33
|
-
const i = Array.isArray(icon)
|
|
34
|
-
? h(
|
|
35
|
-
'g',
|
|
36
|
-
{
|
|
37
|
-
transform: `matrix(1 0 0 1 ${x - width / 2} ${y - height / 2})`,
|
|
38
|
-
},
|
|
39
|
-
...icon,
|
|
40
|
-
)
|
|
41
|
-
: h('path', {
|
|
42
|
-
transform: `matrix(1 0 0 1 ${x - width / 2} ${y - height / 2})`,
|
|
43
|
-
d: icon,
|
|
44
|
-
style:
|
|
45
|
-
'fill: white; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
|
|
46
|
-
})
|
|
47
|
-
return h(
|
|
48
|
-
'g',
|
|
49
|
-
{},
|
|
50
|
-
h('circle', {
|
|
51
|
-
...style,
|
|
52
|
-
cx: x,
|
|
53
|
-
cy: y,
|
|
54
|
-
r,
|
|
55
|
-
strokeDasharray: isInterrupting ? '5,5' : '',
|
|
56
|
-
strokeWidth: 2,
|
|
57
|
-
}),
|
|
58
|
-
i,
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
class model extends CircleNodeModel {
|
|
64
|
-
constructor(data: NodeConfig, graphModel: GraphModel) {
|
|
65
|
-
if (!data.id) {
|
|
66
|
-
data.id = `Event_${genBpmnId()}`
|
|
67
|
-
}
|
|
68
|
-
if (!data.text) {
|
|
69
|
-
data.text = ''
|
|
70
|
-
}
|
|
71
|
-
if (data.text && typeof data.text === 'string') {
|
|
72
|
-
data.text = {
|
|
73
|
-
value: data.text,
|
|
74
|
-
x: data.x,
|
|
75
|
-
y: data.y + 40,
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
const { properties = {} } =
|
|
79
|
-
definition.startEvent?.get(data.properties?.definitionType) || {}
|
|
80
|
-
data.properties = {
|
|
81
|
-
...properties,
|
|
82
|
-
...data.properties,
|
|
83
|
-
}
|
|
84
|
-
data.properties?.definitionType &&
|
|
85
|
-
(data.properties!.definitionId = `Definition_${genBpmnId()}`)
|
|
86
|
-
super(data, graphModel)
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
setAttributes(): void {
|
|
90
|
-
this.r = 18
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
getConnectedTargetRules() {
|
|
94
|
-
const rules = super.getConnectedTargetRules()
|
|
95
|
-
const notAsSource = {
|
|
96
|
-
message: '起始节点不能作为边的终点',
|
|
97
|
-
validate: (_source: any, target: any) => {
|
|
98
|
-
if (target === this) {
|
|
99
|
-
return false
|
|
100
|
-
}
|
|
101
|
-
return true
|
|
102
|
-
},
|
|
103
|
-
}
|
|
104
|
-
rules.push(notAsSource)
|
|
105
|
-
return rules
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
return {
|
|
110
|
-
type: 'bpmn:startEvent',
|
|
111
|
-
view,
|
|
112
|
-
model,
|
|
113
|
-
}
|
|
114
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/* eslint-disable max-len */
|
|
2
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
3
|
-
import {
|
|
4
|
-
CircleNode,
|
|
5
|
-
CircleNodeModel,
|
|
6
|
-
GraphModel,
|
|
7
|
-
h,
|
|
8
|
-
LogicFlow,
|
|
9
|
-
} from '@logicflow/core'
|
|
10
|
-
import { genBpmnId, groupRule } from '../../utils'
|
|
11
|
-
import NodeConfig = LogicFlow.NodeConfig
|
|
12
|
-
|
|
13
|
-
export function BoundaryEventFactory(lf: any): {
|
|
14
|
-
type: string
|
|
15
|
-
model: any
|
|
16
|
-
view: any
|
|
17
|
-
} {
|
|
18
|
-
const [definition] = lf.useDefinition()
|
|
19
|
-
|
|
20
|
-
class view extends CircleNode {
|
|
21
|
-
getAnchorStyle() {
|
|
22
|
-
return {
|
|
23
|
-
visibility: 'hidden',
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
getShape() {
|
|
28
|
-
// @ts-ignore
|
|
29
|
-
const { model } = this.props
|
|
30
|
-
const style = model.getNodeStyle()
|
|
31
|
-
const { x, y, r, width, height, properties } = model as CircleNodeModel
|
|
32
|
-
const { definitionType, cancelActivity } = properties
|
|
33
|
-
const { icon } = definition.boundaryEvent?.get(definitionType) || {}
|
|
34
|
-
const i = Array.isArray(icon)
|
|
35
|
-
? h(
|
|
36
|
-
'g',
|
|
37
|
-
{
|
|
38
|
-
transform: `matrix(1 0 0 1 ${x - width / 2} ${y - height / 2})`,
|
|
39
|
-
},
|
|
40
|
-
...icon,
|
|
41
|
-
)
|
|
42
|
-
: h('path', {
|
|
43
|
-
transform: `matrix(1 0 0 1 ${x - width / 2} ${y - height / 2})`,
|
|
44
|
-
d: icon,
|
|
45
|
-
})
|
|
46
|
-
return h(
|
|
47
|
-
'g',
|
|
48
|
-
{},
|
|
49
|
-
h('circle', {
|
|
50
|
-
...style,
|
|
51
|
-
cx: x,
|
|
52
|
-
cy: y,
|
|
53
|
-
r,
|
|
54
|
-
strokeDasharray: cancelActivity ? '' : '5,5',
|
|
55
|
-
strokeWidth: 1.5,
|
|
56
|
-
}),
|
|
57
|
-
h('circle', {
|
|
58
|
-
...style,
|
|
59
|
-
cx: x,
|
|
60
|
-
cy: y,
|
|
61
|
-
r: r - 3,
|
|
62
|
-
strokeDasharray: cancelActivity ? '' : '5,5',
|
|
63
|
-
strokeWidth: 1.5,
|
|
64
|
-
}),
|
|
65
|
-
i,
|
|
66
|
-
)
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
class model extends CircleNodeModel {
|
|
71
|
-
constructor(data: NodeConfig, graphModel: GraphModel) {
|
|
72
|
-
if (!data.id) {
|
|
73
|
-
data.id = `Event_${genBpmnId()}`
|
|
74
|
-
}
|
|
75
|
-
if (!data.text) {
|
|
76
|
-
data.text = ''
|
|
77
|
-
}
|
|
78
|
-
if (data.text && typeof data.text === 'string') {
|
|
79
|
-
data.text = {
|
|
80
|
-
value: data.text,
|
|
81
|
-
x: data.x,
|
|
82
|
-
y: data.y + 40,
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
const { properties = {} } =
|
|
86
|
-
definition.boundaryEvent?.get(data.properties?.definitionType) || {}
|
|
87
|
-
|
|
88
|
-
data.properties = {
|
|
89
|
-
attachedToRef: '',
|
|
90
|
-
cancelActivity: true,
|
|
91
|
-
...properties,
|
|
92
|
-
...data.properties,
|
|
93
|
-
}
|
|
94
|
-
data.properties?.definitionType &&
|
|
95
|
-
(data.properties!.definitionId = `Definition_${genBpmnId()}`)
|
|
96
|
-
super(data, graphModel)
|
|
97
|
-
groupRule.call(this)
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
initNodeData(data: any) {
|
|
101
|
-
super.initNodeData(data)
|
|
102
|
-
this.r = 20
|
|
103
|
-
this.autoToFront = false // 不自动设置到最顶部,而是使用自己的zIndex
|
|
104
|
-
this.zIndex = 99999 // 保证边界事件节点用于在最上方
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
setAttributes(): void {
|
|
108
|
-
this.r = 18
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
return {
|
|
113
|
-
type: 'bpmn:boundaryEvent',
|
|
114
|
-
view,
|
|
115
|
-
model,
|
|
116
|
-
}
|
|
117
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import LogicFlow from '@logicflow/core'
|
|
2
|
-
import { EndEventFactory } from './EndEventFactory'
|
|
3
|
-
import { IntermediateCatchEventFactory } from './IntermediateCatchEvent'
|
|
4
|
-
import { StartEventFactory } from './StartEventFactory'
|
|
5
|
-
import { BoundaryEventFactory } from './boundaryEventFactory'
|
|
6
|
-
import { IntermediateThrowEventFactory } from './IntermediateThrowEvent'
|
|
7
|
-
|
|
8
|
-
export function registerEventNodes(lf: LogicFlow) {
|
|
9
|
-
lf.register(StartEventFactory(lf))
|
|
10
|
-
lf.register(EndEventFactory(lf))
|
|
11
|
-
lf.register(IntermediateCatchEventFactory(lf))
|
|
12
|
-
lf.register(IntermediateThrowEventFactory(lf))
|
|
13
|
-
lf.register(BoundaryEventFactory(lf))
|
|
14
|
-
}
|