@operato/scene-bpmn 8.0.0-beta.1 → 8.0.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 (39) hide show
  1. package/package.json +5 -5
  2. package/CHANGELOG.md +0 -400
  3. package/src/base/bpmn-activity.ts +0 -32
  4. package/src/base/bpmn-container-base.ts +0 -201
  5. package/src/base/bpmn-control-base.ts +0 -201
  6. package/src/bpmn-comment.ts +0 -64
  7. package/src/bpmn-data-object.ts +0 -181
  8. package/src/bpmn-data-store.ts +0 -63
  9. package/src/bpmn-event.ts +0 -468
  10. package/src/bpmn-expanded-subprocess.ts +0 -207
  11. package/src/bpmn-flow.ts +0 -37
  12. package/src/bpmn-gateway.ts +0 -181
  13. package/src/bpmn-group.ts +0 -39
  14. package/src/bpmn-lane.ts +0 -125
  15. package/src/bpmn-message.ts +0 -57
  16. package/src/bpmn-pool.ts +0 -25
  17. package/src/bpmn-subprocess.ts +0 -323
  18. package/src/bpmn-task.ts +0 -479
  19. package/src/characteristics/loop.ts +0 -0
  20. package/src/editors/index.ts +0 -0
  21. package/src/groups/index.ts +0 -3
  22. package/src/groups/process.ts +0 -48
  23. package/src/index.ts +0 -13
  24. package/src/templates/bpmn-comment.ts +0 -24
  25. package/src/templates/bpmn-data-object.ts +0 -21
  26. package/src/templates/bpmn-data-store.ts +0 -19
  27. package/src/templates/bpmn-event.ts +0 -19
  28. package/src/templates/bpmn-expanded-subprocess.ts +0 -24
  29. package/src/templates/bpmn-flow.ts +0 -23
  30. package/src/templates/bpmn-gateway.ts +0 -19
  31. package/src/templates/bpmn-group.ts +0 -20
  32. package/src/templates/bpmn-lane.ts +0 -20
  33. package/src/templates/bpmn-message.ts +0 -21
  34. package/src/templates/bpmn-pool.ts +0 -18
  35. package/src/templates/bpmn-subprocess.ts +0 -18
  36. package/src/templates/bpmn-task.ts +0 -18
  37. package/src/templates/index.ts +0 -31
  38. package/tsconfig.json +0 -24
  39. package/tsconfig.tsbuildinfo +0 -1
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@operato/scene-bpmn",
3
3
  "description": "bpmn components for things-scene",
4
4
  "author": "heartyoh",
5
- "version": "8.0.0-beta.1",
5
+ "version": "8.0.0",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
8
8
  "license": "MIT",
@@ -27,12 +27,12 @@
27
27
  "migration": "things-factory-migration"
28
28
  },
29
29
  "dependencies": {
30
- "@hatiolab/things-scene": "^8.0.0-beta"
30
+ "@hatiolab/things-scene": "^3.4.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@hatiolab/prettier-config": "^1.0.0",
34
- "@things-factory/builder": "^8.0.0-beta",
35
- "@things-factory/operato-board": "^8.0.0-beta",
34
+ "@things-factory/builder": "^8.0.0",
35
+ "@things-factory/operato-board": "^8.0.0",
36
36
  "@typescript-eslint/eslint-plugin": "^4.33.0",
37
37
  "@typescript-eslint/parser": "^4.33.0",
38
38
  "@web/dev-server": "^0.1.28",
@@ -57,5 +57,5 @@
57
57
  "prettier --write"
58
58
  ]
59
59
  },
60
- "gitHead": "acb632aa522d8348f2602bcb614e2819d19a09ed"
60
+ "gitHead": "606d806afe9351c028c8b8a6726ad7e5da694b18"
61
61
  }
