@elyra/canvas 12.35.0 → 12.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/canvas-constants-766c12a9.js +2 -0
  2. package/dist/{canvas-constants-85883d4c.js.map → canvas-constants-766c12a9.js.map} +1 -1
  3. package/dist/canvas-constants-f4219d26.js +2 -0
  4. package/dist/{canvas-constants-d8652829.js.map → canvas-constants-f4219d26.js.map} +1 -1
  5. package/dist/canvas-controller-62b66fc8.js +2 -0
  6. package/dist/canvas-controller-62b66fc8.js.map +1 -0
  7. package/dist/canvas-controller-76f68572.js +2 -0
  8. package/dist/canvas-controller-76f68572.js.map +1 -0
  9. package/dist/common-canvas-339584b8.js +2 -0
  10. package/dist/common-canvas-339584b8.js.map +1 -0
  11. package/dist/common-canvas-c728f092.js +2 -0
  12. package/dist/common-canvas-c728f092.js.map +1 -0
  13. package/dist/common-canvas.es.js +1 -1
  14. package/dist/common-canvas.es.js.map +1 -1
  15. package/dist/common-canvas.js +1 -1
  16. package/dist/common-canvas.js.map +1 -1
  17. package/dist/common-properties-009d29d6.js +2 -0
  18. package/dist/common-properties-009d29d6.js.map +1 -0
  19. package/dist/common-properties-99d34523.js +2 -0
  20. package/dist/common-properties-99d34523.js.map +1 -0
  21. package/dist/context-menu-wrapper-624a1e7c.js +2 -0
  22. package/dist/context-menu-wrapper-624a1e7c.js.map +1 -0
  23. package/dist/context-menu-wrapper-ab018d6e.js +2 -0
  24. package/dist/context-menu-wrapper-ab018d6e.js.map +1 -0
  25. package/dist/{datarecord-metadata-v3-schema-531c7b07.js → datarecord-metadata-v3-schema-1f21696a.js} +2 -2
  26. package/dist/{datarecord-metadata-v3-schema-531c7b07.js.map → datarecord-metadata-v3-schema-1f21696a.js.map} +1 -1
  27. package/dist/{datarecord-metadata-v3-schema-28d4d7bb.js → datarecord-metadata-v3-schema-c2ad8862.js} +2 -2
  28. package/dist/{datarecord-metadata-v3-schema-28d4d7bb.js.map → datarecord-metadata-v3-schema-c2ad8862.js.map} +1 -1
  29. package/dist/flexible-table-4cf19e2e.js +2 -0
  30. package/dist/flexible-table-4cf19e2e.js.map +1 -0
  31. package/dist/flexible-table-8d10f5c9.js +2 -0
  32. package/dist/flexible-table-8d10f5c9.js.map +1 -0
  33. package/dist/{icon-909437d7.js → icon-5e06bfe1.js} +2 -2
  34. package/dist/{icon-909437d7.js.map → icon-5e06bfe1.js.map} +1 -1
  35. package/dist/{icon-de9c6b33.js → icon-8433d369.js} +2 -2
  36. package/dist/{icon-de9c6b33.js.map → icon-8433d369.js.map} +1 -1
  37. package/dist/{index-9960d3bf.js → index-2a61be58.js} +2 -2
  38. package/dist/{index-9960d3bf.js.map → index-2a61be58.js.map} +1 -1
  39. package/dist/{index-61e4a113.js → index-9a355ed6.js} +2 -2
  40. package/dist/{index-61e4a113.js.map → index-9a355ed6.js.map} +1 -1
  41. package/dist/lib/canvas-controller.es.js +1 -1
  42. package/dist/lib/canvas-controller.js +1 -1
  43. package/dist/lib/canvas.es.js +1 -1
  44. package/dist/lib/canvas.js +1 -1
  45. package/dist/lib/context-menu.es.js +1 -1
  46. package/dist/lib/context-menu.js +1 -1
  47. package/dist/lib/properties/field-picker.es.js +1 -1
  48. package/dist/lib/properties/field-picker.js +1 -1
  49. package/dist/lib/properties/flexible-table.es.js +1 -1
  50. package/dist/lib/properties/flexible-table.js +1 -1
  51. package/dist/lib/properties.es.js +1 -1
  52. package/dist/lib/properties.js +1 -1
  53. package/dist/styles/common-canvas.min.css +1 -1
  54. package/dist/styles/common-canvas.min.css.map +1 -1
  55. package/dist/{toolbar-cdb38f4a.js → toolbar-76733735.js} +2 -2
  56. package/dist/{toolbar-cdb38f4a.js.map → toolbar-76733735.js.map} +1 -1
  57. package/dist/{toolbar-3b5a592c.js → toolbar-85e1e463.js} +2 -2
  58. package/dist/{toolbar-3b5a592c.js.map → toolbar-85e1e463.js.map} +1 -1
  59. package/locales/common-canvas/locales/en.json +1 -1
  60. package/locales/common-canvas/locales/eo.json +1 -1
  61. package/package.json +3 -4
  62. package/src/common-canvas/canvas-controller.js +15 -6
  63. package/src/common-canvas/cc-contents.jsx +44 -6
  64. package/src/common-canvas/common-canvas-utils.js +9 -2
  65. package/src/common-canvas/common-canvas.scss +30 -3
  66. package/src/common-canvas/constants/canvas-constants.js +0 -6
  67. package/src/common-canvas/svg-canvas-d3.js +1 -3
  68. package/src/common-canvas/svg-canvas-d3.scss +0 -26
  69. package/src/common-canvas/svg-canvas-pipeline.js +6 -0
  70. package/src/common-canvas/svg-canvas-renderer.js +490 -2804
  71. package/src/common-canvas/svg-canvas-utils-drag-det-link.js +491 -0
  72. package/src/common-canvas/svg-canvas-utils-drag-new-link.js +595 -0
  73. package/src/common-canvas/svg-canvas-utils-drag-objects.js +832 -0
  74. package/src/common-canvas/svg-canvas-utils-external.js +82 -16
  75. package/src/common-canvas/svg-canvas-utils-zoom.js +780 -0
  76. package/src/common-properties/common-properties.jsx +2 -0
  77. package/src/common-properties/components/editor-form/editor-form.jsx +5 -1
  78. package/src/common-properties/properties-main/properties-main.jsx +2 -0
  79. package/src/context-menu/common-context-menu.jsx +57 -26
  80. package/src/context-menu/context-menu.scss +33 -53
  81. package/src/notification-panel/notification-panel.jsx +6 -1
  82. package/src/notification-panel/notification-panel.scss +14 -8
  83. package/src/palette/palette-content-list-item.jsx +23 -7
  84. package/src/palette/palette.scss +4 -4
  85. package/stats.html +1 -1
  86. package/dist/canvas-constants-85883d4c.js +0 -2
  87. package/dist/canvas-constants-d8652829.js +0 -2
  88. package/dist/canvas-controller-c9f3bef9.js +0 -2
  89. package/dist/canvas-controller-c9f3bef9.js.map +0 -1
  90. package/dist/canvas-controller-f7820ab0.js +0 -2
  91. package/dist/canvas-controller-f7820ab0.js.map +0 -1
  92. package/dist/common-canvas-487520d3.js +0 -2
  93. package/dist/common-canvas-487520d3.js.map +0 -1
  94. package/dist/common-canvas-e1591f51.js +0 -2
  95. package/dist/common-canvas-e1591f51.js.map +0 -1
  96. package/dist/common-properties-580436d7.js +0 -2
  97. package/dist/common-properties-580436d7.js.map +0 -1
  98. package/dist/common-properties-98a9a99f.js +0 -2
  99. package/dist/common-properties-98a9a99f.js.map +0 -1
  100. package/dist/context-menu-wrapper-19a1cf72.js +0 -2
  101. package/dist/context-menu-wrapper-19a1cf72.js.map +0 -1
  102. package/dist/context-menu-wrapper-c3a98c63.js +0 -2
  103. package/dist/context-menu-wrapper-c3a98c63.js.map +0 -1
  104. package/dist/extends-093996c9.js +0 -2
  105. package/dist/extends-093996c9.js.map +0 -1
  106. package/dist/extends-1b35a664.js +0 -2
  107. package/dist/extends-1b35a664.js.map +0 -1
  108. package/dist/flexible-table-b9c08069.js +0 -2
  109. package/dist/flexible-table-b9c08069.js.map +0 -1
  110. package/dist/flexible-table-ddd6132b.js +0 -2
  111. package/dist/flexible-table-ddd6132b.js.map +0 -1
