@genexus/diagram-editors 18.2.27 → 18.4.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/cjs/{editor-386996a2.js → editor-39f75f41.js} +79 -6
  2. package/dist/cjs/gx-bpmn-editor.cjs.entry.js +203 -82
  3. package/dist/cjs/gx-report-layout-editor.cjs.entry.js +1 -1
  4. package/dist/collection/components/bpmn/bpmn-editor.js +88 -8
  5. package/dist/collection/components/bpmn/bpmn-graph.js +19 -3
  6. package/dist/collection/components/bpmn/cell-types.js +2 -1
  7. package/dist/collection/components/bpmn/properties.js +8 -0
  8. package/dist/collection/components/bpmn/shapes/text-annotation-shape.js +26 -0
  9. package/dist/collection/components/bpmn/style-tokens.js +4 -0
  10. package/dist/collection/components/bpmn/style-types.js +6 -0
  11. package/dist/collection/components/common/cell-descriptor.js +4 -0
  12. package/dist/collection/components/common/connection-handler.js +18 -1
  13. package/dist/collection/components/common/graph.js +30 -1
  14. package/dist/collection/components/common/mx.js +6 -1
  15. package/dist/collection/components/common/vertex-tool-handler.js +6 -3
  16. package/dist/diagram-editors/diagram-editors.esm.js +1 -1
  17. package/dist/diagram-editors/{p-80e1f1a5.system.js → p-0dea64d7.system.js} +1 -1
  18. package/dist/diagram-editors/p-36601737.system.entry.js +1 -0
  19. package/dist/diagram-editors/{p-f022f8f7.entry.js → p-3a040373.entry.js} +1 -1
  20. package/dist/diagram-editors/{p-009a6590.system.entry.js → p-54b997ae.system.entry.js} +1 -1
  21. package/dist/diagram-editors/{p-52c75d65.js → p-690fb19a.js} +1 -1
  22. package/dist/diagram-editors/{p-0cbf75ed.entry.js → p-d6be927a.entry.js} +1 -1
  23. package/dist/diagram-editors/p-e435d3dc.system.js +1 -1
  24. package/dist/esm/{editor-4d1ececd.js → editor-61f535ce.js} +79 -7
  25. package/dist/esm/gx-bpmn-editor.entry.js +147 -26
  26. package/dist/esm/gx-report-layout-editor.entry.js +1 -1
  27. package/dist/esm-es5/{editor-4d1ececd.js → editor-61f535ce.js} +132 -55
  28. package/dist/esm-es5/gx-bpmn-editor.entry.js +157 -31
  29. package/dist/esm-es5/gx-report-layout-editor.entry.js +1 -1
  30. package/dist/types/components/bpmn/cell-types.d.ts +1 -0
  31. package/dist/types/components/bpmn/properties.d.ts +8 -1
  32. package/dist/types/components/bpmn/shapes/text-annotation-shape.d.ts +7 -0
  33. package/dist/types/components/bpmn/style-tokens.d.ts +4 -0
  34. package/dist/types/components/bpmn/style-types.d.ts +6 -0
  35. package/dist/types/components/common/cell-descriptor.d.ts +8 -0
  36. package/dist/types/components/common/connection-handler.d.ts +1 -0
  37. package/dist/types/components/common/graph.d.ts +2 -0
  38. package/package.json +2 -2
  39. package/dist/diagram-editors/p-60b39e5b.system.entry.js +0 -1
@@ -7,10 +7,12 @@ import BpmnGraph from "./bpmn-graph";
7
7
  import CellTypes from "./cell-types";
8
8
  import { ActivityLoopTypeValues, ActivityOrderingValues, ActivityProperties, ArtifactProperties, ConnectorProperties, EventProperties, EventTriggerValues, GatewayProperties, GatewayTypeValues, TaskTypeValues } from "./properties";
9
9
  import ActivityShape from "./shapes/activity-shape";
10
+ import TextAnnotationShape from "./shapes/text-annotation-shape";
10
11
  import { ConnectorShape } from "./shapes/connector-shape";
11
12
  import EventShape from "./shapes/event-shape";
12
13
  import GatewayShape from "./shapes/gateway-shape";
13
14
  import { StyleTokens } from "./style-tokens";
15
+ import StyleTypes from "./style-types";
14
16
  const _SLOT_ACTIVITY_EVENTS = 'Events';
