@eclipse-glsp-examples/workflow-glsp 0.9.0-next.4ef6fe50 → 0.9.0-next.65bdcf24

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.
@@ -1,17 +1,4 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
2
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
16
3
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
17
4
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -21,66 +8,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
21
8
  var __metadata = (this && this.__metadata) || function (k, v) {
22
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
23
10
  };
24
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
25
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
26
- return new (P || (P = Promise))(function (resolve, reject) {
27
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
28
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
29
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
30
- step((generator = generator.apply(thisArg, _arguments || [])).next());
31
- });
32
- };
33
- var __generator = (this && this.__generator) || function (thisArg, body) {
34
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
35
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
36
- function verb(n) { return function (v) { return step([n, v]); }; }
37
- function step(op) {
38
- if (f) throw new TypeError("Generator is already executing.");
39
- while (_) try {
40
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
41
- if (y = 0, t) op = [op[0] & 2, t.value];
42
- switch (op[0]) {
43
- case 0: case 1: t = op; break;
44
- case 4: _.label++; return { value: op[1], done: false };
45
- case 5: _.label++; y = op[1]; op = [0]; continue;
46
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
47
- default:
48
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
49
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
50
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
51
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
52
- if (t[2]) _.ops.pop();
53
- _.trys.pop(); continue;
54
- }
55
- op = body.call(thisArg, _);
56
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
57
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
58
- }
59
- };
60
- var __read = (this && this.__read) || function (o, n) {
61
- var m = typeof Symbol === "function" && o[Symbol.iterator];
62
- if (!m) return o;
63
- var i = m.call(o), r, ar = [], e;
64
- try {
65
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
66
- }
67
- catch (error) { e = { error: error }; }
68
- finally {
69
- try {
70
- if (r && !r.done && (m = i["return"])) m.call(i);
71
- }
72
- finally { if (e) throw e.error; }
73
- }
74
- return ar;
75
- };
76
- var __spread = (this && this.__spread) || function () {
77
- for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
78
- return ar;
79
- };
11
+ var TaskEditor_1;
80
12
  Object.defineProperty(exports, "__esModule", { value: true });
81
13
  exports.TaskEditor = exports.ApplyTaskEditOperation = void 0;
82
14
  /********************************************************************************
83
- * Copyright (c) 2020 EclipseSource and others.
15
+ * Copyright (c) 2020-2021 EclipseSource and others.
84
16
  *
85
17
  * This program and the accompanying materials are made available under the
86
18
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -94,145 +26,117 @@ exports.TaskEditor = exports.ApplyTaskEditOperation = void 0;
94
26
  *
95
27
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
96
28
  ********************************************************************************/
97
- var client_1 = require("@eclipse-glsp/client");
98
- var inversify_1 = require("inversify");
99
- var lib_1 = require("sprotty/lib");
100
- var dom_helper_1 = require("sprotty/lib/base/views/dom-helper");
101
- var model_1 = require("../model");
102
- var ApplyTaskEditOperation = /** @class */ (function () {
103
- function ApplyTaskEditOperation(taskId, expression) {
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) {
104
36
  this.taskId = taskId;
105
37
  this.expression = expression;
106
38
  this.kind = ApplyTaskEditOperation.KIND;
107
39
  }
108
- ApplyTaskEditOperation.KIND = 'applyTaskEdit';
109
- return ApplyTaskEditOperation;
110
- }());
40
+ }
111
41
  exports.ApplyTaskEditOperation = ApplyTaskEditOperation;
