@elyra/canvas 12.36.0 → 12.38.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 (116) 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-9be06eb4.js +2 -0
  10. package/dist/common-canvas-9be06eb4.js.map +1 -0
  11. package/dist/common-canvas-e201c174.js +2 -0
  12. package/dist/common-canvas-e201c174.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-7ad71160.js +2 -0
  18. package/dist/{common-properties-d5775a12.js.map → common-properties-7ad71160.js.map} +1 -1
  19. package/dist/common-properties-f1c69af7.js +2 -0
  20. package/dist/{common-properties-a34905c3.js.map → common-properties-f1c69af7.js.map} +1 -1
  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/de.json +1 -0
  60. package/locales/common-canvas/locales/en.json +1 -1
  61. package/locales/common-canvas/locales/eo.json +1 -1
  62. package/locales/common-canvas/locales/es.json +1 -0
  63. package/locales/common-canvas/locales/fr.json +1 -0
  64. package/locales/common-canvas/locales/it.json +1 -0
  65. package/locales/common-canvas/locales/ja.json +1 -0
  66. package/locales/common-canvas/locales/ko.json +1 -0
  67. package/locales/common-canvas/locales/pt-br.json +1 -0
  68. package/locales/common-canvas/locales/sv.json +1 -0
  69. package/locales/common-canvas/locales/zh-CN.json +1 -0
  70. package/locales/common-canvas/locales/zh-TW.json +1 -0
  71. package/package.json +2 -3
  72. package/src/common-canvas/canvas-controller.js +7 -0
  73. package/src/common-canvas/cc-contents.jsx +42 -4
  74. package/src/common-canvas/common-canvas-utils.js +9 -2
  75. package/src/common-canvas/common-canvas.scss +30 -3
  76. package/src/common-canvas/constants/canvas-constants.js +0 -6
  77. package/src/common-canvas/svg-canvas-d3.js +1 -3
  78. package/src/common-canvas/svg-canvas-d3.scss +0 -26
  79. package/src/common-canvas/svg-canvas-pipeline.js +6 -0
  80. package/src/common-canvas/svg-canvas-renderer.js +488 -2815
  81. package/src/common-canvas/svg-canvas-utils-drag-det-link.js +491 -0
  82. package/src/common-canvas/svg-canvas-utils-drag-new-link.js +595 -0
  83. package/src/common-canvas/svg-canvas-utils-drag-objects.js +832 -0
  84. package/src/common-canvas/svg-canvas-utils-external.js +82 -16
  85. package/src/common-canvas/svg-canvas-utils-zoom.js +780 -0
  86. package/src/common-properties/properties-controller.js +5 -0
  87. package/src/context-menu/common-context-menu.jsx +57 -26
  88. package/src/context-menu/context-menu.scss +33 -53
  89. package/src/notification-panel/notification-panel.jsx +21 -21
  90. package/src/notification-panel/notification-panel.scss +16 -15
  91. package/src/palette/palette-content-list-item.jsx +23 -7
  92. package/stats.html +1 -1
  93. package/dist/canvas-constants-85883d4c.js +0 -2
  94. package/dist/canvas-constants-d8652829.js +0 -2
  95. package/dist/canvas-controller-7beb80ec.js +0 -2
  96. package/dist/canvas-controller-7beb80ec.js.map +0 -1
  97. package/dist/canvas-controller-b70d0f98.js +0 -2
  98. package/dist/canvas-controller-b70d0f98.js.map +0 -1
  99. package/dist/common-canvas-86fb7d21.js +0 -2
  100. package/dist/common-canvas-86fb7d21.js.map +0 -1
  101. package/dist/common-canvas-a6bfce5e.js +0 -2
  102. package/dist/common-canvas-a6bfce5e.js.map +0 -1
  103. package/dist/common-properties-a34905c3.js +0 -2
  104. package/dist/common-properties-d5775a12.js +0 -2
  105. package/dist/context-menu-wrapper-19a1cf72.js +0 -2
  106. package/dist/context-menu-wrapper-19a1cf72.js.map +0 -1
  107. package/dist/context-menu-wrapper-c3a98c63.js +0 -2
  108. package/dist/context-menu-wrapper-c3a98c63.js.map +0 -1
  109. package/dist/extends-093996c9.js +0 -2
  110. package/dist/extends-093996c9.js.map +0 -1
  111. package/dist/extends-1b35a664.js +0 -2
  112. package/dist/extends-1b35a664.js.map +0 -1
  113. package/dist/flexible-table-b9c08069.js +0 -2
  114. package/dist/flexible-table-b9c08069.js.map +0 -1
  115. package/dist/flexible-table-ddd6132b.js +0 -2
  116. package/dist/flexible-table-ddd6132b.js.map +0 -1
