@eclipse-glsp/vscode-integration-webview 2.2.0-next.76 → 2.2.0-next.82
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/features/copyPaste/copy-paste-module.d.ts.map +1 -1
- package/lib/features/copyPaste/copy-paste-module.js +0 -3
- package/lib/features/copyPaste/copy-paste-module.js.map +1 -1
- package/lib/features/default/default-module.d.ts.map +1 -1
- package/lib/features/default/default-module.js +1 -4
- package/lib/features/default/default-module.js.map +1 -1
- package/lib/features/default/extension-action-handler.d.ts.map +1 -1
- package/lib/features/default/extension-action-handler.js +1 -2
- package/lib/features/default/extension-action-handler.js.map +1 -1
- package/lib/features/default/vscode-glsp-modelsource.d.ts +10 -3
- package/lib/features/default/vscode-glsp-modelsource.d.ts.map +1 -1
- package/lib/features/default/vscode-glsp-modelsource.js +8 -16
- package/lib/features/default/vscode-glsp-modelsource.js.map +1 -1
- package/package.json +3 -5
- package/src/features/copyPaste/copy-paste-module.ts +1 -12
- package/src/features/default/default-module.ts +2 -5
- package/src/features/default/extension-action-handler.ts +1 -2
- package/src/features/default/vscode-glsp-modelsource.ts +12 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-paste-module.d.ts","sourceRoot":"","sources":["../../../src/features/copyPaste/copy-paste-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,
|
|
1
|
+
{"version":3,"file":"copy-paste-module.d.ts","sourceRoot":"","sources":["../../../src/features/copyPaste/copy-paste-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,aAAa,EAA4D,MAAM,sBAAsB,CAAC;AAG/G,eAAO,MAAM,qBAAqB,eAQjC,CAAC"}
|
|
@@ -17,12 +17,9 @@
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.vscodeCopyPasteModule = void 0;
|
|
19
19
|
const client_1 = require("@eclipse-glsp/client");
|
|
20
|
-
const extension_action_handler_1 = require("../default/extension-action-handler");
|
|
21
20
|
const copy_paste_startup_1 = require("./copy-paste-startup");
|
|
22
21
|
exports.vscodeCopyPasteModule = new client_1.FeatureModule(bind => {
|
|
23
22
|
bind(copy_paste_startup_1.CopyPasteHandlerProvider).toProvider(ctx => () => new Promise(resolve => resolve(ctx.container.get(client_1.TYPES.ICopyPasteHandler))));
|
|
24
23
|
(0, client_1.bindAsService)(bind, client_1.TYPES.IDiagramStartup, copy_paste_startup_1.CopyPasteStartup);
|
|
25
|
-
bind(extension_action_handler_1.ExtensionActionKind).toConstantValue(client_1.RequestClipboardDataAction.KIND);
|
|
26
|
-
bind(extension_action_handler_1.ExtensionActionKind).toConstantValue(client_1.SetClipboardDataAction.KIND);
|
|
27
24
|
}, { requires: client_1.copyPasteModule });
|
|
28
25
|
//# sourceMappingURL=copy-paste-module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-paste-module.js","sourceRoot":"","sources":["../../../src/features/copyPaste/copy-paste-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,
|
|
1
|
+
{"version":3,"file":"copy-paste-module.js","sourceRoot":"","sources":["../../../src/features/copyPaste/copy-paste-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,iDAA+G;AAC/G,6DAAkF;AAErE,QAAA,qBAAqB,GAAG,IAAI,sBAAa,CAClD,IAAI,CAAC,EAAE;IACH,IAAI,CAAC,6CAAwB,CAAC,CAAC,UAAU,CACrC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,IAAI,OAAO,CAAoB,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAoB,cAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,CACjI,CAAC;IACF,IAAA,sBAAa,EAAC,IAAI,EAAE,cAAK,CAAC,eAAe,EAAE,qCAAgB,CAAC,CAAC;AACjE,CAAC,EACD,EAAE,QAAQ,EAAE,wBAAe,EAAE,CAChC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-module.d.ts","sourceRoot":"","sources":["../../../src/features/default/default-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"default-module.d.ts","sourceRoot":"","sources":["../../../src/features/default/default-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,aAAa,EAAqD,MAAM,sBAAsB,CAAC;AAIxG,eAAO,MAAM,mBAAmB,eAQ/B,CAAC"}
|
|
@@ -19,12 +19,9 @@ exports.vscodeDefaultModule = void 0;
|
|
|
19
19
|
const client_1 = require("@eclipse-glsp/client");
|
|
20
20
|
const glsp_diagram_widget_1 = require("../../glsp-diagram-widget");
|
|
21
21
|
const extension_action_handler_1 = require("./extension-action-handler");
|
|
22
|
-
|
|
23
|
-
exports.vscodeDefaultModule = new client_1.FeatureModule((bind, _unbind, _isBound, rebind) => {
|
|
22
|
+
exports.vscodeDefaultModule = new client_1.FeatureModule(bind => {
|
|
24
23
|
bind(glsp_diagram_widget_1.GLSPDiagramWidget).toSelf().inSingletonScope();
|
|
25
24
|
bind(glsp_diagram_widget_1.GLSPDiagramWidgetFactory).toFactory(context => () => context.container.get(glsp_diagram_widget_1.GLSPDiagramWidget));
|
|
26
|
-
bind(vscode_glsp_modelsource_1.VsCodeGLSPModelSource).toSelf().inSingletonScope();
|
|
27
|
-
rebind(client_1.GLSPModelSource).toService(vscode_glsp_modelsource_1.VsCodeGLSPModelSource);
|
|
28
25
|
(0, client_1.bindAsService)(bind, client_1.TYPES.IActionHandlerInitializer, extension_action_handler_1.HostExtensionActionHandler);
|
|
29
26
|
bind(extension_action_handler_1.ExtensionActionKind).toConstantValue(client_1.SelectAction.KIND);
|
|
30
27
|
}, { requires: client_1.defaultModule });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-module.js","sourceRoot":"","sources":["../../../src/features/default/default-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,
|
|
1
|
+
{"version":3,"file":"default-module.js","sourceRoot":"","sources":["../../../src/features/default/default-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,iDAAwG;AACxG,mEAAwF;AACxF,yEAA6F;AAEhF,QAAA,mBAAmB,GAAG,IAAI,sBAAa,CAChD,IAAI,CAAC,EAAE;IACH,IAAI,CAAC,uCAAiB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACpD,IAAI,CAAC,8CAAwB,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAoB,uCAAiB,CAAC,CAAC,CAAC;IACvH,IAAA,sBAAa,EAAC,IAAI,EAAE,cAAK,CAAC,yBAAyB,EAAE,qDAA0B,CAAC,CAAC;IACjF,IAAI,CAAC,8CAAmB,CAAC,CAAC,eAAe,CAAC,qBAAY,CAAC,IAAI,CAAC,CAAC;AACjE,CAAC,EACD,EAAE,QAAQ,EAAE,sBAAa,EAAE,CAC9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension-action-handler.d.ts","sourceRoot":"","sources":["../../../src/features/default/extension-action-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,MAAM,EACN,qBAAqB,EACrB,UAAU,EACV,cAAc,EACd,yBAAyB,EACzB,QAAQ,EACR,eAAe,EAElB,MAAM,sBAAsB,CAAC;AAG9B;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,eAAgC,CAAC;AAEjE;;;;GAIG;AACH,qBACa,0BAA2B,YAAW,cAAc,EAAE,yBAAyB;IAGxF,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,CAAM;IAGrC,SAAS,CAAC,cAAc,EAAE,eAAe,CAAC;IAE1C,SAAS,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC;IAGlC,SAAS,CAAC,aAAa,IAAI,IAAI;IAI/B,UAAU,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI;IAIjD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,QAAQ;
|
|
1
|
+
{"version":3,"file":"extension-action-handler.d.ts","sourceRoot":"","sources":["../../../src/features/default/extension-action-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,MAAM,EACN,qBAAqB,EACrB,UAAU,EACV,cAAc,EACd,yBAAyB,EACzB,QAAQ,EACR,eAAe,EAElB,MAAM,sBAAsB,CAAC;AAG9B;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,eAAgC,CAAC;AAEjE;;;;GAIG;AACH,qBACa,0BAA2B,YAAW,cAAc,EAAE,yBAAyB;IAGxF,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,CAAM;IAGrC,SAAS,CAAC,cAAc,EAAE,eAAe,CAAC;IAE1C,SAAS,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC;IAGlC,SAAS,CAAC,aAAa,IAAI,IAAI;IAI/B,UAAU,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI;IAIjD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,QAAQ;CASnD"}
|
|
@@ -56,8 +56,7 @@ let HostExtensionActionHandler = class HostExtensionActionHandler {
|
|
|
56
56
|
if (this.actionKinds.includes(action.kind)) {
|
|
57
57
|
const message = {
|
|
58
58
|
clientId: this.diagramOptions.clientId,
|
|
59
|
-
action
|
|
60
|
-
__localDispatch: true
|
|
59
|
+
action
|
|
61
60
|
};
|
|
62
61
|
(_a = this.glspClient) === null || _a === void 0 ? void 0 : _a.sendActionMessage(message);
|
|
63
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension-action-handler.js","sourceRoot":"","sources":["../../../src/features/default/extension-action-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAS8B;AAC9B,yCAAqF;AAErF;;;;;;;GAOG;AACU,QAAA,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAEjE;;;;GAIG;AAEI,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAAhC;QAGO,gBAAW,GAAa,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"extension-action-handler.js","sourceRoot":"","sources":["../../../src/features/default/extension-action-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAS8B;AAC9B,yCAAqF;AAErF;;;;;;;GAOG;AACU,QAAA,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAEjE;;;;GAIG;AAEI,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAAhC;QAGO,gBAAW,GAAa,EAAE,CAAC;IAyBzC,CAAC;IAjBa,aAAa;QACnB,IAAI,CAAC,cAAc,CAAC,kBAAkB,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,CAAC,CAAC;IAChG,CAAC;IAED,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,cAAc,CAAC,QAAQ;gBACtC,MAAM;aACT,CAAC;YACF,MAAA,IAAI,CAAC,UAAU,0CAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;SAC/C;IACL,CAAC;CACJ,CAAA;AA5BY,gEAA0B;AAGzB;IAFT,IAAA,uBAAW,EAAC,2BAAmB,CAAC;IAChC,IAAA,oBAAQ,GAAE;;+DAC0B;AAG3B;IADT,IAAA,kBAAM,EAAC,cAAK,CAAC,eAAe,CAAC;;kEACY;AAKhC;IADT,IAAA,yBAAa,GAAE;;;;+DAGf;qCAbQ,0BAA0B;IADtC,IAAA,sBAAU,GAAE;GACA,0BAA0B,CA4BtC"}
|
|
@@ -13,28 +13,35 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { Action,
|
|
16
|
+
import { Action, GLSPModelSource } from '@eclipse-glsp/client';
|
|
17
17
|
/**
|
|
18
18
|
* A helper interface that allows the webview to mark actions that have been received directly from the vscode extension
|
|
19
19
|
* (i.e. they are not forwarded to the GLSP Server).
|
|
20
|
+
*
|
|
21
|
+
* @deprecated The concept of marking actions as locally dispatched `ExtensionAction`s is no longer necessary and usage is discouraged.
|
|
20
22
|
*/
|
|
21
23
|
export interface ExtensionAction extends Action {
|
|
22
24
|
__localDispatch: true;
|
|
23
25
|
}
|
|
24
26
|
export declare namespace ExtensionAction {
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated The concept of marking actions as locally dispatched `ExtensionAction`s is no longer necessary and usage is discouraged.
|
|
29
|
+
* */
|
|
25
30
|
function is(object: unknown): object is ExtensionAction;
|
|
26
31
|
/**
|
|
27
32
|
* Mark the given action as {@link ServerAction} by attaching the "_receivedFromServer" property
|
|
28
33
|
* @param action The action that should be marked as server action
|
|
34
|
+
*
|
|
35
|
+
* @deprecated The concept of marking actions as locally dispatched `ExtensionAction`s is no longer necessary and usage is discouraged.
|
|
29
36
|
*/
|
|
30
37
|
function mark(action: Action): void;
|
|
31
38
|
}
|
|
32
39
|
/**
|
|
33
40
|
* Customization of the default {@link GLSPModelSource} for the vscode integration.
|
|
34
41
|
* Also takes locally dispatched actions (i.e. actions that are originating from or intended for the host extension) into consideration.
|
|
42
|
+
*
|
|
43
|
+
* @deprecated A customized model source is no longer necessary. Use the default {@link GLSPModelSource} instead.
|
|
35
44
|
*/
|
|
36
45
|
export declare class VsCodeGLSPModelSource extends GLSPModelSource {
|
|
37
|
-
protected messageReceived(message: ActionMessage): void;
|
|
38
|
-
protected checkMessageOrigin(message: ActionMessage): void;
|
|
39
46
|
}
|
|
40
47
|
//# sourceMappingURL=vscode-glsp-modelsource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vscode-glsp-modelsource.d.ts","sourceRoot":"","sources":["../../../src/features/default/vscode-glsp-modelsource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;
|
|
1
|
+
{"version":3,"file":"vscode-glsp-modelsource.d.ts","sourceRoot":"","sources":["../../../src/features/default/vscode-glsp-modelsource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG/D;;;;;GAKG;AACH,MAAM,WAAW,eAAgB,SAAQ,MAAM;IAC3C,eAAe,EAAE,IAAI,CAAC;CACzB;AAED,yBAAiB,eAAe,CAAC;IAC7B;;SAEK;IACL,SAAgB,EAAE,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,eAAe,CAE7D;IAED;;;;;OAKG;IACH,SAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEzC;CACJ;AAED;;;;;GAKG;AACH,qBACa,qBAAsB,SAAQ,eAAe;CAAG"}
|
|
@@ -22,10 +22,14 @@ exports.VsCodeGLSPModelSource = exports.ExtensionAction = void 0;
|
|
|
22
22
|
*
|
|
23
23
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
24
24
|
********************************************************************************/
|
|
25
|
+
/* eslint-disable deprecation/deprecation */
|
|
25
26
|
const client_1 = require("@eclipse-glsp/client");
|
|
26
27
|
const inversify_1 = require("inversify");
|
|
27
28
|
var ExtensionAction;
|
|
28
29
|
(function (ExtensionAction) {
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated The concept of marking actions as locally dispatched `ExtensionAction`s is no longer necessary and usage is discouraged.
|
|
32
|
+
* */
|
|
29
33
|
function is(object) {
|
|
30
34
|
return client_1.Action.is(object) && '__localDispatch' in object && object.__localDispatch === true;
|
|
31
35
|
}
|
|
@@ -33,6 +37,8 @@ var ExtensionAction;
|
|
|
33
37
|
/**
|
|
34
38
|
* Mark the given action as {@link ServerAction} by attaching the "_receivedFromServer" property
|
|
35
39
|
* @param action The action that should be marked as server action
|
|
40
|
+
*
|
|
41
|
+
* @deprecated The concept of marking actions as locally dispatched `ExtensionAction`s is no longer necessary and usage is discouraged.
|
|
36
42
|
*/
|
|
37
43
|
function mark(action) {
|
|
38
44
|
action.__localDispatch = true;
|
|
@@ -42,24 +48,10 @@ var ExtensionAction;
|
|
|
42
48
|
/**
|
|
43
49
|
* Customization of the default {@link GLSPModelSource} for the vscode integration.
|
|
44
50
|
* Also takes locally dispatched actions (i.e. actions that are originating from or intended for the host extension) into consideration.
|
|
51
|
+
*
|
|
52
|
+
* @deprecated A customized model source is no longer necessary. Use the default {@link GLSPModelSource} instead.
|
|
45
53
|
*/
|
|
46
54
|
let VsCodeGLSPModelSource = class VsCodeGLSPModelSource extends client_1.GLSPModelSource {
|
|
47
|
-
messageReceived(message) {
|
|
48
|
-
if (this.clientId !== message.clientId) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
this.checkMessageOrigin(message);
|
|
52
|
-
const action = message.action;
|
|
53
|
-
this.logger.log(this, 'receiving', action);
|
|
54
|
-
this.actionDispatcher.dispatch(action);
|
|
55
|
-
}
|
|
56
|
-
checkMessageOrigin(message) {
|
|
57
|
-
var _a;
|
|
58
|
-
const isLocalDispatch = (_a = message['__localDispatch']) !== null && _a !== void 0 ? _a : false;
|
|
59
|
-
if (!isLocalDispatch) {
|
|
60
|
-
client_1.ServerAction.mark(message.action);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
55
|
};
|
|
64
56
|
exports.VsCodeGLSPModelSource = VsCodeGLSPModelSource;
|
|
65
57
|
exports.VsCodeGLSPModelSource = VsCodeGLSPModelSource = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vscode-glsp-modelsource.js","sourceRoot":"","sources":["../../../src/features/default/vscode-glsp-modelsource.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,
|
|
1
|
+
{"version":3,"file":"vscode-glsp-modelsource.js","sourceRoot":"","sources":["../../../src/features/default/vscode-glsp-modelsource.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,4CAA4C;AAC5C,iDAA+D;AAC/D,yCAAuC;AAYvC,IAAiB,eAAe,CAiB/B;AAjBD,WAAiB,eAAe;IAC5B;;SAEK;IACL,SAAgB,EAAE,CAAC,MAAe;QAC9B,OAAO,eAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,iBAAiB,IAAI,MAAM,IAAI,MAAM,CAAC,eAAe,KAAK,IAAI,CAAC;IAC/F,CAAC;IAFe,kBAAE,KAEjB,CAAA;IAED;;;;;OAKG;IACH,SAAgB,IAAI,CAAC,MAAc;QAC9B,MAA0B,CAAC,eAAe,GAAG,IAAI,CAAC;IACvD,CAAC;IAFe,oBAAI,OAEnB,CAAA;AACL,CAAC,EAjBgB,eAAe,+BAAf,eAAe,QAiB/B;AAED;;;;;GAKG;AAEI,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,wBAAe;CAAG,CAAA;AAAhD,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,sBAAU,GAAE;GACA,qBAAqB,CAA2B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-glsp/vscode-integration-webview",
|
|
3
|
-
"version": "2.2.0-next.
|
|
3
|
+
"version": "2.2.0-next.82+f6a13d3",
|
|
4
4
|
"description": "Integration of a GLSP diagram in a VS Code extensions (WebView part)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vscode",
|
|
@@ -37,12 +37,10 @@
|
|
|
37
37
|
"build": "tsc -b",
|
|
38
38
|
"clean": "rimraf lib tsconfig.tsbuildinfo ",
|
|
39
39
|
"lint": "eslint --ext .ts,.tsx ./src",
|
|
40
|
-
"lint:ci": "yarn lint -o eslint.xml -f checkstyle",
|
|
41
|
-
"prepare": "yarn clean && yarn build",
|
|
42
40
|
"watch": "tsc -w"
|
|
43
41
|
},
|
|
44
42
|
"dependencies": {
|
|
45
|
-
"@eclipse-glsp/client": "
|
|
43
|
+
"@eclipse-glsp/client": "next",
|
|
46
44
|
"vscode-messenger-webview": "^0.4.5"
|
|
47
45
|
},
|
|
48
46
|
"devDependencies": {
|
|
@@ -51,5 +49,5 @@
|
|
|
51
49
|
"publishConfig": {
|
|
52
50
|
"access": "public"
|
|
53
51
|
},
|
|
54
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "f6a13d32b3c55a302a82f8421f2a155090286a40"
|
|
55
53
|
}
|
|
@@ -14,16 +14,7 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
FeatureModule,
|
|
19
|
-
ICopyPasteHandler,
|
|
20
|
-
RequestClipboardDataAction,
|
|
21
|
-
SetClipboardDataAction,
|
|
22
|
-
TYPES,
|
|
23
|
-
bindAsService,
|
|
24
|
-
copyPasteModule
|
|
25
|
-
} from '@eclipse-glsp/client';
|
|
26
|
-
import { ExtensionActionKind } from '../default/extension-action-handler';
|
|
17
|
+
import { FeatureModule, ICopyPasteHandler, TYPES, bindAsService, copyPasteModule } from '@eclipse-glsp/client';
|
|
27
18
|
import { CopyPasteHandlerProvider, CopyPasteStartup } from './copy-paste-startup';
|
|
28
19
|
|
|
29
20
|
export const vscodeCopyPasteModule = new FeatureModule(
|
|
@@ -32,8 +23,6 @@ export const vscodeCopyPasteModule = new FeatureModule(
|
|
|
32
23
|
ctx => () => new Promise<ICopyPasteHandler>(resolve => resolve(ctx.container.get<ICopyPasteHandler>(TYPES.ICopyPasteHandler)))
|
|
33
24
|
);
|
|
34
25
|
bindAsService(bind, TYPES.IDiagramStartup, CopyPasteStartup);
|
|
35
|
-
bind(ExtensionActionKind).toConstantValue(RequestClipboardDataAction.KIND);
|
|
36
|
-
bind(ExtensionActionKind).toConstantValue(SetClipboardDataAction.KIND);
|
|
37
26
|
},
|
|
38
27
|
{ requires: copyPasteModule }
|
|
39
28
|
);
|
|
@@ -14,17 +14,14 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
import { FeatureModule,
|
|
17
|
+
import { FeatureModule, SelectAction, TYPES, bindAsService, defaultModule } from '@eclipse-glsp/client';
|
|
18
18
|
import { GLSPDiagramWidget, GLSPDiagramWidgetFactory } from '../../glsp-diagram-widget';
|
|
19
19
|
import { ExtensionActionKind, HostExtensionActionHandler } from './extension-action-handler';
|
|
20
|
-
import { VsCodeGLSPModelSource } from './vscode-glsp-modelsource';
|
|
21
20
|
|
|
22
21
|
export const vscodeDefaultModule = new FeatureModule(
|
|
23
|
-
|
|
22
|
+
bind => {
|
|
24
23
|
bind(GLSPDiagramWidget).toSelf().inSingletonScope();
|
|
25
24
|
bind(GLSPDiagramWidgetFactory).toFactory(context => () => context.container.get<GLSPDiagramWidget>(GLSPDiagramWidget));
|
|
26
|
-
bind(VsCodeGLSPModelSource).toSelf().inSingletonScope();
|
|
27
|
-
rebind(GLSPModelSource).toService(VsCodeGLSPModelSource);
|
|
28
25
|
bindAsService(bind, TYPES.IActionHandlerInitializer, HostExtensionActionHandler);
|
|
29
26
|
bind(ExtensionActionKind).toConstantValue(SelectAction.KIND);
|
|
30
27
|
},
|
|
@@ -64,8 +64,7 @@ export class HostExtensionActionHandler implements IActionHandler, IActionHandle
|
|
|
64
64
|
if (this.actionKinds.includes(action.kind)) {
|
|
65
65
|
const message = {
|
|
66
66
|
clientId: this.diagramOptions.clientId,
|
|
67
|
-
action
|
|
68
|
-
__localDispatch: true
|
|
67
|
+
action
|
|
69
68
|
};
|
|
70
69
|
this.glspClient?.sendActionMessage(message);
|
|
71
70
|
}
|
|
@@ -13,18 +13,24 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
|
|
16
|
+
/* eslint-disable deprecation/deprecation */
|
|
17
|
+
import { Action, GLSPModelSource } from '@eclipse-glsp/client';
|
|
17
18
|
import { injectable } from 'inversify';
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* A helper interface that allows the webview to mark actions that have been received directly from the vscode extension
|
|
21
22
|
* (i.e. they are not forwarded to the GLSP Server).
|
|
23
|
+
*
|
|
24
|
+
* @deprecated The concept of marking actions as locally dispatched `ExtensionAction`s is no longer necessary and usage is discouraged.
|
|
22
25
|
*/
|
|
23
26
|
export interface ExtensionAction extends Action {
|
|
24
27
|
__localDispatch: true;
|
|
25
28
|
}
|
|
26
29
|
|
|
27
30
|
export namespace ExtensionAction {
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated The concept of marking actions as locally dispatched `ExtensionAction`s is no longer necessary and usage is discouraged.
|
|
33
|
+
* */
|
|
28
34
|
export function is(object: unknown): object is ExtensionAction {
|
|
29
35
|
return Action.is(object) && '__localDispatch' in object && object.__localDispatch === true;
|
|
30
36
|
}
|
|
@@ -32,6 +38,8 @@ export namespace ExtensionAction {
|
|
|
32
38
|
/**
|
|
33
39
|
* Mark the given action as {@link ServerAction} by attaching the "_receivedFromServer" property
|
|
34
40
|
* @param action The action that should be marked as server action
|
|
41
|
+
*
|
|
42
|
+
* @deprecated The concept of marking actions as locally dispatched `ExtensionAction`s is no longer necessary and usage is discouraged.
|
|
35
43
|
*/
|
|
36
44
|
export function mark(action: Action): void {
|
|
37
45
|
(action as ExtensionAction).__localDispatch = true;
|
|
@@ -41,23 +49,8 @@ export namespace ExtensionAction {
|
|
|
41
49
|
/**
|
|
42
50
|
* Customization of the default {@link GLSPModelSource} for the vscode integration.
|
|
43
51
|
* Also takes locally dispatched actions (i.e. actions that are originating from or intended for the host extension) into consideration.
|
|
52
|
+
*
|
|
53
|
+
* @deprecated A customized model source is no longer necessary. Use the default {@link GLSPModelSource} instead.
|
|
44
54
|
*/
|
|
45
55
|
@injectable()
|
|
46
|
-
export class VsCodeGLSPModelSource extends GLSPModelSource {
|
|
47
|
-
protected override messageReceived(message: ActionMessage): void {
|
|
48
|
-
if (this.clientId !== message.clientId) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
this.checkMessageOrigin(message);
|
|
52
|
-
const action = message.action;
|
|
53
|
-
this.logger.log(this, 'receiving', action);
|
|
54
|
-
this.actionDispatcher.dispatch(action);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
protected checkMessageOrigin(message: ActionMessage): void {
|
|
58
|
-
const isLocalDispatch = (message as any)['__localDispatch'] ?? false;
|
|
59
|
-
if (!isLocalDispatch) {
|
|
60
|
-
ServerAction.mark(message.action);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
56
|
+
export class VsCodeGLSPModelSource extends GLSPModelSource {}
|