package/CHANGELOG.md DELETED
@@ -1,400 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [8.0.0-beta.1](https://github.com/things-scene/operato-scene/compare/v8.0.0-beta.0...v8.0.0-beta.1) (2025-01-07)
7
-
8
-
9
- ### :bug: Bug Fix
10
-
11
- * [@things-factory](https://github.com/things-factory)@v8.0.0-beta ([2cd95a8](https://github.com/things-scene/operato-scene/commit/2cd95a8b07b588f3d96e5da2a0309910e683e33f))
12
-
13
-
14
-
15
- ## [8.0.0-beta.0](https://github.com/things-scene/operato-scene/compare/v8.0.0-alpha.12...v8.0.0-beta.0) (2025-01-07)
16
-
17
-
18
- ### :bug: Bug Fix
19
-
20
- * @hatiolab/things-scene@^8.0.0-beta ([c32f4c0](https://github.com/things-scene/operato-scene/commit/c32f4c00decf244ca82ae17a41e33f269e1882e7))
21
-
22
-
23
-
24
- ## [8.0.0-alpha.1](https://github.com/things-scene/operato-scene/compare/v8.0.0-alpha.0...v8.0.0-alpha.1) (2024-09-09)
25
-
26
-
27
- ### :bug: Bug Fix
28
-
29
- * update [@things-factory](https://github.com/things-factory)@^8.0.0-alpha ([1dc3163](https://github.com/things-scene/operato-scene/commit/1dc31638ed9d3fd0ecb2ac55be0ce541e5599ab8))
30
-
31
-
32
-
33
- ## [8.0.0-alpha.0](https://github.com/things-scene/operato-scene/compare/v7.3.7...v8.0.0-alpha.0) (2024-09-01)
34
-
35
- **Note:** Version bump only for package @operato/scene-bpmn
36
-
37
-
38
-
39
-
40
-
41
- ## [7.0.1](https://github.com/things-scene/operato-scene/compare/v7.0.0...v7.0.1) (2024-06-30)
42
-
43
-
44
- ### :bug: Bug Fix
45
-
46
- * things-factory@7.0.0 ([f4cfe44](https://github.com/things-scene/operato-scene/commit/f4cfe44cb565e7b8fdc0df210a722b6526871848))
47
-
48
-
49
-
50
- ## [7.0.0](https://github.com/things-scene/operato-scene/compare/v7.0.0-rc.4...v7.0.0) (2024-06-30)
51
-
52
- **Note:** Version bump only for package @operato/scene-bpmn
53
-
54
-
55
-
56
-
57
-
58
- ## [7.0.0-rc.1](https://github.com/things-scene/operato-scene/compare/v7.0.0-rc.0...v7.0.0-rc.1) (2024-06-21)
59
-
60
-
61
- ### :bug: Bug Fix
62
-
63
- * apply v7-rc dependencies ([eee5612](https://github.com/things-scene/operato-scene/commit/eee5612e1d569387c284a7c6c49d64ef44b6d701))
64
-
65
-
66
-
67
- ## [7.0.0-rc.0](https://github.com/things-scene/operato-scene/compare/v2.0.0-beta.8...v7.0.0-rc.0) (2024-06-21)
68
-
69
- **Note:** Version bump only for package @operato/scene-bpmn
70
-
71
-
72
-
73
-
74
-
75
- ## [2.0.0-beta.0](https://github.com/things-scene/operato-scene/compare/v2.0.0-alpha.12...v2.0.0-beta.0) (2024-06-01)
76
-
77
-
78
- ### :rocket: New Features
79
-
80
- * 2.0.0-beta.0 ([a2e2869](https://github.com/things-scene/operato-scene/commit/a2e28694eedf5bab0c54bcab5432d54ec59edd7f))
81
-
82
-
83
- ### :bug: Bug Fix
84
-
85
- * allowJs in tsconfig option ([fa77174](https://github.com/things-scene/operato-scene/commit/fa771742188f21f177f0a85281570f59f0c478cf))
86
-
87
-
88
-
89
- ## [2.0.0-alpha.12](https://github.com/things-scene/operato-scene/compare/v2.0.0-alpha.11...v2.0.0-alpha.12) (2024-05-11)
90
-
91
-
92
- ### :bug: Bug Fix
93
-
94
- * ignore 'cache' folder for git and npm ([d70f811](https://github.com/things-scene/operato-scene/commit/d70f8118ff3e9248f80aa9435d6e6cbb8aacfcaf))
95
-
96
-
97
-
98
- ## [2.0.0-alpha.9](https://github.com/things-scene/operato-scene/compare/v2.0.0-alpha.8...v2.0.0-alpha.9) (2024-04-11)
99
-
100
-
101
- ### :bug: Bug Fix
102
-
103
- * things-factory@7.0.1 ([a9f4c18](https://github.com/things-scene/operato-scene/commit/a9f4c1873b80c540e4c2e16649e127ccffcf9a4c))
104
-
105
-
106
-
107
- ## [2.0.0-alpha.6](https://github.com/things-scene/operato-scene/compare/v2.0.0-alpha.5...v2.0.0-alpha.6) (2024-03-24)
108
-
109
-
110
- ### :bug: Bug Fix
111
-
112
- * translation ([266d423](https://github.com/things-scene/operato-scene/commit/266d423d9d6992464f45a437acc90ccf8ed33bf6))
113
-
114
-
115
-
116
- ## [2.0.0-alpha.4](https://github.com/things-scene/operato-scene/compare/v2.0.0-alpha.3...v2.0.0-alpha.4) (2024-03-21)
117
-
118
-
119
- ### :bug: Bug Fix
120
-
121
- * 컴포넌트 명 다국어 ([3616a52](https://github.com/things-scene/operato-scene/commit/3616a52e2f0268c83c976c6b4deeffc016f91e46))
122
-
123
-
124
-
125
- ## [2.0.0-alpha.0](https://github.com/things-scene/operato-scene/compare/v1.3.9...v2.0.0-alpha.0) (2024-01-14)
126
-
127
-
128
- ### :bug: Bug Fix
129
-
130
- * 2.0.0-alpha.0 ([93274e3](https://github.com/things-scene/operato-scene/commit/93274e36c5d184f339f83899654dd48b4786ac2b))
131
-
132
-
133
-
134
- ## [1.3.7](https://github.com/things-scene/operato-scene/compare/v1.3.6...v1.3.7) (2024-01-01)
135
-
136
-
137
- ### :bug: Bug Fix
138
-
139
- * mpi module moved from things-factory ([47b743f](https://github.com/things-scene/operato-scene/commit/47b743fd19001f195db85e50b8f6e457a1573aa5))
140
-
141
-
142
-
143
- ## [1.2.90](https://github.com/things-scene/operato-scene/compare/v1.2.89...v1.2.90) (2023-11-22)
144
-
145
- **Note:** Version bump only for package @operato/scene-bpmn
146
-
147
-
148
-
149
-
150
-
151
- ## [1.2.87](https://github.com/things-scene/operato-scene/compare/v1.2.86...v1.2.87) (2023-11-10)
152
-
153
- **Note:** Version bump only for package @operato/scene-bpmn
154
-
155
-
156
-
157
-
158
-
159
- ## [1.2.76](https://github.com/things-scene/operato-scene/compare/v1.2.75...v1.2.76) (2023-10-28)
160
-
161
-
162
- ### :bug: Bug Fix
163
-
164
- * scene-tab ([ad62f96](https://github.com/things-scene/operato-scene/commit/ad62f967b149eb5adf8f2e0714d79e8a9dc7186c))
165
-
166
-
167
-
168
- ## [1.2.66](https://github.com/things-scene/operato-scene/compare/v1.2.65...v1.2.66) (2023-09-14)
169
-
170
- **Note:** Version bump only for package @operato/scene-bpmn
171
-
172
-
173
-
174
-
175
-
176
- ## [1.2.65](https://github.com/things-scene/operato-scene/compare/v1.2.64...v1.2.65) (2023-09-14)
177
-
178
- **Note:** Version bump only for package @operato/scene-bpmn
179
-
180
-
181
-
182
-
183
-
184
- ## [1.2.62](https://github.com/things-scene/operato-scene/compare/v1.2.61...v1.2.62) (2023-09-11)
185
-
186
- **Note:** Version bump only for package @operato/scene-bpmn
187
-
188
-
189
-
190
-
191
-
192
- ## [1.2.49](https://github.com/things-scene/operato-scene/compare/v1.2.48...v1.2.49) (2023-06-26)
193
-
194
-
195
- ### :bug: Bug Fix
196
-
197
- * missing .npmignore ([61ba4f2](https://github.com/things-scene/operato-scene/commit/61ba4f2ae22a865d700a971d62eb01f950c34d0e))
198
-
199
-
200
-
201
- ## [1.2.46](https://github.com/things-scene/operato-scene/compare/v1.2.45...v1.2.46) (2023-06-10)
202
-
203
-
204
- ### :bug: Bug Fix
205
-
206
- * typescript build options ([3eb0d7f](https://github.com/things-scene/operato-scene/commit/3eb0d7fd80e2c3cea698501aa1d9d54903423a7b))
207
-
208
-
209
-
210
- ## [1.2.36](https://github.com/things-scene/operato-scene/compare/v1.2.35...v1.2.36) (2023-05-13)
211
-
212
-
213
- ### :bug: Bug Fix
214
-
215
- * license ([d37d485](https://github.com/things-scene/operato-scene/commit/d37d48597407dea1ad022e674f2899720e56d695))
216
-
217
-
218
-
219
- ## [1.2.29](https://github.com/things-scene/operato-scene/compare/v1.2.28...v1.2.29) (2023-04-30)
220
-
221
-
222
- ### :bug: Bug Fix
223
-
224
- * update module's version ([047d08b](https://github.com/things-scene/operato-scene/commit/047d08b5d912d12c04b2f6b63156d1e812588365))
225
-
226
-
227
-
228
- ### [1.2.27](https://github.com/things-scene/operato-scene/compare/v1.2.26...v1.2.27) (2023-04-22)
229
-
230
- **Note:** Version bump only for package @operato/scene-bpmn
231
-
232
-
233
-
234
-
235
-
236
- ### [1.2.4](https://github.com/things-scene/operato-scene/compare/v1.2.3...v1.2.4) (2023-02-13)
237
-
238
- **Note:** Version bump only for package @operato/scene-bpmn
239
-
240
-
241
-
242
-
243
-
244
- ### [1.2.2](https://github.com/things-scene/operato-scene/compare/v1.2.1...v1.2.2) (2023-02-09)
245
-
246
-
247
- ### :bug: Bug Fix
248
-
249
- * migrate scene-urdf from things-factory ([3f75f87](https://github.com/things-scene/operato-scene/commit/3f75f8743e993a9a3ed595eed8f94b15da042a31))
250
-
251
-
252
-
253
- ## [1.2.0](https://github.com/things-scene/operato-scene/compare/v1.1.29...v1.2.0) (2023-02-07)
254
-
255
-
256
- ### :bug: Bug Fix
257
-
258
- * [@things-factory](https://github.com/things-factory)@6.0.0 ([5927ebb](https://github.com/things-scene/operato-scene/commit/5927ebb5113be2b914cc47005eb7115d69481695))
259
- * updating dependencies ([f4dd8fc](https://github.com/things-scene/operato-scene/commit/f4dd8fcdaa03b67de78189c6d574b30a995456f0))
260
-
261
-
262
-
263
- ### [1.1.23](https://github.com/things-scene/operato-scene/compare/v1.1.22...v1.1.23) (2022-12-18)
264
-
265
-
266
- ### :bug: Bug Fix
267
-
268
- * latest @hatiolab/things-scene ([8d6afb5](https://github.com/things-scene/operato-scene/commit/8d6afb5ecbd453260615fca229f1d74b0ea6e4ee))
269
-
270
-
271
-
272
- ### [1.1.20](https://github.com/things-scene/operato-scene/compare/v1.1.19...v1.1.20) (2022-12-09)
273
-
274
-
275
- ### :bug: Bug Fix
276
-
277
- * filling for bpmn components ([2f3bb57](https://github.com/things-scene/operato-scene/commit/2f3bb57ef5ab7915f8c863d82eb55e46af4d512e))
278
- * filling for bpmn components ([7447940](https://github.com/things-scene/operato-scene/commit/74479406b4cf70702ef367eea6cdf3dff24dec2b))
279
-
280
-
281
-
282
- ### [1.1.15](https://github.com/things-scene/operato-scene/compare/v1.1.14...v1.1.15) (2022-11-13)
283
-
284
-
285
- ### :bug: Bug Fix
286
-
287
- * use @things-factory/operato-board@6.0.0-zeta.x ([a9deef9](https://github.com/things-scene/operato-scene/commit/a9deef935fde00c6c0d09ca424ca949ac24cbd6a))
288
-
289
-
290
-
291
- ### [1.1.12](https://github.com/things-scene/operato-scene/compare/v1.1.11...v1.1.12) (2022-11-09)
292
-
293
-
294
- ### :bug: Bug Fix
295
-
296
- * bpmn ([b80f20a](https://github.com/things-scene/operato-scene/commit/b80f20adc7656c544b9a559e1eb85ceca5b4f00f))
297
- * events properties for activities ([93cdf0b](https://github.com/things-scene/operato-scene/commit/93cdf0b570fe829a50d89672cf8c974ad6ff74ac))
298
-
299
-
300
-
301
- ### [1.1.10](https://github.com/things-scene/operato-scene/compare/v1.1.9...v1.1.10) (2022-11-06)
302
-
303
-
304
- ### :bug: Bug Fix
305
-
306
- * bpmn label positions ([805c888](https://github.com/things-scene/operato-scene/commit/805c888a9f51b1094e2af7edd27c8a22e933b1e6))
307
-
308
-
309
-
310
- ### [1.1.9](https://github.com/things-scene/operato-scene/compare/v1.1.8...v1.1.9) (2022-11-06)
311
-
312
-
313
- ### :bug: Bug Fix
314
-
315
- * bpmn-flow template ([464a8bd](https://github.com/things-scene/operato-scene/commit/464a8bd39762b1f746ad461ff167efe0feacb073))
316
- * transaction, interrupting properties for bpmn ([e9a7308](https://github.com/things-scene/operato-scene/commit/e9a7308d3cd983b604d278984dc4764d6c3fd974))
317
-
318
-
319
-
320
- ### [1.1.8](https://github.com/things-scene/operato-scene/compare/v1.1.7...v1.1.8) (2022-11-05)
321
-
322
-
323
- ### :bug: Bug Fix
324
-
325
- * guaranty padding values ([6d21f7c](https://github.com/things-scene/operato-scene/commit/6d21f7ced527b3172b6e1ff67160f505192359bd))
326
- * padding default value ([2d55f81](https://github.com/things-scene/operato-scene/commit/2d55f81efffbbb1687e11380abfe293328e1e88d))
327
-
328
-
329
-
330
- ### [1.1.7](https://github.com/things-scene/operato-scene/compare/v1.1.6...v1.1.7) (2022-11-05)
331
-
332
-
333
- ### :bug: Bug Fix
334
-
335
- * bpmn-expanded-subprocess default font size ([89e4675](https://github.com/things-scene/operato-scene/commit/89e4675a177c5e6411b847ee6aa55787c4dc0a8a))
336
-
337
-
338
-
339
- ### [1.1.6](https://github.com/things-scene/operato-scene/compare/v1.1.5...v1.1.6) (2022-11-05)
340
-
341
-
342
- ### :bug: Bug Fix
343
-
344
- * bpmn-lane textAlign ([16d84ce](https://github.com/things-scene/operato-scene/commit/16d84cefbdc561cacfda8938a843083db1fe0b82))
345
-
346
-
347
-
348
- ### [1.1.5](https://github.com/things-scene/operato-scene/compare/v1.1.4...v1.1.5) (2022-11-05)
349
-
350
-
351
- ### :bug: Bug Fix
352
-
353
- * templates ([78a23e4](https://github.com/things-scene/operato-scene/commit/78a23e42c3a13b1fd50af223d3a7c5f6739ed8a3))
354
- * update things-scene ([84f2a9f](https://github.com/things-scene/operato-scene/commit/84f2a9fa6fe5fcb22444caf489de8a5aa84000a2))
355
-
356
-
357
-
358
- ### [1.1.4](https://github.com/things-scene/operato-scene/compare/v1.1.3...v1.1.4) (2022-11-04)
359
-
360
-
361
- ### :bug: Bug Fix
362
-
363
- * add serve:dev ([c9f2ac7](https://github.com/things-scene/operato-scene/commit/c9f2ac74ff71fcbe39e2fa374778ef754239bd25))
364
- * bpmn lane ([5bd4cb8](https://github.com/things-scene/operato-scene/commit/5bd4cb81a35e98a51d5eec4fb0e4e3ad97fc39aa))
365
-
366
-
367
-
368
- ### [1.1.3](https://github.com/things-scene/operato-scene/compare/v1.1.2...v1.1.3) (2022-11-04)
369
-
370
-
371
- ### :bug: Bug Fix
372
-
373
- * bpmn-lane ([0b96d84](https://github.com/things-scene/operato-scene/commit/0b96d84b6964f570db79ac532c754341c478eb29))
374
-
375
-
376
-
377
- ### [1.1.2](https://github.com/things-scene/operato-scene/compare/v1.1.1...v1.1.2) (2022-11-04)
378
-
379
-
380
- ### :bug: Bug Fix
381
-
382
- * process-lane ([853b998](https://github.com/things-scene/operato-scene/commit/853b998333bda1c7946059a851777aac9f46b8b2))
383
-
384
-
385
-
386
- ### [1.1.1](https://github.com/things-scene/operato-scene/compare/v1.1.0...v1.1.1) (2022-11-03)
387
-
388
-
389
- ### :bug: Bug Fix
390
-
391
- * typo ([c4758b9](https://github.com/things-scene/operato-scene/commit/c4758b9d66e4edb15ee4b805117fd9b18ef92737))
392
-
393
-
394
-
395
- ## [1.1.0](https://github.com/things-scene/operato-scene/compare/v1.0.7...v1.1.0) (2022-11-03)
396
-
397
-
398
- ### :rocket: New Features
399
-
400
- * add bpmn and eipatterns ([6f5e74c](https://github.com/things-scene/operato-scene/commit/6f5e74c9e45ff61324c080f9b2828f1a69fddc5a))
@@ -1,32 +0,0 @@
1
- import BPMNControlBase from './bpmn-control-base'
2
-
3
- export default abstract class BPMNActivity extends BPMNControlBase {
4
- abstract getImageElement(): HTMLImageElement | null | undefined
5
-
6
- render(ctx: CanvasRenderingContext2D) {
7
- var { left, top, width, height } = this.bounds
8
-
9
- ctx.translate(left, top)
10
- ctx.beginPath()
11
-
12
- var radius = 9
13
-
14
- ctx.moveTo(radius, 0)
15
- ctx.arcTo(width, 0, width, height, radius)
16
- ctx.arcTo(width, height, 0, height, radius)
17
- ctx.arcTo(0, height, 0, 0, radius)
18
- ctx.arcTo(0, 0, width, 0, radius)
19
-
20
- ctx.translate(-left, -top)
21
-
22
- this.drawFill(ctx)
23
- this.drawStroke(ctx)
24
-
25
- ctx.beginPath()
26
-
27
- const image = this.getImageElement()
28
- if (image) {
29
- this.drawImage(ctx, image, left, top, 24, 24)
30
- }
31
- }
32
- }
@@ -1,201 +0,0 @@
1
- import { Anchor, Container, Connectable, LinkEnd, Properties } from '@hatiolab/things-scene'
2
-
3
- export enum DIRECTION {
4
- NORTH = 'N',
5
- EAST = 'E',
6
- SOUTH = 'S',
7
- WEST = 'W'
8
- }
9
-
10
- export enum INOUT {
11
- IN = 'in',
12
- OUT = 'out',
13
- INOUT = 'inout'
14
- }
15
-
16
- export enum FLOW {
17
- MESSAGE = 'message',
18
- SEQUENCE = 'sequence',
19
- ASSOCIATION = 'association'
20
- }
21
-
22
- export type NODE = {
23
- name: string
24
- description: string
25
- inout: INOUT
26
- type: FLOW
27
- direction: DIRECTION
28
- multiplicity?: number
29
- }
30
-
31
- const STYLE_MAP = {
32
- message: {
33
- strokeStyle: 'black',
34
- fillStyle: 'black'
35
- },
36
- sequence: {
37
- strokeStyle: 'red',
38
- fillStyle: 'red',
39
- lineDash: 'long-dash-dot'
40
- },
41
- association: {
42
- strokeStyle: 'yellow',
43
- fillStyle: 'yellow',
44
- lineDash: 'dash',
45
- begin: 'none',
46
- beginSize: 'size1',
47
- end: 'none',
48
- endSize: 'size1'
49
- }
50
- }
51
-
52
- type FILTER_FUNCTION = (this: Anchor, counterEnd?: LinkEnd) => boolean
53
-
54
- const ANCHOR_LENGTH = 8
55
-
56
- const TEMPLATE = {
57
- type: 'bpmn-flow',
58
- lineWidth: 2,
59
- strokeStyle: 'black',
60
- begin: 'none',
61
- beginSize: 'size1',
62
- end: 'arrow',
63
- endSize: 'size9',
64
- round: 10
65
- }
66
-
67
- function linkFilter(this: Anchor, counterEnd?: LinkEnd) {
68
- if (!counterEnd) {
69
- return this.inout !== 'in'
70
- }
71
-
72
- const { component, anchor } = counterEnd || {}
73
- /* FIXME remove !anchor.type condition */
74
- return !anchor?.type || anchor.type === this.type
75
- }
76
-
77
- export default abstract class BPMNContainerBase extends Connectable(Container) {
78
- get anchors(): Array<Anchor> {
79
- var allNodes = this.nodes
80
- var { left, top, width, height } = this.bounds
81
-
82
- var right = left + width
83
- var bottom = top + height
84
-
85
- const dirs: Array<Array<Anchor>> = [DIRECTION.NORTH, DIRECTION.EAST, DIRECTION.SOUTH, DIRECTION.WEST].map(
86
- direction => {
87
- const nodes = allNodes.filter(node => node.direction === direction)
88
- if (nodes.length === 0) {
89
- return []
90
- }
91
-
92
- var dx = 0
93
- var dy = 0
94
- var sx = 0
95
- var sy = 0
96
-
97
- switch (direction) {
98
- case DIRECTION.NORTH:
99
- sx = left
100
- sy = top
101
- dx = width / (nodes.length + 1)
102
- dy = 0
103
-
104
- break
105
-
106
- case DIRECTION.EAST:
107
- sx = right
108
- sy = top
109
- dx = 0
110
- dy = height / (nodes.length + 1)
111
-
112
- break
113
-
114
- case DIRECTION.SOUTH:
115
- sx = left
116
- sy = bottom
117
- dx = width / (nodes.length + 1)
118
- dy = 0
119
-
120
- break
121
-
122
- case DIRECTION.WEST:
123
- sx = left
124
- sy = top
125
- dx = 0
126
- dy = height / (nodes.length + 1)
127
-
128
- break
129
-
130
- default:
131
- }
132
-
133
- return nodes.map((node, idx) => {
134
- const x = sx + dx * (idx + 1)
135
- const y = sy + dy * (idx + 1)
136
-
137
- return {
138
- type: node.type as string,
139
- name: node.name,
140
- inout: node.inout,
141
- position: {
142
- x,
143
- y
144
- },
145
- bounds: {
146
- left: x - ANCHOR_LENGTH / 2,
147
- top: y - ANCHOR_LENGTH / 2,
148
- width: ANCHOR_LENGTH,
149
- height: ANCHOR_LENGTH
150
- },
151
- filter: linkFilter,
152
- template: {
153
- ...TEMPLATE,
154
- ...(STYLE_MAP[node.type || 'message'] || STYLE_MAP['message'])
155
- },
156
- multiplicity: node.multiplicity
157
- }
158
- })
159
- }
160
- )
161
-
162
- return dirs.flat()
163
- }
164
-
165
- get nodes(): NODE[] {
166
- return [
167
- {
168
- name: 'Left',
169
- description: 'Left side message inout',
170
- inout: INOUT.INOUT,
171
- type: FLOW.MESSAGE,
172
- direction: DIRECTION.WEST,
173
- multiplicity: 1
174
- },
175
- {
176
- name: 'Top',
177
- description: 'Top side message inout',
178
- inout: INOUT.INOUT,
179
- type: FLOW.MESSAGE,
180
- direction: DIRECTION.NORTH,
181
- multiplicity: 1
182
- },
183
- {
184
- name: 'Right',
185
- description: 'Right side message inout',
186
- inout: INOUT.INOUT,
187
- type: FLOW.MESSAGE,
188
- direction: DIRECTION.EAST,
189
- multiplicity: 1
190
- },
191
- {
192
- name: 'Down',
193
- description: 'Down side message inout',
194
- inout: INOUT.INOUT,
195
- type: FLOW.MESSAGE,
196
- direction: DIRECTION.SOUTH,
197
- multiplicity: 1
198
- }
199
- ]
200
- }
201
- }