@elyra/canvas 12.12.1 → 12.12.2

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 (76) hide show
  1. package/dist/{canvas-controller-b856cfa3.js → canvas-controller-de76a796.js} +2 -2
  2. package/dist/{canvas-controller-b856cfa3.js.map → canvas-controller-de76a796.js.map} +1 -1
  3. package/dist/{canvas-controller-851afae4.js → canvas-controller-e91d037b.js} +2 -2
  4. package/dist/{canvas-controller-851afae4.js.map → canvas-controller-e91d037b.js.map} +1 -1
  5. package/dist/common-canvas-522f6263.js +2 -0
  6. package/dist/common-canvas-522f6263.js.map +1 -0
  7. package/dist/common-canvas-90539c97.js +2 -0
  8. package/dist/common-canvas-90539c97.js.map +1 -0
  9. package/dist/common-canvas.es.js +1 -1
  10. package/dist/common-canvas.js +1 -1
  11. package/dist/{common-properties-87fef545.js → common-properties-245c4711.js} +2 -2
  12. package/dist/common-properties-245c4711.js.map +1 -0
  13. package/dist/{common-properties-8727d6f9.js → common-properties-49e6bb67.js} +2 -2
  14. package/dist/common-properties-49e6bb67.js.map +1 -0
  15. package/dist/datarecord-metadata-v3-schema-6b6384ff.js.map +1 -1
  16. package/dist/datarecord-metadata-v3-schema-81228a9a.js.map +1 -1
  17. package/dist/en-8647c347.js.map +1 -1
  18. package/dist/{extends-cf86ca1c.js → extends-7fdcdc52.js} +2 -2
  19. package/dist/{extends-cf86ca1c.js.map → extends-7fdcdc52.js.map} +1 -1
  20. package/dist/extends-8d17c85c.js +7 -0
  21. package/dist/extends-8d17c85c.js.map +1 -0
  22. package/dist/{flexible-table-f0c164d2.js → flexible-table-50ce600a.js} +2 -2
  23. package/dist/{flexible-table-f0c164d2.js.map → flexible-table-50ce600a.js.map} +1 -1
  24. package/dist/{flexible-table-d4a68ebb.js → flexible-table-a13cb7d0.js} +2 -2
  25. package/dist/{flexible-table-d4a68ebb.js.map → flexible-table-a13cb7d0.js.map} +1 -1
  26. package/dist/getPrototypeOf-a1c3fe64.js +2 -0
  27. package/dist/getPrototypeOf-a1c3fe64.js.map +1 -0
  28. package/dist/getPrototypeOf-bf88242f.js +2 -0
  29. package/dist/getPrototypeOf-bf88242f.js.map +1 -0
  30. package/dist/{icon-c85b53bd.js → icon-4882a57f.js} +2 -2
  31. package/dist/{icon-c85b53bd.js.map → icon-4882a57f.js.map} +1 -1
  32. package/dist/{icon-caf4caca.js → icon-bf77b2aa.js} +2 -2
  33. package/dist/{icon-caf4caca.js.map → icon-bf77b2aa.js.map} +1 -1
  34. package/dist/{index-beefcd21.js → index-0e6c8b9c.js} +2 -2
  35. package/dist/{index-beefcd21.js.map → index-0e6c8b9c.js.map} +1 -1
  36. package/dist/{index-fb90b885.js → index-f2c306ba.js} +2 -2
  37. package/dist/{index-fb90b885.js.map → index-f2c306ba.js.map} +1 -1
  38. package/dist/isArrayLikeObject-a9c7973b.js.map +1 -1
  39. package/dist/isArrayLikeObject-f3b27f64.js.map +1 -1
  40. package/dist/lib/canvas-controller.es.js +1 -1
  41. package/dist/lib/canvas-controller.js +1 -1
  42. package/dist/lib/canvas.es.js +1 -1
  43. package/dist/lib/canvas.js +1 -1
  44. package/dist/lib/context-menu.es.js +1 -1
  45. package/dist/lib/context-menu.js +1 -1
  46. package/dist/lib/properties/field-picker.es.js +1 -1
  47. package/dist/lib/properties/field-picker.js +1 -1
  48. package/dist/lib/properties/flexible-table.es.js +1 -1
  49. package/dist/lib/properties/flexible-table.js +1 -1
  50. package/dist/lib/properties.es.js +1 -1
  51. package/dist/lib/properties.js +1 -1
  52. package/dist/lib/tooltip.es.js +1 -1
  53. package/dist/lib/tooltip.js +1 -1
  54. package/dist/{toolbar-cca1d9a9.js → toolbar-1c181339.js} +2 -2
  55. package/dist/{toolbar-cca1d9a9.js.map → toolbar-1c181339.js.map} +1 -1
  56. package/dist/{toolbar-a5ec3435.js → toolbar-c6fa3cdb.js} +2 -2
  57. package/dist/{toolbar-a5ec3435.js.map → toolbar-c6fa3cdb.js.map} +1 -1
  58. package/package.json +1 -1
  59. package/src/command-actions/sizeAndPositionObjectsAction.js +4 -4
  60. package/src/common-canvas/canvas-controller.js +4 -4
  61. package/src/common-canvas/svg-canvas-renderer.js +69 -62
  62. package/src/common-properties/controls/expression/expression-builder/expression-builder.jsx +6 -5
  63. package/src/common-properties/controls/expression/expression.jsx +9 -3
  64. package/stats.html +1 -1
  65. package/dist/common-canvas-65512584.js +0 -2
  66. package/dist/common-canvas-65512584.js.map +0 -1
  67. package/dist/common-canvas-a2d6b5af.js +0 -2
  68. package/dist/common-canvas-a2d6b5af.js.map +0 -1
  69. package/dist/common-properties-8727d6f9.js.map +0 -1
  70. package/dist/common-properties-87fef545.js.map +0 -1
  71. package/dist/extends-e9462902.js +0 -7
  72. package/dist/extends-e9462902.js.map +0 -1
  73. package/dist/getPrototypeOf-0bf77a9e.js +0 -2
  74. package/dist/getPrototypeOf-0bf77a9e.js.map +0 -1
  75. package/dist/getPrototypeOf-97272efe.js +0 -2
  76. package/dist/getPrototypeOf-97272efe.js.map +0 -1
