@logicflow/extension 1.2.10 → 1.2.11

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 (134) hide show
  1. package/CHANGELOG.md +1727 -0
  2. package/cjs/bpmn/getBpmnId.js +25 -2
  3. package/cjs/bpmn-elements/index.js +102 -0
  4. package/cjs/bpmn-elements/presets/Event/EndEventFactory.js +134 -0
  5. package/cjs/bpmn-elements/presets/Event/IntermediateCatchEvent.js +118 -0
  6. package/cjs/bpmn-elements/presets/Event/IntermediateThrowEvent.js +119 -0
  7. package/cjs/bpmn-elements/presets/Event/StartEventFactory.js +133 -0
  8. package/cjs/bpmn-elements/presets/Event/boundaryEventFactory.js +125 -0
  9. package/cjs/bpmn-elements/presets/Event/index.js +16 -0
  10. package/cjs/bpmn-elements/presets/Flow/index.js +9 -0
  11. package/cjs/bpmn-elements/presets/Flow/sequenceFlow.js +78 -0
  12. package/cjs/bpmn-elements/presets/Gateway/gateway.js +109 -0
  13. package/cjs/bpmn-elements/presets/Gateway/index.js +14 -0
  14. package/cjs/bpmn-elements/presets/Task/index.js +134 -0
  15. package/cjs/bpmn-elements/presets/Task/subProcess.js +190 -0
  16. package/cjs/bpmn-elements/presets/Task/task.js +190 -0
  17. package/cjs/bpmn-elements/presets/icons.js +116 -0
  18. package/cjs/bpmn-elements/utils.js +45 -0
  19. package/cjs/bpmn-elements-adapter/constant.js +69 -0
  20. package/cjs/bpmn-elements-adapter/index.js +1066 -0
  21. package/cjs/bpmn-elements-adapter/json2xml.js +91 -0
  22. package/cjs/bpmn-elements-adapter/xml2json.js +554 -0
  23. package/cjs/index.js +3 -1
  24. package/cjs/materials/group/index.js +16 -7
  25. package/cjs/tools/snapshot/index.js +14 -0
  26. package/es/bpmn/getBpmnId.js +25 -2
  27. package/es/bpmn-elements/index.d.ts +16 -0
  28. package/es/bpmn-elements/index.js +88 -0
  29. package/es/bpmn-elements/presets/Event/EndEventFactory.d.ts +5 -0
  30. package/es/bpmn-elements/presets/Event/EndEventFactory.js +130 -0
  31. package/es/bpmn-elements/presets/Event/IntermediateCatchEvent.d.ts +5 -0
  32. package/es/bpmn-elements/presets/Event/IntermediateCatchEvent.js +114 -0
  33. package/es/bpmn-elements/presets/Event/IntermediateThrowEvent.d.ts +5 -0
  34. package/es/bpmn-elements/presets/Event/IntermediateThrowEvent.js +115 -0
  35. package/es/bpmn-elements/presets/Event/StartEventFactory.d.ts +5 -0
  36. package/es/bpmn-elements/presets/Event/StartEventFactory.js +129 -0
  37. package/es/bpmn-elements/presets/Event/boundaryEventFactory.d.ts +5 -0
  38. package/es/bpmn-elements/presets/Event/boundaryEventFactory.js +121 -0
  39. package/es/bpmn-elements/presets/Event/index.d.ts +2 -0
  40. package/es/bpmn-elements/presets/Event/index.js +12 -0
  41. package/es/bpmn-elements/presets/Flow/index.d.ts +7 -0
  42. package/es/bpmn-elements/presets/Flow/index.js +5 -0
  43. package/es/bpmn-elements/presets/Flow/sequenceFlow.d.ts +5 -0
  44. package/es/bpmn-elements/presets/Flow/sequenceFlow.js +74 -0
  45. package/es/bpmn-elements/presets/Gateway/gateway.d.ts +17 -0
  46. package/es/bpmn-elements/presets/Gateway/gateway.js +105 -0
  47. package/es/bpmn-elements/presets/Gateway/index.d.ts +2 -0
  48. package/es/bpmn-elements/presets/Gateway/index.js +10 -0
  49. package/es/bpmn-elements/presets/Task/index.d.ts +2 -0
  50. package/es/bpmn-elements/presets/Task/index.js +130 -0
  51. package/es/bpmn-elements/presets/Task/subProcess.d.ts +5 -0
  52. package/es/bpmn-elements/presets/Task/subProcess.js +186 -0
  53. package/es/bpmn-elements/presets/Task/task.d.ts +12 -0
  54. package/es/bpmn-elements/presets/Task/task.js +186 -0
  55. package/es/bpmn-elements/presets/icons.d.ts +25 -0
  56. package/es/bpmn-elements/presets/icons.js +113 -0
  57. package/es/bpmn-elements/utils.d.ts +2 -0
  58. package/es/bpmn-elements/utils.js +40 -0
  59. package/{types/bpmn → es/bpmn-elements-adapter}/constant.d.ts +20 -0
  60. package/es/bpmn-elements-adapter/constant.js +66 -0
  61. package/es/bpmn-elements-adapter/index.d.ts +103 -0
  62. package/es/bpmn-elements-adapter/index.js +1060 -0
  63. package/es/bpmn-elements-adapter/json2xml.d.ts +3 -0
  64. package/es/bpmn-elements-adapter/json2xml.js +87 -0
  65. package/es/bpmn-elements-adapter/xml2json.js +551 -0
  66. package/es/index.d.ts +3 -1
  67. package/es/index.js +3 -1
  68. package/es/materials/group/index.js +16 -7
  69. package/es/tools/snapshot/index.js +14 -0
  70. package/lib/AutoLayout.js +1 -1
  71. package/lib/BpmnAdapter.js +1 -1
  72. package/lib/BpmnElement.js +1 -1
  73. package/lib/ContextMenu.js +1 -1
  74. package/lib/Control.js +1 -1
  75. package/lib/CurvedEdge.js +1 -1
  76. package/lib/DndPanel.js +1 -1
  77. package/lib/FlowPath.js +1 -1
  78. package/lib/Group.js +1 -1
  79. package/lib/Highlight.js +1 -1
  80. package/lib/InsertNodeInPolyline.js +1 -1
  81. package/lib/Menu.js +1 -1
  82. package/lib/MiniMap.js +1 -1
  83. package/lib/NodeResize.js +1 -1
  84. package/lib/RectLabelNode.js +1 -1
  85. package/lib/SelectionSelect.js +1 -1
  86. package/lib/Snapshot.js +1 -1
  87. package/lib/TurboAdapter.js +1 -1
  88. package/lib/lfJson2Xml.js +1 -1
  89. package/lib/lfXml2Json.js +1 -1
  90. package/package.json +3 -3
  91. package/types/NodeResize/BasicShape/Polygon.d.ts +0 -10
  92. package/types/NodeResize/BasicShape/Rect.d.ts +0 -17
  93. package/types/NodeResize/Control/Control.d.ts +0 -66
  94. package/types/NodeResize/Control/ControlGroup.d.ts +0 -13
  95. package/types/NodeResize/Control/Util.d.ts +0 -33
  96. package/types/NodeResize/Node/DiamondResize.d.ts +0 -30
  97. package/types/NodeResize/Node/EllipseResize.d.ts +0 -30
  98. package/types/NodeResize/Node/HtmlResize.d.ts +0 -30
  99. package/types/NodeResize/Node/RectResize.d.ts +0 -32
  100. package/types/NodeResize/index.d.ts +0 -11
  101. package/types/bpmn/events/EndEvent.d.ts +0 -21
  102. package/types/bpmn/events/StartEvent.d.ts +0 -17
  103. package/types/bpmn/flow/SequenceFlow.d.ts +0 -15
  104. package/types/bpmn/gateways/ExclusiveGateway.d.ts +0 -16
  105. package/types/bpmn/getBpmnId.d.ts +0 -1
  106. package/types/bpmn/index.d.ts +0 -13
  107. package/types/bpmn/tasks/ServiceTask.d.ts +0 -17
  108. package/types/bpmn/tasks/UserTask.d.ts +0 -17
  109. package/types/bpmn-adapter/bpmnIds.d.ts +0 -1
  110. package/types/bpmn-adapter/index.d.ts +0 -63
  111. package/types/bpmn-adapter/json2xml.d.ts +0 -3
  112. package/types/components/context-menu/index.d.ts +0 -34
  113. package/types/components/control/index.d.ts +0 -26
  114. package/types/components/dnd-panel/index.d.ts +0 -25
  115. package/types/components/highlight/index.d.ts +0 -21
  116. package/types/components/menu/index.d.ts +0 -50
  117. package/types/components/mini-map/index.d.ts +0 -88
  118. package/types/components/selection-select/index.d.ts +0 -42
  119. package/types/index.d.ts +0 -19
  120. package/types/insert-node-in-polyline/edge.d.ts +0 -31
  121. package/types/insert-node-in-polyline/index.d.ts +0 -28
  122. package/types/locale/en-locale/en.d.ts +0 -19
  123. package/types/locale/en-locale/index.d.ts +0 -9
  124. package/types/locale/locale.d.ts +0 -6
  125. package/types/materials/curved-edge/index.d.ts +0 -8
  126. package/types/materials/curved-edge/searchMiddleIndex.d.ts +0 -1
  127. package/types/materials/group/GroupNode.d.ts +0 -125
  128. package/types/materials/group/index.d.ts +0 -56
  129. package/types/tools/auto-layout/index.d.ts +0 -40
  130. package/types/tools/flow-path/index.d.ts +0 -47
  131. package/types/tools/snapshot/index.d.ts +0 -25
  132. package/types/turbo-adapter/index.d.ts +0 -21
  133. package/types/type/index.d.ts +0 -6
  134. /package/{types/bpmn-adapter → es/bpmn-elements-adapter}/xml2json.d.ts +0 -0
