@elyra/canvas 12.35.0 → 12.36.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 (36) hide show
  1. package/dist/{canvas-controller-c9f3bef9.js → canvas-controller-7beb80ec.js} +2 -2
  2. package/dist/{canvas-controller-f7820ab0.js.map → canvas-controller-7beb80ec.js.map} +1 -1
  3. package/dist/{canvas-controller-f7820ab0.js → canvas-controller-b70d0f98.js} +2 -2
  4. package/dist/{canvas-controller-c9f3bef9.js.map → canvas-controller-b70d0f98.js.map} +1 -1
  5. package/dist/{common-canvas-487520d3.js → common-canvas-86fb7d21.js} +2 -2
  6. package/dist/{common-canvas-487520d3.js.map → common-canvas-86fb7d21.js.map} +1 -1
  7. package/dist/{common-canvas-e1591f51.js → common-canvas-a6bfce5e.js} +2 -2
  8. package/dist/{common-canvas-e1591f51.js.map → common-canvas-a6bfce5e.js.map} +1 -1
  9. package/dist/common-canvas.es.js +1 -1
  10. package/dist/common-canvas.js +1 -1
  11. package/dist/common-properties-a34905c3.js +2 -0
  12. package/dist/common-properties-a34905c3.js.map +1 -0
  13. package/dist/common-properties-d5775a12.js +2 -0
  14. package/dist/common-properties-d5775a12.js.map +1 -0
  15. package/dist/lib/canvas-controller.es.js +1 -1
  16. package/dist/lib/canvas-controller.js +1 -1
  17. package/dist/lib/canvas.es.js +1 -1
  18. package/dist/lib/canvas.js +1 -1
  19. package/dist/lib/properties.es.js +1 -1
  20. package/dist/lib/properties.js +1 -1
  21. package/dist/styles/common-canvas.min.css +1 -1
  22. package/dist/styles/common-canvas.min.css.map +1 -1
  23. package/package.json +2 -2
  24. package/src/common-canvas/canvas-controller.js +8 -6
  25. package/src/common-canvas/cc-contents.jsx +2 -2
  26. package/src/common-canvas/svg-canvas-renderer.js +31 -18
  27. package/src/common-properties/common-properties.jsx +2 -0
  28. package/src/common-properties/components/editor-form/editor-form.jsx +5 -1
  29. package/src/common-properties/properties-main/properties-main.jsx +2 -0
  30. package/src/notification-panel/notification-panel.scss +10 -6
  31. package/src/palette/palette.scss +4 -4
  32. package/stats.html +1 -1
  33. package/dist/common-properties-580436d7.js +0 -2
  34. package/dist/common-properties-580436d7.js.map +0 -1
  35. package/dist/common-properties-98a9a99f.js +0 -2
  36. package/dist/common-properties-98a9a99f.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elyra/canvas",
3
- "version": "12.35.0",
3
+ "version": "12.36.0",
4
4
  "description": "Elyra common-canvas",
5
5
  "main": "dist/common-canvas.js",
6
6
  "module": "dist/common-canvas.es.js",
@@ -70,7 +70,7 @@
70
70
  "deep-freeze": "0.0.1",
71
71
  "enzyme": "3.11.0",
72
72
  "enzyme-adapter-react-16": "1.15.5",
73
- "eslint": "7.9.0",
73
+ "eslint": "^7.32.0",
74
74
  "eslint-config-canvas": "file:../eslint-config-canvas",
75
75
  "eslint-plugin-import": "2.25.3",
76
76
  "eslint-plugin-react": "7.21.2",
