@elyra/canvas 12.12.3 → 12.15.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/.stylelintrc.json +17 -16
- package/README.md +1 -1
- package/dist/_baseForOwn-7d4e8506.js.map +1 -1
- package/dist/_baseForOwn-d38b560e.js.map +1 -1
- package/dist/canvas-constants-34cdb7df.js.map +1 -1
- package/dist/canvas-constants-3c09c7f6.js.map +1 -1
- package/dist/{canvas-controller-e91d037b.js → canvas-controller-720a509c.js} +2 -2
- package/dist/canvas-controller-720a509c.js.map +1 -0
- package/dist/canvas-controller-73113a1b.js +2 -0
- package/dist/canvas-controller-73113a1b.js.map +1 -0
- package/dist/common-canvas-21b6ab50.js +2 -0
- package/dist/common-canvas-21b6ab50.js.map +1 -0
- package/dist/common-canvas-baef2726.js +2 -0
- package/dist/common-canvas-baef2726.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-86de4c9f.js +2 -0
- package/dist/common-properties-86de4c9f.js.map +1 -0
- package/dist/common-properties-9e579309.js +2 -0
- package/dist/common-properties-9e579309.js.map +1 -0
- package/dist/createClass-32a0cf0f.js.map +1 -1
- package/dist/createClass-6db89a23.js.map +1 -1
- package/dist/datarecord-metadata-v3-schema-6b6384ff.js.map +1 -1
- package/dist/datarecord-metadata-v3-schema-81228a9a.js.map +1 -1
- package/dist/en-7a0f1db1.js.map +1 -1
- package/dist/en-8647c347.js.map +1 -1
- package/dist/{extends-7fdcdc52.js → extends-1139e06f.js} +2 -2
- package/dist/{extends-7fdcdc52.js.map → extends-1139e06f.js.map} +1 -1
- package/dist/extends-8d17c85c.js.map +1 -1
- package/dist/{flexible-table-a13cb7d0.js → flexible-table-d3598aa8.js} +2 -2
- package/dist/flexible-table-d3598aa8.js.map +1 -0
- package/dist/{flexible-table-50ce600a.js → flexible-table-fe7fbc13.js} +2 -2
- package/dist/flexible-table-fe7fbc13.js.map +1 -0
- package/dist/getPrototypeOf-a1c3fe64.js.map +1 -1
- package/dist/getPrototypeOf-bf88242f.js.map +1 -1
- package/dist/{icon-bf77b2aa.js → icon-918d2dd3.js} +2 -2
- package/dist/{icon-bf77b2aa.js.map → icon-918d2dd3.js.map} +1 -1
- package/dist/{index-f2c306ba.js → index-669f95a7.js} +2 -2
- package/dist/{index-f2c306ba.js.map → index-669f95a7.js.map} +1 -1
- package/dist/{index-0e6c8b9c.js → index-6d3404e1.js} +2 -2
- package/dist/{index-0e6c8b9c.js.map → index-6d3404e1.js.map} +1 -1
- package/dist/isArrayLikeObject-a9c7973b.js.map +1 -1
- package/dist/isArrayLikeObject-f3b27f64.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/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/lib/tooltip.es.js +1 -1
- package/dist/lib/tooltip.es.js.map +1 -1
- package/dist/lib/tooltip.js +1 -1
- package/dist/lib/tooltip.js.map +1 -1
- package/dist/styles/common-canvas.min.css +1 -1
- package/dist/styles/common-canvas.min.css.map +1 -1
- package/dist/toolbar-29ec7983.js +2 -0
- package/dist/toolbar-29ec7983.js.map +1 -0
- package/dist/toolbar-3f4b173f.js +2 -0
- package/dist/toolbar-3f4b173f.js.map +1 -0
- package/locales/command-actions/locales/de.json +50 -8
- package/locales/command-actions/locales/en.json +1 -1
- package/locales/command-actions/locales/es.json +50 -8
- package/locales/command-actions/locales/fr.json +50 -8
- package/locales/command-actions/locales/index.js +2 -2
- package/locales/command-actions/locales/it.json +50 -8
- package/locales/command-actions/locales/ja.json +50 -8
- package/locales/command-actions/locales/ko.json +42 -0
- package/locales/command-actions/locales/pt-br.json +50 -8
- package/locales/command-actions/locales/zh-CN.json +51 -0
- package/locales/command-actions/locales/zh-TW.json +51 -0
- package/locales/common-canvas/locales/de.json +36 -26
- package/locales/common-canvas/locales/en.json +14 -1
- package/locales/common-canvas/locales/eo.json +14 -1
- package/locales/common-canvas/locales/es.json +36 -26
- package/locales/common-canvas/locales/fr.json +36 -26
- package/locales/common-canvas/locales/index.js +2 -2
- package/locales/common-canvas/locales/it.json +36 -26
- package/locales/common-canvas/locales/ja.json +36 -26
- package/locales/common-canvas/locales/ko.json +7 -2
- package/locales/common-canvas/locales/pt-br.json +36 -26
- package/locales/common-canvas/locales/zh-CN.json +37 -0
- package/locales/common-canvas/locales/zh-TW.json +37 -0
- package/locales/common-properties/locales/de.json +92 -92
- package/locales/common-properties/locales/en.json +1 -1
- package/locales/common-properties/locales/es.json +92 -92
- package/locales/common-properties/locales/fr.json +92 -92
- package/locales/common-properties/locales/index.js +2 -2
- package/locales/common-properties/locales/it.json +92 -92
- package/locales/common-properties/locales/ja.json +92 -92
- package/locales/common-properties/locales/ko.json +1 -1
- package/locales/common-properties/locales/pt-br.json +92 -92
- package/locales/common-properties/locales/zh-CN.json +93 -0
- package/locales/common-properties/locales/zh-TW.json +93 -0
- package/locales/palette/locales/de.json +9 -9
- package/locales/palette/locales/en.json +6 -6
- package/locales/palette/locales/es.json +9 -9
- package/locales/palette/locales/fr.json +9 -9
- package/locales/palette/locales/index.js +2 -2
- package/locales/palette/locales/it.json +9 -9
- package/locales/palette/locales/ja.json +9 -9
- package/locales/palette/locales/pt-br.json +9 -9
- package/locales/palette/locales/zh-CN.json +10 -0
- package/locales/palette/locales/zh-TW.json +10 -0
- package/locales/toolbar/locales/de.json +7 -7
- package/locales/toolbar/locales/en.json +1 -1
- package/locales/toolbar/locales/es.json +7 -7
- package/locales/toolbar/locales/fr.json +7 -7
- package/locales/toolbar/locales/index.js +2 -2
- package/locales/toolbar/locales/it.json +7 -7
- package/locales/toolbar/locales/ja.json +7 -7
- package/locales/toolbar/locales/pt-br.json +7 -7
- package/locales/toolbar/locales/zh-CN.json +8 -0
- package/locales/toolbar/locales/zh-TW.json +8 -0
- package/package.json +3 -2
- package/src/common-canvas/canvas-controller.js +19 -3
- package/src/common-canvas/cc-bottom-panel.jsx +37 -21
- package/src/common-canvas/cc-central-items.jsx +1 -1
- package/src/common-canvas/cc-contents.jsx +10 -3
- package/src/common-canvas/cc-text-toolbar.jsx +141 -0
- package/src/common-canvas/cc-toolbar.jsx +8 -6
- package/src/common-canvas/common-canvas-utils.js +37 -4
- package/src/common-canvas/common-canvas.scss +52 -5
- package/src/common-canvas/svg-canvas-d3.scss +172 -23
- package/src/common-canvas/svg-canvas-pipeline.js +10 -3
- package/src/common-canvas/svg-canvas-renderer.js +93 -341
- package/src/common-canvas/svg-canvas-utils-decs.js +0 -5
- package/src/common-canvas/svg-canvas-utils-markdown.js +515 -0
- package/src/common-canvas/svg-canvas-utils-nodes.js +0 -5
- package/src/common-canvas/svg-canvas-utils-textarea.js +472 -0
- package/src/common-properties/components/control-item/control-item.scss +1 -1
- package/src/common-properties/components/flexible-table/flexible-table.jsx +14 -3
- package/src/common-properties/components/flexible-table/flexible-table.scss +20 -0
- package/src/common-properties/components/title-editor/title-editor.jsx +2 -2
- package/src/common-properties/components/title-editor/title-editor.scss +1 -16
- package/src/common-properties/controls/abstract-table.jsx +2 -0
- package/src/common-properties/controls/checkbox/checkbox.jsx +1 -1
- package/src/common-properties/controls/checkboxset/checkboxset.jsx +36 -11
- package/src/common-properties/controls/checkboxset/checkboxset.scss +6 -0
- package/src/common-properties/controls/list/list.jsx +1 -0
- package/src/common-properties/controls/radioset/radioset.jsx +25 -1
- package/src/common-properties/controls/radioset/radioset.scss +19 -0
- package/src/common-properties/controls/selectcolumns/selectcolumns.jsx +1 -0
- package/src/common-properties/controls/someofselect/someofselect.jsx +1 -0
- package/src/common-properties/form/ControlInfo.js +3 -0
- package/src/common-properties/form/EditorForm.js +45 -3
- package/src/common-properties/panels/action-panel/action-panel.jsx +38 -3
- package/src/common-properties/panels/action-panel/action-panel.scss +3 -0
- package/src/common-properties/panels/text-panel/text-panel.jsx +38 -7
- package/src/common-properties/panels/text-panel/text-panel.scss +4 -3
- package/src/common-properties/properties-controller.js +39 -12
- package/src/common-properties/ui-conditions/conditions-utils.js +14 -8
- package/src/common-properties/util/L10nProvider.js +6 -0
- package/src/object-model/config-utils.js +1 -0
- package/src/object-model/layout-dimensions.js +14 -2
- package/src/object-model/object-model.js +12 -0
- package/src/object-model/redux/canvas-store.js +4 -1
- package/src/object-model/redux/reducers/bottompanel.js +1 -3
- package/src/object-model/redux/reducers/texttoolbar.js +29 -0
- package/src/palette/palette-content-list-item.jsx +12 -2
- package/src/palette/palette-content-list.jsx +11 -19
- package/src/palette/palette-dialog-content-grid.jsx +1 -6
- package/src/palette/palette-dialog-content.jsx +13 -11
- package/src/palette/palette-flyout-content-category.jsx +90 -57
- package/src/palette/palette-flyout-content.jsx +4 -24
- package/src/palette/palette.scss +72 -44
- package/src/toolbar/toolbar-action-item.jsx +9 -6
- package/src/toolbar/toolbar-overflow-item.jsx +1 -0
- package/src/toolbar/toolbar.jsx +12 -15
- package/src/tooltip/tooltip.jsx +14 -5
- package/stats.html +1 -1
- package/dist/canvas-controller-de76a796.js +0 -2
- package/dist/canvas-controller-de76a796.js.map +0 -1
- package/dist/canvas-controller-e91d037b.js.map +0 -1
- package/dist/common-canvas-522f6263.js +0 -2
- package/dist/common-canvas-522f6263.js.map +0 -1
- package/dist/common-canvas-90539c97.js +0 -2
- package/dist/common-canvas-90539c97.js.map +0 -1
- package/dist/common-properties-245c4711.js +0 -2
- package/dist/common-properties-245c4711.js.map +0 -1
- package/dist/common-properties-49e6bb67.js +0 -2
- package/dist/common-properties-49e6bb67.js.map +0 -1
- package/dist/flexible-table-50ce600a.js.map +0 -1
- package/dist/flexible-table-a13cb7d0.js.map +0 -1
- package/dist/toolbar-1c181339.js +0 -2
- package/dist/toolbar-1c181339.js.map +0 -1
- package/dist/toolbar-c6fa3cdb.js +0 -2
- package/dist/toolbar-c6fa3cdb.js.map +0 -1
- package/locales/command-actions/locales/zh-cn.json +0 -9
- package/locales/command-actions/locales/zh-tw.json +0 -9
- package/locales/common-canvas/locales/zh-cn.json +0 -27
- package/locales/common-canvas/locales/zh-tw.json +0 -27
- package/locales/common-properties/locales/zh-cn.json +0 -93
- package/locales/common-properties/locales/zh-tw.json +0 -93
- package/locales/palette/locales/zh-cn.json +0 -10
- package/locales/palette/locales/zh-tw.json +0 -10
- package/locales/toolbar/locales/zh-cn.json +0 -8
- package/locales/toolbar/locales/zh-tw.json +0 -8
|
@@ -75,6 +75,7 @@ export default class CanvasUtils {
|
|
|
75
75
|
enablePanIntoViewOnOpen: false,
|
|
76
76
|
enableZoomIntoSubFlows: false,
|
|
77
77
|
enableBrowserEditMenu: true,
|
|
78
|
+
enableMarkdownInComments: false,
|
|
78
79
|
enableAutoLinkOnlyFromSelNodes: false,
|
|
79
80
|
enableSaveZoom: "None",
|
|
80
81
|
enableSnapToGridType: "None",
|
|
@@ -353,11 +353,17 @@ const portsHorizontalDefaultLayout = {
|
|
|
353
353
|
commentSizingArea: 10,
|
|
354
354
|
|
|
355
355
|
// Add comment toolbar action, default offset from viewport
|
|
356
|
-
|
|
356
|
+
addCommentOffsetX: 30,
|
|
357
|
+
addCommentOffsetY: 50,
|
|
357
358
|
|
|
358
359
|
// Comment port (circle) radius
|
|
359
360
|
commentPortRadius: 5,
|
|
360
361
|
|
|
362
|
+
// Position of the comment toolbar as an offset from the comment position
|
|
363
|
+
// (which is the top left corner of the comment bounding box).
|
|
364
|
+
commentToolbarPosX: -2,
|
|
365
|
+
commentToolbarPosY: -44,
|
|
366
|
+
|
|
361
367
|
// ---------------------------------------------------------------------------
|
|
362
368
|
// Layout values for operations
|
|
363
369
|
// ---------------------------------------------------------------------------
|
|
@@ -737,11 +743,17 @@ const portsVerticalDefaultLayout = {
|
|
|
737
743
|
commentSizingArea: 10,
|
|
738
744
|
|
|
739
745
|
// Add comment toolbar action, default offset from viewport
|
|
740
|
-
|
|
746
|
+
addCommentOffsetX: 30,
|
|
747
|
+
addCommentOffsetY: 50,
|
|
741
748
|
|
|
742
749
|
// Comment port (circle) radius
|
|
743
750
|
commentPortRadius: 5,
|
|
744
751
|
|
|
752
|
+
// Position of the comment toolbar as an offset from the comment position
|
|
753
|
+
// (which is the top left corner of the comment bounding box).
|
|
754
|
+
commentToolbarPosX: -2,
|
|
755
|
+
commentToolbarPosY: -44,
|
|
756
|
+
|
|
745
757
|
// ---------------------------------------------------------------------------
|
|
746
758
|
// Layout values for operations
|
|
747
759
|
// ---------------------------------------------------------------------------
|
|
@@ -1442,6 +1442,10 @@ export default class ObjectModel {
|
|
|
1442
1442
|
return this.store.isBottomPanelOpen();
|
|
1443
1443
|
}
|
|
1444
1444
|
|
|
1445
|
+
setBottomPanelHeight(ht) {
|
|
1446
|
+
this.store.dispatch({ type: "SET_BOTTOM_PANEL_CONFIG", data: { config: { panelHeight: ht } } });
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1445
1449
|
// ---------------------------------------------------------------------------
|
|
1446
1450
|
// Clone methods
|
|
1447
1451
|
// ---------------------------------------------------------------------------
|
|
@@ -2380,4 +2384,12 @@ export default class ObjectModel {
|
|
|
2380
2384
|
isTooltipOpen() {
|
|
2381
2385
|
return this.store.isTooltipOpen();
|
|
2382
2386
|
}
|
|
2387
|
+
|
|
2388
|
+
// ---------------------------------------------------------------------------
|
|
2389
|
+
// Text Toolbar methods
|
|
2390
|
+
// ---------------------------------------------------------------------------
|
|
2391
|
+
setTextToolbarDef(textToolbarDef) {
|
|
2392
|
+
this.store.dispatch({ type: "SET_TEXT_TOOLBAR_DEF", data: { textToolbarDef: textToolbarDef } });
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2383
2395
|
}
|
|
@@ -28,6 +28,7 @@ import bottompanel from "./reducers/bottompanel.js";
|
|
|
28
28
|
import breadcrumbs from "./reducers/breadcrumbs.js";
|
|
29
29
|
import canvasconfig from "./reducers/canvasconfig.js";
|
|
30
30
|
import canvastoolbar from "./reducers/canvastoolbar.js";
|
|
31
|
+
import texttoolbar from "./reducers/texttoolbar.js";
|
|
31
32
|
import notifications from "./reducers/notifications.js";
|
|
32
33
|
import selectioninfo from "./reducers/selectioninfo.js";
|
|
33
34
|
import notificationpanel from "./reducers/notificationpanel.js";
|
|
@@ -50,6 +51,7 @@ export default class CanavasStore {
|
|
|
50
51
|
externalpipelineflows,
|
|
51
52
|
tooltip,
|
|
52
53
|
canvastoolbar,
|
|
54
|
+
texttoolbar,
|
|
53
55
|
contextmenu,
|
|
54
56
|
rightflyout,
|
|
55
57
|
bottompanel
|
|
@@ -66,9 +68,10 @@ export default class CanavasStore {
|
|
|
66
68
|
externalpipelineflows: [],
|
|
67
69
|
tooltip: {},
|
|
68
70
|
canvastoolbar: {},
|
|
71
|
+
texttoolbar: { isOpen: false },
|
|
69
72
|
contextmenu: { menuDef: [] },
|
|
70
73
|
rightflyout: {},
|
|
71
|
-
bottompanel: {}
|
|
74
|
+
bottompanel: { panelHeight: 393 }
|
|
72
75
|
};
|
|
73
76
|
|
|
74
77
|
let enableDevTools = false;
|
|
@@ -18,9 +18,7 @@ export default (state = {}, action) => {
|
|
|
18
18
|
switch (action.type) {
|
|
19
19
|
case "SET_BOTTOM_PANEL_CONFIG": {
|
|
20
20
|
if (action.data.config) {
|
|
21
|
-
return {
|
|
22
|
-
content: action.data.config.content,
|
|
23
|
-
isOpen: action.data.config.isOpen };
|
|
21
|
+
return Object.assign({}, state, action.data.config);
|
|
24
22
|
}
|
|
25
23
|
return state;
|
|
26
24
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 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
|
+
export default (state = {}, action) => {
|
|
18
|
+
switch (action.type) {
|
|
19
|
+
case "SET_TEXT_TOOLBAR_DEF": {
|
|
20
|
+
if (action.data.textToolbarDef) {
|
|
21
|
+
return Object.assign({}, state, action.data.textToolbarDef);
|
|
22
|
+
}
|
|
23
|
+
return state;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
default:
|
|
27
|
+
return state;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
@@ -47,6 +47,7 @@ class PaletteContentListItem extends React.Component {
|
|
|
47
47
|
this.onMouseOver = this.onMouseOver.bind(this);
|
|
48
48
|
this.onMouseLeave = this.onMouseLeave.bind(this);
|
|
49
49
|
this.onMouseDown = this.onMouseDown.bind(this);
|
|
50
|
+
this.onKeyPress = this.onKeyPress.bind(this);
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
onMouseDown() {
|
|
@@ -73,6 +74,13 @@ class PaletteContentListItem extends React.Component {
|
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
76
|
|
|
77
|
+
onKeyPress(e) {
|
|
78
|
+
// e.key === " " is needed to allow Cypress test in palette.js to run on the build machine!
|
|
79
|
+
if (e.key === " " || e.code === "Space" || e.keyCode === 32) {
|
|
80
|
+
this.onDoubleClick();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
76
84
|
// This is needed in-case the drag ends somewhere other than the canvas area.
|
|
77
85
|
onDragEnd() {
|
|
78
86
|
this.props.canvasController.nodeTemplateDragEnd();
|
|
@@ -289,23 +297,25 @@ class PaletteContentListItem extends React.Component {
|
|
|
289
297
|
: null;
|
|
290
298
|
|
|
291
299
|
const nodeLabel = itemText
|
|
292
|
-
? <div className="palette-list-item-text-div">{itemText}</div>
|
|
300
|
+
? <div className="palette-list-item-text-div" tabIndex="-1">{itemText}</div>
|
|
293
301
|
: null;
|
|
294
302
|
|
|
295
303
|
return (
|
|
296
304
|
<div id={this.props.nodeTypeInfo.nodeType.id}
|
|
297
305
|
data-id={this.props.nodeTypeInfo.nodeType.op}
|
|
306
|
+
tabIndex={0}
|
|
298
307
|
draggable={draggable}
|
|
299
308
|
className={mainDivClass}
|
|
300
309
|
onMouseOver={this.onMouseOver}
|
|
301
310
|
onMouseLeave={this.onMouseLeave}
|
|
311
|
+
onKeyPress={this.props.isEditingEnabled ? this.onKeyPress : null}
|
|
302
312
|
onMouseDown={this.props.isEditingEnabled ? this.onMouseDown : null}
|
|
303
313
|
onDragStart={this.props.isEditingEnabled ? this.onDragStart : null}
|
|
304
314
|
onDragEnd={this.props.isEditingEnabled ? this.onDragEnd : null}
|
|
305
315
|
onDoubleClick={this.props.isEditingEnabled ? this.onDoubleClick : null}
|
|
306
316
|
>
|
|
307
317
|
{categoryLabel}
|
|
308
|
-
<div className="palette-list-item-icon-and-text">
|
|
318
|
+
<div className="palette-list-item-icon-and-text" tabIndex="-1">
|
|
309
319
|
{icon}
|
|
310
320
|
{nodeLabel}
|
|
311
321
|
{ranking}
|
|
@@ -38,6 +38,7 @@ class PaletteContentList extends React.Component {
|
|
|
38
38
|
isDisplaySearchResult={false}
|
|
39
39
|
canvasController={this.props.canvasController}
|
|
40
40
|
isPaletteOpen={this.props.isPaletteOpen}
|
|
41
|
+
isEditingEnabled={this.props.isEditingEnabled}
|
|
41
42
|
/>
|
|
42
43
|
</div>
|
|
43
44
|
);
|
|
@@ -46,27 +47,20 @@ class PaletteContentList extends React.Component {
|
|
|
46
47
|
var itemKey = "item_" + idx;
|
|
47
48
|
|
|
48
49
|
contentItems.push(
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
</div>
|
|
50
|
+
<PaletteContentListItem
|
|
51
|
+
key={itemKey}
|
|
52
|
+
nodeTypeInfo={this.props.nodeTypeInfos[idx]}
|
|
53
|
+
isDisplaySearchResult={false}
|
|
54
|
+
canvasController={this.props.canvasController}
|
|
55
|
+
isPaletteOpen={this.props.isPaletteOpen}
|
|
56
|
+
isEditingEnabled={this.props.isEditingEnabled}
|
|
57
|
+
/>
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
const style = {};
|
|
63
|
-
style.borderBottom = this.props.isLastCategory ? "none" : null;
|
|
64
|
-
style.display = this.props.show ? "block" : "none";
|
|
65
|
-
|
|
66
62
|
return (
|
|
67
|
-
<div width="100%" draggable="false" className="palette-content-list palette-scroll"
|
|
68
|
-
style={ style }
|
|
69
|
-
>
|
|
63
|
+
<div width="100%" draggable="false" className="palette-content-list palette-scroll">
|
|
70
64
|
{contentItems}
|
|
71
65
|
</div>
|
|
72
66
|
);
|
|
@@ -76,11 +70,9 @@ class PaletteContentList extends React.Component {
|
|
|
76
70
|
PaletteContentList.propTypes = {
|
|
77
71
|
category: PropTypes.object.isRequired,
|
|
78
72
|
nodeTypeInfos: PropTypes.array.isRequired,
|
|
79
|
-
show: PropTypes.bool.isRequired,
|
|
80
73
|
canvasController: PropTypes.object.isRequired,
|
|
81
74
|
isPaletteOpen: PropTypes.bool.isRequired,
|
|
82
|
-
|
|
83
|
-
isEditingEnabled: PropTypes.bool.isRequired
|
|
75
|
+
isEditingEnabled: PropTypes.bool.isRequired,
|
|
84
76
|
};
|
|
85
77
|
|
|
86
78
|
export default PaletteContentList;
|
|
@@ -53,12 +53,8 @@ class PaletteDialogContentGrid extends React.Component {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
const displayValue = this.props.show ? "block" : "none";
|
|
57
|
-
|
|
58
56
|
return (
|
|
59
|
-
<div width="100%" className="palette-scroll"
|
|
60
|
-
style={{ display: displayValue }}
|
|
61
|
-
>
|
|
57
|
+
<div width="100%" className="palette-scroll">
|
|
62
58
|
{gridNodes}
|
|
63
59
|
</div>
|
|
64
60
|
);
|
|
@@ -68,7 +64,6 @@ class PaletteDialogContentGrid extends React.Component {
|
|
|
68
64
|
PaletteDialogContentGrid.propTypes = {
|
|
69
65
|
category: PropTypes.object.isRequired,
|
|
70
66
|
nodeTypes: PropTypes.array.isRequired,
|
|
71
|
-
show: PropTypes.bool.isRequired,
|
|
72
67
|
isEditingEnabled: PropTypes.bool.isRequired,
|
|
73
68
|
canvasController: PropTypes.object.isRequired
|
|
74
69
|
};
|
|
@@ -80,27 +80,29 @@ class PaletteDialogContent extends React.Component {
|
|
|
80
80
|
const category = this.getSelectedCategory(this.props.paletteJSON.categories);
|
|
81
81
|
const nodeTypes = category && category.node_types ? category.node_types : [];
|
|
82
82
|
const nodeTypeInfos = nodeTypes.map((nt) => ({ nodeType: nt, category: category }));
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
<PaletteDialogContentCategories categories={cats}
|
|
87
|
-
selectedCategory={this.state.selectedCategory}
|
|
88
|
-
categorySelectedMethod={this.categorySelected}
|
|
89
|
-
/>
|
|
90
|
-
<PaletteDialogContentGrid show={this.props.showGrid}
|
|
83
|
+
const content = this.props.showGrid
|
|
84
|
+
? (
|
|
85
|
+
<PaletteDialogContentGrid
|
|
91
86
|
category={category}
|
|
92
87
|
nodeTypes={nodeTypes}
|
|
93
88
|
canvasController={this.props.canvasController}
|
|
94
89
|
isEditingEnabled={this.props.isEditingEnabled}
|
|
95
|
-
/>
|
|
96
|
-
|
|
90
|
+
/>)
|
|
91
|
+
: (
|
|
92
|
+
<PaletteContentList
|
|
97
93
|
category={category}
|
|
98
94
|
nodeTypeInfos={nodeTypeInfos}
|
|
99
95
|
canvasController={this.props.canvasController}
|
|
100
96
|
isPaletteOpen
|
|
101
|
-
isLastCategory={false}
|
|
102
97
|
isEditingEnabled={this.props.isEditingEnabled}
|
|
98
|
+
/>);
|
|
99
|
+
return (
|
|
100
|
+
<div className="palette-dialog-content" ref="palettecontent">
|
|
101
|
+
<PaletteDialogContentCategories categories={cats}
|
|
102
|
+
selectedCategory={this.state.selectedCategory}
|
|
103
|
+
categorySelectedMethod={this.categorySelected}
|
|
103
104
|
/>
|
|
105
|
+
{content}
|
|
104
106
|
</div>
|
|
105
107
|
);
|
|
106
108
|
}
|
|
@@ -17,15 +17,21 @@
|
|
|
17
17
|
import React from "react";
|
|
18
18
|
import PropTypes from "prop-types";
|
|
19
19
|
import { InlineLoading } from "carbon-components-react";
|
|
20
|
-
import Icon from "../icons/icon.jsx";
|
|
21
20
|
import SVG from "react-inlinesvg";
|
|
22
|
-
import { TIP_TYPE_PALETTE_CATEGORY
|
|
21
|
+
import { TIP_TYPE_PALETTE_CATEGORY } from "../common-canvas/constants/canvas-constants.js";
|
|
23
22
|
import { get } from "lodash";
|
|
23
|
+
import { AccordionItem } from "carbon-components-react";
|
|
24
|
+
import PaletteContentList from "./palette-content-list.jsx";
|
|
25
|
+
|
|
24
26
|
|
|
25
27
|
class PaletteFlyoutContentCategory extends React.Component {
|
|
26
28
|
constructor(props) {
|
|
27
29
|
super(props);
|
|
28
30
|
|
|
31
|
+
this.state = {
|
|
32
|
+
isOpen: false
|
|
33
|
+
};
|
|
34
|
+
|
|
29
35
|
this.onMouseOver = this.onMouseOver.bind(this);
|
|
30
36
|
this.onMouseLeave = this.onMouseLeave.bind(this);
|
|
31
37
|
this.categorySelected = this.categorySelected.bind(this);
|
|
@@ -63,7 +69,7 @@ class PaletteFlyoutContentCategory extends React.Component {
|
|
|
63
69
|
description = this.props.category.loading_text;
|
|
64
70
|
}
|
|
65
71
|
|
|
66
|
-
const
|
|
72
|
+
const titleLoadingObj = (
|
|
67
73
|
<div className="palette-flyout-category">
|
|
68
74
|
<div className="palette-flyout-category-item-loading">
|
|
69
75
|
<InlineLoading
|
|
@@ -78,39 +84,45 @@ class PaletteFlyoutContentCategory extends React.Component {
|
|
|
78
84
|
</div>
|
|
79
85
|
</div>
|
|
80
86
|
);
|
|
87
|
+
|
|
88
|
+
const content = (
|
|
89
|
+
<AccordionItem className="palette-loading-category" title={titleLoadingObj} />
|
|
90
|
+
);
|
|
81
91
|
return content;
|
|
82
92
|
}
|
|
83
93
|
|
|
94
|
+
// Returns the category object for a regular category.
|
|
84
95
|
getRenderCategory() {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
? <Icon type={CANVAS_CARBON_ICONS.CHEVRONARROWS.UP} className={caretClassName} />
|
|
94
|
-
: <Icon type={CANVAS_CARBON_ICONS.CHEVRONARROWS.DOWN} className={caretClassName} />;
|
|
95
|
-
}
|
|
96
|
+
const titleObj = this.getTitleObj();
|
|
97
|
+
const content = this.getContent();
|
|
98
|
+
return (
|
|
99
|
+
<AccordionItem title={titleObj} onHeadingClick={({ isOpen }) => this.setState({ isOpen })}>
|
|
100
|
+
{content}
|
|
101
|
+
</AccordionItem>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
96
104
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
105
|
+
// Returns the title object for the category consisting of the image and text.
|
|
106
|
+
getTitleObj() {
|
|
107
|
+
const itemImage = this.getItemImage();
|
|
108
|
+
const itemText = this.getItemText();
|
|
109
|
+
return (
|
|
110
|
+
<div className="palette-flyout-category"
|
|
111
|
+
data-id={get(this.props.category, "id", "")}
|
|
112
|
+
onClick={this.categorySelected}
|
|
113
|
+
value={this.props.category.label}
|
|
114
|
+
onMouseOver={this.onMouseOver}
|
|
115
|
+
onMouseLeave={this.onMouseLeave}
|
|
116
|
+
>
|
|
117
|
+
<div className="palette-flyout-category-item">
|
|
118
|
+
{itemImage}
|
|
119
|
+
{itemText}
|
|
120
|
+
</div></div>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
113
123
|
|
|
124
|
+
// Returns the text for the category
|
|
125
|
+
getItemText() {
|
|
114
126
|
let itemText = null;
|
|
115
127
|
const label = this.getDisplayLabel();
|
|
116
128
|
if (this.props.isPaletteOpen === true) {
|
|
@@ -131,23 +143,50 @@ class PaletteFlyoutContentCategory extends React.Component {
|
|
|
131
143
|
</span>
|
|
132
144
|
);
|
|
133
145
|
}
|
|
146
|
+
return itemText;
|
|
147
|
+
}
|
|
134
148
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
// Returns the image for the category
|
|
150
|
+
getItemImage() {
|
|
151
|
+
let itemImage = null;
|
|
152
|
+
if (this.props.category.image && this.props.category.image !== "") {
|
|
153
|
+
if (this.props.category.image.endsWith(".svg")) {
|
|
154
|
+
itemImage = (
|
|
155
|
+
<div>
|
|
156
|
+
<SVG src={this.props.category.image} className="palette-flyout-category-item-icon" draggable="false" />
|
|
157
|
+
</div>
|
|
158
|
+
);
|
|
159
|
+
} else {
|
|
160
|
+
itemImage = (
|
|
161
|
+
<div>
|
|
162
|
+
<img src={this.props.category.image} className="palette-flyout-category-item-icon" draggable="false" />
|
|
163
|
+
</div>
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return itemImage;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Returns the content object for the AccordionItem. This is only set to
|
|
171
|
+
// something if the category is open (that is: isOpen is true). It is useful
|
|
172
|
+
// to remove the nodes from the DOM when the category is closed because this
|
|
173
|
+
// can help inline SVG icons on the canvas, that reference elements in the
|
|
174
|
+
// <defs> element, to appear correclty.
|
|
175
|
+
getContent() {
|
|
176
|
+
if (this.state.isOpen) {
|
|
177
|
+
const nodeTypeInfos = this.props.category.node_types.map((nt) => ({ nodeType: nt, category: this.props.category }));
|
|
178
|
+
return (
|
|
179
|
+
<PaletteContentList
|
|
180
|
+
key={this.props.category.id + "-nodes"}
|
|
181
|
+
category={this.props.category}
|
|
182
|
+
nodeTypeInfos={nodeTypeInfos}
|
|
183
|
+
canvasController={this.props.canvasController}
|
|
184
|
+
isPaletteOpen={this.props.isPaletteOpen}
|
|
185
|
+
isEditingEnabled={this.props.isEditingEnabled}
|
|
186
|
+
/>
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
return null;
|
|
151
190
|
}
|
|
152
191
|
|
|
153
192
|
categorySelected() {
|
|
@@ -155,24 +194,18 @@ class PaletteFlyoutContentCategory extends React.Component {
|
|
|
155
194
|
}
|
|
156
195
|
|
|
157
196
|
render() {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
} else {
|
|
162
|
-
content = this.getRenderCategory();
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
return content;
|
|
197
|
+
return this.props.category.loading_text
|
|
198
|
+
? this.getInlineLoadingRenderCategory()
|
|
199
|
+
: this.getRenderCategory();
|
|
166
200
|
}
|
|
167
201
|
}
|
|
168
202
|
|
|
169
203
|
PaletteFlyoutContentCategory.propTypes = {
|
|
170
204
|
category: PropTypes.object.isRequired,
|
|
171
|
-
isCategorySelected: PropTypes.bool.isRequired,
|
|
172
205
|
categorySelectedMethod: PropTypes.func.isRequired,
|
|
173
|
-
itemCount: PropTypes.number.isRequired,
|
|
174
206
|
canvasController: PropTypes.object.isRequired,
|
|
175
|
-
isPaletteOpen: PropTypes.bool.isRequired
|
|
207
|
+
isPaletteOpen: PropTypes.bool.isRequired,
|
|
208
|
+
isEditingEnabled: PropTypes.bool.isRequired,
|
|
176
209
|
};
|
|
177
210
|
|
|
178
211
|
export default PaletteFlyoutContentCategory;
|
|
@@ -20,9 +20,10 @@ import { debounce } from "lodash";
|
|
|
20
20
|
import { getFilteredNodeTypeInfos } from "./palette-flyout-utils.js";
|
|
21
21
|
import PaletteFlyoutContentCategory from "./palette-flyout-content-category.jsx";
|
|
22
22
|
import PaletteFlyoutContentSearch from "./palette-flyout-content-search.jsx";
|
|
23
|
-
import PaletteContentList from "./palette-content-list.jsx";
|
|
24
23
|
import PaletteFlyoutContentFilteredList from "./palette-flyout-content-filtered-list.jsx";
|
|
25
24
|
import Logger from "../logging/canvas-logger.js";
|
|
25
|
+
import { Accordion } from "carbon-components-react";
|
|
26
|
+
|
|
26
27
|
|
|
27
28
|
const logger = new Logger("PaletteFlyoutContent");
|
|
28
29
|
|
|
@@ -71,41 +72,20 @@ class PaletteFlyoutContent extends React.Component {
|
|
|
71
72
|
const contentDivs = [];
|
|
72
73
|
for (let idx = 0; idx < categories.length; idx++) {
|
|
73
74
|
const category = categories[idx];
|
|
74
|
-
const isLastCategory = idx === categories.length - 1;
|
|
75
|
-
const nodeTypeInfos = category.node_types.map((nt) => ({ nodeType: nt, category: category }));
|
|
76
|
-
const isCategorySelected = this.isCategorySelected(category.id);
|
|
77
|
-
|
|
78
|
-
let content = null;
|
|
79
|
-
if (isCategorySelected) {
|
|
80
|
-
content = (
|
|
81
|
-
<PaletteContentList
|
|
82
|
-
key={category.label + "-nodes"}
|
|
83
|
-
show
|
|
84
|
-
category={category}
|
|
85
|
-
nodeTypeInfos={nodeTypeInfos}
|
|
86
|
-
canvasController={this.props.canvasController}
|
|
87
|
-
isPaletteOpen={this.props.isPaletteOpen}
|
|
88
|
-
isLastCategory={isLastCategory}
|
|
89
|
-
isEditingEnabled={this.props.isEditingEnabled}
|
|
90
|
-
/>);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
75
|
contentDivs.push(
|
|
94
76
|
<div key={category.label + "-container"}>
|
|
95
77
|
<PaletteFlyoutContentCategory
|
|
96
78
|
key={category.id}
|
|
97
79
|
category={category}
|
|
98
|
-
isCategorySelected={isCategorySelected}
|
|
99
80
|
categorySelectedMethod={this.categorySelected}
|
|
100
|
-
itemCount={nodeTypeInfos.length}
|
|
101
81
|
canvasController={this.props.canvasController}
|
|
102
82
|
isPaletteOpen={this.props.isPaletteOpen}
|
|
83
|
+
isEditingEnabled={this.props.isEditingEnabled}
|
|
103
84
|
/>
|
|
104
|
-
{content}
|
|
105
85
|
</div>
|
|
106
86
|
);
|
|
107
87
|
}
|
|
108
|
-
return contentDivs
|
|
88
|
+
return <Accordion>{contentDivs}</Accordion>;
|
|
109
89
|
}
|
|
110
90
|
|
|
111
91
|
getFilteredContentDivs(categories) {
|