@eclipse-glsp/server 2.1.0-next.70 → 2.1.0-next.73
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/command/recording-command.js +3 -3
- package/lib/common/command/recording-command.js.map +1 -1
- package/lib/common/features/model/model-submission-handler.d.ts +1 -1
- package/lib/common/features/model/model-submission-handler.js +1 -1
- package/lib/common/operations/json-operation-handler.d.ts +2 -2
- package/lib/common/operations/json-operation-handler.d.ts.map +1 -1
- package/lib/common/operations/json-operation-handler.js +1 -1
- package/lib/common/operations/json-operation-handler.js.map +1 -1
- package/package.json +4 -4
- package/src/common/command/recording-command.ts +3 -3
- package/src/common/features/model/model-submission-handler.ts +1 -1
- package/src/common/operations/json-operation-handler.ts +3 -3
|
@@ -29,7 +29,7 @@ class AbstractRecordingCommand {
|
|
|
29
29
|
const afterState = await this.getJsonObject();
|
|
30
30
|
this.undoPatch = jsonPatch.compare(afterState, beforeState);
|
|
31
31
|
this.redoPatch = jsonPatch.compare(beforeState, afterState);
|
|
32
|
-
(_a = this.postChange) === null || _a === void 0 ? void 0 : _a.call(this, afterState);
|
|
32
|
+
await ((_a = this.postChange) === null || _a === void 0 ? void 0 : _a.call(this, afterState));
|
|
33
33
|
}
|
|
34
34
|
applyPatch(object, patch) {
|
|
35
35
|
return jsonPatch.applyPatch(object, patch, false, true);
|
|
@@ -47,14 +47,14 @@ class AbstractRecordingCommand {
|
|
|
47
47
|
var _a;
|
|
48
48
|
if (this.undoPatch) {
|
|
49
49
|
const result = this.applyPatch(await this.getJsonObject(), this.undoPatch);
|
|
50
|
-
(_a = this.postChange) === null || _a === void 0 ? void 0 : _a.call(this, result.newDocument);
|
|
50
|
+
await ((_a = this.postChange) === null || _a === void 0 ? void 0 : _a.call(this, result.newDocument));
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
async redo() {
|
|
54
54
|
var _a;
|
|
55
55
|
if (this.redoPatch) {
|
|
56
56
|
const result = this.applyPatch(await this.getJsonObject(), this.redoPatch);
|
|
57
|
-
(_a = this.postChange) === null || _a === void 0 ? void 0 : _a.call(this, result.newDocument);
|
|
57
|
+
await ((_a = this.postChange) === null || _a === void 0 ? void 0 : _a.call(this, result.newDocument));
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
canUndo() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recording-command.js","sourceRoot":"","sources":["../../../src/common/command/recording-command.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAGlF,6CAA6C;AAI7C;;;GAGG;AACH,MAAsB,wBAAwB;IAI1C,KAAK,CAAC,OAAO;;QACT,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QAC/D,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;QACvB,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QAC9C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;QAC5D,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QAC5D,MAAA,IAAI,CAAC,UAAU,qDAAG,UAAU,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"recording-command.js","sourceRoot":"","sources":["../../../src/common/command/recording-command.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAGlF,6CAA6C;AAI7C;;;GAGG;AACH,MAAsB,wBAAwB;IAI1C,KAAK,CAAC,OAAO;;QACT,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QAC/D,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;QACvB,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QAC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C;IAClF,YAAsB,UAAsB,EAAY,UAA4B,EAAY,SAAmC;QAC/H,KAAK,EAAE,CAAC;QADU,eAAU,GAAV,UAAU,CAAY;QAAY,eAAU,GAAV,UAAU,CAAkB;QAAY,cAAS,GAAT,SAAS,CAA0B;IAEnI,CAAC;IAES,aAAa;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC9D,CAAC;IAEkB,UAAU,CAAC,QAA6B;QACvD,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QACrD,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;CACJ;AAbD,wDAaC"}
|
|
@@ -41,7 +41,7 @@ export declare class ModelSubmissionHandler {
|
|
|
41
41
|
protected requestModelAction?: RequestModelAction;
|
|
42
42
|
/**
|
|
43
43
|
* Returns a list of actions to submit the initial revision of the client-side model, based on the injected
|
|
44
|
-
* {@link
|
|
44
|
+
* {@link ModelState}. Typically this method is invoked by the {@link RequestModelActionHandler} when the diagram
|
|
45
45
|
* is (re)loaded.
|
|
46
46
|
* <p>
|
|
47
47
|
* These actions are not processed by this {@link ModelSubmissionHandler}, but should be either manually dispatched
|
|
@@ -46,7 +46,7 @@ const model_state_1 = require("./model-state");
|
|
|
46
46
|
let ModelSubmissionHandler = class ModelSubmissionHandler {
|
|
47
47
|
/**
|
|
48
48
|
* Returns a list of actions to submit the initial revision of the client-side model, based on the injected
|
|
49
|
-
* {@link
|
|
49
|
+
* {@link ModelState}. Typically this method is invoked by the {@link RequestModelActionHandler} when the diagram
|
|
50
50
|
* is (re)loaded.
|
|
51
51
|
* <p>
|
|
52
52
|
* These actions are not processed by this {@link ModelSubmissionHandler}, but should be either manually dispatched
|
|
@@ -25,8 +25,8 @@ import { OperationHandler } from './operation-handler';
|
|
|
25
25
|
* Has to be implemented in order to reuse the {@link JsonOperationHandler} API.
|
|
26
26
|
*/
|
|
27
27
|
export interface JsonModelState<JsonObject extends AnyObject = AnyObject> extends ModelState {
|
|
28
|
-
readonly sourceModel: JsonObject
|
|
29
|
-
updateSourceModel(sourceModel: JsonObject): void
|
|
28
|
+
readonly sourceModel: MaybePromise<JsonObject>;
|
|
29
|
+
updateSourceModel(sourceModel: JsonObject): MaybePromise<void>;
|
|
30
30
|
}
|
|
31
31
|
export declare namespace JsonModelState {
|
|
32
32
|
function is(modelState: ModelState): modelState is JsonModelState;
|
|
@@ -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,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,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qB,SAAQ,gBAAgB;IAC/D,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO;CAMrD;AAED;;GAEG;AACH,8BACsB,8BAA+B,SAAQ,oBAAqB,YAAW,0BAA0B;IACnH,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,CAAC;IAClC,SAAkB,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;IAIhD;;;;;;;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;CAKzE;AAED;;GAEG;AACH,8BACsB,8BAA+B,SAAQ,oBAAqB,YAAW,0BAA0B;IACnH,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,CAAC;IAClC,SAAkB,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"}
|
|
@@ -33,7 +33,7 @@ class JsonRecordingCommand extends recording_command_1.AbstractRecordingCommand
|
|
|
33
33
|
return this.modelState.sourceModel;
|
|
34
34
|
}
|
|
35
35
|
postChange(newModel) {
|
|
36
|
-
this.modelState.updateSourceModel(newModel);
|
|
36
|
+
return this.modelState.updateSourceModel(newModel);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
exports.JsonRecordingCommand = JsonRecordingCommand;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-operation-handler.js","sourceRoot":"","sources":["../../../src/common/operations/json-operation-handler.ts"],"names":[],"mappings":";;;;;;;;;AAgBA,qDAUgC;AAChC,yCAAuC;AAEvC,oEAAwE;AAExE,sDAA2D;AAE3D,2DAAuD;AAWvD,IAAiB,cAAc,CAI9B;AAJD,WAAiB,cAAc;IAC3B,SAAgB,EAAE,CAAC,UAAsB;QACrC,OAAO,IAAA,wBAAa,EAAC,UAAU,EAAE,aAAa,CAAC,IAAI,IAAA,0BAAe,EAAC,UAAU,EAAE,mBAAmB,CAAC,CAAC;IACxG,CAAC;IAFe,iBAAE,KAEjB,CAAA;AACL,CAAC,EAJgB,cAAc,8BAAd,cAAc,QAI9B;AAED;;;GAGG;AACH,MAAa,oBAA+D,SAAQ,4CAAoC;IACpH,YAAsB,UAAsC,EAAY,SAAmC;QACvG,KAAK,EAAE,CAAC;QADU,eAAU,GAAV,UAAU,CAA4B;QAAY,cAAS,GAAT,SAAS,CAA0B;IAE3G,CAAC;IAEkB,aAAa;QAC5B,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;IACvC,CAAC;IAEkB,UAAU,CAAC,QAAoB;QAC9C,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"json-operation-handler.js","sourceRoot":"","sources":["../../../src/common/operations/json-operation-handler.ts"],"names":[],"mappings":";;;;;;;;;AAgBA,qDAUgC;AAChC,yCAAuC;AAEvC,oEAAwE;AAExE,sDAA2D;AAE3D,2DAAuD;AAWvD,IAAiB,cAAc,CAI9B;AAJD,WAAiB,cAAc;IAC3B,SAAgB,EAAE,CAAC,UAAsB;QACrC,OAAO,IAAA,wBAAa,EAAC,UAAU,EAAE,aAAa,CAAC,IAAI,IAAA,0BAAe,EAAC,UAAU,EAAE,mBAAmB,CAAC,CAAC;IACxG,CAAC;IAFe,iBAAE,KAEjB,CAAA;AACL,CAAC,EAJgB,cAAc,8B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AAC,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAChF,CAAC;IAED,WAAW,CAAC,SAA8B;QACtC,OAAO,SAAS,CAAC,QAAQ,CAAC;IAC9B,CAAC;IAED;;;;;;;;;OASG;IACH,mBAAmB,CAAC,SAA8B;;QAC9C,MAAM,SAAS,GAAG,MAAA,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,mCAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QACvE,MAAM,gBAAgB,GAAG,MAAA,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,mCAAI,gBAAK,CAAC,MAAM,CAAC;QACrE,OAAO,IAAA,iCAAmB,EAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;IAC5D,CAAC;CACJ,CAAA;AA3CqB,wEAA8B;yCAA9B,8BAA8B;IADnD,IAAA,sBAAU,GAAE;GACS,8BAA8B,CA2CnD;AAED;;GAEG;AAEI,IAAe,8BAA8B,GAA7C,MAAe,8BAA+B,SAAQ,oBAAoB;IAA1E;;QAGe,kBAAa,GAAG,8BAAmB,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.73+1c47d6b",
|
|
4
4
|
"description": "A js server framework for Eclipse GLSP",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eclipse",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"watch": "tsc -w"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@eclipse-glsp/graph": "2.1.0-next.
|
|
63
|
-
"@eclipse-glsp/protocol": "
|
|
62
|
+
"@eclipse-glsp/graph": "2.1.0-next.73+1c47d6b",
|
|
63
|
+
"@eclipse-glsp/protocol": "next",
|
|
64
64
|
"@types/uuid": "8.3.1",
|
|
65
65
|
"commander": "^8.3.0",
|
|
66
66
|
"fast-json-patch": "^3.1.0",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"publishConfig": {
|
|
77
77
|
"access": "public"
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "1c47d6b567f041e3a82791ee54aae0c2bb41d74f"
|
|
80
80
|
}
|
|
@@ -33,7 +33,7 @@ export abstract class AbstractRecordingCommand<JsonObject extends AnyObject> imp
|
|
|
33
33
|
const afterState = await this.getJsonObject();
|
|
34
34
|
this.undoPatch = jsonPatch.compare(afterState, beforeState);
|
|
35
35
|
this.redoPatch = jsonPatch.compare(beforeState, afterState);
|
|
36
|
-
this.postChange?.(afterState);
|
|
36
|
+
await this.postChange?.(afterState);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
/**
|
|
@@ -65,14 +65,14 @@ export abstract class AbstractRecordingCommand<JsonObject extends AnyObject> imp
|
|
|
65
65
|
async undo(): Promise<void> {
|
|
66
66
|
if (this.undoPatch) {
|
|
67
67
|
const result = this.applyPatch(await this.getJsonObject(), this.undoPatch);
|
|
68
|
-
this.postChange?.(result.newDocument);
|
|
68
|
+
await this.postChange?.(result.newDocument);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
async redo(): Promise<void> {
|
|
73
73
|
if (this.redoPatch) {
|
|
74
74
|
const result = this.applyPatch(await this.getJsonObject(), this.redoPatch);
|
|
75
|
-
this.postChange?.(result.newDocument);
|
|
75
|
+
await this.postChange?.(result.newDocument);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -74,7 +74,7 @@ export class ModelSubmissionHandler {
|
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* Returns a list of actions to submit the initial revision of the client-side model, based on the injected
|
|
77
|
-
* {@link
|
|
77
|
+
* {@link ModelState}. Typically this method is invoked by the {@link RequestModelActionHandler} when the diagram
|
|
78
78
|
* is (re)loaded.
|
|
79
79
|
* <p>
|
|
80
80
|
* These actions are not processed by this {@link ModelSubmissionHandler}, but should be either manually dispatched
|
|
@@ -38,8 +38,8 @@ import { OperationHandler } from './operation-handler';
|
|
|
38
38
|
* Has to be implemented in order to reuse the {@link JsonOperationHandler} API.
|
|
39
39
|
*/
|
|
40
40
|
export interface JsonModelState<JsonObject extends AnyObject = AnyObject> extends ModelState {
|
|
41
|
-
readonly sourceModel: JsonObject
|
|
42
|
-
updateSourceModel(sourceModel: JsonObject): void
|
|
41
|
+
readonly sourceModel: MaybePromise<JsonObject>;
|
|
42
|
+
updateSourceModel(sourceModel: JsonObject): MaybePromise<void>;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
export namespace JsonModelState {
|
|
@@ -62,7 +62,7 @@ export class JsonRecordingCommand<JsonObject extends AnyObject = AnyObject> exte
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
protected override postChange(newModel: JsonObject): MaybePromise<void> {
|
|
65
|
-
this.modelState.updateSourceModel(newModel);
|
|
65
|
+
return this.modelState.updateSourceModel(newModel);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|