@logicflow/core 2.2.2 → 2.2.3-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/README.md +32 -0
  2. package/es/model/GraphModel.js +3 -1
  3. package/lib/model/GraphModel.js +3 -1
  4. package/package.json +6 -6
  5. package/dist/docs/api/logicflow-constructor/index.en.md +0 -106
  6. package/dist/docs/api/logicflow-constructor/index.zh.md +0 -106
  7. package/dist/docs/api/logicflow-constructor/use.en.md +0 -61
  8. package/dist/docs/api/logicflow-constructor/use.zh.md +0 -61
  9. package/dist/docs/api/logicflow-instance/canvas.en.md +0 -197
  10. package/dist/docs/api/logicflow-instance/canvas.zh.md +0 -199
  11. package/dist/docs/api/logicflow-instance/edge.en.md +0 -273
  12. package/dist/docs/api/logicflow-instance/edge.zh.md +0 -273
  13. package/dist/docs/api/logicflow-instance/edit-config.en.md +0 -59
  14. package/dist/docs/api/logicflow-instance/edit-config.zh.md +0 -59
  15. package/dist/docs/api/logicflow-instance/element.en.md +0 -375
  16. package/dist/docs/api/logicflow-instance/element.zh.md +0 -379
  17. package/dist/docs/api/logicflow-instance/event.en.md +0 -326
  18. package/dist/docs/api/logicflow-instance/event.zh.md +0 -406
  19. package/dist/docs/api/logicflow-instance/history.en.md +0 -38
  20. package/dist/docs/api/logicflow-instance/history.zh.md +0 -38
  21. package/dist/docs/api/logicflow-instance/index.en.md +0 -41
  22. package/dist/docs/api/logicflow-instance/index.zh.md +0 -41
  23. package/dist/docs/api/logicflow-instance/node.en.md +0 -308
  24. package/dist/docs/api/logicflow-instance/node.zh.md +0 -308
  25. package/dist/docs/api/logicflow-instance/register.en.md +0 -76
  26. package/dist/docs/api/logicflow-instance/register.zh.md +0 -76
  27. package/dist/docs/api/logicflow-instance/render-and-data.en.md +0 -179
  28. package/dist/docs/api/logicflow-instance/render-and-data.zh.md +0 -181
  29. package/dist/docs/api/logicflow-instance/text.en.md +0 -60
  30. package/dist/docs/api/logicflow-instance/text.zh.md +0 -60
  31. package/dist/docs/api/logicflow-instance/theme.en.md +0 -179
  32. package/dist/docs/api/logicflow-instance/theme.zh.md +0 -179
  33. package/dist/docs/api/runtime-model/edgeModel.en.md +0 -29
  34. package/dist/docs/api/runtime-model/edgeModel.zh.md +0 -325
  35. package/dist/docs/api/runtime-model/graphModel.en.md +0 -275
  36. package/dist/docs/api/runtime-model/graphModel.zh.md +0 -1153
  37. package/dist/docs/api/runtime-model/nodeModel.en.md +0 -37
  38. package/dist/docs/api/runtime-model/nodeModel.zh.md +0 -644
  39. package/dist/docs/api/type/MainTypes.en.md +0 -598
  40. package/dist/docs/api/type/MainTypes.zh.md +0 -867
  41. package/dist/docs/api/type/Theme.en.md +0 -187
  42. package/dist/docs/api/type/Theme.zh.md +0 -187
  43. package/dist/docs/api/type/canvas-types.en.md +0 -25
  44. package/dist/docs/api/type/canvas-types.zh.md +0 -25
  45. package/dist/docs/api/type/index.en.md +0 -96
  46. package/dist/docs/api/type/index.zh.md +0 -99
  47. package/dist/docs/api/type/node-types.en.md +0 -21
  48. package/dist/docs/api/type/node-types.zh.md +0 -21
  49. package/dist/docs/api/type/plugin-types.en.md +0 -24
  50. package/dist/docs/api/type/plugin-types.zh.md +0 -24
  51. package/dist/docs/index.md +0 -11
  52. package/dist/docs/tutorial/about.en.md +0 -38
  53. package/dist/docs/tutorial/about.zh.md +0 -65
  54. package/dist/docs/tutorial/advanced/dnd.en.md +0 -62
  55. package/dist/docs/tutorial/advanced/dnd.zh.md +0 -52
  56. package/dist/docs/tutorial/advanced/edge.en.md +0 -64
  57. package/dist/docs/tutorial/advanced/edge.zh.md +0 -66
  58. package/dist/docs/tutorial/advanced/keyboard.en.md +0 -70
  59. package/dist/docs/tutorial/advanced/keyboard.zh.md +0 -67
  60. package/dist/docs/tutorial/advanced/node.en.md +0 -338
  61. package/dist/docs/tutorial/advanced/node.zh.md +0 -338
  62. package/dist/docs/tutorial/advanced/react.en.md +0 -106
  63. package/dist/docs/tutorial/advanced/react.zh.md +0 -114
  64. package/dist/docs/tutorial/advanced/silent-mode.en.md +0 -75
  65. package/dist/docs/tutorial/advanced/silent-mode.zh.md +0 -71
  66. package/dist/docs/tutorial/advanced/snapline.en.md +0 -54
  67. package/dist/docs/tutorial/advanced/vue.en.md +0 -249
  68. package/dist/docs/tutorial/advanced/vue.zh.md +0 -248
  69. package/dist/docs/tutorial/ai.en.md +0 -64
  70. package/dist/docs/tutorial/ai.zh.md +0 -64
  71. package/dist/docs/tutorial/basic/background.en.md +0 -50
  72. package/dist/docs/tutorial/basic/canvas.en.md +0 -164
  73. package/dist/docs/tutorial/basic/canvas.zh.md +0 -183
  74. package/dist/docs/tutorial/basic/class.en.md +0 -106
  75. package/dist/docs/tutorial/basic/class.zh.md +0 -103
  76. package/dist/docs/tutorial/basic/edge.en.md +0 -151
  77. package/dist/docs/tutorial/basic/edge.zh.md +0 -152
  78. package/dist/docs/tutorial/basic/event.en.md +0 -70
  79. package/dist/docs/tutorial/basic/event.zh.md +0 -66
  80. package/dist/docs/tutorial/basic/grid.en.md +0 -77
  81. package/dist/docs/tutorial/basic/node.en.md +0 -358
  82. package/dist/docs/tutorial/basic/node.zh.md +0 -318
  83. package/dist/docs/tutorial/basic/theme.en.md +0 -154
  84. package/dist/docs/tutorial/basic/theme.zh.md +0 -157
  85. package/dist/docs/tutorial/extension/adapter.en.md +0 -446
  86. package/dist/docs/tutorial/extension/adapter.zh.md +0 -429
  87. package/dist/docs/tutorial/extension/bpmn-element.en.md +0 -1427
  88. package/dist/docs/tutorial/extension/bpmn-element.zh.md +0 -1472
  89. package/dist/docs/tutorial/extension/control.en.md +0 -117
  90. package/dist/docs/tutorial/extension/control.zh.md +0 -118
  91. package/dist/docs/tutorial/extension/curved-edge.en.md +0 -46
  92. package/dist/docs/tutorial/extension/curved-edge.zh.md +0 -46
  93. package/dist/docs/tutorial/extension/custom.en.md +0 -142
  94. package/dist/docs/tutorial/extension/custom.zh.md +0 -138
  95. package/dist/docs/tutorial/extension/dnd-panel.en.md +0 -109
  96. package/dist/docs/tutorial/extension/dnd-panel.zh.md +0 -109
  97. package/dist/docs/tutorial/extension/dynamic-group.en.md +0 -606
  98. package/dist/docs/tutorial/extension/dynamic-group.zh.md +0 -606
  99. package/dist/docs/tutorial/extension/group.en.md +0 -217
  100. package/dist/docs/tutorial/extension/group.zh.md +0 -209
  101. package/dist/docs/tutorial/extension/highlight.en.md +0 -50
  102. package/dist/docs/tutorial/extension/highlight.zh.md +0 -50
  103. package/dist/docs/tutorial/extension/insert-node-in-polyline.en.md +0 -52
  104. package/dist/docs/tutorial/extension/insert-node-in-polyline.zh.md +0 -47
  105. package/dist/docs/tutorial/extension/intro.en.md +0 -72
  106. package/dist/docs/tutorial/extension/intro.zh.md +0 -95
  107. package/dist/docs/tutorial/extension/label.en.md +0 -136
  108. package/dist/docs/tutorial/extension/label.zh.md +0 -135
  109. package/dist/docs/tutorial/extension/layout.en.md +0 -156
  110. package/dist/docs/tutorial/extension/layout.zh.md +0 -156
  111. package/dist/docs/tutorial/extension/menu.en.md +0 -319
  112. package/dist/docs/tutorial/extension/menu.zh.md +0 -377
  113. package/dist/docs/tutorial/extension/minimap.en.md +0 -164
  114. package/dist/docs/tutorial/extension/minimap.zh.md +0 -180
  115. package/dist/docs/tutorial/extension/node-resize.en.md +0 -199
  116. package/dist/docs/tutorial/extension/node-resize.zh.md +0 -221
  117. package/dist/docs/tutorial/extension/pool.en.md +0 -227
  118. package/dist/docs/tutorial/extension/pool.zh.md +0 -227
  119. package/dist/docs/tutorial/extension/proximity-connect.en.md +0 -104
  120. package/dist/docs/tutorial/extension/proximity-connect.zh.md +0 -107
  121. package/dist/docs/tutorial/extension/selection.en.md +0 -166
  122. package/dist/docs/tutorial/extension/selection.zh.md +0 -150
  123. package/dist/docs/tutorial/extension/snapshot.en.md +0 -276
  124. package/dist/docs/tutorial/extension/snapshot.zh.md +0 -276
  125. package/dist/docs/tutorial/get-started.en.md +0 -501
  126. package/dist/docs/tutorial/get-started.zh.md +0 -139
  127. package/dist/docs/tutorial/update.en.md +0 -213
  128. package/dist/docs/tutorial/update.zh.md +0 -212
  129. package/dist/index.css +0 -214
  130. package/dist/index.min.js +0 -2
  131. package/dist/index.min.js.map +0 -1
