@elyra/canvas 12.30.0 → 12.31.1

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 (163) hide show
  1. package/dist/{extends-7d4f15b6.js → _baseForOwn-ad2a8649.js} +3 -3
  2. package/dist/_baseForOwn-ad2a8649.js.map +1 -0
  3. package/dist/_baseForOwn-bfa77b3e.js +8 -0
  4. package/dist/_baseForOwn-bfa77b3e.js.map +1 -0
  5. package/dist/canvas-constants-187a30d5.js +2 -0
  6. package/dist/canvas-constants-187a30d5.js.map +1 -0
  7. package/dist/canvas-constants-5fb4e9b8.js +2 -0
  8. package/dist/canvas-constants-5fb4e9b8.js.map +1 -0
  9. package/dist/canvas-controller-53bd69c8.js +2 -0
  10. package/dist/canvas-controller-53bd69c8.js.map +1 -0
  11. package/dist/canvas-controller-9551a089.js +2 -0
  12. package/dist/canvas-controller-9551a089.js.map +1 -0
  13. package/dist/common-canvas-1c40c3df.js +2 -0
  14. package/dist/common-canvas-1c40c3df.js.map +1 -0
  15. package/dist/common-canvas-93c3f6a4.js +2 -0
  16. package/dist/common-canvas-93c3f6a4.js.map +1 -0
  17. package/dist/common-canvas.es.js +1 -1
  18. package/dist/common-canvas.es.js.map +1 -1
  19. package/dist/common-canvas.js +1 -1
  20. package/dist/common-canvas.js.map +1 -1
  21. package/dist/common-properties-02c52656.js +2 -0
  22. package/dist/common-properties-02c52656.js.map +1 -0
  23. package/dist/common-properties-df2350d5.js +2 -0
  24. package/dist/common-properties-df2350d5.js.map +1 -0
  25. package/dist/context-menu-wrapper-6c8f7928.js +2 -0
  26. package/dist/context-menu-wrapper-6c8f7928.js.map +1 -0
  27. package/dist/context-menu-wrapper-fc78153c.js +2 -0
  28. package/dist/context-menu-wrapper-fc78153c.js.map +1 -0
  29. package/dist/datarecord-metadata-v3-schema-15146f5e.js +2 -0
  30. package/dist/{datarecord-metadata-v3-schema-6a3754ce.js.map → datarecord-metadata-v3-schema-15146f5e.js.map} +1 -1
  31. package/dist/datarecord-metadata-v3-schema-9994b9ee.js +2 -0
  32. package/dist/{datarecord-metadata-v3-schema-ba1f2849.js.map → datarecord-metadata-v3-schema-9994b9ee.js.map} +1 -1
  33. package/dist/extends-093996c9.js +2 -0
  34. package/dist/extends-093996c9.js.map +1 -0
  35. package/dist/extends-1b35a664.js +2 -0
  36. package/dist/extends-1b35a664.js.map +1 -0
  37. package/dist/flexible-table-1f259bf6.js +2 -0
  38. package/dist/flexible-table-1f259bf6.js.map +1 -0
  39. package/dist/flexible-table-aa7a3125.js +2 -0
  40. package/dist/flexible-table-aa7a3125.js.map +1 -0
  41. package/dist/icon-c65ffd4c.js +2 -0
  42. package/dist/{icon-221bb2e5.js.map → icon-c65ffd4c.js.map} +1 -1
  43. package/dist/icon-e1c49d95.js +2 -0
  44. package/dist/{icon-ea917a08.js.map → icon-e1c49d95.js.map} +1 -1
  45. package/dist/index-27d84a2b.js +2 -0
  46. package/dist/{index-aee893ad.js.map → index-27d84a2b.js.map} +1 -1
  47. package/dist/index-6776fe83.js +2 -0
  48. package/dist/{index-92422c18.js.map → index-6776fe83.js.map} +1 -1
  49. package/dist/{isArrayLikeObject-f3b27f64.js → isArrayLikeObject-0cd02b77.js} +2 -2
  50. package/dist/{isArrayLikeObject-f3b27f64.js.map → isArrayLikeObject-0cd02b77.js.map} +1 -1
  51. package/dist/{isArrayLikeObject-a9c7973b.js → isArrayLikeObject-6a001191.js} +2 -2
  52. package/dist/{isArrayLikeObject-a9c7973b.js.map → isArrayLikeObject-6a001191.js.map} +1 -1
  53. package/dist/lib/canvas-controller.es.js +1 -1
  54. package/dist/lib/canvas-controller.js +1 -1
  55. package/dist/lib/canvas.es.js +1 -1
  56. package/dist/lib/canvas.js +1 -1
  57. package/dist/lib/context-menu.es.js +1 -1
  58. package/dist/lib/context-menu.es.js.map +1 -1
  59. package/dist/lib/context-menu.js +1 -1
  60. package/dist/lib/context-menu.js.map +1 -1
  61. package/dist/lib/properties/field-picker.es.js +1 -1
  62. package/dist/lib/properties/field-picker.js +1 -1
  63. package/dist/lib/properties/flexible-table.es.js +1 -1
  64. package/dist/lib/properties/flexible-table.js +1 -1
  65. package/dist/lib/properties.es.js +1 -1
  66. package/dist/lib/properties.js +1 -1
  67. package/dist/styles/common-canvas.min.css +1 -1
  68. package/dist/styles/common-canvas.min.css.map +1 -1
  69. package/dist/toolbar-83b4d3d3.js +2 -0
  70. package/dist/toolbar-83b4d3d3.js.map +1 -0
  71. package/dist/toolbar-d7febd83.js +2 -0
  72. package/dist/toolbar-d7febd83.js.map +1 -0
  73. package/locales/common-canvas/locales/en.json +1 -0
  74. package/locales/common-canvas/locales/eo.json +1 -0
  75. package/package.json +3 -3
  76. package/src/color-picker/color-picker.scss +2 -2
  77. package/src/common-canvas/canvas-controller-menu-utils.js +328 -0
  78. package/src/common-canvas/canvas-controller.js +114 -283
  79. package/src/common-canvas/cc-contents.jsx +9 -1
  80. package/src/common-canvas/cc-context-menu.jsx +9 -6
  81. package/src/common-canvas/cc-context-toolbar.jsx +205 -0
  82. package/src/common-canvas/cc-text-toolbar.jsx +4 -3
  83. package/src/common-canvas/cc-toolbar.jsx +4 -4
  84. package/src/common-canvas/common-canvas-utils.js +0 -5
  85. package/src/common-canvas/common-canvas.scss +34 -4
  86. package/src/common-canvas/constants/canvas-constants.js +9 -1
  87. package/src/common-canvas/svg-canvas-d3.js +4 -0
  88. package/src/common-canvas/svg-canvas-renderer.js +174 -86
  89. package/src/common-canvas/svg-canvas-utils-textarea.js +1 -1
  90. package/src/common-properties/common-properties.jsx +3 -1
  91. package/src/common-properties/components/editor-form/editor-form.jsx +11 -7
  92. package/src/common-properties/components/editor-form/editor-form.scss +27 -4
  93. package/src/common-properties/components/flexible-table/flexible-table.jsx +6 -4
  94. package/src/common-properties/components/title-editor/title-editor.jsx +3 -1
  95. package/src/common-properties/components/title-editor/title-editor.scss +4 -0
  96. package/src/common-properties/components/virtualized-table/virtualized-table.jsx +8 -2
  97. package/src/common-properties/constants/constants.js +5 -0
  98. package/src/common-properties/panels/subtabs/subtabs.jsx +1 -0
  99. package/src/common-properties/panels/tearsheet/tearsheet.scss +1 -0
  100. package/src/common-properties/properties-controller.js +2 -1
  101. package/src/common-properties/properties-main/properties-main.jsx +4 -1
  102. package/src/common-properties/ui-conditions/condition-ops/greaterThan.js +1 -1
  103. package/src/common-properties/ui-conditions/condition-ops/isDateTime.js +1 -1
  104. package/src/common-properties/ui-conditions/condition-ops/isEmpty.js +1 -1
  105. package/src/common-properties/ui-conditions/condition-ops/isNotEmpty.js +1 -1
  106. package/src/common-properties/ui-conditions/condition-ops/lessThan.js +1 -1
  107. package/src/context-menu/common-context-menu.jsx +20 -23
  108. package/src/context-menu/context-menu-wrapper.jsx +13 -11
  109. package/src/object-model/config-utils.js +5 -1
  110. package/src/object-model/layout-dimensions.js +10 -2
  111. package/src/object-model/object-model.js +23 -3
  112. package/src/object-model/redux/canvas-store.js +8 -4
  113. package/src/object-model/redux/reducers/categories.js +12 -0
  114. package/src/object-model/redux/reducers/contextmenu.js +10 -3
  115. package/src/object-model/redux/reducers/palette.js +3 -0
  116. package/src/palette/palette-flyout-content-category.jsx +18 -15
  117. package/src/palette/palette-flyout-content.jsx +0 -15
  118. package/src/toolbar/toolbar-action-item.jsx +80 -10
  119. package/src/toolbar/toolbar-overflow-item.jsx +9 -9
  120. package/src/toolbar/toolbar.jsx +12 -1
  121. package/src/toolbar/toolbar.scss +41 -13
  122. package/stats.html +1 -1
  123. package/dist/_baseForOwn-7d4e8506.js +0 -2
  124. package/dist/_baseForOwn-7d4e8506.js.map +0 -1
  125. package/dist/_baseForOwn-d38b560e.js +0 -2
  126. package/dist/_baseForOwn-d38b560e.js.map +0 -1
  127. package/dist/canvas-constants-046e4126.js +0 -2
  128. package/dist/canvas-constants-046e4126.js.map +0 -1
  129. package/dist/canvas-constants-f4e65d4d.js +0 -2
  130. package/dist/canvas-constants-f4e65d4d.js.map +0 -1
  131. package/dist/canvas-controller-6fe261d9.js +0 -2
  132. package/dist/canvas-controller-6fe261d9.js.map +0 -1
  133. package/dist/canvas-controller-ea7d4a8f.js +0 -2
  134. package/dist/canvas-controller-ea7d4a8f.js.map +0 -1
  135. package/dist/common-canvas-2953ff65.js +0 -2
  136. package/dist/common-canvas-2953ff65.js.map +0 -1
  137. package/dist/common-canvas-fbd62592.js +0 -2
  138. package/dist/common-canvas-fbd62592.js.map +0 -1
  139. package/dist/common-properties-0df4ed36.js +0 -2
  140. package/dist/common-properties-0df4ed36.js.map +0 -1
  141. package/dist/common-properties-8409565f.js +0 -2
  142. package/dist/common-properties-8409565f.js.map +0 -1
  143. package/dist/datarecord-metadata-v3-schema-6a3754ce.js +0 -2
  144. package/dist/datarecord-metadata-v3-schema-ba1f2849.js +0 -2
  145. package/dist/en-7201b548.js +0 -2
  146. package/dist/en-7201b548.js.map +0 -1
  147. package/dist/en-a08356c8.js +0 -2
  148. package/dist/en-a08356c8.js.map +0 -1
  149. package/dist/extends-7d4f15b6.js.map +0 -1
  150. package/dist/extends-d144eab9.js +0 -7
  151. package/dist/extends-d144eab9.js.map +0 -1
  152. package/dist/flexible-table-3a78cdf3.js +0 -2
  153. package/dist/flexible-table-3a78cdf3.js.map +0 -1
  154. package/dist/flexible-table-6e801de4.js +0 -2
  155. package/dist/flexible-table-6e801de4.js.map +0 -1
  156. package/dist/icon-221bb2e5.js +0 -2
  157. package/dist/icon-ea917a08.js +0 -2
  158. package/dist/index-92422c18.js +0 -2
  159. package/dist/index-aee893ad.js +0 -2
  160. package/dist/toolbar-3fdd090b.js +0 -2
  161. package/dist/toolbar-3fdd090b.js.map +0 -1
  162. package/dist/toolbar-5437484a.js +0 -2
  163. package/dist/toolbar-5437484a.js.map +0 -1