@@ -131,6 +131,11 @@ export default class PropertiesController {
131
131
  return get(this.propertiesConfig, "locale", DEFAULT_LOCALE);
132
132
  }
133
133
 
134
+ // Return the id of top-level active tab or accordion
135
+ getTopLevelActiveGroupId() {
136
+ return this.propertiesStore.getActiveTab();
137
+ }
138
+
134
139
  isTearsheetContainer() {
135
140
  return this.propertiesConfig.containerType === "Tearsheet";
136
141
  }
@@ -17,21 +17,22 @@
17
17
 
18
18
  import React from "react";
19
19
  import PropTypes from "prop-types";
20
- import { MenuItem, SubMenu } from "react-contextmenu";
21
20
  import { ChevronRight16 } from "@carbon/icons-react";
22
21
  import ColorPicker from "../color-picker";
23
22
 
24
23
  // context-menu sizing
25
- const CONTEXT_MENU_WIDTH = 160; // see context-menu.css .react-context-menu margin
26
- const CONTEXT_MENU_LINK_HEIGHT = 30; // see context-menu.css .react-context-menu-item height
27
- const CONTEXT_MENU_DIVIDER_HEIGHT = 1; // see context-menu.css .react-context-menu-item height
24
+ const CONTEXT_MENU_WIDTH = 160; // See context-menu.scss
25
+ const CONTEXT_MENU_LINK_HEIGHT = 30; // See context-menu.scss
26
+ const CONTEXT_MENU_DIVIDER_HEIGHT = 1; // See context-menu.scss
28
27
  const EXTRA_OFFSET = 5; // Extra offset for vertical menu positioning
29
28
 
30
29
 