15
17
  const NEW_VERTEX_TYPES = [
16
18
  CellTypes.TASK,
@@ -18,7 +20,8 @@ const NEW_VERTEX_TYPES = [
18
20
  CellTypes.EXPANDED_EMBEDDED_SUB_PROCESS,
19
21
  CellTypes.INTERMEDIATE_EVENT,
20
22
  CellTypes.END_EVENT,
21
- CellTypes.GATEWAY
23
+ CellTypes.GATEWAY,
24
+ CellTypes.TEXT_ANNOTATION,
22
25
  ];
23
26
  var CustomTools;
24
27
  (function (CustomTools) {
@@ -193,6 +196,12 @@ var CustomTools;
193
196
  [ActivityProperties.LoopType]: ActivityLoopTypeValues.Standard
194
197
  }
195
198
  };
199
+ CustomTools.ACTIVITY_LOOP_NONE = {
200
+ icon: 'bpmn-icon-lasso-tool',
201
+ label: 'Parallel Multi Instance', value: {
202
+ [ActivityProperties.LoopType]: ActivityLoopTypeValues.None
203
+ }
204
+ };
196
205
  })(CustomTools || (CustomTools = {}));
197
206
  const _SWIMLANE_RADIAL_MANEU = {
198
207
  customTools: {
@@ -243,6 +252,7 @@ export default class BpmnEditor extends Editor {
243
252
  CustomTools.ACTIVITY_LOOP_MULTI_PARALLEL,
244
253
  CustomTools.ACTIVITY_LOOP_MULTI_SEQUENTIAL,
245
254
  CustomTools.ACTIVITY_LOOP_STANDARD,
255
+ CustomTools.ACTIVITY_LOOP_NONE,
246
256
  ]
247
257
  }
248
258
  },
@@ -283,6 +293,7 @@ export default class BpmnEditor extends Editor {
283
293
  CustomTools.ACTIVITY_LOOP_MULTI_PARALLEL,
284
294
  CustomTools.ACTIVITY_LOOP_MULTI_SEQUENTIAL,
285
295
  CustomTools.ACTIVITY_LOOP_STANDARD,
296
+ CustomTools.ACTIVITY_LOOP_NONE
286
297
  ]
287
298
  }
288
299
  },
@@ -323,6 +334,7 @@ export default class BpmnEditor extends Editor {
323
334
  CustomTools.ACTIVITY_LOOP_MULTI_PARALLEL,
324
335
  CustomTools.ACTIVITY_LOOP_MULTI_SEQUENTIAL,
325
336
  CustomTools.ACTIVITY_LOOP_STANDARD,
337
+ CustomTools.ACTIVITY_LOOP_NONE,
326
338
  ]
327
339
  }
328
340
  },
