@eclipse-glsp/server 2.1.0-next.77 → 2.1.0-next.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/common/gmodel/gmodel-create-node-operation-handler.d.ts +4 -1
- package/lib/common/gmodel/gmodel-create-node-operation-handler.d.ts.map +1 -1
- package/lib/common/gmodel/gmodel-create-node-operation-handler.js +10 -1
- package/lib/common/gmodel/gmodel-create-node-operation-handler.js.map +1 -1
- package/lib/common/operations/json-operation-handler.d.ts +5 -2
- package/lib/common/operations/json-operation-handler.d.ts.map +1 -1
- package/lib/common/operations/json-operation-handler.js +13 -1
- package/lib/common/operations/json-operation-handler.js.map +1 -1
- package/package.json +3 -3
- package/src/common/gmodel/gmodel-create-node-operation-handler.ts +18 -2
- package/src/common/operations/json-operation-handler.ts +23 -3
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import { GModelElement, GNode } from '@eclipse-glsp/graph';
|
|
17
|
-
import { CreateNodeOperation, MaybePromise, Point, TriggerNodeCreationAction } from '@eclipse-glsp/protocol';
|
|
17
|
+
import { Args, CreateNodeOperation, GhostElement, MaybePromise, Point, TriggerNodeCreationAction } from '@eclipse-glsp/protocol';
|
|
18
18
|
import { ActionDispatcher } from '../actions/action-dispatcher';
|
|
19
19
|
import { Command } from '../command/command';
|
|
20
20
|
import { CreateNodeOperationHandler } from '../operations/create-operation-handler';
|
|
@@ -32,6 +32,9 @@ export declare abstract class GModelCreateNodeOperationHandler extends GModelOpe
|
|
|
32
32
|
createCommand(operation: CreateNodeOperation): MaybePromise<Command | undefined>;
|
|
33
33
|
executeCreation(operation: CreateNodeOperation): void;
|
|
34
34
|
getTriggerActions(): TriggerNodeCreationAction[];
|
|
35
|
+
protected createTriggerNodeCreationAction(elementTypeId: string): TriggerNodeCreationAction;
|
|
36
|
+
protected createTriggerGhostElement(elementTypeId: string): GhostElement | undefined;
|
|
37
|
+
protected createTriggerArgs(elementTypeId: string): Args | undefined;
|
|
35
38
|
/**
|
|
36
39
|
* Return the GModelElement that will contain the newly created node. It is usually
|
|
37
40
|
* the target element ({@link CreateNodeOperation.containerId}), but could also
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gmodel-create-node-operation-handler.d.ts","sourceRoot":"","sources":["../../../src/common/gmodel/gmodel-create-node-operation-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"gmodel-create-node-operation-handler.d.ts","sourceRoot":"","sources":["../../../src/common/gmodel/gmodel-create-node-operation-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACH,IAAI,EAAE,mBAAmB,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,EAC5D,yBAAyB,EAC5B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AAEpF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE;;;;GAIG;AACH,8BACsB,gCAAiC,SAAQ,sBAAuB,YAAW,0BAA0B;IAEvH,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAE7C,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,CAAC;IAElC,SAAkB,KAAK,EAAE,MAAM,CAAC;IAEhC,SAAkB,aAAa,gBAA4B;IAElD,aAAa,CAAC,SAAS,EAAE,mBAAmB,GAAG,YAAY,CAAC,OAAO,GAAG,SAAS,CAAC;IAIzF,eAAe,CAAC,SAAS,EAAE,mBAAmB,GAAG,IAAI;IAWrD,iBAAiB,IAAI,yBAAyB,EAAE;IAIhD,SAAS,CAAC,+BAA+B,CAAC,aAAa,EAAE,MAAM,GAAG,yBAAyB;IAK3F,SAAS,CAAC,yBAAyB,CAAC,aAAa,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IAIpF,SAAS,CAAC,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAIpE;;;;;;;OAOG;IACH,YAAY,CAAC,SAAS,EAAE,mBAAmB,GAAG,aAAa,GAAG,SAAS;IAKvE,WAAW,CAAC,SAAS,EAAE,mBAAmB,GAAG,KAAK,GAAG,SAAS;IAI9D;;;;;;;;;OASG;IACH,mBAAmB,CAAC,SAAS,EAAE,mBAAmB,GAAG,KAAK,GAAG,SAAS;IAMtE,QAAQ,CAAC,UAAU,CAAC,SAAS,EAAE,mBAAmB,EAAE,gBAAgB,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,SAAS;CACnG"}
|
|
@@ -55,7 +55,16 @@ let GModelCreateNodeOperationHandler = class GModelCreateNodeOperationHandler ex
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
getTriggerActions() {
|
|
58
|
-
return this.elementTypeIds.map(
|
|
58
|
+
return this.elementTypeIds.map(elementTypeId => this.createTriggerNodeCreationAction(elementTypeId));
|
|
59
|
+
}
|
|
60
|
+
createTriggerNodeCreationAction(elementTypeId) {
|
|
61
|
+
return protocol_1.TriggerNodeCreationAction.create(elementTypeId, { ghostElement: this.createTriggerGhostElement(elementTypeId), args: this.createTriggerArgs(elementTypeId) });
|
|
62
|
+
}
|
|
63
|
+
createTriggerGhostElement(elementTypeId) {
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
createTriggerArgs(elementTypeId) {
|
|
67
|
+
return undefined;
|
|
59
68
|
}
|
|
60
69
|
/**
|
|
61
70
|
* Return the GModelElement that will contain the newly created node. It is usually
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gmodel-create-node-operation-handler.js","sourceRoot":"","sources":["../../../src/common/gmodel/gmodel-create-node-operation-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAGlF,
|
|
1
|
+
{"version":3,"file":"gmodel-create-node-operation-handler.js","sourceRoot":"","sources":["../../../src/common/gmodel/gmodel-create-node-operation-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAGlF,qDAGgC;AAChC,yCAA+C;AAC/C,oEAAgE;AAGhE,sDAA2D;AAC3D,yEAAoE;AAEpE;;;;GAIG;AAEI,IAAe,gCAAgC,GAA/C,MAAe,gCAAiC,SAAQ,iDAAsB;IAA9E;;QAQe,kBAAa,GAAG,8BAAmB,CAAC,IAAI,CAAC;IAoE/D,CAAC;IAlEY,aAAa,CAAC,SAA8B;QACjD,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,eAAe,CAAC,SAA8B;;QAC1C,MAAM,SAAS,GAAG,MAAA,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,mCAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QACvE,MAAM,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;QAC7D,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;QAC7D,IAAI,OAAO,EAAE;YACT,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACjC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;YAC3B,IAAI,CAAC,gBAA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AmB,EAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;IAC5D,CAAC;CAGJ,CAAA;AA5EqB,4EAAgC;AAExC;IADT,IAAA,kBAAM,EAAC,oCAAgB,CAAC;;0EACoB;2CAF3B,gCAAgC;IADrD,IAAA,sBAAU,GAAE;GACS,gCAAgC,CA4ErD"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import { GModelElement } from '@eclipse-glsp/graph';
|
|
17
|
-
import { AnyObject, CreateEdgeOperation, CreateNodeOperation, MaybePromise, Point, TriggerEdgeCreationAction, TriggerNodeCreationAction } from '@eclipse-glsp/protocol';
|
|
17
|
+
import { AnyObject, Args, CreateEdgeOperation, CreateNodeOperation, GhostElement, MaybePromise, Point, TriggerEdgeCreationAction, TriggerNodeCreationAction } from '@eclipse-glsp/protocol';
|
|
18
18
|
import { Command } from '../command/command';
|
|
19
19
|
import { AbstractRecordingCommand } from '../command/recording-command';
|
|
20
20
|
import { ModelState } from '../features/model/model-state';
|
|
@@ -48,7 +48,7 @@ export declare class JsonRecordingCommand<JsonObject extends AnyObject = AnyObje
|
|
|
48
48
|
*
|
|
49
49
|
*/
|
|
50
50
|
export declare abstract class JsonOperationHandler extends OperationHandler {
|
|
51
|
-
protected commandOf(runnable: () => void): Command;
|
|
51
|
+
protected commandOf(runnable: () => MaybePromise<void>): Command;
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
54
|
* Reusable {@link CreateNodeOperationHandler} base implementation for diagram languages that use a (serializable) JSON-based source model.
|
|
@@ -59,6 +59,9 @@ export declare abstract class JsonCreateNodeOperationHandler extends JsonOperati
|
|
|
59
59
|
readonly operationType = "createNode";
|
|
60
60
|
abstract createCommand(operation: CreateNodeOperation): MaybePromise<Command | undefined>;
|
|
61
61
|
getTriggerActions(): TriggerNodeCreationAction[];
|
|
62
|
+
protected createTriggerNodeCreationAction(elementTypeId: string): TriggerNodeCreationAction;
|
|
63
|
+
protected createTriggerGhostElement(elementTypeId: string): GhostElement | undefined;
|
|
64
|
+
protected createTriggerArgs(elementTypeId: string): Args | undefined;
|
|
62
65
|
/**
|
|
63
66
|
* Return the GModelElement that will contain the newly created node. It is usually
|
|
64
67
|
* the target element ({@link CreateNodeOperation.containerId}), but could also
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-operation-handler.d.ts","sourceRoot":"","sources":["../../../src/common/operations/json-operation-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EACH,SAAS,EACT,mBAAmB,EACnB,mBAAmB,EACnB,YAAY,EACZ,KAAK,EACL,yBAAyB,EACzB,yBAAyB,EAG5B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AACpG,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,cAAc,CAAC,UAAU,SAAS,SAAS,GAAG,SAAS,CAAE,SAAQ,UAAU;IACxF,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IAC/C,iBAAiB,CAAC,WAAW,EAAE,UAAU,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;CAClE;AAED,yBAAiB,cAAc,CAAC;IAC5B,SAAgB,EAAE,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,IAAI,cAAc,CAEvE;CACJ;AAED;;;GAGG;AACH,qBAAa,oBAAoB,CAAC,UAAU,SAAS,SAAS,GAAG,SAAS,CAAE,SAAQ,wBAAwB,CAAC,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"json-operation-handler.d.ts","sourceRoot":"","sources":["../../../src/common/operations/json-operation-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EACH,SAAS,EACT,IAAI,EACJ,mBAAmB,EACnB,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,yBAAyB,EACzB,yBAAyB,EAG5B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AACpG,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,cAAc,CAAC,UAAU,SAAS,SAAS,GAAG,SAAS,CAAE,SAAQ,UAAU;IACxF,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IAC/C,iBAAiB,CAAC,WAAW,EAAE,UAAU,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;CAClE;AAED,yBAAiB,cAAc,CAAC;IAC5B,SAAgB,EAAE,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,IAAI,cAAc,CAEvE;CACJ;AAED;;;GAGG;AACH,qBAAa,oBAAoB,CAAC,UAAU,SAAS,SAAS,GAAG,SAAS,CAAE,SAAQ,wBAAwB,CAAC,UAAU,CAAC;IAEhH,SAAS,CAAC,UAAU,EAAE,cAAc,CAAC,UAAU,CAAC;IAChD,SAAS,CAAC,SAAS,EAAE,MAAM,YAAY,CAAC,IAAI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AkB,KAAK,EAAE,MAAM,CAAC;IAChC,SAAkB,aAAa,gBAA4B;aAEzC,aAAa,CAAC,SAAS,EAAE,mBAAmB,GAAG,YAAY,CAAC,OAAO,GAAG,SAAS,CAAC;IAElG,iBAAiB,IAAI,yBAAyB,EAAE;CAGnD"}
|
|
@@ -63,7 +63,19 @@ let JsonCreateNodeOperationHandler = class JsonCreateNodeOperationHandler extend
|
|
|
63
63
|
this.operationType = protocol_1.CreateNodeOperation.KIND;
|
|
64
64
|
}
|
|
65
65
|
getTriggerActions() {
|
|
66
|
-
return this.elementTypeIds.map(
|
|
66
|
+
return this.elementTypeIds.map(elementTypeId => this.createTriggerNodeCreationAction(elementTypeId));
|
|
67
|
+
}
|
|
68
|
+
createTriggerNodeCreationAction(elementTypeId) {
|
|
69
|
+
return protocol_1.TriggerNodeCreationAction.create(elementTypeId, {
|
|
70
|
+
ghostElement: this.createTriggerGhostElement(elementTypeId),
|
|
71
|
+
args: this.createTriggerArgs(elementTypeId)
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
createTriggerGhostElement(elementTypeId) {
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
createTriggerArgs(elementTypeId) {
|
|
78
|
+
return undefined;
|
|
67
79
|
}
|
|
68
80
|
/**
|
|
69
81
|
* Return the GModelElement that will contain the newly created node. It is usually
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-operation-handler.js","sourceRoot":"","sources":["../../../src/common/operations/json-operation-handler.ts"],"names":[],"mappings":";;;;;;;;;AAgBA,
|
|
1
|
+
{"version":3,"file":"json-operation-handler.js","sourceRoot":"","sources":["../../../src/common/operations/json-operation-handler.ts"],"names":[],"mappings":";;;;;;;;;AAgBA,qDAYgC;AAChC,yCAAuC;AAEvC,oEAAwE;AAExE,sDAA2D;AAE3D,2DAAuD;AAWvD,IAAiB,cAAc,CAI9B;AAJD,WAAiB,cAAc;IAC3B,SAAgB,EAAE,CAAC,UAAsB;QACrC,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,CAAC,IAAI,CAAC;IAO/D,CAAC;IAHG,iBAAiB;QACb,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,oCAAyB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACvF,CAAC;CACJ,CAAA;AAVqB,wEAA8B;yCAA9B,8BAA8B;IADnD,IAAA,sBAAU,GAAE;GACS,8BAA8B,CAUnD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-glsp/server",
|
|
3
|
-
"version": "2.1.0-next.
|
|
3
|
+
"version": "2.1.0-next.79+4e6ca30",
|
|
4
4
|
"description": "A js server framework for Eclipse GLSP",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eclipse",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"watch": "tsc -w"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@eclipse-glsp/graph": "2.1.0-next.
|
|
62
|
+
"@eclipse-glsp/graph": "2.1.0-next.79+4e6ca30",
|
|
63
63
|
"@eclipse-glsp/protocol": "next",
|
|
64
64
|
"@types/uuid": "8.3.1",
|
|
65
65
|
"commander": "^8.3.0",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"publishConfig": {
|
|
77
77
|
"access": "public"
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "4e6ca3072260c0eb9319c4f338a632696bb203a8"
|
|
80
80
|
}
|
|
@@ -15,7 +15,10 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
17
|
import { GModelElement, GNode } from '@eclipse-glsp/graph';
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
Args, CreateNodeOperation, GhostElement, MaybePromise, Point, SelectAction,
|
|
20
|
+
TriggerNodeCreationAction
|
|
21
|
+
} from '@eclipse-glsp/protocol';
|
|
19
22
|
import { inject, injectable } from 'inversify';
|
|
20
23
|
import { ActionDispatcher } from '../actions/action-dispatcher';
|
|
21
24
|
import { Command } from '../command/command';
|
|
@@ -55,7 +58,20 @@ export abstract class GModelCreateNodeOperationHandler extends GModelOperationHa
|
|
|
55
58
|
}
|
|
56
59
|
|
|
57
60
|
getTriggerActions(): TriggerNodeCreationAction[] {
|
|
58
|
-
return this.elementTypeIds.map(
|
|
61
|
+
return this.elementTypeIds.map(elementTypeId => this.createTriggerNodeCreationAction(elementTypeId));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
protected createTriggerNodeCreationAction(elementTypeId: string): TriggerNodeCreationAction {
|
|
65
|
+
return TriggerNodeCreationAction.create(elementTypeId,
|
|
66
|
+
{ ghostElement: this.createTriggerGhostElement(elementTypeId), args: this.createTriggerArgs(elementTypeId) } );
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
protected createTriggerGhostElement(elementTypeId: string): GhostElement | undefined {
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
protected createTriggerArgs(elementTypeId: string): Args | undefined {
|
|
74
|
+
return undefined;
|
|
59
75
|
}
|
|
60
76
|
|
|
61
77
|
/**
|
|
@@ -16,8 +16,10 @@
|
|
|
16
16
|
import { GModelElement } from '@eclipse-glsp/graph';
|
|
17
17
|
import {
|
|
18
18
|
AnyObject,
|
|
19
|
+
Args,
|
|
19
20
|
CreateEdgeOperation,
|
|
20
21
|
CreateNodeOperation,
|
|
22
|
+
GhostElement,
|
|
21
23
|
MaybePromise,
|
|
22
24
|
Point,
|
|
23
25
|
TriggerEdgeCreationAction,
|
|
@@ -53,7 +55,10 @@ export namespace JsonModelState {
|
|
|
53
55
|
* to the `sourceModel` of the given {@link JsonModelState} during the given `doExecute` function
|
|
54
56
|
*/
|
|
55
57
|
export class JsonRecordingCommand<JsonObject extends AnyObject = AnyObject> extends AbstractRecordingCommand<JsonObject> {
|
|
56
|
-
constructor(
|
|
58
|
+
constructor(
|
|
59
|
+
protected modelState: JsonModelState<JsonObject>,
|
|
60
|
+
protected doExecute: () => MaybePromise<void>
|
|
61
|
+
) {
|
|
57
62
|
super();
|
|
58
63
|
}
|
|
59
64
|
|
|
@@ -73,7 +78,7 @@ export class JsonRecordingCommand<JsonObject extends AnyObject = AnyObject> exte
|
|
|
73
78
|
*/
|
|
74
79
|
@injectable()
|
|
75
80
|
export abstract class JsonOperationHandler extends OperationHandler {
|
|
76
|
-
protected commandOf(runnable: () => void): Command {
|
|
81
|
+
protected commandOf(runnable: () => MaybePromise<void>): Command {
|
|
77
82
|
if (!JsonModelState.is(this.modelState)) {
|
|
78
83
|
throw new Error('Cannot create command. The underlying model state does not implement the `JsonModelState` interface');
|
|
79
84
|
}
|
|
@@ -93,7 +98,22 @@ export abstract class JsonCreateNodeOperationHandler extends JsonOperationHandle
|
|
|
93
98
|
abstract override createCommand(operation: CreateNodeOperation): MaybePromise<Command | undefined>;
|
|
94
99
|
|
|
95
100
|
getTriggerActions(): TriggerNodeCreationAction[] {
|
|
96
|
-
return this.elementTypeIds.map(
|
|
101
|
+
return this.elementTypeIds.map(elementTypeId => this.createTriggerNodeCreationAction(elementTypeId));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
protected createTriggerNodeCreationAction(elementTypeId: string): TriggerNodeCreationAction {
|
|
105
|
+
return TriggerNodeCreationAction.create(elementTypeId, {
|
|
106
|
+
ghostElement: this.createTriggerGhostElement(elementTypeId),
|
|
107
|
+
args: this.createTriggerArgs(elementTypeId)
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
protected createTriggerGhostElement(elementTypeId: string): GhostElement | undefined {
|
|
112
|
+
return undefined;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
protected createTriggerArgs(elementTypeId: string): Args | undefined {
|
|
116
|
+
return undefined;
|
|
97
117
|
}
|
|
98
118
|
|
|
99
119
|
/**
|