@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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
2
|
+
"toolbar.palette": "Paleta",
|
|
3
|
+
"toolbar.zoomIn": "Aumentar",
|
|
4
|
+
"toolbar.zoomOut": "Alejar",
|
|
5
|
+
"toolbar.zoomToFit": "Ajustar",
|
|
6
|
+
"toolbar.overflowMenu": "Menú de desbordamiento",
|
|
7
|
+
"toolbar.label": "Barra de herramientas del lienzo"
|
|
8
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
2
|
+
"toolbar.palette": "Palette",
|
|
3
|
+
"toolbar.zoomIn": "Zoom avant",
|
|
4
|
+
"toolbar.zoomOut": "Zoom arrière",
|
|
5
|
+
"toolbar.zoomToFit": "Zoom d'ajustement",
|
|
6
|
+
"toolbar.overflowMenu": "Menu déroulant dynamique",
|
|
7
|
+
"toolbar.label": "Barre d'outils de canevas"
|
|
8
|
+
}
|
|
@@ -20,8 +20,8 @@ const fr = require("./fr.json");
|
|
|
20
20
|
const itIT = require("./it.json");
|
|
21
21
|
const ja = require("./ja.json");
|
|
22
22
|
const ptBR = require("./pt-br.json");
|
|
23
|
-
const zhTW = require("./zh-
|
|
24
|
-
const zhCN = require("./zh-
|
|
23
|
+
const zhTW = require("./zh-TW.json");
|
|
24
|
+
const zhCN = require("./zh-CN.json");
|
|
25
25
|
const ru = require("./ru.json");
|
|
26
26
|
const eo = require("./eo.json");
|
|
27
27
|
const ko = require("./ko.json");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
2
|
+
"toolbar.palette": "Tavolozza",
|
|
3
|
+
"toolbar.zoomIn": "Zoom avanti",
|
|
4
|
+
"toolbar.zoomOut": "Zoom indietro",
|
|
5
|
+
"toolbar.zoomToFit": "Adatta zoom",
|
|
6
|
+
"toolbar.overflowMenu": "Menu Overflow",
|
|
7
|
+
"toolbar.label": "Barra degli strumenti area di disegno"
|
|
8
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
2
|
+
"toolbar.palette": "パレット",
|
|
3
|
+
"toolbar.zoomIn": "ズームイン",
|
|
4
|
+
"toolbar.zoomOut": "ズームアウト",
|
|
5
|
+
"toolbar.zoomToFit": "適合ズーム",
|
|
6
|
+
"toolbar.overflowMenu": "オーバーフロー・メニュー",
|
|
7
|
+
"toolbar.label": "キャンバス・ツールバー"
|
|
8
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
2
|
+
"toolbar.palette": "Paleta",
|
|
3
|
+
"toolbar.zoomIn": "Aumentar zoom",
|
|
4
|
+
"toolbar.zoomOut": "Diminuir zoom",
|
|
5
|
+
"toolbar.zoomToFit": "Zoom para ajustar",
|
|
6
|
+
"toolbar.overflowMenu": "Menu overflow",
|
|
7
|
+
"toolbar.label": "Barra de ferramentas de tela"
|
|
8
|
+
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elyra/canvas",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.15.0",
|
|
4
4
|
"description": "Elyra common-canvas",
|
|
5
5
|
"main": "dist/common-canvas.js",
|
|
6
6
|
"module": "dist/common-canvas.es.js",
|
|
7
7
|
"homepage": "https://github.com/elyra-ai/canvas",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "https://github.com/elyra-ai/canvas/tree/
|
|
10
|
+
"url": "https://github.com/elyra-ai/canvas/tree/main/canvas_modules/common-canvas"
|
|
11
11
|
},
|
|
12
12
|
"bugs": {
|
|
13
13
|
"url": "https://github.com/elyra-ai/canvas/issues"
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"immutable": "^4.0.0",
|
|
32
32
|
"jsonschema": "^1.4.0",
|
|
33
33
|
"lodash": "^4.17.21",
|
|
34
|
+
"markdown-it": "^13.0.1",
|
|
34
35
|
"prop-types": "^15.7.2",
|
|
35
36
|
"react-codemirror2": "^7.2.1",
|
|
36
37
|
"react-contextmenu": "^2.14.0",
|
|
@@ -406,7 +406,7 @@ export default class CanvasController {
|
|
|
406
406
|
// nodeTypeObj - must conform to the style of node used by the palette as
|
|
407
407
|
// described in the palette schema. See objects in nodeTypes array in the
|
|
408
408
|
// palette schema:
|
|
409
|
-
// https://github.com/elyra-ai/pipeline-schemas/blob/
|
|
409
|
+
// https://github.com/elyra-ai/pipeline-schemas/blob/main/common-canvas/palette/palette-v3-schema.json
|
|
410
410
|
// category - is the name of the palette category where the node will be
|
|
411
411
|
// added. If the category doesn't exist it will be created.
|
|
412
412
|
// categoryLabel - Is an optional param. If a new category is created it will
|
|
@@ -423,7 +423,7 @@ export default class CanvasController {
|
|
|
423
423
|
// nodeTypeObjs - an array of nodetypes that must conform to the style of
|
|
424
424
|
// nodes used by the palette as described in the palette schema. See objects
|
|
425
425
|
// in nodeTypes array in the palette schema:
|
|
426
|
-
// https://github.com/elyra-ai/pipeline-schemas/blob/
|
|
426
|
+
// https://github.com/elyra-ai/pipeline-schemas/blob/main/common-canvas/palette/palette-v3-schema.json
|
|
427
427
|
// category - is the name of the palette category where the node will be
|
|
428
428
|
// added. If the category doesn't exist it will be created.
|
|
429
429
|
// categoryLabel - is an optional param. If a new category is created it will
|
|
@@ -545,7 +545,7 @@ export default class CanvasController {
|
|
|
545
545
|
return this.objectModel.areSelectedNodesContiguous();
|
|
546
546
|
}
|
|
547
547
|
|
|
548
|
-
// Returns true if all the selected
|
|
548
|
+
// Returns true if all the selected objects are links.
|
|
549
549
|
areAllSelectedObjectsLinks() {
|
|
550
550
|
return this.objectModel.areAllSelectedObjectsLinks();
|
|
551
551
|
}
|
|
@@ -1405,6 +1405,10 @@ export default class CanvasController {
|
|
|
1405
1405
|
return this.getObjectModel().isBottomPanelOpen();
|
|
1406
1406
|
}
|
|
1407
1407
|
|
|
1408
|
+
setBottomPanelHeight(ht) {
|
|
1409
|
+
this.objectModel.setBottomPanelHeight(ht);
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1408
1412
|
closeContextMenu() {
|
|
1409
1413
|
this.objectModel.closeContextMenu();
|
|
1410
1414
|
}
|
|
@@ -1776,6 +1780,18 @@ export default class CanvasController {
|
|
|
1776
1780
|
}
|
|
1777
1781
|
}
|
|
1778
1782
|
|
|
1783
|
+
openTextToolbar(xPos, yPos, actionHandler, blurHandler) {
|
|
1784
|
+
this.objectModel.setTextToolbarDef({ isOpen: true, pos_x: xPos, pos_y: yPos, actionHandler, blurHandler });
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
closeTextToolbar() {
|
|
1788
|
+
this.objectModel.setTextToolbarDef({ isOpen: false });
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
moveTextToolbar(xPos, yPos) {
|
|
1792
|
+
this.objectModel.setTextToolbarDef({ pos_x: xPos, pos_y: yPos });
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1779
1795
|
// Processes the drop of an 'external' object, either from the desktop or
|
|
1780
1796
|
// elsewhere on the browser page, onto the canvas.
|
|
1781
1797
|
// dropData - The data describing the object being dropped
|
|
@@ -19,14 +19,13 @@ import PropTypes from "prop-types";
|
|
|
19
19
|
import { connect } from "react-redux";
|
|
20
20
|
import Logger from "../logging/canvas-logger.js";
|
|
21
21
|
|
|
22
|
+
const MARGIN_TOP = 100;
|
|
23
|
+
const MIN_HEIGHT = 75;
|
|
24
|
+
|
|
22
25
|
class CanvasBottomPanel extends React.Component {
|
|
23
26
|
constructor(props) {
|
|
24
27
|
super(props);
|
|
25
28
|
|
|
26
|
-
this.state = {
|
|
27
|
-
panelHeight: 393
|
|
28
|
-
};
|
|
29
|
-
|
|
30
29
|
this.logger = new Logger("CC-Bottom-Panel");
|
|
31
30
|
|
|
32
31
|
this.onMouseUp = this.onMouseUp.bind(this);
|
|
@@ -38,7 +37,10 @@ class CanvasBottomPanel extends React.Component {
|
|
|
38
37
|
if (e.button === 0) {
|
|
39
38
|
document.addEventListener("mousemove", this.onMouseMoveY, true);
|
|
40
39
|
document.addEventListener("mouseup", this.onMouseUp, true);
|
|
41
|
-
this.
|
|
40
|
+
this.posY = e.clientY;
|
|
41
|
+
// Prevent panel contents being dragged in the test harness (which can
|
|
42
|
+
// happen even though draggable is false for the contents!)
|
|
43
|
+
e.preventDefault();
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
46
|
|
|
@@ -49,29 +51,37 @@ class CanvasBottomPanel extends React.Component {
|
|
|
49
51
|
|
|
50
52
|
onMouseMoveY(e) {
|
|
51
53
|
if (e.clientY) {
|
|
52
|
-
const diff = e.clientY - this.
|
|
53
|
-
this.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
const diff = e.clientY - this.posY;
|
|
55
|
+
const ht = this.props.panelHeight - diff;
|
|
56
|
+
this.props.canvasController.setBottomPanelHeight(this.limitHeight(ht));
|
|
57
|
+
this.posY = e.clientY;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Returns a new height for the bottom panel limited by the need to enforce
|
|
62
|
+
// a minimum and maximum height.
|
|
63
|
+
limitHeight(ht) {
|
|
64
|
+
const canvasContainer = document.getElementById(this.props.containingDivId);
|
|
65
|
+
let height = ht;
|
|
66
|
+
|
|
67
|
+
// canvasContainer may not be available in some test situations
|
|
68
|
+
if (canvasContainer) {
|
|
69
|
+
const canvasHeight = canvasContainer.getBoundingClientRect().height;
|
|
70
|
+
const maxHeight = canvasHeight - MARGIN_TOP;
|
|
71
|
+
height = Math.min(Math.max(height, MIN_HEIGHT), maxHeight);
|
|
57
72
|
}
|
|
73
|
+
return height;
|
|
58
74
|
}
|
|
75
|
+
|
|
59
76
|
render() {
|
|
60
77
|
this.logger.log("render");
|
|
61
78
|
let bottomPanel = null;
|
|
62
79
|
|
|
63
80
|
if (this.props.bottomPanelIsOpen) {
|
|
64
|
-
const
|
|
65
|
-
const rectHeight = canvasContainer
|
|
66
|
-
? canvasContainer.getBoundingClientRect().height
|
|
67
|
-
: 0;
|
|
68
|
-
const marginTop = 60;
|
|
69
|
-
const height = this.state.panelHeight >= (rectHeight - marginTop)
|
|
70
|
-
? (rectHeight - marginTop)
|
|
71
|
-
: this.state.panelHeight;
|
|
81
|
+
const heightPx = this.limitHeight(this.props.panelHeight) + "px";
|
|
72
82
|
|
|
73
83
|
bottomPanel = (
|
|
74
|
-
<div className="bottom-panel" style={{ height }} >
|
|
84
|
+
<div className="bottom-panel" style={{ height: heightPx }} >
|
|
75
85
|
<div className="bottom-panel-drag" onMouseDown={this.onMouseDown} />
|
|
76
86
|
<div className="bottom-panel-contents">
|
|
77
87
|
{this.props.bottomPanelContent}
|
|
@@ -85,13 +95,19 @@ class CanvasBottomPanel extends React.Component {
|
|
|
85
95
|
}
|
|
86
96
|
|
|
87
97
|
CanvasBottomPanel.propTypes = {
|
|
98
|
+
// Provided by CommonCanvas
|
|
99
|
+
canvasController: PropTypes.object,
|
|
100
|
+
containingDivId: PropTypes.string,
|
|
101
|
+
|
|
88
102
|
// Provided by Redux
|
|
89
103
|
bottomPanelIsOpen: PropTypes.bool,
|
|
90
|
-
bottomPanelContent: PropTypes.object
|
|
104
|
+
bottomPanelContent: PropTypes.object,
|
|
105
|
+
panelHeight: PropTypes.number
|
|
91
106
|
};
|
|
92
107
|
|
|
93
108
|
const mapStateToProps = (state, ownProps) => ({
|
|
94
109
|
bottomPanelIsOpen: state.bottompanel.isOpen,
|
|
95
|
-
bottomPanelContent: state.bottompanel.content
|
|
110
|
+
bottomPanelContent: state.bottompanel.content,
|
|
111
|
+
panelHeight: state.bottompanel.panelHeight
|
|
96
112
|
});
|
|
97
113
|
export default connect(mapStateToProps)(CanvasBottomPanel);
|
|
@@ -37,7 +37,7 @@ class CommonCanvasCentralItems extends React.Component {
|
|
|
37
37
|
const canvasToolbar = (<CommonCanvasToolbar canvasController={this.props.canvasController} />);
|
|
38
38
|
const notificationPanel = (<NotificationPanel canvasController={this.props.canvasController} />);
|
|
39
39
|
const canvasContents = (<CanvasContents canvasController={this.props.canvasController} />);
|
|
40
|
-
const bottomPanel = (<CanvasBottomPanel canvasController={this.props.canvasController} />);
|
|
40
|
+
const bottomPanel = (<CanvasBottomPanel canvasController={this.props.canvasController} containingDivId={this.props.containingDivId} />);
|
|
41
41
|
|
|
42
42
|
let centralItems = null;
|
|
43
43
|
if (this.props.enableRightFlyoutUnderToolbar) {
|
|
@@ -23,6 +23,7 @@ import { connect } from "react-redux";
|
|
|
23
23
|
import { injectIntl } from "react-intl";
|
|
24
24
|
import defaultMessages from "../../locales/common-canvas/locales/en.json";
|
|
25
25
|
import CommonCanvasContextMenu from "./cc-context-menu.jsx";
|
|
26
|
+
import CommonCanvasTextToolbar from "./cc-text-toolbar.jsx";
|
|
26
27
|
import CommonCanvasStateTag from "./cc-state-tag.jsx";
|
|
27
28
|
import CanvasUtils from "./common-canvas-utils.js";
|
|
28
29
|
import { FlowData16 } from "@carbon/icons-react";
|
|
@@ -305,6 +306,13 @@ class CanvasContents extends React.Component {
|
|
|
305
306
|
/>);
|
|
306
307
|
}
|
|
307
308
|
|
|
309
|
+
getTextToolbar() {
|
|
310
|
+
return (
|
|
311
|
+
<CommonCanvasTextToolbar
|
|
312
|
+
canvasController={this.props.canvasController}
|
|
313
|
+
/>);
|
|
314
|
+
}
|
|
315
|
+
|
|
308
316
|
getDropZone() {
|
|
309
317
|
let dropZoneCanvas = null;
|
|
310
318
|
if (this.isDropZoneDisplayed()) {
|
|
@@ -416,9 +424,6 @@ class CanvasContents extends React.Component {
|
|
|
416
424
|
}
|
|
417
425
|
this.svgCanvasD3.externalObjectDropped(dropData, event.clientX, event.clientY);
|
|
418
426
|
}
|
|
419
|
-
|
|
420
|
-
// Also clear dataTransfer data for when we get external objects.
|
|
421
|
-
event.dataTransfer.clearData();
|
|
422
427
|
}
|
|
423
428
|
|
|
424
429
|
dragOver(event) {
|
|
@@ -485,6 +490,7 @@ class CanvasContents extends React.Component {
|
|
|
485
490
|
const stateTag = this.getStateTag();
|
|
486
491
|
const emptyCanvas = this.getEmptyCanvas();
|
|
487
492
|
const contextMenu = this.getContextMenu();
|
|
493
|
+
const textToolbar = this.getTextToolbar();
|
|
488
494
|
const dropZoneCanvas = this.getDropZone();
|
|
489
495
|
const svgCanvasDiv = this.getSVGCanvasDiv();
|
|
490
496
|
|
|
@@ -518,6 +524,7 @@ class CanvasContents extends React.Component {
|
|
|
518
524
|
{emptyCanvas}
|
|
519
525
|
{svgCanvasDiv}
|
|
520
526
|
{contextMenu}
|
|
527
|
+
{textToolbar}
|
|
521
528
|
{dropZoneCanvas}
|
|
522
529
|
{stateTag}
|
|
523
530
|
</div>
|
|
@@ -0,0 +1,141 @@
|
|
|
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
|
+
import React from "react";
|
|
18
|
+
import PropTypes from "prop-types";
|
|
19
|
+
import { connect } from "react-redux";
|
|
20
|
+
import { injectIntl } from "react-intl";
|
|
21
|
+
import defaultMessages from "../../locales/common-canvas/locales/en.json";
|
|
22
|
+
import defaultToolbarMessages from "../../locales/toolbar/locales/en.json";
|
|
23
|
+
import Toolbar from "../toolbar/toolbar.jsx";
|
|
24
|
+
import CanvasUtils from "../common-canvas/common-canvas-utils.js";
|
|
25
|
+
import Logger from "../logging/canvas-logger.js";
|
|
26
|
+
import { OverflowMenu, OverflowMenuItem } from "carbon-components-react";
|
|
27
|
+
import { Code32, Link32, ListBulleted32, ListNumbered32, TextIndentMore32,
|
|
28
|
+
TextBold32, TextItalic32, TextScale32, TextStrikethrough32 } from "@carbon/icons-react";
|
|
29
|
+
|
|
30
|
+
class CommonCanvasTextToolbar extends React.Component {
|
|
31
|
+
constructor(props) {
|
|
32
|
+
super(props);
|
|
33
|
+
|
|
34
|
+
this.getLabel = this.getLabel.bind(this);
|
|
35
|
+
this.logger = new Logger("CC-Toolbar");
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
getLabel(labelId, substituteObj) {
|
|
39
|
+
const defaultMessage = defaultMessages[labelId] ? defaultMessages[labelId] : defaultToolbarMessages[labelId];
|
|
40
|
+
return this.props.intl.formatMessage({ id: labelId, defaultMessage: defaultMessage }, substituteObj);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
getJsxLabel(key, shortcutSuffix, shortcutSuffix2) {
|
|
44
|
+
const osKey = CanvasUtils.isMacintosh() ? "⌘" : "Ctrl";
|
|
45
|
+
const shortCut = shortcutSuffix ? (osKey + " + " + shortcutSuffix) : null;
|
|
46
|
+
const shortCut2 = shortcutSuffix2 ? (osKey + " + " + shortcutSuffix2) : null;
|
|
47
|
+
return (
|
|
48
|
+
<div>
|
|
49
|
+
{this.getLabel(key)}<br />{shortCut}<br />{shortCut2}
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
getTextToolbar() {
|
|
55
|
+
const headerLabel = this.getJsxLabel("texttoolbar.headerAction", ">", "<");
|
|
56
|
+
const boldLabel = this.getJsxLabel("texttoolbar.boldAction", "b");
|
|
57
|
+
const italicsLabel = this.getJsxLabel("texttoolbar.italicsAction", "i");
|
|
58
|
+
const strikethroughLabel = this.getJsxLabel("texttoolbar.strikethroughAction", "shift + x");
|
|
59
|
+
const codeLabel = this.getJsxLabel("texttoolbar.codeAction", "e");
|
|
60
|
+
const linkLabel = this.getJsxLabel("texttoolbar.linkAction", "k");
|
|
61
|
+
const quoteLabel = this.getJsxLabel("texttoolbar.quoteAction", "shift + >");
|
|
62
|
+
const numberedListLabel = this.getJsxLabel("texttoolbar.numberedListAction", "shift + 7");
|
|
63
|
+
const bulletedListLabel = this.getJsxLabel("texttoolbar.bulletedListAction", "shift + 8");
|
|
64
|
+
const headerOptions = (
|
|
65
|
+
<div>
|
|
66
|
+
<OverflowMenu id={"headerMenu"} iconDescription={""} renderIcon={TextScale32} >
|
|
67
|
+
<OverflowMenuItem itemText={this.getLabel("texttoolbar.titleAction")} onClick={(evt) => this.props.actionHandler("title", evt)} />
|
|
68
|
+
<OverflowMenuItem itemText={this.getLabel("texttoolbar.headerAction")} onClick={(evt) => this.props.actionHandler("header", evt)} />
|
|
69
|
+
<OverflowMenuItem itemText={this.getLabel("texttoolbar.subheaderAction")} onClick={(evt) => this.props.actionHandler("subheader", evt)} />
|
|
70
|
+
<OverflowMenuItem itemText={this.getLabel("texttoolbar.bodyAction")} onClick={(evt) => this.props.actionHandler("body", evt)} />
|
|
71
|
+
</OverflowMenu>
|
|
72
|
+
<svg className="text-toolbar-tick-svg">
|
|
73
|
+
<path d="M 39 39 L 39 33 33 39 Z" className="text-toolbar-tick-mark" />
|
|
74
|
+
</svg>
|
|
75
|
+
</div>
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
leftBar: [
|
|
80
|
+
{ action: "header", tooltip: headerLabel, jsx: headerOptions },
|
|
81
|
+
{ divider: true },
|
|
82
|
+
{ action: "bold", label: boldLabel, enable: true, iconEnabled: (<TextBold32 />) },
|
|
83
|
+
{ action: "italics", label: italicsLabel, enable: true, iconEnabled: (<TextItalic32 />) },
|
|
84
|
+
{ action: "strikethrough", label: strikethroughLabel, enable: true, iconEnabled: (<TextStrikethrough32 />) },
|
|
85
|
+
{ divider: true },
|
|
86
|
+
{ action: "code", label: codeLabel, enable: true, iconEnabled: (<Code32 />) },
|
|
87
|
+
{ divider: true },
|
|
88
|
+
{ action: "link", label: linkLabel, enable: true, iconEnabled: (<Link32 />) },
|
|
89
|
+
{ divider: true },
|
|
90
|
+
{ action: "quote", label: quoteLabel, enable: true, iconEnabled: (<TextIndentMore32 />) },
|
|
91
|
+
{ divider: true },
|
|
92
|
+
{ action: "numberedList", label: numberedListLabel, enable: true, iconEnabled: (<ListNumbered32 />) },
|
|
93
|
+
{ action: "bulletedList", label: bulletedListLabel, enable: true, iconEnabled: (<ListBulleted32 />) }
|
|
94
|
+
]
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
render() {
|
|
99
|
+
this.logger.log("render");
|
|
100
|
+
|
|
101
|
+
let textToolbar = null;
|
|
102
|
+
|
|
103
|
+
if (this.props.isOpen) {
|
|
104
|
+
textToolbar = (
|
|
105
|
+
<div className={"text-toolbar"} style={{ left: this.props.pos_x, top: this.props.pos_y }} onBlur={this.props.blurHandler}>
|
|
106
|
+
<Toolbar
|
|
107
|
+
config={this.getTextToolbar()}
|
|
108
|
+
instanceId={this.props.canvasController.getInstanceId()}
|
|
109
|
+
toolbarActionHandler={this.props.actionHandler}
|
|
110
|
+
tooltipDirection={"top"}
|
|
111
|
+
/>
|
|
112
|
+
</div>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return textToolbar;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
CommonCanvasTextToolbar.propTypes = {
|
|
121
|
+
// Provided by CommonCanvas
|
|
122
|
+
intl: PropTypes.object.isRequired,
|
|
123
|
+
canvasController: PropTypes.object.isRequired,
|
|
124
|
+
|
|
125
|
+
// Provided by redux
|
|
126
|
+
isOpen: PropTypes.bool.isRequired,
|
|
127
|
+
pos_x: PropTypes.number,
|
|
128
|
+
pos_y: PropTypes.number,
|
|
129
|
+
actionHandler: PropTypes.func,
|
|
130
|
+
blurHandler: PropTypes.func
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const mapStateToProps = (state, ownProps) => ({
|
|
134
|
+
isOpen: state.texttoolbar.isOpen,
|
|
135
|
+
pos_x: state.texttoolbar.pos_x,
|
|
136
|
+
pos_y: state.texttoolbar.pos_y,
|
|
137
|
+
actionHandler: state.texttoolbar.actionHandler,
|
|
138
|
+
blurHandler: state.texttoolbar.blurHandler
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
export default connect(mapStateToProps)(injectIntl(CommonCanvasTextToolbar));
|
|
@@ -272,12 +272,14 @@ class CommonCanvasToolbar extends React.Component {
|
|
|
272
272
|
|
|
273
273
|
if (this.props.enableToolbarLayout === TOOLBAR_LAYOUT_TOP) {
|
|
274
274
|
canvasToolbar = (
|
|
275
|
-
<
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
275
|
+
<section aria-label={this.getLabel("toolbar.label")} role="toolbar">
|
|
276
|
+
<Toolbar
|
|
277
|
+
config={toolbarConfig}
|
|
278
|
+
instanceId={this.props.canvasController.getInstanceId()}
|
|
279
|
+
toolbarActionHandler={this.toolbarActionHandler}
|
|
280
|
+
additionalText={{ overflowMenuLabel: this.getLabel("toolbar.overflowMenu") }}
|
|
281
|
+
/>
|
|
282
|
+
</section>
|
|
281
283
|
);
|
|
282
284
|
}
|
|
283
285
|
|
|
@@ -27,7 +27,7 @@ import { ASSOCIATION_LINK, ASSOC_STRAIGHT, COMMENT_LINK, NODE_LINK,
|
|
|
27
27
|
export default class CanvasUtils {
|
|
28
28
|
|
|
29
29
|
static getObjectPositions(objects) {
|
|
30
|
-
const objectPositions =
|
|
30
|
+
const objectPositions = {};
|
|
31
31
|
objects.forEach((obj) => {
|
|
32
32
|
objectPositions[obj.id] = { x_pos: obj.x_pos, y_pos: obj.y_pos };
|
|
33
33
|
});
|
|
@@ -35,7 +35,7 @@ export default class CanvasUtils {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
static getLinkPositions(links) {
|
|
38
|
-
const positions =
|
|
38
|
+
const positions = {};
|
|
39
39
|
links.forEach((l) => {
|
|
40
40
|
if (l.srcPos) {
|
|
41
41
|
set(positions[l.id], "srcPos.x_pos", l.srcPos.x_pos);
|
|
@@ -53,7 +53,7 @@ export default class CanvasUtils {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
static moveSurroundingObjects(supernode, objects, nodeSizingDirection, newWidth, newHeight, updateNodePos) {
|
|
56
|
-
const newObjectPositions =
|
|
56
|
+
const newObjectPositions = {};
|
|
57
57
|
const incWidth = newWidth - supernode.width;
|
|
58
58
|
const incHeight = newHeight - supernode.height;
|
|
59
59
|
const superCenterX = supernode.x_pos + (supernode.width / 2);
|
|
@@ -88,7 +88,7 @@ export default class CanvasUtils {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
static moveSurroundingDetachedLinks(supernode, links, nodeSizingDirection, newWidth, newHeight, updateLinkPos) {
|
|
91
|
-
const newLinkPositions =
|
|
91
|
+
const newLinkPositions = {};
|
|
92
92
|
const incWidth = newWidth - supernode.width;
|
|
93
93
|
const incHeight = newHeight - supernode.height;
|
|
94
94
|
const superCenterX = supernode.x_pos + (supernode.width / 2);
|
|
@@ -1186,4 +1186,37 @@ export default class CanvasUtils {
|
|
|
1186
1186
|
}
|
|
1187
1187
|
return null;
|
|
1188
1188
|
}
|
|
1189
|
+
|
|
1190
|
+
// Returns the element passed in, or an ancestor of the element, if either
|
|
1191
|
+
// contains the classNames passed in. Otherwise it returns null if the
|
|
1192
|
+
// className cannot be found. For example, if this element is a child of the
|
|
1193
|
+
// node group object and "d3-node-group" is passed in, this function will
|
|
1194
|
+
// find the group element.
|
|
1195
|
+
static getParentElementWithClass(element, className) {
|
|
1196
|
+
let el = element;
|
|
1197
|
+
let foundElement = null;
|
|
1198
|
+
|
|
1199
|
+
while (el) {
|
|
1200
|
+
// No need to proceed if we find either of these. Stopping at svg-area
|
|
1201
|
+
// prevents the search transitioning from a sub-flow to a parent flow.
|
|
1202
|
+
if (this.isClassNameIncluded(el, "d3-new-connection-guide") ||
|
|
1203
|
+
this.isClassNameIncluded(el, "svg-area")) {
|
|
1204
|
+
el = null;
|
|
1205
|
+
|
|
1206
|
+
} else if (this.isClassNameIncluded(el, className)) {
|
|
1207
|
+
foundElement = el;
|
|
1208
|
+
el = null;
|
|
1209
|
+
} else {
|
|
1210
|
+
el = el.parentNode;
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
return foundElement;
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
// Returns true if the class name passed in is one of the classes assigned
|
|
1217
|
+
// to the element passed in.
|
|
1218
|
+
static isClassNameIncluded(el, className) {
|
|
1219
|
+
return el.classList && el.classList.contains(className);
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1189
1222
|
}
|