@@ -2045,13 +2045,15 @@ export default class CanvasController {
2045
2045
  // the host app from editActionHandler. The editActionHandler method
2046
2046
  // does not intercept this action.
2047
2047
  createNodeFromDataAt(x, y, dropData, pipelineId) {
2048
- const data = dropData.data;
2049
- data.offsetX = x;
2050
- data.offsetY = y;
2051
- data.pipelineId = pipelineId;
2052
- data.editSource = "canvas";
2048
+ if (dropData?.data) {
2049
+ const data = dropData.data;
2050
+ data.offsetX = x;
2051
+ data.offsetY = y;
2052
+ data.pipelineId = pipelineId;
2053
+ data.editSource = "canvas";
2053
2054
 
2054
- this.editActionHandler(data);
2055
+ this.editActionHandler(data);
2056
+ }
2055
2057
  }
2056
2058
 
2057
2059
  canNewNodeBeDroppedOnLink(nodeType) {
@@ -547,9 +547,9 @@ class CanvasContents extends React.Component {
547
547
  onDragEnter={this.dragEnter}
548
548
  onDragLeave={this.dragLeave}
549
549
  >
550
- {stateTag}
551
- {emptyCanvas}
552
550
  {svgCanvasDiv}
551
+ {emptyCanvas}
552
+ {stateTag}
553
553
  {contextMenu}
554
554
  {textToolbar}
555
555
  {dropZoneCanvas}
@@ -4038,7 +4038,9 @@ export default class SVGCanvasRenderer {
4038
4038
 
4039
4039
  removeContextToolbar() {
4040
4040
  this.canvasController.setMouseInObject(false);
4041
- setTimeout(() => this.canvasController.closeContextToolbar(), 200);
4041
+ if (this.canvasController.isContextMenuDisplayed()) {
4042
+ setTimeout(() => this.canvasController.closeContextToolbar(), 200);
4043
+ }
4042
4044
  }
4043
4045
 
4044
4046
  recreateContextToolbar(d3Event, d, objType) {
@@ -6409,27 +6411,12 @@ export default class SVGCanvasRenderer {
6409
6411
  handlesGrp
6410
6412
  .append(this.canvasLayout.linkStartHandleObject)
6411
6413
  .attr("class", (d) => "d3-link-handle-start")
6412
- // Use mouse down instead of click because it gets called before drag start.
6413
- .on("mousedown", (d3Event, d) => {
6414
- this.logger.log("Link start handle - mouse down");
6415
- if (!this.config.enableDragWithoutSelect) {
6416
- this.selectObjectD3Event(d3Event, d, "link");
6417
- }
6418
- this.logger.log("Link end handle - finished mouse down");
6419
- });
6414
+ .call(this.attachStartHandleListeners.bind(this));
6420
6415
 
6421
6416
  handlesGrp
6422
6417
  .append(this.canvasLayout.linkEndHandleObject)
6423
6418
  .attr("class", (d) => "d3-link-handle-end")
6424
- // Use mouse down instead of click because it gets called before drag start.
6425
- .on("mousedown", (d3Event, d) => {
6426
- this.logger.log("Link end handle - mouse down");
6427
- if (!this.config.enableDragWithoutSelect) {
6428
- this.selectObjectD3Event(d3Event, d, "link");
6429
- }
6430
- this.logger.log("Link end handle - finished mouse down");
6431
- });
6432
-
6419
+ .call(this.attachEndHandleListeners.bind(this));
6433
6420
  }
6434
6421
 
6435
6422
  // Updates the start and end link handles for the handle groups passed in.
@@ -6492,6 +6479,32 @@ export default class SVGCanvasRenderer {
6492
6479
  }
6493
6480
  }
6494
6481
 
6482
+ // Attaches any required event listeners to the start handles of the links.
6483
+ attachStartHandleListeners(startHandles) {
6484
+ startHandles
6485
+ // Use mouse down instead of click because it gets called before drag start.
6486
+ .on("mousedown", (d3Event, d) => {
6487
+ this.logger.log("Link start handle - mouse down");
6488
+ if (!this.config.enableDragWithoutSelect) {
6489
+ this.selectObjectD3Event(d3Event, d, "link");
6490
+ }
6491
+ this.logger.log("Link end handle - finished mouse down");
6492
+ });
6493
+ }
6494
+
6495
+ // Attaches any required event listeners to the end handles of the links.
6496
+ attachEndHandleListeners(endHandles) {
6497
+ endHandles
6498
+ // Use mouse down instead of click because it gets called before drag start.
6499
+ .on("mousedown", (d3Event, d) => {
6500
+ this.logger.log("Link end handle - mouse down");
6501
+ if (!this.config.enableDragWithoutSelect) {
6502
+ this.selectObjectD3Event(d3Event, d, "link");
6503
+ }
6504
+ this.logger.log("Link end handle - finished mouse down");
6505
+ });
6506
+ }
6507
+
6495
6508
  // Sets the custom inline styles on the link object passed in.
6496
6509
  setLinkLineStyles(linkObj, link, type) {
6497
6510
  const style = CanvasUtils.getObjectStyle(link, "line", type);
@@ -251,6 +251,7 @@ CommonProperties.propTypes = {
251
251
  maxLengthForSingleLineControls: PropTypes.number,
252
252
  convertValueDataTypes: PropTypes.bool,
253
253
  showRequiredIndicator: PropTypes.bool,
254
+ showAlertsTab: PropTypes.bool,
254
255
  locale: PropTypes.string
255
256
  }),
256
257
  callbacks: PropTypes.shape({
@@ -290,6 +291,7 @@ CommonProperties.defaultProps = {
290
291
  maxLengthForSingleLineControls: 128,
291
292
  convertValueDataTypes: false,
292
293
  showRequiredIndicator: true,
294
+ showAlertsTab: true,
293
295
  locale: DEFAULT_LOCALE
294
296
  },
295
297
  callbacks: {
@@ -87,6 +87,9 @@ class EditorForm extends React.Component {
87
87
  }
88
88
 
89
89
  _getMessageCountForCategory(tab) {
90
+ if (!this.props.showAlertsTab) {
91
+ return null;
92
+ }
90
93
  if (tab.group === ALERT_TAB_GROUP) {
91
94
  return " (" + this.messages.length + ")";
92
95
  }
@@ -609,7 +612,7 @@ class EditorForm extends React.Component {
609
612
 
610
613
  render() {
611
614
  let uiItems = this.props.controller.getUiItems();
612
- if (!isEmpty(this.messages) && uiItems[0].itemType === "primaryTabs" && uiItems[0].tabs && uiItems[0].tabs.length > 1) {
615
+ if (this.props.showAlertsTab && !isEmpty(this.messages) && uiItems[0].itemType === "primaryTabs" && uiItems[0].tabs && uiItems[0].tabs.length > 1) {
613
616
  // create a new copy for uiItems object so that alerts are not added multiple times
614
617
  uiItems = cloneDeep(uiItems);
615
618
  uiItems[0].tabs.unshift(this.genAlertsTab(this.messages)); // add alerts tab to the beginning of the tabs array
@@ -668,6 +671,7 @@ EditorForm.propTypes = {
668
671
  customPanels: PropTypes.array,
669
672
  rightFlyout: PropTypes.bool,
670
673
  categoryView: PropTypes.oneOf([CATEGORY_VIEW.ACCORDIONS, CATEGORY_VIEW.TABS]),
674
+ showAlertsTab: PropTypes.bool,
671
675
  activeTab: PropTypes.string, // set by redux
672
676
  setActiveTab: PropTypes.func, // set by redux
673
677
  messages: PropTypes.array // set by redux
@@ -517,6 +517,7 @@ class PropertiesMain extends React.Component {
517
517
  customPanels={this.props.customPanels}
518
518
  rightFlyout={this.props.propertiesConfig.rightFlyout}
519
519
  categoryView={this.props.propertiesConfig.categoryView}
520
+ showAlertsTab={this.props.propertiesConfig.showAlertsTab !== false}
520
521
  />);
521
522
 
522
523
  if (this.props.propertiesConfig.containerType === "Editing") {
@@ -630,6 +631,7 @@ PropertiesMain.propTypes = {
630
631
  maxLengthForSingleLineControls: PropTypes.number,
631
632
  convertValueDataTypes: PropTypes.bool,
632
633
  showRequiredIndicator: PropTypes.bool,
634
+ showAlertsTab: PropTypes.bool,
633
635
  locale: PropTypes.string
634
636
  }),
635
637
  callbacks: PropTypes.shape({
@@ -14,9 +14,12 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- $notification-panel-header-height: 35px;
17
+ $notification-panel-header-height: 33px;
18
+ $notification-panel-subtitle-height: 20px;
18
19
  $notification-message-height: 48px;
19
20
  $notification-left-border-color-width: 4px;
21
+ $notification-panel-button-container-height: 49px;
22
+ $notification-panel-header-container-height: $notification-panel-header-height + $notification-panel-subtitle-height + 32px;
20
23
  $toolbar-button-height: 41px; // Allow one extra pixel for the toolbar border
21
24
 
22
25
  // This section adds an ease-in ease-out effect for the notification-panel-container
@@ -37,7 +40,8 @@ $toolbar-button-height: 41px; // Allow one extra pixel for the toolbar border
37
40
  .notification-panel {
38
41
  position: absolute;
39
42
  width: 320px;
40
- height: fit-content;
43
+ height: 100%;
44
+ max-height: 635px;
41
45
  right: 0;
42
46
  top: $toolbar-button-height;
43
47
  }
@@ -70,7 +74,7 @@ $toolbar-button-height: 41px; // Allow one extra pixel for the toolbar border
70
74
 
71
75
  .notification-panel-button-container {
72
76
  width: 100%;
73
- height: 49px;
77
+ height: $notification-panel-button-container-height;
74
78
  background-color: $ui-01;
75
79
  display: flex;
76
80
  justify-content: space-between;
@@ -82,11 +86,11 @@ $toolbar-button-height: 41px; // Allow one extra pixel for the toolbar border
82
86
 
83
87
  .notification-panel-messages-container {
84
88
  width: inherit;
85
- max-height: calc(100% - #{$notification-panel-header-height});
86
- height: fit-content;
89
+ max-height: calc(100% - #{$notification-panel-header-height} - #{$notification-panel-subtitle-height});
90
+ height: 100%;
87
91
  }
88
92
  .notification-panel-messages {
89
- max-height: 500px;
93
+ max-height: calc(100% - #{$notification-panel-header-container-height} - #{$notification-panel-button-container-height});
90
94
  height: fit-content;
91
95
  overflow-y: auto;
92
96
  line-height: normal;
@@ -275,18 +275,18 @@ $palette-search-container-height: 41px;
275
275
  }
276
276
 
277
277
  .palette-flyout-category-text-abbr {
278
- line-height: 46px; /* Must be same as containing div height */
278
+ line-height: 1.2;
279
279
  margin-left: 0;
280
280
  }
281
281
 
282
282
  .palette-flyout-category-text-no-image {
283
- line-height: 46px; /* Must be same as containing div height */
284
- margin-left: 16px;
283
+ line-height: 1.2;
284
+ margin-left: 10px;
285
285
  width: 170px;
286
286
  }
287
287
 
288
288
  .palette-flyout-category-count {
289
- line-height: 46px; /* Must be same as containing div height */
289
+ line-height: 1.2;
290
290
  padding-left: 5px;
291
291
  }
292
292