112
- var TaskEditor = /** @class */ (function (_super) {
113
- __extends(TaskEditor, _super);
114
- function TaskEditor() {
115
- var _this = _super !== null && _super.apply(this, arguments) || this;
116
- _this.autoSuggestionSettings = {
42
+ ApplyTaskEditOperation.KIND = 'applyTaskEdit';
43
+ let TaskEditor = TaskEditor_1 = class TaskEditor extends client_1.AbstractUIExtension {
44
+ constructor() {
45
+ super(...arguments);
46
+ this.autoSuggestionSettings = {
117
47
  noSuggestionsMessage: 'No suggestions available',
118
48
  suggestionsClass: 'command-palette-suggestions',
119
49
  debounceWaitMs: 50,
120
50
  showOnFocus: true
121
51
  };
122
- return _this;
123
52
  }
124
- TaskEditor_1 = TaskEditor;
125
- TaskEditor.prototype.id = function () { return TaskEditor_1.ID; };
126
- TaskEditor.prototype.containerClass = function () { return 'command-palette'; };
127
- TaskEditor.prototype.initializeContents = function (containerElement) {
128
- var _this = this;
129
- this.autoSuggestion = new client_1.AutoCompleteWidget(this.autoSuggestionSettings, { provideSuggestions: function (input) { return _this.retrieveSuggestions(input); } }, { executeFromSuggestion: function (input) { return _this.executeFromSuggestion(input); } }, function () { return _this.hide(); }, this.logger);
130
- this.autoSuggestion.configureValidation({ validate: function (input) { return _this.validateInput(input); } }, new client_1.ValidationDecorator(containerElement));
131
- this.autoSuggestion.configureTextSubmitHandler({ executeFromTextOnlyInput: function (input) { return _this.executeFromTextOnlyInput(input); } });
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
+ });
132
65
  this.autoSuggestion.initialize(containerElement);
133
- };
134
- TaskEditor.prototype.show = function (root) {
135
- var contextElementIds = [];
136
- for (var _i = 1; _i < arguments.length; _i++) {
137
- contextElementIds[_i - 1] = arguments[_i];
138
- }
139
- _super.prototype.show.apply(this, __spread([root], contextElementIds));
66
+ }
67
+ show(root, ...contextElementIds) {
68
+ super.show(root, ...contextElementIds);
140
69
  this.autoSuggestion.open(root);
141
- };
142
- TaskEditor.prototype.onBeforeShow = function (containerElement, root) {
143
- var contextElementIds = [];
144
- for (var _i = 2; _i < arguments.length; _i++) {
145
- contextElementIds[_i - 2] = arguments[_i];
146
- }
70
+ }
71
+ onBeforeShow(containerElement, root, ...contextElementIds) {
147
72
  this.task = getTask(contextElementIds, root)[0];
148
73
  this.autoSuggestion.inputField.value = '';
149
74
  this.setPosition(containerElement);
150
- };
151
- TaskEditor.prototype.setPosition = function (containerElement) {
152
- var x = 0;
153
- var y = 0;
75
+ }
76
+ setPosition(containerElement) {
77
+ let x = 0;
78
+ let y = 0;
154
79
  if (this.task) {
155
- var bounds = client_1.getAbsoluteClientBounds(this.task, this.domHelper, this.viewerOptions);
80
+ const bounds = client_1.getAbsoluteClientBounds(this.task, this.domHelper, this.viewerOptions);
156
81
  x = bounds.x + 5;
157
82
  y = bounds.y + 5;
158
83
  }
159
- containerElement.style.left = x + "px";
160
- containerElement.style.top = y + "px";
84
+ containerElement.style.left = `${x}px`;
85
+ containerElement.style.top = `${y}px`;
161
86
  containerElement.style.width = '200px';
162
- };
163
- TaskEditor.prototype.retrieveSuggestions = function (input) {
164
- return __awaiter(this, void 0, void 0, function () {
165
- var response;
166
- var _a;
167
- return __generator(this, function (_b) {
168
- switch (_b.label) {
169
- case 0: return [4 /*yield*/, this.actionDispatcher.request(new client_1.RequestContextActions(TaskEditor_1.ID, this.editorContextService.get((_a = {}, _a['text'] = input, _a))))];
170
- case 1:
171
- response = _b.sent();
172
- if (client_1.isSetContextActionsAction(response)) {
173
- return [2 /*return*/, response.actions];
174
- }
175
- return [2 /*return*/, Promise.reject()];
176
- }
177
- });
178
- });
179
- };
180
- TaskEditor.prototype.validateInput = function (input) {
181
- return __awaiter(this, void 0, void 0, function () {
182
- var response;
183
- return __generator(this, function (_a) {
184
- switch (_a.label) {
185
- case 0: return [4 /*yield*/, this.actionDispatcher.request(new client_1.RequestEditValidationAction(TaskEditor_1.ID, this.task.id, input))];
186
- case 1:
187
- response = _a.sent();
188
- if (client_1.isSetEditValidationResultAction(response)) {
189
- return [2 /*return*/, response.status];
190
- }
191
- return [2 /*return*/, Promise.reject()];
192
- }
193
- });
194
- });
195
- };
196
- TaskEditor.prototype.executeFromSuggestion = function (input) {
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) {
197
103
  this.actionDispatcher.dispatchAll(client_1.toActionArray(input));
198
- };
199
- TaskEditor.prototype.executeFromTextOnlyInput = function (input) {
200
- var action = new ApplyTaskEditOperation(this.task.id, input);
104
+ }
105
+ executeFromTextOnlyInput(input) {
106
+ const action = new ApplyTaskEditOperation(this.task.id, input);
201
107
  this.actionDispatcher.dispatch(action);
202
- };
203
- TaskEditor.prototype.hide = function () {
108
+ }
109
+ hide() {
204
110
  this.autoSuggestion.dispose();
205
- _super.prototype.hide.call(this);
206
- };
207
- var TaskEditor_1;
208
- TaskEditor.ID = 'task-editor';
209
- __decorate([
210
- inversify_1.inject(lib_1.TYPES.IActionDispatcher),
211
- __metadata("design:type", client_1.GLSPActionDispatcher)
212
- ], TaskEditor.prototype, "actionDispatcher", void 0);
213
- __decorate([
214
- inversify_1.inject(client_1.EditorContextService),
215
- __metadata("design:type", client_1.EditorContextService)
216
- ], TaskEditor.prototype, "editorContextService", void 0);
217
- __decorate([
218
- inversify_1.inject(lib_1.TYPES.ViewerOptions),
219
- __metadata("design:type", Object)
220
- ], TaskEditor.prototype, "viewerOptions", void 0);
221
- __decorate([
222
- inversify_1.inject(lib_1.TYPES.DOMHelper),
223
- __metadata("design:type", dom_helper_1.DOMHelper)
224
- ], TaskEditor.prototype, "domHelper", void 0);
225
- __decorate([
226
- inversify_1.inject(lib_1.TYPES.ILogger),
227
- __metadata("design:type", Object)
228
- ], TaskEditor.prototype, "logger", void 0);
229
- TaskEditor = TaskEditor_1 = __decorate([
230
- inversify_1.injectable()
231
- ], TaskEditor);
232
- return TaskEditor;
233
- }(client_1.AbstractUIExtension));
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);
234
138
  exports.TaskEditor = TaskEditor;
