@eclipse-glsp-examples/workflow-glsp 2.2.0-next.331 → 2.2.0-next.333
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/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/workflow-diagram-module.d.ts.map +1 -1
- package/lib/workflow-diagram-module.js +5 -7
- package/lib/workflow-diagram-module.js.map +1 -1
- package/lib/workflow-snapper.d.ts +20 -0
- package/lib/workflow-snapper.d.ts.map +1 -0
- package/lib/workflow-snapper.js +40 -0
- package/lib/workflow-snapper.js.map +1 -0
- package/lib/workflow-startup.d.ts +23 -0
- package/lib/workflow-startup.d.ts.map +1 -0
- package/lib/workflow-startup.js +49 -0
- package/lib/workflow-startup.js.map +1 -0
- package/package.json +3 -3
- package/src/index.ts +2 -0
- package/src/workflow-diagram-module.ts +16 -10
- package/src/workflow-snapper.ts +29 -0
- package/src/workflow-startup.ts +30 -0
package/lib/index.d.ts
CHANGED
|
@@ -16,5 +16,7 @@
|
|
|
16
16
|
export * from './direct-task-editing';
|
|
17
17
|
export * from './model';
|
|
18
18
|
export * from './workflow-diagram-module';
|
|
19
|
+
export * from './workflow-snapper';
|
|
20
|
+
export * from './workflow-startup';
|
|
19
21
|
export * from './workflow-views';
|
|
20
22
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC;AACxB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC;AACxB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -32,5 +32,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
32
32
|
__exportStar(require("./direct-task-editing"), exports);
|
|
33
33
|
__exportStar(require("./model"), exports);
|
|
34
34
|
__exportStar(require("./workflow-diagram-module"), exports);
|
|
35
|
+
__exportStar(require("./workflow-snapper"), exports);
|
|
36
|
+
__exportStar(require("./workflow-startup"), exports);
|
|
35
37
|
__exportStar(require("./workflow-views"), exports);
|
|
36
38
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,wDAAsC;AACtC,0CAAwB;AACxB,4DAA0C;AAC1C,mDAAiC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,wDAAsC;AACtC,0CAAwB;AACxB,4DAA0C;AAC1C,qDAAmC;AACnC,qDAAmC;AACnC,mDAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-diagram-module.d.ts","sourceRoot":"","sources":["../src/workflow-diagram-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAEH,sBAAsB,
|
|
1
|
+
{"version":3,"file":"workflow-diagram-module.d.ts","sourceRoot":"","sources":["../src/workflow-diagram-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAEH,sBAAsB,EA4BzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,6BAA6B,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,4BAA4B,CAAC;AACpC,OAAO,oBAAoB,CAAC;AAO5B,eAAO,MAAM,qBAAqB,iBAoChC,CAAC;AAEH,wBAAgB,8BAA8B,CAAC,GAAG,sBAAsB,EAAE,sBAAsB,GAAG,SAAS,CAE3G;AAED,wBAAgB,kCAAkC,CAAC,SAAS,EAAE,SAAS,EAAE,GAAG,sBAAsB,EAAE,sBAAsB,GAAG,SAAS,CAUrI"}
|
|
@@ -23,12 +23,13 @@ require("sprotty/css/edit-label.css");
|
|
|
23
23
|
require("../css/diagram.css");
|
|
24
24
|
const di_config_1 = require("./direct-task-editing/di.config");
|
|
25
25
|
const model_1 = require("./model");
|
|
26
|
+
const workflow_snapper_1 = require("./workflow-snapper");
|
|
27
|
+
const workflow_startup_1 = require("./workflow-startup");
|
|
26
28
|
const workflow_views_1 = require("./workflow-views");
|
|
27
29
|
exports.workflowDiagramModule = new inversify_1.ContainerModule((bind, unbind, isBound, rebind) => {
|
|
28
30
|
const context = { bind, unbind, isBound, rebind };
|
|
29
31
|
(0, client_1.bindOrRebind)(context, client_1.TYPES.ILogger).to(client_1.ConsoleLogger).inSingletonScope();
|
|
30
32
|
(0, client_1.bindOrRebind)(context, client_1.TYPES.LogLevel).toConstantValue(client_1.LogLevel.warn);
|
|
31
|
-
bind(client_1.TYPES.ISnapper).to(client_1.GridSnapper);
|
|
32
33
|
(0, client_1.bindAsService)(context, client_1.TYPES.ICommandPaletteActionProvider, client_1.RevealNamedElementActionProvider);
|
|
33
34
|
(0, client_1.bindAsService)(context, client_1.TYPES.IContextMenuItemProvider, client_1.DeleteElementContextMenuItemProvider);
|
|
34
35
|
(0, client_1.configureDefaultModelElements)(context);
|
|
@@ -50,22 +51,19 @@ exports.workflowDiagramModule = new inversify_1.ContainerModule((bind, unbind, i
|
|
|
50
51
|
(0, client_1.configureModelElement)(context, 'struct', client_1.GCompartment, client_1.StructureCompartmentView);
|
|
51
52
|
bind(client_1.TYPES.IHelperLineOptions).toDynamicValue(ctx => {
|
|
52
53
|
const options = {};
|
|
53
|
-
// the user needs to use twice the force (double the distance) to break through a helper line compared to moving on the grid
|
|
54
|
-
const snapper = ctx.container.get(client_1.TYPES.ISnapper);
|
|
55
|
-
if (snapper instanceof client_1.GridSnapper) {
|
|
56
|
-
options.minimumMoveDelta = client_1.Point.multiplyScalar(snapper.grid, 2);
|
|
57
|
-
}
|
|
58
54
|
// skip icons for alignment as well as compartments which are only used for structure
|
|
59
55
|
options.alignmentElementFilter = element => (0, client_1.DEFAULT_ALIGNABLE_ELEMENT_FILTER)(element) && !(element instanceof model_1.Icon) && !(element instanceof client_1.GCompartment);
|
|
60
56
|
return options;
|
|
61
57
|
});
|
|
58
|
+
(0, client_1.bindAsService)(context, client_1.TYPES.IDiagramStartup, workflow_startup_1.WorkflowStartup);
|
|
59
|
+
(0, client_1.bindOrRebind)(context, client_1.TYPES.ISnapper).to(workflow_snapper_1.WorkflowSnapper);
|
|
62
60
|
});
|
|
63
61
|
function createWorkflowDiagramContainer(...containerConfiguration) {
|
|
64
62
|
return initializeWorkflowDiagramContainer(new inversify_1.Container(), ...containerConfiguration);
|
|
65
63
|
}
|
|
66
64
|
exports.createWorkflowDiagramContainer = createWorkflowDiagramContainer;
|
|
67
65
|
function initializeWorkflowDiagramContainer(container, ...containerConfiguration) {
|
|
68
|
-
return (0, client_1.initializeDiagramContainer)(container,
|
|
66
|
+
return (0, client_1.initializeDiagramContainer)(container, di_config_1.directTaskEditor, client_1.helperLineModule, client_1.gridModule, client_1.debugModule, exports.workflowDiagramModule, ...containerConfiguration);
|
|
69
67
|
}
|
|
70
68
|
exports.initializeWorkflowDiagramContainer = initializeWorkflowDiagramContainer;
|
|
71
69
|
//# sourceMappingURL=workflow-diagram-module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-diagram-module.js","sourceRoot":"","sources":["../src/workflow-diagram-module.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,
|
|
1
|
+
{"version":3,"file":"workflow-diagram-module.js","sourceRoot":"","sources":["../src/workflow-diagram-module.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2024 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
|
+
import { GModelElement, GridSnapper, Point } from '@eclipse-glsp/client';
|
|
17
|
+
export declare class WorkflowSnapper extends GridSnapper {
|
|
18
|
+
snap(position: Point, element: GModelElement): Point;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=workflow-snapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-snapper.d.ts","sourceRoot":"","sources":["../src/workflow-snapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,aAAa,EAAkB,WAAW,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAGzF,qBACa,eAAgB,SAAQ,WAAW;IACnC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,GAAG,KAAK;CAOhE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2024 EclipseSource and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
*
|
|
9
|
+
* This Source Code may also be made available under the following Secondary
|
|
10
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
* with the GNU Classpath Exception which is available at
|
|
13
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
*
|
|
15
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
|
+
********************************************************************************/
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.WorkflowSnapper = void 0;
|
|
25
|
+
const client_1 = require("@eclipse-glsp/client");
|
|
26
|
+
const inversify_1 = require("inversify");
|
|
27
|
+
let WorkflowSnapper = class WorkflowSnapper extends client_1.GridSnapper {
|
|
28
|
+
snap(position, element) {
|
|
29
|
+
// we snap our edges to the center of the elements and our elements to the grid,
|
|
30
|
+
// so to allow for nicer angles and more fine-grained control, we allow routing points to be snapped half-grid
|
|
31
|
+
return element instanceof client_1.GRoutingHandle
|
|
32
|
+
? client_1.Point.snapToGrid(position, client_1.Point.divideScalar(this.grid, 2))
|
|
33
|
+
: super.snap(position, element);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
exports.WorkflowSnapper = WorkflowSnapper;
|
|
37
|
+
exports.WorkflowSnapper = WorkflowSnapper = __decorate([
|
|
38
|
+
(0, inversify_1.injectable)()
|
|
39
|
+
], WorkflowSnapper);
|
|
40
|
+
//# sourceMappingURL=workflow-snapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-snapper.js","sourceRoot":"","sources":["../src/workflow-snapper.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;AAElF,iDAAyF;AACzF,yCAAuC;AAGhC,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,oBAAW;IACnC,IAAI,CAAC,QAAe,EAAE,OAAsB;QACjD,gFAAgF;QAChF,8GAA8G;QAC9G,OAAO,OAAO,YAAY,uBAAc;YACpC,CAAC,CAAC,cAAK,CAAC,UAAU,CAAC,QAAQ,EAAE,cAAK,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YAC9D,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;CACJ,CAAA;AARY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,sBAAU,GAAE;GACA,eAAe,CAQ3B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2024 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
|
+
import { GridManager, IDiagramStartup } from '@eclipse-glsp/client';
|
|
17
|
+
import { MaybePromise } from '@eclipse-glsp/sprotty';
|
|
18
|
+
export declare class WorkflowStartup implements IDiagramStartup {
|
|
19
|
+
rank: number;
|
|
20
|
+
protected gridManager?: GridManager;
|
|
21
|
+
preRequestModel(): MaybePromise<void>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=workflow-startup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-startup.d.ts","sourceRoot":"","sources":["../src/workflow-startup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAS,MAAM,uBAAuB,CAAC;AAG5D,qBACa,eAAgB,YAAW,eAAe;IACnD,IAAI,SAAM;IAE8B,SAAS,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;IAE5E,eAAe,IAAI,YAAY,CAAC,IAAI,CAAC;CAGxC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2024 EclipseSource and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
*
|
|
9
|
+
* This Source Code may also be made available under the following Secondary
|
|
10
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
* with the GNU Classpath Exception which is available at
|
|
13
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
*
|
|
15
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
|
+
********************************************************************************/
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.WorkflowStartup = void 0;
|
|
28
|
+
const client_1 = require("@eclipse-glsp/client");
|
|
29
|
+
const sprotty_1 = require("@eclipse-glsp/sprotty");
|
|
30
|
+
const inversify_1 = require("inversify");
|
|
31
|
+
let WorkflowStartup = class WorkflowStartup {
|
|
32
|
+
constructor() {
|
|
33
|
+
this.rank = -1;
|
|
34
|
+
}
|
|
35
|
+
preRequestModel() {
|
|
36
|
+
var _a;
|
|
37
|
+
(_a = this.gridManager) === null || _a === void 0 ? void 0 : _a.setGridVisible(true);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.WorkflowStartup = WorkflowStartup;
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, inversify_1.inject)(sprotty_1.TYPES.IGridManager),
|
|
43
|
+
(0, inversify_1.optional)(),
|
|
44
|
+
__metadata("design:type", client_1.GridManager)
|
|
45
|
+
], WorkflowStartup.prototype, "gridManager", void 0);
|
|
46
|
+
exports.WorkflowStartup = WorkflowStartup = __decorate([
|
|
47
|
+
(0, inversify_1.injectable)()
|
|
48
|
+
], WorkflowStartup);
|
|
49
|
+
//# sourceMappingURL=workflow-startup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-startup.js","sourceRoot":"","sources":["../src/workflow-startup.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAElF,iDAAoE;AACpE,mDAA4D;AAC5D,yCAAyD;AAGlD,IAAM,eAAe,GAArB,MAAM,eAAe;IAArB;QACH,SAAI,GAAG,CAAC,CAAC,CAAC;IAOd,CAAC;IAHG,eAAe;;QACX,MAAA,IAAI,CAAC,WAAW,0CAAE,cAAc,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;CACJ,CAAA;AARY,0CAAe;AAG0B;IAAjD,IAAA,kBAAM,EAAC,eAAK,CAAC,YAAY,CAAC;IAAE,IAAA,oBAAQ,GAAE;8BAAyB,oBAAW;oDAAC;0BAHnE,eAAe;IAD3B,IAAA,sBAAU,GAAE;GACA,eAAe,CAQ3B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-glsp-examples/workflow-glsp",
|
|
3
|
-
"version": "2.2.0-next.
|
|
3
|
+
"version": "2.2.0-next.333+50b1e85",
|
|
4
4
|
"description": "GLSP diagrams for the Workflow DSL",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"glsp",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"watch": "tsc -w"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@eclipse-glsp/client": "2.2.0-next.
|
|
43
|
+
"@eclipse-glsp/client": "2.2.0-next.333+50b1e85",
|
|
44
44
|
"balloon-css": "^0.5.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "50b1e85e8d2acf2fc73a2280dcb0151d617e0286"
|
|
53
53
|
}
|
package/src/index.ts
CHANGED
|
@@ -27,11 +27,8 @@ import {
|
|
|
27
27
|
GLSPProjectionView,
|
|
28
28
|
GLabel,
|
|
29
29
|
GLabelView,
|
|
30
|
-
GridSnapper,
|
|
31
30
|
IHelperLineOptions,
|
|
32
|
-
ISnapper,
|
|
33
31
|
LogLevel,
|
|
34
|
-
Point,
|
|
35
32
|
RectangularNodeView,
|
|
36
33
|
RevealNamedElementActionProvider,
|
|
37
34
|
RoundedCornerNodeView,
|
|
@@ -41,7 +38,9 @@ import {
|
|
|
41
38
|
bindOrRebind,
|
|
42
39
|
configureDefaultModelElements,
|
|
43
40
|
configureModelElement,
|
|
41
|
+
debugModule,
|
|
44
42
|
editLabelFeature,
|
|
43
|
+
gridModule,
|
|
45
44
|
helperLineModule,
|
|
46
45
|
initializeDiagramContainer
|
|
47
46
|
} from '@eclipse-glsp/client';
|
|
@@ -51,6 +50,8 @@ import 'sprotty/css/edit-label.css';
|
|
|
51
50
|
import '../css/diagram.css';
|
|
52
51
|
import { directTaskEditor } from './direct-task-editing/di.config';
|
|
53
52
|
import { ActivityNode, CategoryNode, Icon, TaskNode, WeightedEdge } from './model';
|
|
53
|
+
import { WorkflowSnapper } from './workflow-snapper';
|
|
54
|
+
import { WorkflowStartup } from './workflow-startup';
|
|
54
55
|
import { IconView, WorkflowEdgeView } from './workflow-views';
|
|
55
56
|
|
|
56
57
|
export const workflowDiagramModule = new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
@@ -58,7 +59,6 @@ export const workflowDiagramModule = new ContainerModule((bind, unbind, isBound,
|
|
|
58
59
|
|
|
59
60
|
bindOrRebind(context, TYPES.ILogger).to(ConsoleLogger).inSingletonScope();
|
|
60
61
|
bindOrRebind(context, TYPES.LogLevel).toConstantValue(LogLevel.warn);
|
|
61
|
-
bind(TYPES.ISnapper).to(GridSnapper);
|
|
62
62
|
bindAsService(context, TYPES.ICommandPaletteActionProvider, RevealNamedElementActionProvider);
|
|
63
63
|
bindAsService(context, TYPES.IContextMenuItemProvider, DeleteElementContextMenuItemProvider);
|
|
64
64
|
|
|
@@ -82,16 +82,14 @@ export const workflowDiagramModule = new ContainerModule((bind, unbind, isBound,
|
|
|
82
82
|
|
|
83
83
|
bind<IHelperLineOptions>(TYPES.IHelperLineOptions).toDynamicValue(ctx => {
|
|
84
84
|
const options: IHelperLineOptions = {};
|
|
85
|
-
// the user needs to use twice the force (double the distance) to break through a helper line compared to moving on the grid
|
|
86
|
-
const snapper = ctx.container.get<ISnapper>(TYPES.ISnapper);
|
|
87
|
-
if (snapper instanceof GridSnapper) {
|
|
88
|
-
options.minimumMoveDelta = Point.multiplyScalar(snapper.grid, 2);
|
|
89
|
-
}
|
|
90
85
|
// skip icons for alignment as well as compartments which are only used for structure
|
|
91
86
|
options.alignmentElementFilter = element =>
|
|
92
87
|
DEFAULT_ALIGNABLE_ELEMENT_FILTER(element) && !(element instanceof Icon) && !(element instanceof GCompartment);
|
|
93
88
|
return options;
|
|
94
89
|
});
|
|
90
|
+
|
|
91
|
+
bindAsService(context, TYPES.IDiagramStartup, WorkflowStartup);
|
|
92
|
+
bindOrRebind(context, TYPES.ISnapper).to(WorkflowSnapper);
|
|
95
93
|
});
|
|
96
94
|
|
|
97
95
|
export function createWorkflowDiagramContainer(...containerConfiguration: ContainerConfiguration): Container {
|
|
@@ -99,5 +97,13 @@ export function createWorkflowDiagramContainer(...containerConfiguration: Contai
|
|
|
99
97
|
}
|
|
100
98
|
|
|
101
99
|
export function initializeWorkflowDiagramContainer(container: Container, ...containerConfiguration: ContainerConfiguration): Container {
|
|
102
|
-
return initializeDiagramContainer(
|
|
100
|
+
return initializeDiagramContainer(
|
|
101
|
+
container,
|
|
102
|
+
directTaskEditor,
|
|
103
|
+
helperLineModule,
|
|
104
|
+
gridModule,
|
|
105
|
+
debugModule,
|
|
106
|
+
workflowDiagramModule,
|
|
107
|
+
...containerConfiguration
|
|
108
|
+
);
|
|
103
109
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2024 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
|
+
|
|
17
|
+
import { GModelElement, GRoutingHandle, GridSnapper, Point } from '@eclipse-glsp/client';
|
|
18
|
+
import { injectable } from 'inversify';
|
|
19
|
+
|
|
20
|
+
@injectable()
|
|
21
|
+
export class WorkflowSnapper extends GridSnapper {
|
|
22
|
+
override snap(position: Point, element: GModelElement): Point {
|
|
23
|
+
// we snap our edges to the center of the elements and our elements to the grid,
|
|
24
|
+
// so to allow for nicer angles and more fine-grained control, we allow routing points to be snapped half-grid
|
|
25
|
+
return element instanceof GRoutingHandle
|
|
26
|
+
? Point.snapToGrid(position, Point.divideScalar(this.grid, 2))
|
|
27
|
+
: super.snap(position, element);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2024 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
|
+
|
|
17
|
+
import { GridManager, IDiagramStartup } from '@eclipse-glsp/client';
|
|
18
|
+
import { MaybePromise, TYPES } from '@eclipse-glsp/sprotty';
|
|
19
|
+
import { inject, injectable, optional } from 'inversify';
|
|
20
|
+
|
|
21
|
+
@injectable()
|
|
22
|
+
export class WorkflowStartup implements IDiagramStartup {
|
|
23
|
+
rank = -1;
|
|
24
|
+
|
|
25
|
+
@inject(TYPES.IGridManager) @optional() protected gridManager?: GridManager;
|
|
26
|
+
|
|
27
|
+
preRequestModel(): MaybePromise<void> {
|
|
28
|
+
this.gridManager?.setGridVisible(true);
|
|
29
|
+
}
|
|
30
|
+
}
|