@elyra/canvas 12.30.0 → 12.31.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.
- package/dist/{extends-7d4f15b6.js → _baseForOwn-ad2a8649.js} +3 -3
- package/dist/_baseForOwn-ad2a8649.js.map +1 -0
- package/dist/_baseForOwn-bfa77b3e.js +8 -0
- package/dist/_baseForOwn-bfa77b3e.js.map +1 -0
- package/dist/canvas-constants-187a30d5.js +2 -0
- package/dist/canvas-constants-187a30d5.js.map +1 -0
- package/dist/canvas-constants-5fb4e9b8.js +2 -0
- package/dist/canvas-constants-5fb4e9b8.js.map +1 -0
- package/dist/canvas-controller-53bd69c8.js +2 -0
- package/dist/canvas-controller-53bd69c8.js.map +1 -0
- package/dist/canvas-controller-9551a089.js +2 -0
- package/dist/canvas-controller-9551a089.js.map +1 -0
- package/dist/common-canvas-1c40c3df.js +2 -0
- package/dist/common-canvas-1c40c3df.js.map +1 -0
- package/dist/common-canvas-93c3f6a4.js +2 -0
- package/dist/common-canvas-93c3f6a4.js.map +1 -0
- package/dist/common-canvas.es.js +1 -1
- package/dist/common-canvas.es.js.map +1 -1
- package/dist/common-canvas.js +1 -1
- package/dist/common-canvas.js.map +1 -1
- package/dist/common-properties-18cce049.js +2 -0
- package/dist/common-properties-18cce049.js.map +1 -0
- package/dist/common-properties-b45b54ac.js +2 -0
- package/dist/common-properties-b45b54ac.js.map +1 -0
- package/dist/context-menu-wrapper-6c8f7928.js +2 -0
- package/dist/context-menu-wrapper-6c8f7928.js.map +1 -0
- package/dist/context-menu-wrapper-fc78153c.js +2 -0
- package/dist/context-menu-wrapper-fc78153c.js.map +1 -0
- package/dist/datarecord-metadata-v3-schema-15146f5e.js +2 -0
- package/dist/{datarecord-metadata-v3-schema-6a3754ce.js.map → datarecord-metadata-v3-schema-15146f5e.js.map} +1 -1
- package/dist/datarecord-metadata-v3-schema-9994b9ee.js +2 -0
- package/dist/{datarecord-metadata-v3-schema-ba1f2849.js.map → datarecord-metadata-v3-schema-9994b9ee.js.map} +1 -1
- package/dist/extends-093996c9.js +2 -0
- package/dist/extends-093996c9.js.map +1 -0
- package/dist/extends-1b35a664.js +2 -0
- package/dist/extends-1b35a664.js.map +1 -0
- package/dist/flexible-table-1f259bf6.js +2 -0
- package/dist/flexible-table-1f259bf6.js.map +1 -0
- package/dist/flexible-table-aa7a3125.js +2 -0
- package/dist/flexible-table-aa7a3125.js.map +1 -0
- package/dist/icon-c65ffd4c.js +2 -0
- package/dist/{icon-221bb2e5.js.map → icon-c65ffd4c.js.map} +1 -1
- package/dist/icon-e1c49d95.js +2 -0
- package/dist/{icon-ea917a08.js.map → icon-e1c49d95.js.map} +1 -1
- package/dist/index-27d84a2b.js +2 -0
- package/dist/{index-aee893ad.js.map → index-27d84a2b.js.map} +1 -1
- package/dist/index-6776fe83.js +2 -0
- package/dist/{index-92422c18.js.map → index-6776fe83.js.map} +1 -1
- package/dist/{isArrayLikeObject-f3b27f64.js → isArrayLikeObject-0cd02b77.js} +2 -2
- package/dist/{isArrayLikeObject-f3b27f64.js.map → isArrayLikeObject-0cd02b77.js.map} +1 -1
- package/dist/{isArrayLikeObject-a9c7973b.js → isArrayLikeObject-6a001191.js} +2 -2
- package/dist/{isArrayLikeObject-a9c7973b.js.map → isArrayLikeObject-6a001191.js.map} +1 -1
- package/dist/lib/canvas-controller.es.js +1 -1
- package/dist/lib/canvas-controller.js +1 -1
- package/dist/lib/canvas.es.js +1 -1
- package/dist/lib/canvas.js +1 -1
- package/dist/lib/context-menu.es.js +1 -1
- package/dist/lib/context-menu.es.js.map +1 -1
- package/dist/lib/context-menu.js +1 -1
- package/dist/lib/context-menu.js.map +1 -1
- package/dist/lib/properties/field-picker.es.js +1 -1
- package/dist/lib/properties/field-picker.js +1 -1
- package/dist/lib/properties/flexible-table.es.js +1 -1
- package/dist/lib/properties/flexible-table.js +1 -1
- package/dist/lib/properties.es.js +1 -1
- package/dist/lib/properties.js +1 -1
- package/dist/styles/common-canvas.min.css +1 -1
- package/dist/styles/common-canvas.min.css.map +1 -1
- package/dist/toolbar-83b4d3d3.js +2 -0
- package/dist/toolbar-83b4d3d3.js.map +1 -0
- package/dist/toolbar-d7febd83.js +2 -0
- package/dist/toolbar-d7febd83.js.map +1 -0
- package/locales/common-canvas/locales/en.json +1 -0
- package/locales/common-canvas/locales/eo.json +1 -0
- package/package.json +3 -3
- package/src/color-picker/color-picker.scss +2 -2
- package/src/common-canvas/canvas-controller-menu-utils.js +328 -0
- package/src/common-canvas/canvas-controller.js +114 -283
- package/src/common-canvas/cc-contents.jsx +9 -1
- package/src/common-canvas/cc-context-menu.jsx +9 -6
- package/src/common-canvas/cc-context-toolbar.jsx +205 -0
- package/src/common-canvas/cc-text-toolbar.jsx +4 -3
- package/src/common-canvas/cc-toolbar.jsx +4 -4
- package/src/common-canvas/common-canvas-utils.js +0 -5
- package/src/common-canvas/common-canvas.scss +34 -4
- package/src/common-canvas/constants/canvas-constants.js +9 -1
- package/src/common-canvas/svg-canvas-d3.js +4 -0
- package/src/common-canvas/svg-canvas-renderer.js +174 -86
- package/src/common-canvas/svg-canvas-utils-textarea.js +1 -1
- package/src/common-properties/common-properties.jsx +3 -1
- package/src/common-properties/components/editor-form/editor-form.jsx +11 -7
- package/src/common-properties/components/editor-form/editor-form.scss +27 -4
- package/src/common-properties/components/flexible-table/flexible-table.jsx +6 -4
- package/src/common-properties/components/title-editor/title-editor.jsx +3 -1
- package/src/common-properties/components/title-editor/title-editor.scss +4 -0
- package/src/common-properties/components/virtualized-table/virtualized-table.jsx +8 -2
- package/src/common-properties/constants/constants.js +5 -0
- package/src/common-properties/panels/subtabs/subtabs.jsx +1 -0
- package/src/common-properties/panels/tearsheet/tearsheet.scss +1 -0
- package/src/common-properties/properties-controller.js +2 -1
- package/src/common-properties/properties-main/properties-main.jsx +4 -1
- package/src/context-menu/common-context-menu.jsx +20 -23
- package/src/context-menu/context-menu-wrapper.jsx +13 -11
- package/src/object-model/config-utils.js +5 -1
- package/src/object-model/layout-dimensions.js +10 -2
- package/src/object-model/object-model.js +23 -3
- package/src/object-model/redux/canvas-store.js +8 -4
- package/src/object-model/redux/reducers/categories.js +12 -0
- package/src/object-model/redux/reducers/contextmenu.js +10 -3
- package/src/object-model/redux/reducers/palette.js +3 -0
- package/src/palette/palette-flyout-content-category.jsx +18 -15
- package/src/palette/palette-flyout-content.jsx +0 -15
- package/src/toolbar/toolbar-action-item.jsx +80 -10
- package/src/toolbar/toolbar-overflow-item.jsx +9 -9
- package/src/toolbar/toolbar.jsx +12 -1
- package/src/toolbar/toolbar.scss +41 -13
- package/stats.html +1 -1
- package/dist/_baseForOwn-7d4e8506.js +0 -2
- package/dist/_baseForOwn-7d4e8506.js.map +0 -1
- package/dist/_baseForOwn-d38b560e.js +0 -2
- package/dist/_baseForOwn-d38b560e.js.map +0 -1
- package/dist/canvas-constants-046e4126.js +0 -2
- package/dist/canvas-constants-046e4126.js.map +0 -1
- package/dist/canvas-constants-f4e65d4d.js +0 -2
- package/dist/canvas-constants-f4e65d4d.js.map +0 -1
- package/dist/canvas-controller-6fe261d9.js +0 -2
- package/dist/canvas-controller-6fe261d9.js.map +0 -1
- package/dist/canvas-controller-ea7d4a8f.js +0 -2
- package/dist/canvas-controller-ea7d4a8f.js.map +0 -1
- package/dist/common-canvas-2953ff65.js +0 -2
- package/dist/common-canvas-2953ff65.js.map +0 -1
- package/dist/common-canvas-fbd62592.js +0 -2
- package/dist/common-canvas-fbd62592.js.map +0 -1
- package/dist/common-properties-0df4ed36.js +0 -2
- package/dist/common-properties-0df4ed36.js.map +0 -1
- package/dist/common-properties-8409565f.js +0 -2
- package/dist/common-properties-8409565f.js.map +0 -1
- package/dist/datarecord-metadata-v3-schema-6a3754ce.js +0 -2
- package/dist/datarecord-metadata-v3-schema-ba1f2849.js +0 -2
- package/dist/en-7201b548.js +0 -2
- package/dist/en-7201b548.js.map +0 -1
- package/dist/en-a08356c8.js +0 -2
- package/dist/en-a08356c8.js.map +0 -1
- package/dist/extends-7d4f15b6.js.map +0 -1
- package/dist/extends-d144eab9.js +0 -7
- package/dist/extends-d144eab9.js.map +0 -1
- package/dist/flexible-table-3a78cdf3.js +0 -2
- package/dist/flexible-table-3a78cdf3.js.map +0 -1
- package/dist/flexible-table-6e801de4.js +0 -2
- package/dist/flexible-table-6e801de4.js.map +0 -1
- package/dist/icon-221bb2e5.js +0 -2
- package/dist/icon-ea917a08.js +0 -2
- package/dist/index-92422c18.js +0 -2
- package/dist/index-aee893ad.js +0 -2
- package/dist/toolbar-3fdd090b.js +0 -2
- package/dist/toolbar-3fdd090b.js.map +0 -1
- package/dist/toolbar-5437484a.js +0 -2
- package/dist/toolbar-5437484a.js.map +0 -1
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 Elyra Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import React from "react";
|
|
18
|
+
import PropTypes from "prop-types";
|
|
19
|
+
import { connect } from "react-redux";
|
|
20
|
+
import Toolbar from "../toolbar/toolbar.jsx";
|
|
21
|
+
import Logger from "../logging/canvas-logger.js";
|
|
22
|
+
import ColorPickerPanel from "../color-picker/color-picker-panel.jsx";
|
|
23
|
+
|
|
24
|
+
const CM_TOOLBAR_GAP = 4;
|
|
25
|
+
const CM_ICON_SIZE = 32;
|
|
26
|
+
const CM_ICON_PAD = 2;
|
|
27
|
+
|
|
28
|
+
class CommonCanvasContextToolbar extends React.Component {
|
|
29
|
+
constructor(props) {
|
|
30
|
+
super(props);
|
|
31
|
+
|
|
32
|
+
this.logger = new Logger("CC-Context-Toolbar");
|
|
33
|
+
this.onMouseEnter = this.onMouseEnter.bind(this);
|
|
34
|
+
this.onMouseLeave = this.onMouseLeave.bind(this);
|
|
35
|
+
this.toolbarActionHandler = this.toolbarActionHandler.bind(this);
|
|
36
|
+
this.colorClicked = this.colorClicked.bind(this);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
onMouseLeave(evt) {
|
|
40
|
+
this.props.canvasController.setMouseInContextToolbar(false);
|
|
41
|
+
setTimeout(() => this.props.canvasController.closeContextToolbar(), 200);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
onMouseEnter(evt) {
|
|
45
|
+
this.props.canvasController.setMouseInContextToolbar(true);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
getToolbarConfig({ toolbarItems, overflowMenuItems }) {
|
|
49
|
+
const leftBar = [];
|
|
50
|
+
toolbarItems.forEach((item) => {
|
|
51
|
+
leftBar.push(this.getMenuItem(item));
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// Records if we have just displayed a divider. This is useful because we
|
|
55
|
+
// only want to display one divider if there is a divider element
|
|
56
|
+
// immediately after another divider element in the overflowMenuItems array.
|
|
57
|
+
let previousDivider = false;
|
|
58
|
+
|
|
59
|
+
overflowMenuItems.forEach((item) => {
|
|
60
|
+
if (item.divider) {
|
|
61
|
+
if (!previousDivider) {
|
|
62
|
+
leftBar.push({ divider: true });
|
|
63
|
+
previousDivider = true;
|
|
64
|
+
}
|
|
65
|
+
} else {
|
|
66
|
+
leftBar.push(this.getMenuItem(item));
|
|
67
|
+
previousDivider = false;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
return {
|
|
72
|
+
leftBar: leftBar,
|
|
73
|
+
rightBar: []
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
getMenuItem(menuItem) {
|
|
78
|
+
const subPanel = this.getSubPanel(menuItem);
|
|
79
|
+
const subMenu = !subPanel && menuItem.submenu ? this.getSubMenu(menuItem) : null;
|
|
80
|
+
return { action: menuItem.action, label: menuItem.label, subMenu, subPanel, enable: this.getEnable(menuItem), iconEnabled: menuItem.icon };
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
getSubPanel(menuItem) {
|
|
84
|
+
if (menuItem.action === "colorBackground") {
|
|
85
|
+
return this.buildColorPickerPanel();
|
|
86
|
+
}
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
getSubMenu(menuItem) {
|
|
92
|
+
if (typeof menuItem.menu === "object") {
|
|
93
|
+
return menuItem.menu.map((option) => {
|
|
94
|
+
if (option.divider) {
|
|
95
|
+
return { divider: true };
|
|
96
|
+
}
|
|
97
|
+
return { action: option.action, label: option.label, enable: this.getEnable(option), iconEnabled: option.icon };
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
getEnable(menuItem) {
|
|
104
|
+
if (typeof menuItem.enable === "undefined") {
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
return menuItem.enable;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Returns the width of the context toolbar.
|
|
111
|
+
getContextToolbarWidth(toolbarItems, overflowMenuItems) {
|
|
112
|
+
// If there is at least one overflow item, we will need an overflow
|
|
113
|
+
// icon which will increase the toolbar items by one.
|
|
114
|
+
const overflowItemCount = overflowMenuItems.length > 0 ? 1 : 0;
|
|
115
|
+
const toolbarItemsCount = toolbarItems.length + overflowItemCount;
|
|
116
|
+
|
|
117
|
+
// If we have some overflow menu items, we reduce the width by one pixel
|
|
118
|
+
// which forces the overflow menu and the overflow icon to be shown.
|
|
119
|
+
const reduction = overflowMenuItems.length > 0 ? 1 : 0;
|
|
120
|
+
return (toolbarItemsCount * (CM_ICON_SIZE + CM_ICON_PAD)) - reduction;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
toolbarActionHandler(action, editParam) {
|
|
124
|
+
this.props.canvasController.setMouseInContextToolbar(false);
|
|
125
|
+
this.props.canvasController.closeContextToolbar();
|
|
126
|
+
this.props.canvasController.contextMenuActionHandler(action, editParam);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
colorClicked(color) {
|
|
130
|
+
this.toolbarActionHandler("colorSelectedObjects", { color });
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
buildColorPickerPanel() {
|
|
134
|
+
return (
|
|
135
|
+
<ColorPickerPanel clickActionHandler={this.colorClicked} />
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
shouldCenterJustifyToolbar() {
|
|
140
|
+
const objType = this.props.contextSource.type;
|
|
141
|
+
return (
|
|
142
|
+
objType === "link" ||
|
|
143
|
+
objType === "canvas" ||
|
|
144
|
+
objType === "node" &&
|
|
145
|
+
this.props.contextSource.targetObject.layout.contextToolbarPosition === "topCenter" &&
|
|
146
|
+
!this.props.contextSource.targetObject.is_expanded);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
render() {
|
|
150
|
+
this.logger.log("render");
|
|
151
|
+
|
|
152
|
+
let contextToolbar = null;
|
|
153
|
+
|
|
154
|
+
if (this.props.showContextMenu) {
|
|
155
|
+
const toolbarItems = this.props.contextMenuDef.filter((cmItem) => cmItem.toolbarItem && !cmItem.divider);
|
|
156
|
+
const overflowMenuItems = this.props.contextMenuDef.filter((cmItem) => !cmItem.toolbarItem);
|
|
157
|
+
const toolbarConfig = this.getToolbarConfig({ toolbarItems, overflowMenuItems });
|
|
158
|
+
|
|
159
|
+
const toolbarWidth = this.getContextToolbarWidth(toolbarItems, overflowMenuItems);
|
|
160
|
+
|
|
161
|
+
// Note: cmPos is already adjusted as a starting point for the context
|
|
162
|
+
// toolbar position by a calculation in svg-canvas-renderer.js.
|
|
163
|
+
const pos = this.props.contextSource.cmPos || { x: 0, y: 0 };
|
|
164
|
+
const x = this.shouldCenterJustifyToolbar()
|
|
165
|
+
? pos.x - (toolbarWidth / 2)
|
|
166
|
+
: pos.x - toolbarWidth;
|
|
167
|
+
const y = (pos.y - CM_ICON_SIZE) - CM_TOOLBAR_GAP;
|
|
168
|
+
|
|
169
|
+
contextToolbar = (
|
|
170
|
+
<div className={"context-toolbar"} style={{ left: x, top: y, width: toolbarWidth }}
|
|
171
|
+
onMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave}
|
|
172
|
+
>
|
|
173
|
+
<Toolbar
|
|
174
|
+
config={toolbarConfig}
|
|
175
|
+
instanceId={this.props.canvasController.getInstanceId()}
|
|
176
|
+
toolbarActionHandler={this.toolbarActionHandler}
|
|
177
|
+
tooltipDirection={"top"}
|
|
178
|
+
size={"sm"}
|
|
179
|
+
/>
|
|
180
|
+
</div>
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return contextToolbar;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
CommonCanvasContextToolbar.propTypes = {
|
|
189
|
+
// Provided by CommonCanvas
|
|
190
|
+
canvasController: PropTypes.object.isRequired,
|
|
191
|
+
containingDivId: PropTypes.string.isRequired,
|
|
192
|
+
|
|
193
|
+
// Provided by redux
|
|
194
|
+
contextMenuDef: PropTypes.array.isRequired,
|
|
195
|
+
contextSource: PropTypes.object.isRequired,
|
|
196
|
+
showContextMenu: PropTypes.bool.isRequired
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
const mapStateToProps = (state, ownProps) => ({
|
|
200
|
+
contextMenuDef: state.contextmenu.menuDef,
|
|
201
|
+
contextSource: state.contextmenu.source,
|
|
202
|
+
showContextMenu: state.contextmenu.isOpen
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
export default connect(mapStateToProps)(CommonCanvasContextToolbar);
|
|
@@ -32,7 +32,7 @@ class CommonCanvasTextToolbar extends React.Component {
|
|
|
32
32
|
super(props);
|
|
33
33
|
|
|
34
34
|
this.getLabel = this.getLabel.bind(this);
|
|
35
|
-
this.logger = new Logger("CC-Toolbar");
|
|
35
|
+
this.logger = new Logger("CC-Text-Toolbar");
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
getLabel(labelId, substituteObj) {
|
|
@@ -63,14 +63,14 @@ class CommonCanvasTextToolbar extends React.Component {
|
|
|
63
63
|
const bulletedListLabel = this.getJsxLabel("texttoolbar.bulletedListAction", "shift + 8");
|
|
64
64
|
const headerOptions = (
|
|
65
65
|
<div>
|
|
66
|
-
<OverflowMenu id={"headerMenu"} iconDescription={""} renderIcon={TextScale32} >
|
|
66
|
+
<OverflowMenu id={"headerMenu"} iconDescription={""} renderIcon={TextScale32} size={"sm"}>
|
|
67
67
|
<OverflowMenuItem itemText={this.getLabel("texttoolbar.titleAction")} onClick={(evt) => this.props.actionHandler("title", evt)} />
|
|
68
68
|
<OverflowMenuItem itemText={this.getLabel("texttoolbar.headerAction")} onClick={(evt) => this.props.actionHandler("header", evt)} />
|
|
69
69
|
<OverflowMenuItem itemText={this.getLabel("texttoolbar.subheaderAction")} onClick={(evt) => this.props.actionHandler("subheader", evt)} />
|
|
70
70
|
<OverflowMenuItem itemText={this.getLabel("texttoolbar.bodyAction")} onClick={(evt) => this.props.actionHandler("body", evt)} />
|
|
71
71
|
</OverflowMenu>
|
|
72
72
|
<svg className="text-toolbar-tick-svg">
|
|
73
|
-
<path d="M
|
|
73
|
+
<path d="M 31 31 L 31 25 25 31 Z" className="text-toolbar-tick-mark" />
|
|
74
74
|
</svg>
|
|
75
75
|
</div>
|
|
76
76
|
);
|
|
@@ -108,6 +108,7 @@ class CommonCanvasTextToolbar extends React.Component {
|
|
|
108
108
|
instanceId={this.props.canvasController.getInstanceId()}
|
|
109
109
|
toolbarActionHandler={this.props.actionHandler}
|
|
110
110
|
tooltipDirection={"top"}
|
|
111
|
+
size={"sm"}
|
|
111
112
|
/>
|
|
112
113
|
</div>
|
|
113
114
|
);
|
|
@@ -30,9 +30,10 @@ class CommonCanvasToolbar extends React.Component {
|
|
|
30
30
|
constructor(props) {
|
|
31
31
|
super(props);
|
|
32
32
|
|
|
33
|
+
this.logger = new Logger("CC-Toolbar");
|
|
34
|
+
|
|
33
35
|
this.getLabel = this.getLabel.bind(this);
|
|
34
36
|
this.toolbarActionHandler = this.toolbarActionHandler.bind(this);
|
|
35
|
-
this.logger = new Logger("CC-Toolbar");
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
getLabel(labelId, substituteObj) {
|
|
@@ -184,7 +185,7 @@ class CommonCanvasToolbar extends React.Component {
|
|
|
184
185
|
{ divider: true },
|
|
185
186
|
{ action: TOOLBAR_TOGGLE_NOTIFICATION_PANEL,
|
|
186
187
|
label: this.props.notificationConfig.label,
|
|
187
|
-
enable:
|
|
188
|
+
enable: this.props.notificationConfig.enable,
|
|
188
189
|
isSelected: this.props.isNotificationOpen,
|
|
189
190
|
className: this.getNotificationClassName(),
|
|
190
191
|
textContent: (notificationCount > 9) ? "9+" : notificationCount.toString()
|
|
@@ -272,7 +273,7 @@ class CommonCanvasToolbar extends React.Component {
|
|
|
272
273
|
|
|
273
274
|
if (this.props.enableToolbarLayout === TOOLBAR_LAYOUT_TOP) {
|
|
274
275
|
canvasToolbar = (
|
|
275
|
-
<div aria-label={this.getLabel("toolbar.label")} role="navigation">
|
|
276
|
+
<div aria-label={this.getLabel("toolbar.label")} role="navigation" className={"common-canvas-toolbar"} >
|
|
276
277
|
<Toolbar
|
|
277
278
|
config={toolbarConfig}
|
|
278
279
|
instanceId={this.props.canvasController.getInstanceId()}
|
|
@@ -282,7 +283,6 @@ class CommonCanvasToolbar extends React.Component {
|
|
|
282
283
|
</div>
|
|
283
284
|
);
|
|
284
285
|
}
|
|
285
|
-
|
|
286
286
|
return canvasToolbar;
|
|
287
287
|
}
|
|
288
288
|
}
|
|
@@ -912,11 +912,6 @@ export default class CanvasUtils {
|
|
|
912
912
|
return regionSelections;
|
|
913
913
|
}
|
|
914
914
|
|
|
915
|
-
// Returns true if the ID passed in is in the array.
|
|
916
|
-
static isSelected(nodeId, array) {
|
|
917
|
-
return array.findIndex((id) => id === nodeId) !== -1;
|
|
918
|
-
}
|
|
919
|
-
|
|
920
915
|
// Return true if the position provided is within the area provided.
|
|
921
916
|
static isPosInArea(pos, area, pad) {
|
|
922
917
|
return pos.x_pos > area.x1 - pad &&
|
|
@@ -130,10 +130,35 @@ $panel-border-color: $ui-03;
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
.common-canvas-toolbar {
|
|
134
|
+
border-bottom: $toolbar-divider-width solid $ui-04;
|
|
135
|
+
}
|
|
133
136
|
|
|
134
137
|
.text-toolbar {
|
|
138
|
+
.toolbar-div {
|
|
139
|
+
animation: raise-toolbar 0.3s linear;
|
|
140
|
+
border: 1px solid $ui-04;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Below, we have to override the Carbon button's focus highlighting in the
|
|
145
|
+
// context toolbar to get a complete border around the overflow icon. This is
|
|
146
|
+
// necessary because the width allocated to the context toolbar is reduced by
|
|
147
|
+
// one pixel to force the overflow icon to be displayed.
|
|
148
|
+
.context-toolbar {
|
|
149
|
+
.toolbar-overflow-item {
|
|
150
|
+
button:focus {
|
|
151
|
+
border-color: transparent;
|
|
152
|
+
box-shadow: inset 0 0 0 1px $interactive-01, inset 0 0 0 2px $interactive-01
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.text-toolbar,
|
|
158
|
+
.context-toolbar {
|
|
135
159
|
position: absolute;
|
|
136
160
|
// top and left will be calculated and set for the text toolbar programmatically
|
|
161
|
+
// top, left and width will be calculated and set for the context toolbar programmatically
|
|
137
162
|
top: 0;
|
|
138
163
|
left: 0;
|
|
139
164
|
width: fit-content;
|
|
@@ -143,8 +168,6 @@ $panel-border-color: $ui-03;
|
|
|
143
168
|
// opening by adjusting its 'height' and 'top' values.
|
|
144
169
|
position: relative;
|
|
145
170
|
left: 0;
|
|
146
|
-
animation: raise-toolbar 0.3s linear;
|
|
147
|
-
border: 1px solid $ui-04;
|
|
148
171
|
padding-right: 0px;
|
|
149
172
|
|
|
150
173
|
.toolbar-left-bar {
|
|
@@ -156,8 +179,8 @@ $panel-border-color: $ui-03;
|
|
|
156
179
|
position: absolute;
|
|
157
180
|
top: 0;
|
|
158
181
|
left: 0;
|
|
159
|
-
height:
|
|
160
|
-
width:
|
|
182
|
+
height: 32px;
|
|
183
|
+
width: 32px;
|
|
161
184
|
pointer-events: none;
|
|
162
185
|
}
|
|
163
186
|
|
|
@@ -166,6 +189,13 @@ $panel-border-color: $ui-03;
|
|
|
166
189
|
}
|
|
167
190
|
}
|
|
168
191
|
|
|
192
|
+
.text-toolbar {
|
|
193
|
+
.toolbar-div {
|
|
194
|
+
animation: raise-toolbar 0.3s linear;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
|
|
169
199
|
// Causes the text toolbar to animate upwards from the top of the comment
|
|
170
200
|
// to its final position
|
|
171
201
|
@keyframes raise-toolbar {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright 2017-
|
|
2
|
+
* Copyright 2017-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.
|
|
@@ -178,9 +178,13 @@ export const TOOLBAR_REDO = "redo";
|
|
|
178
178
|
export const TOOLBAR_CUT = "cut";
|
|
179
179
|
export const TOOLBAR_COPY = "copy";
|
|
180
180
|
export const TOOLBAR_PASTE = "paste";
|
|
181
|
+
export const TOOLBAR_CREATE_COMMENT = "createComment";
|
|
181
182
|
export const TOOLBAR_CREATE_AUTO_COMMENT = "createAutoComment";
|
|
183
|
+
export const TOOLBAR_SET_COMMENT_EDIT_MODE = "setCommentEditingMode";
|
|
182
184
|
export const TOOLBAR_SHOW_COMMENTS = "commentsShow";
|
|
183
185
|
export const TOOLBAR_HIDE_COMMENTS = "commentsHide";
|
|
186
|
+
export const TOOLBAR_COLOR_BACKGROUND = "colorBackground";
|
|
187
|
+
export const TOOLBAR_DELETE_LINK = "deleteLink";
|
|
184
188
|
export const TOOLBAR_DELETE_SELECTED_OBJECTS = "deleteSelectedObjects";
|
|
185
189
|
export const TOOLBAR_ZOOM_IN = "zoomIn";
|
|
186
190
|
export const TOOLBAR_ZOOM_OUT = "zoomOut";
|
|
@@ -190,6 +194,10 @@ export const TOOLBAR_ARRANGE_VERTICALLY = "arrangeVertically";
|
|
|
190
194
|
export const TOOLBAR_TOGGLE_NOTIFICATION_PANEL = "toggleNotificationPanel";
|
|
191
195
|
export const TOOLBAR_OPEN_PALETTE = "paletteOpen";
|
|
192
196
|
export const TOOLBAR_CLOSE_PALETTE = "paletteClose";
|
|
197
|
+
export const TOOLBAR_EXPAND_SUPERNODE_IN_PLACE = "expandSuperNodeInPlace";
|
|
198
|
+
export const TOOLBAR_COLLAPSE_SUPERNODE_IN_PLACE = "collapseSuperNodeInPlace";
|
|
199
|
+
export const TOOLBAR_EXPAND_SUPERNODE_FULL_PAGE = "displaySubPipeline";
|
|
200
|
+
export const TOOLBAR_SET_NODE_LABEL_EDIT = "setNodeLabelEditingMode";
|
|
193
201
|
|
|
194
202
|
export const EDIT_ICON =
|
|
195
203
|
"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\">" +
|
|
@@ -167,6 +167,10 @@ export default class SVGCanvasD3 {
|
|
|
167
167
|
return this.renderer ? this.renderer.getZoom() : null;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
+
setCommentEditingMode(commentId, pipelineId) {
|
|
171
|
+
this.renderer.setCommentEditingMode(commentId, pipelineId);
|
|
172
|
+
}
|
|
173
|
+
|
|
170
174
|
setNodeLabelEditingMode(nodeId, pipelineId) {
|
|
171
175
|
this.renderer.setNodeLabelEditingMode(nodeId, pipelineId);
|
|
172
176
|
}
|