@@ -0,0 +1,186 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ extendStatics(d, b);
10
+ function __() { this.constructor = d; }
11
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
+ };
13
+ })();
14
+ var __assign = (this && this.__assign) || function () {
15
+ __assign = Object.assign || function(t) {
16
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
17
+ s = arguments[i];
18
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
19
+ t[p] = s[p];
20
+ }
21
+ return t;
22
+ };
23
+ return __assign.apply(this, arguments);
24
+ };
25
+ /* eslint-disable no-shadow */
26
+ /* eslint-disable @typescript-eslint/naming-convention */
27
+ import { h } from '@logicflow/core';
28
+ import { GroupNode } from '../../../materials/group/index';
29
+ export function SubProcessFactory() {
30
+ var view = /** @class */ (function (_super) {
31
+ __extends(view, _super);
32
+ function view() {
33
+ return _super !== null && _super.apply(this, arguments) || this;
34
+ }
35
+ view.prototype.getFoldIcon = function () {
36
+ var model = this.props.model;
37
+ var x = model.x, y = model.y, width = model.width, height = model.height, properties = model.properties, foldable = model.foldable;
38
+ var foldX = model.x - model.width / 2 + 5;
39
+ var foldY = model.y - model.height / 2 + 5;
40
+ if (!foldable)
41
+ return null;
42
+ var iconIcon = h('path', {
43
+ fill: 'none',
44
+ stroke: '#818281',
45
+ strokeWidth: 2,
46
+ 'pointer-events': 'none',
47
+ d: properties.isFolded
48
+ ? "M " + (foldX + 3) + "," + (foldY + 6) + " " + (foldX + 11) + "," + (foldY + 6) + " M" + (foldX + 7) + "," + (foldY + 2) + " " + (foldX + 7) + "," + (foldY + 10)
49
+ : "M " + (foldX + 3) + "," + (foldY + 6) + " " + (foldX + 11) + "," + (foldY + 6) + " ",
50
+ });
51
+ return h('g', {}, [
52
+ h('rect', {
53
+ height: 12,
54
+ width: 14,
55
+ rx: 2,
56
+ ry: 2,
57
+ strokeWidth: 1,
58
+ fill: '#F4F5F6',
59
+ stroke: '#CECECE',
60
+ cursor: 'pointer',
61
+ x: x - width / 2 + 5,
62
+ y: y - height / 2 + 5,
63
+ onClick: function (e) {
64
+ e.stopPropagation();
65
+ model.foldGroup(!properties.isFolded);
66
+ },
67
+ }),
68
+ iconIcon,
69
+ ]);
70
+ };
71
+ view.prototype.getResizeShape = function () {
72
+ var model = this.props.model;
73
+ var x = model.x, y = model.y, width = model.width, height = model.height;
74
+ var style = model.getNodeStyle();
75
+ var foldRectAttrs = __assign(__assign({}, style), { x: x - width / 2, y: y - height / 2, width: width,
76
+ height: height, stroke: 'black', strokeWidth: 2, strokeDasharray: '0 0' });
77
+ return h('g', {}, [
78
+ // this.getAddAbleShape(),
79
+ h('rect', __assign({}, foldRectAttrs)),
80
+ this.getFoldIcon(),
81
+ ]);
82
+ };
83
+ return view;
84
+ }(GroupNode.view));
85
+ var model = /** @class */ (function (_super) {
86
+ __extends(model, _super);
87
+ function model() {
88
+ return _super !== null && _super.apply(this, arguments) || this;
89
+ }
90
+ model.prototype.initNodeData = function (data) {
91
+ _super.prototype.initNodeData.call(this, data);
92
+ this.foldable = true;
93
+ // this.isFolded = true;
94
+ this.resizable = true;
95
+ this.width = 400;
96
+ this.height = 200;
97
+ // 根据 properties中的配置重设 宽高
98
+ this.resetWidthHeight();
99
+ this.isTaskNode = true; // 标识此节点是任务节点,可以被附件边界事件
100
+ this.boundaryEvents = []; // 记录自己附加的边界事件
101
+ };
102
+ // 自定义根据properties.iniProp
103
+ model.prototype.resetWidthHeight = function () {
104
+ var _a, _b;
105
+ var width = (_a = this.properties.iniProp) === null || _a === void 0 ? void 0 : _a.width;
106
+ var height = (_b = this.properties.iniProp) === null || _b === void 0 ? void 0 : _b.height;
107
+ width && (this.width = width);
108
+ height && (this.height = height);
109
+ };
110
+ model.prototype.getNodeStyle = function () {
111
+ var style = _super.prototype.getNodeStyle.call(this);
112
+ style.stroke = '#989891';
113
+ style.strokeWidth = 1;
114
+ style.strokeDasharray = '3 3';
115
+ if (this.isSelected) {
116
+ style.stroke = 'rgb(124, 15, 255)';
117
+ }
118
+ // isBoundaryEventTouchingTask属性用于标识拖动边界节点是否靠近此节点
119
+ // 如果靠近,则高亮提示
120
+ // style.fill = 'rgb(255, 230, 204)';
121
+ var isBoundaryEventTouchingTask = this.properties.isBoundaryEventTouchingTask;
122
+ if (isBoundaryEventTouchingTask) {
123
+ style.stroke = '#00acff';
124
+ style.strokeWidth = 2;
125
+ }
126
+ return style;
127
+ };
128
+ model.prototype.addChild = function (id) {
129
+ var model = this.graphModel.getElement(id);
130
+ model.setProperties({
131
+ parent: this.id,
132
+ });
133
+ _super.prototype.addChild.call(this, id);
134
+ };
135
+ // 隐藏锚点而不是设置锚点数为0
136
+ // 因为分组内部节点与外部节点相连时,
137
+ // 如果折叠分组,需要分组代替内部节点与外部节点相连。
138
+ model.prototype.getAnchorStyle = function () {
139
+ var style = _super.prototype.getAnchorStyle.call(this, {});
140
+ style.stroke = '#000';
141
+ style.fill = '#fff';
142
+ style.hover.stroke = 'transparent';
143
+ return style;
144
+ };
145
+ model.prototype.getOutlineStyle = function () {
146
+ var style = _super.prototype.getOutlineStyle.call(this);
147
+ style.stroke = 'transparent';
148
+ !style.hover && (style.hover = {});
149
+ style.hover.stroke = 'transparent';
150
+ return style;
151
+ };
152
+ /**
153
+ * 提供方法给插件在判断此节点被拖动边界事件节点靠近时调用,从而触发高亮
154
+ */
155
+ model.prototype.setTouching = function (flag) {
156
+ this.setProperty('isBoundaryEventTouchingTask', flag);
157
+ };
158
+ /**
159
+ * 附加后记录被附加的边界事件节点Id
160
+ */
161
+ model.prototype.addBoundaryEvent = function (nodeId) {
162
+ this.setTouching(false);
163
+ if (this.boundaryEvents.find(function (item) { return item === nodeId; })) {
164
+ return false;
165
+ }
166
+ var boundaryEvent = this.graphModel.getNodeModelById(nodeId);
167
+ boundaryEvent === null || boundaryEvent === void 0 ? void 0 : boundaryEvent.setProperties({
168
+ attachedToRef: this.id,
169
+ });
170
+ this.boundaryEvents.push(nodeId);
171
+ return true;
172
+ };
173
+ /**
174
+ * 被附加的边界事件节点被删除时,移除记录
175
+ */
176
+ model.prototype.deleteBoundaryEvent = function (nodeId) {
177
+ this.boundaryEvents = this.boundaryEvents.filter(function (item) { return item !== nodeId; });
178
+ };
179
+ return model;
180
+ }(GroupNode.model));
181
+ return {
182
+ type: 'bpmn:subProcess',
183
+ view: view,
184
+ model: model,
185
+ };
186
+ }
@@ -0,0 +1,12 @@
1
+ export declare const multiInstanceIcon: any;
2
+ /**
3
+ * @param type 任务节点的type, 对应其XML定义中的节点名,如<bpmn:userTask /> 其type为bpmn:userTask
4
+ * @param icon 任务节点左上角的图标,可以是svg path,也可以是h函数生成的svg
5
+ * @param props (可选) 任务节点的属性
6
+ * @returns { type: string, model: any, view: any }
7
+ */
8
+ export declare function TaskNodeFactory(type: string, icon: string | any[], props?: any): {
9
+ type: string;
10
+ model: any;
11
+ view: any;
12
+ };
@@ -0,0 +1,186 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ extendStatics(d, b);
10
+ function __() { this.constructor = d; }
11
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
+ };
13
+ })();
14
+ var __assign = (this && this.__assign) || function () {
15
+ __assign = Object.assign || function(t) {
16
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
17
+ s = arguments[i];
18
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
19
+ t[p] = s[p];
20
+ }
21
+ return t;
22
+ };
23
+ return __assign.apply(this, arguments);
24
+ };
25
+ var __read = (this && this.__read) || function (o, n) {
26
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
27
+ if (!m) return o;
28
+ var i = m.call(o), r, ar = [], e;
29
+ try {
30
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
31
+ }
32
+ catch (error) { e = { error: error }; }
33
+ finally {
34
+ try {
35
+ if (r && !r.done && (m = i["return"])) m.call(i);
36
+ }
37
+ finally { if (e) throw e.error; }
38
+ }
39
+ return ar;
40
+ };
41
+ var __spread = (this && this.__spread) || function () {
42
+ for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
43
+ return ar;
44
+ };
45
+ /* eslint-disable @typescript-eslint/naming-convention */
46
+ import { RectNode, RectNodeModel, h, } from '@logicflow/core';
47
+ import { parallelMarker, sequentialMarker, loopMarker } from '../icons';
48
+ import { genBpmnId, groupRule } from '../../utils';
49
+ export var multiInstanceIcon = {
50
+ parallel: parallelMarker,
51
+ sequential: sequentialMarker,
52
+ loop: loopMarker,
53
+ };
54
+ /**
55
+ * @param type 任务节点的type, 对应其XML定义中的节点名,如<bpmn:userTask /> 其type为bpmn:userTask
56
+ * @param icon 任务节点左上角的图标,可以是svg path,也可以是h函数生成的svg
57
+ * @param props (可选) 任务节点的属性
58
+ * @returns { type: string, model: any, view: any }
59
+ */
60
+ export function TaskNodeFactory(type, icon, props) {
61
+ var view = /** @class */ (function (_super) {
62
+ __extends(view, _super);
63
+ function view() {
64
+ return _super !== null && _super.apply(this, arguments) || this;
65
+ }
66
+ view.prototype.getLabelShape = function () {
67
+ // @ts-ignore
68
+ var model = this.props.model;
69
+ var x = model.x, y = model.y, width = model.width, height = model.height;
70
+ var style = model.getNodeStyle();
71
+ var i = Array.isArray(icon)
72
+ ? h.apply(void 0, __spread(['g', {
73
+ transform: "matrix(1 0 0 1 " + (x - width / 2) + " " + (y - height / 2) + ")",
74
+ }], icon)) : h('path', {
75
+ fill: style.stroke,
76
+ d: icon,
77
+ });
78
+ return h('svg', {
79
+ x: x - width / 2 + 5,
80
+ y: y - height / 2 + 5,
81
+ width: 25,
82
+ height: 25,
83
+ viewBox: '0 0 1274 1024',
84
+ }, i);
85
+ };
86
+ view.prototype.getShape = function () {
87
+ // @ts-ignore
88
+ var model = this.props.model;
89
+ var x = model.x, y = model.y, width = model.width, height = model.height, radius = model.radius, properties = model.properties;
90
+ var style = model.getNodeStyle();
91
+ return h('g', {}, [
92
+ h('rect', __assign(__assign({}, style), { x: x - width / 2, y: y - height / 2, rx: radius, ry: radius, width: width,
93
+ height: height, opacity: 0.95 })),
94
+ this.getLabelShape(),
95
+ h('g', {
96
+ transform: "matrix(1 0 0 1 " + (x - width / 2) + " " + (y - height / 2) + ")",
97
+ }, h('path', {
98
+ fill: 'white',
99
+ strokeLinecap: 'round',
100
+ strokeLinejoin: 'round',
101
+ stroke: 'rgb(34, 36, 42)',
102
+ strokeWidth: '2',
103
+ d: multiInstanceIcon[properties.multiInstanceType] || '',
104
+ })),
105
+ ]);
106
+ };
107
+ return view;
108
+ }(RectNode));
109
+ var model = /** @class */ (function (_super) {
110
+ __extends(model, _super);
111
+ function model(data, graphModel) {
112
+ var _a;
113
+ var _this = this;
114
+ if (!data.id) {
115
+ data.id = "Activity_" + genBpmnId();
116
+ }
117
+ var properties = __assign(__assign({}, (props || {})), data.properties);
118
+ data.properties = properties;
119
+ _this = _super.call(this, data, graphModel) || this;
120
+ (_a = properties === null || properties === void 0 ? void 0 : properties.boundaryEvents) === null || _a === void 0 ? void 0 : _a.forEach(function (id) {
121
+ _this.addBoundaryEvent(id);
122
+ });
123
+ _this.deleteProperty('boundaryEvents');
124
+ groupRule.call(_this);
125
+ return _this;
126
+ }
127
+ model.prototype.initNodeData = function (data) {
128
+ _super.prototype.initNodeData.call(this, data);
129
+ this.isTaskNode = true; // 标识此节点是任务节点,可以被附件边界事件
130
+ this.boundaryEvents = []; // 记录自己附加的边界事件
131
+ };
132
+ model.prototype.getNodeStyle = function () {
133
+ var style = _super.prototype.getNodeStyle.call(this);
134
+ // isBoundaryEventTouchingTask属性用于标识拖动边界节点是否靠近此节点
135
+ // 如果靠近,则高亮提示
136
+ // style.fill = 'rgb(255, 230, 204)';
137
+ var isBoundaryEventTouchingTask = this.properties.isBoundaryEventTouchingTask;
138
+ if (isBoundaryEventTouchingTask) {
139
+ style.stroke = '#00acff';
140
+ style.strokeWidth = 2;
141
+ }
142
+ return style;
143
+ };
144
+ model.prototype.getOutlineStyle = function () {
145
+ var style = _super.prototype.getOutlineStyle.call(this);
146
+ style.stroke = 'transparent';
147
+ !style.hover && (style.hover = {});
148
+ style.hover.stroke = 'transparent';
149
+ return style;
150
+ };
151
+ /**
152
+ * 提供方法给插件在判断此节点被拖动边界事件节点靠近时调用,从而触发高亮
153
+ */
154
+ model.prototype.setTouching = function (flag) {
155
+ this.setProperty('isBoundaryEventTouchingTask', flag);
156
+ };
157
+ /**
158
+ * 附加后记录被附加的边界事件节点Id
159
+ */
160
+ model.prototype.addBoundaryEvent = function (nodeId) {
161
+ this.setTouching(false);
162
+ if (this.boundaryEvents.find(function (item) { return item === nodeId; })) {
163
+ return false;
164
+ }
165
+ var boundaryEvent = this.graphModel.getNodeModelById(nodeId);
166
+ boundaryEvent === null || boundaryEvent === void 0 ? void 0 : boundaryEvent.setProperties({
167
+ attachedToRef: this.id,
168
+ });
169
+ this.boundaryEvents.push(nodeId);
170
+ return true;
171
+ };
172
+ /**
173
+ * 被附加的边界事件节点被删除时,移除记录
174
+ */
175
+ model.prototype.deleteBoundaryEvent = function (nodeId) {
176
+ this.boundaryEvents = this.boundaryEvents.filter(function (item) { return item !== nodeId; });
177
+ };
178
+ return model;
179
+ }(RectNodeModel));
180
+ // @ts-ignore
181
+ return {
182
+ type: type,
183
+ view: view,
184
+ model: model,
185
+ };
186
+ }
@@ -0,0 +1,25 @@
1
+ export declare const messageIcon = "m 8.459999999999999,11.34 l 0,12.6 l 18.900000000000002,0 l 0,-12.6 z l 9.450000000000001,5.4 l 9.450000000000001,-5.4";
2
+ export declare const timerIcon: import("preact").VNode<any>[];
3
+ export declare const errorIcon = "m 7.2,25.991999999999997 0.09350000000000001,-0.025300000000000003 7.3392,-9.610700000000001 7.667000000000001,8.9661 4.7003,-18.2204 -5.8707,11.6501 -7.299600000000001,-9.585400000000002 z";
4
+ export declare const escalationIcon = "M 18,7.2 l 8,20 l -8,-7 l -8,7 Z";
5
+ export declare const compensationIcon = "m 7.92,18 9,-6.5 0,13 z m 9.3,-0.4 8.7,-6.1 0,13 -8.7,-6.1 z";
6
+ export declare const conditionalIcon = "M 10.5,8.5 l 14.5,0 l 0,18 l -14.5,0 Z M 12.5,11.5 l 10.5,0 M 12.5,14.5 l 10.5,0 M 12.5,17.5 l 10.5,0 M 12.5,20.5 l 10.5,0 M 12.5,23.5 l 10.5,0 M 12.5,26.5 l 10.5,0 ";
7
+ export declare const linkIcon = "m 20.52,9.468 0,4.4375 -13.5,0 0,6.75 13.5,0 0,4.4375 9.84375,-7.8125 -9.84375,-7.8125 z";
8
+ export declare const signalIcon = "M 18,7.2 l 9,16.2 l -18,0 Z";
9
+ export declare const terminateIcon: import("preact").VNode<any>[];
10
+ export declare const exclusiveIcon = "m 16,15 7.42857142857143,9.714285714285715 -7.42857142857143,9.714285714285715 3.428571428571429,0 5.714285714285715,-7.464228571428572 5.714285714285715,7.464228571428572 3.428571428571429,0 -7.42857142857143,-9.714285714285715 7.42857142857143,-9.714285714285715 -3.428571428571429,0 -5.714285714285715,7.464228571428572 -5.714285714285715,-7.464228571428572 -3.428571428571429,0 z";
11
+ export declare const parallelIcon = "m 23,10 0,12.5 -12.5,0 0,5 12.5,0 0,12.5 5,0 0,-12.5 12.5,0 0,-5 -12.5,0 0,-12.5 -5,0 z";
12
+ export declare const inclusiveIcon: import("preact").VNode<any>;
13
+ export declare const serviceTaskIcon = "M882.527918 434.149934c-2.234901-5.303796-7.311523-8.853645-13.059434-9.138124l-61.390185-3.009544c-6.635117-20.973684-15.521508-41.175795-26.513864-60.282968l42.051745-47.743374c4.308119-4.889357 4.955872-12.004405 1.602498-17.59268-46.384423-77.30362-103.969956-101.422947-106.400309-102.410438-5.332449-2.170432-11.432377-1.090844-15.693424 2.77009L654.674467 240.664222c-17.004279-8.654101-35.092239-15.756869-53.995775-21.210068l-3.26537-66.490344c-0.280386-5.747911-3.833305-10.824533-9.134031-13.059434-1.683339-0.709151-30.193673-12.391215-76.866668-12.051477-46.672996-0.339738-75.18333 11.342326-76.866668 12.051477-5.300726 2.234901-8.853645 7.311523-9.134031 13.059434l-3.26537 66.490344c-18.903535 5.453199-36.991496 12.555967-53.995775 21.210068l-48.450479-43.922349c-4.261047-3.860934-10.360975-4.940522-15.693424-2.77009-2.430352 0.98749-60.015885 25.106818-106.400309 102.410438-3.353374 5.588275-2.705622 12.703323 1.602498 17.59268l42.051745 47.743374c-10.992355 19.107173-19.878746 39.309284-26.513864 60.282968l-61.390185 3.009544c-5.747911 0.284479-10.824533 3.834328-13.059434 9.138124-1.01512 2.415003-24.687262 60.190871-2.822278 147.651828 1.583055 6.324032 7.072069 10.893094 13.57518 11.308557 5.892197 0.37146 11.751648 0.523933 17.419741 0.667196 14.498202 0.372483 28.193109 0.723477 40.908712 4.63353 4.212952 1.294482 6.435573 8.270361 9.349949 18.763342 1.287319 4.640694 2.617617 9.43693 4.484128 14.010085 1.794879 4.393054 3.75758 8.570189 5.66093 12.607132 1.302669 2.765997 2.529613 5.380544 3.689019 8.018627 2.986007 6.803963 2.682086 9.773598 2.578732 10.349719-3.061732 3.672646-6.391571 7.238868-9.91379 11.015891-1.810229 1.943258-3.680832 3.949962-5.523807 5.980201l-22.560832 24.8909c-3.865028 4.261047-4.940522 10.365068-2.774183 15.693424 0.991584 2.426259 25.102724 60.011792 102.414531 106.400309 5.588275 3.353374 12.703323 2.701528 17.591657-1.603521l23.476691-20.682042c2.346441-2.061962 4.64888-4.336772 6.875594-6.534833 9.05319-8.93858 14.018272-12.95608 17.73185-11.576663 3.305279 1.222851 6.907317 3.166109 10.720156 5.228071 3.325745 1.794879 6.764054 3.650133 10.465352 5.288446 6.016017 2.662643 12.120039 4.688789 18.019399 6.65149 6.827499 2.266623 13.279445 4.409426 18.819624 7.275707 1.518586 0.782829 1.926886 0.994654 2.358721 7.830339 0.726547 11.496845 1.25048 23.276123 1.753947 34.672684 0.264013 5.900384 0.528026 11.803837 0.815575 17.700127 0.284479 5.743818 3.833305 10.82044 9.138124 13.05534 1.654686 0.698918 29.371958 12.063757 74.869175 12.063757 0.328481 0 3.65832 0 3.986801 0 45.497217 0 73.214489-11.364839 74.869175-12.063757 5.304819-2.234901 8.853645-7.311523 9.138124-13.05534 0.287549-5.89629 0.551562-11.799744 0.815575-17.700127 0.503467-11.396561 1.027399-23.175839 1.753947-34.672684 0.431835-6.835685 0.840134-7.04751 2.358721-7.830339 5.54018-2.866281 11.992125-5.009084 18.819624-7.275707 5.89936-1.962701 12.003382-3.988848 18.019399-6.65149 3.701299-1.638313 7.139607-3.493567 10.465352-5.288446 3.812839-2.061962 7.414877-4.00522 10.720156-5.228071 3.713578-1.379417 8.67866 2.638083 17.73185 11.576663 2.226714 2.198062 4.529153 4.472871 6.875594 6.534833l23.476691 20.682042c4.888334 4.305049 12.003382 4.956895 17.591657 1.603521 77.311807-46.388517 101.422947-103.97405 102.414531-106.400309 2.166339-5.328355 1.090844-11.432377-2.774183-15.693424l-22.560832-24.8909c-1.842974-2.030239-3.713578-4.036943-5.523807-5.980201-3.52222-3.777023-6.852058-7.343245-9.91379-11.015891-0.103354-0.576121-0.407276-3.545756 2.578732-10.349719 1.159406-2.638083 2.38635-5.252631 3.689019-8.018627 1.90335-4.036943 3.866051-8.214079 5.66093-12.607132 1.866511-4.573155 3.196809-9.369392 4.484128-14.010085 2.914376-10.492982 5.136997-17.46886 9.349949-18.763342 12.715603-3.910053 26.41051-4.261047 40.908712-4.63353 5.668093-0.143263 11.527544-0.295735 17.419741-0.667196 6.503111-0.415462 11.992125-4.984524 13.57518-11.308557C907.21518 494.340805 883.543038 436.564937 882.527918 434.149934zM643.49894 643.761929c-35.280528 35.280528-82.191954 54.711066-132.086317 54.711066s-96.806813-19.430538-132.086317-54.711066c-35.280528-35.279504-54.711066-82.191954-54.711066-132.086317 0-49.894364 19.430538-96.80272 54.711066-132.082224 35.283598-35.284621 82.191954-54.711066 132.086317-54.711066s96.80579 19.426445 132.086317 54.711066c35.279504 35.279504 54.711066 82.187861 54.711066 132.082224C698.210006 561.569976 678.782537 608.482425 643.49894 643.761929z";
14
+ export declare const userTaskIcon = "M655.807326 287.35973m-223.989415 0a218.879 218.879 0 1 0 447.978829 0 218.879 218.879 0 1 0-447.978829 0ZM1039.955839 895.482975c-0.490184-212.177424-172.287821-384.030443-384.148513-384.030443-211.862739 0-383.660376 171.85302-384.15056 384.030443L1039.955839 895.482975z";
15
+ export declare const scriptTaskIcon = "M6.402,0.5H20.902C20.902,0.5,15.069,3.333,15.069,6.083S19.486,12.083,19.486,15.25S15.319,20.333,15.319,20.333H0.235C0.235,20.333,5.235,17.665999999999997,5.235,15.332999999999998S0.6520000000000001,8.582999999999998,0.6520000000000001,6.082999999999998S6.402,0.5,6.402,0.5ZM3.5,4.5L13.5,4.5M3.8,8.5L13.8,8.5M6.3,12.5L16.3,12.5M6.5,16.5L16.5,16.5";
16
+ export declare const manualTaskIcon = "M0.5,3.751L4.583,0.5009999999999999C4.583,0.5009999999999999,15.749,0.5839999999999999,16.666,0.5839999999999999S14.249,3.5009999999999994,15.166,3.5009999999999994S26.833,3.5009999999999994,27.75,3.5009999999999994C28.916,5.209,27.582,6.667999999999999,26.916,7.167999999999999S27.791,9.084999999999999,25.916,11.584999999999999C25.166,11.834999999999999,26.666,13.459999999999999,24.583000000000002,14.918C23.416,15.501,25.166,16.46,23.333000000000002,17.750999999999998C22.166,17.750999999999998,2.5000000000000036,17.833999999999996,2.5000000000000036,17.833999999999996L0.5000000000000036,16.500999999999998V3.751ZM13.5,7L27,7M13.5,11L26,11M14,14.5L25,14.5M8.2,3.1L15,3.1";
17
+ export declare const style: {
18
+ throw: string;
19
+ catch: string;
20
+ nonIntermediate: string;
21
+ intermediate: string;
22
+ };
23
+ export declare const parallelMarker = "m44,60 m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10";
24
+ export declare const sequentialMarker = "m47,61 m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0";
25
+ export declare const loopMarker = "m 50,73 c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902";
@@ -0,0 +1,113 @@
1
+ import { h } from '@logicflow/core';
2
+ // event
3
+ export var messageIcon = 'm 8.459999999999999,11.34 l 0,12.6 l 18.900000000000002,0 l 0,-12.6 z l 9.450000000000001,5.4 l 9.450000000000001,-5.4';
4
+ export var timerIcon = [
5
+ h('circle', {
6
+ cx: 18,
7
+ cy: 18,
8
+ r: 11,
9
+ style: 'stroke-linecap: round;stroke-linejoin: round;stroke: rgb(34, 36, 42);stroke-width: 2px;fill: white',
10
+ }),
11
+ h('path', {
12
+ d: 'M 18,18 l 2.25,-7.5 m -2.25,7.5 l 5.25,1.5',
13
+ style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2px;',
14
+ }),
15
+ h('path', {
16
+ d: 'M 18,18 m 0,7.5 l -0,2.25',
17
+ transform: 'rotate(0,18,18)',
18
+ style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
19
+ }),
20
+ h('path', {
21
+ d: 'M 18,18 m 0,7.5 l -0,2.25',
22
+ transform: 'rotate(30,18,18)',
23
+ style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
24
+ }),
25
+ h('path', {
26
+ d: 'M 18,18 m 0,7.5 l -0,2.25',
27
+ transform: 'rotate(60,18,18)',
28
+ style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
29
+ }),
30
+ h('path', {
31
+ d: 'M 18,18 m 0,7.5 l -0,2.25',
32
+ transform: 'rotate(90,18,18)',
33
+ style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
34
+ }),
35
+ h('path', {
36
+ d: 'M 18,18 m 0,7.5 l -0,2.25',
37
+ transform: 'rotate(120,18,18)',
38
+ style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
39
+ }),
40
+ h('path', {
41
+ d: 'M 18,18 m 0,7.5 l -0,2.25',
42
+ transform: 'rotate(150,18,18)',
43
+ style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
44
+ }),
45
+ h('path', {
46
+ d: 'M 18,18 m 0,7.5 l -0,2.25',
47
+ transform: 'rotate(180,18,18)',
48
+ style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
49
+ }),
50
+ h('path', {
51
+ d: 'M 18,18 m 0,7.5 l -0,2.25',
52
+ transform: 'rotate(210,18,18)',
53
+ style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
54
+ }),
55
+ h('path', {
56
+ d: 'M 18,18 m 0,7.5 l -0,2.25',
57
+ transform: 'rotate(240,18,18)',
58
+ style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
59
+ }),
60
+ h('path', {
61
+ d: 'M 18,18 m 0,7.5 l -0,2.25',
62
+ transform: 'rotate(270,18,18)',
63
+ style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
64
+ }),
65
+ h('path', {
66
+ d: 'M 18,18 m 0,7.5 l -0,2.25',
67
+ transform: 'rotate(300,18,18)',
68
+ style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
69
+ }),
70
+ h('path', {
71
+ d: 'M 18,18 m 0,7.5 l -0,2.25',
72
+ transform: 'rotate(330,18,18)',
73
+ style: 'fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
74
+ }),
75
+ ];
76
+ export var errorIcon = 'm 7.2,25.991999999999997 0.09350000000000001,-0.025300000000000003 7.3392,-9.610700000000001 7.667000000000001,8.9661 4.7003,-18.2204 -5.8707,11.6501 -7.299600000000001,-9.585400000000002 z';
77
+ export var escalationIcon = 'M 18,7.2 l 8,20 l -8,-7 l -8,7 Z';
78
+ export var compensationIcon = 'm 7.92,18 9,-6.5 0,13 z m 9.3,-0.4 8.7,-6.1 0,13 -8.7,-6.1 z';
79
+ export var conditionalIcon = 'M 10.5,8.5 l 14.5,0 l 0,18 l -14.5,0 Z M 12.5,11.5 l 10.5,0 M 12.5,14.5 l 10.5,0 M 12.5,17.5 l 10.5,0 M 12.5,20.5 l 10.5,0 M 12.5,23.5 l 10.5,0 M 12.5,26.5 l 10.5,0 ';
80
+ export var linkIcon = 'm 20.52,9.468 0,4.4375 -13.5,0 0,6.75 13.5,0 0,4.4375 9.84375,-7.8125 -9.84375,-7.8125 z';
81
+ export var signalIcon = 'M 18,7.2 l 9,16.2 l -18,0 Z';
82
+ export var terminateIcon = [
83
+ h('circle', {
84
+ cx: 18,
85
+ cy: 18,
86
+ r: 10,
87
+ style: 'stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 4px; fill: rgb(34, 36, 42);',
88
+ }),
89
+ ];
90
+ // gateway
91
+ export var exclusiveIcon = 'm 16,15 7.42857142857143,9.714285714285715 -7.42857142857143,9.714285714285715 3.428571428571429,0 5.714285714285715,-7.464228571428572 5.714285714285715,7.464228571428572 3.428571428571429,0 -7.42857142857143,-9.714285714285715 7.42857142857143,-9.714285714285715 -3.428571428571429,0 -5.714285714285715,7.464228571428572 -5.714285714285715,-7.464228571428572 -3.428571428571429,0 z';
92
+ export var parallelIcon = 'm 23,10 0,12.5 -12.5,0 0,5 12.5,0 0,12.5 5,0 0,-12.5 12.5,0 0,-5 -12.5,0 0,-12.5 -5,0 z';
93
+ export var inclusiveIcon = h('circle', {
94
+ cx: 25,
95
+ cy: 25,
96
+ r: 13,
97
+ style: 'stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2.5px; fill: white;',
98
+ });
99
+ // task
100
+ export var serviceTaskIcon = 'M882.527918 434.149934c-2.234901-5.303796-7.311523-8.853645-13.059434-9.138124l-61.390185-3.009544c-6.635117-20.973684-15.521508-41.175795-26.513864-60.282968l42.051745-47.743374c4.308119-4.889357 4.955872-12.004405 1.602498-17.59268-46.384423-77.30362-103.969956-101.422947-106.400309-102.410438-5.332449-2.170432-11.432377-1.090844-15.693424 2.77009L654.674467 240.664222c-17.004279-8.654101-35.092239-15.756869-53.995775-21.210068l-3.26537-66.490344c-0.280386-5.747911-3.833305-10.824533-9.134031-13.059434-1.683339-0.709151-30.193673-12.391215-76.866668-12.051477-46.672996-0.339738-75.18333 11.342326-76.866668 12.051477-5.300726 2.234901-8.853645 7.311523-9.134031 13.059434l-3.26537 66.490344c-18.903535 5.453199-36.991496 12.555967-53.995775 21.210068l-48.450479-43.922349c-4.261047-3.860934-10.360975-4.940522-15.693424-2.77009-2.430352 0.98749-60.015885 25.106818-106.400309 102.410438-3.353374 5.588275-2.705622 12.703323 1.602498 17.59268l42.051745 47.743374c-10.992355 19.107173-19.878746 39.309284-26.513864 60.282968l-61.390185 3.009544c-5.747911 0.284479-10.824533 3.834328-13.059434 9.138124-1.01512 2.415003-24.687262 60.190871-2.822278 147.651828 1.583055 6.324032 7.072069 10.893094 13.57518 11.308557 5.892197 0.37146 11.751648 0.523933 17.419741 0.667196 14.498202 0.372483 28.193109 0.723477 40.908712 4.63353 4.212952 1.294482 6.435573 8.270361 9.349949 18.763342 1.287319 4.640694 2.617617 9.43693 4.484128 14.010085 1.794879 4.393054 3.75758 8.570189 5.66093 12.607132 1.302669 2.765997 2.529613 5.380544 3.689019 8.018627 2.986007 6.803963 2.682086 9.773598 2.578732 10.349719-3.061732 3.672646-6.391571 7.238868-9.91379 11.015891-1.810229 1.943258-3.680832 3.949962-5.523807 5.980201l-22.560832 24.8909c-3.865028 4.261047-4.940522 10.365068-2.774183 15.693424 0.991584 2.426259 25.102724 60.011792 102.414531 106.400309 5.588275 3.353374 12.703323 2.701528 17.591657-1.603521l23.476691-20.682042c2.346441-2.061962 4.64888-4.336772 6.875594-6.534833 9.05319-8.93858 14.018272-12.95608 17.73185-11.576663 3.305279 1.222851 6.907317 3.166109 10.720156 5.228071 3.325745 1.794879 6.764054 3.650133 10.465352 5.288446 6.016017 2.662643 12.120039 4.688789 18.019399 6.65149 6.827499 2.266623 13.279445 4.409426 18.819624 7.275707 1.518586 0.782829 1.926886 0.994654 2.358721 7.830339 0.726547 11.496845 1.25048 23.276123 1.753947 34.672684 0.264013 5.900384 0.528026 11.803837 0.815575 17.700127 0.284479 5.743818 3.833305 10.82044 9.138124 13.05534 1.654686 0.698918 29.371958 12.063757 74.869175 12.063757 0.328481 0 3.65832 0 3.986801 0 45.497217 0 73.214489-11.364839 74.869175-12.063757 5.304819-2.234901 8.853645-7.311523 9.138124-13.05534 0.287549-5.89629 0.551562-11.799744 0.815575-17.700127 0.503467-11.396561 1.027399-23.175839 1.753947-34.672684 0.431835-6.835685 0.840134-7.04751 2.358721-7.830339 5.54018-2.866281 11.992125-5.009084 18.819624-7.275707 5.89936-1.962701 12.003382-3.988848 18.019399-6.65149 3.701299-1.638313 7.139607-3.493567 10.465352-5.288446 3.812839-2.061962 7.414877-4.00522 10.720156-5.228071 3.713578-1.379417 8.67866 2.638083 17.73185 11.576663 2.226714 2.198062 4.529153 4.472871 6.875594 6.534833l23.476691 20.682042c4.888334 4.305049 12.003382 4.956895 17.591657 1.603521 77.311807-46.388517 101.422947-103.97405 102.414531-106.400309 2.166339-5.328355 1.090844-11.432377-2.774183-15.693424l-22.560832-24.8909c-1.842974-2.030239-3.713578-4.036943-5.523807-5.980201-3.52222-3.777023-6.852058-7.343245-9.91379-11.015891-0.103354-0.576121-0.407276-3.545756 2.578732-10.349719 1.159406-2.638083 2.38635-5.252631 3.689019-8.018627 1.90335-4.036943 3.866051-8.214079 5.66093-12.607132 1.866511-4.573155 3.196809-9.369392 4.484128-14.010085 2.914376-10.492982 5.136997-17.46886 9.349949-18.763342 12.715603-3.910053 26.41051-4.261047 40.908712-4.63353 5.668093-0.143263 11.527544-0.295735 17.419741-0.667196 6.503111-0.415462 11.992125-4.984524 13.57518-11.308557C907.21518 494.340805 883.543038 436.564937 882.527918 434.149934zM643.49894 643.761929c-35.280528 35.280528-82.191954 54.711066-132.086317 54.711066s-96.806813-19.430538-132.086317-54.711066c-35.280528-35.279504-54.711066-82.191954-54.711066-132.086317 0-49.894364 19.430538-96.80272 54.711066-132.082224 35.283598-35.284621 82.191954-54.711066 132.086317-54.711066s96.80579 19.426445 132.086317 54.711066c35.279504 35.279504 54.711066 82.187861 54.711066 132.082224C698.210006 561.569976 678.782537 608.482425 643.49894 643.761929z';
101
+ export var userTaskIcon = 'M655.807326 287.35973m-223.989415 0a218.879 218.879 0 1 0 447.978829 0 218.879 218.879 0 1 0-447.978829 0ZM1039.955839 895.482975c-0.490184-212.177424-172.287821-384.030443-384.148513-384.030443-211.862739 0-383.660376 171.85302-384.15056 384.030443L1039.955839 895.482975z';
102
+ export var scriptTaskIcon = 'M6.402,0.5H20.902C20.902,0.5,15.069,3.333,15.069,6.083S19.486,12.083,19.486,15.25S15.319,20.333,15.319,20.333H0.235C0.235,20.333,5.235,17.665999999999997,5.235,15.332999999999998S0.6520000000000001,8.582999999999998,0.6520000000000001,6.082999999999998S6.402,0.5,6.402,0.5ZM3.5,4.5L13.5,4.5M3.8,8.5L13.8,8.5M6.3,12.5L16.3,12.5M6.5,16.5L16.5,16.5';
103
+ export var manualTaskIcon = 'M0.5,3.751L4.583,0.5009999999999999C4.583,0.5009999999999999,15.749,0.5839999999999999,16.666,0.5839999999999999S14.249,3.5009999999999994,15.166,3.5009999999999994S26.833,3.5009999999999994,27.75,3.5009999999999994C28.916,5.209,27.582,6.667999999999999,26.916,7.167999999999999S27.791,9.084999999999999,25.916,11.584999999999999C25.166,11.834999999999999,26.666,13.459999999999999,24.583000000000002,14.918C23.416,15.501,25.166,16.46,23.333000000000002,17.750999999999998C22.166,17.750999999999998,2.5000000000000036,17.833999999999996,2.5000000000000036,17.833999999999996L0.5000000000000036,16.500999999999998V3.751ZM13.5,7L27,7M13.5,11L26,11M14,14.5L25,14.5M8.2,3.1L15,3.1';
104
+ export var style = {
105
+ throw: 'fill: rgb(34, 36, 42); stroke-linecap: round; stroke-linejoin: round; stroke: white; stroke-width: 1px;',
106
+ catch: 'fill: white; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;',
107
+ nonIntermediate: 'stroke-width: 1.5; stroke-dash-array: 6',
108
+ intermediate: 'stroke-width: 1.5',
109
+ };
110
+ // marker
111
+ export var parallelMarker = 'm44,60 m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10';
112
+ export var sequentialMarker = 'm47,61 m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0';
113
+ export var loopMarker = 'm 50,73 c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902';
@@ -0,0 +1,2 @@
1
+ export declare function groupRule(): void;
2
+ export declare function genBpmnId(): string;
@@ -0,0 +1,40 @@
1
+ /* eslint-disable no-bitwise */
2
+ export function groupRule() {
3
+ var rule = {
4
+ message: '分组外的节点不允许连接分组内的',
5
+ validate: function (_sourceNode, _targetNode, _sourceAnchor, _targetAnchor) {
6
+ var isSourceNodeInsideTheGroup = !!_sourceNode.properties.parent;
7
+ var isTargetNodeInsideTheGroup = !!_targetNode.properties.parent;
8
+ return !(!isSourceNodeInsideTheGroup && isTargetNodeInsideTheGroup);
9
+ },
10
+ };
11
+ this.targetRules.push(rule);
12
+ }
13
+ /* eslint-disable no-bitwise */
14
+ var IDS = /** @class */ (function () {
15
+ function IDS() {
16
+ globalThis._ids = this;
17
+ this._ids = new Set();
18
+ }
19
+ IDS.prototype.generateId = function () {
20
+ var id = 'xxxxxxxx'.replace(/[x]/g, function (c) {
21
+ var r = (Math.random() * 16) | 0;
22
+ var v = c === 'x' ? r : (r & 0x3) | 0x8;
23
+ return v.toString(16);
24
+ });
25
+ return id;
26
+ };
27
+ IDS.prototype.next = function () {
28
+ var id = this.generateId();
29
+ while (this._ids.has(id)) {
30
+ id = this.generateId();
31
+ }
32
+ this._ids.add(id);
33
+ return id;
34
+ };
35
+ return IDS;
36
+ }());
37
+ var ids = (globalThis === null || globalThis === void 0 ? void 0 : globalThis._ids) || new IDS();
38
+ export function genBpmnId() {
39
+ return ids.next();
40
+ }
@@ -6,6 +6,22 @@ export declare const EndEventConfig: {
6
6
  width: number;
7
7
  height: number;
8
8
  };
9
+ export declare const BoundaryEventConfig: {
10
+ width: number;
11
+ height: number;
12
+ };
13
+ export declare const IntermediateEventConfig: {
14
+ width: number;
15
+ height: number;
16
+ };
17
+ export declare const ParallelGatewayConfig: {
18
+ width: number;
19
+ height: number;
20
+ };
21
+ export declare const InclusiveGatewayConfig: {
22
+ width: number;
23
+ height: number;
24
+ };
9
25
  export declare const ExclusiveGatewayConfig: {
10
26
  width: number;
11
27
  height: number;
@@ -18,6 +34,10 @@ export declare const UserTaskConfig: {
18
34
  width: number;
19
35
  height: number;
20
36
  };
37
+ export declare const SubProcessConfig: {
38
+ width: number;
39
+ height: number;
40
+ };
21
41
  export declare const theme: {
22
42
  rect: {
23
43
  radius: number;