@eclipse-glsp/vscode-integration-webview 1.1.0-next.e3c23fc.57 → 1.1.0-next.e5a109d.70
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/README.md +1 -0
- package/lib/default-modules.d.ts +19 -0
- package/lib/default-modules.d.ts.map +1 -0
- package/lib/default-modules.js +27 -0
- package/lib/default-modules.js.map +1 -0
- package/lib/diagram-identifier.d.ts +0 -17
- package/lib/diagram-identifier.d.ts.map +1 -1
- package/lib/diagram-identifier.js +1 -1
- package/lib/diagram-identifier.js.map +1 -1
- package/lib/{copy-paste-handler-provider.js → features/copyPaste/copy-paste-module.d.ts} +4 -6
- package/lib/features/copyPaste/copy-paste-module.d.ts.map +1 -0
- package/lib/features/copyPaste/copy-paste-module.js +28 -0
- package/lib/features/copyPaste/copy-paste-module.js.map +1 -0
- package/lib/{copy-paste-handler-provider.d.ts → features/copyPaste/copy-paste-startup.d.ts} +10 -3
- package/lib/features/copyPaste/copy-paste-startup.d.ts.map +1 -0
- package/lib/features/copyPaste/copy-paste-startup.js +56 -0
- package/lib/features/copyPaste/copy-paste-startup.js.map +1 -0
- package/lib/{services.d.ts → features/default/default-module.d.ts} +4 -10
- package/lib/features/default/default-module.d.ts.map +1 -0
- package/lib/features/default/default-module.js +30 -0
- package/lib/features/default/default-module.js.map +1 -0
- package/lib/{extension-action-handler.d.ts → features/default/extension-action-handler.d.ts} +16 -9
- package/lib/features/default/extension-action-handler.d.ts.map +1 -0
- package/lib/features/default/extension-action-handler.js +85 -0
- package/lib/features/default/extension-action-handler.js.map +1 -0
- package/lib/features/default/vscode-glsp-modelsource.d.ts +40 -0
- package/lib/features/default/vscode-glsp-modelsource.d.ts.map +1 -0
- package/lib/features/default/vscode-glsp-modelsource.js +68 -0
- package/lib/features/default/vscode-glsp-modelsource.js.map +1 -0
- package/lib/features/export/export-module.d.ts +18 -0
- package/lib/features/export/export-module.d.ts.map +1 -0
- package/lib/features/export/export-module.js +24 -0
- package/lib/features/export/export-module.js.map +1 -0
- package/lib/features/navigation/navigation-module.d.ts +18 -0
- package/lib/features/navigation/navigation-module.d.ts.map +1 -0
- package/lib/features/navigation/navigation-module.js +24 -0
- package/lib/features/navigation/navigation-module.js.map +1 -0
- package/lib/glsp-diagram-widget.d.ts +8 -11
- package/lib/glsp-diagram-widget.d.ts.map +1 -1
- package/lib/glsp-diagram-widget.js +20 -68
- package/lib/glsp-diagram-widget.js.map +1 -1
- package/lib/glsp-starter.d.ts +39 -10
- package/lib/glsp-starter.d.ts.map +1 -1
- package/lib/glsp-starter.js +44 -62
- package/lib/glsp-starter.js.map +1 -1
- package/lib/index.d.ts +8 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +23 -19
- package/lib/index.js.map +1 -1
- package/lib/webview-glsp-client.d.ts +56 -0
- package/lib/webview-glsp-client.d.ts.map +1 -0
- package/lib/webview-glsp-client.js +103 -0
- package/lib/webview-glsp-client.js.map +1 -0
- package/package.json +4 -3
- package/src/default-modules.ts +27 -0
- package/src/diagram-identifier.ts +1 -2
- package/src/features/copyPaste/copy-paste-module.ts +39 -0
- package/src/features/copyPaste/copy-paste-startup.ts +50 -0
- package/src/features/default/default-module.ts +31 -0
- package/src/{extension-action-handler.ts → features/default/extension-action-handler.ts} +39 -12
- package/src/features/default/vscode-glsp-modelsource.ts +63 -0
- package/src/{services.ts → features/export/export-module.ts} +6 -10
- package/src/{copy-paste-handler-provider.ts → features/navigation/navigation-module.ts} +6 -8
- package/src/glsp-diagram-widget.ts +22 -79
- package/src/glsp-starter.ts +57 -80
- package/src/index.ts +9 -4
- package/src/webview-glsp-client.ts +132 -0
- package/lib/copy-paste-handler-provider.d.ts.map +0 -1
- package/lib/copy-paste-handler-provider.js.map +0 -1
- package/lib/extension-action-handler.d.ts.map +0 -1
- package/lib/extension-action-handler.js +0 -30
- package/lib/extension-action-handler.js.map +0 -1
- package/lib/glsp-vscode-diagramserver.d.ts +0 -39
- package/lib/glsp-vscode-diagramserver.d.ts.map +0 -1
- package/lib/glsp-vscode-diagramserver.js +0 -126
- package/lib/glsp-vscode-diagramserver.js.map +0 -1
- package/lib/services.d.ts.map +0 -1
- package/lib/services.js +0 -5
- package/lib/services.js.map +0 -1
- package/src/glsp-vscode-diagramserver.ts +0 -131
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-module.js","sourceRoot":"","sources":["../../../src/features/export/export-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,iDAAsE;AACtE,kFAA0E;AAE7D,QAAA,kBAAkB,GAAG,IAAI,sBAAa,CAAC,IAAI,CAAC,EAAE;IACvD,IAAI,CAAC,8CAAmB,CAAC,CAAC,eAAe,CAAC,wBAAe,CAAC,IAAI,CAAC,CAAC;AACpE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023 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 { FeatureModule } from '@eclipse-glsp/client';
|
|
17
|
+
export declare const vscodeNavigationModule: FeatureModule;
|
|
18
|
+
//# sourceMappingURL=navigation-module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-module.d.ts","sourceRoot":"","sources":["../../../src/features/navigation/navigation-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,aAAa,EAAoD,MAAM,sBAAsB,CAAC;AAGvG,eAAO,MAAM,sBAAsB,eAEf,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2023 EclipseSource and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
*
|
|
9
|
+
* This Source Code may also be made available under the following Secondary
|
|
10
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
* with the GNU Classpath Exception which is available at
|
|
13
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
*
|
|
15
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
|
+
********************************************************************************/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.vscodeNavigationModule = void 0;
|
|
19
|
+
const client_1 = require("@eclipse-glsp/client");
|
|
20
|
+
const extension_action_handler_1 = require("../default/extension-action-handler");
|
|
21
|
+
exports.vscodeNavigationModule = new client_1.FeatureModule(bind => {
|
|
22
|
+
bind(extension_action_handler_1.ExtensionActionKind).toConstantValue(client_1.NavigateToExternalTargetAction.KIND);
|
|
23
|
+
}, client_1.navigationModule);
|
|
24
|
+
//# sourceMappingURL=navigation-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-module.js","sourceRoot":"","sources":["../../../src/features/navigation/navigation-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,iDAAuG;AACvG,kFAA0E;AAE7D,QAAA,sBAAsB,GAAG,IAAI,sBAAa,CAAC,IAAI,CAAC,EAAE;IAC3D,IAAI,CAAC,8CAAmB,CAAC,CAAC,eAAe,CAAC,uCAA8B,CAAC,IAAI,CAAC,CAAC;AACnF,CAAC,EAAE,yBAAgB,CAAC,CAAC"}
|
|
@@ -14,22 +14,19 @@
|
|
|
14
14
|
*
|
|
15
15
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
16
|
********************************************************************************/
|
|
17
|
-
import { IActionDispatcher,
|
|
18
|
-
import { GLSPDiagramIdentifier } from './diagram-identifier';
|
|
17
|
+
import { DiagramLoader, DiagramLoadingOptions, IActionDispatcher, IDiagramOptions, ModelSource, ViewerOptions } from '@eclipse-glsp/client';
|
|
19
18
|
export declare const GLSPDiagramWidgetFactory: unique symbol;
|
|
20
19
|
export type GLSPDiagramWidgetFactory = () => GLSPDiagramWidget;
|
|
21
20
|
export declare abstract class GLSPDiagramWidget {
|
|
22
|
-
protected
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
protected actionDispatcher: IActionDispatcher;
|
|
22
|
+
protected modelSource: ModelSource;
|
|
23
|
+
protected diagramOptions: IDiagramOptions;
|
|
25
24
|
protected viewerOptions: ViewerOptions;
|
|
26
|
-
protected
|
|
27
|
-
|
|
25
|
+
protected diagramLoader: DiagramLoader;
|
|
26
|
+
get clientId(): string;
|
|
28
27
|
initialize(): void;
|
|
29
28
|
protected initializeHtml(): void;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
protected removeClasses(element: Element, keep: number): void;
|
|
29
|
+
protected createDiagramLoadingOptions(): DiagramLoadingOptions | undefined;
|
|
30
|
+
loadDiagram(): Promise<void>;
|
|
33
31
|
}
|
|
34
|
-
export declare function decodeURI(uri: string): string;
|
|
35
32
|
//# sourceMappingURL=glsp-diagram-widget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-diagram-widget.d.ts","sourceRoot":"","sources":["../src/glsp-diagram-widget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;kFAekF;AAElF,OAAO,
|
|
1
|
+
{"version":3,"file":"glsp-diagram-widget.d.ts","sourceRoot":"","sources":["../src/glsp-diagram-widget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;kFAekF;AAElF,OAAO,EACH,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,WAAW,EAEX,aAAa,EAChB,MAAM,sBAAsB,CAAC;AAG9B,eAAO,MAAM,wBAAwB,eAAqC,CAAC;AAC3E,MAAM,MAAM,wBAAwB,GAAG,MAAM,iBAAiB,CAAC;AAE/D,8BACsB,iBAAiB;IAEnC,SAAS,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;IAG9C,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC;IAGnC,SAAS,CAAC,cAAc,EAAE,eAAe,CAAC;IAG1C,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IAGvC,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IAEvC,IAAI,QAAQ,IAAI,MAAM,CAErB;IAGD,UAAU,IAAI,IAAI;IAKlB,SAAS,CAAC,cAAc,IAAI,IAAI;IAahC,SAAS,CAAC,2BAA2B,IAAI,qBAAqB,GAAG,SAAS;IAI1E,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;CAG/B"}
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.GLSPDiagramWidget = exports.GLSPDiagramWidgetFactory = void 0;
|
|
13
13
|
/********************************************************************************
|
|
14
14
|
* Copyright (c) 2018 TypeFox and others.
|
|
15
15
|
* Modifications: (c) 2020-2023 EclipseSource and others.
|
|
@@ -29,15 +29,17 @@ exports.decodeURI = exports.GLSPDiagramWidget = exports.GLSPDiagramWidgetFactory
|
|
|
29
29
|
// based on https://github.com/eclipse-sprotty/sprotty-vscode/blob/v0.3.0/sprotty-vscode-webview/src/vscode-diagram-widget.ts
|
|
30
30
|
const client_1 = require("@eclipse-glsp/client");
|
|
31
31
|
const inversify_1 = require("inversify");
|
|
32
|
-
const diagram_identifier_1 = require("./diagram-identifier");
|
|
33
32
|
exports.GLSPDiagramWidgetFactory = Symbol('GLSPDiagramWidgetFactory');
|
|
34
33
|
let GLSPDiagramWidget = class GLSPDiagramWidget {
|
|
34
|
+
get clientId() {
|
|
35
|
+
return this.diagramOptions.clientId;
|
|
36
|
+
}
|
|
35
37
|
initialize() {
|
|
36
38
|
this.initializeHtml();
|
|
37
|
-
this.
|
|
39
|
+
this.loadDiagram();
|
|
38
40
|
}
|
|
39
41
|
initializeHtml() {
|
|
40
|
-
const containerDiv = document.getElementById(this.
|
|
42
|
+
const containerDiv = document.getElementById(this.clientId + '_container');
|
|
41
43
|
if (containerDiv) {
|
|
42
44
|
const svgContainer = document.createElement('div');
|
|
43
45
|
svgContainer.id = this.viewerOptions.baseDiv;
|
|
@@ -45,69 +47,16 @@ let GLSPDiagramWidget = class GLSPDiagramWidget {
|
|
|
45
47
|
const hiddenContainer = document.createElement('div');
|
|
46
48
|
hiddenContainer.id = this.viewerOptions.hiddenDiv;
|
|
47
49
|
document.body.appendChild(hiddenContainer);
|
|
48
|
-
const statusDiv = document.createElement('div');
|
|
49
|
-
statusDiv.setAttribute('class', 'sprotty-status');
|
|
50
|
-
containerDiv.appendChild(statusDiv);
|
|
51
|
-
this.statusIconDiv = document.createElement('div');
|
|
52
|
-
statusDiv.appendChild(this.statusIconDiv);
|
|
53
|
-
this.statusMessageDiv = document.createElement('div');
|
|
54
|
-
this.statusMessageDiv.setAttribute('class', 'sprotty-status-message');
|
|
55
|
-
statusDiv.appendChild(this.statusMessageDiv);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
dispatchInitialActions() {
|
|
59
|
-
if (this.modelSource instanceof client_1.DiagramServerProxy) {
|
|
60
|
-
this.modelSource.clientId = this.diagramIdentifier.clientId;
|
|
61
50
|
}
|
|
62
|
-
this.actionDispatcher.dispatch(client_1.RequestModelAction.create({
|
|
63
|
-
options: {
|
|
64
|
-
sourceUri: decodeURI(this.diagramIdentifier.uri),
|
|
65
|
-
diagramType: this.diagramIdentifier.diagramType
|
|
66
|
-
}
|
|
67
|
-
}));
|
|
68
|
-
this.actionDispatcher.dispatch(client_1.RequestTypeHintsAction.create());
|
|
69
|
-
this.actionDispatcher.dispatch(client_1.EnableToolPaletteAction.create());
|
|
70
51
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
this.removeClasses(this.statusMessageDiv, 1);
|
|
74
|
-
this.statusMessageDiv.classList.add(status.severity.toLowerCase());
|
|
75
|
-
this.removeClasses(this.statusIconDiv, 0);
|
|
76
|
-
const classes = this.statusIconDiv.classList;
|
|
77
|
-
classes.add(status.severity.toLowerCase());
|
|
78
|
-
switch (status.severity) {
|
|
79
|
-
case 'FATAL':
|
|
80
|
-
classes.add('fa');
|
|
81
|
-
classes.add('fa-times-circle');
|
|
82
|
-
break;
|
|
83
|
-
case 'ERROR':
|
|
84
|
-
classes.add('fa');
|
|
85
|
-
classes.add('fa-exclamation-circle');
|
|
86
|
-
break;
|
|
87
|
-
case 'WARNING':
|
|
88
|
-
classes.add('fa');
|
|
89
|
-
classes.add('fa-exclamation-circle');
|
|
90
|
-
break;
|
|
91
|
-
case 'INFO':
|
|
92
|
-
classes.add('fa');
|
|
93
|
-
classes.add('fa-info-circle');
|
|
94
|
-
break;
|
|
95
|
-
}
|
|
52
|
+
createDiagramLoadingOptions() {
|
|
53
|
+
return undefined;
|
|
96
54
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
while (classes.length > keep) {
|
|
100
|
-
const item = classes.item(classes.length - 1);
|
|
101
|
-
if (item) {
|
|
102
|
-
classes.remove(item);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
55
|
+
loadDiagram() {
|
|
56
|
+
return this.diagramLoader.load(this.createDiagramLoadingOptions());
|
|
105
57
|
}
|
|
106
58
|
};
|
|
107
|
-
|
|
108
|
-
(0, inversify_1.inject)(diagram_identifier_1.GLSPDiagramIdentifier),
|
|
109
|
-
__metadata("design:type", Object)
|
|
110
|
-
], GLSPDiagramWidget.prototype, "diagramIdentifier", void 0);
|
|
59
|
+
exports.GLSPDiagramWidget = GLSPDiagramWidget;
|
|
111
60
|
__decorate([
|
|
112
61
|
(0, inversify_1.inject)(client_1.TYPES.IActionDispatcher),
|
|
113
62
|
__metadata("design:type", Object)
|
|
@@ -116,22 +65,25 @@ __decorate([
|
|
|
116
65
|
(0, inversify_1.inject)(client_1.TYPES.ModelSource),
|
|
117
66
|
__metadata("design:type", client_1.ModelSource)
|
|
118
67
|
], GLSPDiagramWidget.prototype, "modelSource", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, inversify_1.inject)(client_1.TYPES.IDiagramOptions),
|
|
70
|
+
__metadata("design:type", Object)
|
|
71
|
+
], GLSPDiagramWidget.prototype, "diagramOptions", void 0);
|
|
119
72
|
__decorate([
|
|
120
73
|
(0, inversify_1.inject)(client_1.TYPES.ViewerOptions),
|
|
121
74
|
__metadata("design:type", Object)
|
|
122
75
|
], GLSPDiagramWidget.prototype, "viewerOptions", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, inversify_1.inject)(client_1.DiagramLoader),
|
|
78
|
+
__metadata("design:type", client_1.DiagramLoader)
|
|
79
|
+
], GLSPDiagramWidget.prototype, "diagramLoader", void 0);
|
|
123
80
|
__decorate([
|
|
124
81
|
(0, inversify_1.postConstruct)(),
|
|
125
82
|
__metadata("design:type", Function),
|
|
126
83
|
__metadata("design:paramtypes", []),
|
|
127
84
|
__metadata("design:returntype", void 0)
|
|
128
85
|
], GLSPDiagramWidget.prototype, "initialize", null);
|
|
129
|
-
GLSPDiagramWidget = __decorate([
|
|
86
|
+
exports.GLSPDiagramWidget = GLSPDiagramWidget = __decorate([
|
|
130
87
|
(0, inversify_1.injectable)()
|
|
131
88
|
], GLSPDiagramWidget);
|
|
132
|
-
exports.GLSPDiagramWidget = GLSPDiagramWidget;
|
|
133
|
-
function decodeURI(uri) {
|
|
134
|
-
return decodeURIComponent(uri.replace(/\+/g, ' '));
|
|
135
|
-
}
|
|
136
|
-
exports.decodeURI = decodeURI;
|
|
137
89
|
//# sourceMappingURL=glsp-diagram-widget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-diagram-widget.js","sourceRoot":"","sources":["../src/glsp-diagram-widget.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;kFAekF;AAClF,6HAA6H;AAC7H,
|
|
1
|
+
{"version":3,"file":"glsp-diagram-widget.js","sourceRoot":"","sources":["../src/glsp-diagram-widget.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;kFAekF;AAClF,6HAA6H;AAC7H,iDAQ8B;AAC9B,yCAA8D;AAEjD,QAAA,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC;AAIpE,IAAe,iBAAiB,GAAhC,MAAe,iBAAiB;IAgBnC,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC;IACxC,CAAC;IAGD,UAAU;QACN,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,EAAE,CAAC;IACvB,CAAC;IAES,cAAc;QACpB,MAAM,YAAY,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,GAAG,YAAY,CAAC,CAAC;QAC3E,IAAI,YAAY,EAAE;YACd,MAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YACnD,YAAY,CAAC,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;YAC7C,YAAY,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;YAEvC,MAAM,eAAe,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YACtD,eAAe,CAAC,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC;YAClD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;SAC9C;IACL,CAAC;IAES,2BAA2B;QACjC,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,WAAW;QACP,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,2BAA2B,EAAE,CAAC,CAAC;IACvE,CAAC;CACJ,CAAA;AA9CqB,8CAAiB;AAEzB;IADT,IAAA,kBAAM,EAAC,cAAK,CAAC,iBAAiB,CAAC;;2DACc;AAGpC;IADT,IAAA,kBAAM,EAAC,cAAK,CAAC,WAAW,CAAC;8BACH,oBAAW;sDAAC;AAGzB;IADT,IAAA,kBAAM,EAAC,cAAK,CAAC,eAAe,CAAC;;yDACY;AAGhC;IADT,IAAA,kBAAM,EAAC,cAAK,CAAC,aAAa,CAAC;;wDACW;AAG7B;IADT,IAAA,kBAAM,EAAC,sBAAa,CAAC;8BACG,sBAAa;wDAAC;AAOvC;IADC,IAAA,yBAAa,GAAE;;;;mDAIf;4BAxBiB,iBAAiB;IADtC,IAAA,sBAAU,GAAE;GACS,iBAAiB,CA8CtC"}
|
package/lib/glsp-starter.d.ts
CHANGED
|
@@ -1,18 +1,47 @@
|
|
|
1
|
-
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2018 TypeFox and others.
|
|
3
|
+
* Modifications: (c) 2020-2023 EclipseSource and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
*
|
|
9
|
+
* This Source Code may also be made available under the following Secondary
|
|
10
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
* with the GNU Classpath Exception which is available at
|
|
13
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
*
|
|
15
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
|
+
********************************************************************************/
|
|
17
|
+
import { ContainerConfiguration } from '@eclipse-glsp/client';
|
|
18
|
+
import { Container, ContainerModule } from 'inversify';
|
|
19
|
+
import { NotificationType } from 'vscode-messenger-common';
|
|
20
|
+
import { Messenger } from 'vscode-messenger-webview';
|
|
2
21
|
import { GLSPDiagramIdentifier } from './diagram-identifier';
|
|
3
|
-
|
|
22
|
+
export declare const WebviewReadyNotification: NotificationType<void>;
|
|
23
|
+
export declare const InitializeNotification: NotificationType<GLSPDiagramIdentifier>;
|
|
4
24
|
export declare abstract class GLSPStarter {
|
|
5
25
|
protected container?: Container;
|
|
6
|
-
protected
|
|
7
|
-
constructor(
|
|
26
|
+
protected messenger: Messenger;
|
|
27
|
+
constructor();
|
|
8
28
|
protected sendReadyMessage(): void;
|
|
9
|
-
protected acceptDiagramIdentifier(): void;
|
|
10
|
-
protected
|
|
11
|
-
protected addVscodeBindings(container: Container, diagramIdentifier: GLSPDiagramIdentifier): void;
|
|
12
|
-
protected configureExtensionActionHandler(container: Container, diagramIdentifier: GLSPDiagramIdentifier): void;
|
|
29
|
+
protected acceptDiagramIdentifier(identifier: GLSPDiagramIdentifier): void;
|
|
30
|
+
protected createDiagramOptionsModule(identifier: GLSPDiagramIdentifier): ContainerModule;
|
|
13
31
|
/**
|
|
14
|
-
*
|
|
32
|
+
* Retrieves additional {@link ContainerConfiguration} for the diagram container.
|
|
33
|
+
* Typically this composes a set of vscode specific customization modules.
|
|
34
|
+
* @returns the container configuration
|
|
15
35
|
*/
|
|
16
|
-
protected
|
|
36
|
+
protected getContainerConfiguration(): ContainerConfiguration;
|
|
37
|
+
protected abstract createContainer(...containerConfiguration: ContainerConfiguration): Container;
|
|
38
|
+
/**
|
|
39
|
+
* Optional hook that can be implemented to customize diagram container bindings before it's used
|
|
40
|
+
* to instantiate the diagram services
|
|
41
|
+
* @param container The diagram container
|
|
42
|
+
* @param diagramIdentifier The diagram identfier
|
|
43
|
+
*/
|
|
44
|
+
protected addVscodeBindings?(container: Container, diagramIdentifier: GLSPDiagramIdentifier): void;
|
|
17
45
|
}
|
|
46
|
+
export declare function decodeURI(uri: string): string;
|
|
18
47
|
//# sourceMappingURL=glsp-starter.d.ts.map
|
|
@@ -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":"AAAA;;;;;;;;;;;;;;;kFAekF;AAElF,OAAO,EAAE,sBAAsB,EAA8B,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAkB,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAa,MAAM,0BAA0B,CAAC;AAEhE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAG7D,eAAO,MAAM,wBAAwB,EAAE,gBAAgB,CAAC,IAAI,CAAuB,CAAC;AACpF,eAAO,MAAM,sBAAsB,EAAE,gBAAgB,CAAC,qBAAqB,CAA4B,CAAC;AAIxG,8BAAsB,WAAW;IAC7B,SAAS,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;IAChC,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC;;IAW/B,SAAS,CAAC,gBAAgB,IAAI,IAAI;IAIlC,SAAS,CAAC,uBAAuB,CAAC,UAAU,EAAE,qBAAqB,GAAG,IAAI;IAe1E,SAAS,CAAC,0BAA0B,CAAC,UAAU,EAAE,qBAAqB,GAAG,eAAe;IAUxF;;;;OAIG;IACH,SAAS,CAAC,yBAAyB,IAAI,sBAAsB;IAI7D,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,GAAG,sBAAsB,EAAE,sBAAsB,GAAG,SAAS;IAEhG;;;;;OAKG;IACH,SAAS,CAAC,iBAAiB,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,qBAAqB,GAAG,IAAI;CACrG;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C"}
|
package/lib/glsp-starter.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GLSPStarter = void 0;
|
|
3
|
+
exports.decodeURI = exports.GLSPStarter = exports.InitializeNotification = exports.WebviewReadyNotification = void 0;
|
|
4
4
|
/********************************************************************************
|
|
5
5
|
* Copyright (c) 2018 TypeFox and others.
|
|
6
6
|
* Modifications: (c) 2020-2023 EclipseSource and others.
|
|
@@ -19,79 +19,61 @@ exports.GLSPStarter = void 0;
|
|
|
19
19
|
********************************************************************************/
|
|
20
20
|
// based on https://github.com/eclipse-sprotty/sprotty-vscode/blob/v0.3.0/sprotty-vscode-webview/src/sprotty-starter.ts
|
|
21
21
|
const client_1 = require("@eclipse-glsp/client");
|
|
22
|
-
const
|
|
22
|
+
const vscode_messenger_common_1 = require("vscode-messenger-common");
|
|
23
|
+
const vscode_messenger_webview_1 = require("vscode-messenger-webview");
|
|
24
|
+
const default_modules_1 = require("./default-modules");
|
|
23
25
|
const diagram_identifier_1 = require("./diagram-identifier");
|
|
24
|
-
const extension_action_handler_1 = require("./extension-action-handler");
|
|
25
26
|
const glsp_diagram_widget_1 = require("./glsp-diagram-widget");
|
|
26
|
-
const
|
|
27
|
-
|
|
27
|
+
const webview_glsp_client_1 = require("./webview-glsp-client");
|
|
28
|
+
exports.WebviewReadyNotification = { method: 'ready' };
|
|
29
|
+
exports.InitializeNotification = { method: 'initialize' };
|
|
28
30
|
class GLSPStarter {
|
|
29
|
-
constructor(
|
|
30
|
-
|
|
31
|
-
this.
|
|
31
|
+
constructor() {
|
|
32
|
+
this.messenger = new vscode_messenger_webview_1.Messenger(acquireVsCodeApi());
|
|
33
|
+
this.messenger.onNotification(exports.InitializeNotification, identifier => this.acceptDiagramIdentifier(identifier));
|
|
34
|
+
this.messenger.start();
|
|
32
35
|
this.sendReadyMessage();
|
|
33
|
-
this.acceptDiagramIdentifier();
|
|
34
36
|
}
|
|
35
37
|
sendReadyMessage() {
|
|
36
|
-
this.
|
|
37
|
-
}
|
|
38
|
-
acceptDiagramIdentifier() {
|
|
39
|
-
console.log('Waiting for diagram identifier...');
|
|
40
|
-
const eventListener = (message) => {
|
|
41
|
-
if ((0, diagram_identifier_1.isDiagramIdentifier)(message.data)) {
|
|
42
|
-
console.log(message);
|
|
43
|
-
if (this.container) {
|
|
44
|
-
const oldIdentifier = this.container.get(diagram_identifier_1.GLSPDiagramIdentifier);
|
|
45
|
-
const newIdentifier = message.data;
|
|
46
|
-
oldIdentifier.diagramType = newIdentifier.diagramType;
|
|
47
|
-
oldIdentifier.uri = newIdentifier.uri;
|
|
48
|
-
const diagramWidget = this.container.get(glsp_diagram_widget_1.GLSPDiagramWidget);
|
|
49
|
-
diagramWidget.dispatchInitialActions();
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
console.log('...received...', message);
|
|
53
|
-
const diagramIdentifier = message.data;
|
|
54
|
-
this.container = this.createContainer(diagramIdentifier);
|
|
55
|
-
this.addVscodeBindings(this.container, diagramIdentifier);
|
|
56
|
-
if (diagramIdentifier.initializeResult) {
|
|
57
|
-
(0, client_1.configureServerActions)(diagramIdentifier.initializeResult, diagramIdentifier.diagramType, this.container);
|
|
58
|
-
}
|
|
59
|
-
this.container.get(glsp_diagram_widget_1.GLSPDiagramWidget);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
window.addEventListener('message', eventListener);
|
|
38
|
+
this.messenger.sendNotification(exports.WebviewReadyNotification, vscode_messenger_common_1.HOST_EXTENSION);
|
|
64
39
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
.
|
|
72
|
-
.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
40
|
+
acceptDiagramIdentifier(identifier) {
|
|
41
|
+
var _a;
|
|
42
|
+
if (this.container) {
|
|
43
|
+
const oldIdentifier = this.container.get(diagram_identifier_1.GLSPDiagramIdentifier);
|
|
44
|
+
oldIdentifier.diagramType = identifier.diagramType;
|
|
45
|
+
oldIdentifier.uri = identifier.uri;
|
|
46
|
+
const diagramWidget = this.container.get(glsp_diagram_widget_1.GLSPDiagramWidget);
|
|
47
|
+
diagramWidget.loadDiagram();
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
const diagramModule = this.createDiagramOptionsModule(identifier);
|
|
51
|
+
this.container = this.createContainer(diagramModule, ...this.getContainerConfiguration());
|
|
52
|
+
(_a = this.addVscodeBindings) === null || _a === void 0 ? void 0 : _a.call(this, this.container, identifier);
|
|
53
|
+
this.container.get(glsp_diagram_widget_1.GLSPDiagramWidget);
|
|
54
|
+
}
|
|
77
55
|
}
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
56
|
+
createDiagramOptionsModule(identifier) {
|
|
57
|
+
const glspClient = new webview_glsp_client_1.WebviewGlspClient({ id: identifier.diagramType, messenger: this.messenger });
|
|
58
|
+
return (0, client_1.createDiagramOptionsModule)({
|
|
59
|
+
clientId: identifier.clientId,
|
|
60
|
+
diagramType: identifier.diagramType,
|
|
61
|
+
glspClientProvider: async () => glspClient,
|
|
62
|
+
sourceUri: decodeURIComponent(identifier.uri)
|
|
63
|
+
});
|
|
82
64
|
}
|
|
83
65
|
/**
|
|
84
|
-
*
|
|
66
|
+
* Retrieves additional {@link ContainerConfiguration} for the diagram container.
|
|
67
|
+
* Typically this composes a set of vscode specific customization modules.
|
|
68
|
+
* @returns the container configuration
|
|
85
69
|
*/
|
|
86
|
-
|
|
87
|
-
return [
|
|
88
|
-
client_1.NavigateToExternalTargetAction.KIND,
|
|
89
|
-
client_1.RequestClipboardDataAction.KIND,
|
|
90
|
-
client_1.SetClipboardDataAction.KIND,
|
|
91
|
-
client_1.SelectAction.KIND,
|
|
92
|
-
client_1.ExportSvgAction.KIND
|
|
93
|
-
];
|
|
70
|
+
getContainerConfiguration() {
|
|
71
|
+
return [default_modules_1.VSCODE_DEFAULT_MODULE_CONFIG];
|
|
94
72
|
}
|
|
95
73
|
}
|
|
96
74
|
exports.GLSPStarter = GLSPStarter;
|
|
75
|
+
function decodeURI(uri) {
|
|
76
|
+
return decodeURIComponent(uri.replace(/\+/g, ' '));
|
|
77
|
+
}
|
|
78
|
+
exports.decodeURI = decodeURI;
|
|
97
79
|
//# 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":";;;AAAA;;;;;;;;;;;;;;;kFAekF;AAClF,uHAAuH;AACvH,
|
|
1
|
+
{"version":3,"file":"glsp-starter.js","sourceRoot":"","sources":["../src/glsp-starter.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;kFAekF;AAClF,uHAAuH;AACvH,iDAA0F;AAE1F,qEAA2E;AAC3E,uEAAgE;AAChE,uDAAiE;AACjE,6DAA6D;AAC7D,+DAA0D;AAC1D,+DAA0D;AAC7C,QAAA,wBAAwB,GAA2B,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AACvE,QAAA,sBAAsB,GAA4C,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;AAIxG,MAAsB,WAAW;IAI7B;QACI,IAAI,CAAC,SAAS,GAAG,IAAI,oCAAS,CAAC,gBAAgB,EAAE,CAAC,CAAC;QACnD,IAAI,CAAC,SAAS,CAAC,cAAc,CAAwB,8BAAsB,EAAE,UAAU,CAAC,EAAE,CACtF,IAAI,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAC3C,CAAC;QACF,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QACvB,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC5B,CAAC;IAES,gBAAgB;QACtB,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,gCAAwB,EAAE,wCAAc,CAAC,CAAC;IAC9E,CAAC;IAES,uBAAuB,CAAC,UAAiC;;QAC/D,IAAI,IAAI,CAAC,SAAS,EAAE;YAChB,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAwB,0CAAqB,CAAC,CAAC;YACvF,aAAa,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;YACnD,aAAa,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC;YACnC,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,uCAAiB,CAAC,CAAC;YAC5D,aAAa,CAAC,WAAW,EAAE,CAAC;SAC/B;aAAM;YACH,MAAM,aAAa,GAAG,IAAI,CAAC,0BAA0B,CAAC,UAAU,CAAC,CAAC;YAClE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,GAAG,IAAI,CAAC,yBAAyB,EAAE,CAAC,CAAC;YAC1F,MAAA,IAAI,CAAC,iBAAiB,qDAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;YACrD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,uCAAiB,CAAC,CAAC;SACzC;IACL,CAAC;IAES,0BAA0B,CAAC,UAAiC;QAClE,MAAM,UAAU,GAAG,IAAI,uCAAiB,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,WAAW,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;QACpG,OAAO,IAAA,mCAA0B,EAAC;YAC9B,QAAQ,EAAE,UAAU,CAAC,QAAQ;YAC7B,WAAW,EAAE,UAAU,CAAC,WAAW;YACnC,kBAAkB,EAAE,KAAK,IAAI,EAAE,CAAC,UAAU;YAC1C,SAAS,EAAE,kBAAkB,CAAC,UAAU,CAAC,GAAG,CAAC;SAChD,CAAC,CAAC;IACP,CAAC;IAED;;;;OAIG;IACO,yBAAyB;QAC/B,OAAO,CAAC,8CAA4B,CAAC,CAAC;IAC1C,CAAC;CAWJ;AA5DD,kCA4DC;AAED,SAAgB,SAAS,CAAC,GAAW;IACjC,OAAO,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;AACvD,CAAC;AAFD,8BAEC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -13,11 +13,15 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
export * from './
|
|
16
|
+
export * from './default-modules';
|
|
17
17
|
export * from './diagram-identifier';
|
|
18
|
-
export * from './
|
|
18
|
+
export * from './features/copyPaste/copy-paste-module';
|
|
19
|
+
export * from './features/copyPaste/copy-paste-startup';
|
|
20
|
+
export * from './features/default/default-module';
|
|
21
|
+
export * from './features/default/vscode-glsp-modelsource';
|
|
22
|
+
export * from './features/export/export-module';
|
|
23
|
+
export * from './features/navigation/navigation-module';
|
|
19
24
|
export * from './glsp-diagram-widget';
|
|
20
25
|
export * from './glsp-starter';
|
|
21
|
-
export * from './glsp-
|
|
22
|
-
export * from './services';
|
|
26
|
+
export * from './webview-glsp-client';
|
|
23
27
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,iCAAiC,CAAC;AAChD,cAAc,yCAAyC,CAAC;AACxD,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
2
|
/********************************************************************************
|
|
18
3
|
* Copyright (c) 2020-2023 EclipseSource and others.
|
|
19
4
|
*
|
|
@@ -29,11 +14,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
14
|
*
|
|
30
15
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
31
16
|
********************************************************************************/
|
|
32
|
-
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
29
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
__exportStar(require("./default-modules"), exports);
|
|
33
33
|
__exportStar(require("./diagram-identifier"), exports);
|
|
34
|
-
__exportStar(require("./
|
|
34
|
+
__exportStar(require("./features/copyPaste/copy-paste-module"), exports);
|
|
35
|
+
__exportStar(require("./features/copyPaste/copy-paste-startup"), exports);
|
|
36
|
+
__exportStar(require("./features/default/default-module"), exports);
|
|
37
|
+
__exportStar(require("./features/default/vscode-glsp-modelsource"), exports);
|
|
38
|
+
__exportStar(require("./features/export/export-module"), exports);
|
|
39
|
+
__exportStar(require("./features/navigation/navigation-module"), exports);
|
|
35
40
|
__exportStar(require("./glsp-diagram-widget"), exports);
|
|
36
41
|
__exportStar(require("./glsp-starter"), exports);
|
|
37
|
-
__exportStar(require("./glsp-
|
|
38
|
-
__exportStar(require("./services"), exports);
|
|
42
|
+
__exportStar(require("./webview-glsp-client"), exports);
|
|
39
43
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;;;;AAElF,oDAAkC;AAClC,uDAAqC;AACrC,yEAAuD;AACvD,0EAAwD;AACxD,oEAAkD;AAClD,6EAA2D;AAC3D,kEAAgD;AAChD,0EAAwD;AACxD,wDAAsC;AACtC,iDAA+B;AAC/B,wDAAsC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023 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 { Action, ActionMessage, ActionMessageHandler, ClientState, Disposable, DisposableCollection, DisposeClientSessionParameters, Emitter, Event, GLSPClient, InitializeClientSessionParameters, InitializeParameters, InitializeResult } from '@eclipse-glsp/client';
|
|
17
|
+
import { NotificationType, RequestType } from 'vscode-messenger-common';
|
|
18
|
+
import { Messenger } from 'vscode-messenger-webview';
|
|
19
|
+
export interface WebviewGlspClientOptions extends GLSPClient.Options {
|
|
20
|
+
messenger?: Messenger;
|
|
21
|
+
}
|
|
22
|
+
export declare const ActionMessageNotification: NotificationType<ActionMessage>;
|
|
23
|
+
export declare const StartRequest: RequestType<undefined, void>;
|
|
24
|
+
export declare const InitializeServerRequest: RequestType<InitializeParameters, InitializeResult>;
|
|
25
|
+
export declare const InitializeClientSessionRequest: RequestType<InitializeClientSessionParameters, void>;
|
|
26
|
+
export declare const DisposeClientSessionRequest: RequestType<DisposeClientSessionParameters, void>;
|
|
27
|
+
export declare const ShutdownServerNotification: NotificationType<void>;
|
|
28
|
+
export declare const StopRequest: RequestType<undefined, void>;
|
|
29
|
+
/**
|
|
30
|
+
* GLSP client implementation for the diagram webview. This is proxy implementation
|
|
31
|
+
* that communicates with the actual GLSP client running in the host extension.
|
|
32
|
+
* via the vscode-messenger protocol
|
|
33
|
+
*/
|
|
34
|
+
export declare class WebviewGlspClient implements GLSPClient, Disposable {
|
|
35
|
+
readonly id: string;
|
|
36
|
+
protected messenger: Messenger;
|
|
37
|
+
protected toDispose: DisposableCollection;
|
|
38
|
+
protected onActionMessageEmitter: Emitter<ActionMessage<Action>>;
|
|
39
|
+
protected _currentState: ClientState;
|
|
40
|
+
get currentState(): ClientState;
|
|
41
|
+
protected _initializeResult?: InitializeResult;
|
|
42
|
+
get initializeResult(): InitializeResult | undefined;
|
|
43
|
+
protected onServerInitializedEmitter: Emitter<InitializeResult>;
|
|
44
|
+
get onServerInitialized(): Event<InitializeResult>;
|
|
45
|
+
constructor(options: WebviewGlspClientOptions);
|
|
46
|
+
start(): Promise<void>;
|
|
47
|
+
initializeServer(params: InitializeParameters): Promise<InitializeResult>;
|
|
48
|
+
initializeClientSession(params: InitializeClientSessionParameters): Promise<void>;
|
|
49
|
+
disposeClientSession(params: DisposeClientSessionParameters): Promise<void>;
|
|
50
|
+
shutdownServer(): void;
|
|
51
|
+
stop(): Promise<void>;
|
|
52
|
+
sendActionMessage(message: ActionMessage<Action>): void;
|
|
53
|
+
onActionMessage(handler: ActionMessageHandler): Disposable;
|
|
54
|
+
dispose(): void;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=webview-glsp-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webview-glsp-client.d.ts","sourceRoot":"","sources":["../src/webview-glsp-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EACH,MAAM,EACN,aAAa,EACb,oBAAoB,EACpB,WAAW,EACX,UAAU,EACV,oBAAoB,EACpB,8BAA8B,EAC9B,OAAO,EACP,KAAK,EACL,UAAU,EACV,iCAAiC,EACjC,oBAAoB,EACpB,gBAAgB,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAkB,gBAAgB,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,MAAM,WAAW,wBAAyB,SAAQ,UAAU,CAAC,OAAO;IAChE,SAAS,CAAC,EAAE,SAAS,CAAC;CACzB;AAED,eAAO,MAAM,yBAAyB,EAAE,gBAAgB,CAAC,aAAa,CAA+B,CAAC;AACtG,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,SAAS,EAAE,IAAI,CAAuB,CAAC;AAC9E,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,oBAAoB,EAAE,gBAAgB,CAAkC,CAAC;AAC3H,eAAO,MAAM,8BAA8B,EAAE,WAAW,CAAC,iCAAiC,EAAE,IAAI,CAAyC,CAAC;AAC1I,eAAO,MAAM,2BAA2B,EAAE,WAAW,CAAC,8BAA8B,EAAE,IAAI,CAAsC,CAAC;AACjI,eAAO,MAAM,0BAA0B,EAAE,gBAAgB,CAAC,IAAI,CAAgC,CAAC;AAC/F,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,SAAS,EAAE,IAAI,CAAsB,CAAC;AAC5E;;;;GAIG;AACH,qBAAa,iBAAkB,YAAW,UAAU,EAAE,UAAU;IAC5D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC;IAC/B,SAAS,CAAC,SAAS,uBAA8B;IACjD,SAAS,CAAC,sBAAsB,iCAAgC;IAEhE,SAAS,CAAC,aAAa,EAAE,WAAW,CAAwB;IAC5D,IAAI,YAAY,IAAI,WAAW,CAE9B;IAED,SAAS,CAAC,iBAAiB,CAAC,EAAE,gBAAgB,CAAC;IAC/C,IAAI,gBAAgB,IAAI,gBAAgB,GAAG,SAAS,CAEnD;IAED,SAAS,CAAC,0BAA0B,4BAAmC;IACvE,IAAI,mBAAmB,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAEjD;gBAEW,OAAO,EAAE,wBAAwB;IAOvC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAWtB,gBAAgB,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAU/E,uBAAuB,CAAC,MAAM,EAAE,iCAAiC,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjF,oBAAoB,CAAC,MAAM,EAAE,8BAA8B,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3E,cAAc,IAAI,IAAI;IAIhB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAS3B,iBAAiB,CAAC,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,IAAI;IAIvD,eAAe,CAAC,OAAO,EAAE,oBAAoB,GAAG,UAAU;IAI1D,OAAO,IAAI,IAAI;CAGlB"}
|