@eclipse-glsp-examples/workflow-server 2.6.0-next.0 → 2.6.0-next.1
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/common/provider/workflow-context-menu-item-provider.d.ts +1 -1
- package/lib/common/provider/workflow-context-menu-item-provider.d.ts.map +1 -1
- package/lib/common/provider/workflow-context-menu-item-provider.js +16 -4
- package/lib/common/provider/workflow-context-menu-item-provider.js.map +1 -1
- package/package.json +4 -4
- package/src/common/provider/workflow-context-menu-item-provider.ts +20 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022-
|
|
2
|
+
* Copyright (c) 2022-2025 STMicroelectronics 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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-context-menu-item-provider.d.ts","sourceRoot":"","sources":["../../../src/common/provider/workflow-context-menu-item-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAuB,QAAQ,EAAE,UAAU,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"workflow-context-menu-item-provider.d.ts","sourceRoot":"","sources":["../../../src/common/provider/workflow-context-menu-item-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAuB,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAqB,MAAM,sBAAsB,CAAC;AAK1I,qBACa,+BAAgC,SAAQ,uBAAuB;IAExE,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IAEjC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,QAAQ,EAAE;CAwCnF"}
|
|
@@ -11,7 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.WorkflowContextMenuItemProvider = void 0;
|
|
13
13
|
/********************************************************************************
|
|
14
|
-
* Copyright (c) 2022-
|
|
14
|
+
* Copyright (c) 2022-2025 STMicroelectronics and others.
|
|
15
15
|
*
|
|
16
16
|
* This program and the accompanying materials are made available under the
|
|
17
17
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -31,8 +31,14 @@ const grid_snapper_1 = require("../handler/grid-snapper");
|
|
|
31
31
|
const model_types_1 = require("../util/model-types");
|
|
32
32
|
let WorkflowContextMenuItemProvider = class WorkflowContextMenuItemProvider extends server_1.ContextMenuItemProvider {
|
|
33
33
|
getItems(selectedElementIds, position, args) {
|
|
34
|
+
const editModeMenu = {
|
|
35
|
+
id: 'editMode',
|
|
36
|
+
label: 'Readonly Mode',
|
|
37
|
+
isToggled: this.modelState.isReadonly,
|
|
38
|
+
actions: [this.modelState.isReadonly ? server_1.SetEditModeAction.create('editable') : server_1.SetEditModeAction.create('readonly')]
|
|
39
|
+
};
|
|
34
40
|
if (this.modelState.isReadonly || selectedElementIds.length !== 0) {
|
|
35
|
-
return [];
|
|
41
|
+
return [editModeMenu];
|
|
36
42
|
}
|
|
37
43
|
const snappedPosition = grid_snapper_1.GridSnapper.snap(position);
|
|
38
44
|
const newAutTask = {
|
|
@@ -45,15 +51,21 @@ let WorkflowContextMenuItemProvider = class WorkflowContextMenuItemProvider exte
|
|
|
45
51
|
label: 'Manual Task',
|
|
46
52
|
actions: [server_1.CreateNodeOperation.create(model_types_1.ModelTypes.MANUAL_TASK, { location: snappedPosition })]
|
|
47
53
|
};
|
|
54
|
+
const hiddenItem = {
|
|
55
|
+
id: 'hiddenItem',
|
|
56
|
+
label: 'Should be hidden',
|
|
57
|
+
actions: [],
|
|
58
|
+
isVisible: false
|
|
59
|
+
};
|
|
48
60
|
const newChildMenu = {
|
|
49
61
|
id: 'new',
|
|
50
62
|
label: 'New',
|
|
51
63
|
actions: [],
|
|
52
|
-
children: [newAutTask, newManTask],
|
|
64
|
+
children: [newAutTask, newManTask, hiddenItem],
|
|
53
65
|
icon: 'add',
|
|
54
66
|
group: '0_new'
|
|
55
67
|
};
|
|
56
|
-
return [newChildMenu];
|
|
68
|
+
return [newChildMenu, editModeMenu];
|
|
57
69
|
}
|
|
58
70
|
};
|
|
59
71
|
exports.WorkflowContextMenuItemProvider = WorkflowContextMenuItemProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-context-menu-item-provider.js","sourceRoot":"","sources":["../../../src/common/provider/workflow-context-menu-item-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,
|
|
1
|
+
{"version":3,"file":"workflow-context-menu-item-provider.js","sourceRoot":"","sources":["../../../src/common/provider/workflow-context-menu-item-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAA0I;AAC1I,yCAA+C;AAC/C,0DAAsD;AACtD,qDAAiD;AAG1C,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,gCAAuB;IAIxE,QAAQ,CAAC,kBAA4B,EAAE,QAAe,EAAE,IAAW;QAC/D,MAAM,YAAY,GAAa;YAC3B,EAAE,EAAE,UAAU;YACd,KAAK,EAAE,eAAe;YACtB,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,UAAU;YACrC,OAAO,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,0BAAiB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,0BAAiB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;SACtH,CAAC;QAEF,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,IAAI,kBAAkB,CAAC,MAAM,KAA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
|
+
"version": "2.6.0-next.1+9d94ba7",
|
|
4
4
|
"description": "GLSP node server for the workflow example",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eclipse",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"watch:bundle": "webpack -w"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@eclipse-glsp/layout-elk": "2.6.0-next.
|
|
60
|
-
"@eclipse-glsp/server": "2.6.0-next.
|
|
59
|
+
"@eclipse-glsp/layout-elk": "2.6.0-next.1+9d94ba7",
|
|
60
|
+
"@eclipse-glsp/server": "2.6.0-next.1+9d94ba7",
|
|
61
61
|
"inversify": "^6.1.3"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "9d94ba715de9f94a72bf1820f8b7dd847fe218d6"
|
|
72
72
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022-
|
|
2
|
+
* Copyright (c) 2022-2025 STMicroelectronics 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,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { Args, ContextMenuItemProvider, CreateNodeOperation, MenuItem, ModelState, Point } from '@eclipse-glsp/server';
|
|
16
|
+
import { Args, ContextMenuItemProvider, CreateNodeOperation, MenuItem, ModelState, Point, SetEditModeAction } from '@eclipse-glsp/server';
|
|
17
17
|
import { inject, injectable } from 'inversify';
|
|
18
18
|
import { GridSnapper } from '../handler/grid-snapper';
|
|
19
19
|
import { ModelTypes } from '../util/model-types';
|
|
@@ -24,8 +24,15 @@ export class WorkflowContextMenuItemProvider extends ContextMenuItemProvider {
|
|
|
24
24
|
protected modelState: ModelState;
|
|
25
25
|
|
|
26
26
|
getItems(selectedElementIds: string[], position: Point, args?: Args): MenuItem[] {
|
|
27
|
+
const editModeMenu: MenuItem = {
|
|
28
|
+
id: 'editMode',
|
|
29
|
+
label: 'Readonly Mode',
|
|
30
|
+
isToggled: this.modelState.isReadonly,
|
|
31
|
+
actions: [this.modelState.isReadonly ? SetEditModeAction.create('editable') : SetEditModeAction.create('readonly')]
|
|
32
|
+
};
|
|
33
|
+
|
|
27
34
|
if (this.modelState.isReadonly || selectedElementIds.length !== 0) {
|
|
28
|
-
return [];
|
|
35
|
+
return [editModeMenu];
|
|
29
36
|
}
|
|
30
37
|
const snappedPosition = GridSnapper.snap(position);
|
|
31
38
|
const newAutTask: MenuItem = {
|
|
@@ -38,14 +45,22 @@ export class WorkflowContextMenuItemProvider extends ContextMenuItemProvider {
|
|
|
38
45
|
label: 'Manual Task',
|
|
39
46
|
actions: [CreateNodeOperation.create(ModelTypes.MANUAL_TASK, { location: snappedPosition })]
|
|
40
47
|
};
|
|
48
|
+
|
|
49
|
+
const hiddenItem: MenuItem = {
|
|
50
|
+
id: 'hiddenItem',
|
|
51
|
+
label: 'Should be hidden',
|
|
52
|
+
actions: [],
|
|
53
|
+
isVisible: false
|
|
54
|
+
};
|
|
41
55
|
const newChildMenu: MenuItem = {
|
|
42
56
|
id: 'new',
|
|
43
57
|
label: 'New',
|
|
44
58
|
actions: [],
|
|
45
|
-
children: [newAutTask, newManTask],
|
|
59
|
+
children: [newAutTask, newManTask, hiddenItem],
|
|
46
60
|
icon: 'add',
|
|
47
61
|
group: '0_new'
|
|
48
62
|
};
|
|
49
|
-
|
|
63
|
+
|
|
64
|
+
return [newChildMenu, editModeMenu];
|
|
50
65
|
}
|
|
51
66
|
}
|