235
139
  function getTask(ids, element) {
236
- return ids.map(function (id) { return element.index.getById(id); }).filter(model_1.isTaskNode);
140
+ return ids.map(id => element.index.getById(id)).filter(model_1.isTaskNode);
237
141
  }
238
142
  //# 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,+CAmB8B;AAC9B,uCAA+C;AAC/C,mCAAoC;AACpC,gEAA8D;AAE9D,kCAAgD;AAEhD;IAGI,gCAAqB,MAAc,EAAW,UAAkB;QAA3C,WAAM,GAAN,MAAM,CAAQ;QAAW,eAAU,GAAV,UAAU,CAAQ;QADvD,SAAI,GAAG,sBAAsB,CAAC,IAAI,CAAC;IACwB,CAAC;IAFrD,2BAAI,GAAG,eAAe,CAAC;IAG3C,6BAAC;CAAA,AAJD,IAIC;AAJY,wDAAsB;AAOnC;IAAgC,8BAAmB;IAAnD;QAAA,qEAuGC;QApGY,4BAAsB,GAAG;YAC9B,oBAAoB,EAAE,0BAA0B;YAChD,gBAAgB,EAAE,6BAA6B;YAC/C,cAAc,EAAE,EAAE;YAClB,WAAW,EAAE,IAAI;SACpB,CAAC;;IA+FN,CAAC;mBAvGY,UAAU;IA4BnB,uBAAE,GAAF,cAAO,OAAO,YAAU,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9B,mCAAc,GAAd,cAAmB,OAAO,iBAAiB,CAAC,CAAC,CAAC;IAEpC,uCAAkB,GAA5B,UAA6B,gBAA6B;QAA1D,iBAcC;QAbG,IAAI,CAAC,cAAc,GAAG,IAAI,2BAAkB,CACxC,IAAI,CAAC,sBAAsB,EAC3B,EAAE,kBAAkB,EAAE,UAAA,KAAK,IAAI,OAAA,KAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAA/B,CAA+B,EAAE,EAChE,EAAE,qBAAqB,EAAE,UAAA,KAAK,IAAI,OAAA,KAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,EA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A5GmB,aAAE,GAAG,aAAa,CAAC;AASnC;IADC,kBAAM,CAAC,WAAK,CAAC,iBAAiB,CAAC;8BACJ,6BAAoB;oDAAC;AAGjD;IADC,kBAAM,CAAC,6BAAoB,CAAC;8BACG,6BAAoB;wDAAC;AAGrD;IADC,kBAAM,CAAC,WAAK,CAAC,aAAa,CAAC;;iDACW;AAGvC;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 CHANGED
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019 EclipseSource and others.
2
+ * Copyright (c) 2019-2021 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,9 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
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";
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
20
  export { createWorkflowDiagramContainer };