@@ -27,9 +27,9 @@ import CommonCanvasContextToolbar from "./cc-context-toolbar.jsx";
27
27
  import CommonCanvasTextToolbar from "./cc-text-toolbar.jsx";
28
28
  import CommonCanvasStateTag from "./cc-state-tag.jsx";
29
29
  import CanvasUtils from "./common-canvas-utils.js";
30
- import { FlowData16 } from "@carbon/icons-react";
30
+ import { Button } from "carbon-components-react";
31
+ import { FlowData16, ArrowLeft16 } from "@carbon/icons-react";
31
32
  import { DND_DATA_TEXT, STATE_TAG_LOCKED, STATE_TAG_READ_ONLY } from "./constants/canvas-constants";
32
-
33
33
  import Logger from "../logging/canvas-logger.js";
34
34
  import SVGCanvasD3 from "./svg-canvas-d3.js";
35
35
 
@@ -92,6 +92,7 @@ class CanvasContents extends React.Component {
92
92
  this.onKeyDown = this.onKeyDown.bind(this);
93
93
  this.onKeyUp = this.onKeyUp.bind(this);
94
94
  this.onMouseMove = this.onMouseMove.bind(this);
95
+ this.onClickReturnToPrevious = this.onClickReturnToPrevious.bind(this);
95
96
 
96
97
  // Variables to handle strange HTML drag and drop behaviors. That is, pairs
97
98
  // of dragEnter/dragLeave events are fired as an external object is
@@ -200,12 +201,16 @@ class CanvasContents extends React.Component {
200
201
  } else if (CanvasUtils.isCmndCtrlPressed(evt) &&
201
202
  !evt.shiftKey && evt.keyCode === Z_KEY && actions.undo) {
202
203
  CanvasUtils.stopPropagationAndPreventDefault(evt);
203
- this.props.canvasController.keyboardActionHandler("undo");
204
+ if (this.props.canvasController.canUndo()) {
205
+ this.props.canvasController.keyboardActionHandler("undo");
206
+ }
204
207
 
205
208
  } else if (CanvasUtils.isCmndCtrlPressed(evt) &&
206
209
  ((evt.shiftKey && evt.keyCode === Z_KEY) || evt.keyCode === Y_KEY && actions.redo)) {
207
210
  CanvasUtils.stopPropagationAndPreventDefault(evt);
208
- this.props.canvasController.keyboardActionHandler("redo");
211
+ if (this.props.canvasController.canRedo()) {
212
+ this.props.canvasController.keyboardActionHandler("redo");
213
+ }
209
214
 
210
215
  } else if (CanvasUtils.isCmndCtrlPressed(evt) && evt.keyCode === C_KEY && actions.copyToClipboard) {
211
216
  CanvasUtils.stopPropagationAndPreventDefault(evt);
@@ -266,6 +271,13 @@ class CanvasContents extends React.Component {
266
271
  }
267
272
  }
268
273
 
274
+ // Handles the click on the "Return to previous flow" button.
275
+ onClickReturnToPrevious(evt) {
276
+ evt.stopPropagation();
277
+ evt.preventDefault();
278
+ this.props.canvasController.displayPreviousPipeline();
279
+ }
280
+
269
281
  setCanvasInfo() {
270
282
  // TODO - Eventually move nodeLayout and canvasLayout into redux and then
271
283
  // pass them into this.svgCanvasD3() as props.
@@ -333,6 +345,30 @@ class CanvasContents extends React.Component {
333
345
  return emptyCanvas;
334
346
  }
335
347
 
348
+ getReturnToPreviousBtn() {
349
+ let returnToPrevious = null;
350
+ if (!this.props.canvasController.isPrimaryPipelineEmpty() &&
351
+ (this.props.canvasController.isDisplayingFullPageSubFlow() ||
352
+ this.props.canvasConfig?.enableCanvasLayout?.alwaysDisplayBackToParentFlow)) {
353
+ const label = this.getLabel("canvas.returnToPrevious");
354
+ returnToPrevious = (
355
+ <div className={"return-to-previous"}>
356
+ <Button kind={"tertiary"}
357
+ onClick={this.onClickReturnToPrevious}
358
+ aria-label={label}
359
+ size={"md"}
360
+ >
361
+ <div className={"return-to-previous-content"}>
362
+ <ArrowLeft16 />
363
+ <span>{label}</span>
364
+ </div>
365
+ </Button>
366
+ </div>
367
+ );
368
+ }
369
+ return returnToPrevious;
370
+ }
371
+
336
372
  getContextMenu() {
337
373
  if (this.props.canvasConfig.enableContextToolbar) {
338
374
  return (
@@ -531,6 +567,7 @@ class CanvasContents extends React.Component {
531
567
 
532
568
  const stateTag = this.getStateTag();
533
569
  const emptyCanvas = this.getEmptyCanvas();
570
+ const returnToPreviousBtn = this.getReturnToPreviousBtn();
534
571
  const contextMenu = this.getContextMenu();
535
572
  const textToolbar = this.getTextToolbar();
536
573
  const dropZoneCanvas = this.getDropZone();
@@ -547,9 +584,10 @@ class CanvasContents extends React.Component {
547
584
  onDragEnter={this.dragEnter}
548
585
  onDragLeave={this.dragLeave}
549
586
  >
550
- {stateTag}
551
- {emptyCanvas}
552
587
  {svgCanvasDiv}
588
+ {emptyCanvas}
589
+ {returnToPreviousBtn}
590
+ {stateTag}
553
591
  {contextMenu}
554
592
  {textToolbar}
555
593
  {dropZoneCanvas}
@@ -863,9 +863,16 @@ export default class CanvasUtils {
863
863
  }
864
864
 
865
865
  // Returns an array of selected object IDs for nodes, comments and links
866
- // that are within the region provided. Links are only included if
866
+ // that are within the region (inReg) provided. Links are only included if
867
867
  // includeLinks is truthy.
868
- static selectInRegion(region, pipeline, includeLinks, linkType, enableAssocLinkType) {
868
+ static selectInRegion(inReg, pipeline, includeLinks, linkType, enableAssocLinkType) {
869
+ const region = {
870
+ x1: inReg.x,
871
+ y1: inReg.y,
872
+ x2: inReg.x + inReg.width,
873
+ y2: inReg.y + inReg.height
874
+ };
875
+
869
876
  var regionSelections = [];
870
877
  for (const node of pipeline.nodes) {
871
878
  if (!this.isSuperBindingNode(node) && // Don't include binding nodes in select
@@ -57,7 +57,6 @@ $panel-border-color: $ui-03;
57
57
  cursor: default;
58
58
  overflow: hidden;
59
59
  position: relative; // This allows the State Tag to have positio: absolute
60
-
61
60
  }
62
61
 
63
62
  .right-flyout-panel {
@@ -74,7 +73,6 @@ $panel-border-color: $ui-03;
74
73
  // Make sure the bottom panel appear above the empty canvas content
75
74
  // (when displayed) in the flow editor div.
76
75
  z-index: 1;
77
-
78
76
  }
79
77
 
80
78
  .bottom-panel-drag {
@@ -201,7 +199,6 @@ $panel-border-color: $ui-03;
201
199
  grid-template-columns: 1fr;
202
200
  }
203
201
 
204
-
205
202
  /* Styles for empty canvas objects */
206
203
 
207
204
  .empty-canvas {
@@ -241,6 +238,36 @@ $panel-border-color: $ui-03;
241
238
  text-align: center;
242
239
  }
243
240
 
241
+ /* Styles for 'Return to previous flow' button - shown for full-page sub-flows */
242
+
243
+ .return-to-previous {
244
+ position: absolute;
245
+ left: 15px;
246
+ top: 15px;
247
+ background-color: $ui-background;
248
+ & button {
249
+ background-color: $ui-background;
250
+ padding-right: 20px;
251
+ }
252
+ & button:hover,
253
+ & button:focus {
254
+ background-color: $ui-03;
255
+ color: $interactive-01;
256
+ }
257
+ & .return-to-previous-content {
258
+ display: flex;
259
+ background-color: transparent;
260
+ & svg {
261
+ margin-top: 1px;
262
+ margin-left: 4px;
263
+ margin-right: 7px;
264
+ }
265
+ & span {
266
+ padding-bottom: 2px;
267
+ }
268
+ }
269
+ }
270
+
244
271
  /* Styles for drop zone canvas objects */
245
272
 
246
273
  .dropzone-canvas {
@@ -235,12 +235,6 @@ export const NODE_WARNING_ICON =
235
235
  "<path style=\"stroke-width: 0; fill: #161616; opacity: 1;\" d=\"M7.5 4h1v5h-1V4zm.5 8.2c-.4 0-.8-.4-.8-.8s.3-.8.8-.8c.4 0 .8.4.8.8s-.4.8-.8.8z\"></path>" +
236
236
  "</svg>";
237
237
 
238
- export const LEFT_ARROW_ICON =
239
- "<svg focusable=\"false\" preserveAspectRatio=\"xMidYMid meet\" xmlns=\"http://www.w3.org/2000/svg\" " +
240
- "width=\"16\" height=\"16\" viewBox=\"0 0 32 32\" aria-hidden=\"true\" style=\"will-change: transform;\">" +
241
- "<path d=\"M13 26L14.41 24.59 6.83 17 29 17 29 15 6.83 15 14.41 7.41 13 6 3 16 13 26z\"></path>" +
242
- "<title>Arrow left</title></svg>";
243
-
244
238
  // This image is stored in the format to be shown as an <img> in the JSX
245
239
  // created by palette-flyout-content-category render method.
246
240
  export const SAVED_NODES_FOLDER_ICON =
@@ -107,9 +107,7 @@ export default class SVGCanvasD3 {
107
107
  }
108
108
 
109
109
  convertPageCoordsToSnappedCanvasCoords(pos) {
110
- let positon = this.renderer.convertPageCoordsToCanvasCoords(pos.x, pos.y);
111
- positon = this.renderer.getMousePosSnapToGrid(positon);
112
- return positon;
110
+ return this.renderer.convertPageCoordsToSnappedCanvasCoords(pos);
113
111
  }
114
112
 
115
113
  nodeTemplateDragStart(nodeTemplate) {
@@ -21,10 +21,6 @@ $canvas-background-color: $ui-background;
21
21
  $region-selector-stroke-color: $ui-05;
22
22
  $region-selector-fill-color: $ui-03;
23
23
 
24
- // 'Back to previous flow' control colors
25
- $back-to-previous-flow-box-color: $interactive-01;
26
- $back-to-previous-flow-box-fill-hover: $ui-03;
27
-
28
24
  // Node colors
29
25
  $node-body-stroke: $ui-05;
30
26
  $node-body-fill: $ui-01;
@@ -154,28 +150,6 @@ $link-highlight-color: $support-04;
154
150
  fill: transparent;
155
151
  }
156
152
 
157
- /* Back to Previous Flow control */
158
-
159
- .d3-back-to-previous-flow-box {
160
- stroke: $back-to-previous-flow-box-color;
161
- fill: $canvas-background-color;
162
- }
163
-
164
- .d3-back-to-previous-flow-box[data-pointer-hover="yes"] {
165
- stroke: $back-to-previous-flow-box-color;
166
- fill: $back-to-previous-flow-box-fill-hover;
167
- }
168
-
169
- .d3-back-to-previous-flow-text {
170
- font-size: 14px;
171
- font-weight: 400;
172
- fill: $back-to-previous-flow-box-color;
173
- }
174
-
175
- .d3-back-to-previous-flow-box, .d3-back-to-previous-flow-text {
176
- cursor: pointer;
177
- }
178
-
179
153
  /* Ghost div and node used when dragging a node from the palette */
180
154
 
181
155
  .d3-ghost-div {
@@ -76,7 +76,13 @@ export default class SVGCanvasPipeline {
76
76
  return (typeof node === "undefined") ? null : node;
77
77
  }
78
78
 
79
+ // Returns nodes from the active pipeline. If nodeIds is
80
+ // provided as an array the nodes correspondong to those IDs
81
+ // are returned otherwise all nodes are retunred.
79
82
  getNodes(nodeIds) {
83
+ if (!nodeIds) {
84
+ return this.pipeline.nodes;
85
+ }
80
86
  const nodes = [];
81
87
  nodeIds.forEach((nId) => {
82
88
  const n = this.getNode(nId);