@genexus/diagram-editors 18.2.27 → 18.3.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
@@ -92554,11 +92554,16 @@ mx.mxConstants.VALID_COLOR = CommonStyleTokens.HIGHLIGHT_CONNECTION_COLOR;
92554
92554
  mx.mxConstants.GUIDE_COLOR = CommonStyleTokens.GUIDE_COLOR;
92555
92555
  mx.mxConstants.GUIDE_STROKEWIDTH = CommonStyleTokens.GUIDE_STROKE_WIDTH;
92556
92556
  mx.mxConstants.DROP_TARGET_COLOR = CommonStyleTokens.DROP_TARGET_COLOR;
92557
+ mx.mxEdgeHandler.prototype.livePreview = true;
92558
+ mx.mxConnectionHandler.prototype.livePreview = true;
92559
+ mx.mxVertexHandler.prototype.livePreview = true;
92560
+ mx.mxGraphHandler.prototype.maxLivePreview = 10;
92557
92561
  mx.mxUrlConverter.prototype.isRelativeUrl = function (url) {
92558
92562
  return url.substring(0, 2) != '//' && url.substring(0, 7) != 'http://' &&
92559
92563
  url.substring(0, 8) != 'https://' && url.substring(0, 10) != 'data:image' &&
92560
92564
  url.substring(0, 7) != 'file://' &&
92561
- url.substring(0, 7) != 'gxjs://';
92565
+ url.substring(0, 7) != 'gxjs://' &&
92566
+ url.substring(0, 10) != 'gx-file://';
92562
92567
  };