31
30
  class CommonContextMenu extends React.Component {
32
31
  constructor(props) {
33
32
  super(props);
34
- this.state = {};
33
+ this.state = {
34
+ displaySubMenuAction: ""
35
+ };
35
36
  this.itemSelected = this.itemSelected.bind(this);
36
37
  this.colorClicked = this.colorClicked.bind(this);
37
38
  }
@@ -53,6 +54,7 @@ class CommonContextMenu extends React.Component {
53
54
  this.props.contextHandler("colorSelectedObjects", { color });
54
55
  }
55
56
 
57
+ // Returns the size of the menu passed in.
56
58
  calculateMenuSize(menu) {
57
59
  var numDividers = 0;
58
60
  for (let i = 0; i < menu.length; ++i) {
@@ -101,6 +103,7 @@ class CommonContextMenu extends React.Component {
101
103
  return menuPos;
102
104
  }
103
105
 
106
+ // Returns true of all the items in a sub-menu are disabled.
104
107
  areAllSubmenuItemsDisabled(submenuItems) {
105
108
  let itemCount = 0;
106
109
  let disabledCount = 0;
@@ -115,11 +118,8 @@ class CommonContextMenu extends React.Component {
115
118
  return disabledCount === itemCount;
116
119
  }
117
120
 
121
+ // Builds a new menu based on the menu defintion passed in.
118
122
  buildMenu(menuDefinition, menuSize, menuPos, canvasRect) {
119
- const customDivider = {
120
- className: "contextmenu-divider"
121
- };
122
-
123
123
  const menuItems = [];
124
124
 
125
125
  let runningYPos = 0;
@@ -134,7 +134,7 @@ class CommonContextMenu extends React.Component {
134
134
 
135
135
  if (divider) {
136
136
  if (!previousDivider) {
137
- menuItems.push(<MenuItem attributes={customDivider} key={i + 1} onClick={() => {}} divider />);
137
+ menuItems.push(<div key={i + 1} className={"context-menu-divider"} />);
138
138
  runningYPos += CONTEXT_MENU_DIVIDER_HEIGHT;
139
139
  previousDivider = true;
140
140
  }
@@ -152,7 +152,7 @@ class CommonContextMenu extends React.Component {
152
152
 
153
153
  } else if (submenu) {
154
154
  previousDivider = false;
155
- const disabled = { disabled: this.areAllSubmenuItemsDisabled(menuDefinition[i].menu) };
155
+ const disabled = this.areAllSubmenuItemsDisabled(menuDefinition[i].menu);
156
156
  const subMenuSize = this.calculateMenuSize(menuDefinition[i].menu);
157
157
  const subMenuContent = this.buildMenu(menuDefinition[i].menu, menuSize, menuPos, canvasRect);
158
158
 
@@ -164,12 +164,18 @@ class CommonContextMenu extends React.Component {
164
164
 
165
165
  } else {
166
166
  previousDivider = false;
167
- const disabled = { disabled: menuDefinition[i].enable === false };
168
- menuItems.push(
169
- <MenuItem onClick={this.itemSelected.bind(null, menuDefinition[i].action)} key={i + 1} {...disabled}>
167
+ const className = "context-menu-item" +
168
+ (menuDefinition[i].enable === false ? " disabled" : "");
169
+
170
+ const onClickFunction = menuDefinition[i].enable === false
171
+ ? null
172
+ : this.itemSelected.bind(null, menuDefinition[i].action);
173
+
174
+ menuItems.push((
175
+ <div key={i + 1} className={className} onClick={onClickFunction} role="menuitem">
170
176
  {menuDefinition[i].label}
171
- </MenuItem>
172
- );
177
+ </div>
178
+ ));
173
179
  runningYPos += CONTEXT_MENU_LINK_HEIGHT;
174
180
  }
175
181
  }
@@ -182,20 +188,39 @@ class CommonContextMenu extends React.Component {
182
188
  );
183
189
  }
184
190
 
191
+ subMenuMouseEnter(action) {
192
+ this.setState({ displaySubMenuAction: action });
193
+ }
194
+
195
+ subMenuMouseLeave(action) {
196
+ this.setState({ displaySubMenuAction: "" });
197
+ }
198
+
199
+ // Builds a sub-menu for the menuitem identified by the index into the menudefintion.
185
200
  buildSubMenu(menuDefinition, index, subMenuContent, runningYPos, menuPos,
186
201
  menuSize, subMenuSize, canvasRect, disabled) {
187
202
  const rtl = this.buildRtlState(menuPos, menuSize, subMenuSize, canvasRect);
188
- const subMenuPosStyle = this.buildSubMenuPosStyle(runningYPos, menuPos, subMenuSize, canvasRect);
203
+ const subMenuPosStyle = this.buildSubMenuPosStyle(runningYPos, menuPos, subMenuSize, canvasRect, rtl);
204
+ const menuItem = menuDefinition[index];
189
205
 
190
206
  const icon = (<ChevronRight16 />);
191
- const menuItem = <div>{menuDefinition[index].label}{icon} </div>;
207
+ const menuItemContent = <div>{menuItem.label}{icon} </div>;
208
+ const menuItemClass = "context-menu-item " + (disabled ? " disabled" : "");
209
+ const subMenuClass = "context-menu-popover context-menu-submenu" +
210
+ (this.state.displaySubMenuAction === menuItem.action ? " context-menu--visible" : "");
211
+ const onMouseEnter = (disabled ? null : this.subMenuMouseEnter.bind(this, menuItem.action));
212
+ const onMouseLeave = (disabled ? null : this.subMenuMouseLeave.bind(this));
192
213
 
193
214
  return (
194
- <SubMenu title={menuItem} key={index + 1} className="contextmenu-submenu" rtl={rtl} {...disabled}>
195
- <div key={index + 1} style={subMenuPosStyle} className="context-menu-popover">
215
+ <div key={index + 1} className={menuItemClass} aria-haspopup role="menuitem"
216
+ onMouseEnter={onMouseEnter}
217
+ onMouseLeave={onMouseLeave}
218
+ >
219
+ {menuItemContent}
220
+ <div style={subMenuPosStyle} className={subMenuClass}>
196
221
  {subMenuContent}
197
222
  </div>
198
- </SubMenu>
223
+ </div>
199
224
  );
200
225
  }
201
226
 
@@ -206,13 +231,14 @@ class CommonContextMenu extends React.Component {
206
231
  // Ensure that the combined menu position, plus the menu width,
207
232
  // plus the submenu width, does not exceed the viewport bounds.
208
233
  return (menuPos.x + menuSize.width + subMenuSize.width > canvasRect.right);
209
-
210
234
  }
211
235
 
212
- // Returns a style object that can be applied to the sub-menu to adjust
213
- // its vertical (y) position. This may be necessary if the submenu is tall
214
- // enough that it would be displayed off the bottom of the canvas area.
215
- buildSubMenuPosStyle(runningYPos, menuPos, subMenuSize, canvasRect) {
236
+ // Returns a style object that can be applied to the sub-menu to adjust its:
237
+ // * vertical (y) position: If the submenu is tall enough that it would be
238
+ // displayed off the bottom of the canvas area.
239
+ // * horizontal (x) position: If the sub-menu needs to appear on the left
240
+ // side of the main menu (rtl === true).
241
+ buildSubMenuPosStyle(runningYPos, menuPos, subMenuSize, canvasRect, rtl) {
216
242
  // Does the submenu go below the bottom of the viewport?
217
243
  const y = canvasRect.bottom - (menuPos.y + runningYPos + subMenuSize.height);
218
244
 
@@ -224,6 +250,11 @@ class CommonContextMenu extends React.Component {
224
250
  const subMenuPosStyle = {
225
251
  top: offset + "px" // Use negative to push the menu up
226
252
  };
253
+
254
+ if (rtl) {
255
+ subMenuPosStyle.left = -CONTEXT_MENU_WIDTH + "px";
256
+ }
257
+
227
258
  return subMenuPosStyle;
228
259
  }
229
260
 
@@ -21,42 +21,29 @@
21
21
  cursor: pointer;
22
22
  min-width: 160px;
23
23
  background-color: $ui-01;
24
+ -webkit-background-clip: padding-box;
24
25
  background-clip: padding-box;
25
26
  border: 0;
26
27
  outline: none;
27
- position: absolute;
28
- z-index: 2;
29
28
  -moz-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.2);
30
29
  -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.2);
31
30
  box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.2);
32
- }
31
+ position: absolute;
33
32
 
34
- .context-menu-popover.popover>.arrow {
35
- display: none;
36
- }
37
- .context-menu-popover.popover>.popover-content {
38
- padding: 0;
39
- }
33
+ // For cascaded sub-menu
34
+ &.context-menu-submenu {
35
+ top: 0;
36
+ left: 100%;
37
+ display: none;
40
38
 
41
- .react-contextmenu {
42
- min-width: 160px;
43
- text-align: left;
44
- background-color: $ui-02;
45
- -webkit-background-clip: padding-box;
46
- background-clip: padding-box;
47
- border-radius: 0.25rem;
48
- outline: none;
49
- display: none;
50
- -moz-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.2);
51
- -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.2);
52
- box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.2);
39
+ // Makes the cascaded sub-menu visible.
40
+ &.context-menu--visible {
41
+ display: inline-grid;
42
+ }
43
+ }
53
44
  }
54
45
 
55
- .react-contextmenu--visible {
56
- display: inline-grid;
57
- }
58
-
59
- .react-contextmenu-item {
46
+ .context-menu-item {
60
47
  height: 30px;
61
48
  padding: 0 1em;
62
49
  clear: both;
@@ -67,38 +54,31 @@
67
54
  border: 0;
68
55
  display: flex;
69
56
  align-items: center;
70
- }
57
+ position: relative; // Needed to allow sub-menu, if there is one, to be positioned correctly
71
58
 
72
- .react-contextmenu-item.react-contextmenu-item--disabled {
73
- opacity: 0.5;
74
- cursor: not-allowed;
75
- }
59
+ &.disabled {
60
+ opacity: 0.5;
61
+ cursor: not-allowed;
62
+ }
76
63
 
77
- .react-contextmenu-item:active,
78
- .react-contextmenu-item:focus,
79
- .react-contextmenu-item:hover {
80
- background: $hover-ui;
81
- text-decoration: none;
82
- border: 0;
83
- outline: none; /* Suppress Chrome's blue active border */
84
- }
64
+ &:active,
65
+ &:focus,
66
+ &:hover {
67
+ background: $hover-ui;
68
+ text-decoration: none;
69
+ border: 0;
70
+ outline: none; /* Suppress Chrome's blue active border */
71
+ }
85
72
 
86
- .react-contextmenu-item.react-contextmenu-submenu {
87
- padding: 0;
88
- }
89
-
90
- .react-contextmenu-item.react-contextmenu-submenu > div {
91
- padding-right: 27px;
92
- }
93
-
94
- /* Style for the chevron '>' in menu item that opens a submenu. */
95
- .react-contextmenu-item svg {
96
- color: $text-01;
97
- position: absolute;
98
- right: 12px;
73
+ /* Style for the chevron '>' in menu item that opens a submenu. */
74
+ & svg {
75
+ color: $text-01;
76
+ position: absolute;
77
+ right: 12px;
78
+ }
99
79
  }
100
80
 
101
- .react-contextmenu-item.contextmenu-divider {
81
+ .context-menu-divider {
102
82
  height: 1px;
103
83
  display: block;
104
84
  overflow: hidden;
@@ -22,7 +22,7 @@ import Icon from "./../icons/icon.jsx";
22
22
  import { Button } from "carbon-components-react";
23
23
  import { Close16 } from "@carbon/icons-react";
24
24
  import Logger from "../logging/canvas-logger.js";
25
- import { DEFAULT_NOTIFICATION_HEADER, NOTIFICATION_ICON_CLASS } from "./../common-canvas/constants/canvas-constants.js";
25
+ import { DEFAULT_NOTIFICATION_HEADER } from "./../common-canvas/constants/canvas-constants.js";
26
26
  import defaultMessages from "../../locales/notification-panel/locales/en.json";
27
27
 
28
28
 
@@ -37,6 +37,8 @@ class NotificationPanel extends React.Component {
37
37
  constructor(props) {
38
38
  super(props);
39
39
  this.state = {};
40
+
41
+ this.firstTime = true;
40
42
  this.logger = new Logger("NotificationPanel");
41
43
  this.handleNotificationPanelClickOutside = this.handleNotificationPanelClickOutside.bind(this);
42
44
  this.closeNotificationPanel = this.closeNotificationPanel.bind(this);
@@ -118,20 +120,17 @@ class NotificationPanel extends React.Component {
118
120
  handleNotificationPanelClickOutside(e) {
119
121
  if (this.props.isNotificationOpen &&
120
122
  this.props.notificationConfig &&
121
- !this.props.notificationConfig.keepOpen) {
122
- const notificationIcon = document.getElementsByClassName(NOTIFICATION_ICON_CLASS)[0];
123
- const notificationHeader = document.getElementsByClassName("notification-panel-header")[0];
124
- const notificationMessages = document.getElementsByClassName("notification-panel-messages-container")[0];
125
-
126
- if (notificationIcon && !notificationIcon.contains(e.target) &&
127
- notificationHeader && !notificationHeader.contains(e.target) &&
128
- notificationMessages && !notificationMessages.contains(e.target)) {
129
- this.props.canvasController.toolbarActionHandler("closeNotificationPanel");
130
- e.stopPropagation(); // Prevent D3 canvas code from clearing the selections.
131
- }
123
+ !this.props.notificationConfig.keepOpen &&
124
+ this.isClickOutsideNotificationPanel(e)) {
125
+ this.props.canvasController.toolbarActionHandler("closeNotificationPanel");
126
+ e.stopPropagation(); // Prevent D3 canvas code from clearing the selections.
132
127
  }
133
128
  }
134
129
 
130
+ isClickOutsideNotificationPanel(e) {
131
+ return !e.target.closest(".notification-panel");
132
+ }
133
+
135
134
  notificationCallback(id, messageCallback) {
136
135
  if (messageCallback) {
137
136
  messageCallback(id);
@@ -160,7 +159,10 @@ class NotificationPanel extends React.Component {
160
159
  return null;
161
160
  }
162
161
 
163
- const notificationPanelClassName = this.props.isNotificationOpen ? "" : "panel-hidden";
162
+ let notificationPanelClassName = this.props.isNotificationOpen ? "" : "panel-hidden";
163
+ notificationPanelClassName += this.firstTime ? "" : " panel-transition";
164
+ this.firstTime = false;
165
+
164
166
  const notificationHeader = this.props.notificationConfig && this.props.notificationConfig.notificationHeader
165
167
  ? this.props.notificationConfig.notificationHeader
166
168
  : DEFAULT_NOTIFICATION_HEADER;
@@ -231,14 +233,12 @@ class NotificationPanel extends React.Component {
231
233
  </div>
232
234
  {notificationSubtitle}
233
235
  </div>
234
- <div className="notification-panel-messages-container">
235
- <div className="notification-panel-messages">
236
- {notificationPanelMessages}
237
- </div>
238
- <div className="notification-panel-button-container">
239
- {clearAll}
240
- {secondaryButton}
241
- </div>
236
+ <div className="notification-panel-messages">
237
+ {notificationPanelMessages}
238
+ </div>
239
+ <div className="notification-panel-button-container">
240
+ {clearAll}
241
+ {secondaryButton}
242
242
  </div>
243
243
  </div>
244
244
  </div>);
@@ -15,39 +15,46 @@
15
15
  */
16
16
 
17
17
  $notification-panel-header-height: 33px;
18
- $notification-panel-subtitle-height: 20px;
19
18
  $notification-message-height: 48px;
20
19
  $notification-left-border-color-width: 4px;
21
20
  $notification-panel-button-container-height: 49px;
22
- $notification-panel-header-container-height: $notification-panel-header-height + $notification-panel-subtitle-height + 32px;
23
21
  $toolbar-button-height: 41px; // Allow one extra pixel for the toolbar border
24
22
 
25
23
  // This section adds an ease-in ease-out effect for the notification-panel-container
26
24
  .notification-panel-container {
27
- transition: 0.25s ease-in-out;
28
25
  opacity: 1;
29
26
  margin-top: 0;
30
27
  z-index: 2; // Ensure panel appears on top of bottom panel.
31
28
 
32
29
  &.panel-hidden {
33
- transition: 0.25s ease-in-out;
34
30
  display: block;
35
31
  opacity: 0;
36
32
  visibility: hidden;
37
33
  }
34
+
35
+ &.panel-transition {
36
+ transition: 0.25s ease-in-out;
37
+ }
38
38
  }
39
39
 
40
40
  .notification-panel {
41
41
  position: absolute;
42
- width: 320px;
43
- height: 100%;
44
- max-height: 635px;
45
- right: 0;
46
42
  top: $toolbar-button-height;
43
+ right: 0;
44
+
45
+ width: 320px;
46
+ height: fit-content;
47
+ min-height: calc(#{$notification-panel-header-height} + #{$notification-panel-button-container-height} + #{$notification-message-height});
48
+ max-height: calc(100% - 53px);
49
+
50
+ display: grid;
51
+ flex-direction: column;
52
+ grid-template-rows: auto 1fr auto;
47
53
  }
48
54
 
49
55
  .notification-panel-header-container {
50
56
  min-height: $notification-panel-header-height;
57
+ height: fit-content;
51
58
  width: inherit;
52
59
  background-color: $ui-01;
53
60
  display: flex;
@@ -84,18 +91,12 @@ $toolbar-button-height: 41px; // Allow one extra pixel for the toolbar border
84
91
  font-weight: 400;
85
92
  }
86
93
 
87
- .notification-panel-messages-container {
88
- width: inherit;
89
- max-height: calc(100% - #{$notification-panel-header-height} - #{$notification-panel-subtitle-height});
90
- height: 100%;
91
- }
92
94
  .notification-panel-messages {
93
- max-height: calc(100% - #{$notification-panel-header-container-height} - #{$notification-panel-button-container-height});
94
- height: fit-content;
95
95
  overflow-y: auto;
96
96
  line-height: normal;
97
97
  background-color: $ui-01;
98
98
  border: 1px solid $ui-03;
99
+ max-height: 448px;
99
100
  .notifications-button-container {
100
101
  border-bottom: 1px solid $ui-03;
101
102
  min-height: $notification-message-height;
@@ -87,7 +87,7 @@ class PaletteContentListItem extends React.Component {
87
87
  }
88
88
 
89
89
  onDoubleClick() {
90
- if (this.props.canvasController.createAutoNode) {
90
+ if (this.props.canvasController.createAutoNode && !this.isItemDisabled()) {
91
91
  const nodeTemplate = this.props.canvasController.convertNodeTemplate(this.props.nodeTypeInfo.nodeType);
92
92
  this.props.canvasController.createAutoNode(nodeTemplate);
93
93
  }
@@ -233,6 +233,21 @@ class PaletteContentListItem extends React.Component {
233
233
  return highlightedElements;
234
234
  }
235
235
 
236
+ // Returns the class to be applied to the main div for this palette
237
+ // item depending on whether we are displaying search results (or not)
238
+ // and if there is a special palette class specified (or not).
239
+ getMainDivClass() {
240
+ const paletteClass = this.props.nodeTypeInfo?.nodeType?.app_data?.ui_data?.palette_class_name;
241
+
242
+ let mainDivClass = this.props.isDisplaySearchResult
243
+ ? "palette-list-item search-result"
244
+ : "palette-list-item";
245
+
246
+ mainDivClass += (paletteClass ? " " + paletteClass : "");
247
+
248
+ return mainDivClass;
249
+ }
250
+
236
251
  showFullDescription() {
237
252
  this.setState({ showFullDescription: true });
238
253
  }
@@ -241,14 +256,17 @@ class PaletteContentListItem extends React.Component {
241
256
  this.setState({ showFullDescription: false });
242
257
  }
243
258
 
244
- imageDrag() {
245
- return false;
259
+ // Returns true if this item is disabled and should not be draggable or double-clicked
260
+ // from the palette.
261
+ isItemDisabled() {
262
+ const disabled = this.props.nodeTypeInfo.nodeType?.app_data?.ui_data?.palette_disabled;
263
+ return !this.props.isEditingEnabled || disabled;
246
264
  }
247
265
 
248
266
  render() {
249
267
  let itemText = null;
250
268
  let labelText = get(this.props, "nodeTypeInfo.nodeType.app_data.ui_data.label", "");
251
- let draggable = this.props.isEditingEnabled ? "true" : "false";
269
+ let draggable = this.isItemDisabled() ? "false" : "true";
252
270
  let icon = null;
253
271
 
254
272
  if (has(this.props.nodeTypeInfo.nodeType, "app_data.ui_data.image")) {
@@ -287,9 +305,7 @@ class PaletteContentListItem extends React.Component {
287
305
  icon = (<Icon type={CANVAS_CARBON_ICONS.WARNING_UNFILLED} className="palette-list-item-icon-warning" draggable="false" />);
288
306
  }
289
307
 
290
- const mainDivClass = this.props.isDisplaySearchResult
291
- ? "palette-list-item search-result"
292
- : "palette-list-item";
308
+ const mainDivClass = this.getMainDivClass();
293
309
 
294
310
  const categoryLabel = this.props.isDisplaySearchResult
295
311
  ? (<div className={"palette-list-item-category-label"}>{this.getHighlightedCategoryLabel()}</div>)