21
21
  //# sourceMappingURL=index.d.ts.map
package/lib/index.js CHANGED
@@ -12,7 +12,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.createWorkflowDiagramContainer = void 0;
14
14
  /********************************************************************************
15
- * Copyright (c) 2019 EclipseSource and others.
15
+ * Copyright (c) 2019-2021 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
@@ -26,7 +26,7 @@ exports.createWorkflowDiagramContainer = void 0;
26
26
  *
27
27
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
28
28
  ********************************************************************************/
29
- var di_config_1 = require("./di.config");
29
+ const di_config_1 = require("./di.config");
30
30
  exports.createWorkflowDiagramContainer = di_config_1.default;
31
31
  __exportStar(require("./model"), exports);
32
32
  __exportStar(require("./workflow-views"), exports);
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,yCAAyD;AAKhD,yCALF,mBAA8B,CAKE;AAHvC,0CAAwB;AACxB,mDAAiC;AACjC,2EAAyD"}
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 CHANGED
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2020 EclipseSource and others.
2
+ * Copyright (c) 2020-2021 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,14 +13,14 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { DiamondNode, LayoutContainer, Nameable, RectangularNode, SEdge, SModelElement, SShapeElement, WithEditableLabel } from "@eclipse-glsp/client";
16
+ import { DiamondNode, EditableLabel, LayoutContainer, Nameable, RectangularNode, SChildElement, SEdge, SModelElement, SShapeElement, WithEditableLabel } from '@eclipse-glsp/client';
17
17
  export declare class TaskNode extends RectangularNode implements Nameable, WithEditableLabel {
18
18
  static readonly DEFAULT_FEATURES: symbol[];
19
19
  name: string;
20
20
  duration?: number;
21
21
  taskType?: string;
22
22
  reference?: string;
23
- get editableLabel(): (import("@eclipse-glsp/client").SChildElement & import("@eclipse-glsp/client").EditableLabel) | undefined;
23
+ get editableLabel(): (SChildElement & EditableLabel) | undefined;
24
24
  }
25
25
  export declare function isTaskNode(element: SModelElement): element is TaskNode;
26
26
  export declare class WeightedEdge extends SEdge {
@@ -56,4 +56,9 @@ export declare class Icon extends SShapeElement implements LayoutContainer {
56
56
  height: number;
57
57
  };
58
58
  }
59
+ export declare class CategoryNode extends RectangularNode implements Nameable, WithEditableLabel {
60
+ static readonly DEFAULT_FEATURES: symbol[];
61
+ name: string;
62
+ get editableLabel(): (SChildElement & EditableLabel) | undefined;
63
+ }
59
64
  //# sourceMappingURL=model.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAIH,WAAW,EAKX,eAAe,EAGf,QAAQ,EAGR,eAAe,EACf,KAAK,EAEL,aAAa,EACb,aAAa,EACb,iBAAiB,EAEpB,MAAM,sBAAsB,CAAC;AAG9B,qBAAa,QAAS,SAAQ,eAAgB,YAAW,QAAQ,EAAE,iBAAiB;IAChF,MAAM,CAAC,QAAQ,CAAC,gBAAgB,WAC6F;IAC7H,IAAI,EAAE,MAAM,CAAM;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,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var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
