@eclipse-glsp-examples/workflow-glsp 0.9.0-next.9ac2fc1e
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/LICENSE +277 -0
- package/README.md +14 -0
- package/css/diagram.css +203 -0
- package/lib/di.config.d.ts +21 -0
- package/lib/di.config.d.ts.map +1 -0
- package/lib/di.config.js +59 -0
- package/lib/di.config.js.map +1 -0
- package/lib/direct-task-editing/di.config.d.ts +18 -0
- package/lib/direct-task-editing/di.config.d.ts.map +1 -0
- package/lib/direct-task-editing/di.config.js +26 -0
- package/lib/direct-task-editing/di.config.js.map +1 -0
- package/lib/direct-task-editing/direct-task-editor.d.ts +53 -0
- package/lib/direct-task-editing/direct-task-editor.d.ts.map +1 -0
- package/lib/direct-task-editing/direct-task-editor.js +142 -0
- package/lib/direct-task-editing/direct-task-editor.js.map +1 -0
- package/lib/index.d.ts +21 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +34 -0
- package/lib/index.js.map +1 -0
- package/lib/model.d.ts +59 -0
- package/lib/model.d.ts.map +1 -0
- package/lib/model.js +92 -0
- package/lib/model.js.map +1 -0
- package/lib/workflow-views.d.ts +26 -0
- package/lib/workflow-views.d.ts.map +1 -0
- package/lib/workflow-views.js +59 -0
- package/lib/workflow-views.js.map +1 -0
- package/package.json +56 -0
- package/scripts/download.ts +32 -0
- package/src/di.config.ts +152 -0
- package/src/direct-task-editing/di.config.ts +24 -0
- package/src/direct-task-editing/direct-task-editor.ts +162 -0
- package/src/index.ts +21 -0
- package/src/model.ts +111 -0
- package/src/workflow-views.tsx +70 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2020-2021 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 { AbstractUIExtension, Action, AutoCompleteWidget, EditorContextService, GLSPActionDispatcher, ILogger, LabeledAction, SModelRoot, ValidationStatus, ViewerOptions } from '@eclipse-glsp/client';
|
|
17
|
+
import { DOMHelper } from 'sprotty/lib/base/views/dom-helper';
|
|
18
|
+
import { TaskNode } from '../model';
|
|
19
|
+
export declare class ApplyTaskEditOperation implements Action {
|
|
20
|
+
readonly taskId: string;
|
|
21
|
+
readonly expression: string;
|
|
22
|
+
static readonly KIND = "applyTaskEdit";
|
|
23
|
+
readonly kind = "applyTaskEdit";
|
|
24
|
+
constructor(taskId: string, expression: string);
|
|
25
|
+
}
|
|
26
|
+
export declare class TaskEditor extends AbstractUIExtension {
|
|
27
|
+
static readonly ID = "task-editor";
|
|
28
|
+
readonly autoSuggestionSettings: {
|
|
29
|
+
noSuggestionsMessage: string;
|
|
30
|
+
suggestionsClass: string;
|
|
31
|
+
debounceWaitMs: number;
|
|
32
|
+
showOnFocus: boolean;
|
|
33
|
+
};
|
|
34
|
+
protected actionDispatcher: GLSPActionDispatcher;
|
|
35
|
+
protected editorContextService: EditorContextService;
|
|
36
|
+
protected viewerOptions: ViewerOptions;
|
|
37
|
+
protected domHelper: DOMHelper;
|
|
38
|
+
protected logger: ILogger;
|
|
39
|
+
protected task: TaskNode;
|
|
40
|
+
protected autoSuggestion: AutoCompleteWidget;
|
|
41
|
+
id(): string;
|
|
42
|
+
containerClass(): string;
|
|
43
|
+
protected initializeContents(containerElement: HTMLElement): void;
|
|
44
|
+
show(root: Readonly<SModelRoot>, ...contextElementIds: string[]): void;
|
|
45
|
+
protected onBeforeShow(containerElement: HTMLElement, root: Readonly<SModelRoot>, ...contextElementIds: string[]): void;
|
|
46
|
+
protected setPosition(containerElement: HTMLElement): void;
|
|
47
|
+
protected retrieveSuggestions(input: string): Promise<LabeledAction[]>;
|
|
48
|
+
protected validateInput(input: string): Promise<ValidationStatus>;
|
|
49
|
+
protected executeFromSuggestion(input: LabeledAction | Action[] | Action): void;
|
|
50
|
+
protected executeFromTextOnlyInput(input: string): void;
|
|
51
|
+
hide(): void;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=direct-task-editor.d.ts.map
|
|
@@ -0,0 +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,EACpB,OAAO,EAGP,aAAa,EAIb,UAAU,EAGV,gBAAgB,EAChB,aAAa,EAChB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAE9D,OAAO,EAAc,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEhD,qBAAa,sBAAuB,YAAW,MAAM;IAGrC,QAAQ,CAAC,MAAM,EAAE,MAAM;IAAE,QAAQ,CAAC,UAAU,EAAE,MAAM;IAFhE,MAAM,CAAC,QAAQ,CAAC,IAAI,mBAAmB;IACvC,QAAQ,CAAC,IAAI,mBAA+B;gBACvB,MAAM,EAAE,MAAM,EAAW,UAAU,EAAE,MAAM;CACnE;AAED,qBACa,UAAW,SAAQ,mBAAmB;IAC/C,MAAM,CAAC,QAAQ,CAAC,EAAE,iBAAiB;IACnC,QAAQ,CAAC,sBAAsB;;;;;MAK7B;IAGF,SAAS,CAAC,gBAAgB,EAAE,oBAAoB,CAAC;IAGjD,SAAS,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAGrD,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IAGvC,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC;IAG/B,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC;IAE1B,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC;IACzB,SAAS,CAAC,cAAc,EAAE,kBAAkB,CAAC;IAE7C,EAAE,IAAI,MAAM;IAGZ,cAAc,IAAI,MAAM;IAIxB,SAAS,CAAC,kBAAkB,CAAC,gBAAgB,EAAE,WAAW,GAAG,IAAI;IAkBjE,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,GAAG,iBAAiB,EAAE,MAAM,EAAE,GAAG,IAAI;IAKtE,SAAS,CAAC,YAAY,CAAC,gBAAgB,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,GAAG,iBAAiB,EAAE,MAAM,EAAE,GAAG,IAAI;IAMvH,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;IAQvE,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;IAKvD,IAAI,IAAI,IAAI;CAIf"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var TaskEditor_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.TaskEditor = exports.ApplyTaskEditOperation = void 0;
|
|
14
|
+
/********************************************************************************
|
|
15
|
+
* Copyright (c) 2020-2021 EclipseSource and others.
|
|
16
|
+
*
|
|
17
|
+
* This program and the accompanying materials are made available under the
|
|
18
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
19
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
20
|
+
*
|
|
21
|
+
* This Source Code may also be made available under the following Secondary
|
|
22
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
23
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
24
|
+
* with the GNU Classpath Exception which is available at
|
|
25
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
26
|
+
*
|
|
27
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
28
|
+
********************************************************************************/
|
|
29
|
+
const client_1 = require("@eclipse-glsp/client");
|
|
30
|
+
const inversify_1 = require("inversify");
|
|
31
|
+
const lib_1 = require("sprotty/lib");
|
|
32
|
+
const dom_helper_1 = require("sprotty/lib/base/views/dom-helper");
|
|
33
|
+
const model_1 = require("../model");
|
|
34
|
+
class ApplyTaskEditOperation {
|
|
35
|
+
constructor(taskId, expression) {
|
|
36
|
+
this.taskId = taskId;
|
|
37
|
+
this.expression = expression;
|
|
38
|
+
this.kind = ApplyTaskEditOperation.KIND;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.ApplyTaskEditOperation = ApplyTaskEditOperation;
|
|
42
|
+
ApplyTaskEditOperation.KIND = 'applyTaskEdit';
|
|
43
|
+
let TaskEditor = TaskEditor_1 = class TaskEditor extends client_1.AbstractUIExtension {
|
|
44
|
+
constructor() {
|
|
45
|
+
super(...arguments);
|
|
46
|
+
this.autoSuggestionSettings = {
|
|
47
|
+
noSuggestionsMessage: 'No suggestions available',
|
|
48
|
+
suggestionsClass: 'command-palette-suggestions',
|
|
49
|
+
debounceWaitMs: 50,
|
|
50
|
+
showOnFocus: true
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
id() {
|
|
54
|
+
return TaskEditor_1.ID;
|
|
55
|
+
}
|
|
56
|
+
containerClass() {
|
|
57
|
+
return 'command-palette';
|
|
58
|
+
}
|
|
59
|
+
initializeContents(containerElement) {
|
|
60
|
+
this.autoSuggestion = new client_1.AutoCompleteWidget(this.autoSuggestionSettings, { provideSuggestions: input => this.retrieveSuggestions(input) }, { executeFromSuggestion: input => this.executeFromSuggestion(input) }, () => this.hide(), this.logger);
|
|
61
|
+
this.autoSuggestion.configureValidation({ validate: input => this.validateInput(input) }, new client_1.ValidationDecorator(containerElement));
|
|
62
|
+
this.autoSuggestion.configureTextSubmitHandler({
|
|
63
|
+
executeFromTextOnlyInput: (input) => this.executeFromTextOnlyInput(input)
|
|
64
|
+
});
|
|
65
|
+
this.autoSuggestion.initialize(containerElement);
|
|
66
|
+
}
|
|
67
|
+
show(root, ...contextElementIds) {
|
|
68
|
+
super.show(root, ...contextElementIds);
|
|
69
|
+
this.autoSuggestion.open(root);
|
|
70
|
+
}
|
|
71
|
+
onBeforeShow(containerElement, root, ...contextElementIds) {
|
|
72
|
+
this.task = getTask(contextElementIds, root)[0];
|
|
73
|
+
this.autoSuggestion.inputField.value = '';
|
|
74
|
+
this.setPosition(containerElement);
|
|
75
|
+
}
|
|
76
|
+
setPosition(containerElement) {
|
|
77
|
+
let x = 0;
|
|
78
|
+
let y = 0;
|
|
79
|
+
if (this.task) {
|
|
80
|
+
const bounds = client_1.getAbsoluteClientBounds(this.task, this.domHelper, this.viewerOptions);
|
|
81
|
+
x = bounds.x + 5;
|
|
82
|
+
y = bounds.y + 5;
|
|
83
|
+
}
|
|
84
|
+
containerElement.style.left = `${x}px`;
|
|
85
|
+
containerElement.style.top = `${y}px`;
|
|
86
|
+
containerElement.style.width = '200px';
|
|
87
|
+
}
|
|
88
|
+
async retrieveSuggestions(input) {
|
|
89
|
+
const response = await this.actionDispatcher.request(new client_1.RequestContextActions(TaskEditor_1.ID, this.editorContextService.get({ ['text']: input })));
|
|
90
|
+
if (client_1.isSetContextActionsAction(response)) {
|
|
91
|
+
return response.actions;
|
|
92
|
+
}
|
|
93
|
+
return Promise.reject();
|
|
94
|
+
}
|
|
95
|
+
async validateInput(input) {
|
|
96
|
+
const response = await this.actionDispatcher.request(new client_1.RequestEditValidationAction(TaskEditor_1.ID, this.task.id, input));
|
|
97
|
+
if (client_1.isSetEditValidationResultAction(response)) {
|
|
98
|
+
return response.status;
|
|
99
|
+
}
|
|
100
|
+
return Promise.reject();
|
|
101
|
+
}
|
|
102
|
+
executeFromSuggestion(input) {
|
|
103
|
+
this.actionDispatcher.dispatchAll(client_1.toActionArray(input));
|
|
104
|
+
}
|
|
105
|
+
executeFromTextOnlyInput(input) {
|
|
106
|
+
const action = new ApplyTaskEditOperation(this.task.id, input);
|
|
107
|
+
this.actionDispatcher.dispatch(action);
|
|
108
|
+
}
|
|
109
|
+
hide() {
|
|
110
|
+
this.autoSuggestion.dispose();
|
|
111
|
+
super.hide();
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
TaskEditor.ID = 'task-editor';
|
|
115
|
+
__decorate([
|
|
116
|
+
inversify_1.inject(lib_1.TYPES.IActionDispatcher),
|
|
117
|
+
__metadata("design:type", client_1.GLSPActionDispatcher)
|
|
118
|
+
], TaskEditor.prototype, "actionDispatcher", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
inversify_1.inject(client_1.EditorContextService),
|
|
121
|
+
__metadata("design:type", client_1.EditorContextService)
|
|
122
|
+
], TaskEditor.prototype, "editorContextService", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
inversify_1.inject(lib_1.TYPES.ViewerOptions),
|
|
125
|
+
__metadata("design:type", Object)
|
|
126
|
+
], TaskEditor.prototype, "viewerOptions", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
inversify_1.inject(lib_1.TYPES.DOMHelper),
|
|
129
|
+
__metadata("design:type", dom_helper_1.DOMHelper)
|
|
130
|
+
], TaskEditor.prototype, "domHelper", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
inversify_1.inject(lib_1.TYPES.ILogger),
|
|
133
|
+
__metadata("design:type", Object)
|
|
134
|
+
], TaskEditor.prototype, "logger", void 0);
|
|
135
|
+
TaskEditor = TaskEditor_1 = __decorate([
|
|
136
|
+
inversify_1.injectable()
|
|
137
|
+
], TaskEditor);
|
|
138
|
+
exports.TaskEditor = TaskEditor;
|
|
139
|
+
function getTask(ids, element) {
|
|
140
|
+
return ids.map(id => element.index.getById(id)).filter(model_1.isTaskNode);
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=direct-task-editor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"direct-task-editor.js","sourceRoot":"","sources":["../../src/direct-task-editing/direct-task-editor.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAmB8B;AAC9B,yCAA+C;AAC/C,qCAAoC;AACpC,kEAA8D;AAE9D,oCAAgD;AAEhD,MAAa,sBAAsB;IAG/B,YAAqB,MAAc,EAAW,UAAkB;QAA3C,WAAM,GAAN,MAAM,CAAQ;QAAW,eAAU,GAAV,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;IADC,kBAAM,CAAC,WAAK,CAAC,SAAS,CAAC;8BACH,sBAAS;6CAAC;AAG/B;IADC,kBAAM,CAAC,WAAK,CAAC,OAAO,CAAC;;0CACI;AAtBjB,UAAU;IADtB,sBAAU,EAAE;GACA,UAAU,CA6GtB;AA7GY,gCAAU;AA+GvB,SAAS,OAAO,CAAC,GAAa,EAAE,OAAsB;IAClD,OAAO,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,kBAAU,CAAC,CAAC;AACvE,CAAC"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2019-2021 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 createWorkflowDiagramContainer from './di.config';
|
|
17
|
+
export * from './model';
|
|
18
|
+
export * from './workflow-views';
|
|
19
|
+
export * from './direct-task-editing/direct-task-editor';
|
|
20
|
+
export { createWorkflowDiagramContainer };
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,8BAA8B,MAAM,aAAa,CAAC;AAEzD,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,0CAA0C,CAAC;AACzD,OAAO,EAAE,8BAA8B,EAAE,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.createWorkflowDiagramContainer = void 0;
|
|
14
|
+
/********************************************************************************
|
|
15
|
+
* Copyright (c) 2019-2021 EclipseSource and others.
|
|
16
|
+
*
|
|
17
|
+
* This program and the accompanying materials are made available under the
|
|
18
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
19
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
20
|
+
*
|
|
21
|
+
* This Source Code may also be made available under the following Secondary
|
|
22
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
23
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
24
|
+
* with the GNU Classpath Exception which is available at
|
|
25
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
26
|
+
*
|
|
27
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
28
|
+
********************************************************************************/
|
|
29
|
+
const di_config_1 = require("./di.config");
|
|
30
|
+
exports.createWorkflowDiagramContainer = di_config_1.default;
|
|
31
|
+
__exportStar(require("./model"), exports);
|
|
32
|
+
__exportStar(require("./workflow-views"), exports);
|
|
33
|
+
__exportStar(require("./direct-task-editing/direct-task-editor"), exports);
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,2CAAyD;AAKhD,yCALF,mBAA8B,CAKE;AAHvC,0CAAwB;AACxB,mDAAiC;AACjC,2EAAyD"}
|
package/lib/model.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2020-2021 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 { DiamondNode, EditableLabel, LayoutContainer, Nameable, RectangularNode, SChildElement, SEdge, SModelElement, SShapeElement, WithEditableLabel } from '@eclipse-glsp/client';
|
|
17
|
+
export declare class TaskNode extends RectangularNode implements Nameable, WithEditableLabel {
|
|
18
|
+
static readonly DEFAULT_FEATURES: symbol[];
|
|
19
|
+
name: string;
|
|
20
|
+
duration?: number;
|
|
21
|
+
taskType?: string;
|
|
22
|
+
reference?: string;
|
|
23
|
+
get editableLabel(): (SChildElement & EditableLabel) | undefined;
|
|
24
|
+
}
|
|
25
|
+
export declare function isTaskNode(element: SModelElement): element is TaskNode;
|
|
26
|
+
export declare class WeightedEdge extends SEdge {
|
|
27
|
+
probability?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare class ActivityNode extends DiamondNode {
|
|
30
|
+
nodeType: string;
|
|
31
|
+
size: {
|
|
32
|
+
width: number;
|
|
33
|
+
height: number;
|
|
34
|
+
};
|
|
35
|
+
strokeWidth: number;
|
|
36
|
+
}
|
|
37
|
+
export declare namespace ActivityNode {
|
|
38
|
+
namespace Type {
|
|
39
|
+
const INITIAL = "initalNode";
|
|
40
|
+
const FINAL = "finalNode";
|
|
41
|
+
const DECISION = "decisionNode";
|
|
42
|
+
const MERGE = "mergeNode";
|
|
43
|
+
const JOIN = "joinNode";
|
|
44
|
+
const FORK = "forkNode";
|
|
45
|
+
const UNDEFINED = "undefined";
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export declare class Icon extends SShapeElement implements LayoutContainer {
|
|
49
|
+
static readonly DEFAULT_FEATURES: symbol[];
|
|
50
|
+
layout: string;
|
|
51
|
+
layoutOptions?: {
|
|
52
|
+
[key: string]: string | number | boolean;
|
|
53
|
+
};
|
|
54
|
+
size: {
|
|
55
|
+
width: number;
|
|
56
|
+
height: number;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +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,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esModule", { value: true });
|
|
3
|
+
exports.Icon = exports.ActivityNode = exports.WeightedEdge = exports.isTaskNode = exports.TaskNode = void 0;
|
|
4
|
+
/********************************************************************************
|
|
5
|
+
* Copyright (c) 2020-2021 EclipseSource and others.
|
|
6
|
+
*
|
|
7
|
+
* This program and the accompanying materials are made available under the
|
|
8
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
9
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
10
|
+
*
|
|
11
|
+
* This Source Code may also be made available under the following Secondary
|
|
12
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
13
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
14
|
+
* with the GNU Classpath Exception which is available at
|
|
15
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
16
|
+
*
|
|
17
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
18
|
+
********************************************************************************/
|
|
19
|
+
const client_1 = require("@eclipse-glsp/client");
|
|
20
|
+
class TaskNode extends client_1.RectangularNode {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.name = '';
|
|
24
|
+
}
|
|
25
|
+
get editableLabel() {
|
|
26
|
+
const headerComp = this.children.find(element => element.type === 'comp:header');
|
|
27
|
+
if (headerComp) {
|
|
28
|
+
const label = headerComp.children.find(element => element.type === 'label:heading');
|
|
29
|
+
if (label && client_1.isEditableLabel(label)) {
|
|
30
|
+
return label;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.TaskNode = TaskNode;
|
|
37
|
+
TaskNode.DEFAULT_FEATURES = [
|
|
38
|
+
client_1.connectableFeature,
|
|
39
|
+
client_1.deletableFeature,
|
|
40
|
+
client_1.selectFeature,
|
|
41
|
+
client_1.boundsFeature,
|
|
42
|
+
client_1.moveFeature,
|
|
43
|
+
client_1.layoutContainerFeature,
|
|
44
|
+
client_1.fadeFeature,
|
|
45
|
+
client_1.hoverFeedbackFeature,
|
|
46
|
+
client_1.popupFeature,
|
|
47
|
+
client_1.nameFeature,
|
|
48
|
+
client_1.withEditLabelFeature
|
|
49
|
+
];
|
|
50
|
+
function isTaskNode(element) {
|
|
51
|
+
return element instanceof TaskNode || false;
|
|
52
|
+
}
|
|
53
|
+
exports.isTaskNode = isTaskNode;
|
|
54
|
+
class WeightedEdge extends client_1.SEdge {
|
|
55
|
+
}
|
|
56
|
+
exports.WeightedEdge = WeightedEdge;
|
|
57
|
+
class ActivityNode extends client_1.DiamondNode {
|
|
58
|
+
constructor() {
|
|
59
|
+
super(...arguments);
|
|
60
|
+
this.nodeType = ActivityNode.Type.UNDEFINED;
|
|
61
|
+
this.size = {
|
|
62
|
+
width: 32,
|
|
63
|
+
height: 32
|
|
64
|
+
};
|
|
65
|
+
this.strokeWidth = 1;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.ActivityNode = ActivityNode;
|
|
69
|
+
(function (ActivityNode) {
|
|
70
|
+
let Type;
|
|
71
|
+
(function (Type) {
|
|
72
|
+
Type.INITIAL = 'initalNode';
|
|
73
|
+
Type.FINAL = 'finalNode';
|
|
74
|
+
Type.DECISION = 'decisionNode';
|
|
75
|
+
Type.MERGE = 'mergeNode';
|
|
76
|
+
Type.JOIN = 'joinNode';
|
|
77
|
+
Type.FORK = 'forkNode';
|
|
78
|
+
Type.UNDEFINED = 'undefined';
|
|
79
|
+
})(Type = ActivityNode.Type || (ActivityNode.Type = {}));
|
|
80
|
+
})(ActivityNode = exports.ActivityNode || (exports.ActivityNode = {}));
|
|
81
|
+
class Icon extends client_1.SShapeElement {
|
|
82
|
+
constructor() {
|
|
83
|
+
super(...arguments);
|
|
84
|
+
this.size = {
|
|
85
|
+
width: 32,
|
|
86
|
+
height: 32
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.Icon = Icon;
|
|
91
|
+
Icon.DEFAULT_FEATURES = [client_1.boundsFeature, client_1.layoutContainerFeature, client_1.layoutableChildFeature, client_1.fadeFeature];
|
|
92
|
+
//# sourceMappingURL=model.js.map
|
package/lib/model.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAwB8B;AAE9B,MAAa,QAAS,SAAQ,wBAAe;IAA7C;;QAcI,SAAI,GAAG,EAAE,CAAC;IAed,CAAC;IAVG,IAAI,aAAa;QACb,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC;QACjF,IAAI,UAAU,EAAE;YACZ,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,eAAe,CAAC,CAAC;YACpF,IAAI,KAAK,IAAI,wBAAe,CAAC,KAAK,CAAC,EAAE;gBACjC,OAAO,KAAK,CAAC;aAChB;SACJ;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;;AA5BL,4BA6BC;AA5BmB,yBAAgB,GAAG;IAC/B,2BAAkB;IAClB,yBAAgB;IAChB,sBAAa;IACb,sBAAa;IACb,oBAAW;IACX,+BAAsB;IACtB,oBAAW;IACX,6BAAoB;IACpB,qBAAY;IACZ,oBAAW;IACX,6BAAoB;CACvB,CAAC;AAkBN,SAAgB,UAAU,CAAC,OAAsB;IAC7C,OAAO,OAAO,YAAY,QAAQ,IAAI,KAAK,CAAC;AAChD,CAAC;AAFD,gCAEC;AAED,MAAa,YAAa,SAAQ,cAAK;CAEtC;AAFD,oCAEC;AAED,MAAa,YAAa,SAAQ,oBAAW;IAA7C;;QACI,aAAQ,GAAW,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC;QAC/C,SAAI,GAAG;YACH,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;SACb,CAAC;QACF,gBAAW,GAAG,CAAC,CAAC;IACpB,CAAC;CAAA;AAPD,oCAOC;AAED,WAAiB,YAAY;IACzB,IAAiB,IAAI,CAQpB;IARD,WAAiB,IAAI;QACJ,YAAO,GAAG,YAAY,CAAC;QACvB,UAAK,GAAG,WAAW,CAAC;QACpB,aAAQ,GAAG,cAAc,CAAC;QAC1B,UAAK,GAAG,WAAW,CAAC;QACpB,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;;QAKI,SAAI,GAAG;YACH,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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2019-2021 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 { IView, Point, PolylineEdgeViewWithGapsOnIntersections, RenderingContext, SEdge } from '@eclipse-glsp/client';
|
|
17
|
+
import { VNode } from 'snabbdom';
|
|
18
|
+
import { Icon } from './model';
|
|
19
|
+
export declare class WorkflowEdgeView extends PolylineEdgeViewWithGapsOnIntersections {
|
|
20
|
+
protected renderAdditionals(edge: SEdge, segments: Point[], context: RenderingContext): VNode[];
|
|
21
|
+
}
|
|
22
|
+
export declare class IconView implements IView {
|
|
23
|
+
render(element: Icon, context: RenderingContext): VNode;
|
|
24
|
+
getRadius(): number;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=workflow-views.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-views.d.ts","sourceRoot":"","sources":["../src/workflow-views.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAEH,KAAK,EACL,KAAK,EACL,uCAAuC,EACvC,gBAAgB,EAChB,KAAK,EAER,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAGjC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAK/B,qBACa,gBAAiB,SAAQ,uCAAuC;IACzE,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,gBAAgB,GAAG,KAAK,EAAE;CAiBlG;AAED,qBACa,QAAS,YAAW,KAAK;IAClC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,GAAG,KAAK;IAUvD,SAAS,IAAI,MAAM;CAGtB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.IconView = exports.WorkflowEdgeView = void 0;
|
|
10
|
+
/********************************************************************************
|
|
11
|
+
* Copyright (c) 2019-2021 EclipseSource and others.
|
|
12
|
+
*
|
|
13
|
+
* This program and the accompanying materials are made available under the
|
|
14
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
15
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
16
|
+
*
|
|
17
|
+
* This Source Code may also be made available under the following Secondary
|
|
18
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
19
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
20
|
+
* with the GNU Classpath Exception which is available at
|
|
21
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
22
|
+
*
|
|
23
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
24
|
+
********************************************************************************/
|
|
25
|
+
const client_1 = require("@eclipse-glsp/client");
|
|
26
|
+
const inversify_1 = require("inversify");
|
|
27
|
+
const sprotty_1 = require("sprotty");
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
29
|
+
const JSX = { createElement: sprotty_1.svg };
|
|
30
|
+
let WorkflowEdgeView = class WorkflowEdgeView extends client_1.PolylineEdgeViewWithGapsOnIntersections {
|
|
31
|
+
renderAdditionals(edge, segments, context) {
|
|
32
|
+
const additionals = super.renderAdditionals(edge, segments, context);
|
|
33
|
+
const p1 = segments[segments.length - 2];
|
|
34
|
+
const p2 = segments[segments.length - 1];
|
|
35
|
+
const arrow = (JSX.createElement("path", { "class-sprotty-edge": true, "class-arrow": true, d: 'M 1.5,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})` }));
|
|
36
|
+
additionals.push(arrow);
|
|
37
|
+
return additionals;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
WorkflowEdgeView = __decorate([
|
|
41
|
+
inversify_1.injectable()
|
|
42
|
+
], WorkflowEdgeView);
|
|
43
|
+
exports.WorkflowEdgeView = WorkflowEdgeView;
|
|
44
|
+
let IconView = class IconView {
|
|
45
|
+
render(element, context) {
|
|
46
|
+
const radius = this.getRadius();
|
|
47
|
+
return (JSX.createElement("g", null,
|
|
48
|
+
JSX.createElement("circle", { "class-sprotty-icon": true, r: radius, cx: radius, cy: radius }),
|
|
49
|
+
context.renderChildren(element)));
|
|
50
|
+
}
|
|
51
|
+
getRadius() {
|
|
52
|
+
return 16;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
IconView = __decorate([
|
|
56
|
+
inversify_1.injectable()
|
|
57
|
+
], IconView);
|
|
58
|
+
exports.IconView = IconView;
|
|
59
|
+
//# sourceMappingURL=workflow-views.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-views.js","sourceRoot":"","sources":["../src/workflow-views.tsx"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAQ8B;AAC9B,yCAAuC;AAEvC,qCAA8B;AAI9B,6DAA6D;AAC7D,MAAM,GAAG,GAAG,EAAE,aAAa,EAAE,aAAG,EAAE,CAAC;AAGnC,IAAa,gBAAgB,GAA7B,MAAa,gBAAiB,SAAQ,gDAAuC;IAC/D,iBAAiB,CAAC,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;IADpB,sBAAU,EAAE;GACA,QAAQ,CAcpB;AAdY,4BAAQ"}
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@eclipse-glsp-examples/workflow-glsp",
|
|
3
|
+
"version": "0.9.0-next.9ac2fc1e",
|
|
4
|
+
"description": "GLSP diagrams for the Workflow DSL",
|
|
5
|
+
"license": "(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"glsp",
|
|
8
|
+
"workflow",
|
|
9
|
+
"diagram",
|
|
10
|
+
"example"
|
|
11
|
+
],
|
|
12
|
+
"author": {
|
|
13
|
+
"name": "Eclipse GLSP"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://www.eclipse.org/glsp/",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/eclipse-glsp/glsp-client.git"
|
|
19
|
+
},
|
|
20
|
+
"bugs": "https://github.com/eclipse-glsp/glsp/issues",
|
|
21
|
+
"contributors": [
|
|
22
|
+
{
|
|
23
|
+
"name": "Eclipse GLSP Project",
|
|
24
|
+
"email": "glsp-dev@eclipse.org",
|
|
25
|
+
"url": "https://projects.eclipse.org/projects/ecd.glsp"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@eclipse-glsp/client": "0.9.0-next.9ac2fc1e",
|
|
30
|
+
"balloon-css": "^0.5.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"mvn-artifact-download": "5.1.0",
|
|
34
|
+
"rimraf": "^2.6.1",
|
|
35
|
+
"typescript": "^3.9.2"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"prepare": "yarn clean && yarn build && yarn lint",
|
|
39
|
+
"clean": "rimraf lib",
|
|
40
|
+
"build": "tsc",
|
|
41
|
+
"lint": "eslint -c ./.eslintrc.js --ext .ts,.tsx ./src",
|
|
42
|
+
"watch": "tsc -w"
|
|
43
|
+
},
|
|
44
|
+
"files": [
|
|
45
|
+
"lib",
|
|
46
|
+
"src",
|
|
47
|
+
"build",
|
|
48
|
+
"css",
|
|
49
|
+
"scripts"
|
|
50
|
+
],
|
|
51
|
+
"main": "lib/index",
|
|
52
|
+
"types": "lib/index",
|
|
53
|
+
"publishConfig": {
|
|
54
|
+
"access": "public"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
import download from "mvn-artifact-download";
|
|
17
|
+
import { join, resolve } from "path";
|
|
18
|
+
|
|
19
|
+
const downloadDir = resolve(join(__dirname)) + "/../../..";
|
|
20
|
+
const mavenRepository = "https://oss.sonatype.org/content/repositories/snapshots/";
|
|
21
|
+
const groupId = "org.eclipse.glsp.example";
|
|
22
|
+
const artifactId = "org.eclipse.glsp.example.workflow";
|
|
23
|
+
const version = "0.9.0";
|
|
24
|
+
const classifier = "glsp";
|
|
25
|
+
|
|
26
|
+
console.log("Downloading latest version of the Workflow Example Java Server from the maven repository...");
|
|
27
|
+
download({ groupId, artifactId, version, classifier, isSnapShot: true }, downloadDir, mavenRepository)
|
|
28
|
+
.then(() => console.log("Download completed. Start the server using this command: \njava -jar org.eclipse.glsp.example.workflow-"
|
|
29
|
+
+ version + "-SNAPSHOT-glsp.jar org.eclipse.glsp.example.workflow.launch.ExampleServerLauncher --port=8081 --websocket\n\n"
|
|
30
|
+
+ "After starting the server, access the following file locally in your browser to see the running example:\n"
|
|
31
|
+
+ "./examples/workflow-standalone/app/diagram.html"
|
|
32
|
+
));
|