@@ -356,7 +368,14 @@ export default class BpmnEditor extends Editor {
356
368
  resizable: false,
357
369
  style: `defaultVertex;${mx.mxConstants.STYLE_PERIMETER}=${mx.mxConstants.PERIMETER_ELLIPSE};${mx.mxConstants.STYLE_NOLABEL}=1`,
358
370
  radialMenu: {
359
- newVertexTypes: NEW_VERTEX_TYPES,
371
+ newVertexTypes: [
372
+ CellTypes.TASK,
373
+ CellTypes.EMBEDDED_SUB_PROCESS,
374
+ CellTypes.EXPANDED_EMBEDDED_SUB_PROCESS,
375
+ CellTypes.INTERMEDIATE_EVENT,
376
+ CellTypes.GATEWAY,
377
+ CellTypes.TEXT_ANNOTATION,
378
+ ],
360
379
  customTools: {
361
380
  subMenuMain: [
362
381
  CustomTools.StartEvents.NONE,
@@ -411,7 +430,7 @@ export default class BpmnEditor extends Editor {
411
430
  resizable: false,
412
431
  style: `defaultVertex;${mx.mxConstants.STYLE_PERIMETER}=${mx.mxConstants.PERIMETER_ELLIPSE};${mx.mxConstants.STYLE_NOLABEL}=1`,
413
432
  radialMenu: {
414
- newVertexTypes: NEW_VERTEX_TYPES,
433
+ newVertexTypes: [CellTypes.TEXT_ANNOTATION],
415
434
  customTools: {
416
435
  subMenuMain: [
417
436
  CustomTools.EndEvents.NONE,
@@ -422,7 +441,13 @@ export default class BpmnEditor extends Editor {
422
441
  CustomTools.EndEvents.TERMINATE
423
442
  ]
424
443
  }
425
- }
444
+ },
445
+ cellConectionRestrictions: new Map([
446
+ [CellTypes.TEXT_ANNOTATION, {
447
+ to: CellTypes.TEXT_ANNOTATION,
448
+ isValidConnection: () => true
449
+ }],
450
+ ])
426
451
  }),
427
452
  new CellDescriptor({
428
453
  id: CellTypes.GATEWAY,
@@ -476,9 +501,26 @@ export default class BpmnEditor extends Editor {
476
501
  icon: '',
477
502
  labelAttribute: ConnectorProperties.Text,
478
503
  isEdge: true,
479
- style: `defaultEdge`,
504
+ style: StyleTypes.SEQUENCE_FLOW,
480
505
  shape: ConnectorShape
481
- })
506
+ }),
507
+ new CellDescriptor({
508
+ id: CellTypes.TEXT_ANNOTATION,
509
+ baseName: CellTypes.TEXT_ANNOTATION,
510
+ icon: 'bpmn-icon-text-annotation',
511
+ isSlot: true,
512
+ slotId: _SLOT_ACTIVITY_EVENTS,
513
+ labelAttribute: ActivityProperties.Name,
514
+ isVertex: true,
515
+ size: StyleTokens.TEXT_ANNOTATION_SIZE,
516
+ shape: TextAnnotationShape,
517
+ radialMenu: {
518
+ delete: true,
519
+ newEdge: false,
520
+ newVertexTypes: [],
521
+ },
522
+ style: `defaultVertex;`,
523
+ }),
482
524
  ],
483
525
  defaultEdgeDescriptorId: CellTypes.CONNECTOR,
484
526
  globalStyles: [
@@ -494,14 +536,51 @@ export default class BpmnEditor extends Editor {
494
536
  [mx.mxConstants.STYLE_FONTCOLOR]: StyleTokens.DEFAULT_FONT_COLOR,
495
537
  [mx.mxConstants.STYLE_FONTSIZE]: StyleTokens.DEFAULT_FONT_SIZE,
496
538
  [mx.mxConstants.STYLE_STROKEWIDTH]: StyleTokens.DEFAULT_STROKE_WIDTH,
497
- [mx.mxConstants.STYLE_LABEL_BACKGROUNDCOLOR]: StyleTokens.LABEL_BACKGROUND_COLOR
539
+ [mx.mxConstants.STYLE_LABEL_BACKGROUNDCOLOR]: StyleTokens.LABEL_BACKGROUND_COLOR,
540
+ [mx.mxConstants.STYLE_WHITE_SPACE]: mx.mxConstants.WORD_WRAP,
541
+ }
542
+ },
543
+ {
544
+ name: StyleTypes.SEQUENCE_FLOW,
545
+ value: {
546
+ [mx.mxConstants.STYLE_SHAPE]: mx.mxConstants.SHAPE_CONNECTOR,
547
+ [mx.mxConstants.STYLE_ENDARROW]: mx.mxConstants.ARROW_BLOCK,
548
+ [mx.mxConstants.STYLE_EDGE]: mx.mxConstants.EDGESTYLE_ORTHOGONAL,
549
+ [mx.mxConstants.STYLE_ROUNDED]: '1',
550
+ [mx.mxConstants.STYLE_ARCSIZE]: 10,
551
+ [mx.mxConstants.STYLE_VERTICAL_ALIGN]: mx.mxConstants.ALIGN_MIDDLE,
552
+ [mx.mxConstants.STYLE_ALIGN]: mx.mxConstants.ALIGN_CENTER,
553
+ [mx.mxConstants.STYLE_STROKECOLOR]: StyleTokens.CONNECTOR_STROKE_COLOR,
554
+ [mx.mxConstants.STYLE_FONTCOLOR]: StyleTokens.DEFAULT_FONT_COLOR,
555
+ [mx.mxConstants.STYLE_STROKEWIDTH]: StyleTokens.DEFAULT_STROKE_WIDTH,
556
+ }
557
+ },
558
+ {
559
+ name: StyleTypes.ASSOSIATION,
560
+ value: {
561
+ [mx.mxConstants.STYLE_SHAPE]: mx.mxConstants.SHAPE_CONNECTOR,
562
+ [mx.mxConstants.STYLE_ENDARROW]: undefined,
563
+ [mx.mxConstants.STYLE_DASHED]: 1,
564
+ [mx.mxConstants.STYLE_DASH_PATTERN]: "1 2",
565
+ [mx.mxConstants.STYLE_EDGE]: mx.mxConstants.EDGESTYLE_ORTHOGONAL,
566
+ [mx.mxConstants.STYLE_ROUNDED]: '1',
567
+ [mx.mxConstants.STYLE_ARCSIZE]: 10,
568
+ [mx.mxConstants.STYLE_VERTICAL_ALIGN]: mx.mxConstants.ALIGN_MIDDLE,
569
+ [mx.mxConstants.STYLE_ALIGN]: mx.mxConstants.ALIGN_CENTER,
570
+ [mx.mxConstants.STYLE_STROKECOLOR]: StyleTokens.CONNECTOR_STROKE_COLOR,
571
+ [mx.mxConstants.STYLE_FONTCOLOR]: StyleTokens.DEFAULT_FONT_COLOR,
572
+ [mx.mxConstants.STYLE_STROKEWIDTH]: StyleTokens.DEFAULT_STROKE_WIDTH,
498
573
  }
499
574
  },
500
575
  {
501
- name: 'defaultEdge',
576
+ name: StyleTypes.MESSAGE_FLOW,
502
577
  value: {
503
578
  [mx.mxConstants.STYLE_SHAPE]: mx.mxConstants.SHAPE_CONNECTOR,
579
+ [mx.mxConstants.STYLE_STARTARROW]: mx.mxConstants.ARROW_OVAL,
580
+ [mx.mxConstants.STYLE_STARTFILL]: false,
504
581
  [mx.mxConstants.STYLE_ENDARROW]: mx.mxConstants.ARROW_BLOCK,
582
+ [mx.mxConstants.STYLE_ENDFILL]: false,
583
+ [mx.mxConstants.STYLE_DASHED]: 1,
505
584
  [mx.mxConstants.STYLE_EDGE]: mx.mxConstants.EDGESTYLE_ORTHOGONAL,
506
585
  [mx.mxConstants.STYLE_ROUNDED]: '1',
507
586
  [mx.mxConstants.STYLE_ARCSIZE]: 10,
@@ -514,6 +593,7 @@ export default class BpmnEditor extends Editor {
514
593
  }
515
594
  ]
516
595
  });
