@eclipse-glsp-examples/workflow-glsp 0.10.0-next.4ce46ea.160 → 0.10.0-next.5043408.167
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/lib/di.config.js +18 -18
- package/lib/di.config.js.map +1 -1
- package/lib/direct-task-editing/di.config.d.ts +0 -15
- package/lib/direct-task-editing/di.config.d.ts.map +1 -1
- package/lib/direct-task-editing/di.config.js +3 -3
- package/lib/direct-task-editing/di.config.js.map +1 -1
- package/lib/direct-task-editing/direct-task-editor.d.ts +24 -8
- package/lib/direct-task-editing/direct-task-editor.d.ts.map +1 -1
- package/lib/direct-task-editing/direct-task-editor.js +28 -26
- package/lib/direct-task-editing/direct-task-editor.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/model.d.ts.map +1 -1
- package/lib/model.js +2 -2
- package/lib/model.js.map +1 -1
- package/lib/workflow-views.d.ts +1 -2
- package/lib/workflow-views.d.ts.map +1 -1
- package/lib/workflow-views.js +8 -9
- package/lib/workflow-views.js.map +1 -1
- package/package.json +5 -7
- package/src/direct-task-editing/di.config.ts +2 -3
- package/src/direct-task-editing/direct-task-editor.ts +53 -22
- package/src/model.ts +6 -6
- package/src/workflow-views.tsx +5 -2
package/lib/di.config.js
CHANGED
|
@@ -31,26 +31,26 @@ const workflowDiagramModule = new inversify_1.ContainerModule((bind, unbind, isB
|
|
|
31
31
|
bind(client_1.TYPES.ICommandPaletteActionProvider).to(client_1.RevealNamedElementActionProvider);
|
|
32
32
|
bind(client_1.TYPES.IContextMenuItemProvider).to(client_1.DeleteElementContextMenuItemProvider);
|
|
33
33
|
const context = { bind, unbind, isBound, rebind };
|
|
34
|
-
client_1.configureDefaultModelElements(context);
|
|
35
|
-
client_1.configureModelElement(context, 'task:automated', model_1.TaskNode, client_1.RoundedCornerNodeView);
|
|
36
|
-
client_1.configureModelElement(context, 'task:manual', model_1.TaskNode, client_1.RoundedCornerNodeView);
|
|
37
|
-
client_1.configureModelElement(context, 'label:heading', client_1.SLabel, client_1.SLabelView, { enable: [client_1.editLabelFeature] });
|
|
38
|
-
client_1.configureModelElement(context, 'comp:comp', client_1.SCompartment, client_1.SCompartmentView);
|
|
39
|
-
client_1.configureModelElement(context, 'comp:header', client_1.SCompartment, client_1.SCompartmentView);
|
|
40
|
-
client_1.configureModelElement(context, 'label:icon', client_1.SLabel, client_1.SLabelView);
|
|
41
|
-
client_1.configureModelElement(context, protocol_1.DefaultTypes.EDGE, client_1.SEdge, workflow_views_1.WorkflowEdgeView);
|
|
42
|
-
client_1.configureModelElement(context, 'edge:weighted', model_1.WeightedEdge, workflow_views_1.WorkflowEdgeView);
|
|
43
|
-
client_1.configureModelElement(context, 'icon', model_1.Icon, workflow_views_1.IconView);
|
|
44
|
-
client_1.configureModelElement(context, 'activityNode:merge', model_1.ActivityNode, client_1.DiamondNodeView);
|
|
45
|
-
client_1.configureModelElement(context, 'activityNode:decision', model_1.ActivityNode, client_1.DiamondNodeView);
|
|
46
|
-
client_1.configureModelElement(context, 'activityNode:fork', model_1.ActivityNode, client_1.RectangularNodeView);
|
|
47
|
-
client_1.configureModelElement(context, 'activityNode:join', model_1.ActivityNode, client_1.RectangularNodeView);
|
|
48
|
-
client_1.configureModelElement(context, 'category', model_1.CategoryNode, client_1.RoundedCornerNodeView);
|
|
49
|
-
client_1.configureModelElement(context, 'struct', client_1.SCompartment, client_1.StructureCompartmentView);
|
|
34
|
+
(0, client_1.configureDefaultModelElements)(context);
|
|
35
|
+
(0, client_1.configureModelElement)(context, 'task:automated', model_1.TaskNode, client_1.RoundedCornerNodeView);
|
|
36
|
+
(0, client_1.configureModelElement)(context, 'task:manual', model_1.TaskNode, client_1.RoundedCornerNodeView);
|
|
37
|
+
(0, client_1.configureModelElement)(context, 'label:heading', client_1.SLabel, client_1.SLabelView, { enable: [client_1.editLabelFeature] });
|
|
38
|
+
(0, client_1.configureModelElement)(context, 'comp:comp', client_1.SCompartment, client_1.SCompartmentView);
|
|
39
|
+
(0, client_1.configureModelElement)(context, 'comp:header', client_1.SCompartment, client_1.SCompartmentView);
|
|
40
|
+
(0, client_1.configureModelElement)(context, 'label:icon', client_1.SLabel, client_1.SLabelView);
|
|
41
|
+
(0, client_1.configureModelElement)(context, protocol_1.DefaultTypes.EDGE, client_1.SEdge, workflow_views_1.WorkflowEdgeView);
|
|
42
|
+
(0, client_1.configureModelElement)(context, 'edge:weighted', model_1.WeightedEdge, workflow_views_1.WorkflowEdgeView);
|
|
43
|
+
(0, client_1.configureModelElement)(context, 'icon', model_1.Icon, workflow_views_1.IconView);
|
|
44
|
+
(0, client_1.configureModelElement)(context, 'activityNode:merge', model_1.ActivityNode, client_1.DiamondNodeView);
|
|
45
|
+
(0, client_1.configureModelElement)(context, 'activityNode:decision', model_1.ActivityNode, client_1.DiamondNodeView);
|
|
46
|
+
(0, client_1.configureModelElement)(context, 'activityNode:fork', model_1.ActivityNode, client_1.RectangularNodeView);
|
|
47
|
+
(0, client_1.configureModelElement)(context, 'activityNode:join', model_1.ActivityNode, client_1.RectangularNodeView);
|
|
48
|
+
(0, client_1.configureModelElement)(context, 'category', model_1.CategoryNode, client_1.RoundedCornerNodeView);
|
|
49
|
+
(0, client_1.configureModelElement)(context, 'struct', client_1.SCompartment, client_1.StructureCompartmentView);
|
|
50
50
|
});
|
|
51
51
|
function createContainer(widgetId) {
|
|
52
|
-
const container = client_1.createClientContainer(workflowDiagramModule, di_config_1.directTaskEditor);
|
|
53
|
-
client_1.overrideViewerOptions(container, {
|
|
52
|
+
const container = (0, client_1.createClientContainer)(workflowDiagramModule, di_config_1.directTaskEditor);
|
|
53
|
+
(0, client_1.overrideViewerOptions)(container, {
|
|
54
54
|
baseDiv: widgetId,
|
|
55
55
|
hiddenDiv: widgetId + '_hidden'
|
|
56
56
|
});
|
package/lib/di.config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"di.config.js","sourceRoot":"","sources":["../src/di.config.ts"],"names":[],"mappings":";;AA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AAC;IAChF,IAAA,8BAAqB,EAAC,OAAO,EAAE,MAAM,EAAE,YAAI,EAAE,yBAAQ,CAAC,CAAC;IACvD,IAAA,8BAAqB,EAAC,OAAO,EAAE,oBAAoB,EAAE,oBAAY,EAAE,wBAAe,CAAC,CAAC;IACpF,IAAA,8BAAqB,EAAC,OAAO,EAAE,uBAAuB,EAAE,oBAAY,EAAE,wBAAe,CAAC,CAAC;IACvF,IAAA,8BAAqB,EAAC,OAAO,EAAE,mBAAmB,EAAE,oBAAY,EAAE,4BAAmB,CAAC,CAAC;IACvF,IAAA,8BAAqB,EAAC,OAAO,EAAE,mBAAmB,EAAE,oBAAY,EAAE,4BAAmB,CAAC,CAAC;IAEvF,IAAA,8BAAqB,EAAC,OAAO,EAAE,UAAU,EAAE,oBAAY,EAAE,8BAAqB,CAAC,CAAC;IAChF,IAAA,8BAAqB,EAAC,OAAO,EAAE,QAAQ,EAAE,qBAAY,EAAE,iCAAwB,CAAC,CAAC;AACrF,CAAC,CAAC,CAAC;AAEH,SAAwB,eAAe,CAAC,QAAgB;IACpD,MAAM,SAAS,GAAG,IAAA,8BAAqB,EAAC,qBAAqB,EAAE,4BAAgB,CAAC,CAAC;IACjF,IAAA,8BAAqB,EAAC,SAAS,EAAE;QAC7B,OAAO,EAAE,QAAQ;QACjB,SAAS,EAAE,QAAQ,GAAG,SAAS;KAClC,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACrB,CAAC;AAPD,kCAOC"}
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020 EclipseSource and others.
|
|
3
|
-
*
|
|
4
|
-
* This program and the accompanying materials are made available under the
|
|
5
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
*
|
|
8
|
-
* This Source Code may also be made available under the following Secondary
|
|
9
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
* with the GNU Classpath Exception which is available at
|
|
12
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
*
|
|
14
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
-
********************************************************************************/
|
|
16
1
|
import { ContainerModule } from 'inversify';
|
|
17
2
|
export declare const directTaskEditor: ContainerModule;
|
|
18
3
|
//# sourceMappingURL=di.config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"di.config.d.ts","sourceRoot":"","sources":["../../src/direct-task-editing/di.config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"di.config.d.ts","sourceRoot":"","sources":["../../src/direct-task-editing/di.config.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAG5C,eAAO,MAAM,gBAAgB,iBAG3B,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.directTaskEditor = void 0;
|
|
4
4
|
/********************************************************************************
|
|
5
|
-
* Copyright (c) 2020 EclipseSource and others.
|
|
5
|
+
* Copyright (c) 2020-2022 EclipseSource and others.
|
|
6
6
|
*
|
|
7
7
|
* This program and the accompanying materials are made available under the
|
|
8
8
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -16,11 +16,11 @@ exports.directTaskEditor = void 0;
|
|
|
16
16
|
*
|
|
17
17
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
18
18
|
********************************************************************************/
|
|
19
|
+
const client_1 = require("@eclipse-glsp/client");
|
|
19
20
|
const inversify_1 = require("inversify");
|
|
20
|
-
const sprotty_1 = require("sprotty");
|
|
21
21
|
const direct_task_editor_1 = require("./direct-task-editor");
|
|
22
22
|
exports.directTaskEditor = new inversify_1.ContainerModule((bind, _unbind, isBound) => {
|
|
23
23
|
bind(direct_task_editor_1.TaskEditor).toSelf().inSingletonScope();
|
|
24
|
-
bind(
|
|
24
|
+
bind(client_1.TYPES.IUIExtension).toService(direct_task_editor_1.TaskEditor);
|
|
25
25
|
});
|
|
26
26
|
//# sourceMappingURL=di.config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"di.config.js","sourceRoot":"","sources":["../../src/direct-task-editing/di.config.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,yCAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"di.config.js","sourceRoot":"","sources":["../../src/direct-task-editing/di.config.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAA6C;AAC7C,yCAA4C;AAC5C,6DAAkD;AAErC,QAAA,gBAAgB,GAAG,IAAI,2BAAe,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IAC3E,IAAI,CAAC,+BAAU,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC7C,IAAI,CAAC,cAAK,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,+BAAU,CAAC,CAAC;AACnD,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020-
|
|
2
|
+
* Copyright (c) 2020-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -13,15 +13,31 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { AbstractUIExtension, Action, AutoCompleteWidget, EditorContextService, GLSPActionDispatcher, ILogger, LabeledAction, SModelRoot, ValidationStatus, ViewerOptions } from '@eclipse-glsp/client';
|
|
16
|
+
import { AbstractUIExtension, Action, AutoCompleteWidget, EditorContextService, GLSPActionDispatcher, ILogger, LabeledAction, Operation, SModelRoot, ValidationStatus, ViewerOptions } from '@eclipse-glsp/client';
|
|
17
17
|
import { DOMHelper } from 'sprotty/lib/base/views/dom-helper';
|
|
18
18
|
import { TaskNode } from '../model';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Is send from the {@link TaskEditor} to the GLSP server
|
|
21
|
+
* to execute a task edit operation.
|
|
22
|
+
*/
|
|
23
|
+
export interface ApplyTaskEditOperation extends Operation {
|
|
24
|
+
kind: typeof ApplyTaskEditOperation.KIND;
|
|
25
|
+
/**
|
|
26
|
+
* Id of the task that should be edited
|
|
27
|
+
*/
|
|
28
|
+
taskId: string;
|
|
29
|
+
/**
|
|
30
|
+
* The edit expression
|
|
31
|
+
*/
|
|
32
|
+
expression: string;
|
|
33
|
+
}
|
|
34
|
+
export declare namespace ApplyTaskEditOperation {
|
|
35
|
+
const KIND = "applyTaskEdit";
|
|
36
|
+
function is(object: any): object is ApplyTaskEditOperation;
|
|
37
|
+
function create(options: {
|
|
38
|
+
taskId: string;
|
|
39
|
+
expression: string;
|
|
40
|
+
}): ApplyTaskEditOperation;
|
|
25
41
|
}
|
|
26
42
|
export declare class TaskEditor extends AbstractUIExtension {
|
|
27
43
|
static readonly ID = "task-editor";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"direct-task-editor.d.ts","sourceRoot":"","sources":["../../src/direct-task-editing/direct-task-editor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,mBAAmB,EACnB,MAAM,EACN,kBAAkB,EAClB,oBAAoB,EAEpB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"direct-task-editor.d.ts","sourceRoot":"","sources":["../../src/direct-task-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AAC;IAE7C,EAAE,IAAI,MAAM;IAGZ,cAAc,IAAI,MAAM;IAIxB,SAAS,CAAC,kBAAkB,CAAC,gBAAgB,EAAE,WAAW,GAAG,IAAI;IAkBxD,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,GAAG,iBAAiB,EAAE,MAAM,EAAE,GAAG,IAAI;cAK5D,YAAY,CAAC,gBAAgB,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,GAAG,iBAAiB,EAAE,MAAM,EAAE,GAAG,IAAI;IAMhI,SAAS,CAAC,WAAW,CAAC,gBAAgB,EAAE,WAAW,GAAG,IAAI;cAe1C,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;cAU5D,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAUvE,SAAS,CAAC,qBAAqB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI;IAI/E,SAAS,CAAC,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK9C,IAAI,IAAI,IAAI;CAIxB"}
|
|
@@ -12,7 +12,7 @@ var TaskEditor_1;
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.TaskEditor = exports.ApplyTaskEditOperation = void 0;
|
|
14
14
|
/********************************************************************************
|
|
15
|
-
* Copyright (c) 2020-
|
|
15
|
+
* Copyright (c) 2020-2022 EclipseSource and others.
|
|
16
16
|
*
|
|
17
17
|
* This program and the accompanying materials are made available under the
|
|
18
18
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -28,18 +28,20 @@ exports.TaskEditor = exports.ApplyTaskEditOperation = void 0;
|
|
|
28
28
|
********************************************************************************/
|
|
29
29
|
const client_1 = require("@eclipse-glsp/client");
|
|
30
30
|
const inversify_1 = require("inversify");
|
|
31
|
-
const lib_1 = require("sprotty/lib");
|
|
32
31
|
const dom_helper_1 = require("sprotty/lib/base/views/dom-helper");
|
|
33
32
|
const model_1 = require("../model");
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
var ApplyTaskEditOperation;
|
|
34
|
+
(function (ApplyTaskEditOperation) {
|
|
35
|
+
ApplyTaskEditOperation.KIND = 'applyTaskEdit';
|
|
36
|
+
function is(object) {
|
|
37
|
+
return client_1.Operation.hasKind(object, ApplyTaskEditOperation.KIND) && (0, client_1.hasStringProp)(object, 'taskId') && (0, client_1.hasStringProp)(object, 'expression');
|
|
39
38
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
ApplyTaskEditOperation.KIND
|
|
39
|
+
ApplyTaskEditOperation.is = is;
|
|
40
|
+
function create(options) {
|
|
41
|
+
return Object.assign({ kind: ApplyTaskEditOperation.KIND, isOperation: true }, options);
|
|
42
|
+
}
|
|
43
|
+
ApplyTaskEditOperation.create = create;
|
|
44
|
+
})(ApplyTaskEditOperation = exports.ApplyTaskEditOperation || (exports.ApplyTaskEditOperation = {}));
|
|
43
45
|
let TaskEditor = TaskEditor_1 = class TaskEditor extends client_1.AbstractUIExtension {
|
|
44
46
|
constructor() {
|
|
45
47
|
super(...arguments);
|
|
@@ -69,7 +71,7 @@ let TaskEditor = TaskEditor_1 = class TaskEditor extends client_1.AbstractUIExte
|
|
|
69
71
|
this.autoSuggestion.open(root);
|
|
70
72
|
}
|
|
71
73
|
onBeforeShow(containerElement, root, ...contextElementIds) {
|
|
72
|
-
this.task = getTask(contextElementIds, root)[0];
|
|
74
|
+
this.task = getTask(contextElementIds, root.index)[0];
|
|
73
75
|
this.autoSuggestion.inputField.value = '';
|
|
74
76
|
this.setPosition(containerElement);
|
|
75
77
|
}
|
|
@@ -77,7 +79,7 @@ let TaskEditor = TaskEditor_1 = class TaskEditor extends client_1.AbstractUIExte
|
|
|
77
79
|
let x = 0;
|
|
78
80
|
let y = 0;
|
|
79
81
|
if (this.task) {
|
|
80
|
-
const bounds = client_1.getAbsoluteClientBounds(this.task, this.domHelper, this.viewerOptions);
|
|
82
|
+
const bounds = (0, client_1.getAbsoluteClientBounds)(this.task, this.domHelper, this.viewerOptions);
|
|
81
83
|
x = bounds.x + 5;
|
|
82
84
|
y = bounds.y + 5;
|
|
83
85
|
}
|
|
@@ -86,24 +88,24 @@ let TaskEditor = TaskEditor_1 = class TaskEditor extends client_1.AbstractUIExte
|
|
|
86
88
|
containerElement.style.width = '200px';
|
|
87
89
|
}
|
|
88
90
|
async retrieveSuggestions(input) {
|
|
89
|
-
const response = await this.actionDispatcher.request(
|
|
90
|
-
if (client_1.
|
|
91
|
+
const response = await this.actionDispatcher.request(client_1.RequestContextActions.create({ contextId: TaskEditor_1.ID, editorContext: this.editorContextService.get({ ['text']: input }) }));
|
|
92
|
+
if (client_1.SetContextActions.is(response)) {
|
|
91
93
|
return response.actions;
|
|
92
94
|
}
|
|
93
95
|
return Promise.reject();
|
|
94
96
|
}
|
|
95
97
|
async validateInput(input) {
|
|
96
|
-
const response = await this.actionDispatcher.request(
|
|
97
|
-
if (client_1.
|
|
98
|
+
const response = await this.actionDispatcher.request(client_1.RequestEditValidationAction.create({ contextId: TaskEditor_1.ID, modelElementId: this.task.id, text: input }));
|
|
99
|
+
if (client_1.SetEditValidationResultAction.is(response)) {
|
|
98
100
|
return response.status;
|
|
99
101
|
}
|
|
100
102
|
return Promise.reject();
|
|
101
103
|
}
|
|
102
104
|
executeFromSuggestion(input) {
|
|
103
|
-
this.actionDispatcher.dispatchAll(client_1.toActionArray(input));
|
|
105
|
+
this.actionDispatcher.dispatchAll((0, client_1.toActionArray)(input));
|
|
104
106
|
}
|
|
105
107
|
executeFromTextOnlyInput(input) {
|
|
106
|
-
const action =
|
|
108
|
+
const action = ApplyTaskEditOperation.create({ taskId: this.task.id, expression: input });
|
|
107
109
|
this.actionDispatcher.dispatch(action);
|
|
108
110
|
}
|
|
109
111
|
hide() {
|
|
@@ -113,30 +115,30 @@ let TaskEditor = TaskEditor_1 = class TaskEditor extends client_1.AbstractUIExte
|
|
|
113
115
|
};
|
|
114
116
|
TaskEditor.ID = 'task-editor';
|
|
115
117
|
__decorate([
|
|
116
|
-
inversify_1.inject(
|
|
118
|
+
(0, inversify_1.inject)(client_1.TYPES.IActionDispatcher),
|
|
117
119
|
__metadata("design:type", client_1.GLSPActionDispatcher)
|
|
118
120
|
], TaskEditor.prototype, "actionDispatcher", void 0);
|
|
119
121
|
__decorate([
|
|
120
|
-
inversify_1.inject(client_1.EditorContextService),
|
|
122
|
+
(0, inversify_1.inject)(client_1.EditorContextService),
|
|
121
123
|
__metadata("design:type", client_1.EditorContextService)
|
|
122
124
|
], TaskEditor.prototype, "editorContextService", void 0);
|
|
123
125
|
__decorate([
|
|
124
|
-
inversify_1.inject(
|
|
126
|
+
(0, inversify_1.inject)(client_1.TYPES.ViewerOptions),
|
|
125
127
|
__metadata("design:type", Object)
|
|
126
128
|
], TaskEditor.prototype, "viewerOptions", void 0);
|
|
127
129
|
__decorate([
|
|
128
|
-
inversify_1.inject(
|
|
130
|
+
(0, inversify_1.inject)(client_1.TYPES.DOMHelper),
|
|
129
131
|
__metadata("design:type", dom_helper_1.DOMHelper)
|
|
130
132
|
], TaskEditor.prototype, "domHelper", void 0);
|
|
131
133
|
__decorate([
|
|
132
|
-
inversify_1.inject(
|
|
134
|
+
(0, inversify_1.inject)(client_1.TYPES.ILogger),
|
|
133
135
|
__metadata("design:type", Object)
|
|
134
136
|
], TaskEditor.prototype, "logger", void 0);
|
|
135
137
|
TaskEditor = TaskEditor_1 = __decorate([
|
|
136
|
-
inversify_1.injectable()
|
|
138
|
+
(0, inversify_1.injectable)()
|
|
137
139
|
], TaskEditor);
|
|
138
140
|
exports.TaskEditor = TaskEditor;
|
|
139
|
-
function getTask(ids,
|
|
140
|
-
return ids.map(id =>
|
|
141
|
+
function getTask(ids, index) {
|
|
142
|
+
return ids.map(id => index.getById(id)).filter(element => element && (0, model_1.isTaskNode)(element));
|
|
141
143
|
}
|
|
142
144
|
//# sourceMappingURL=direct-task-editor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"direct-task-editor.js","sourceRoot":"","sources":["../../src/direct-task-editing/direct-task-editor.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,
|
|
1
|
+
{"version":3,"file":"direct-task-editor.js","sourceRoot":"","sources":["../../src/direct-task-editing/direct-task-editor.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAsB8B;AAC9B,yCAA+C;AAC/C,kEAA8D;AAC9D,oCAAgD;AAoBhD,IAAiB,sBAAsB,CActC;AAdD,WAAiB,sBAAsB;IACtB,2BAAI,GAAG,eAAe,CAAC;IAEpC,SAAgB,EAAE,CAAC,MAAW;QAC1B,OAAO,kBAAS,CAAC,OAAO,CAAC,MAAM,EAAE,uBAAA,IAAI,CAAC,IAAI,IAAA,sBAAa,EAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,IAAA,sBAAa,EAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACrH,CAAC;IAFe,yBAAE,KAEjB,CAAA;IAED,SAAgB,MAAM,CAAC,OAA+C;QAClE,uBACI,IAAI,EAAE,uBAAA,IAAI,EACV,WAAW,EAAE,IAAI,IACd,OAAO,EACZ;IACN,CAAC;IANe,6BAAM,SAMrB,CAAA;AACL,CAAC,EAdgB,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QActC;AAGD,IAAa,UAAU,kBAAvB,MAAa,UAAW,SAAQ,4BAAmB;IAAnD;;QAEa,2BAAsB,GAAG;YAC9B,oBAAoB,EAAE,0BAA0B;YAChD,gBAAgB,EAAE,6BAA6B;YAC/C,cAAc,EAAE,EAAE;YAClB,WAAW,EAAE,IAAI;SACpB,CAAC;IAwGN,CAAC;IApFG,EAAE;QACE,OAA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B,IAAA,sBAAU,GAAE;GACA,UAAU,CA+GtB;AA/GY,gCAAU;AAiHvB,SAAS,OAAO,CAAC,GAAa,EAAE,KAAqB;IACjD,OAAO,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,IAAI,IAAA,kBAAU,EAAC,OAAO,CAAC,CAAe,CAAC;AAC5G,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -7,7 +7,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
7
7
|
o[k2] = m[k];
|
|
8
8
|
}));
|
|
9
9
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.createWorkflowDiagramContainer = void 0;
|
package/lib/model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAIH,WAAW,EACX,aAAa,EAKb,eAAe,EAGf,QAAQ,EAGR,eAAe,EACf,aAAa,EACb,KAAK,EAEL,aAAa,EACb,aAAa,EACb,iBAAiB,EAEpB,MAAM,sBAAsB,CAAC;AAE9B,qBAAa,QAAS,SAAQ,eAAgB,YAAW,QAAQ,EAAE,iBAAiB;IAChF,
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAIH,WAAW,EACX,aAAa,EAKb,eAAe,EAGf,QAAQ,EAGR,e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gB,YAAW,QAAQ,EAAE,iBAAiB;IACpF,gBAAyB,gBAAgB,WAWvC;IAEF,IAAI,SAAM;IAEV,IAAI,aAAa,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC,GAAG,SAAS,CAM/D;CACJ"}
|
package/lib/model.js
CHANGED
|
@@ -20,7 +20,7 @@ const client_1 = require("@eclipse-glsp/client");
|
|
|
20
20
|
class TaskNode extends client_1.RectangularNode {
|
|
21
21
|
get editableLabel() {
|
|
22
22
|
const label = this.children.find(element => element.type === 'label:heading');
|
|
23
|
-
if (label && client_1.isEditableLabel(label)) {
|
|
23
|
+
if (label && (0, client_1.isEditableLabel)(label)) {
|
|
24
24
|
return label;
|
|
25
25
|
}
|
|
26
26
|
return undefined;
|
|
@@ -94,7 +94,7 @@ class CategoryNode extends client_1.RectangularNode {
|
|
|
94
94
|
}
|
|
95
95
|
get editableLabel() {
|
|
96
96
|
const label = this.children.find(element => element.type === 'label:heading');
|
|
97
|
-
if (label && client_1.isEditableLabel(label)) {
|
|
97
|
+
if (label && (0, client_1.isEditableLabel)(label)) {
|
|
98
98
|
return label;
|
|
99
99
|
}
|
|
100
100
|
return undefined;
|
package/lib/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAwB8B;AAE9B,MAAa,QAAS,SAAQ,wBAAe;IAkBzC,IAAI,aAAa;QACb,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,eAAe,CAAC,CAAC;QAC9E,IAAI,KAAK,IAAI,wBAAe,
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAwB8B;AAE9B,MAAa,QAAS,SAAQ,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B,SAAI,GAAG,UAAU,CAAC;QAClB,SAAI,GAAG,UAAU,CAAC;QAClB,cAAS,GAAG,WAAW,CAAC;IACzC,CAAC,EARgB,IAAI,GAAJ,iBAAI,KAAJ,iBAAI,QAQpB;AACL,CAAC,EAVgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAU5B;AAED,MAAa,IAAK,SAAQ,sBAAa;IAAvC;;QAKa,SAAI,GAAG;YACZ,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;SACb,CAAC;IACN,CAAC;;AATD,oBASC;AARmB,qBAAgB,GAAG,CAAC,sBAAa,EAAE,+BAAsB,EAAE,+BAAsB,EAAE,oBAAW,CAAC,CAAC;AAUpH,MAAa,YAAa,SAAQ,wBAAe;IAAjD;;QAcI,SAAI,GAAG,EAAE,CAAC;IASd,CAAC;IAPG,IAAI,aAAa;QACb,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,eAAe,CAAC,CAAC;QAC9E,IAAI,KAAK,IAAI,IAAA,wBAAe,EAAC,KAAK,CAAC,EAAE;YACjC,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;;AAtBL,oCAuBC;AAtB4B,6BAAgB,GAAG;IACxC,yBAAgB;IAChB,sBAAa;IACb,sBAAa;IACb,oBAAW;IACX,+BAAsB;IACtB,oBAAW;IACX,6BAAoB;IACpB,qBAAY;IACZ,oBAAW;IACX,6BAAoB;CACvB,CAAC"}
|
package/lib/workflow-views.d.ts
CHANGED
|
@@ -13,9 +13,8 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { Point, PolylineEdgeViewWithGapsOnIntersections, RenderingContext, SEdge } from '@eclipse-glsp/client';
|
|
16
|
+
import { Point, PolylineEdgeViewWithGapsOnIntersections, RenderingContext, SEdge, ShapeView } from '@eclipse-glsp/client';
|
|
17
17
|
import { VNode } from 'snabbdom';
|
|
18
|
-
import { ShapeView } from 'sprotty';
|
|
19
18
|
import { Icon } from './model';
|
|
20
19
|
export declare class WorkflowEdgeView extends PolylineEdgeViewWithGapsOnIntersections {
|
|
21
20
|
protected renderAdditionals(edge: SEdge, segments: Point[], context: RenderingContext): VNode[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-views.d.ts","sourceRoot":"","sources":["../src/workflow-views.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,
|
|
1
|
+
{"version":3,"file":"workflow-views.d.ts","sourceRoot":"","sources":["../src/workflow-views.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAIH,KAAK,EACL,uCAAuC,EACvC,gBAAgB,EAChB,KAAK,EAEL,SAAS,EAGZ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,IAAI,EAAc,MAAM,SAAS,CAAC;AAK3C,qBACa,gBAAiB,SAAQ,uCAAuC;cACtD,iBAAiB,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,gBAAgB,GAAG,KAAK,EAAE;CAiB3G;AAED,qBACa,QAAS,SAAQ,SAAS;IACnC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,GAAG,KAAK,GAAG,SAAS;CAuCtE"}
|
package/lib/workflow-views.js
CHANGED
|
@@ -24,27 +24,26 @@ exports.IconView = exports.WorkflowEdgeView = void 0;
|
|
|
24
24
|
********************************************************************************/
|
|
25
25
|
const client_1 = require("@eclipse-glsp/client");
|
|
26
26
|
const inversify_1 = require("inversify");
|
|
27
|
-
const sprotty_1 = require("sprotty");
|
|
28
27
|
const model_1 = require("./model");
|
|
29
28
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
30
|
-
const JSX = { createElement:
|
|
29
|
+
const JSX = { createElement: client_1.svg };
|
|
31
30
|
let WorkflowEdgeView = class WorkflowEdgeView extends client_1.PolylineEdgeViewWithGapsOnIntersections {
|
|
32
31
|
renderAdditionals(edge, segments, context) {
|
|
33
32
|
const additionals = super.renderAdditionals(edge, segments, context);
|
|
34
33
|
const p1 = segments[segments.length - 2];
|
|
35
34
|
const p2 = segments[segments.length - 1];
|
|
36
|
-
const arrow = (JSX.createElement("path", { "class-sprotty-edge": true, "class-arrow": true, d: 'M 1,0 L 10,-4 L 10,4 Z', transform: `rotate(${client_1.toDegrees(client_1.angleOfPoint({ x: p1.x - p2.x, y: p1.y - p2.y }))} ${p2.x} ${p2.y}) translate(${p2.x} ${p2.y})` }));
|
|
35
|
+
const arrow = (JSX.createElement("path", { "class-sprotty-edge": true, "class-arrow": true, d: 'M 1,0 L 10,-4 L 10,4 Z', transform: `rotate(${(0, client_1.toDegrees)((0, client_1.angleOfPoint)({ x: p1.x - p2.x, y: p1.y - p2.y }))} ${p2.x} ${p2.y}) translate(${p2.x} ${p2.y})` }));
|
|
37
36
|
additionals.push(arrow);
|
|
38
37
|
return additionals;
|
|
39
38
|
}
|
|
40
39
|
};
|
|
41
40
|
WorkflowEdgeView = __decorate([
|
|
42
|
-
inversify_1.injectable()
|
|
41
|
+
(0, inversify_1.injectable)()
|
|
43
42
|
], WorkflowEdgeView);
|
|
44
43
|
exports.WorkflowEdgeView = WorkflowEdgeView;
|
|
45
|
-
let IconView = class IconView extends
|
|
44
|
+
let IconView = class IconView extends client_1.ShapeView {
|
|
46
45
|
render(element, context) {
|
|
47
|
-
const taskNode =
|
|
46
|
+
const taskNode = (0, client_1.findParentByFeature)(element, model_1.isTaskNode);
|
|
48
47
|
if (!taskNode || !this.isVisible(element, context)) {
|
|
49
48
|
return undefined;
|
|
50
49
|
}
|
|
@@ -68,15 +67,15 @@ let IconView = class IconView extends sprotty_1.ShapeView {
|
|
|
68
67
|
d: icon }),
|
|
69
68
|
JSX.createElement("rect", { "class-icon-background": true, x: 0, y: 0, width: 25, height: 20 }),
|
|
70
69
|
context.renderChildren(element)));
|
|
71
|
-
const subType = client_1.getSubType(element);
|
|
70
|
+
const subType = (0, client_1.getSubType)(element);
|
|
72
71
|
if (subType) {
|
|
73
|
-
client_1.setAttr(vnode, 'class', subType);
|
|
72
|
+
(0, client_1.setAttr)(vnode, 'class', subType);
|
|
74
73
|
}
|
|
75
74
|
return vnode;
|
|
76
75
|
}
|
|
77
76
|
};
|
|
78
77
|
IconView = __decorate([
|
|
79
|
-
inversify_1.injectable()
|
|
78
|
+
(0, inversify_1.injectable)()
|
|
80
79
|
], IconView);
|
|
81
80
|
exports.IconView = IconView;
|
|
82
81
|
//# sourceMappingURL=workflow-views.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-views.js","sourceRoot":"","sources":["../src/workflow-views.tsx"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,
|
|
1
|
+
{"version":3,"file":"workflow-views.js","sourceRoot":"","sources":["../src/workflow-views.tsx"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAY8B;AAC9B,yCAAuC;AAEvC,mCAA2C;AAE3C,6DAA6D;AAC7D,MAAM,GAAG,GAAG,EAAE,aAAa,EAAE,YAAG,EAAE,CAAC;AAGnC,IAAa,gBAAgB,GAA7B,MAAa,gBAAiB,SAAQ,gDAAuC;IACtD,iBAAiB,CAAC,IAAW,EAAE,QAAiB,EAAE,OAAyB;QAC1F,MAAM,WAAW,GAAG,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QACrE,MAAM,EAAE,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACzC,MAAM,EA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H,mCAAmC;gBACnC,CAAC,EAAE,IAAI,GACT;YACF,2DAA4B,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,GAAI;YAChE,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAChC,CACP,CAAC;QAEF,MAAM,OAAO,GAAG,IAAA,mBAAU,EAAC,OAAO,CAAC,CAAC;QACpC,IAAI,OAAO,EAAE;YACT,IAAA,gBAAO,EAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SACpC;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ,CAAA;AAxCY,QAAQ;IADpB,IAAA,sBAAU,GAAE;GACA,QAAQ,CAwCpB;AAxCY,4BAAQ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-glsp-examples/workflow-glsp",
|
|
3
|
-
"version": "0.10.0-next.
|
|
3
|
+
"version": "0.10.0-next.5043408.167+5043408",
|
|
4
4
|
"description": "GLSP diagrams for the Workflow DSL",
|
|
5
5
|
"license": "(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)",
|
|
6
6
|
"keywords": [
|
|
@@ -26,17 +26,15 @@
|
|
|
26
26
|
}
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@eclipse-glsp/client": "0.10.0-next.
|
|
29
|
+
"@eclipse-glsp/client": "0.10.0-next.5043408.167+5043408",
|
|
30
30
|
"balloon-css": "^0.5.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"mvn-artifact-download": "5.1.0"
|
|
34
|
-
"rimraf": "^2.6.1",
|
|
35
|
-
"typescript": "^3.9.2"
|
|
33
|
+
"mvn-artifact-download": "5.1.0"
|
|
36
34
|
},
|
|
37
35
|
"scripts": {
|
|
38
36
|
"prepare": "yarn clean && yarn build && yarn lint",
|
|
39
|
-
"clean": "rimraf lib",
|
|
37
|
+
"clean": "rimraf tsconfig.tsbuildinfo lib",
|
|
40
38
|
"build": "tsc",
|
|
41
39
|
"lint": "eslint -c ./.eslintrc.js --ext .ts,.tsx ./src",
|
|
42
40
|
"watch": "tsc -w"
|
|
@@ -53,5 +51,5 @@
|
|
|
53
51
|
"publishConfig": {
|
|
54
52
|
"access": "public"
|
|
55
53
|
},
|
|
56
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "50434080a9890d7e9087fb5b561d5cea70f0230f"
|
|
57
55
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2020-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -13,9 +13,8 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
+
import { TYPES } from '@eclipse-glsp/client';
|
|
16
17
|
import { ContainerModule } from 'inversify';
|
|
17
|
-
import { TYPES } from 'sprotty';
|
|
18
|
-
|
|
19
18
|
import { TaskEditor } from './direct-task-editor';
|
|
20
19
|
|
|
21
20
|
export const directTaskEditor = new ContainerModule((bind, _unbind, isBound) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020-
|
|
2
|
+
* Copyright (c) 2020-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -20,29 +20,58 @@ import {
|
|
|
20
20
|
EditorContextService,
|
|
21
21
|
getAbsoluteClientBounds,
|
|
22
22
|
GLSPActionDispatcher,
|
|
23
|
+
hasStringProp,
|
|
23
24
|
ILogger,
|
|
24
|
-
isSetContextActionsAction,
|
|
25
|
-
isSetEditValidationResultAction,
|
|
26
25
|
LabeledAction,
|
|
26
|
+
ModelIndexImpl,
|
|
27
|
+
Operation,
|
|
27
28
|
RequestContextActions,
|
|
28
29
|
RequestEditValidationAction,
|
|
29
|
-
|
|
30
|
+
SetContextActions,
|
|
31
|
+
SetEditValidationResultAction,
|
|
30
32
|
SModelRoot,
|
|
31
33
|
toActionArray,
|
|
34
|
+
TYPES,
|
|
32
35
|
ValidationDecorator,
|
|
33
36
|
ValidationStatus,
|
|
34
37
|
ViewerOptions
|
|
35
38
|
} from '@eclipse-glsp/client';
|
|
36
39
|
import { inject, injectable } from 'inversify';
|
|
37
|
-
import { TYPES } from 'sprotty/lib';
|
|
38
40
|
import { DOMHelper } from 'sprotty/lib/base/views/dom-helper';
|
|
39
|
-
|
|
40
41
|
import { isTaskNode, TaskNode } from '../model';
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Is send from the {@link TaskEditor} to the GLSP server
|
|
45
|
+
* to execute a task edit operation.
|
|
46
|
+
*/
|
|
47
|
+
export interface ApplyTaskEditOperation extends Operation {
|
|
48
|
+
kind: typeof ApplyTaskEditOperation.KIND;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Id of the task that should be edited
|
|
52
|
+
*/
|
|
53
|
+
taskId: string;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The edit expression
|
|
57
|
+
*/
|
|
58
|
+
expression: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export namespace ApplyTaskEditOperation {
|
|
62
|
+
export const KIND = 'applyTaskEdit';
|
|
63
|
+
|
|
64
|
+
export function is(object: any): object is ApplyTaskEditOperation {
|
|
65
|
+
return Operation.hasKind(object, KIND) && hasStringProp(object, 'taskId') && hasStringProp(object, 'expression');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function create(options: { taskId: string; expression: string }): ApplyTaskEditOperation {
|
|
69
|
+
return {
|
|
70
|
+
kind: KIND,
|
|
71
|
+
isOperation: true,
|
|
72
|
+
...options
|
|
73
|
+
};
|
|
74
|
+
}
|
|
46
75
|
}
|
|
47
76
|
|
|
48
77
|
@injectable()
|
|
@@ -68,7 +97,7 @@ export class TaskEditor extends AbstractUIExtension {
|
|
|
68
97
|
protected domHelper: DOMHelper;
|
|
69
98
|
|
|
70
99
|
@inject(TYPES.ILogger)
|
|
71
|
-
protected logger: ILogger;
|
|
100
|
+
protected override logger: ILogger;
|
|
72
101
|
|
|
73
102
|
protected task: TaskNode;
|
|
74
103
|
protected autoSuggestion: AutoCompleteWidget;
|
|
@@ -98,13 +127,13 @@ export class TaskEditor extends AbstractUIExtension {
|
|
|
98
127
|
this.autoSuggestion.initialize(containerElement);
|
|
99
128
|
}
|
|
100
129
|
|
|
101
|
-
show(root: Readonly<SModelRoot>, ...contextElementIds: string[]): void {
|
|
130
|
+
override show(root: Readonly<SModelRoot>, ...contextElementIds: string[]): void {
|
|
102
131
|
super.show(root, ...contextElementIds);
|
|
103
132
|
this.autoSuggestion.open(root);
|
|
104
133
|
}
|
|
105
134
|
|
|
106
|
-
protected onBeforeShow(containerElement: HTMLElement, root: Readonly<SModelRoot>, ...contextElementIds: string[]): void {
|
|
107
|
-
this.task = getTask(contextElementIds, root)[0];
|
|
135
|
+
protected override onBeforeShow(containerElement: HTMLElement, root: Readonly<SModelRoot>, ...contextElementIds: string[]): void {
|
|
136
|
+
this.task = getTask(contextElementIds, root.index)[0];
|
|
108
137
|
this.autoSuggestion.inputField.value = '';
|
|
109
138
|
this.setPosition(containerElement);
|
|
110
139
|
}
|
|
@@ -126,17 +155,19 @@ export class TaskEditor extends AbstractUIExtension {
|
|
|
126
155
|
|
|
127
156
|
protected async retrieveSuggestions(input: string): Promise<LabeledAction[]> {
|
|
128
157
|
const response = await this.actionDispatcher.request(
|
|
129
|
-
|
|
158
|
+
RequestContextActions.create({ contextId: TaskEditor.ID, editorContext: this.editorContextService.get({ ['text']: input }) })
|
|
130
159
|
);
|
|
131
|
-
if (
|
|
160
|
+
if (SetContextActions.is(response)) {
|
|
132
161
|
return response.actions;
|
|
133
162
|
}
|
|
134
163
|
return Promise.reject();
|
|
135
164
|
}
|
|
136
165
|
|
|
137
166
|
protected async validateInput(input: string): Promise<ValidationStatus> {
|
|
138
|
-
const response = await this.actionDispatcher.request(
|
|
139
|
-
|
|
167
|
+
const response = await this.actionDispatcher.request(
|
|
168
|
+
RequestEditValidationAction.create({ contextId: TaskEditor.ID, modelElementId: this.task.id, text: input })
|
|
169
|
+
);
|
|
170
|
+
if (SetEditValidationResultAction.is(response)) {
|
|
140
171
|
return response.status;
|
|
141
172
|
}
|
|
142
173
|
return Promise.reject();
|
|
@@ -147,16 +178,16 @@ export class TaskEditor extends AbstractUIExtension {
|
|
|
147
178
|
}
|
|
148
179
|
|
|
149
180
|
protected executeFromTextOnlyInput(input: string): void {
|
|
150
|
-
const action =
|
|
181
|
+
const action = ApplyTaskEditOperation.create({ taskId: this.task.id, expression: input });
|
|
151
182
|
this.actionDispatcher.dispatch(action);
|
|
152
183
|
}
|
|
153
184
|
|
|
154
|
-
hide(): void {
|
|
185
|
+
override hide(): void {
|
|
155
186
|
this.autoSuggestion.dispose();
|
|
156
187
|
super.hide();
|
|
157
188
|
}
|
|
158
189
|
}
|
|
159
190
|
|
|
160
|
-
function getTask(ids: string[],
|
|
161
|
-
return ids.map(id =>
|
|
191
|
+
function getTask(ids: string[], index: ModelIndexImpl): TaskNode[] {
|
|
192
|
+
return ids.map(id => index.getById(id)).filter(element => element && isTaskNode(element)) as TaskNode[];
|
|
162
193
|
}
|
package/src/model.ts
CHANGED
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
} from '@eclipse-glsp/client';
|
|
41
41
|
|
|
42
42
|
export class TaskNode extends RectangularNode implements Nameable, WithEditableLabel {
|
|
43
|
-
static readonly DEFAULT_FEATURES = [
|
|
43
|
+
static override readonly DEFAULT_FEATURES = [
|
|
44
44
|
connectableFeature,
|
|
45
45
|
deletableFeature,
|
|
46
46
|
selectFeature,
|
|
@@ -81,11 +81,11 @@ export class WeightedEdge extends SEdge {
|
|
|
81
81
|
|
|
82
82
|
export class ActivityNode extends DiamondNode {
|
|
83
83
|
nodeType: string = ActivityNode.Type.UNDEFINED;
|
|
84
|
-
size = {
|
|
84
|
+
override size = {
|
|
85
85
|
width: 32,
|
|
86
86
|
height: 32
|
|
87
87
|
};
|
|
88
|
-
strokeWidth = 1;
|
|
88
|
+
override strokeWidth = 1;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
export namespace ActivityNode {
|
|
@@ -104,15 +104,15 @@ export class Icon extends SShapeElement implements LayoutContainer {
|
|
|
104
104
|
static readonly DEFAULT_FEATURES = [boundsFeature, layoutContainerFeature, layoutableChildFeature, fadeFeature];
|
|
105
105
|
|
|
106
106
|
layout: string;
|
|
107
|
-
layoutOptions?: { [key: string]: string | number | boolean };
|
|
108
|
-
size = {
|
|
107
|
+
override layoutOptions?: { [key: string]: string | number | boolean };
|
|
108
|
+
override size = {
|
|
109
109
|
width: 32,
|
|
110
110
|
height: 32
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
export class CategoryNode extends RectangularNode implements Nameable, WithEditableLabel {
|
|
115
|
-
static readonly DEFAULT_FEATURES = [
|
|
115
|
+
static override readonly DEFAULT_FEATURES = [
|
|
116
116
|
deletableFeature,
|
|
117
117
|
selectFeature,
|
|
118
118
|
boundsFeature,
|
package/src/workflow-views.tsx
CHANGED
|
@@ -15,17 +15,19 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import {
|
|
17
17
|
angleOfPoint,
|
|
18
|
+
findParentByFeature,
|
|
18
19
|
getSubType,
|
|
19
20
|
Point,
|
|
20
21
|
PolylineEdgeViewWithGapsOnIntersections,
|
|
21
22
|
RenderingContext,
|
|
22
23
|
SEdge,
|
|
23
24
|
setAttr,
|
|
25
|
+
ShapeView,
|
|
26
|
+
svg,
|
|
24
27
|
toDegrees
|
|
25
28
|
} from '@eclipse-glsp/client';
|
|
26
29
|
import { injectable } from 'inversify';
|
|
27
30
|
import { VNode } from 'snabbdom';
|
|
28
|
-
import { findParentByFeature, ShapeView, svg } from 'sprotty';
|
|
29
31
|
import { Icon, isTaskNode } from './model';
|
|
30
32
|
|
|
31
33
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -33,7 +35,7 @@ const JSX = { createElement: svg };
|
|
|
33
35
|
|
|
34
36
|
@injectable()
|
|
35
37
|
export class WorkflowEdgeView extends PolylineEdgeViewWithGapsOnIntersections {
|
|
36
|
-
protected renderAdditionals(edge: SEdge, segments: Point[], context: RenderingContext): VNode[] {
|
|
38
|
+
protected override renderAdditionals(edge: SEdge, segments: Point[], context: RenderingContext): VNode[] {
|
|
37
39
|
const additionals = super.renderAdditionals(edge, segments, context);
|
|
38
40
|
const p1 = segments[segments.length - 2];
|
|
39
41
|
const p2 = segments[segments.length - 1];
|
|
@@ -90,6 +92,7 @@ export class IconView extends ShapeView {
|
|
|
90
92
|
if (subType) {
|
|
91
93
|
setAttr(vnode, 'class', subType);
|
|
92
94
|
}
|
|
95
|
+
|
|
93
96
|
return vnode;
|
|
94
97
|
}
|
|
95
98
|
}
|