@elyra/canvas 12.14.0 → 12.20.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/_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-ccb05f9f.js +2 -0
- package/dist/canvas-controller-ccb05f9f.js.map +1 -0
- package/dist/canvas-controller-feabad26.js +2 -0
- package/dist/canvas-controller-feabad26.js.map +1 -0
- package/dist/common-canvas-0c35f64f.js +2 -0
- package/dist/common-canvas-0c35f64f.js.map +1 -0
- package/dist/common-canvas-b60fe77c.js +2 -0
- package/dist/common-canvas-b60fe77c.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-5d20f9bf.js +2 -0
- package/dist/common-properties-5d20f9bf.js.map +1 -0
- package/dist/common-properties-80b89ad2.js +2 -0
- package/dist/common-properties-80b89ad2.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-1139e06f.js → extends-42886b42.js} +2 -2
- package/dist/extends-42886b42.js.map +1 -0
- package/dist/{extends-8d17c85c.js → extends-634d1af7.js} +2 -2
- package/dist/extends-634d1af7.js.map +1 -0
- package/dist/flexible-table-72146c49.js +2 -0
- package/dist/flexible-table-72146c49.js.map +1 -0
- package/dist/flexible-table-fa8e4aa4.js +2 -0
- package/dist/flexible-table-fa8e4aa4.js.map +1 -0
- package/dist/getPrototypeOf-a1c3fe64.js.map +1 -1
- package/dist/getPrototypeOf-bf88242f.js.map +1 -1
- package/dist/{icon-918d2dd3.js → icon-079f1f09.js} +2 -2
- package/dist/{icon-918d2dd3.js.map → icon-079f1f09.js.map} +1 -1
- package/dist/{icon-4882a57f.js → icon-4ba4a133.js} +2 -2
- package/dist/{icon-4882a57f.js.map → icon-4ba4a133.js.map} +1 -1
- package/dist/index-ddc2e031.js +2 -0
- package/dist/index-ddc2e031.js.map +1 -0
- package/dist/{index-669f95a7.js → index-e0fcee5d.js} +2 -2
- package/dist/index-e0fcee5d.js.map +1 -0
- 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/context-menu.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/styles/common-canvas.min.css +1 -1
- package/dist/styles/common-canvas.min.css.map +1 -1
- package/dist/{toolbar-3f4b173f.js → toolbar-011cf35e.js} +2 -2
- package/dist/{toolbar-3f4b173f.js.map → toolbar-011cf35e.js.map} +1 -1
- package/dist/{toolbar-29ec7983.js → toolbar-91cb4665.js} +2 -2
- package/dist/{toolbar-29ec7983.js.map → toolbar-91cb4665.js.map} +1 -1
- package/locales/command-actions/locales/de.json +8 -8
- package/locales/command-actions/locales/es.json +8 -8
- package/locales/command-actions/locales/fr.json +9 -9
- package/locales/command-actions/locales/index.js +3 -1
- package/locales/command-actions/locales/it.json +13 -13
- package/locales/command-actions/locales/ja.json +8 -8
- package/locales/command-actions/locales/ko.json +8 -8
- package/locales/command-actions/locales/pt-br.json +10 -10
- package/locales/command-actions/locales/sv.json +51 -0
- package/locales/command-actions/locales/zh-CN.json +8 -8
- package/locales/command-actions/locales/zh-TW.json +10 -10
- package/locales/common-canvas/locales/de.json +18 -4
- package/locales/common-canvas/locales/es.json +16 -2
- package/locales/common-canvas/locales/fr.json +16 -2
- package/locales/common-canvas/locales/index.js +3 -1
- package/locales/common-canvas/locales/it.json +17 -3
- package/locales/common-canvas/locales/ja.json +19 -5
- package/locales/common-canvas/locales/ko.json +25 -11
- package/locales/common-canvas/locales/pt-br.json +18 -4
- package/locales/common-canvas/locales/sv.json +51 -0
- package/locales/common-canvas/locales/zh-CN.json +15 -1
- package/locales/common-canvas/locales/zh-TW.json +15 -1
- package/locales/common-properties/locales/de.json +22 -22
- package/locales/common-properties/locales/en.json +3 -1
- package/locales/common-properties/locales/eo.json +2 -0
- package/locales/common-properties/locales/es.json +12 -12
- package/locales/common-properties/locales/fr.json +22 -22
- package/locales/common-properties/locales/index.js +3 -1
- package/locales/common-properties/locales/it.json +13 -13
- package/locales/common-properties/locales/ja.json +28 -28
- package/locales/common-properties/locales/ko.json +10 -10
- package/locales/common-properties/locales/pt-br.json +16 -16
- package/locales/common-properties/locales/sv.json +93 -0
- package/locales/common-properties/locales/zh-CN.json +28 -28
- package/locales/common-properties/locales/zh-TW.json +26 -26
- package/locales/palette/locales/index.js +3 -1
- package/locales/palette/locales/it.json +1 -1
- package/locales/palette/locales/ja.json +1 -1
- package/locales/palette/locales/pt-br.json +1 -1
- package/locales/palette/locales/sv.json +10 -0
- package/locales/palette/locales/zh-CN.json +4 -4
- package/locales/palette/locales/zh-TW.json +2 -2
- package/locales/toolbar/locales/es.json +1 -1
- package/locales/toolbar/locales/index.js +3 -1
- package/locales/toolbar/locales/it.json +2 -2
- package/locales/toolbar/locales/pt-br.json +1 -1
- package/locales/toolbar/locales/sv.json +8 -0
- package/package.json +2 -2
- package/src/command-actions/createCommentAction.js +5 -9
- package/src/command-actions/createSuperNodeAction.js +358 -268
- package/src/common-canvas/canvas-controller.js +20 -5
- package/src/common-canvas/common-canvas-utils.js +38 -5
- package/src/common-canvas/svg-canvas-d3.js +2 -2
- package/src/common-canvas/svg-canvas-d3.scss +17 -11
- package/src/common-canvas/svg-canvas-pipeline.js +10 -3
- package/src/common-canvas/svg-canvas-renderer.js +93 -493
- package/src/common-canvas/svg-canvas-utils-decs.js +0 -5
- package/src/common-canvas/svg-canvas-utils-links.js +5 -1
- package/src/common-canvas/svg-canvas-utils-nodes.js +23 -5
- package/src/common-canvas/svg-canvas-utils-textarea.js +472 -0
- package/src/common-properties/actions.js +5 -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/components/virtualized-table/virtualized-table.jsx +5 -5
- package/src/common-properties/components/wide-flyout/wide-flyout.jsx +5 -2
- package/src/common-properties/constants/constants.js +8 -1
- package/src/common-properties/constants/form-constants.js +1 -0
- package/src/common-properties/controls/abstract-table.jsx +2 -2
- package/src/common-properties/controls/control-factory.js +5 -0
- package/src/common-properties/controls/controls.scss +1 -0
- package/src/common-properties/controls/dropdown/dropdown.jsx +7 -5
- package/src/common-properties/controls/expression/expression.jsx +2 -1
- package/src/common-properties/controls/expression/expression.scss +60 -33
- package/src/common-properties/controls/radioset/radioset.jsx +16 -14
- package/src/common-properties/controls/radioset/radioset.scss +13 -11
- package/src/common-properties/controls/someofselect/someofselect.jsx +4 -4
- package/src/common-properties/controls/toggle/index.jsx +18 -0
- package/src/common-properties/controls/toggle/toggle.jsx +89 -0
- package/src/common-properties/controls/toggle/toggle.scss +23 -0
- package/src/common-properties/panels/summary/summary.jsx +5 -2
- package/src/common-properties/properties-controller.js +31 -13
- package/src/common-properties/properties-main/properties-main.jsx +1 -0
- package/src/common-properties/properties-store.js +19 -2
- package/src/common-properties/reducers/wide-flyout-primary-button-disable.jsx +31 -0
- package/src/common-properties/ui-conditions/condition-ops/colDoesExists.js +9 -3
- package/src/common-properties/ui-conditions/conditions-utils.js +10 -16
- package/src/object-model/api-pipeline.js +30 -10
- package/src/object-model/config-utils.js +1 -0
- package/src/object-model/layout-dimensions.js +9 -5
- package/src/palette/palette-content-list-item.jsx +3 -1
- package/src/palette/palette-flyout-content-category.jsx +73 -42
- package/src/palette/palette.scss +1 -1
- package/stats.html +1 -1
- package/dist/canvas-controller-8e2bb291.js +0 -2
- package/dist/canvas-controller-8e2bb291.js.map +0 -1
- package/dist/canvas-controller-bd0d8d59.js +0 -2
- package/dist/canvas-controller-bd0d8d59.js.map +0 -1
- package/dist/common-canvas-69fe4a67.js +0 -2
- package/dist/common-canvas-69fe4a67.js.map +0 -1
- package/dist/common-canvas-f5e4af65.js +0 -2
- package/dist/common-canvas-f5e4af65.js.map +0 -1
- package/dist/common-properties-40648163.js +0 -2
- package/dist/common-properties-40648163.js.map +0 -1
- package/dist/common-properties-6d839df1.js +0 -2
- package/dist/common-properties-6d839df1.js.map +0 -1
- package/dist/extends-1139e06f.js.map +0 -1
- package/dist/extends-8d17c85c.js.map +0 -1
- package/dist/flexible-table-d3598aa8.js +0 -2
- package/dist/flexible-table-d3598aa8.js.map +0 -1
- package/dist/flexible-table-fe7fbc13.js +0 -2
- package/dist/flexible-table-fe7fbc13.js.map +0 -1
- package/dist/index-669f95a7.js.map +0 -1
- package/dist/index-6d3404e1.js +0 -2
- package/dist/index-6d3404e1.js.map +0 -1
|
@@ -25,7 +25,7 @@ import { setActionStates, updateActionState } from "./actions";
|
|
|
25
25
|
import { clearSelectedRows, updateSelectedRows, disableRowMoveButtons } from "./actions";
|
|
26
26
|
import { clearStaticRows, updateStaticRows } from "./actions";
|
|
27
27
|
import { setErrorMessages, updateErrorMessage, clearErrorMessage } from "./actions";
|
|
28
|
-
import { setDatasetMetadata, setSaveButtonDisable, setAddRemoveRows, setTableButtonEnabled, setHideEditButton } from "./actions";
|
|
28
|
+
import { setDatasetMetadata, setSaveButtonDisable, setWideFlyoutPrimaryButtonDisabled, setAddRemoveRows, setTableButtonEnabled, setHideEditButton } from "./actions";
|
|
29
29
|
import { setTitle, setActiveTab } from "./actions";
|
|
30
30
|
import propertiesReducer from "./reducers/properties";
|
|
31
31
|
import controlStatesReducer from "./reducers/control-states";
|
|
@@ -38,6 +38,7 @@ import rowFreezeReducer from "./reducers/row-static";
|
|
|
38
38
|
import componentMetadataReducer from "./reducers/component-metadata";
|
|
39
39
|
import disableRowMoveButtonsReducer from "./reducers/disable-row-move-buttons";
|
|
40
40
|
import saveButtonDisableReducer from "./reducers/save-button-disable";
|
|
41
|
+
import wideFlyoutPrimaryButtonDisableReducer from "./reducers/wide-flyout-primary-button-disable";
|
|
41
42
|
import propertiesSettingsReducer from "./reducers/properties-settings";
|
|
42
43
|
import * as PropertyUtils from "./util/property-utils.js";
|
|
43
44
|
import { CONDITION_MESSAGE_TYPE, MESSAGE_KEYS } from "./constants/constants.js";
|
|
@@ -48,7 +49,7 @@ export default class PropertiesStore {
|
|
|
48
49
|
constructor() {
|
|
49
50
|
this.combinedReducer = combineReducers({ propertiesReducer, controlStatesReducer, panelStatesReducer,
|
|
50
51
|
errorMessagesReducer, datasetMetadataReducer, rowSelectionsReducer, componentMetadataReducer,
|
|
51
|
-
disableRowMoveButtonsReducer, actionStatesReducer, saveButtonDisableReducer, propertiesSettingsReducer, rowFreezeReducer });
|
|
52
|
+
disableRowMoveButtonsReducer, actionStatesReducer, saveButtonDisableReducer, wideFlyoutPrimaryButtonDisableReducer, propertiesSettingsReducer, rowFreezeReducer });
|
|
52
53
|
let enableDevTools = false;
|
|
53
54
|
if (typeof window !== "undefined") {
|
|
54
55
|
enableDevTools = window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__();
|
|
@@ -219,6 +220,22 @@ export default class PropertiesStore {
|
|
|
219
220
|
return state.saveButtonDisableReducer.disable;
|
|
220
221
|
}
|
|
221
222
|
|
|
223
|
+
setWideFlyoutPrimaryButtonDisabled(panelId, disableState) {
|
|
224
|
+
this.store.dispatch(setWideFlyoutPrimaryButtonDisabled({ panelId: panelId, disableState: disableState }));
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
getWideFlyoutPrimaryButtonDisabled(panelId) {
|
|
228
|
+
if (typeof panelId === "undefined") {
|
|
229
|
+
return null;
|
|
230
|
+
}
|
|
231
|
+
const state = this.store.getState();
|
|
232
|
+
const disablePrimaryButtonForPanel = state.wideFlyoutPrimaryButtonDisableReducer[panelId.name];
|
|
233
|
+
if (typeof disablePrimaryButtonForPanel !== "undefined") {
|
|
234
|
+
return disablePrimaryButtonForPanel;
|
|
235
|
+
}
|
|
236
|
+
return null;
|
|
237
|
+
}
|
|
238
|
+
|
|
222
239
|
/*
|
|
223
240
|
* Retrieves filtered enumeration values for the given propertyId.
|
|
224
241
|
*/
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2017-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 { SET_WIDE_FLYOUT_PRIMARY_BUTTON_DISABLED } from "../actions";
|
|
18
|
+
|
|
19
|
+
function setWideFlyoutPrimaryButtonDisabled(state = [], action) {
|
|
20
|
+
switch (action.type) {
|
|
21
|
+
case SET_WIDE_FLYOUT_PRIMARY_BUTTON_DISABLED: {
|
|
22
|
+
const newState = state;
|
|
23
|
+
newState[action.info.panelId.name] = action.info.disableState;
|
|
24
|
+
return Object.assign({}, state, newState);
|
|
25
|
+
}
|
|
26
|
+
default:
|
|
27
|
+
return state;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default setWideFlyoutPrimaryButtonDisabled;
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import logger from "./../../../../utils/logger";
|
|
18
18
|
import { fieldValueMatchesProto } from "./../../util/property-utils.js";
|
|
19
|
+
import { isEmpty } from "lodash";
|
|
19
20
|
|
|
20
21
|
function op() {
|
|
21
22
|
return "colDoesExists";
|
|
@@ -51,9 +52,14 @@ function evaluate(paramInfo, param2Info, value, controller) {
|
|
|
51
52
|
|
|
52
53
|
// Return the field if found in dataset, else undefined
|
|
53
54
|
function valueInDataset(dataset, field) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
// Don't validate empty, null or undefined value
|
|
56
|
+
return (
|
|
57
|
+
(typeof field === "undefined" || field === null || isEmpty(field))
|
|
58
|
+
? true
|
|
59
|
+
: dataset.find(function(dataModelField) {
|
|
60
|
+
return fieldValueMatchesProto(field, dataModelField);
|
|
61
|
+
})
|
|
62
|
+
);
|
|
57
63
|
}
|
|
58
64
|
|
|
59
65
|
|
|
@@ -80,6 +80,7 @@ function validatePropertiesConditions(controller) {
|
|
|
80
80
|
*
|
|
81
81
|
* @param {object} properties controller. required
|
|
82
82
|
* @param {object} list of control objects or properties. required
|
|
83
|
+
* @param {boolean} showErrors. optional. Set to false to run conditions without displaying errors in the UI
|
|
83
84
|
*/
|
|
84
85
|
function validatePropertiesListValues(controller, controls, showErrors) {
|
|
85
86
|
if (Object.keys(controls).length > 0) {
|
|
@@ -697,7 +698,8 @@ function _validateInput(propertyId, controller, control, showErrors) {
|
|
|
697
698
|
|
|
698
699
|
// Determine if this condition is for required parameters
|
|
699
700
|
errorMessage.required = requiredDefinitionsIds.indexOf(validation.definition.validation.id) > -1;
|
|
700
|
-
|
|
701
|
+
// Only show warning messages for "colDoesExists" condition
|
|
702
|
+
if (!showErrors && !validation.alwaysShow) {
|
|
701
703
|
errorMessage.displayError = false;
|
|
702
704
|
}
|
|
703
705
|
|
|
@@ -1127,6 +1129,7 @@ function _injectInvalidFieldDefinition(control, valDefinitions, keyName, control
|
|
|
1127
1129
|
const label = (control.label && control.label.text) ? control.label.text : keyName;
|
|
1128
1130
|
const errorMsg = formatMessage(intl,
|
|
1129
1131
|
MESSAGE_KEYS.INVALID_FIELD_ERROR, { label: label });
|
|
1132
|
+
// Note: Please don't update "validField_" in validation id. It is used as identifier in another condition.
|
|
1130
1133
|
const injectedDefinition = {
|
|
1131
1134
|
params: keyName,
|
|
1132
1135
|
definition: {
|
|
@@ -1140,23 +1143,14 @@ function _injectInvalidFieldDefinition(control, valDefinitions, keyName, control
|
|
|
1140
1143
|
focus_parameter_ref: keyName
|
|
1141
1144
|
},
|
|
1142
1145
|
evaluate: {
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
op: "colDoesExists"
|
|
1148
|
-
}
|
|
1149
|
-
},
|
|
1150
|
-
{
|
|
1151
|
-
condition: {
|
|
1152
|
-
parameter_ref: keyName,
|
|
1153
|
-
op: "isEmpty"
|
|
1154
|
-
}
|
|
1155
|
-
}
|
|
1156
|
-
]
|
|
1146
|
+
condition: {
|
|
1147
|
+
parameter_ref: keyName,
|
|
1148
|
+
op: "colDoesExists"
|
|
1149
|
+
}
|
|
1157
1150
|
}
|
|
1158
1151
|
}
|
|
1159
|
-
}
|
|
1152
|
+
},
|
|
1153
|
+
alwaysShow: true
|
|
1160
1154
|
};
|
|
1161
1155
|
// add the new definition to the set of validation definitions for this control.
|
|
1162
1156
|
if (valDefinitions.controls[keyName]) {
|
|
@@ -30,6 +30,7 @@ import { cloneDeep, get, has, set } from "lodash";
|
|
|
30
30
|
import { ASSOCIATION_LINK, NODE_LINK, COMMENT_LINK, VERTICAL,
|
|
31
31
|
DAGRE_HORIZONTAL, DAGRE_VERTICAL,
|
|
32
32
|
CREATE_NODE, CREATE_COMMENT, CREATE_NODE_LINK, CREATE_COMMENT_LINK,
|
|
33
|
+
SNAP_TO_GRID_AFTER, SNAP_TO_GRID_DURING,
|
|
33
34
|
BINDING, SUPER_NODE }
|
|
34
35
|
from "../common-canvas/constants/canvas-constants.js";
|
|
35
36
|
|
|
@@ -1017,12 +1018,18 @@ export default class APIPipeline {
|
|
|
1017
1018
|
// Returns a position for a new comment added by clicking the 'add comment'
|
|
1018
1019
|
// button on the toolbar. It searches for a position that is not already
|
|
1019
1020
|
// occupied by an existing comment.
|
|
1020
|
-
|
|
1021
|
-
const
|
|
1021
|
+
getAdjustedCommentPosition(comPos) {
|
|
1022
|
+
const stgType = this.objectModel.getCanvasConfig().enableSnapToGridType;
|
|
1023
|
+
const pos = { x_pos: comPos.x, y_pos: comPos.y };
|
|
1022
1024
|
|
|
1023
1025
|
while (this.exactlyOverlaps(null, [pos], null)) {
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
+
if (stgType === SNAP_TO_GRID_DURING || stgType === SNAP_TO_GRID_AFTER) {
|
|
1027
|
+
pos.x_pos += this.objectModel.getCanvasLayout().snapToGridXPx;
|
|
1028
|
+
pos.y_pos += this.objectModel.getCanvasLayout().snapToGridYPx;
|
|
1029
|
+
} else {
|
|
1030
|
+
pos.x_pos += 10;
|
|
1031
|
+
pos.y_pos += 10;
|
|
1032
|
+
}
|
|
1026
1033
|
}
|
|
1027
1034
|
|
|
1028
1035
|
return pos;
|
|
@@ -1144,19 +1151,32 @@ export default class APIPipeline {
|
|
|
1144
1151
|
return linkNodeList;
|
|
1145
1152
|
}
|
|
1146
1153
|
|
|
1154
|
+
// Creates a node link from the srcInfo and trgInfo and other link 'data'
|
|
1155
|
+
// passed in.
|
|
1147
1156
|
createNodeLink(srcInfo, trgInfo, data) {
|
|
1148
1157
|
const srcNode = this.getNode(srcInfo.id);
|
|
1149
1158
|
const trgNode = this.getNode(trgInfo.id);
|
|
1150
1159
|
const links = this.getLinks();
|
|
1151
1160
|
|
|
1152
|
-
if (
|
|
1161
|
+
if ((srcInfo.srcPos && trgInfo.trgPos) || // Fully detached
|
|
1162
|
+
(srcInfo.srcPos && CanvasUtils.isTrgConnectionAllowedWithDetachedLinks(trgInfo.portId, trgNode, links)) || // Semi-detached
|
|
1163
|
+
(trgInfo.trgPos && CanvasUtils.isSrcConnectionAllowedWithDetachedLinks(srcInfo.portId, srcNode, links)) || // Semi-detached
|
|
1164
|
+
(CanvasUtils.isConnectionAllowed(srcInfo.portId, trgInfo.portId, srcNode, trgNode, links, data.type))) { // Fully attached
|
|
1153
1165
|
const link = {};
|
|
1154
|
-
link.id = data.id ? data.id : this.objectModel.getUniqueId(CREATE_NODE_LINK, { "sourceNode":
|
|
1166
|
+
link.id = data.id ? data.id : this.objectModel.getUniqueId(CREATE_NODE_LINK, { "sourceNode": srcNode, "targetNode": trgNode });
|
|
1155
1167
|
link.type = data.type;
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1168
|
+
if (srcInfo.srcPos) {
|
|
1169
|
+
link.srcPos = srcInfo.srcPos;
|
|
1170
|
+
} else {
|
|
1171
|
+
link.srcNodeId = srcInfo.id;
|
|
1172
|
+
link.srcNodePortId = srcInfo.portId;
|
|
1173
|
+
}
|
|
1174
|
+
if (trgInfo.trgPos) {
|
|
1175
|
+
link.trgPos = trgInfo.trgPos;
|
|
1176
|
+
} else {
|
|
1177
|
+
link.trgNodeId = trgInfo.id;
|
|
1178
|
+
link.trgNodePortId = trgInfo.portId;
|
|
1179
|
+
}
|
|
1160
1180
|
if (data.class_name) {
|
|
1161
1181
|
link.class_name = data.class_name;
|
|
1162
1182
|
}
|
|
@@ -181,21 +181,22 @@ const portsHorizontalDefaultLayout = {
|
|
|
181
181
|
outputPortWidth: 12,
|
|
182
182
|
outputPortHeight: 12,
|
|
183
183
|
|
|
184
|
-
// Position of right single
|
|
184
|
+
// Position of right single output port. Multiple input ports will be
|
|
185
185
|
// automatically positioned with the Y coordinate being overriden. These
|
|
186
186
|
// values are an offset from the top right corner of the node outline.
|
|
187
187
|
// Used when linkDirection is "LeftRight".
|
|
188
|
+
outputPortRightPosition: "topRight",
|
|
188
189
|
outputPortRightPosX: 0,
|
|
189
190
|
outputPortRightPosY: 20,
|
|
190
191
|
|
|
191
|
-
// Position of top single
|
|
192
|
+
// Position of top single output port. Multiple input ports will be
|
|
192
193
|
// automatically positioned with the X coordinate being overriden. These
|
|
193
194
|
// values are an offset from the top left corner of the node outline.
|
|
194
195
|
// Used when linkDirection is "BottomTop".
|
|
195
196
|
outputPortTopPosX: 80,
|
|
196
197
|
outputPortTopPosY: 0,
|
|
197
198
|
|
|
198
|
-
// Position of bottom single
|
|
199
|
+
// Position of bottom single output port. Multiple input ports will be
|
|
199
200
|
// automatically positioned with the X coordinate being overriden. These
|
|
200
201
|
// values are an offset from the bottom left corner of the node outline.
|
|
201
202
|
// Used when linkDirection is "TopBottom".
|
|
@@ -353,7 +354,8 @@ const portsHorizontalDefaultLayout = {
|
|
|
353
354
|
commentSizingArea: 10,
|
|
354
355
|
|
|
355
356
|
// Add comment toolbar action, default offset from viewport
|
|
356
|
-
|
|
357
|
+
addCommentOffsetX: 30,
|
|
358
|
+
addCommentOffsetY: 50,
|
|
357
359
|
|
|
358
360
|
// Comment port (circle) radius
|
|
359
361
|
commentPortRadius: 5,
|
|
@@ -574,6 +576,7 @@ const portsVerticalDefaultLayout = {
|
|
|
574
576
|
// automatically positioned with the Y coordinate being overriden. These
|
|
575
577
|
// values are an offset from the top right corner of the node outline.
|
|
576
578
|
// Used when linkDirection is "LeftRight".
|
|
579
|
+
outputPortRightPosition: "topRight",
|
|
577
580
|
outputPortRightPosX: 0,
|
|
578
581
|
outputPortRightPosY: 29,
|
|
579
582
|
|
|
@@ -742,7 +745,8 @@ const portsVerticalDefaultLayout = {
|
|
|
742
745
|
commentSizingArea: 10,
|
|
743
746
|
|
|
744
747
|
// Add comment toolbar action, default offset from viewport
|
|
745
|
-
|
|
748
|
+
addCommentOffsetX: 30,
|
|
749
|
+
addCommentOffsetY: 50,
|
|
746
750
|
|
|
747
751
|
// Comment port (circle) radius
|
|
748
752
|
commentPortRadius: 5,
|
|
@@ -250,7 +250,9 @@ class PaletteContentListItem extends React.Component {
|
|
|
250
250
|
let icon = null;
|
|
251
251
|
|
|
252
252
|
if (has(this.props.nodeTypeInfo.nodeType, "app_data.ui_data.image")) {
|
|
253
|
-
let image = this.props.nodeTypeInfo.nodeType.app_data.ui_data.
|
|
253
|
+
let image = this.props.nodeTypeInfo.nodeType.app_data.ui_data.palette_image
|
|
254
|
+
? this.props.nodeTypeInfo.nodeType.app_data.ui_data.palette_image
|
|
255
|
+
: this.props.nodeTypeInfo.nodeType.app_data.ui_data.image;
|
|
254
256
|
|
|
255
257
|
if (image === USE_DEFAULT_ICON) {
|
|
256
258
|
image = SUPERNODE_ICON;
|
|
@@ -28,6 +28,10 @@ class PaletteFlyoutContentCategory extends React.Component {
|
|
|
28
28
|
constructor(props) {
|
|
29
29
|
super(props);
|
|
30
30
|
|
|
31
|
+
this.state = {
|
|
32
|
+
isOpen: false
|
|
33
|
+
};
|
|
34
|
+
|
|
31
35
|
this.onMouseOver = this.onMouseOver.bind(this);
|
|
32
36
|
this.onMouseLeave = this.onMouseLeave.bind(this);
|
|
33
37
|
this.categorySelected = this.categorySelected.bind(this);
|
|
@@ -87,24 +91,38 @@ class PaletteFlyoutContentCategory extends React.Component {
|
|
|
87
91
|
return content;
|
|
88
92
|
}
|
|
89
93
|
|
|
94
|
+
// Returns the category object for a regular category.
|
|
90
95
|
getRenderCategory() {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
} else {
|
|
100
|
-
itemImage = (
|
|
101
|
-
<div>
|
|
102
|
-
<img src={this.props.category.image} className="palette-flyout-category-item-icon" draggable="false" />
|
|
103
|
-
</div>
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
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
|
+
}
|
|
107
104
|
|
|
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
|
+
}
|
|
123
|
+
|
|
124
|
+
// Returns the text for the category
|
|
125
|
+
getItemText() {
|
|
108
126
|
let itemText = null;
|
|
109
127
|
const label = this.getDisplayLabel();
|
|
110
128
|
if (this.props.isPaletteOpen === true) {
|
|
@@ -125,22 +143,39 @@ class PaletteFlyoutContentCategory extends React.Component {
|
|
|
125
143
|
</span>
|
|
126
144
|
);
|
|
127
145
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
146
|
+
return itemText;
|
|
147
|
+
}
|
|
148
|
+
|
|
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 (
|
|
144
179
|
<PaletteContentList
|
|
145
180
|
key={this.props.category.id + "-nodes"}
|
|
146
181
|
category={this.props.category}
|
|
@@ -149,8 +184,9 @@ class PaletteFlyoutContentCategory extends React.Component {
|
|
|
149
184
|
isPaletteOpen={this.props.isPaletteOpen}
|
|
150
185
|
isEditingEnabled={this.props.isEditingEnabled}
|
|
151
186
|
/>
|
|
152
|
-
|
|
153
|
-
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
return null;
|
|
154
190
|
}
|
|
155
191
|
|
|
156
192
|
categorySelected() {
|
|
@@ -158,14 +194,9 @@ class PaletteFlyoutContentCategory extends React.Component {
|
|
|
158
194
|
}
|
|
159
195
|
|
|
160
196
|
render() {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
} else {
|
|
165
|
-
content = this.getRenderCategory();
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
return content;
|
|
197
|
+
return this.props.category.loading_text
|
|
198
|
+
? this.getInlineLoadingRenderCategory()
|
|
199
|
+
: this.getRenderCategory();
|
|
169
200
|
}
|
|
170
201
|
}
|
|
171
202
|
|
package/src/palette/palette.scss
CHANGED