@@ -1,59 +0,0 @@
1
- ---
2
- nav: API
3
- group:
4
- title: LogicFlow Instance
5
- order: 2
6
- title: Edit configuration
7
- toc: content
8
- order: 11
9
- ---
10
-
11
- This page documents instance APIs for reading and updating edit configuration.
12
-
13
- ### updateEditConfig
14
-
15
- Merge partial updates into the active edit configuration.
16
-
17
- **Signature**
18
-
19
- ```ts
20
- updateEditConfig(config: Partial<IEditConfigType>): void
21
- ```
22
-
23
- **Parameters**
24
-
25
- | Name | Type | Required | Description |
26
- | :------ | :--- | :------- | :---------- |
27
- | `config` | [`Partial<IEditConfigType>`](../type/MainTypes.en.md#ieditconfigtype-edit-control) | Yes | Fields to update. |
28
-
29
- **Example**
30
-
31
- ```ts
32
- lf.updateEditConfig({
33
- stopZoomGraph: true,
34
- });
35
- ```
36
-
37
- ### getEditConfig
38
-
39
- Return the current edit configuration.
40
-
41
- **Signature**
42
-
43
- ```ts
44
- getEditConfig(): IEditConfigType
45
- ```
46
-
47
- **Returns**
48
-
49
- | Type | Description |
50
- | :--- | :---------- |
51
- | [`IEditConfigType`](../type/MainTypes.en.md#ieditconfigtype-edit-control) | Active configuration for this instance. |
52
-
53
- **Example**
54
-
55
- ```ts
56
- lf.getEditConfig();
57
- ```
58
-
59
- Field definitions: [IEditConfigType](../type/MainTypes.en.md#ieditconfigtype-edit-control). `editConfigModel` methods: [graphModel → editConfigModel](../runtime-model/graphModel.en.md#editconfigmodel).
@@ -1,59 +0,0 @@
1
- ---
2
- nav: API
3
- group:
4
- title: LogicFlow 实例
5
- order: 2
6
- title: 编辑控制
7
- toc: content
8
- order: 11
9
- ---
10
-
11
- 本页汇总 LogicFlow 实例中与编辑配置读写相关的方法。
12
-
13
- ### updateEditConfig
14
-
15
- 更新流程编辑基础配置。
16
-
17
- **签名**
18
-
19
- ```ts
20
- updateEditConfig(config: Partial<IEditConfigType>): void
21
- ```
22
-
23
- **参数**
24
-
25
- | 名称 | 类型 | 必传 | 说明 |
26
- | :--- | :--- | :--- | :--- |
27
- | `config` | [`Partial<IEditConfigType>`](../type/MainTypes.zh.md#ieditconfigtype编辑控制配置) | 是 | 需要更新的编辑控制配置。 |
28
-
29
- **示例**
30
-
31
- ```ts
32
- lf.updateEditConfig({
33
- stopZoomGraph: true,
34
- });
35
- ```
36
-
37
- ### getEditConfig
38
-
39
- 获取当前流程编辑基础配置。
40
-
41
- **签名**
42
-
43
- ```ts
44
- getEditConfig(): IEditConfigType
45
- ```
46
-
47
- **返回值**
48
-
49
- | 类型 | 说明 |
50
- | :--- | :--- |
51
- | [`IEditConfigType`](../type/MainTypes.zh.md#ieditconfigtype编辑控制配置) | 当前实例生效的编辑控制配置。 |
52
-
53
- **示例**
54
-
55
- ```ts
56
- lf.getEditConfig();
57
- ```
58
-
59
- 配置字段说明见 [IEditConfigType](../type/MainTypes.zh.md#ieditconfigtype编辑控制配置)。`editConfigModel` 的方法与模型说明见 [graphModel → editConfigModel](../runtime-model/graphModel.zh.md#editconfigmodel)。
@@ -1,375 +0,0 @@
1
- ---
2
- nav: API
3
- group:
4
- title: LogicFlow Instance
5
- order: 2
6
- title: Elements
7
- toc: content
8
- order: 4
9
- ---
10
-
11
- This page documents batch operations, selection helpers, and property utilities that work on both nodes and edges.
12
-
13
- ### addElements
14
-
15
- Adds many nodes and edges at once.
16
-
17
- **Signature**
18
-
19
- ```ts
20
- addElements(data: GraphData): void
21
- ```
22
-
23
- **Parameters**
24
-
25
- | Name | Type | Required | Description |
26
- | :--- | :--- | :--- | :--- |
27
- | `data` | [`GraphData`](../type/MainTypes.en.md#graphdata) | Yes | Nodes and edges to insert. |
28
-
29
- **Example**
30
-
31
- ```ts
32
- lf.addElements({
33
- nodes: [{ id: 'node_1', type: 'rect', x: 100, y: 100 }],
34
- edges: [],
35
- });
36
- ```
37
-
38
- ### selectElementById
39
-
40
- Selects a node or edge.
41
-
42
- **Signature**
43
-
44
- ```ts
45
- selectElementById(id: string, multiple?: boolean, toFront?: boolean): BaseNodeModel | BaseEdgeModel
46
- ```
47
-
48
- **Parameters**
49
-
50
- | Name | Type | Required | Description |
51
- | :--- | :--- | :--- | :--- |
52
- | `id` | `string` | Yes | Element id. |
53
- | `multiple` | `boolean` | No | Keep previous selection when `true`. |
54
- | `toFront` | `boolean` | No | Promote z-order after selection. |
55
-
56
- **Returns**
57
-
58
- | Type | Description |
59
- | :--- | :--- |
60
- | `BaseNodeModel \| BaseEdgeModel` | Selected model. |
61
-
62
- **Example**
63
-
64
- ```ts
65
- lf.selectElementById('node_1', true, true);
66
- ```
67
-
68
- ### deselectElementById
69
-
70
- Clears selection for one element.
71
-
72
- **Signature**
73
-
74
- ```ts
75
- deselectElementById(id: string): void
76
- ```
77
-
78
- **Parameters**
79
-
80
- | Name | Type | Required | Description |
81
- | :--- | :--- | :--- | :--- |
82
- | `id` | `string` | Yes | Element id. |
83
-
84
- **Example**
85
-
86
- ```ts
87
- lf.deselectElementById('node_1');
88
- ```
89
-
90
- ### getSelectElements
91
-
92
- Exports currently selected elements as graph configuration data.
93
-
94
- **Signature**
95
-
96
- ```ts
97
- getSelectElements(isIgnoreCheck?: boolean): GraphConfigData
98
- ```
99
-
100
- **Parameters**
101
-
102
- | Name | Type | Required | Description |
103
- | :--- | :--- | :--- | :--- |
104
- | `isIgnoreCheck` | `boolean` | No | When `false`, omits edges whose endpoints are not both selected (useful for copy). |
105
-
106
- **Returns**
107
-
108
- | Type | Description |
109
- | :--- | :--- |
110
- | [`GraphConfigData`](../type/MainTypes.en.md#graphconfigdata) | Selection payload. |
111
-
112
- **Example**
113
-
114
- ```ts
115
- lf.getSelectElements(false);
116
- ```
117
-
118
- ### clearSelectElements
119
-
120
- Clears the entire selection.
121
-
122
- **Signature**
123
-
124
- ```ts
125
- clearSelectElements(): void
126
- ```
127
-
128
- **Example**
129
-
130
- ```ts
131
- lf.clearSelectElements();
132
- ```
133
-
134
- ### getModelById
135
-
136
- Looks up a node or edge model.
137
-
138
- **Signature**
139
-
140
- ```ts
141
- getModelById(id: string): BaseNodeModel | BaseEdgeModel | undefined
142
- ```
143
-
144
- **Parameters**
145
-
146
- | Name | Type | Required | Description |
147
- | :--- | :--- | :--- | :--- |
148
- | `id` | `string` | Yes | Element id. |
149
-
150
- **Returns**
151
-
152
- | Type | Description |
153
- | :--- | :--- |
154
- | `BaseNodeModel \| BaseEdgeModel \| undefined` | Model instance. |
155
-
156
- **Example**
157
-
158
- ```ts
159
- lf.getModelById('node_id');
160
- lf.getModelById('edge_id');
161
- ```
162
-
163
- ### getDataById
164
-
165
- Returns plain config data for a node or edge.
166
-
167
- **Signature**
168
-
169
- ```ts
170
- getDataById(id: string): NodeConfig | EdgeConfig | undefined
171
- ```
172
-
173
- **Parameters**
174
-
175
- | Name | Type | Required | Description |
176
- | :--- | :--- | :--- | :--- |
177
- | `id` | `string` | Yes | Element id. |
178
-
179
- **Returns**
180
-
181
- | Type | Description |
182
- | :--- | :--- |
183
- | [`NodeConfig`](../type/MainTypes.en.md#nodeconfig) \| [`EdgeConfig`](../type/MainTypes.en.md#edgeconfig) \| `undefined` | Data snapshot. |
184
-
185
- ### deleteElement
186
-
187
- Deletes a node or edge.
188
-
189
- **Signature**
190
-
191
- ```ts
192
- deleteElement(id: string): boolean
193
- ```
194
-
195
- **Parameters**
196
-
197
- | Name | Type | Required | Description |
198
- | :--- | :--- | :--- | :--- |
199
- | `id` | `string` | Yes | Element id. |
200
-
201
- **Returns**
202
-
203
- | Type | Description |
204
- | :--- | :--- |
205
- | `boolean` | Whether deletion succeeded. |
206
-
207
- **Example**
208
-
209
- ```ts
210
- lf.deleteElement('node_id');
211
- ```
212
-
213
- ### setElementZIndex
214
-
215
- Sets stacking order for an element.
216
-
217
- **Signature**
218
-
219
- ```ts
220
- setElementZIndex(id: string, zIndex: string | number): void
221
- ```
222
-
223
- **Parameters**
224
-
225
- | Name | Type | Required | Description |
226
- | :--- | :--- | :--- | :--- |
227
- | `id` | `string` | Yes | Element id. |
228
- | `zIndex` | `string \| number` | Yes | Numeric index or `'top'` / `'bottom'`. |
229
-
230
- **Example**
231
-
232
- ```ts
233
- lf.setElementZIndex('element_id', 'top');
234
- ```
235
-
236
- ### getAreaElement
237
-
238
- Returns models intersecting a canvas rectangle.
239
-
240
- **Signature**
241
-
242
- ```ts
243
- getAreaElement(
244
- leftTopPoint: PointTuple,
245
- rightBottomPoint: PointTuple,
246
- wholeEdge?: boolean,
247
- wholeNode?: boolean,
248
- ignoreHideElement?: boolean
249
- ): (BaseNodeModel | BaseEdgeModel)[]
250
- ```
251
-
252
- **Parameters**
253
-
254
- | Name | Type | Required | Description |
255
- | :--- | :--- | :--- | :--- |
256
- | `leftTopPoint` | `PointTuple` | Yes | Upper-left corner. |
257
- | `rightBottomPoint` | `PointTuple` | Yes | Lower-right corner. |
258
- | `wholeEdge` | `boolean` | No | Require the entire edge inside the box. |
259
- | `wholeNode` | `boolean` | No | Require the entire node inside the box. |
260
- | `ignoreHideElement` | `boolean` | No | Skip hidden elements. |
261
-
262
- **Returns**
263
-
264
- | Type | Description |
265
- | :--- | :--- |
266
- | `(BaseNodeModel \| BaseEdgeModel)[]` | Hits. |
267
-
268
- **Example**
269
-
270
- ```ts
271
- lf.getAreaElement([100, 100], [500, 500]);
272
- ```
273
-
274
- ### setProperties
275
-
276
- Sets custom `properties` on a node or edge.
277
-
278
- **Signature**
279
-
280
- ```ts
281
- setProperties(id: string, properties: Record<string, unknown>): void
282
- ```
283
-
284
- **Parameters**
285
-
286
- | Name | Type | Required | Description |
287
- | :--- | :--- | :--- | :--- |
288
- | `id` | `string` | Yes | Element id. |
289
- | `properties` | `Record<string, unknown>` | Yes | Property bag. |
290
-
291
- **Example**
292
-
293
- ```ts
294
- lf.setProperties('aF2Md2P23moN2gasd', {
295
- isRollbackNode: true,
296
- });
297
- ```
298
-
299
- ### getProperties
300
-
301
- Reads the custom property object.
302
-
303
- **Signature**
304
-
305
- ```ts
306
- getProperties(id: string): Record<string, any>
307
- ```
308
-
309
- **Parameters**
310
-
311
- | Name | Type | Required | Description |
312
- | :--- | :--- | :--- | :--- |
313
- | `id` | `string` | Yes | Element id. |
314
-
315
- **Returns**
316
-
317
- | Type | Description |
318
- | :--- | :--- |
319
- | `Record<string, any>` | Properties map. |
320
-
321
- **Example**
322
-
323
- ```ts
324
- lf.getProperties('id');
325
- ```
326
-
327
- ### deleteProperty
328
-
329
- Removes a single key from `properties`.
330
-
331
- **Signature**
332
-
333
- ```ts
334
- deleteProperty(id: string, key: string): void
335
- ```
336
-
337
- **Parameters**
338
-
339
- | Name | Type | Required | Description |
340
- | :--- | :--- | :--- | :--- |
341
- | `id` | `string` | Yes | Element id. |
342
- | `key` | `string` | Yes | Property key. |
343
-
344
- **Example**
345
-
346
- ```ts
347
- lf.deleteProperty('aF2Md2P23moN2gasd', 'isRollbackNode');
348
- ```
349
-
350
- ### updateAttributes
351
-
352
- Low-level patch against model fields; delegates to [`graphModel.updateAttributes`](../runtime-model/graphModel.en.md#updateattributes).
353
-
354
- :::warning{title=Note}
355
- Prefer higher-level helpers (`setProperties`, `updateText`, `changeNodeId`, …). Changing ids or geometry incorrectly can break edges.
356
- :::
357
-
358
- **Signature**
359
-
360
- ```ts
361
- updateAttributes(id: string, attributes: object): void
362
- ```
363
-
364
- **Parameters**
365
-
366
- | Name | Type | Required | Description |
367
- | :--- | :--- | :--- | :--- |
368
- | `id` | `string` | Yes | Element id. |
369
- | `attributes` | `object` | Yes | Fields to merge into the model. |
370
-
371
- **Example**
372
-
373
- ```ts
374
- lf.updateAttributes('node_id_1', { radius: 4 });
375
- ```