@eclipse-glsp/vscode-integration-webview 0.9.0-next.ba9614af → 0.9.0-next.ecc539e1
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 +642 -276
- package/README.md +0 -1
- package/css/command-palette.css +6 -4
- package/css/decoration.css +1 -1
- package/css/diagram.css +3 -2
- package/css/glsp-vscode.css +6 -6
- package/css/tool-palette.css +1 -1
- package/lib/diagram-identifer.d.ts +25 -0
- package/lib/diagram-identifer.d.ts.map +1 -0
- package/lib/diagram-identifer.js +14 -0
- package/lib/diagram-identifer.js.map +1 -0
- package/lib/extension-action-handler.d.ts.map +1 -1
- package/lib/extension-action-handler.js +11 -13
- package/lib/extension-action-handler.js.map +1 -1
- package/lib/glsp-starter.d.ts +3 -1
- package/lib/glsp-starter.d.ts.map +1 -1
- package/lib/glsp-starter.js +55 -42
- package/lib/glsp-starter.js.map +1 -1
- package/lib/glsp-vscode-diagram-widget.d.ts.map +1 -1
- package/lib/glsp-vscode-diagram-widget.js +10 -31
- package/lib/glsp-vscode-diagram-widget.js.map +1 -1
- package/lib/glsp-vscode-diagramserver.d.ts +2 -1
- package/lib/glsp-vscode-diagramserver.d.ts.map +1 -1
- package/lib/glsp-vscode-diagramserver.js +50 -81
- package/lib/glsp-vscode-diagramserver.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +11 -11
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
- package/src/diagram-identifer.ts +36 -0
- package/src/extension-action-handler.ts +1 -4
- package/src/glsp-starter.ts +50 -6
- package/src/glsp-vscode-diagram-widget.ts +7 -12
- package/src/glsp-vscode-diagramserver.ts +15 -2
- package/src/index.ts +0 -1
package/README.md
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
This package helps you to implement a [VS Code Webview](https://code.visualstudio.com/api/extension-guides/webview) that renders a [GLSP](https://www.eclipse.org/glsp/) diagram.
|
|
4
4
|
Since GLSP is based on sprotty(https://github.com/eclipse/sprotty) this glue code is built on top of [sprotty-vscode-webview](https://www.npmjs.com/package/sprotty-vscode-webview).
|
|
5
5
|
|
|
6
|
-
|
|
7
6
|
### Where to find the sources?
|
|
8
7
|
|
|
9
8
|
In addition to this repository, the related source code can be found here:
|
package/css/command-palette.css
CHANGED
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
animation: fadein 0.3s;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
.command-palette.validation.error input,
|
|
44
|
+
.command-palette.validation.error input,
|
|
45
|
+
.command-palette.validation.error input:focus {
|
|
45
46
|
color: var(--vscode-inputValidation-errorForeground);
|
|
46
47
|
outline-color: var(--vscode-inputValidation-errorBorder);
|
|
47
48
|
}
|
|
@@ -51,7 +52,8 @@
|
|
|
51
52
|
background-color: var(--vscode-inputValidation-errorBorder);
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
.command-palette.validation.warning input,
|
|
55
|
+
.command-palette.validation.warning input,
|
|
56
|
+
.command-palette.validation.warning input:focus {
|
|
55
57
|
color: var(--vscode-inputValidation-warningForeground);
|
|
56
58
|
outline-color: var(--vscode-inputValidation-warningBorder);
|
|
57
59
|
}
|
|
@@ -81,11 +83,11 @@
|
|
|
81
83
|
line-height: var(--vscode-content-line-height);
|
|
82
84
|
}
|
|
83
85
|
|
|
84
|
-
.command-palette .command-palette-suggestions>div:hover:not(.group) {
|
|
86
|
+
.command-palette .command-palette-suggestions > div:hover:not(.group) {
|
|
85
87
|
background: var(--vscode-menubar-selectionBackground);
|
|
86
88
|
}
|
|
87
89
|
|
|
88
|
-
.command-palette .command-palette-suggestions>div.selected {
|
|
90
|
+
.command-palette .command-palette-suggestions > div.selected {
|
|
89
91
|
background: var(--vscode-menu-selectionBackground);
|
|
90
92
|
color: var(--vscode-menu-selectionForeground);
|
|
91
93
|
}
|
package/css/decoration.css
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
|
package/css/diagram.css
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
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
html,
|
|
17
|
+
html,
|
|
18
|
+
body {
|
|
18
19
|
width: 100%;
|
|
19
20
|
height: 100%;
|
|
20
21
|
padding: 0px;
|
package/css/glsp-vscode.css
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
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
@import
|
|
18
|
-
@import
|
|
19
|
-
@import
|
|
20
|
-
@import
|
|
17
|
+
@import 'command-palette.css';
|
|
18
|
+
@import 'diagram.css';
|
|
19
|
+
@import 'tool-palette.css';
|
|
20
|
+
@import 'decoration.css';
|
|
21
21
|
.sprotty-resize-handle.active {
|
|
22
|
-
fill: #0074e8!important;
|
|
22
|
+
fill: #0074e8 !important;
|
|
23
23
|
}
|
package/css/tool-palette.css
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
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 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 { InitializeResult } from '@eclipse-glsp/client';
|
|
17
|
+
export declare const GLSPDiagramIdentifier: unique symbol;
|
|
18
|
+
export interface GLSPDiagramIdentifier {
|
|
19
|
+
clientId: string;
|
|
20
|
+
diagramType: string;
|
|
21
|
+
uri: string;
|
|
22
|
+
initializeResult?: InitializeResult;
|
|
23
|
+
}
|
|
24
|
+
export declare function isDiagramIdentifier(object: any): object is GLSPDiagramIdentifier;
|
|
25
|
+
//# sourceMappingURL=diagram-identifer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagram-identifer.d.ts","sourceRoot":"","sources":["../src/diagram-identifer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD,eAAO,MAAM,qBAAqB,eAAkC,CAAC;AAErE,MAAM,WAAW,qBAAqB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACvC;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,qBAAqB,CAQhF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isDiagramIdentifier = exports.GLSPDiagramIdentifier = void 0;
|
|
4
|
+
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
5
|
+
exports.GLSPDiagramIdentifier = Symbol('GLSPDiagramIdentifier');
|
|
6
|
+
function isDiagramIdentifier(object) {
|
|
7
|
+
return (object !== undefined &&
|
|
8
|
+
typeof object === 'object' &&
|
|
9
|
+
(0, protocol_1.isString)(object, 'clientId') &&
|
|
10
|
+
(0, protocol_1.isString)(object, 'diagramType') &&
|
|
11
|
+
(0, protocol_1.isString)(object, 'uri'));
|
|
12
|
+
}
|
|
13
|
+
exports.isDiagramIdentifier = isDiagramIdentifier;
|
|
14
|
+
//# sourceMappingURL=diagram-identifer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagram-identifer.js","sourceRoot":"","sources":["../src/diagram-identifer.ts"],"names":[],"mappings":";;;AAgBA,qDAAkD;AAErC,QAAA,qBAAqB,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;AASrE,SAAgB,mBAAmB,CAAC,MAAW;IAC3C,OAAO,CACH,MAAM,KAAK,SAAS;QACpB,OAAO,MAAM,KAAK,QAAQ;QAC1B,IAAA,mBAAQ,EAAC,MAAM,EAAE,UAAU,CAAC;QAC5B,IAAA,mBAAQ,EAAC,MAAM,EAAE,aAAa,CAAC;QAC/B,IAAA,mBAAQ,EAAC,MAAM,EAAE,KAAK,CAAC,CAC1B,CAAC;AACN,CAAC;AARD,kDAQC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension-action-handler.d.ts","sourceRoot":"","sources":["../src/extension-action-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,cAAc,EAAE,yBAAyB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC7G,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAGlE;;;;GAIG;AACH,qBAAa,gCAAiC,YAAW,cAAc,EAAE,yBAAyB;
|
|
1
|
+
{"version":3,"file":"extension-action-handler.d.ts","sourceRoot":"","sources":["../src/extension-action-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,cAAc,EAAE,yBAAyB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC7G,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAGlE;;;;GAIG;AACH,qBAAa,gCAAiC,YAAW,cAAc,EAAE,yBAAyB;IAClF,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE;IAAE,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,wBAAwB;gBAArF,WAAW,EAAE,MAAM,EAAE,EAAqB,iBAAiB,EAAE,wBAAwB;IAEpH,UAAU,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI;IAIjD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,QAAQ;CAUnD"}
|
|
@@ -1,32 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GLSPVscodeExtensionActionHandler = void 0;
|
|
4
|
-
|
|
4
|
+
const vscode_api_1 = require("sprotty-vscode-webview/lib/vscode-api");
|
|
5
5
|
/**
|
|
6
6
|
* Delegates actions that should be handled inside of the glsp vscode extension instead
|
|
7
7
|
* of the webview. This enables the implementation of action handlers that require access
|
|
8
8
|
* to the vscode API and/or node backend.
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
class GLSPVscodeExtensionActionHandler {
|
|
11
|
+
constructor(actionKinds, diagramIdentifier) {
|
|
12
12
|
this.actionKinds = actionKinds;
|
|
13
13
|
this.diagramIdentifier = diagramIdentifier;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
GLSPVscodeExtensionActionHandler.prototype.handle = function (action) {
|
|
15
|
+
initialize(registry) {
|
|
16
|
+
this.actionKinds.forEach(kind => registry.register(kind, this));
|
|
17
|
+
}
|
|
18
|
+
handle(action) {
|
|
20
19
|
if (this.actionKinds.includes(action.kind)) {
|
|
21
|
-
|
|
20
|
+
const message = {
|
|
22
21
|
clientId: this.diagramIdentifier.clientId,
|
|
23
|
-
action
|
|
22
|
+
action,
|
|
24
23
|
__localDispatch: true
|
|
25
24
|
};
|
|
26
25
|
vscode_api_1.vscodeApi.postMessage(message);
|
|
27
26
|
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
}());
|
|
27
|
+
}
|
|
28
|
+
}
|
|
31
29
|
exports.GLSPVscodeExtensionActionHandler = GLSPVscodeExtensionActionHandler;
|
|
32
30
|
//# sourceMappingURL=extension-action-handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension-action-handler.js","sourceRoot":"","sources":["../src/extension-action-handler.ts"],"names":[],"mappings":";;;AAiBA,
|
|
1
|
+
{"version":3,"file":"extension-action-handler.js","sourceRoot":"","sources":["../src/extension-action-handler.ts"],"names":[],"mappings":";;;AAiBA,sEAAkE;AAElE;;;;GAIG;AACH,MAAa,gCAAgC;IACzC,YAA+B,WAAqB,EAAqB,iBAA2C;QAArF,gBAAW,GAAX,WAAW,CAAU;QAAqB,sBAAiB,GAAjB,iBAAiB,CAA0B;IAAG,CAAC;IAExH,UAAU,CAAC,QAA+B;QACtC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,IAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YACxC,MAAM,OAAO,GAAG;gBACZ,QAAQ,EAAE,IAAI,CAAC,iBAAiB,CAAC,QAAQ;gBACzC,MAAM;gBACN,eAAe,EAAE,IAAI;aACxB,CAAC;YACF,sBAAS,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;SAClC;IACL,CAAC;CACJ;AAjBD,4EAiBC"}
|
package/lib/glsp-starter.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Container } from 'inversify';
|
|
2
2
|
import { SprottyDiagramIdentifier, SprottyStarter } from 'sprotty-vscode-webview';
|
|
3
|
+
import { GLSPDiagramIdentifier } from './diagram-identifer';
|
|
3
4
|
export declare abstract class GLSPStarter extends SprottyStarter {
|
|
4
|
-
protected
|
|
5
|
+
protected acceptDiagramIdentifier(): void;
|
|
6
|
+
protected addVscodeBindings(container: Container, diagramIdentifier: GLSPDiagramIdentifier): void;
|
|
5
7
|
protected configureExtensionActionHandler(container: Container, diagramIdentifier: SprottyDiagramIdentifier): void;
|
|
6
8
|
/**
|
|
7
9
|
* All kinds of actions that should (also) be delegated to and handled by the vscode extension
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-starter.d.ts","sourceRoot":"","sources":["../src/glsp-starter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"glsp-starter.d.ts","sourceRoot":"","sources":["../src/glsp-starter.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EACH,wBAAwB,EACxB,cAAc,EAIjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAuB,MAAM,qBAAqB,CAAC;AAKjF,8BAAsB,WAAY,SAAQ,cAAc;IACpD,SAAS,CAAC,uBAAuB,IAAI,IAAI;IA2BzC,SAAS,CAAC,iBAAiB,CAAC,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,qBAAqB,GAAG,IAAI;IAgBjG,SAAS,CAAC,+BAA+B,CAAC,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,wBAAwB,GAAG,IAAI;IAMlH;;OAEG;IACH,SAAS,KAAK,oBAAoB,IAAI,MAAM,EAAE,CAQ7C;CACJ"}
|
package/lib/glsp-starter.js
CHANGED
|
@@ -1,19 +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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.GLSPStarter = void 0;
|
|
19
4
|
/********************************************************************************
|
|
@@ -31,43 +16,71 @@ exports.GLSPStarter = void 0;
|
|
|
31
16
|
*
|
|
32
17
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
33
18
|
********************************************************************************/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
19
|
+
const client_1 = require("@eclipse-glsp/client");
|
|
20
|
+
const sprotty_vscode_webview_1 = require("sprotty-vscode-webview");
|
|
21
|
+
const diagram_identifer_1 = require("./diagram-identifer");
|
|
22
|
+
const extension_action_handler_1 = require("./extension-action-handler");
|
|
23
|
+
const glsp_vscode_diagram_widget_1 = require("./glsp-vscode-diagram-widget");
|
|
24
|
+
const glsp_vscode_diagramserver_1 = require("./glsp-vscode-diagramserver");
|
|
25
|
+
class GLSPStarter extends sprotty_vscode_webview_1.SprottyStarter {
|
|
26
|
+
acceptDiagramIdentifier() {
|
|
27
|
+
console.log('Waiting for diagram identifier...');
|
|
28
|
+
const eventListener = (message) => {
|
|
29
|
+
if ((0, diagram_identifer_1.isDiagramIdentifier)(message.data)) {
|
|
30
|
+
console.log(message);
|
|
31
|
+
if (this.container) {
|
|
32
|
+
const oldIdentifier = this.container.get(diagram_identifer_1.GLSPDiagramIdentifier);
|
|
33
|
+
const newIdentifier = message.data;
|
|
34
|
+
oldIdentifier.diagramType = newIdentifier.diagramType;
|
|
35
|
+
oldIdentifier.uri = newIdentifier.uri;
|
|
36
|
+
const diagramWidget = this.container.get(sprotty_vscode_webview_1.VscodeDiagramWidget);
|
|
37
|
+
diagramWidget.requestModel();
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
console.log('...received...', message);
|
|
41
|
+
const diagramIdentifier = message.data;
|
|
42
|
+
this.container = this.createContainer(diagramIdentifier);
|
|
43
|
+
this.addVscodeBindings(this.container, diagramIdentifier);
|
|
44
|
+
if (diagramIdentifier.initializeResult) {
|
|
45
|
+
(0, client_1.configureServerActions)(diagramIdentifier.initializeResult, diagramIdentifier.diagramType, this.container);
|
|
46
|
+
}
|
|
47
|
+
this.container.get(sprotty_vscode_webview_1.VscodeDiagramWidget);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
window.addEventListener('message', eventListener);
|
|
43
52
|
}
|
|
44
|
-
|
|
53
|
+
addVscodeBindings(container, diagramIdentifier) {
|
|
45
54
|
container.bind(glsp_vscode_diagram_widget_1.GLSPVscodeDiagramWidget).toSelf().inSingletonScope();
|
|
46
55
|
container.bind(sprotty_vscode_webview_1.VscodeDiagramWidget).toService(glsp_vscode_diagram_widget_1.GLSPVscodeDiagramWidget);
|
|
47
|
-
container
|
|
56
|
+
container
|
|
57
|
+
.bind(sprotty_vscode_webview_1.VscodeDiagramWidgetFactory)
|
|
58
|
+
.toFactory(context => () => context.container.get(glsp_vscode_diagram_widget_1.GLSPVscodeDiagramWidget));
|
|
59
|
+
container.bind(diagram_identifer_1.GLSPDiagramIdentifier).toConstantValue(diagramIdentifier);
|
|
48
60
|
container.bind(sprotty_vscode_webview_1.SprottyDiagramIdentifier).toConstantValue(diagramIdentifier);
|
|
49
61
|
container.bind(glsp_vscode_diagramserver_1.GLSPVscodeDiagramServer).toSelf().inSingletonScope();
|
|
50
62
|
container.bind(sprotty_vscode_webview_1.VscodeDiagramServer).toService(glsp_vscode_diagramserver_1.GLSPVscodeDiagramServer);
|
|
51
63
|
container.bind(client_1.TYPES.ModelSource).toService(glsp_vscode_diagramserver_1.GLSPVscodeDiagramServer);
|
|
52
64
|
container.bind(client_1.DiagramServer).toService(glsp_vscode_diagramserver_1.GLSPVscodeDiagramServer);
|
|
53
65
|
this.configureExtensionActionHandler(container, diagramIdentifier);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
66
|
+
}
|
|
67
|
+
configureExtensionActionHandler(container, diagramIdentifier) {
|
|
68
|
+
const extensionActionHandler = new extension_action_handler_1.GLSPVscodeExtensionActionHandler(this.extensionActionKinds, diagramIdentifier);
|
|
57
69
|
container.bind(extension_action_handler_1.GLSPVscodeExtensionActionHandler).toConstantValue(extensionActionHandler);
|
|
58
70
|
container.bind(client_1.TYPES.IActionHandlerInitializer).toService(extension_action_handler_1.GLSPVscodeExtensionActionHandler);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* All kinds of actions that should (also) be delegated to and handled by the vscode extension
|
|
74
|
+
*/
|
|
75
|
+
get extensionActionKinds() {
|
|
76
|
+
return [
|
|
77
|
+
client_1.NavigateToExternalTargetAction.KIND,
|
|
78
|
+
client_1.RequestClipboardDataAction.KIND,
|
|
79
|
+
client_1.SetClipboardDataAction.KIND,
|
|
80
|
+
client_1.SelectAction.KIND,
|
|
81
|
+
client_1.ExportSvgAction.KIND
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
72
85
|
exports.GLSPStarter = GLSPStarter;
|
|
73
86
|
//# sourceMappingURL=glsp-starter.js.map
|
package/lib/glsp-starter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-starter.js","sourceRoot":"","sources":["../src/glsp-starter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"glsp-starter.js","sourceRoot":"","sources":["../src/glsp-starter.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAS8B;AAE9B,mEAMgC;AAChC,2DAAiF;AACjF,yEAA8E;AAC9E,6EAAuE;AACvE,2EAAsE;AAEtE,MAAsB,WAAY,SAAQ,uCAAc;IAC1C,uBAAuB;QA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BAAyB,CAAC,CAAC,SAAS,CAAC,2DAAgC,CAAC,CAAC;IAChG,CAAC;IAED;;OAEG;IACH,IAAc,oBAAoB;QAC9B,OAAO;YACH,uCAA8B,CAAC,IAAI;YACnC,mCAA0B,CAAC,IAAI;YAC/B,+BAAsB,CAAC,IAAI;YAC3B,qBAAY,CAAC,IAAI;YACjB,wBAAe,CAAC,IAAI;SACvB,CAAC;IACN,CAAC;CACJ;AA9DD,kCA8DC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-vscode-diagram-widget.d.ts","sourceRoot":"","sources":["../src/glsp-vscode-diagram-widget.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"glsp-vscode-diagram-widget.d.ts","sourceRoot":"","sources":["../src/glsp-vscode-diagram-widget.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,8BACsB,uBAAwB,SAAQ,mBAAmB;IACrE,SAAS,CAAC,iBAAiB,IAAI,IAAI;CActC;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C"}
|
|
@@ -1,19 +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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -37,31 +22,25 @@ exports.decodeURI = exports.GLSPVscodeDiagramWidget = void 0;
|
|
|
37
22
|
*
|
|
38
23
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
39
24
|
********************************************************************************/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
function GLSPVscodeDiagramWidget() {
|
|
46
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
47
|
-
}
|
|
48
|
-
GLSPVscodeDiagramWidget.prototype.initializeSprotty = function () {
|
|
25
|
+
const client_1 = require("@eclipse-glsp/client");
|
|
26
|
+
const inversify_1 = require("inversify");
|
|
27
|
+
const sprotty_vscode_webview_1 = require("sprotty-vscode-webview");
|
|
28
|
+
let GLSPVscodeDiagramWidget = class GLSPVscodeDiagramWidget extends sprotty_vscode_webview_1.VscodeDiagramWidget {
|
|
29
|
+
initializeSprotty() {
|
|
49
30
|
if (this.modelSource instanceof client_1.DiagramServer) {
|
|
50
31
|
this.modelSource.clientId = this.diagramIdentifier.clientId;
|
|
51
32
|
}
|
|
52
|
-
this.actionDispatcher.dispatch(new client_1.InitializeClientSessionAction(this.diagramIdentifier.clientId));
|
|
53
33
|
this.actionDispatcher.dispatch(new client_1.RequestModelAction({
|
|
54
34
|
sourceUri: decodeURI(this.diagramIdentifier.uri),
|
|
55
35
|
diagramType: this.diagramIdentifier.diagramType
|
|
56
36
|
}));
|
|
57
37
|
this.actionDispatcher.dispatch(new client_1.RequestTypeHintsAction(this.diagramIdentifier.diagramType));
|
|
58
38
|
this.actionDispatcher.dispatch(new client_1.EnableToolPaletteAction());
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}(sprotty_vscode_webview_1.VscodeDiagramWidget));
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
GLSPVscodeDiagramWidget = __decorate([
|
|
42
|
+
(0, inversify_1.injectable)()
|
|
43
|
+
], GLSPVscodeDiagramWidget);
|
|
65
44
|
exports.GLSPVscodeDiagramWidget = GLSPVscodeDiagramWidget;
|
|
66
45
|
function decodeURI(uri) {
|
|
67
46
|
return decodeURIComponent(uri.replace(/\+/g, ' '));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-vscode-diagram-widget.js","sourceRoot":"","sources":["../src/glsp-vscode-diagram-widget.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"glsp-vscode-diagram-widget.js","sourceRoot":"","sources":["../src/glsp-vscode-diagram-widget.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAA0H;AAC1H,yCAAuC;AACvC,mEAA6D;AAG7D,IAAsB,uBAAuB,GAA7C,MAAsB,uBAAwB,SAAQ,4CAAmB;IAC3D,iBAAiB;QACvB,IAAI,IAAI,CAAC,WAAW,YAAY,sBAAa,EAAE;YAC3C,IAAI,CAAC,WAAW,CAAC,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC;SAC/D;QACD,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAC1B,IAAI,2BAAkB,CAAC;YACnB,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC;YAChD,WAAW,EAAE,IAAI,CAAC,iBAAiB,CAAC,WAAW;SAClD,CAAC,CACL,CAAC;QAEF,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,+BAAsB,CAAC,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC;QAC/F,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,gCAAuB,EAAE,CAAC,CAAC;IAClE,CAAC;CACJ,CAAA;AAfqB,uBAAuB;IAD5C,IAAA,sBAAU,GAAE;GACS,uBAAuB,CAe5C;AAfqB,0DAAuB;AAiB7C,SAAgB,SAAS,CAAC,GAAW;IACjC,OAAO,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;AACvD,CAAC;AAFD,8BAEC"}
|
|
@@ -13,13 +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 { Action, ActionHandlerRegistry, ActionMessage, ComputedBoundsAction, DeleteElementOperation, SetEditModeAction } from '@eclipse-glsp/client';
|
|
16
|
+
import { Action, ActionHandlerRegistry, ActionMessage, ComputedBoundsAction, DeleteElementOperation, ICopyPasteHandler, SetEditModeAction } from '@eclipse-glsp/client';
|
|
17
17
|
import { SelectionService } from '@eclipse-glsp/client/lib/features/select/selection-service';
|
|
18
18
|
import { VscodeDiagramServer } from 'sprotty-vscode-webview';
|
|
19
19
|
export declare const receivedFromServerProperty = "__receivedFromServer";
|
|
20
20
|
export declare const localDispatchProperty = "__localDispatch";
|
|
21
21
|
export declare class GLSPVscodeDiagramServer extends VscodeDiagramServer {
|
|
22
22
|
protected selectionService: SelectionService;
|
|
23
|
+
protected copyPasteHandler: ICopyPasteHandler;
|
|
23
24
|
initialize(registry: ActionHandlerRegistry): void;
|
|
24
25
|
handleLocally(action: Action): boolean;
|
|
25
26
|
protected messageReceived(data: any): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-vscode-diagramserver.d.ts","sourceRoot":"","sources":["../src/glsp-vscode-diagramserver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,MAAM,EACN,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACpB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"glsp-vscode-diagramserver.d.ts","sourceRoot":"","sources":["../src/glsp-vscode-diagramserver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,MAAM,EACN,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EAEtB,iBAAiB,EAIjB,iBAAiB,EACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,4DAA4D,CAAC;AAE9F,OAAO,EAAmB,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE9E,eAAO,MAAM,0BAA0B,yBAAyB,CAAC;AACjE,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AAEvD,qBAAa,uBAAwB,SAAQ,mBAAmB;IACvB,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,SAAS,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;IAEpF,UAAU,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI;IAsBjD,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAUtC,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI;IAe1C,SAAS,CAAC,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAO1D,SAAS,CAAC,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO;IAIrE,SAAS,CAAC,4BAA4B,CAAC,SAAS,EAAE,sBAAsB,GAAG,OAAO;IAOlF,SAAS,CAAC,uBAAuB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO;CAGxE"}
|