@operato/scene-bpmn 1.1.15 → 1.1.20

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 (69) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/base/bpmn-activity.js +2 -2
  3. package/dist/base/bpmn-activity.js.map +1 -1
  4. package/dist/base/bpmn-container-base.d.ts +1 -1
  5. package/dist/base/bpmn-control-base.d.ts +1 -1
  6. package/dist/bpmn-comment.js +1 -2
  7. package/dist/bpmn-comment.js.map +1 -1
  8. package/dist/bpmn-data-object.js +3 -3
  9. package/dist/bpmn-data-object.js.map +1 -1
  10. package/dist/bpmn-data-store.js +1 -1
  11. package/dist/bpmn-data-store.js.map +1 -1
  12. package/dist/bpmn-event.js +2 -2
  13. package/dist/bpmn-event.js.map +1 -1
  14. package/dist/bpmn-expanded-subprocess.js +1 -1
  15. package/dist/bpmn-expanded-subprocess.js.map +1 -1
  16. package/dist/bpmn-gateway.js +2 -2
  17. package/dist/bpmn-gateway.js.map +1 -1
  18. package/dist/bpmn-group.js +1 -1
  19. package/dist/bpmn-group.js.map +1 -1
  20. package/dist/bpmn-message.js +1 -1
  21. package/dist/bpmn-message.js.map +1 -1
  22. package/dist/bpmn-subprocess.js +3 -3
  23. package/dist/bpmn-subprocess.js.map +1 -1
  24. package/dist/bpmn-task.js +4 -4
  25. package/dist/bpmn-task.js.map +1 -1
  26. package/logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json +3 -58
  27. package/logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json +3 -73
  28. package/logs/application-2022-12-09-13.log +12 -0
  29. package/logs/connections-2022-12-09-13.log +70 -0
  30. package/package.json +2 -2
  31. package/src/base/bpmn-activity.ts +3 -3
  32. package/src/bpmn-comment.ts +2 -3
  33. package/src/bpmn-data-object.ts +4 -4
  34. package/src/bpmn-data-store.ts +2 -2
  35. package/src/bpmn-event.ts +3 -3
  36. package/src/bpmn-expanded-subprocess.ts +2 -2
  37. package/src/bpmn-gateway.ts +3 -3
  38. package/src/bpmn-group.ts +2 -2
  39. package/src/bpmn-message.ts +2 -2
  40. package/src/bpmn-subprocess.ts +4 -4
  41. package/src/bpmn-task.ts +5 -5
  42. package/tsconfig.tsbuildinfo +1 -1
  43. package/logs/application-2022-11-04-14.log +0 -6
  44. package/logs/application-2022-11-04-15.log +0 -6
  45. package/logs/application-2022-11-05-06.log +0 -6
  46. package/logs/application-2022-11-05-10.log +0 -6
  47. package/logs/application-2022-11-05-11.log +0 -6
  48. package/logs/application-2022-11-05-16.log +0 -30
  49. package/logs/application-2022-11-05-17.log +0 -6
  50. package/logs/application-2022-11-05-20.log +0 -6
  51. package/logs/application-2022-11-05-23.log +0 -6
  52. package/logs/application-2022-11-06-00.log +0 -6
  53. package/logs/application-2022-11-06-12.log +0 -6
  54. package/logs/application-2022-11-06-14.log +0 -18
  55. package/logs/connections-2022-11-03-10.log +0 -70
  56. package/logs/connections-2022-11-03-11.log +0 -105
  57. package/logs/connections-2022-11-04-11.log +0 -35
  58. package/logs/connections-2022-11-04-14.log +0 -35
  59. package/logs/connections-2022-11-04-15.log +0 -35
  60. package/logs/connections-2022-11-05-06.log +0 -35
  61. package/logs/connections-2022-11-05-10.log +0 -35
  62. package/logs/connections-2022-11-05-11.log +0 -35
  63. package/logs/connections-2022-11-05-16.log +0 -175
  64. package/logs/connections-2022-11-05-17.log +0 -35
  65. package/logs/connections-2022-11-05-20.log +0 -35
  66. package/logs/connections-2022-11-05-23.log +0 -35
  67. package/logs/connections-2022-11-06-00.log +0 -35
  68. package/logs/connections-2022-11-06-12.log +0 -35
  69. package/logs/connections-2022-11-06-14.log +0 -70