@@ -110,11 +110,6 @@ export default class SVGCanvasRenderer {
110
110
  this.minScaleExtent = 0.2;
111
111
  this.maxScaleExtent = 1.8;
112
112
 
113
- // Allow us to keep track of the object (node or comment) being sized and
114
- // its initial size and position at the start of the sizing event.
115
- this.resizeObj = null;
116
- this.resizeObjInitialInfo = null;
117
-
118
113
  // Allows us to track the sizing behavior of comments
119
114
  this.commentSizing = false;
120
115
  this.commentSizingDirection = "";
@@ -123,9 +118,14 @@ export default class SVGCanvasRenderer {
123
118
  this.nodeSizing = false;
124
119
  this.nodeSizingDirection = "";
125
120
  this.nodeSizingObjectsInfo = [];
126
- this.nodeSizingLinksInfo = [];
121
+ this.nodeSizingDetLinksInfo = [];
122
+
123
+ // Keeps track of the size and position, at the start of the sizing event,
124
+ // of the object (node or comment) being sized.
125
+ this.resizeObjInitialInfo = null;
127
126
 
128
- // General purpose variables to allow us to handle resize and snap to grid
127
+ // Keeps track of the size and position, during a sizing event, of the
128
+ // object (node or comment) being sized, before it is snapped to grid.
129
129
  this.notSnappedXPos = 0;
130
130
  this.notSnappedYPos = 0;
131
131
  this.notSnappedWidth = 0;
@@ -2094,12 +2094,12 @@ export default class SVGCanvasRenderer {
2094
2094
 
2095
2095
  // Note: Comment and Node resizing is started by the comment/node highlight rectangle.
2096
2096
  if (this.commentSizing) {
2097
- this.resizeObj = this.activePipeline.getComment(d.id);
2098
- this.initializeResizeVariables(this.resizeObj);
2097
+ const resizeObj = this.activePipeline.getComment(d.id);
2098
+ this.initializeResizeVariables(resizeObj);
2099
2099
 
2100
2100
  } else if (this.nodeSizing) {
2101
- this.resizeObj = this.activePipeline.getNode(d.id);
2102
- this.initializeResizeVariables(this.resizeObj);
2101
+ const resizeObj = this.activePipeline.getNode(d.id);
2102
+ this.initializeResizeVariables(resizeObj);
2103
2103
 
2104
2104
  } else {
2105
2105
  this.dragObjectsStart(d3Event, d);
@@ -2107,12 +2107,12 @@ export default class SVGCanvasRenderer {
2107
2107
  this.logger.logEndTimer("dragStart", true);
2108
2108
  }
2109
2109
 
2110
- dragMove(d3Event) {
2110
+ dragMove(d3Event, d) {
2111
2111
  this.logger.logStartTimer("dragMove");
2112
2112
  if (this.commentSizing) {
2113
- this.resizeComment(d3Event);
2113
+ this.resizeComment(d3Event, d);
2114
2114
  } else if (this.nodeSizing) {
2115
- this.resizeNode(d3Event);
2115
+ this.resizeNode(d3Event, d);
2116
2116
  } else {
2117
2117
  this.dragObjectsAction(d3Event);
2118
2118
  }
@@ -2126,10 +2126,10 @@ export default class SVGCanvasRenderer {
2126
2126
  this.removeTempCursorOverlay();
2127
2127
 
2128
2128
  if (this.commentSizing) {
2129
- this.endCommentSizing();
2129
+ this.endCommentSizing(d);
2130
2130
 
2131
2131
  } else if (this.nodeSizing) {
2132
- this.endNodeSizing();
2132
+ this.endNodeSizing(d);
2133
2133
 
2134
2134
  } else if (this.dragging) {
2135
2135
  this.dragObjectsEnd(d3Event, d);
@@ -5670,23 +5670,24 @@ export default class SVGCanvasRenderer {
5670
5670
  // array based on the position of the pointer during the resize action
5671
5671
  // then redraws the nodes and links (the link positions may move based
5672
5672
  // on the node size change).
5673
- resizeNode(d3Event) {
5674
- const oldSupernode = Object.assign({}, this.resizeObj);
5675
- const minHeight = this.getMinHeight(this.resizeObj);
5676
- const minWidth = this.getMinWidth(this.resizeObj);
5673
+ resizeNode(d3Event, d) {
5674
+ const resizeObj = this.activePipeline.getNode(d.id);
5675
+ const oldSupernode = Object.assign({}, resizeObj);
5676
+ const minHeight = this.getMinHeight(resizeObj);
5677
+ const minWidth = this.getMinWidth(resizeObj);
5677
5678
 
5678
- const delta = this.resizeObject(d3Event, this.resizeObj,
5679
+ const delta = this.resizeObject(d3Event, resizeObj,
5679
5680
  this.nodeSizingDirection, minWidth, minHeight);
5680
5681
 
5681
5682
  if (delta && (delta.x_pos !== 0 || delta.y_pos !== 0 || delta.width !== 0 || delta.height !== 0)) {
5682
- if (CanvasUtils.isSupernode(this.resizeObj) &&
5683
+ if (CanvasUtils.isSupernode(resizeObj) &&
5683
5684
  this.config.enableMoveNodesOnSupernodeResize) {
5684
5685
  const objectsInfo = CanvasUtils.moveSurroundingObjects(
5685
5686
  oldSupernode,
5686
5687
  this.activePipeline.getNodesAndComments(),
5687
5688
  this.nodeSizingDirection,
5688
- this.resizeObj.width,
5689
- this.resizeObj.height,
5689
+ resizeObj.width,
5690
+ resizeObj.height,
5690
5691
  true // Pass true to indicate that object positions should be updated.
5691
5692
  );
5692
5693
 
@@ -5694,21 +5695,21 @@ export default class SVGCanvasRenderer {
5694
5695
  oldSupernode,
5695
5696
  this.activePipeline.links,
5696
5697
  this.nodeSizingDirection,
5697
- this.resizeObj.width,
5698
- this.resizeObj.height,
5698
+ resizeObj.width,
5699
+ resizeObj.height,
5699
5700
  true // Pass true to indicate that link positions should be updated.
5700
5701
  );
5701
5702
 
5702
5703
  // Overwrite the object and link info with any new info.
5703
5704
  this.nodeSizingObjectsInfo = Object.assign(this.nodeSizingObjectsInfo, objectsInfo);
5704
- this.nodeSizingLinksInfo = Object.assign(this.nodeSizingLinksInfo, linksInfo);
5705
+ this.nodeSizingDetLinksInfo = Object.assign(this.nodeSizingDetLinksInfo, linksInfo);
5705
5706
  }
5706
5707
 
5707
5708
  this.displayComments();
5708
5709
  this.displayNodes();
5709
5710
  this.displayLinks();
5710
5711
 
5711
- if (CanvasUtils.isSupernode(this.resizeObj)) {
5712
+ if (CanvasUtils.isSupernode(resizeObj)) {
5712
5713
  if (this.dispUtils.isDisplayingSubFlow()) {
5713
5714
  this.displayBindingNodesToFitSVG();
5714
5715
  }
@@ -5721,8 +5722,9 @@ export default class SVGCanvasRenderer {
5721
5722
  // array based on the position of the pointer during the resize action
5722
5723
  // then redraws the comment and links (the link positions may move based
5723
5724
  // on the comment size change).
5724
- resizeComment(d3Event) {
5725
- this.resizeObject(d3Event, this.resizeObj, this.commentSizingDirection, 20, 20);
5725
+ resizeComment(d3Event, d) {
5726
+ const resizeObj = this.activePipeline.getComment(d.id);
5727
+ this.resizeObject(d3Event, resizeObj, this.commentSizingDirection, 20, 20);
5726
5728
  this.displayComments();
5727
5729
  this.displayLinks();
5728
5730
  }
@@ -5800,71 +5802,76 @@ export default class SVGCanvasRenderer {
5800
5802
 
5801
5803
  // Finalises the sizing of a node by calling editActionHandler
5802
5804
  // with an editNode action.
5803
- endNodeSizing() {
5805
+ endNodeSizing(node) {
5806
+ let resizeObj = this.activePipeline.getNode(node.id);
5804
5807
  if (this.config.enableSnapToGridType === SNAP_TO_GRID_AFTER) {
5805
- this.resizeObj = this.snapToGridObject(this.resizeObj);
5808
+ resizeObj = this.snapToGridObject(resizeObj);
5806
5809
  }
5807
5810
 
5808
5811
  // If the dimensions or position has changed, issue the command.
5809
5812
  // Note: x_pos or y_pos might change on resize if the node is sized
5810
5813
  // upwards or to the left.
5811
- if (this.resizeObjInitialInfo.x_pos !== this.resizeObj.x_pos ||
5812
- this.resizeObjInitialInfo.y_pos !== this.resizeObj.y_pos ||
5813
- this.resizeObjInitialInfo.width !== this.resizeObj.width ||
5814
- this.resizeObjInitialInfo.height !== this.resizeObj.height) {
5814
+ if (this.resizeObjInitialInfo.x_pos !== resizeObj.x_pos ||
5815
+ this.resizeObjInitialInfo.y_pos !== resizeObj.y_pos ||
5816
+ this.resizeObjInitialInfo.width !== resizeObj.width ||
5817
+ this.resizeObjInitialInfo.height !== resizeObj.height) {
5815
5818
  // Add the dimensions of the object being resized to the array of object infos.
5816
- this.nodeSizingObjectsInfo[this.resizeObj.id] = {
5817
- width: this.resizeObj.width,
5818
- height: this.resizeObj.height,
5819
- x_pos: this.resizeObj.x_pos,
5820
- y_pos: this.resizeObj.y_pos
5819
+ this.nodeSizingObjectsInfo[resizeObj.id] = {
5820
+ width: resizeObj.width,
5821
+ height: resizeObj.height,
5822
+ x_pos: resizeObj.x_pos,
5823
+ y_pos: resizeObj.y_pos
5821
5824
  };
5822
5825
 
5823
5826
  // If the node has been resized set the resize properties appropriately.
5824
- if (this.resizeObjInitialInfo.width !== this.resizeObj.width ||
5825
- this.resizeObjInitialInfo.height !== this.resizeObj.height) {
5826
- this.nodeSizingObjectsInfo[this.resizeObj.id].isResized = true;
5827
- this.nodeSizingObjectsInfo[this.resizeObj.id].resizeWidth = this.resizeObj.width;
5828
- this.nodeSizingObjectsInfo[this.resizeObj.id].resizeHeight = this.resizeObj.height;
5827
+ if (this.resizeObjInitialInfo.width !== resizeObj.width ||
5828
+ this.resizeObjInitialInfo.height !== resizeObj.height) {
5829
+ this.nodeSizingObjectsInfo[resizeObj.id].isResized = true;
5830
+ this.nodeSizingObjectsInfo[resizeObj.id].resizeWidth = resizeObj.width;
5831
+ this.nodeSizingObjectsInfo[resizeObj.id].resizeHeight = resizeObj.height;
5829
5832
  }
5830
5833
 
5831
5834
  this.canvasController.editActionHandler({
5832
5835
  editType: "resizeObjects",
5833
5836
  editSource: "canvas",
5834
5837
  objectsInfo: this.nodeSizingObjectsInfo,
5835
- linksInfo: this.nodeSizingLinksInfo,
5838
+ detachedLinksInfo: this.nodeSizingDetLinksInfo,
5836
5839
  pipelineId: this.pipelineId
5837
5840
  });
5838
5841
  }
5839
- this.resizeObj = null;
5840
5842
  this.nodeSizing = false;
5841
5843
  this.nodeSizingObjectsInfo = [];
5842
- this.nodeSizingLinksInfo = [];
5844
+ this.nodeSizingDetLinksInfo = [];
5843
5845
  }
5844
5846
 
5845
5847
  // Finalises the sizing of a comment by calling editActionHandler
5846
5848
  // with an editComment action.
5847
- endCommentSizing() {
5849
+ endCommentSizing(comment) {
5850
+ let resizeObj = this.activePipeline.getComment(comment.id);
5848
5851
  if (this.config.enableSnapToGridType === SNAP_TO_GRID_AFTER) {
5849
- this.resizeObj = this.snapToGridObject(this.resizeObj);
5852
+ resizeObj = this.snapToGridObject(resizeObj);
5850
5853
  }
5851
5854
 
5852
5855
  // If the dimensions or position has changed, issue the command.
5853
5856
  // Note: x_pos or y_pos might change on resize if the node is sized
5854
5857
  // upwards or to the left.
5855
- if (this.resizeObjInitialInfo.x_pos !== this.resizeObj.x_pos ||
5856
- this.resizeObjInitialInfo.y_pos !== this.resizeObj.y_pos ||
5857
- this.resizeObjInitialInfo.width !== this.resizeObj.width ||
5858
- this.resizeObjInitialInfo.height !== this.resizeObj.height) {
5858
+ if (this.resizeObjInitialInfo.x_pos !== resizeObj.x_pos ||
5859
+ this.resizeObjInitialInfo.y_pos !== resizeObj.y_pos ||
5860
+ this.resizeObjInitialInfo.width !== resizeObj.width ||
5861
+ this.resizeObjInitialInfo.height !== resizeObj.height) {
5862
+ const commentSizingObjectsInfo = [];
5863
+ commentSizingObjectsInfo[resizeObj.id] = {
5864
+ width: resizeObj.width,
5865
+ height: resizeObj.height,
5866
+ x_pos: resizeObj.x_pos,
5867
+ y_pos: resizeObj.y_pos
5868
+ };
5869
+
5859
5870
  const data = {
5860
- editType: "editComment",
5871
+ editType: "resizeObjects",
5861
5872
  editSource: "canvas",
5862
- id: this.resizeObj.id,
5863
- content: this.resizeObj.content,
5864
- width: this.resizeObj.width,
5865
- height: this.resizeObj.height,
5866
- x_pos: this.resizeObj.x_pos,
5867
- y_pos: this.resizeObj.y_pos,
5873
+ objectsInfo: commentSizingObjectsInfo,
5874
+ detachedLinksInfo: {}, // Comments cannot have detached links
5868
5875
  pipelineId: this.pipelineId
5869
5876
  };
5870
5877
  this.canvasController.editActionHandler(data);
@@ -20,6 +20,7 @@ import ExpressionControl from "./../expression";
20
20
  import ExpressionSelectionPanel from "./expression-selection-panel";
21
21
  import { MESSAGE_KEYS } from "./../../../constants/constants";
22
22
  import { formatMessage } from "./../../../util/property-utils";
23
+ import { isEqual } from "lodash";
23
24
 
24
25
  export default class ExpressionBuilder extends React.Component {
25
26
  constructor(props) {
@@ -68,13 +69,13 @@ export default class ExpressionBuilder extends React.Component {
68
69
 
69
70
  onBlur(editor, evt) {
70
71
  this.lastCursorPos = editor.getCursor();
72
+ const currentValue = this.props.controller.getPropertyValue(this.props.propertyId);
71
73
  const newValue = this.editor.getValue();
72
- let skipValidate = false;
73
- if (this.expressionSelectionPanel && this.expressionSelectionPanel.contains(evt.relatedTarget)) {
74
- // don't validate on old content when adding new content
75
- skipValidate = true;
74
+ const skipValidate = this.expressionSelectionPanel && evt && this.expressionSelectionPanel.contains(evt.relatedTarget);
75
+ // update property value when value is updated OR value is to be validated
76
+ if (!isEqual(currentValue, newValue) || !skipValidate) {
77
+ this.props.controller.updatePropertyValue(this.props.propertyId, newValue, skipValidate);
76
78
  }
77
- this.props.controller.updatePropertyValue(this.props.propertyId, newValue, skipValidate);
78
79
  }
79
80
 
80
81
  editorDidMount(editor, next) {
@@ -23,7 +23,7 @@ import { UnControlled as CodeMirror } from "react-codemirror2";
23
23
  import Icon from "./../../../icons/icon.jsx";
24
24
  import { Button } from "carbon-components-react";
25
25
  import classNames from "classnames";
26
-
26
+ import { isEqual } from "lodash";
27
27
  import ValidationMessage from "./../../components/validation-message";
28
28
  import WideFlyout from "./../../components/wide-flyout";
29
29
  import { formatMessage } from "./../../util/property-utils";
@@ -102,8 +102,13 @@ class ExpressionControl extends React.Component {
102
102
  }
103
103
 
104
104
  // this is needed to ensure expression builder selection works.
105
- componentDidUpdate() {
106
- if (this.props.selectionRange && this.props.selectionRange.length > 0 && this.editor) {
105
+ componentDidUpdate(prevProps) {
106
+ if (
107
+ this.props.selectionRange &&
108
+ this.props.selectionRange.length > 0 &&
109
+ !isEqual(prevProps.selectionRange, this.props.selectionRange) &&
110
+ this.editor
111
+ ) {
107
112
  this.props.selectionRange.forEach((selected) => {
108
113
  this.editor.setSelection(selected.anchor, selected.head);
109
114
  });
@@ -225,6 +230,7 @@ class ExpressionControl extends React.Component {
225
230
  validateIcon: response.type,
226
231
  validationInProgress: false
227
232
  });
233
+ this.editor.display.input.blur();
228
234
  });
229
235
  }
230
236