2
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.Icon = exports.ActivityNode = exports.WeightedEdge = exports.isTaskNode = exports.TaskNode = void 0;
3
+ exports.CategoryNode = exports.Icon = exports.ActivityNode = exports.WeightedEdge = exports.isTaskNode = exports.TaskNode = void 0;
17
4
  /********************************************************************************
18
- * Copyright (c) 2020 EclipseSource and others.
5
+ * Copyright (c) 2020-2021 EclipseSource and others.
19
6
  *
20
7
  * This program and the accompanying materials are made available under the
21
8
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -29,62 +16,58 @@ exports.Icon = exports.ActivityNode = exports.WeightedEdge = exports.isTaskNode
29
16
  *
30
17
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
31
18
  ********************************************************************************/
32
- var client_1 = require("@eclipse-glsp/client");
33
- var TaskNode = /** @class */ (function (_super) {
34
- __extends(TaskNode, _super);
35
- function TaskNode() {
36
- var _this = _super !== null && _super.apply(this, arguments) || this;
37
- _this.name = "";
38
- return _this;
19
+ const client_1 = require("@eclipse-glsp/client");
20
+ class TaskNode extends client_1.RectangularNode {
21
+ constructor() {
22
+ super(...arguments);
23
+ this.name = '';
39
24
  }
40
- Object.defineProperty(TaskNode.prototype, "editableLabel", {
41
- get: function () {
42
- var headerComp = this.children.find(function (element) { return element.type === 'comp:header'; });
43
- if (headerComp) {
44
- var label = headerComp.children.find(function (element) { return element.type === 'label:heading'; });
45
- if (label && client_1.isEditableLabel(label)) {
46
- return label;
47
- }
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;
48
31
  }
49
- return undefined;
50
- },
51
- enumerable: false,
52
- configurable: true
53
- });
54
- TaskNode.DEFAULT_FEATURES = [client_1.connectableFeature, client_1.deletableFeature, client_1.selectFeature, client_1.boundsFeature,
55
- client_1.moveFeature, client_1.layoutContainerFeature, client_1.fadeFeature, client_1.hoverFeedbackFeature, client_1.popupFeature, client_1.nameFeature, client_1.withEditLabelFeature];
56
- return TaskNode;
57
- }(client_1.RectangularNode));
32
+ }
33
+ return undefined;
34
+ }
35
+ }
58
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
+ ];
59
50
  function isTaskNode(element) {
60
51
  return element instanceof TaskNode || false;
61
52
  }
62
53
  exports.isTaskNode = isTaskNode;
63
- var WeightedEdge = /** @class */ (function (_super) {
64
- __extends(WeightedEdge, _super);
65
- function WeightedEdge() {
66
- return _super !== null && _super.apply(this, arguments) || this;
67
- }
68
- return WeightedEdge;
69
- }(client_1.SEdge));
54
+ class WeightedEdge extends client_1.SEdge {
55
+ }
70
56
  exports.WeightedEdge = WeightedEdge;
