@elyra/canvas 12.40.1 → 12.42.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/{_baseIteratee-05ccf6a8.js → _baseIteratee-148093b7.js} +3 -3
- package/dist/{_baseIteratee-05ccf6a8.js.map → _baseIteratee-148093b7.js.map} +1 -1
- package/dist/{canvas-constants-079172c0.js → canvas-constants-13b58448.js} +2 -2
- package/dist/{canvas-constants-079172c0.js.map → canvas-constants-13b58448.js.map} +1 -1
- package/dist/canvas-controller-a53943e4.js +2 -0
- package/dist/canvas-controller-a53943e4.js.map +1 -0
- package/dist/canvas-controller-cb1d7420.js +2 -0
- package/dist/canvas-controller-cb1d7420.js.map +1 -0
- package/dist/common-canvas-42027a3f.js +2 -0
- package/dist/common-canvas-42027a3f.js.map +1 -0
- package/dist/common-canvas-f758ff42.js +2 -0
- package/dist/common-canvas-f758ff42.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-2e1b7ec7.js +2 -0
- package/dist/common-properties-2e1b7ec7.js.map +1 -0
- package/dist/common-properties-5e8870e3.js +2 -0
- package/dist/common-properties-5e8870e3.js.map +1 -0
- package/dist/context-menu-wrapper-49f9a1af.js +2 -0
- package/dist/context-menu-wrapper-49f9a1af.js.map +1 -0
- package/dist/context-menu-wrapper-5d6a399f.js +2 -0
- package/dist/context-menu-wrapper-5d6a399f.js.map +1 -0
- package/dist/{datarecord-metadata-v3-schema-59505bc5.js → datarecord-metadata-v3-schema-98ec66e9.js} +2 -2
- package/dist/{datarecord-metadata-v3-schema-59505bc5.js.map → datarecord-metadata-v3-schema-98ec66e9.js.map} +1 -1
- package/dist/{flexible-table-5ee2a42b.js → flexible-table-35e9922a.js} +2 -2
- package/dist/{flexible-table-5ee2a42b.js.map → flexible-table-35e9922a.js.map} +1 -1
- package/dist/{flexible-table-562ae288.js → flexible-table-7c7de0f9.js} +1 -1
- package/dist/{flexible-table-562ae288.js.map → flexible-table-7c7de0f9.js.map} +1 -1
- package/dist/{icon-0390f1fe.js → icon-9edff40c.js} +2 -2
- package/dist/{icon-0390f1fe.js.map → icon-9edff40c.js.map} +1 -1
- package/dist/{index-fe8d4201.js → index-94fec521.js} +2 -2
- package/dist/index-94fec521.js.map +1 -0
- package/dist/index-e2f8a935.js +2 -0
- package/dist/index-e2f8a935.js.map +1 -0
- package/dist/{isArrayLikeObject-36898fcb.js → isArrayLikeObject-7a30aa4b.js} +2 -2
- package/dist/{isArrayLikeObject-36898fcb.js.map → isArrayLikeObject-7a30aa4b.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/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-6acda0a2.js +2 -0
- package/dist/toolbar-6acda0a2.js.map +1 -0
- package/dist/toolbar-d5647da2.js +2 -0
- package/dist/toolbar-d5647da2.js.map +1 -0
- package/locales/common-properties/locales/de.json +1 -0
- package/locales/common-properties/locales/es.json +1 -0
- package/locales/common-properties/locales/fr.json +1 -0
- package/locales/common-properties/locales/it.json +1 -0
- package/locales/common-properties/locales/ja.json +1 -0
- package/locales/common-properties/locales/ko.json +1 -0
- package/locales/common-properties/locales/pt-br.json +1 -0
- package/locales/common-properties/locales/sv.json +1 -0
- package/locales/common-properties/locales/zh-CN.json +1 -0
- package/locales/common-properties/locales/zh-TW.json +1 -0
- package/package.json +12 -4
- package/src/color-picker/color-picker.jsx +92 -17
- package/src/command-actions/arrangeLayoutAction.js +7 -6
- package/src/command-actions/attachNodeToLinksAction.js +4 -4
- package/src/command-actions/collapseSuperNodeInPlaceAction.js +5 -5
- package/src/command-actions/colorSelectedObjectsAction.js +4 -4
- package/src/command-actions/commonPropertiesAction.js +1 -1
- package/src/command-actions/convertSuperNodeExternalToLocalAction.js +4 -4
- package/src/command-actions/convertSuperNodeLocalToExternalAction.js +4 -4
- package/src/command-actions/createAutoNodeAction.js +14 -5
- package/src/command-actions/createCommentAction.js +4 -10
- package/src/command-actions/createCommentLinkAction.js +4 -4
- package/src/command-actions/createNodeAction.js +13 -4
- package/src/command-actions/createNodeAttachLinksAction.js +4 -4
- package/src/command-actions/createNodeLinkAction.js +13 -4
- package/src/command-actions/createNodeLinkDetachedAction.js +4 -4
- package/src/command-actions/createNodeOnLinkAction.js +4 -4
- package/src/command-actions/createSuperNodeAction.js +7 -7
- package/src/command-actions/deconstructSuperNodeAction.js +5 -5
- package/src/command-actions/deleteLinkAction.js +4 -4
- package/src/command-actions/deleteObjectsAction.js +15 -6
- package/src/command-actions/disconnectObjectsAction.js +13 -4
- package/src/command-actions/displayPreviousPipelineAction.js +4 -4
- package/src/command-actions/displaySubPipelineAction.js +4 -4
- package/src/command-actions/editCommentAction.js +4 -4
- package/src/command-actions/editDecorationLabelAction.js +4 -4
- package/src/command-actions/expandSuperNodeInPlaceAction.js +5 -5
- package/src/command-actions/insertNodeIntoLinkAction.js +4 -4
- package/src/command-actions/moveObjectsAction.js +4 -4
- package/src/command-actions/pasteAction.js +16 -7
- package/src/command-actions/saveToPaletteAction.js +4 -4
- package/src/command-actions/setLinksStyleAction.js +4 -4
- package/src/command-actions/setNodeLabelAction.js +4 -4
- package/src/command-actions/setObjectsStyleAction.js +4 -4
- package/src/command-actions/sizeAndPositionObjectsAction.js +4 -4
- package/src/command-actions/updateLinkAction.js +4 -4
- package/src/common-canvas/canvas-controller-menu-utils.js +1 -1
- package/src/common-canvas/canvas-controller.js +78 -62
- package/src/common-canvas/cc-central-items.jsx +1 -1
- package/src/common-canvas/cc-context-toolbar.jsx +9 -13
- package/src/common-canvas/cc-toolbar.jsx +2 -0
- package/src/common-canvas/svg-canvas-d3.scss +1 -1
- package/src/common-canvas/svg-canvas-renderer.js +6 -2
- package/src/common-canvas/svg-canvas-utils-drag-det-link.js +8 -1
- package/src/common-canvas/svg-canvas-utils-drag-new-link.js +1 -1
- package/src/common-properties/components/table-buttons/table-buttons.scss +0 -1
- package/src/common-properties/components/wide-flyout/wide-flyout.scss +1 -2
- package/src/common-properties/constants/form-constants.js +1 -0
- package/src/common-properties/controls/control-factory.js +6 -1
- package/src/common-properties/controls/controls.scss +1 -0
- package/src/common-properties/controls/expression/expression-builder/expression-builder.jsx +32 -26
- package/src/common-properties/controls/expression/expression.jsx +146 -117
- package/src/common-properties/controls/expression/expression.scss +43 -45
- package/src/common-properties/controls/expression/languages/CLEM-hint.js +86 -159
- package/src/common-properties/controls/expression/languages/python-hint.js +53 -104
- package/src/common-properties/controls/expression/languages/r-hint.js +55 -130
- package/src/{toolbar/toolbar-utils.js → common-properties/controls/slider/index.js} +2 -17
- package/src/common-properties/controls/slider/slider.jsx +96 -0
- package/src/common-properties/controls/slider/slider.scss +44 -0
- package/src/common-properties/form/ControlInfo.js +6 -0
- package/src/common-properties/form/EditorForm.js +2 -0
- package/src/common-properties/form/ParameterInfo.js +8 -0
- package/src/common-properties/properties-controller.js +16 -5
- package/src/context-menu/common-context-menu.jsx +4 -1
- package/src/index.js +12 -2
- package/src/object-model/redux/canvas-store.js +4 -3
- package/src/toolbar/toolbar-action-item.jsx +90 -314
- package/src/toolbar/toolbar-button-item.jsx +354 -0
- package/src/toolbar/toolbar-divider-item.jsx +3 -4
- package/src/toolbar/toolbar-overflow-item.jsx +82 -36
- package/src/toolbar/toolbar-sub-menu-item.jsx +235 -0
- package/src/toolbar/toolbar-sub-menu.jsx +254 -0
- package/src/toolbar/toolbar-sub-panel.jsx +81 -0
- package/src/toolbar/toolbar-sub-utils.js +77 -0
- package/src/toolbar/toolbar.jsx +330 -146
- package/src/toolbar/toolbar.scss +22 -15
- package/src/tooltip/tooltip.jsx +21 -2
- package/stats.html +1 -1
- package/dist/canvas-controller-1e71b405.js +0 -2
- package/dist/canvas-controller-1e71b405.js.map +0 -1
- package/dist/canvas-controller-4bed5320.js +0 -2
- package/dist/canvas-controller-4bed5320.js.map +0 -1
- package/dist/common-canvas-318df796.js +0 -2
- package/dist/common-canvas-318df796.js.map +0 -1
- package/dist/common-canvas-d41ba910.js +0 -2
- package/dist/common-canvas-d41ba910.js.map +0 -1
- package/dist/common-properties-6e904e3b.js +0 -2
- package/dist/common-properties-6e904e3b.js.map +0 -1
- package/dist/common-properties-c91bfb31.js +0 -2
- package/dist/common-properties-c91bfb31.js.map +0 -1
- package/dist/context-menu-wrapper-3a7fdec8.js +0 -2
- package/dist/context-menu-wrapper-3a7fdec8.js.map +0 -1
- package/dist/context-menu-wrapper-fc85d853.js +0 -2
- package/dist/context-menu-wrapper-fc85d853.js.map +0 -1
- package/dist/index-8e8b8729.js +0 -2
- package/dist/index-8e8b8729.js.map +0 -1
- package/dist/index-fe8d4201.js.map +0 -1
- package/dist/toolbar-b01e6749.js +0 -2
- package/dist/toolbar-b01e6749.js.map +0 -1
- package/dist/toolbar-fd4e4a3a.js +0 -2
- package/dist/toolbar-fd4e4a3a.js.map +0 -1
- package/src/toolbar/toolbar-action-sub-area.jsx +0 -126
- package/src/toolbar/toolbar-overflow-menu.jsx +0 -77
|
@@ -2773,7 +2773,7 @@ export default class SVGCanvasRenderer {
|
|
|
2773
2773
|
addContextToolbar(d3Event, d, objType) {
|
|
2774
2774
|
if (!this.isSizing() && !this.isDragging() &&
|
|
2775
2775
|
!this.svgCanvasTextArea.isEditingText() && !CanvasUtils.isSuperBindingNode(d)) {
|
|
2776
|
-
this.canvasController.setMouseInObject(
|
|
2776
|
+
this.canvasController.setMouseInObject(d.id);
|
|
2777
2777
|
let pos = this.getContextToolbarPos(objType, d);
|
|
2778
2778
|
pos = this.zoomUtils.unTransformPos(pos);
|
|
2779
2779
|
this.openContextMenu(d3Event, objType, d, null, pos);
|
|
@@ -2781,7 +2781,7 @@ export default class SVGCanvasRenderer {
|
|
|
2781
2781
|
}
|
|
2782
2782
|
|
|
2783
2783
|
removeContextToolbar() {
|
|
2784
|
-
this.canvasController.setMouseInObject(
|
|
2784
|
+
this.canvasController.setMouseInObject(null);
|
|
2785
2785
|
if (this.canvasController.isContextMenuDisplayed()) {
|
|
2786
2786
|
setTimeout(() => this.canvasController.closeContextToolbar(), 200);
|
|
2787
2787
|
}
|
|
@@ -2974,6 +2974,8 @@ export default class SVGCanvasRenderer {
|
|
|
2974
2974
|
|
|
2975
2975
|
}
|
|
2976
2976
|
|
|
2977
|
+
// Opens either the context menu or the context toolbar depending on which is
|
|
2978
|
+
// currently enabled.
|
|
2977
2979
|
openContextMenu(d3Event, type, d, port, pos) {
|
|
2978
2980
|
CanvasUtils.stopPropagationAndPreventDefault(d3Event); // Stop the browser context menu appearing
|
|
2979
2981
|
this.canvasController.contextMenuHandler({
|
|
@@ -2991,6 +2993,8 @@ export default class SVGCanvasRenderer {
|
|
|
2991
2993
|
zoom: this.zoomUtils.getZoomScale() });
|
|
2992
2994
|
}
|
|
2993
2995
|
|
|
2996
|
+
// Closes the conetext menu if open. Called by various drag utility
|
|
2997
|
+
// classes.
|
|
2994
2998
|
closeContextMenuIfOpen() {
|
|
2995
2999
|
if (this.canvasController.isContextMenuDisplayed()) {
|
|
2996
3000
|
this.canvasController.closeContextMenu();
|
|
@@ -168,12 +168,19 @@ export default class SVGCanvasUtilsDragDetLink {
|
|
|
168
168
|
// If editSubType is set the user did a gesture that requires a change
|
|
169
169
|
// to the object model.
|
|
170
170
|
if (editSubType) {
|
|
171
|
-
this.ren.canvasController.editActionHandler({
|
|
171
|
+
const success = this.ren.canvasController.editActionHandler({
|
|
172
172
|
editType: "updateLink",
|
|
173
173
|
editSubType: editSubType,
|
|
174
174
|
editSource: "canvas",
|
|
175
175
|
newLink: newLink,
|
|
176
176
|
pipelineId: this.ren.activePipeline.id });
|
|
177
|
+
|
|
178
|
+
// The call to editActionHandler might "fail" if the host app
|
|
179
|
+
// uses beforeEditActionHandler to cancel the edit action. In
|
|
180
|
+
// this case, we snap the link back to its old position.
|
|
181
|
+
if (!success) {
|
|
182
|
+
this.snapBackOldLink(draggingLinkData.oldLink);
|
|
183
|
+
}
|
|
177
184
|
// If editSubType is null, the user performed a gesture which should
|
|
178
185
|
// not be executed as an action so draw the link back in its old position.
|
|
179
186
|
} else {
|
|
@@ -559,7 +559,7 @@ export default class SVGCanvasUtilsDragNewLink {
|
|
|
559
559
|
}
|
|
560
560
|
|
|
561
561
|
// Switches on or off node highlighting depending on whether a node is
|
|
562
|
-
// close to
|
|
562
|
+
// close to the new link being dragged.
|
|
563
563
|
setNewLinkOverNode(d3Event) {
|
|
564
564
|
const nodeNearMouse = this.ren.getNodeNearMousePos(d3Event, this.ren.canvasLayout.nodeProximity);
|
|
565
565
|
const highlightState = nodeNearMouse && this.isNewLinkAllowedToNode(nodeNearMouse);
|
|
@@ -48,6 +48,7 @@ import StructureEditorControl from "./structureeditor";
|
|
|
48
48
|
import StructureTableControl from "./structuretable";
|
|
49
49
|
import StructurelisteditorControl from "./structurelisteditor";
|
|
50
50
|
import ReadonlyTableControl from "./readonlytable";
|
|
51
|
+
import Slider from "./slider";
|
|
51
52
|
|
|
52
53
|
import ControlItem from "./../components/control-item";
|
|
53
54
|
import ActionFactory from "./../actions/action-factory.js";
|
|
@@ -82,7 +83,8 @@ const accessibleControls = [
|
|
|
82
83
|
ControlType.ONEOFSELECT,
|
|
83
84
|
ControlType.MULTISELECT,
|
|
84
85
|
ControlType.SELECTSCHEMA,
|
|
85
|
-
ControlType.SELECTCOLUMN
|
|
86
|
+
ControlType.SELECTCOLUMN,
|
|
87
|
+
ControlType.SLIDER
|
|
86
88
|
];
|
|
87
89
|
|
|
88
90
|
const tableControls = [
|
|
@@ -337,6 +339,9 @@ export default class ControlFactory {
|
|
|
337
339
|
rightFlyout={this.rightFlyout}
|
|
338
340
|
/>);
|
|
339
341
|
break;
|
|
342
|
+
case (ControlType.SLIDER):
|
|
343
|
+
createdControl = (<Slider {...props} />);
|
|
344
|
+
break;
|
|
340
345
|
default:
|
|
341
346
|
createdControl = (<ReadonlyControl {...props} />);
|
|
342
347
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright 2017-
|
|
2
|
+
* Copyright 2017-2024 Elyra Authors
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -31,36 +31,40 @@ export default class ExpressionBuilder extends React.Component {
|
|
|
31
31
|
this.onChange = this.onChange.bind(this);
|
|
32
32
|
this.onBlur = this.onBlur.bind(this);
|
|
33
33
|
this.onSelectionChange = this.onSelectionChange.bind(this);
|
|
34
|
-
this.
|
|
35
|
-
|
|
34
|
+
this.getCodemirrorState = this.getCodemirrorState.bind(this);
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
onChange(newValue) {
|
|
39
38
|
const value = (typeof newValue === "string") ? newValue : newValue.toString();
|
|
40
|
-
|
|
39
|
+
const somethingSelected = this.getCodemirrorState()?.selection.ranges.some((r) => !r.empty);
|
|
40
|
+
let cursor = this.getCodemirrorState()?.selection.main.head;
|
|
41
|
+
if (cursor === 0 && !somethingSelected) { // TODO: Doesn't work when I explicitly set the cursor to 0
|
|
42
|
+
// When nothing selected, set cursor at the end of the line
|
|
43
|
+
this.editor.dispatch({ selection: { anchor: this.getCodemirrorState()?.doc.length } });
|
|
44
|
+
cursor = this.getCodemirrorState()?.selection.main.head;
|
|
45
|
+
this.editor.focus();
|
|
46
|
+
}
|
|
41
47
|
let selectionOffset = 1;
|
|
42
|
-
if (
|
|
48
|
+
if (somethingSelected) {
|
|
43
49
|
selectionOffset = 0;
|
|
44
|
-
this.editor.replaceSelection(value);
|
|
50
|
+
this.editor.dispatch(this.getCodemirrorState()?.replaceSelection(value), { scrollIntoView: true });
|
|
51
|
+
this.editor.focus();
|
|
45
52
|
} else {
|
|
46
53
|
let buffer = " ";
|
|
47
|
-
if (this.lastCursorPos) {
|
|
48
|
-
this.editor.setCursor(this.lastCursorPos);
|
|
49
|
-
cursor = this.lastCursorPos;
|
|
50
|
-
}
|
|
51
54
|
// if adding to a parenth/bracket/brace expression, no need for space
|
|
52
|
-
const
|
|
55
|
+
const currentLineNumber = this.getCodemirrorState()?.doc.lineAt(this.getCodemirrorState()?.selection.main.head).number;
|
|
56
|
+
const charBefore = this.getCodemirrorState()?.doc.line(currentLineNumber).text[cursor - 1];
|
|
53
57
|
// edge case of cursor being at line 0, char 0 is still handled here
|
|
54
58
|
if (["(", "[", "{"].indexOf(charBefore) !== -1) {
|
|
55
59
|
buffer = "";
|
|
56
60
|
}
|
|
57
|
-
this.editor.replaceSelection(buffer + value);
|
|
61
|
+
this.editor.dispatch(this.getCodemirrorState()?.replaceSelection(buffer + value), { scrollIntoView: true });
|
|
62
|
+
this.editor.focus();
|
|
58
63
|
}
|
|
59
64
|
this._setSelection(value, cursor, selectionOffset);
|
|
60
65
|
// This is needed to generate a render so that the selection will appear.
|
|
61
|
-
const exprValue = this.
|
|
66
|
+
const exprValue = this.getCodemirrorState()?.doc.toString();
|
|
62
67
|
this.props.controller.updatePropertyValue(this.props.propertyId, exprValue, true);
|
|
63
|
-
this.lastCursorPos = this.editor.getCursor();
|
|
64
68
|
}
|
|
65
69
|
|
|
66
70
|
onSelectionChange(selection) {
|
|
@@ -68,9 +72,8 @@ export default class ExpressionBuilder extends React.Component {
|
|
|
68
72
|
}
|
|
69
73
|
|
|
70
74
|
onBlur(editor, evt) {
|
|
71
|
-
this.lastCursorPos = editor.getCursor();
|
|
72
75
|
const currentValue = this.props.controller.getPropertyValue(this.props.propertyId);
|
|
73
|
-
const newValue =
|
|
76
|
+
const newValue = editor?.viewState?.state?.doc.toString();
|
|
74
77
|
const skipValidate = this.expressionSelectionPanel && evt && this.expressionSelectionPanel.contains(evt.relatedTarget);
|
|
75
78
|
// update property value when value is updated OR value is to be validated
|
|
76
79
|
if (!isEqual(currentValue, newValue) || !skipValidate) {
|
|
@@ -78,38 +81,41 @@ export default class ExpressionBuilder extends React.Component {
|
|
|
78
81
|
}
|
|
79
82
|
}
|
|
80
83
|
|
|
81
|
-
|
|
82
|
-
this.editor
|
|
84
|
+
getCodemirrorState() {
|
|
85
|
+
return this.editor?.viewState?.state;
|
|
83
86
|
}
|
|
84
87
|
|
|
88
|
+
editorDidMount(editor) {
|
|
89
|
+
this.editor = editor;
|
|
90
|
+
}
|
|
85
91
|
|
|
86
92
|
_setSelection(value, cursor, selectionOffset) {
|
|
87
93
|
// first set the selection to the first param holder of new value
|
|
88
94
|
if (typeof value === "string") {
|
|
89
95
|
const firstParam = value.indexOf("?");
|
|
90
96
|
if (firstParam !== -1) {
|
|
91
|
-
const selection = { anchor:
|
|
92
|
-
|
|
97
|
+
const selection = { anchor: cursor + firstParam + selectionOffset + 1, head: cursor + firstParam + selectionOffset };
|
|
98
|
+
this.editor.dispatch({ selection: selection });
|
|
93
99
|
this.onSelectionChange([selection]);
|
|
94
100
|
return;
|
|
95
101
|
}
|
|
96
102
|
}
|
|
97
103
|
// if the newValue doesn't have a param holder
|
|
98
104
|
// set it to the first param holder found in the expression
|
|
99
|
-
const lineCount = this.
|
|
105
|
+
const lineCount = this.getCodemirrorState()?.doc.lines;
|
|
100
106
|
for (let index = 0; index < lineCount; index++) {
|
|
101
|
-
const line = this.
|
|
107
|
+
const line = this.getCodemirrorState()?.doc.line(index + 1).text;
|
|
102
108
|
const paramOffset = line.indexOf("?");
|
|
103
109
|
if (paramOffset !== -1) {
|
|
104
|
-
const selection = { anchor:
|
|
105
|
-
|
|
110
|
+
const selection = { anchor: paramOffset + 1, head: paramOffset };
|
|
111
|
+
this.editor.dispatch({ selection: selection });
|
|
106
112
|
this.onSelectionChange([selection]);
|
|
107
113
|
return;
|
|
108
114
|
}
|
|
109
115
|
}
|
|
110
116
|
// if no parameter holders found then set it to end of insert string
|
|
111
|
-
const insertSelection = { anchor:
|
|
112
|
-
head:
|
|
117
|
+
const insertSelection = { anchor: this.getCodemirrorState()?.selection.main.anchor,
|
|
118
|
+
head: this.getCodemirrorState()?.selection.main.head };
|
|
113
119
|
this.onSelectionChange([insertSelection]);
|
|
114
120
|
return;
|
|
115
121
|
}
|