92563
92568
  mx.mxMarker.addMarker('oval', function (canvas, shape, type, pe, unitX, unitY, size, source, sw, filled) {
92564
92569
  var a = size / 2;
@@ -92687,6 +92692,7 @@ class CellDescriptor {
92687
92692
  this._labelAttribute = options.labelAttribute;
92688
92693
  this._nameAttribute = options.nameAttribute;
92689
92694
  this._resizable = options.resizable;
92695
+ this._cellConectionRestrictions = options.cellConectionRestrictions;
92690
92696
  if (this._isVertex && !options.size)
92691
92697
  this._size = { width: 100, height: 50 };
92692
92698
  else
@@ -92744,6 +92750,9 @@ class CellDescriptor {
92744
92750
  get value() {
92745
92751
  return this._value;
92746
92752
  }
92753
+ get cellConectionRestrictions() {
92754
+ return this._cellConectionRestrictions;
92755
+ }
92747
92756
  getRadialMenu(graph, cell) {
92748
92757
  if (typeof this._radialMenu === 'function')
92749
92758
  return this._radialMenu.call(this, graph, cell);
@@ -92896,6 +92905,32 @@ class CellEditor extends mx.mxCellEditor {
92896
92905
  }
92897
92906
  }
92898
92907
 
92908
+ const CellTypes = {
92909
+ TASK: 'Task',
92910
+ SUB_PROCESS: 'SubProcess',
92911
+ EMBEDDED_SUB_PROCESS: 'EmbeddedSubProcess',
92912
+ EXPANDED_EMBEDDED_SUB_PROCESS: 'ExpandedEmbeddedSubProcess',
92913
+ SUB_PROCESS_CHILDREN_SLOT: 'SubProcessChildrenSlot',
92914
+ START_EVENT: 'StartEvent',
92915
+ INTERMEDIATE_EVENT: 'IntermediateEvent',
92916
+ END_EVENT: 'EndEvent',
92917
+ GATEWAY: 'Gateway',
92918
+ POOL: 'Pool',
92919
+ LANE: 'Lane',
92920
+ CONNECTOR: 'Connector',
92921
+ TEXT_ANNOTATION: 'TextAnnotation',
92922
+ };
92923
+
92924
+ mx.mxConnectionHandler.prototype.start = function (state, x, y, edgeState) {
92925
+ this.previous = state;
92926
+ this.first = new mx.mxPoint(x, y);
92927
+ this.edgeState = (edgeState != null) ? edgeState : this.createEdgeState(null);
92928
+ this.marker.currentColor = this.marker.validColor;
92929
+ this.marker.markedState = state;
92930
+ this.marker.mark();
92931
+ console.log("previous", this.previous, "actual", this.edgeState);
92932
+ this.fireEvent(new mx.mxEventObject(mx.mxEvent.START, 'state', this.previous));
92933
+ };
92899
92934
  class ConnectionHandler extends mx.mxConnectionHandler {
92900
92935
  constructor(graph, factory) {
92901
92936
  super(graph, factory);
@@ -92911,8 +92946,12 @@ class ConnectionHandler extends mx.mxConnectionHandler {
92911
92946
  });
92912
92947
  return marker;
92913
92948
  }
92949
+ isCreateTarget(evt) {
92950
+ return this.createTarget;
92951
+ }
92914
92952
  createEdgeState() {
92915
- let edge = this.graph.createEdge(null, null, null, null, null, 'defaultEdge');
92953
+ console.log("createedgestate called");
92954
+ let edge = this.graph.newCellInstance({ type: CellTypes.CONNECTOR });
92916
92955
  let geo = new mx.mxGeometry();
92917
92956
  geo.relative = false;
92918
92957
  edge.setGeometry(geo);
@@ -93011,7 +93050,9 @@ class ConnectionHandler extends mx.mxConnectionHandler {
93011
93050
  value = this.edgeState.cell.value;
93012
93051
  style = this.edgeState.cell.style;
93013
93052
  }
93053
+ console.log("edgeState before insert: ", this.edgeState);
93014
93054
  edge = this.insertEdge(parent, null, value, source, target, style);
93055
+ console.log("edge inserted: ", edge);
93015
93056
  if (edge != null) {
93016
93057
  this.graph.setConnectionConstraint(edge, source, true, this.sourceConstraint);
93017
93058
  this.graph.setConnectionConstraint(edge, target, false, this.constraintHandler.currentConstraint);
@@ -93371,10 +93412,11 @@ class PanningHandler extends mx.mxPanningHandler {
93371
93412
  const _HANDLER_PADDING = 10;
93372
93413
  class VertexToolHandler extends mx.mxVertexHandler {
93373
93414
  constructor(state) {
93415
+ console.log("mxVertexHandler creation");
93374
93416
  super(state);
93375
93417
  }
93376
93418
  init() {
93377
- var _a, _b, _c, _d, _e, _f;
93419
+ var _a, _b, _c, _d, _e, _f, _g;
93378
93420
  super.init();
93379
93421
  let graph = this.graph;
93380
93422
  let state = this.state;
@@ -93401,13 +93443,13 @@ class VertexToolHandler extends mx.mxVertexHandler {
93401
93443
  this._setCustomToolCallback(item, tool);
93402
93444
  }
93403
93445
  }
93404
- if (((_e = menu.customTools) === null || _e === void 0 ? void 0 : _e.subMenuMain) || menu.customTools.subMenuTop || menu.newEdge || menu.delete) {
93446
+ 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) {
93405
93447
  let toolsGroup = this._createGroup();
93406
93448
  if (menu.newEdge === undefined || menu.newEdge)
93407
93449
  this._createNewEdgeTool(toolsGroup);
93408
93450
  if (menu.delete === undefined || menu.delete)
93409
93451
  this._createDeleteTool(toolsGroup);
93410
- if ((_f = menu.customTools) === null || _f === void 0 ? void 0 : _f.subMenuMain)
93452
+ if ((_g = menu.customTools) === null || _g === void 0 ? void 0 : _g.subMenuMain)
93411
93453
  this._createCustomToolsPad(toolsGroup, menu);
93412
93454
  }
93413
93455
  }
@@ -93547,6 +93589,7 @@ class VertexToolHandler extends mx.mxVertexHandler {
93547
93589
  let cell = this.state.cell;
93548
93590
  if (tool.value) {
93549
93591
  graph.getModel().setValue(cell, Object.assign({}, cell.getValue(), tool.value));
93592
+ graph.refresh(cell);
93550
93593
  }
93551
93594
  this._toglePanel();
93552
93595
  if (tool.execute)
@@ -93640,8 +93683,10 @@ class Graph extends mx.mxGraph {
93640
93683
  if (this._defaultEdgeDescriptor) {
93641
93684
  edge = new Cell(this._defaultEdgeDescriptor, {}, geo);
93642
93685
  }
93643
- else
93686
+ else {
93687
+ console.log("No style found");
93644
93688
  edge = new mx.mxCell('', geo, 'defaultEdge');
93689
+ }
93645
93690
  edge.setEdge(true);
93646
93691
  return edge;
93647
93692
  });
@@ -94121,6 +94166,33 @@ class Graph extends mx.mxGraph {
94121
94166
  }
94122
94167
  return null;
94123
94168
  }
94169
+ isValidConnection(source, target) {
94170
+ console.log('valid connection called');
94171
+ if (!super.isValidConnection(source, target)) {
94172
+ return false;
94173
+ }
94174
+ else {
94175
+ if (source instanceof Cell && target instanceof Cell) {
94176
+ if (source.descriptor.cellConectionRestrictions) {
94177
+ let restrictions = source.descriptor.cellConectionRestrictions;
94178
+ if (restrictions.has(target.descriptor.id)) {
94179
+ let restriction = restrictions.get(target.descriptor.id);
94180
+ if (restriction.isValidConnection)
94181
+ restriction.isValidConnection(source, target);
94182
+ else
94183
+ this.validationAlert("A cell restriction definition must have an isValidConnection memeber implementation");
94184
+ }
94185
+ else {
94186
+ return false;
94187
+ }
94188
+ }
94189
+ }
94190
+ }
94191
+ return true;
94192
+ }
94193
+ validationAlert(message) {
94194
+ console.log(message);
94195
+ }
94124
94196
  getState() {
94125
94197
  return {
94126
94198
  elements: this.getElementsState(this.getDefaultParent().children)
@@ -94618,6 +94690,7 @@ Editor.EVENT_SELECTION_CHANGED = 'selectionChanged';
94618
94690
 
94619
94691
  exports.Cell = Cell;
94620
94692
  exports.CellDescriptor = CellDescriptor;
94693
+ exports.CellTypes = CellTypes;
94621
94694
  exports.Editor = Editor;
94622
94695
  exports.Graph = Graph;
94623
94696
  exports.Utils = Utils;