@@ -81,6 +81,7 @@ class Subtabs extends React.Component {
81
81
  <Tabs className={classNames("properties-subtabs", { "properties-leftnav-subtabs": this.props.leftnav })}
82
82
  selected={activeTab}
83
83
  light={this.props.controller.getLight()}
84
+ tabContentClassName="properties-subtab-panel"
84
85
  >
85
86
  {subTabs}
86
87
  </Tabs>
@@ -89,6 +89,7 @@ $properties-buttons-height: $spacing-10;
89
89
  background-color: $ui-01;
90
90
  border-bottom: 1px solid $ui-03;
91
91
  margin-bottom: $spacing-05;
92
+ padding-left: $spacing-05;
92
93
  }
93
94
  }
94
95
  }
@@ -1054,7 +1054,8 @@ export default class PropertiesController {
1054
1054
  const data = {
1055
1055
  action: ACTIONS.UPDATE_PROPERTY,
1056
1056
  property: propertyId,
1057
- value: convertedValue
1057
+ value: convertedValue,
1058
+ previousValue: initialValue
1058
1059
  };
1059
1060
  if (typeof type !== "undefined") {
1060
1061
  data.type = type;
@@ -25,7 +25,7 @@ import Form from "./../form/Form";
25
25
  import CommonPropertiesAction from "./../../command-actions/commonPropertiesAction";
26
26
  import PropertiesController from "./../properties-controller";
27
27
  import * as PropertyUtils from "./../util/property-utils";
28
- import { MESSAGE_KEYS, CONDITION_RETURN_VALUE_HANDLING, CARBON_ICONS, APPLY, CANCEL, ACTIONS } from "./../constants/constants";
28
+ import { MESSAGE_KEYS, CONDITION_RETURN_VALUE_HANDLING, CARBON_ICONS, APPLY, CANCEL, ACTIONS, CATEGORY_VIEW } from "./../constants/constants";
29
29
  import { Size } from "./../constants/form-constants";
30
30
  import { validateParameterDefAgainstSchema } from "../schema-validator/properties-schema-validator.js";
31
31
  import { has, isEqual, omit, pick, cloneDeep } from "lodash";
@@ -477,6 +477,7 @@ class PropertiesMain extends React.Component {
477
477
  icon={formData.icon}
478
478
  heading={formData.heading}
479
479
  showHeading={this.props.propertiesConfig.heading}
480
+ rightFlyoutTabsView={this.props.propertiesConfig.categoryView === CATEGORY_VIEW.TABS}
480
481
  />);
481
482
 
482
483
  hasHeading = this.props.propertiesConfig.heading && (formData.icon || formData.heading);
@@ -511,6 +512,7 @@ class PropertiesMain extends React.Component {
511
512
  showPropertiesButtons={this.showPropertiesButtons}
512
513
  customPanels={this.props.customPanels}
513
514
  rightFlyout={this.props.propertiesConfig.rightFlyout}
515
+ categoryView={this.props.propertiesConfig.categoryView}
514
516
  />);
515
517
 
516
518
  if (this.props.propertiesConfig.containerType === "Editing") {
@@ -606,6 +608,7 @@ PropertiesMain.propTypes = {
606
608
  applyOnBlur: PropTypes.bool,
607
609
  disableSaveOnRequiredErrors: PropTypes.bool,
608
610
  rightFlyout: PropTypes.bool,
611
+ categoryView: PropTypes.oneOf([CATEGORY_VIEW.ACCORDIONS, CATEGORY_VIEW.TABS]),
609
612
  containerType: PropTypes.string,
610
613
  enableResize: PropTypes.bool,
611
614
  conditionReturnValueHandling: PropTypes.string,
@@ -43,7 +43,7 @@ function evaluate(paramInfo, param2Info, value, controller) {
43
43
  }
44
44
  return false;
45
45
  case "string": {
46
- if (paramInfo.control.controlType === ControlType.DATEPICKER) {
46
+ if (paramInfo.control && paramInfo.control.controlType === ControlType.DATEPICKER) {
47
47
  const param1Date = new Date(paramInfo.value);
48
48
  if (!isNaN(param1Date) && param2Info) {
49
49
  const param2Date = new Date(param2Info.value);
@@ -24,7 +24,7 @@ function op() {
24
24
 
25
25
  function evaluate(paramInfo, param2Info, value, controller) {
26
26
  if (paramInfo.value) { // only check if there is a value.
27
- if (paramInfo.control.controlType !== ControlType.DATEPICKER && paramInfo.control.controlType !== ControlType.DATEPICKERRANGE) {
27
+ if (paramInfo.control && paramInfo.control.controlType !== ControlType.DATEPICKER && paramInfo.control.controlType !== ControlType.DATEPICKERRANGE) {
28
28
  // always use iso format for time
29
29
  const timeDateFormat = (value === "time") ? "HH:mm:ss:xxx" : DEFAULT_DATE_FORMAT;
30
30
  const date = parse(paramInfo.value, timeDateFormat, new Date());
@@ -34,7 +34,7 @@ function evaluate(paramInfo, param2Info, value, controller) {
34
34
  case "number":
35
35
  return paramInfo.value === null;
36
36
  case "object":
37
- if (paramInfo.control.controlType === ControlType.DATEPICKERRANGE) {
37
+ if (paramInfo.control && paramInfo.control.controlType === ControlType.DATEPICKERRANGE) {
38
38
  const startDate = paramInfo.value[0].trim();
39
39
  const endDate = paramInfo.value[1].trim();
40
40
  return startDate === "" && endDate === ""; // DATEPICKERRANGE is empty if both start and end dates are empty
@@ -33,7 +33,7 @@ function evaluate(paramInfo, param2Info, value, controller) {
33
33
  case "number":
34
34
  return paramInfo.value !== null;
35
35
  case "object":
36
- if (paramInfo.control.controlType === ControlType.DATEPICKERRANGE) {
36
+ if (paramInfo.control && paramInfo.control.controlType === ControlType.DATEPICKERRANGE) {
37
37
  return paramInfo.value[0].trim() !== "" || paramInfo.value[1].trim() !== "";
38
38
  }
39
39
  return paramInfo.value === null ? false : paramInfo.value.length !== 0;
@@ -44,7 +44,7 @@ function evaluate(paramInfo, param2Info, value, controller) {
44
44
  }
45
45
  return false;
46
46
  case "string": {
47
- if (paramInfo.control.controlType === ControlType.DATEPICKER) {
47
+ if (paramInfo.control && paramInfo.control.controlType === ControlType.DATEPICKER) {
48
48
  const param1Date = new Date(paramInfo.value);
49
49
  if (!isNaN(param1Date) && param2Info) {
50
50
  const param2Date = new Date(param2Info.value);
@@ -18,8 +18,7 @@
18
18
  import React from "react";
19
19
  import PropTypes from "prop-types";
20
20
  import { MenuItem, SubMenu } from "react-contextmenu";
21
- import Icon from "../icons/icon.jsx";
22
- import { CONTEXT_MENU_CARBON_ICONS } from "../common-canvas/constants/canvas-constants";
21
+ import { ChevronRight16 } from "@carbon/icons-react";
23
22
  import ColorPickerPanel from "../color-picker/color-picker-panel.jsx";
24
23
 
25
24
  // context-menu sizing
@@ -139,31 +138,29 @@ class CommonContextMenu extends React.Component {
139
138
  runningYPos += CONTEXT_MENU_DIVIDER_HEIGHT;
140
139
  previousDivider = true;
141
140
  }
142
-
143
- } else if (submenu) {
141
+ } else if (menuDefinition[i].action === "colorBackground") {
144
142
  previousDivider = false;
145
- if (menuDefinition[i].menu === "colorPicker") {
146
- const disabled = false;
147
- const subMenuSize = { width: CONTEXT_MENU_WIDTH, height: 50 };
148
- const subMenuContent = this.buildColorPickerPanel();
143
+ const disabled = false;
144
+ const subMenuSize = { width: CONTEXT_MENU_WIDTH, height: 50 };
145
+ const subMenuContent = this.buildColorPickerPanel();
149
146
 
150
- const subMenu = this.buildSubMenu(
151
- menuDefinition, i, subMenuContent, runningYPos, menuPos, menuSize, subMenuSize, canvasRect, disabled);
152
- menuItems.push(subMenu);
147
+ const subMenu = this.buildSubMenu(
148
+ menuDefinition, i, subMenuContent, runningYPos, menuPos, menuSize, subMenuSize, canvasRect, disabled);
149
+ menuItems.push(subMenu);
153
150
 
154
- runningYPos += CONTEXT_MENU_LINK_HEIGHT;
151
+ runningYPos += CONTEXT_MENU_LINK_HEIGHT;
155
152
 
156
- } else {
157
- const disabled = { disabled: this.areAllSubmenuItemsDisabled(menuDefinition[i].menu) };
158
- const subMenuSize = this.calculateMenuSize(menuDefinition[i].menu);
159
- const subMenuContent = this.buildMenu(menuDefinition[i].menu, menuSize, menuPos, canvasRect);
153
+ } else if (submenu) {
154
+ previousDivider = false;
155
+ const disabled = { disabled: this.areAllSubmenuItemsDisabled(menuDefinition[i].menu) };
156
+ const subMenuSize = this.calculateMenuSize(menuDefinition[i].menu);
157
+ const subMenuContent = this.buildMenu(menuDefinition[i].menu, menuSize, menuPos, canvasRect);
160
158
 
161
- const subMenu = this.buildSubMenu(
162
- menuDefinition, i, subMenuContent, runningYPos, menuPos, menuSize, subMenuSize, canvasRect, disabled);
163
- menuItems.push(subMenu);
159
+ const subMenu = this.buildSubMenu(
160
+ menuDefinition, i, subMenuContent, runningYPos, menuPos, menuSize, subMenuSize, canvasRect, disabled);
161
+ menuItems.push(subMenu);
164
162
 
165
- runningYPos += CONTEXT_MENU_LINK_HEIGHT;
166
- }
163
+ runningYPos += CONTEXT_MENU_LINK_HEIGHT;
167
164
 
168
165
  } else {
169
166
  previousDivider = false;
@@ -181,7 +178,7 @@ class CommonContextMenu extends React.Component {
181
178
 
182
179
  buildColorPickerPanel() {
183
180
  return (
184
- <ColorPickerPanel clickActionHandler={this.colorPickHandler} clickActionHandler={this.colorClicked} />
181
+ <ColorPickerPanel clickActionHandler={this.colorClicked} />
185
182
  );
186
183
  }
187
184
 
@@ -190,7 +187,7 @@ class CommonContextMenu extends React.Component {
190
187
  const rtl = this.buildRtlState(menuPos, menuSize, subMenuSize, canvasRect);
191
188
  const subMenuPosStyle = this.buildSubMenuPosStyle(runningYPos, menuPos, subMenuSize, canvasRect);
192
189
 
193
- const icon = <Icon type={CONTEXT_MENU_CARBON_ICONS.CHEVRONARROWS.RIGHT} disabled={false} className={"react-contextmenu-submenu-icon"} />;
190
+ const icon = (<ChevronRight16 />);
194
191
  const menuItem = <div>{menuDefinition[index].label}{icon} </div>;
195
192
 
196
193
  return (
@@ -41,17 +41,19 @@ export default class ContextMenuWrapper extends React.Component {
41
41
  // which is specified in this.props.contextMenuPos object.
42
42
  getCanvasRect() {
43
43
  const containingDiv = document.getElementById(this.props.containingDivId);
44
- const clientRect = containingDiv.getBoundingClientRect();
45
- const canvasRect = {
46
- top: 0,
47
- bottom: clientRect.bottom - clientRect.top,
48
- left: 0,
49
- right: clientRect.right - clientRect.left,
50
- height: clientRect.height,
51
- width: clientRect.width
52
- };
53
-
54
- return canvasRect;
44
+ if (containingDiv) {
45
+ const clientRect = containingDiv.getBoundingClientRect();
46
+ return {
47
+ top: 0,
48
+ bottom: clientRect.bottom - clientRect.top,
49
+ left: 0,
50
+ right: clientRect.right - clientRect.left,
51
+ height: clientRect.height,
52
+ width: clientRect.width
53
+ };
54
+ }
55
+ // Assist Jests tests to run when containingDiv is not available.
56
+ return { top: 0, bottom: 200, left: 0, right: 50, height: 200, width: 50 };
55
57
  }
56
58
 
57
59
  handleClickOutside(e) {
@@ -77,6 +77,7 @@ export default class CanvasUtils {
77
77
  enableBrowserEditMenu: true,
78
78
  enableMarkdownInComments: false,
79
79
  enableAutoLinkOnlyFromSelNodes: false,
80
+ enableContextToolbar: false,
80
81
  enableSaveZoom: "None",
81
82
  enableSnapToGridType: "None",
82
83
  enableSnapToGridX: null,
@@ -96,7 +97,10 @@ export default class CanvasUtils {
96
97
  enableCanvasLayout: {}, // Not documented
97
98
  enableUseCardFromOriginalPorts: false, // Not documented
98
99
  tipConfig: {
99
- "palette": true,
100
+ "palette": {
101
+ categories: true,
102
+ nodesTemplates: true
103
+ },
100
104
  "nodes": true,
101
105
  "ports": true,
102
106
  "decorations": true,
@@ -240,6 +240,10 @@ const portsHorizontalDefaultLayout = {
240
240
  // Spacing between the port arcs around the ports.
241
241
  portArcSpacing: 3,
242
242
 
243
+ // Position of the context toolbar realtive to the node. Some adjustment
244
+ // will be made to account for the width of the toolbar.
245
+ contextToolbarPosition: "topRight",
246
+
243
247
  // Display of vertical ellipsis to show context menu
244
248
  ellipsisDisplay: true,
245
249
  ellipsisPosition: "topLeft",
@@ -378,7 +382,7 @@ const portsHorizontalDefaultLayout = {
378
382
  // Position of the comment toolbar as an offset from the comment position
379
383
  // (which is the top left corner of the comment bounding box).
380
384
  commentToolbarPosX: -2,
381
- commentToolbarPosY: -44,
385
+ commentToolbarPosY: -36,
382
386
 
383
387
  // ---------------------------------------------------------------------------
384
388
  // Layout values for operations
@@ -646,6 +650,10 @@ const portsVerticalDefaultLayout = {
646
650
  // Spacing between the port arcs around the ports.
647
651
  portArcSpacing: 0,
648
652
 
653
+ // Position of the context toolbar realtive to the node. Some adjustment
654
+ // will be made to account for the width of the toolbar.
655
+ contextToolbarPosition: "topCenter",
656
+
649
657
  // Display of vertical ellipsis to show context menu
650
658
  ellipsisDisplay: true,
651
659
  ellipsisPosition: "topLeft",
@@ -784,7 +792,7 @@ const portsVerticalDefaultLayout = {
784
792
  // Position of the comment toolbar as an offset from the comment position
785
793
  // (which is the top left corner of the comment bounding box).
786
794
  commentToolbarPosX: -2,
787
- commentToolbarPosY: -44,
795
+ commentToolbarPosY: -36,
788
796
 
789
797
  // ---------------------------------------------------------------------------
790
798
  // Layout values for operations
@@ -342,6 +342,22 @@ export default class ObjectModel {
342
342
  return pal;
343
343
  }
344
344
 
345
+ setIsOpenCategory(categoryId, isOpen) {
346
+ this.store.dispatch({ type: "SET_IS_OPEN_CATEGORY", data: { categoryId: categoryId, isOpen } });
347
+ }
348
+
349
+ setIsOpenAllCategories(isOpen) {
350
+ this.store.dispatch({ type: "SET_IS_OPEN_ALL_CATEGORIES", data: { isOpen } });
351
+ }
352
+
353
+ isPaletteCategoryOpen(categoryId) {
354
+ const category = this.store.getPaletteCategory(categoryId);
355
+ if (category) {
356
+ return category.is_open;
357
+ }
358
+ return null;
359
+ }
360
+
345
361
  // ---------------------------------------------------------------------------
346
362
  // Pipeline Flow and Canvas methods
347
363
  // ---------------------------------------------------------------------------
@@ -1418,18 +1434,22 @@ export default class ObjectModel {
1418
1434
  // Context menu methods
1419
1435
  // ---------------------------------------------------------------------------
1420
1436
 
1421
- openContextMenu(menuDef) {
1422
- this.store.dispatch({ type: "SET_CONTEXT_MENU_DEF", data: { menuDef: menuDef } });
1437
+ openContextMenu(menuDef, source) {
1438
+ this.store.dispatch({ type: "OPEN_CONTEXT_MENU", data: { menuDef, source } });
1423
1439
  }
1424
1440
 
1425
1441
  closeContextMenu() {
1426
- this.store.dispatch({ type: "SET_CONTEXT_MENU_DEF", data: { menuDef: [] } });
1442
+ this.store.dispatch({ type: "CLOSE_CONTEXT_MENU" });
1427
1443
  }
1428
1444
 
1429
1445
  isContextMenuDisplayed() {
1430
1446
  return this.store.isContextMenuDisplayed();
1431
1447
  }
1432
1448
 
1449
+ getContextMenuSource() {
1450
+ return this.store.getContextMenuSource();
1451
+ }
1452
+
1433
1453
  // ---------------------------------------------------------------------------
1434
1454
  // Right flyout methods
1435
1455
  // ---------------------------------------------------------------------------
@@ -71,7 +71,7 @@ export default class CanavasStore {
71
71
  tooltip: {},
72
72
  canvastoolbar: {},
73
73
  texttoolbar: { isOpen: false },
74
- contextmenu: { menuDef: [] },
74
+ contextmenu: { isOpen: false, menuDef: [], source: {} },
75
75
  rightflyout: {},
76
76
  bottompanel: { panelHeight: 393 },
77
77
  toppanel: { }
@@ -107,6 +107,10 @@ export default class CanavasStore {
107
107
  return cloneDeep(this.store.getState().palette.content);
108
108
  }
109
109
 
110
+ getPaletteCategory(categoryId) {
111
+ return cloneDeep(this.store.getState().palette.content.categories.find((c) => c.id === categoryId));
112
+ }
113
+
110
114
  getCanvasInfo() {
111
115
  return cloneDeep(this.store.getState().canvasinfo);
112
116
  }
@@ -275,12 +279,12 @@ export default class CanavasStore {
275
279
  return this.getNotificationPanel().isOpen;
276
280
  }
277
281
 
278
- getContextMenu() {
279
- return this.cloneData(this.store.getState().contextmenu);
282
+ getContextMenuSource() {
283
+ return this.cloneData(this.store.getState().contextmenu.source);
280
284
  }
281
285
 
282
286
  isContextMenuDisplayed() {
283
- return !isEmpty(this.store.getState().contextmenu.menuDef);
287
+ return this.store.getState().contextmenu.isOpen;
284
288
  }
285
289
 
286
290
  getSelectionInfo() {
@@ -78,6 +78,18 @@ export default (state = [], action) => {
78
78
  });
79
79
  }
80
80
 
81
+ case "SET_IS_OPEN_CATEGORY": {
82
+ return state.map((category) => {
83
+ if (category.id === action.data.categoryId) {
84
+ return Object.assign({}, category, { is_open: action.data.isOpen });
85
+ }
86
+ return category;
87
+ });
88
+ }
89
+
90
+ case "SET_IS_OPEN_ALL_CATEGORIES": {
91
+ return state.map((category) => Object.assign({}, category, { is_open: action.data.isOpen }));
92
+ }
81
93
  default:
82
94
  return state;
83
95
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2022 Elyra Authors
2
+ * Copyright 2023 Elyra Authors
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -16,9 +16,16 @@
16
16
 
17
17
  export default (state = {}, action) => {
18
18
  switch (action.type) {
19
- case "SET_CONTEXT_MENU_DEF": {
19
+ case "OPEN_CONTEXT_MENU": {
20
20
  const menuDef = action.data.menuDef.map((m) => Object.assign({}, m));
21
- return Object.assign({}, state, { menuDef: menuDef });
21
+ if (menuDef.length > 0) {
22
+ return Object.assign({}, state, { isOpen: true, menuDef, source: action.data.source });
23
+ }
24
+ return state;
25
+ }
26
+
27
+ case "CLOSE_CONTEXT_MENU": {
28
+ return Object.assign({}, state, { isOpen: false });
22
29
  }
23
30
 
24
31
  default:
@@ -28,6 +28,8 @@ export default (state = {}, action) => {
28
28
 
29
29
  case "ADD_NODE_TYPES_TO_PALETTE":
30
30
  case "REMOVE_NODE_TYPES_FROM_PALETTE":
31
+ case "SET_IS_OPEN_CATEGORY":
32
+ case "SET_IS_OPEN_ALL_CATEGORIES":
31
33
  case "SET_CATEGORY_LOADING_TEXT":
32
34
  case "SET_CATEGORY_EMPTY_TEXT": {
33
35
  const newContent = Object.assign({}, state.content, { categories: categories(state.content.categories, action) });
@@ -38,6 +40,7 @@ export default (state = {}, action) => {
38
40
  case "SET_PALETTE_OPEN_STATE":
39
41
  return Object.assign({}, state, { isOpen: action.data.isOpen });
40
42
 
43
+
41
44
  default:
42
45
  return state;
43
46
  }
@@ -28,13 +28,9 @@ class PaletteFlyoutContentCategory extends React.Component {
28
28
  constructor(props) {
29
29
  super(props);
30
30
 
31
- this.state = {
32
- isOpen: false
33
- };
34
-
35
31
  this.onMouseOver = this.onMouseOver.bind(this);
36
32
  this.onMouseLeave = this.onMouseLeave.bind(this);
37
- this.categorySelected = this.categorySelected.bind(this);
33
+ this.categoryClicked = this.categoryClicked.bind(this);
38
34
  }
39
35
 
40
36
  onMouseOver(ev) {
@@ -102,7 +98,7 @@ class PaletteFlyoutContentCategory extends React.Component {
102
98
  const titleObj = this.getTitleObj();
103
99
  const content = this.getContent();
104
100
  return (
105
- <AccordionItem title={titleObj} onHeadingClick={({ isOpen }) => this.setState({ isOpen })}>
101
+ <AccordionItem title={titleObj} open={this.props.category.is_open}>
106
102
  {content}
107
103
  </AccordionItem>
108
104
  );
@@ -115,7 +111,7 @@ class PaletteFlyoutContentCategory extends React.Component {
115
111
  return (
116
112
  <div className="palette-flyout-category"
117
113
  data-id={get(this.props.category, "id", "")}
118
- onClick={this.categorySelected}
114
+ onClick={this.categoryClicked}
119
115
  value={this.props.category.label}
120
116
  onMouseOver={this.onMouseOver}
121
117
  onMouseLeave={this.onMouseLeave}
@@ -174,12 +170,12 @@ class PaletteFlyoutContentCategory extends React.Component {
174
170
  }
175
171
 
176
172
  // Returns the content object for the AccordionItem. This is only set to
177
- // something if the category is open (that is: isOpen is true). It is useful
178
- // to remove the nodes from the DOM when the category is closed because this
179
- // can help inline SVG icons on the canvas, that reference elements in the
180
- // <defs> element, to appear correclty.
173
+ // something if the category is open (that is: this.props.category.is_open
174
+ // is true). We remove the nodes from the DOM, when the category
175
+ // is closed, because this helps inline SVG icons on the canvas, that
176
+ // reference elements in the <defs> element, to appear correctly.
181
177
  getContent() {
182
- if (this.state.isOpen) {
178
+ if (this.props.category.is_open) {
183
179
  const nodeTypeInfos = this.props.category.node_types.map((nt) => ({ nodeType: nt, category: this.props.category }));
184
180
  return (
185
181
  <PaletteContentList
@@ -195,8 +191,16 @@ class PaletteFlyoutContentCategory extends React.Component {
195
191
  return null;
196
192
  }
197
193
 
198
- categorySelected() {
199
- this.props.categorySelectedMethod(this.props.category.id);
194
+ categoryClicked(evt) {
195
+ // Stopping event propagation prevents an extra refresh of the node icons when
196
+ // a category is opened.
197
+ evt.stopPropagation();
198
+
199
+ if (this.props.category.is_open) {
200
+ this.props.canvasController.closePaletteCategory(this.props.category.id);
201
+ } else {
202
+ this.props.canvasController.openPaletteCategory(this.props.category.id);
203
+ }
200
204
  }
201
205
 
202
206
  render() {
@@ -208,7 +212,6 @@ class PaletteFlyoutContentCategory extends React.Component {
208
212
 
209
213
  PaletteFlyoutContentCategory.propTypes = {
210
214
  category: PropTypes.object.isRequired,
211
- categorySelectedMethod: PropTypes.func.isRequired,
212
215
  canvasController: PropTypes.object.isRequired,
213
216
  isPaletteOpen: PropTypes.bool.isRequired,
214
217
  isEditingEnabled: PropTypes.bool.isRequired,
@@ -39,13 +39,11 @@ class PaletteFlyoutContent extends React.Component {
39
39
  // debounce and after the debounce unwinds it sets searchString in this
40
40
  // class which causes the filtered result set to be calculated and displayed.
41
41
  this.state = {
42
- selectedCategoryIds: [],
43
42
  searchString: ""
44
43
  };
45
44
 
46
45
  this.categories = [];
47
46
 
48
- this.categorySelected = this.categorySelected.bind(this);
49
47
  this.getUniqueCategories = this.getUniqueCategories.bind(this);
50
48
  this.setSearchString = this.setSearchString.bind(this);
51
49
  this.handleSearchStringChange = this.handleSearchStringChange.bind(this);
@@ -77,7 +75,6 @@ class PaletteFlyoutContent extends React.Component {
77
75
  <PaletteFlyoutContentCategory
78
76
  key={category.id}
79
77
  category={category}
80
- categorySelectedMethod={this.categorySelected}
81
78
  canvasController={this.props.canvasController}
82
79
  isPaletteOpen={this.props.isPaletteOpen}
83
80
  isEditingEnabled={this.props.isEditingEnabled}
@@ -123,18 +120,6 @@ class PaletteFlyoutContent extends React.Component {
123
120
  this.setSearchStringThrottled();
124
121
  }
125
122
 
126
- categorySelected(catSelId) {
127
- const selCatIds = this.isCategorySelected(catSelId)
128
- ? this.state.selectedCategoryIds.filter((catId) => catId !== catSelId)
129
- : this.state.selectedCategoryIds.concat(catSelId);
130
-
131
- this.setState({ selectedCategoryIds: selCatIds });
132
- }
133
-
134
- isCategorySelected(categoryId) {
135
- return this.state.selectedCategoryIds.some((cId) => cId === categoryId);
136
- }
137
-
138
123
  render() {
139
124
  this.categories = this.getUniqueCategories(this.props.paletteJSON.categories);
140
125
  const contentDivs = this.props.isPaletteOpen && this.state.searchString