596
+ console.log("asdadsad");
517
597
  }
518
598
  createGraph(options) {
519
599
  return new BpmnGraph(options);
@@ -4,11 +4,13 @@ import mx from "../common/mx";
4
4
  import Utils from "../common/utils";
5
5
  import CellTypes from "./cell-types";
6
6
  import { LayoutManager, SwimlaneManager } from "./layout";
7
- import { ConnectorProperties, GatewayProperties, GatewayTypeValues, SequenceConnectorType } from "./properties";
7
+ import { ConnectorProperties, ConnectorType, GatewayProperties, GatewayTypeValues, SequenceConnectorType } from "./properties";
8
8
  import { StyleTokens } from "./style-tokens";
9
+ import StyleTypes from "./style-types";
9
10
  export default class BpmnGraph extends Graph {
10
11
  constructor(options) {
11
12
  super(options);
13
+ this.multigraph = false;
12
14
  this.tolerance = 20;
13
15
  this.swimlaneManager = new SwimlaneManager(this, false, undefined, undefined);
14
16
  this.layoutManager = new LayoutManager(this);
@@ -60,10 +62,8 @@ export default class BpmnGraph extends Graph {
60
62
  }
61
63
  isSwimlane(cell) {
62
64
  return Utils.cellOfType(cell, [
63
- CellTypes.TASK,
64
65
  CellTypes.SUB_PROCESS,
65
66
  CellTypes.EMBEDDED_SUB_PROCESS,
66
- CellTypes.EXPANDED_EMBEDDED_SUB_PROCESS,
67
67
  CellTypes.SUB_PROCESS_CHILDREN_SLOT,
68
68
  CellTypes.POOL,
69
69
  CellTypes.LANE
@@ -157,6 +157,9 @@ export default class BpmnGraph extends Graph {
157
157
  return super.getDropTarget(cells, evt, cell, clone);
158
158
  }
159
159
  _onCellConnected(evt) {
160
+ let edge = evt.getProperty('edge');
161
+ edge.style = StyleTypes.SEQUENCE_FLOW;
162
+ console.log('onCellConnected', evt);
160
163
  if (evt.getProperty('source')) {
161
164
  let vertex = evt.getProperty('terminal');
162
165
  if (Utils.cellOfType(vertex, CellTypes.GATEWAY)) {
@@ -172,6 +175,19 @@ export default class BpmnGraph extends Graph {
172
175
  }
173
176
  }
174
177
  }
178
+ if (evt.getProperty('terminal')) {
179
+ let vertex = evt.getProperty('terminal');
180
+ if (Utils.cellOfType(vertex, CellTypes.TEXT_ANNOTATION)) {
181
+ let edge = evt.getProperty('edge');
182
+ edge.style = StyleTypes.ASSOSIATION;
183
+ if (Utils.cellOfType(edge, CellTypes.CONNECTOR)) {
184
+ let connectorProps = edge.getValue() || {};
185
+ if (connectorProps[ConnectorProperties.ConnectorType] != ConnectorType.Association) {
186
+ this.getModel().setValue(edge, Object.assign({}, connectorProps, { [ConnectorProperties.ConnectorType]: ConnectorType.Association }));
187
+ }
188
+ }
189
+ }
190
+ }
175
191
  }
176
192
  _onSplitEdge(evt) {
177
193
  let cells = evt.getProperty('cells');
@@ -10,6 +10,7 @@ const CellTypes = {
10
10
  GATEWAY: 'Gateway',
11
11
  POOL: 'Pool',
12
12
  LANE: 'Lane',
13
- CONNECTOR: 'Connector'
13
+ CONNECTOR: 'Connector',
14
+ TEXT_ANNOTATION: 'TextAnnotation',
14
15
  };
15
16
  export default CellTypes;
@@ -13,6 +13,7 @@ export var TaskTypeValues;
13
13
  })(TaskTypeValues || (TaskTypeValues = {}));
14
14
  export var ActivityLoopTypeValues;
15
15
  (function (ActivityLoopTypeValues) {
16
+ ActivityLoopTypeValues["None"] = "None";
16
17
  ActivityLoopTypeValues["Standard"] = "Standard";
17
18
  ActivityLoopTypeValues["MultiInstance"] = "Multi-Instance";
18
19
  })(ActivityLoopTypeValues || (ActivityLoopTypeValues = {}));
@@ -54,10 +55,17 @@ export var EventTriggerValues;
54
55
  EventTriggerValues["Terminate"] = "Terminate";
55
56
  EventTriggerValues["Timer"] = "Timer";
56
57
  })(EventTriggerValues || (EventTriggerValues = {}));
58
+ export var ConnectorType;
59
+ (function (ConnectorType) {
60
+ ConnectorType["SequenceFlow"] = "SequenceFlow";
61
+ ConnectorType["Association"] = "Association";
62
+ ConnectorType["MessageFlow"] = "MessageFlow";
63
+ })(ConnectorType || (ConnectorType = {}));
57
64
  export var ConnectorProperties;
58
65
  (function (ConnectorProperties) {
59
66
  ConnectorProperties["Text"] = "PWFSeqConnText";
60
67
  ConnectorProperties["SequenceType"] = "PWFSeqConnType";
68
+ ConnectorProperties["ConnectorType"] = "PWFConnType";
61
69
  })(ConnectorProperties || (ConnectorProperties = {}));
62
70
  export var SequenceConnectorType;
63
71
  (function (SequenceConnectorType) {
@@ -0,0 +1,26 @@
1
+ import mx from "../../common/mx";
2
+ import { StyleTokens } from "../style-tokens";
3
+ export default class TextAnnotationShape extends mx.mxShape {
4
+ paintBackground(c, x, y, w, h) {
5
+ this.paintBorder(c, x, y, w, h);
6
+ }
7
+ paintBorder(c, x, y, w, h) {
8
+ let cell = this.state.cell;
9
+ let value = cell.getValue();
10
+ c.setFillColor(StyleTokens.TEXT_ANNOTATION_BACKGROUND_COLOR);
11
+ c.setStrokeColor(StyleTokens.TEXT_ANNOTATION_STROKE_COLOR);
12
+ c.rect(x, y, w, h);
13
+ c.fill();
14
+ c.begin();
15
+ c.moveTo(x + StyleTokens.TEXT_ANNOTATION_BRACKET_WIDTH, y);
16
+ c.lineTo(x, y);
17
+ c.lineTo(x, y + h);
18
+ c.lineTo(x + StyleTokens.TEXT_ANNOTATION_BRACKET_WIDTH, y + h);
19
+ c.stroke();
20
+ c.end();
21
+ }
22
+ getScale(c) {
23
+ let state = c.state;
24
+ return state.scale;
25
+ }
26
+ }
@@ -1,6 +1,8 @@
1
1
  export var StyleTokens;
2
2
  (function (StyleTokens) {
3
3
  StyleTokens.ACTIVITY_SIZE = { width: 130, height: 50 };
4
+ StyleTokens.TEXT_ANNOTATION_SIZE = { width: 130, height: 50 };
5
+ StyleTokens.TEXT_ANNOTATION_BRACKET_WIDTH = 17;
4
6
  StyleTokens.EVENT_SIZE = { width: 32, height: 32 };
5
7
  StyleTokens.ATTACHED_EVENT_SIZE = { width: 24, height: 24 };
6
8
  StyleTokens.GATEWAY_SIZE = { width: 40, height: 40 };
@@ -20,6 +22,8 @@ export var StyleTokens;
20
22
  StyleTokens.TASK_USER_STROKE_COLOR = '#96e3b0';
21
23
  StyleTokens.TASK_SCRIPT_BACKGROUND_COLOR = 'rgb(40,41,45)';
22
24
  StyleTokens.TASK_SCRIPT_STROKE_COLOR = '#5bb2ff';
25
+ StyleTokens.TEXT_ANNOTATION_BACKGROUND_COLOR = '#35363A';
26
+ StyleTokens.TEXT_ANNOTATION_STROKE_COLOR = '#a4a5a6';
23
27
  StyleTokens.SUB_PROCESS_BACKGROUND_COLOR = 'rgb(40,41,45)';
24
28
  StyleTokens.SUB_PROCESS_STROKE_COLOR = '#f89491';
25
29
  StyleTokens.GATEWAY_STROKE_COLOR = '#2dcf76';
@@ -0,0 +1,6 @@
1
+ const StyleTypes = {
2
+ SEQUENCE_FLOW: 'sequenceFlow',
3
+ MESSAGE_FLOW: 'messageFlow',
4
+ ASSOSIATION: 'association',
5
+ };
6
+ export default StyleTypes;
@@ -15,6 +15,7 @@ export default class CellDescriptor {
15
15
  this._labelAttribute = options.labelAttribute;
16
16
  this._nameAttribute = options.nameAttribute;
17
17
  this._resizable = options.resizable;
18
+ this._cellConectionRestrictions = options.cellConectionRestrictions;
18
19
  if (this._isVertex && !options.size)
19
20
  this._size = { width: 100, height: 50 };
20
21
  else
@@ -72,6 +73,9 @@ export default class CellDescriptor {
72
73
  get value() {
73
74
  return this._value;
74
75
  }
76
+ get cellConectionRestrictions() {
77
+ return this._cellConectionRestrictions;
78
+ }
75
79
  getRadialMenu(graph, cell) {
76
80
  if (typeof this._radialMenu === 'function')
77
81
  return this._radialMenu.call(this, graph, cell);
@@ -1,4 +1,15 @@
1
+ import CellTypes from '../bpmn/cell-types';
1
2
  import mx from './mx';
3
+ mx.mxConnectionHandler.prototype.start = function (state, x, y, edgeState) {
4
+ this.previous = state;
5
+ this.first = new mx.mxPoint(x, y);
6
+ this.edgeState = (edgeState != null) ? edgeState : this.createEdgeState(null);
7
+ this.marker.currentColor = this.marker.validColor;
8
+ this.marker.markedState = state;
9
+ this.marker.mark();
10
+ console.log("previous", this.previous, "actual", this.edgeState);
11
+ this.fireEvent(new mx.mxEventObject(mx.mxEvent.START, 'state', this.previous));
12
+ };
2
13
  export default class ConnectionHandler extends mx.mxConnectionHandler {
3
14
  constructor(graph, factory) {
4
15
  super(graph, factory);
@@ -14,8 +25,12 @@ export default class ConnectionHandler extends mx.mxConnectionHandler {
14
25
  });
15
26
  return marker;
16
27
  }
28
+ isCreateTarget(evt) {
29
+ return this.createTarget;
30
+ }
17
31
  createEdgeState() {
18
- let edge = this.graph.createEdge(null, null, null, null, null, 'defaultEdge');
32
+ console.log("createedgestate called");
33
+ let edge = this.graph.newCellInstance({ type: CellTypes.CONNECTOR });
19
34
  let geo = new mx.mxGeometry();
20
35
  geo.relative = false;
21
36
  edge.setGeometry(geo);
@@ -114,7 +129,9 @@ export default class ConnectionHandler extends mx.mxConnectionHandler {
114
129
  value = this.edgeState.cell.value;
115
130
  style = this.edgeState.cell.style;
116
131
  }
132
+ console.log("edgeState before insert: ", this.edgeState);
117
133
  edge = this.insertEdge(parent, null, value, source, target, style);
134
+ console.log("edge inserted: ", edge);
118
135
  if (edge != null) {
119
136
  this.graph.setConnectionConstraint(edge, source, true, this.sourceConstraint);
120
137
  this.graph.setConnectionConstraint(edge, target, false, this.constraintHandler.currentConstraint);
@@ -55,8 +55,10 @@ export default class Graph extends mx.mxGraph {
55
55
  if (this._defaultEdgeDescriptor) {
56
56
  edge = new Cell(this._defaultEdgeDescriptor, {}, geo);
57
57
  }
58
- else
58
+ else {
59
+ console.log("No style found");
59
60
  edge = new mx.mxCell('', geo, 'defaultEdge');
61
+ }
60
62
  edge.setEdge(true);
61
63
  return edge;
62
64
  });
@@ -536,6 +538,33 @@ export default class Graph extends mx.mxGraph {
536
538
  }
537
539
  return null;
538
540
  }
541
+ isValidConnection(source, target) {
542
+ console.log('valid connection called');
543
+ if (!super.isValidConnection(source, target)) {
544
+ return false;
545
+ }
546
+ else {
547
+ if (source instanceof Cell && target instanceof Cell) {
548
+ if (source.descriptor.cellConectionRestrictions) {
549
+ let restrictions = source.descriptor.cellConectionRestrictions;
550
+ if (restrictions.has(target.descriptor.id)) {
551
+ let restriction = restrictions.get(target.descriptor.id);
552
+ if (restriction.isValidConnection)
553
+ restriction.isValidConnection(source, target);
554
+ else
555
+ this.validationAlert("A cell restriction definition must have an isValidConnection memeber implementation");
556
+ }
557
+ else {
558
+ return false;
559
+ }
560
+ }
561
+ }
562
+ }
563
+ return true;
564
+ }
565
+ validationAlert(message) {
566
+ console.log(message);
567
+ }
539
568
  getState() {
540
569
  return {
541
570
  elements: this.getElementsState(this.getDefaultParent().children)
@@ -18,11 +18,16 @@ mx.mxConstants.VALID_COLOR = CommonStyleTokens.HIGHLIGHT_CONNECTION_COLOR;
18
18
  mx.mxConstants.GUIDE_COLOR = CommonStyleTokens.GUIDE_COLOR;
19
19
  mx.mxConstants.GUIDE_STROKEWIDTH = CommonStyleTokens.GUIDE_STROKE_WIDTH;
20
20
  mx.mxConstants.DROP_TARGET_COLOR = CommonStyleTokens.DROP_TARGET_COLOR;
21
+ mx.mxEdgeHandler.prototype.livePreview = true;
22
+ mx.mxConnectionHandler.prototype.livePreview = true;
23
+ mx.mxVertexHandler.prototype.livePreview = true;
24
+ mx.mxGraphHandler.prototype.maxLivePreview = 10;
21
25
  mx.mxUrlConverter.prototype.isRelativeUrl = function (url) {
22
26
  return url.substring(0, 2) != '//' && url.substring(0, 7) != 'http://' &&
23
27
  url.substring(0, 8) != 'https://' && url.substring(0, 10) != 'data:image' &&
24
28
  url.substring(0, 7) != 'file://' &&
25
- url.substring(0, 7) != 'gxjs://';
29
+ url.substring(0, 7) != 'gxjs://' &&
30
+ url.substring(0, 10) != 'gx-file://';
26
31
  };
27
32
  mx.mxMarker.addMarker('oval', function (canvas, shape, type, pe, unitX, unitY, size, source, sw, filled) {
28
33
  var a = size / 2;
@@ -2,10 +2,11 @@ import mx from "./mx";
2
2
  const _HANDLER_PADDING = 10;
3
3
  export default class VertexToolHandler extends mx.mxVertexHandler {
4
4
  constructor(state) {
5
+ console.log("mxVertexHandler creation");
5
6
  super(state);
6
7
  }
7
8
  init() {
8
- var _a, _b, _c, _d, _e, _f;
9
+ var _a, _b, _c, _d, _e, _f, _g;
9
10
  super.init();
10
11
  let graph = this.graph;
11
12
  let state = this.state;
@@ -32,13 +33,13 @@ export default class VertexToolHandler extends mx.mxVertexHandler {
32
33
  this._setCustomToolCallback(item, tool);
33
34
  }
34
35
  }
35
- if (((_e = menu.customTools) === null || _e === void 0 ? void 0 : _e.subMenuMain) || menu.customTools.subMenuTop || menu.newEdge || menu.delete) {
36
+ if (((_e = menu.customTools) === null || _e === void 0 ? void 0 : _e.subMenuMain) || ((_f = menu.customTools) === null || _f === void 0 ? void 0 : _f.subMenuTop) || menu.newEdge || menu.delete) {
36
37
  let toolsGroup = this._createGroup();
37
38
  if (menu.newEdge === undefined || menu.newEdge)
38
39
  this._createNewEdgeTool(toolsGroup);
39
40
  if (menu.delete === undefined || menu.delete)
40
41
  this._createDeleteTool(toolsGroup);
41
- if ((_f = menu.customTools) === null || _f === void 0 ? void 0 : _f.subMenuMain)
42
+ if ((_g = menu.customTools) === null || _g === void 0 ? void 0 : _g.subMenuMain)
42
43
  this._createCustomToolsPad(toolsGroup, menu);
43
44
  }
44
45
  }
@@ -176,8 +177,10 @@ export default class VertexToolHandler extends mx.mxVertexHandler {
176
177
  mx.mxEvent.addGestureListeners(el, () => {
177
178
  let graph = this.graph;
178
179
  let cell = this.state.cell;
180
+ let state = this.state;
179
181
  if (tool.value) {
180
182
  graph.getModel().setValue(cell, Object.assign({}, cell.getValue(), tool.value));
183
+ graph.refresh(cell);
181
184
  }
182
185
  this._toglePanel();
183
186
  if (tool.execute)
@@ -1 +1 @@
1
- import{b as e}from"./p-29a806fc.js";import{p as r}from"./p-dccd2ba0.js";r().then(r=>e([["p-f022f8f7",[[0,"gx-bpmn-editor",{editorHelper:[16],setProperties:[64],setState:[64],getState:[64],copyToClipboard:[64],pasteFromClipboard:[64],undo:[64],redo:[64]}]]],["p-0cbf75ed",[[0,"gx-report-layout-editor",{editorHelper:[16],paperProps:[32],printBlockHeights:[32],insertPrintBlock:[64],setProperties:[64],setPaperProperties:[64],setState:[64],copyToClipboard:[64],pasteFromClipboard:[64],undo:[64],redo:[64]}]]]],r));
1
+ import{b as e}from"./p-29a806fc.js";import{p as r}from"./p-dccd2ba0.js";r().then(r=>e([["p-3a040373",[[0,"gx-bpmn-editor",{editorHelper:[16],setProperties:[64],setState:[64],getState:[64],copyToClipboard:[64],pasteFromClipboard:[64],undo:[64],redo:[64]}]]],["p-d6be927a",[[0,"gx-report-layout-editor",{editorHelper:[16],paperProps:[32],printBlockHeights:[32],insertPrintBlock:[64],setProperties:[64],setPaperProperties:[64],setState:[64],copyToClipboard:[64],pasteFromClipboard:[64],undo:[64],redo:[64]}]]]],r));