71
- var ActivityNode = /** @class */ (function (_super) {
72
- __extends(ActivityNode, _super);
73
- function ActivityNode() {
74
- var _this = _super !== null && _super.apply(this, arguments) || this;
75
- _this.nodeType = ActivityNode.Type.UNDEFINED;
76
- _this.size = {
57
+ class ActivityNode extends client_1.DiamondNode {
58
+ constructor() {
59
+ super(...arguments);
60
+ this.nodeType = ActivityNode.Type.UNDEFINED;
61
+ this.size = {
77
62
  width: 32,
78
63
  height: 32
79
64
  };
80
- _this.strokeWidth = 1;
81
- return _this;
65
+ this.strokeWidth = 1;
82
66
  }
83
- return ActivityNode;
84
- }(client_1.DiamondNode));
67
+ }
85
68
  exports.ActivityNode = ActivityNode;
86
69
  (function (ActivityNode) {
87
- var Type;
70
+ let Type;
88
71
  (function (Type) {
89
72
  Type.INITIAL = 'initalNode';
90
73
  Type.FINAL = 'finalNode';
@@ -92,22 +75,44 @@ exports.ActivityNode = ActivityNode;
92
75
  Type.MERGE = 'mergeNode';
93
76
  Type.JOIN = 'joinNode';
94
77
  Type.FORK = 'forkNode';
95
- Type.UNDEFINED = "undefined";
78
+ Type.UNDEFINED = 'undefined';
96
79
  })(Type = ActivityNode.Type || (ActivityNode.Type = {}));
97
80
  })(ActivityNode = exports.ActivityNode || (exports.ActivityNode = {}));
98
- exports.ActivityNode = ActivityNode;
99
- var Icon = /** @class */ (function (_super) {
100
- __extends(Icon, _super);
101
- function Icon() {
102
- var _this = _super !== null && _super.apply(this, arguments) || this;
103
- _this.size = {
81
+ class Icon extends client_1.SShapeElement {
82
+ constructor() {
83
+ super(...arguments);
84
+ this.size = {
104
85
  width: 32,
105
86
  height: 32
106
87
  };
107
- return _this;
108
88
  }
109
- Icon.DEFAULT_FEATURES = [client_1.boundsFeature, client_1.layoutContainerFeature, client_1.layoutableChildFeature, client_1.fadeFeature];
110
- return Icon;
111
- }(client_1.SShapeElement));
89
+ }
112
90
  exports.Icon = Icon;
91
+ Icon.DEFAULT_FEATURES = [client_1.boundsFeature, client_1.layoutContainerFeature, client_1.layoutableChildFeature, client_1.fadeFeature];
92
+ class CategoryNode extends client_1.RectangularNode {
93
+ constructor() {
94
+ super(...arguments);
95
+ this.name = '';
96
+ }
97
+ get editableLabel() {
98
+ const label = this.children.find(element => element.type === 'label:heading');
99
+ if (label && client_1.isEditableLabel(label)) {
100
+ return label;
101
+ }
102
+ return undefined;
103
+ }
104
+ }
105
+ exports.CategoryNode = CategoryNode;
106
+ CategoryNode.DEFAULT_FEATURES = [
107
+ client_1.deletableFeature,
108
+ client_1.selectFeature,
109
+ client_1.boundsFeature,
110
+ client_1.moveFeature,
111
+ client_1.layoutContainerFeature,
112
+ client_1.fadeFeature,
113
+ client_1.hoverFeedbackFeature,
114
+ client_1.popupFeature,
115
+ client_1.nameFeature,
116
+ client_1.withEditLabelFeature
117
+ ];
113
118
  //# sourceMappingURL=model.js.map
package/lib/model.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,+CAsB8B;AAG9B;IAA8B,4BAAe;IAA7C;QAAA,qEAkBC;QAfG,UAAI,GAAW,EAAE,CAAC;;IAetB,CAAC;IAVG,sBAAI,mCAAa;aAAjB;YACI,IAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAA,OAAO,IAAI,OAAA,OAAO,CAAC,IAAI,KAAK,aAAa,EAA9B,CAA8B,CAAC,CAAC;YACjF,IAAI,UAAU,EAAE;gBACZ,IAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAA,OAAO,IAAI,OAAA,OAAO,CAAC,IAAI,KAAK,eAAe,EAAhC,CAAgC,CAAC,CAAC;gBACpF,IAAI,KAAK,IAAI,wBAAe,CAAC,KAAK,CAAC,EAAE;oBACjC,OAAO,KAAK,CAAC;iBAChB;aACJ;YACD,OAAO,SAAS,CAAC;QACrB,CAAC;;;OAAA;IAhBe,yBAAgB,GAAG,CAAC,2BAAkB,EAAE,yBAAgB,EAAE,sBAAa,EAAE,sBAAa;QAClG,oBAAW,EAAE,+BAAsB,EAAE,oBAAW,EAAE,6BAAoB,EAAE,qBAAY,EAAE,oBAAW,EAAE,6BAAoB,CAAC,CAAC;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