package/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ### [1.1.20](https://github.com/things-scene/operato-scene/compare/v1.1.19...v1.1.20) (2022-12-09)
7
+
8
+
9
+ ### :bug: Bug Fix
10
+
11
+ * filling for bpmn components ([2f3bb57](https://github.com/things-scene/operato-scene/commit/2f3bb57ef5ab7915f8c863d82eb55e46af4d512e))
12
+ * filling for bpmn components ([7447940](https://github.com/things-scene/operato-scene/commit/74479406b4cf70702ef367eea6cdf3dff24dec2b))
13
+
14
+
15
+
6
16
  ### [1.1.15](https://github.com/things-scene/operato-scene/compare/v1.1.14...v1.1.15) (2022-11-13)
7
17
 
8
18
 
@@ -10,14 +10,14 @@ export default class BPMNActivity extends BPMNControlBase {
10
10
  ctx.arcTo(width, height, 0, height, radius);
11
11
  ctx.arcTo(0, height, 0, 0, radius);
12
12
  ctx.arcTo(0, 0, width, 0, radius);
13
+ ctx.translate(-left, -top);
13
14
  this.drawFill(ctx);
14
15
  this.drawStroke(ctx);
15
16
  ctx.beginPath();
16
17
  const image = this.getImageElement();
17
18
  if (image) {
18
- this.drawImage(ctx, image, 0, 0, 24, 24);
19
+ this.drawImage(ctx, image, left, top, 24, 24);
19
20
  }
20
- ctx.translate(-left, -top);
21
21
  }
22
22
  }
23
23
  //# sourceMappingURL=bpmn-activity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bpmn-activity.js","sourceRoot":"","sources":["../../src/base/bpmn-activity.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,qBAAqB,CAAA;AAEjD,MAAM,CAAC,OAAO,OAAgB,YAAa,SAAQ,eAAe;IAGhE,MAAM,CAAC,GAA6B;QAClC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAE9C,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;QACxB,GAAG,CAAC,SAAS,EAAE,CAAA;QAEf,IAAI,MAAM,GAAG,CAAC,CAAA;QAEd,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;QACrB,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;QAC1C,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;QAC3C,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAA;QAClC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,CAAC,CAAA;QAEjC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;QAClB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;QAEpB,GAAG,CAAC,SAAS,EAAE,CAAA;QAEf,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,EAAE,CAAA;QACpC,IAAI,KAAK,EAAE;YACT,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;SACzC;QAED,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAA;IAC5B,CAAC;CACF","sourcesContent":["import BPMNControlBase from './bpmn-control-base'\n\nexport default abstract class BPMNActivity extends BPMNControlBase {\n abstract getImageElement(): HTMLImageElement | null | undefined\n\n render(ctx: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n var radius = 9\n\n ctx.moveTo(radius, 0)\n ctx.arcTo(width, 0, width, height, radius)\n ctx.arcTo(width, height, 0, height, radius)\n ctx.arcTo(0, height, 0, 0, radius)\n ctx.arcTo(0, 0, width, 0, radius)\n\n this.drawFill(ctx)\n this.drawStroke(ctx)\n\n ctx.beginPath()\n\n const image = this.getImageElement()\n if (image) {\n this.drawImage(ctx, image, 0, 0, 24, 24)\n }\n\n ctx.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,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;SAC9C;IACH,CAAC;CACF","sourcesContent":["import BPMNControlBase from './bpmn-control-base'\n\nexport default abstract class BPMNActivity extends BPMNControlBase {\n abstract getImageElement(): HTMLImageElement | null | undefined\n\n render(ctx: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n var radius = 9\n\n ctx.moveTo(radius, 0)\n ctx.arcTo(width, 0, width, height, radius)\n ctx.arcTo(width, height, 0, height, radius)\n ctx.arcTo(0, height, 0, 0, radius)\n ctx.arcTo(0, 0, width, 0, radius)\n\n ctx.translate(-left, -top)\n\n this.drawFill(ctx)\n this.drawStroke(ctx)\n\n ctx.beginPath()\n\n const image = this.getImageElement()\n if (image) {\n this.drawImage(ctx, image, left, top, 24, 24)\n }\n }\n}\n"]}
@@ -15,7 +15,7 @@ export declare enum FLOW {
15
15
  SEQUENCE = "sequence",
16
16
  ASSOCIATION = "association"
17
17
  }
18
- export declare type NODE = {
18
+ export type NODE = {
19
19
  name: string;
20
20
  description: string;
21
21
  inout: INOUT;
@@ -15,7 +15,7 @@ export declare enum FLOW {
15
15
  SEQUENCE = "sequence",
16
16
  ASSOCIATION = "association"
17
17
  }
18
- export declare type NODE = {
18
+ export type NODE = {
19
19
  name: string;
20
20
  description: string;
21
21
  inout: INOUT;
@@ -35,9 +35,8 @@ export default class BPMNComment extends BPMNControlBase {
35
35
  this.drawStroke(ctx);
36
36
  ctx.beginPath();
37
37
  ctx.rect(0, 0, width, height);
38
- this.drawFill(ctx);
39
- ctx.beginPath();
40
38
  ctx.translate(-left, -top);
39
+ this.drawFill(ctx);
41
40
  }
42
41
  get textBounds() {
43
42
  var { left, top, width, height } = this.bounds;
@@ -1 +1 @@
1
- {"version":3,"file":"bpmn-comment.js","sourceRoot":"","sources":["../src/bpmn-comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,SAAS,EAAE,MA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,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;QAC7B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;QAElB,GAAG,CAAC,SAAS,EAAE,CAAA;QAEf,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAA;IAC5B,CAAC;IAED,IAAI,UAAU;QACZ,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAE9C,OAAO;YACL,IAAI,EAAE,IAAI,GAAG,EAAE;YACf,GAAG,EAAE,GAAG,GAAG,EAAE;YACb,KAAK,EAAE,KAAK,GAAG,EAAE;YACjB,MAAM,EAAE,MAAM,GAAG,EAAE;SACpB,CAAA;IACH,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,CAAA","sourcesContent":["import { BOUNDS, Component } from '@hatiolab/things-scene'\n\nimport BPMNControlBase, { DIRECTION, INOUT, NODE, FLOW } from './base/bpmn-control-base'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [],\n help: '/bpmn/comment/comment'\n}\n\nexport default class BPMNComment extends BPMNControlBase {\n static get nature() {\n return NATURE\n }\n\n get nodes(): NODE[] {\n return [\n {\n name: 'Left',\n description: 'Left side message inout',\n inout: INOUT.INOUT,\n type: FLOW.MESSAGE,\n direction: DIRECTION.WEST,\n multiplicity: 1\n }\n ]\n }\n\n render(ctx: CanvasRenderingContext2D) {\n const { left, top, width, height } = this.bounds\n const bracket = height / 3\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n ctx.moveTo(bracket, 0)\n ctx.lineTo(0, 0)\n ctx.lineTo(0, height)\n ctx.lineTo(bracket, height)\n this.drawStroke(ctx)\n\n ctx.beginPath()\n ctx.rect(0, 0, width, height)\n this.drawFill(ctx)\n\n ctx.beginPath()\n\n ctx.translate(-left, -top)\n }\n\n get textBounds(): BOUNDS {\n var { left, top, width, height } = this.bounds\n\n return {\n left: left + 10,\n top: top + 10,\n width: width - 10,\n height: height - 10\n }\n }\n}\n\nComponent.register('bpmn-comment', BPMNComment)\n"]}
1
+ {"version":3,"file":"bpmn-comment.js","sourceRoot":"","sources":["../src/bpmn-comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAE1D,OAAO,eAAe,EAAE,EAAE,SAAS,EAAE,KAAK,EAAQ,IAAI,EAAE,MAAM,0BAA0B,CAAA;AAExF,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,uBAAuB;CAC9B,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,eAAe;IACtD,MAAM,KAAK,MAAM;QACf,OAAO,MAAM,CAAA;IACf,CAAC;IAED,IAAI,KAAK;QACP,OAAO;YACL;gBACE,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,yBAAyB;gBACtC,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,IAAI,EAAE,IAAI,CAAC,OAAO;gBAClB,SAAS,EAAE,SAAS,CAAC,IAAI;gBACzB,YAAY,EAAE,CAAC;aAChB;SACF,CAAA;IACH,CAAC;IAED,MAAM,CAAC,GAA6B;QAClC,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAChD,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,CAAA;QAE1B,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;QACxB,GAAG,CAAC,SAAS,EAAE,CAAA;QAEf,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;QACtB,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;QAChB,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;QACrB,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;QAC3B,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;QAEpB,GAAG,CAAC,SAAS,EAAE,CAAA;QACf,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;QAE7B,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAA;QAE1B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;IACpB,CAAC;IAED,IAAI,UAAU;QACZ,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAE9C,OAAO;YACL,IAAI,EAAE,IAAI,GAAG,EAAE;YACf,GAAG,EAAE,GAAG,GAAG,EAAE;YACb,KAAK,EAAE,KAAK,GAAG,EAAE;YACjB,MAAM,EAAE,MAAM,GAAG,EAAE;SACpB,CAAA;IACH,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,CAAA","sourcesContent":["import { BOUNDS, Component } from '@hatiolab/things-scene'\n\nimport BPMNControlBase, { DIRECTION, INOUT, NODE, FLOW } from './base/bpmn-control-base'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [],\n help: '/bpmn/comment/comment'\n}\n\nexport default class BPMNComment extends BPMNControlBase {\n static get nature() {\n return NATURE\n }\n\n get nodes(): NODE[] {\n return [\n {\n name: 'Left',\n description: 'Left side message inout',\n inout: INOUT.INOUT,\n type: FLOW.MESSAGE,\n direction: DIRECTION.WEST,\n multiplicity: 1\n }\n ]\n }\n\n render(ctx: CanvasRenderingContext2D) {\n const { left, top, width, height } = this.bounds\n const bracket = height / 3\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n ctx.moveTo(bracket, 0)\n ctx.lineTo(0, 0)\n ctx.lineTo(0, height)\n ctx.lineTo(bracket, height)\n this.drawStroke(ctx)\n\n ctx.beginPath()\n ctx.rect(0, 0, width, height)\n\n ctx.translate(-left, -top)\n\n this.drawFill(ctx)\n }\n\n get textBounds(): BOUNDS {\n var { left, top, width, height } = this.bounds\n\n return {\n left: left + 10,\n top: top + 10,\n width: width - 10,\n height: height - 10\n }\n }\n}\n\nComponent.register('bpmn-comment', BPMNComment)\n"]}
@@ -70,17 +70,17 @@ export default class BPMNDataObject extends BPMNControlBase {
70
70
  ctx.lineTo(width, height);
71
71
  ctx.lineTo(0, height);
72
72
  ctx.lineTo(0, 0);
73
+ ctx.translate(-left, -top);
73
74
  this.drawFill(ctx);
74
75
  this.drawStroke(ctx);
75
76
  ctx.beginPath();
76
77
  const image = this.getImageElement();
77
78
  if (image) {
78
- this.drawImage(ctx, image, 0, 0, corner, corner);
79
+ this.drawImage(ctx, image, left, top, corner, corner);
79
80
  }
80
81
  if (collection) {
81
- this.drawImage(ctx, this.getCollectionImageElement(), (width - 16) / 2, height - 16, 16, 16);
82
+ this.drawImage(ctx, this.getCollectionImageElement(), left + (width - 16) / 2, top + height - 16, 16, 16);
82
83
  }
83
- ctx.translate(-left, -top);
84
84
  }
85
85
  onchange(after, before) {
86
86
  if ('inout' in after || 'collection' in after || 'strokeStyle' in after) {
@@ -1 +1 @@
1
- {"version":3,"file":"bpmn-data-object.js","sourceRoot":"","sources":["../src/bpmn-data-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAsB,MAAM,wBAAwB,CAAA;AAEtE,OAAO,eAAe,MAAM,0BAA0B,CAAA;AAEtD,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,IA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YAChC,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;YAElC,IAAI,CAAC,sBAAsB,GAAG,IAAI,KAAK,EAAE,CAAA;YACzC,IAAI,CAAC,sBAAsB,CAAC,GAAG;gBAC7B,0CAA0C,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC,CAAA;SACzG;QAED,OAAO,IAAI,CAAC,sBAAsB,CAAA;IACpC,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAAA;AAEtD,MAAM,MAAM,GAA+B;IACzC,KAAK,EAAE;;;;;;;;GAQN;IACD,MAAM,EAAE;;;;;;;;GAQP;CACF,CAAA;AAED,MAAM,UAAU,GAAW;;;;;;;;;;;;GAYxB,CAAA","sourcesContent":["import { Component, Properties, BOUNDS } from '@hatiolab/things-scene'\n\nimport BPMNControlBase from './base/bpmn-control-base'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [\n {\n type: 'select',\n name: 'inout',\n label: 'inout',\n property: {\n options: [\n {\n display: '',\n value: ''\n },\n {\n display: 'input',\n value: 'input'\n },\n {\n display: 'output',\n value: 'output'\n }\n ]\n }\n },\n {\n type: 'checkbox',\n name: 'collection',\n label: 'collection'\n }\n ],\n help: '/bpmn/data-object/data-object'\n}\n\nexport default class BPMNDataObject extends BPMNControlBase {\n private imageElement?: HTMLImageElement\n private collectionImageElement?: HTMLImageElement\n\n static get nature() {\n return NATURE\n }\n\n get textBounds(): BOUNDS {\n var { left, top, width, height } = this.bounds\n var { paddingTop, paddingLeft, paddingRight } = this.state\n\n paddingTop ||= 0\n paddingLeft ||= 0\n paddingRight ||= 0\n\n return {\n left: left + paddingLeft,\n top: top + paddingTop + height + 10,\n width: Math.max(width - paddingLeft - paddingRight, 0),\n height: 0\n }\n }\n\n render(ctx: CanvasRenderingContext2D) {\n const { left, top, width, height } = this.bounds\n const { collection = false } = this.state\n\n const corner = (Math.min(width, height) * 2) / 5\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n ctx.moveTo(width - corner, 0)\n ctx.lineTo(width - corner, corner)\n ctx.lineTo(width, corner)\n ctx.lineTo(width - corner, 0)\n this.drawStroke(ctx)\n\n ctx.beginPath()\n ctx.moveTo(0, 0)\n ctx.lineTo(width - corner, 0)\n ctx.lineTo(width - corner, corner)\n ctx.lineTo(width, corner)\n ctx.lineTo(width, height)\n ctx.lineTo(0, height)\n ctx.lineTo(0, 0)\n\n this.drawFill(ctx)\n this.drawStroke(ctx)\n\n ctx.beginPath()\n\n const image = this.getImageElement()\n if (image) {\n this.drawImage(ctx, image, 0, 0, corner, corner)\n }\n\n if (collection) {\n this.drawImage(ctx, this.getCollectionImageElement()!, (width - 16) / 2, height - 16, 16, 16)\n }\n\n ctx.translate(-left, -top)\n }\n\n onchange(after: Properties, before: Properties) {\n if ('inout' in after || 'collection' in after || 'strokeStyle' in after) {\n delete this.imageElement\n delete this.collectionImageElement\n }\n }\n\n getImageElement(): HTMLImageElement | undefined {\n if (!this.imageElement) {\n const { inout, strokeStyle } = this.state\n\n if (!inout) {\n return\n }\n\n const src: string = IMAGES[inout]\n if (!src) {\n return\n }\n\n this.imageElement = new Image()\n this.imageElement.src =\n 'data:image/svg+xml;charset=UTF-8;base64,' + btoa(src.replace(/{{strokeColor}}/g, strokeStyle))\n }\n\n return this.imageElement\n }\n\n getCollectionImageElement(): HTMLImageElement | undefined {\n if (!this.collectionImageElement) {\n const { strokeStyle } = this.state\n\n this.collectionImageElement = new Image()\n this.collectionImageElement.src =\n 'data:image/svg+xml;charset=UTF-8;base64,' + btoa(COLLECTION.replace(/{{strokeColor}}/g, strokeStyle))\n }\n\n return this.collectionImageElement\n }\n}\n\nComponent.register('bpmn-data-object', BPMNDataObject)\n\nconst IMAGES: { [type: string]: string } = {\n input: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:none;stroke:{{strokeColor}};stroke-miterlimit:10;}\n </style>\n <path class=\"st0\" d=\"M19,13.8V8l9.5,9.5L19,27v-5.8H6.5v-7.5H19z\"/>\n </svg>\n `,\n output: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <path class=\"st0\" d=\"M19,13.8V8l9.5,9.5L19,27v-5.8H6.5v-7.5H19z\"/>\n </svg>\n `\n}\n\nconst COLLECTION: string = `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <g>\n <rect x=\"5.5\" y=\"1.9\" class=\"st0\" width=\"3.3\" height=\"25.3\"/>\n <rect x=\"15.9\" y=\"1.9\" class=\"st0\" width=\"3.3\" height=\"25.3\"/>\n <rect x=\"26.2\" y=\"1.9\" class=\"st0\" width=\"3.3\" height=\"25.3\"/>\n </g>\n </svg>\n `\n"]}
1
+ {"version":3,"file":"bpmn-data-object.js","sourceRoot":"","sources":["../src/bpmn-data-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAsB,MAAM,wBAAwB,CAAA;AAEtE,OAAO,eAAe,MAAM,0BAA0B,CAAA;AAEtD,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd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C,CAAA;SAClG;QAED,OAAO,IAAI,CAAC,YAAY,CAAA;IAC1B,CAAC;IAED,yBAAyB;QACvB,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE;YAChC,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;YAElC,IAAI,CAAC,sBAAsB,GAAG,IAAI,KAAK,EAAE,CAAA;YACzC,IAAI,CAAC,sBAAsB,CAAC,GAAG;gBAC7B,0CAA0C,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC,CAAA;SACzG;QAED,OAAO,IAAI,CAAC,sBAAsB,CAAA;IACpC,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAAA;AAEtD,MAAM,MAAM,GAA+B;IACzC,KAAK,EAAE;;;;;;;;GAQN;IACD,MAAM,EAAE;;;;;;;;GAQP;CACF,CAAA;AAED,MAAM,UAAU,GAAW;;;;;;;;;;;;GAYxB,CAAA","sourcesContent":["import { Component, Properties, BOUNDS } from '@hatiolab/things-scene'\n\nimport BPMNControlBase from './base/bpmn-control-base'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [\n {\n type: 'select',\n name: 'inout',\n label: 'inout',\n property: {\n options: [\n {\n display: '',\n value: ''\n },\n {\n display: 'input',\n value: 'input'\n },\n {\n display: 'output',\n value: 'output'\n }\n ]\n }\n },\n {\n type: 'checkbox',\n name: 'collection',\n label: 'collection'\n }\n ],\n help: '/bpmn/data-object/data-object'\n}\n\nexport default class BPMNDataObject extends BPMNControlBase {\n private imageElement?: HTMLImageElement\n private collectionImageElement?: HTMLImageElement\n\n static get nature() {\n return NATURE\n }\n\n get textBounds(): BOUNDS {\n var { left, top, width, height } = this.bounds\n var { paddingTop, paddingLeft, paddingRight } = this.state\n\n paddingTop ||= 0\n paddingLeft ||= 0\n paddingRight ||= 0\n\n return {\n left: left + paddingLeft,\n top: top + paddingTop + height + 10,\n width: Math.max(width - paddingLeft - paddingRight, 0),\n height: 0\n }\n }\n\n render(ctx: CanvasRenderingContext2D) {\n const { left, top, width, height } = this.bounds\n const { collection = false } = this.state\n\n const corner = (Math.min(width, height) * 2) / 5\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n ctx.moveTo(width - corner, 0)\n ctx.lineTo(width - corner, corner)\n ctx.lineTo(width, corner)\n ctx.lineTo(width - corner, 0)\n this.drawStroke(ctx)\n\n ctx.beginPath()\n ctx.moveTo(0, 0)\n ctx.lineTo(width - corner, 0)\n ctx.lineTo(width - corner, corner)\n ctx.lineTo(width, corner)\n ctx.lineTo(width, height)\n ctx.lineTo(0, height)\n ctx.lineTo(0, 0)\n\n ctx.translate(-left, -top)\n\n this.drawFill(ctx)\n this.drawStroke(ctx)\n\n ctx.beginPath()\n\n const image = this.getImageElement()\n if (image) {\n this.drawImage(ctx, image, left, top, corner, corner)\n }\n\n if (collection) {\n this.drawImage(ctx, this.getCollectionImageElement()!, left + (width - 16) / 2, top + height - 16, 16, 16)\n }\n }\n\n onchange(after: Properties, before: Properties) {\n if ('inout' in after || 'collection' in after || 'strokeStyle' in after) {\n delete this.imageElement\n delete this.collectionImageElement\n }\n }\n\n getImageElement(): HTMLImageElement | undefined {\n if (!this.imageElement) {\n const { inout, strokeStyle } = this.state\n\n if (!inout) {\n return\n }\n\n const src: string = IMAGES[inout]\n if (!src) {\n return\n }\n\n this.imageElement = new Image()\n this.imageElement.src =\n 'data:image/svg+xml;charset=UTF-8;base64,' + btoa(src.replace(/{{strokeColor}}/g, strokeStyle))\n }\n\n return this.imageElement\n }\n\n getCollectionImageElement(): HTMLImageElement | undefined {\n if (!this.collectionImageElement) {\n const { strokeStyle } = this.state\n\n this.collectionImageElement = new Image()\n this.collectionImageElement.src =\n 'data:image/svg+xml;charset=UTF-8;base64,' + btoa(COLLECTION.replace(/{{strokeColor}}/g, strokeStyle))\n }\n\n return this.collectionImageElement\n }\n}\n\nComponent.register('bpmn-data-object', BPMNDataObject)\n\nconst IMAGES: { [type: string]: string } = {\n input: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:none;stroke:{{strokeColor}};stroke-miterlimit:10;}\n </style>\n <path class=\"st0\" d=\"M19,13.8V8l9.5,9.5L19,27v-5.8H6.5v-7.5H19z\"/>\n </svg>\n `,\n output: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <path class=\"st0\" d=\"M19,13.8V8l9.5,9.5L19,27v-5.8H6.5v-7.5H19z\"/>\n </svg>\n `\n}\n\nconst COLLECTION: string = `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <g>\n <rect x=\"5.5\" y=\"1.9\" class=\"st0\" width=\"3.3\" height=\"25.3\"/>\n <rect x=\"15.9\" y=\"1.9\" class=\"st0\" width=\"3.3\" height=\"25.3\"/>\n <rect x=\"26.2\" y=\"1.9\" class=\"st0\" width=\"3.3\" height=\"25.3\"/>\n </g>\n </svg>\n `\n"]}
@@ -40,9 +40,9 @@ export default class BPMNDataStore extends BPMNControlBase {
40
40
  ctx.lineTo(0, height - ry);
41
41
  ctx.ellipse(width / 2, height - ry, width / 2, ry, 0, startAngle, endAngle, true);
42
42
  ctx.lineTo(width, ry);
43
+ ctx.translate(-left, -top);
43
44
  this.drawFill(ctx);
44
45
  this.drawStroke(ctx);
45
- ctx.translate(-left, -top);
46
46
  }
47
47
  }
48
48
  Component.register('bpmn-data-store', BPMNDataStore);
@@ -1 +1 @@
1
- {"version":3,"file":"bpmn-data-store.js","sourceRoot":"","sources":["../src/bpmn-data-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAU,MAAM,wBAAwB,CAAA;AAE1D,OAAO,eAAe,MAAM,0BAA0B,CAAA;AAEtD,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,6BAA6B;CACpC,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,eAAe;IACxD,MAAM,KAAK,MAAM;QACf,OAAO,MAAM,CAAA;IACf,CAAC;IAED,IAAI,UAAU;QACZ,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAC9C,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAE1D,UAAU,KAAV,UAAU,GAAK,CAAC,EAAA;QAChB,WAAW,KAAX,WAAW,GAAK,CAAC,EAAA;QACjB,YAAY,KAAZ,YAAY,GAAK,CAAC,EAAA;QAElB,OAAO;YACL,IAAI,EAAE,IAAI,GAAG,WAAW;YACxB,GAAG,EAAE,GAAG,GAAG,UAAU,GAAG,MAAM,GAAG,EAAE;YACnC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,WAAW,GAAG,YAAY,EAAE,CAAC,CAAC;YACtD,MAAM,EAAE,CAAC;SACV,CAAA;IACH,CAAC;IAED,MAAM,CAAC,GAA6B;QA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AG,CAAC,EAAE,MAAM,GAAG,EAAE,EAAE,KAAK,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;QACjF,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;QAErB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;QAClB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;QAEpB,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAA;IAC5B,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAA","sourcesContent":["import { Component, BOUNDS } from '@hatiolab/things-scene'\n\nimport BPMNControlBase from './base/bpmn-control-base'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [],\n help: '/bpmn/data-store/data-store'\n}\n\nexport default class BPMNDataStore extends BPMNControlBase {\n static get nature() {\n return NATURE\n }\n\n get textBounds(): BOUNDS {\n var { left, top, width, height } = this.bounds\n var { paddingTop, paddingLeft, paddingRight } = this.state\n\n paddingTop ||= 0\n paddingLeft ||= 0\n paddingRight ||= 0\n\n return {\n left: left + paddingLeft,\n top: top + paddingTop + height + 10,\n width: Math.max(width - paddingLeft - paddingRight, 0),\n height: 0\n }\n }\n\n render(ctx: CanvasRenderingContext2D) {\n const { left, top, width, height } = this.bounds\n const ry = Math.abs(height / 6)\n const startAngle = Math.PI\n const endAngle = 0\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n ctx.ellipse(width / 2, ry, width / 2, ry, 0, startAngle, startAngle - Math.PI * 2, true)\n\n ctx.moveTo(0, ry + ry / 2)\n ctx.ellipse(width / 2, ry + ry / 2, width / 2, ry, 0, startAngle, endAngle, true)\n\n ctx.moveTo(0, ry + ry)\n ctx.ellipse(width / 2, ry + ry, width / 2, ry, 0, startAngle, endAngle, true)\n\n ctx.moveTo(0, ry)\n ctx.lineTo(0, height - ry)\n ctx.ellipse(width / 2, height - ry, width / 2, ry, 0, startAngle, endAngle, true)\n ctx.lineTo(width, ry)\n\n this.drawFill(ctx)\n this.drawStroke(ctx)\n\n ctx.translate(-left, -top)\n }\n}\n\nComponent.register('bpmn-data-store', BPMNDataStore)\n"]}
1
+ {"version":3,"file":"bpmn-data-store.js","sourceRoot":"","sources":["../src/bpmn-data-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAU,MAAM,wBAAwB,CAAA;AAE1D,OAAO,eAAe,MAAM,0BAA0B,CAAA;AAEtD,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,6BAA6B;CACpC,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,eAAe;IACxD,MAAM,KAAK,MAAM;QACf,OAAO,MAAM,CAAA;IACf,CAAC;IAED,IAAI,UAAU;QACZ,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAC9C,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAE1D,UAAU,KAAV,UAAU,GAAK,CAAC,EAAA;QAChB,WAAW,KAAX,WAAW,GAAK,CAAC,EAAA;QACjB,YAAY,KAAZ,YAAY,GAAK,CAAC,EAAA;QAElB,OAAO;YACL,IAAI,EAAE,IAAI,GAAG,WAAW;YACxB,GAAG,EAAE,GAAG,GAAG,UAAU,GAAG,MAAM,GAAG,EAAE;YACnC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,WAAW,GAAG,YAAY,EAAE,CAAC,CAAC;YACtD,MAAM,EAAE,CAAC;SACV,CAAA;IACH,CAAC;IAED,MAAM,CAAC,GAA6B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,GAAG,CAAC,EAAE,MAAM,GAAG,EAAE,EAAE,KAAK,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;QACjF,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;QAErB,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAA;QAE1B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;QAClB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;IACtB,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAA","sourcesContent":["import { Component, BOUNDS } from '@hatiolab/things-scene'\n\nimport BPMNControlBase from './base/bpmn-control-base'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [],\n help: '/bpmn/data-store/data-store'\n}\n\nexport default class BPMNDataStore extends BPMNControlBase {\n static get nature() {\n return NATURE\n }\n\n get textBounds(): BOUNDS {\n var { left, top, width, height } = this.bounds\n var { paddingTop, paddingLeft, paddingRight } = this.state\n\n paddingTop ||= 0\n paddingLeft ||= 0\n paddingRight ||= 0\n\n return {\n left: left + paddingLeft,\n top: top + paddingTop + height + 10,\n width: Math.max(width - paddingLeft - paddingRight, 0),\n height: 0\n }\n }\n\n render(ctx: CanvasRenderingContext2D) {\n const { left, top, width, height } = this.bounds\n const ry = Math.abs(height / 6)\n const startAngle = Math.PI\n const endAngle = 0\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n ctx.ellipse(width / 2, ry, width / 2, ry, 0, startAngle, startAngle - Math.PI * 2, true)\n\n ctx.moveTo(0, ry + ry / 2)\n ctx.ellipse(width / 2, ry + ry / 2, width / 2, ry, 0, startAngle, endAngle, true)\n\n ctx.moveTo(0, ry + ry)\n ctx.ellipse(width / 2, ry + ry, width / 2, ry, 0, startAngle, endAngle, true)\n\n ctx.moveTo(0, ry)\n ctx.lineTo(0, height - ry)\n ctx.ellipse(width / 2, height - ry, width / 2, ry, 0, startAngle, endAngle, true)\n ctx.lineTo(width, ry)\n\n ctx.translate(-left, -top)\n\n this.drawFill(ctx)\n this.drawStroke(ctx)\n }\n}\n\nComponent.register('bpmn-data-store', BPMNDataStore)\n"]}
@@ -137,6 +137,7 @@ export default class BPMNEvent extends BPMNControlBase {
137
137
  ctx.ellipse(cx, cy, width / 2, height / 2, 0, 0, 2 * Math.PI);
138
138
  break;
139
139
  }
140
+ ctx.translate(-left, -top);
140
141
  this.drawFill(ctx);
141
142
  this.drawStroke(ctx, {
142
143
  lineWidth,
@@ -145,9 +146,8 @@ export default class BPMNEvent extends BPMNControlBase {
145
146
  ctx.beginPath();
146
147
  const image = this.getImageElement();
147
148
  if (image) {
148
- this.drawImage(ctx, image, width / 6, height / 6, (width * 2) / 3, (height * 2) / 3);
149
+ this.drawImage(ctx, image, left + width / 6, top + height / 6, (width * 2) / 3, (height * 2) / 3);
149
150
  }
150
- ctx.translate(-left, -top);
151
151
  }
152
152
  onchange(after, before) {
153
153
  if ('marker' in after || 'strokeStyle' in after) {
@@ -1 +1 @@
1
- {"version":3,"file":"bpmn-event.js","sourceRoot":"","sources":["../src/bpmn-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,SAAS,EAAc,MAAM,wBAAwB,CAAA;AAEtE,OAAO,eAAe,MAAM,0BAA0B,CAAA;AAEtD,IAAK,QAGJ;AAHD,WAAK,QAAQ;IACX,+CAAQ,CAAA;IACR,+CAAQ,CAAA;AACV,CAAC,EAHI,QAAQ,KAAR,QAAQ,QAGZ;AAED,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,YAAY;YACnB,QAAQ,EAAE;gBACR,OAAO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;;;;;;;GAWN;IACD,YAAY,EAAE;;;;;;;;;;GAUb;IACD,UAAU,EAAE;;;;;;;;GAQX;IACD,iBAAiB,EAAE;;;;;;;;GAQlB;IACD,MAAM,EAAE;;;;;;;;;;;GAWP;IACD,aAAa,EAAE;;;;;;;;;;;;;GAad;IACD,YAAY,EAAE;;;;;;;;;GASb;IACD,mBAAmB,EAAE;;;;;;;;;GASpB;IACD,WAAW,EAAE;;;;;;;;;;;;GAYZ;IACD,IAAI,EAAE;;;;;;;;GAQL;IACD,WAAW,EAAE;;;;;;;;GAQZ;IACD,MAAM,EAAE;;;;;;;;GAQP;IACD,aAAa,EAAE;;;;;;;;GAQd;IACD,SAAS,EAAE;;;;;;;;GAQV;IACD,QAAQ,EAAE;;;;;;;;GAQT;IACD,eAAe,EAAE;;;;;;;;GAQhB;IACD,mBAAmB,EAAE;;;;;;;;;;;GAWpB;CACF,CAAA","sourcesContent":["import { BOUNDS, Component, Properties } from '@hatiolab/things-scene'\n\nimport BPMNControlBase from './base/bpmn-control-base'\n\nenum BEHAVIOR {\n catching,\n throwing\n}\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [\n {\n type: 'select',\n name: 'eventType',\n label: 'event-type',\n property: {\n options: [\n {\n display: 'start',\n value: 'start'\n },\n {\n display: 'intermediate',\n value: 'intermediate'\n },\n {\n display: 'end',\n value: 'end'\n }\n ]\n }\n },\n {\n type: 'select',\n name: 'marker',\n label: 'marker',\n property: {\n options: [\n {\n display: 'message',\n value: 'message'\n },\n {\n display: 'timer',\n value: 'timer'\n },\n {\n display: 'error',\n value: 'error'\n },\n {\n display: 'escalation',\n value: 'escalation'\n },\n {\n display: 'cancel',\n value: 'cancel'\n },\n {\n display: 'compensation',\n value: 'compensation'\n },\n {\n display: 'conditional',\n value: 'conditional'\n },\n {\n display: 'link',\n value: 'link'\n },\n {\n display: 'signal',\n value: 'signal'\n },\n {\n display: 'terminate',\n value: 'terminate'\n },\n {\n display: 'multiple',\n value: 'multiple'\n },\n {\n display: 'parallel multiple',\n value: 'parallel-multiple'\n }\n ]\n }\n },\n {\n type: 'checkbox',\n label: 'interrupting',\n name: 'interrupting'\n }\n ],\n help: '/bpmn/event/event'\n}\n\nexport default class BPMNEvent extends BPMNControlBase {\n private imageElement?: HTMLImageElement\n\n static get nature() {\n return NATURE\n }\n\n get textBounds(): BOUNDS {\n var { left, top, width, height } = this.bounds\n var { paddingTop, paddingLeft, paddingRight } = this.state\n\n paddingTop ||= 0\n paddingLeft ||= 0\n paddingRight ||= 0\n\n return {\n left: left + paddingLeft,\n top: top + paddingTop + height + 10,\n width: Math.max(width - paddingLeft - paddingRight, 0),\n height: 0\n }\n }\n\n render(ctx: CanvasRenderingContext2D) {\n const { left, top, width, height } = this.bounds\n const { eventType, interrupting } = this.state\n const cx = width / 2\n const cy = height / 2\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n var lineWidth = 2\n\n switch (eventType) {\n case 'intermediate':\n lineWidth = 1\n ctx.ellipse(cx, cy, width / 2, height / 2, 0, 0, 2 * Math.PI)\n ctx.moveTo(width / 2 + width / 2.5, height / 2)\n ctx.ellipse(cx, cy, width / 2.5, height / 2.5, 0, 0, 2 * Math.PI)\n break\n\n case 'end':\n lineWidth = 5\n ctx.ellipse(cx, cy, width / 2 - 1.5, height / 2 - 1.5, 0, 0, 2 * Math.PI)\n break\n\n case 'start':\n default:\n ctx.ellipse(cx, cy, width / 2, height / 2, 0, 0, 2 * Math.PI)\n break\n }\n\n this.drawFill(ctx)\n\n this.drawStroke(ctx, {\n lineWidth,\n lineDash: interrupting ? 'round-dot' : 'solid'\n })\n\n ctx.beginPath()\n\n const image = this.getImageElement()\n if (image) {\n this.drawImage(ctx, image, width / 6, height / 6, (width * 2) / 3, (height * 2) / 3)\n }\n\n ctx.translate(-left, -top)\n }\n\n onchange(after: Properties, before: Properties) {\n if ('marker' in after || 'strokeStyle' in after) {\n // Since strokeStyle affects the image, the image is redrawn according to the change of strokeStyle.\n delete this.imageElement\n this.invalidate()\n }\n }\n\n getImageElement(): HTMLImageElement | undefined {\n if (!this.imageElement) {\n const { marker, strokeStyle } = this.state\n\n if (!marker) {\n return\n }\n\n const src = IMAGES[marker]\n if (!src) {\n return\n }\n\n this.imageElement = new Image()\n this.imageElement.src =\n 'data:image/svg+xml;charset=UTF-8;base64,' + btoa(src.replace(/{{strokeColor}}/g, strokeStyle))\n }\n\n return this.imageElement\n }\n}\n\nComponent.register('bpmn-event', BPMNEvent)\n\nconst IMAGES: { [type: string]: string } = {\n message: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <path class=\"st0\" d=\"M29.5,10.3c0-1.3-1.1-2.4-2.4-2.4H7.9c-1.3,0-2.4,1.1-2.4,2.4v14.4c0,1.3,1.1,2.4,2.4,2.4h19.2c1.3,0,2.4-1.1,2.4-2.4V10.3z\n M27.1,9.3l-9.6,7l-9.6-7H27.1z M28.1,25.7H6.9v-16l10.6,8l10.6-8V25.7z\"/>\n </svg>\n `,\n 'message-fill': `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <path d=\"M27.1,7.9H7.9c-1.3,0-2.4,1.1-2.4,2.4l0,14.4c0,1.3,1.1,2.4,2.4,2.4h19.2c1.3,0,2.4-1.1,2.4-2.4V10.3\n C29.5,9,28.4,7.9,27.1,7.9z M27.1,12.7l-9.6,6l-9.6-6v-2.4l9.6,6l9.6-6V12.7z\"/>\n </svg>\n `,\n timer: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <g>\n <g id=\"XMLID_807_\">\n <path class=\"st0\" d=\"M17.5,9.6c0.3,0,0.6-0.3,0.6-0.6V7.2c0-0.3-0.3-0.6-0.6-0.6c-0.3,0-0.6,0.3-0.6,0.6V9C16.9,9.3,17.2,9.6,17.5,9.6z\"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M7.4,18.2h1.8c0.3,0,0.6-0.3,0.6-0.6c0-0.3-0.3-0.6-0.6-0.6H7.4c-0.3,0-0.6,0.3-0.6,0.6C6.8,18,7,18.2,7.4,18.2z\"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M17.5,28.5c0.3,0,0.6-0.3,0.6-0.6v-1.8c0-0.3-0.3-0.6-0.6-0.6c-0.3,0-0.6,0.3-0.6,0.6v1.8C16.9,28.2,17.2,28.5,17.5,28.5z\n \"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M25.9,18.2h1.8c0.3,0,0.6-0.3,0.6-0.6c0-0.3-0.3-0.6-0.6-0.6h-1.8c-0.3,0-0.6,0.3-0.6,0.6C25.3,18,25.5,18.2,25.9,18.2z\"\n />\n </g>\n <g>\n <path class=\"st0\" d=\"M13.2,10.9c0.1,0,0.2,0,0.3-0.1c0.3-0.2,0.4-0.5,0.2-0.8l-0.9-1.5c-0.2-0.3-0.5-0.4-0.8-0.2c-0.3,0.2-0.4,0.5-0.2,0.8\n l0.9,1.5C12.8,10.8,13,10.9,13.2,10.9z\"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M9,23.5c0.1,0,0.2,0,0.3-0.1l1.5-0.9c0.3-0.2,0.4-0.5,0.2-0.8c-0.2-0.3-0.5-0.4-0.8-0.2l-1.5,0.9\n c-0.3,0.2-0.4,0.5-0.2,0.8C8.6,23.4,8.8,23.5,9,23.5z\"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M22.6,27.2c0.1,0,0.2,0,0.3-0.1c0.3-0.2,0.4-0.5,0.2-0.8l-0.9-1.5c-0.2-0.3-0.5-0.4-0.8-0.2c-0.3,0.2-0.4,0.5-0.2,0.8\n l0.9,1.5C22.2,27.1,22.4,27.2,22.6,27.2z\"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M25.1,14.5c0.1,0,0.2,0,0.3-0.1l1.5-0.9c0.3-0.2,0.4-0.5,0.2-0.8c-0.2-0.3-0.5-0.4-0.8-0.2l-1.5,0.9\n c-0.3,0.2-0.4,0.5-0.2,0.8C24.7,14.4,24.9,14.5,25.1,14.5z\"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M10,13.8c0.2,0,0.4-0.1,0.5-0.3c0.2-0.3,0.1-0.7-0.2-0.8l-1.5-0.9c-0.3-0.2-0.7-0.1-0.8,0.2c-0.2,0.3-0.1,0.7,0.2,0.8\n l1.5,0.9C9.8,13.8,9.9,13.8,10,13.8z\"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M12.4,27.1c0.2,0,0.4-0.1,0.5-0.3l0.9-1.5c0.2-0.3,0.1-0.7-0.2-0.8c-0.3-0.2-0.7-0.1-0.8,0.2l-0.9,1.5\n c-0.2,0.3-0.1,0.7,0.2,0.8C12.2,27.1,12.3,27.1,12.4,27.1z\"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M26,23.5c0.2,0,0.4-0.1,0.5-0.3c0.2-0.3,0.1-0.7-0.2-0.8l-1.5-0.9c-0.3-0.2-0.7-0.1-0.8,0.2c-0.2,0.3-0.1,0.7,0.2,0.8\n l1.5,0.9C25.8,23.5,25.9,23.5,26,23.5z\"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M21.8,10.8c0.2,0,0.4-0.1,0.5-0.3L23.2,9c0.2-0.3,0.1-0.7-0.2-0.8c-0.3-0.2-0.7-0.1-0.8,0.2l-0.9,1.5\n c-0.2,0.3-0.1,0.7,0.2,0.8C21.6,10.8,21.7,10.8,21.8,10.8z\"/>\n </g>\n <g id=\"XMLID_806_\">\n <path class=\"st0\" d=\"M17.5,17.7c0.4,0,0.7-0.3,0.7-0.7v-5.6c0-0.4-0.3-0.7-0.7-0.7c-0.4,0-0.7,0.3-0.7,0.7V17C16.8,17.4,17.1,17.7,17.5,17.7z\"\n />\n </g>\n <g id=\"XMLID_805_\">\n <path class=\"st0\" d=\"M17.5,18.3h3.9c0.4,0,0.7-0.3,0.7-0.7c0-0.4-0.3-0.7-0.7-0.7h-3.9c-0.4,0-0.7,0.3-0.7,0.7C16.8,17.9,17.1,18.3,17.5,18.3z\n \"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M17.5,7.2c5.7,0,10.2,4.6,10.2,10.2s-4.6,10.2-10.2,10.2S7.2,23.2,7.2,17.5S11.8,7.2,17.5,7.2 M17.5,6.5\n c-6.1,0-11,4.9-11,11s4.9,11,11,11s11-4.9,11-11S23.6,6.5,17.5,6.5L17.5,6.5z\"/>\n </g>\n </g>\n </svg>\n `,\n error: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <g>\n <path class=\"st0\" d=\"M9.7,10.3l11.1,6.1c0.2,0.1,0.5,0.2,0.7,0.2c0.4,0,0.7-0.1,1-0.4l4.9-4.3l-2,12.7l-10.1-6c-0.2-0.1-0.5-0.2-0.8-0.2\n c-0.3,0-0.7,0.1-0.9,0.3l-6,4.7L9.7,10.3 M29.5,8l-8,7.1L8.5,8l-3,19l9-7.1l12,7.1L29.5,8L29.5,8z\"/>\n </g>\n </svg>\n `,\n 'error-fill': `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <g>\n <polygon class=\"st0\" points=\"26.5,27 29.5,8 21.5,15.1 8.5,8 5.5,27 14.5,19.9 \t\"/>\n </g>\n </svg>\n `,\n escalation: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:none;stroke:{{strokeColor}};stroke-miterlimit:10;}\n </style>\n <polygon class=\"st0\" points=\"17.5,19.9 7.5,27 17.5,8 27.5,27 \"/>\n </svg>\n `,\n 'escalation-fill': `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <polygon class=\"st0\" points=\"17.5,19.9 7.5,27 17.5,8 27.5,27 \"/>\n </svg>\n `,\n cancel: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <path class=\"st0\" d=\"M24.4,8.8l1.8,1.8l-6.9,6.9l6.9,6.9l-1.8,1.8l-6.9-6.9l-6.9,6.9l-1.8-1.8l6.9-6.9l-6.9-6.9l1.8-1.8l6.9,6.9L24.4,8.8\n\t\t M24.4,7.4l-0.7,0.7l-6.2,6.2l-6.2-6.2l-0.7-0.7L9.9,8.1L8.1,9.9l-0.7,0.7l0.7,0.7l6.2,6.2l-6.2,6.2l-0.7,0.7l0.7,0.7l1.8,1.8\n\t\tl0.7,0.7l0.7-0.7l6.2-6.2l6.2,6.2l0.7,0.7l0.7-0.7l1.8-1.8l0.7-0.7l-0.7-0.7l-6.2-6.2l6.2-6.2l0.7-0.7l-0.7-0.7l-1.8-1.8L24.4,7.4\n\t\tL24.4,7.4z\"/>\n </svg>\n `,\n 'cancel-fill': `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <g>\n <rect class=\"st0\" x=\"6.5\" y=\"16.3\" transform=\"matrix(0.7071 -0.7071 0.7071 0.7071 -7.2487 17.5)\" width=\"22\" height=\"2.5\"/>\n </g>\n <g>\n <rect class=\"st0\" x=\"16.2\" y=\"6.5\" transform=\"matrix(0.7071 -0.7071 0.7071 0.7071 -7.2487 17.5)\" width=\"2.5\" height=\"22\"/>\n </g>\n </svg>\n `,\n compensation: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <path class=\"st0\" d=\"M17,10.4v14.2l-7.1-7.1L17,10.4 M18,8l-9.5,9.5L18,27V8L18,8z M8.5,17.5L8.5,17.5L8.5,17.5L8.5,17.5L8.5,17.5z\"/>\n <path class=\"st0\" d=\"M25.5,10.4v14.2l-7.1-7.1L25.5,10.4 M26.5,8L17,17.5l9.5,9.5V8L26.5,8z M17,17.5L17,17.5L17,17.5L17,17.5L17,17.5z\"/>\n </svg>\n `,\n 'compensation-fill': `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <polygon class=\"st0\" points=\"8.5,17.5 18,8 18,27 8.5,17.5 \t\t\"/>\n <polygon class=\"st0\" points=\"17,17.5 26.5,8 26.5,27 17,17.5 \t\t\"/>\n </svg>\n `,\n conditional: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <g>\n <path class=\"st0\" d=\"M28.6,11.1v14.8H6.5V11.1h20.3 M26.8,8H8.2c-1.5,0-2.7,1-2.7,2.1v15.8c0,1.2,1.2,1.1,2.7,1.1h18.7c1.5,0,2.7,0.1,2.7-1.1\n V10.1C29.5,8.9,28.3,8,26.8,8L26.8,8z\"/>\n </g>\n <path class=\"st0\" d=\"M27.5,23.5h-20v-1h20V23.5z M27.5,17.8h-20v-1h20V17.8z M27.5,14.9h-20v-1h20V14.9z M27.5,20.6h-20v-1h20V20.6z\"/>\n </svg>\n `,\n link: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:none;stroke:{{strokeColor}};stroke-miterlimit:10;}\n </style>\n <path class=\"st0\" d=\"M19,13.8V8l9.5,9.5L19,27v-5.8H6.5v-7.5H19z\"/>\n </svg>\n `,\n 'link-fill': `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <path class=\"st0\" d=\"M19,13.8V8l9.5,9.5L19,27v-5.8H6.5v-7.5H19z\"/>\n </svg>\n `,\n signal: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:none;stroke:{{strokeColor}};stroke-miterlimit:10;}\n </style>\n <polygon class=\"st0\" points=\"17.5,26.9 7.5,27 17.5,8 27.5,27 \"/>\n </svg>\n `,\n 'signal-fill': `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <polygon class=\"st0\" points=\"17.5,26.9 7.5,27 17.5,8 27.5,27 \"/>\n </svg>\n `,\n terminate: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <circle class=\"st0\" cx=\"17.5\" cy=\"17.5\" r=\"11.5\"/>\n </svg>\n `,\n multiple: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{stroke:{{strokeColor}};}\n </style>\n <path class=\"st0\" d=\"M17.5,9.2l8.8,6.4L23,26H12L8.7,15.6L17.5,9.2 M17.5,8l-10,7.3L11.3,27h12.4l3.8-11.8L17.5,8L17.5,8z\"/>\n </svg>\n `,\n 'multiple-fill': `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <polygon class=\"st0\" points=\"17.5,8 7.5,15.3 11.3,27 23.7,27 27.5,15.3 \t\"/>\n </svg>\n `,\n 'parallel-multiple': `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:none;stroke:{{strokeColor}};stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}\n .st1{fill:{{strokeColor}};}\n </style>\n <path class=\"st1\" d=\"M18.4,10v6.6H25l0,1.7h-6.6V25h-1.7l0-6.6H10v-1.7h6.6V10H18.4 M19.4,9h-1h-1.7h-1v1v5.6H10H9v1v1.7v1h1h5.6l0,5.6v1h1h1.7\n\t\th1v-1v-5.6H25h1l0-1l0-1.7l0-1h-1h-5.6V10V9L19.4,9z\"/>\n <circle class=\"st0\" cx=\"17.5\" cy=\"17.5\" r=\"12\"/>\n </svg>\n `\n}\n"]}
1
+ {"version":3,"file":"bpmn-event.js","sourceRoot":"","sources":["../src/bpmn-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,SAAS,EAAc,MAAM,wBAAwB,CAAA;AAEtE,OAAO,eAAe,MAAM,0BAA0B,CAAA;AAEtD,IAAK,QAGJ;AAHD,WAAK,QAAQ;IACX,+CAAQ,CAAA;IACR,+CAAQ,CAAA;AACV,CAAC,EAHI,QAAQ,KAAR,QAAQ,QAGZ;AAED,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,YAAY;YACnB,QAAQ,EAAE;gBACR,OAAO,EAAE;oBACP;wBACE,OAAO,EAAE,OAAO;wBAChB,KAAK,EAAE,OAAO;qBACf;oBACD;wBACE,OAAO,EAAE,cAAc;wBACvB,KAAK,EAAE,cAAc;qBACtB;oBACD;wBACE,OAAO,EAAE,KAAK;wBACd,KAAK,EAAE,KAAK;qBACb;iBACF;aACF;SACF;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,QAAQ;YACf,QAAQ,EAAE;gBACR,OAAO,EAAE;oBACP;wBACE,OAAO,EAAE,SAAS;wBAClB,KAAK,EAAE,SAAS;qBACjB;oBACD;wBACE,OAAO,EAAE,OAAO;wBAChB,KAAK,EAAE,OAAO;qBACf;oBACD;wBACE,OAAO,EAAE,OAA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ACD,QAAQ,EAAE;;;;;;;;GAQT;IACD,eAAe,EAAE;;;;;;;;GAQhB;IACD,mBAAmB,EAAE;;;;;;;;;;;GAWpB;CACF,CAAA","sourcesContent":["import { BOUNDS, Component, Properties } from '@hatiolab/things-scene'\n\nimport BPMNControlBase from './base/bpmn-control-base'\n\nenum BEHAVIOR {\n catching,\n throwing\n}\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [\n {\n type: 'select',\n name: 'eventType',\n label: 'event-type',\n property: {\n options: [\n {\n display: 'start',\n value: 'start'\n },\n {\n display: 'intermediate',\n value: 'intermediate'\n },\n {\n display: 'end',\n value: 'end'\n }\n ]\n }\n },\n {\n type: 'select',\n name: 'marker',\n label: 'marker',\n property: {\n options: [\n {\n display: 'message',\n value: 'message'\n },\n {\n display: 'timer',\n value: 'timer'\n },\n {\n display: 'error',\n value: 'error'\n },\n {\n display: 'escalation',\n value: 'escalation'\n },\n {\n display: 'cancel',\n value: 'cancel'\n },\n {\n display: 'compensation',\n value: 'compensation'\n },\n {\n display: 'conditional',\n value: 'conditional'\n },\n {\n display: 'link',\n value: 'link'\n },\n {\n display: 'signal',\n value: 'signal'\n },\n {\n display: 'terminate',\n value: 'terminate'\n },\n {\n display: 'multiple',\n value: 'multiple'\n },\n {\n display: 'parallel multiple',\n value: 'parallel-multiple'\n }\n ]\n }\n },\n {\n type: 'checkbox',\n label: 'interrupting',\n name: 'interrupting'\n }\n ],\n help: '/bpmn/event/event'\n}\n\nexport default class BPMNEvent extends BPMNControlBase {\n private imageElement?: HTMLImageElement\n\n static get nature() {\n return NATURE\n }\n\n get textBounds(): BOUNDS {\n var { left, top, width, height } = this.bounds\n var { paddingTop, paddingLeft, paddingRight } = this.state\n\n paddingTop ||= 0\n paddingLeft ||= 0\n paddingRight ||= 0\n\n return {\n left: left + paddingLeft,\n top: top + paddingTop + height + 10,\n width: Math.max(width - paddingLeft - paddingRight, 0),\n height: 0\n }\n }\n\n render(ctx: CanvasRenderingContext2D) {\n const { left, top, width, height } = this.bounds\n const { eventType, interrupting } = this.state\n const cx = width / 2\n const cy = height / 2\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n var lineWidth = 2\n\n switch (eventType) {\n case 'intermediate':\n lineWidth = 1\n ctx.ellipse(cx, cy, width / 2, height / 2, 0, 0, 2 * Math.PI)\n ctx.moveTo(width / 2 + width / 2.5, height / 2)\n ctx.ellipse(cx, cy, width / 2.5, height / 2.5, 0, 0, 2 * Math.PI)\n break\n\n case 'end':\n lineWidth = 5\n ctx.ellipse(cx, cy, width / 2 - 1.5, height / 2 - 1.5, 0, 0, 2 * Math.PI)\n break\n\n case 'start':\n default:\n ctx.ellipse(cx, cy, width / 2, height / 2, 0, 0, 2 * Math.PI)\n break\n }\n\n ctx.translate(-left, -top)\n\n this.drawFill(ctx)\n\n this.drawStroke(ctx, {\n lineWidth,\n lineDash: interrupting ? 'round-dot' : 'solid'\n })\n\n ctx.beginPath()\n\n const image = this.getImageElement()\n if (image) {\n this.drawImage(ctx, image, left + width / 6, top + height / 6, (width * 2) / 3, (height * 2) / 3)\n }\n }\n\n onchange(after: Properties, before: Properties) {\n if ('marker' in after || 'strokeStyle' in after) {\n // Since strokeStyle affects the image, the image is redrawn according to the change of strokeStyle.\n delete this.imageElement\n this.invalidate()\n }\n }\n\n getImageElement(): HTMLImageElement | undefined {\n if (!this.imageElement) {\n const { marker, strokeStyle } = this.state\n\n if (!marker) {\n return\n }\n\n const src = IMAGES[marker]\n if (!src) {\n return\n }\n\n this.imageElement = new Image()\n this.imageElement.src =\n 'data:image/svg+xml;charset=UTF-8;base64,' + btoa(src.replace(/{{strokeColor}}/g, strokeStyle))\n }\n\n return this.imageElement\n }\n}\n\nComponent.register('bpmn-event', BPMNEvent)\n\nconst IMAGES: { [type: string]: string } = {\n message: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <path class=\"st0\" d=\"M29.5,10.3c0-1.3-1.1-2.4-2.4-2.4H7.9c-1.3,0-2.4,1.1-2.4,2.4v14.4c0,1.3,1.1,2.4,2.4,2.4h19.2c1.3,0,2.4-1.1,2.4-2.4V10.3z\n M27.1,9.3l-9.6,7l-9.6-7H27.1z M28.1,25.7H6.9v-16l10.6,8l10.6-8V25.7z\"/>\n </svg>\n `,\n 'message-fill': `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <path d=\"M27.1,7.9H7.9c-1.3,0-2.4,1.1-2.4,2.4l0,14.4c0,1.3,1.1,2.4,2.4,2.4h19.2c1.3,0,2.4-1.1,2.4-2.4V10.3\n C29.5,9,28.4,7.9,27.1,7.9z M27.1,12.7l-9.6,6l-9.6-6v-2.4l9.6,6l9.6-6V12.7z\"/>\n </svg>\n `,\n timer: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <g>\n <g id=\"XMLID_807_\">\n <path class=\"st0\" d=\"M17.5,9.6c0.3,0,0.6-0.3,0.6-0.6V7.2c0-0.3-0.3-0.6-0.6-0.6c-0.3,0-0.6,0.3-0.6,0.6V9C16.9,9.3,17.2,9.6,17.5,9.6z\"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M7.4,18.2h1.8c0.3,0,0.6-0.3,0.6-0.6c0-0.3-0.3-0.6-0.6-0.6H7.4c-0.3,0-0.6,0.3-0.6,0.6C6.8,18,7,18.2,7.4,18.2z\"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M17.5,28.5c0.3,0,0.6-0.3,0.6-0.6v-1.8c0-0.3-0.3-0.6-0.6-0.6c-0.3,0-0.6,0.3-0.6,0.6v1.8C16.9,28.2,17.2,28.5,17.5,28.5z\n \"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M25.9,18.2h1.8c0.3,0,0.6-0.3,0.6-0.6c0-0.3-0.3-0.6-0.6-0.6h-1.8c-0.3,0-0.6,0.3-0.6,0.6C25.3,18,25.5,18.2,25.9,18.2z\"\n />\n </g>\n <g>\n <path class=\"st0\" d=\"M13.2,10.9c0.1,0,0.2,0,0.3-0.1c0.3-0.2,0.4-0.5,0.2-0.8l-0.9-1.5c-0.2-0.3-0.5-0.4-0.8-0.2c-0.3,0.2-0.4,0.5-0.2,0.8\n l0.9,1.5C12.8,10.8,13,10.9,13.2,10.9z\"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M9,23.5c0.1,0,0.2,0,0.3-0.1l1.5-0.9c0.3-0.2,0.4-0.5,0.2-0.8c-0.2-0.3-0.5-0.4-0.8-0.2l-1.5,0.9\n c-0.3,0.2-0.4,0.5-0.2,0.8C8.6,23.4,8.8,23.5,9,23.5z\"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M22.6,27.2c0.1,0,0.2,0,0.3-0.1c0.3-0.2,0.4-0.5,0.2-0.8l-0.9-1.5c-0.2-0.3-0.5-0.4-0.8-0.2c-0.3,0.2-0.4,0.5-0.2,0.8\n l0.9,1.5C22.2,27.1,22.4,27.2,22.6,27.2z\"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M25.1,14.5c0.1,0,0.2,0,0.3-0.1l1.5-0.9c0.3-0.2,0.4-0.5,0.2-0.8c-0.2-0.3-0.5-0.4-0.8-0.2l-1.5,0.9\n c-0.3,0.2-0.4,0.5-0.2,0.8C24.7,14.4,24.9,14.5,25.1,14.5z\"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M10,13.8c0.2,0,0.4-0.1,0.5-0.3c0.2-0.3,0.1-0.7-0.2-0.8l-1.5-0.9c-0.3-0.2-0.7-0.1-0.8,0.2c-0.2,0.3-0.1,0.7,0.2,0.8\n l1.5,0.9C9.8,13.8,9.9,13.8,10,13.8z\"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M12.4,27.1c0.2,0,0.4-0.1,0.5-0.3l0.9-1.5c0.2-0.3,0.1-0.7-0.2-0.8c-0.3-0.2-0.7-0.1-0.8,0.2l-0.9,1.5\n c-0.2,0.3-0.1,0.7,0.2,0.8C12.2,27.1,12.3,27.1,12.4,27.1z\"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M26,23.5c0.2,0,0.4-0.1,0.5-0.3c0.2-0.3,0.1-0.7-0.2-0.8l-1.5-0.9c-0.3-0.2-0.7-0.1-0.8,0.2c-0.2,0.3-0.1,0.7,0.2,0.8\n l1.5,0.9C25.8,23.5,25.9,23.5,26,23.5z\"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M21.8,10.8c0.2,0,0.4-0.1,0.5-0.3L23.2,9c0.2-0.3,0.1-0.7-0.2-0.8c-0.3-0.2-0.7-0.1-0.8,0.2l-0.9,1.5\n c-0.2,0.3-0.1,0.7,0.2,0.8C21.6,10.8,21.7,10.8,21.8,10.8z\"/>\n </g>\n <g id=\"XMLID_806_\">\n <path class=\"st0\" d=\"M17.5,17.7c0.4,0,0.7-0.3,0.7-0.7v-5.6c0-0.4-0.3-0.7-0.7-0.7c-0.4,0-0.7,0.3-0.7,0.7V17C16.8,17.4,17.1,17.7,17.5,17.7z\"\n />\n </g>\n <g id=\"XMLID_805_\">\n <path class=\"st0\" d=\"M17.5,18.3h3.9c0.4,0,0.7-0.3,0.7-0.7c0-0.4-0.3-0.7-0.7-0.7h-3.9c-0.4,0-0.7,0.3-0.7,0.7C16.8,17.9,17.1,18.3,17.5,18.3z\n \"/>\n </g>\n <g>\n <path class=\"st0\" d=\"M17.5,7.2c5.7,0,10.2,4.6,10.2,10.2s-4.6,10.2-10.2,10.2S7.2,23.2,7.2,17.5S11.8,7.2,17.5,7.2 M17.5,6.5\n c-6.1,0-11,4.9-11,11s4.9,11,11,11s11-4.9,11-11S23.6,6.5,17.5,6.5L17.5,6.5z\"/>\n </g>\n </g>\n </svg>\n `,\n error: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <g>\n <path class=\"st0\" d=\"M9.7,10.3l11.1,6.1c0.2,0.1,0.5,0.2,0.7,0.2c0.4,0,0.7-0.1,1-0.4l4.9-4.3l-2,12.7l-10.1-6c-0.2-0.1-0.5-0.2-0.8-0.2\n c-0.3,0-0.7,0.1-0.9,0.3l-6,4.7L9.7,10.3 M29.5,8l-8,7.1L8.5,8l-3,19l9-7.1l12,7.1L29.5,8L29.5,8z\"/>\n </g>\n </svg>\n `,\n 'error-fill': `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <g>\n <polygon class=\"st0\" points=\"26.5,27 29.5,8 21.5,15.1 8.5,8 5.5,27 14.5,19.9 \t\"/>\n </g>\n </svg>\n `,\n escalation: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:none;stroke:{{strokeColor}};stroke-miterlimit:10;}\n </style>\n <polygon class=\"st0\" points=\"17.5,19.9 7.5,27 17.5,8 27.5,27 \"/>\n </svg>\n `,\n 'escalation-fill': `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <polygon class=\"st0\" points=\"17.5,19.9 7.5,27 17.5,8 27.5,27 \"/>\n </svg>\n `,\n cancel: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <path class=\"st0\" d=\"M24.4,8.8l1.8,1.8l-6.9,6.9l6.9,6.9l-1.8,1.8l-6.9-6.9l-6.9,6.9l-1.8-1.8l6.9-6.9l-6.9-6.9l1.8-1.8l6.9,6.9L24.4,8.8\n\t\t M24.4,7.4l-0.7,0.7l-6.2,6.2l-6.2-6.2l-0.7-0.7L9.9,8.1L8.1,9.9l-0.7,0.7l0.7,0.7l6.2,6.2l-6.2,6.2l-0.7,0.7l0.7,0.7l1.8,1.8\n\t\tl0.7,0.7l0.7-0.7l6.2-6.2l6.2,6.2l0.7,0.7l0.7-0.7l1.8-1.8l0.7-0.7l-0.7-0.7l-6.2-6.2l6.2-6.2l0.7-0.7l-0.7-0.7l-1.8-1.8L24.4,7.4\n\t\tL24.4,7.4z\"/>\n </svg>\n `,\n 'cancel-fill': `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <g>\n <rect class=\"st0\" x=\"6.5\" y=\"16.3\" transform=\"matrix(0.7071 -0.7071 0.7071 0.7071 -7.2487 17.5)\" width=\"22\" height=\"2.5\"/>\n </g>\n <g>\n <rect class=\"st0\" x=\"16.2\" y=\"6.5\" transform=\"matrix(0.7071 -0.7071 0.7071 0.7071 -7.2487 17.5)\" width=\"2.5\" height=\"22\"/>\n </g>\n </svg>\n `,\n compensation: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <path class=\"st0\" d=\"M17,10.4v14.2l-7.1-7.1L17,10.4 M18,8l-9.5,9.5L18,27V8L18,8z M8.5,17.5L8.5,17.5L8.5,17.5L8.5,17.5L8.5,17.5z\"/>\n <path class=\"st0\" d=\"M25.5,10.4v14.2l-7.1-7.1L25.5,10.4 M26.5,8L17,17.5l9.5,9.5V8L26.5,8z M17,17.5L17,17.5L17,17.5L17,17.5L17,17.5z\"/>\n </svg>\n `,\n 'compensation-fill': `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <polygon class=\"st0\" points=\"8.5,17.5 18,8 18,27 8.5,17.5 \t\t\"/>\n <polygon class=\"st0\" points=\"17,17.5 26.5,8 26.5,27 17,17.5 \t\t\"/>\n </svg>\n `,\n conditional: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <g>\n <path class=\"st0\" d=\"M28.6,11.1v14.8H6.5V11.1h20.3 M26.8,8H8.2c-1.5,0-2.7,1-2.7,2.1v15.8c0,1.2,1.2,1.1,2.7,1.1h18.7c1.5,0,2.7,0.1,2.7-1.1\n V10.1C29.5,8.9,28.3,8,26.8,8L26.8,8z\"/>\n </g>\n <path class=\"st0\" d=\"M27.5,23.5h-20v-1h20V23.5z M27.5,17.8h-20v-1h20V17.8z M27.5,14.9h-20v-1h20V14.9z M27.5,20.6h-20v-1h20V20.6z\"/>\n </svg>\n `,\n link: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:none;stroke:{{strokeColor}};stroke-miterlimit:10;}\n </style>\n <path class=\"st0\" d=\"M19,13.8V8l9.5,9.5L19,27v-5.8H6.5v-7.5H19z\"/>\n </svg>\n `,\n 'link-fill': `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <path class=\"st0\" d=\"M19,13.8V8l9.5,9.5L19,27v-5.8H6.5v-7.5H19z\"/>\n </svg>\n `,\n signal: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:none;stroke:{{strokeColor}};stroke-miterlimit:10;}\n </style>\n <polygon class=\"st0\" points=\"17.5,26.9 7.5,27 17.5,8 27.5,27 \"/>\n </svg>\n `,\n 'signal-fill': `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <polygon class=\"st0\" points=\"17.5,26.9 7.5,27 17.5,8 27.5,27 \"/>\n </svg>\n `,\n terminate: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <circle class=\"st0\" cx=\"17.5\" cy=\"17.5\" r=\"11.5\"/>\n </svg>\n `,\n multiple: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{stroke:{{strokeColor}};}\n </style>\n <path class=\"st0\" d=\"M17.5,9.2l8.8,6.4L23,26H12L8.7,15.6L17.5,9.2 M17.5,8l-10,7.3L11.3,27h12.4l3.8-11.8L17.5,8L17.5,8z\"/>\n </svg>\n `,\n 'multiple-fill': `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <polygon class=\"st0\" points=\"17.5,8 7.5,15.3 11.3,27 23.7,27 27.5,15.3 \t\"/>\n </svg>\n `,\n 'parallel-multiple': `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:none;stroke:{{strokeColor}};stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}\n .st1{fill:{{strokeColor}};}\n </style>\n <path class=\"st1\" d=\"M18.4,10v6.6H25l0,1.7h-6.6V25h-1.7l0-6.6H10v-1.7h6.6V10H18.4 M19.4,9h-1h-1.7h-1v1v5.6H10H9v1v1.7v1h1h5.6l0,5.6v1h1h1.7\n\t\th1v-1v-5.6H25h1l0-1l0-1.7l0-1h-1h-5.6V10V9L19.4,9z\"/>\n <circle class=\"st0\" cx=\"17.5\" cy=\"17.5\" r=\"12\"/>\n </svg>\n `\n}\n"]}
@@ -175,6 +175,7 @@ export default class BPMNExpandedSubprocess extends BPMNContainerBase {
175
175
  ctx.arcTo(LINEGAP, height - LINEGAP, LINEGAP, LINEGAP, radius);
176
176
  ctx.arcTo(LINEGAP, LINEGAP, width - LINEGAP, LINEGAP, radius);
177
177
  }
178
+ ctx.translate(-left, -top);
178
179
  this.drawFill(ctx);
179
180
  if (callActivity) {
180
181
  this.drawStroke(ctx, { lineWidth: 5 });
@@ -185,7 +186,6 @@ export default class BPMNExpandedSubprocess extends BPMNContainerBase {
185
186
  lineDash: interrupting ? 'dash' : 'solid'
186
187
  });
187
188
  }
188
- ctx.translate(-left, -top);
189
189
  }
190
190
  get textHidden() {
191
191
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"bpmn-expanded-subprocess.js","sourceRoot":"","sources":["../src/bpmn-expanded-subprocess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAGlD,OAAO,iBAAmD,MAAM,4BAA4B,CAAA;AAE5F,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,MAAM;SACd;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,cAAc;SACrB;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,aAAa;SACpB;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,cAAc;YACrB,IAAI,EAAE,cAAc;SACrB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,cAAc;YACpB,QAAQ,EAAE;gBACR,OAAO,EAAE;oBACP;wBACE,OAAO,EAAE,EAAE;wBACX,KAAK,EAAE,EAAE;qBACV;oBACD;wBACE,OAAO,EAAE,SAAS;wBAClB,KAAK,EAAE,SAAS;qBACjB;oBACD;wBACE,OAAO,EAAE,OAAO;wBAChB,KAAK,EAAE,OAAO;qBACf;oBACD;wBACE,OAAO,EAAE,OAAO;wBAChB,KAAK,EAAE,OAA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,EAAE,sBAAsB,CAAC,CAAA","sourcesContent":["import { Component } from '@hatiolab/things-scene'\nimport { over } from 'lodash'\n\nimport BPMNContainerBase, { DIRECTION, INOUT, NODE, FLOW } from './base/bpmn-container-base'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [\n {\n type: 'string',\n name: 'name',\n label: 'name'\n },\n {\n type: 'checkbox',\n label: 'call-activity',\n name: 'callActivity'\n },\n {\n type: 'checkbox',\n label: 'transaction',\n name: 'transaction'\n },\n {\n type: 'checkbox',\n label: 'interrupting',\n name: 'interrupting'\n },\n {\n type: 'select',\n label: 'trigger-event',\n name: 'triggerEvent',\n property: {\n options: [\n {\n display: '',\n value: ''\n },\n {\n display: 'message',\n value: 'message'\n },\n {\n display: 'timer',\n value: 'timer'\n },\n {\n display: 'error',\n value: 'error'\n },\n {\n display: 'escalation',\n value: 'escalation'\n },\n {\n display: 'cancel',\n value: 'cancel'\n },\n {\n display: 'compensation',\n value: 'compensation'\n },\n {\n display: 'conditional',\n value: 'conditional'\n },\n {\n display: 'link',\n value: 'link'\n },\n {\n display: 'signal',\n value: 'signal'\n },\n {\n display: 'terminate',\n value: 'terminate'\n },\n {\n display: 'multiple',\n value: 'multiple'\n },\n {\n display: 'parallel multiple',\n value: 'parallel-multiple'\n }\n ]\n }\n },\n {\n // TODO this property might be an array\n type: 'select',\n label: 'boundary-event',\n name: 'boundaryEvent',\n property: {\n options: [\n {\n display: '',\n value: ''\n },\n {\n display: 'message',\n value: 'message'\n },\n {\n display: 'timer',\n value: 'timer'\n },\n {\n display: 'error',\n value: 'error'\n },\n {\n display: 'escalation',\n value: 'escalation'\n },\n {\n display: 'cancel',\n value: 'cancel'\n },\n {\n display: 'compensation',\n value: 'compensation'\n },\n {\n display: 'conditional',\n value: 'conditional'\n },\n {\n display: 'link',\n value: 'link'\n },\n {\n display: 'signal',\n value: 'signal'\n },\n {\n display: 'terminate',\n value: 'terminate'\n },\n {\n display: 'multiple',\n value: 'multiple'\n },\n {\n display: 'parallel multiple',\n value: 'parallel-multiple'\n }\n ]\n }\n }\n ],\n help: '/bpmn/expanded-subprocess/expanded-subprocess'\n}\n\nexport default class BPMNExpandedSubprocess extends BPMNContainerBase {\n get nature() {\n return NATURE\n }\n\n render(ctx: CanvasRenderingContext2D) {\n const { left, top, width, height } = this.bounds\n const { callActivity, interrupting, transaction } = this.state\n var radius = 9\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n ctx.moveTo(radius, 0)\n ctx.arcTo(width, 0, width, height, radius)\n ctx.arcTo(width, height, 0, height, radius)\n ctx.arcTo(0, height, 0, 0, radius)\n ctx.arcTo(0, 0, width, 0, radius)\n\n if (transaction) {\n const LINEGAP = 3\n radius -= LINEGAP\n\n ctx.moveTo(radius + LINEGAP, LINEGAP)\n ctx.arcTo(width - LINEGAP, LINEGAP, width - LINEGAP, height - LINEGAP, radius)\n ctx.arcTo(width - LINEGAP, height - LINEGAP, LINEGAP, height, radius)\n ctx.arcTo(LINEGAP, height - LINEGAP, LINEGAP, LINEGAP, radius)\n ctx.arcTo(LINEGAP, LINEGAP, width - LINEGAP, LINEGAP, radius)\n }\n\n this.drawFill(ctx)\n\n if (callActivity) {\n this.drawStroke(ctx, { lineWidth: 5 })\n } else {\n this.drawStroke(ctx, {\n lineWidth: transaction ? 1 : 2,\n lineDash: interrupting ? 'dash' : 'solid'\n })\n }\n\n ctx.translate(-left, -top)\n }\n\n get textHidden() {\n return false\n }\n}\n\nComponent.register('bpmn-expanded-subprocess', BPMNExpandedSubprocess)\n"]}
1
+ {"version":3,"file":"bpmn-expanded-subprocess.js","sourceRoot":"","sources":["../src/bpmn-expanded-subprocess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAGlD,OAAO,iBAAmD,MAAM,4BAA4B,CAAA;AAE5F,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,KAAK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MAAM,CAAC,CAAA;YAC9D,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,GAAG,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAA;SAC9D;QAED,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAA;QAE1B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;QAElB,IAAI,YAAY,EAAE;YAChB,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAA;SACvC;aAAM;YACL,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE;gBACnB,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC9B,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;aAC1C,CAAC,CAAA;SACH;IACH,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,KAAK,CAAA;IACd,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,0BAA0B,EAAE,sBAAsB,CAAC,CAAA","sourcesContent":["import { Component } from '@hatiolab/things-scene'\nimport { over } from 'lodash'\n\nimport BPMNContainerBase, { DIRECTION, INOUT, NODE, FLOW } from './base/bpmn-container-base'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [\n {\n type: 'string',\n name: 'name',\n label: 'name'\n },\n {\n type: 'checkbox',\n label: 'call-activity',\n name: 'callActivity'\n },\n {\n type: 'checkbox',\n label: 'transaction',\n name: 'transaction'\n },\n {\n type: 'checkbox',\n label: 'interrupting',\n name: 'interrupting'\n },\n {\n type: 'select',\n label: 'trigger-event',\n name: 'triggerEvent',\n property: {\n options: [\n {\n display: '',\n value: ''\n },\n {\n display: 'message',\n value: 'message'\n },\n {\n display: 'timer',\n value: 'timer'\n },\n {\n display: 'error',\n value: 'error'\n },\n {\n display: 'escalation',\n value: 'escalation'\n },\n {\n display: 'cancel',\n value: 'cancel'\n },\n {\n display: 'compensation',\n value: 'compensation'\n },\n {\n display: 'conditional',\n value: 'conditional'\n },\n {\n display: 'link',\n value: 'link'\n },\n {\n display: 'signal',\n value: 'signal'\n },\n {\n display: 'terminate',\n value: 'terminate'\n },\n {\n display: 'multiple',\n value: 'multiple'\n },\n {\n display: 'parallel multiple',\n value: 'parallel-multiple'\n }\n ]\n }\n },\n {\n // TODO this property might be an array\n type: 'select',\n label: 'boundary-event',\n name: 'boundaryEvent',\n property: {\n options: [\n {\n display: '',\n value: ''\n },\n {\n display: 'message',\n value: 'message'\n },\n {\n display: 'timer',\n value: 'timer'\n },\n {\n display: 'error',\n value: 'error'\n },\n {\n display: 'escalation',\n value: 'escalation'\n },\n {\n display: 'cancel',\n value: 'cancel'\n },\n {\n display: 'compensation',\n value: 'compensation'\n },\n {\n display: 'conditional',\n value: 'conditional'\n },\n {\n display: 'link',\n value: 'link'\n },\n {\n display: 'signal',\n value: 'signal'\n },\n {\n display: 'terminate',\n value: 'terminate'\n },\n {\n display: 'multiple',\n value: 'multiple'\n },\n {\n display: 'parallel multiple',\n value: 'parallel-multiple'\n }\n ]\n }\n }\n ],\n help: '/bpmn/expanded-subprocess/expanded-subprocess'\n}\n\nexport default class BPMNExpandedSubprocess extends BPMNContainerBase {\n get nature() {\n return NATURE\n }\n\n render(ctx: CanvasRenderingContext2D) {\n const { left, top, width, height } = this.bounds\n const { callActivity, interrupting, transaction } = this.state\n var radius = 9\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n ctx.moveTo(radius, 0)\n ctx.arcTo(width, 0, width, height, radius)\n ctx.arcTo(width, height, 0, height, radius)\n ctx.arcTo(0, height, 0, 0, radius)\n ctx.arcTo(0, 0, width, 0, radius)\n\n if (transaction) {\n const LINEGAP = 3\n radius -= LINEGAP\n\n ctx.moveTo(radius + LINEGAP, LINEGAP)\n ctx.arcTo(width - LINEGAP, LINEGAP, width - LINEGAP, height - LINEGAP, radius)\n ctx.arcTo(width - LINEGAP, height - LINEGAP, LINEGAP, height, radius)\n ctx.arcTo(LINEGAP, height - LINEGAP, LINEGAP, LINEGAP, radius)\n ctx.arcTo(LINEGAP, LINEGAP, width - LINEGAP, LINEGAP, radius)\n }\n\n ctx.translate(-left, -top)\n\n this.drawFill(ctx)\n\n if (callActivity) {\n this.drawStroke(ctx, { lineWidth: 5 })\n } else {\n this.drawStroke(ctx, {\n lineWidth: transaction ? 1 : 2,\n lineDash: interrupting ? 'dash' : 'solid'\n })\n }\n }\n\n get textHidden() {\n return false\n }\n}\n\nComponent.register('bpmn-expanded-subprocess', BPMNExpandedSubprocess)\n"]}
@@ -67,14 +67,14 @@ export default class BPMNGateway extends BPMNControlBase {
67
67
  ctx.lineTo(width / 2, height);
68
68
  ctx.lineTo(0, height / 2);
69
69
  ctx.lineTo(width / 2, 0);
70
+ ctx.translate(-left, -top);
70
71
  this.drawFill(ctx);
71
72
  this.drawStroke(ctx);
72
73
  ctx.beginPath();
73
74
  const image = this.getImageElement();
74
75
  if (image) {
75
- this.drawImage(ctx, image, width / 6, height / 6, (width * 2) / 3, (height * 2) / 3);
76
+ this.drawImage(ctx, image, left + width / 6, top + height / 6, (width * 2) / 3, (height * 2) / 3);
76
77
  }
77
- ctx.translate(-left, -top);
78
78
  }
79
79
  onchange(after, before) {
80
80
  if ('gatewayType' in after || 'strokeStyle' in after) {
@@ -1 +1 @@
1
- {"version":3,"file":"bpmn-gateway.js","sourceRoot":"","sources":["../src/bpmn-gateway.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,SAAS,EAAc,MAAM,wBAAwB,CAAA;AAEtE,OAAO,eAAe,MAAM,0BAA0B,CAAA;AAEtD,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,cAAc;YACrB,IAAI,E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AE,WAAW,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;YAE/C,IAAI,CAAC,WAAW,EAAE;gBAChB,OAAM;aACP;YAED,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;YAC/B,IAAI,CAAC,GAAG,EAAE;gBACR,OAAM;aACP;YAED,IAAI,CAAC,YAAY,GAAG,IAAI,KAAK,EAAE,CAAA;YAC/B,IAAI,CAAC,YAAY,CAAC,GAAG;gBACnB,0CAA0C,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC,CAAA;SAClG;QAED,OAAO,IAAI,CAAC,YAAY,CAAA;IAC1B,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,CAAA;AAE/C,MAAM,MAAM,GAA+B;IACzC,SAAS,EAAE;;;;;;;;;GASV;IACD,SAAS,EAAE;;;;;;;;;GASV;IACD,QAAQ,EAAE;;;;;;;;;GAST;IACD,OAAO,EAAE;;;;;;;;;;;GAWR;IACD,aAAa,EAAE;;;;;;;;;;;;GAYd;CACF,CAAA","sourcesContent":["import { BOUNDS, Component, Properties } from '@hatiolab/things-scene'\n\nimport BPMNControlBase from './base/bpmn-control-base'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [\n {\n type: 'select',\n label: 'gateway-type',\n name: 'gatewayType',\n property: {\n options: [\n {\n display: '',\n value: ''\n },\n {\n display: 'exclusive',\n value: 'exclusive'\n },\n {\n display: 'inclusive',\n value: 'inclusive'\n },\n {\n display: 'complex',\n value: 'complex'\n },\n {\n display: 'event based',\n value: 'event-based'\n },\n {\n display: 'parallel',\n value: 'parallel'\n }\n ]\n }\n }\n ],\n help: '/bpmn/gateway/gateway'\n}\n\nexport default class BPMNGateway extends BPMNControlBase {\n private imageElement?: HTMLImageElement\n\n static get nature() {\n return NATURE\n }\n\n get textBounds(): BOUNDS {\n var { left, top, width, height } = this.bounds\n var { paddingTop, paddingLeft, paddingRight } = this.state\n\n paddingTop ||= 0\n paddingLeft ||= 0\n paddingRight ||= 0\n\n return {\n left: left + paddingLeft,\n top: top + paddingTop + height + 10,\n width: Math.max(width - paddingLeft - paddingRight, 0),\n height: 0\n }\n }\n\n render(ctx: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n ctx.moveTo(width / 2, 0)\n ctx.lineTo(width, height / 2)\n ctx.lineTo(width / 2, height)\n ctx.lineTo(0, height / 2)\n ctx.lineTo(width / 2, 0)\n\n this.drawFill(ctx)\n this.drawStroke(ctx)\n\n ctx.beginPath()\n\n const image = this.getImageElement()\n if (image) {\n this.drawImage(ctx, image, width / 6, height / 6, (width * 2) / 3, (height * 2) / 3)\n }\n\n ctx.translate(-left, -top)\n }\n\n onchange(after: Properties, before: Properties) {\n if ('gatewayType' in after || 'strokeStyle' in after) {\n delete this.imageElement\n }\n }\n\n getImageElement(): HTMLImageElement | undefined {\n if (!this.imageElement) {\n const { gatewayType, strokeStyle } = this.state\n\n if (!gatewayType) {\n return\n }\n\n const src = IMAGES[gatewayType]\n if (!src) {\n return\n }\n\n this.imageElement = new Image()\n this.imageElement.src =\n 'data:image/svg+xml;charset=UTF-8;base64,' + btoa(src.replace(/{{strokeColor}}/g, strokeStyle))\n }\n\n return this.imageElement\n }\n}\n\nComponent.register('bpmn-gateway', BPMNGateway)\n\nconst IMAGES: { [type: string]: string } = {\n inclusive: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <path class=\"st0\" d=\"M17.5,8.5c5,0,9,4,9,9s-4,9-9,9s-9-4-9-9S12.5,8.5,17.5,8.5 M17.5,6C11.1,6,6,11.1,6,17.5S11.1,29,17.5,29S29,23.9,29,17.5\n\t\tS23.9,6,17.5,6L17.5,6z\"/>\n </svg>\n `,\n exclusive: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <rect class=\"st0\" x=\"6.5\" y=\"15.8\" transform=\"matrix(0.7071 -0.7071 0.7071 0.7071 -7.2487 17.5)\" width=\"22\" height=\"3.5\"/>\n <rect class=\"st0\" x=\"15.8\" y=\"6.5\" transform=\"matrix(0.7071 -0.7071 0.7071 0.7071 -7.2487 17.5)\" width=\"3.5\" height=\"22\"/>\n </svg>\n `,\n parallel: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <rect class=\"st0\" x=\"16.3\" y=\"6.5\" width=\"3.5\" height=\"22\"/>\n <rect class=\"st0\" x=\"6.5\" y=\"16.2\" width=\"22\" height=\"3.5\"/>\n </svg>\n `,\n complex: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <rect class=\"st0\" x=\"16.2\" y=\"6.5\" width=\"3.5\" height=\"22\"/>\n <rect class=\"st0\" x=\"6.5\" y=\"16.2\" transform=\"matrix(0.7071 -0.7071 0.7071 0.7071 -7.2487 17.5)\" width=\"22\" height=\"3.5\"/>\n <rect class=\"st0\" x=\"16.2\" y=\"6.5\" transform=\"matrix(0.7072 -0.707 0.707 0.7072 -7.2487 17.4966)\" width=\"3.5\" height=\"22\"/>\n <rect class=\"st0\" x=\"6.5\" y=\"16.2\" width=\"22\" height=\"3.5\"/>\n </svg>\n `,\n 'event-based': `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <path class=\"st0\" d=\"M17.5,6.2c6.2,0,11.2,5,11.2,11.2s-5,11.2-11.2,11.2s-11.2-5-11.2-11.2S11.3,6.2,17.5,6.2 M17.5,5.5c-6.6,0-12,5.4-12,12\n s5.4,12,12,12s12-5.4,12-12S24.1,5.5,17.5,5.5L17.5,5.5z\"/>\n <path class=\"st0\" d=\"M17.5,8.2c5.1,0,9.2,4.1,9.2,9.2s-4.1,9.2-9.2,9.2s-9.2-4.1-9.2-9.2S12.4,8.2,17.5,8.2 M17.5,7.5c-5.5,0-10,4.5-10,10\n s4.5,10,10,10s10-4.5,10-10S23,7.5,17.5,7.5L17.5,7.5z\"/>\n <path class=\"st0\" d=\"M17.5,11.7l5.7,4.1L21,22.5h-7l-2.2-6.7L17.5,11.7 M17.5,10l-7.3,5.3l2.8,8.6h9l2.8-8.6L17.5,10L17.5,10z\"/>\n </svg>\n `\n}\n"]}
1
+ {"version":3,"file":"bpmn-gateway.js","sourceRoot":"","sources":["../src/bpmn-gateway.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,SAAS,EAAc,MAAM,wBAAwB,CAAA;AAEtE,OAAO,eAAe,MAAM,0BAA0B,CAAA;AAEtD,MAA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E,MAAkB;QAC5C,IAAI,aAAa,IAAI,KAAK,IAAI,aAAa,IAAI,KAAK,EAAE;YACpD,OAAO,IAAI,CAAC,YAAY,CAAA;SACzB;IACH,CAAC;IAED,eAAe;QACb,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACtB,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;YAE/C,IAAI,CAAC,WAAW,EAAE;gBAChB,OAAM;aACP;YAED,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;YAC/B,IAAI,CAAC,GAAG,EAAE;gBACR,OAAM;aACP;YAED,IAAI,CAAC,YAAY,GAAG,IAAI,KAAK,EAAE,CAAA;YAC/B,IAAI,CAAC,YAAY,CAAC,GAAG;gBACnB,0CAA0C,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC,CAAA;SAClG;QAED,OAAO,IAAI,CAAC,YAAY,CAAA;IAC1B,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,CAAA;AAE/C,MAAM,MAAM,GAA+B;IACzC,SAAS,EAAE;;;;;;;;;GASV;IACD,SAAS,EAAE;;;;;;;;;GASV;IACD,QAAQ,EAAE;;;;;;;;;GAST;IACD,OAAO,EAAE;;;;;;;;;;;GAWR;IACD,aAAa,EAAE;;;;;;;;;;;;GAYd;CACF,CAAA","sourcesContent":["import { BOUNDS, Component, Properties } from '@hatiolab/things-scene'\n\nimport BPMNControlBase from './base/bpmn-control-base'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [\n {\n type: 'select',\n label: 'gateway-type',\n name: 'gatewayType',\n property: {\n options: [\n {\n display: '',\n value: ''\n },\n {\n display: 'exclusive',\n value: 'exclusive'\n },\n {\n display: 'inclusive',\n value: 'inclusive'\n },\n {\n display: 'complex',\n value: 'complex'\n },\n {\n display: 'event based',\n value: 'event-based'\n },\n {\n display: 'parallel',\n value: 'parallel'\n }\n ]\n }\n }\n ],\n help: '/bpmn/gateway/gateway'\n}\n\nexport default class BPMNGateway extends BPMNControlBase {\n private imageElement?: HTMLImageElement\n\n static get nature() {\n return NATURE\n }\n\n get textBounds(): BOUNDS {\n var { left, top, width, height } = this.bounds\n var { paddingTop, paddingLeft, paddingRight } = this.state\n\n paddingTop ||= 0\n paddingLeft ||= 0\n paddingRight ||= 0\n\n return {\n left: left + paddingLeft,\n top: top + paddingTop + height + 10,\n width: Math.max(width - paddingLeft - paddingRight, 0),\n height: 0\n }\n }\n\n render(ctx: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n ctx.moveTo(width / 2, 0)\n ctx.lineTo(width, height / 2)\n ctx.lineTo(width / 2, height)\n ctx.lineTo(0, height / 2)\n ctx.lineTo(width / 2, 0)\n\n ctx.translate(-left, -top)\n\n this.drawFill(ctx)\n this.drawStroke(ctx)\n\n ctx.beginPath()\n\n const image = this.getImageElement()\n if (image) {\n this.drawImage(ctx, image, left + width / 6, top + height / 6, (width * 2) / 3, (height * 2) / 3)\n }\n }\n\n onchange(after: Properties, before: Properties) {\n if ('gatewayType' in after || 'strokeStyle' in after) {\n delete this.imageElement\n }\n }\n\n getImageElement(): HTMLImageElement | undefined {\n if (!this.imageElement) {\n const { gatewayType, strokeStyle } = this.state\n\n if (!gatewayType) {\n return\n }\n\n const src = IMAGES[gatewayType]\n if (!src) {\n return\n }\n\n this.imageElement = new Image()\n this.imageElement.src =\n 'data:image/svg+xml;charset=UTF-8;base64,' + btoa(src.replace(/{{strokeColor}}/g, strokeStyle))\n }\n\n return this.imageElement\n }\n}\n\nComponent.register('bpmn-gateway', BPMNGateway)\n\nconst IMAGES: { [type: string]: string } = {\n inclusive: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <path class=\"st0\" d=\"M17.5,8.5c5,0,9,4,9,9s-4,9-9,9s-9-4-9-9S12.5,8.5,17.5,8.5 M17.5,6C11.1,6,6,11.1,6,17.5S11.1,29,17.5,29S29,23.9,29,17.5\n\t\tS23.9,6,17.5,6L17.5,6z\"/>\n </svg>\n `,\n exclusive: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <rect class=\"st0\" x=\"6.5\" y=\"15.8\" transform=\"matrix(0.7071 -0.7071 0.7071 0.7071 -7.2487 17.5)\" width=\"22\" height=\"3.5\"/>\n <rect class=\"st0\" x=\"15.8\" y=\"6.5\" transform=\"matrix(0.7071 -0.7071 0.7071 0.7071 -7.2487 17.5)\" width=\"3.5\" height=\"22\"/>\n </svg>\n `,\n parallel: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <rect class=\"st0\" x=\"16.3\" y=\"6.5\" width=\"3.5\" height=\"22\"/>\n <rect class=\"st0\" x=\"6.5\" y=\"16.2\" width=\"22\" height=\"3.5\"/>\n </svg>\n `,\n complex: `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <rect class=\"st0\" x=\"16.2\" y=\"6.5\" width=\"3.5\" height=\"22\"/>\n <rect class=\"st0\" x=\"6.5\" y=\"16.2\" transform=\"matrix(0.7071 -0.7071 0.7071 0.7071 -7.2487 17.5)\" width=\"22\" height=\"3.5\"/>\n <rect class=\"st0\" x=\"16.2\" y=\"6.5\" transform=\"matrix(0.7072 -0.707 0.707 0.7072 -7.2487 17.4966)\" width=\"3.5\" height=\"22\"/>\n <rect class=\"st0\" x=\"6.5\" y=\"16.2\" width=\"22\" height=\"3.5\"/>\n </svg>\n `,\n 'event-based': `\n <svg version=\"1.1\" id=\"Layer_3\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 35 35\" style=\"enable-background:new 0 0 35 35;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <path class=\"st0\" d=\"M17.5,6.2c6.2,0,11.2,5,11.2,11.2s-5,11.2-11.2,11.2s-11.2-5-11.2-11.2S11.3,6.2,17.5,6.2 M17.5,5.5c-6.6,0-12,5.4-12,12\n s5.4,12,12,12s12-5.4,12-12S24.1,5.5,17.5,5.5L17.5,5.5z\"/>\n <path class=\"st0\" d=\"M17.5,8.2c5.1,0,9.2,4.1,9.2,9.2s-4.1,9.2-9.2,9.2s-9.2-4.1-9.2-9.2S12.4,8.2,17.5,8.2 M17.5,7.5c-5.5,0-10,4.5-10,10\n s4.5,10,10,10s10-4.5,10-10S23,7.5,17.5,7.5L17.5,7.5z\"/>\n <path class=\"st0\" d=\"M17.5,11.7l5.7,4.1L21,22.5h-7l-2.2-6.7L17.5,11.7 M17.5,10l-7.3,5.3l2.8,8.6h9l2.8-8.6L17.5,10L17.5,10z\"/>\n </svg>\n `\n}\n"]}
@@ -21,9 +21,9 @@ export default class BPMNGroup extends BPMNContainerBase {
21
21
  ctx.arcTo(width, height, 0, height, radius);
22
22
  ctx.arcTo(0, height, 0, 0, radius);
23
23
  ctx.arcTo(0, 0, width, 0, radius);
24
+ ctx.translate(-left, -top);
24
25
  this.drawFill(ctx);
25
26
  this.drawStroke(ctx);
26
- ctx.translate(-left, -top);
27
27
  }
28
28
  }
29
29
  Component.register('bpmn-group', BPMNGroup);
@@ -1 +1 @@
1
- {"version":3,"file":"bpmn-group.js","sourceRoot":"","sources":["../src/bpmn-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAElD,OAAO,iBAAiB,MAAM,4BAA4B,CAAA;AAE1D,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,mBAAmB;CAC1B,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,iBAAiB;IACtD,MAAM,KAAK,MAAM;QACf,OAAO,MAAM,CAAA;IACf,CAAC;IAED,MAAM,CAAC,GAA6B;QAClC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAE9C,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;QACxB,GAAG,CAAC,SAAS,EAAE,CAAA;QAEf,IAAI,MAAM,GAAG,CAAC,CAAA;QAEd,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;QACrB,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;QAC1C,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;QAC3C,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAA;QAClC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,CAAC,CAAA;QAEjC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;QAClB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;QAEpB,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAA;IAC5B,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA","sourcesContent":["import { Component } from '@hatiolab/things-scene'\n\nimport BPMNContainerBase from './base/bpmn-container-base'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [],\n help: '/bpmn/group/group'\n}\n\nexport default class BPMNGroup extends BPMNContainerBase {\n static get nature() {\n return NATURE\n }\n\n render(ctx: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n var radius = 9\n\n ctx.moveTo(radius, 0)\n ctx.arcTo(width, 0, width, height, radius)\n ctx.arcTo(width, height, 0, height, radius)\n ctx.arcTo(0, height, 0, 0, radius)\n ctx.arcTo(0, 0, width, 0, radius)\n\n this.drawFill(ctx)\n this.drawStroke(ctx)\n\n ctx.translate(-left, -top)\n }\n}\n\nComponent.register('bpmn-group', BPMNGroup)\n"]}
1
+ {"version":3,"file":"bpmn-group.js","sourceRoot":"","sources":["../src/bpmn-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAElD,OAAO,iBAAiB,MAAM,4BAA4B,CAAA;AAE1D,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,mBAAmB;CAC1B,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,iBAAiB;IACtD,MAAM,KAAK,MAAM;QACf,OAAO,MAAM,CAAA;IACf,CAAC;IAED,MAAM,CAAC,GAA6B;QAClC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAE9C,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;QACxB,GAAG,CAAC,SAAS,EAAE,CAAA;QAEf,IAAI,MAAM,GAAG,CAAC,CAAA;QAEd,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;QACrB,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;QAC1C,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;QAC3C,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAA;QAClC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,CAAC,CAAA;QAEjC,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAA;QAE1B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;QAClB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;IACtB,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA","sourcesContent":["import { Component } from '@hatiolab/things-scene'\n\nimport BPMNContainerBase from './base/bpmn-container-base'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [],\n help: '/bpmn/group/group'\n}\n\nexport default class BPMNGroup extends BPMNContainerBase {\n static get nature() {\n return NATURE\n }\n\n render(ctx: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n var radius = 9\n\n ctx.moveTo(radius, 0)\n ctx.arcTo(width, 0, width, height, radius)\n ctx.arcTo(width, height, 0, height, radius)\n ctx.arcTo(0, height, 0, 0, radius)\n ctx.arcTo(0, 0, width, 0, radius)\n\n ctx.translate(-left, -top)\n\n this.drawFill(ctx)\n this.drawStroke(ctx)\n }\n}\n\nComponent.register('bpmn-group', BPMNGroup)\n"]}
@@ -36,9 +36,9 @@ export default class BPMNMessage extends BPMNControlBase {
36
36
  ctx.lineTo(0, 0);
37
37
  ctx.lineTo(width / 2, height / 2);
38
38
  ctx.lineTo(width, 0);
39
+ ctx.translate(-left, -top);
39
40
  this.drawFill(ctx);
40
41
  this.drawStroke(ctx);
41
- ctx.translate(-left, -top);
42
42
  }
43
43
  }
44
44
  Component.register('bpmn-message', BPMNMessage);
@@ -1 +1 @@
1
- {"version":3,"file":"bpmn-message.js","sourceRoot":"","sources":["../src/bpmn-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAE1D,OAAO,eAAe,MAAM,0BAA0B,CAAA;AAEtD,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,uBAAuB;CAC9B,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,eAAe;IACtD,MAAM,KAAK,MAAM;QACf,OAAO,MAAM,CAAA;IACf,CAAC;IAED,IAAI,UAAU;QACZ,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;Q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A;QAEpB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;QAClB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;QAEpB,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAA;IAC5B,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,CAAA","sourcesContent":["import { BOUNDS, Component } from '@hatiolab/things-scene'\n\nimport BPMNControlBase from './base/bpmn-control-base'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [],\n help: '/bpmn/message/message'\n}\n\nexport default class BPMNMessage extends BPMNControlBase {\n static get nature() {\n return NATURE\n }\n\n get textBounds(): BOUNDS {\n var { left, top, width, height } = this.bounds\n var { paddingTop, paddingLeft, paddingRight } = this.state\n\n paddingTop ||= 0\n paddingLeft ||= 0\n paddingRight ||= 0\n\n return {\n left: left + paddingLeft,\n top: top + paddingTop + height + 10,\n width: Math.max(width - paddingLeft - paddingRight, 0),\n height: 0\n }\n }\n\n render(ctx: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n const corner = (Math.min(width, height) * 2) / 5\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n ctx.moveTo(0, 0)\n ctx.lineTo(width, 0)\n ctx.lineTo(width, height)\n ctx.lineTo(0, height)\n ctx.lineTo(0, 0)\n ctx.lineTo(width / 2, height / 2)\n ctx.lineTo(width, 0)\n\n this.drawFill(ctx)\n this.drawStroke(ctx)\n\n ctx.translate(-left, -top)\n }\n}\n\nComponent.register('bpmn-message', BPMNMessage)\n"]}
1
+ {"version":3,"file":"bpmn-message.js","sourceRoot":"","sources":["../src/bpmn-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAE1D,OAAO,eAAe,MAAM,0BAA0B,CAAA;AAEtD,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;I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AAA;QACpB,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QACzB,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;QACrB,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;QAChB,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,CAAA;QACjC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QAEpB,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAA;QAE1B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;QAClB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;IACtB,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,CAAA","sourcesContent":["import { BOUNDS, Component } from '@hatiolab/things-scene'\n\nimport BPMNControlBase from './base/bpmn-control-base'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: false,\n properties: [],\n help: '/bpmn/message/message'\n}\n\nexport default class BPMNMessage extends BPMNControlBase {\n static get nature() {\n return NATURE\n }\n\n get textBounds(): BOUNDS {\n var { left, top, width, height } = this.bounds\n var { paddingTop, paddingLeft, paddingRight } = this.state\n\n paddingTop ||= 0\n paddingLeft ||= 0\n paddingRight ||= 0\n\n return {\n left: left + paddingLeft,\n top: top + paddingTop + height + 10,\n width: Math.max(width - paddingLeft - paddingRight, 0),\n height: 0\n }\n }\n\n render(ctx: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n const corner = (Math.min(width, height) * 2) / 5\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n ctx.moveTo(0, 0)\n ctx.lineTo(width, 0)\n ctx.lineTo(width, height)\n ctx.lineTo(0, height)\n ctx.lineTo(0, 0)\n ctx.lineTo(width / 2, height / 2)\n ctx.lineTo(width, 0)\n\n ctx.translate(-left, -top)\n\n this.drawFill(ctx)\n this.drawStroke(ctx)\n }\n}\n\nComponent.register('bpmn-message', BPMNMessage)\n"]}
@@ -190,6 +190,7 @@ export default class BPMNSubprocess extends BPMNControlBase {
190
190
  ctx.arcTo(LINEGAP, height - LINEGAP, LINEGAP, LINEGAP, radius);
191
191
  ctx.arcTo(LINEGAP, LINEGAP, width - LINEGAP, LINEGAP, radius);
192
192
  }
193
+ ctx.translate(-left, -top);
193
194
  this.drawFill(ctx);
194
195
  if (callActivity) {
195
196
  this.drawStroke(ctx, { lineWidth: 5 });
@@ -202,11 +203,10 @@ export default class BPMNSubprocess extends BPMNControlBase {
202
203
  }
203
204
  ctx.beginPath();
204
205
  const images = this.getMarkerImages() || [];
205
- const start = (width - images.length * 16) / 2;
206
+ const start = left + (width - images.length * 16) / 2;
206
207
  images.forEach((image, index) => {
207
- this.drawImage(ctx, image, start + index * 16, height - 16, 16, 16);
208
+ this.drawImage(ctx, image, start + index * 16, top + height - 16, 16, 16);
208
209
  });
209
- ctx.translate(-left, -top);
210
210
  }
211
211
  onchange(after, before) {
212
212
  if (['loop', 'multiInstance', 'adhoc', 'compensation', 'strokeStyle'].find(prop => prop in after)) {